Browse Source

Simplify deep picking with pathOr

v5.0.0-beta
Eli Perelman 8 years ago
parent
commit
99db8080c0
  1. 5
      packages/neutrino/bin/neutrino
  2. 1
      packages/neutrino/package.json
  3. 4
      packages/neutrino/yarn.lock

5
packages/neutrino/bin/neutrino

@ -6,6 +6,7 @@ process.noDeprecation = true;
const Neutrino = require('../src/neutrino');
const yargs = require('yargs');
const { pathOr } = require('ramda');
const { join } = require('path');
const cwd = process.cwd();
@ -15,7 +16,7 @@ try {
pkg = require(join(cwd, 'package.json'));
} catch (ex) {}
const pkgPresets = pkg.neutrino && pkg.neutrino.presets ? pkg.neutrino.presets : [];
const pkgPresets = pathOr([], ['neutrino', 'presets'], pkg);
const environments = { build: 'production', start: 'development', test: 'test' };
const args = yargs
.option('presets', {
@ -48,7 +49,7 @@ const args = yargs
function run(command, presets) {
process.env.NODE_ENV = environments[command];
const options = pkg.neutrino && pkg.neutrino.options ? pkg.neutrino.options : {};
const options = pathOr({}, ['neutrino', 'options'], pkg);
const api = new Neutrino(options);
const cwd = process.cwd();

1
packages/neutrino/package.json

@ -23,6 +23,7 @@
},
"dependencies": {
"ora": "^1.1.0",
"ramda": "^0.23.0",
"webpack": "^2.2.1",
"webpack-chain": "^1.4.2",
"webpack-dev-server": "^2.4.1",

4
packages/neutrino/yarn.lock

@ -1608,6 +1608,10 @@ querystringify@0.0.x:
version "0.0.4"
resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-0.0.4.tgz#0cf7f84f9463ff0ae51c4c4b142d95be37724d9c"
ramda@^0.23.0:
version "0.23.0"
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.23.0.tgz#ccd13fff73497a93974e3e86327bfd87bd6e8e2b"
randomatic@^1.1.3:
version "1.1.6"
resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb"

Loading…
Cancel
Save