Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
Require Node.js 6
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jun 17, 2018
1 parent 45c7156 commit 5bf99e3
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 75 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
@@ -1,2 +1 @@
* text=auto
*.js text eol=lf
* text=auto eol=lf
1 change: 1 addition & 0 deletions .npmrc
@@ -0,0 +1 @@
package-lock=false
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,5 +1,5 @@
language: node_js
node_js:
- '10'
- '8'
- '6'
- '4'
3 changes: 3 additions & 0 deletions app/index.js
Expand Up @@ -30,6 +30,7 @@ module.exports = class extends Generator {
desc: 'Upload coverage to codecov.io (implies coverage)'
});
}

init() {
return this.prompt([{
name: 'moduleName',
Expand Down Expand Up @@ -115,9 +116,11 @@ module.exports = class extends Generator {
mv('_package.json', 'package.json');
});
}

git() {
this.spawnCommandSync('git', ['init']);
}

install() {
this.installDependencies({bower: false});
}
Expand Down
12 changes: 6 additions & 6 deletions app/templates/_package.json
Expand Up @@ -11,7 +11,7 @@
},<% if (cli) { %>
"bin": "cli.js",<% } %>
"engines": {
"node": ">=4"
"node": ">=6"
},
"scripts": {
"test": "xo && <% if (nyc) { %>nyc <% } %>ava"
Expand All @@ -26,13 +26,13 @@
""
],
"dependencies": {<% if (cli) { %>
"meow": "^3.7.0"
"meow": "^5.0.0"
<% } %>},
"devDependencies": {
"ava": "^0.20.0",<% if (codecov) { %>
"codecov": "^2.2.0",<% } %><% if (nyc) { %>
"nyc": "^11.0.0",<% } %>
"xo": "^0.18.2"
"ava": "^0.25.0",<% if (codecov) { %>
"codecov": "^3.0.0",<% } %><% if (nyc) { %>
"nyc": "^12.0.0",<% } %>
"xo": "^0.21.0"
}<% if (codecov) { %>,
"nyc": {
"reporter": [
Expand Down
3 changes: 1 addition & 2 deletions app/templates/gitattributes
@@ -1,2 +1 @@
* text=auto
*.js text eol=lf
* text=auto eol=lf
7 changes: 3 additions & 4 deletions app/templates/index.js
@@ -1,10 +1,9 @@
'use strict';
module.exports = (input, opts) => {

module.exports = (input, options = {}) => {
if (typeof input !== 'string') {
throw new TypeError(`Expected a string, got ${typeof input}`);
}

opts = opts || {};

return input + ' & ' + (opts.postfix || 'rainbows');
return input + ' & ' + (options.postfix || 'rainbows');
};
2 changes: 2 additions & 0 deletions app/templates/readme.md
Expand Up @@ -32,6 +32,8 @@ Lorem ipsum.

#### options

Type: `Object`

##### foo

Type: `boolean`<br>
Expand Down
6 changes: 3 additions & 3 deletions app/templates/test.js
@@ -1,11 +1,11 @@
import test from 'ava';
import m from '.';
import <%= camelModuleName %> from '.';

test('title', t => {
const err = t.throws(() => {
m(123);
<%= camelModuleName %>(123);
}, TypeError);
t.is(err.message, 'Expected a string, got number');

t.is(m('unicorns'), 'unicorns & rainbows');
t.is(<%= camelModuleName %>('unicorns'), 'unicorns & rainbows');
});
4 changes: 2 additions & 2 deletions app/templates/travis.yml
@@ -1,7 +1,7 @@
language: node_js
node_js:
- '10'
- '8'
- '6'
- '4'<% if (codecov) { %>
- '6'<% if (codecov) { %>
after_script:
- './node_modules/.bin/nyc report --reporter=text-lcov > coverage.lcov && ./node_modules/.bin/codecov'<% } %>
110 changes: 55 additions & 55 deletions package.json
@@ -1,57 +1,57 @@
{
"name": "generator-nm",
"version": "3.5.0",
"description": "Scaffold out a node module",
"license": "MIT",
"repository": "sindresorhus/generator-nm",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"app"
],
"keywords": [
"yeoman-generator",
"plugin",
"boilerplate",
"template",
"scaffold",
"node",
"module",
"node_module",
"node-module",
"init",
"sindre"
],
"dependencies": {
"humanize-url": "^1.0.1",
"is-scoped": "^1.0.0",
"normalize-url": "^1.2.0",
"superb": "^1.1.3",
"underscore.string": "^3.0.3",
"yeoman-generator": "^1.0.1"
},
"devDependencies": {
"ava": "*",
"pify": "^3.0.0",
"xo": "*",
"yeoman-assert": "^3.0.0",
"yeoman-test": "^1.0.0"
},
"ava": {
"failWithoutAssertions": false
},
"xo": {
"ignores": [
"app/templates/**"
]
}
"name": "generator-nm",
"version": "3.5.0",
"description": "Scaffold out a node module",
"license": "MIT",
"repository": "sindresorhus/generator-nm",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=6"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"app"
],
"keywords": [
"yeoman-generator",
"plugin",
"boilerplate",
"template",
"scaffold",
"node",
"module",
"node_module",
"node-module",
"init",
"sindre"
],
"dependencies": {
"humanize-url": "^1.0.1",
"is-scoped": "^1.0.0",
"normalize-url": "^2.0.0",
"superb": "^2.0.0",
"underscore.string": "^3.0.3",
"yeoman-generator": "^2.0.5"
},
"devDependencies": {
"ava": "*",
"pify": "^3.0.0",
"xo": "*",
"yeoman-assert": "^3.0.0",
"yeoman-test": "^1.0.0"
},
"ava": {
"failWithoutAssertions": false
},
"xo": {
"ignores": [
"app/templates/**"
]
}
}

0 comments on commit 5bf99e3

Please sign in to comment.