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

Feature/WDSUS-46 Block Registration #82

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

khleomix
Copy link
Contributor

Closes

WDSUS-46

What type of PR is this? (put an x to all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Link to test

Test Locally

Description

  • Dynamically Register Blocks:
    • Introduce dynamic block registration, allowing blocks to be automatically registered when added to the blocks folder. This streamlines the block registration process and enhances the theme's scalability.
  • Fix Pattern Category Function
  • Create Block Template with Mustache template:
    • Add a new feature that allows the creation of block templates using the Mustache templating engine. This provides greater flexibility in customizing block templates.
  • Sharing Dependencies in the Root:
    • Add changes to share dependencies for blocks at the root level of the theme, simplifying dependency management and promoting consistency across blocks.
  • Add Create Block and Build Scripts:
    • Introduce create block and build scripts to streamline the process of creating new blocks.
  • Remove WPCLI Script
  • Remove Options from Script and Add Defaults to Template
  • Update Readme and Docs

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

image

image

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 Confluence
  • 🙅 no documentation needed

Others

  • 🦮 Is this issue accessible? (Section 508/WCAG 2.0AA)
  • 🙌 Does this issue pass all the linting? (PHPCS, ESLint, SassLint)

[optional] Are there any post-deployment tasks we need to perform?

@@ -61,11 +61,12 @@
},
"scripts": {
"a11y": "pa11y-ci --reporter=pa11y-ci-reporter-html --sitemap $npm_config_url/sitemap.xml",
"build": "cross-env NODE_ENV=production wp-scripts build --config webpack.prod.js",
"build:blocks": "for dir in blocks/*/; do (cd \"$dir\" && npm run build); done",

Choose a reason for hiding this comment

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

Suggested change
"build:blocks": "for dir in blocks/*/; do (cd \"$dir\" && npm run build); done",
"build:blocks": "for dir in blocks/*/; do if [ -d \"$dir\" ]; then (cd \"$dir\" && npm run build); fi done",

I think adding this if check fixes running the build with an empty blocks folder.

@khleomix khleomix requested a review from asharirfan October 31, 2023 14:51
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.

2 participants