diff --git a/packages/data-point-codemods/LICENSE b/packages/data-point-codemods/LICENSE new file mode 100644 index 00000000..1f98faa8 --- /dev/null +++ b/packages/data-point-codemods/LICENSE @@ -0,0 +1,203 @@ +Copyright 2018 Viacom Inc. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018 Viacom Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/data-point-codemods/README.md b/packages/data-point-codemods/README.md new file mode 100644 index 00000000..c609be65 --- /dev/null +++ b/packages/data-point-codemods/README.md @@ -0,0 +1,57 @@ +# DataPoint codemods + +> Codemods to help upgrade to newer versions of [data-point](https://github.com/ViacomInc/data-point/) + +Codemods, or [jscodeshift](https://github.com/facebook/jscodeshift) transforms, are small programs that help automate changes in a codebase. Think of them as search and replace on steroids. + +## Install + +Globally install data-point-codemods: + +```bash +$ npm install -g data-point-codemods +``` + +This will install a binary `data-point-codemods`. + +## Usage + +```bash +data-point-codemods [options] +``` + +This tool uses [lib-upgrader](#https://github.com/jfmengels/lib-upgrader) to run the codemods. + +When executed it will ask you about the version you currently are, and the one you wish to upgrade to, after that it will attempt at executing all the codemods to upgrade your code. + +### Help + +For help type: + +```bash +data-point-codemods --help +``` + +## Supported codemods + +**Upgrading 1.x → 2.x** + +- ([codemod](transforms/reducer-args-acc-to-val-acc.js)) Refactor ReducerFunctions for value as first parameter eg. `(acc)` → `(input, acc)`. For more info please look at the [input](transforms/__testfixtures__/reducer-args-acc-to-val-acc.input.js)/[output](transforms/__testfixtures__/reducer-args-acc-to-val-acc.output.js) tests. + + +## WARNING + +Make sure you backup your files, these tests will overwrite their content. The codemods try to cover the most use cases possible, but there might be cases where they end up breaking your code. + +codemods might change your formatting. + +## Example of how a run may look: + +```bash +$ data-point-codemods src/data/ +? What version of data-point are you currently using? older than 2.0.0 +? What version of data-point are you moving to? 2.0.0 (latest) + +For similar projects, you may want to run the following command: + data-point-codemods --from 0.0.0 --to 2.0.0 "src/data/" +``` diff --git a/packages/data-point-codemods/data-point-codemods.js b/packages/data-point-codemods/data-point-codemods.js new file mode 100755 index 00000000..7f1138d6 --- /dev/null +++ b/packages/data-point-codemods/data-point-codemods.js @@ -0,0 +1,24 @@ +#!/usr/bin/env node +'use strict' + +const upgrader = require('lib-upgrader') +const pkg = require('./package.json') +const releases = require('./releases.json') + +const settings = { + libraryName: 'data-point', + releases: releases, + pkg: pkg, + dirname: __dirname +} + +upgrader(settings) + .then(upgrader.checkForUpdates) + .then(upgrader.checkGitIsClean) + .then(upgrader.prompt) + .then(upgrader.applyCodemods) + .then(upgrader.printTip) + .catch(function (err) { + console.error(err.message) + process.exit(1) + }) diff --git a/packages/data-point-codemods/package.json b/packages/data-point-codemods/package.json new file mode 100644 index 00000000..3d214570 --- /dev/null +++ b/packages/data-point-codemods/package.json @@ -0,0 +1,25 @@ +{ + "name": "data-point-codemods", + "version": "1.7.0", + "description": "DataPoint Codemods", + "license": "Apache-2.0", + "engines": { + "node": ">=6" + }, + "author": { + "name": "Acatl Pacheco", + "email": "acatl.pacheco@viacom.com" + }, + "bin":{ + "data-point-codemods": "data-point-codemods.js" + }, + "dependencies": { + "jscodeshift": "0.x", + "lodash": "4.x", + "lib-upgrader": "1.x" + }, + "keywords": [ + "data-point", + "codemods" + ] +} diff --git a/packages/data-point-codemods/releases.json b/packages/data-point-codemods/releases.json new file mode 100644 index 00000000..9a45c432 --- /dev/null +++ b/packages/data-point-codemods/releases.json @@ -0,0 +1,6 @@ +[{ + "version": "2.0.0", + "transforms": [ + "./transforms/reducer-args-acc-to-val-acc.js" + ] +}] diff --git a/packages/data-point-codemods/transforms/__testfixtures__/reducer-args-acc-to-val-acc.input.js b/packages/data-point-codemods/transforms/__testfixtures__/reducer-args-acc-to-val-acc.input.js new file mode 100644 index 00000000..778a0828 --- /dev/null +++ b/packages/data-point-codemods/transforms/__testfixtures__/reducer-args-acc-to-val-acc.input.js @@ -0,0 +1,72 @@ +/* eslint-disable */ +/* eslint-disable prettier */ + +// prettier-ignore +{ + // first parameter is not named acc + function nonReducer1(foo) { + return foo.value + } + + // last method is not a function + function nonReducer2(acc, next) { + return acc.locals + } + + // reducers only have 2 params + function nonReducer3(acc, next, foo) { + return acc.locals + } + + // not a reducer either + d.transform(1,2).then(acc => { + return { + a: acc.value, + b: acc.value[0], + c: acc.value.message.array[0].a, + d: `${acc.value.a}` + }; + }) + + d.transform(1,2).then(acc => { + acc.value + }) + + // only references acc.value + function reducer(acc) { + return { + a: acc.value, + b: acc.value[0], + c: acc.value.message.array[0].a, + d: `${acc.value.a}` + } + } + + const exp1 = function reducer(acc) { + return acc.value + } + + const exp2 = acc => { + return acc.value + } + + const exp3 = a => b => acc => { + return acc.value + } + + // references any other property under acc + function reducerPromise(acc) { + return acc.locals + } + + // references any other property under acc + function reducerNodeStyle(acc, next) { + next(acc.value) + } + + // valid reducer + const f = input = acc => { + // should change value, and not throw error finding input as an identifier + return acc.value.input + } +} diff --git a/packages/data-point-codemods/transforms/__testfixtures__/reducer-args-acc-to-val-acc.output.js b/packages/data-point-codemods/transforms/__testfixtures__/reducer-args-acc-to-val-acc.output.js new file mode 100644 index 00000000..1d71ecec --- /dev/null +++ b/packages/data-point-codemods/transforms/__testfixtures__/reducer-args-acc-to-val-acc.output.js @@ -0,0 +1,72 @@ +/* eslint-disable */ +/* eslint-disable prettier */ + +// prettier-ignore +{ + // first parameter is not named acc + function nonReducer1(foo) { + return foo.value + } + + // last method is not a function + function nonReducer2(acc, next) { + return acc.locals + } + + // reducers only have 2 params + function nonReducer3(acc, next, foo) { + return acc.locals + } + + // not a reducer either + d.transform(1,2).then(acc => { + return { + a: acc.value, + b: acc.value[0], + c: acc.value.message.array[0].a, + d: `${acc.value.a}` + }; + }) + + d.transform(1,2).then(acc => { + acc.value + }) + + // only references acc.value + function reducer(input) { + return { + a: input, + b: input[0], + c: input.message.array[0].a, + d: `${input.a}` + }; + } + + const exp1 = function reducer(input) { + return input; + } + + const exp2 = input => { + return input; + } + + const exp3 = a => b => input => { + return input; + } + + // references any other property under acc + function reducerPromise(input, acc) { + return acc.locals + } + + // references any other property under acc + function reducerNodeStyle(input, acc, next) { + next(input) + } + + // valid reducer + const f = input = input => { + // should change value, and not throw error finding input as an identifier + return input.input; + } +} diff --git a/packages/data-point-codemods/transforms/__tests__/reducer-args-acc-to-val-acc-test.js b/packages/data-point-codemods/transforms/__tests__/reducer-args-acc-to-val-acc-test.js new file mode 100644 index 00000000..0a53032d --- /dev/null +++ b/packages/data-point-codemods/transforms/__tests__/reducer-args-acc-to-val-acc-test.js @@ -0,0 +1,24 @@ +/* eslint-env jest */ + +'use strict' + +const defineTest = require('jscodeshift/dist/testUtils').defineTest + +defineTest( + __dirname, + 'reducer-args-acc-to-val-acc', + null, + 'reducer-args-acc-to-val-acc' +) + +it('throws variable value is already in scope', () => { + const jscodeshift = require('jscodeshift') + const transform = require('../../transforms/reducer-args-acc-to-val-acc') + const source = ` + const f = input = acc => { + return input + acc.value + } + ` + + expect(() => transform({ source }, { jscodeshift }, {})).toThrowError() +}) diff --git a/packages/data-point-codemods/transforms/reducer-args-acc-to-val-acc.js b/packages/data-point-codemods/transforms/reducer-args-acc-to-val-acc.js new file mode 100755 index 00000000..01c484cf --- /dev/null +++ b/packages/data-point-codemods/transforms/reducer-args-acc-to-val-acc.js @@ -0,0 +1,160 @@ +const util = require('util') +const _ = require('lodash') + +module.exports = (file, api, options) => { + const j = api.jscodeshift + const root = j(file.source) + + function replaceWith (target, newObject) { + for (let key in target) { + delete target[key] + } + Object.assign(target, newObject) + } + + function addValueParam (node) { + const accReferences = j(node.value.body) + .find(j.Identifier, { + name: 'acc' + }) + .size() + + let injectAcc = node.value.params.length === 2 || accReferences > 0 + + const newParams = [ + { + type: 'Identifier', + name: 'input' + } + ] + + node.value.params = injectAcc + ? newParams.concat(node.value.params) + : newParams + } + + function replaceAccValueReferences (node) { + // find all references to acc inside the function + j(node) + .find(j.MemberExpression, { + object: { + object: { + name: 'acc' + }, + property: { + name: 'value' + } + } + }) + .forEach(node => { + node.value.object = { + type: 'Identifier', + name: 'input' + } + }) + + // find all references to acc inside the function + j(node) + .find(j.MemberExpression, { + object: { + name: 'acc' + }, + property: { + name: 'value' + } + }) + .forEach(node => { + replaceWith(node.value, { + type: 'Identifier', + name: 'input' + }) + }) + + return node.value + } + + function checkInputVariable (node) { + j(node) + .find(j.Identifier, { + name: 'input' + }) + .forEach(nodePath => { + const parentNode = nodePath.parentPath.value + if (parentNode.type !== 'MemberExpression') { + const nodeStart = parentNode.loc.start + throw Error( + util.format( + 'Refactor Reducer arguments (acc) -> (input, acc) Failed.', + '\nA variable with name `input` already exists in the scope of a reducer function.', + `\n\n${j(node).toSource()}`, + `\n^------- ${file.path}:${nodeStart.line}:${nodeStart.column}`, + "\n\nTry refactoring this block of code to remove any variable of name 'input' before running the codemod.\n\n" + ) + ) + } + }) + } + + function refactorReducer (node) { + checkInputVariable(node) + replaceAccValueReferences(node) + addValueParam(node) + } + + function isReducer (node) { + const firstParam = _.get(node, 'params[0]', {}) + + const isAcc = firstParam.type === 'Identifier' && firstParam.name === 'acc' + + if (!isAcc) { + return false + } + + if (node.params.length === 1) { + return true + } + + // reducers my only have max 2 arguments + if (node.params.length > 2) { + return false + } + + const secondParam = _.get(node, 'params[1]', {}) + const secondParamIsCallback = j(node.body) + .find(j.CallExpression, node => { + return node.callee.name === secondParam.name + }) + .size() + + if (secondParamIsCallback) { + return true + } + + return false + } + + function filterNonReducers (nodePath) { + // we want to filter out any function that is called by dataPoint.transform(a,b).then(acc => {}) + const grandParent = _.get(nodePath, 'parentPath.parentPath.value', {}) + const isThenHandlerFromTransform = + grandParent.type === 'CallExpression' && + _.get(grandParent, 'callee.object.callee.property.name') === + 'transform' && + _.get(grandParent, 'callee.property.name') === 'then' + + return !isThenHandlerFromTransform + } + + function refactorReducerMatches (nodeType) { + root + .find(nodeType, isReducer) + .filter(filterNonReducers) + .forEach(refactorReducer) + } + + refactorReducerMatches(j.FunctionDeclaration) + refactorReducerMatches(j.ArrowFunctionExpression) + refactorReducerMatches(j.FunctionExpression) + + return root.toSource() +} diff --git a/packages/data-point-express/README.md b/packages/data-point-express/README.md index a9672c27..42242302 100644 --- a/packages/data-point-express/README.md +++ b/packages/data-point-express/README.md @@ -32,7 +32,7 @@ const app = new express() Service.create({ // add DataPoint entities entities: { - 'entry:hello-world': (acc) => 'Hello World!!' + 'entry:hello-world': () => 'Hello World!!' } }) .then((service) => { @@ -102,8 +102,8 @@ const app = new express() Service.create({ // add DataPoint entities entities: { - 'entry:HelloWorld': (acc) => 'Hello World!!', - 'entry:Greet': (acc) => `Hello ${acc.locals.params.person}!!` + 'entry:HelloWorld': (input, acc) => 'Hello World!!', + 'entry:Greet': (input, acc) => `Hello ${acc.locals.params.person}!!` } }) .then(service => { @@ -269,7 +269,7 @@ You must pass a string that points to a valid DataPoint entity id; this maps the // data point entities: { 'entry:HelloWorld': { - value: (acc) => 'hello ${acc.locals.params.person}!' + value: (input, acc) => `hello ${acc.locals.params.person}!` } } @@ -295,7 +295,7 @@ One caveat is that you may only pass one entity id and it must be the last middl // data point entities: { 'entry:HelloWorld': { - value: (acc) => 'hello ${acc.locals.params.person}!' + value: (input, acc) => `hello ${acc.locals.params.person}!` } } @@ -333,7 +333,7 @@ const app = new express() Service.create({ // DataPoint entities entities: { - 'entry:hello-world': (acc) => 'Hello World!!' + 'entry:hello-world': (input, acc) => 'Hello World!!' } }) .then((service) => { @@ -370,9 +370,9 @@ When an entity executes through a DataPoint Middleware, it appends some useful i [DataPoint Reducer](https://github.com/ViacomInc/data-point#function-reducer) that prints out the `acc.locals.url` to the console. ```js -const reducer = (acc) => { +const reducer = (input, acc) => { console.log('url that originated this call:', acc.locals.url) - return acc.value + return input } ``` diff --git a/packages/data-point-express/examples/entities.js b/packages/data-point-express/examples/entities.js index ab91b5d3..277422da 100644 --- a/packages/data-point-express/examples/entities.js +++ b/packages/data-point-express/examples/entities.js @@ -2,11 +2,11 @@ module.exports = { 'transform:HelloWorld': () => { return 'Hello World!!' }, - 'transform:greet': acc => { + 'transform:greet': (input, acc) => { return `Hello ${acc.locals.params.name}!!` }, 'entry:getPerson': { - before: acc => { + before: (input, acc) => { // check params is not missing if (!acc.locals.params.personId) { throw new Error('missing params.personId') @@ -15,7 +15,7 @@ module.exports = { value: '$..locals.params.personId | request:getPersonById | hash:Person', params: { ttl: '5m', - cacheKey: acc => `entry:getPerson:${acc.locals.params.personId}` + cacheKey: (input, acc) => `entry:getPerson:${acc.locals.params.personId}` } }, 'request:getPersonById': { diff --git a/packages/data-point-express/lib/factory.test.js b/packages/data-point-express/lib/factory.test.js index 325ad645..c2b1ca10 100644 --- a/packages/data-point-express/lib/factory.test.js +++ b/packages/data-point-express/lib/factory.test.js @@ -16,7 +16,7 @@ describe('create - all middleware', () => { beforeAll(() => { const options = { entities: { - 'transform:hello': acc => ({ + 'transform:hello': (value, acc) => ({ message: `Hello ${acc.locals.params.name}` }) } diff --git a/packages/data-point-express/lib/inspector-middleware.test.js b/packages/data-point-express/lib/inspector-middleware.test.js index 6588c90b..4c4fb3cc 100644 --- a/packages/data-point-express/lib/inspector-middleware.test.js +++ b/packages/data-point-express/lib/inspector-middleware.test.js @@ -16,14 +16,14 @@ describe('create - inspect middleware', () => { beforeAll(() => { dataPoint = DataPoint.create({ entities: { - 'transform:test-params': acc => ({ + 'transform:test-params': (value, acc) => ({ message: `Hello ${acc.locals.params.name}` }), - 'transform:test-query': acc => ({ + 'transform:test-query': (value, acc) => ({ message: `Hello ${acc.locals.query.name}` }), - 'transform:test-value': acc => ({ - message: `Hello ${acc.value}` + 'transform:test-value': (value, acc) => ({ + message: `Hello ${value}` }) } }) diff --git a/packages/data-point-express/lib/middleware.test.js b/packages/data-point-express/lib/middleware.test.js index 130469a3..c91a9064 100644 --- a/packages/data-point-express/lib/middleware.test.js +++ b/packages/data-point-express/lib/middleware.test.js @@ -172,11 +172,11 @@ describe('resolveReducer', () => { beforeAll(() => { dataPoint = DataPoint.create({ entities: { - 'transform:string': acc => `Test`, - 'transform:object': acc => ({ + 'transform:string': () => `Test`, + 'transform:object': () => ({ test: `Test` }), - 'transform:value': acc => `Test ${acc.value}` + 'transform:value': value => `Test ${value}` } }) }) diff --git a/packages/data-point-express/lib/route-middleware.test.js b/packages/data-point-express/lib/route-middleware.test.js index 1bd36d83..80f1de9c 100644 --- a/packages/data-point-express/lib/route-middleware.test.js +++ b/packages/data-point-express/lib/route-middleware.test.js @@ -14,10 +14,10 @@ describe('create - entity middleware', () => { beforeAll(() => { dataPoint = DataPoint.create({ entities: { - 'transform:my-test-query': acc => ({ + 'transform:my-test-query': (value, acc) => ({ message: `Hello ${acc.locals.query.name}` }), - 'transform:my-test-params': acc => ({ + 'transform:my-test-params': (value, acc) => ({ message: `Hello ${acc.locals.params.name}` }) } diff --git a/packages/data-point-express/lib/router-middleware.test.js b/packages/data-point-express/lib/router-middleware.test.js index ee31e43a..eaf0bbf4 100644 --- a/packages/data-point-express/lib/router-middleware.test.js +++ b/packages/data-point-express/lib/router-middleware.test.js @@ -39,7 +39,7 @@ describe('create - datapoint routes', () => { beforeAll(() => { dataPoint = DataPoint.create({ entities: { - 'transform:Test': acc => ({ + 'transform:Test': (value, acc) => ({ message: `Hello ${acc.locals.query.name}` }) } diff --git a/packages/data-point-service/README.md b/packages/data-point-service/README.md index 7c8b2b6e..a098bf6b 100644 --- a/packages/data-point-service/README.md +++ b/packages/data-point-service/README.md @@ -40,15 +40,15 @@ The Service Object holds a reference to a dataPoint instance. ```js const options = { entities: { - 'transform:foo': (acc) => 'bar' + 'transform:foo': (input, acc) => 'bar' } } factory.create(options) .then((service) => { return service.dataPoint.transform('transform:foo') }) - .then(acc => { - console.log(acc.value) + .then((output) => { + console.log(output) // bar }) ``` @@ -64,9 +64,9 @@ function server (dataPoint) { const app = express() app.get('/api/hello-world', (req, res) => { - dataPoint.transform(`entry:HelloWorld`, req.query) - .then(result => { - res.send(result.value) + dataPoint.resolve(`entry:HelloWorld`, req.query) + .then((output) => { + res.send(output) }) }) @@ -79,7 +79,7 @@ function createService () { return DataPointService.create({ DataPoint, entities: { - 'entry:HelloWorld': (acc) => 'Hello World!!' + 'entry:HelloWorld': (input, acc) => 'Hello World!!' } }).then((service) => { return service.dataPoint diff --git a/packages/data-point-service/examples/express-implementation.js b/packages/data-point-service/examples/express-implementation.js index 05f680a2..e0362e99 100644 --- a/packages/data-point-service/examples/express-implementation.js +++ b/packages/data-point-service/examples/express-implementation.js @@ -6,8 +6,8 @@ function server (dataPoint) { const app = express() app.get('/api/hello-world', (req, res) => { - dataPoint.transform(`entry:HelloWorld`, req.query).then(result => { - res.send(result.value) + dataPoint.transform(`entry:HelloWorld`, req.query).then(acc => { + res.send(acc.value) }) }) @@ -20,7 +20,7 @@ function createService () { return DataPointService.create({ DataPoint, entities: { - 'entry:HelloWorld': acc => 'Hello World!!' + 'entry:HelloWorld': () => 'Hello World!!' } }).then(service => { return service.dataPoint diff --git a/packages/data-point/README.md b/packages/data-point/README.md index d9e9c975..9bece1f7 100644 --- a/packages/data-point/README.md +++ b/packages/data-point/README.md @@ -21,6 +21,7 @@ npm install --save data-point - [Getting Started](#getting-started) - [DataPoint.create](#api-data-point-create) - [Transforms](#transforms) + - [dataPoint.resolve](#api-data-point-resolve) - [dataPoint.transform](#api-data-point-transform) - [Reducers](#reducers) - [Accumulator](#accumulator) @@ -63,7 +64,7 @@ This section is meant to get you started with basic concepts of DataPoint's API, Additionally there is a [Hello World](https://www.youtube.com/watch?v=3VxP-FIWgF0) youtube tutorial that explains the data-point basics. -### Hello World Example +### Hello World Example Trivial example of transforming a given **input** with a [FunctionReducer](#function-reducer). @@ -74,16 +75,16 @@ const dataPoint = DataPoint.create() // reducer function that concatenates // accumulator.value with 'World' -const reducer = (acc) => { - return acc.value + ' World' +const reducer = (input) => { + return input + ' World' } // applies reducer to input dataPoint - .transform(reducer, 'Hello') - .then((acc) => { + .resolve(reducer, 'Hello') + .then((output) => { // 'Hello World' - console.log(acc.value) + console.log(output) }) ``` @@ -173,10 +174,10 @@ Based on an initial feed, fetch and aggregate results from multiple remote servi planetId: 1 } - dataPoint.transform('model:Planet', input) - .then((acc) => { + dataPoint.resolve('model:Planet', input) + .then((output) => { /* - acc.value -> + output -> { name: 'Tatooine', population: 200000, @@ -247,8 +248,8 @@ DataPoint instance. foo: 'bar' }, entities: { - 'transform:HelloWorld': (acc) => { - return `hello ${acc.value}!!` + 'transform:HelloWorld': (input) => { + return `hello ${input}!!` } } }) @@ -258,17 +259,46 @@ DataPoint instance. ## Transform +### dataPoint.resolve() + +Execute a [Reducer](#reducers) against an input value. This function supports currying and will get executed when at least the first *2* parameters are provided. + +**SYNOPSIS** + +```js +dataPoint.resolve(reducer:Reducer, input:*, options:TransformOptions):Promise(output:*) +``` + +This method returns a **Promise** with the final output value. + +**ARGUMENTS** + +| Argument | Type | Description | +|:---|:---|:---| +| *reducer* | [Reducer](#reducers) | Reducer that manipulates the input. | +| *input* | `*` | Input value that you want to transform. If **none**, pass `null` or empty object `{}`. | +| *options* | [TransformOptions](#transform-options) | Options within the scope of the current transformation | + +**EXAMPLES:** + +- [Hello World](#hello-world) example. +- [With options](#acc-locals-example) example. + ### dataPoint.transform() -Execute a [Reducer](#reducers) against an input value. + +This method is similar to [dataPoint.resolve()](#api-data-point-resolve). The differences between this method and dataPoint.resolve are: + +- `.transform()` accepts an optional third parameter for node style callback. +- `.transform()` returns a Promise that when resolved it will return the **full** [Accumulator](#accumulator) object instead of the `accumulator.value`. This may come in handy if you want to inspect other values from the transformation. **SYNOPSIS** ```js -// promise -dataPoint.transform(reducer, value, options) -// nodejs callback function -dataPoint.transform(reducer, value, options, done) +// as promise +dataPoint.transform(reducer:Reducer, input:*, options:TransformOptions):Promise(acc:*) +// as nodejs callback function +dataPoint.transform(reducer:Reducer, input:*, options:TransformOptions, done:Function) ``` This method will return a **Promise** if `done` is omitted. @@ -277,8 +307,8 @@ This method will return a **Promise** if `done` is omitted. | Argument | Type | Description | |:---|:---|:---| -| *reducer* | [Reducer](#reducers) | Reducer | -| *value* | `Object` | Value that you want to transform. If **none**, pass `null` or empty object `{}`. | +| *reducer* | [Reducer](#reducers) | Reducer that manipulates the input. | +| *input* | `*` | Input value that you want to transform. If **none**, pass `null` or empty object `{}`. | | *options* | [TransformOptions](#transform-options) | Options within the scope of the current transformation | | *done* | `function` _(optional)_ | Error-first callback [Node.js style callback](https://nodejs.org/api/errors.html#errors_node_js_style_callbacks) that has the arguments `(error, result)`, where `result` contains the final resolved [Accumulator](#accumulator). The actual transformation result will be inside the `result.value` property. | @@ -359,9 +389,9 @@ PathReducer is a `string` value that extracts a path from the current [Accumulat } dataPoint - .transform('$', input) - .then((acc) => { - assert.equal(acc.value, input) + .resolve('$', input) + .then((output) => { + assert.equal(output, input) }) ``` @@ -385,9 +415,9 @@ PathReducer is a `string` value that extracts a path from the current [Accumulat } dataPoint - .transform('$..value', input) - .then((acc) => { - assert.equal(acc.value, input) + .resolve('$..value', input) + .then(output => { + assert.equal(output input) }) ``` @@ -411,9 +441,9 @@ PathReducer is a `string` value that extracts a path from the current [Accumulat } dataPoint - .transform('$a.b[0]', input) - .then((acc) => { - assert.equal(acc.value, 'Hello World') + .resolve('$a.b[0]', input) + .then(output => { + assert.equal(output, 'Hello World') }) ``` @@ -449,9 +479,9 @@ Example at: [examples/reducer-path.js](examples/reducer-path.js) ] dataPoint - .transform('$a.b[]', input) - .then((acc) => { - assert.deepEqual(acc.value, ['Hello World', 'Hello Solar System', 'Hello Universe']) + .resolve('$a.b[]', input) + .then(output => { + assert.deepEqual(output, ['Hello World', 'Hello Solar System', 'Hello Universe']) }) ``` @@ -468,14 +498,14 @@ A FunctionReducer allows you to use a function to apply a transformation. There **IMPORTANT:** Be careful with the parameters passed to your reducer function, DataPoint relies on the number of arguments to detect the type of ReducerFunction it should expect. -#### Returning a value (synchronous) +#### Returning a value The returned value is used as the new value of the transformation. **SYNOPSIS** ```js -const name = (acc:Accumulator) => { +const name = (input:*, acc:Accumulator) => { return newValue } ``` @@ -484,20 +514,21 @@ const name = (acc:Accumulator) => { | Argument | Type | Description | |:---|:---|:---| -| *acc* | [Accumulator](#accumulator) | Current reducer's accumulator Object. The main property is `acc.value`, which is the current reducer's value. | +| *input* | `*` | Reference to acc.value | +| *acc* | [Accumulator](#accumulator) | Current reducer's accumulator Object. The main property is `value`, which is the current reducer's value. |
Reducer Function Example ```js - const reducer = (acc) => { - return acc.value + ' World' + const reducer = (input, acc) => { + return input + ' World' } dataPoint - .transform(reducer, 'Hello') - .then((acc) => { - assert.equal(acc.value, 'Hello World') + .resolve(reducer, 'Hello') + .then((output) => { + assert.equal(output, 'Hello World') }) ```
@@ -512,7 +543,7 @@ If you return a Promise its resolution will be used as the new value of the tran **SYNOPSIS** ```js -const name = (acc:Accumulator) => { +const name = (input:*, acc:Accumulator) => { return Promise.resolve(newValue) } ``` @@ -521,20 +552,22 @@ const name = (acc:Accumulator) => { | Argument | Type | Description | |:---|:---|:---| +| *input* | `*` | Reference to acc.value | | *acc* | [Accumulator](#accumulator) | Current reducer's accumulator Object. The main property is `acc.value`, which is the current reducer's value. |
Example ```js - const reducer = (acc) => { + const reducer = (input, acc) => { + // input is a reference to acc.value return Promise.resolve(acc.value + ' World') } dataPoint - .transform(reducer, 'Hello') - .then((acc) => { - assert.equal(acc.value, 'Hello World') + .resolve(reducer, 'Hello') + .then((output) => { + assert.equal(output, 'Hello World') }) ```
@@ -544,12 +577,12 @@ Example at: [examples/reducer-function-promise.js](examples/reducer-function-pro #### With a callback parameter -Accepting a second parameter as a callback allows you to execute an asynchronous block of code. This callback is an error-first callback ([Node.js style callback](https://nodejs.org/api/errors.html#errors_node_js_style_callbacks)) that has the arguments `(error, value)`, where value will be the _value_ passed to the _next_ transform; this value becomes the new value of the transformation. +Accepting a third parameter as a **callback** allows you to execute an asynchronous block of code. This callback is an error-first callback ([Node.js style callback](https://nodejs.org/api/errors.html#errors_node_js_style_callbacks)) that has the arguments `(error, value)`, where value will be the _value_ passed to the _next_ transform; this value becomes the new value of the transformation. **SYNOPSIS** ```js -const name = (acc:Accumulator, next:function) => { +const name = (input:*, acc:Accumulator, next:function) => { next(error:Error, newValue:*) } ``` @@ -558,6 +591,7 @@ const name = (acc:Accumulator, next:function) => { | Argument | Type | Description | |:---|:---|:---| +| *input* | `*` | Reference to acc.value | | *acc* | [Accumulator](#accumulator) | Current reducer's accumulator Object. The main property is `acc.value`, which is the current reducer's value. | | *next* | `Function(error,value)` | [Node.js style callback](https://nodejs.org/api/errors.html#errors_node_js_style_callbacks), where `value` is the value to be passed to the next reducer. @@ -565,14 +599,14 @@ const name = (acc:Accumulator, next:function) => { Example ```js - const reducer = (acc, next) => { - next(null, acc.value + ' World') + const reducer = (input, acc, next) => { + next(null, input + ' World') } dataPoint - .transform(reducer, 'Hello') - .then((acc) => { - assert.equal(acc.value, 'Hello World') + .resolve(reducer, 'Hello') + .then((output) => { + assert.equal(output, 'Hello World') }) ``` @@ -584,7 +618,7 @@ Example at: [examples/reducer-function-with-callback.js](examples/reducer-functi Throw an error from the reducer ```js - const throwError = (acc, next) => { + const throwError = (error, acc, next) => { // passing first argument will be // handled as an error by the transform next(new Error('oh noes!!')) @@ -620,7 +654,7 @@ ObjectReducers are plain objects where the values are reducers. They're used to const objectReducer = { y: '$x.y', - zPlusOne: ['$x.y.z', (acc) => acc.value + 1] + zPlusOne: ['$x.y.z', (input) => input + 1] } // output from dataPoint.transform(objectReducer, inputData): @@ -657,8 +691,8 @@ ObjectReducers are plain objects where the values are reducers. They're used to alderaan: 2 } - dataPoint.transform(objectReducer, planetIds) - .then(acc => { + dataPoint.resolve(objectReducer, planetIds) + .then(output => { // do something with the aggregated planet data! }) @@ -692,7 +726,7 @@ Each of the reducers, including the nested ones, are resolved against the same a } } - // output from dataPoint.transform(objectReducer, inputData): + // output from dataPoint.resolve(objectReducer, inputData): { x: 'X', @@ -738,7 +772,7 @@ Each of the reducers might contain more ObjectReducers (which might contain redu ] } - // output from dataPoint.transform(objectReducer, inputData): + // output from dataPoint.resolve(objectReducer, inputData): { x: { @@ -782,8 +816,8 @@ For information about supported (built-in) entities, see the [Entities](#entitie } } - const toUpperCase = (acc) => { - return acc.value.toUpperCase() + const toUpperCase = (input) => { + return input.toUpperCase() } dataPoint.addEntities({ @@ -794,9 +828,9 @@ For information about supported (built-in) entities, see the [Entities](#entitie // resolve `transform:getGreeting`, // pipe value to `transform:toUpperCase` dataPoint - .transform(['transform:getGreeting | transform:toUpperCase'], input) - .then((acc) => { - assert.equal(acc.value, 'HELLO WORLD') + .resolve(['transform:getGreeting | transform:toUpperCase'], input) + .then((output) => { + assert.equal(output, 'HELLO WORLD') }) ``` @@ -807,8 +841,8 @@ A ListReducer is an array of reducers where the result of each reducer becomes t | ListReducer | Description | |:---|:---| -| `['$a.b', (acc) => { ... }]` | Get path `a.b`, pipe value to function reducer | -| `['$a.b', (acc) => { ... }, 'hash:Foo']` | Get path `a.b`, pipe value to function reducer, pipe result to `hash:Foo` | +| `['$a.b', (input) => { ... }]` | Get path `a.b`, pipe value to function reducer | +| `['$a.b', (input) => { ... }, 'hash:Foo']` | Get path `a.b`, pipe value to function reducer, pipe result to `hash:Foo` | ### Conditionally execute an entity @@ -843,9 +877,9 @@ dataPoint.addEntities({ }) dataPoint - .transform('transform:getPerson[]', people) - .then((acc) => { - assert.deepEqual(acc.value, [ + .resolve('transform:getPerson[]', people) + .then((output) => { + assert.deepEqual(output, [ { name: 'Luke Skywalker', birthYear: '19BBY' @@ -864,7 +898,7 @@ Example at: [examples/reducer-conditional-operator.js](examples/reducer-conditio ### Collection Mapping -Adding `[]` at the end of an entity reducer will map the given entity to each result of the current `acc.value` if `value` is a collection. If the value is not a collection, the entity will ignore the `[]` directive. +Adding `[]` at the end of an entity reducer will map the given entity to each result of the current `value` if `value` is a collection. If the value is not a collection, the entity will ignore the `[]` directive.
Reducer Collection Mapping Example @@ -879,8 +913,8 @@ Adding `[]` at the end of an entity reducer will map the given entity to each re ] } - const toUpperCase = (acc) => { - return acc.value.toUpperCase() + const toUpperCase = (input) => { + return input.toUpperCase() } dataPoint.addEntities({ @@ -888,12 +922,12 @@ Adding `[]` at the end of an entity reducer will map the given entity to each re }) dataPoint - .transform(['$a | transform:toUpperCase[]'], input) - .then((acc) => { - assert.equal(acc.value[0], 'HELLO WORLD') - assert.equal(acc.value[1], 'HELLO LAIA') - assert.equal(acc.value[2], 'HELLO DAREK') - assert.equal(acc.value[3], 'HELLO ITALY') + .resolve(['$a | transform:toUpperCase[]'], input) + .then((output) => { + assert.equal(output[0], 'HELLO WORLD') + assert.equal(output[1], 'HELLO LAIA') + assert.equal(output[2], 'HELLO DAREK') + assert.equal(output[3], 'HELLO ITALY') }) ```
@@ -937,7 +971,7 @@ assign(reducer:Reducer):Object assign } = DataPoint.helpers - const value = { + const input = { a: 1 } @@ -948,10 +982,10 @@ assign(reducer:Reducer):Object }) dataPoint - .transform(reducer, value) - .then(acc => { + .resolve(reducer, input) + .then(output => { /* - acc.value --> { + output --> { a: 1, b: { c: 2 @@ -992,7 +1026,7 @@ map(reducer:Reducer):Array map } = DataPoint.helpers - const value = [{ + const input = [{ a: 1 }, { a: 2 @@ -1000,13 +1034,13 @@ map(reducer:Reducer):Array // get path `a` then multiply by 2 const reducer = map( - ['$a', (acc) => acc.value * 2] + ['$a', (input) => input * 2] ) dataPoint - .transform(reducer, value) - .then(acc => { - // acc.value -> [2, 4] + .resolve(reducer, input) + .then(output => { + // output -> [2, 4] }) ``` @@ -1040,18 +1074,18 @@ filter(reducer:Reducer):Array map } = DataPoint.helpers - const value = [{ a: 1 }, { a: 2 }] + const input = [{ a: 1 }, { a: 2 }] // filters array elements that are not // truthy for the given reducer list const reducer = filter( - ['$a', (acc) => acc.value > 1] + ['$a', (input) => input > 1] ) dataPoint - .transform(reducer, value) - .then(acc => { - // acc.value -> [{ a: 2 }] + .resolve(reducer, input) + .then(output => { + // output -> [{ a: 2 }] }) ``` @@ -1084,16 +1118,16 @@ find(reducer:Reducer):* map } = DataPoint.helpers - const value = [{ a: 1 }, { b: 2 }] + const input = [{ a: 1 }, { b: 2 }] // the $b reducer is truthy for the // second element in the array const reducer = find('$b') dataPoint - .transform(reducer, value) - .then(acc => { - // acc.value -> { b: 2 } + .resolve(reducer, input) + .then(output => { + // output -> { b: 2 } }) ``` @@ -1213,9 +1247,9 @@ To use built-in type checks you may set the value of **inputType**/**outputType* name: 'DataPoint' } - dataPoint.transform('model:getName', input) - .then(acc => { - // acc.value -> DataPoint + dataPoint.resolve('model:getName', input) + .then(output => { + // output -> 'DataPoint' }) ``` @@ -1236,8 +1270,8 @@ To customize type checking you may use a [Reducer](#reducers). If the reducer th 'model:getName': { value: '$name', - outputType: acc => { - if(typeof acc.value === 'string' && acc.value.length > 5) { + outputType: value => { + if(typeof value === 'string' && value.length > 5) { return trues } @@ -1250,9 +1284,9 @@ To customize type checking you may use a [Reducer](#reducers). If the reducer th name: 'DataPoint' } - dataPoint.transform('model:getName', input) - .then(acc => { - // acc.value -> DataPoint + dataPoint.resolve('model:getName', input) + .then(output => { + // output -> 'DataPoint' }) ``` @@ -1280,9 +1314,9 @@ To customize type checking you may use a [Reducer](#reducers). If the reducer th name: 'DataPoint' } - dataPoint.transform('model:getName', input) - .then(acc => { - // acc.value -> DataPoint + dataPoint.resolve('model:getName', input) + .then(output => { + // output -> DataPoint }) ``` @@ -1317,12 +1351,12 @@ dataPoint.addEntities({ } } - const getMax = (acc) => { - return Math.max.apply(null, acc.value) + const getMax = (input) => { + return Math.max.apply(null, input) } - const multiplyBy = (number) => (acc) => { - return acc.value * number + const multiplyBy = (number) => (input) => { + return input * number } dataPoint.addEntities({ @@ -1330,9 +1364,9 @@ dataPoint.addEntities({ }) dataPoint - .transform('transform:foo', input) - .then((acc) => { - assert.equal(acc.value, 30) + .resolve('transform:foo', input) + .then((output) => { + assert.equal(output, 30) }) ``` @@ -1383,12 +1417,12 @@ dataPoint.addEntities({ } } - const getMax = (acc) => { - return Math.max.apply(null, acc.value) + const getMax = (input) => { + return Math.max.apply(null, input) } - const multiplyBy = (number) => (acc) => { - return acc.value * number + const multiplyBy = (number) => (input) => { + return input * number } dataPoint.addEntities({ @@ -1398,9 +1432,9 @@ dataPoint.addEntities({ }) dataPoint - .transform('model:foo', input) - .then((acc) => { - assert.equal(acc.value, 30) + .resolve('model:foo', input) + .then((output) => { + assert.equal(output, 30) }) ``` @@ -1414,10 +1448,10 @@ Example at: [examples/entity-model-basic.js](examples/entity-model-basic.js) Checking whether the value passed to an entity is an array ```js - const toArray = (acc) => { - return Array.isArray(acc.value) - ? acc.value - : [acc.value] + const toArray = (input) => { + return Array.isArray(input) + ? input + : [input] } dataPoint.addEntities({ @@ -1428,9 +1462,9 @@ Example at: [examples/entity-model-basic.js](examples/entity-model-basic.js) }) dataPoint - .transform('model:foo', 100) - .then((acc) => { - assert.deepEqual(acc.value, [100]) + .resolve('model:foo', 100) + .then((output) => { + assert.deepEqual(output, [100]) }) ``` @@ -1444,10 +1478,10 @@ Example at: [examples/entity-model-before.js](examples/entity-model-before.js) Using `after` transform ```js - const toArray = (acc) => { - return Array.isArray(acc.value) - ? acc.value - : [acc.value] + const toArray = (input) => { + return Array.isArray(input) + ? input + : [input] } dataPoint.addEntities({ @@ -1464,16 +1498,16 @@ Example at: [examples/entity-model-before.js](examples/entity-model-before.js) } dataPoint - .transform('model:foo', input) - .then((acc) => { - assert.deepEqual(acc.value, [3, 15]) + .resolve('model:foo', input) + .then((output) => { + assert.deepEqual(output, [3, 15]) }) ``` ##### Model.error -Any error that happens within the scope of the Entity can be handled by the `error` transform. To respect the API, error reducers have the same API, and the value of the error is under `acc.value`. +Any error that happens within the scope of the Entity can be handled by the `error` transform. To respect the API, error reducers have the same API. **Error handling** @@ -1493,11 +1527,11 @@ Passing a value as the second argument will stop the propagation of the error. // points to a NON Array value value: '$a.b', outputType: 'isArray', - error: (acc) => { + error: (error) => { // prints out the error // message generated by // isArray type check - console.log(acc.value.message) + console.log(error.message) console.log('Value is invalid, resolving to empty array') @@ -1515,9 +1549,9 @@ Passing a value as the second argument will stop the propagation of the error. } dataPoint - .transform('model:getArray', input) - .then((acc) => { - assert.deepEqual(acc.value, []) + .resolve('model:getArray', input) + .then((output) => { + assert.deepEqual(output, []) }) ``` @@ -1529,10 +1563,9 @@ Example at: [examples/entity-model-error-handled.js](examples/entity-model-error Pass the array to be handled somewhere else ```js - const logError = (acc) => { - // acc.value holds the actual Error Object - console.log(acc.value.toString()) - throw acc.value + const logError = (error) => { + console.log(error.toString()) + throw error } dataPoint.addEntities({ @@ -1550,7 +1583,7 @@ Example at: [examples/entity-model-error-handled.js](examples/entity-model-error } dataPoint - .transform('model:getArray', input) + .resolve('model:getArray', input) .catch((error) => { console.log(error.toString()) }) @@ -1568,8 +1601,8 @@ The params object is used to pass custom data to your entity. This Object is exp On a FunctionReducer ```js - const multiplyValue = (acc) => { - return acc.value * acc.params.multiplier + const multiplyValue = (input, acc) => { + return input * acc.params.multiplier } dataPoint.addEntities({ @@ -1582,9 +1615,9 @@ The params object is used to pass custom data to your entity. This Object is exp }) dataPoint - .transform('model:multiply', 200) - .then((acc) => { - assert.deepEqual(acc.value, 20000) + .resolve('model:multiply', 200) + .then((output) => { + assert.deepEqual(output, 20000) }) ``` @@ -1603,9 +1636,9 @@ The params object is used to pass custom data to your entity. This Object is exp } }) - dataPoint.transform('model:getParam') - .then((acc) => { - assert.deepEqual(acc.value, 100) + dataPoint.resolve('model:getParam') + .then((output) => { + assert.deepEqual(output, 100) }) ``` @@ -1690,11 +1723,17 @@ Sets the url to be requested. } }) - dataPoint.transform('request:getLuke', {}).then(acc => { - const result = acc.value - assert.equal(result.name, 'Luke Skywalker') - assert.equal(result.height, '172') - }) + dataPoint.resolve('request:getLuke', {}) + .then(output => { + /* + output -> + { + name: 'Luke Skywalker', + height: '172', + ... + } + */ + }) ``` @@ -1722,11 +1761,17 @@ Using `acc.value` property to make the url dynamic. personId: 1 } - dataPoint.transform('request:getLuke', input).then(acc => { - const result = acc.value - assert.equal(result.name, 'Luke Skywalker') - assert.equal(result.height, '172') - }) + dataPoint.resolve('request:getLuke', input) + .then(output => { + /* + output -> + { + name: 'Luke Skywalker', + height: '172', + ... + } + */ + }) ``` @@ -1751,11 +1796,17 @@ For more information on acc.locals: [TransformOptions](#transform-options) and [ } } - dataPoint.transform('request:getLuke', {}, options).then(acc => { - const result = acc.value - assert.equal(result.name, 'Luke Skywalker') - assert.equal(result.height, '172') - }) + dataPoint.resolve('request:getLuke', {}, options) + .then(output => { + /* + output -> + { + name: 'Luke Skywalker', + height: '172', + ... + } + */ + }) ``` @@ -1763,7 +1814,88 @@ For more information on acc.locals: [TransformOptions](#transform-options) and [ Example at: [examples/entity-request-string-template.js](examples/entity-request-options-locals.js) +<<<<<<< HEAD +##### TransformObject + +A TransformObject is a Object where any property (at any level), that its key starts with the character `$` is treated as a [Reducer](#reducers). Properties that do not start with a `$` character will be left untouched. + +When a TransformObject is to be resolved, all reducers are resolved in parallel. The `$` character will also be removed from the resolved property. + +
+ TransformObject Example + + ```js + dataPoint.addEntities({ + 'request:searchPeople': { + url: 'https://swapi.co/api/people', + options: { + // this request will be sent as: + // https://swapi.co/api/people/?search=r2 + qs: { + // because the key starts + // with $ it will be treated + // as a reducer + $search: '$personName' + } + } + } + }) + + // second parameter to resolve is + // the input value + dataPoint + .resolve('request:searchPeople', { + personName: 'r2' + }) + .then(output => { + // output.results[0].name -> 'R2-D2' + }) + ``` +
+ + +Example at: [examples/entity-request-transform-object.js](examples/entity-request-transform-object.js) + +##### Request.beforeRequest + +There are times where you may want to process the `request.options` object before passing it to send the request. + +This example simply provides the header object through a reducer. One possible use case for request.beforeRequest would be to set up [OAuth Signing](https://www.npmjs.com/package/request#oauth-signing). + +
+ Request.beforeRequest Example + + ```js + dataPoint.addEntities({ + 'request:getOrgInfo': { + url: 'https://api.github.com/orgs/{value}', + beforeRequest: (options) => { + // reference to request.options + return Object.assign({}, options, { + headers: { + 'User-Agent': 'DataPoint' + } + }) + } + } + }) + + dataPoint + .resolve('request:getOrgInfo', 'nodejs') + .then((output) => { + console.log(output) + // entire result from https://api.github.com/orgs/nodejs + }) + ``` +
+ + +Example at: [examples/entity-request-before-request.js](examples/entity-request-before-request.js) + +For more examples of request entities, see the [Examples](examples), the unit tests: [Request Definitions](test/definitions/sources.js), and [Integration Examples](test/definitions/integrations.js) +======= For more examples of request entities, see the [Examples](examples), the [Integration Examples](test/definitions/integrations.js), and the unit tests: [Request Definitions](test/definitions/sources.js). +>>>>>>> upstream/master ### Inspecting Request @@ -1866,9 +1998,9 @@ dataPoint.addEntities({ }) dataPoint - .transform('hash:helloWorld', input) - .then((acc) => { - assert.deepEqual(acc.value, { + .resolve('hash:helloWorld', input) + .then((output) => { + assert.deepEqual(output, { c: 'Hello', d: ' World!!' }) @@ -1902,8 +2034,8 @@ Going back to our GitHub API examples, let's map some keys from the result of a // a ReducerFunction url: [ '$name', - acc => { - return `https://github.com/ViacomInc/${_.kebabCase(acc.value)}` + input => { + return `https://github.com/ViacomInc/${_.kebabCase(input)}` } ] } @@ -1914,8 +2046,8 @@ Going back to our GitHub API examples, let's map some keys from the result of a name: 'DataPoint' } - dataPoint.transform('hash:mapKeys', input).then(acc => { - assert.deepEqual(acc.value, { + dataPoint.resolve('hash:mapKeys', input).then(output => { + assert.deepEqual(output, { name: 'DataPoint', url: 'https://github.com/ViacomInc/data-point' }) @@ -1939,7 +2071,7 @@ Hash.addKeys is very similar to Hash.mapKeys, but the difference is that `mapKey dataPoint.addEntities({ 'hash:addKeys': { addKeys: { - nameLowerCase: ['$name', acc => acc.value.toLowerCase()], + nameLowerCase: ['$name', input => input.toLowerCase()], url: () => 'https://github.com/ViacomInc/data-point' } } @@ -1949,8 +2081,8 @@ Hash.addKeys is very similar to Hash.mapKeys, but the difference is that `mapKey name: 'DataPoint' } - dataPoint.transform('hash:addKeys', input).then(acc => { - assert.deepEqual(acc.value, { + dataPoint.resolve('hash:addKeys', input).then(output => { + assert.deepEqual(output, { name: 'DataPoint', nameLowerCase: 'datapoint', url: 'https://github.com/ViacomInc/data-point' @@ -1983,10 +2115,10 @@ The next example is similar to the previous example. However, instead of mapping url: 'https://github.com/ViacomInc/data-point' } - dataPoint.transform('hash:pickKeys', input).then(acc => { + dataPoint.resolve('hash:pickKeys', input).then(output => { // notice how name is no longer // in the object - assert.deepEqual(acc.value, { + assert.deepEqual(output, { url: 'https://github.com/ViacomInc/data-point' }) }) @@ -2022,8 +2154,8 @@ This example will only **omit** some keys, and let the rest pass through: url: 'https://github.com/ViacomInc/data-point' } - dataPoint.transform('hash:omitKeys', input).then(acc => { - assert.deepEqual(acc.value, expectedResult) + dataPoint.resolve('hash:omitKeys', input).then(output => { + assert.deepEqual(output, expectedResult) }) ``` @@ -2064,9 +2196,9 @@ Sometimes you just want to add a hard-coded value to your current `acc.value`. dataPoint - .transform('hash:addValues') - .then((acc) => { - assert.deepEqual(acc.value, expectedResult) + .resolve('hash:addValues') + .then((output) => { + assert.deepEqual(output, expectedResult) }) ``` @@ -2080,8 +2212,8 @@ You can add multiple reducers to your Hash spec. Hash Multiple Reducers Example ```js - const toUpperCase = (acc) => { - return acc.value.toUpperCase() + const toUpperCase = (input) => { + return input.toUpperCase() } dataPoint.addEntities({ @@ -2114,9 +2246,9 @@ You can add multiple reducers to your Hash spec. } dataPoint - .transform('entry:orgInfo', { org: 'nodejs' }) - .then((acc) => { - assert.deepEqual(acc.value, expectedResult) + .resolve('entry:orgInfo', { org: 'nodejs' }) + .then((output) => { + assert.deepEqual(output, expectedResult) }) ``` @@ -2203,9 +2335,9 @@ Now that we have the result of the fetch, let's now map each item, and then extr }) dataPoint - .transform('request:getOrgRepositories | collection:getRepositoryTagsUrl', {}) - .then((acc) => { - console.log(acc.value) + .resolve('request:getOrgRepositories | collection:getRepositoryTagsUrl', {}) + .then((output) => { + console.log(output) /* [ https://api.github.com/repos/nodejs/http-parser/tags, @@ -2250,8 +2382,8 @@ _For the purpose of this example, let's imagine that GitHub does not provide the } }) - dataPoint.transform('request:getOrgRepositories | collection:getRepositoryLatestTag', {}).then((acc) => { - console.log(acc.value) + dataPoint.resolve('request:getOrgRepositories | collection:getRepositoryLatestTag', {}).then((output) => { + console.log(output) /* [ [ // repo @@ -2304,9 +2436,9 @@ dataPoint.addEntities({ }) dataPoint - .transform('request:getOrgRepositories | collection:getRepositoryLatestTag') - .then((acc) => { - console.log(acc.value) + .resolve('request:getOrgRepositories | collection:getRepositoryLatestTag') + .then((output) => { + console.log(output) /* [ "v2.7.1", @@ -2342,16 +2474,16 @@ The following example filters the data to identify all the repos that have more }, 'collection:getRepositoryUrl': { map: '$url', - filter: (acc) => { - return acc.value.stargazers_count > 100 + filter: (input) => { + return input.stargazers_count > 100 } } }) dataPoint - .transform(['request:getOrgRepositories', 'collection:getRepositoryUrl']) - .then((acc) => { - console.log(acc.value) + .resolve(['request:getOrgRepositories', 'collection:getRepositoryUrl']) + .then((output) => { + console.log(output) /* [ https://api.github.com/repos/nodejs/http-parser, @@ -2391,9 +2523,9 @@ The following example gets all the repos that are actually forks. In this case, }) dataPoint - .transform(['request:getOrgRepositories', 'collection:getRepositoryUrl']) - .then((acc) => { - console.log(acc.value) + .resolve(['request:getOrgRepositories', 'collection:getRepositoryUrl']) + .then((output) => { + console.log(output) /* [ { @@ -2436,17 +2568,17 @@ Returns the value of the first element in the array that satisfies the provided }, 'collection:getNodeRepo': { before: 'request:repos', - find: (acc) => { + find: (input) => { // notice we are checking against the property -name- - return acc.value.name === 'node' + return input.name === 'node' } } }) dataPoint - .transform('request:repos | collection:getNodeRepo') - .then((acc) => { - console.log(acc.value) + .resolve('request:repos | collection:getNodeRepo') + .then((output) => { + console.log(output) /* { "id": 27193779, @@ -2474,8 +2606,8 @@ Returns the value of the first element in the array that satisfies the provided Basic `Collection.find` with `compose` example ```js - const isEqualTo = (match) => (acct) => { - return acc.value === match + const isEqualTo = (match) => (input) => { + return input === match } dataPoint.addEntities({ @@ -2498,9 +2630,9 @@ Returns the value of the first element in the array that satisfies the provided }; dataPoint - .transform('request:repos | collection:getNodeRepo') - .then((acc) => { - console.log(acc.value) + .resolve('request:repos | collection:getNodeRepo') + .then((output) => { + console.log(output) /* { "id": 27193779, @@ -2522,8 +2654,8 @@ Returns the value of the first element in the array that satisfies the provided Get all forks and map them to a Hash entity ```js - const isEqualTo = (match) => (acc) => { - return acc.value === match + const isEqualTo = (match) => (input) => { + return input === match } dataPoint.addEntities({ @@ -2547,9 +2679,9 @@ Returns the value of the first element in the array that satisfies the provided }; dataPoint - .transform('request:repos | collection:forkedReposSummary') - .then((acc) => { - console.log(acc.value) + .resolve('request:repos | collection:forkedReposSummary') + .then((output) => { + console.log(output) /* [ { @@ -2621,15 +2753,15 @@ If no case statement resolves to `truthy`, then the default statement will be us ```js -const isEqual = (compareTo) => (acc) => { - return acc.value === compareTo +const isEqual = (compareTo) => (input) => { + return input === compareTo } -const resolveTo = (value) => (acc) => { - return value +const resolveTo = (newValue) => (input) => { + return input } -const throwError = (message) => (acc) => { +const throwError = (message) => (input) => { throw new Error(message) } @@ -2645,15 +2777,15 @@ dataPoint.addEntities({ } }) -dataPoint.transform('control:fruitPrices', 'apples').then((acc) => { - console.log(acc.value) // 0.32 +dataPoint.resolve('control:fruitPrices', 'apples').then((output) => { + console.log(output) // 0.32 }); -dataPoint.transform('control:fruitPrices', 'cherries').then((acc) => { - console.log(acc.value) // 3.00 expensive!! +dataPoint.resolve('control:fruitPrices', 'cherries').then((output) => { + console.log(output) // 3.00 expensive!! }); -dataPoint.transform('control:fruitPrices', 'plum') +dataPoint.resolve('control:fruitPrices', 'plum') .catch((error) => { console.log(error) // Fruit was not found!! Maybe call the manager? }); @@ -2768,10 +2900,10 @@ Extending entities is **not a deep merge of properties** from one entity to the } } - dataPoint.transform('entry:getReposWithAllTags', null, options).then((acc) => { + dataPoint.resolve('entry:getReposWithAllTags', null, options).then((output) => { // returns all the repos // for nodejs org - console.log(acc.value) + console.log(output) }) ``` @@ -2791,7 +2923,7 @@ Example at: [examples/extend-entity-keys.js](examples/extend-entity-keys.js) } }, 'model:multiplyBy': { - value: (acc) => acc.value * acc.params.multiplicand, + value: (input, acc) => input * acc.params.multiplicand, params: { multiplicand: 1 } @@ -2806,8 +2938,8 @@ Example at: [examples/extend-entity-keys.js](examples/extend-entity-keys.js) } }) - dataPoint.transform('hash:multiply', {multiplier: 5}).then((acc) => { - console.log(acc.value) + dataPoint.resolve('hash:multiply', {multiplier: 5}).then((output) => { + console.log(output) /* { multiplyByFactor: 5, @@ -2999,8 +3131,10 @@ function resolve(acc:Accumulator, resolveReducer:function):Promise .then((acc) => { // execute lodash template against accumulator value const output = spec.template(acc.value) - // set new accumulator.value this method creates a new acc object - return DataPoint.set(acc, 'value', output) + // creates a new acc object with new value + return Object.assign({}, acc, { + value: output + }) }) } @@ -3029,16 +3163,16 @@ function resolve(acc:Accumulator, resolveReducer:function):Promise } }) - const data = { + const input = { user: { name: 'World' } } dataPoint - .transform('render:HelloWorld', data) - .then((acc) => { - assert.equal(acc.value, '

Hello World!!

') + .resolve('render:HelloWorld', input) + .then((output) => { + assert.equal(output, '

Hello World!!

') }) ``` @@ -3059,20 +3193,21 @@ const dataPoint = DataPoint.create({ /* data-point options */ }) -app.get('/api/:entry', (req, res, next) =>{ +app.get('/api/:entry', (req, res, next) => { const {entry} = req.params - dataPoint.transform(`entry:${entry}`, req.query, (err, res) => { - if (err) { + dataPoint.resolve(`entry:${entry}`, req.query) + .then((output) => { + res.send((output) + }) + .catch((error) => { console.error('entry: %s failed!', entry) console.error(error.stack) next(err) // pass error to middleware chain return - } - // respond with result from data-point - res.send(result.value) - })) + }) }) + app.listen(3000, function () { console.log('listening on port 3000!') }) @@ -3088,15 +3223,15 @@ You may use a [higher order function](https://medium.com/javascript-scene/higher ```js // sync -const name = (param1, param2, ...) => (acc:Accumulator) => { +const name = (param1, param2, ...) => (input:*, acc:Accumulator) => { return newValue } // async via promise -const name = (param1, param2, ...) => (acc:Accumulator) => { +const name = (param1, param2, ...) => (input:*, acc:Accumulator) => { return Promise.resolve(newValue) } // async via callback -const name = (param1, param2, ...) => (acc:Accumulator, next:function) => { +const name = (param1, param2, ...) => (input:*, acc:Accumulator, next:function) => { next(error:Error, newValue:*) } ``` @@ -3105,14 +3240,14 @@ const name = (param1, param2, ...) => (acc:Accumulator, next:function) => { Higher Order Reducer Example ```js - const addStr = (value) => (acc) => { - return acc.value + value + const addStr = (newString) => (input) => { + return `${input}${newString}` } dataPoint - .transform(addStr(' World!!'), 'Hello') - .then((acc) => { - assert.equal(acc.value, 'Hello World!!') + .resolve(addStr(' World!!'), 'Hello') + .then((output) => { + assert.equal(output, 'Hello World!!') }) ``` @@ -3130,29 +3265,29 @@ In the context of a [FunctionReducer](#function-reducer) it means you should nev Example ```js - const badReducer = () => (acc) => { + const badReducer = () => (input) => { // never ever modify the value object. - acc.value[1].username = 'foo' + input[1].username = 'foo' // keep in mind JS is by reference // so this means this is also // modifying the value object - const image = acc.value[1] + const image = input[1] image.username = 'foo' // pass value to next reducer - return acc.value + return input } // this is better const fp = require('lodash/fp') - const goodReducer = () => (acc) => { + const goodReducer = () => (input) => { // https://github.com/lodash/lodash/wiki/FP-Guide // this will cause no side effects - const value = fp.set('[1].username', 'foo', acc.value) + const newValue = fp.set('[1].username', 'foo', input) // pass value to next reducer - return value + return newValue } ``` diff --git a/packages/data-point/examples/async-example.js b/packages/data-point/examples/async-example.js index 80f9a25d..5bfae14a 100644 --- a/packages/data-point/examples/async-example.js +++ b/packages/data-point/examples/async-example.js @@ -75,19 +75,18 @@ const input = { // mock actual calls to server mocks() -dataPoint.transform('model:Planet', input).then(acc => { - const result = acc.value - assert.equal(result.name, 'Tatooine') - assert.equal(result.population, '200000') - assert.ok(result.residents.length > 0) +dataPoint.resolve('model:Planet', input).then(output => { + assert.equal(output.name, 'Tatooine') + assert.equal(output.population, '200000') + assert.ok(output.residents.length > 0) - assert.deepEqual(result.residents[0], { + assert.deepEqual(output.residents[0], { name: 'Luke Skywalker', gender: 'male', birthYear: '19BBY' }) - console.dir(acc.value, { colors: true }) + console.dir(output, { colors: true }) /* { name: 'Tatooine', diff --git a/packages/data-point/examples/custom-entity-type.js b/packages/data-point/examples/custom-entity-type.js index fa4e02dc..ae6a0d32 100644 --- a/packages/data-point/examples/custom-entity-type.js +++ b/packages/data-point/examples/custom-entity-type.js @@ -73,6 +73,6 @@ const data = { } } -dataPoint.transform('render:HelloWorld', data).then(acc => { - console.log(acc.value) // '

Hello World!!

' +dataPoint.resolve('render:HelloWorld', data).then(output => { + console.log(output) // '

Hello World!!

' }) diff --git a/packages/data-point/examples/entity-hash-addKeys.js b/packages/data-point/examples/entity-hash-addKeys.js index 9cd6a6e7..4eb51197 100644 --- a/packages/data-point/examples/entity-hash-addKeys.js +++ b/packages/data-point/examples/entity-hash-addKeys.js @@ -4,7 +4,7 @@ const assert = require('assert') dataPoint.addEntities({ 'hash:addKeys': { addKeys: { - nameLowerCase: ['$name', acc => acc.value.toLowerCase()], + nameLowerCase: ['$name', input => input.toLowerCase()], url: () => 'https://github.com/ViacomInc/data-point' } } @@ -20,7 +20,7 @@ const input = { name: 'DataPoint' } -dataPoint.transform('hash:addKeys', input).then(acc => { - assert.deepEqual(acc.value, expectedResult) - console.log(acc.value) +dataPoint.resolve('hash:addKeys', input).then(output => { + assert.deepEqual(output, expectedResult) + console.log(output) }) diff --git a/packages/data-point/examples/entity-hash-compose.js b/packages/data-point/examples/entity-hash-compose.js index 6752e145..4e158dcc 100644 --- a/packages/data-point/examples/entity-hash-compose.js +++ b/packages/data-point/examples/entity-hash-compose.js @@ -12,9 +12,8 @@ dataPoint.addEntities({ }, { addKeys: { - urls: acc => { - const value = acc.value - return [value.reposUrl, value.eventsUrl] + urls: input => { + return [input.reposUrl, input.eventsUrl] } } }, @@ -34,9 +33,9 @@ const expectedResult = { urls: ['/orgs/nodejs/repos', '/orgs/nodejs/events'] } -dataPoint.transform('hash:composeExmple', input).then(acc => { - console.log(acc.value) - assert.deepEqual(acc.value, expectedResult) +dataPoint.resolve('hash:composeExmple', input).then(output => { + console.log(output) + assert.deepEqual(output, expectedResult) /* { orgName: 'Node.js Foundation', diff --git a/packages/data-point/examples/entity-hash-context.js b/packages/data-point/examples/entity-hash-context.js index 21e25f32..0d95a3da 100644 --- a/packages/data-point/examples/entity-hash-context.js +++ b/packages/data-point/examples/entity-hash-context.js @@ -16,11 +16,11 @@ dataPoint.addEntities({ } }) -dataPoint.transform('hash:helloWorld', input).then(acc => { - assert.deepEqual(acc.value, { +dataPoint.resolve('hash:helloWorld', input).then(output => { + assert.deepEqual(output, { c: 'Hello', d: ' World!!' }) - console.log('result:', acc.value) + console.log('result:', output) // result: { c: 'Hello', d: ' World!!' } }) diff --git a/packages/data-point/examples/entity-hash-mapKeys.js b/packages/data-point/examples/entity-hash-mapKeys.js index c32a1bf7..cbc41de5 100644 --- a/packages/data-point/examples/entity-hash-mapKeys.js +++ b/packages/data-point/examples/entity-hash-mapKeys.js @@ -8,8 +8,8 @@ dataPoint.addEntities({ name: '$name', url: [ '$name', - acc => { - return `https://github.com/ViacomInc/${_.kebabCase(acc.value)}` + input => { + return `https://github.com/ViacomInc/${_.kebabCase(input)}` } ] } @@ -25,7 +25,7 @@ const input = { name: 'DataPoint' } -dataPoint.transform('hash:mapKeys', input).then(acc => { - assert.deepEqual(acc.value, expectedResult) - console.log(acc.value) +dataPoint.resolve('hash:mapKeys', input).then(output => { + assert.deepEqual(output, expectedResult) + console.log(output) }) diff --git a/packages/data-point/examples/entity-hash-omitKeys.js b/packages/data-point/examples/entity-hash-omitKeys.js index 59090431..ec180609 100644 --- a/packages/data-point/examples/entity-hash-omitKeys.js +++ b/packages/data-point/examples/entity-hash-omitKeys.js @@ -17,7 +17,7 @@ const input = { url: 'https://github.com/ViacomInc/data-point' } -dataPoint.transform('hash:omitKeys', input).then(acc => { - assert.deepEqual(acc.value, expectedResult) - console.log(acc.value) +dataPoint.resolve('hash:omitKeys', input).then(output => { + assert.deepEqual(output, expectedResult) + console.log(output) }) diff --git a/packages/data-point/examples/entity-hash-pickKeys.js b/packages/data-point/examples/entity-hash-pickKeys.js index fa1a947c..edab69de 100644 --- a/packages/data-point/examples/entity-hash-pickKeys.js +++ b/packages/data-point/examples/entity-hash-pickKeys.js @@ -17,7 +17,7 @@ const input = { url: 'https://github.com/ViacomInc/data-point' } -dataPoint.transform('hash:pickKeys', input).then(acc => { - assert.deepEqual(acc.value, expectedResult) - console.log(acc.value) +dataPoint.resolve('hash:pickKeys', input).then(output => { + assert.deepEqual(output, expectedResult) + console.log(output) }) diff --git a/packages/data-point/examples/entity-model-basic.js b/packages/data-point/examples/entity-model-basic.js index 081848f5..542e5ebe 100644 --- a/packages/data-point/examples/entity-model-basic.js +++ b/packages/data-point/examples/entity-model-basic.js @@ -10,12 +10,12 @@ const input = { } } -const getMax = acc => { - return Math.max.apply(null, acc.value) +const getMax = input => { + return Math.max.apply(null, input) } -const multiplyBy = number => acc => { - return acc.value * number +const multiplyBy = number => input => { + return input * number } dataPoint.addEntities({ @@ -24,6 +24,6 @@ dataPoint.addEntities({ } }) -dataPoint.transform('model:foo', input).then(acc => { - assert.equal(acc.value, 30) +dataPoint.resolve('model:foo', input).then(output => { + assert.equal(output, 30) }) diff --git a/packages/data-point/examples/entity-model-before.js b/packages/data-point/examples/entity-model-before.js index f51b80fb..f62b0b50 100644 --- a/packages/data-point/examples/entity-model-before.js +++ b/packages/data-point/examples/entity-model-before.js @@ -1,8 +1,8 @@ const dataPoint = require('../').create() const assert = require('assert') -const toArray = acc => { - return Array.isArray(acc.value) ? acc.value : [acc.value] +const toArray = input => { + return Array.isArray(input) ? input : [input] } dataPoint.addEntities({ @@ -12,6 +12,6 @@ dataPoint.addEntities({ } }) -dataPoint.transform('model:foo', 100).then(acc => { - assert.deepEqual(acc.value, [100]) +dataPoint.resolve('model:foo', 100).then(output => { + assert.deepEqual(output, [100]) }) diff --git a/packages/data-point/examples/entity-model-error-handled.js b/packages/data-point/examples/entity-model-error-handled.js index 9549a0d9..31d5e4fb 100644 --- a/packages/data-point/examples/entity-model-error-handled.js +++ b/packages/data-point/examples/entity-model-error-handled.js @@ -6,11 +6,11 @@ dataPoint.addEntities({ // points to a NON Array value value: '$a.b', outputType: 'array', - error: acc => { + error: input => { // prints out the error // message generated by // isArray type check - console.log(acc.value.message) + console.log(input.message) console.log('Value is invalid, resolving to empty array') @@ -27,6 +27,6 @@ const input = { } } -dataPoint.transform('model:getArray', input).then(acc => { - assert.deepEqual(acc.value, []) +dataPoint.resolve('model:getArray', input).then(output => { + assert.deepEqual(output, []) }) diff --git a/packages/data-point/examples/entity-model-error-rethrow.js b/packages/data-point/examples/entity-model-error-rethrow.js index 011c7f98..99c61f69 100644 --- a/packages/data-point/examples/entity-model-error-rethrow.js +++ b/packages/data-point/examples/entity-model-error-rethrow.js @@ -1,10 +1,9 @@ const dataPoint = require('../').create() const assert = require('assert') -const logError = acc => { - // acc.value holds the actual Error Object - console.log(acc.value.toString()) - throw acc.value +const logError = error => { + console.log(error.toString()) + throw error } dataPoint.addEntities({ @@ -22,7 +21,7 @@ const input = { } dataPoint - .transform('model:getArray', input) + .resolve('model:getArray', input) .then(() => { // should not execute assert.ok(false) diff --git a/packages/data-point/examples/entity-request-basic.js b/packages/data-point/examples/entity-request-basic.js index a359ad73..4450a910 100644 --- a/packages/data-point/examples/entity-request-basic.js +++ b/packages/data-point/examples/entity-request-basic.js @@ -11,9 +11,8 @@ dataPoint.addEntities({ // mock the remote service mockRequest() -dataPoint.transform('request:getLuke', {}).then(acc => { - const result = acc.value - assert.equal(result.name, 'Luke Skywalker') - assert.equal(result.height, '172') - console.dir(acc.value, { colors: true }) +dataPoint.resolve('request:getLuke', {}).then(output => { + assert.equal(output.name, 'Luke Skywalker') + assert.equal(output.height, '172') + console.dir(output, { colors: true }) }) diff --git a/packages/data-point/examples/entity-request-options-locals.js b/packages/data-point/examples/entity-request-options-locals.js index 7f57e84e..17475d2e 100644 --- a/packages/data-point/examples/entity-request-options-locals.js +++ b/packages/data-point/examples/entity-request-options-locals.js @@ -17,9 +17,8 @@ const options = { } } -dataPoint.transform('request:getLuke', {}, options).then(acc => { - const result = acc.value - assert.equal(result.name, 'Luke Skywalker') - assert.equal(result.height, '172') - console.dir(acc.value, { colors: true }) +dataPoint.resolve('request:getLuke', {}, options).then(output => { + assert.equal(output.name, 'Luke Skywalker') + assert.equal(output.height, '172') + console.dir(output, { colors: true }) }) diff --git a/packages/data-point/examples/entity-request-string-template.js b/packages/data-point/examples/entity-request-string-template.js index 396c3fb7..3762c6dd 100644 --- a/packages/data-point/examples/entity-request-string-template.js +++ b/packages/data-point/examples/entity-request-string-template.js @@ -15,9 +15,8 @@ const input = { personId: 1 } -dataPoint.transform('request:getLuke', input).then(acc => { - const result = acc.value - assert.equal(result.name, 'Luke Skywalker') - assert.equal(result.height, '172') - console.dir(acc.value, { colors: true }) +dataPoint.resolve('request:getLuke', input).then(output => { + assert.equal(output.name, 'Luke Skywalker') + assert.equal(output.height, '172') + console.dir(output, { colors: true }) }) diff --git a/packages/data-point/examples/extend-entity-keys.js b/packages/data-point/examples/extend-entity-keys.js index b8e55284..eec60538 100644 --- a/packages/data-point/examples/extend-entity-keys.js +++ b/packages/data-point/examples/extend-entity-keys.js @@ -3,11 +3,11 @@ const assert = require('assert') dataPoint.addEntities({ 'entry:Base': { - before: acc => { - return acc.value + 'before' + before: input => { + return input + 'before' }, - after: acc => { - return acc.value + 'after' + after: input => { + return input + 'after' } }, @@ -16,13 +16,13 @@ dataPoint.addEntities({ // entry:Base's `before` and // `after` get merged with // this entity - value: acc => { - return acc.value + ' value ' + value: input => { + return input + ' value ' } } }) -dataPoint.transform('entry:Extended', '').then(acc => { - assert.equal(acc.value, 'before value after') - console.log(acc.value) +dataPoint.resolve('entry:Extended', '').then(output => { + assert.equal(output, 'before value after') + console.log(output) }) diff --git a/packages/data-point/examples/extend-entity-reusability.js b/packages/data-point/examples/extend-entity-reusability.js index a7873342..3baba253 100644 --- a/packages/data-point/examples/extend-entity-reusability.js +++ b/packages/data-point/examples/extend-entity-reusability.js @@ -8,7 +8,7 @@ dataPoint.addEntities({ } }, 'model:multiplyBy': { - value: acc => acc.value * acc.params.multiplicand, + value: (input, acc) => input * acc.params.multiplicand, params: { multiplicand: 1 } @@ -22,8 +22,8 @@ dataPoint.addEntities({ } }) -dataPoint.transform('hash:multiply', { multiplier: 5 }).then(acc => { - console.log(acc.value) +dataPoint.resolve('hash:multiply', { multiplier: 5 }).then(output => { + console.log(output) /* { multiplyByFactor: 5, diff --git a/packages/data-point/examples/hello-world.js b/packages/data-point/examples/hello-world.js index fe34b3aa..7b524df8 100644 --- a/packages/data-point/examples/hello-world.js +++ b/packages/data-point/examples/hello-world.js @@ -5,12 +5,12 @@ const dataPoint = DataPoint.create() // Reducer function that appends // 'World' to the value of the // accumulator -const reducer = acc => { - return acc.value + ' World' +const reducer = input => { + return input + ' World' } // applies reducer to input -dataPoint.transform(reducer, 'Hello').then(acc => { +dataPoint.resolve(reducer, 'Hello').then(output => { // 'Hello World' - console.log(acc.value) + console.log(output) }) diff --git a/packages/data-point/examples/model-type-check-custom.js b/packages/data-point/examples/model-type-check-custom.js index ed83934a..bd74ab15 100644 --- a/packages/data-point/examples/model-type-check-custom.js +++ b/packages/data-point/examples/model-type-check-custom.js @@ -5,8 +5,8 @@ const dataPoint = DataPoint.create() dataPoint.addEntities({ 'model:string': { value: '$name', - outputType: acc => { - const valid = typeof acc.value === 'string' && acc.value.length > 5 + outputType: input => { + const valid = typeof input === 'string' && input.length > 5 if (!valid) { throw new Error('string and length > 5') } @@ -18,7 +18,7 @@ const input = { name: 'DataPoint' } -dataPoint.transform('model:string', input).then(acc => { - assert.equal(acc.value, 'DataPoint') - console.log(acc.value) +dataPoint.resolve('model:string', input).then(output => { + assert.equal(output, 'DataPoint') + console.log(output) }) diff --git a/packages/data-point/examples/model-type-check-helper.js b/packages/data-point/examples/model-type-check-helper.js index ccd6ea27..b04d931a 100644 --- a/packages/data-point/examples/model-type-check-helper.js +++ b/packages/data-point/examples/model-type-check-helper.js @@ -13,7 +13,7 @@ const input = { name: 'DataPoint' } -dataPoint.transform('model:string', input).then(acc => { - assert.equal(acc.value, 'DataPoint') - console.log(acc.value) +dataPoint.resolve('model:string', input).then(output => { + assert.equal(output, 'DataPoint') + console.log(output) }) diff --git a/packages/data-point/examples/reducer-array-closures.js b/packages/data-point/examples/reducer-array-closures.js index 01bba4ea..9ab5852a 100644 --- a/packages/data-point/examples/reducer-array-closures.js +++ b/packages/data-point/examples/reducer-array-closures.js @@ -1,13 +1,13 @@ const dataPoint = require('../').create() const assert = require('assert') -const addStr = word => acc => { - return acc.value + word +const addStr = word => input => { + return input + word } const reducers = [addStr(' World'), addStr('!!')] -dataPoint.transform(reducers, 'Hello').then(acc => { - assert.equal(acc.value, 'Hello World!!') - console.log(acc.value) +dataPoint.resolve(reducers, 'Hello').then(output => { + assert.equal(output, 'Hello World!!') + console.log(output) }) diff --git a/packages/data-point/examples/reducer-array-functions.js b/packages/data-point/examples/reducer-array-functions.js index 01bba4ea..9ab5852a 100644 --- a/packages/data-point/examples/reducer-array-functions.js +++ b/packages/data-point/examples/reducer-array-functions.js @@ -1,13 +1,13 @@ const dataPoint = require('../').create() const assert = require('assert') -const addStr = word => acc => { - return acc.value + word +const addStr = word => input => { + return input + word } const reducers = [addStr(' World'), addStr('!!')] -dataPoint.transform(reducers, 'Hello').then(acc => { - assert.equal(acc.value, 'Hello World!!') - console.log(acc.value) +dataPoint.resolve(reducers, 'Hello').then(output => { + assert.equal(output, 'Hello World!!') + console.log(output) }) diff --git a/packages/data-point/examples/reducer-array-mixed-2.js b/packages/data-point/examples/reducer-array-mixed-2.js index 934b55e6..12cc156f 100644 --- a/packages/data-point/examples/reducer-array-mixed-2.js +++ b/packages/data-point/examples/reducer-array-mixed-2.js @@ -9,16 +9,16 @@ const input = { } } -const multiplyBy = factor => acc => { - return acc.value * factor +const multiplyBy = factor => input => { + return input * factor } -const getMax = () => acc => { - const result = Math.max.apply(null, acc.value) +const getMax = () => input => { + const result = Math.max.apply(null, input) return result } -dataPoint.transform(['$a.b.c', getMax(), multiplyBy(10)], input).then(acc => { - assert.equal(acc.value, 30) - console.log(acc.value) +dataPoint.resolve(['$a.b.c', getMax(), multiplyBy(10)], input).then(output => { + assert.equal(output, 30) + console.log(output) }) diff --git a/packages/data-point/examples/reducer-array-mixed.js b/packages/data-point/examples/reducer-array-mixed.js index cec1ba00..150cac48 100644 --- a/packages/data-point/examples/reducer-array-mixed.js +++ b/packages/data-point/examples/reducer-array-mixed.js @@ -7,11 +7,11 @@ const input = { } } -const toUpperCase = acc => { - return acc.value.toUpperCase() +const toUpperCase = input => { + return input.toUpperCase() } -dataPoint.transform(['$a.b', toUpperCase], input).then(acc => { - assert.equal(acc.value, 'HELLO WORLD') - console.log(acc.value) +dataPoint.resolve(['$a.b', toUpperCase], input).then(output => { + assert.equal(output, 'HELLO WORLD') + console.log(output) }) diff --git a/packages/data-point/examples/reducer-conditional-operator.js b/packages/data-point/examples/reducer-conditional-operator.js index e43ef4b7..5d960919 100644 --- a/packages/data-point/examples/reducer-conditional-operator.js +++ b/packages/data-point/examples/reducer-conditional-operator.js @@ -28,8 +28,8 @@ dataPoint.addEntities({ mockRequests() -dataPoint.transform('transform:getPerson[]', people).then(acc => { - assert.deepEqual(acc.value, [ +dataPoint.resolve('transform:getPerson[]', people).then(output => { + assert.deepEqual(output, [ { name: 'Luke Skywalker', birthYear: '19BBY' @@ -40,5 +40,5 @@ dataPoint.transform('transform:getPerson[]', people).then(acc => { } ]) - console.dir(acc.value, { colors: true }) + console.dir(output, { colors: true }) }) diff --git a/packages/data-point/examples/reducer-function-closure.js b/packages/data-point/examples/reducer-function-closure.js index f654148f..153fecd5 100644 --- a/packages/data-point/examples/reducer-function-closure.js +++ b/packages/data-point/examples/reducer-function-closure.js @@ -1,11 +1,11 @@ const dataPoint = require('../').create() const assert = require('assert') -const addStr = value => acc => { - return acc.value + value +const addStr = value => input => { + return input + value } -dataPoint.transform(addStr(' World!!'), 'Hello').then(acc => { - assert.equal(acc.value, 'Hello World!!') - console.log(acc.value) +dataPoint.resolve(addStr(' World!!'), 'Hello').then(output => { + assert.equal(output, 'Hello World!!') + console.log(output) }) diff --git a/packages/data-point/examples/reducer-function-error.js b/packages/data-point/examples/reducer-function-error.js index d458bc73..b72c4d9d 100644 --- a/packages/data-point/examples/reducer-function-error.js +++ b/packages/data-point/examples/reducer-function-error.js @@ -1,12 +1,12 @@ const dataPoint = require('../').create() -const throwError = (acc, next) => { +const throwError = (input, acc, next) => { // passing first argument will be // handled as an error by the transform next(new Error('oh noes!!')) } -dataPoint.transform(throwError, 'Hello').catch(error => { +dataPoint.resolve(throwError, 'Hello').catch(error => { console.assert(error instanceof Error) console.log(error.toString()) // 'Error: oh noes!!' }) diff --git a/packages/data-point/examples/reducer-function-promise.js b/packages/data-point/examples/reducer-function-promise.js index ab8b7da9..205aefae 100644 --- a/packages/data-point/examples/reducer-function-promise.js +++ b/packages/data-point/examples/reducer-function-promise.js @@ -1,11 +1,11 @@ const dataPoint = require('../').create() const assert = require('assert') -const reducer = acc => { - return Promise.resolve(acc.value + ' World') +const reducer = input => { + return Promise.resolve(input + ' World') } -dataPoint.transform(reducer, 'Hello').then(acc => { - console.log(acc.value) - assert.equal(acc.value, 'Hello World') +dataPoint.resolve(reducer, 'Hello').then(output => { + console.log(output) + assert.equal(output, 'Hello World') }) diff --git a/packages/data-point/examples/reducer-function-sync.js b/packages/data-point/examples/reducer-function-sync.js index 15142263..358e7eb7 100644 --- a/packages/data-point/examples/reducer-function-sync.js +++ b/packages/data-point/examples/reducer-function-sync.js @@ -1,11 +1,11 @@ const dataPoint = require('../').create() const assert = require('assert') -const reducer = acc => { - return acc.value + ' World' +const reducer = input => { + return input + ' World' } -dataPoint.transform(reducer, 'Hello').then(acc => { - console.log(acc.value) - assert.equal(acc.value, 'Hello World') +dataPoint.resolve(reducer, 'Hello').then(output => { + console.log(output) + assert.equal(output, 'Hello World') }) diff --git a/packages/data-point/examples/reducer-function-with-callback.js b/packages/data-point/examples/reducer-function-with-callback.js index 3367f356..b8aaacf8 100644 --- a/packages/data-point/examples/reducer-function-with-callback.js +++ b/packages/data-point/examples/reducer-function-with-callback.js @@ -1,11 +1,11 @@ const dataPoint = require('../').create() const assert = require('assert') -const reducer = (acc, next) => { - next(null, acc.value + ' World') +const reducer = (input, acc, next) => { + next(null, input + ' World') } -dataPoint.transform(reducer, 'Hello').then(acc => { - assert.equal(acc.value, 'Hello World') - console.log(acc.value) +dataPoint.resolve(reducer, 'Hello').then(output => { + assert.equal(output, 'Hello World') + console.log(output) }) diff --git a/packages/data-point/examples/reducer-helper-assign.js b/packages/data-point/examples/reducer-helper-assign.js index b1bb7ada..9026ef19 100644 --- a/packages/data-point/examples/reducer-helper-assign.js +++ b/packages/data-point/examples/reducer-helper-assign.js @@ -19,8 +19,8 @@ const reducer = assign({ c: '$b.c' }) -dataPoint.transform(reducer, value).then(acc => { - assert.deepEqual(acc.value, { +dataPoint.resolve(reducer, value).then(output => { + assert.deepEqual(output, { a: 1, b: { c: 2 diff --git a/packages/data-point/examples/reducer-helper-filter.js b/packages/data-point/examples/reducer-helper-filter.js index 20c20a82..8fbe9f8a 100644 --- a/packages/data-point/examples/reducer-helper-filter.js +++ b/packages/data-point/examples/reducer-helper-filter.js @@ -17,8 +17,8 @@ const value = [ // filters array elements that are not // truthy for the given reducer list -const reducer = filter(['$a', acc => acc.value > 1]) +const reducer = filter(['$a', input => input > 1]) -dataPoint.transform(reducer, value).then(acc => { - assert.deepEqual(acc.value, [{ a: 2 }]) +dataPoint.resolve(reducer, value).then(output => { + assert.deepEqual(output, [{ a: 2 }]) }) diff --git a/packages/data-point/examples/reducer-helper-find.js b/packages/data-point/examples/reducer-helper-find.js index 939d4f8f..3609e23d 100644 --- a/packages/data-point/examples/reducer-helper-find.js +++ b/packages/data-point/examples/reducer-helper-find.js @@ -19,8 +19,8 @@ const value = [ // second element in the array const reducer = find('$b') -dataPoint.transform(reducer, value).then(acc => { - assert.deepEqual(acc.value, { +dataPoint.resolve(reducer, value).then(output => { + assert.deepEqual(output, { b: 2 }) }) diff --git a/packages/data-point/examples/reducer-helper-map.js b/packages/data-point/examples/reducer-helper-map.js index 255ec5f1..9fef42f6 100644 --- a/packages/data-point/examples/reducer-helper-map.js +++ b/packages/data-point/examples/reducer-helper-map.js @@ -17,8 +17,8 @@ const value = [ // applies the $a reducer to each // item in the array -const reducer = map(['$a', acc => acc.value * 2]) +const reducer = map(['$a', input => input * 2]) -dataPoint.transform(reducer, value).then(acc => { - assert.deepEqual(acc.value, [2, 4]) +dataPoint.resolve(reducer, value).then(output => { + assert.deepEqual(output, [2, 4]) }) diff --git a/packages/data-point/examples/reducer-object-1.js b/packages/data-point/examples/reducer-object-1.js index 2adf5220..e89d5d03 100644 --- a/packages/data-point/examples/reducer-object-1.js +++ b/packages/data-point/examples/reducer-object-1.js @@ -2,7 +2,7 @@ const dataPoint = require('../').create() const reducer = { y: '$x.y', - zPlusOne: ['$x.y.z', acc => acc.value + 1] + zPlusOne: ['$x.y.z', input => input + 1] } const data = { @@ -13,6 +13,6 @@ const data = { } } -dataPoint.transform(reducer, data).then(acc => { - console.log(acc.value) +dataPoint.resolve(reducer, data).then(output => { + console.log(output) }) diff --git a/packages/data-point/examples/reducer-object-2.js b/packages/data-point/examples/reducer-object-2.js index fdb908c6..874b13b1 100644 --- a/packages/data-point/examples/reducer-object-2.js +++ b/packages/data-point/examples/reducer-object-2.js @@ -18,6 +18,6 @@ const data = { } } -dataPoint.transform(reducer, data).then(acc => { - console.log(acc.value) +dataPoint.resolve(reducer, data).then(output => { + console.log(output) }) diff --git a/packages/data-point/examples/reducer-object-3.js b/packages/data-point/examples/reducer-object-3.js index 1da6982c..a37e9a17 100644 --- a/packages/data-point/examples/reducer-object-3.js +++ b/packages/data-point/examples/reducer-object-3.js @@ -22,6 +22,6 @@ const data = { } } -dataPoint.transform(reducer, data).then(acc => { - console.log(acc.value) +dataPoint.resolve(reducer, data).then(output => { + console.log(output) }) diff --git a/packages/data-point/examples/reducer-path.js b/packages/data-point/examples/reducer-path.js index 535f94b8..1e5d96d4 100644 --- a/packages/data-point/examples/reducer-path.js +++ b/packages/data-point/examples/reducer-path.js @@ -24,12 +24,12 @@ const input = { ] } -dataPoint.transform('$a.b', input).then(acc => { - assert.equal(acc.value, 'Hello World') - console.log(acc.value) +dataPoint.resolve('$a.b', input).then(output => { + assert.equal(output, 'Hello World') + console.log(output) }) -dataPoint.transform('$d.e[]', input.c).then(acc => { - assert.deepEqual(acc.value, [1, 2, 3]) - console.log(acc.value) +dataPoint.resolve('$d.e[]', input.c).then(output => { + assert.deepEqual(output, [1, 2, 3]) + console.log(output) }) diff --git a/packages/data-point/lib/core/__snapshots__/core.test.js.snap b/packages/data-point/lib/core/__snapshots__/core.test.js.snap new file mode 100644 index 00000000..da742875 --- /dev/null +++ b/packages/data-point/lib/core/__snapshots__/core.test.js.snap @@ -0,0 +1,17 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`api 1`] = ` +Array [ + "middleware", + "values", + "entities", + "entityTypes", + "addValue", + "addEntityType", + "addEntityTypes", + "use", + "addEntities", + "resolve", + "transform", +] +`; diff --git a/packages/data-point/lib/core/core.js b/packages/data-point/lib/core/core.js index ce5c5190..c5f17aeb 100644 --- a/packages/data-point/lib/core/core.js +++ b/packages/data-point/lib/core/core.js @@ -1,7 +1,7 @@ const _ = require('lodash') const normalizeEntities = require('./normalize-entities') -const transform = require('./transform') +const Transform = require('./transform') const storeValues = require('../stores/values') const storeEntities = require('../stores/entities') @@ -59,8 +59,6 @@ function create (spec) { entityTypes } - manager.transform = _.partial(transform, manager) - // add single item (singular) manager.addValue = manager.values.add @@ -73,8 +71,6 @@ function create (spec) { // add collection of items (plural) manager.addEntities = _.partial(addEntitiesToStore, manager.entities) - // using options to initialize dataPoint - // built-in entity types manager.addEntityType('transform', EntityTransform) manager.addEntityType('entry', EntityEntry) @@ -93,6 +89,11 @@ function create (spec) { manager.addEntityTypes(options.entityTypes, true) manager.addEntities(options.entities) + // supports currying + manager.resolve = Transform.resolve(manager) + // does not support currying + manager.transform = _.partial(Transform.transform, manager) + return manager } diff --git a/packages/data-point/lib/core/core.test.js b/packages/data-point/lib/core/core.test.js index eb973a0e..8524405b 100644 --- a/packages/data-point/lib/core/core.test.js +++ b/packages/data-point/lib/core/core.test.js @@ -21,6 +21,10 @@ beforeAll(() => { }) }) +test('api', () => { + expect(Object.keys(instance)).toMatchSnapshot() +}) + test('setup', () => { expect(instance.middleware.use).toBeTruthy() expect(_.isFunction(instance.use)).toBeTruthy() diff --git a/packages/data-point/lib/core/transform.js b/packages/data-point/lib/core/transform.js index 0f2418d4..c10edc20 100644 --- a/packages/data-point/lib/core/transform.js +++ b/packages/data-point/lib/core/transform.js @@ -10,7 +10,7 @@ function getOptions (spec) { }) } -function resolve (manager, reducerSource, value, options) { +function reducerResolve (manager, reducerSource, value, options) { const contextOptions = getOptions(options) const context = AccumulatorFactory.create({ value: value, @@ -26,8 +26,16 @@ function resolve (manager, reducerSource, value, options) { function transform (manager, reducerSource, value, options, done) { return Promise.resolve() - .then(() => resolve(manager, reducerSource, value, options)) + .then(() => reducerResolve(manager, reducerSource, value, options)) .asCallback(done) } -module.exports = transform +module.exports.transform = transform + +function resolve (manager, reducerSource, value, options) { + return Promise.resolve() + .then(() => reducerResolve(manager, reducerSource, value, options)) + .then(acc => acc.value) +} + +module.exports.resolve = _.curry(resolve, 3) diff --git a/packages/data-point/lib/core/transform.test.js b/packages/data-point/lib/core/transform.test.js index 14d85cc7..d2dc1618 100644 --- a/packages/data-point/lib/core/transform.test.js +++ b/packages/data-point/lib/core/transform.test.js @@ -5,7 +5,7 @@ const core = require('./core') const reducers = require('../../test/utils/reducers') const entities = require('../../test/definitions/entities') -const transform = require('./transform') +const Transform = require('./transform') const TestData = require('../../test/data.json') let dataPoint @@ -23,7 +23,7 @@ beforeAll(() => { }) test('transform - throw error in invalid id(promise)', () => { - return transform(dataPoint, 'INVALID', TestData, {}) + return Transform.transform(dataPoint, 'INVALID', TestData, {}) .catch(err => err) .then(res => { expect(res).toBeInstanceOf(Error) @@ -33,86 +33,86 @@ test('transform - throw error in invalid id(promise)', () => { describe('transform - should attach input value to accumulator', () => { test('passing undefined', () => { - return transform(dataPoint, acc => { - expect(acc.value).toBe(undefined) + return Transform.transform(dataPoint, value => { + expect(value).toBe(undefined) }) }) test('passing 0', () => { - return transform( + return Transform.transform( dataPoint, - acc => { - expect(acc.value).toBe(0) + value => { + expect(value).toBe(0) }, 0 ) }) test('passing 1', () => { - return transform( + return Transform.transform( dataPoint, - acc => { - expect(acc.value).toBe(1) + value => { + expect(value).toBe(1) }, 1 ) }) test('passing empty string', () => { - return transform( + return Transform.transform( dataPoint, - acc => { - expect(acc.value).toBe('') + value => { + expect(value).toBe('') }, '' ) }) test('passing a string', () => { - return transform( + return Transform.transform( dataPoint, - acc => { - expect(acc.value).toBe('Hello World') + value => { + expect(value).toBe('Hello World') }, 'Hello World' ) }) test('passing false', () => { - return transform( + return Transform.transform( dataPoint, - acc => { - expect(acc.value).toBe(false) + value => { + expect(value).toBe(false) }, false ) }) test('passing true', () => { - return transform( + return Transform.transform( dataPoint, - acc => { - expect(acc.value).toBe(true) + value => { + expect(value).toBe(true) }, true ) }) test('passing an array', () => { - return transform( + return Transform.transform( dataPoint, - acc => { - expect(acc.value).toEqual(['Hello World']) + value => { + expect(value).toEqual(['Hello World']) }, ['Hello World'] ) }) test('passing an object', () => { - return transform( + return Transform.transform( dataPoint, - acc => { - expect(acc.value).toEqual({ message: 'Hello World' }) + value => { + expect(value).toEqual({ message: 'Hello World' }) }, { message: 'Hello World' } ) @@ -120,47 +120,42 @@ describe('transform - should attach input value to accumulator', () => { }) test('transform - single reducer', () => { - const reducer = (acc, next) => { - next(null, acc.value + ' World') + const reducer = value => { + return value + ' World' } - return transform(dataPoint, reducer, 'Hello').then(res => { + return Transform.transform(dataPoint, reducer, 'Hello').then(res => { expect(res.value).toEqual('Hello World') }) }) test('transform - reducer chain', () => { - const reducers = [ - (acc, next) => { - next(null, acc.value + ' World') - }, - (acc, next) => { - next(null, acc.value + '!!') - } - ] - return transform(dataPoint, reducers, 'Hello').then(res => { + const reducers = [value => value + ' World', value => value + '!!'] + return Transform.transform(dataPoint, reducers, 'Hello').then(res => { expect(res.value).toEqual('Hello World!!') }) }) test('transform - reducer path', () => { - return transform(dataPoint, '$a.b.c', TestData).then(res => { + return Transform.transform(dataPoint, '$a.b.c', TestData).then(res => { expect(res.value).toEqual([1, 2, 3]) }) }) test('transform - reducer mixed', () => { - const getMax = (acc, next) => { - next(null, Math.max.apply(null, acc.value)) + const getMax = value => { + return Math.max.apply(null, value) } - return transform(dataPoint, ['$a.b.c', getMax], TestData).then(res => { - expect(res.value).toEqual(3) - }) + return Transform.transform(dataPoint, ['$a.b.c', getMax], TestData).then( + res => { + expect(res.value).toEqual(3) + } + ) }) describe('options argument', () => { test('passing locals', () => { - const reducer = (acc, next) => { - next(null, acc.locals.greeting + ' World') + const reducer = (value, acc) => { + return acc.locals.greeting + ' World' } const options = { @@ -169,8 +164,39 @@ describe('options argument', () => { } } - return transform(dataPoint, reducer, {}, options).then(res => { + return Transform.transform(dataPoint, reducer, {}, options).then(res => { expect(res.value).toEqual('Hello World') }) }) }) + +describe('resolve', () => { + test('transform - resolve', () => { + return Transform.resolve(dataPoint, '$a.b.c', TestData).then(value => { + expect(value).toEqual([1, 2, 3]) + }) + }) + test('transform - options is last argument', () => { + const options = { + locals: { + foo: 'bar' + } + } + return Transform.resolve(dataPoint, '$..locals.foo', {}, options).then( + value => { + expect(value).toEqual('bar') + } + ) + }) + + test('transform - execute with 3 arguments', () => { + const value = { + foo: 'bar' + } + return Promise.resolve(value) + .then(Transform.resolve(dataPoint, '$foo')) + .then(value => { + expect(value).toEqual('bar') + }) + }) +}) diff --git a/packages/data-point/lib/entity-types/base-entity/__snapshots__/resolve.test.js.snap b/packages/data-point/lib/entity-types/base-entity/__snapshots__/resolve.test.js.snap index fb87406f..d66e03da 100644 --- a/packages/data-point/lib/entity-types/base-entity/__snapshots__/resolve.test.js.snap +++ b/packages/data-point/lib/entity-types/base-entity/__snapshots__/resolve.test.js.snap @@ -2,6 +2,6 @@ exports[`ResolveEntity.resolveEntity if custom typeCheck throws then fail 1`] = `[Error: custom type error]`; -exports[`ResolveEntity.resolveEntity inputType - throws error if inputType does not pass 1`] = `[Error: model:c.0 did not pass type check, type expected: number but recevied: string. The value received is: 'foo']`; +exports[`ResolveEntity.resolveEntity inputType - throws error if inputType does not pass 1`] = `[Error: value did not pass type check, type expected: number but recevied: string. The value received is: 'foo']`; -exports[`ResolveEntity.resolveEntity outputType - throws error if outputType does not pass 1`] = `[Error: model:c.1 did not pass type check, type expected: string but recevied: number. The value received is: 1]`; +exports[`ResolveEntity.resolveEntity outputType - throws error if outputType does not pass 1`] = `[Error: value did not pass type check, type expected: string but recevied: number. The value received is: 1]`; diff --git a/packages/data-point/lib/entity-types/base-entity/resolve.test.js b/packages/data-point/lib/entity-types/base-entity/resolve.test.js index 86566db8..b30ef78f 100644 --- a/packages/data-point/lib/entity-types/base-entity/resolve.test.js +++ b/packages/data-point/lib/entity-types/base-entity/resolve.test.js @@ -49,7 +49,7 @@ describe('ResolveEntity.resolveErrorReducers', () => { {}, { context: { - error: createReducer((acc, next) => next(null, 'pass')) + error: createReducer((value, acc, next) => next(null, 'pass')) } } ) diff --git a/packages/data-point/lib/entity-types/entity-collection/__snapshots__/resolve.test.js.snap b/packages/data-point/lib/entity-types/entity-collection/__snapshots__/resolve.test.js.snap index 2394d7ab..d1d04ebb 100644 --- a/packages/data-point/lib/entity-types/entity-collection/__snapshots__/resolve.test.js.snap +++ b/packages/data-point/lib/entity-types/entity-collection/__snapshots__/resolve.test.js.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`CollectionReducer.resolve entity.collection - throw error if value not array 1`] = `[Error: collection:ObjectsNotAllowed received acc.value = { c: [ 1, 2, 3 ] } of type object, this entity only resolves Array values. More info https://github.com/ViacomInc/data-point/tree/master/packages/data-point#collection-entity]`; +exports[`CollectionReducer.resolve entity.collection - throw error if value not array 1`] = `[Error: collection:ObjectsNotAllowed received value = { c: [ 1, 2, 3 ] } of type object, this entity only resolves Array values. More info https://github.com/ViacomInc/data-point/tree/master/packages/data-point#collection-entity]`; diff --git a/packages/data-point/lib/entity-types/entity-collection/resolve.js b/packages/data-point/lib/entity-types/entity-collection/resolve.js index a2360097..158c31de 100644 --- a/packages/data-point/lib/entity-types/entity-collection/resolve.js +++ b/packages/data-point/lib/entity-types/entity-collection/resolve.js @@ -25,7 +25,7 @@ function validateAsArray (acc) { : Promise.reject( new Error( Util.format( - '%s received acc.value = %s of type %s,', + '%s received value = %s of type %s,', entity.id, _.truncate(Util.inspect(acc.value, { breakLength: Infinity }), { length: 30 diff --git a/packages/data-point/lib/entity-types/entity-entry/factory.test.js b/packages/data-point/lib/entity-types/entity-entry/factory.test.js index a635cebf..dc94d010 100644 --- a/packages/data-point/lib/entity-types/entity-entry/factory.test.js +++ b/packages/data-point/lib/entity-types/entity-entry/factory.test.js @@ -4,7 +4,7 @@ const Factory = require('./factory') test('Factory#create', () => { const obj = Factory.create({ - value: ['$foo', (acc, done) => {}] + value: ['$foo', () => {}] }) expect(obj).not.toHaveProperty('before') diff --git a/packages/data-point/lib/entity-types/entity-hash/__snapshots__/resolve.test.js.snap b/packages/data-point/lib/entity-types/entity-hash/__snapshots__/resolve.test.js.snap index 8a53480e..3fddbadc 100644 --- a/packages/data-point/lib/entity-types/entity-hash/__snapshots__/resolve.test.js.snap +++ b/packages/data-point/lib/entity-types/entity-hash/__snapshots__/resolve.test.js.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`entity.hash.resolve entity.hash - only process Plain Objects 1`] = `"hash:asIs received acc.value = [ { foo: 1, a: { b: [Object... of type array, this entity only resolves plain Objects. More info https://github.com/ViacomInc/data-point/tree/master/packages/data-point#hash-entity"`; +exports[`entity.hash.resolve entity.hash - only process Plain Objects 1`] = `"hash:asIs received value = [ { foo: 1, a: { b: [Object... of type array, this entity only resolves plain Objects. More info https://github.com/ViacomInc/data-point/tree/master/packages/data-point#hash-entity"`; -exports[`entity.hash.resolve entity.hash - throw error if value is not object 1`] = `[Error: hash:noValue received acc.value = 'invalid' of type string, this entity only resolves plain Objects. More info https://github.com/ViacomInc/data-point/tree/master/packages/data-point#hash-entity]`; +exports[`entity.hash.resolve entity.hash - throw error if value is not object 1`] = `[Error: hash:noValue received value = 'invalid' of type string, this entity only resolves plain Objects. More info https://github.com/ViacomInc/data-point/tree/master/packages/data-point#hash-entity]`; diff --git a/packages/data-point/lib/entity-types/entity-hash/resolve.js b/packages/data-point/lib/entity-types/entity-hash/resolve.js index b8530630..a1bb3173 100644 --- a/packages/data-point/lib/entity-types/entity-hash/resolve.js +++ b/packages/data-point/lib/entity-types/entity-hash/resolve.js @@ -25,7 +25,7 @@ function validateAsObject (acc) { return Promise.reject( new Error( Util.format( - '%s received acc.value = %s of type %s,', + '%s received value = %s of type %s,', entity.id, _.truncate(Util.inspect(acc.value, { breakLength: Infinity }), { length: 30 diff --git a/packages/data-point/lib/helpers/helpers.js b/packages/data-point/lib/helpers/helpers.js index 8ad58abc..c1802a25 100644 --- a/packages/data-point/lib/helpers/helpers.js +++ b/packages/data-point/lib/helpers/helpers.js @@ -33,13 +33,9 @@ module.exports.resolveEntity = require('../entity-types/base-entity/resolve').re function reducify (method) { return function () { const partialArguments = Array.prototype.slice.call(arguments) - return function (acc, done) { - const methodArguments = [acc.value].concat(partialArguments) - const result = method.apply(null, methodArguments) - if (_.isError(result)) { - return done(result) - } - done(null, result) + return function (value) { + const methodArguments = [value].concat(partialArguments) + return method.apply(null, methodArguments) } } } @@ -58,7 +54,7 @@ module.exports.reducifyAll = reducifyAll function mockReducer (reducer, acc) { const pcb = Promise.promisify(reducer) - return pcb(acc).then(val => ({ value: val })) + return pcb(acc.value, acc).then(val => ({ value: val })) } module.exports.mockReducer = mockReducer diff --git a/packages/data-point/lib/helpers/helpers.test.js b/packages/data-point/lib/helpers/helpers.test.js index 91161d21..6fc5f242 100644 --- a/packages/data-point/lib/helpers/helpers.test.js +++ b/packages/data-point/lib/helpers/helpers.test.js @@ -4,67 +4,47 @@ const _ = require('lodash') const helpers = require('./helpers') describe('helpers.reducify', () => { - test('pass simple', done => { + test('pass simple', () => { const rpick = helpers.reducify(_.pick) const input = ['a', 'c'] - const acc = { - value: { a: 1, b: 2, c: 3 } - } - rpick(input)(acc, (err, value) => { - /* eslint handle-callback-err: 0 */ - expect(value).toEqual({ a: 1, c: 3 }) - done() - }) + const value = { a: 1, b: 2, c: 3 } + expect(rpick(input)(value)).toEqual({ a: 1, c: 3 }) }) - test('pass error', done => { + test('pass error', () => { const rTest = helpers.reducify(() => { - return new Error('testerror') - }) - rTest()({}, (err, value) => { - /* eslint handle-callback-err: 0 */ - expect(err).toBeInstanceOf(Error) - done() + throw new Error('testerror') }) + expect(() => { + rTest()({}) + }).toThrow() }) }) describe('helpers.reducifyAll', () => { - test('reducify all keys', done => { + test('reducify all keys', () => { const rLodash = helpers.reducifyAll(_) const input = ['a', 'c'] - const acc = { - value: { a: 1, b: 2, c: 3 } - } + const value = { a: 1, b: 2, c: 3 } const keys = Object.keys(rLodash) expect(keys.length).toBeGreaterThan(10) - rLodash.pick(input)(acc, (err, value) => { - /* eslint handle-callback-err: 0 */ - expect(value).toEqual({ a: 1, c: 3 }) - done() - }) + expect(rLodash.pick(input)(value)).toEqual({ a: 1, c: 3 }) }) - test('reducify specificy keys', done => { + test('reducify specific keys', () => { const rLodash = helpers.reducifyAll(_, ['pick', 'map', 'find']) const input = ['a', 'c'] - const acc = { - value: { a: 1, b: 2, c: 3 } - } + const value = { a: 1, b: 2, c: 3 } const keys = Object.keys(rLodash) expect(keys).toEqual(['pick', 'map', 'find']) - rLodash.pick(input)(acc, (err, value) => { - /* eslint handle-callback-err: 0 */ - expect(value).toEqual({ a: 1, c: 3 }) - done() - }) + expect(rLodash.pick(input)(value)).toEqual({ a: 1, c: 3 }) }) }) describe('helpers.mockReducer', () => { test('test reducerTest', () => { - const reducerTest = a => (acc, done) => { - done(null, acc.value * a) + const reducerTest = a => (value, acc, done) => { + done(null, value * a) } return helpers.mockReducer(reducerTest(2), { value: 100 }).then(result => { diff --git a/packages/data-point/lib/helpers/type-check-function-reducers.js b/packages/data-point/lib/helpers/type-check-function-reducers.js index 46bd7eaf..e3ff73c6 100644 --- a/packages/data-point/lib/helpers/type-check-function-reducers.js +++ b/packages/data-point/lib/helpers/type-check-function-reducers.js @@ -2,52 +2,52 @@ const Util = require('util') const _ = require('lodash') const utils = require('../utils') -function errorMessage (acc, expectedType) { - const entityId = _.get(acc, 'reducer.spec.id', 'value') +function errorMessage (value, expectedType) { + const entityId = _.get(value, 'reducer.spec.id', 'value') return Util.format( '%s did not pass type check, type expected: %s but recevied: %s. The value received is: %s', entityId, expectedType, - utils.typeOf(acc.value), - _.truncate(Util.inspect(acc.value, { breakLength: Infinity }), { + utils.typeOf(value), + _.truncate(Util.inspect(value, { breakLength: Infinity }), { length: 30 }) ) } -function isString (acc) { - if (typeof acc.value === 'string') return acc.value - throw new Error(errorMessage(acc, 'string')) +function isString (value) { + if (typeof value === 'string') return value + throw new Error(errorMessage(value, 'string')) } -function isNumber (acc) { - if (typeof acc.value === 'number') return acc.value - throw new Error(errorMessage(acc, 'number')) +function isNumber (value) { + if (typeof value === 'number') return value + throw new Error(errorMessage(value, 'number')) } -function isBoolean (acc) { - if (typeof acc.value === 'boolean') return acc.value - throw new Error(errorMessage(acc, 'boolean')) +function isBoolean (value) { + if (typeof value === 'boolean') return value + throw new Error(errorMessage(value, 'boolean')) } -function isFunction (acc) { - if (typeof acc.value === 'function') return acc.value - throw new Error(errorMessage(acc, 'function')) +function isFunction (value) { + if (typeof value === 'function') return value + throw new Error(errorMessage(value, 'function')) } -function isError (acc) { - if (acc.value instanceof Error) return acc.value - throw new Error(errorMessage(acc, 'function')) +function isError (value) { + if (value instanceof Error) return value + throw new Error(errorMessage(value, 'function')) } -function isArray (acc) { - if (Array.isArray(acc.value)) return acc.value - throw new Error(errorMessage(acc, 'Array')) +function isArray (value) { + if (Array.isArray(value)) return value + throw new Error(errorMessage(value, 'Array')) } -function isObject (acc) { - if (_.isPlainObject(acc.value)) return acc.value - throw new Error(errorMessage(acc, 'Object')) +function isObject (value) { + if (_.isPlainObject(value)) return value + throw new Error(errorMessage(value, 'Object')) } module.exports = { diff --git a/packages/data-point/lib/helpers/type-check-function-reducers.test.js b/packages/data-point/lib/helpers/type-check-function-reducers.test.js index 6001bdad..d6816ff7 100644 --- a/packages/data-point/lib/helpers/type-check-function-reducers.test.js +++ b/packages/data-point/lib/helpers/type-check-function-reducers.test.js @@ -12,17 +12,11 @@ const { function testTypeChecker (typeCheck, goodValue, badValue, type) { test('It should return true if type match', () => { - const acc = { - value: goodValue - } - expect(typeCheck(acc)).toBe(goodValue) + expect(typeCheck(goodValue)).toBe(goodValue) }) test(`It should throw error when not matched`, () => { - const acc = { - value: badValue - } expect(() => { - typeCheck(acc) + typeCheck(badValue) }).toThrowErrorMatchingSnapshot() }) } diff --git a/packages/data-point/lib/reducer-types/reducer-function/__snapshots__/factory.test.js.snap b/packages/data-point/lib/reducer-types/reducer-function/__snapshots__/factory.test.js.snap index dfe472fe..875b54df 100644 --- a/packages/data-point/lib/reducer-types/reducer-function/__snapshots__/factory.test.js.snap +++ b/packages/data-point/lib/reducer-types/reducer-function/__snapshots__/factory.test.js.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[` 1`] = `"Reducer functions must have an arity of 2 at most"`; +exports[` 1`] = `"Reducer functions must have an arity of 3 at most"`; diff --git a/packages/data-point/lib/reducer-types/reducer-function/factory.js b/packages/data-point/lib/reducer-types/reducer-function/factory.js index f0164c78..b233c018 100644 --- a/packages/data-point/lib/reducer-types/reducer-function/factory.js +++ b/packages/data-point/lib/reducer-types/reducer-function/factory.js @@ -36,8 +36,8 @@ module.exports.isType = isType * @returns {boolean} */ function validateFunction (fn) { - if (fn.length > 2) { - const e = new Error(`Reducer functions must have an arity of 2 at most`) + if (fn.length > 3) { + const e = new Error(`Reducer functions must have an arity of 3 at most`) e.name = 'InvalidArity' throw e } @@ -55,9 +55,9 @@ module.exports.validateFunction = validateFunction function create (createReducer, source) { validateFunction(source) const reducer = new ReducerFunction() - // if the arity is 2, we expect a Node Style - // callback function with the form of (acc, done) - if (source.length === 2) { + // if the arity is 3, we expect a Node Style + // callback function with the form of (value, acc, done) + if (source.length === 3) { reducer.body = Promise.promisify(source) } else { reducer.body = source diff --git a/packages/data-point/lib/reducer-types/reducer-function/factory.test.js b/packages/data-point/lib/reducer-types/reducer-function/factory.test.js index a2836856..55476c95 100644 --- a/packages/data-point/lib/reducer-types/reducer-function/factory.test.js +++ b/packages/data-point/lib/reducer-types/reducer-function/factory.test.js @@ -11,16 +11,18 @@ test('reducer/reducer-function#isType', () => { describe('reducer/reducer-function#validateFunction', () => { expect(factory.validateFunction(() => true)).toBe(true) - expect(factory.validateFunction(a => true)).toBe(true) - expect(factory.validateFunction((a, b) => true)).toBe(true) + expect(factory.validateFunction(value => true)).toBe(true) + expect(factory.validateFunction((value, acc) => true)).toBe(true) + expect(factory.validateFunction((value, acc, next) => true)).toBe(true) expect(() => - factory.validateFunction((a, b, c) => true) + // 4 arguments is not a reducer + factory.validateFunction((a, b, c, d) => true) ).toThrowErrorMatchingSnapshot() }) describe('reducer/reducer-function#create', () => { test('function body', () => { - const reducerFunction = () => (acc, done) => done(null, acc.value * 2) + const reducerFunction = () => value => value * 2 const reducer = factory.create(createReducer, reducerFunction) expect(reducer.body).toEqual(reducerFunction) }) diff --git a/packages/data-point/lib/reducer-types/reducer-function/resolve.js b/packages/data-point/lib/reducer-types/reducer-function/resolve.js index 7ffc7d0b..6f6c91b3 100644 --- a/packages/data-point/lib/reducer-types/reducer-function/resolve.js +++ b/packages/data-point/lib/reducer-types/reducer-function/resolve.js @@ -9,9 +9,11 @@ const utils = require('../../utils') * @returns {Promise} */ function resolve (manager, resolveReducer, accumulator, reducer) { - return Promise.try(() => reducer.body(accumulator)).then(value => { - return utils.set(accumulator, 'value', value) - }) + return Promise.try(() => reducer.body(accumulator.value, accumulator)).then( + value => { + return utils.set(accumulator, 'value', value) + } + ) } module.exports.resolve = resolve diff --git a/packages/data-point/lib/reducer-types/reducer-function/resolve.test.js b/packages/data-point/lib/reducer-types/reducer-function/resolve.test.js index 891a8742..6c3f59c9 100644 --- a/packages/data-point/lib/reducer-types/reducer-function/resolve.test.js +++ b/packages/data-point/lib/reducer-types/reducer-function/resolve.test.js @@ -18,8 +18,8 @@ describe('resolve#filter.resolve', () => { value: 'test' }) - const reducer = reducerFactory.create((acc, done) => - done(null, `${acc.value}node`) + const reducer = reducerFactory.create((value, acc, done) => + done(null, `${value}node`) ) return resolveFunction @@ -34,7 +34,7 @@ describe('resolve#filter.resolve', () => { value: 'test' }) - const reducer = reducerFactory.create(acc => `${acc.value}sync`) + const reducer = reducerFactory.create(value => `${value}sync`) return resolveFunction .resolve(dataPoint, resolveReducer, accumulator, reducer) @@ -48,8 +48,8 @@ describe('resolve#filter.resolve', () => { value: 'test' }) - const reducer = reducerFactory.create(acc => - Promise.resolve(`${acc.value}promise`) + const reducer = reducerFactory.create(value => + Promise.resolve(`${value}promise`) ) return resolveFunction @@ -64,7 +64,7 @@ describe('resolve#filter.resolve', () => { value: 'test' }) - const reducer = reducerFactory.create((acc, done) => { + const reducer = reducerFactory.create((value, acc, done) => { return done(new Error('Test')) }) diff --git a/packages/data-point/lib/reducer-types/reducer-helpers/reducer-filter/resolve.test.js b/packages/data-point/lib/reducer-types/reducer-helpers/reducer-filter/resolve.test.js index a925f12f..78693e89 100644 --- a/packages/data-point/lib/reducer-types/reducer-helpers/reducer-filter/resolve.test.js +++ b/packages/data-point/lib/reducer-types/reducer-helpers/reducer-filter/resolve.test.js @@ -41,7 +41,7 @@ describe('ReducerFilter#resolve', () => { } ] const accumulator = AccumulatorFactory.create({ value }) - const reducer = Factory.create(Reducer.create, ['$a', acc => acc.value > 1]) + const reducer = Factory.create(Reducer.create, ['$a', value => value > 1]) return Resolve.resolve(manager, Reducer.resolve, accumulator, reducer).then( result => { expect(result.value).toEqual([ diff --git a/packages/data-point/lib/reducer-types/reducer-helpers/reducer-find/resolve.test.js b/packages/data-point/lib/reducer-types/reducer-helpers/reducer-find/resolve.test.js index de68e607..f5cb810e 100644 --- a/packages/data-point/lib/reducer-types/reducer-helpers/reducer-find/resolve.test.js +++ b/packages/data-point/lib/reducer-types/reducer-helpers/reducer-find/resolve.test.js @@ -41,7 +41,7 @@ describe('ReducerFind#resolve', () => { } ] const accumulator = AccumulatorFactory.create({ value }) - const reducer = Factory.create(Reducer.create, ['$a', acc => acc.value > 1]) + const reducer = Factory.create(Reducer.create, ['$a', value => value > 1]) return Resolve.resolve(manager, Reducer.resolve, accumulator, reducer).then( result => { expect(result.value).toEqual({ diff --git a/packages/data-point/lib/reducer-types/reducer-helpers/reducer-map/resolve.test.js b/packages/data-point/lib/reducer-types/reducer-helpers/reducer-map/resolve.test.js index 5f310943..1d650258 100644 --- a/packages/data-point/lib/reducer-types/reducer-helpers/reducer-map/resolve.test.js +++ b/packages/data-point/lib/reducer-types/reducer-helpers/reducer-map/resolve.test.js @@ -41,7 +41,7 @@ describe('ReducerMap#resolve', () => { } ] const accumulator = AccumulatorFactory.create({ value }) - const reducer = Factory.create(Reducer.create, ['$a', acc => acc.value + 1]) + const reducer = Factory.create(Reducer.create, ['$a', value => value + 1]) return Resolve.resolve(manager, Reducer.resolve, accumulator, reducer).then( result => { expect(result.value).toEqual([2, 3]) diff --git a/packages/data-point/lib/reducer-types/reducer-list/factory.test.js b/packages/data-point/lib/reducer-types/reducer-list/factory.test.js index ce2f6231..a2b33c18 100644 --- a/packages/data-point/lib/reducer-types/reducer-list/factory.test.js +++ b/packages/data-point/lib/reducer-types/reducer-list/factory.test.js @@ -66,9 +66,7 @@ describe('factory#create', () => { }) test('factory#create reducer from single function', () => { - const result = factory.create(createReducer, (acc, done) => - done(null, acc.value) - ) + const result = factory.create(createReducer, value => value) expect(result.reducers).toHaveLength(1) expect(result.reducers[0].type).toBe('ReducerFunction') }) @@ -98,7 +96,7 @@ describe('factory#create', () => { const result = factory.create(createReducer, [ '$foo.bar', 'reducer:add | $foo.bar.zeta', - (acc, done) => done(null, acc.value) + value => value ]) expect(result.reducers).toHaveLength(4) diff --git a/packages/data-point/lib/reducer-types/reducer-object/resolve.test.js b/packages/data-point/lib/reducer-types/reducer-object/resolve.test.js index c1ba8c32..bda4b350 100644 --- a/packages/data-point/lib/reducer-types/reducer-object/resolve.test.js +++ b/packages/data-point/lib/reducer-types/reducer-object/resolve.test.js @@ -50,7 +50,7 @@ describe('resolve#reducerObject.resolve', () => { const reducer = createReducerObject(createReducer, { y: '$x.y', - zPlusOne: ['$x.y.z', acc => acc.value + 1] + zPlusOne: ['$x.y.z', input => input + 1] }) return resolveReducerObject( diff --git a/packages/data-point/test/definitions/collection.js b/packages/data-point/test/definitions/collection.js index a4a8e749..e2687e31 100644 --- a/packages/data-point/test/definitions/collection.js +++ b/packages/data-point/test/definitions/collection.js @@ -2,7 +2,7 @@ const reducers = require('../utils/reducers') module.exports = { 'collection:noValue': { - value: (acc, next) => { + value: (value, acc, next) => { return next(null, 'invalid') } }, @@ -26,9 +26,7 @@ module.exports = { }, 'collection:c.2': { value: '$a.b.c', - filter: (acc, next) => { - next(null, acc.value % 2) - } + filter: value => value % 2 }, 'collection:c.3': { value: '$a.b.c', @@ -36,15 +34,11 @@ module.exports = { }, 'collection:d.1': { value: '$a.b.c', - find: (acc, next) => { - next(null, acc.value % 2) - } + find: value => value % 2 }, 'collection:d.2': { value: '$a.b.c', - find: (acc, next) => { - next(null, acc.value === 0) - } + find: value => value === 0 }, 'collection:d.3': { value: '$a.b.c', diff --git a/packages/data-point/test/definitions/control.js b/packages/data-point/test/definitions/control.js index 9090502b..52c3c9e6 100644 --- a/packages/data-point/test/definitions/control.js +++ b/packages/data-point/test/definitions/control.js @@ -1,14 +1,14 @@ const _ = require('lodash') -const isEqualTo = (pathFrom, compareTo) => (acc, done) => { - done(null, _.get(acc.value, pathFrom) === compareTo) +const isEqualTo = (pathFrom, compareTo) => value => { + return _.get(value, pathFrom) === compareTo } -const returnValue = value => (acc, done) => { - done(null, value) +const returnValue = newValue => value => { + return newValue } -const throwError = () => (acc, done) => { +const throwError = () => value => { throw new Error('test') } diff --git a/packages/data-point/test/definitions/hash.js b/packages/data-point/test/definitions/hash.js index af4d90b6..383bb9a5 100644 --- a/packages/data-point/test/definitions/hash.js +++ b/packages/data-point/test/definitions/hash.js @@ -2,7 +2,7 @@ const reducers = require('../utils/reducers') module.exports = { 'hash:noValue': { - value: (acc, next) => { + value: (value, acc, next) => { return next(null, 'invalid') } }, diff --git a/packages/data-point/test/definitions/model.js b/packages/data-point/test/definitions/model.js index b0c1fc0e..3b848018 100644 --- a/packages/data-point/test/definitions/model.js +++ b/packages/data-point/test/definitions/model.js @@ -1,10 +1,10 @@ module.exports = { 'model:a.0': {}, 'model:a.1': { - value: acc => acc.value + 5 + value: value => value + 5 }, 'model:a.2': { - value: acc => acc.value + 5 + value: value => value + 5 }, // entities c.* are for testing @@ -19,19 +19,19 @@ module.exports = { 'model:c.2': { // test that its immutable - outputType: acc => { + outputType: value => { return 'cant happen' } }, 'model:c.3': { // custom type checking - inputType: acc => { - if (typeof acc.value !== 'string') { + inputType: value => { + if (typeof value !== 'string') { throw new Error('custom type error') } - return acc.value + return value } } } diff --git a/packages/data-point/test/definitions/requests.js b/packages/data-point/test/definitions/requests.js index c15f9492..9a293ae9 100644 --- a/packages/data-point/test/definitions/requests.js +++ b/packages/data-point/test/definitions/requests.js @@ -12,9 +12,9 @@ module.exports = { username: '$username$' }), assign({ - password: (acc, next) => next(null, '$password$'), + password: value => '$password$', qs: { - varKey1: (acc, next) => next(null, 'someValue'), + varKey1: value => 'someValue', varKey2: () => 1, varKey3: () => true } @@ -39,14 +39,14 @@ module.exports = { 'request:a2': { url: 'http://remote.test', options: { - url: acc => acc.url + '/source1' + url: options => options.url + '/source1' } }, 'request:a3': { + url: 'http://remote.test', options: { - url: acc => acc.url + acc.initialValue.itemPath - }, - url: 'http://remote.test' + url: (options, acc) => acc.url + acc.initialValue.itemPath + } }, 'request:a3.2': { url: 'http://remote.test{locals.itemPath}' diff --git a/packages/data-point/test/definitions/transform.js b/packages/data-point/test/definitions/transform.js index 647a8368..4e082cf2 100644 --- a/packages/data-point/test/definitions/transform.js +++ b/packages/data-point/test/definitions/transform.js @@ -1,7 +1,4 @@ module.exports = { 'transform:a0': '$message', - 'transform:a1': [ - 'transform:a0', - (acc, next) => next(null, acc.value.toUpperCase()) - ] + 'transform:a1': ['transform:a0', value => value.toUpperCase()] } diff --git a/packages/data-point/test/utils/reducers.js b/packages/data-point/test/utils/reducers.js index de0b9bbd..d48aedd0 100644 --- a/packages/data-point/test/utils/reducers.js +++ b/packages/data-point/test/utils/reducers.js @@ -2,11 +2,11 @@ const _ = require('lodash') const utils = require('../../lib/utils') -module.exports.passThrough = () => (context, next) => { - next(null, context.value) +module.exports.passThrough = () => value => { + return value } -module.exports.throwError = () => (context, next) => { +module.exports.throwError = () => () => { throw new Error('unexpected') } @@ -16,88 +16,78 @@ module.exports.invalidReducer = () => { } // invalid in arity, must be 2 -module.exports.invalidReducerArity = () => context => { - // return method should have context and callback as arguments +module.exports.invalidReducerArity = () => value => { + // return method should have acc and callback as arguments } -module.exports.isEqualTo = value => (context, next) => { - next(null, context.value === value) +module.exports.isEqualTo = compareTo => value => { + return compareTo === value } -module.exports.addKeyValue = (key, val) => (context, next) => { - const value = _.set(context.value, key, val) - next(null, value) +module.exports.addKeyValue = (key, val) => value => { + // TODO: check why this is mutating object, dont believe it should + return _.set(value, key, val) } -module.exports.getKeyValue = key => (context, next) => { - const value = _.get(context.value, key) - next(null, value) +module.exports.getKeyValue = key => value => { + return _.get(value, key) } -module.exports.addCollectionValues = () => (context, next) => { - const value = context.value.reduce(_.add) - next(null, value) +module.exports.addCollectionValues = () => value => { + return value.reduce(_.add) } -module.exports.timesArg1 = module.exports.multiplyBy = factor => ( - context, - next -) => { - next(null, context.value * factor) +module.exports.timesArg1 = module.exports.multiplyBy = factor => value => { + return value * factor } -module.exports.addString = string => (context, next) => { - next(null, context.value + string) +module.exports.addString = string => value => { + return value + string } -module.exports.useDataContext = () => (context, next) => { - next(null, context.value + context.initialValue.itemPath) +module.exports.useDataacc = () => (value, acc) => { + return value + acc.initialValue.itemPath } -module.exports.addQueryVar = (key, val) => (context, next) => { - const initialValue = context.value - const value = utils.set(initialValue, `qs.${key}`, val) - next(null, value) +module.exports.addQueryVar = (key, val) => value => { + // TODO: check why this is mutating object, dont believe it should + return utils.set(value, `qs.${key}`, val) } -module.exports.fromMetaToData = key => (context, next) => { - const initialValue = context.value - const value = _.get(context, `params.${key}`) - const result = utils.set(initialValue, key, value) - next(null, result) +module.exports.fromMetaToData = key => (value, acc) => { + const initialValue = value + const val = _.get(acc, `params.${key}`) + const result = utils.set(initialValue, key, val) + return result } -module.exports.addStringFromMeta = key => (context, next) => { - const value = _.get(context, `params.${key}`) - const result = context.value + value - next(null, result) +module.exports.addStringFromMeta = key => (value, acc) => { + const val = _.get(acc, `params.${key}`) + return value + val } -module.exports.setDataFromRequest = key => (context, next) => { - const initialValue = context.value - const value = _.get(context, `locals.${key}`) - const result = utils.set(initialValue, key, value) - next(null, result) +module.exports.setDataFromRequest = key => (value, acc) => { + const initialValue = value + const val = _.get(acc, `locals.${key}`) + return utils.set(initialValue, key, val) } -module.exports.addStringFromRequest = key => (context, next) => { - const value = _.get(context, `locals.${key}`) - const result = context.value + value - next(null, result) +module.exports.addStringFromRequest = key => (value, acc) => { + const val = _.get(acc, `locals.${key}`) + return acc.value + val } -module.exports.sourceErrorDoNothing = () => (context, next) => { - next(context.value) +module.exports.sourceErrorDoNothing = () => value => { + return value } -module.exports.sourceErrorGraceful = () => (context, next) => { - next(null, { +module.exports.sourceErrorGraceful = () => value => { + return { noData: true - }) + } } -module.exports.addStringFromContextKey = key => (context, next) => { - const value = _.get(context, key) - const result = context.value + value - next(null, result) +module.exports.addStringFromaccKey = key => (value, acc) => { + const val = _.get(acc, key) + return value + val } diff --git a/yarn.lock b/yarn.lock index 62fad9a3..739b992c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -161,6 +161,12 @@ all-contributors-cli@^4.10.1: request "^2.72.0" yargs "^10.0.3" +alter@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/alter/-/alter-0.2.0.tgz#c7588808617572034aae62480af26b1d4d1cb3cd" + dependencies: + stable "~0.1.3" + amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" @@ -191,6 +197,10 @@ ansi-styles@^3.0.0, ansi-styles@^3.1.0, ansi-styles@^3.2.0: dependencies: color-convert "^1.9.0" +ansi-styles@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.0.0.tgz#cb102df1c56f5123eab8b67cd7b98027a0279178" + any-observable@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.2.0.tgz#c67870058003579009083f54ac0abafb5c33d242" @@ -239,6 +249,10 @@ arr-flatten@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" +array-differ@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" + array-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" @@ -297,8 +311,28 @@ assert-plus@^0.2.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" assertion-error@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c" + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + +ast-traverse@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ast-traverse/-/ast-traverse-0.1.1.tgz#69cf2b8386f19dcda1bb1e05d68fe359d8897de6" + +ast-types@0.10.1: + version "0.10.1" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.10.1.tgz#f52fca9715579a14f841d67d7f8d25432ab6a3dd" + +ast-types@0.8.12: + version "0.8.12" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.8.12.tgz#a0d90e4351bb887716c83fd637ebf818af4adfcc" + +ast-types@0.8.15: + version "0.8.15" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.8.15.tgz#8eef0827f04dff0ec8857ba925abe3fea6194e52" + +ast-types@0.9.6: + version "0.9.6" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9" astral-regex@^1.0.0: version "1.0.0" @@ -342,6 +376,57 @@ babel-code-frame@^6.16.0, babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: esutils "^2.0.2" js-tokens "^3.0.2" +babel-core@^5: + version "5.8.38" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-5.8.38.tgz#1fcaee79d7e61b750b00b8e54f6dfc9d0af86558" + dependencies: + babel-plugin-constant-folding "^1.0.1" + babel-plugin-dead-code-elimination "^1.0.2" + babel-plugin-eval "^1.0.1" + babel-plugin-inline-environment-variables "^1.0.1" + babel-plugin-jscript "^1.0.4" + babel-plugin-member-expression-literals "^1.0.1" + babel-plugin-property-literals "^1.0.1" + babel-plugin-proto-to-assign "^1.0.3" + babel-plugin-react-constant-elements "^1.0.3" + babel-plugin-react-display-name "^1.0.3" + babel-plugin-remove-console "^1.0.1" + babel-plugin-remove-debugger "^1.0.1" + babel-plugin-runtime "^1.0.7" + babel-plugin-undeclared-variables-check "^1.0.2" + babel-plugin-undefined-to-void "^1.1.6" + babylon "^5.8.38" + bluebird "^2.9.33" + chalk "^1.0.0" + convert-source-map "^1.1.0" + core-js "^1.0.0" + debug "^2.1.1" + detect-indent "^3.0.0" + esutils "^2.0.0" + fs-readdir-recursive "^0.1.0" + globals "^6.4.0" + home-or-tmp "^1.0.0" + is-integer "^1.0.4" + js-tokens "1.0.1" + json5 "^0.4.0" + lodash "^3.10.0" + minimatch "^2.0.3" + output-file-sync "^1.1.0" + path-exists "^1.0.0" + path-is-absolute "^1.0.0" + private "^0.1.6" + regenerator "0.8.40" + regexpu "^1.3.0" + repeating "^1.1.2" + resolve "^1.1.6" + shebang-regex "^1.0.0" + slash "^1.0.0" + source-map "^0.5.0" + source-map-support "^0.2.10" + to-fast-properties "^1.0.0" + trim-right "^1.0.0" + try-resolve "^1.0.0" + babel-core@^6.0.0, babel-core@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" @@ -388,6 +473,117 @@ babel-generator@^6.18.0, babel-generator@^6.26.0: source-map "^0.5.6" trim-right "^1.0.1" +babel-helper-bindify-decorators@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz#14c19e5f142d7b47f19a52431e52b1ccbc40a330" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + dependencies: + babel-helper-explode-assignable-expression "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-define-map@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-explode-assignable-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-explode-class@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz#7dc2a3910dee007056e1e31d640ced3d54eaa9eb" + dependencies: + babel-helper-bindify-decorators "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + dependencies: + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-regex@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" + dependencies: + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + dependencies: + babel-helper-optimise-call-expression "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babel-helpers@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" @@ -408,6 +604,28 @@ babel-messages@^6.23.0: dependencies: babel-runtime "^6.22.0" +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-constant-folding@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-constant-folding/-/babel-plugin-constant-folding-1.0.1.tgz#8361d364c98e449c3692bdba51eff0844290aa8e" + +babel-plugin-dead-code-elimination@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/babel-plugin-dead-code-elimination/-/babel-plugin-dead-code-elimination-1.0.2.tgz#5f7c451274dcd7cccdbfbb3e0b85dd28121f0f65" + +babel-plugin-eval@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-eval/-/babel-plugin-eval-1.0.1.tgz#a2faed25ce6be69ade4bfec263f70169195950da" + +babel-plugin-inline-environment-variables@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-inline-environment-variables/-/babel-plugin-inline-environment-variables-1.0.1.tgz#1f58ce91207ad6a826a8bf645fafe68ff5fe3ffe" + babel-plugin-istanbul@^4.0.0: version "4.1.5" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.5.tgz#6760cdd977f411d3e175bb064f2bc327d99b2b6e" @@ -420,10 +638,380 @@ babel-plugin-jest-hoist@^21.2.0: version "21.2.0" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-21.2.0.tgz#2cef637259bd4b628a6cace039de5fcd14dbb006" -babel-plugin-syntax-object-rest-spread@^6.13.0: +babel-plugin-jscript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/babel-plugin-jscript/-/babel-plugin-jscript-1.0.4.tgz#8f342c38276e87a47d5fa0a8bd3d5eb6ccad8fcc" + +babel-plugin-member-expression-literals@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-member-expression-literals/-/babel-plugin-member-expression-literals-1.0.1.tgz#cc5edb0faa8dc927170e74d6d1c02440021624d3" + +babel-plugin-property-literals@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-property-literals/-/babel-plugin-property-literals-1.0.1.tgz#0252301900192980b1c118efea48ce93aab83336" + +babel-plugin-proto-to-assign@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/babel-plugin-proto-to-assign/-/babel-plugin-proto-to-assign-1.0.4.tgz#c49e7afd02f577bc4da05ea2df002250cf7cd123" + dependencies: + lodash "^3.9.3" + +babel-plugin-react-constant-elements@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/babel-plugin-react-constant-elements/-/babel-plugin-react-constant-elements-1.0.3.tgz#946736e8378429cbc349dcff62f51c143b34e35a" + +babel-plugin-react-display-name@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/babel-plugin-react-display-name/-/babel-plugin-react-display-name-1.0.3.tgz#754fe38926e8424a4e7b15ab6ea6139dee0514fc" + +babel-plugin-remove-console@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-remove-console/-/babel-plugin-remove-console-1.0.1.tgz#d8f24556c3a05005d42aaaafd27787f53ff013a7" + +babel-plugin-remove-debugger@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-remove-debugger/-/babel-plugin-remove-debugger-1.0.1.tgz#fd2ea3cd61a428ad1f3b9c89882ff4293e8c14c7" + +babel-plugin-runtime@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/babel-plugin-runtime/-/babel-plugin-runtime-1.0.7.tgz#bf7c7d966dd56ecd5c17fa1cb253c9acb7e54aaf" + +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + +babel-plugin-syntax-async-generators@^6.5.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a" + +babel-plugin-syntax-class-constructor-call@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz#9cb9d39fe43c8600bec8146456ddcbd4e1a76416" + +babel-plugin-syntax-class-properties@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" + +babel-plugin-syntax-decorators@^6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz#312563b4dbde3cc806cee3e416cceeaddd11ac0b" + +babel-plugin-syntax-dynamic-import@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da" + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + +babel-plugin-syntax-export-extensions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz#70a1484f0f9089a4e84ad44bac353c95b9b12721" + +babel-plugin-syntax-flow@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d" + +babel-plugin-syntax-object-rest-spread@^6.13.0, babel-plugin-syntax-object-rest-spread@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + +babel-plugin-transform-async-generator-functions@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-generators "^6.5.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-class-constructor-call@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.24.1.tgz#80dc285505ac067dcb8d6c65e2f6f11ab7765ef9" + dependencies: + babel-plugin-syntax-class-constructor-call "^6.18.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-class-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" + dependencies: + babel-helper-function-name "^6.24.1" + babel-plugin-syntax-class-properties "^6.8.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-decorators@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz#788013d8f8c6b5222bdf7b344390dfd77569e24d" + dependencies: + babel-helper-explode-class "^6.24.1" + babel-plugin-syntax-decorators "^6.13.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoping@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" + dependencies: + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-plugin-transform-es2015-classes@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + dependencies: + babel-helper-define-map "^6.24.1" + babel-helper-function-name "^6.24.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-helper-replace-supers "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-computed-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-destructuring@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-for-of@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + dependencies: + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a" + dependencies: + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-types "^6.26.0" + +babel-plugin-transform-es2015-modules-systemjs@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-umd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + dependencies: + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-object-super@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + dependencies: + babel-helper-replace-supers "^6.24.1" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-parameters@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + dependencies: + babel-helper-call-delegate "^6.24.1" + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-shorthand-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-sticky-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-unicode-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-exponentiation-operator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + dependencies: + babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" + babel-plugin-syntax-exponentiation-operator "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-export-extensions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz#53738b47e75e8218589eea946cbbd39109bbe653" + dependencies: + babel-plugin-syntax-export-extensions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-flow-strip-types@^6.8.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" + dependencies: + babel-plugin-syntax-flow "^6.18.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-object-rest-spread@^6.22.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" + dependencies: + babel-plugin-syntax-object-rest-spread "^6.8.0" + babel-runtime "^6.26.0" + +babel-plugin-transform-regenerator@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" + dependencies: + regenerator-transform "^0.10.0" + +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-undeclared-variables-check@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/babel-plugin-undeclared-variables-check/-/babel-plugin-undeclared-variables-check-1.0.2.tgz#5cf1aa539d813ff64e99641290af620965f65dee" + dependencies: + leven "^1.0.2" + +babel-plugin-undefined-to-void@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/babel-plugin-undefined-to-void/-/babel-plugin-undefined-to-void-1.1.6.tgz#7f578ef8b78dfae6003385d8417a61eda06e2f81" + +babel-preset-es2015@^6.9.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.24.1" + babel-plugin-transform-es2015-classes "^6.24.1" + babel-plugin-transform-es2015-computed-properties "^6.24.1" + babel-plugin-transform-es2015-destructuring "^6.22.0" + babel-plugin-transform-es2015-duplicate-keys "^6.24.1" + babel-plugin-transform-es2015-for-of "^6.22.0" + babel-plugin-transform-es2015-function-name "^6.24.1" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-plugin-transform-es2015-modules-systemjs "^6.24.1" + babel-plugin-transform-es2015-modules-umd "^6.24.1" + babel-plugin-transform-es2015-object-super "^6.24.1" + babel-plugin-transform-es2015-parameters "^6.24.1" + babel-plugin-transform-es2015-shorthand-properties "^6.24.1" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.24.1" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.22.0" + babel-plugin-transform-es2015-unicode-regex "^6.24.1" + babel-plugin-transform-regenerator "^6.24.1" + babel-preset-jest@^21.2.0: version "21.2.0" resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-21.2.0.tgz#ff9d2bce08abd98e8a36d9a8a5189b9173b85638" @@ -431,7 +1019,34 @@ babel-preset-jest@^21.2.0: babel-plugin-jest-hoist "^21.2.0" babel-plugin-syntax-object-rest-spread "^6.13.0" -babel-register@^6.26.0: +babel-preset-stage-1@^6.5.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz#7692cd7dcd6849907e6ae4a0a85589cfb9e2bfb0" + dependencies: + babel-plugin-transform-class-constructor-call "^6.24.1" + babel-plugin-transform-export-extensions "^6.22.0" + babel-preset-stage-2 "^6.24.1" + +babel-preset-stage-2@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz#d9e2960fb3d71187f0e64eec62bc07767219bdc1" + dependencies: + babel-plugin-syntax-dynamic-import "^6.18.0" + babel-plugin-transform-class-properties "^6.24.1" + babel-plugin-transform-decorators "^6.24.1" + babel-preset-stage-3 "^6.24.1" + +babel-preset-stage-3@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz#836ada0a9e7a7fa37cb138fb9326f87934a48395" + dependencies: + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-generator-functions "^6.24.1" + babel-plugin-transform-async-to-generator "^6.24.1" + babel-plugin-transform-exponentiation-operator "^6.24.1" + babel-plugin-transform-object-rest-spread "^6.22.0" + +babel-register@^6.26.0, babel-register@^6.9.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" dependencies: @@ -443,7 +1058,7 @@ babel-register@^6.26.0: mkdirp "^0.5.1" source-map-support "^0.4.15" -babel-runtime@^6.22.0, babel-runtime@^6.23.0, babel-runtime@^6.26.0: +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.23.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" dependencies: @@ -460,7 +1075,7 @@ babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: babylon "^6.18.0" lodash "^4.17.4" -babel-traverse@^6.18.0, babel-traverse@^6.26.0: +babel-traverse@^6.18.0, babel-traverse@^6.24.1, babel-traverse@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" dependencies: @@ -474,7 +1089,7 @@ babel-traverse@^6.18.0, babel-traverse@^6.26.0: invariant "^2.2.2" lodash "^4.17.4" -babel-types@^6.18.0, babel-types@^6.26.0: +babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" dependencies: @@ -487,7 +1102,11 @@ babylon@7.0.0-beta.32, babylon@^7.0.0-beta.31: version "7.0.0-beta.32" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.32.tgz#e9033cb077f64d6895f4125968b37dc0a8c3bc6e" -babylon@^6.18.0: +babylon@^5.8.38: + version "5.8.38" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-5.8.38.tgz#ec9b120b11bf6ccd4173a18bf217e60b79859ffd" + +babylon@^6.17.3, babylon@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" @@ -518,10 +1137,14 @@ bluebird@3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c" -bluebird@3.5.1, bluebird@^3.3.4, bluebird@^3.5.0, bluebird@^3.5.1: +bluebird@3.5.1, bluebird@^3.1.5, bluebird@^3.3.4, bluebird@^3.5.0, bluebird@^3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" +bluebird@^2.9.33: + version "2.11.0" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1" + body-parser@1.18.2: version "1.18.2" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.2.tgz#87678a19d84b47d859b83199bd59bce222b10454" @@ -555,7 +1178,18 @@ boom@5.x.x: dependencies: hoek "4.x.x" -brace-expansion@^1.1.7: +boxen@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-0.3.1.tgz#a7d898243ae622f7abb6bb604d740a76c6a5461b" + dependencies: + chalk "^1.1.1" + filled-array "^1.0.0" + object-assign "^4.0.1" + repeating "^2.0.0" + string-width "^1.0.1" + widest-line "^1.0.0" + +brace-expansion@^1.0.0, brace-expansion@^1.1.7: version "1.1.8" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" dependencies: @@ -570,6 +1204,10 @@ braces@^1.8.2: preserve "^0.2.0" repeat-element "^1.1.2" +breakable@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/breakable/-/breakable-1.0.0.tgz#784a797915a38ead27bad456b5572cb4bbaa78c1" + browser-resolve@^1.11.2: version "1.11.2" resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" @@ -621,7 +1259,7 @@ camelcase-keys@^2.0.0: camelcase "^2.0.0" map-obj "^1.0.0" -camelcase@^1.0.2: +camelcase@^1.0.2, camelcase@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" @@ -674,6 +1312,14 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0: escape-string-regexp "^1.0.5" supports-color "^4.0.0" +chalk@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.4.0.tgz#5199a3ddcd0c1efe23bc08c1b027b06176e0c64f" + dependencies: + ansi-styles "~1.0.0" + has-color "~0.1.0" + strip-ansi "~0.1.0" + chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" @@ -709,6 +1355,10 @@ cli-truncate@^0.2.1: slice-ansi "0.0.4" string-width "^1.0.1" +cli-width@^1.0.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-1.1.1.tgz#a4d293ef67ebb7b88d4a4d42c0ccf00c4d1e366d" + cli-width@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" @@ -766,6 +1416,10 @@ colors@1.0.x: version "1.0.3" resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" +colors@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" + columnify@^1.5.4: version "1.5.4" resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" @@ -787,6 +1441,10 @@ commander@^2.11.0, commander@^2.9.0: version "2.12.2" resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555" +commander@^2.5.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" + commitizen@2.9.6, commitizen@latest: version "2.9.6" resolved "https://registry.yarnpkg.com/commitizen/-/commitizen-2.9.6.tgz#c0d00535ef264da7f63737edfda4228983fa2291" @@ -813,6 +1471,20 @@ common-tags@^1.4.0: dependencies: babel-runtime "^6.26.0" +commoner@~0.10.3: + version "0.10.8" + resolved "https://registry.yarnpkg.com/commoner/-/commoner-0.10.8.tgz#34fc3672cd24393e8bb47e70caa0293811f4f2c5" + dependencies: + commander "^2.5.0" + detective "^4.3.1" + glob "^5.0.15" + graceful-fs "^4.1.2" + iconv-lite "^0.4.5" + mkdirp "^0.5.0" + private "^0.1.6" + q "^1.1.2" + recast "^0.11.17" + compare-func@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-1.3.2.tgz#99dd0ba457e1f9bc722b12c08ec33eeab31fa648" @@ -836,6 +1508,20 @@ concat-stream@^1.4.10, concat-stream@^1.4.7, concat-stream@^1.5.0, concat-stream readable-stream "^2.2.2" typedarray "^0.0.6" +configstore@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-2.1.0.tgz#737a3a7036e9886102aa6099e47bb33ab1aba1a1" + dependencies: + dot-prop "^3.0.0" + graceful-fs "^4.1.2" + mkdirp "^0.5.0" + object-assign "^4.0.1" + os-tmpdir "^1.0.0" + osenv "^0.1.0" + uuid "^2.0.1" + write-file-atomic "^1.1.2" + xdg-basedir "^2.0.0" + console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" @@ -1005,7 +1691,7 @@ conventional-recommended-bump@^1.0.0, conventional-recommended-bump@^1.0.1: meow "^3.3.0" object-assign "^4.0.1" -convert-source-map@^1.4.0, convert-source-map@^1.5.0: +convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.5.0: version "1.5.1" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" @@ -1021,10 +1707,18 @@ cookiejar@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.1.tgz#41ad57b1b555951ec171412a81942b1e8200d34a" +core-js@^1.0.0: + version "1.2.7" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" + core-js@^2.4.0, core-js@^2.5.0: version "2.5.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.1.tgz#ae6874dc66937789b80754ff5428df66819ca50b" +core-js@^2.4.1: + version "2.5.3" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e" + core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -1051,12 +1745,19 @@ cosmiconfig@^3.1.0: parse-json "^3.0.0" require-from-string "^2.0.1" -create-error-class@^3.0.0: +create-error-class@^3.0.0, create-error-class@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" dependencies: capture-stack-trace "^1.0.0" +cross-spawn-async@^2.1.1: + version "2.2.5" + resolved "https://registry.yarnpkg.com/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz#845ff0c0834a3ded9d160daca6d390906bb288cc" + dependencies: + lru-cache "^4.0.0" + which "^1.2.8" + cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -1227,6 +1928,25 @@ define-properties@^1.1.2: 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" + +defs@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/defs/-/defs-1.1.1.tgz#b22609f2c7a11ba7a3db116805c139b1caffa9d2" + dependencies: + alter "~0.2.0" + ast-traverse "~0.1.1" + breakable "~1.0.0" + esprima-fb "~15001.1001.0-dev-harmony-fb" + simple-fmt "~0.1.0" + simple-is "~0.2.0" + stringmap "~0.2.2" + stringset "~0.2.1" + tryor "~0.1.2" + yargs "~3.27.0" + deglob@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/deglob/-/deglob-2.1.0.tgz#4d44abe16ef32c779b4972bd141a80325029a14a" @@ -1262,10 +1982,14 @@ denque@^1.1.0: version "1.2.2" resolved "https://registry.yarnpkg.com/denque/-/denque-1.2.2.tgz#e06cf7cf0da8badc88cbdaabf8fc0a70d659f1d4" -depd@1.1.1, depd@~1.1.1: +depd@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" +depd@~1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" @@ -1280,7 +2004,15 @@ detect-indent@4.0.0, detect-indent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" dependencies: - repeating "^2.0.0" + repeating "^2.0.0" + +detect-indent@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-3.0.1.tgz#9dc5e5ddbceef8325764b9451b02bc6d54084f75" + dependencies: + get-stdin "^4.0.1" + minimist "^1.1.0" + repeating "^1.1.0" detect-indent@^5.0.0: version "5.0.0" @@ -1290,6 +2022,13 @@ detect-libc@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" +detective@^4.3.1: + version "4.7.1" + resolved "https://registry.yarnpkg.com/detective/-/detective-4.7.1.tgz#0eca7314338442febb6d65da54c10bb1c82b246e" + dependencies: + acorn "^5.2.1" + defined "^1.0.0" + diff@^3.2.0: version "3.4.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c" @@ -1317,6 +2056,12 @@ dot-prop@^3.0.0: dependencies: is-obj "^1.0.0" +duplexer2@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" + dependencies: + readable-stream "^2.0.2" + duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" @@ -1340,8 +2085,8 @@ elegant-spinner@^1.0.1: resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" encodeurl@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20" + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" errno@^0.1.4: version "0.1.4" @@ -1615,11 +2360,19 @@ espree@^3.4.0, espree@^3.5.2: acorn "^5.2.1" acorn-jsx "^3.0.0" -esprima@^3.1.3: +esprima-fb@~15001.1001.0-dev-harmony-fb: + version "15001.1001.0-dev-harmony-fb" + resolved "https://registry.yarnpkg.com/esprima-fb/-/esprima-fb-15001.1001.0-dev-harmony-fb.tgz#43beb57ec26e8cf237d3dd8b33e42533577f2659" + +esprima@^2.6.0: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + +esprima@^3.1.3, esprima@~3.1.0: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" -esprima@^4.0.0: +esprima@^4.0.0, esprima@~4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" @@ -1640,7 +2393,7 @@ estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" -esutils@^2.0.2: +esutils@^2.0.0, esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -1661,6 +2414,17 @@ exec-sh@^0.2.0: dependencies: merge "^1.1.3" +execa@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.4.0.tgz#4eb6467a36a095fabb2970ff9d5e3fb7bce6ebc3" + dependencies: + cross-spawn-async "^2.1.1" + is-stream "^1.1.0" + npm-run-path "^1.0.0" + object-assign "^4.0.1" + path-key "^1.0.0" + strip-eof "^1.0.0" + execa@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" @@ -1850,6 +2614,10 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" +filled-array@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/filled-array/-/filled-array-1.1.0.tgz#c3c4f6c663b923459a9aa29912d2d031f1507f84" + finalhandler@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" @@ -1916,6 +2684,10 @@ flexbuffer@0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/flexbuffer/-/flexbuffer-0.0.6.tgz#039fdf23f8823e440c38f3277e6fef1174215b30" +flow-parser@^0.*: + version "0.64.0" + resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.64.0.tgz#858664ef2246880f9a81b05e69fbd308a1b865c9" + for-in@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -1988,6 +2760,10 @@ fs-extra@^4.0.1: jsonfile "^4.0.0" universalify "^0.1.0" +fs-readdir-recursive@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-0.1.2.tgz#315b4fb8c1ca5b8c47defef319d073dad3568059" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -2148,6 +2924,26 @@ glob@7.1.1: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^5.0.15: + version "5.0.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^6.0.1: + 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.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" @@ -2194,10 +2990,25 @@ globals@^11.0.1: version "11.0.1" resolved "https://registry.yarnpkg.com/globals/-/globals-11.0.1.tgz#12a87bb010e5154396acc535e1e43fc753b0e5e8" +globals@^6.4.0: + version "6.4.1" + resolved "https://registry.yarnpkg.com/globals/-/globals-6.4.1.tgz#8498032b3b6d1cc81eebc5f79690d8fe29fabf4f" + globals@^9.14.0, globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" +globby@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-4.1.0.tgz#080f54549ec1b82a6c60e631fc82e1211dbe95f8" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^6.0.1" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + globby@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" @@ -2219,6 +3030,26 @@ globby@^6.1.0: pify "^2.0.0" pinkie-promise "^2.0.0" +got@^5.0.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/got/-/got-5.7.1.tgz#5f81635a61e4a6589f180569ea4e381680a51f35" + dependencies: + create-error-class "^3.0.1" + duplexer2 "^0.1.4" + is-redirect "^1.0.0" + is-retry-allowed "^1.0.0" + is-stream "^1.0.0" + lowercase-keys "^1.0.0" + node-status-codes "^1.0.0" + object-assign "^4.0.1" + parse-json "^2.1.0" + pinkie-promise "^2.0.0" + read-all-stream "^3.0.0" + readable-stream "^2.0.5" + timed-out "^3.0.0" + unzip-response "^1.0.2" + url-parse-lax "^1.0.0" + got@^6.7.1: version "6.7.1" resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" @@ -2235,7 +3066,7 @@ got@^6.7.1: unzip-response "^2.0.1" url-parse-lax "^1.0.0" -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, 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" @@ -2281,6 +3112,10 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" +has-color@~0.1.0: + version "0.1.7" + resolved "https://registry.yarnpkg.com/has-color/-/has-color-0.1.7.tgz#67144a5260c34fc3cca677d041daf52fe7b78b2f" + has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" @@ -2325,6 +3160,13 @@ hoek@4.x.x: version "4.2.0" resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" +home-or-tmp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-1.0.0.tgz#4b9f1e40800c3e50c6c27f781676afcce71f3985" + dependencies: + os-tmpdir "^1.0.1" + user-home "^1.1.1" + home-or-tmp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" @@ -2373,7 +3215,7 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" -iconv-lite@0.4.19, iconv-lite@^0.4.17: +iconv-lite@0.4.19, iconv-lite@^0.4.17, iconv-lite@^0.4.5: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" @@ -2410,6 +3252,13 @@ ini@^1.3.2, ini@^1.3.4, ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" +inquirer-bluebird@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/inquirer-bluebird/-/inquirer-bluebird-1.0.7.tgz#1cc90be6f6101443613ae5a63c1726c2ac1fbc1c" + dependencies: + bluebird "^3.1.5" + inquirer "^0.11.4" + inquirer@1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-1.2.3.tgz#4dec6f32f37ef7bb0b2ed3f1d1a5c3f545074918" @@ -2429,6 +3278,24 @@ inquirer@1.2.3: strip-ansi "^3.0.0" through "^2.3.6" +inquirer@^0.11.4: + version "0.11.4" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.11.4.tgz#81e3374e8361beaff2d97016206d359d0b32fa4d" + dependencies: + ansi-escapes "^1.1.0" + ansi-regex "^2.0.0" + chalk "^1.0.0" + cli-cursor "^1.0.1" + cli-width "^1.0.1" + figures "^1.3.5" + lodash "^3.3.1" + readline2 "^1.0.1" + run-async "^0.1.0" + rx-lite "^3.1.2" + string-width "^1.0.1" + strip-ansi "^3.0.0" + through "^2.3.6" + inquirer@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" @@ -2500,8 +3367,8 @@ invert-kv@^1.0.0: resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" ioredis-mock@^3.3.1: - version "3.4.2" - resolved "https://registry.yarnpkg.com/ioredis-mock/-/ioredis-mock-3.4.2.tgz#87408c4c70e6008ecf547c1a5450e25192badcee" + version "3.6.1" + resolved "https://registry.yarnpkg.com/ioredis-mock/-/ioredis-mock-3.6.1.tgz#4efbd5d325842745ebbaede840c8a67a86378572" dependencies: array-from "^2.1.1" bluebird "^3.5.1" @@ -2613,6 +3480,14 @@ is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" +is-git-clean@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-git-clean/-/is-git-clean-1.1.0.tgz#13abd6dda711bb08aafd42604da487845ddcf88d" + dependencies: + execa "^0.4.0" + is-obj "^1.0.1" + multimatch "^2.1.0" + is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" @@ -2631,6 +3506,12 @@ is-glob@^4.0.0: dependencies: is-extglob "^2.1.1" +is-integer@^1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-integer/-/is-integer-1.0.7.tgz#6bde81aacddf78b659b6629d629cadc51a886d5c" + dependencies: + is-finite "^1.0.0" + is-my-json-valid@^2.10.0: version "2.16.1" resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz#5a846777e2c2620d1e69104e5d3a03b1f6088f11" @@ -2640,6 +3521,10 @@ is-my-json-valid@^2.10.0: jsonpointer "^4.0.0" xtend "^4.0.0" +is-npm@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" + is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" @@ -3064,6 +3949,10 @@ jest@latest: dependencies: jest-cli "^21.2.1" +js-tokens@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-1.0.1.tgz#cc435a5c8b94ad15acb7983140fc80182c89aeae" + js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" @@ -3079,6 +3968,47 @@ jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" +jscodeshift@0.x: + version "0.4.0" + resolved "https://registry.yarnpkg.com/jscodeshift/-/jscodeshift-0.4.0.tgz#a76afdbfc6f4e78c3fd0d1a60470dfa43c03190e" + dependencies: + async "^1.5.0" + babel-plugin-transform-flow-strip-types "^6.8.0" + babel-preset-es2015 "^6.9.0" + babel-preset-stage-1 "^6.5.0" + babel-register "^6.9.0" + babylon "^6.17.3" + colors "^1.1.2" + flow-parser "^0.*" + lodash "^4.13.1" + micromatch "^2.3.7" + node-dir "0.1.8" + nomnom "^1.8.1" + recast "^0.12.5" + temp "^0.8.1" + write-file-atomic "^1.2.0" + +jscodeshift@^0.3.19: + version "0.3.32" + resolved "https://registry.yarnpkg.com/jscodeshift/-/jscodeshift-0.3.32.tgz#dece5eb602f16340d8d954c7f96ac907c502eabb" + dependencies: + async "^1.5.0" + babel-core "^5" + babel-plugin-transform-flow-strip-types "^6.8.0" + babel-preset-es2015 "^6.9.0" + babel-preset-stage-1 "^6.5.0" + babel-register "^6.9.0" + babylon "^6.17.3" + colors "^1.1.2" + flow-parser "^0.*" + lodash "^4.13.1" + micromatch "^2.3.7" + node-dir "0.1.8" + nomnom "^1.8.1" + recast "^0.12.5" + temp "^0.8.1" + write-file-atomic "^1.2.0" + jsdom@^9.12.0: version "9.12.0" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.12.0.tgz#e8c546fffcb06c00d4833ca84410fed7f8a097d4" @@ -3107,6 +4037,10 @@ jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + json-schema-traverse@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" @@ -3129,6 +4063,10 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" +json5@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.4.0.tgz#054352e4c4c80c86c0923877d449de176a732c8d" + json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" @@ -3188,6 +4126,12 @@ klaw@^1.0.0: optionalDependencies: graceful-fs "^4.1.9" +latest-version@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-2.0.0.tgz#56f8d6139620847b8017f8f1f4d78e211324168b" + dependencies: + package-json "^2.0.0" + lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" @@ -3241,6 +4185,10 @@ lerna@^2.5.1: write-pkg "^3.1.0" yargs "^8.0.2" +leven@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/leven/-/leven-1.0.2.tgz#9144b6eebca5f1d0680169f1a6770dcea60b75c3" + leven@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" @@ -3252,6 +4200,22 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +lib-upgrader@1.x: + version "1.1.0" + resolved "https://registry.yarnpkg.com/lib-upgrader/-/lib-upgrader-1.1.0.tgz#4c27ce1c167be5ea41b5046a60b03e06ca325991" + dependencies: + bluebird "^3.3.4" + globby "^4.0.0" + inquirer-bluebird "^1.0.7" + is-git-clean "^1.0.0" + jscodeshift "^0.3.19" + lodash.assign "^4.0.7" + lodash.findindex "^4.3.0" + lodash.flatten "^4.1.1" + meow "^3.7.0" + semver "^5.1.0" + update-notifier "^0.6.3" + lint-staged@4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-4.2.3.tgz#5a1f12256af06110b96225f109dbf215009a37a9" @@ -3417,7 +4381,7 @@ lodash._reinterpolate@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" -lodash.assign@^4.2.0: +lodash.assign@^4.0.7, lodash.assign@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" @@ -3445,7 +4409,11 @@ lodash.difference@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.difference/-/lodash.difference-4.5.0.tgz#9ccb4e505d486b91651345772885a2df27fd017c" -lodash.flatten@^4.4.0: +lodash.findindex@^4.3.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.findindex/-/lodash.findindex-4.6.0.tgz#a3245dee61fb9b6e0624b535125624bb69c11106" + +lodash.flatten@^4.1.1, lodash.flatten@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" @@ -3522,6 +4490,10 @@ lodash@4.17.4, lodash@4.x, lodash@^4.0.0, lodash@^4.1.0, lodash@^4.11.2, lodash@ version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" +lodash@^3.10.0, lodash@^3.3.1, lodash@^3.9.3: + version "3.10.1" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" + lodash@~4.9.0: version "4.9.0" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.9.0.tgz#4c20d742f03ce85dc700e0dd7ab9bcab85e6fc14" @@ -3577,7 +4549,7 @@ lowercase-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" -lru-cache@^4.0.1: +lru-cache@^4.0.0, lru-cache@^4.0.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" dependencies: @@ -3697,12 +4669,18 @@ mimic-fn@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" -minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: brace-expansion "^1.1.7" +minimatch@^2.0.3: + version "2.0.10" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7" + dependencies: + brace-expansion "^1.0.0" + minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" @@ -3741,6 +4719,15 @@ ms@2.x: version "2.1.1" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" +multimatch@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" + dependencies: + array-differ "^1.0.0" + array-union "^1.0.1" + arrify "^1.0.0" + minimatch "^3.0.0" + mute-stream@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" @@ -3778,6 +4765,10 @@ nock@^8.0.0: propagate "0.4.0" qs "^6.0.2" +node-dir@0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/node-dir/-/node-dir-0.1.8.tgz#55fb8deb699070707fb67f91a460f0448294c77d" + node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -3807,6 +4798,17 @@ node-pre-gyp@^0.6.39: tar "^2.2.1" tar-pack "^3.4.0" +node-status-codes@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-status-codes/-/node-status-codes-1.0.0.tgz#5ae5541d024645d32a58fcddc9ceecea7ae3ac2f" + +nomnom@^1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.8.1.tgz#2151f722472ba79e50a76fc125bb8c8f2e4dc2a7" + dependencies: + chalk "~0.4.0" + underscore "~1.6.0" + nopt@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" @@ -3841,6 +4843,12 @@ npm-path@^2.0.2: dependencies: which "^1.2.10" +npm-run-path@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-1.0.0.tgz#f5c32bf595fe81ae927daec52e82f8b000ac3c8f" + dependencies: + path-key "^1.0.0" + npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" @@ -3956,6 +4964,12 @@ os-homedir@^1.0.0, os-homedir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + dependencies: + lcid "^1.0.0" + os-locale@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" @@ -3972,13 +4986,21 @@ os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" -osenv@^0.1.4: +osenv@^0.1.0, osenv@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.0" +output-file-sync@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" + dependencies: + graceful-fs "^4.1.4" + mkdirp "^0.5.1" + object-assign "^4.1.0" + p-cancelable@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" @@ -4001,6 +5023,15 @@ p-map@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" +package-json@^2.0.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-2.4.0.tgz#0d15bd67d1cbbddbb2ca222ff2edb86bcb31a8bb" + dependencies: + got "^5.0.0" + registry-auth-token "^3.0.1" + registry-url "^3.0.3" + semver "^5.1.0" + package-json@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/package-json/-/package-json-4.0.1.tgz#8869a0401253661c4c4ca3da6c2121ed555f5eed" @@ -4029,7 +5060,7 @@ parse-glob@^3.0.4: is-extglob "^1.0.0" is-glob "^2.0.0" -parse-json@^2.2.0: +parse-json@^2.1.0, parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" dependencies: @@ -4063,6 +5094,10 @@ path-exists@2.1.0, path-exists@^2.0.0: dependencies: pinkie-promise "^2.0.0" +path-exists@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-1.0.0.tgz#d5a8998eb71ef37a74c34eb0d9eba6e878eea081" + path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" @@ -4075,6 +5110,10 @@ path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" +path-key@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-1.0.0.tgz#5d53d578019646c0d68800db4e146e6bdc2ac7af" + path-key@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" @@ -4155,8 +5194,8 @@ pkg-up@^1.0.0: find-up "^1.0.0" platform@^1.3.3: - version "1.3.4" - resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.4.tgz#6f0fb17edaaa48f21442b3a975c063130f1c3ebd" + version "1.3.5" + resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.5.tgz#fb6958c696e07e2918d2eeda0f0bc9448d733444" pluralize@^1.2.1: version "1.2.1" @@ -4255,7 +5294,11 @@ prettier@1.7.x: version "1.7.4" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.4.tgz#5e8624ae9363c80f95ec644584ecdf55d74f93fa" -prettier@^1.4.4, prettier@^1.6.0, prettier@^1.7.1: +prettier@^1.4.4, prettier@^1.6.0: + version "1.10.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.10.2.tgz#1af8356d1842276a99a5b5529c82dd9e9ad3cc93" + +prettier@^1.7.1: version "1.8.2" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.8.2.tgz#bff83e7fd573933c607875e5ba3abbdffb96aeb8" @@ -4273,7 +5316,7 @@ pretty-format@^21.2.1: ansi-regex "^3.0.0" ansi-styles "^3.2.0" -private@^0.1.7: +private@^0.1.6, private@^0.1.7, private@~0.1.5: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" @@ -4312,7 +5355,7 @@ punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" -q@^1.4.1: +q@^1.1.2, q@^1.4.1: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" @@ -4353,6 +5396,13 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.1.7: minimist "^1.2.0" strip-json-comments "~2.0.1" +read-all-stream@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/read-all-stream/-/read-all-stream-3.1.0.tgz#35c3e177f2078ef789ee4bfafa4373074eaef4fa" + dependencies: + pinkie-promise "^2.0.0" + readable-stream "^2.0.0" + read-cmd-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz#2d5d157786a37c055d22077c32c53f8329e91c7b" @@ -4389,7 +5439,7 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" -readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2: +readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2: version "2.3.3" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" dependencies: @@ -4409,6 +5459,43 @@ readline2@^1.0.1: is-fullwidth-code-point "^1.0.0" mute-stream "0.0.5" +recast@0.10.33: + version "0.10.33" + resolved "https://registry.yarnpkg.com/recast/-/recast-0.10.33.tgz#942808f7aa016f1fa7142c461d7e5704aaa8d697" + dependencies: + ast-types "0.8.12" + esprima-fb "~15001.1001.0-dev-harmony-fb" + private "~0.1.5" + source-map "~0.5.0" + +recast@^0.10.10: + version "0.10.43" + resolved "https://registry.yarnpkg.com/recast/-/recast-0.10.43.tgz#b95d50f6d60761a5f6252e15d80678168491ce7f" + dependencies: + ast-types "0.8.15" + esprima-fb "~15001.1001.0-dev-harmony-fb" + private "~0.1.5" + source-map "~0.5.0" + +recast@^0.11.17: + version "0.11.23" + resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.23.tgz#451fd3004ab1e4df9b4e4b66376b2a21912462d3" + dependencies: + ast-types "0.9.6" + esprima "~3.1.0" + private "~0.1.5" + source-map "~0.5.0" + +recast@^0.12.5: + version "0.12.9" + resolved "https://registry.yarnpkg.com/recast/-/recast-0.12.9.tgz#e8e52bdb9691af462ccbd7c15d5a5113647a15f1" + dependencies: + ast-types "0.10.1" + core-js "^2.4.1" + esprima "~4.0.0" + private "~0.1.5" + source-map "~0.6.1" + rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -4430,16 +5517,57 @@ redis-parser@^2.4.0: version "2.6.0" resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-2.6.0.tgz#52ed09dacac108f1a631c07e9b69941e7a19504b" +regenerate@^1.2.1: + version "1.3.3" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" + regenerator-runtime@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz#7e54fe5b5ccd5d6624ea6255c3473be090b802e1" +regenerator-transform@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" + dependencies: + babel-runtime "^6.18.0" + babel-types "^6.19.0" + private "^0.1.6" + +regenerator@0.8.40: + version "0.8.40" + resolved "https://registry.yarnpkg.com/regenerator/-/regenerator-0.8.40.tgz#a0e457c58ebdbae575c9f8cd75127e93756435d8" + dependencies: + commoner "~0.10.3" + defs "~1.1.0" + esprima-fb "~15001.1001.0-dev-harmony-fb" + private "~0.1.5" + recast "0.10.33" + through "~2.3.8" + regex-cache@^0.4.2: version "0.4.4" resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" dependencies: is-equal-shallow "^0.1.3" +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regexpu@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/regexpu/-/regexpu-1.3.0.tgz#e534dc991a9e5846050c98de6d7dd4a55c9ea16d" + dependencies: + esprima "^2.6.0" + recast "^0.10.10" + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + registry-auth-token@^3.0.1: version "3.3.1" resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.1.tgz#fb0d3289ee0d9ada2cbb52af5dfe66cb070d3006" @@ -4453,6 +5581,16 @@ registry-url@^3.0.3: dependencies: rc "^1.0.1" +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + dependencies: + jsesc "~0.5.0" + remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -4465,6 +5603,12 @@ repeat-string@^1.5.2: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" +repeating@^1.1.0, repeating@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-1.1.3.tgz#3d4114218877537494f97f77f9785fab810fa4ac" + dependencies: + is-finite "^1.0.0" + repeating@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" @@ -4649,6 +5793,10 @@ rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.6.1: dependencies: glob "^7.0.5" +rimraf@~2.2.6: + version "2.2.8" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" + run-async@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" @@ -4683,7 +5831,13 @@ rx@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" -rxjs@^5.0.0-beta.11, rxjs@^5.4.0, rxjs@^5.4.2: +rxjs@^5.0.0-beta.11: + version "5.5.6" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.6.tgz#e31fb96d6fd2ff1fd84bcea8ae9c02d007179c02" + dependencies: + symbol-observable "1.0.1" + +rxjs@^5.4.0, rxjs@^5.4.2: version "5.5.2" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.2.tgz#28d403f0071121967f18ad665563255d54236ac3" dependencies: @@ -4711,6 +5865,12 @@ sax@^1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" +semver-diff@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" + dependencies: + semver "^5.0.3" + "semver@2 || 3 || 4 || 5", semver@5.4.1, semver@^5.0.1, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" @@ -4719,6 +5879,10 @@ semver@5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" +semver@^5.0.3: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + send@0.16.1: version "0.16.1" resolved "https://registry.yarnpkg.com/send/-/send-0.16.1.tgz#a70e1ca21d1382c11d0d9f6231deb281080d7ab3" @@ -4792,6 +5956,14 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" +simple-fmt@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/simple-fmt/-/simple-fmt-0.1.0.tgz#191bf566a59e6530482cb25ab53b4a8dc85c3a6b" + +simple-is@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/simple-is/-/simple-is-0.2.0.tgz#2abb75aade39deb5cc815ce10e6191164850baf0" + slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" @@ -4806,6 +5978,10 @@ slice-ansi@1.0.0: dependencies: is-fullwidth-code-point "^2.0.0" +slide@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + snazzy@7.0.0, snazzy@latest: version "7.0.0" resolved "https://registry.yarnpkg.com/snazzy/-/snazzy-7.0.0.tgz#95edaccc4a8d6f80f4ac5cc7b520e8f8f9ac2325" @@ -4835,22 +6011,38 @@ sort-keys@^2.0.0: dependencies: is-plain-obj "^1.0.0" +source-map-support@^0.2.10: + version "0.2.10" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.2.10.tgz#ea5a3900a1c1cb25096a0ae8cc5c2b4b10ded3dc" + dependencies: + source-map "0.1.32" + source-map-support@^0.4.15: version "0.4.18" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" dependencies: source-map "^0.5.6" +source-map@0.1.32: + version "0.1.32" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.32.tgz#c8b6c167797ba4740a8ea33252162ff08591b266" + dependencies: + amdefine ">=0.0.4" + source-map@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" dependencies: amdefine ">=0.0.4" -source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.6: +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.0, source-map@~0.5.1, source-map@~0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" +source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + spawn-sync@^1.0.15: version "1.0.15" resolved "https://registry.yarnpkg.com/spawn-sync/-/spawn-sync-1.0.15.tgz#b00799557eb7fb0c8376c29d44e8a1ea67e57476" @@ -4902,6 +6094,10 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" +stable@~0.1.3: + version "0.1.6" + resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.6.tgz#910f5d2aed7b520c6e777499c1f32e139fdecb10" + stack-trace@0.0.x: version "0.0.10" resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" @@ -5009,6 +6205,14 @@ stringify-object@^3.2.0: is-obj "^1.0.1" is-regexp "^1.0.0" +stringmap@~0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/stringmap/-/stringmap-0.2.2.tgz#556c137b258f942b8776f5b2ef582aa069d7d1b1" + +stringset@~0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/stringset/-/stringset-0.2.1.tgz#ef259c4e349344377fcd1c913dd2e848c9c042b5" + stringstream@~0.0.4, stringstream@~0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -5025,6 +6229,10 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.1.1.tgz#39e8a98d044d150660abe4a6808acf70bb7bc991" + strip-bom@3.0.0, strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -5097,6 +6305,10 @@ supports-color@^4.0.0: dependencies: has-flag "^2.0.0" +symbol-observable@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" + symbol-observable@^0.2.2: version "0.2.4" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40" @@ -5167,6 +6379,13 @@ temp-write@^3.3.0: temp-dir "^1.0.0" uuid "^3.0.1" +temp@^0.8.1: + version "0.8.3" + resolved "https://registry.yarnpkg.com/temp/-/temp-0.8.3.tgz#e0c6bc4d26b903124410e4fed81103014dfc1f59" + dependencies: + os-tmpdir "^1.0.0" + rimraf "~2.2.6" + tempfile@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/tempfile/-/tempfile-1.1.1.tgz#5bcc4eaecc4ab2c707d8bc11d99ccc9a2cb287f2" @@ -5203,10 +6422,14 @@ through2@^2.0.0, through2@^2.0.2: readable-stream "^2.1.5" xtend "~4.0.1" -through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: +through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@~2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" +timed-out@^3.0.0: + version "3.1.3" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-3.1.3.tgz#95860bfcc5c76c277f8f8326fd0f5b2e20eba217" + timed-out@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" @@ -5227,7 +6450,7 @@ tmpl@1.0.x: version "1.0.4" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" -to-fast-properties@^1.0.3: +to-fast-properties@^1.0.0, to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" @@ -5253,14 +6476,22 @@ trim-off-newlines@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" -trim-right@^1.0.1: +trim-right@^1.0.0, trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" +try-resolve@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/try-resolve/-/try-resolve-1.0.1.tgz#cfde6fabd72d63e5797cfaab873abbe8e700e912" + tryit@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" +tryor@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/tryor/-/tryor-0.1.2.tgz#8145e4ca7caff40acde3ccf946e8b8bb75b4172b" + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -5324,6 +6555,10 @@ uid-number@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" +underscore@~1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8" + uniq@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" @@ -5336,16 +6571,35 @@ unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" +unzip-response@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-1.0.2.tgz#b984f0877fc0a89c2c773cc1ef7b5b232b5b06fe" + unzip-response@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" +update-notifier@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-0.6.3.tgz#776dec8daa13e962a341e8a1d98354306b67ae08" + dependencies: + boxen "^0.3.1" + chalk "^1.0.0" + configstore "^2.0.0" + is-npm "^1.0.0" + latest-version "^2.0.0" + semver-diff "^2.0.0" + url-parse-lax@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" dependencies: prepend-http "^1.0.1" +user-home@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" + user-home@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" @@ -5431,7 +6685,7 @@ which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" -which@^1.2.10, which@^1.2.12, which@^1.2.9: +which@^1.2.10, which@^1.2.12, which@^1.2.8, which@^1.2.9: version "1.3.0" resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" dependencies: @@ -5443,10 +6697,20 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2" +widest-line@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-1.0.0.tgz#0c09c85c2a94683d0d7eaf8ee097d564bf0e105c" + dependencies: + string-width "^1.0.1" + window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" +window-size@^0.1.2: + version "0.1.4" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" + winston@2.x: version "2.4.0" resolved "https://registry.yarnpkg.com/winston/-/winston-2.4.0.tgz#808050b93d52661ed9fb6c26b3f0c826708b0aee" @@ -5492,6 +6756,14 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" +write-file-atomic@^1.1.2, write-file-atomic@^1.2.0: + version "1.3.4" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + slide "^1.1.5" + write-file-atomic@^2.0.0, write-file-atomic@^2.1.0, write-file-atomic@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" @@ -5524,6 +6796,12 @@ write@^0.2.1: dependencies: mkdirp "^0.5.1" +xdg-basedir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-2.0.0.tgz#edbc903cc385fc04523d966a335504b5504d1bd2" + dependencies: + os-homedir "^1.0.0" + xml-name-validator@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" @@ -5532,7 +6810,7 @@ xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" -y18n@^3.2.1: +y18n@^3.2.0, y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" @@ -5613,3 +6891,14 @@ yargs@~3.10.0: cliui "^2.1.0" decamelize "^1.0.0" window-size "0.1.0" + +yargs@~3.27.0: + version "3.27.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.27.0.tgz#21205469316e939131d59f2da0c6d7f98221ea40" + dependencies: + camelcase "^1.2.1" + cliui "^2.1.0" + decamelize "^1.0.0" + os-locale "^1.4.0" + window-size "^0.1.2" + y18n "^3.2.0"