@wordpress/create-block 4.65.0 → 4.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -67,6 +67,7 @@ The rest of the configuration is set to all default values unless overridden wit
67
67
  --wp-scripts enable integration with `@wordpress/scripts` package
68
68
  --no-wp-scripts disable integration with `@wordpress/scripts` package
69
69
  --wp-env enable integration with `@wordpress/env` package
70
+ --textdomain <value> text domain for internationalization
70
71
  -h, --help output usage information
71
72
  ```
72
73
 
@@ -108,6 +109,14 @@ With this argument, the `create-block` package will add to the generated plugin
108
109
  $ npx @wordpress/create-block@latest --wp-env
109
110
  ```
110
111
 
112
+ #### `--textdomain`
113
+
114
+ With this argument, the `create-block` package will a generate a block with the provided text domain. If not specified, the block’s slug is used as the default text domain.
115
+
116
+ ```bash
117
+ $ npx @wordpress/create-block@latest --textdomain my-custom-domain
118
+ ```
119
+
111
120
  #### `--help`
112
121
 
113
122
  With this argument, the `create-block` package outputs usage information.
package/lib/index.js CHANGED
@@ -63,6 +63,7 @@ program
63
63
  'disable integration with `@wordpress/scripts` package'
64
64
  )
65
65
  .option( '--wp-env', 'enable integration with `@wordpress/env` package' )
66
+ .option( '--textdomain <value>', 'text domain for internationalization' )
66
67
  .action(
67
68
  async (
68
69
  slug,
@@ -77,6 +78,7 @@ program
77
78
  wpEnv,
78
79
  variant,
79
80
  targetDir,
81
+ textdomain,
80
82
  }
81
83
  ) => {
82
84
  try {
@@ -110,6 +112,7 @@ program
110
112
  wpScripts,
111
113
  wpEnv,
112
114
  targetDir,
115
+ textdomain,
113
116
  } ).filter( ( [ , value ] ) => value !== undefined )
114
117
  );
115
118
 
@@ -158,7 +161,7 @@ program
158
161
  'description',
159
162
  'dashicon',
160
163
  'category',
161
- ! plugin && 'textdomain',
164
+ ! plugin && ! textdomain && 'textdomain',
162
165
  ].filter( Boolean ),
163
166
  variant,
164
167
  optionsValues
@@ -216,5 +219,8 @@ program
216
219
  log.info(
217
220
  ` $ ${ commandName } todo-list --template es5 --title "TODO List"`
218
221
  );
222
+ log.info(
223
+ ` $ ${ commandName } todo-list --no-plugin --textdomain=my-plugin`
224
+ );
219
225
  } )
220
226
  .parse( process.argv );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/create-block",
3
- "version": "4.65.0",
3
+ "version": "4.67.0",
4
4
  "description": "Generates PHP, JS and CSS code for registering a block for a WordPress plugin.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@inquirer/prompts": "^7.2.0",
35
- "@wordpress/lazy-import": "^2.22.0",
35
+ "@wordpress/lazy-import": "^2.24.0",
36
36
  "chalk": "^4.0.0",
37
37
  "change-case": "^4.1.2",
38
38
  "check-node-version": "^4.1.0",
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "01a314d7e46a50101e328fdb11959c441e49372d"
51
+ "gitHead": "9c03d1458cae76792ae15e67b421205836bf4393"
52
52
  }