Open ryelle opened 2 years ago
It's pretty lightweight as dependencies go, so installing it globally and requiring it in composer.json (for the configs, at least) seems fine. I like the idea of having a CLI command for generating a new project π
It looks like we can use @wordpress/create-block
with a custom template directory --template
or with some other custom config. Worth experimenting so we maybe don't need to rewrite a template-generator.
I think it would be good to create templates for the following (β are priorities IMO)
wporg-mu-plugins/mu-plugins/blocks
, which might be tricky given how it's currently set upI think we want the script to generate the files & package.json
, but whether it should also do a composer.json
& wporg-repo-tools
depends on where it's going, so maybe let that be optional.
Unfortunately, create-block
can only be used to create block-plugins, it doesn't handle other kinds of projects and we can't customize the prompts.
So here's where we kind-of stand on this. There isn't one single tool suggestion, and I'm not sure if that's really a bad thing.
@wordpress/create-block
with the default template. @wordpress/scripts
build process.@wordpress/create-block
with the template in #21. No build process because the parent project should have one.
Right now the templates directory is pretty empty, but I added a branch with a child-theme template. It uses the mustache template syntax that
@wordpress/create-block
uses, so it would be nice to add a CLI command that could generate a project from the template likecreate-block
does.Maybe wporg-repo-tools becomes something you install globally, so that you can run
$ repo-tools/generate child-theme
and it prompts you for all the required values, then generates a child-theme in your current directory? Or something like that :)