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

Create block: Ensure $slug is replaced with passed slug #66528

Merged
merged 15 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
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
Prev Previous commit
Next Next commit
Reorder CLI options in the docs
  • Loading branch information
gziolo committed Oct 28, 2024
commit b90de4a08f469928c6344952fb3e9bdd52b56cb5
20 changes: 10 additions & 10 deletions packages/create-block/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ The rest of the configuration is set to all default values unless overridden wit
```bash
-V, --version output the version number
-t, --template <name> project template type name; allowed values: "static" (default), "es5", the name of an external npm package, or the path to a local directory
--variant choose a block variant as defined by the template
--no-plugin scaffold block files only
--target-dir <directory> the directory where the files will be scaffolded, defaults to the slug
--namespace <value> internal namespace for the block name
--title <value> display title for the block and the WordPress plugin
--short-description <value> short description for the block and the WordPress plugin
--category <name> category name for the block
--variant choose a block variant as defined by the template
--target-dir <directory> the directory where the files will be scaffolded, defaults to the slug
--wp-scripts enable integration with `@wordpress/scripts` package
--no-wp-scripts disable integration with `@wordpress/scripts` package
--wp-env enable integration with `@wordpress/env` package
Expand Down Expand Up @@ -92,14 +92,6 @@ With this argument, `create-block` will generate a [dynamic block](https://devel
$ npx @wordpress/create-block@latest --variant dynamic
```

#### `--help`

With this argument, the `create-block` package outputs usage information.

```bash
$ npx @wordpress/create-block@latest --help
```

#### `--no-plugin`

With this argument, the `create-block` package runs in _No plugin mode_ which only scaffolds block files into the current directory.
Expand All @@ -116,6 +108,14 @@ With this argument, the `create-block` package will add to the generated plugin
$ npx @wordpress/create-block@latest --wp-env
```

#### `--help`

With this argument, the `create-block` package outputs usage information.

```bash
$ npx @wordpress/create-block@latest --help
```

## Available commands in the scaffolded project

The plugin folder created when executing this command, is a node package with a modern build setup that requires no configuration.
Expand Down
12 changes: 6 additions & 6 deletions packages/create-block/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ program
'project template type name; allowed values: "standard", "es5", the name of an external npm package, or the path to a local directory',
'standard'
)
.option( '--variant <variant>', 'the variant of the template to use' )
.option( '--no-plugin', 'scaffold only block files' )
.option(
'--target-dir <directory>',
'the directory where the files will be scaffolded, defaults to the slug'
)
.option( '--namespace <value>', 'internal namespace for the block name' )
.option(
'--title <value>',
Expand All @@ -48,11 +54,6 @@ program
'short description for the block and the WordPress plugin'
)
.option( '--category <name>', 'category name for the block' )
.option( '--variant <variant>', 'the variant of the template to use' )
.option(
'--target-dir <directory>',
'the directory where the files will be scaffolded, defaults to the slug'
)
.option(
'--wp-scripts',
'enable integration with `@wordpress/scripts` package'
Expand All @@ -62,7 +63,6 @@ program
'disable integration with `@wordpress/scripts` package'
)
.option( '--wp-env', 'enable integration with `@wordpress/env` package' )
.option( '--no-plugin', 'scaffold only block files' )
.action(
async (
slug,
Expand Down
Loading