regify init

Prepare your project for registry generation.

The init command creates a regify.json configuration file in your root directory. This file is the source of truth for your component registry.

What it does

  • Configuration SetupSets up default values for your registry json files
  • Output DirectorySpecifies where your generated registry JSON files will be stored.
  • Dependency MappingAllows you to map local registryDependencies to their remote registry URLs.
  • Base PathSets a default base path for your component source files (e.g., 'src/components').
  • // 👉 regify.json - your config file
    {
        ...
        basePath: "src/components"
        ...
        registryDependencies: [
            "btn-provider": "https://r.yourdomain.com/r/btn-provider.json",  // 👉 your remote registry json files, you can add as many files as you want	
            ...
        ]
        ...
    }
    
    // 👉 Now it will be used like this in your generate registry json
    {
        "name": "button",
        "type": "registry:ui",
        ...
        "registryDependencies": [
            "https://r.yourdomain.com/r/btn-provider.json",  // 👉 your remote registry json files
        ],
        "files": [
            {
            "path": "src/components/button", // 👉 basePath + "/button"
            "content": ""use client" ...", // content of your component file
            "type": "registry:ui"
            }
        ]
    }

Usage

regify init