{"id":29234474,"url":"https://github.com/builtnorth/wp-theme-json-compiler","last_synced_at":"2025-07-03T17:37:09.171Z","repository":{"id":302325088,"uuid":"1012040073","full_name":"builtnorth/wp-theme-json-compiler","owner":"builtnorth","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-01T18:34:15.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-01T19:27:15.031Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/builtnorth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-01T18:03:39.000Z","updated_at":"2025-07-01T18:31:02.000Z","dependencies_parsed_at":"2025-07-01T19:38:04.979Z","dependency_job_id":null,"html_url":"https://github.com/builtnorth/wp-theme-json-compiler","commit_stats":null,"previous_names":["builtnorth/wp-theme-json-compiler"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/builtnorth/wp-theme-json-compiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/builtnorth%2Fwp-theme-json-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/builtnorth%2Fwp-theme-json-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/builtnorth%2Fwp-theme-json-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/builtnorth%2Fwp-theme-json-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/builtnorth","download_url":"https://codeload.github.com/builtnorth/wp-theme-json-compiler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/builtnorth%2Fwp-theme-json-compiler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263370377,"owners_count":23456468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-03T17:36:48.980Z","updated_at":"2025-07-03T17:37:09.151Z","avatar_url":"https://github.com/builtnorth.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WP Theme JSON Compiler\n\nA modular theme.json compiler for WordPress themes.\n\n\u003e ⚠️ **Warning**\n\u003e\n\u003e The `compile` and `watch` commands will overwrite your `theme.json` file in the specified theme directory.\n\u003e\n\u003e 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuiltnorth%2Fwp-theme-json-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuiltnorth%2Fwp-theme-json-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuiltnorth%2Fwp-theme-json-compiler/lists"}