Skip to content

Commit

Permalink
Merge pull request #1138 from userfrosting/node-12-min
Browse files Browse the repository at this point in the history
Raise minimum node version
  • Loading branch information
Silic0nS0ldier authored Mar 5, 2021
2 parents d911b55 + cdcfa44 commit 4fcff0f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: 10
node-version: 14

- name: Setup Redis-server
uses: supercharge/redis-github-action@1.1.0
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: 10
node-version: 14

- name: Setup Redis-server
uses: supercharge/redis-github-action@1.1.0
Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: 10
node-version: 14

- name: Setup Redis-server
uses: supercharge/redis-github-action@1.1.0
Expand Down Expand Up @@ -268,7 +268,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: 10
node-version: 14

- name: Copy .env
run: php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');"
Expand Down Expand Up @@ -305,7 +305,7 @@ jobs:
fail-fast: false
matrix:
php_versions: ['7.4']
node_versions: ['10', '11', '12', '14']
node_versions: ['12.17.0', '14', '15']
os: [ubuntu-latest, windows-latest]

runs-on: ${{ matrix.os }}
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed
- Changed `.php_cs` to `.php_cs.dist`.
- Changed `phpunit.xml` to `phpunit.xml.dist`.
- Raised NodeJS version requirement from `>=10.12.0` to `^12.17.0 || >=14.0.0`.
- Raised NPM version requirement from `>=6.0.0` to `>=6.14.4`.

### Fixed
- Replaced AdminLTE credit in default footer (old link was dead).
-

### Removed
- Removed deprecated `UserFrosting\System\Bakery\Migration` (deprecated in 4.2.0).
- Removed deprecated `UserFrosting\Tests\DatabaseTransactions` (deprecated in 4.2.0).
Expand Down
4 changes: 2 additions & 2 deletions app/defines.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
define('UserFrosting\DS', '/');
define('UserFrosting\PHP_MIN_VERSION', '7.1');
define('UserFrosting\PHP_RECOMMENDED_VERSION', '7.3');
define('UserFrosting\NODE_MIN_VERSION', 'v10.12.0');
define('UserFrosting\NPM_MIN_VERSION', '6.0.0');
define('UserFrosting\NODE_MIN_VERSION', '^12.17.0 || >=14.0.0');
define('UserFrosting\NPM_MIN_VERSION', '>=6.14.4');

// Directories and Paths

Expand Down
1 change: 1 addition & 0 deletions app/sprinkles/core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
}
],
"require": {
"composer/semver": "^3.2.4",
"doctrine/dbal": "^2.5",
"filp/whoops": "^2.3.1",
"illuminate/cache": "5.8.*",
Expand Down
12 changes: 7 additions & 5 deletions app/sprinkles/core/src/Bakery/Helper/NodeVersionCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

namespace UserFrosting\Sprinkle\Core\Bakery\Helper;

use Composer\Semver\Semver;

/**
* Helper trait to check NodeJS and NPM version dependencies.
*
Expand All @@ -24,10 +26,10 @@ trait NodeVersionCheck
*/
protected function checkNodeVersion()
{
$npmVersion = trim(exec('node -v'));
$nodeVersion = trim(exec('node -v'));

if (version_compare($npmVersion, \UserFrosting\NODE_MIN_VERSION, '<')) {
$this->io->error('UserFrosting requires Node version ' . \UserFrosting\NODE_MIN_VERSION . ' or above. Check the documentation for more details.');
if (!Semver::satisfies($nodeVersion, \UserFrosting\NODE_MIN_VERSION)) {
$this->io->error('UserFrosting requires a Node version that satisfies "' . \UserFrosting\NODE_MIN_VERSION . '", but found . Check the documentation for more details.');
exit(1);
}

Expand All @@ -43,8 +45,8 @@ protected function checkNpmVersion()
{
$npmVersion = trim(exec('npm -v'));

if (version_compare($npmVersion, \UserFrosting\NPM_MIN_VERSION, '<')) {
$this->io->error('UserFrosting requires npm version ' . \UserFrosting\NPM_MIN_VERSION . ' or above. Check the documentation for more details.');
if (!Semver::satisfies($npmVersion, \UserFrosting\NPM_MIN_VERSION)) {
$this->io->error('UserFrosting requires a NPM version that satisfies "' . \UserFrosting\NPM_MIN_VERSION . '" or above. Check the documentation for more details.');
exit(1);
}

Expand Down
4 changes: 2 additions & 2 deletions build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"uf-clean": "./node_modules/.bin/gulp clean"
},
"engines": {
"node": ">=10.12.0",
"npm": ">=6.0.0"
"node": "^12.17.0 || >=14.0.0",
"npm": ">=6.14.4"
},
"engineStrict": true
}

0 comments on commit 4fcff0f

Please sign in to comment.