Skip to content

Commit

Permalink
feat(project): initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Feb 22, 2017
0 parents commit 7376455
Show file tree
Hide file tree
Showing 18 changed files with 278 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": [
"@jedwards1211/eslint-config-es5", "@jedwards1211/eslint-config-flow"
],
"ecmaVersion": 5,
"env": {
"es6": false,
"shared-node-browser": true
}
}
12 changes: 12 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[ignore]
.*/node_modules/.*/tests?/.*\.json

[include]
./src
./test

[libs]

[options]
module.system=node

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
coverage
.nyc_output
node_modules

7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
coverage
.nyc_output
test
node_modules
.eslintrc
.flowconfig
.travis.yml
19 changes: 19 additions & 0 deletions .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+$/
22 changes: 22 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2016-present Andy Edwards

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

22 changes: 22 additions & 0 deletions PROJECT-LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2016-present {{ author }}

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

9 changes: 9 additions & 0 deletions PROJECT-README
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# {{ name }}

[![Build Status](https://travis-ci.org/{{ organization }}/{{ name }}.svg?branch=master)](https://travis-ci.org/{{ organization }}/{{ name }})
[![Coverage Status](https://coveralls.io/repos/github/{{ organization }}/{{ name }}/badge.svg?branch=master)](https://coveralls.io/github/{{ organization }}/{{ name }}?branch=master)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

{{ description }}

15 changes: 15 additions & 0 deletions PROJECT-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "{{ name }}",
"version": "0.0.0-development",
"description": "{{ description }}",
"repository": {
"type": "git",
"url": "https://github.com/{{ organization }}/{{ name }}.git"
},
"author": "{{ author }}",
"bugs": {
"url": "https://github.com/{{ organization }}/{{ name }}/issues"
},
"homepage": "https://github.com/{{ organization }}/{{ name }}#readme"
}

34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# es5-library-skeleton

[![Build Status](https://travis-ci.org/jedwards1211/es5-library-skeleton.svg?branch=master)](https://travis-ci.org/jedwards1211/es5-library-skeleton)
[![Coverage Status](https://coveralls.io/repos/github/jedwards1211/es5-library-skeleton/badge.svg?branch=master)](https://coveralls.io/github/jedwards1211/es5-library-skeleton?branch=master)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

This is my personal skeleton for creating an ES5 library npm package. You are welcome to use it.

## Quick start

```sh
# this PR of mine will hopefully be merged soon
npm i -g howardroark/pollinate#keep-history
pollinate https://github.com/jedwards1211/es5-library-skeleton.git --name <package name> --author <your name> --organization <github organization> --description <package description>
cd <package name>
npm i
```

## Tools used

* mocha
* chai
* istanbul
* nyc
* eslint
* eslint-watch
* flow
* flow-watch
* pre-commit (runs eslnt and flow)
* semantic-release
* Travis CI
* Coveralls

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'

2 changes: 2 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* eslint-disable no-console, no-undef */
console.log('Hello world!')
3 changes: 3 additions & 0 deletions lib/index.js.flow
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// @flow

declare module.exports: {};
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')

65 changes: 65 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"name": "es5-library-skeleton",
"version": "0.0.0-development",
"description": "my personal ES5 library project skeleton",
"main": "lib/index.js",
"scripts": {
"lint": "eslint lib test",
"lint:fix": "eslint --fix lib test",
"lint:watch": "esw --watch lib test",
"flow": "flow",
"flow:coverage": "for file in lib/**.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 lib/ --watch test/",
"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",
"open:coverage": "open coverage/lcov-report/index.html",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"config": {
"mocha": "./test/**/*.js",
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"nyc": {
"include": [
"lib/**/*.js"
]
},
"repository": {
"type": "git",
"url": "https://github.com/jedwards1211/es5-library-skeleton.git"
},
"keywords": [
"es5"
],
"author": "Andy Edwards",
"license": "MIT",
"bugs": {
"url": "https://github.com/jedwards1211/es5-library-skeleton/issues"
},
"homepage": "https://github.com/jedwards1211/es5-library-skeleton#readme",
"devDependencies": {
"@jedwards1211/eslint-config-es5": "^1.0.0",
"@jedwards1211/eslint-config-flow": "^1.0.0",
"chai": "^3.5.0",
"copy": "^0.3.0",
"coveralls": "^2.11.16",
"eslint": "^3.13.1",
"eslint-plugin-flowtype": "^2.30.0",
"eslint-watch": "^3.0.0",
"flow-bin": "^0.39.0",
"flow-watch": "^1.1.0",
"husky": "^0.13.1",
"istanbul": "^0.4.5",
"mocha": "^3.2.0",
"nyc": "^10.1.2",
"rimraf": "^2.5.4",
"semantic-release": "^6.3.6",
"validate-commit-msg": "^2.8.2"
}
}

22 changes: 22 additions & 0 deletions template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"organization": "jedwards1211",
"name": "es5-library-skeleton",
"description": "my personal skeleton for ES5 library NPM packages",
"author": "Andy Edwards",
"parse": [
"PROJECT-README",
"PROJECT-LICENSE",
"PROJECT-package.json"
],
"discard": [
"README.md",
"LICENSE.md",
"template.json"
],
"move": [
{ "PROJECT-README": "README.md" },
{ "PROJECT-LICENSE": "LICENSE.md" }
],
"complete": "cd {{ name }} && ./complete.sh"
}

6 changes: 6 additions & 0 deletions test/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"env": {
"mocha": true,
"commonjs": true
}
}
8 changes: 8 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require('../lib')

describe('test setup', function () {
it('works', function () {

})
})

0 comments on commit 7376455

Please sign in to comment.