From e6ec7cba6cbad3f9a9fdb459bc5f20714b0507b5 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Thu, 9 May 2019 17:10:17 +0700 Subject: [PATCH] Require Node.js 8 --- .gitignore | 1 + .travis.yml | 2 +- app/index.js | 2 +- app/templates/_package.json | 10 +++++----- app/templates/readme.md | 2 +- app/templates/test.js | 8 +++++--- app/templates/travis.yml | 4 ++-- package.json | 16 ++++++++-------- 8 files changed, 24 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index dba8a59..31ed8dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules +yarn.lock temp diff --git a/.travis.yml b/.travis.yml index 2ae9d62..f98fed0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: node_js node_js: + - '12' - '10' - '8' - - '6' diff --git a/app/index.js b/app/index.js index a229ca9..4c826e5 100644 --- a/app/index.js +++ b/app/index.js @@ -71,7 +71,7 @@ module.exports = class extends Generator { type: 'confirm', default: false, when: x => (x.nyc || this.options.coverage) && (this.options.codecov === undefined) - }]).then(props => { + }]).then(props => { // eslint-disable-line promise/prefer-await-to-then const or = (option, prop) => this.options[option] === undefined ? props[prop || option] : this.options[option]; const cli = or('cli'); diff --git a/app/templates/_package.json b/app/templates/_package.json index 65314cb..53d64d0 100644 --- a/app/templates/_package.json +++ b/app/templates/_package.json @@ -11,7 +11,7 @@ },<% if (cli) { %> "bin": "cli.js",<% } %> "engines": { - "node": ">=6" + "node": ">=8" }, "scripts": { "test": "xo && <% if (nyc) { %>nyc <% } %>ava" @@ -29,10 +29,10 @@ "meow": "^5.0.0" <% } %>}, "devDependencies": { - "ava": "^0.25.0",<% if (codecov) { %> - "codecov": "^3.0.0",<% } %><% if (nyc) { %> - "nyc": "^12.0.0",<% } %> - "xo": "^0.21.0" + "ava": "^1.4.1",<% if (codecov) { %> + "codecov": "^3.4.0",<% } %><% if (nyc) { %> + "nyc": "^14.1.0",<% } %> + "xo": "^0.24.0" }<% if (codecov) { %>, "nyc": { "reporter": [ diff --git a/app/templates/readme.md b/app/templates/readme.md index a737142..6365fed 100644 --- a/app/templates/readme.md +++ b/app/templates/readme.md @@ -32,7 +32,7 @@ Lorem ipsum. #### options -Type: `Object` +Type: `object` ##### foo diff --git a/app/templates/test.js b/app/templates/test.js index 5a1ef77..36ff298 100644 --- a/app/templates/test.js +++ b/app/templates/test.js @@ -2,10 +2,12 @@ import test from 'ava'; import <%= camelModuleName %> from '.'; test('title', t => { - const err = t.throws(() => { + t.throws(() => { <%= camelModuleName %>(123); - }, TypeError); - t.is(err.message, 'Expected a string, got number'); + }, { + instanceOf: TypeError, + message: 'Expected a string, got number' + }); t.is(<%= camelModuleName %>('unicorns'), 'unicorns & rainbows'); }); diff --git a/app/templates/travis.yml b/app/templates/travis.yml index a72d62c..9a7b4e9 100644 --- a/app/templates/travis.yml +++ b/app/templates/travis.yml @@ -1,7 +1,7 @@ language: node_js node_js: + - '12' - '10' - - '8' - - '6'<% if (codecov) { %> + - '8'<% if (codecov) { %> after_script: - './node_modules/.bin/nyc report --reporter=text-lcov > coverage.lcov && ./node_modules/.bin/codecov'<% } %> diff --git a/package.json b/package.json index 4b26426..0e1f0ec 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "url": "sindresorhus.com" }, "engines": { - "node": ">=6" + "node": ">=8" }, "scripts": { "test": "xo && ava" @@ -32,17 +32,17 @@ "sindre" ], "dependencies": { - "humanize-url": "^1.0.1", - "is-scoped": "^1.0.0", - "normalize-url": "^3.3.0", - "superb": "^3.0.0", + "humanize-url": "^2.1.0", + "is-scoped": "^2.1.0", + "normalize-url": "^4.3.0", + "superb": "^4.0.0", "underscore.string": "^3.0.3", - "yeoman-generator": "^3.1.1" + "yeoman-generator": "^4.0.0" }, "devDependencies": { - "ava": "*", + "ava": "^1.4.1", "pify": "^4.0.1", - "xo": "*", + "xo": "^0.24.0", "yeoman-assert": "^3.0.0", "yeoman-test": "^1.0.0" },