Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PascalCase slug to create-block template strings #35462

Merged
merged 3 commits into from
Oct 8, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add PascalCase slug to create-block template strings
  • Loading branch information
opr committed Oct 8, 2021
commit 332a8f0403eece93a987c120209b594b8509c82a
3 changes: 2 additions & 1 deletion packages/create-block/lib/scaffold.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
const { writeFile } = require( 'fs' ).promises;
const { snakeCase } = require( 'lodash' );
const { snakeCase, camelCase, upperFirst } = require( 'lodash' );
const makeDir = require( 'make-dir' );
const { render } = require( 'mustache' );
const { dirname, join } = require( 'path' );
Expand Down Expand Up @@ -53,6 +53,7 @@ module.exports = async (
namespaceSnakeCase: snakeCase( namespace ),
slug,
slugSnakeCase: snakeCase( slug ),
slugPascalCase: upperFirst( camelCase( slug ) ),
title,
description,
dashicon,
Expand Down