Skip to content
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

feat: custom block generators #121

Merged
merged 2 commits into from
Oct 26, 2023
Merged

Conversation

dustin-jw
Copy link
Contributor

Description

This work replaces the example blocks plugin with generators for scaffolding new custom blocks plugins and individual custom blocks. This further reduces the amount of boilerplate that a developer would need to delete (or forget is still there) when starting a new project.

Closes #113

To Validate

  1. Make sure all PR Checks have passed
  2. Pull down this branch
  3. Run npm ci (there's a new dependency for one of the generators)
  4. Run npm start
  5. Confirm that the WordPress Plugins admin page no longer lists the "Example Blocks" plugin (existing posts that used the blocks may warn you about the blocks being unsupported, but you can convert them to HTML)
  6. Run npm run generate:custom-blocks-plugin and answer the prompts to create a test plugin
  7. Run npm run generate:custom-block and answer the prompts to create a test block within the test plugin
  8. Confirm that all the files you would expect for a custom block are created in src/plugins (compare to main as an example)
  9. Confirm that two new npm scripts are added to package.json
  10. Confirm that a new volume mapping is added to docker-compose.yml
  11. Restart your development process (Ctrl+C, then npm start) to pick up the package.json and docker-compose.yml changes
  12. Go to the WordPress Plugins admin page and confirm that your test plugin is available and can be activated
  13. Activate the plugin
  14. Add or edit a post and add your test block, confirming that it works as expected both in the editor and on the site when viewing the page

Copy link
Contributor

@rise-erpelding rise-erpelding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working as expected!! Nice job!

- add generator for scaffolding custom block plugins
- add generator for individual custom blocks
- install js-yaml
- update volume mapping for new plugins
- remove example-blocks plugin
- update clean and copy scripts
@dustin-jw dustin-jw force-pushed the feat--custom-block-generators branch from 05b4189 to 9978fc9 Compare October 26, 2023 21:19
@dustin-jw dustin-jw merged commit 9978fc9 into main Oct 26, 2023
2 checks passed
@dustin-jw dustin-jw deleted the feat--custom-block-generators branch October 26, 2023 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace example-blocks plugin with custom block generator(s)
2 participants