Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactors into npm-library-starter based configuration
- Loading branch information
Showing
36 changed files
with
14,419 additions
and
583 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 |
---|---|---|
@@ -1,6 +1,26 @@ | ||
{ | ||
"presets": ["es2015", "stage-1", "react"], | ||
"ignore": [ | ||
"/node_modules/" | ||
] | ||
"presets": [ | ||
["env", { "targets": { "node": true } }], | ||
"stage-3", | ||
"react" | ||
], | ||
"plugins": [ | ||
"transform-class-properties" | ||
], | ||
"env": { | ||
"commonjs": { | ||
"presets": [ | ||
"env", | ||
"stage-3", | ||
"react" | ||
] | ||
}, | ||
"umd": { | ||
"presets": [ | ||
["env", { "es2015": { "modules": false } }], | ||
"stage-3", | ||
"react" | ||
] | ||
} | ||
} | ||
} |
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,4 @@ | ||
node_modules/ | ||
commonjs/ | ||
coverage/ | ||
umd/ |
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 |
---|---|---|
@@ -1,17 +1,45 @@ | ||
{ | ||
"root": true, | ||
"parser": "babel-eslint", | ||
"extends": "airbnb", | ||
"plugins": [], | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"mocha": true, | ||
"node": true | ||
"node": true, | ||
"jest": true, | ||
}, | ||
"ecmaFeatures": { | ||
"defaultParams": true | ||
}, | ||
"rules": { | ||
"indent": [2, 2, { "SwitchCase": 1 }], | ||
"react/jsx-filename-extension": 0 | ||
// It really is not confusing. | ||
"no-confusing-arrow": 0, | ||
|
||
// Semi-strict max width | ||
"max-len": [ | ||
"error", | ||
{ | ||
"ignoreComments": true, | ||
"ignoreStrings": true, | ||
"code": 80 | ||
} | ||
], | ||
|
||
// Going hipster | ||
"semi": [2, "never"], | ||
|
||
// A .jsx extension is not required for files containing jsx | ||
"react/jsx-filename-extension": 0, | ||
|
||
// These rules are annoying | ||
"react/sort-comp": 0, | ||
"react/forbid-prop-types": 0, | ||
|
||
// This rule sucks at Higher Order Components | ||
"react/no-unused-prop-types": 0, | ||
|
||
// Annoying, and works fine without escaping them | ||
"react/no-unescaped-entities": 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 |
---|---|---|
@@ -1,35 +1,21 @@ | ||
# Webpack stats file output used for bundle optimisation. | ||
lib/stats.json | ||
|
||
#####=== Node ===##### | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
# Dependencies | ||
node_modules | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
# Debug log from npm | ||
npm-debug.log | ||
|
||
# Coverage directory used by tools like istanbul | ||
# Jest | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
# Build output | ||
umd | ||
commonjs | ||
build | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- | ||
node_modules | ||
|
||
# Debug log from npm | ||
npm-debug.log | ||
# Flow | ||
flow-coverage | ||
flow-typed |
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.1.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 |
---|---|---|
@@ -1,22 +1,16 @@ | ||
sudo: false | ||
language: node_js | ||
cache: | ||
yarn: true | ||
directories: | ||
- node_modules | ||
branches: | ||
only: | ||
- master | ||
notifications: | ||
email: false | ||
node_js: | ||
- '4' | ||
before_install: | ||
- npm i -g npm@^3.0.0 | ||
before_script: | ||
- npm prune | ||
- '8' | ||
script: | ||
- npm run test:coverage | ||
- npm run build | ||
# Unfortunately flow falls over when a dep exists in peer deps and others. :( | ||
# @see https://github.com/flowtype/flow-typed/issues/528 | ||
#- yarn run flow:defs | ||
- yarn run check | ||
after_success: | ||
- npm run report-coverage | ||
- npm run semantic-release | ||
# Deploy code coverage report to codecov.io | ||
- yarn run test:coverage:deploy |
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
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 @@ | ||
{ | ||
"rules": { | ||
"no-console": 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 @@ | ||
{ | ||
"presets": [ | ||
"latest", | ||
"stage-3", | ||
"react" | ||
] | ||
} |
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,29 @@ | ||
{ | ||
"name": "my-library-example", | ||
"version": "1.0.0", | ||
"description": "An example of my-library", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "babel-node server.js" | ||
}, | ||
"author": "", | ||
"license": "MIT", | ||
"devDependencies": {}, | ||
"dependencies": { | ||
"app-root-dir": "^1.0.2", | ||
"babel-cli": "^6.18.0", | ||
"babel-core": "^6.21.0", | ||
"babel-loader": "^6.2.10", | ||
"babel-preset-latest": "^6.16.0", | ||
"babel-preset-react": "^6.16.0", | ||
"babel-preset-stage-3": "^6.17.0", | ||
"babel-register": "^6.18.0", | ||
"express": "^4.14.0", | ||
"html-webpack-plugin": "^2.26.0", | ||
"react": "^15.4.2", | ||
"react-dom": "^15.4.2", | ||
"webpack": "^2.2.0-rc.3", | ||
"webpack-dev-middleware": "^1.9.0", | ||
"webpack-hot-middleware": "^2.15.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,25 @@ | ||
import express from 'express'; | ||
import webpack from 'webpack'; | ||
import devMiddleware from 'webpack-dev-middleware'; | ||
import hotMiddleware from 'webpack-hot-middleware'; | ||
import config from './tools/webpack/config'; | ||
|
||
const port = process.env.PORT || 1337; | ||
const app = express(); | ||
const compiler = webpack(config); | ||
app.use( | ||
devMiddleware(compiler, { | ||
quiet: true, | ||
noInfo: true, | ||
headers: { | ||
'Access-Control-Allow-Origin': '*', | ||
}, | ||
// Ensure that the public path is taken from the compiler webpack config | ||
// as it will have been created as an absolute path to avoid conflicts | ||
// with an node servers. | ||
publicPath: compiler.options.output.publicPath, | ||
}), | ||
); | ||
app.use(hotMiddleware(compiler)); | ||
|
||
app.listen(port, () => console.log(`Example running on port ${port}...`)); |
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 @@ | ||
import React from 'react'; | ||
import { render } from 'react-dom'; | ||
|
||
function App() { | ||
return <div>poop</div>; | ||
} | ||
|
||
render(<App />, document.getElementById('app')); |
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,41 @@ | ||
import { resolve as resolvePath } from 'path'; | ||
import webpack from 'webpack'; | ||
import HtmlWebpackPlugin from 'html-webpack-plugin'; | ||
import appRootDir from 'app-root-dir'; | ||
import pkg from '../../package.json'; | ||
|
||
module.exports = { | ||
entry: { | ||
index: resolvePath(appRootDir.get(), './src/index.js'), | ||
}, | ||
output: { | ||
path: resolvePath(appRootDir.get(), './build'), | ||
filename: `${pkg.name}.js`, | ||
publicPath: '/', | ||
}, | ||
target: 'web', | ||
plugins: [ | ||
new webpack.NoErrorsPlugin(), | ||
new HtmlWebpackPlugin({ | ||
filename: 'index.html', | ||
template: resolvePath(__dirname, './html.js'), | ||
inject: true, | ||
// We can pass custom data to the template... | ||
custom: { | ||
name: pkg.name, | ||
description: pkg.description, | ||
}, | ||
}), | ||
], | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
loader: 'babel-loader', | ||
include: [ | ||
resolvePath(appRootDir.get(), './src'), | ||
], | ||
}, | ||
], | ||
}, | ||
}; |
Oops, something went wrong.