creativecommons / wp-plugin-creativecommons

Official Creative Commons plugin for licensing your content. With Creative Commons licenses, keep your copyright AND share your creativity.
https://wordpress.org/plugins/creative-commons/
GNU General Public License v2.0
153 stars 104 forks source link

Scope strategy of the migration from `create-guten-block` scripts to a `@wordpress/scripts` core setup #211

Open possumbilities opened 2 years ago

possumbilities commented 2 years ago

Problem

Previously:

The use of create-guten-block as a scaffolding for the WordPress Gutenberg blocks has a number of compatibility and stability issues. Since the blocks were originally created with create-guten-block core WP has grown its capacity to handle scaffolding, dev, and build. To keep block dev stable long term, create-guten-block needs to be replaced entirely with core functionality.

Description

The entirety of create-guten-block needs to be removed, along with all its dependencies. Its implementation of block structure and file setup is not quite 1:1 compared to the @wordpress/scripts, which will require modification.

Additionally, the CGB setup has its own "cgb" namespace, which is not as intuitive or accurate post deprecation. The namespace should likely shift to "cc" or something similar.

As the namespace will be shifting, that will cause CSS rules, HTML classes, and JS naming conventions to shift as well. This means that any site utilizing a CGB built block will need a proper migration path to using the core scripts implementation with the new namespace and naming convention.

Above all, a proper strategy with adjoining scope needs to be drafted to establish the best migration path.

Implementation

RonaldRonnie commented 2 weeks ago

hi my senior, do i need to first create the "docker-compose.yml file for building and testing."?

RonaldRonnie commented 2 weeks ago

Also Migration to @wordpress/scripts:

The README doesn't detail the migration process, it provides context for understanding the current workflow and the commands I'll likely need to modify.

Points for Migration basing on my finding:

npm remains relevant: Since @wordpress/scripts also utilizes npm for managing dependencies and scripts, the basic commands like npm install and npm run will still be used. Build Process Updates: We will likely need to replace the existing build scripts for @wordpress/scripts. WP-CLI remains useful: WP-CLI can still be used within a Docker environment or locally for interacting with WordPress during development and testing.

however, choose a development environment that supports @wordpress/scripts, such as a local WordPress instance with the necessary plugins installed is also crucial.

I requset you to enlight me about this please and to provide me more guidance about it.

RonaldRonnie commented 2 weeks ago

hi @possumbilities , i've tried out a few changes about this and I would like you go through this file and advise me . I wanted to first work on one file and then proceed . (wp-plugin-creativecommons/src/CC-BY/block.js)

`import './style.scss'; import './editor.scss'; import { __ } from '@wordpress/i18n'; import { registerBlockType } from '@wordpress/blocks'; import { InspectorControls, PanelColorSettings, RichText } from '@wordpress/block-editor';

/**