{"id":28715633,"url":"https://github.com/ge3224/wp-dx-theme-config","last_synced_at":"2026-02-17T01:34:43.370Z","repository":{"id":274364023,"uuid":"919681179","full_name":"ge3224/wp-dx-theme-config","owner":"ge3224","description":"Write your 'theme.json' file for a WordPress theme with TypeScript.","archived":false,"fork":false,"pushed_at":"2025-08-18T00:21:44.000Z","size":105,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-08T10:54:45.330Z","etag":null,"topics":["gutenberg-theme","wordpress"],"latest_commit_sha":null,"homepage":"https://jsr.io/@wp-dx/theme-config","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ge3224.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-20T20:09:13.000Z","updated_at":"2025-01-27T19:33:09.000Z","dependencies_parsed_at":"2025-01-26T21:24:37.781Z","dependency_job_id":"6b626d15-4a78-4e96-92ca-a0022987dd4f","html_url":"https://github.com/ge3224/wp-dx-theme-config","commit_stats":null,"previous_names":["ge3224/wp-dx-theme-config"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/ge3224/wp-dx-theme-config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ge3224%2Fwp-dx-theme-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ge3224%2Fwp-dx-theme-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ge3224%2Fwp-dx-theme-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ge3224%2Fwp-dx-theme-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ge3224","download_url":"https://codeload.github.com/ge3224/wp-dx-theme-config/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ge3224%2Fwp-dx-theme-config/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29529513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T00:57:22.232Z","status":"ssl_error","status_checked_at":"2026-02-17T00:54:25.811Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["gutenberg-theme","wordpress"],"created_at":"2025-06-15T02:10:35.342Z","updated_at":"2026-02-17T01:34:43.342Z","avatar_url":"https://github.com/ge3224.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wrangle that hulking `theme.json` file with TypeScript\n\nCraft WordPress theme configurations using the full power of TypeScript: split\nconfigs, leverage functions, iterate over arrays, and even throw in some\ncomments.\n\n[![JSR](https://jsr.io/badges/@wp-dx/theme-config)](https://jsr.io/@wp-dx/theme-config)\n[![NPM Version](https://img.shields.io/npm/v/%40wp-dx%2Ftheme-config)](https://www.npmjs.com/package/@wp-dx/theme-config)\n[![GitHub License](https://img.shields.io/github/license/ge3224/wp-dx-theme-config)](https://github.com/ge3224/wp-dx-theme-config/blob/main/LICENSE)\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/ge3224/wp-dx-theme-config/publish.yml)\n\n## Usage Example\n\n```ts\nimport { config, settings, styles } from \"@wp-dx/theme-config\";\n\nasync function creatThemeJson() {\n  const themeJson = config.create(\n    config.withVersion(2),\n    config.withSchema(\"https://schemas.wp.org/wp/6.5/theme.json\"),\n    config.withSettings(\n      settings.create(\n        settings.withAppearanceTools(true),\n        settings.withSpacing({ padding: true, margin: true }),\n        settings.withTypography({ customFontSize: true, fontWeight: true }),\n      ),\n    ),\n    config.withStyles(styles.create(\n      styles.withElement(\"button\", {\n        color: { text: \"#ffffff\", background: \"#000000\" },\n        \":hover\": { color: { text: \"#000000\", background: \"#fff47b\" } },\n      }, true),\n    )),\n  );\n```\n\n### Deno\n\n```ts\n// Deno (assuming write permission to the current directory)\nasync function writeThemeJsonDeno() {\n  try {\n    await Deno.writeTextFile(\n      \"theme.json\",\n      JSON.stringify(themeJson, null, 2),  // see above snippet for themeJson implementation\n    );\n    console.log(\"✓ theme.json updated\");\n  } catch (error) {\n    console.error(\"Failed to write theme.json:\", error);\n  }\n}\n\nif (import.meta.main) {\n  await writeThemeJsonDeno();\n}\n```\n\n### Node.js\n\n```js\nconst { createThemeJson } = require('./src/theme-generator'); \nconst fs = require('fs');\n\nfunction writeThemeJsonNode() {\n  const themeJson = createThemeJson();\n  try {\n    fs.writeFileSync(\"theme.json\", JSON.stringify(themeJson, null, 2));  // see above snippet for themeJson implementation\n    console.log(\"✓ theme.json updated\");\n  } catch (error) {\n    console.error(\"Failed to write theme.json:\", error);\n  }\n}\n\nwriteThemeJsonNode();\n```\n\n### Bun\n\n```ts\nimport { createThemeJson } from './src/theme-generator'; \n\nasync function writeThemeJsonBun() {\n  const themeJson = createThemeJson();\n  try {\n    await Bun.file(\"theme.json\").write(JSON.stringify(themeJson, null, 2)); // see above snippet for themeJson implementation\n    console.log(\"✓ theme.json updated\");\n  } catch (error) {\n    console.error(\"Failed to write theme.json:\", error);\n  }\n}\n\nawait writeThemeJsonBun();\n```\n\n## Installation\n\nTo install the library:\n\n```bash\ndeno add jsr:@wp-dx/theme-config\n```\n\n```bash\nnpm install @wp-dx/theme-config\n```\n\n## Project Examples\n\nThe [`examples`](https://github.com/ge3224/wp-dx-theme-config/tree/main/examples)\ndirectory contains example projects demonstrating usage in different environments:\n\n- **basic.ts:** A basic usage example demonstrating theme configuration creation.\n- **bun:** A Bun project showcasing theme configuration usage with Bun-specific considerations.\n- **nodejs:** A Node.js project demonstrating theme configuration usage with\nNode.js-specific considerations.\n\n## Contributing\n\nContributions to this project are welcome! Please see the\n[CONTRIBUTING.md](https://github.com/ge3224/wp-dx-theme-config/tree/main/CONTRIBUTING.md)\nfile for details on how to submit pull requests and code contributions.\n\n## Inspiration\n\nInspired by the article [How to Split Theme.json into Multiple Files with WordPress](https://fullstackdigital.io/blog/split-theme-json-into-multiple-files-with-wordpress).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fge3224%2Fwp-dx-theme-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fge3224%2Fwp-dx-theme-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fge3224%2Fwp-dx-theme-config/lists"}