Browse Source

Removing base preset, adding Airbnb preset

docs
Eli Perelman 8 years ago
parent
commit
89f0c1e760
  1. 11
      package.json
  2. 26
      packages/neutrino-preset-airbnb-base/package.json
  3. 0
      packages/neutrino-preset-airbnb-base/src/eslint.js
  4. 58
      packages/neutrino-preset-airbnb-base/src/index.js
  5. 1020
      packages/neutrino-preset-airbnb-base/yarn.lock
  6. 19
      packages/neutrino-preset-base/README.md
  7. 33
      packages/neutrino-preset-base/package.json
  8. 71
      packages/neutrino-preset-base/src/index.js
  9. 2644
      packages/neutrino-preset-base/yarn.lock
  10. 6
      packages/neutrino-preset-node/package.json
  11. 121
      packages/neutrino-preset-node/src/index.js
  12. 146
      packages/neutrino-preset-node/yarn.lock
  13. 44
      packages/neutrino-preset-react/src/index.js
  14. 8
      packages/neutrino-preset-web/package.json
  15. 79
      packages/neutrino-preset-web/src/index.js
  16. 142
      packages/neutrino-preset-web/yarn.lock
  17. 6
      packages/neutrino/bin/neutrino
  18. 2
      packages/neutrino/src/neutrino.js
  19. 11
      yarn.lock

11
package.json

@ -9,11 +9,12 @@
"license": "MPL-2.0",
"scripts": {
"bootstrap": "oao bootstrap",
"add-dep": "oao add",
"remove-dep": "oao remove",
"clear-deps": "rm -rf packages/**/node_modules",
"deps:add": "oao add",
"deps:remove": "oao remove",
"deps:upgrade": "oao upgrade",
"deps:clean": "rm -rf packages/**/node_modules",
"docs:build": "gitbook build",
"docs:deploy": "npm run docs:build && gh-pages --dist _book --remote upstream",
"docs:deploy": "npm run docs:build && cp CNAME _book && gh-pages --dist _book --remote upstream",
"docs:serve": "gitbook serve"
},
"devDependencies": {
@ -23,6 +24,6 @@
"gitbook-plugin-edit-link": "^2.0.2",
"gitbook-plugin-github": "^2.0.0",
"gitbook-plugin-prism": "^2.1.0",
"oao": "^0.5.0"
"oao": "^0.5.1"
}
}

26
packages/neutrino-preset-airbnb-base/package.json

@ -0,0 +1,26 @@
{
"name": "neutrino-preset-airbnb-base",
"version": "4.0.0",
"description": "Neutrino preset for adding Airbnb's base JS ESLint config, following the Airbnb styleguide",
"main": "src/index.js",
"keywords": [
"neutrino",
"neutrino-preset",
"airbnb",
"eslint"
],
"author": "Eli Perelman <eli@eliperelman.com>",
"license": "MPL-2.0",
"repository": "mozilla-neutrino/neutrino-dev",
"dependencies": {
"babel-eslint": "^7.1.1",
"eslint": "^3.14.1",
"eslint-config-airbnb-base": "^11.1.0",
"eslint-loader": "^1.6.1",
"eslint-plugin-babel": "^4.0.1",
"eslint-plugin-import": "^2.2.0"
},
"peerDependencies": {
"neutrino": "^4.0.0"
}
}

0
packages/neutrino-preset-base/src/eslint.js → packages/neutrino-preset-airbnb-base/src/eslint.js

58
packages/neutrino-preset-airbnb-base/src/index.js

@ -0,0 +1,58 @@
'use strict';
const path = require('path');
const MODULES = path.join(__dirname, '../node_modules');
module.exports = ({ config }) => {
config
.module
.rule('lint')
.test(/\.(js|jsx)$/)
.pre()
.include(path.join(process.cwd(), 'src'))
.loader('eslint', require.resolve('eslint-loader'), {
failOnError: process.env.NODE_ENV !== 'development',
emitWarning: process.env.NODE_ENV !== 'development',
emitError: process.env.NODE_ENV !== 'development'
cwd: process.cwd(),
useEslintrc: false,
root: true,
plugins: ['babel'],
baseConfig: {
extends: ['airbnb-base']
},
envs: ['es6'],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
ecmaFeatures: {
objectLiteralDuplicateProperties: false,
generators: true,
impliedStrict: true
}
},
settings: {},
globals: ['process'],
rules: {
// handled by babel rules
'new-cap': 'off',
// handled by babel rules
'object-curly-spacing': 'off',
// require a capital letter for constructors
'babel/new-cap': ['error', { newIsCap: true }],
// require padding inside curly braces
'babel/object-curly-spacing': ['error', 'always'],
// guard against awaiting async functions inside of a loop
'babel/no-await-in-loop': 'error'
}
});
config.resolve.modules.add(MODULES);
config.resolveLoader.modules.add(MODULES);
};

1020
packages/neutrino-preset-airbnb-base/yarn.lock

File diff suppressed because it is too large

19
packages/neutrino-preset-base/README.md

@ -1,19 +0,0 @@
# Neutrino Base Preset [![NPM version][npm-image]][npm-url] [![Dependency Status][daviddm-image]][daviddm-url]
This [neutrino](https://github.com/mozilla-neutrino/neutrino) preset is abstract and should not be
used directly to build a JavaScript project. Rather, this preset contains shared configuration that
is extended by all other core neutrino presets.
Modify this preset if there is shared configuration that should be propagated to all other core
neutrino presets. This preset contains the bulk of the shared Webpack and ESLint configuration.
# Technology
* [neutrino-preset-base](https://github.com/mozilla-neutrino/neutrino-preset-base)
* babel-preset-es2015: Polyfill ES2015 syntaxes
[npm-image]: https://badge.fury.io/js/neutrino-preset-base.svg
[npm-url]: https://npmjs.org/package/neutrino-preset-base
[daviddm-image]: https://david-dm.org/mozilla-neutrino/neutrino-preset-base.svg
[daviddm-url]: https://david-dm.org/mozilla-neutrino/neutrino-preset-base

33
packages/neutrino-preset-base/package.json

@ -1,33 +0,0 @@
{
"name": "neutrino-preset-base",
"version": "4.0.0",
"description": "Neutrino base preset for shared core configuration",
"main": "src/index.js",
"keywords": [
"neutrino",
"neutrino-preset"
],
"author": "Eli Perelman <eli@eliperelman.com>",
"license": "MPL-2.0",
"repository": "mozilla-neutrino/neutrino-dev",
"dependencies": {
"babel-eslint": "^7.1.1",
"clean-webpack-plugin": "^0.1.15",
"copy-webpack-plugin": "4.0.1",
"eslint": "^3.14.1",
"eslint-loader": "^1.6.1",
"eslint-plugin-babel": "^4.0.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-mocha": "^4.8.0",
"exports-loader": "0.6.3",
"imports-loader": "^0.7.0",
"progress-bar-webpack-plugin": "^1.9.3",
"webpack": "^2.2.1"
},
"peerDependencies": {
"neutrino": "^4.0.0"
},
"devDependencies": {
"eslint-plugin-react": "^6.9.0"
}
}

71
packages/neutrino-preset-base/src/index.js

@ -1,71 +0,0 @@
'use strict';
const CleanPlugin = require('clean-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const path = require('path');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const webpack = require('webpack');
const lint = require('./eslint');
const CWD = process.cwd();
const BUILD = path.join(CWD, 'build');
const PROJECT_MODULES = path.join(CWD, 'node_modules');
const BASE_MODULES = path.join(__dirname, '../node_modules');
const SRC = path.join(CWD, 'src');
module.exports = ({ config }) => {
config
.context(CWD)
.entry('index')
.add(path.join(SRC, 'index.js'))
.end()
.output
.path(path.join(process.cwd(), 'build'))
.filename('[name].bundle.js')
.chunkFilename('[id].[chunkhash].js')
.end()
.resolve
.modules
.add(PROJECT_MODULES)
.add(BASE_MODULES)
.end()
.extensions
.add('.js')
.add('json')
.end()
.end()
.resolveLoader
.modules
.add(PROJECT_MODULES)
.add(BASE_MODULES);
config
.module
.rule('lint')
.test(/\.js$/)
.pre()
.include(SRC)
.loader('eslint', require.resolve('eslint-loader'), Object.assign({
failOnError: process.env.NODE_ENV !== 'development',
emitWarning: process.env.NODE_ENV !== 'development',
emitError: process.env.NODE_ENV !== 'development'
}, lint));
if (process.env.NODE_ENV === 'development') {
config.devtool('eval');
} else {
config.output.filename('[name].[chunkhash].bundle.js');
config
.plugin('copy')
.use(CopyPlugin, [{ context: SRC, from: `**/*` }], { ignore: ['*.js*'] });
config
.plugin('progress')
.use(ProgressBarPlugin);
config
.plugin('clean')
.use(CleanPlugin, [BUILD], { root: CWD });
}
};

2644
packages/neutrino-preset-base/yarn.lock

File diff suppressed because it is too large

6
packages/neutrino-preset-node/package.json

@ -14,8 +14,12 @@
"babel-core": "^6.22.1",
"babel-loader": "^6.2.10",
"babel-preset-env": "^1.1.8",
"clean-webpack-plugin": "^0.1.15",
"copy-webpack-plugin": "4.0.1",
"deepmerge": "^1.3.2",
"neutrino-preset-base": "4.0.0",
"exports-loader": "0.6.3",
"imports-loader": "^0.7.0",
"progress-bar-webpack-plugin": "^1.9.3",
"source-map-support": "^0.4.6",
"webpack": "^2.2.1",
"webpack-merge": "^2.6.1",

121
packages/neutrino-preset-node/src/index.js

@ -1,10 +1,12 @@
'use strict';
const base = require('neutrino-preset-base');
const nodeExternals = require('webpack-node-externals');
const path = require('path');
const webpack = require('webpack');
const merge = require('deepmerge');
const CopyPlugin = require('copy-webpack-plugin');
const CleanPlugin = require('clean-webpack-plugin');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const CWD = process.cwd();
const SRC = path.join(CWD, 'src');
@ -12,24 +14,41 @@ const TEST = path.join(CWD, 'test');
const MODULES = path.join(__dirname, '../node_modules');
module.exports = neutrino => {
base(neutrino);
const { config } = neutrino;
config
.target('node')
.devtool('source-map')
.externals([nodeExternals()])
.node
.set('__filename', false)
.set('__dirname', false)
.end()
.devtool('source-map')
.externals([nodeExternals()])
.context(CWD)
.entry('index')
.add(path.join(SRC, 'index.js'))
.end()
.output
.path(path.join(process.cwd(), 'build'))
.filename('[name].js')
.libraryTarget('commonjs2');
.libraryTarget('commonjs2')
.chunkFilename('[id].[chunkhash].js')
.end()
.resolve
.modules
.add(PROJECT_MODULES)
.add(MODULES)
.end()
.extensions
.add('.js')
.add('json')
.end()
.end()
.resolveLoader
.modules
.add(PROJECT_MODULES)
.add(MODULES);
config.resolve.modules.add(MODULES);
config.resolveLoader.modules.add(MODULES);
config.options.set('performance', { hints: false });
config
@ -40,51 +59,53 @@ module.exports = neutrino => {
entryOnly: true
});
config.module
.rule('lint')
.loader('eslint', ({ options }) => {
return {
options: merge(options, {
envs: ['node'],
rules: {
// enforce return after a callback
'callback-return': 'off',
if (config.module.rules.has('lint')) {
config.module
.rule('lint')
.loader('eslint', ({ options }) => {
return {
options: merge(options, {
envs: ['node'],
rules: {
// enforce return after a callback
'callback-return': 'off',
// require all requires be top-level
// http://eslint.org/docs/rules/global-require
'global-require': 'error',
// require all requires be top-level
// http://eslint.org/docs/rules/global-require
'global-require': 'error',
// enforces error handling in callbacks (node environment)
'handle-callback-err': 'off',
// enforces error handling in callbacks (node environment)
'handle-callback-err': 'off',
// Allow console in Node.js
'no-console': 'off',
// Allow console in Node.js
'no-console': 'off',
// disallow mixing regular variable and require declarations
'no-mixed-requires': ['off', false],
// disallow mixing regular variable and require declarations
'no-mixed-requires': ['off', false],
// disallow use of new operator with the require function
'no-new-require': 'error',
// disallow use of new operator with the require function
'no-new-require': 'error',
// disallow string concatenation with __dirname and __filename
// http://eslint.org/docs/rules/no-path-concat
'no-path-concat': 'error',
// disallow string concatenation with __dirname and __filename
// http://eslint.org/docs/rules/no-path-concat
'no-path-concat': 'error',
// disallow use of process.env
'no-process-env': 'off',
// disallow use of process.env
'no-process-env': 'off',
// disallow process.exit()
'no-process-exit': 'off',
// disallow process.exit()
'no-process-exit': 'off',
// restrict usage of specified node modules
'no-restricted-modules': 'off',
// restrict usage of specified node modules
'no-restricted-modules': 'off',
// disallow use of synchronous methods (off by default)
'no-sync': 'off'
}
})
};
});
// disallow use of synchronous methods (off by default)
'no-sync': 'off'
}
})
};
});
}
config.module
.rule('compile')
@ -104,4 +125,18 @@ module.exports = neutrino => {
]
]
});
if (process.env.NODE_ENV !== 'development') {
config
.plugin('copy')
.use(CopyPlugin, [{ context: SRC, from: `**/*` }], { ignore: ['*.js*'] });
config
.plugin('progress')
.use(ProgressBarPlugin);
config
.plugin('clean')
.use(CleanPlugin, [BUILD], { root: CWD });
}
};

146
packages/neutrino-preset-node/yarn.lock

@ -35,6 +35,10 @@ align-text@^0.1.1, align-text@^0.1.3:
longest "^1.0.1"
repeat-string "^1.5.2"
amdefine@>=0.0.4:
version "1.0.1"
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
ansi-regex@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
@ -623,6 +627,10 @@ block-stream@*:
dependencies:
inherits "~2.0.0"
bluebird@^2.10.2:
version "2.11.0"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1"
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0:
version "4.11.6"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215"
@ -788,6 +796,12 @@ cipher-base@^1.0.0, cipher-base@^1.0.1:
dependencies:
inherits "^2.0.1"
clean-webpack-plugin@^0.1.15:
version "0.1.15"
resolved "https://registry.yarnpkg.com/clean-webpack-plugin/-/clean-webpack-plugin-0.1.15.tgz#facc04e0c8dba99bf451ae865ad0361f51af1df1"
dependencies:
rimraf "~2.5.1"
cliui@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1"
@ -850,6 +864,19 @@ convert-source-map@^1.1.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.3.0.tgz#e9f3e9c6e2728efc2676696a70eb382f73106a67"
copy-webpack-plugin@4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-4.0.1.tgz#9728e383b94316050d0c7463958f2b85c0aa8200"
dependencies:
bluebird "^2.10.2"
fs-extra "^0.26.4"
glob "^6.0.4"
is-glob "^3.1.0"
loader-utils "^0.2.15"
lodash "^4.3.0"
minimatch "^3.0.0"
node-dir "^0.1.10"
core-js@^2.4.0:
version "2.4.1"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e"
@ -936,6 +963,13 @@ deepmerge@^1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-1.3.2.tgz#1663691629d4dbfe364fa12a2a4f0aa86aa3a050"
define-properties@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94"
dependencies:
foreach "^2.0.5"
object-keys "^1.0.8"
delayed-stream@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
@ -1043,6 +1077,13 @@ expand-range@^1.8.1:
dependencies:
fill-range "^2.1.0"
exports-loader@0.6.3:
version "0.6.3"
resolved "https://registry.yarnpkg.com/exports-loader/-/exports-loader-0.6.3.tgz#57dc78917f709b96f247fa91e69b554c855013c8"
dependencies:
loader-utils "0.2.x"
source-map "0.1.x"
extend@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4"
@ -1096,6 +1137,10 @@ for-own@^0.1.4:
dependencies:
for-in "^0.1.5"
foreach@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
forever-agent@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
@ -1108,6 +1153,16 @@ form-data@~2.1.1:
combined-stream "^1.0.5"
mime-types "^2.1.12"
fs-extra@^0.26.4:
version "0.26.7"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.26.7.tgz#9ae1fdd94897798edab76d0918cf42d0c3184fa9"
dependencies:
graceful-fs "^4.1.2"
jsonfile "^2.1.0"
klaw "^1.0.0"
path-is-absolute "^1.0.0"
rimraf "^2.2.8"
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
@ -1136,6 +1191,10 @@ fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10:
mkdirp ">=0.5 0"
rimraf "2"
function-bind@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771"
gauge@~2.7.1:
version "2.7.3"
resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.3.tgz#1c23855f962f17b3ad3d0dc7443f304542edfe09"
@ -1182,6 +1241,16 @@ glob-parent@^2.0.0:
dependencies:
is-glob "^2.0.0"
glob@^6.0.4:
version "6.0.4"
resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22"
dependencies:
inflight "^1.0.4"
inherits "2"
minimatch "2 || 3"
once "^1.3.0"
path-is-absolute "^1.0.0"
glob@^7.0.5:
version "7.1.1"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
@ -1197,7 +1266,7 @@ globals@^9.0.0:
version "9.14.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034"
graceful-fs@^4.1.2:
graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9:
version "4.1.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
@ -1274,6 +1343,13 @@ ieee754@^1.1.4:
version "1.1.8"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4"
imports-loader@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/imports-loader/-/imports-loader-0.7.0.tgz#468c04de8075941cfab28146c755c24cc1f36ccd"
dependencies:
loader-utils "^0.2.16"
source-map "^0.5.6"
indexof@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d"
@ -1349,6 +1425,10 @@ is-extglob@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0"
is-extglob@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
is-finite@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa"
@ -1367,6 +1447,12 @@ is-glob@^2.0.0, is-glob@^2.0.1:
dependencies:
is-extglob "^1.0.0"
is-glob@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a"
dependencies:
is-extglob "^2.1.0"
is-my-json-valid@^2.12.4:
version "2.15.0"
resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b"
@ -1460,6 +1546,12 @@ json5@^0.5.0:
version "0.5.1"
resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821"
jsonfile@^2.1.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8"
optionalDependencies:
graceful-fs "^4.1.6"
jsonify@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
@ -1482,6 +1574,12 @@ kind-of@^3.0.2:
dependencies:
is-buffer "^1.0.2"
klaw@^1.0.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439"
optionalDependencies:
graceful-fs "^4.1.9"
lazy-cache@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e"
@ -1506,7 +1604,7 @@ loader-runner@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2"
loader-utils@^0.2.11, loader-utils@^0.2.16:
loader-utils@0.2.x, loader-utils@^0.2.11, loader-utils@^0.2.15, loader-utils@^0.2.16:
version "0.2.16"
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.16.tgz#f08632066ed8282835dff88dfb52704765adee6d"
dependencies:
@ -1515,7 +1613,7 @@ loader-utils@^0.2.11, loader-utils@^0.2.16:
json5 "^0.5.0"
object-assign "^4.0.1"
lodash@^4.14.0, lodash@^4.17.4, lodash@^4.2.0:
lodash@^4.14.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
@ -1575,7 +1673,7 @@ minimalistic-assert@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3"
minimatch@^3.0.0, minimatch@^3.0.2:
"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774"
dependencies:
@ -1607,6 +1705,12 @@ nan@^2.3.0:
version "2.5.1"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.1.tgz#d5b01691253326a97a2bbee9e61c55d8d60351e2"
node-dir@^0.1.10:
version "0.1.16"
resolved "https://registry.yarnpkg.com/node-dir/-/node-dir-0.1.16.tgz#d2ef583aa50b90d93db8cdd26fcea58353957fe4"
dependencies:
minimatch "^3.0.2"
node-libs-browser@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.0.0.tgz#a3a59ec97024985b46e958379646f96c4b616646"
@ -1689,6 +1793,18 @@ object-assign@^4.0.1, object-assign@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
object-keys@^1.0.10, object-keys@^1.0.8:
version "1.0.11"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
object.assign@^4.0.1:
version "4.0.4"
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.0.4.tgz#b1c9cc044ef1b9fe63606fc141abbb32e14730cc"
dependencies:
define-properties "^1.1.2"
function-bind "^1.1.0"
object-keys "^1.0.10"
object.omit@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa"
@ -1813,6 +1929,18 @@ process@^0.11.0:
version "0.11.9"
resolved "https://registry.yarnpkg.com/process/-/process-0.11.9.tgz#7bd5ad21aa6253e7da8682264f1e11d11c0318c1"
progress-bar-webpack-plugin@^1.9.3:
version "1.9.3"
resolved "https://registry.yarnpkg.com/progress-bar-webpack-plugin/-/progress-bar-webpack-plugin-1.9.3.tgz#81fb8bd8e38da6edaf9a20beed79bd978dd63c2a"
dependencies:
chalk "^1.1.1"
object.assign "^4.0.1"
progress "^1.1.8"
progress@^1.1.8:
version "1.1.8"
resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be"
prr@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a"
@ -2009,7 +2137,7 @@ right-align@^0.1.1:
dependencies:
align-text "^0.1.1"
rimraf@2, rimraf@~2.5.1, rimraf@~2.5.4:
rimraf@2, rimraf@^2.2.8, rimraf@~2.5.1, rimraf@~2.5.4:
version "2.5.4"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04"
dependencies:
@ -2065,7 +2193,13 @@ source-map-support@^0.4.2, source-map-support@^0.4.6:
dependencies:
source-map "^0.5.3"
source-map@^0.5.0, source-map@^0.5.3, source-map@~0.5.1, source-map@~0.5.3:
source-map@0.1.x:
version "0.1.43"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346"
dependencies:
amdefine ">=0.0.4"
source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.3:
version "0.5.6"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"

44
packages/neutrino-preset-react/src/index.js

@ -12,28 +12,30 @@ module.exports = neutrino => {
const { config } = neutrino;
config.module
.rule('lint')
.test(/\.jsx?$/)
.loader('eslint', ({ options }) => {
return {
options: merge(options, {
plugins: ['react'],
baseConfig: {
extends: ['plugin:react/recommended']
},
parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true
if (config.module.rules.has('lint')) {
config.module
.rule('lint')
.test(/\.jsx?$/)
.loader('eslint', ({ options }) => {
return {
options: merge(options, {
plugins: ['react'],
baseConfig: {
extends: ['plugin:react/recommended']
},
parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true
}
},
rules: {
'react/prop-types': ['off'],
'jsx-quotes': ['error', 'prefer-double']
}
},
rules: {
'react/prop-types': ['off'],
'jsx-quotes': ['error', 'prefer-double']
}
})
};
});
})
};
});
}
config.module
.rule('compile')

8
packages/neutrino-preset-web/package.json

@ -15,18 +15,22 @@
"babel-loader": "^6.2.10",
"babel-preset-babili": "^0.0.11",
"babel-preset-env": "^1.1.8",
"clean-webpack-plugin": "^0.1.15",
"copy-webpack-plugin": "4.0.1",
"css-loader": "^0.26.1",
"deepmerge": "^1.3.2",
"exists-file": "3.0.0",
"exports-loader": "0.6.3",
"file-loader": "^0.10.0",
"html-webpack-plugin": "^2.28.0",
"html-webpack-template": "^6.0.1",
"imports-loader": "^0.7.0",
"progress-bar-webpack-plugin": "^1.9.3",
"style-loader": "0.13.1",
"url-loader": "0.5.7",
"webpack": "^2.2.1",
"webpack-merge": "^2.6.1",
"worker-loader": "0.7.1",
"neutrino-preset-base": "4.0.0"
"worker-loader": "0.7.1"
},
"peerDependencies": {
"neutrino": "^4.0.0"

79
packages/neutrino-preset-web/src/index.js

@ -5,8 +5,10 @@ const webpack = require('webpack');
const HtmlPlugin = require('html-webpack-plugin');
const htmlTemplate = require('html-webpack-template');
const merge = require('deepmerge');
const base = require('neutrino-preset-base');
const path = require('path');
const CopyPlugin = require('copy-webpack-plugin');
const CleanPlugin = require('clean-webpack-plugin');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const CWD = process.cwd();
const SRC = path.join(CWD, 'src');
@ -18,15 +20,33 @@ const STYLE_LOADER = require.resolve('style-loader');
const URL_LOADER = require.resolve('url-loader');
const MODULES = path.join(__dirname, '../node_modules');
module.exports = neutrino => {
base(neutrino);
const { config } = neutrino;
config.target('web');
config.output.publicPath('./');
config.resolve.modules.add(MODULES);
config.resolveLoader.modules.add(MODULES);
module.exports = ({ config }) => {
config
.target('web')
.context(CWD)
.entry('index')
.add(path.join(SRC, 'index.js'))
.end()
.output
.path(path.join(process.cwd(), 'build'))
.publicPath('./')
.filename('[name].bundle.js')
.chunkFilename('[id].[chunkhash].js')
.end()
.resolve
.modules
.add(PROJECT_MODULES)
.add(MODULES)
.end()
.extensions
.add('.js')
.add('json')
.end()
.end()
.resolveLoader
.modules
.add(PROJECT_MODULES)
.add(MODULES);
config.node
.set('console', false)
@ -122,16 +142,18 @@ module.exports = neutrino => {
}
});
config.module
.rule('lint')
.loader('eslint', ({ options }) => {
return {
options: merge(options, {
globals: ['Buffer'],
envs: ['browser', 'commonjs']
})
};
});
if (config.module.rules.has('lint')) {
config.module
.rule('lint')
.loader('eslint', ({ options }) => {
return {
options: merge(options, {
globals: ['Buffer'],
envs: ['browser', 'commonjs']
})
};
});
}
config
.plugin('env')
@ -165,6 +187,7 @@ module.exports = neutrino => {
const host = process.env.HOST || 'localhost';
const port = parseInt(process.env.PORT) || 5000;
config.devtool('eval');
config.devServer
.host(host)
.port(port)
@ -196,4 +219,20 @@ module.exports = neutrino => {
.plugin('hot')
.use(webpack.HotModuleReplacementPlugin);
}
if (process.env.NODE_ENV !== 'development') {
config.output.filename('[name].[chunkhash].bundle.js');
config
.plugin('copy')
.use(CopyPlugin, [{ context: SRC, from: `**/*` }], { ignore: ['*.js*'] });
config
.plugin('progress')
.use(ProgressBarPlugin);
config
.plugin('clean')
.use(CleanPlugin, [BUILD], { root: CWD });
}
};

142
packages/neutrino-preset-web/yarn.lock

@ -39,6 +39,10 @@ alphanum-sort@^1.0.1, alphanum-sort@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3"
amdefine@>=0.0.4:
version "1.0.1"
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
ansi-regex@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
@ -810,6 +814,10 @@ block-stream@*:
dependencies:
inherits "~2.0.0"
bluebird@^2.10.2:
version "2.11.0"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1"
bluebird@^3.4.7:
version "3.4.7"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3"
@ -1018,6 +1026,12 @@ clean-css@4.0.x:
dependencies:
source-map "0.5.x"
clean-webpack-plugin@^0.1.15:
version "0.1.15"
resolved "https://registry.yarnpkg.com/clean-webpack-plugin/-/clean-webpack-plugin-0.1.15.tgz#facc04e0c8dba99bf451ae865ad0361f51af1df1"
dependencies:
rimraf "~2.5.1"
cliui@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1"
@ -1130,6 +1144,19 @@ convert-source-map@^1.1.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.3.0.tgz#e9f3e9c6e2728efc2676696a70eb382f73106a67"
copy-webpack-plugin@4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-4.0.1.tgz#9728e383b94316050d0c7463958f2b85c0aa8200"
dependencies:
bluebird "^2.10.2"
fs-extra "^0.26.4"
glob "^6.0.4"
is-glob "^3.1.0"
loader-utils "^0.2.15"
lodash "^4.3.0"
minimatch "^3.0.0"
node-dir "^0.1.10"
core-js@^2.4.0:
version "2.4.1"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e"
@ -1314,6 +1341,13 @@ deepmerge@^1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-1.3.2.tgz#1663691629d4dbfe364fa12a2a4f0aa86aa3a050"
define-properties@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94"
dependencies:
foreach "^2.0.5"
object-keys "^1.0.8"
defined@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693"
@ -1479,6 +1513,13 @@ expand-range@^1.8.1:
dependencies:
fill-range "^2.1.0"
exports-loader@0.6.3:
version "0.6.3"
resolved "https://registry.yarnpkg.com/exports-loader/-/exports-loader-0.6.3.tgz#57dc78917f709b96f247fa91e69b554c855013c8"
dependencies:
loader-utils "0.2.x"
source-map "0.1.x"
extend@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4"
@ -1546,6 +1587,10 @@ for-own@^0.1.4:
dependencies:
for-in "^0.1.5"
foreach@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
forever-agent@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
@ -1558,6 +1603,16 @@ form-data@~2.1.1:
combined-stream "^1.0.5"
mime-types "^2.1.12"
fs-extra@^0.26.4:
version "0.26.7"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.26.7.tgz#9ae1fdd94897798edab76d0918cf42d0c3184fa9"
dependencies:
graceful-fs "^4.1.2"
jsonfile "^2.1.0"
klaw "^1.0.0"
path-is-absolute "^1.0.0"
rimraf "^2.2.8"
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
@ -1586,7 +1641,7 @@ fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10:
mkdirp ">=0.5 0"
rimraf "2"
function-bind@^1.0.2:
function-bind@^1.0.2, function-bind@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771"
@ -1636,6 +1691,16 @@ glob-parent@^2.0.0:
dependencies:
is-glob "^2.0.0"
glob@^6.0.4:
version "6.0.4"
resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22"
dependencies:
inflight "^1.0.4"
inherits "2"
minimatch "2 || 3"
once "^1.3.0"
path-is-absolute "^1.0.0"
glob@^7.0.5:
version "7.1.1"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
@ -1651,7 +1716,7 @@ globals@^9.0.0:
version "9.14.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034"
graceful-fs@^4.1.2:
graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9:
version "4.1.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
@ -1783,6 +1848,13 @@ ieee754@^1.1.4:
version "1.1.8"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4"
imports-loader@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/imports-loader/-/imports-loader-0.7.0.tgz#468c04de8075941cfab28146c755c24cc1f36ccd"
dependencies:
loader-utils "^0.2.16"
source-map "^0.5.6"
indexes-of@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607"
@ -1866,6 +1938,10 @@ is-extglob@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0"
is-extglob@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
is-finite@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa"
@ -1884,6 +1960,12 @@ is-glob@^2.0.0, is-glob@^2.0.1:
dependencies:
is-extglob "^1.0.0"
is-glob@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a"
dependencies:
is-extglob "^2.1.0"
is-my-json-valid@^2.12.4:
version "2.15.0"
resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b"
@ -2006,6 +2088,12 @@ json5@^0.5.0:
version "0.5.1"
resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821"
jsonfile@^2.1.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8"
optionalDependencies:
graceful-fs "^4.1.6"
jsonify@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
@ -2028,6 +2116,12 @@ kind-of@^3.0.2:
dependencies:
is-buffer "^1.0.2"
klaw@^1.0.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439"
optionalDependencies:
graceful-fs "^4.1.9"
lazy-cache@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e"
@ -2052,7 +2146,7 @@ loader-runner@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2"
loader-utils@0.2.x, loader-utils@^0.2.11, loader-utils@^0.2.16, loader-utils@^0.2.7, loader-utils@~0.2.2, loader-utils@~0.2.5:
loader-utils@0.2.x, loader-utils@^0.2.11, loader-utils@^0.2.15, loader-utils@^0.2.16, loader-utils@^0.2.7, loader-utils@~0.2.2, loader-utils@~0.2.5:
version "0.2.16"
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.16.tgz#f08632066ed8282835dff88dfb52704765adee6d"
dependencies:
@ -2081,7 +2175,7 @@ lodash.uniq@^4.3.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
lodash@^4.14.0, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.2.0:
lodash@^4.14.0, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
@ -2157,7 +2251,7 @@ minimalistic-assert@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3"
minimatch@^3.0.0, minimatch@^3.0.2:
"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774"
dependencies:
@ -2201,6 +2295,12 @@ no-case@^2.2.0:
dependencies:
lower-case "^1.1.1"
node-dir@^0.1.10:
version "0.1.16"
resolved "https://registry.yarnpkg.com/node-dir/-/node-dir-0.1.16.tgz#d2ef583aa50b90d93db8cdd26fcea58353957fe4"
dependencies:
minimatch "^3.0.2"
node-libs-browser@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.0.0.tgz#a3a59ec97024985b46e958379646f96c4b616646"
@ -2306,6 +2406,18 @@ object-assign@^4.0.1, object-assign@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
object-keys@^1.0.10, object-keys@^1.0.8:
version "1.0.11"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
object.assign@^4.0.1:
version "4.0.4"
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.0.4.tgz#b1c9cc044ef1b9fe63606fc141abbb32e14730cc"
dependencies:
define-properties "^1.1.2"
function-bind "^1.1.0"
object-keys "^1.0.10"
object.omit@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa"
@ -2685,6 +2797,18 @@ process@^0.11.0:
version "0.11.9"
resolved "https://registry.yarnpkg.com/process/-/process-0.11.9.tgz#7bd5ad21aa6253e7da8682264f1e11d11c0318c1"
progress-bar-webpack-plugin@^1.9.3:
version "1.9.3"
resolved "https://registry.yarnpkg.com/progress-bar-webpack-plugin/-/progress-bar-webpack-plugin-1.9.3.tgz#81fb8bd8e38da6edaf9a20beed79bd978dd63c2a"
dependencies:
chalk "^1.1.1"
object.assign "^4.0.1"
progress "^1.1.8"
progress@^1.1.8:
version "1.1.8"
resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be"
prr@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a"
@ -2937,7 +3061,7 @@ right-align@^0.1.1:
dependencies:
align-text "^0.1.1"
rimraf@2, rimraf@~2.5.1, rimraf@~2.5.4:
rimraf@2, rimraf@^2.2.8, rimraf@~2.5.1, rimraf@~2.5.4:
version "2.5.4"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04"
dependencies:
@ -3003,6 +3127,12 @@ source-map-support@^0.4.2:
dependencies:
source-map "^0.5.3"
source-map@0.1.x:
version "0.1.43"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346"
dependencies:
amdefine ">=0.0.4"
source-map@0.5.x, source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.3:
version "0.5.6"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"

6
packages/neutrino/bin/neutrino

@ -18,7 +18,9 @@ const args = yargs
.command('build', 'Compile the source directory to a bundled build')
.command('test [files..]', 'Run all suites from the test directory or provided files', {
watch: {
boolean: true
description: 'Watch source files for changes and re-run tests',
boolean: true,
default: false
}
})
.demandCommand(1, 'You must specify a command for Neutrino to run.\nUSAGE: neutrino <command>')
@ -43,4 +45,4 @@ function run(command, presets) {
});
}
run(args._[0], [...new Set(args.presets.concat(pkgPresets))]);
run(args._[0], [...new Set(pkgPresets.concat(args.presets))]);

2
packages/neutrino/src/neutrino.js

@ -8,7 +8,7 @@ const ora = require('ora');
const cwd = process.cwd();
class Neutrino extends EventEmitter {
constructor(presets) {
constructor(presets = []) {
super();
this.config = new Config();
this.custom = {};

11
yarn.lock

@ -861,6 +861,10 @@ jsprim@^1.2.2:
json-schema "0.2.3"
verror "1.3.6"
kebab-case@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/kebab-case/-/kebab-case-1.0.0.tgz#3f9e4990adcad0c686c0e701f7645868f75f91eb"
klaw@^1.0.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439"
@ -1389,14 +1393,15 @@ nth-check@~1.0.1:
dependencies:
boolbase "~1.0.0"
oao@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/oao/-/oao-0.5.0.tgz#bd8b8534548bd0263cfe8721bccc8e590cae0c8a"
oao@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/oao/-/oao-0.5.1.tgz#994924fb7fee3ab20d2b4ca15ab0819b89613544"
dependencies:
babel-polyfill "6.22.0"
commander "2.9.0"
globby "6.1.0"
inquirer "3.0.1"
kebab-case "1.0.0"
semver "5.3.0"
shelljs "0.7.6"
split "1.0.0"

Loading…
Cancel
Save