JSON Transforms

JSON (JavaScript Object Notation) is a standard file format in Shopify theme development and powers features like locales, settings and (OS 2.0^) sections. Syncify extends upon this and uses JSON for its own features, including shared schema, metafields, navigation and translation sync capabilities. The json transform in Syncify is used to control control JSON handling keeping things consistent across projects.

Key Features

Syncify supports formatting, sorting, and minification, while extending standard JSON with a less-strict syntax. This sits between the JSON5 and strict JSON, keeping things practical for theme development. Here’s what is included:

  • Formatting Control: Set indent, crlf, useTab.
  • Trailing Commas: Allowed in objects and arrays.
  • Property Sorting: Sort with sortObjects, sortTargets or skip via noSortList.
  • Comments: Line // or Block /* */ comments with stipping
  • Minification: Minify JSON files use terse for production.
  • Diffing: Intelligent diffing of local and remote copies

You’ll want to align beautification specific settings like indent, crlf and useTab with your Prettier (or Æsthetic) formatting rules to avoid messy git diffs when collaborating or tracking changes.


Config Options

The json transform option can be used to control JSON processing behaviour. This option lets you customize formatting, sorting, and minification (see terse output) to match your project’s needs, keeping files readable for team collaboration. It ships with sensible defaults (listed below).


Terse Options

When terse is set to an object rather than a boolean, it provides a detailed way to configure JSON minification across different directories and use cases in your Syncify project. Each property within the terse object targets a specific directory or context, and they all default to true unless you explicitly override them with false in the configuration.

Terse minification only kicks in when the --prod or --terse CLI flag is provided, regardless of these settings.