{"_id":"@builtnorth/wp-theme-json-compiler","name":"@builtnorth/wp-theme-json-compiler","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@builtnorth/wp-theme-json-compiler","version":"1.0.0","description":"A modular theme.json compiler for WordPress themes.","main":"src/index.js","bin":{"wp-theme-json-compiler":"src/index.js"},"scripts":{"compile":"node src/index.js compile","split":"node src/index.js split","watch":"node src/index.js watch","prepublishOnly":"node -e \"console.log('Package validation passed')\""},"keywords":["wordpress","theme","theme.json","compiler","modular","cli","build-tool","gutenberg","full-site-editing"],"author":{"name":"Built North"},"license":"GPL-2.0-or-later","repository":{"type":"git","url":"git+https://github.com/builtnorth/wp-theme-json-compiler.git"},"homepage":"https://github.com/builtnorth/wp-theme-json-compiler#readme","bugs":{"url":"https://github.com/builtnorth/wp-theme-json-compiler/issues"},"engines":{"node":">=14.0.0"},"dependencies":{"chokidar":"^3.6.0"},"_id":"@builtnorth/wp-theme-json-compiler@1.0.0","_nodeVersion":"22.13.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-+bclbRk4TUh0r4M+PmEZmgZY9G7fCqQbvbDGADeluwv8GhOaoXuo6L0ReW2m/dOI/PxWL4v7w+6ZkzD7WMsBdA==","shasum":"6b55edcc186ee5910aa1fb70023c8f45e6a77b88","tarball":"https://registry.npmjs.org/@builtnorth/wp-theme-json-compiler/-/wp-theme-json-compiler-1.0.0.tgz","fileCount":3,"unpackedSize":20918,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIE8FPC60vqF9gcqC2Vq8FHy7jc6RioF9FUsabY0k1hU9AiEA45a7grIi0MUtO4BMe40y5IRUTYwFD9ikVmtx2ZquKbw="}]},"_npmUser":{"name":"builtnorth","email":"hello@builtnorth.co"},"directories":{},"maintainers":[{"name":"builtnorth","email":"hello@builtnorth.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wp-theme-json-compiler_1.0.0_1760114085191_0.5822384138866581"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-10T16:34:45.050Z","1.0.0":"2025-10-10T16:34:45.369Z","modified":"2025-10-10T16:34:45.709Z"},"maintainers":[{"name":"builtnorth","email":"hello@builtnorth.co"}],"description":"A modular theme.json compiler for WordPress themes.","homepage":"https://github.com/builtnorth/wp-theme-json-compiler#readme","keywords":["wordpress","theme","theme.json","compiler","modular","cli","build-tool","gutenberg","full-site-editing"],"repository":{"type":"git","url":"git+https://github.com/builtnorth/wp-theme-json-compiler.git"},"author":{"name":"Built North"},"bugs":{"url":"https://github.com/builtnorth/wp-theme-json-compiler/issues"},"license":"GPL-2.0-or-later","readme":"# WP Theme JSON Compiler\n\nA modular theme.json compiler for WordPress themes.\n\n> ⚠️ **Warning**\n>\n> The `compile` and `watch` commands will overwrite your `theme.json` file in the specified theme directory.\n>\n> A backup is created automatically, but you may want to manually make one as well since this tool has not been thoroughly tested yet.\n\n## Features\n\n- Split `theme.json` into modular files for easier management\n- Compile modular files back into a single `theme.json`\n- Supports granular splitting for `settings`, `styles`, and more\n- CLI commands for `compile`, `split`, and `watch`\n\n## Installation\n\n```bash\nnpm install @builtnorth/wp-theme-json-compiler\n```\n\n## CLI Commands\n\n- **split**: Splits a current `theme.json` file into modular JavaScript files in the `theme-config` directory. This makes it easier to manage and edit theme settings in a structured way.\n- **compile**: Compiles all modular files from the `theme-config` directory back into a single `theme.json` file. Automatically creates a backup of the existing `theme.json` before overwriting.\n- **watch**: Watches the `theme-config` directory for changes. When a change is detected, automatically recompiles `theme.json` (creating a backup the first time in each session).\n\n## Usage\n\n### CLI\n\n```\n\nnpx @builtnorth/wp-theme-json-compiler compile --theme-path=wp-content/themes/your-theme\nnpx @builtnorth/wp-theme-json-compiler split --theme-path=wp-content/themes/your-theme\nnpx @builtnorth/wp-theme-json-compiler watch --theme-path=wp-content/themes/your-theme\n\n```\n\n- If `--theme-path` is omitted, the current working directory is used.\n\n### NPM Scripts\n\nAdd to your root `package.json` scripts:\n\n```\n\n\"theme-json:compile\": \"wp-theme-json-compiler compile --theme-path=wp-content/themes/your-theme\",\n\"theme-json:split\": \"wp-theme-json-compiler split --theme-path=wp-content/themes/your-theme\",\n\"theme-json:watch\": \"wp-theme-json-compiler watch --theme-path=wp-content/themes/your-theme\"\n\n```\n\n## Configuration\n\n- By default, operates on `theme.json` and `theme-config` in the current working directory.\n- Use `--theme-path` to specify a custom theme directory.\n\n## Automatic Backups\n\nBefore overwriting your existing `theme.json`, the compiler automatically creates a backup named `theme.backup.json` in the same theme directory. This occurs every time you run the `compile` command, and once per session when using the `watch` command (the first time a change is detected).\n\n- The backup file is always named `theme.backup.json` and will be overwritten on subsequent runs.\n- This helps prevent accidental data loss. To restore, simply rename or copy `theme.backup.json` back to `theme.json`.\n- Always verify your changes and keep your own version control backups for extra safety.\n\n## Credits\n\nThanks to [Nick Diego's article on managing theme.json files](https://nickdiego.com/stop-struggling-with-cumbersome-theme-json-files/) that came up in search results when looking into spitting up a monolithic theme.json file.\n\n## Disclaimer\n\nThis tool is provided \"as is\" without warranty of any kind, express or implied. Use at your own risk. Tool will override currenth theme.json files, so please understand that and/or have a backup. The authors and contributors are not responsible for any damages or liabilities arising from the use of this library. Always test thoroughly in your specific environment before deploying to production.\n\n## License\n\nGNU General Public License version 2 (or later) (GPLv2)\n","readmeFilename":"README.md","_rev":"1-b7d870cd1ac258bd08f2564b759070f0"}