Skip to content

Commit 91ec60a

Browse files
committed
feat(pollinate): improve how pollination works
2 parents a9a4f23 + 453d7f0 commit 91ec60a

File tree

7 files changed

+51
-142
lines changed

7 files changed

+51
-142
lines changed

.travis.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@ language: node_js
22
cache:
33
directories:
44
- node_modules
5+
notifications:
6+
email: false
57
node_js:
68
- '7'
79
- '6'
810
- '4'
9-
before_install:
10-
- npm i -g howardroark/pollinate#feature/keep-history
11-
- git config --global user.email "jedwards@fastmail.com"
12-
- git config --global user.name "Andy Edwards"
1311
before_script:
1412
- npm prune
15-
after_script:
16-
- cd pollinated && cat coverage/lcov.info | node_modules/coveralls/bin/coveralls.js
17-
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-.travis.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

PROJECT-package.json

Lines changed: 2 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -2,108 +2,14 @@
22
"name": "{{ name }}",
33
"version": "0.0.0-development",
44
"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-
"storybook": "start-storybook -p 6006",
22-
"build-storybook": "build-storybook",
23-
"open:coverage": "open coverage/lcov-report/index.html",
24-
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
25-
},
26-
"config": {
27-
"mocha": "--compilers js:babel-core/register -r jsdom-global/register ./test/**/*.js",
28-
"commitizen": {
29-
"path": "cz-conventional-changelog"
30-
}
31-
},
32-
"nyc": {
33-
"include": [
34-
"src/**/*.js"
35-
],
36-
"require": [
37-
"babel-register"
38-
],
39-
"sourceMap": false,
40-
"instrument": false
41-
},
425
"repository": {
436
"type": "git",
447
"url": "https://github.com/{{ organization }}/{{ name }}.git"
458
},
46-
"keywords": [
47-
"es2015"
48-
],
499
"author": "{{ author }}",
50-
"license": "MIT",
5110
"bugs": {
5211
"url": "https://github.com/{{ organization }}/{{ name }}/issues"
5312
},
54-
"homepage": "https://github.com/{{ organization }}/{{ name }}#readme",
55-
"devDependencies": {
56-
"@jedwards1211/eslint-config-flow": "^1.0.0",
57-
"@jedwards1211/eslint-config-react": "^1.0.1",
58-
"@kadira/storybook": "^2.35.2",
59-
"babel-cli": "^6.18.0",
60-
"babel-core": "^6.21.0",
61-
"babel-eslint": "^7.1.1",
62-
"babel-plugin-flow-react-proptypes": "^0.20.0",
63-
"babel-plugin-istanbul": "^3.1.2",
64-
"babel-plugin-transform-react-constant-elements": "^6.9.1",
65-
"babel-plugin-transform-runtime": "^6.15.0",
66-
"babel-preset-es2015": "^6.18.0",
67-
"babel-preset-flow": "^1.0.0",
68-
"babel-preset-react": "^6.16.0",
69-
"babel-preset-stage-1": "^6.16.0",
70-
"babel-register": "^6.18.0",
71-
"babel-runtime": "^6.20.0",
72-
"chai": "^3.5.0",
73-
"copy": "^0.3.0",
74-
"coveralls": "^2.11.15",
75-
"enzyme": "^2.7.0",
76-
"babel-cli": "^6.22.2",
77-
"babel-core": "^6.22.1",
78-
"babel-eslint": "^7.1.1",
79-
"babel-plugin-istanbul": "^3.1.2",
80-
"babel-plugin-transform-runtime": "^6.22.0",
81-
"babel-preset-es2015": "^6.22.0",
82-
"babel-preset-flow": "^1.0.0",
83-
"babel-preset-stage-1": "^6.22.0",
84-
"babel-register": "^6.22.0",
85-
"babel-runtime": "^6.22.0",
86-
"eslint": "^3.13.1",
87-
"eslint-plugin-flowtype": "^2.29.2",
88-
"eslint-plugin-react": "^6.8.0",
89-
"eslint-watch": "^2.1.14",
90-
"flow-bin": "^0.38.0",
91-
"flow-watch": "^1.1.0",
92-
"husky": "^0.12.0",
93-
"istanbul": "^0.4.5",
94-
"jsdom": "^9.9.1",
95-
"jsdom-global": "^2.1.1",
96-
"mocha": "^3.2.0",
97-
"nyc": "^10.0.0",
98-
"react": "^15.4.2",
99-
"react-addons-test-utils": "^15.4.2",
100-
"react-dom": "^15.4.2",
101-
"react-hot-loader": "^3.0.0-beta.2",
102-
"rimraf": "^2.5.4",
103-
"validate-commit-msg": "^2.8.2"
104-
},
105-
"peerDependencies": {
106-
"react": "0.14.x || ^15.0.0"
107-
},
108-
"dependencies": {}
13+
"homepage": "https://github.com/{{ organization }}/{{ name }}#readme"
10914
}
15+

complete.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
git remote rename origin skeleton
5+
npm i lodash.merge
6+
./merge-package-json.js
7+
npm rm lodash.merge
8+
rm merge-package-json.js PROJECT-package.json complete.sh
9+
git add --all .
10+
git commit -n -m 'pollinate project'
11+

merge-package-json.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env node
2+
3+
var merge = require('lodash.merge')
4+
var fs = require('fs')
5+
var merged = merge(require('./package.json'), require('./PROJECT-package.json'))
6+
fs.writeFileSync('./package.json', JSON.stringify(merged, null, 2), 'utf8')
7+

package.json

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-library-skeleton",
3-
"version": "5.0.0",
3+
"version": "0.0.0-development",
44
"description": "my personal skeleton for React library NPM packages",
55
"main": "lib/index.js",
66
"scripts": {
@@ -10,13 +10,16 @@
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-
"test": "rimraf pollinated && pollinate https://github.com/jedwards1211/react-library-skeleton.git#$(git rev-parse --abbrev-ref HEAD) --name pollinated --keep-history && cd pollinated && npm i",
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",
1417
"commitmsg": "validate-commit-msg",
1518
"precommit": "npm run lint && flow",
1619
"prepush": "npm test",
17-
"storybook": "start-storybook -p 6006",
18-
"build-storybook": "build-storybook",
19-
"open:coverage": "open coverage/lcov-report/index.html"
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"
2023
},
2124
"config": {
2225
"mocha": "--compilers js:babel-core/register -r jsdom-global/register ./test/**.js",
@@ -73,35 +76,38 @@
7376
"babel-cli": "^6.22.2",
7477
"babel-core": "^6.22.1",
7578
"babel-eslint": "^7.1.1",
76-
"babel-plugin-istanbul": "^3.1.2",
79+
"babel-plugin-istanbul": "^4.0.0",
7780
"babel-plugin-transform-runtime": "^6.22.0",
7881
"babel-preset-es2015": "^6.22.0",
79-
"babel-preset-flow": "^1.0.0",
82+
"babel-preset-flow": "^6.23.0",
8083
"babel-preset-stage-1": "^6.22.0",
8184
"babel-register": "^6.22.0",
8285
"babel-runtime": "^6.22.0",
86+
"chai": "^3.5.0",
87+
"copy": "^0.3.0",
88+
"coveralls": "^2.11.16",
8389
"eslint": "^3.13.1",
84-
"eslint-plugin-flowtype": "^2.29.2",
90+
"eslint-plugin-flowtype": "^2.30.0",
8591
"eslint-plugin-react": "^6.8.0",
86-
"eslint-watch": "^2.1.14",
87-
"flow-bin": "^0.38.0",
92+
"eslint-watch": "^3.0.0",
93+
"flow-bin": "^0.39.0",
8894
"flow-watch": "^1.1.0",
89-
"husky": "^0.12.0",
95+
"husky": "^0.13.1",
9096
"istanbul": "^0.4.5",
9197
"jsdom": "^9.9.1",
9298
"jsdom-global": "^2.1.1",
9399
"mocha": "^3.2.0",
94-
"nyc": "^10.0.0",
100+
"nyc": "^10.1.2",
95101
"react": "^15.4.2",
96102
"react-addons-test-utils": "^15.4.2",
97103
"react-dom": "^15.4.2",
98104
"react-hot-loader": "^3.0.0-beta.2",
99105
"rimraf": "^2.5.4",
106+
"semantic-release": "^6.3.6",
100107
"validate-commit-msg": "^2.8.2"
101108
},
102109
"peerDependencies": {
103110
"react": "0.14.x || ^15.0.0"
104111
},
105112
"dependencies": {}
106113
}
107-

template.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@
1111
"discard": [
1212
"README.md",
1313
"LICENSE.md",
14-
"package.json",
15-
"template.json",
16-
".travis.yml"
14+
"template.json"
1715
],
1816
"move": [
1917
{ "PROJECT-README": "README.md" },
20-
{ "PROJECT-LICENSE": "LICENSE.md" },
21-
{ "PROJECT-package.json": "package.json" },
22-
{ "PROJECT-.travis.yml": ".travis.yml" }
18+
{ "PROJECT-LICENSE": "LICENSE.md" }
2319
],
24-
"complete": "cd {{ name }} && git remote rename origin skeleton && git add --all . && git commit -n -m 'pollinate project'"
20+
"complete": "cd {{ name }} && ./complete.sh"
2521
}
2622

0 commit comments

Comments
 (0)