Skip to content

Commit

Permalink
Default check-engines command to the engines config in `package.j…
Browse files Browse the repository at this point in the history
…son` file of the current project
  • Loading branch information
gziolo committed Feb 17, 2021
1 parent b281db0 commit 98a705b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/create-block/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

### Bug Fixes

- Updated `check-node-version` to version `^4.1.0` that no longer processes unrelated engines.
- 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)

Expand Down
6 changes: 5 additions & 1 deletion packages/scripts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +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.
- 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
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

0 comments on commit 98a705b

Please sign in to comment.