Configuration file
Reference for the project configuration file format.
The croct.json file stores the project configuration, including organization and workspace identifiers, application mappings, locale settings, and directory paths. The CLI creates this file when you run the init command.
Example
Here is a typical configuration file:
{ "$schema": "https://schema.croct.com/json/v1/project.json", "organization": "acme", "workspace": "default", "applications": { "development": "my-app-dev", "production": "my-app" }, "defaultLocale": "en", "locales": [ "en", "pt-br" ], "slots": {}, "components": {}, "paths": { "source": "src", "components": "src/components" }}Properties
The following list describes the properties of the configuration file:
- $schema(optional)string
The URL of the JSON Schema for validation and autocomplete in editors.
Set this to https://schema.croct.com/json/v1/project.json to enable autocomplete and validation in editors that support JSON Schema.
- organizationstring
The ID of the organization that owns the project.
- workspacestring
The ID of the workspace associated with the project.
- applicationsobject
The application IDs mapped to the project.
- developmentstring
The ID of the development application.
- production(optional)string
The ID of the production application.
- development
- defaultLocalestring
The default locale for the project, for example en or pt-br.
- localesArray<string>
The list of locales supported by the project.
- slotsRecord<string,string>
A mapping of slot identifiers to version specifiers. The CLI manages this property automatically when you add or remove slots.
The version specifier controls which versions get type definitions and fallback content.
- componentsRecord<string,string>
A mapping of component identifiers to version specifiers. The CLI manages this property automatically when you add or remove components.
The version specifier controls which versions get type definitions.
- paths(optional)object
Custom directory paths for the project. When omitted, the CLI auto-detects paths based on the project structure.
Templates use these paths to know where to place generated code in the project. For example, a template that downloads a UI component uses the components path to determine the destination directory.
- source(optional)string
The root directory for application source code, for example src.
Auto-detected based on the recognized project type and conventions.
- utilities(optional)string
The directory for helper modules and shared code, for example src/lib.
Auto-detected based on the recognized project type and conventions.
- components(optional)string
The directory for UI components, for example src/components.
Auto-detected based on the recognized project type and conventions.
- examples(optional)string
The directory for code examples, for example src/examples.
The CLI generates slot usage examples here, and templates can reference this path to add their own code samples.
Auto-detected based on the recognized project type and conventions.
- content(optional)string
The directory where the CLI writes content files like fallback data and type definitions.
Defaults to the project root when not specified.
- source(optional)
Version specifiers
The slots and components properties use version specifiers to define which major versions the CLI should generate types and content for. The following formats are supported:
| Format | Example | Description |
|---|---|---|
| Exact | 3 | A single major version. |
| Range | 1 - 3 | All major versions from 1 to 3, inclusive. |
| Set | 1, 3, 5 | A specific set of major versions. |
For example:
{ "slots": { "home-hero": "1 - 3", "banner": "2", "footer": "1, 4" }}This generates types and downloads default content for home-hero versions 1, 2, and 3, banner version 2, and footer versions 1 and 4.