Skip to content

Commit

Permalink
fix(project): make templates for package.json and .travis.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Feb 19, 2017
1 parent e61281f commit a27da9e
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 28 deletions.
10 changes: 3 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@ 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
before_script:
- npm prune
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: 19 additions & 0 deletions PROJECT-.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: node_js
cache:
directories:
- node_modules
notifications:
email: false
node_js:
- '7'
- '6'
- '4'
before_script:
- npm prune
script:
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
after_success:
- npm run semantic-release
branches:
except:
- /^v\d+\.\d+\.\d+$/
83 changes: 83 additions & 0 deletions PROJECT-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"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",
"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 ./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": "^1.0.0",
"@jedwards1211/eslint-config-flow": "^1.0.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",
"chai": "^3.5.0",
"copy": "^0.3.0",
"coveralls": "^2.11.15",
"eslint": "^3.13.1",
"eslint-plugin-flowtype": "^2.30.0",
"eslint-watch": "^2.1.14",
"flow-bin": "^0.38.0",
"flow-watch": "^1.1.0",
"husky": "^0.12.0",
"istanbul": "^0.4.5",
"mocha": "^3.2.0",
"nyc": "^10.1.2",
"rimraf": "^2.5.4",
"semantic-release": "^6.3.2",
"validate-commit-msg": "^2.8.2"
},
"dependencies": {}
}
27 changes: 9 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "{{ name }}",
"name": "es2015-library-skeleton",
"version": "0.0.0-development",
"description": "{{ description }}",
"description": "my personal skeleton for ES2015 library NPM packages",
"main": "lib/index.js",
"scripts": {
"lint": "eslint src test",
Expand All @@ -10,19 +10,14 @@
"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",
"test": "rimraf pollinated && pollinate git@github.com:jedwards1211/es2015-library-skeleton#pollinate --name pollinated --keep-history && cd pollinated && npm i && cd .. && rimraf pollinated",
"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",
"open:coverage": "open coverage/lcov-report/index.html",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
"open:coverage": "open coverage/lcov-report/index.html"
},
"config": {
"mocha": "--compilers js:babel-core/register ./test/**/*.js",
"commitizen": {
"path": "cz-conventional-changelog"
}
Expand All @@ -39,17 +34,17 @@
},
"repository": {
"type": "git",
"url": "https://github.com/{{ organization }}/{{ name }}.git"
"url": "https://github.com/jedwards1211/es2015-library-skeleton.git"
},
"keywords": [
"es2015"
],
"author": "{{ author }}",
"author": "Andy Edwards",
"license": "MIT",
"bugs": {
"url": "https://github.com/{{ organization }}/{{ name }}/issues"
"url": "https://github.com/jedwards1211/es2015-library-skeleton/issues"
},
"homepage": "https://github.com/{{ organization }}/{{ name }}#readme",
"homepage": "https://github.com/jedwards1211/es2015-library-skeleton#readme",
"devDependencies": {
"@jedwards1211/eslint-config": "^1.0.0",
"@jedwards1211/eslint-config-flow": "^1.0.0",
Expand All @@ -63,21 +58,17 @@
"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.15",
"eslint": "^3.13.1",
"eslint-plugin-flowtype": "^2.30.0",
"eslint-watch": "^2.1.14",
"flow-bin": "^0.38.0",
"flow-watch": "^1.1.0",
"husky": "^0.12.0",
"istanbul": "^0.4.5",
"mocha": "^3.2.0",
"nyc": "^10.1.2",
"rimraf": "^2.5.4",
"semantic-release": "^6.3.2",
"validate-commit-msg": "^2.8.2"
},
"dependencies": {}
}

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

0 comments on commit a27da9e

Please sign in to comment.