Skip to content

Commit

Permalink
[Create block] Add new namespacePascalCase template variable. (WordPr…
Browse files Browse the repository at this point in the history
…ess#60223)

* Add new template variable called namespacePascalCase and fix namespaceSnakeCase that was incorrecly using the slug instead of the namespace.

* Use new namespacePascalCase template variable and remove some extraneous whitespace

* Update changelog

Co-authored-by: ryanwelcher <welcher@git.wordpress.org>
Co-authored-by: justintadlock <greenshady@git.wordpress.org>
  • Loading branch information
3 people authored and cbravobernal committed Apr 9, 2024
1 parent 95ea0c1 commit b17de55
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/create-block/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion packages/create-block/lib/scaffold.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* Update URI: {{{updateURI}}}
{{/updateURI}}
*
* @package {{namespace}}
* @package {{namespacePascalCase}}
*/

if ( ! defined( 'ABSPATH' ) ) {
Expand Down

0 comments on commit b17de55

Please sign in to comment.