Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed May 19, 2016
0 parents commit 7a1283c
Show file tree
Hide file tree
Showing 14 changed files with 189 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": ["es2015", "stage-1"],
"env": {
"production": {
"plugins": [
"transform-flow-strip-types"
]
}
}
}
24 changes: 24 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"parser": "babel-eslint",
"extends": [
"eslint:recommended"
],
"rules": {
"comma-dangle": 2,
"comma-spacing": 2,
"eol-last": 2,
"indent": ["error", 2],
"keyword-spacing": 2,
"linebreak-style": 2,
"no-console": 2,
"no-unused-vars": [2, {"args": "none", "varsIgnorePattern": "React"}],
"no-extra-semi": 2,
"no-trailing-spaces": 2,
"no-unexpected-multiline": 2,
"no-unreachable": 2,
"semi": ["error", "never"]
},
"env": {
"node": true
}
}
22 changes: 22 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[ignore]
<PROJECT_ROOT>/test/.*
.*/node_modules/react/.*
.*/node_modules/fbjs/.*
.*/node_modules/json5/.*
.*/node_modules/babel.*
.*/node_modules/npmconf.*
.*/node_modules/y18n.*
.*/node_modules/config-chain.*

[include]

[libs]

[options]
module.system=haste
module.name_mapper='.*\.sass$' -> 'empty/object'
module.name_mapper='.*\.scss$' -> 'empty/object'
module.name_mapper='.*\.css$' -> 'empty/object'
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
suppress_comment= \\(.\\|\n\\)*\\flow-issue(react-library-skeleton)
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
lib
testlib
8 changes: 8 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
examples
spec
test
testlib
node_modules
.babelrc
.eslintrc
.flowconfig
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.

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

This is my personal skeleton for creating an ES2015 library component npm module. You are welcome to use it.

## Tools used

* babel 6
* jasmine
* eslint
* flow

The `prepublish` script checks the output of `eslint` and `flow`.
6 changes: 6 additions & 0 deletions examples/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"env": {
"es6": true,
"node": false
}
}
39 changes: 39 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "es2015-library-skeleton",
"version": "1.0.0",
"description": "my personal skeleton for ES6 library NPM packages",
"main": "lib/index.js",
"scripts": {
"lint": "eslint *.js src test examples; exit 0",
"lint:fix": "eslint *.js src test examples --fix; exit 0",
"build": "rm -rf lib; NODE_ENV=production babel src --out-dir lib",
"test": "rm -rf testlib; NODE_ENV=production babel src --out-dir testlib/src && NODE_ENV=production babel test --out-dir testlib/test && jasmine",
"prepublish": "eslint *.js src test examples --fix && flow status && npm run test && npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/jedwards1211/es2015-library-skeleton.git"
},
"keywords": [
"es2015"
],
"author": "Andy Edwards",
"license": "MIT",
"bugs": {
"url": "https://github.com/jedwards1211/es2015-library-skeleton/issues"
},
"homepage": "https://github.com/jedwards1211/es2015-library-skeleton#readme",
"devDependencies": {
"babel-cli": "^6.8.0",
"babel-core": "^6.8.0",
"babel-eslint": "^6.0.4",
"babel-plugin-transform-flow-strip-types": "^6.8.0",
"babel-polyfill": "^6.8.0",
"babel-preset-es2015": "^6.6.0",
"babel-preset-stage-1": "^6.5.0",
"eslint": "^2.9.0",
"jasmine": "^2.4.1",
"progress-bar-webpack-plugin": "^1.6.0"
},
"dependencies": {}
}
11 changes: 11 additions & 0 deletions spec/support/jasmine.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"spec_dir": "testlib/test",
"spec_files": [
"**/*.js"
],
"helpers": [
"helpers/**/*.js"
],
"stopSpecOnExpectationFailure": false,
"random": false
}
6 changes: 6 additions & 0 deletions src/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"env": {
"es6": true,
"node": false
}
}
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* @flow */
7 changes: 7 additions & 0 deletions test/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"env": {
"es6": true,
"jasmine": true,
"node": false
}
}
18 changes: 18 additions & 0 deletions testlib/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"use strict";

var _marked = [generate].map(regeneratorRuntime.mark);

function generate() {
return regeneratorRuntime.wrap(function generate$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
return _context.delegateYield([1, 2, 3], "t0", 1);

case 1:
case "end":
return _context.stop();
}
}
}, _marked[0], this);
}

0 comments on commit 7a1283c

Please sign in to comment.