-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'starter/master' into mixins
- Loading branch information
Showing
12 changed files
with
282 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"presets": [ | ||
["env", { | ||
"targets": { | ||
"browsers": ["last 2 versions"] | ||
} | ||
}], | ||
"stage-0", | ||
"flow" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"extends": "eslint:recommended", | ||
|
||
"plugins": [ | ||
"import", | ||
"flowtype" | ||
], | ||
|
||
"parserOptions": { | ||
"sourceType": "module" | ||
}, | ||
|
||
"globals": { | ||
"require": true, | ||
"console": true, | ||
"document": true, | ||
"process": true, | ||
"module": true, | ||
"__dirname": true | ||
}, | ||
|
||
"env": { | ||
"es6": true, | ||
"jest": true, | ||
"browser": true, | ||
"node": true | ||
}, | ||
|
||
"rules": { | ||
"strict": [2, "never"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[ignore] | ||
<PROJECT_ROOT>/node_modules/.* | ||
<PROJECT_ROOT>/dist/.* | ||
.*\.config.* | ||
.*\.test.* | ||
|
||
[include] | ||
<PROJECT_ROOT>/src | ||
|
||
[libs] | ||
|
||
[options] | ||
all=true | ||
emoji=true | ||
esproposal.class_instance_fields=ignore | ||
esproposal.class_static_fields=ignore | ||
esproposal.decorators=ignore | ||
experimental.const_params=true | ||
module.file_ext=.js | ||
module.system.node.resolve_dirname=node_modules | ||
module.system.node.resolve_dirname=src | ||
module.system=node | ||
module.use_strict=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
*.log | ||
coverage | ||
dist | ||
doc | ||
flow-typed | ||
node_modules | ||
package-lock.json | ||
yarn.lock | ||
|
||
.* | ||
!.babelrc | ||
!.eslintrc | ||
!.flowconfig | ||
!.git* | ||
!.tern-project | ||
!.travis.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"libs": [ | ||
"browser" | ||
], | ||
"plugins": { | ||
"node": {}, | ||
"modules": {}, | ||
"es_modules": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- "node" | ||
after_success: | ||
"npm run coveralls" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
The MIT License (MIT) | ||
Copyright (c) 2017 Justin Krueger <justin@kroo.gs> | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Proto ES2017+ | ||
|
||
[![TravisCI](https://img.shields.io/travis/kroogs/proto-es2017.svg)](https://travis-ci.org/kroogs/proto-es2017) | ||
[![Coverage](https://img.shields.io/coveralls/kroogs/proto-es2017.svg)](https://coveralls.io/github/kroogs/proto-es2017) | ||
[![Dependencies](https://img.shields.io/david/kroogs/proto-es2017.svg)](https://david-dm.org/kroogs/proto-es2017) | ||
[![Dev Dependencies](https://img.shields.io/david/dev/kroogs/proto-es2017.svg)](https://david-dm.org/kroogs/proto-es2017?type=dev) | ||
[![MIT License](https://img.shields.io/github/license/kroogs/proto-es2017.svg)](https://github.com/kroogs/proto-es2017/blob/master/LICENSE) | ||
|
||
> Spiffy boilerplate for building and testing with ES2017+. | ||
## Getting Started | ||
|
||
Clone and cd to `project_name`: | ||
``` | ||
git clone https://github.com/kroogs/proto-es2017 project_name && cd project_name | ||
``` | ||
|
||
(Optional) Setup remotes: | ||
``` | ||
git remote rename origin starter | ||
git remote add origin <your repo url> | ||
``` | ||
|
||
Install dependencies: | ||
``` | ||
npm install | ||
``` | ||
|
||
## Usage | ||
|
||
Watch `src` for changes: | ||
``` | ||
npm start | ||
``` | ||
|
||
Run tests: | ||
``` | ||
npm test | ||
``` | ||
|
||
Type check, reformat, lint: | ||
``` | ||
npm run lint | ||
``` | ||
|
||
Produce minified bundle in `dist`: | ||
``` | ||
npm run build | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"name": "proto-es2017", | ||
"version": "0.0.0", | ||
"description": "Spiffy boilerplate for building and testing with ES2017+.", | ||
"keywords": [], | ||
"homepage": "https://github.com/kroogs/proto-es2017", | ||
"author": "Justin Krueger <justin@kroo.gs>", | ||
"contributors": [], | ||
"private": "true", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/kroogs/proto-es2017.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/kroogs/proto-es2017/issues" | ||
}, | ||
"main": "./dist/proto-es2017.js", | ||
"files": [ | ||
"dist", | ||
"src", | ||
"test" | ||
], | ||
"scripts": { | ||
"start": "webpack-dev-server", | ||
"build": "webpack -p", | ||
"test": "jest --coverage", | ||
"test-dev": "jest --watch --coverage", | ||
"coveralls": "cat ./coverage/lcov.info | coveralls", | ||
"lint": "prettier --no-color --trailing-comma all --no-semi --single-quote --write \"src/**/*.js\" && eslint --fix src", | ||
"prepublishOnly": "npm run lint && npm test && npm run build" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.24.1", | ||
"babel-core": "^6.25.0", | ||
"babel-eslint": "^7.2.3", | ||
"babel-loader": "^7.1.1", | ||
"babel-preset-env": "^1.6.0", | ||
"babel-preset-flow": "^6.23.0", | ||
"babel-preset-stage-0": "^6.24.1", | ||
"coveralls": "^2.13.1", | ||
"esdoc": "^1.0.1", | ||
"esdoc-flow-plugin": "^1.0.0", | ||
"esdoc-standard-plugin": "^1.0.0", | ||
"eslint": "^4.3.0", | ||
"eslint-plugin-flowtype": "^2.35.0", | ||
"eslint-plugin-import": "^2.7.0", | ||
"file-loader": "^0.11.2", | ||
"flow": "^0.2.3", | ||
"flow-bin": "^0.52.0", | ||
"flow-typed": "^2.1.5", | ||
"jest": "^20.0.4", | ||
"jest-cli": "^20.0.4", | ||
"prettier": "^1.5.3", | ||
"webpack": "^3.4.1", | ||
"webpack-dev-server": "^2.6.1" | ||
}, | ||
"jest": { | ||
"moduleDirectories": [ | ||
"node_modules", | ||
"src" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* Return the sum of the arguments. | ||
* @param {...number} args - numbers to sum | ||
* @return {number} | ||
*/ | ||
export function sum(...args: number[]): number { | ||
return args.reduce((total, current) => total + current, 0) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { sum } from './index' | ||
|
||
describe('Proto ES2017+', function() { | ||
test('#sum should add 1, 2, 3, and 4 to equal 10', () => { | ||
expect(sum(1, 2, 3, 4)).toBe(10) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const path = require('path') | ||
|
||
module.exports = { | ||
context: __dirname, | ||
entry: './src/index.js', | ||
devtool: 'source-map', | ||
|
||
output: { | ||
library: 'es2017-starter', | ||
libraryTarget: 'umd', | ||
path: path.resolve('dist'), | ||
filename: 'es2017-starter.js', | ||
}, | ||
|
||
resolve: { | ||
extensions: ['.js'], | ||
modules: [path.resolve('node_modules'), path.resolve('src')], | ||
}, | ||
|
||
module: { | ||
loaders: [ | ||
{ | ||
use: ['babel-loader'], | ||
test: /\.js$/, | ||
exclude: [path.resolve('node_modules')], | ||
}, | ||
{ | ||
use: 'file-loader', | ||
test: /.*/, | ||
exclude: [/\.js$/], | ||
}, | ||
], | ||
}, | ||
|
||
watchOptions: { | ||
ignored: /node_modules/, | ||
}, | ||
|
||
devServer: { | ||
port: 3030, | ||
contentBase: path.resolve('src'), | ||
stats: 'errors-only', | ||
overlay: { | ||
warnings: true, | ||
errors: true, | ||
}, | ||
}, | ||
} |