From 3699fbf81099777d4ded71404ef36be3d5e00842 Mon Sep 17 00:00:00 2001 From: Ryan Welcher Date: Tue, 26 Mar 2024 14:57:35 -0400 Subject: [PATCH 1/3] Add new template variable called namespacePascalCase and fix namespaceSnakeCase that was incorrecly using the slug instead of the namespace. --- packages/create-block/lib/scaffold.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/create-block/lib/scaffold.js b/packages/create-block/lib/scaffold.js index da753d13ae394..b7d4addde6a82 100644 --- a/packages/create-block/lib/scaffold.js +++ b/packages/create-block/lib/scaffold.js @@ -98,7 +98,8 @@ module.exports = async ( const view = { ...transformedValues, - namespaceSnakeCase: snakeCase( transformedValues.slug ), + namespaceSnakeCase: snakeCase( transformedValues.namespace ), + namespacePascalCase: pascalCase( transformedValues.namespace ), slugSnakeCase: snakeCase( transformedValues.slug ), slugPascalCase: pascalCase( transformedValues.slug ), ...variantVars, From a1e6a51b1218675d54034f139f66c1c88a228cf5 Mon Sep 17 00:00:00 2001 From: Ryan Welcher Date: Tue, 26 Mar 2024 15:49:56 -0400 Subject: [PATCH 2/3] Use new namespacePascalCase template variable and remove some extraneous whitespace --- packages/create-block/lib/templates/plugin/$slug.php.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/create-block/lib/templates/plugin/$slug.php.mustache b/packages/create-block/lib/templates/plugin/$slug.php.mustache index 90f293f1472f4..45487ef61006f 100644 --- a/packages/create-block/lib/templates/plugin/$slug.php.mustache +++ b/packages/create-block/lib/templates/plugin/$slug.php.mustache @@ -27,7 +27,7 @@ * Update URI: {{{updateURI}}} {{/updateURI}} * - * @package {{namespace}} + * @package {{namespacePascalCase}} */ if ( ! defined( 'ABSPATH' ) ) { From 0dd73f9129a4203f3cc5eb55b4349b58c8e1bf09 Mon Sep 17 00:00:00 2001 From: Ryan Welcher Date: Tue, 26 Mar 2024 15:58:12 -0400 Subject: [PATCH 3/3] Update changelog --- packages/create-block/CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/create-block/CHANGELOG.md b/packages/create-block/CHANGELOG.md index 9bd132fc13672..22d04786d1088 100644 --- a/packages/create-block/CHANGELOG.md +++ b/packages/create-block/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### New Feature + +- Add new `namespacePascalCase` template variable ([#60223](https://github.com/WordPress/gutenberg/pull/60223)). + ## 4.38.0 (2024-03-21) ## 4.37.0 (2024-03-06) @@ -14,7 +18,7 @@ ### Internal -- Remove deprecated `viewModule` field ([#59198](https://github.com/WordPress/gutenberg/pull/59198)). +- Remove deprecated `viewModule` field ([#59198](https://github.com/WordPress/gutenberg/pull/59198)). ## 4.35.0 (2024-02-09)