Skip to content

Commit

Permalink
feat(pollinate): improve how pollination works
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Feb 20, 2017
2 parents a9a4f23 + 453d7f0 commit 91ec60a
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 142 deletions.
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ language: node_js
cache:
directories:
- node_modules
notifications:
email: false
node_js:
- '7'
- '6'
- '4'
before_install:
- npm i -g howardroark/pollinate#feature/keep-history
- git config --global user.email "[email protected]"
- git config --global user.name "Andy Edwards"
before_script:
- npm prune
after_script:
- cd pollinated && cat coverage/lcov.info | node_modules/coveralls/bin/coveralls.js

script:
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
after_success:
- npm run semantic-release
branches:
except:
- /^v\d+\.\d+\.\d+$/
19 changes: 0 additions & 19 deletions PROJECT-.travis.yml

This file was deleted.

98 changes: 2 additions & 96 deletions PROJECT-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,108 +2,14 @@
"name": "{{ name }}",
"version": "0.0.0-development",
"description": "{{ description }}",
"main": "lib/index.js",
"scripts": {
"lint": "eslint src test",
"lint:fix": "eslint --fix src test",
"lint:watch": "esw --watch src test",
"flow": "flow",
"flow:coverage": "for file in src/**.js test/**.js; do echo $file; flow coverage $file; done",
"flow:watch": "flow-watch -e js,js.flow,flowconfig --ignore lib/ --ignore node_modules/ --watch .flowconfig --watch src/ --watch test/",
"gen-flow-files": "flow gen-flow-files src/ --out-dir lib",
"copy-flow-files": "cd src; copy *.js.flow **/*.js.flow ../lib",
"build": "rimraf lib && babel src --out-dir lib",
"test": "NODE_ENV=production BABEL_ENV=test nyc --reporter=lcov --reporter=text mocha $npm_package_config_mocha",
"commitmsg": "validate-commit-msg",
"precommit": "npm run lint && flow",
"prepush": "npm test",
"prepublish": "npm run lint && flow && npm test && npm run build && npm run copy-flow-files",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"open:coverage": "open coverage/lcov-report/index.html",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"config": {
"mocha": "--compilers js:babel-core/register -r jsdom-global/register ./test/**/*.js",
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"nyc": {
"include": [
"src/**/*.js"
],
"require": [
"babel-register"
],
"sourceMap": false,
"instrument": false
},
"repository": {
"type": "git",
"url": "https://github.com/{{ organization }}/{{ name }}.git"
},
"keywords": [
"es2015"
],
"author": "{{ author }}",
"license": "MIT",
"bugs": {
"url": "https://github.com/{{ organization }}/{{ name }}/issues"
},
"homepage": "https://github.com/{{ organization }}/{{ name }}#readme",
"devDependencies": {
"@jedwards1211/eslint-config-flow": "^1.0.0",
"@jedwards1211/eslint-config-react": "^1.0.1",
"@kadira/storybook": "^2.35.2",
"babel-cli": "^6.18.0",
"babel-core": "^6.21.0",
"babel-eslint": "^7.1.1",
"babel-plugin-flow-react-proptypes": "^0.20.0",
"babel-plugin-istanbul": "^3.1.2",
"babel-plugin-transform-react-constant-elements": "^6.9.1",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-flow": "^1.0.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-1": "^6.16.0",
"babel-register": "^6.18.0",
"babel-runtime": "^6.20.0",
"chai": "^3.5.0",
"copy": "^0.3.0",
"coveralls": "^2.11.15",
"enzyme": "^2.7.0",
"babel-cli": "^6.22.2",
"babel-core": "^6.22.1",
"babel-eslint": "^7.1.1",
"babel-plugin-istanbul": "^3.1.2",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-flow": "^1.0.0",
"babel-preset-stage-1": "^6.22.0",
"babel-register": "^6.22.0",
"babel-runtime": "^6.22.0",
"eslint": "^3.13.1",
"eslint-plugin-flowtype": "^2.29.2",
"eslint-plugin-react": "^6.8.0",
"eslint-watch": "^2.1.14",
"flow-bin": "^0.38.0",
"flow-watch": "^1.1.0",
"husky": "^0.12.0",
"istanbul": "^0.4.5",
"jsdom": "^9.9.1",
"jsdom-global": "^2.1.1",
"mocha": "^3.2.0",
"nyc": "^10.0.0",
"react": "^15.4.2",
"react-addons-test-utils": "^15.4.2",
"react-dom": "^15.4.2",
"react-hot-loader": "^3.0.0-beta.2",
"rimraf": "^2.5.4",
"validate-commit-msg": "^2.8.2"
},
"peerDependencies": {
"react": "0.14.x || ^15.0.0"
},
"dependencies": {}
"homepage": "https://github.com/{{ organization }}/{{ name }}#readme"
}

11 changes: 11 additions & 0 deletions complete.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -e

git remote rename origin skeleton
npm i lodash.merge
./merge-package-json.js
npm rm lodash.merge
rm merge-package-json.js PROJECT-package.json complete.sh
git add --all .
git commit -n -m 'pollinate project'

7 changes: 7 additions & 0 deletions merge-package-json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node

var merge = require('lodash.merge')
var fs = require('fs')
var merged = merge(require('./package.json'), require('./PROJECT-package.json'))
fs.writeFileSync('./package.json', JSON.stringify(merged, null, 2), 'utf8')

32 changes: 19 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-library-skeleton",
"version": "5.0.0",
"version": "0.0.0-development",
"description": "my personal skeleton for React library NPM packages",
"main": "lib/index.js",
"scripts": {
Expand All @@ -10,13 +10,16 @@
"flow": "flow",
"flow:coverage": "for file in src/**.js test/**.js; do echo $file; flow coverage $file; done",
"flow:watch": "flow-watch -e js,js.flow,flowconfig --ignore lib/ --ignore node_modules/ --watch .flowconfig --watch src/ --watch test/",
"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",
"gen-flow-files": "flow gen-flow-files src/ --out-dir lib",
"copy-flow-files": "cd src; copy *.js.flow **/*.js.flow ../lib",
"build": "rimraf lib && babel src --out-dir lib",
"test": "NODE_ENV=production BABEL_ENV=test nyc --reporter=lcov --reporter=text mocha $npm_package_config_mocha",
"commitmsg": "validate-commit-msg",
"precommit": "npm run lint && flow",
"prepush": "npm test",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"open:coverage": "open coverage/lcov-report/index.html"
"prepublish": "npm run lint && flow && npm test && npm run build && npm run copy-flow-files",
"open:coverage": "open coverage/lcov-report/index.html",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"config": {
"mocha": "--compilers js:babel-core/register -r jsdom-global/register ./test/**.js",
Expand Down Expand Up @@ -73,35 +76,38 @@
"babel-cli": "^6.22.2",
"babel-core": "^6.22.1",
"babel-eslint": "^7.1.1",
"babel-plugin-istanbul": "^3.1.2",
"babel-plugin-istanbul": "^4.0.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-flow": "^1.0.0",
"babel-preset-flow": "^6.23.0",
"babel-preset-stage-1": "^6.22.0",
"babel-register": "^6.22.0",
"babel-runtime": "^6.22.0",
"chai": "^3.5.0",
"copy": "^0.3.0",
"coveralls": "^2.11.16",
"eslint": "^3.13.1",
"eslint-plugin-flowtype": "^2.29.2",
"eslint-plugin-flowtype": "^2.30.0",
"eslint-plugin-react": "^6.8.0",
"eslint-watch": "^2.1.14",
"flow-bin": "^0.38.0",
"eslint-watch": "^3.0.0",
"flow-bin": "^0.39.0",
"flow-watch": "^1.1.0",
"husky": "^0.12.0",
"husky": "^0.13.1",
"istanbul": "^0.4.5",
"jsdom": "^9.9.1",
"jsdom-global": "^2.1.1",
"mocha": "^3.2.0",
"nyc": "^10.0.0",
"nyc": "^10.1.2",
"react": "^15.4.2",
"react-addons-test-utils": "^15.4.2",
"react-dom": "^15.4.2",
"react-hot-loader": "^3.0.0-beta.2",
"rimraf": "^2.5.4",
"semantic-release": "^6.3.6",
"validate-commit-msg": "^2.8.2"
},
"peerDependencies": {
"react": "0.14.x || ^15.0.0"
},
"dependencies": {}
}

10 changes: 3 additions & 7 deletions template.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@
"discard": [
"README.md",
"LICENSE.md",
"package.json",
"template.json",
".travis.yml"
"template.json"
],
"move": [
{ "PROJECT-README": "README.md" },
{ "PROJECT-LICENSE": "LICENSE.md" },
{ "PROJECT-package.json": "package.json" },
{ "PROJECT-.travis.yml": ".travis.yml" }
{ "PROJECT-LICENSE": "LICENSE.md" }
],
"complete": "cd {{ name }} && git remote rename origin skeleton && git add --all . && git commit -n -m 'pollinate project'"
"complete": "cd {{ name }} && ./complete.sh"
}

0 comments on commit 91ec60a

Please sign in to comment.