woocommerce/packages/js/create-product-editor-block
Néstor Soriano 4876ab35b8
Bump WooCommerce minimum required PHP version to 7.4 (#39820)
-Change "Requires PHP":
  - In woocommerce.php
  - In readme.txt
  - In plugins/woocommerce-docs/woocommerce-docs.php
  - In packages/js/create-product-editor-block/plugin-templates/$slug.php.mustache

- Change "testVersion" in phpcs.xml:
  - In the root of the repository
  - In plugins/woocommerce
  - In plugins/woocommerce-beta-tester

- Change "require-php" and "config-platform-php" in composer.json
- Update composer.lock with more modern versions of some of the dependencies
- Remove the admin notice about the upcoming bump for PHP 7.3 users in class-wc-admin-notices.php
2023-08-22 09:21:09 +02:00
..
block-templates Add @woocommerce/create-product-editor-block package (#38263) 2023-05-26 08:16:57 -04:00
changelog Bump WooCommerce minimum required PHP version to 7.4 (#39820) 2023-08-22 09:21:09 +02:00
plugin-templates Bump WooCommerce minimum required PHP version to 7.4 (#39820) 2023-08-22 09:21:09 +02:00
.gitignore Add gitignore to package and update package.json (#39007) 2023-06-28 18:18:02 -03:00
CHANGELOG.md Prepare create product editor block package (#39022) 2023-06-29 10:32:04 -03:00
README.md Add @woocommerce/create-product-editor-block package (#38263) 2023-05-26 08:16:57 -04:00
composer.json Add @woocommerce/create-product-editor-block package (#38263) 2023-05-26 08:16:57 -04:00
composer.lock Add @woocommerce/create-product-editor-block package (#38263) 2023-05-26 08:16:57 -04:00
index.js Create Product Editor Block: Do not add script prop to generated block.json (#38496) 2023-06-13 09:53:20 -04:00
package.json Use syncpack customTypes to keep pnpm and node in sync. Update pnpm to 8.6.7 (#39245) 2023-07-18 14:27:18 +12:00

README.md

@woocommerce/create-product-editor-block

Create Product Editor Block scaffolds a fully functional modern development environment for developing block-based extensions to the new block-based product editor in WooCommerce.

Default tooling

You can use the built-in wp-env support to easily get a local WordPress environment up and running. It is configured to load the latest released version of WordPress, the latest WooCommerce nightly build and the latest version of the WooCommerce Beta Tester.

If you want to change which version of WordPress and WooCommerce are used, you can do so by modifying the .wp-env.override.json file.

Tooling support for linting, code formatting, and compilation are configured by default.

If you already have a local WordPress development environment configured, you can map the generated project folder under your plugins folder.

Usage

Generate project folder

npx @wordpress/create-block --template @woocommerce/create-product-editor-block my-extension-name

Get started developing

cd my-extension-name
npx wp-env start # Start Wordpress environment

By default, the wp-env environment created will have the new block-based product editor enabled. You can disable this by using the WooCommerce Beta Tester (disable the product-block-editor feature).

Navigate to http://localhost:8888/wp-admin/admin.php?page=wc-admin&path=%2Fadd-product to check out your new block!

Make changes and re-build your block

cd my-extension-name
npm install # Install dependencies
npm run build # Build the javascript

Development of this tool

For development of this tool itself, you can also point to a local directory when creating a product editor block:

npx @wordpress/create-block --template ./path/to/woocommerce/packages/js/create-product-editor-block my-extension-name

This tool is a template to be used with @wordpress/create-block to create a WooCommerce Product Editor Block starting point.