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

Add logic for block style entry points #390

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

dmtrmrv
Copy link

@dmtrmrv dmtrmrv commented Apr 22, 2024

Related Issue/RFC: #339

This PR introduces several enhancements and fixes to the configuration and entry logic for the toolkit package. Key changes include the reorganization of path configurations, the addition of a new configuration option for loading block-specific styles, and the update of the webpack entry to support this new feature.

Changes

  1. Path Configuration Updates (paths.config.js):

    • Reorganized and added a new path configuration for blocksStyles.
    • Maintained the order of properties for better readability and consistency.
  2. Webpack Entry Updates (entry.js):

    • Introduced a new configuration option loadBlockSpecificStyles to conditionally load CSS files specific to blocks.
    • Implemented logic to automatically discover and create entry points for block-specific stylesheets located in the assets/css/blocks directory.
    • Merged the new entry points for block stylesheets with the existing build files.
  3. Default Configuration Update (config.js):

    • Added the loadBlockSpecificStyles option to the default configuration, with a default value set to false.

Requires this to be deployed to Scaffold: 10up/wp-scaffold#229

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.
  • I have added a changeset to my PR. See CONTRIBUTING document for instructions

Copy link

changeset-bot bot commented Apr 22, 2024

⚠️ No Changeset found

Latest commit: 1c01f08

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dmtrmrv dmtrmrv marked this pull request as ready for review May 21, 2024 00:27
@nicholasio
Copy link
Member

@dmtrmrv Would you mind try adding a few e2e tests? You can follow the structure of the existing e2e tests, essentially you can create a new "project" with an expected block structure, run tooklit via jest then asset that toolkit is compiling the right files.

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.

None yet

2 participants