{"_id":"@bluecadet/bluecadet-create-block","_rev":"2-61e94eff87c3986a7d992e504d7fd24a","name":"@bluecadet/bluecadet-create-block","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@bluecadet/bluecadet-create-block","version":"0.1.0","_id":"@bluecadet/bluecadet-create-block@0.1.0","maintainers":[{"name":"baerkins","email":"shaun.baer@gmail.com"},{"name":"peteinge","email":"pete.inge@gmail.com"},{"name":"benjaminbojko","email":"b@bbojko.de"},{"name":"claytercek","email":"clay@tercek.me"},{"name":"bluecadetreleases","email":"releases@bluecadet.com"}],"bin":{"bcb":"dist/index.js","bluecadet-create-block":"dist/index.js"},"dist":{"shasum":"401437170f6d2291a8b35ed5390f7bd16e8d495b","tarball":"https://registry.npmjs.org/@bluecadet/bluecadet-create-block/-/bluecadet-create-block-0.1.0.tgz","fileCount":4,"integrity":"sha512-BdIx92dz+LSlo8lKPlKHGpf+LC9lQmzg//5NtZkKqEUtx+pcAJhB787r1wtAGIaN9muCRKgnqlYOMRZ2bjOR4w==","signatures":[{"sig":"MEYCIQCN+3YlQAuTyY5NDFPbg3O4JNMZhF50EGWe88uI1is4qAIhAP7UQqa0Q+WF+EhpfQCIykqBqBrrsYInLmINMTfw+Qrk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23206},"type":"module","engines":{"node":">=20"},"exports":{".":"./dist/defineConfig.js"},"gitHead":"df6220f50558d4a09d4426614db688c05e6aacfa","scripts":{"dev":"tsup --watch","build":"tsup"},"_npmUser":{"name":"baerkins","email":"shaun.baer@gmail.com"},"_npmVersion":"11.13.0","description":"Scaffold Gutenberg blocks for Bluecadet WordPress projects","directories":{},"_nodeVersion":"26.1.0","dependencies":{"jiti":"^2.4.2","@clack/prompts":"^0.9.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","typescript":"^5.7.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/bluecadet-create-block_0.1.0_1781027287099_0.8463789093286034","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@bluecadet/bluecadet-create-block","version":"0.1.1","description":"Scaffold Gutenberg blocks for Bluecadet WordPress projects","type":"module","engines":{"node":">=20"},"bin":{"bluecadet-create-block":"dist/index.js","bcb":"dist/index.js"},"exports":{".":"./dist/defineConfig.js"},"scripts":{"build":"tsup","dev":"tsup --watch"},"dependencies":{"@clack/prompts":"^0.9.0","jiti":"^2.4.2"},"devDependencies":{"@types/node":"^22.0.0","tsup":"^8.3.0","typescript":"^5.7.0"},"gitHead":"932cc6c29d43dbe598edc794160776e2a09d5c12","_id":"@bluecadet/bluecadet-create-block@0.1.1","_nodeVersion":"26.1.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-Xw/vlCWa1pC1r1kUuhUmFA+inFwwKonnTof0PUlYKQUQ3VMlAupDElkDz2kcRXoQxKq44SniH6TvOcpsi66mEA==","shasum":"b36f683be35949cb9f3716665eced7e09e4173ba","tarball":"https://registry.npmjs.org/@bluecadet/bluecadet-create-block/-/bluecadet-create-block-0.1.1.tgz","fileCount":4,"unpackedSize":23307,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBDMQLKVg7KqJRH+toujM00cAc9ZmXf8dfF1YjjOtswwAiEAq5IdASrEhdXJgUnFxhEsmc2eQZ/p2zKc9cb5Pwx1YB4="}]},"_npmUser":{"name":"baerkins","email":"shaun.baer@gmail.com"},"directories":{},"maintainers":[{"name":"baerkins","email":"shaun.baer@gmail.com"},{"name":"peteinge","email":"pete.inge@gmail.com"},{"name":"benjaminbojko","email":"b@bbojko.de"},{"name":"claytercek","email":"clay@tercek.me"},{"name":"bluecadetreleases","email":"releases@bluecadet.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bluecadet-create-block_0.1.1_1784855253179_0.828563310079975"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-09T17:48:06.930Z","modified":"2026-07-24T01:07:33.600Z","0.1.0":"2026-06-09T17:48:07.274Z","0.1.1":"2026-07-24T01:07:33.324Z"},"description":"Scaffold Gutenberg blocks for Bluecadet WordPress projects","maintainers":[{"name":"baerkins","email":"shaun.baer@gmail.com"},{"name":"peteinge","email":"pete.inge@gmail.com"},{"name":"benjaminbojko","email":"b@bbojko.de"},{"name":"claytercek","email":"clay@tercek.me"},{"name":"bluecadetreleases","email":"releases@bluecadet.com"}],"readme":"# bluecadet-create-block\n\nCLI scaffolding tool for Gutenberg blocks in Bluecadet WordPress projects.\n\n## Usage\n\nRun from the root of a WordPress project:\n\n```bash\nnpx @bluecadet/bluecadet-create-block\n```\n\nOr with the short alias:\n\n```bash\nnpx bcb\n```\n\n## First run — setup wizard\n\nIf no config file is found, the CLI runs a one-time setup wizard that asks for your project paths and saves a `.bluecadet-create-block.js` file to the project root.\n\nRe-run the wizard at any time to update the config:\n\n```bash\nnpx @bluecadet/bluecadet-create-block --config\n```\n\n## Config file\n\nThe config file lives at `.bluecadet-create-block.js` in the project root and uses a `defineConfig` helper:\n\n```js\nimport { defineConfig } from '@bluecadet/bluecadet-create-block';\n\nexport default defineConfig({\n  theme_path: './wp-content/themes/my-theme',\n  blocks_path: './wp-content/themes/my-theme/editor/blocks/src',\n  block_namespace: 'basecadet',\n  acf_render_callback: '\\\\Basecadet\\\\Gutenberg\\\\ACFBlocksRenderer::render_acf_blocks',\n  custom_render_callback: 'Basecadet\\\\Gutenberg\\\\BasecadetBlocksRenderer::render_basecadet_blocks($attributes, $content, $block);',\n});\n```\n\nAll paths are relative to the project root (where the config file lives).\n\n| Key | Description |\n|---|---|\n| `theme_path` | Path to the WordPress theme |\n| `blocks_path` | Path to the blocks `src` directory |\n| `block_namespace` | WordPress block namespace prefix (default: `basecadet`) |\n| `acf_render_callback` | PHP render callback for ACF blocks |\n| `custom_render_callback` | PHP render callback for Custom blocks |\n\n## What gets created\n\n### DataComponent (always)\n\nA PHP class at `[theme_path]/lib/Basecadet/Twig/Data/Components/[BlockName].php` extending `AbstractComponentBuilder`.\n\n### ACF Block\n\nDirectory: `[blocks_path]/acf-[block-name]/`\n\n- `block.json` — registered as `[block_namespace]/acf-[block-name]`\n\n### Custom Block\n\nDirectory: `[blocks_path]/custom-[block-name]/`\n\n- `block.json` — registered as `[block_namespace]/custom-[block-name]`\n- `index.js`\n- `edit.js`\n- `render.php`\n\n## BlockConfig.php integration\n\nThe CLI reads `[theme_path]/lib/Basecadet/Gutenberg/BlockConfig.php` (required) and offers to add the new block to the `allowed_blocks` array for one or more post types defined in `BLOCK_LAYOUT_MAP`.\n\nAfter selecting a post type, if it has template sub-keys (e.g. `default`, `home`) you'll be asked which templates to add the block to. Post types with a flat `allowed_blocks` array are updated directly.\n\n`BlockConfig.php` is validated with `php -l` after modification and restored to its original state if validation fails.\n\n## Block name variants\n\nThe input name is normalized to several forms used across generated files:\n\n| Form | Example |\n|---|---|\n| PascalCase | `SomeBlock` — PHP class name, filename |\n| kebab-case | `some-block` — directory names, block `name` field |\n| Title Case | `Some Block` — block `title` and `description` |\n","readmeFilename":"README.md"}