-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tooling: scaffolding WordPress plugins and blocks #10629
Comments
I don't think this should be part of Gutenberg, tbh. There are already popular tools like https://github.com/ahmadawais/create-guten-block and even support for that in the official WordPress command line utility, WP-CLI: https://github.com/wp-cli/scaffold-command. Both can work without WordPress. IMO we should concentrate our focus on the existing solutions to make them better if needed. |
We actually already have a It's probably too soon at the moment but It seems like a natural evolution for me to have a scaffolding tool based on |
Just wanted to clarify The downside of the current implementation of |
Yes, once we add support for handling builds, we will have all that is required to manage plugins. |
@youknowriad @gziolo already covered most of the points WP-CLI past discussion around having modern tooling for scaffolding wp-cli/scaffold-command#106 The plan is to use |
Sharing this handbook tutorial from @mkaz for reference as it is a nice starter for extensibility template. |
There's no reason why Note: my main focus for v2.2.0 of WP-CLI will be to rethink the scaffolding tool to make it the de-facto code generator for WordPress. This would probably be a better place to include block generation than the Gutenberg plugin itself. |
@schlessera Great to hear, If I could have one suggestion about this rethinking is to consider splitting the scaffolding from the rest of the tooling. Installing and running the scaffolding tool shouldn't require an active WordPress installation. |
I'm sharing for reference the link to create-cloud-block which helps to scaffold blocks to use with Cloud Blocks plugin. Those blocks work with both WordPress and Drupal. The repository is maintained by @eliocro. |
I have this npm package up and running which implements parts of the functionality proposed in this issue: https://www.npmjs.com/package/create-wordpress-block I plan to open PR against Gutenberg after some testing with the community. This is how it works: |
Introduction:
A javascript based tool to fit into developer workflow which enables them to kickstart blocks & plugins. Runs independently without any PHP/WordPress.
Scaffolding Wishlist:
Commands Idea List:
Generate plugin with a single block setup using esnext
$create-wp-plugin block --single --esnext
Generate plugin with a multi-block setup
$create-wp-plugin block --multi
Generate blocks without any plugin (for themes & existing plugins)
$create-wp-plugin block --no-plugin
Generate block using predefined templates
$create-wp-plugin block --template=serverside | richtext | blockcontrols | inspectorcontrols
Generate plugin to extend gutenberg
$create-wp-plugin extensibility --template=sidebar | block
Generate plugin page utilizing gutenberg components & react abstraction
$create-wp-plugin page --title=<page_title>
Commands / Flags:
block
--name=
--slug=
--icon=<Dashicon / SVG>
--category=< category name >
--keywords=<Max 3>
--esnext
--single
--multi
--no-plugin
--template=[
basic,
serverside
richtext,
blockcontrols,
inspectorcontrols,
kitchensink
]
extend
-- sidebar --icon=<Dashicon / SVG> --name=
-- block --with-insepctor-controls --with-block-controls --with-save --with-edit
-- publish
-- pre-publish
page
--name=
--menu=<menu_title>
--slug=
--parent=<menu_parent>
--icon=<Dashicon / SVG>
--kitchensink(Add demo controls)
--tabs=<tabs1,tab2,tab3>
#10628 is MVP exploring above
The text was updated successfully, but these errors were encountered: