From b4fe3f4cb827888d361b57cb75642427be17efcb Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Sat, 17 Feb 2024 22:11:40 +0900 Subject: [PATCH] Create Block: Add missing `viewScriptModule` field (#59140) * Create Block: Add missing `viewScriptModule` field * Update changelog * Fix double space Co-authored-by: t-hamano Co-authored-by: c4rl0sbr4v0 --- packages/create-block-interactive-template/README.md | 2 +- packages/create-block-tutorial-template/README.md | 2 +- packages/create-block/CHANGELOG.md | 4 ++++ packages/create-block/lib/init-block.js | 2 ++ packages/create-block/lib/scaffold.js | 2 ++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/create-block-interactive-template/README.md b/packages/create-block-interactive-template/README.md index adf3cab6594cc9..9ae25fba2a1417 100644 --- a/packages/create-block-interactive-template/README.md +++ b/packages/create-block-interactive-template/README.md @@ -7,7 +7,7 @@ This is a template for [`@wordpress/create-block`](https://github.com/WordPress/ This block template can be used by running the following command: ```bash -npx @wordpress/create-block --template @wordpress/create-block-interactive-template +npx @wordpress/create-block --template @wordpress/create-block-interactive-template ``` It requires Gutenberg 17.5 or higher. diff --git a/packages/create-block-tutorial-template/README.md b/packages/create-block-tutorial-template/README.md index f883ff5fb79d47..cf9cfe99a0d376 100644 --- a/packages/create-block-tutorial-template/README.md +++ b/packages/create-block-tutorial-template/README.md @@ -7,7 +7,7 @@ This is a template for [`@wordpress/create-block`](https://github.com/WordPress/ This block template can be used by running the following command: ```bash -npx @wordpress/create-block --template @wordpress/create-block-tutorial-template +npx @wordpress/create-block --template @wordpress/create-block-tutorial-template ``` Use the default options when prompted in the terminal. diff --git a/packages/create-block/CHANGELOG.md b/packages/create-block/CHANGELOG.md index 31cb293ca19b2f..80f254b5defc10 100644 --- a/packages/create-block/CHANGELOG.md +++ b/packages/create-block/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Bug Fix + +- Add missing `viewScriptModule` field ([#59140](https://github.com/WordPress/gutenberg/pull/59140)). + ## 4.35.0 (2024-02-09) ## 4.34.0 (2024-01-24) diff --git a/packages/create-block/lib/init-block.js b/packages/create-block/lib/init-block.js index 58e62f06bed099..0a364b793d21cd 100644 --- a/packages/create-block/lib/init-block.js +++ b/packages/create-block/lib/init-block.js @@ -32,6 +32,7 @@ async function initBlockJSON( { viewStyle, render, viewModule, + viewScriptModule, viewScript, customBlockJSON, example, @@ -66,6 +67,7 @@ async function initBlockJSON( { viewStyle, render, viewModule, + viewScriptModule, viewScript, ...customBlockJSON, } ).filter( ( [ , value ] ) => !! value ) diff --git a/packages/create-block/lib/scaffold.js b/packages/create-block/lib/scaffold.js index d0c09dcd07a6b0..bb1e7a485259a6 100644 --- a/packages/create-block/lib/scaffold.js +++ b/packages/create-block/lib/scaffold.js @@ -46,6 +46,7 @@ module.exports = async ( viewStyle, render, viewModule, + viewScriptModule, viewScript, variantVars, customPackageJSON, @@ -88,6 +89,7 @@ module.exports = async ( viewStyle, render, viewModule, + viewScriptModule, viewScript, variantVars, customPackageJSON,