Skip to content

Commit

Permalink
Merge pull request #206 from merkle-open/feature/node-18
Browse files Browse the repository at this point in the history
add node 18 compatibility
  • Loading branch information
ernscht authored Mar 12, 2023
2 parents 98d0f2e + fe3322e commit 1bfb8ea
Show file tree
Hide file tree
Showing 37 changed files with 623 additions and 30,631 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Test - ${{ matrix.platform }} - Node v${{ matrix.node-version }}
strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [14.x, 16.x, 18.x]
platform: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand All @@ -28,7 +28,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci
run: npm install

- name: Run tests
run: npm test || npm test
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.19.1
18.15.0
30,796 changes: 390 additions & 30,406 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"repository": "merkle-open/generator-nitro",
"author": "The Nitro Team",
"engines": {
"node": ">=14.15.0 <17",
"npm": ">=6.14.8 <9"
"node": ">=14.15.0 <19",
"npm": ">=6.14.8 <10"
},
"scripts": {
"clean": "npx -y npm-run-all --npm-path npm clean:*",
Expand Down Expand Up @@ -42,8 +42,8 @@
"cz-conventional-changelog": "3.3.0",
"lerna": "6.5.1",
"markdownlint-cli": "0.33.0",
"npm-check-updates": "16.7.10",
"npm-check-updates": "16.7.12",
"npm-run-all": "4.1.5",
"rimraf": "4.3.0"
"rimraf": "4.4.0"
}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.19.1
18.15.0
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"private": true,
"author": "The Nitro Team",
"engines": {
"node": ">=14.15.0 <17",
"npm": ">=6.14.8 <9"
"node": ">=14.15.0 <19",
"npm": ">=6.14.8 <10"
},
"scripts": {
"\n# PROJECT ------- ": "",
Expand Down Expand Up @@ -87,7 +87,7 @@
"core-js": "3.29.0"<% if (options.exampleCode) { %>,
"flatpickr": "4.6.13",
"handlebars": "4.7.7",
"jquery": "3.6.3",
"jquery": "3.6.4",
"lazysizes": "5.3.2",
"lottie-web": "5.10.2",
"prevent-window-opener-attacks": "0.3.0"<% } %><% if (options.jsCompiler === 'js') { %>,
Expand Down Expand Up @@ -124,15 +124,15 @@
"generator-nitro": "<%= version %>",
"gulp": "4.0.2",
"husky": "8.0.3",
"html-validate": "7.13.2",
"html-validate": "7.13.3",
"license-checker": "25.0.1",
"lighthouse": "10.0.2",
"lint-staged": "13.1.2",<% if (options.themes) { %>
"lint-staged": "13.2.0",<% if (options.themes) { %>
"node-sass": "8.0.0",<% } %>
"npm-check-updates": "16.7.10",
"npm-check-updates": "16.7.12",
"npm-run-all": "4.1.5",
"prettier": "2.8.4",
"rimraf": "4.3.0",
"rimraf": "4.4.0",
"stylelint": "14.16.1",<% if (options.jsCompiler === 'ts') { %>
"typescript": "4.9.5",<% } %>
"webpack-cli": "4.10.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Nitro is simple, fast and flexible. Use this app for all your frontend work.

This application was created by the yeoman generator for nitro.
Before using, you need of course [node](https://nodejs.org/) installed.
Nitro is currently tested with the LTS maintenance versions (release 16.x and 14.x).
Nitro is tested with the current ["Active" LTS version](https://github.com/nodejs/Release#release-schedule)
and with the LTS maintenance versions (release 16.x and 14.x).

Install the project dependencies in the project root:

Expand Down
6 changes: 3 additions & 3 deletions packages/generator-nitro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"repository": "merkle-open/generator-nitro",
"author": "The Nitro Team",
"engines": {
"node": ">=14.15.0 <17",
"npm": ">=6.14.8 <9"
"node": ">=14.15.0 <19",
"npm": ">=6.14.8 <10"
},
"main": "generators/app/index.js",
"scripts": {
"lint": "eslint .",
"prepublishOnly": "npx -y [email protected]",
"pretest": "npm run lint",
"test": "jasmine --config=tests/jasmine/support/jasmine.json"
"test": "jasmine --config=tests/jasmine/jasmine.json"
},
"files": [
"generators/app",
Expand Down
3 changes: 2 additions & 1 deletion packages/generator-nitro/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Nitro is simple, fast and flexible. It works on macOS, Windows and Linux. Use th
## Usage

Before using, you need of course [node](https://nodejs.org/) installed.
Nitro and the Nitro generator are currently tested with the LTS maintenance versions (release 16.x and 14.x).
Nitro and the Nitro generator are tested with the current ["Active" LTS version](https://github.com/nodejs/Release#release-schedule)
and with the LTS maintenance versions (release 16.x and 14.x).

### Create a new project

Expand Down

This file was deleted.

28 changes: 28 additions & 0 deletions packages/generator-nitro/tests/jasmine/helpers/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const crypto = require('crypto');
const os = require('os');
const path = require('path');

// to avoid mixing up properties with global '.yo-rc-global.json', we have to pass in all prompt options for test cases
// (see bug: https://github.com/yeoman/yeoman-test/issues/45)
const defaultPrompts = {
templateEngine: 'hbs',
jsCompiler: 'ts',
themes: false,
clientTpl: false,
exampleCode: false,
exporter: false,
};

const getRandomString = (length = 20) => {
return crypto.randomBytes(length).toString('hex').substring(0, length);
};

function getTempFolder(base, randomize = true) {
const folder = randomize ? `${base}-${getRandomString(3)}` : base;
return path.join(os.tmpdir(), `nitro/${folder}`)
}

module.exports = {
defaultPrompts,
getTempFolder,
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"spec_dir": "tests/jasmine",
"spec_dir": "tests/jasmine/spec",
"spec_files": ["**/*[sS]pec.js"],
"jsLoader": "require",
"env": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
const path = require('path');
const assert = require('yeoman-assert');
const helpers = require('yeoman-test');
const os = require('os');
const defaultPrompts = require('./utils/appDefaultPrompts');
const utils = require('../../helpers/utils');

const folder = 'temp-test-default-app';

describe('nitro:app', () => {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 25000;

describe('when using default options', () => {
beforeAll((done) => {
helpers
.run(path.join(__dirname, '../../../generators/app'))
.inDir(path.join(os.tmpdir(), './temp-test')) // Clear the directory and set it as the CWD
.withOptions({ 'skip-install': true, 'skip-questions': true }) // Mock options passed in
.withPrompts(defaultPrompts)
.on('end', done);
beforeAll(() => {
return helpers
.run(path.join(__dirname, '../../../../generators/app'))
.inDir(utils.getTempFolder(folder, false))
.withOptions({ 'skip-install': true, 'skip-questions': true })
.withPrompts(utils.defaultPrompts);
});

// base files
Expand Down Expand Up @@ -56,7 +56,7 @@ describe('nitro:app', () => {
});

it('package.json contains project name', () => {
assert.fileContent([['package.json', '"name": "temp-test",']]);
assert.fileContent([['package.json', `"name": "${folder}",`]]);
});

it('package.json contains @nitro dependencies', () => {
Expand Down
Loading

0 comments on commit 1bfb8ea

Please sign in to comment.