@wordpress/create-block 3.2.0 → 3.5.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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 3.3.0 (2022-06-01)
6
+
7
+ ### Enhancement
8
+
9
+ - Read the block name from `block.json` file in JavaScript files ([#41273](https://github.com/WordPress/gutenberg/pull/41273)).
10
+
5
11
  ## 3.2.0 (2022-05-18)
6
12
 
7
13
  ### Bug Fix
@@ -2,7 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  const { command } = require( 'execa' );
5
- const { isEmpty, omitBy, size } = require( 'lodash' );
5
+ const { isEmpty, omitBy } = require( 'lodash' );
6
6
  const npmPackageArg = require( 'npm-package-arg' );
7
7
  const { join } = require( 'path' );
8
8
  const writePkg = require( 'write-pkg' );
@@ -76,7 +76,7 @@ module.exports = async ( {
76
76
  }
77
77
 
78
78
  if ( wpScripts ) {
79
- if ( size( npmDependencies ) ) {
79
+ if ( npmDependencies.length ) {
80
80
  info( '' );
81
81
  info(
82
82
  'Installing npm dependencies. It might take a couple of minutes...'
@@ -99,7 +99,7 @@ module.exports = async ( {
99
99
  }
100
100
  }
101
101
 
102
- if ( size( npmDevDependencies ) ) {
102
+ if ( npmDevDependencies.length ) {
103
103
  info( '' );
104
104
  info(
105
105
  'Installing npm devDependencies. It might take a couple of minutes...'
package/lib/prompts.js CHANGED
@@ -88,7 +88,8 @@ const version = {
88
88
  message: 'The current version number of the plugin:',
89
89
  validate( input ) {
90
90
  // Regular expression was copied from https://semver.org.
91
- const validSemVerPattern = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
91
+ const validSemVerPattern =
92
+ /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
92
93
  if ( ! validSemVerPattern.test( input ) ) {
93
94
  return 'Invalid Semantic Version provided. Visit https://regex101.com/r/vkijKf/1/ to discover all valid patterns.';
94
95
  }
@@ -19,13 +19,14 @@ import './style.scss';
19
19
  */
20
20
  import Edit from './edit';
21
21
  import save from './save';
22
+ import metadata from './block.json';
22
23
 
23
24
  /**
24
25
  * Every block starts by registering a new block type definition.
25
26
  *
26
27
  * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/
27
28
  */
28
- registerBlockType( '{{namespace}}/{{slug}}', {
29
+ registerBlockType( metadata.name, {
29
30
  /**
30
31
  * @see ./edit.js
31
32
  */
@@ -7,7 +7,7 @@
7
7
  {{#description}}
8
8
  * Description: {{description}}
9
9
  {{/description}}
10
- * Requires at least: 5.8
10
+ * Requires at least: 5.9
11
11
  * Requires PHP: 7.0
12
12
  * Version: {{version}}
13
13
  {{#author}}
@@ -3,7 +3,7 @@
3
3
  Contributors: {{author}}
4
4
  {{/author}}
5
5
  Tags: block
6
- Tested up to: 5.9
6
+ Tested up to: 6.0
7
7
  Stable tag: {{version}}
8
8
  {{#license}}
9
9
  License: {{license}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/create-block",
3
- "version": "3.2.0",
3
+ "version": "3.5.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",
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "198fa129cf1af8dc615918987ea6795cd40ab7df"
51
+ "gitHead": "a80eeb62ec7cb1418b9915c277e084a29d6665e3"
52
52
  }