Sync CLI commands

The commands in this section allow you to manage all project assets. See the full list.

The uniform sync command requires a configuration file to specify how it should work. By default, it looks for the uniform.config.ts file in the project's root directory.

It's a TypeScript, JavaScript, or JSON file that exports the configuration object. The object should have a serialization key with a configuration object to specify how uniform sync command should work.

Here is an example of configuration file to enable backup/restore of canvas entities with default settings (YAML format, mirror mode, ./uniform-data directory).

The configuration allows you to control 4 things:

  • Serialization format: yaml or json
  • Serialization mode: mirror or createOrUpdate or create
  • Serialization directory or file path to store serialized data
  • Serialization entities configuration: to specify which entities and how to serialize

Use will depend on your application. An example case could be where you want to push a new component from your local environment. Review the output details of the push component command.

There are also 3 levels of granular configuration:

  • Global configuration
  • Per entity type configuration
  • Per pull or push command configuration

Here is an example with explanation:

The default configuration before merging with user provided configuration is:

Most of the time you will need to override only entitiesConfig object:

To configure this command you should provide the configuration file in one of two ways:

Use the cosmiconfig package to locate the configuration file in the project root. You can see different ways of naming the configuration .

You can also use TypeScript files as configuration files. In this case, you should provide a ts extension in the file name.

You can specify the file explicitly:

The pull command will fetch all configured project entities from the Uniform Project and save them to the local file system.

The push command will read all configured project entities from the local file system and push them to the target Uniform Project.