Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

New Package: Support package for alleyinteractive/create-wordpress-plugin #44

Open
srtfisher opened this issue Feb 22, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@srtfisher
Copy link
Member

Create a new support package that would aid in the development of plugins that use the create-wordpress-plugin project. Example features:

  • Scaffolding out a new entry quickly.
  • Shared webpack configuration boiler plate.
@srtfisher srtfisher added the enhancement New feature or request label Feb 22, 2023
@srtfisher srtfisher changed the title New Pacakge: Support package for alleyinteractive/create-wordpress-plugin New Package: Support package for alleyinteractive/create-wordpress-plugin Feb 22, 2023
@kevinfodness
Copy link
Member

I would love a shared configuration that's built on wp-scripts. Further, I think it could be used to build theme assets in addition to plugin assets. It would make it significantly easier to keep build toolchains up to date if it was maintained as an external dependency.

A few thoughts:

  • It should support TypeScript.
  • We should be able to build Gutenberg blocks, slotfills, plugin sidebars, and front-end assets using this system, including CSS.
  • It should have support for leveraging WP's dependencies via the Dependency Extraction Webpack Plugin, including for front-end builds (for example, we could load WP's version of React rather than bundling it with what we're building for the front-end).
  • It should be able to operate on files at any level. I'd like to be able to use the shared asset build system in the root of wp-content to build both plugins and themes without needing to run npm ci && npm run build in each of the plugin and theme folders.
  • It should be extensible for cases where more precise control over output is required by specific projects, but should aim to cover 95% of our projects with zero configuration.
  • Can we leverage the other stuff wp-scripts provides at the same time? For example, wp-scripts has support for running tests with Jest. Can we also use it as a test runner? Alternately, would we want to build out a different shared package for running tests? What about eslint?

@stevenslack
Copy link
Contributor

  • Jest is bundled with wp-scripts but we may need our own config file.
  • We already have a shared stylelint config as a part of the alley scripts, we can and should do the same with ESLint.
  • HMR should be enabled for the block editor leveraging wp-scripts. Can this same command be used for HMR on the front end?

@srtfisher
Copy link
Member Author

It should be able to operate on files at any level. I'd like to be able to use the shared asset build system in the root of wp-content to build both plugins and themes without needing to run npm ci && npm run build in each of the plugin and theme folders.

That part might be best set up as a standalone package itself. This issue would be more focused on getting the webpack configuration centralized for Alley projects in an external dependency and also providing a way to quickly generate a new entry for a create-wordpress-plugin project.

@kevinfodness
Copy link
Member

For instance, a package that includes the shared build system? I'd be fine with that as a solution.

@stevenslack
Copy link
Contributor

Scaffolding out a new entry quickly.

Scaffolding out a new entry could result in several different variations:

  • A slotfill for the editor.
  • A slotfill with styles.
  • A plain .js/.ts entry point.
  • A .js/.ts entry point with styles.
  • A styles entry point for one-off stylesheets.

Each of the above would benefit from scaffolded enqueue functions for it's respective entry. Or at least a nudge in the right direction with adequate documentation or inline comments

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants