JSON

The json transform governs how Syncify processes .json and .schema files in your project, including theme configurations, metafields, and other JSON-based structures. This transform is optional, you can skip it entirely, and Syncify will fallback to the default settings when omitted from your configuration. See usage documentation.

crlf

Controls whether JSON files use Windows-style CRLF (\r\n) line endings. Defaults to false, which applies Unix-style LF (\n) — the standard for most development environments. Set to true if targeting Windows-specific workflows.

indent

Sets the number of spaces used for indentation in formatted JSON output. Defaults to 2, aligning with common style guides like Prettier. Adjust this to match your team’s formatting preferences.

useTab

Determines if tabs (\t) are used for indentation instead of spaces. When true, the tab width is calculated as indent / 2 (e.g., indent: 4 means 2 tabs). Defaults to false for space-based indentation, which is more common in JSON formatting.

stripComments

Decides whether comments (// or /* */) in JSON files are removed or kept. Set to true to strip them, or keep the default false to preserve them. Affects both local files and remote sources fetched by Syncify.

sortObjects

Enables alphabetical sorting of object properties throughout the JSON structure, including nested objects. Defaults to false to maintain the original order. Turn on with true for consistent property ordering.

sortTargets

Specifies a list of JSON paths (using dot notation, e.g., settings.colors) to sort specific object entries. Only applies sorting to these targets, leaving others unsorted. Empty [] by default, so no sorting occurs unless populated.

noSortList

Lists property names (e.g., id, created_at) to exclude from sorting when sortObjects is true. Ignored if sortObjects is false. Useful for preserving order in specific fields. Empty [] by default.

exclude

A list of glob patterns (e.g., **/private.json) for .json files to skip during processing. Matching files pass through unchanged. Empty [] by default, meaning all files are processed.

terse

Controls JSON minification. Can be a boolean (true or false) or an object with detailed settings (see below). Defaults to false, disabling minification. When enabled (true or object), requires the --prod or --terse CLI flag to activate otherwise, minification is skipped.

terse → assets

Minifies .json files written to the theme/assets directory when true. Set to false to keep them unminified, preserving readability for asset-related JSON.

terse → config

Minifies settings_schema.json and settings_data.json in the config directory when true. Disable with false if you need these files human-readable for debugging or collaboration.

terse → locales

Minifies .json files in the locales directory (e.g., translation files) when true. Set to false to avoid minifying, which can help when reviewing locale data.

terse → metafields

Minifies .json metafield files synced to stores when true. Defaults to true for compact output, use false to keep them formatted, aiding in manual inspection.

terse → metaobject

Minifies .json files in the metaobject directory when true. Set to false to skip minification, useful if metaobject data needs to remain readable.

terse → groups

Minifies section group *-group.json files when true. Defaults to true for smaller files, switch to false to maintain formatting for easier edits.

terse → templates

Minifies .json files in the templates directory when true. Use false to keep them unminified, which can simplify template development workflows.

terse → exclude

A list of glob patterns (e.g., **/debug.json) to exclude specific .json files from minification. Files matching these patterns stay unminified, even if their directory is targeted. Empty[] by default.