Skip to content

Commit

Permalink
Use Node 18 as default
Browse files Browse the repository at this point in the history
Closes #211, #214.
  • Loading branch information
niksy committed Mar 23, 2024
1 parent 5e5785b commit 5a286ea
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 30 deletions.
2 changes: 1 addition & 1 deletion generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ export default class extends Generator {
type: 'input',
name: 'nodeEngineVersion',
message: 'Which Node engine version this project supports?',
default: 12.22
default: 18
},
{
type: 'input',
Expand Down
4 changes: 2 additions & 2 deletions generators/app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"karma-fixture": "^0.2.6",<% } %>
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5"<% } %><% if ( automatedTests || integrationTests ) { %>,
"mocha": "<% if (browserSupport.ie < 11) { %>^4.1.0<% } else { %><% if ( nodeEngineVersion >= 12 ) { %>^9.1.3<% } else { %>^8.2.0<% } %><% } %>"<% } %><% if ( automatedTests && codeCoverage && !browserModule ) { %>,
"mocha": "<% if (browserSupport.ie < 11) { %>^4.1.0<% } else { %>^10.3.0<% } %>"<% } %><% if ( automatedTests && codeCoverage && !browserModule ) { %>,
"nodemon": "^2.0.6",
"nyc": "^15.1.0"<% } %><% if ( automatedTests && codeCoverage && browserModule && !sassModule ) { %><% if ( bundlingTool === 'webpack' ) { %>,
"@jsdevtools/coverage-istanbul-loader": "^3.0.5"<% } %><% if ( bundlingTool === 'rollup' ) { %>,
Expand Down Expand Up @@ -152,7 +152,7 @@
"ts-node": "^10.1.0",<% } %><% if ( browserModule && usesHtmlFixtures ) { %>
"@types/karma-fixture": "^0.2.5",<% } %>
"@types/node": "^16.3.0"<% if ( automatedTests || integrationTests ) { %>,
"@types/mocha": "<% if ( nodeEngineVersion >= 12 ) { %>^9.0.0<% } else { %>^8.2.3<% } %>"<% } %><% } %>
"@types/mocha": "^10.0.6"<% } %><% } %>
},<% if ( isScopedPackage ) { %>
"publishConfig": {
"access": "public"
Expand Down
8 changes: 3 additions & 5 deletions generators/app/templates/eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ files.push("rollup.config.js"); } %>{
"settings": {
"html/html-extensions": [".svelte"],
"html/indent": "0"
}<% } %><% if ( browserModule || files.length !== 0 || nodeEngineVersion <= 10 ) { %>,
}<% } %><% if ( browserModule || files.length !== 0 ) { %>,
"overrides": [
{
<% if ( files.length !== 0 ) { %>"files": [<% for ( var i = 0, filesLength = files.length; i < filesLength; i++ ) { %>
Expand All @@ -35,11 +35,9 @@ files.push("rollup.config.js"); } %>{
}<% } %>,
"parserOptions": {
"sourceType": "script"
}<% if ( nodeEngineVersion <= 10 ) { %>,
"plugins": ["eslint-plugin-unicorn"]<% } %>,
},
"rules": {
"no-console": 0<% if ( nodeEngineVersion <= 10 ) { %>,
"unicorn/numeric-separators-style": 0<% } %>
"no-console": 0
}
}
]<% } %>
Expand Down
26 changes: 4 additions & 22 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ describe('Automated tests', function () {
'test:watch': 'npm test -- --watch'
},
devDependencies: {
mocha: '^9.1.3'
mocha: '^10.3.0'
}
});
});
Expand Down Expand Up @@ -357,7 +357,7 @@ describe('Integration tests', function () {
{
modules: false,
targets: {
node: '12.22'
node: '18'
}
}
]
Expand Down Expand Up @@ -899,7 +899,7 @@ describe('Transpile', function () {
{
modules: false,
targets: {
node: '12.22'
node: '18'
}
}
]
Expand Down Expand Up @@ -1490,7 +1490,7 @@ describe('TypeScript, with comments', function () {
devDependencies: {
'typescript': '^4.3.5',
'@types/node': '^16.3.0',
'@types/mocha': '^9.0.0'
'@types/mocha': '^10.0.6'
}
});
});
Expand All @@ -1509,25 +1509,7 @@ describe('TypeScript, full', function () {
.toPromise();
});

it('should create necessary files', function () {
assert.file(['tsconfig.json']);
});

it('should fill rollup.config.js with correct information', function () {
assert.fileContent('rollup.config.js', "input: 'index.ts'");
});

it('should fill package.json with correct information', function () {
assert.jsonFileContent('package.json', {
types: 'esm/index.d.ts',
scripts: {
'lint:types': 'tsc'
},
devDependencies: {
'typescript': '^4.3.5',
'@types/node': '^16.3.0',
'@types/mocha': '^9.0.0'
}
});
});
});

0 comments on commit 5a286ea

Please sign in to comment.