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:

croct.json
{  "$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.

organization
string

The ID of the organization that owns the project.

workspace
string

The ID of the workspace associated with the project.

applications
object

The application IDs mapped to the project.

development
string

The ID of the development application.

production(optional)
string

The ID of the production application.

defaultLocale
string

The default locale for the project, for example en or pt-br.

locales
Array<string>

The list of locales supported by the project.

slots
Record<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.

components
Record<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.

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:

FormatExampleDescription
Exact3A single major version.
Range1 - 3All major versions from 1 to 3, inclusive.
Set1, 3, 5A specific set of major versions.

For example:

croct.json
{  "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.