This repository was archived by the owner on Jan 17, 2025. It is now read-only.
Migration from create-guten-block scripts to a @wordpress/scripts core setup #248
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes
Fixes #211 by @possumbilities
Description
This PR migrates the WordPress Gutenberg block setup from create-guten-block to @wordpress/scripts to address compatibility and stability issues. The migration updates the block’s structure, file setup, and namespace, aligning it with core WordPress practices as outlined in issue #211.
Key changes include:
Complete removal of create-guten-block and its dependencies.
Adoption of @wordpress/scripts for improved maintainability and compatibility.
Updated namespace from cgb to cc to align with WordPress conventions and ensure future compatibility.
Refactored CSS classes, HTML elements, and JavaScript function names to reflect the new cc namespace.
Technical details
Replaced all instances of wp.blocks and wp.blockEditor imports with @wordpress/block-editor.
Configured @wordpress/scripts for building, linting, and testing.
Updated CSS and JavaScript naming conventions to the new cc namespace.
Tests
To verify this PR:
Clone the branch and install dependencies.
Test the block on a WordPress instance to confirm compatibility with existing content.
Run all build and linting commands to confirm they execute without errors.
Verify that the blocks load and function as expected in the WordPress block editor.
Checklist
My pull request has a descriptive title (not a vague title like Update index.md).
My pull request targets the default branch of the repository (main or master).
My commit messages follow best practices.
My code follows the established code style of the repository.
I added or updated tests for the changes I made (if applicable).
I added or updated documentation (if applicable).
I tried running the project locally and verified that there are no visible errors.