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: Fix issue with processing unrelated engines #29066

Merged
merged 2 commits into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
71 changes: 54 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ _Example:_
```diff
+++ b/packages/scripts/package.json
@@ -43,7 +43,6 @@
"check-node-version": "^3.1.1",
"check-node-version": "^4.1.0",
"cross-spawn": "^5.1.0",
"eslint": "^7.1.0",
- "jest": "^26.6.3",
Expand Down
4 changes: 4 additions & 0 deletions packages/create-block/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

- Block scaffolded with `esnext` template is now registered from `block.json` with the `register_block_type_from_metadata` helper ([#28883](https://github.com/WordPress/gutenberg/pull/28883)).

### Bug Fixes

- Updated `check-node-version` to version `^4.1.0` that no longer processes unrelated engines ([#29066](https://github.com/WordPress/gutenberg/pull/29066)).

## 2.0.1 (2021-02-01)

### Bug Fix
Expand Down
2 changes: 1 addition & 1 deletion packages/create-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@wordpress/lazy-import": "file:../lazy-import",
"chalk": "^4.0.0",
"check-node-version": "^3.1.1",
"check-node-version": "^4.1.0",
"commander": "^4.1.0",
"execa": "^4.0.2",
"fast-glob": "^2.2.7",
Expand Down
5 changes: 5 additions & 0 deletions packages/scripts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

## Unreleased

### New Features

- Default `check-engines` command to the `engines` config in `package.json` file of the current project ([#29066](https://github.com/WordPress/gutenberg/pull/29066)).

### Enhancements

- Make `check-licenses` command compatible with npm v7 ([#28909](https://github.com/WordPress/gutenberg/pull/28909)).
- Add `Python 2.0` to non-GPL compatible OSS licenses allowed for development in `check-licenses` command ([#29968](https://github.com/WordPress/gutenberg/pull/28968)).
- Updated `check-node-version` to version `^4.1.0` that no longer processes unrelated engines with `check-engines` command ([#29066](https://github.com/WordPress/gutenberg/pull/29066)).

## 13.0.0 (2021-01-21)

Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"babel-jest": "^26.6.3",
"babel-loader": "^8.1.0",
"chalk": "^4.0.0",
"check-node-version": "^3.1.1",
"check-node-version": "^4.1.0",
"clean-webpack-plugin": "^3.0.0",
"cross-spawn": "^5.1.0",
"css-loader": "^3.5.2",
Expand Down
7 changes: 3 additions & 4 deletions packages/scripts/scripts/check-engines.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { sync: resolveBin } = require( 'resolve-bin' );
/**
* Internal dependencies
*/
const { getArgsFromCLI, hasArgInCLI } = require( '../utils' );
const { getArgsFromCLI, hasArgInCLI, getPackageProp } = require( '../utils' );

const getConfig = () => {
const hasConfig =
Expand All @@ -19,9 +19,8 @@ const getConfig = () => {
if ( hasConfig ) {
return [];
}
const {
engines: { node, npm },
} = require( '../package.json' );
const { node, npm } =
getPackageProp( 'engines' ) || require( '../package.json' ).engines;

return [ '--node', node, '--npm', npm ];
};
Expand Down