Skip to content

Commit a27da9e

Browse files
committed
fix(project): make templates for package.json and .travis.yml
1 parent e61281f commit a27da9e

File tree

5 files changed

+121
-28
lines changed

5 files changed

+121
-28
lines changed

.travis.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@ language: node_js
22
cache:
33
directories:
44
- node_modules
5-
notifications:
6-
email: false
75
node_js:
86
- '7'
97
- '6'
108
- '4'
9+
before_install:
10+
- npm i -g howardroark/pollinate#feature/keep-history
1111
before_script:
1212
- npm prune
1313
script:
1414
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
15-
after_success:
16-
- npm run semantic-release
17-
branches:
18-
except:
19-
- /^v\d+\.\d+\.\d+$/
15+

PROJECT-.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
language: node_js
2+
cache:
3+
directories:
4+
- node_modules
5+
notifications:
6+
email: false
7+
node_js:
8+
- '7'
9+
- '6'
10+
- '4'
11+
before_script:
12+
- npm prune
13+
script:
14+
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
15+
after_success:
16+
- npm run semantic-release
17+
branches:
18+
except:
19+
- /^v\d+\.\d+\.\d+$/

PROJECT-package.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"name": "{{ name }}",
3+
"version": "0.0.0-development",
4+
"description": "{{ description }}",
5+
"main": "lib/index.js",
6+
"scripts": {
7+
"lint": "eslint src test",
8+
"lint:fix": "eslint --fix src test",
9+
"lint:watch": "esw --watch src test",
10+
"flow": "flow",
11+
"flow:coverage": "for file in src/**.js test/**.js; do echo $file; flow coverage $file; done",
12+
"flow:watch": "flow-watch -e js,js.flow,flowconfig --ignore lib/ --ignore node_modules/ --watch .flowconfig --watch src/ --watch test/",
13+
"gen-flow-files": "flow gen-flow-files src/ --out-dir lib",
14+
"copy-flow-files": "cd src; copy *.js.flow **/*.js.flow ../lib",
15+
"build": "rimraf lib && babel src --out-dir lib",
16+
"test": "NODE_ENV=production BABEL_ENV=test nyc --reporter=lcov --reporter=text mocha $npm_package_config_mocha",
17+
"commitmsg": "validate-commit-msg",
18+
"precommit": "npm run lint && flow",
19+
"prepush": "npm test",
20+
"prepublish": "npm run lint && flow && npm test && npm run build && npm run copy-flow-files",
21+
"open:coverage": "open coverage/lcov-report/index.html",
22+
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
23+
},
24+
"config": {
25+
"mocha": "--compilers js:babel-core/register ./test/**/*.js",
26+
"commitizen": {
27+
"path": "cz-conventional-changelog"
28+
}
29+
},
30+
"nyc": {
31+
"include": [
32+
"src/**/*.js"
33+
],
34+
"require": [
35+
"babel-register"
36+
],
37+
"sourceMap": false,
38+
"instrument": false
39+
},
40+
"repository": {
41+
"type": "git",
42+
"url": "https://github.com/{{ organization }}/{{ name }}.git"
43+
},
44+
"keywords": [
45+
"es2015"
46+
],
47+
"author": "{{ author }}",
48+
"license": "MIT",
49+
"bugs": {
50+
"url": "https://github.com/{{ organization }}/{{ name }}/issues"
51+
},
52+
"homepage": "https://github.com/{{ organization }}/{{ name }}#readme",
53+
"devDependencies": {
54+
"@jedwards1211/eslint-config": "^1.0.0",
55+
"@jedwards1211/eslint-config-flow": "^1.0.0",
56+
"babel-cli": "^6.22.2",
57+
"babel-core": "^6.22.1",
58+
"babel-eslint": "^7.1.1",
59+
"babel-plugin-istanbul": "^3.1.2",
60+
"babel-plugin-transform-runtime": "^6.22.0",
61+
"babel-preset-es2015": "^6.22.0",
62+
"babel-preset-flow": "^1.0.0",
63+
"babel-preset-stage-1": "^6.22.0",
64+
"babel-register": "^6.22.0",
65+
"babel-runtime": "^6.22.0",
66+
"chai": "^3.5.0",
67+
"copy": "^0.3.0",
68+
"coveralls": "^2.11.15",
69+
"eslint": "^3.13.1",
70+
"eslint-plugin-flowtype": "^2.30.0",
71+
"eslint-watch": "^2.1.14",
72+
"flow-bin": "^0.38.0",
73+
"flow-watch": "^1.1.0",
74+
"husky": "^0.12.0",
75+
"istanbul": "^0.4.5",
76+
"mocha": "^3.2.0",
77+
"nyc": "^10.1.2",
78+
"rimraf": "^2.5.4",
79+
"semantic-release": "^6.3.2",
80+
"validate-commit-msg": "^2.8.2"
81+
},
82+
"dependencies": {}
83+
}

package.json

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "{{ name }}",
2+
"name": "es2015-library-skeleton",
33
"version": "0.0.0-development",
4-
"description": "{{ description }}",
4+
"description": "my personal skeleton for ES2015 library NPM packages",
55
"main": "lib/index.js",
66
"scripts": {
77
"lint": "eslint src test",
@@ -10,19 +10,14 @@
1010
"flow": "flow",
1111
"flow:coverage": "for file in src/**.js test/**.js; do echo $file; flow coverage $file; done",
1212
"flow:watch": "flow-watch -e js,js.flow,flowconfig --ignore lib/ --ignore node_modules/ --watch .flowconfig --watch src/ --watch test/",
13-
"gen-flow-files": "flow gen-flow-files src/ --out-dir lib",
14-
"copy-flow-files": "cd src; copy *.js.flow **/*.js.flow ../lib",
15-
"build": "rimraf lib && babel src --out-dir lib",
16-
"test": "NODE_ENV=production BABEL_ENV=test nyc --reporter=lcov --reporter=text mocha $npm_package_config_mocha",
13+
"test": "rimraf pollinated && pollinate git@github.com:jedwards1211/es2015-library-skeleton#pollinate --name pollinated --keep-history && cd pollinated && npm i && cd .. && rimraf pollinated",
1714
"commitmsg": "validate-commit-msg",
1815
"precommit": "npm run lint && flow",
1916
"prepush": "npm test",
2017
"prepublish": "npm run lint && flow && npm test && npm run build && npm run copy-flow-files",
21-
"open:coverage": "open coverage/lcov-report/index.html",
22-
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
18+
"open:coverage": "open coverage/lcov-report/index.html"
2319
},
2420
"config": {
25-
"mocha": "--compilers js:babel-core/register ./test/**/*.js",
2621
"commitizen": {
2722
"path": "cz-conventional-changelog"
2823
}
@@ -39,17 +34,17 @@
3934
},
4035
"repository": {
4136
"type": "git",
42-
"url": "https://github.com/{{ organization }}/{{ name }}.git"
37+
"url": "https://github.com/jedwards1211/es2015-library-skeleton.git"
4338
},
4439
"keywords": [
4540
"es2015"
4641
],
47-
"author": "{{ author }}",
42+
"author": "Andy Edwards",
4843
"license": "MIT",
4944
"bugs": {
50-
"url": "https://github.com/{{ organization }}/{{ name }}/issues"
45+
"url": "https://github.com/jedwards1211/es2015-library-skeleton/issues"
5146
},
52-
"homepage": "https://github.com/{{ organization }}/{{ name }}#readme",
47+
"homepage": "https://github.com/jedwards1211/es2015-library-skeleton#readme",
5348
"devDependencies": {
5449
"@jedwards1211/eslint-config": "^1.0.0",
5550
"@jedwards1211/eslint-config-flow": "^1.0.0",
@@ -63,21 +58,17 @@
6358
"babel-preset-stage-1": "^6.22.0",
6459
"babel-register": "^6.22.0",
6560
"babel-runtime": "^6.22.0",
66-
"chai": "^3.5.0",
67-
"copy": "^0.3.0",
68-
"coveralls": "^2.11.15",
6961
"eslint": "^3.13.1",
7062
"eslint-plugin-flowtype": "^2.30.0",
7163
"eslint-watch": "^2.1.14",
7264
"flow-bin": "^0.38.0",
7365
"flow-watch": "^1.1.0",
7466
"husky": "^0.12.0",
7567
"istanbul": "^0.4.5",
76-
"mocha": "^3.2.0",
7768
"nyc": "^10.1.2",
7869
"rimraf": "^2.5.4",
79-
"semantic-release": "^6.3.2",
8070
"validate-commit-msg": "^2.8.2"
8171
},
8272
"dependencies": {}
8373
}
74+

template.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,20 @@
66
"parse": [
77
"PROJECT-README",
88
"PROJECT-LICENSE",
9-
"package.json"
9+
"PROJECT-package.json"
1010
],
1111
"discard": [
1212
"README.md",
1313
"LICENSE.md",
14-
"template.json"
14+
"package.json",
15+
"template.json",
16+
".travis.yml"
1517
],
1618
"move": [
1719
{ "PROJECT-README": "README.md" },
18-
{ "PROJECT-LICENSE": "LICENSE.md" }
20+
{ "PROJECT-LICENSE": "LICENSE.md" },
21+
{ "PROJECT-package.json": "package.json" },
22+
{ "PROJECT-.travis.yml": ".travis.yml" }
1923
],
2024
"complete": "cd {{ name }} && git remote rename origin skeleton && git add . && git commit -n -m 'pollinate project'"
2125
}

0 commit comments

Comments
 (0)