-
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
Create a @wordpress/create-project
package to scaffold scripts and styles
#23514
Comments
@wordpress/create-ui-plugin
package, to scaffold regular scripts (not blocks)@wordpress/create-plugin
package, to scaffold regular scripts (not blocks)
Firs, I'd like to make it clear that
Given that we have If that happens, |
I'm using |
@mrleemon, first, I would restrain from criticizing work of a group of contributors that volunteer to the project. Every project is different and extends WordPress in a different way. I also didn’t say you shouldn’t be using the API you mentioned. @ryanwelcher added it earlier this year based on recurring requests from plugin developers. I just don’t think it should be the highlighted example in the scaffolded plugin. |
@mrleemon as @gziolo mentioned the introduction of As the project moves forward, I'm sure there will be a more elegant solution presented to extend the editor experience but for now, go with the API. If there is something that you'd like to see, I would encourage you to open an issue/PR. |
Sorry
Thanks for the clarification |
Possibly the script must be registered on the footer. See #23607 |
Now that it’s possible to scaffold the plugin shell independently of the block when using It could be beneficial addition knowing we maintain today more examples of JS-based packages enriching WordPress. |
Something I've been interested in, came across the issue and wanted to cross-link my request |
It is possible to create a template that create-block can use to scaffold non-block functionality such as registering a slotfill, variation etc. I would encourage you to try that approach to see if it fits your needs. You would be able to leverage variations and the mustache conditionals to output the files you need. Have a look at this template I am using to do exactly that. I have a variation (called |
I have recently started thinking about themes, too. It's another place where folks use WP Scripts to manage JavaScript and CSS files that require the build step. Consequently, we should consider creating a general-purpose package {
pluginTemplatesPath: join( __dirname, 'templates/plugin' ),
blockTemplatesPath: join( __dirname, 'templates/block' ),
} There could also be
|
I'd love to see tools like create-block for anything extenders need. I have an experiment for a theme tool that is based on create-block that we could use to experiment. It was pretty straight forward to put together as it's basically all of the internals of create-block with modifications for themes. https://github.com/ryanwelcher/theme-cli-tool Perhaps the approach is to abstract the internals of create-block, scaffolding engine and template system into a package that can power any kind of tool? |
@wordpress/create-plugin
package, to scaffold regular scripts (not blocks)@wordpress/create-project
package to scaffold scripts and styles
Is your feature request related to a problem? Please describe.
Package
@wordpress/create-block
scaffolds single-block plugins. However, not everything in Gutenberg must be dealt with through a block.For instance, any panel component, such as
PluginDocumentSettingPanel
, must be registered through a regular script, not through a block.Currently, in order to scaffold the script for a panel component for my plugin, I do the following steps (documented here):
@wordpress/create-block
This way, I can use the webpack configuration from
@wordpress/scripts
. However, this process is cumbersome, error-prone, and unnecessary.Describe the solution you'd like
It would be much better to already have a scaffolding tool similar to
@wordpress/create-block
to create single-script plugins.Talking to @gziolo he suggested to name it
@wordpress/create-ui-plugin
The text was updated successfully, but these errors were encountered: