From 9b24d7567be194c454395365bb5db4fbd7a5caca Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Thu, 21 Mar 2019 13:10:29 -0400 Subject: [PATCH 001/113] Remove deprecated `walkTree` Since there was no way to make `walkTree` behavior consistent with modern versions of React, it was deprecated in `react-apollo` 2.4.1. --- README.md | 2 +- jest.cjs.config.js | 1 - jest.umd.config.js | 1 - src/walkTree.ts | 172 ---------- test/client/getDataFromTree.test.tsx | 454 --------------------------- 5 files changed, 1 insertion(+), 629 deletions(-) delete mode 100644 src/walkTree.ts diff --git a/README.md b/README.md index 02362bb58a..55d2a5951e 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ import 'core-js/fn/object/assign'; The `react-apollo` package is designed to be effectively consumed by bundlers that understand either CommonJS `require` syntax or ECMASCript `import` and `export` syntax, such as [Rollup](https://rollupjs.org), [Webpack](https://webpack.js.org), or [Parcel](https://parceljs.org). If your bundler supports tree-shaking, it should be able to eliminate unused code from the `react-apollo` package, regardless of which module syntax you're using. -You should (almost) never need to reach into the `react-apollo/...` internals to import specific modules. The only supported exceptions are `react-apollo/test-links`, `react-apollo/test-utils`, and `react-apollo/walkTree` (deprecated). +You should (almost) never need to reach into the `react-apollo/...` internals to import specific modules. The only supported exceptions are `react-apollo/test-links`, `react-apollo/test-utils`. When minifying your application, you can make the `react-apollo` package noticeably smaller by configuring your minifier to replace the expression `process.env.NODE_ENV` with a string literal (typically `"production"`). Other packages such as [React](https://reactjs.org) use the same convention, so there's a good chance you already have your minifier configured in this way. diff --git a/jest.cjs.config.js b/jest.cjs.config.js index 0ca648de81..374ef2e589 100644 --- a/jest.cjs.config.js +++ b/jest.cjs.config.js @@ -3,7 +3,6 @@ const { jest } = require('./package.json'); jest.moduleNameMapper = { '\\.\\./src$': '/lib/react-apollo.cjs.js', '\\.\\./src/test-utils': '/lib/test-utils.js', - '\\.\\./src/walkTree': '/lib/walkTree.js', // Force other imports to /src/whatever to fail '\\.\\./src': '/test/fail-no-entry-point.js', }; diff --git a/jest.umd.config.js b/jest.umd.config.js index 0a503751b5..91b61dd8cb 100644 --- a/jest.umd.config.js +++ b/jest.umd.config.js @@ -3,7 +3,6 @@ const { jest } = require('./package.json'); jest.moduleNameMapper = { '\\.\\./src$': '/lib/react-apollo.umd.js', '\\.\\./src/test-utils': '/lib/test-utils.js', - '\\.\\./src/walkTree': '/lib/walkTree.js', // Force other imports to /src/whatever to fail '\\.\\./src': '/test/fail-no-entry-point.js', }; diff --git a/src/walkTree.ts b/src/walkTree.ts deleted file mode 100644 index 4bca214d23..0000000000 --- a/src/walkTree.ts +++ /dev/null @@ -1,172 +0,0 @@ -import * as React from 'react'; -import { Context } from './types'; - -interface PreactElement

{ - attributes: P; -} - -function getProps

(element: React.ReactElement

| PreactElement

): P { - return (element as React.ReactElement

).props || (element as PreactElement

).attributes; -} - -function isReactElement(element: React.ReactNode): element is React.ReactElement { - return !!(element as any).type; -} - -function isComponentClass(Comp: React.ComponentType): Comp is React.ComponentClass { - return Comp.prototype && (Comp.prototype.render || Comp.prototype.isReactComponent); -} - -function providesChildContext( - instance: React.Component, -): instance is React.Component & React.ChildContextProvider { - return !!(instance as any).getChildContext; -} - -// Recurse a React Element tree, running visitor on each element. -// If visitor returns `false`, don't call the element's render function -// or recurse into its child elements. -export function walkTree( - element: React.ReactNode, - context: Context, - visitor: ( - element: React.ReactNode, - instance: React.Component | null, - newContextMap: Map, - context: Context, - childContext?: Context, - ) => boolean | void, - newContext: Map = new Map(), -) { - if (!element) { - return; - } - - if (Array.isArray(element)) { - element.forEach(item => walkTree(item, context, visitor, newContext)); - return; - } - - // A stateless functional component or a class - if (isReactElement(element)) { - if (typeof element.type === 'function') { - const Comp = element.type; - let childContext = context; - let child; - - // Are we are a react class? - if (isComponentClass(Comp)) { - const props = Object.assign({}, Comp.defaultProps, getProps(element)); - const instance = new Comp(props, context); - // In case the user doesn't pass these to super in the constructor. - // Note: `Component.props` are now readonly in `@types/react`, so - // we're using `defineProperty` as a workaround (for now). - Object.defineProperty(instance, 'props', { - value: instance.props || props, - }); - instance.context = instance.context || context; - - // Set the instance state to null (not undefined) if not set, to match React behaviour - instance.state = instance.state || null; - - // Override setState to just change the state, not queue up an update - // (we can't do the default React thing as we aren't mounted - // "properly", however we don't need to re-render as we only support - // setState in componentWillMount, which happens *before* render). - instance.setState = newState => { - if (typeof newState === 'function') { - // React's TS type definitions don't contain context as a third parameter for - // setState's updater function. - // Remove this cast to `any` when that is fixed. - newState = (newState as any)(instance.state, instance.props, instance.context); - } - instance.state = Object.assign({}, instance.state, newState); - }; - - if (Comp.getDerivedStateFromProps) { - const result = Comp.getDerivedStateFromProps(instance.props, instance.state); - if (result !== null) { - instance.state = Object.assign({}, instance.state, result); - } - } else if (instance.UNSAFE_componentWillMount) { - instance.UNSAFE_componentWillMount(); - } else if (instance.componentWillMount) { - instance.componentWillMount(); - } - - if (providesChildContext(instance)) { - childContext = Object.assign({}, context, instance.getChildContext()); - } - - if (visitor(element, instance, newContext, context, childContext) === false) { - return; - } - - child = instance.render(); - } else { - - // Just a stateless functional - if (visitor(element, null, newContext, context) === false) { - return; - } - - const FC = Comp as React.FunctionComponent; - child = FC(getProps(element), context); - } - - if (child) { - if (Array.isArray(child)) { - child.forEach(item => walkTree(item, childContext, visitor, newContext)); - } else { - walkTree(child, childContext, visitor, newContext); - } - } - } else if ((element.type as any)._context || (element.type as any).Consumer) { - // A React context provider or consumer - if (visitor(element, null, newContext, context) === false) { - return; - } - - let child; - if (!!(element.type as any)._context) { - // A provider - sets the context value before rendering children - // this needs to clone the map because this value should only apply to children of the provider - newContext = new Map(newContext); - newContext.set(element.type, element.props.value); - child = element.props.children; - } else { - // A consumer - let value = (element.type as any)._currentValue; - if (newContext.has((element.type as any).Provider)) { - value = newContext.get((element.type as any).Provider); - } - child = element.props.children(value); - } - - if (child) { - if (Array.isArray(child)) { - child.forEach(item => walkTree(item, context, visitor, newContext)); - } else { - walkTree(child, context, visitor, newContext); - } - } - } else { - // A basic string or dom element, just get children - if (visitor(element, null, newContext, context) === false) { - return; - } - - if (element.props && element.props.children) { - React.Children.forEach(element.props.children, (child: any) => { - if (child) { - walkTree(child, context, visitor, newContext); - } - }); - } - } - } else if (typeof element === 'string' || typeof element === 'number') { - // Just visit these, they are leaves so we don't keep traversing. - visitor(element, null, newContext, context); - } - // TODO: Portals? -} diff --git a/test/client/getDataFromTree.test.tsx b/test/client/getDataFromTree.test.tsx index fab3241dee..c3482809ff 100644 --- a/test/client/getDataFromTree.test.tsx +++ b/test/client/getDataFromTree.test.tsx @@ -11,7 +11,6 @@ import { DataValue, ChildProps, } from '../../src'; -import { walkTree } from "../../src/walkTree"; import gql from 'graphql-tag'; const times = require('lodash.times'); import { InMemoryCache as Cache } from 'apollo-cache-inmemory'; @@ -19,459 +18,6 @@ import { mockSingleLink } from '../../src/test-utils'; import { DocumentNode } from 'graphql'; describe('SSR', () => { - describe('`walkTree`', () => { - describe('traversal', () => { - it('basic element trees', () => { - let elementCount = 0; - const rootElement = ( -

- Foo - Bar -
- ); - walkTree(rootElement, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(5); - }); - - it('basic element trees with nulls', () => { - let elementCount = 0; - const rootElement =
{null}
; - walkTree(rootElement, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(1); - }); - - it('basic element trees with false', () => { - let elementCount = 0; - const rootElement =
{false}
; - walkTree(rootElement, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(1); - }); - - it('basic element trees with empty string', () => { - let elementCount = 0; - const rootElement =
{''}
; - walkTree(rootElement, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(1); - }); - - it('basic element trees with arrays', () => { - let elementCount = 0; - const rootElement = [1, 2]; - walkTree(rootElement, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(2); - }); - - it('basic element trees with false or null', () => { - let elementCount = 0; - const rootElement = [1, false, null, '']; - walkTree(rootElement, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(1); - }); - - it('functional stateless components', () => { - let elementCount = 0; - const MyComponent = ({ n }: { n: number }) => ( -
- {times(n, (i: any) => ( - - ))} -
- ); - walkTree(, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(7); - }); - - it('functional stateless components with children', () => { - let elementCount = 0; - let isPreact = false; - interface Props { - n: number; - children?: React.ReactNode; - } - const MyComponent = ({ n, children }: Props) => ( -
- {times(n, (i: any) => ( - - ))} - {children} -
- ); - walkTree( - - Foo - , - {}, - element => { - if (element && (element as any).preactCompatUpgraded) { - isPreact = true; - } - elementCount += 1; - }, - ); - // preact does a slightly different pass than react does here - // fwiw, preact's seems to make sense here (7 nodes vs 9) - // XXX verify markup checksums on this - if (isPreact) { - expect(elementCount).toEqual(7); - } else { - expect(elementCount).toEqual(9); - } - }); - - it('functional stateless components with null children', () => { - let elementCount = 0; - const MyComponent = ({ n, children = null }: { n: number; children: React.ReactNode }) => ( -
- {times(n, (i: any) => ( - - ))} - {children} -
- ); - walkTree({null}, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(7); - }); - - it('functional stateless components that render null', () => { - let elementCount = 0; - const MyComponent = () => null; - walkTree(, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(1); - }); - - it('functional stateless components that render an array', () => { - let elementCount = 0; - const MyComponent = () => [1, 2] as any; - walkTree(, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(3); - }); - - it('function stateless components that render with a null in array', () => { - let elementCount = 0; - - const MyComponent = () => [null,
] as any; - walkTree(, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(2); - }); - - it('function stateless components that render with a undefined in array', () => { - let elementCount = 0; - - const MyComponent = () => [undefined,
] as any; - walkTree(, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(2); - }); - - // `walkTree` is deprecated and will be removed in `react-apollo` 3.0. - // It is no longer being updated to work with newer versions of `react`. - xit('function stateless components with React 16.3 context', () => { - if (!React.createContext) { - // Preact doesn't support createContext yet, see https://github.com/developit/preact/pull/963 - return; - } - expect.assertions(4); - let elementCount = 0; - const defaultValue = { key: 'default' }; - const contextValue = { key: 'value' }; - const Context = React.createContext(defaultValue); - const MyComponent = () => ( -
- - {(value: object) => { - expect(value).toBe(defaultValue); - return ( - -
- - {(value1: object) => { - expect(value1).toBe(contextValue); - return ( -
- - {(value2: object) => { - expect(value2).toBe(contextValue); - return [
,
]; - }} - -
- ); - }} - -
- - ); - }} -
-
- ); - const MyCompAsAny = MyComponent as any; - walkTree(, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(10); - }); - - it('basic classes', () => { - let elementCount = 0; - class MyComponent extends React.Component { - render() { - return ( -
- {times(this.props.n, (i: any) => ( - - ))} -
- ); - } - } - walkTree(, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(7); - }); - - it('basic classes components that render null', () => { - let elementCount = 0; - class MyComponent extends React.Component { - render() { - return null; - } - } - walkTree(, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(1); - }); - - it('basic classes components that render an array', () => { - let elementCount = 0; - class MyComponent extends React.Component { - render() { - return [1, 2]; - } - } - walkTree(, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(3); - }); - - it('basic classes components that render with a null in array', () => { - let elementCount = 0; - - class MyComponent extends React.Component { - render() { - return [null,
]; - } - } - walkTree(, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(2); - }); - - it('basic classes with incomplete constructors', () => { - let elementCount = 0; - class MyComponent extends React.Component { - constructor() { - super(null); // note doesn't pass props or context - } - render() { - return ( -
- {times(this.props.n, (i: any) => ( - - ))} -
- ); - } - } - walkTree(, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(7); - }); - - it('basic classes with children', () => { - let elementCount = 0; - class MyComponent extends React.Component { - render() { - return ( -
- {times(this.props.n, (i: any) => ( - - ))} - {this.props.children} -
- ); - } - } - walkTree( - - Foo - , - {}, - () => { - elementCount += 1; - }, - ); - expect(elementCount).toEqual(9); - }); - - it('basic classes with render on instance', () => { - let elementCount = 0; - class MyComponent extends (React.Component as any) { - render = () => { - return ( -
- {times(this.props.n, (i: any) => ( - - ))} -
- ); - }; - } - const MyCompAsAny = MyComponent as any; - walkTree(, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(7); - }); - - it('basic classes with getDerivedStateFromProps', () => { - const renderedCounts: Number[] = []; - class MyComponent extends React.Component { - state = { count: 0 }; - - static getDerivedStateFromProps(nextProps: any, prevState: any) { - if (nextProps.increment) { - return { count: prevState.count + 1 }; - } - return null; - } - - componentWillMount() { - throw new Error( - "`componentWillMount` shouldn't be called when " + - '`getDerivedStateFromProps` is available', - ); - } - - render() { - renderedCounts.push(this.state.count); - return
{this.state.count}
; - } - } - walkTree(, {}, () => { - // noop - }); - expect(renderedCounts).toEqual([1]); - }); - - it('basic classes with UNSAFE_componentWillMount', () => { - class MyComponent extends React.Component { - state = { count: 0 }; - - UNSAFE_componentWillMount() { - this.setState({ count: 1 }); - } - - componentWillMount() { - throw new Error( - "`componentWillMount` shouldn't be called when " + - '`UNSAFE_componentWillMount` is available', - ); - } - - render() { - expect(this.state.count).toBe(1); - return
{this.state.count}
; - } - } - walkTree(, {}, () => { - // noop - }); - }); - - // `walkTree` is deprecated and will be removed in `react-apollo` 3.0. - // It is no longer being updated to work with newer versions of `react`. - xit('basic classes with React 16.3 context', () => { - if (!React.createContext) { - // Preact doesn't support createContext yet, see https://github.com/developit/preact/pull/963 - return; - } - expect.assertions(4); - let elementCount = 0; - const defaultValue = { key: 'default' }; - const contextValue = { key: 'value' }; - const Context = React.createContext(defaultValue); - class MyComponent extends (React.Component as any) { - render() { - return ( -
- - {(value: object) => { - expect(value).toBe(defaultValue); - return ( - -
- - {(value1: object) => { - expect(value1).toBe(contextValue); - return ( -
- - {(value2: object) => { - expect(value2).toBe(contextValue); - return [
,
]; - }} - -
- ); - }} - -
- - ); - }} -
-
- ); - } - } - const MyCompAsAny = MyComponent as any; - walkTree(, {}, () => { - elementCount += 1; - }); - expect(elementCount).toEqual(10); - }); - }); - }); - describe('`getDataFromTree`', () => { it('should run through all of the queries that want SSR', async () => { const query = gql` From ade881f07b1175d28b0aae79915bfc5ed8dd9e5a Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Thu, 21 Mar 2019 13:29:54 -0400 Subject: [PATCH 002/113] Remove deprecated `GraphqlQueryControls` and `MutationFunc` types --- src/types.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/types.ts b/src/types.ts index b92c565f14..cb1c6c1e76 100644 --- a/src/types.ts +++ b/src/types.ts @@ -69,16 +69,6 @@ export interface QueryControls) => any) => void; } -// XXX remove in the next breaking semver change (3.0) -export interface GraphqlQueryControls - extends QueryControls {} - -// XXX remove in the next breaking semver change (3.0) -export type MutationFunc = MutationFn< - TData, - TVariables ->; - export type DataValue = QueryControls< TData, TGraphQLVariables From f75c83397554b6d555cae12723aa1c898962aa02 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Thu, 21 Mar 2019 13:38:39 -0400 Subject: [PATCH 003/113] Update `peerDependencies` to their latest versions --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 389661807f..35b41e4f45 100644 --- a/package.json +++ b/package.json @@ -101,9 +101,9 @@ }, "peerDependencies": { "apollo-client": "^2.5.1", - "react": "^15.0.0 || ^16.0.0", - "react-dom": "^15.0.0 || ^16.0.0", - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0" + "react": "^16.8.0", + "react-dom": "^16.8.0", + "graphql": "^14.1.0" }, "sideEffects": false, "devDependencies": { From 78f035066969179fc9853560e0274ac4372cc727 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Thu, 21 Mar 2019 13:40:10 -0400 Subject: [PATCH 004/113] Adjust prettier config We've been transitioning to use the default prettier standards across all Apollo repo's, so this will get us closer (the only non-default settings are now single quotes and trailing commas). --- package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/package.json b/package.json index 35b41e4f45..4fafaed6c9 100644 --- a/package.json +++ b/package.json @@ -94,9 +94,7 @@ ] }, "prettier": { - "printWidth": 100, "singleQuote": true, - "semi": true, "trailingComma": "all" }, "peerDependencies": { From b742ae6382039eac79e050a9b0f54183dafaf4a3 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Thu, 21 Mar 2019 14:02:48 -0400 Subject: [PATCH 005/113] Remove Preact support and compatibility Preact is a great library, but it has fallen behind React in terms of functionality and compatibility with React's public API. Preact X is intended to help address this, but we're a bit concerned that it will also end up lagging behind other important areas of React functionality. To help simplify the React Apollo codebase, testing, and make sure we aren't held back from implementing new React features shortly after they're available, we're removing all Preact support for `react-apollo` 3.0. --- .circleci/config.yml | 16 --- jest.preact.config.json | 27 ----- package-lock.json | 57 --------- package.json | 3 - src/ApolloConsumer.tsx | 7 +- src/ApolloContext.ts | 5 +- test/client/getDataFromTree.test.tsx | 9 +- test/server/server.test.tsx | 175 +++++++++++++-------------- 8 files changed, 91 insertions(+), 208 deletions(-) delete mode 100644 jest.preact.config.json diff --git a/.circleci/config.yml b/.circleci/config.yml index 0c9d9f4a06..64fee0583b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,21 +46,6 @@ jobs: - run: npm i - run: npm run type-check - Preact: - docker: [{ image: 'circleci/node:8' }] - steps: - - checkout - - run: npm i - - run: - name: Jest suite - command: npm run test-preact -- --ci --testResultsProcessor="jest-junit" - environment: - JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml' - - store_test_results: - path: reports/junit - - store_artifacts: - path: reports/junit - Commonjs: docker: [{ image: 'circleci/node:8' }] steps: @@ -109,7 +94,6 @@ workflows: - Node.js 10 - Linting - Typecheck - - Preact - UMD - Commonjs - Filesize diff --git a/jest.preact.config.json b/jest.preact.config.json deleted file mode 100644 index ea43ec9524..0000000000 --- a/jest.preact.config.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "testEnvironment": "jsdom", - "transform": { - "^.+\\.tsx?$": "ts-jest", - "^.+\\.jsx?$": "babel-jest" - }, - "moduleFileExtensions": ["ts", "tsx", "js", "json"], - "modulePathIgnorePatterns": [ - "/examples", - "/test/typescript-usage.tsx", - "/test/client/graphql", - "/test/client/ApolloConsumer.test.tsx", - "/test/client/ApolloProvider.test.tsx", - "/test/client/Query.test.tsx", - "/test/client/Mutation.test.tsx", - "/test/client/Subscription.test.tsx", - "/test/internal-api/", - "/test/test-utils.test.tsx" - ], - "projects": [""], - "testRegex": "(/test/(?!test-utils\b)\b.*|\\.(test|spec))\\.(ts|tsx|js)$", - "moduleNameMapper": { - "^react$": "preact-compat", - "react-dom$": "preact-compat", - "react-dom/server": "preact-compat/server" - } -} diff --git a/package-lock.json b/package-lock.json index 8b16342d9f..d183bbc4f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4230,15 +4230,6 @@ "prebuild-install": "^2.3.0" } }, - "immutability-helper": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/immutability-helper/-/immutability-helper-2.9.1.tgz", - "integrity": "sha512-r/RmRG8xO06s/k+PIaif2r5rGc3j4Yhc01jSBfwPCXDLYZwp/yxralI37Df1mwmuzcCsen/E/ITKcTEvc1PQmQ==", - "dev": true, - "requires": { - "invariant": "^2.2.0" - } - }, "immutable-tuple": { "version": "0.4.10", "resolved": "https://registry.npmjs.org/immutable-tuple/-/immutable-tuple-0.4.10.tgz", @@ -7282,48 +7273,6 @@ "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", "dev": true }, - "preact": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/preact/-/preact-8.4.2.tgz", - "integrity": "sha512-TsINETWiisfB6RTk0wh3/mvxbGRvx+ljeBccZ4Z6MPFKgu/KFGyf2Bmw3Z/jlXhL5JlNKY6QAbA9PVyzIy9//A==", - "dev": true - }, - "preact-compat": { - "version": "3.18.4", - "resolved": "https://registry.npmjs.org/preact-compat/-/preact-compat-3.18.4.tgz", - "integrity": "sha512-aR5CvCIDerE2Y201ERVkWQdTAQKhKGNYujEk4tbyfQDInFTrnCCa3KCeGtULZrwy0PNRBjdQa2/Za7qv7ALNFg==", - "dev": true, - "requires": { - "immutability-helper": "^2.7.1", - "preact-render-to-string": "^3.8.2", - "preact-transition-group": "^1.1.1", - "prop-types": "^15.6.2", - "standalone-react-addons-pure-render-mixin": "^0.1.1" - } - }, - "preact-render-to-string": { - "version": "3.8.2", - "resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-3.8.2.tgz", - "integrity": "sha512-przuZPajiurStGgxMoJP0EJeC4xj5CgHv+M7GfF3YxAdhGgEWAkhOSE0xympAFN20uMayntBZpttIZqqLl77fw==", - "dev": true, - "requires": { - "pretty-format": "^3.5.1" - }, - "dependencies": { - "pretty-format": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-3.8.0.tgz", - "integrity": "sha1-v77VbV6ad2ZF9LH/eqGjrE+jw4U=", - "dev": true - } - } - }, - "preact-transition-group": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/preact-transition-group/-/preact-transition-group-1.1.1.tgz", - "integrity": "sha1-8KSTJ+pRXs406ivoZMSn0p5dbhA=", - "dev": true - }, "prebuild-install": { "version": "2.5.3", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-2.5.3.tgz", @@ -8580,12 +8529,6 @@ "integrity": "sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==", "dev": true }, - "standalone-react-addons-pure-render-mixin": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/standalone-react-addons-pure-render-mixin/-/standalone-react-addons-pure-render-mixin-0.1.1.tgz", - "integrity": "sha1-PHQJ9MecQN6axyxhbPZ5qZTzdVE=", - "dev": true - }, "static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", diff --git a/package.json b/package.json index 4fafaed6c9..8f0919f4ee 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "prettier": "prettier --write \"./**/*.{js,jsx,ts*,md,graphql,json}\"", "test": "npm run lint && npm run type-check && npm run jest", "test-examples": ". ./test-examples.sh", - "test-preact": "jest --config ./jest.preact.config.json --runInBand", "test-watch": "jest --watch", "test:compiled": "npm run test:compiled:cjs && npm run test:compiled:umd", "test:compiled:cjs": "jest --config jest.cjs.config.js --runInBand", @@ -138,8 +137,6 @@ "jsdom": "14.0.0", "lodash.includes": "4.3.0", "lodash.times": "4.3.2", - "preact": "8.4.2", - "preact-compat": "3.18.4", "prettier": "1.16.4", "react": "16.8.4", "react-dom": "16.8.4", diff --git a/src/ApolloConsumer.tsx b/src/ApolloConsumer.tsx index 5f5bf1cc27..0cfced2ed8 100644 --- a/src/ApolloConsumer.tsx +++ b/src/ApolloConsumer.tsx @@ -9,7 +9,7 @@ export interface ApolloConsumerProps { } const ApolloConsumer: React.StatelessComponent = - (props, legacyContext) => { + (props) => { function finish(context: any) { if (!context || !context.client) { throw new InvariantError( @@ -20,13 +20,10 @@ const ApolloConsumer: React.StatelessComponent = return props.children(context.client); } - return ApolloContext ? ( + return ( {finish} - ) : ( - // Fall back to legacy context API if React.createContext not available. - finish(legacyContext) ); }; diff --git a/src/ApolloContext.ts b/src/ApolloContext.ts index 8c83b2519f..6bb6dc766e 100644 --- a/src/ApolloContext.ts +++ b/src/ApolloContext.ts @@ -7,6 +7,5 @@ export interface ApolloContextValue { operations?: Map; } -export const ApolloContext = React.createContext - ? React.createContext(undefined) - : null; +export const ApolloContext = + React.createContext(undefined); diff --git a/test/client/getDataFromTree.test.tsx b/test/client/getDataFromTree.test.tsx index c3482809ff..55acdc1121 100644 --- a/test/client/getDataFromTree.test.tsx +++ b/test/client/getDataFromTree.test.tsx @@ -657,14 +657,7 @@ describe('SSR', () => { it('should correctly initialize an empty state to null', () => { class Element extends React.Component { render() { - // this is a check for how react and preact differ. Preact (nicely) - // comes with a default state - if ((this as any).__d) { - // I'm preact - expect(this.state).toEqual({}); - } else { - expect(this.state).toBeNull(); - } + expect(this.state).toBeNull(); return null; } } diff --git a/test/server/server.test.tsx b/test/server/server.test.tsx index ab959df0e1..594a6cb470 100644 --- a/test/server/server.test.tsx +++ b/test/server/server.test.tsx @@ -265,103 +265,100 @@ describe('SSR', () => { }); it('should work with React.createContext', async () => { - // Preact doesn't support createContext so this test won't run in Preact - if (React.createContext) { - let defaultValue = 'default'; - let Context = React.createContext(defaultValue); - let providerValue = 'provider'; - expect( - await renderToStringWithData( - - - - {val => { - expect(val).toBe(defaultValue); - return val; - }} - - , - ), - ).toBe(defaultValue); - expect( - await renderToStringWithData( - - - {val => { - expect(val).toBe(providerValue); - return val; - }} - - , - ), - ).toBe(providerValue); - expect( - await renderToStringWithData( + let defaultValue = 'default'; + let Context = React.createContext(defaultValue); + let providerValue = 'provider'; + expect( + await renderToStringWithData( + + {val => { expect(val).toBe(defaultValue); return val; }} - , - ), - ).toBe(defaultValue); - let ContextForUndefined = React.createContext(defaultValue); +
+ , + ), + ).toBe(defaultValue); + expect( + await renderToStringWithData( + + + {val => { + expect(val).toBe(providerValue); + return val; + }} + + , + ), + ).toBe(providerValue); + expect( + await renderToStringWithData( + + {val => { + expect(val).toBe(defaultValue); + return val; + }} + , + ), + ).toBe(defaultValue); + let ContextForUndefined = React.createContext(defaultValue); - expect( - await renderToStringWithData( - - - {val => { - expect(val).toBeUndefined(); - return val === undefined ? 'works' : 'broken'; - }} - - , - ), - ).toBe('works'); + expect( + await renderToStringWithData( + + + {val => { + expect(val).toBeUndefined(); + return val === undefined ? 'works' : 'broken'; + }} + + , + ), + ).toBe('works'); - const apolloClient = new ApolloClient({ - link: new ApolloLink(config => { - return new Observable(observer => { - execute(Schema, print(config.query), null, null, config.variables, config.operationName) - .then(result => { - observer.next(result); - observer.complete(); - }) - .catch(e => { - observer.error(e); - }); - }); - }), - cache: new Cache(), - }); + const apolloClient = new ApolloClient({ + link: new ApolloLink(config => { + return new Observable(observer => { + execute(Schema, print(config.query), null, null, config.variables, config.operationName) + .then(result => { + observer.next(result); + observer.complete(); + }) + .catch(e => { + observer.error(e); + }); + }); + }), + cache: new Cache(), + }); - expect( - await renderToStringWithData( - - - + + - {() => ( - - {val => { - expect(val).toBe(providerValue); - return val; - }} - - )} - - - , - ), - ).toBe(providerValue); - } + } + `} + > + {() => ( + + {val => { + expect(val).toBe(providerValue); + return val; + }} + + )} + + + , + ), + ).toBe(providerValue); }); }); From f264d81373dfa0836fb2b562f30f944971588eaa Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Thu, 21 Mar 2019 14:08:43 -0400 Subject: [PATCH 006/113] Remove the out of date `ROADMAP` The React Apollo `ROADMAP` is no longer tracked in this repository. We now create new github issues and/or release branches + PR's to track roadmaps, for specific releases, as needed. --- ROADMAP.md | 115 ----------------------------------------------------- 1 file changed, 115 deletions(-) delete mode 100644 ROADMAP.md diff --git a/ROADMAP.md b/ROADMAP.md deleted file mode 100644 index 0fe9b28905..0000000000 --- a/ROADMAP.md +++ /dev/null @@ -1,115 +0,0 @@ -# Roadmap - -This file is intended to be an up to date roadmap for future work on react-apollo. It does not cover patch level changes and some minor changes may be missed. Checkout the [Changelog](./Changelog.md) for detailed release information. - -## 2.0 - -In the 2.0 we want to ensure support for Apollo Client 2.0. It will remove the direct dependency of apollo-client to prevent the need for a breaking change with Apollo Client has one in the future. Since React Apollo exports Apollo Client, the 2.0 of Apollo Client requires a semver breaking change of React Apollo. - -Nothing should actually change in your React app with the 2.0 (expect it'll be faster :tada:). The 2.0 is nearly 100% backwards compatiable with the 1.\* expect for the removal of Redux store management in the Provider! - -## 2.1 - -The 2.1 of react-apollo will feature quite a lot of new features while being 100% backwards compatiable to the 2.0 version so its just a minor version bump. The 2.1 will be a large reorganization of this project and include first class support for Preact and Inferno usage. - -The 2.1 will split up this project into a lerna repository with both examples and multiple packages. What is currently react-apollo will be split into the following new (planned) packages: - -* apollo-component -* react-apollo -* preact-apollo -* inferno-apollo -* react-server-async (getDataFromTree and improved versions) -* preact-server-async (if needed to be different from ^^) -* reason-react-apollo (Bucklescript bindings) -* apollo-component-test-utils - -### Apollo Component - -Apollo Component is the new underlying library that powers all of the view level packages. It will export out an `ApolloProvider` for putting apollo in the context of the react tree, a new component based suite of API's, and an expanded HOC suite. The raw components will be used by the libraries to determine what Component class to use. - -**ApolloProvider** -The ApolloProvider will remove any reference to Redux and a concept of the `store`. Instead, it will accept a client and include it the context. QueryRecycler should be able to be removed in favor of first class recycle support in the 2.1 of Apollo Client. - -**Higher Order Components** -The current `graphql` API will stay the same with the one change of allowing a function instead of just a `DocumentNode` for the first argument. This will no longer be the reccomended way to use react-apollo, instead we will promote the new HOC's and/or the Component methods. However, this will allow for dynamic operations based on props. - -```js -graphql(DocumentNode || (props) => DocumentNode, { - skip: (props) => boolean, - options: (props) => boolean, - name: string - props: ({ ownProps, data }) => any -}); -``` - -Along with `graphql`, the new package will export out `query`, `mutation`, and `subscription` which will be tuned for the specific operations. - -```js -// query -query((ownProps) => ({ - query: DocumentNode - options: QueryOptions - skip: boolean, - props: (data) => any -})) - -// mutation -mutation((ownProps) => ({ - mutation: DocumentNode, - options: MutationOptions, - props: (data) => any -})) - -// subscription -subscription((ownProps) => ({ - subscription: DocumentNode, - options: SubscriptionOptions, - skip: boolean, - props: (data) => any -})) -``` - -They're may be more features added to these HOC's during full design. - -**Query** -A new way to interact with Apollo and React, the `Query` component will allow using Apollo without an higher order component. It will allow for dynamic queries and options driven by props while using a render prop to manage controlling props. A rough draft of this component looks like this: - -```js - Component || null} - error={(result?) => Component || null} - render={result => Component} -/> -``` - -**Mutation** -Like the `Query` component, the `Mutation` component will allow using Apollo without an HOC but still get all of the benefits of Apollo. The rough draft looks something like this: - -```js - Component} /> -``` - -The stateUpdater prop allows for setting local component state based on the state of the _latest_ mutation fired or potentially allow a Map of results and statues. This API is still early and may change. - -**Subscription** -Much like the other two component driven ways outlined above, `Subscription` will function much like `Query`. This design is still very much in flux and feedback is very welcome! - -### React || Preact || Inferno - -Due to the refactoring of the library, the 2.1 will allow first class support for API matching implementations of React. - -### SSR - -We think SSR is one of the best features of React Apollo and want to continue to improve it! The 2.1 will feature a new option called `ssrPolicy` which will allow you to skip (same as ssr: false), fetch the data but stop the tree render (`ssrPolicy: 'hydrate'`) or do a full render (same as ssr: true). - -Along with this change, we have high hopes for merging the async data fetching this library currently provides with a new `renderToStreamWithData` function to match React's `renderToStream` function (or possibly PR it into React :fingerscrossed:). This will allow rendering and fetching data to happen together and return a stream directly to the request. It should be the most efficient way to do SSR while still fetching data. - -### Reason - -With the lerna refactor, we will be able to start providing official bucklescript bindings for both Apollo Client and React Apollo :tada:. If you would like to help with this PLEASE reach out on slack! - -### Test Utils - -Testing of Apollo is currently harder than it should be. The test utils will become its own package (though `/test-utils`) won't change so its not breaking. This API is still in early sketch! From 118672663cd579da67ece8c1042154bd97bc84df Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Fri, 22 Mar 2019 10:50:06 -0400 Subject: [PATCH 007/113] Start using React's newer Context API internally This commit updates `react-apollo` to use React's new Context API internally, across the board. --- src/ApolloConsumer.tsx | 29 +-- src/ApolloContext.ts | 7 +- src/ApolloProvider.tsx | 80 +++------ src/Mutation.tsx | 41 +---- src/Query.tsx | 41 +---- src/Subscriptions.tsx | 25 +-- src/component-utils.tsx | 8 +- src/getDataFromTree.ts | 42 ++--- src/index.ts | 2 + test/client/ApolloConsumer.test.tsx | 11 +- test/client/ApolloProvider.test.tsx | 102 +++-------- test/client/getDataFromTree.test.tsx | 5 +- .../mutations/recycled-queries.test.tsx | 170 ------------------ .../client/graphql/shared-operations.test.tsx | 31 ++-- 14 files changed, 138 insertions(+), 456 deletions(-) diff --git a/src/ApolloConsumer.tsx b/src/ApolloConsumer.tsx index 0cfced2ed8..d68eb0a697 100644 --- a/src/ApolloConsumer.tsx +++ b/src/ApolloConsumer.tsx @@ -1,16 +1,16 @@ import * as React from 'react'; -import * as PropTypes from 'prop-types'; import ApolloClient from 'apollo-client'; -import { ApolloContext } from './ApolloContext'; import { InvariantError } from 'ts-invariant'; +import { ApolloContext } from './ApolloContext'; + export interface ApolloConsumerProps { children: (client: ApolloClient) => React.ReactElement | null; } -const ApolloConsumer: React.StatelessComponent = - (props) => { - function finish(context: any) { +const ApolloConsumer: React.FC = props => ( + + {(context: any) => { if (!context || !context.client) { throw new InvariantError( 'Could not find "client" in the context of ApolloConsumer. ' + @@ -18,21 +18,8 @@ const ApolloConsumer: React.StatelessComponent = ); } return props.children(context.client); - } - - return ( - - {finish} - - ); - }; - -ApolloConsumer.contextTypes = { - client: PropTypes.object.isRequired, -}; - -ApolloConsumer.propTypes = { - children: PropTypes.func.isRequired, -}; + }} + +); export default ApolloConsumer; diff --git a/src/ApolloContext.ts b/src/ApolloContext.ts index 6bb6dc766e..4e6cd314f6 100644 --- a/src/ApolloContext.ts +++ b/src/ApolloContext.ts @@ -1,11 +1,12 @@ import React from 'react'; import ApolloClient from 'apollo-client'; -import { DocumentNode } from 'graphql'; + +import { RenderPromises } from './getDataFromTree'; export interface ApolloContextValue { client?: ApolloClient; - operations?: Map; + renderPromises?: RenderPromises; } export const ApolloContext = - React.createContext(undefined); + React.createContext({}); diff --git a/src/ApolloProvider.tsx b/src/ApolloProvider.tsx index 91a9b50ccf..34626593bd 100644 --- a/src/ApolloProvider.tsx +++ b/src/ApolloProvider.tsx @@ -1,61 +1,37 @@ import * as React from 'react'; -import * as PropTypes from 'prop-types'; -import { Component } from 'react'; import ApolloClient from 'apollo-client'; -import { DocumentNode } from 'graphql'; -import { ApolloContext } from './ApolloContext'; - import { invariant } from 'ts-invariant'; +import { ApolloContext } from './ApolloContext'; + export interface ApolloProviderProps { client: ApolloClient; children: React.ReactNode; -} - -export default class ApolloProvider extends Component> { - static propTypes = { - client: PropTypes.object.isRequired, - children: PropTypes.node.isRequired, - }; - - static childContextTypes = { - client: PropTypes.object.isRequired, - operations: PropTypes.object, - }; - - private operations: Map = new Map(); - - constructor(props: ApolloProviderProps, context: any) { - super(props, context); - - invariant( - props.client, - 'ApolloProvider was not passed a client instance. Make ' + - 'sure you pass in your client via the "client" prop.', +}; + +const ApolloProvider: React.FC> = + ({ client, children }) => { + return ( + + {(context = {}) => { + if (client) { + context.client = client; + } + + invariant( + context.client, + 'ApolloProvider was not passed a client instance. Make ' + + 'sure you pass in your client via the "client" prop.', + ); + + return ( + + {children} + + ); + }} + ); + }; - // we have to attach to the client since you could have multiple - // providers - // XXX this is backwards compat and will be removed in 3.0 - if (!(props.client as any).__operations_cache__) { - (props.client as any).__operations_cache__ = this.operations; - } - } - - getChildContext() { - return { - client: this.props.client, - operations: (this.props.client as any).__operations_cache__, - }; - } - - render() { - return ApolloContext ? ( - - {this.props.children} - - ) : ( - this.props.children - ); - } -} +export default ApolloProvider; diff --git a/src/Mutation.tsx b/src/Mutation.tsx index dbe60ac100..96bf6a4ccf 100644 --- a/src/Mutation.tsx +++ b/src/Mutation.tsx @@ -4,11 +4,12 @@ import ApolloClient, { PureQueryOptions, ApolloError, FetchPolicy } from 'apollo import { DataProxy } from 'apollo-cache'; import { invariant } from 'ts-invariant'; import { DocumentNode, GraphQLError } from 'graphql'; -import shallowEqual from './utils/shallowEqual'; +import shallowEqual from './utils/shallowEqual'; import { OperationVariables, RefetchQueriesProviderFn } from './types'; import { parser, DocumentType } from './parser'; import { getClient } from './component-utils'; +import { ApolloContext, ApolloContextValue } from './ApolloContext'; export interface MutationResult> { data?: TData; @@ -17,10 +18,6 @@ export interface MutationResult> { called: boolean; client: ApolloClient; } -export interface MutationContext { - client?: ApolloClient; - operations: Map; -} export interface ExecutionResult> { data?: T; @@ -98,10 +95,7 @@ class Mutation extends React.Compo MutationProps, MutationState > { - static contextTypes = { - client: PropTypes.object, - operations: PropTypes.object, - }; + static contextType = ApolloContext; static propTypes = { mutation: PropTypes.object.isRequired, @@ -124,7 +118,10 @@ class Mutation extends React.Compo private hasMounted: boolean = false; - constructor(props: MutationProps, context: any) { + constructor( + props: MutationProps, + context: ApolloContextValue, + ) { super(props, context); this.client = getClient(props, context); this.verifyDocumentIsMutation(props.mutation); @@ -140,11 +137,8 @@ class Mutation extends React.Compo this.hasMounted = false; } - componentWillReceiveProps( - nextProps: MutationProps, - nextContext: MutationContext, - ) { - const nextClient = getClient(nextProps, nextContext); + componentWillReceiveProps(nextProps: MutationProps) { + const nextClient = getClient(nextProps, this.context); if (shallowEqual(this.props, nextProps) && this.client === nextClient) { return; } @@ -202,23 +196,6 @@ class Mutation extends React.Compo const mutateOptions = { ...options }; let refetchQueries = mutateOptions.refetchQueries || this.props.refetchQueries; - // XXX this will be removed in the 3.0 of Apollo Client. Currently, we - // support refectching of named queries which just pulls the latest - // variables to match. This forces us to either a) keep all queries around - // to be able to iterate over and refetch, or b) [new in 2.1] keep a map of - // operations on the client where operation name => { query, variables } - // - // Going forward, we should only allow using the full operation + variables to - // refetch. - if (refetchQueries && refetchQueries.length && Array.isArray(refetchQueries)) { - refetchQueries = (refetchQueries as any).map((x: string | PureQueryOptions) => { - if (typeof x === 'string' && this.context.operations) - return this.context.operations.get(x) || x; - return x; - }); - delete mutateOptions.refetchQueries; - } - const mutateVariables = Object.assign({}, variables, mutateOptions.variables); delete mutateOptions.variables; diff --git a/src/Query.tsx b/src/Query.tsx index 6379f868d9..ed989faa11 100644 --- a/src/Query.tsx +++ b/src/Query.tsx @@ -10,11 +10,11 @@ import ApolloClient, { } from 'apollo-client'; import { DocumentNode } from 'graphql'; import { ZenObservable } from 'zen-observable-ts'; + import { OperationVariables, QueryControls, QueryOpts } from './types'; import { parser, DocumentType, IDocumentDefinition } from './parser'; import { getClient } from './component-utils'; -import { RenderPromises } from './getDataFromTree'; - +import { ApolloContext, ApolloContextValue } from './ApolloContext'; import isEqual from 'lodash.isequal'; import shallowEqual from './utils/shallowEqual'; import { invariant } from 'ts-invariant'; @@ -76,20 +76,10 @@ export interface QueryProps extend onError?: (error: ApolloError) => void; } -export interface QueryContext { - client?: ApolloClient; - operations?: Map; - renderPromises?: RenderPromises; -} - export default class Query extends React.Component< QueryProps > { - static contextTypes = { - client: PropTypes.object, - operations: PropTypes.object, - renderPromises: PropTypes.object, - }; + static contextType = ApolloContext; static propTypes = { client: PropTypes.object, @@ -105,8 +95,6 @@ export default class Query extends partialRefetch: PropTypes.bool, }; - context: QueryContext | undefined; - private client: ApolloClient; // request / action storage. Note that we delete querySubscription if we @@ -125,9 +113,11 @@ export default class Query extends private operation?: IDocumentDefinition; private lastResult: ApolloQueryResult | null = null; - constructor(props: QueryProps, context: QueryContext) { + constructor( + props: QueryProps, + context: ApolloContextValue, + ) { super(props, context); - this.client = getClient(props, context); this.initializeQueryObservable(props); } @@ -183,14 +173,14 @@ export default class Query extends } } - componentWillReceiveProps(nextProps: QueryProps, nextContext: QueryContext) { + componentWillReceiveProps(nextProps: QueryProps) { // the next render wants to skip if (nextProps.skip && !this.props.skip) { this.removeQuerySubscription(); return; } - const nextClient = getClient(nextProps, nextContext); + const nextClient = getClient(nextProps, this.context); if (shallowEqual(this.props, nextProps) && this.client === nextClient) { return; @@ -260,8 +250,6 @@ export default class Query extends private initializeQueryObservable(props: QueryProps) { const opts = this.extractOptsFromProps(props); - // save for backwards compat of refetcherQueries without a recycler - this.setOperations(opts); // See if there is an existing observable that was used to fetch the same data and // if so, use it instead since it will contain the proper queryId to fetch @@ -274,21 +262,10 @@ export default class Query extends } } - private setOperations(props: QueryProps) { - if (this.context!.operations) { - this.context!.operations!.set(this.operation!.name, { - query: props.query, - variables: props.variables, - }); - } - } - private updateQuery(props: QueryProps) { // if we skipped initially, we may not have yet created the observable if (!this.queryObservable) { this.initializeQueryObservable(props); - } else { - this.setOperations(props); } this.queryObservable!.setOptions(this.extractOptsFromProps(props)) diff --git a/src/Subscriptions.tsx b/src/Subscriptions.tsx index 178ae3d2de..038e88cf06 100644 --- a/src/Subscriptions.tsx +++ b/src/Subscriptions.tsx @@ -7,9 +7,8 @@ import { ZenObservable } from 'zen-observable-ts'; import { OperationVariables } from './types'; import { getClient } from './component-utils'; - import shallowEqual from './utils/shallowEqual'; -import { invariant } from 'ts-invariant'; +import { ApolloContext, ApolloContextValue } from './ApolloContext'; export interface SubscriptionResult { loading: boolean; @@ -39,17 +38,11 @@ export interface SubscriptionState { error?: ApolloError; } -export interface SubscriptionContext { - client?: ApolloClient; -} - class Subscription extends React.Component< SubscriptionProps, SubscriptionState > { - static contextTypes = { - client: PropTypes.object, - }; + static contextType = ApolloContext; static propTypes = { subscription: PropTypes.object.isRequired, @@ -64,10 +57,13 @@ class Subscription extends React.Component< private queryObservable?: Observable; private querySubscription?: ZenObservable.Subscription; - constructor(props: SubscriptionProps, context: SubscriptionContext) { + constructor( + props: SubscriptionProps, + context: ApolloContextValue, + ) { super(props, context); - this.client = getClient(props, context); + this.initialize(props); this.state = this.getInitialState(); } @@ -76,11 +72,8 @@ class Subscription extends React.Component< this.startSubscription(); } - componentWillReceiveProps( - nextProps: SubscriptionProps, - nextContext: SubscriptionContext, - ) { - const nextClient = getClient(nextProps, nextContext); + componentWillReceiveProps(nextProps: SubscriptionProps) { + const nextClient = getClient(nextProps, this.context); if ( shallowEqual(this.props.variables, nextProps.variables) && diff --git a/src/component-utils.tsx b/src/component-utils.tsx index 8f2f7016c0..34f097f4c9 100644 --- a/src/component-utils.tsx +++ b/src/component-utils.tsx @@ -1,17 +1,15 @@ import ApolloClient from 'apollo-client'; import { invariant } from 'ts-invariant'; -export interface CommonComponentProps { - client?: ApolloClient; -} +import { ApolloContextValue } from './ApolloContext'; -export interface CommonComponentContext { +export interface CommonComponentProps { client?: ApolloClient; } export function getClient( props: CommonComponentProps, - context: CommonComponentContext, + context: ApolloContextValue, ): ApolloClient { const client = props.client || context.client; diff --git a/src/getDataFromTree.ts b/src/getDataFromTree.ts index c9fbad4279..cc939db6a0 100755 --- a/src/getDataFromTree.ts +++ b/src/getDataFromTree.ts @@ -1,9 +1,10 @@ import * as React from 'react'; -import * as PropTypes from 'prop-types'; -import Query from './Query'; import { ObservableQuery } from 'apollo-client'; import { DocumentNode } from 'graphql'; +import Query from './Query'; +import { ApolloContext } from './ApolloContext'; + type QueryInfo = { seen: boolean; observable: ObservableQuery | null; @@ -124,31 +125,20 @@ export function getMarkupFromTree({ }: GetMarkupFromTreeOptions): Promise { const renderPromises = new RenderPromises(); - class RenderPromisesProvider extends React.Component { - static childContextTypes: { [key: string]: any } = { - renderPromises: PropTypes.object, - }; - - getChildContext() { - return { ...context, renderPromises }; - } - - render() { - // Always re-render from the rootElement, even though it might seem - // better to render the children of the component responsible for the - // promise, because it is not possible to reconstruct the full context - // of the original rendering (including all unknown context provider - // elements) for a subtree of the orginal component tree. - return tree; - } - } - - Object.keys(context).forEach(key => { - RenderPromisesProvider.childContextTypes[key] = PropTypes.any; - }); - function process(): Promise | string { - const html = renderFunction(React.createElement(RenderPromisesProvider)); + // Always re-render from the rootElement, even though it might seem + // better to render the children of the component responsible for the + // promise, because it is not possible to reconstruct the full context + // of the original rendering (including all unknown context provider + // elements) for a subtree of the orginal component tree. + const html = renderFunction( + React.createElement( + ApolloContext.Provider, + { value: { ...context, renderPromises } }, + tree, + ) + ); + return renderPromises.hasPromises() ? renderPromises.consumeAndAwaitPromises().then(process) : html; diff --git a/src/index.ts b/src/index.ts index feebc688d7..a5cb60a58b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,5 @@ +export * from './ApolloContext'; + export { default as ApolloConsumer } from './ApolloConsumer'; export * from './ApolloConsumer'; diff --git a/test/client/ApolloConsumer.test.tsx b/test/client/ApolloConsumer.test.tsx index 7ba3f63c22..38e7a689db 100644 --- a/test/client/ApolloConsumer.test.tsx +++ b/test/client/ApolloConsumer.test.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import ApolloClient from 'apollo-client'; import { InMemoryCache as Cache } from 'apollo-cache-inmemory'; import { ApolloLink } from 'apollo-link'; -import { ApolloProvider, ApolloConsumer } from '../../src'; +import { ApolloProvider, ApolloConsumer, ApolloContext } from '../../src'; import { mount } from 'enzyme'; const client = new ApolloClient({ @@ -44,7 +44,14 @@ describe(' component', () => { const errorLogger = console.error; console.error = () => {}; // tslint:disable-line expect(() => { - mount({() => null}); + // We're wrapping the `ApolloConsumer` component in a + // `ApolloContext.Provider` component, to reset the context before + // testing. + mount( + + {() => null} + + ); }).toThrowError( 'Could not find "client" in the context of ApolloConsumer. Wrap the root component in an ', ); diff --git a/test/client/ApolloProvider.test.tsx b/test/client/ApolloProvider.test.tsx index 0e360cd00a..878f178006 100644 --- a/test/client/ApolloProvider.test.tsx +++ b/test/client/ApolloProvider.test.tsx @@ -1,11 +1,11 @@ import * as React from 'react'; -import * as PropTypes from 'prop-types'; -import { shallow } from 'enzyme'; import * as TestUtils from 'react-dom/test-utils'; +import { shallow, mount } from 'enzyme'; import ApolloClient from 'apollo-client'; import { InMemoryCache as Cache } from 'apollo-cache-inmemory'; import { ApolloLink } from 'apollo-link'; -import { ApolloProvider } from '../../src'; + +import { ApolloProvider, ApolloContext } from '../../src'; describe(' Component', () => { const client = new ApolloClient({ @@ -13,26 +13,16 @@ describe(' Component', () => { link: new ApolloLink((o, f) => (f ? f(o) : null)), }); - interface ChildContext { - client: Object; - } - class Child extends React.Component { - static contextTypes: React.ValidationMap = { - client: PropTypes.object.isRequired, - }; + static contextType = ApolloContext; - context: ChildContext = { - client: {}, - }; + componentDidUpdate() { + if (this.props.data) this.props.data.refetch(); + } render() { return null; } - - componentDidUpdate() { - if (this.props.data) this.props.data.refetch(); - } } interface Props { @@ -60,38 +50,8 @@ describe(' Component', () => { } } - // --- unused --- - // const query = gql` - // query { - // authors { - // id - // } - // } - // `; - // const GQLChild = graphql(query)(Child); - // class ConnectedContainer extends React.Component { - // constructor(props) { - // super(props); - // this.state = {}; - // } - // - // componentDidMount() { - // this.setState({ - // client: this.props.client, - // }); - // } - // - // render() { - // return ( - // - // - // - // ); - // } - // } - it('should render children components', () => { - const wrapper = shallow( + const wrapper = mount(
, @@ -101,7 +61,7 @@ describe(' Component', () => { }); it('should support the 2.0', () => { - const wrapper = shallow( + const wrapper = mount( }>
, @@ -116,10 +76,14 @@ describe(' Component', () => { /* noop */ }; expect(() => { - shallow( - -
- , + // Before testing `ApolloProvider`, we first fully reset the + // existing context using `ApolloContext.Provider` directly. + mount( + + +
+ + ); }).toThrowError( 'ApolloProvider was not passed a client instance. Make ' + @@ -129,40 +93,26 @@ describe(' Component', () => { }); it('should not require a store', () => { - const wrapper = shallow( + const wrapper = mount(
- , + ); - expect(wrapper.contains(
)).toBeTruthy(); }); - // NOTE: now that we added types, this fails directly on type checking - we have no way to runtime check - // something that cannot even be compiled. - // it('should throw if rendered without a child component', () => { - // const originalConsoleError = console.error; - // console.error = () => { - // /* noop */ - // }; - // expect(() => { - // shallow(); - // }).toThrowError(Error); - // console.error = originalConsoleError; - // }); - it('should add the client to the children context', () => { - const tree = TestUtils.renderIntoDocument>( + const wrapper = mount( - , - ) as React.Component; - - const children = TestUtils.scryRenderedComponentsWithType(tree, Child); - + + ); + const children = wrapper.find(Child); expect(children).toHaveLength(2); - children.forEach(child => expect(child.context.client).toEqual(client)); + children.forEach((node) => { + expect(node.instance().context.client).toEqual(client); + }); }); it('should update props when the client changes', () => { diff --git a/test/client/getDataFromTree.test.tsx b/test/client/getDataFromTree.test.tsx index 55acdc1121..b03976fe83 100644 --- a/test/client/getDataFromTree.test.tsx +++ b/test/client/getDataFromTree.test.tsx @@ -10,6 +10,7 @@ import { getMarkupFromTree, DataValue, ChildProps, + ApolloContext, } from '../../src'; import gql from 'graphql-tag'; const times = require('lodash.times'); @@ -74,9 +75,7 @@ describe('SSR', () => { it('should support passing a root context', () => { class Consumer extends React.Component { - static contextTypes = { - text: PropTypes.string.isRequired, - }; + static contextType = ApolloContext; render() { return
{this.context.text}
; diff --git a/test/client/graphql/mutations/recycled-queries.test.tsx b/test/client/graphql/mutations/recycled-queries.test.tsx index 5366b2412f..6436331494 100644 --- a/test/client/graphql/mutations/recycled-queries.test.tsx +++ b/test/client/graphql/mutations/recycled-queries.test.tsx @@ -430,174 +430,4 @@ describe('graphql(mutation) update queries', () => { }); }, 5); })); - it('will run `refetchQueries` for a recycled queries with string named queries', () => - new Promise((resolve, reject) => { - const mutation: DocumentNode = gql` - mutation createTodo { - createTodo { - id - text - completed - } - } - `; - - const mutationData = { - createTodo: { - id: '99', - text: 'This one was created with a mutation.', - completed: true, - }, - }; - - type MutationData = typeof mutationData; - - const query: DocumentNode = gql` - query todos($id: ID!) { - todo_list(id: $id) { - id - title - tasks { - id - text - completed - } - } - } - `; - - interface QueryData { - todo_list: { - id: string; - title: string; - tasks: { id: string; text: string; completed: boolean }[]; - }; - } - - interface QueryVariables { - id: string; - } - - const data = { - todo_list: { id: '123', title: 'how to apollo', tasks: [] }, - }; - - const updatedData = { - todo_list: { - id: '123', - title: 'how to apollo', - tasks: [mutationData.createTodo], - }, - }; - - const link = mockSingleLink( - { request: { query, variables: { id: '123' } }, result: { data } }, - { request: { query: mutation }, result: { data: mutationData } }, - { - request: { query, variables: { id: '123' } }, - result: { data: updatedData }, - }, - ); - const client = new ApolloClient({ - link, - cache: new Cache({ addTypename: false }), - }); - - let mutate: MutationFn; - - const Mutation = graphql<{}, MutationData>(mutation)( - class extends React.Component> { - componentDidMount() { - mutate = this.props.mutate!; - } - - render() { - return null; - } - }, - ); - - let queryMountCount = 0; - let queryUnmountCount = 0; - let queryRenderCount = 0; - - const Query = graphql(query)( - class extends React.Component> { - componentWillMount() { - queryMountCount++; - } - - componentWillUnmount() { - queryUnmountCount++; - } - - render() { - try { - switch (queryRenderCount++) { - case 0: - expect(this.props.data!.loading).toBeTruthy(); - expect(this.props.data!.todo_list).toBeFalsy(); - break; - case 1: - expect(this.props.data!.loading).toBeFalsy(); - expect(stripSymbols(this.props.data!.todo_list)).toEqual({ - id: '123', - title: 'how to apollo', - tasks: [], - }); - break; - case 2: - expect(queryMountCount).toBe(2); - expect(queryUnmountCount).toBe(1); - expect(stripSymbols(this.props.data!.todo_list)).toEqual(updatedData.todo_list); - break; - case 3: - expect(queryMountCount).toBe(2); - expect(queryUnmountCount).toBe(1); - expect(stripSymbols(this.props.data!.todo_list)).toEqual(updatedData.todo_list); - break; - default: - throw new Error('Rendered too many times'); - } - } catch (error) { - reject(error); - } - return null; - } - }, - ); - - renderer.create( - - - , - ); - - const wrapperQuery1 = renderer.create( - - - , - ); - - setTimeout(() => { - wrapperQuery1.unmount(); - - mutate({ refetchQueries: ['todos'] }) - .then(() => { - setTimeout(() => { - // This re-renders the recycled query that should have been refetched while recycled. - renderer.create( - - - , - ); - resolve(); - }, 5); - }) - .catch(error => { - reject(error); - throw error; - }); - }, 5); - })); }); diff --git a/test/client/graphql/shared-operations.test.tsx b/test/client/graphql/shared-operations.test.tsx index d7307b649e..67f716d9e7 100644 --- a/test/client/graphql/shared-operations.test.tsx +++ b/test/client/graphql/shared-operations.test.tsx @@ -6,6 +6,7 @@ import { InMemoryCache as Cache } from 'apollo-cache-inmemory'; import { ApolloLink } from 'apollo-link'; import * as TestUtils from 'react-dom/test-utils'; import { DocumentNode } from 'graphql'; +import { mount } from 'enzyme'; import { mockSingleLink } from '../../../src/test-utils'; import { compose, ApolloProvider, ChildProps, DataValue, graphql, withApollo } from '../../../src'; @@ -53,13 +54,13 @@ describe('shared operations', () => { const Decorated = withApollo(Container, { withRef: true }); - const tree = TestUtils.renderIntoDocument( + const wrapped = mount( , - ) as any; + ); - const decorated = TestUtils.findRenderedComponentWithType(tree, Decorated); + const decorated = wrapped.find(Decorated).instance(); expect(() => (decorated as any).someMethod()).toThrow(); expect((decorated as any).getWrappedInstance().someMethod()).toEqual(testData); @@ -70,17 +71,14 @@ describe('shared operations', () => { skip: true, }); - const treeWithSkip = TestUtils.renderIntoDocument( + const treeWithSkip = mount( , - ) as any; - - const decoratedWithSkip = TestUtils.findRenderedComponentWithType( - treeWithSkip, - DecoratedWithSkip, ); + const decoratedWithSkip = treeWithSkip.find(DecoratedWithSkip).instance(); + expect(() => (decoratedWithSkip as any).someMethod()).toThrow(); expect((decoratedWithSkip as any).getWrappedInstance().someMethod()).toEqual(testData); expect((decoratedWithSkip as any).wrappedInstance.someMethod()).toEqual(testData); @@ -336,13 +334,13 @@ describe('shared operations', () => { const Decorated = graphql(query, { withRef: true })(Container); - const tree = TestUtils.renderIntoDocument( + const wrapped = mount( , - ) as any; + ); - const decorated = TestUtils.findRenderedComponentWithType(tree, Decorated); + const decorated = wrapped.find(Decorated).instance(); expect(() => (decorated as any).someMethod()).toThrow(); expect((decorated as any).getWrappedInstance().someMethod()).toEqual(testData); @@ -350,17 +348,14 @@ describe('shared operations', () => { const DecoratedWithSkip = graphql(query, { withRef: true, skip: true })(Container); - const treeWithSkip = TestUtils.renderIntoDocument( + const treeWithSkip = mount( , - ) as any; - - const decoratedWithSkip = TestUtils.findRenderedComponentWithType( - treeWithSkip, - DecoratedWithSkip, ); + const decoratedWithSkip = treeWithSkip.find(DecoratedWithSkip).instance(); + expect(() => (decoratedWithSkip as any).someMethod()).toThrow(); expect((decoratedWithSkip as any).getWrappedInstance().someMethod()).toEqual(testData); expect((decoratedWithSkip as any).wrappedInstance.someMethod()).toEqual(testData); From 5c72f51612d158eb66162843615173445cecf4fc Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Fri, 22 Mar 2019 10:53:59 -0400 Subject: [PATCH 008/113] Remove all disabled tests Since we've been running with them disabled for quite some time, let's get rid of them. --- .../client/graphql/mutations/queries.test.tsx | 190 --------------- .../graphql/queries/observableQuery.test.tsx | 225 ------------------ 2 files changed, 415 deletions(-) diff --git a/test/client/graphql/mutations/queries.test.tsx b/test/client/graphql/mutations/queries.test.tsx index ca486a77c1..a787f7e912 100644 --- a/test/client/graphql/mutations/queries.test.tsx +++ b/test/client/graphql/mutations/queries.test.tsx @@ -298,194 +298,4 @@ describe('graphql(mutation) query integration', () => { , ); }); - // this test is flaky, find out why and turn it back on - xit('handles refetchingQueries after a mutation', done => { - // reproduction of query from Apollo Engine - const accountId = '1234'; - - const billingInfoQuery: DocumentNode = gql` - query Account__PaymentDetailQuery($accountId: ID!) { - account(id: $accountId) { - id - currentPlan { - id - name - } - } - } - `; - - const overlappingQuery: DocumentNode = gql` - query Account__PaymentQuery($accountId: ID!) { - account(id: $accountId) { - id - currentPlan { - id - name - } - } - } - `; - - const data1 = { - account: { - id: accountId, - currentPlan: { - id: 'engine-77', - name: 'Utility', - }, - }, - }; - const data2 = { - account: { - id: accountId, - currentPlan: { - id: 'engine-78', - name: 'Free', - }, - }, - }; - - type QueryData = typeof data1; - - interface QueryVariables { - accountId: string; - } - - const setPlanMutation: DocumentNode = gql` - mutation Account__SetPlanMutation($accountId: ID!, $planId: ID!) { - accountSetPlan(accountId: $accountId, planId: $planId) - } - `; - - const mutationData = { - accountSetPlan: true, - }; - - type MutationData = typeof mutationData; - - interface MutationVariables { - accountId: string; - planId: string; - } - - const variables = { - accountId, - }; - - const link = mockSingleLink( - { - request: { query: billingInfoQuery, variables }, - result: { data: data1 }, - }, - { - request: { query: overlappingQuery, variables }, - result: { data: data1 }, - }, - { - request: { - query: setPlanMutation, - variables: { accountId, planId: 'engine-78' }, - }, - result: { data: mutationData }, - }, - { - request: { query: billingInfoQuery, variables }, - result: { data: data2 }, - }, - ); - const cache = new Cache({ addTypename: false }); - const client = new ApolloClient({ link, cache }); - - class Boundary extends React.Component { - componentDidCatch(e: any) { - done.fail(e); - } - render() { - return this.props.children; - } - } - - let refetched = false; - class RelatedUIComponent extends React.Component> { - componentWillReceiveProps(props: ChildProps<{}, QueryData, QueryVariables>) { - if (refetched) { - expect(props.data!.account!.currentPlan.name).toBe('Free'); - done(); - } - } - render() { - return this.props.children; - } - } - - const RelatedUIComponentWithData = graphql<{}, QueryData, QueryVariables>(overlappingQuery, { - options: { variables: { accountId } }, - })(RelatedUIComponent); - - const withQuery = graphql<{}, QueryData, QueryVariables>(billingInfoQuery, { - options: { variables: { accountId } }, - }); - type WithQueryChildProps = ChildProps<{}, QueryData, QueryVariables>; - - const withMutation = graphql( - setPlanMutation, - ); - type WithMutationChildProps = ChildProps; - - let count = 0; - class PaymentDetail extends React.Component { - componentWillReceiveProps(props: WithMutationChildProps) { - if (count === 1) { - expect(props.data!.account!.currentPlan.name).toBe('Free'); - done(); - } - count++; - } - async onPaymentInfoChanged() { - try { - refetched = true; - await this.props.mutate!({ - refetchQueries: [ - { - query: billingInfoQuery, - variables: { - accountId, - }, - }, - ], - variables: { - accountId, - planId: 'engine-78', - }, - }); - } catch (e) { - done.fail(e); - } - } - - componentDidMount() { - setTimeout(() => { - // trigger mutation and future updates - this.onPaymentInfoChanged(); - }, 10); - } - - render() { - return null; - } - } - - const PaymentDetailWithData = withQuery(withMutation(PaymentDetail)); - - renderer.create( - - - - - - - , - ); - }); }); diff --git a/test/client/graphql/queries/observableQuery.test.tsx b/test/client/graphql/queries/observableQuery.test.tsx index ccc2563914..9bba1c7fc0 100644 --- a/test/client/graphql/queries/observableQuery.test.tsx +++ b/test/client/graphql/queries/observableQuery.test.tsx @@ -149,231 +149,6 @@ describe('[queries] observableQuery', () => { ); }); - xit('will not try to refetch recycled `ObservableQuery`s when resetting the client store', done => { - const query: DocumentNode = gql` - query people { - allPeople(first: 1) { - people { - name - } - } - } - `; - - let finish = () => {}; // tslint:disable-line - let called = 0; - const link = new ApolloLink((o, f) => { - called++; - setTimeout(finish, 5); - return f ? f(o) : null; - }).concat( - mockSingleLink({ - request: { query }, - result: { data: { allPeople: null } }, - }), - ); - const client = new ApolloClient({ - link, - cache: new Cache({ addTypename: false }), - }); - - // make sure that the in flight query is done before resetting store - finish = () => { - client.resetStore(); - - // The query should not have been fetch again - expect(called).toBe(1); - - done(); - }; - - const Container = graphql(query)( - class extends React.Component { - render() { - return null; - } - }, - ); - - const wrapper1 = renderer.create( - - - , - ); - - // let keys = Array.from((client.queryManager as any).queries.keys()); - // expect(keys).toEqual(['1']); - // const queryObservable1 = (client.queryManager as any).queries.get('1') - // .observableQuery; - - // The query should only have been invoked when first mounting and not when resetting store - expect(called).toBe(1); - - wrapper1.unmount(); - - // keys = Array.from((client.queryManager as any).queries.keys()); - // expect(keys).toEqual(['1']); - // const queryObservable2 = (client.queryManager as any).queries.get('1') - // .observableQuery; - - // expect(queryObservable1).toBe(queryObservable2); - }); - - xit('will recycle `ObservableQuery`s when re-rendering a portion of the tree', done => { - const query: DocumentNode = gql` - query people { - allPeople(first: 1) { - people { - name - } - } - } - `; - const data = { allPeople: { people: [{ name: 'Luke Skywalker' }] } }; - - const link = mockSingleLink( - { request: { query }, result: { data } }, - { request: { query }, result: { data } }, - ); - const client = new ApolloClient({ - link, - cache: new Cache({ addTypename: false }), - }); - let remount: any; - - class Remounter extends React.Component { - state = { - showChildren: true, - }; - - componentDidMount() { - remount = () => { - this.setState({ showChildren: false }, () => { - setTimeout(() => { - this.setState({ showChildren: true }); - }, 5); - }); - }; - } - - render() { - return this.state.showChildren ? this.props.children : null; - } - } - - const Container = graphql(query)( - class extends React.Component { - render() { - return null; - } - }, - ); - - const wrapper = renderer.create( - - - - - , - ); - - // let keys = Array.from((client.queryManager as any).queries.keys()); - // expect(keys).toEqual(['1']); - // const queryObservable1 = (client.queryManager as any).queries.get('1') - // .observableQuery; - - remount(); - - setTimeout(() => { - // keys = Array.from((client.queryManager as any).queries.keys()); - // expect(keys).toEqual(['1']); - // const queryObservable2 = (client.queryManager as any).queries.get('1') - // .observableQuery; - // expect(queryObservable1).toBe(queryObservable2); - - remount(); - - setTimeout(() => { - // keys = Array.from((client.queryManager as any).queries.keys()); - // expect(keys).toEqual(['1']); - // const queryObservable3 = (client.queryManager as any).queries.get('1') - // .observableQuery; - // expect(queryObservable1).toBe(queryObservable3); - - wrapper.unmount(); - done(); - }, 10); - }, 10); - }); - - xit('will not recycle parallel GraphQL container `ObservableQuery`s', done => { - const query: DocumentNode = gql` - query people { - allPeople(first: 1) { - people { - name - } - } - } - `; - const data = { allPeople: { people: [{ name: 'Luke Skywalker' }] } }; - const link = mockSingleLink( - { request: { query }, result: { data } }, - { request: { query }, result: { data } }, - ); - const client = new ApolloClient({ - link, - cache: new Cache({ addTypename: false }), - }); - let remount: any; - - class Remounter extends React.Component { - state = { - showChildren: true, - }; - - componentDidMount() { - remount = () => { - this.setState({ showChildren: false }, () => { - setTimeout(() => { - this.setState({ showChildren: true }); - }, 5); - }); - }; - } - - render() { - return this.state.showChildren ? this.props.children : null; - } - } - - const Container = graphql(query)( - class extends React.Component { - render() { - return null; - } - }, - ); - - const wrapper = renderer.create( - -
- - - - -
-
, - ); - - remount(); - - setTimeout(() => { - wrapper.unmount(); - done(); - }, 10); - }); - it("will recycle `ObservableQuery`s when re-rendering a portion of the tree but not return stale data if variables don't match", done => { const query: DocumentNode = gql` query people($first: Int!) { From abe2503eca28e3d6688a03547114353b37d60f87 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Mon, 25 Mar 2019 01:41:08 +0100 Subject: [PATCH 009/113] Create useApolloClient.ts (#2872) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Create useApolloClient.ts * Update index.ts * Import react, duh * Add semi (👀) * Throw on old React * Fix typecheck * chore(deps): update dependency @types/enzyme to v3.9.1 * chore(deps): update dependency react-testing-library to v6.0.2 * chore(deps): update dependency rollup to v1.7.0 * chore(deps): update dependency rollup-plugin-replace to v2.1.1 * chore(deps): update dependency typescript to v3.3.4000 * Adjust `useApolloClient` to return the `client` only We don't necessarily want to expose the entire `ApolloContext`. * Changelog updates --- Changelog.md | 10 ++++++++++ examples/components/package.json | 2 +- examples/mutation/package.json | 2 +- examples/rollup/package-lock.json | 23 +++++++++++------------ examples/rollup/package.json | 4 ++-- examples/typescript/package.json | 2 +- package-lock.json | 18 +++++++++--------- package.json | 6 +++--- src/ApolloContext.ts | 3 +-- src/index.ts | 2 ++ src/useApolloClient.ts | 14 ++++++++++++++ 11 files changed, 55 insertions(+), 31 deletions(-) create mode 100644 src/useApolloClient.ts diff --git a/Changelog.md b/Changelog.md index eedb8e58c4..5eb02b5ce0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,15 @@ # Change log +## 3.0.0 + +### Improvements + +- `useApolloClient` can be used to return an `ApolloClient` instance from + React Apollo's context, assuming it was previously set using + `ApolloProvider`.
+ [@FredyC](https://github.com/FredyC) in [#2872](https://github.com/apollographql/react-apollo/pull/2872) + + ## vNEXT ### Bug Fixes diff --git a/examples/components/package.json b/examples/components/package.json index 325b5a5ea8..61acb2dac4 100644 --- a/examples/components/package.json +++ b/examples/components/package.json @@ -17,7 +17,7 @@ "eject": "react-scripts eject" }, "devDependencies": { - "react-testing-library": "6.0.0" + "react-testing-library": "6.0.2" }, "browserslist": [ ">0.2%", diff --git a/examples/mutation/package.json b/examples/mutation/package.json index 5e261a133c..4980f1181d 100644 --- a/examples/mutation/package.json +++ b/examples/mutation/package.json @@ -17,7 +17,7 @@ "eject": "react-scripts eject" }, "devDependencies": { - "react-testing-library": "6.0.0" + "react-testing-library": "6.0.2" }, "browserslist": [ ">0.2%", diff --git a/examples/rollup/package-lock.json b/examples/rollup/package-lock.json index edb7d02f9b..1835e78ace 100644 --- a/examples/rollup/package-lock.json +++ b/examples/rollup/package-lock.json @@ -128,9 +128,9 @@ "dev": true }, "@types/node": { - "version": "11.11.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.3.tgz", - "integrity": "sha512-wp6IOGu1lxsfnrD+5mX6qwSwWuqsdkKKxTN4aQc4wByHAKZJf9/D4KXPQ1POUjEbnCP5LMggB0OEFNY9OTsMqg==", + "version": "11.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", + "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==", "dev": true }, "@types/zen-observable": { @@ -1896,9 +1896,9 @@ } }, "rollup": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.6.0.tgz", - "integrity": "sha512-qu9iWyuiOxAuBM8cAwLuqPclYdarIpayrkfQB7aTGTiyYPbvx+qVF33sIznfq4bxZCiytQux/FvZieUBAXivCw==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.7.0.tgz", + "integrity": "sha512-hjuWSCgoQsFSTsmsNP4AH1l1kfkFqW82gW00V9nL81Zr3JtnKn3rvxh18jUAAEMb7qNoHj21PR5SqbK2mhBgMg==", "dev": true, "requires": { "@types/estree": "0.0.39", @@ -1986,14 +1986,13 @@ } }, "rollup-plugin-replace": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-replace/-/rollup-plugin-replace-2.1.0.tgz", - "integrity": "sha512-SxrAIgpH/B5/W4SeULgreOemxcpEgKs2gcD42zXw50bhqGWmcnlXneVInQpAqzA/cIly4bJrOpeelmB9p4YXSQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-replace/-/rollup-plugin-replace-2.1.1.tgz", + "integrity": "sha512-IS5ZYBb3px0UfbDCYzKaKxelLd5dbPHhfplEXbymfvGlz9Ok44At4AjTOWe2qEax73bE8+pnMZN9C7PcVpFNlw==", "dev": true, "requires": { - "magic-string": "^0.25.1", - "minimatch": "^3.0.2", - "rollup-pluginutils": "^2.0.1" + "magic-string": "^0.25.2", + "rollup-pluginutils": "^2.4.1" } }, "rollup-plugin-terser": { diff --git a/examples/rollup/package.json b/examples/rollup/package.json index a8d4371514..f02effb5fb 100644 --- a/examples/rollup/package.json +++ b/examples/rollup/package.json @@ -8,12 +8,12 @@ }, "devDependencies": { "@babel/preset-react": "7.0.0", - "rollup": "1.6.0", + "rollup": "1.7.0", "rollup-plugin-babel": "4.3.2", "rollup-plugin-commonjs": "9.2.1", "rollup-plugin-jsx": "1.0.3", "rollup-plugin-node-resolve": "4.0.1", - "rollup-plugin-replace": "2.1.0", + "rollup-plugin-replace": "2.1.1", "rollup-plugin-terser": "4.0.4", "source-map-explorer": "1.8.0" }, diff --git a/examples/typescript/package.json b/examples/typescript/package.json index e9d2f6f847..fd746c5350 100644 --- a/examples/typescript/package.json +++ b/examples/typescript/package.json @@ -22,7 +22,7 @@ "apollo-codegen": "0.20.2", "react-scripts-ts": "3.1.0", "react-test-renderer": "16.8.1", - "typescript": "3.1.6" + "typescript": "3.3.4000" }, "scripts": { "start": "react-scripts-ts start", diff --git a/package-lock.json b/package-lock.json index d183bbc4f4..9b3b079d2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -742,9 +742,9 @@ } }, "@types/enzyme": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@types/enzyme/-/enzyme-3.9.0.tgz", - "integrity": "sha512-o0C7ooyBtj9NKyMzn2BWN53W4J21KPhO+/v+qqQX28Pcz0Z1B3DjL9bq2ZR4TN70PVw8O7gkhuFtC7VN3tausg==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@types/enzyme/-/enzyme-3.9.1.tgz", + "integrity": "sha512-CasnOP73BFE3/5JvGkod+oQtGOD1+CVWz9BV2iAqDFJ+sofL5gTiizSr8ZM3lpDY27ptC8yjAdrUCdv8diKKqw==", "dev": true, "requires": { "@types/cheerio": "*", @@ -7926,9 +7926,9 @@ } }, "rollup": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.6.0.tgz", - "integrity": "sha512-qu9iWyuiOxAuBM8cAwLuqPclYdarIpayrkfQB7aTGTiyYPbvx+qVF33sIznfq4bxZCiytQux/FvZieUBAXivCw==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.7.0.tgz", + "integrity": "sha512-hjuWSCgoQsFSTsmsNP4AH1l1kfkFqW82gW00V9nL81Zr3JtnKn3rvxh18jUAAEMb7qNoHj21PR5SqbK2mhBgMg==", "dev": true, "requires": { "@types/estree": "0.0.39", @@ -9152,9 +9152,9 @@ } }, "typescript": { - "version": "3.3.3333", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3333.tgz", - "integrity": "sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==", + "version": "3.3.4000", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", + "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", "dev": true }, "typescript-require": { diff --git a/package.json b/package.json index 8f0919f4ee..7783fce69b 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ }, "sideEffects": false, "devDependencies": { - "@types/enzyme": "3.9.0", + "@types/enzyme": "3.9.1", "@types/enzyme-adapter-react-16": "1.0.5", "@types/graphql": "14.0.7", "@types/hoist-non-react-statics": "3.3.0", @@ -144,7 +144,7 @@ "recompose": "0.30.0", "recursive-rename": "2.0.0", "rimraf": "2.6.3", - "rollup": "1.6.0", + "rollup": "1.7.0", "rollup-plugin-commonjs": "9.2.1", "rollup-plugin-filesize": "6.0.1", "rollup-plugin-invariant": "0.4.2", @@ -154,7 +154,7 @@ "ts-jest": "24.0.0", "tsc-watch": "2.1.2", "tslint": "5.14.0", - "typescript": "3.3.3333", + "typescript": "3.3.4000", "typescript-require": "0.2.10", "zen-observable-ts": "0.8.18" }, diff --git a/src/ApolloContext.ts b/src/ApolloContext.ts index 4e6cd314f6..9ae703c296 100644 --- a/src/ApolloContext.ts +++ b/src/ApolloContext.ts @@ -8,5 +8,4 @@ export interface ApolloContextValue { renderPromises?: RenderPromises; } -export const ApolloContext = - React.createContext({}); +export const ApolloContext = React.createContext({}); diff --git a/src/index.ts b/src/index.ts index a5cb60a58b..90488c9d27 100644 --- a/src/index.ts +++ b/src/index.ts @@ -20,6 +20,8 @@ export { withQuery } from './query-hoc'; export { withMutation } from './mutation-hoc'; export { withSubscription } from './subscription-hoc'; +export { useApolloClient } from './useApolloClient'; + export { default as withApollo } from './withApollo'; export * from './withApollo'; diff --git a/src/useApolloClient.ts b/src/useApolloClient.ts new file mode 100644 index 0000000000..3c9d747d3a --- /dev/null +++ b/src/useApolloClient.ts @@ -0,0 +1,14 @@ +import React from 'react'; +import { invariant } from 'ts-invariant'; + +import { ApolloContext } from './ApolloContext'; + +export function useApolloClient() { + const { client } = React.useContext(ApolloContext); + invariant( + !client, + 'No Apollo Client instance can be found. Please ensure that you ' + + 'have called `ApolloProvider` higher up in your tree.', + ); + return client; +} From cfd22bbdf342201ca50ac534083fc0a3642011e5 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Mon, 8 Apr 2019 10:39:33 -0400 Subject: [PATCH 010/113] Remove deprecated React lifecyle method use from Apollo Components This commit removes the use of deprecated React lifecycle methods (`componentWillMount`, `componentWillUpdate`, `componentWillReceiveProps`) from the `Query`, `Mutation` and `Subscription` Apollo components. This is a stepping stone towards more extensive `react-apollo` refactoring, as we move away from using React classes internally (making future React Hook use / integration easier). --- src/ApolloConsumer.tsx | 32 +- src/ApolloContext.ts | 13 +- src/ApolloProvider.tsx | 3 +- src/Mutation.tsx | 53 +-- src/Query.tsx | 407 ++++++++---------- src/Subscriptions.tsx | 112 ++--- src/getDataFromTree.ts | 9 +- src/index.ts | 2 +- src/useApolloClient.ts | 4 +- test/client/ApolloConsumer.test.tsx | 3 +- test/client/ApolloProvider.test.tsx | 5 +- test/client/Mutation.test.tsx | 116 +++-- test/client/Query.test.tsx | 2 +- test/client/Subscription.test.tsx | 1 - test/client/getDataFromTree.test.tsx | 10 +- .../mutations/recycled-queries.test.tsx | 37 +- test/client/graphql/queries/api.test.tsx | 7 +- .../client/graphql/queries/lifecycle.test.tsx | 12 - test/client/graphql/queries/loading.test.tsx | 113 +++-- .../graphql/queries/observableQuery.test.tsx | 43 +- test/client/graphql/queries/skip.test.tsx | 17 +- .../graphql/queries/updateQuery.test.tsx | 21 +- 22 files changed, 463 insertions(+), 559 deletions(-) diff --git a/src/ApolloConsumer.tsx b/src/ApolloConsumer.tsx index d68eb0a697..7f66979e35 100644 --- a/src/ApolloConsumer.tsx +++ b/src/ApolloConsumer.tsx @@ -2,24 +2,28 @@ import * as React from 'react'; import ApolloClient from 'apollo-client'; import { InvariantError } from 'ts-invariant'; -import { ApolloContext } from './ApolloContext'; +import { getApolloContext } from './ApolloContext'; export interface ApolloConsumerProps { children: (client: ApolloClient) => React.ReactElement | null; } -const ApolloConsumer: React.FC = props => ( - - {(context: any) => { - if (!context || !context.client) { - throw new InvariantError( - 'Could not find "client" in the context of ApolloConsumer. ' + - 'Wrap the root component in an .' - ); - } - return props.children(context.client); - }} - -); + +const ApolloConsumer: React.FC = (props) => { + const ApolloContext = getApolloContext(); + return ( + + {(context: any) => { + if (!context || !context.client) { + throw new InvariantError( + 'Could not find "client" in the context of ApolloConsumer. ' + + 'Wrap the root component in an .' + ); + } + return props.children(context.client); + }} + + ); +}; export default ApolloConsumer; diff --git a/src/ApolloContext.ts b/src/ApolloContext.ts index 9ae703c296..e6b9a13ba1 100644 --- a/src/ApolloContext.ts +++ b/src/ApolloContext.ts @@ -8,4 +8,15 @@ export interface ApolloContextValue { renderPromises?: RenderPromises; } -export const ApolloContext = React.createContext({}); +let apolloContext: React.Context; + +export function getApolloContext() { + if (!apolloContext) { + apolloContext = React.createContext({}); + } + return apolloContext; +} + +export function resetApolloContext() { + apolloContext = React.createContext({}); +} diff --git a/src/ApolloProvider.tsx b/src/ApolloProvider.tsx index 34626593bd..5bfe5d061b 100644 --- a/src/ApolloProvider.tsx +++ b/src/ApolloProvider.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import ApolloClient from 'apollo-client'; import { invariant } from 'ts-invariant'; -import { ApolloContext } from './ApolloContext'; +import { getApolloContext } from './ApolloContext'; export interface ApolloProviderProps { client: ApolloClient; @@ -11,6 +11,7 @@ export interface ApolloProviderProps { const ApolloProvider: React.FC> = ({ client, children }) => { + const ApolloContext = getApolloContext(); return ( {(context = {}) => { diff --git a/src/Mutation.tsx b/src/Mutation.tsx index 96bf6a4ccf..ad4cb00bd2 100644 --- a/src/Mutation.tsx +++ b/src/Mutation.tsx @@ -5,11 +5,10 @@ import { DataProxy } from 'apollo-cache'; import { invariant } from 'ts-invariant'; import { DocumentNode, GraphQLError } from 'graphql'; -import shallowEqual from './utils/shallowEqual'; import { OperationVariables, RefetchQueriesProviderFn } from './types'; import { parser, DocumentType } from './parser'; import { getClient } from './component-utils'; -import { ApolloContext, ApolloContextValue } from './ApolloContext'; +import { getApolloContext, ApolloContextValue } from './ApolloContext'; export interface MutationResult> { data?: TData; @@ -25,7 +24,6 @@ export interface ExecutionResult> { errors?: GraphQLError[]; } -// Improved MutationUpdaterFn type, need to port them back to Apollo Client export declare type MutationUpdaterFn< T = { [key: string]: any; @@ -79,23 +77,16 @@ export interface MutationProps { export interface MutationState { called: boolean; + loading: boolean; error?: ApolloError; data?: TData; - loading: boolean; } -const initialState = { - loading: false, - called: false, - error: undefined, - data: undefined, -}; - class Mutation extends React.Component< MutationProps, MutationState > { - static contextType = ApolloContext; + static contextType = getApolloContext(); static propTypes = { mutation: PropTypes.object.isRequired, @@ -113,9 +104,7 @@ class Mutation extends React.Compo fetchPolicy: PropTypes.string, }; - private client: ApolloClient; private mostRecentMutationId: number; - private hasMounted: boolean = false; constructor( @@ -123,34 +112,26 @@ class Mutation extends React.Compo context: ApolloContextValue, ) { super(props, context); - this.client = getClient(props, context); this.verifyDocumentIsMutation(props.mutation); this.mostRecentMutationId = 0; - this.state = initialState; + this.state = { + called: false, + loading: false, + }; } componentDidMount() { this.hasMounted = true; } - componentWillUnmount() { - this.hasMounted = false; - } - - componentWillReceiveProps(nextProps: MutationProps) { - const nextClient = getClient(nextProps, this.context); - if (shallowEqual(this.props, nextProps) && this.client === nextClient) { - return; - } - - if (this.props.mutation !== nextProps.mutation) { - this.verifyDocumentIsMutation(nextProps.mutation); + componentDidUpdate(prevProps: MutationProps) { + if (this.props.mutation !== prevProps.mutation) { + this.verifyDocumentIsMutation(this.props.mutation); } + } - if (this.client !== nextClient) { - this.client = nextClient; - this.setState(initialState); - } + componentWillUnmount() { + this.hasMounted = false; } render() { @@ -162,7 +143,7 @@ class Mutation extends React.Compo loading, data, error, - client: this.client, + client: this.currentClient(), }; return children(this.runMutation, result); @@ -199,7 +180,7 @@ class Mutation extends React.Compo const mutateVariables = Object.assign({}, variables, mutateOptions.variables); delete mutateOptions.variables; - return this.client.mutate({ + return this.currentClient().mutate({ mutation, optimisticResponse, refetchQueries, @@ -268,6 +249,10 @@ class Mutation extends React.Compo }.`, ); }; + + private currentClient() { + return getClient(this.props, this.context); + } } export default Mutation; diff --git a/src/Query.tsx b/src/Query.tsx index ed989faa11..ff5b9b4574 100644 --- a/src/Query.tsx +++ b/src/Query.tsx @@ -11,10 +11,10 @@ import ApolloClient, { import { DocumentNode } from 'graphql'; import { ZenObservable } from 'zen-observable-ts'; -import { OperationVariables, QueryControls, QueryOpts } from './types'; +import { OperationVariables, QueryOpts } from './types'; import { parser, DocumentType, IDocumentDefinition } from './parser'; import { getClient } from './component-utils'; -import { ApolloContext, ApolloContextValue } from './ApolloContext'; +import { getApolloContext, ApolloContextValue } from './ApolloContext'; import isEqual from 'lodash.isequal'; import shallowEqual from './utils/shallowEqual'; import { invariant } from 'ts-invariant'; @@ -53,14 +53,6 @@ function observableQueryFields( export interface QueryResult extends ObservableQueryFields { client: ApolloClient; - // we create an empty object to make checking for data - // easier for consumers (i.e. instead of data && data.user - // you can just check data.user) this also makes destructring - // easier (i.e. { data: { user } }) - // however, this isn't realy possible with TypeScript that - // I'm aware of. So intead we enforce checking for data - // like so result.data!.user. This tells TS to use TData - // XXX is there a better way to do this? data: TData | undefined; error?: ApolloError; loading: boolean; @@ -79,8 +71,6 @@ export interface QueryProps extend export default class Query extends React.Component< QueryProps > { - static contextType = ApolloContext; - static propTypes = { client: PropTypes.object, children: PropTypes.func.isRequired, @@ -95,35 +85,56 @@ export default class Query extends partialRefetch: PropTypes.bool, }; - private client: ApolloClient; - - // request / action storage. Note that we delete querySubscription if we - // unsubscribe but never delete queryObservable once it is created. We - // only delete queryObservable when we unmount the component. - private queryObservable?: ObservableQuery | null; - private querySubscription?: ZenObservable.Subscription; - private previousData: any = {}; - private refetcherQueue?: { - args: any; - resolve: (value?: any | PromiseLike) => void; - reject: (reason?: any) => void; - }; + private previousClient?: ApolloClient; + // Note that we delete `observableQuerySubscription` if we unsubscribe but + // never delete `observableQuery` once it is created. We only delete + // `observableQuery` when we unmount the component. + private observableQuery?: ObservableQuery | null; + private observableQuerySubscription?: ZenObservable.Subscription; + + private previousQuery?: DocumentNode; private hasMounted: boolean = false; private operation?: IDocumentDefinition; - private lastResult: ApolloQueryResult | null = null; + private previousOptions: {} | null = null; + private previousResult: ApolloQueryResult | null = null; - constructor( - props: QueryProps, - context: ApolloContextValue, - ) { - super(props, context); - this.client = getClient(props, context); - this.initializeQueryObservable(props); + componentDidMount() { + this.hasMounted = true; + } + + componentDidUpdate(prevProps: QueryProps) { + const isDiffRequest = + !isEqual(prevProps.query, this.props.query) || + !isEqual(prevProps.variables, this.props.variables); + if (isDiffRequest) { + // If specified, `onError` / `onCompleted` callbacks are called here + // after local cache results are loaded. + this.handleErrorOrCompleted(); + } + } + + componentWillUnmount() { + this.removeQuerySubscription(); + this.hasMounted = false; + } + + render(): React.ReactNode { + const ApolloContext = getApolloContext(); + return ( + + {(context: ApolloContextValue) => { + return this.renderData(context); + }} + + ); } // For server-side rendering (see getDataFromTree.ts) - fetchData(): Promise> | boolean { + fetchData( + client: ApolloClient, + context: ApolloContextValue, + ): Promise> | boolean { if (this.props.skip) return false; // pull off react options @@ -132,7 +143,6 @@ export default class Query extends ssr, displayName, skip, - client, onCompleted, onError, partialRefetch, @@ -145,89 +155,20 @@ export default class Query extends fetchPolicy = 'cache-first'; // ignore force fetch in SSR; } - const observable = this.client.watchQuery({ + const observable = client.watchQuery({ ...opts, fetchPolicy, }); // Register the SSR observable, so it can be re-used once the value comes back. - if (this.context && this.context.renderPromises) { - this.context.renderPromises.registerSSRObservable(this, observable); + if (context && context.renderPromises) { + context.renderPromises.registerSSRObservable(this, observable); } - const result = this.queryObservable!.currentResult(); - + const result = this.observableQuery!.getCurrentResult(); return result.loading ? observable.result() : false; } - componentDidMount() { - this.hasMounted = true; - if (this.props.skip) return; - - this.startQuerySubscription(true); - if (this.refetcherQueue) { - const { args, resolve, reject } = this.refetcherQueue; - this.queryObservable!.refetch(args) - .then(resolve) - .catch(reject); - } - } - - componentWillReceiveProps(nextProps: QueryProps) { - // the next render wants to skip - if (nextProps.skip && !this.props.skip) { - this.removeQuerySubscription(); - return; - } - - const nextClient = getClient(nextProps, this.context); - - if (shallowEqual(this.props, nextProps) && this.client === nextClient) { - return; - } - - if (this.client !== nextClient) { - this.client = nextClient; - this.removeQuerySubscription(); - this.queryObservable = null; - this.previousData = {}; - this.updateQuery(nextProps); - } - - if (this.props.query !== nextProps.query) { - this.removeQuerySubscription(); - } - - this.updateQuery(nextProps); - if (nextProps.skip) return; - this.startQuerySubscription(); - } - - componentWillUnmount() { - this.removeQuerySubscription(); - this.hasMounted = false; - } - - componentDidUpdate(prevProps: QueryProps) { - const isDiffRequest = - !isEqual(prevProps.query, this.props.query) || - !isEqual(prevProps.variables, this.props.variables); - if (isDiffRequest) { - // If specified, `onError` / `onCompleted` callbacks are called here - // after local cache results are loaded. - this.handleErrorOrCompleted(); - } - } - - render(): React.ReactNode { - const { context } = this; - const finish = () => this.props.children(this.getQueryResult()); - if (context && context.renderPromises) { - return context.renderPromises.addQueryPromise(this, finish); - } - return finish(); - } - private extractOptsFromProps(props: QueryProps) { this.operation = parser(props.query); @@ -248,91 +189,76 @@ export default class Query extends }; } - private initializeQueryObservable(props: QueryProps) { - const opts = this.extractOptsFromProps(props); - + private initializeObservableQuery( + client: ApolloClient, + props: QueryProps, + context: ApolloContextValue, + ) { // See if there is an existing observable that was used to fetch the same data and // if so, use it instead since it will contain the proper queryId to fetch // the result set. This is used during SSR. - if (this.context && this.context.renderPromises) { - this.queryObservable = this.context.renderPromises.getSSRObservable(this); + if (context && context.renderPromises) { + this.observableQuery = context.renderPromises.getSSRObservable(this); } - if (!this.queryObservable) { - this.queryObservable = this.client.watchQuery(opts); + + if (!this.observableQuery) { + const options = this.extractOptsFromProps(props); + this.previousOptions = { ...options, children: null }; + this.observableQuery = client.watchQuery(options); } } - private updateQuery(props: QueryProps) { + private updateObservableQuery( + client: ApolloClient, + context: ApolloContextValue, + ) { // if we skipped initially, we may not have yet created the observable - if (!this.queryObservable) { - this.initializeQueryObservable(props); + if (!this.observableQuery) { + this.initializeObservableQuery(client, this.props, context); } - this.queryObservable!.setOptions(this.extractOptsFromProps(props)) - // The error will be passed to the child container, so we don't - // need to log it here. We could conceivably log something if - // an option was set. OTOH we don't log errors w/ the original - // query. See https://github.com/apollostack/react-apollo/issues/404 - .catch(() => null); - } + const newOptions = { + ...this.extractOptsFromProps(this.props), + children: null, + }; - private startQuerySubscription = (justMounted: boolean = false) => { - // When the `Query` component receives new props, or when we explicitly - // re-subscribe to a query using `resubscribeToQuery`, we start a new - // subscription in this method. To avoid un-necessary re-renders when - // receiving new props or re-subscribing, we track the full last - // observable result so it can be compared against incoming new data. - // We only trigger a re-render if the incoming result is different than - // the stored `lastResult`. - // - // It's important to note that when a component is first mounted, - // the `startQuerySubscription` method is also triggered. During a first - // mount, we don't want to store or use the last result, as we always - // need the first render to happen, even if there was a previous last - // result (which can happen when the same component is mounted, unmounted, - // and mounted again). - if (!justMounted) { - this.lastResult = this.queryObservable!.getLastResult(); + if (!isEqual(newOptions, this.previousOptions)) { + this.previousOptions = newOptions; + this.observableQuery!.setOptions(newOptions) + // The error will be passed to the child container, so we don't + // need to log it here. We could conceivably log something if + // an option was set. OTOH we don't log errors w/ the original + // query. See https://github.com/apollostack/react-apollo/issues/404 + .catch(() => null); } + } - if (this.querySubscription) return; - - // store the initial renders worth of result - let initial: QueryResult | undefined = this.getQueryResult(); + private startQuerySubscription = (client: ApolloClient) => { + if (this.observableQuerySubscription) return; - this.querySubscription = this.queryObservable!.subscribe({ + this.observableQuerySubscription = this.observableQuery!.subscribe({ next: ({ loading, networkStatus, data }) => { - // to prevent a quick second render from the subscriber - // we compare to see if the original started finished (from cache) and is unchanged - if (initial && initial.networkStatus === 7 && shallowEqual(initial.data, data)) { - initial = undefined; - return; - } - + const { previousResult } = this; if ( - this.lastResult && - this.lastResult.loading === loading && - this.lastResult.networkStatus === networkStatus && - shallowEqual(this.lastResult.data, data) + previousResult && + previousResult.loading === loading && + previousResult.networkStatus === networkStatus && + shallowEqual(previousResult.data, data || {}) ) { return; } - initial = undefined; - if (this.lastResult) { - this.lastResult = this.queryObservable!.getLastResult(); - } this.updateCurrentData(); }, error: error => { - if (!this.lastResult) { - // We only want to remove the old subscription, and start a new - // subscription, when an error was received and we don't have a - // previous result stored. This means either no previous result was - // received due to problems fetching data, or the previous result - // has been forcefully cleared out. - this.resubscribeToQuery(); + const { previousResult } = this; + if ( + !previousResult || + previousResult.networkStatus === NetworkStatus.refetch + ) { + this.resubscribeToQuery(client); } + if (!error.hasOwnProperty('graphQLErrors')) throw error; this.updateCurrentData(); }, @@ -340,28 +266,27 @@ export default class Query extends }; private removeQuerySubscription = () => { - if (this.querySubscription) { - this.lastResult = this.queryObservable!.getLastResult(); - this.querySubscription.unsubscribe(); - delete this.querySubscription; + if (this.observableQuerySubscription) { + this.observableQuerySubscription.unsubscribe(); + delete this.observableQuerySubscription; } }; - private resubscribeToQuery() { + private resubscribeToQuery(client: ApolloClient) { this.removeQuerySubscription(); // Unfortunately, if `lastError` is set in the current - // `queryObservable` when the subscription is re-created, + // `observableQuery` when the subscription is re-created, // the subscription will immediately receive the error, which will // cause it to terminate again. To avoid this, we first clear - // the last error/result from the `queryObservable` before re-starting + // the last error/result from the `observableQuery` before re-starting // the subscription, and restore it afterwards (so the subscription // has a chance to stay open). - const lastError = this.queryObservable!.getLastError(); - const lastResult = this.queryObservable!.getLastResult(); - this.queryObservable!.resetLastResults(); - this.startQuerySubscription(); - Object.assign(this.queryObservable!, { lastError, lastResult }); + const lastError = this.observableQuery!.getLastError(); + const lastResult = this.observableQuery!.getLastResult(); + this.observableQuery!.resetLastResults(); + this.startQuerySubscription(client); + Object.assign(this.observableQuery!, { lastError, lastResult }); } private updateCurrentData = () => { @@ -369,12 +294,11 @@ export default class Query extends // after a network based Query result has been received. this.handleErrorOrCompleted(); - // Force a rerender that goes through shouldComponentUpdate. if (this.hasMounted) this.forceUpdate(); }; private handleErrorOrCompleted = () => { - const result = this.queryObservable!.currentResult(); + const result = this.observableQuery!.getCurrentResult(); const { data, loading, error } = result; const { onCompleted, onError } = this.props; if (onCompleted && !loading && !error) { @@ -384,26 +308,30 @@ export default class Query extends } } - private getQueryResult = (): QueryResult => { - let data = { data: Object.create(null) as TData } as any; + private getQueryResult = (client: ApolloClient): QueryResult => { + let result = { + data: Object.create(null) as TData + } as any; + // Attach bound methods - Object.assign(data, observableQueryFields(this.queryObservable!)); + Object.assign(result, observableQueryFields(this.observableQuery!)); // When skipping a query (ie. we're not querying for data but still want // to render children), make sure the `data` is cleared out and // `loading` is set to `false` (since we aren't loading anything). if (this.props.skip) { - data = { - ...data, + result = { + ...result, data: undefined, error: undefined, loading: false, }; } else { // Fetch the current result (if any) from the store. - const currentResult = this.queryObservable!.currentResult(); + const currentResult = this.observableQuery!.getCurrentResult(); const { loading, partial, networkStatus, errors } = currentResult; - let { error } = currentResult; + let { error, data } = currentResult; + data = data || Object.create(null) as TData; // Until a set naming convention for networkError and graphQLErrors is // decided upon, we map errors (graphQLErrors) to the error props. @@ -411,20 +339,22 @@ export default class Query extends error = new ApolloError({ graphQLErrors: errors }); } - Object.assign(data, { loading, networkStatus, error }); + Object.assign(result, { loading, networkStatus, error }); if (loading) { - Object.assign(data.data, this.previousData, currentResult.data); + const previousData = + this.previousResult ? this.previousResult.data : {}; + Object.assign(result.data, previousData, data); } else if (error) { - Object.assign(data, { - data: (this.queryObservable!.getLastResult() || {}).data, + Object.assign(result, { + data: (this.observableQuery!.getLastResult() || {}).data, }); } else { - const { fetchPolicy } = this.queryObservable!.options; + const { fetchPolicy } = this.observableQuery!.options; const { partialRefetch } = this.props; if ( partialRefetch && - Object.keys(currentResult.data).length === 0 && + Object.keys(data).length === 0 && partial && fetchPolicy !== 'cache-only' ) { @@ -436,50 +366,57 @@ export default class Query extends // the original `Query` component are expecting certain data values to // exist, and they're all of a sudden stripped away. To help avoid // this we'll attempt to refetch the `Query` data. - Object.assign(data, { loading: true, networkStatus: NetworkStatus.loading }); - data.refetch(); - return data; + Object.assign(result, { loading: true, networkStatus: NetworkStatus.loading }); + result.refetch(); + return result; } - Object.assign(data.data, currentResult.data); - this.previousData = currentResult.data; + Object.assign(result.data, data); } } - // Handle race condition where refetch is called on child mount or later - // Normal execution model: - // render(loading) -> mount -> start subscription -> get data -> render(with data) - // - // SSR with synchronous refetch: - // render(with data) -> refetch -> mount -> start subscription - // - // SSR with asynchronous refetch: - // render(with data) -> mount -> start subscription -> refetch - // - // If a subscription has not started, then the synchronous call to refetch - // must be made at a time when an active network request is being made, so - // we ensure that the network requests are deduped, to avoid an - // inconsistent UI state that displays different data for the current query - // alongside a refetched query. - // - // Once the Query component is mounted and the subscription is made, we - // always hit the network with refetch, since the components data will be - // updated and a network request is not currently active. - if (!this.querySubscription) { - const oldRefetch = (data as QueryControls).refetch; - - (data as QueryControls).refetch = args => { - if (this.querySubscription) { - return oldRefetch(args); - } else { - return new Promise((r, f) => { - this.refetcherQueue = { resolve: r, reject: f, args }; - }); - } - }; + result.client = client; + this.previousResult = result; + return result; + } + + private currentClient(context: any) { + const client = getClient(this.props, context); + if (this.previousClient !== client) { + this.previousClient = client; + this.removeQuerySubscription(); + this.observableQuery = null; + this.previousResult = null; } + return client; + } - data.client = this.client; - return data; - }; + private renderData(context: ApolloContextValue): React.ReactNode { + const client = this.currentClient(context); + + const { skip, query } = this.props; + if (skip || query !== this.previousQuery) { + this.removeQuerySubscription(); + this.observableQuery = null; + this.previousQuery = query; + } + + this.updateObservableQuery(client, context); + + if (!skip) { + this.startQuerySubscription(client); + } + + const finish = + () => this.props.children(this.getQueryResult(client)); + if (context && context.renderPromises) { + return context.renderPromises.addQueryPromise( + this, + finish, + client, + context, + ); + } + return finish(); + } } diff --git a/src/Subscriptions.tsx b/src/Subscriptions.tsx index 038e88cf06..d109a96f13 100644 --- a/src/Subscriptions.tsx +++ b/src/Subscriptions.tsx @@ -8,7 +8,7 @@ import { ZenObservable } from 'zen-observable-ts'; import { OperationVariables } from './types'; import { getClient } from './component-utils'; import shallowEqual from './utils/shallowEqual'; -import { ApolloContext, ApolloContextValue } from './ApolloContext'; +import { getApolloContext, ApolloContextValue } from './ApolloContext'; export interface SubscriptionResult { loading: boolean; @@ -42,7 +42,7 @@ class Subscription extends React.Component< SubscriptionProps, SubscriptionState > { - static contextType = ApolloContext; + static contextType = getApolloContext(); static propTypes = { subscription: PropTypes.object.isRequired, @@ -53,9 +53,11 @@ class Subscription extends React.Component< shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]), }; - private client: ApolloClient; - private queryObservable?: Observable; - private querySubscription?: ZenObservable.Subscription; + private client: ApolloClient; + private previousState?: Readonly>; + private previousProps?: Readonly>; + private observableQuery?: Observable; + private observableQuerySubscription?: ZenObservable.Subscription; constructor( props: SubscriptionProps, @@ -63,7 +65,6 @@ class Subscription extends React.Component< ) { super(props, context); this.client = getClient(props, context); - this.initialize(props); this.state = this.getInitialState(); } @@ -72,54 +73,51 @@ class Subscription extends React.Component< this.startSubscription(); } - componentWillReceiveProps(nextProps: SubscriptionProps) { - const nextClient = getClient(nextProps, this.context); + componentWillUnmount() { + this.endSubscription(); + } - if ( - shallowEqual(this.props.variables, nextProps.variables) && - this.client === nextClient && - this.props.subscription === nextProps.subscription - ) { - return; + render() { + let currentState = this.state; + + if (this.newClient()) { + currentState = this.getInitialState(); } - let shouldResubscribe = nextProps.shouldResubscribe; + let { shouldResubscribe } = this.props; if (typeof shouldResubscribe === 'function') { - shouldResubscribe = !!shouldResubscribe(this.props, nextProps); - } - const shouldNotResubscribe = shouldResubscribe === false; - if (this.client !== nextClient) { - this.client = nextClient; + shouldResubscribe = !!shouldResubscribe(this.props); } - if (!shouldNotResubscribe) { + if ( + shouldResubscribe !== false && + this.previousProps && + (!shallowEqual(this.previousProps.variables, this.props.variables) || + this.previousProps.subscription !== this.props.subscription) + ) { this.endSubscription(); - delete this.queryObservable; - this.initialize(nextProps); - this.startSubscription(); - this.setState(this.getInitialState()); - return; + delete this.observableQuery; + + if (!this.previousState) { + currentState = this.getInitialState(); + } } - this.initialize(nextProps); - this.startSubscription(); - } - componentWillUnmount() { - this.endSubscription(); - } + this.initialize(this.props); + this.startSubscription(); - render() { const renderFn: any = this.props.children; if (!renderFn) return null; - const result = Object.assign({}, this.state, { - variables: this.props.variables, - }); + + const result = { ...currentState, variables: this.props.variables }; + this.previousState = currentState; + this.previousProps = this.props; return renderFn(result); } private initialize = (props: SubscriptionProps) => { - if (this.queryObservable) return; - this.queryObservable = this.client.subscribe({ + if (this.observableQuery) return; + this.observableQuery = this.client.subscribe({ query: props.subscription, variables: props.variables, fetchPolicy: props.fetchPolicy, @@ -127,8 +125,8 @@ class Subscription extends React.Component< }; private startSubscription = () => { - if (this.querySubscription) return; - this.querySubscription = this.queryObservable!.subscribe({ + if (this.observableQuerySubscription) return; + this.observableQuerySubscription = this.observableQuery!.subscribe({ next: this.updateCurrentData, error: this.updateError, complete: this.completeSubscription @@ -142,15 +140,21 @@ class Subscription extends React.Component< }); private updateCurrentData = (result: SubscriptionResult) => { - const { - client, - props: { onSubscriptionData }, - } = this; - if (onSubscriptionData) onSubscriptionData({ client, subscriptionData: result }); + const { props: { onSubscriptionData } } = this; + + if (onSubscriptionData) { + onSubscriptionData({ + client: this.client, + subscriptionData: result + }); + } + this.setState({ data: result.data, loading: false, error: undefined, + }, () => { + delete this.previousState; }); }; @@ -168,10 +172,22 @@ class Subscription extends React.Component< }; private endSubscription = () => { - if (this.querySubscription) { - this.querySubscription.unsubscribe(); - delete this.querySubscription; + if (this.observableQuerySubscription) { + this.observableQuerySubscription.unsubscribe(); + delete this.observableQuerySubscription; + } + }; + + private newClient = () => { + let clientChanged = false; + const client = getClient(this.props, this.context); + if (client !== this.client) { + clientChanged = true; + this.client = client; + this.endSubscription(); + delete this.observableQuery; } + return clientChanged; }; } diff --git a/src/getDataFromTree.ts b/src/getDataFromTree.ts index cc939db6a0..3fd75ca526 100755 --- a/src/getDataFromTree.ts +++ b/src/getDataFromTree.ts @@ -1,9 +1,9 @@ import * as React from 'react'; -import { ObservableQuery } from 'apollo-client'; +import { ApolloClient, ObservableQuery } from 'apollo-client'; import { DocumentNode } from 'graphql'; import Query from './Query'; -import { ApolloContext } from './ApolloContext'; +import { getApolloContext, ApolloContextValue } from './ApolloContext'; type QueryInfo = { seen: boolean; @@ -43,13 +43,15 @@ export class RenderPromises { public addQueryPromise( queryInstance: Query, finish: () => React.ReactNode, + client: ApolloClient, + context: ApolloContextValue, ): React.ReactNode { const info = this.lookupQueryInfo(queryInstance); if (!info.seen) { this.queryPromises.set( queryInstance, new Promise(resolve => { - resolve(queryInstance.fetchData()); + resolve(queryInstance.fetchData(client, context)); }), ); // Render null to abandon this subtree for this rendering, so that we @@ -131,6 +133,7 @@ export function getMarkupFromTree({ // promise, because it is not possible to reconstruct the full context // of the original rendering (including all unknown context provider // elements) for a subtree of the orginal component tree. + const ApolloContext = getApolloContext(); const html = renderFunction( React.createElement( ApolloContext.Provider, diff --git a/src/index.ts b/src/index.ts index 90488c9d27..a332d24d21 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -export * from './ApolloContext'; +export { getApolloContext, resetApolloContext } from './ApolloContext'; export { default as ApolloConsumer } from './ApolloConsumer'; export * from './ApolloConsumer'; diff --git a/src/useApolloClient.ts b/src/useApolloClient.ts index 3c9d747d3a..450d32784e 100644 --- a/src/useApolloClient.ts +++ b/src/useApolloClient.ts @@ -1,10 +1,10 @@ import React from 'react'; import { invariant } from 'ts-invariant'; -import { ApolloContext } from './ApolloContext'; +import { getApolloContext } from './ApolloContext'; export function useApolloClient() { - const { client } = React.useContext(ApolloContext); + const { client } = React.useContext(getApolloContext()); invariant( !client, 'No Apollo Client instance can be found. Please ensure that you ' + diff --git a/test/client/ApolloConsumer.test.tsx b/test/client/ApolloConsumer.test.tsx index 38e7a689db..7b8ac8ad12 100644 --- a/test/client/ApolloConsumer.test.tsx +++ b/test/client/ApolloConsumer.test.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import ApolloClient from 'apollo-client'; import { InMemoryCache as Cache } from 'apollo-cache-inmemory'; import { ApolloLink } from 'apollo-link'; -import { ApolloProvider, ApolloConsumer, ApolloContext } from '../../src'; +import { ApolloProvider, ApolloConsumer, getApolloContext } from '../../src'; import { mount } from 'enzyme'; const client = new ApolloClient({ @@ -47,6 +47,7 @@ describe(' component', () => { // We're wrapping the `ApolloConsumer` component in a // `ApolloContext.Provider` component, to reset the context before // testing. + const ApolloContext = getApolloContext(); mount( {() => null} diff --git a/test/client/ApolloProvider.test.tsx b/test/client/ApolloProvider.test.tsx index 878f178006..78bc563e4b 100644 --- a/test/client/ApolloProvider.test.tsx +++ b/test/client/ApolloProvider.test.tsx @@ -5,7 +5,7 @@ import ApolloClient from 'apollo-client'; import { InMemoryCache as Cache } from 'apollo-cache-inmemory'; import { ApolloLink } from 'apollo-link'; -import { ApolloProvider, ApolloContext } from '../../src'; +import { ApolloProvider, getApolloContext } from '../../src'; describe(' Component', () => { const client = new ApolloClient({ @@ -14,7 +14,7 @@ describe(' Component', () => { }); class Child extends React.Component { - static contextType = ApolloContext; + static contextType = getApolloContext(); componentDidUpdate() { if (this.props.data) this.props.data.refetch(); @@ -78,6 +78,7 @@ describe(' Component', () => { expect(() => { // Before testing `ApolloProvider`, we first fully reset the // existing context using `ApolloContext.Provider` directly. + const ApolloContext = getApolloContext(); mount( diff --git a/test/client/Mutation.test.tsx b/test/client/Mutation.test.tsx index 2ed26d26a3..2fa98cf840 100644 --- a/test/client/Mutation.test.tsx +++ b/test/client/Mutation.test.tsx @@ -885,9 +885,7 @@ it('allows a refetchQueries prop', done => { {resultQuery => { if (count === 0) { - setTimeout(() => { - createTodo(); - }); + createTodo(); } else if (count === 1) { expect(resultMutation.loading).toBe(true); expect(resultQuery.loading).toBe(true); @@ -949,71 +947,56 @@ it('allows a refetchQueries prop as string and variables have updated', done => const refetchQueries = ['people']; + let wrapper: any; let count = 0; - class Component extends React.Component { - state = { - variables: { - first: 1, - }, - }; - componentDidMount() { - setTimeout(() => { - this.setState({ - variables: { - first: 2, - }, - }); - }, 50); - } - render() { - const { variables } = this.state; - return ( - - {(createTodo, resultMutation) => ( - - {resultQuery => { - if (count === 0) { - // initial loading - expect(resultQuery.loading).toBe(true); - } else if (count === 1) { - // initial loaded - expect(resultQuery.loading).toBe(false); - } else if (count === 2) { - // first: 2 loading - expect(resultQuery.loading).toBe(true); - } else if (count === 3) { - // first: 2 loaded - expect(resultQuery.loading).toBe(false); - setTimeout(() => { - createTodo(); - }); - } else if (count === 4) { - // mutation loading - expect(resultMutation.loading).toBe(true); - } else if (count === 5) { - // mutation loaded - expect(resultMutation.loading).toBe(false); - } else if (count === 6) { - // query refetched - expect(resultQuery.loading).toBe(false); - expect(resultMutation.loading).toBe(false); - expect(stripSymbols(resultQuery.data)).toEqual(peopleData3); - done(); - } - count++; - return null; - }} - - )} - - ); - } - } + const Component: React.FC = (props) => ( + + {(createTodo, resultMutation) => ( + + {resultQuery => { + if (count === 0) { + // "first: 1" loading + expect(resultQuery.loading).toBe(true); + } else if (count === 1) { + // "first: 1" loaded + expect(resultQuery.loading).toBe(false); + wrapper.setProps({ + children: + }); + } else if (count === 2) { + // "first: 2" loading + expect(resultQuery.loading).toBe(true); + } else if (count === 3) { + // "first: 2" loaded + expect(resultQuery.loading).toBe(false); + setTimeout(() => { + createTodo(); + }); + } else if (count === 4) { + // mutation loading + expect(resultMutation.loading).toBe(true); + } else if (count === 5) { + // mutation loaded + expect(resultMutation.loading).toBe(false); + } else if (count === 6) { + // query refetched + expect(resultQuery.loading).toBe(false); + expect(resultMutation.loading).toBe(false); + expect(stripSymbols(resultQuery.data)).toEqual(peopleData3); + done(); + } + count++; + return null; + }} + + )} + + ); - mount( + wrapper = mount( - + , ); }); @@ -1072,9 +1055,7 @@ it('allows refetchQueries to be passed to the mutate function', done => { {resultQuery => { if (count === 0) { - setTimeout(() => { - createTodo({ refetchQueries }); - }); + createTodo({ refetchQueries }); } else if (count === 1) { expect(resultMutation.loading).toBe(true); expect(resultQuery.loading).toBe(true); @@ -1260,7 +1241,6 @@ it('updates if the client changes', done => { }); }); } else if (count === 3) { - expect(result.called).toEqual(false); expect(result.loading).toEqual(false); setTimeout(() => { createTodo(); diff --git a/test/client/Query.test.tsx b/test/client/Query.test.tsx index 3ed8c3c82b..dbe7ccb314 100644 --- a/test/client/Query.test.tsx +++ b/test/client/Query.test.tsx @@ -1083,7 +1083,7 @@ describe('Query component', () => { result: { data: { allPeople: { people: [{ name }] } } }, }); - return new ApolloClient({ link, cache: new Cache({ addTypename: false }) }); + return new ApolloClient({ link, cache: new Cache({ addTypename: false }), name }); } const skywalker = newClient('Luke Skywalker'); diff --git a/test/client/Subscription.test.tsx b/test/client/Subscription.test.tsx index 26547d5c6c..9aaced5f23 100644 --- a/test/client/Subscription.test.tsx +++ b/test/client/Subscription.test.tsx @@ -256,7 +256,6 @@ it('does not execute if variables have not changed', done => { {result => { const { loading, data } = result; - catchAsyncError(done, () => { if (count === 0) { expect(loading).toBe(true); diff --git a/test/client/getDataFromTree.test.tsx b/test/client/getDataFromTree.test.tsx index b03976fe83..aaa88203f1 100644 --- a/test/client/getDataFromTree.test.tsx +++ b/test/client/getDataFromTree.test.tsx @@ -10,7 +10,7 @@ import { getMarkupFromTree, DataValue, ChildProps, - ApolloContext, + getApolloContext, } from '../../src'; import gql from 'graphql-tag'; const times = require('lodash.times'); @@ -75,7 +75,7 @@ describe('SSR', () => { it('should support passing a root context', () => { class Consumer extends React.Component { - static contextType = ApolloContext; + static contextType = getApolloContext(); render() { return
{this.context.text}
; @@ -192,7 +192,6 @@ describe('SSR', () => { const link = mockSingleLink({ request: { query }, result: { data: { currentUser: { firstName: 'James' } } }, - delay: 50, }); const apolloClient = new ApolloClient({ link, @@ -209,7 +208,7 @@ describe('SSR', () => { options: { fetchPolicy: 'cache-and-network' }, })(({ data }: ChildProps) => (
- {!data || data.loading || !data.currentUser ? 'loading' : data.currentUser.firstName} + {data && data.currentUser ? data.currentUser.firstName : 'loading'}
)); @@ -219,7 +218,8 @@ describe('SSR', () => {
); - return getDataFromTree(app).then(() => { + return getDataFromTree(app).then((html) => { + expect(html).toMatch(/James/); const markup = ReactDOM.renderToString(app); expect(markup).toMatch(/James/); }); diff --git a/test/client/graphql/mutations/recycled-queries.test.tsx b/test/client/graphql/mutations/recycled-queries.test.tsx index 6436331494..d4e6f1017a 100644 --- a/test/client/graphql/mutations/recycled-queries.test.tsx +++ b/test/client/graphql/mutations/recycled-queries.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import * as renderer from 'react-test-renderer'; +import { mount } from 'enzyme'; import gql from 'graphql-tag'; import ApolloClient, { MutationUpdaterFn } from 'apollo-client'; import { InMemoryCache as Cache } from 'apollo-cache-inmemory'; @@ -118,7 +118,7 @@ describe('graphql(mutation) update queries', () => { const MyQuery = graphql<{}, QueryData>(query)( class extends React.Component> { - componentWillMount() { + componentDidMount() { queryMountCount++; } @@ -142,21 +142,6 @@ describe('graphql(mutation) update queries', () => { break; case 2: expect(queryMountCount).toBe(1); - expect(queryUnmountCount).toBe(0); - expect(stripSymbols(this.props.data!.todo_list)).toEqual({ - id: '123', - title: 'how to apollo', - tasks: [ - { - id: '99', - text: 'This one was created with a mutation.', - completed: true, - }, - ], - }); - break; - case 3: - expect(queryMountCount).toBe(2); expect(queryUnmountCount).toBe(1); expect(stripSymbols(this.props.data!.todo_list)).toEqual({ id: '123', @@ -175,7 +160,7 @@ describe('graphql(mutation) update queries', () => { ], }); break; - case 4: + case 3: expect(stripSymbols(this.props.data!.todo_list)).toEqual({ id: '123', title: 'how to apollo', @@ -204,13 +189,13 @@ describe('graphql(mutation) update queries', () => { }, ); - const wrapperMutation = renderer.create( + const wrapperMutation = mount( , ); - const wrapperQuery1 = renderer.create( + const wrapperQuery1 = mount( , @@ -233,12 +218,14 @@ describe('graphql(mutation) update queries', () => { mutate(); setTimeout(() => { - const wrapperQuery2 = renderer.create( + const wrapperQuery2 = mount( , ); + resolve(); + setTimeout(() => { wrapperMutation.unmount(); wrapperQuery2.unmount(); @@ -247,7 +234,7 @@ describe('graphql(mutation) update queries', () => { expect(todoUpdateQueryCount).toBe(2); expect(queryMountCount).toBe(2); expect(queryUnmountCount).toBe(2); - expect(queryRenderCount).toBe(4); + expect(queryRenderCount).toBe(3); resolve(); } catch (error) { reject(error); @@ -397,13 +384,13 @@ describe('graphql(mutation) update queries', () => { }, ); - renderer.create( + const wrapper = mount( , ); - const wrapperQuery1 = renderer.create( + const wrapperQuery1 = mount( , @@ -416,7 +403,7 @@ describe('graphql(mutation) update queries', () => { .then(() => { setTimeout(() => { // This re-renders the recycled query that should have been refetched while recycled. - renderer.create( + const wrapperQuery2 = mount( , diff --git a/test/client/graphql/queries/api.test.tsx b/test/client/graphql/queries/api.test.tsx index 9e7233caa2..4268a9cd3f 100644 --- a/test/client/graphql/queries/api.test.tsx +++ b/test/client/graphql/queries/api.test.tsx @@ -4,7 +4,11 @@ import gql from 'graphql-tag'; import ApolloClient from 'apollo-client'; import { InMemoryCache as Cache } from 'apollo-cache-inmemory'; import { mockSingleLink } from '../../../../src/test-utils'; -import { ApolloProvider, ChildProps, graphql } from '../../../../src'; +import { + ApolloProvider, + ChildProps, + graphql, +} from '../../../../src'; import wrap from '../../../test-utils/wrap'; import stripSymbols from '../../../test-utils/stripSymbols'; @@ -202,7 +206,6 @@ describe('[queries] api', () => { throw new Error('should not reach this point'); } count++; - done(); } render() { return null; diff --git a/test/client/graphql/queries/lifecycle.test.tsx b/test/client/graphql/queries/lifecycle.test.tsx index b244ce6827..eaf733acc2 100644 --- a/test/client/graphql/queries/lifecycle.test.tsx +++ b/test/client/graphql/queries/lifecycle.test.tsx @@ -581,20 +581,8 @@ describe('[queries] lifecycle', () => { { loading: false, a: 7, b: 8, c: 9 }, // Load 6 - - // The first render is caused by the component having its state updated - // when switching the client. The 2nd and 3rd renders are caused by the - // component re-subscribing to get data from Apollo Client. - { loading: false, a: 1, b: 2, c: 3 }, - { loading: false, a: 1, b: 2, c: 3 }, { loading: false, a: 1, b: 2, c: 3 }, - - { loading: false, a: 4, b: 5, c: 6 }, { loading: false, a: 4, b: 5, c: 6 }, - { loading: false, a: 4, b: 5, c: 6 }, - - { loading: false, a: 7, b: 8, c: 9 }, - { loading: false, a: 7, b: 8, c: 9 }, { loading: false, a: 7, b: 8, c: 9 }, ]); }); diff --git a/test/client/graphql/queries/loading.test.tsx b/test/client/graphql/queries/loading.test.tsx index 88d0254419..aa261eba19 100644 --- a/test/client/graphql/queries/loading.test.tsx +++ b/test/client/graphql/queries/loading.test.tsx @@ -297,7 +297,6 @@ describe('[queries] loading', () => { const link = mockSingleLink({ request: { query }, result: { data }, - delay: 10, newData: () => ({ data: { allPeople: { @@ -306,58 +305,51 @@ describe('[queries] loading', () => { }, }), }); + const client = new ApolloClient({ link, cache: new Cache({ addTypename: false }), queryDeduplication: false, }); - let wrapper: ReactWrapper, - app: React.ReactElement, - count = 0; + + let wrapper: ReactWrapper; + let count = 0; const Container = graphql<{}, Data>(query, { options: { fetchPolicy: 'network-only' }, })( class extends React.Component> { - componentWillMount() { + render() { if (count === 1) { - expect(this.props.data!.loading).toBeTruthy(); // on remount - count++; - } - } - componentWillReceiveProps(props: ChildProps<{}, Data>) { - try { - if (count === 0) { - // has data + // Has data + setTimeout(() => { wrapper.unmount(); - setTimeout(() => { - wrapper = mount(app); - }, 5); - } - if (count === 3) { - // remounted data after fetch - expect(props.data!.loading).toBeFalsy(); - expect(props.data!.allPeople!.people[0].name).toMatch(/Darth Skywalker - /); - done(); - } - } catch (e) { - done.fail(e); + wrapper = mount(App); + }, 0); } - count++; - } - render() { + if (count === 2) { + // Loading after remount + expect(this.props.data!.loading).toBeTruthy(); + } + if (count === 3) { + // Fetched data loading after remount + expect(this.props.data!.loading).toBeFalsy(); + expect(this.props.data!.allPeople!.people[0].name).toMatch(/Darth Skywalker - /); + done(); + } + count += 1; return null; } }, ); - app = ( + const App: React.ReactElement = ( ); - wrapper = mount(app); + wrapper = mount(App); }); it('correctly sets loading state on remounted component with changed variables', done => { @@ -465,25 +457,36 @@ describe('[queries] loading', () => { type Vars = typeof variables; const link = mockSingleLink( - { request: { query, variables }, result: { data }, delay: 10 }, + { request: { query, variables }, result: { data } }, { request: { query, variables: variables2 }, result: { data }, - delay: 10, }, ); const client = new ApolloClient({ link, cache: new Cache({ addTypename: false }), }); + let count = 0; + let wrapper: any; const Container = graphql(query)( class extends React.Component> { render() { const { loading } = this.props.data!; if (count === 0) expect(loading).toBeTruthy(); - if (count === 1) expect(loading).toBeFalsy(); + if (count === 1) { + expect(loading).toBeFalsy(); + setTimeout(() => { + wrapper.unmount(); + mount( + + + + ); + }, 0); + } if (count === 2) expect(loading).toBeTruthy(); if (count === 3) { expect(loading).toBeFalsy(); @@ -494,24 +497,12 @@ describe('[queries] loading', () => { } }, ); - const main = document.createElement('DIV'); - main.id = 'main'; - document.body.appendChild(main); - - const render = (props: Vars) => { - ReactDOM.render( - - - , - document.getElementById('main'), - ); - }; - // Initial render. - render(variables); - - // Prop update: fetch. - setTimeout(() => render(variables2), 1000); + wrapper = mount( + + + + ) }); it('correctly sets loading state on component with changed variables and unchanged result', done => { @@ -536,11 +527,10 @@ describe('[queries] loading', () => { type Vars = typeof variables; const link = mockSingleLink( - { request: { query, variables }, result: { data }, delay: 10 }, + { request: { query, variables }, result: { data } }, { request: { query, variables: variables2 }, result: { data }, - delay: 10, }, ); const client = new ApolloClient({ @@ -582,26 +572,27 @@ describe('[queries] loading', () => { options: ({ first }) => ({ variables: { first } }), })( class extends React.Component> { - componentWillReceiveProps(props: ChildProps) { + render() { if (count === 0) { - expect(props.data!.loading).toBeFalsy(); // has initial data - setTimeout(() => { - this.props.setFirst(2); - }, 5); + expect(this.props.data!.loading).toBeTruthy(); // has initial data } if (count === 1) { - expect(props.data!.loading).toBeTruthy(); // on variables change + expect(this.props.data!.loading).toBeFalsy(); + this.props.setFirst(2); } if (count === 2) { + expect(this.props.data!.loading).toBeTruthy(); // on variables change + } + + if (count === 3) { // new data after fetch - expect(props.data!.loading).toBeFalsy(); + expect(this.props.data!.loading).toBeFalsy(); done(); } count++; - } - render() { + return null; } }, diff --git a/test/client/graphql/queries/observableQuery.test.tsx b/test/client/graphql/queries/observableQuery.test.tsx index 9bba1c7fc0..7c7660686a 100644 --- a/test/client/graphql/queries/observableQuery.test.tsx +++ b/test/client/graphql/queries/observableQuery.test.tsx @@ -3,7 +3,6 @@ import * as renderer from 'react-test-renderer'; import { mount, ReactWrapper } from 'enzyme'; import gql from 'graphql-tag'; import ApolloClient from 'apollo-client'; -import { ApolloLink } from 'apollo-link'; import { InMemoryCache as Cache } from 'apollo-cache-inmemory'; import { mockSingleLink } from '../../../../src/test-utils'; import { ApolloProvider, graphql, ChildProps } from '../../../../src'; @@ -34,20 +33,12 @@ describe('[queries] observableQuery', () => { cache: new Cache({ addTypename: false }), }); - // storage - // let queryObservable1: ObservableQuery; - // let queryObservable2: ObservableQuery; - // let originalOptions; let wrapper1: ReactWrapper; - // let wrapper2; let count = 0; - // let recycledOptions; const assert1 = () => { const keys = Array.from((client.queryManager as any).queries.keys()); expect(keys).toEqual(['1']); - // queryObservable1 = (client.queryManager as any).queries.get('1').observableQuery; - // originalOptions = Object.assign({}, queryObservable1.options); }; const assert2 = () => { @@ -59,30 +50,15 @@ describe('[queries] observableQuery', () => { options: { fetchPolicy: 'cache-and-network' }, })( class extends React.Component> { - componentWillMount() { - // during the first mount, the loading prop should be true; - if (count === 0) { - expect(this.props.data!.loading).toBeTruthy(); - } - - // during the second mount, the loading prop should be false, and data should - // be present; - if (count === 3) { - expect(this.props.data!.loading).toBeFalsy(); - expect(stripSymbols(this.props.data!.allPeople)).toEqual(data.allPeople); - } - } - componentDidMount() { - if (count === 4) { + if (count === 3) { wrapper1.unmount(); done(); } } - componentDidUpdate(prevProps: ChildProps<{}, Data>) { - if (count === 3) { - expect(prevProps.data!.loading).toBeTruthy(); + componentDidUpdate() { + if (count === 2) { expect(this.props.data!.loading).toBeFalsy(); expect(stripSymbols(this.props.data!.allPeople)).toEqual(data.allPeople); @@ -96,7 +72,18 @@ describe('[queries] observableQuery', () => { } render() { - // side effect to keep track of render counts + // during the first mount, the loading prop should be true; + if (count === 0) { + expect(this.props.data!.loading).toBeTruthy(); + } + + // during the second mount, the loading prop should be false, and data should + // be present; + if (count === 2) { + expect(this.props.data!.loading).toBeTruthy(); + expect(stripSymbols(this.props.data!.allPeople)).toEqual(data.allPeople); + } + count++; return null; } diff --git a/test/client/graphql/queries/skip.test.tsx b/test/client/graphql/queries/skip.test.tsx index dcfa697c42..f22d230885 100644 --- a/test/client/graphql/queries/skip.test.tsx +++ b/test/client/graphql/queries/skip.test.tsx @@ -551,9 +551,12 @@ describe('[queries] skip', () => { } } `; + const data = { allPeople: { people: [{ name: 'Luke Skywalker' }] } }; const nextData = { allPeople: { people: [{ name: 'Anakin Skywalker' }] } }; + let ranQuery = 0; + const link = new ApolloLink((o, f) => { ranQuery++; return f ? f(o) : null; @@ -582,29 +585,27 @@ describe('[queries] skip', () => { options: () => ({ fetchPolicy: 'network-only' }), skip: ({ skip }) => skip, })( - class extends React.Component> { - componentWillReceiveProps(newProps: ChildProps) { - if (newProps.skip) { + class extends React.Component { + render() { + if (this.props.skip) { // Step 2. We shouldn't query again. expect(ranQuery).toBe(1); hasSkipped = true; this.props.setSkip(false); } else if (hasRequeried) { // Step 4. We need to actually get the data from the query into the component! - expect(newProps.data!.loading).toBeFalsy(); + expect(this.props.data!.loading).toBeFalsy(); done(); } else if (hasSkipped) { // Step 3. We need to query again! - expect(newProps.data!.loading).toBeTruthy(); + expect(this.props.data!.loading).toBeTruthy(); expect(ranQuery).toBe(2); hasRequeried = true; } else { - // Step 1. We've queried once. + // Step 1. We've queried once. expect(ranQuery).toBe(1); this.props.setSkip(true); } - } - render() { return null; } }, diff --git a/test/client/graphql/queries/updateQuery.test.tsx b/test/client/graphql/queries/updateQuery.test.tsx index f382d0ce86..6960b20878 100644 --- a/test/client/graphql/queries/updateQuery.test.tsx +++ b/test/client/graphql/queries/updateQuery.test.tsx @@ -1,15 +1,24 @@ import * as React from 'react'; -import * as renderer from 'react-test-renderer'; import gql from 'graphql-tag'; import ApolloClient from 'apollo-client'; import { InMemoryCache as Cache } from 'apollo-cache-inmemory'; +import { mount } from 'enzyme'; + import { mockSingleLink } from '../../../../src/test-utils'; import { ApolloProvider, graphql, ChildProps } from '../../../../src'; import stripSymbols from '../../../test-utils/stripSymbols'; import { DocumentNode } from 'graphql'; +let wrapper: any; + describe('[queries] updateQuery', () => { + afterEach(() => { + if (wrapper) { + wrapper.unmount(); + } + }) + // updateQuery it('exposes updateQuery as part of the props api', done => { const query: DocumentNode = gql` @@ -47,7 +56,7 @@ describe('[queries] updateQuery', () => { }, ); - renderer.create( + wrapper = mount( , @@ -86,7 +95,7 @@ describe('[queries] updateQuery', () => { }, ); - renderer.create( + wrapper = mount( , @@ -131,7 +140,7 @@ describe('[queries] updateQuery', () => { }, ); - renderer.create( + wrapper = mount( , @@ -185,7 +194,7 @@ describe('[queries] updateQuery', () => { }, ); - renderer.create( + wrapper = mount( , @@ -236,7 +245,7 @@ describe('[queries] updateQuery', () => { }, ); - renderer.create( + wrapper = mount( , From db54959947cd4665992c763d137f90c41c28272a Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Mon, 8 Apr 2019 13:33:42 -0400 Subject: [PATCH 011/113] Remove tslint There are some advantages to using a linter with Typescript, but they aren't really something we're interested in using with React Apollo. Since tslint is being deprecated and reborn as an eslint add-on, we're going to stop using it altogether. We might consider bringing eslint into the project at some point in the future, but for now we're not interested in imposing additional rules or guidelines on potential contributors. --- .circleci/config.yml | 9 --- .../typescript/src/__generated__/types.ts | 1 - examples/typescript/src/__mocks__/data.ts | 1 - package-lock.json | 75 +------------------ package.json | 6 +- scripts/prepare-package.sh | 1 - src/parser.ts | 3 - test/client/ApolloConsumer.test.tsx | 2 +- test/client/Mutation.test.tsx | 18 ++--- test/client/Query.test.tsx | 6 +- test/client/graphql/mutations/index.test.tsx | 2 +- test/client/graphql/queries/api.test.tsx | 3 +- test/client/graphql/queries/errors.test.tsx | 3 +- test/client/graphql/queries/index.test.tsx | 3 +- test/client/graphql/queries/polling.test.tsx | 2 +- test/client/graphql/subscriptions.test.tsx | 2 +- test/typescript-usage.tsx | 50 ++----------- tslint.json | 53 ------------- 18 files changed, 27 insertions(+), 213 deletions(-) delete mode 100644 tslint.json diff --git a/.circleci/config.yml b/.circleci/config.yml index 64fee0583b..050533adb0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,14 +31,6 @@ jobs: - store_artifacts: path: reports/junit - Linting: - docker: [{ image: 'circleci/node:8' }] - steps: - - checkout - - run: npm i - - run: npm run danger - - run: npm run lint - Typecheck: docker: [{ image: 'circleci/node:8' }] steps: @@ -92,7 +84,6 @@ workflows: jobs: - Node.js 8 - Node.js 10 - - Linting - Typecheck - UMD - Commonjs diff --git a/examples/typescript/src/__generated__/types.ts b/examples/typescript/src/__generated__/types.ts index ee598b8490..d9aeeedd15 100644 --- a/examples/typescript/src/__generated__/types.ts +++ b/examples/typescript/src/__generated__/types.ts @@ -1,4 +1,3 @@ -/* tslint:disable */ // This file was automatically generated and should not be edited. // The episodes in the Star Wars trilogy diff --git a/examples/typescript/src/__mocks__/data.ts b/examples/typescript/src/__mocks__/data.ts index f84989ce3a..8383a1ce6d 100644 --- a/examples/typescript/src/__mocks__/data.ts +++ b/examples/typescript/src/__mocks__/data.ts @@ -1,4 +1,3 @@ -// tslint:disable export const empty = null; export const hero_no_friends = { diff --git a/package-lock.json b/package-lock.json index 9b3b079d2a..eae3a209f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-apollo", - "version": "2.5.2", + "version": "2.5.3", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3087,12 +3087,6 @@ "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", "dev": true }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, "diff-sequences": { "version": "24.3.0", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.3.0.tgz", @@ -9060,73 +9054,6 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" }, - "tslint": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.14.0.tgz", - "integrity": "sha512-IUla/ieHVnB8Le7LdQFRGlVJid2T/gaJe5VkjzRVSRR6pA2ODYrnfR1hmxi+5+au9l50jBwpbBL34txgv4NnTQ==", - "dev": true, - "requires": { - "babel-code-frame": "^6.22.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^3.2.0", - "glob": "^7.1.1", - "js-yaml": "^3.7.0", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.8.0", - "tsutils": "^2.29.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", diff --git a/package.json b/package.json index a452d8d573..5655de18e4 100644 --- a/package.json +++ b/package.json @@ -26,15 +26,12 @@ "deploy": "cd lib && npm publish", "filesize": "bundlesize", "jest": "jest --runInBand --coverage", - "lint": "tslint --project tsconfig.json --config tslint.json", - "lint-staged": "lint-staged", - "lint:fix": "npm run prettier && tslint 'src/*.ts*' --project tsconfig.json --fix", "postcompile": "rollup -c && ./scripts/prepare-package.sh", "precompile": "rimraf lib", "predeploy": "npm run compile", "prefilesize": "npm run compile", "prettier": "prettier --write \"./**/*.{js,jsx,ts*,md,graphql,json}\"", - "test": "npm run lint && npm run type-check && npm run jest", + "test": "npm run type-check && npm run jest", "test-examples": ". ./test-examples.sh", "test-watch": "jest --watch", "test:compiled": "npm run test:compiled:cjs && npm run test:compiled:umd", @@ -153,7 +150,6 @@ "rollup-plugin-uglify": "6.0.2", "ts-jest": "24.0.0", "tsc-watch": "2.1.2", - "tslint": "5.14.0", "typescript": "3.3.4000", "typescript-require": "0.2.10", "zen-observable-ts": "0.8.18" diff --git a/scripts/prepare-package.sh b/scripts/prepare-package.sh index 506344db52..7231374e4d 100755 --- a/scripts/prepare-package.sh +++ b/scripts/prepare-package.sh @@ -11,7 +11,6 @@ node -e "var package = require('./package.json'); \ delete package.private; \ delete package.babel; \ - delete package[\"lint-staged\"]; \ delete package.jest; \ delete package.bundlesize; \ delete package[\"husky\"]; \ diff --git a/src/parser.ts b/src/parser.ts index 06f97a92ed..a619f5b651 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -35,7 +35,6 @@ export function parser(document: DocumentNode): IDocumentDefinition { */ invariant( !!document && !!document.kind, - // tslint:disable-line `Argument of ${document} passed to parser was not a valid GraphQL ` + `DocumentNode. You may need to use 'graphql-tag' or another method ` + `to convert your operation into a document`, @@ -65,7 +64,6 @@ export function parser(document: DocumentNode): IDocumentDefinition { invariant( queries.length + mutations.length + subscriptions.length <= 1, - // tslint:disable-line `react-apollo only supports a query, subscription, or a mutation per HOC. ` + `${document} had ${queries.length} queries, ${subscriptions.length} ` + `subscriptions and ${mutations.length} mutations. ` + @@ -79,7 +77,6 @@ export function parser(document: DocumentNode): IDocumentDefinition { invariant( definitions.length === 1, - // tslint:disable-line `react-apollo only supports one definition per HOC. ${document} had ` + `${definitions.length} definitions. ` + `You can use 'compose' to join multiple operation types to a component`, diff --git a/test/client/ApolloConsumer.test.tsx b/test/client/ApolloConsumer.test.tsx index 7b8ac8ad12..01fd5fda7b 100644 --- a/test/client/ApolloConsumer.test.tsx +++ b/test/client/ApolloConsumer.test.tsx @@ -42,7 +42,7 @@ describe(' component', () => { it('errors if there is no client in the context', () => { // Prevent Error about missing context type from appearing in the console. const errorLogger = console.error; - console.error = () => {}; // tslint:disable-line + console.error = () => {}; expect(() => { // We're wrapping the `ApolloConsumer` component in a // `ApolloContext.Provider` component, to reset the context before diff --git a/test/client/Mutation.test.tsx b/test/client/Mutation.test.tsx index 2fa98cf840..eaa95c9150 100644 --- a/test/client/Mutation.test.tsx +++ b/test/client/Mutation.test.tsx @@ -1317,7 +1317,7 @@ it('errors if a query is passed instead of a mutation', () => { // Prevent error from being logged in console of test. const errorLogger = console.error; - console.error = () => {}; // tslint:disable-line + console.error = () => {}; expect(() => { mount( @@ -1327,7 +1327,7 @@ it('errors if a query is passed instead of a mutation', () => { ); }).toThrowError('The component requires a graphql mutation, but got a query.'); - console.log = errorLogger; // tslint:disable-line + console.log = errorLogger; }); it('errors when changing from mutation to a query', done => { @@ -1368,7 +1368,7 @@ it('errors when changing from mutation to a query', done => { // Prevent error from being logged in console of test. const errorLogger = console.error; - console.error = () => {}; // tslint:disable-line + console.error = () => {}; mount( @@ -1376,7 +1376,7 @@ it('errors when changing from mutation to a query', done => { , ); - console.log = errorLogger; //tslint:disable-line + console.log = errorLogger; }); it('errors if a subscription is passed instead of a mutation', () => { @@ -1390,7 +1390,7 @@ it('errors if a subscription is passed instead of a mutation', () => { // Prevent error from being logged in console of test. const errorLogger = console.error; - console.error = () => {}; // tslint:disable-line + console.error = () => {}; expect(() => { mount( @@ -1402,7 +1402,7 @@ it('errors if a subscription is passed instead of a mutation', () => { 'The component requires a graphql mutation, but got a subscription.', ); - console.log = errorLogger; // tslint:disable-line + console.log = errorLogger; }); it('errors when changing from mutation to a subscription', done => { @@ -1445,7 +1445,7 @@ it('errors when changing from mutation to a subscription', done => { // Prevent error from being logged in console of test. const errorLogger = console.error; - console.error = () => {}; // tslint:disable-line + console.error = () => {}; mount( @@ -1453,7 +1453,7 @@ it('errors when changing from mutation to a subscription', done => { , ); - console.log = errorLogger; // tslint:disable-line + console.log = errorLogger; }); describe('after it has been unmounted', () => { @@ -1636,7 +1636,7 @@ describe('after it has been unmounted', () => { {(createTodo, result) => { if (!result.called) { setTimeout(() => { - createTodo().catch(() => {}); // tslint:disable-line + createTodo().catch(() => {}); this.setState({ called: true }, checker); }, 10); } diff --git a/test/client/Query.test.tsx b/test/client/Query.test.tsx index dbe7ccb314..a1a9fadd5c 100644 --- a/test/client/Query.test.tsx +++ b/test/client/Query.test.tsx @@ -830,7 +830,7 @@ describe('Query component', () => { // Prevent error from being logged in console of test. const errorLogger = console.error; - console.error = () => {}; // tslint:disable-line + console.error = () => {}; expect(() => { mount( @@ -854,7 +854,7 @@ describe('Query component', () => { // Prevent error from being logged in console of test. const errorLogger = console.error; - console.error = () => {}; // tslint:disable-line + console.error = () => {}; expect(() => { mount( @@ -1355,7 +1355,7 @@ describe('Query component', () => { // Prevent error from showing up in console. const errorLog = console.error; - console.error = () => {}; // tslint:disable-line + console.error = () => {}; class Component extends React.Component { state = { query: allPeopleQuery }; diff --git a/test/client/graphql/mutations/index.test.tsx b/test/client/graphql/mutations/index.test.tsx index b29a4c2c6e..875d769bd6 100644 --- a/test/client/graphql/mutations/index.test.tsx +++ b/test/client/graphql/mutations/index.test.tsx @@ -37,7 +37,7 @@ describe('graphql(mutation)', () => { let client: ApolloClient; beforeEach(() => { error = console.error; - console.error = jest.fn(() => {}); // tslint:disable-line + console.error = jest.fn(() => {}); client = createClient(expectedData, query); }); afterEach(() => { diff --git a/test/client/graphql/queries/api.test.tsx b/test/client/graphql/queries/api.test.tsx index 4268a9cd3f..d5f4819134 100644 --- a/test/client/graphql/queries/api.test.tsx +++ b/test/client/graphql/queries/api.test.tsx @@ -119,7 +119,6 @@ describe('[queries] api', () => { const Container = graphql(query)( class extends React.Component { componentWillReceiveProps({ data }: ChildProps) { - // tslint:disable-line expect(data!.subscribeToMore).toBeTruthy(); expect(data!.subscribeToMore instanceof Function).toBeTruthy(); done(); @@ -276,7 +275,7 @@ describe('[queries] api', () => { variables: { cursor }, updateQuery(prev, { fetchMoreResult }) { const { - allPeople: { cursor, people }, // tslint:disable-line:no-shadowed-variable + allPeople: { cursor, people }, } = fetchMoreResult!; return { allPeople: { diff --git a/test/client/graphql/queries/errors.test.tsx b/test/client/graphql/queries/errors.test.tsx index a3a56c84c6..19b59630ec 100644 --- a/test/client/graphql/queries/errors.test.tsx +++ b/test/client/graphql/queries/errors.test.tsx @@ -21,7 +21,7 @@ describe('[queries] errors', () => { let error: typeof console.error; beforeEach(() => { error = console.error; - console.error = jest.fn(() => {}); // tslint:disable-line + console.error = jest.fn(() => {}); }); afterEach(() => { console.error = error; @@ -203,7 +203,6 @@ describe('[queries] errors', () => { graphql(query)( class extends React.Component> { componentWillReceiveProps(props: ChildProps) { - // tslint:disable-line iteration += 1; if (iteration === 1) { // initial loading state is done, we have data diff --git a/test/client/graphql/queries/index.test.tsx b/test/client/graphql/queries/index.test.tsx index b84791288b..fa98d8c9b3 100644 --- a/test/client/graphql/queries/index.test.tsx +++ b/test/client/graphql/queries/index.test.tsx @@ -17,7 +17,7 @@ describe('queries', () => { let error: typeof console.error; beforeEach(() => { error = console.error; - console.error = jest.fn(() => {}); // tslint:disable-line + console.error = jest.fn(() => {}); }); afterEach(() => { console.error = error; @@ -598,7 +598,6 @@ describe('queries', () => { }); const Container = graphql<{}, Data>(query)( - // tslint:disable-next-line:no-shadowed-variable class Container extends React.Component> { componentWillReceiveProps() { const queries = client.queryManager!.queryStore.getStore(); diff --git a/test/client/graphql/queries/polling.test.tsx b/test/client/graphql/queries/polling.test.tsx index e595c5b15a..803d71895d 100644 --- a/test/client/graphql/queries/polling.test.tsx +++ b/test/client/graphql/queries/polling.test.tsx @@ -11,7 +11,7 @@ describe('[queries] polling', () => { let error: typeof console.error; beforeEach(() => { error = console.error; - console.error = jest.fn(() => {}); // tslint:disable-line + console.error = jest.fn(() => {}); jest.useRealTimers(); }); afterEach(() => { diff --git a/test/client/graphql/subscriptions.test.tsx b/test/client/graphql/subscriptions.test.tsx index 1735ceb5e2..af10b05d9e 100644 --- a/test/client/graphql/subscriptions.test.tsx +++ b/test/client/graphql/subscriptions.test.tsx @@ -15,7 +15,7 @@ describe('subscriptions', () => { beforeEach(() => { jest.useRealTimers(); error = console.error; - console.error = jest.fn(() => {}); // tslint:disable-line + console.error = jest.fn(() => {}); }); afterEach(() => { console.error = error; diff --git a/test/typescript-usage.tsx b/test/typescript-usage.tsx index 419d87de81..90a91d320b 100644 --- a/test/typescript-usage.tsx +++ b/test/typescript-usage.tsx @@ -74,7 +74,7 @@ class HistoryView extends React.Component> { } const HistoryViewWithData = withHistory(HistoryView); -; // tslint:disable-line +; // -------------------------- // stateless function with data @@ -92,7 +92,7 @@ const HistoryViewSFC = graphql(historyQuery, { } }); -; // tslint:disable-line +; // -------------------------- // decorator @@ -107,7 +107,7 @@ class DecoratedHistoryView extends React.Component> { } } -; // tslint:disable-line +; // -------------------------- // with custom props @@ -122,7 +122,7 @@ const withProps = graphql | const Foo = withProps(props =>
Woot {props.organisationData!.history}
); -; // tslint:disable-line +; // -------------------------- // variables with simple custom props @@ -139,7 +139,7 @@ const simpleVarsAndProps = graphql(historyQuery, { const HistorySimpleVarsAndProps = simpleVarsAndProps(props =>
{props.data!.history}
); -; // tslint:disable-line +; // -------------------------- // variables with advanced custom props @@ -154,42 +154,4 @@ const advancedVarsAndProps = graphql(historyQ const HistoryAdvancedVarsAndProps = advancedVarsAndProps(props =>
{props.history}
); -; // tslint:disable-line - -// -------------------------- -// It is not recommended to use `name` with Typescript, better to use props and map the property -// explicitly so it can be type checked. -// with using name -// const withHistoryUsingName = graphql(historyQuery, { -// name: 'organisationData', -// props: ({ -// organisationData, -// }: NamedProps<{ organisationData: QueryControls & Data }, Props>) => ({ -// ...organisationData, -// }), -// }); - -// const HistoryViewUsingName = withHistoryUsingName(HistoryView); -// ; // tslint:disable-line - -// -------------------------- -// mutation with name -// class UpdateHistoryView extends React.Component< -// ChildProps, -// {} -// > { -// updateHistory() { -// this.props.updateHistory({ -// variables: { -// input: { -// id: 'historyId', -// newDelta: 'newDelta', -// }, -// }, -// }); -// } -// -// render() { -// return null; -// } -// } +; diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 75b9184bd8..0000000000 --- a/tslint.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "rules": { - "align": [false, "parameters", "arguments", "statements"], - "ban": false, - "class-name": true, - "curly": false, - "forin": false, - "jsdoc-format": true, - "label-position": true, - "member-access": false, - "member-ordering": [ - true, - "public-before-private", - "static-before-instance", - "variables-before-functions" - ], - "no-any": false, - "no-arg": true, - "no-bitwise": true, - "no-conditional-assignment": true, - "no-consecutive-blank-lines": false, - "no-console": [true, "log", "debug", "info", "time", "timeEnd", "trace"], - "no-construct": true, - "no-debugger": true, - "no-duplicate-variable": true, - "no-empty": true, - "no-eval": true, - "no-inferrable-types": false, - "no-internal-module": true, - "no-null-keyword": false, - "no-require-imports": false, - "no-var-requires": false, - "no-shadowed-variable": true, - "no-switch-case-fall-through": true, - "no-unused-expression": true, - "no-use-before-declare": true, - "no-var-keyword": true, - "object-literal-sort-keys": false, - "radix": true, - "switch-default": true, - "triple-equals": [true, "allow-null-check"], - "typedef": [ - false, - "call-signature", - "parameter", - "arrow-parameter", - "property-declaration", - "variable-declaration", - "member-variable-declaration" - ], - "variable-name": [false, "check-format", "allow-leading-underscore", "ban-keywords"] - } -} From b787af0a6037cd5fcbf213f726b220c557439ec8 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Mon, 8 Apr 2019 15:20:24 -0400 Subject: [PATCH 012/113] Remove dangerjs We might re-introduce dangerjs into the project at some point in the future (especially for missing `CHANGELOG` entries and/or tests), but for now we're not using it so let's get rid of it. --- dangerfile.ts | 100 ------ package-lock.json | 847 ---------------------------------------------- package.json | 2 - 3 files changed, 949 deletions(-) delete mode 100644 dangerfile.ts diff --git a/dangerfile.ts b/dangerfile.ts deleted file mode 100644 index 60fbf7c6f4..0000000000 --- a/dangerfile.ts +++ /dev/null @@ -1,100 +0,0 @@ -// Removed import -const includes = require('lodash.includes'); -import * as fs from 'fs'; - -// Setup -const pr = danger.github.pr; -const commits = danger.github.commits; -const modified = danger.git.modified_files; -const bodyAndTitle = (pr.body + pr.title).toLowerCase(); - -// Custom modifiers for people submitting PRs to be able to say "skip this" -const trivialPR = bodyAndTitle.includes('trivial'); -const acceptedNoTests = bodyAndTitle.includes('skip new tests'); - -const typescriptOnly = (file: string) => includes(file, '.ts'); -const filesOnly = (file: string) => fs.existsSync(file) && fs.lstatSync(file).isFile(); - -// Custom subsets of known files -const modifiedAppFiles = modified - .filter(p => includes(p, 'src/')) - .filter(p => filesOnly(p) && typescriptOnly(p)); - -const modifiedTestFiles = modified.filter(p => includes(p, 'test/')); - -// Takes a list of file paths, and converts it into clickable links -const linkableFiles = paths => { - const repoURL = danger.github.pr.head.repo.html_url; - const ref = danger.github.pr.head.ref; - const links = paths.map(path => { - return createLink(`${repoURL}/blob/${ref}/${path}`, path); - }); - return toSentence(links); -}; - -// ["1", "2", "3"] to "1, 2 and 3" -const toSentence = (array: Array): string => { - if (array.length === 1) { - return array[0]; - } - return array.slice(0, array.length - 1).join(', ') + ' and ' + array.pop(); -}; - -// ("/href/thing", "name") to "name" -const createLink = (href: string, text: string): string => `${text}`; - -// Raise about missing code inside files -const raiseIssueAboutPaths = (type: Function, paths: string[], codeToInclude: string) => { - if (paths.length > 0) { - const files = linkableFiles(paths); - const strict = '' + codeToInclude + ''; - type(`Please ensure that ${strict} is enabled on: ${files}`); - } -}; - -const authors = commits.map(x => x.author && x.author.login); -const isBot = authors.some(x => ['greenkeeper', 'renovate'].indexOf(x) > -1); - -if (!isBot) { - // Rules - // When there are app-changes and it's not a PR marked as trivial, expect - // there to be CHANGELOG changes. - const changelogChanges = includes(modified, 'Changelog.md'); - if (modifiedAppFiles.length > 0 && !trivialPR && !changelogChanges) { - fail('No CHANGELOG added.'); - } - - // No PR is too small to warrant a paragraph or two of summary - if (pr.body.length === 0) { - fail('Please add a description to your PR.'); - } - - const hasAppChanges = modifiedAppFiles.length > 0; - - const hasTestChanges = modifiedTestFiles.length > 0; - - // Warn when there is a big PR - const bigPRThreshold = 500; - if (danger.github.pr.additions + danger.github.pr.deletions > bigPRThreshold) { - warn(':exclamation: Big PR'); - } - - // Warn if there are library changes, but not tests - if (hasAppChanges && !hasTestChanges) { - warn( - "There are library changes, but not tests. That's OK as long as you're refactoring existing code", - ); - } - - // Be careful of leaving testing shortcuts in the codebase - const onlyTestFiles = modifiedTestFiles.filter(x => { - const content = fs.readFileSync(x).toString(); - return ( - content.includes('it.only') || - content.includes('describe.only') || - content.includes('fdescribe') || - content.includes('fit(') - ); - }); - raiseIssueAboutPaths(fail, onlyTestFiles, 'an `only` was left in the test'); -} diff --git a/package-lock.json b/package-lock.json index eae3a209f3..d623eeecb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -191,24 +191,6 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, - "@babel/polyfill": { - "version": "7.2.5", - "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.2.5.tgz", - "integrity": "sha512-8Y/t3MWThtMLYr0YNC/Q76tqN1w30+b0uQMeFUYauG2UGTR19zyUtFrAzT23zNtBxPp+LbE5E/nwV/q/r3y6ug==", - "dev": true, - "requires": { - "core-js": "^2.5.7", - "regenerator-runtime": "^0.12.0" - }, - "dependencies": { - "regenerator-runtime": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", - "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==", - "dev": true - } - } - }, "@babel/runtime": { "version": "7.3.4", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.3.4.tgz", @@ -646,51 +628,6 @@ "@types/yargs": "^12.0.9" } }, - "@octokit/endpoint": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-3.2.3.tgz", - "integrity": "sha512-yUPCt4vMIOclox13CUxzuKiPJIFo46b/6GhUnUTw5QySczN1L0DtSxgmIZrZV4SAb9EyAqrceoyrWoYVnfF2AA==", - "dev": true, - "requires": { - "deepmerge": "3.2.0", - "is-plain-object": "^2.0.4", - "universal-user-agent": "^2.0.1", - "url-template": "^2.0.8" - } - }, - "@octokit/request": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-2.4.2.tgz", - "integrity": "sha512-lxVlYYvwGbKSHXfbPk5vxEA8w4zHOH1wobado4a9EfsyD3Cbhuhus1w0Ye9Ro0eMubGO8kNy5d+xNFisM3Tvaw==", - "dev": true, - "requires": { - "@octokit/endpoint": "^3.2.0", - "deprecation": "^1.0.1", - "is-plain-object": "^2.0.4", - "node-fetch": "^2.3.0", - "once": "^1.4.0", - "universal-user-agent": "^2.0.1" - } - }, - "@octokit/rest": { - "version": "16.18.1", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.18.1.tgz", - "integrity": "sha512-ozKUH4KCusmPQ6xHxF2q1IDVM5tPbmmAUP69yRLd98BH16mqOVwMkm6zLCUJPD03IVhG+YNHShJDc077CTkIWg==", - "dev": true, - "requires": { - "@octokit/request": "2.4.2", - "before-after-hook": "^1.4.0", - "btoa-lite": "^1.0.0", - "deprecation": "^1.0.1", - "lodash.get": "^4.4.2", - "lodash.set": "^4.3.2", - "lodash.uniq": "^4.5.0", - "octokit-pagination-methods": "^1.1.0", - "once": "^1.4.0", - "universal-user-agent": "^2.0.0", - "url-template": "^2.0.8" - } - }, "@types/babel__core": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.0.tgz", @@ -938,15 +875,6 @@ "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", "dev": true }, - "agent-base": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", - "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", - "dev": true, - "requires": { - "es6-promisify": "^5.0.0" - } - }, "ajv": { "version": "6.10.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", @@ -2106,12 +2034,6 @@ "tweetnacl": "^0.14.3" } }, - "before-after-hook": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-1.4.0.tgz", - "integrity": "sha512-l5r9ir56nda3qu14nAXIlyq1MmUSs0meCIaFAh8HwkFwP1F8eToOuS3ah2VAHHcY04jaYD7FpJC5JTXHYRbkzg==", - "dev": true - }, "bl": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", @@ -2316,12 +2238,6 @@ "node-int64": "^0.4.0" } }, - "btoa-lite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz", - "integrity": "sha1-M3dm2hWAEhD92VbCLpxokaudAzc=", - "dev": true - }, "buffer-alloc": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", @@ -2338,12 +2254,6 @@ "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", "dev": true }, - "buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=", - "dev": true - }, "buffer-fill": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", @@ -2798,107 +2708,6 @@ "integrity": "sha512-rINUZXOkcBmoHWEyu7JdHu5JMzkGRoMX4ov9830WNgxf5UYxcBUO0QTKAqeJ5EZfSdlrcJYkC8WwfVW7JYi4yg==", "dev": true }, - "danger": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/danger/-/danger-7.0.15.tgz", - "integrity": "sha512-A4G3+5/JW19tsB9o+QWlEofRz9WJgzqhlzaCLWBbav8rc9Y2IEAJY6cnervPdeCR1JEjAq/RCXL2TChOCas6Dg==", - "dev": true, - "requires": { - "@babel/polyfill": "^7.2.5", - "@octokit/rest": "^16.14.1", - "chalk": "^2.3.0", - "commander": "^2.18.0", - "debug": "^4.1.1", - "get-stdin": "^6.0.0", - "http-proxy-agent": "^2.1.0", - "https-proxy-agent": "^2.2.1", - "hyperlinker": "^1.0.0", - "jsome": "^2.3.25", - "json5": "^2.1.0", - "jsonpointer": "^4.0.1", - "jsonwebtoken": "^8.4.0", - "lodash.find": "^4.6.0", - "lodash.includes": "^4.3.0", - "lodash.isobject": "^3.0.2", - "lodash.keys": "^4.0.8", - "lodash.memoize": "^4.1.2", - "memfs-or-file-map-to-github-branch": "^1.1.0", - "node-cleanup": "^2.1.2", - "node-fetch": "^2.3.0", - "override-require": "^1.1.1", - "p-limit": "^2.1.0", - "parse-diff": "^0.5.1", - "parse-git-config": "^2.0.3", - "parse-github-url": "^1.0.2", - "parse-link-header": "^1.0.1", - "pinpoint": "^1.1.0", - "readline-sync": "^1.4.9", - "require-from-string": "^2.0.2", - "rfc6902": "^3.0.1", - "supports-hyperlinks": "^1.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "json5": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", - "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -2983,12 +2792,6 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, - "deepmerge": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-3.2.0.tgz", - "integrity": "sha512-6+LuZGU7QCNUnAJyX8cIrlzoEgggTM6B7mm+znKOX4t5ltluT9KLjN6g61ECMS0LTsLW7yDpNoxhix5FZcrIow==", - "dev": true - }, "default-require-extensions": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", @@ -3060,12 +2863,6 @@ "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true }, - "deprecation": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-1.0.1.tgz", - "integrity": "sha512-ccVHpE72+tcIKaGMql33x5MAjKQIZrk+3x2GbJ7TeraUCZWHoT+KSZpoC+JQFsUBlSTXUrBaGiF0j6zVTepPLg==", - "dev": true - }, "detect-indent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", @@ -3165,15 +2962,6 @@ "safer-buffer": "^2.1.0" } }, - "ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, "electron-to-chromium": { "version": "1.3.116", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.116.tgz", @@ -3301,21 +3089,6 @@ "is-symbol": "^1.0.2" } }, - "es6-promise": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz", - "integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==", - "dev": true - }, - "es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "dev": true, - "requires": { - "es6-promise": "^4.0.3" - } - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -3469,15 +3242,6 @@ "integrity": "sha512-cebqLtV8KOZfw0UI8TEFWxtczxxC1jvyUvx6H4fyp1K1FN7A4Q+uggVUlOsI1K8AGU0rwOGqP8nCapdrw8CYQg==", "dev": true }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, "expect": { "version": "24.5.0", "resolved": "https://registry.npmjs.org/expect/-/expect-24.5.0.tgz", @@ -3736,12 +3500,6 @@ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", "dev": true }, - "fs-exists-sync": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", - "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=", - "dev": true - }, "fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", @@ -3810,12 +3568,6 @@ "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", "dev": true }, - "get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", - "dev": true - }, "get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", @@ -3837,17 +3589,6 @@ "assert-plus": "^1.0.0" } }, - "git-config-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/git-config-path/-/git-config-path-1.0.1.tgz", - "integrity": "sha1-bTP37WPbDQ4RgTFQO6s6ykfVRmQ=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "fs-exists-sync": "^0.1.0", - "homedir-polyfill": "^1.0.0" - } - }, "github-build": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/github-build/-/github-build-1.2.0.tgz", @@ -4078,15 +3819,6 @@ "os-tmpdir": "^1.0.1" } }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, "hosted-git-info": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", @@ -4138,27 +3870,6 @@ } } }, - "http-proxy-agent": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", - "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", - "dev": true, - "requires": { - "agent-base": "4", - "debug": "3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -4170,39 +3881,6 @@ "sshpk": "^1.7.0" } }, - "https-proxy-agent": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", - "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", - "dev": true, - "requires": { - "agent-base": "^4.1.0", - "debug": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - } - } - }, - "hyperlinker": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hyperlinker/-/hyperlinker-1.0.0.tgz", - "integrity": "sha512-Ty8UblRWFEcfSuIaajM34LdPXIhbs1ajEX/BBPv24J+enSVaEVY63xQ6lTO9VRYS5LAoghIG0IDJ+p+IPzKUQQ==", - "dev": true - }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -4277,12 +3955,6 @@ "loose-envify": "^1.0.0" } }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true - }, "is-accessor-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", @@ -5971,48 +5643,6 @@ "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", "dev": true }, - "jsome": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/jsome/-/jsome-2.5.0.tgz", - "integrity": "sha1-XkF+70NB/+uD7ov6kmWzbVb+Se0=", - "dev": true, - "requires": { - "chalk": "^2.3.0", - "json-stringify-safe": "^5.0.1", - "yargs": "^11.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -6052,38 +5682,6 @@ "graceful-fs": "^4.1.6" } }, - "jsonpointer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", - "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", - "dev": true - }, - "jsonwebtoken": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.0.tgz", - "integrity": "sha512-IqEycp0znWHNA11TpYi77bVgyBO/pGESDh7Ajhas+u0ttkGkKYIIAjniL4Bw5+oVejVF+SYkaI7XKfwCCyeTuA==", - "dev": true, - "requires": { - "jws": "^3.2.1", - "lodash.includes": "^4.3.0", - "lodash.isboolean": "^3.0.3", - "lodash.isinteger": "^4.0.4", - "lodash.isnumber": "^3.0.3", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.once": "^4.0.0", - "ms": "^2.1.1", - "semver": "^5.6.0" - }, - "dependencies": { - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - } - } - }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -6096,27 +5694,6 @@ "verror": "1.10.0" } }, - "jwa": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.0.tgz", - "integrity": "sha512-mt6IHaq0ZZWDBspg0Pheu3r9sVNMEZn+GJe1zcdYyhFcDSclp3J8xEdO4PjZolZ2i8xlaVU1LetHM0nJejYsEw==", - "dev": true, - "requires": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "jws": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.1.tgz", - "integrity": "sha512-bGA2omSrFUkd72dhh05bIAN832znP4wOU3lfuXtRBuGTbsmNmDXMQg28f0Vsxaxgk4myF5YkKQpz6qeRpMgX9g==", - "dev": true, - "requires": { - "jwa": "^1.2.0", - "safe-buffer": "^5.0.1" - } - }, "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", @@ -6129,15 +5706,6 @@ "integrity": "sha512-3h7B2WRT5LNXOtQiAaWonilegHcPSf9nLVXlSTci8lu1dZUuui61+EsPEZqSVxY7rXYmB2DVKMQILxaO5WL61Q==", "dev": true }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, "lcov-parse": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", @@ -6200,95 +5768,23 @@ "integrity": "sha1-yQRGkMIeBClL6qUXcS/e0fqI3pg=", "dev": true }, - "lodash.find": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.find/-/lodash.find-4.6.0.tgz", - "integrity": "sha1-ywcE1Hq3F4n/oN6Ll92Sb7iLE7E=", - "dev": true - }, "lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", - "dev": true - }, "lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=", "dev": true }, - "lodash.isboolean": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=", - "dev": true - }, "lodash.isequal": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" }, - "lodash.isinteger": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=", - "dev": true - }, - "lodash.isnumber": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=", - "dev": true - }, - "lodash.isobject": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-3.0.2.tgz", - "integrity": "sha1-PI+41bW/S/kK4G4U8qUwpO2TXh0=", - "dev": true - }, - "lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", - "dev": true - }, - "lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=", - "dev": true - }, - "lodash.keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-4.2.0.tgz", - "integrity": "sha1-oIYCrBLk+4P5H8H7ejYKTZujUgU=", - "dev": true - }, - "lodash.memoize": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", - "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", - "dev": true - }, - "lodash.once": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=", - "dev": true - }, - "lodash.set": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", - "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=", - "dev": true - }, "lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", @@ -6301,12 +5797,6 @@ "integrity": "sha1-Ph8lZcQxdU1Uq1fy7RdBk5KFyh0=", "dev": true }, - "lodash.uniq": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", - "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", - "dev": true - }, "log-driver": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", @@ -6331,12 +5821,6 @@ "yallist": "^2.1.2" } }, - "macos-release": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.0.0.tgz", - "integrity": "sha512-iCM3ZGeqIzlrH7KxYK+fphlJpCCczyHXc+HhRVbEu9uNTCrzYJjvvtefzeKTCVHd5AP/aD/fzC80JZ4ZP+dQ/A==", - "dev": true - }, "magic-string": { "version": "0.25.2", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.2.tgz", @@ -6400,21 +5884,6 @@ "object-visit": "^1.0.0" } }, - "mem": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "memfs-or-file-map-to-github-branch": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/memfs-or-file-map-to-github-branch/-/memfs-or-file-map-to-github-branch-1.1.2.tgz", - "integrity": "sha512-D2JKK2DTuVYQqquBWco3K6UfSVyVwmd58dgNqh+TgxHOZdTmR8I130gjMbVCkemDl/EzqDA62417cJxKL3/FFA==", - "dev": true - }, "merge-stream": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", @@ -6481,12 +5950,6 @@ "mime-db": "~1.38.0" } }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, "mimic-response": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", @@ -6651,12 +6114,6 @@ "integrity": "sha1-esGavSl+Caf3KnFUXZUbUX5N3iw=", "dev": true }, - "node-fetch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz", - "integrity": "sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA==", - "dev": true - }, "node-gyp": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", @@ -6924,12 +6381,6 @@ "has": "^1.0.3" } }, - "octokit-pagination-methods": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz", - "integrity": "sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==", - "dev": true - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -6986,55 +6437,6 @@ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, - "os-locale": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", - "dev": true, - "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" - }, - "dependencies": { - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "dev": true, - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - } - } - }, - "os-name": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.0.0.tgz", - "integrity": "sha512-7c74tib2FsdFbQ3W+qj8Tyd1R3Z6tuVRNNxXjJcZ4NgjIEQU9N/prVMqcW29XZPXGACqaXN3jq58/6hoaoXH6g==", - "dev": true, - "requires": { - "macos-release": "^2.0.0", - "windows-release": "^3.1.0" - } - }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -7051,12 +6453,6 @@ "os-tmpdir": "^1.0.0" } }, - "override-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/override-require/-/override-require-1.1.1.tgz", - "integrity": "sha1-auIvresfhQ/7DPTCD/e4fl62UN8=", - "dev": true - }, "p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", @@ -7114,29 +6510,6 @@ "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", "dev": true }, - "parse-diff": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/parse-diff/-/parse-diff-0.5.1.tgz", - "integrity": "sha512-/qXjo9x/pFa5bVk/ZXaJD0yr3Tf3Yp6MWWMr4vnUmumDrE0yoE6YDH2A8vmcCD/Ko3tW2o0X+zGYh2zMLXshsg==", - "dev": true - }, - "parse-git-config": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-2.0.3.tgz", - "integrity": "sha512-Js7ueMZOVSZ3tP8C7E3KZiHv6QQl7lnJ+OkbxoaFazzSa2KyEHqApfGbU3XboUgUnq4ZuUmskUpYKTNx01fm5A==", - "dev": true, - "requires": { - "expand-tilde": "^2.0.2", - "git-config-path": "^1.0.1", - "ini": "^1.3.5" - } - }, - "parse-github-url": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz", - "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==", - "dev": true - }, "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", @@ -7147,21 +6520,6 @@ "json-parse-better-errors": "^1.0.1" } }, - "parse-link-header": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-link-header/-/parse-link-header-1.0.1.tgz", - "integrity": "sha1-vt/g0hGK64S+deewJUGeyKYRQKc=", - "dev": true, - "requires": { - "xtend": "~4.0.1" - } - }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, "parse5": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz", @@ -7231,12 +6589,6 @@ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true }, - "pinpoint": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pinpoint/-/pinpoint-1.1.0.tgz", - "integrity": "sha1-DPd1eml38b9/ajIge3CeN3OI6HQ=", - "dev": true - }, "pirates": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", @@ -7609,12 +6961,6 @@ "util-deprecate": "~1.0.1" } }, - "readline-sync": { - "version": "1.4.9", - "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.9.tgz", - "integrity": "sha1-PtqOZfI80qF+YTAbHwADOWr17No=", - "dev": true - }, "realpath-native": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.1.0.tgz", @@ -7856,12 +7202,6 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true - }, "require-main-filename": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", @@ -7904,12 +7244,6 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, - "rfc6902": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/rfc6902/-/rfc6902-3.0.1.tgz", - "integrity": "sha512-a4t5OlaOgAejBg48/lkyQMcV6EWpljjSjmXAtSXLhw83x1OhlcVGLMLf//GoUSpHsWt8x/7oxaf5FEGM9QH/iQ==", - "dev": true - }, "rimraf": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", @@ -8656,41 +7990,6 @@ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, - "supports-hyperlinks": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-1.0.1.tgz", - "integrity": "sha512-HHi5kVSefKaJkGYXbDuKbUGRVxqnWGn3J2e39CYcNJEfWciGq2zYtOhXLTlvrOZW1QU7VX67w7fMmWafHX9Pfw==", - "dev": true, - "requires": { - "has-flag": "^2.0.0", - "supports-color": "^5.0.0" - }, - "dependencies": { - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - }, - "dependencies": { - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - } - } - } - } - }, "symbol-observable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", @@ -9157,15 +8456,6 @@ } } }, - "universal-user-agent": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-2.0.3.tgz", - "integrity": "sha512-eRHEHhChCBHrZsA4WEhdgiOKgdvgrMIHwnwnqD0r5C6AO8kwKcG7qSku3iXdhvHL3YvsS9ZkSGN8h/hIpoFC8g==", - "dev": true, - "requires": { - "os-name": "^3.0.0" - } - }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -9227,12 +8517,6 @@ "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", "dev": true }, - "url-template": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", - "integrity": "sha1-/FZaPMy/93MMd19WQflVV5FDnyE=", - "dev": true - }, "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", @@ -9421,32 +8705,6 @@ } } }, - "windows-release": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.1.0.tgz", - "integrity": "sha512-hBb7m7acFgQPQc222uEQTmdcGLeBmQLNLFIh0rDk3CwFOBrfjefLzEfEfmpMq8Af/n/GnFf3eYf203FY1PmudA==", - "dev": true, - "requires": { - "execa": "^0.10.0" - }, - "dependencies": { - "execa": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", - "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - } - } - }, "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", @@ -9525,111 +8783,6 @@ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "dev": true }, - "yargs": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", - "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.1.1", - "find-up": "^2.1.0", - "get-caller-file": "^1.0.1", - "os-locale": "^2.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^9.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "yargs-parser": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", - "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", - "dev": true, - "requires": { - "camelcase": "^4.1.0" - } - }, "zen-observable": { "version": "0.8.13", "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.13.tgz", diff --git a/package.json b/package.json index 5655de18e4..31272339f2 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ }, "scripts": { "compile": "tsc -p ./tsconfig.cjs.json", - "danger": "danger run --verbose", "deploy": "cd lib && npm publish", "filesize": "bundlesize", "jest": "jest --runInBand --coverage", @@ -124,7 +123,6 @@ "babel-preset-env": "1.7.0", "bundlesize": "0.17.1", "coveralls": "3.0.3", - "danger": "7.0.15", "enzyme": "3.9.0", "enzyme-adapter-react-16": "1.11.2", "graphql": "14.1.1", From a38ebee3a06261609c8e6b8b356acf6f018d3c52 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Mon, 8 Apr 2019 15:38:34 -0400 Subject: [PATCH 013/113] Remove duplicate renovate config; Adjust to use parent defaults --- package.json | 11 ++--------- renovate.json | 13 ------------- 2 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 renovate.json diff --git a/package.json b/package.json index 31272339f2..8ed04aff70 100644 --- a/package.json +++ b/package.json @@ -52,16 +52,9 @@ ], "renovate": { "extends": [ - "config:base", - "schedule:nonOfficeHours", - ":pinOnlyDevDependencies" + "apollo-open-source" ], - "semanticCommits": true, - "timezone": "America/New_York", - "automerge": false, - "labels": [ - "dependencies" - ] + "automerge": false }, "jest": { "testEnvironment": "jsdom", diff --git a/renovate.json b/renovate.json deleted file mode 100644 index bfeb34e1c5..0000000000 --- a/renovate.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": [":pinOnlyDevDependencies"], - "semanticCommits": true, - "depTypes": [{ "depType": "dependencies", "pinVersions": false }], - "timezone": "America/Los_Angeles", - "schedule": ["after 10pm and before 5am on every weekday"], - "rebaseStalePrs": true, - "prCreation": "not-pending", - "automerge": "minor", - "labels": ["tooling", "dependencies"], - "assignees": ["@hwillson"], - "reviewers": ["@hwillson"] -} From 969d97dee5154b96593d5612e414da1b3db30efa Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Mon, 8 Apr 2019 15:41:05 -0400 Subject: [PATCH 014/113] Copyright fix --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 0808d68832..8c09781ba7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Ben Newman +Copyright (c) 2019 Meteor Development Group, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 29f9659ed18ae9af80f00d3efd4ec5c0d88f0261 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Mon, 8 Apr 2019 15:49:50 -0400 Subject: [PATCH 015/113] Support scripts cleanup - Adjust `prepare-package.sh` to reflect current `package.json` - Remove `test-examples.sh` config and calls, since we are no longer testing examples (and will be moving the example apps out) --- package.json | 1 - scripts/prepare-package.sh | 7 ++----- scripts/test-examples.sh | 11 ----------- 3 files changed, 2 insertions(+), 17 deletions(-) delete mode 100755 scripts/test-examples.sh diff --git a/package.json b/package.json index 8ed04aff70..161182acda 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "prefilesize": "npm run compile", "prettier": "prettier --write \"./**/*.{js,jsx,ts*,md,graphql,json}\"", "test": "npm run type-check && npm run jest", - "test-examples": ". ./test-examples.sh", "test-watch": "jest --watch", "test:compiled": "npm run test:compiled:cjs && npm run test:compiled:umd", "test:compiled:cjs": "jest --config jest.cjs.config.js --runInBand", diff --git a/scripts/prepare-package.sh b/scripts/prepare-package.sh index 7231374e4d..05d5bcc049 100755 --- a/scripts/prepare-package.sh +++ b/scripts/prepare-package.sh @@ -6,16 +6,14 @@ # var language = require('react-apollo/server'); # -# Ensure a vanilla package.json before deploying so other tools do not interpret -# The built output as requiring any further transformation. +# Ensure a vanilla package.json before deploying so other tools do not +# interpret the built output as requiring any further transformation. node -e "var package = require('./package.json'); \ delete package.private; \ delete package.babel; \ delete package.jest; \ delete package.bundlesize; \ - delete package[\"husky\"]; \ delete package.scripts; \ - delete package.options; \ delete package.prettier; \ delete package.devDependencies; \ package.main = 'react-apollo.cjs.js'; \ @@ -26,7 +24,6 @@ node -e "var package = require('./package.json'); \ fs.writeFileSync('./lib/package.json', JSON.stringify(package, null, 2)); \ " - # Copy few more files to ./lib cp README.md lib/ cp LICENSE lib/ diff --git a/scripts/test-examples.sh b/scripts/test-examples.sh deleted file mode 100755 index 9519882e73..0000000000 --- a/scripts/test-examples.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -EXAMPLES_DIR=$(dirname $0)/../examples - -cd $EXAMPLES_DIR/base -npm install -npm test - -cd $EXAMPLES_DIR/components -npm install -npm test From 54beac677904fa9785c7e9690612fe896170350c Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Mon, 8 Apr 2019 15:53:12 -0400 Subject: [PATCH 016/113] Goodbye Probot! Probot is like a bottle of tequila. Sure, it sounds like a lot of fun and when you're in the middle of it, it is! But when the tequila aftermath happens, it hurts. Except in Probot's case you're not just hurting yourself, you're hurting OSS community members. --- .github/no-response.yml | 12 ------------ .github/probot-snooze.yml | 4 ---- .github/stale.yml | 16 ---------------- 3 files changed, 32 deletions(-) delete mode 100644 .github/no-response.yml delete mode 100644 .github/probot-snooze.yml delete mode 100644 .github/stale.yml diff --git a/.github/no-response.yml b/.github/no-response.yml deleted file mode 100644 index 8577286aa9..0000000000 --- a/.github/no-response.yml +++ /dev/null @@ -1,12 +0,0 @@ -# Probot configuration -# Number of days of inactivity before an Issue is closed for lack of response -daysUntilClose: 14 -# Label requiring a response -responseRequiredLabel: waiting-response -# Comment to post when closing an Issue for lack of response. Set to `false` to disable -closeComment: > - This issue has been automatically closed because there has been no response - to the request for more information from the author. With only the - information that is currently in the issue, we sadly don't have enough information - to take action. Please reach out if you have or find the information we need so - that we can investigate further! Thank you for contributing to React Apollo! diff --git a/.github/probot-snooze.yml b/.github/probot-snooze.yml deleted file mode 100644 index 8f993fc754..0000000000 --- a/.github/probot-snooze.yml +++ /dev/null @@ -1,4 +0,0 @@ -# Default length (in days) to snooze an item if no date is specified -defaultSnoozeDuration: 7, -labelName : 'revist', -labelColor : 'ededed' diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 10cd6c302e..0000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,16 +0,0 @@ -# thre weeks without any progress / comments mark issue as stale -daysUntilStale: 21 -# one week after marked stale, close the issue -daysUntilClose: 14 -staleLabel: no-recent-activity -# whitelist of lables to not mark stale -exemptLables: - - feature - - security - - enhancement -# text of the comment when marking issue as stale -markComment: > - This issue has been automatically labled because it has not had recent activity. If you have not received a response from anyone, please mention the repository maintainer (most likely @jbaxleyiii). It will be closed if no further activity occurs. Thank you for your contributions to React Apollo! -# text of the comment when closing an issue -closeComment: > - This issue has been automatically closed because it has not had recent activity after being marked as no recent activyt. If you belive this issue is still a problem or should be reopened, please reopen it! Thank you for your contributions to React Apollo! From e0d205c8bb77115b35341d1a788d9d46bee608d7 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Mon, 8 Apr 2019 15:57:36 -0400 Subject: [PATCH 017/113] Remove Apollo Bot config settings We poured one out for Apollo Bot a while back, so let's get rid of the leftover config. --- .github/settings.yml | 72 -------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 .github/settings.yml diff --git a/.github/settings.yml b/.github/settings.yml deleted file mode 100644 index 35fc3ebde4..0000000000 --- a/.github/settings.yml +++ /dev/null @@ -1,72 +0,0 @@ -repository: - # See https://developer.github.com/v3/repos/#edit for all available settings. - - homepage: http://dev.apollodata.com/ - private: false - has_issues: true - has_wiki: false - has_downloads: true - has_projects: false - -# Labels: define labels for Issues and Pull Requests -labels: - # statuses to signal contributor / maintainers action - - name: help-wanted - color: 159818 - - name: discussion - color: e99695 - - name: question - color: cc317c - - name: waiting-response - color: fbca04 - - name: reproduction-needed - color: fbca04 - - # type of the issue / PR - - name: bug - color: fc2929 - - name: docs - color: c2e0c6 - - name: feature - color: 5319e7 - - name: dependencies - color: ededed - - name: idea - color: fbca04 - - name: perf - color: 1d76db - - name: tooling - color: c5def5 - - name: refactor - color: bfdadc - - name: usability - color: d4c5f9 - - name: good-first-issue - color: bfdadc - - # status of the issue / PR - - name: duplicate - color: d4c5f9 - - name: can't-reproduce - color: bfd4f2 - - name: confirmed - color: d93f0b - - name: in-progress - color: ededed - - name: revist - color: ededed - - # priority - - name: high-priority - color: b60205 - - name: medium-priority - color: e99695 - - name: low-priority - color: fef2c0 - - name: pull-requests-encouraged - color: 0e8a16 - - # tech specific - - name: typescript - color: 1d76db - From 29a45366621aa021864c3a955a84b06a51aa95d2 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Sun, 14 Apr 2019 11:03:45 -0400 Subject: [PATCH 018/113] Lay the initial monorepo foundation This is the first major step towards our planned RA 3.0 restructuring goals. This commit introduces lerna and a new monorepo structure into the project, splitting existing core functionality up into the following separate packages: - @apollo/react-common - @apollo/react-components - @apollo/react-hoc - @apollo/react-hooks - @apollo/react-testing All existing code has been split up and moved into the packages they best align with, and each package now has full passing tests. As we introduce Hooks into the project, the contents of these packages will change, so the current location of certain functionality is not set in stone. --- .circleci/config.yml | 71 +- .gitignore | 40 +- .npmignore | 1 - .prettierignore | 3 +- .vscode/settings.json | 3 + config/jest.config.js | 13 + config/prettier.config.js | 4 + config/tests-setup.ts | 3 + tsconfig.json => config/tsconfig.base.json | 10 +- config/tsconfig.cjs.json | 6 + examples/base/README.md | 8 - examples/base/package.json | 25 - examples/base/public/favicon.ico | Bin 24838 -> 0 bytes examples/base/public/index.html | 40 - examples/base/public/manifest.json | 15 - examples/base/src/App.js | 56 - examples/base/src/__mocks__/data.js | 31 - examples/base/src/__tests__/App.js | 191 - .../src/__tests__/__snapshots__/App.js.snap | 78 - examples/base/src/index.js | 18 - examples/components/README.md | 8 - examples/components/package.json | 28 - examples/components/public/favicon.ico | Bin 3870 -> 0 bytes examples/components/public/index.html | 40 - examples/components/public/manifest.json | 15 - examples/components/src/App.js | 37 - examples/components/src/__mocks__/data.js | 31 - .../src/__tests__/__snapshots__/app.js.snap | 34 - .../__tests__/__snapshots__/character.js.snap | 52 - examples/components/src/__tests__/app.js | 72 - .../components/src/__tests__/character.js | 30 - examples/components/src/character.js | 24 - examples/components/src/index.js | 18 - examples/mutation/.gitignore | 21 - examples/mutation/README.md | 8 - examples/mutation/package.json | 28 - examples/mutation/public/favicon.ico | Bin 3870 -> 0 bytes examples/mutation/public/index.html | 40 - examples/mutation/public/manifest.json | 15 - examples/mutation/src/AddUser.js | 60 - .../src/__snapshots__/addUser.test.js.snap | 15 - examples/mutation/src/addUser.test.js | 86 - examples/mutation/src/index.css | 5 - examples/mutation/src/index.js | 18 - examples/rollup/.gitignore | 3 - examples/rollup/README.md | 21 - examples/rollup/index.html | 9 - examples/rollup/main.js | 50 - examples/rollup/package-lock.json | 2697 ------- examples/rollup/package.json | 32 - examples/rollup/rollup.config.js | 112 - examples/ssr/.babelrc | 8 - examples/ssr/.gitignore | 2 - examples/ssr/.meteor/.finished-upgraders | 18 - examples/ssr/.meteor/.gitignore | 1 - examples/ssr/.meteor/.id | 7 - examples/ssr/.meteor/packages | 20 - examples/ssr/.meteor/platforms | 2 - examples/ssr/.meteor/release | 1 - examples/ssr/.meteor/versions | 69 - examples/ssr/README.md | 10 - examples/ssr/client/main.html | 7 - examples/ssr/client/main.js | 27 - examples/ssr/imports/app.js | 49 - examples/ssr/imports/schema.js | 458 -- examples/ssr/imports/tests/chromedriver.js | 18 - examples/ssr/nightwatch.json | 33 - examples/ssr/package.json | 36 - examples/ssr/server/main.js | 53 - examples/ssr/tests/ssr.js | 65 - examples/typescript/.gitignore | 22 - examples/typescript/README.md | 8 - examples/typescript/package.json | 35 - examples/typescript/public/favicon.ico | Bin 24838 -> 0 bytes examples/typescript/public/index.html | 40 - examples/typescript/public/manifest.json | 15 - examples/typescript/schema.json | 2046 ----- examples/typescript/src/App.tsx | 5 - examples/typescript/src/Character.tsx | 45 - .../typescript/src/__generated__/types.ts | 78 - examples/typescript/src/__mocks__/data.ts | 32 - examples/typescript/src/index.tsx | 25 - examples/typescript/src/queries.ts | 15 - examples/typescript/src/schema.json | 2046 ----- examples/typescript/tsconfig.json | 30 - examples/typescript/tslint.json | 38 - jest.cjs.config.js | 13 - jest.umd.config.js | 13 - lerna.json | 4 + package-lock.json | 7040 +++++++---------- package.json | 206 +- packages/common/README.md | 0 packages/common/config/jest.config.js | 6 + .../common/config/rollup.config.js | 47 +- packages/common/config/tsconfig.cjs.json | 8 + packages/common/config/tsconfig.json | 8 + .../common/lib/context/ApolloConsumer.d.ts | 6 + packages/common/lib/context/ApolloConsumer.js | 14 + .../common/lib/context/ApolloConsumer.js.map | 1 + .../common/lib/context/ApolloContext.d.ts | 8 + packages/common/lib/context/ApolloContext.js | 12 + .../common/lib/context/ApolloContext.js.map | 1 + .../common/lib/context/ApolloProvider.d.ts | 7 + packages/common/lib/context/ApolloProvider.js | 17 + .../common/lib/context/ApolloProvider.js.map | 1 + packages/common/lib/index.d.ts | 4 + packages/common/lib/index.js | 5 + packages/common/lib/index.js.map | 1 + packages/common/lib/parser/parser.d.ts | 12 + packages/common/lib/parser/parser.js | 57 + packages/common/lib/parser/parser.js.map | 1 + packages/common/lib/react-common.cjs.js | 107 + packages/common/lib/react-common.esm.js | 98 + packages/common/lib/react-common.esm.js.map | 1 + packages/common/lib/react-common.umd.js | 110 + packages/common/package.json | 47 + .../common/src/context/ApolloConsumer.d.ts | 6 + packages/common/src/context/ApolloConsumer.js | 14 + .../common/src/context/ApolloConsumer.js.map | 1 + .../common/src/context}/ApolloConsumer.tsx | 9 +- .../common/src/context/ApolloContext.d.ts | 8 + packages/common/src/context/ApolloContext.js | 12 + .../common/src/context/ApolloContext.js.map | 1 + .../common/src/context}/ApolloContext.ts | 4 +- .../common/src/context/ApolloProvider.d.ts | 7 + packages/common/src/context/ApolloProvider.js | 17 + .../common/src/context/ApolloProvider.js.map | 1 + .../common/src/context/ApolloProvider.tsx | 38 + .../__tests__}/ApolloConsumer.test.tsx | 9 +- .../__tests__}/ApolloProvider.test.tsx | 15 +- packages/common/src/index.d.ts | 4 + packages/common/src/index.js | 5 + packages/common/src/index.js.map | 1 + packages/common/src/index.ts | 8 + .../src/parser/__tests__}/parser.test.ts | 22 +- packages/common/src/parser/parser.d.ts | 12 + packages/common/src/parser/parser.js | 57 + packages/common/src/parser/parser.js.map | 1 + {src => packages/common/src/parser}/parser.ts | 28 +- packages/components/README.md | 0 packages/components/config/jest.config.js | 6 + packages/components/config/rollup.config.js | 99 + packages/components/config/tsconfig.cjs.json | 8 + packages/components/config/tsconfig.json | 8 + packages/components/lib/Mutation.d.ts | 88 + packages/components/lib/Mutation.js | 144 + packages/components/lib/Mutation.js.map | 1 + packages/components/lib/Query.d.ts | 65 + packages/components/lib/Query.js | 249 + packages/components/lib/Query.js.map | 1 + packages/components/lib/Subscription.d.ts | 58 + packages/components/lib/Subscription.js | 131 + packages/components/lib/Subscription.js.map | 1 + packages/components/lib/index.d.ts | 8 + packages/components/lib/index.js | 8 + packages/components/lib/index.js.map | 1 + .../components/lib/react-components.cjs.js | 666 ++ .../components/lib/react-components.esm.js | 631 ++ .../lib/react-components.esm.js.map | 1 + .../components/lib/react-components.umd.js | 666 ++ .../components/lib/ssr/getDataFromTree.d.ts | 25 + .../components/lib/ssr/getDataFromTree.js | 79 + .../components/lib/ssr/getDataFromTree.js.map | 1 + .../lib/ssr/renderToStringWithData.d.ts | 2 + .../lib/ssr/renderToStringWithData.js | 8 + .../lib/ssr/renderToStringWithData.js.map | 1 + packages/components/lib/types.d.ts | 71 + packages/components/lib/types.js | 2 + packages/components/lib/types.js.map | 1 + packages/components/lib/useApolloClient.d.ts | 1 + packages/components/lib/useApolloClient.js | 10 + .../components/lib/useApolloClient.js.map | 1 + packages/components/lib/utils/getClient.d.ts | 6 + packages/components/lib/utils/getClient.js | 9 + .../components/lib/utils/getClient.js.map | 1 + .../components/lib/utils/shallowEqual.d.ts | 1 + packages/components/lib/utils/shallowEqual.js | 24 + .../components/lib/utils/shallowEqual.js.map | 1 + packages/components/package.json | 58 + {src => packages/components/src}/Mutation.tsx | 62 +- {src => packages/components/src}/Query.tsx | 75 +- .../components/src/Subscription.tsx | 47 +- .../src/__tests__}/client/Mutation.test.tsx | 170 +- .../src/__tests__}/client/Query.test.tsx | 420 +- .../__tests__}/client/Subscription.test.tsx | 57 +- .../client/__snapshots__/Query.test.tsx.snap | 0 packages/components/src/index.ts | 38 + .../ssr/__tests__/getDataFromTree.test.tsx | 128 + .../src/ssr/__tests__/server.test.tsx | 204 + .../components/src/ssr}/getDataFromTree.ts | 20 +- .../src/ssr/renderToStringWithData.ts | 11 + {src => packages/components/src}/types.ts | 268 +- .../components/src}/useApolloClient.ts | 5 +- .../components/src/utils/getClient.ts | 2 +- .../components/src}/utils/shallowEqual.ts | 0 packages/hoc/README.md | 0 packages/hoc/config/jest.config.js | 6 + packages/hoc/config/rollup.config.js | 101 + packages/hoc/config/tsconfig.cjs.json | 8 + packages/hoc/config/tsconfig.json | 8 + packages/hoc/lib/graphql.d.ts | 4 + packages/hoc/lib/graphql.js | 20 + packages/hoc/lib/graphql.js.map | 1 + packages/hoc/lib/hoc-utils.d.ts | 16 + packages/hoc/lib/hoc-utils.js | 51 + packages/hoc/lib/hoc-utils.js.map | 1 + packages/hoc/lib/index.d.ts | 5 + packages/hoc/lib/index.js | 13 + packages/hoc/lib/index.js.map | 1 + packages/hoc/lib/mutation-hoc.d.ts | 4 + packages/hoc/lib/mutation-hoc.js | 57 + packages/hoc/lib/mutation-hoc.js.map | 1 + packages/hoc/lib/query-hoc.d.ts | 4 + packages/hoc/lib/query-hoc.js | 73 + packages/hoc/lib/query-hoc.js.map | 1 + packages/hoc/lib/react-hoc.cjs.js | 296 + packages/hoc/lib/react-hoc.esm.js | 287 + packages/hoc/lib/react-hoc.esm.js.map | 1 + packages/hoc/lib/react-hoc.umd.js | 296 + packages/hoc/lib/subscription-hoc.d.ts | 4 + packages/hoc/lib/subscription-hoc.js | 80 + packages/hoc/lib/subscription-hoc.js.map | 1 + packages/hoc/lib/withApollo.d.ts | 7 + packages/hoc/lib/withApollo.js | 48 + packages/hoc/lib/withApollo.js.map | 1 + packages/hoc/package.json | 53 + .../hoc/src/__tests__/MockedProvider.test.tsx | 166 +- .../MockedProvider.test.tsx.snap | 0 .../hoc/src/__tests__}/client-option.test.tsx | 16 +- .../hoc/src/__tests__}/fragments.test.tsx | 16 +- .../src/__tests__}/mutations/index.test.tsx | 30 +- .../__tests__}/mutations/lifecycle.test.tsx | 11 +- .../src/__tests__}/mutations/queries.test.tsx | 54 +- .../mutations/recycled-queries.test.tsx | 25 +- .../__snapshots__/lifecycle.test.tsx.snap | 0 .../hoc/src/__tests__}/queries/api.test.tsx | 25 +- .../src/__tests__}/queries/errors.test.tsx | 80 +- .../hoc/src/__tests__}/queries/index.test.tsx | 76 +- .../src/__tests__}/queries/lifecycle.test.tsx | 46 +- .../src/__tests__}/queries/loading.test.tsx | 49 +- .../queries/observableQuery.test.tsx | 26 +- .../src/__tests__}/queries/polling.test.tsx | 10 +- .../src/__tests__}/queries/reducer.test.tsx | 16 +- .../hoc/src/__tests__}/queries/skip.test.tsx | 50 +- .../__tests__}/queries/updateQuery.test.tsx | 25 +- .../src/__tests__}/shared-operations.test.tsx | 93 +- .../__tests__/ssr}/getDataFromTree.test.tsx | 303 +- .../hoc/src/__tests__/ssr}/server.test.tsx | 121 +- .../hoc/src/__tests__}/statics.test.tsx | 9 +- .../subscriptions}/subscriptions.test.tsx | 79 +- {src => packages/hoc/src}/graphql.tsx | 18 +- {src => packages/hoc/src}/hoc-utils.tsx | 21 +- packages/hoc/src/index.ts | 5 + {src => packages/hoc/src}/mutation-hoc.tsx | 46 +- {src => packages/hoc/src}/query-hoc.tsx | 42 +- .../hoc/src}/subscription-hoc.tsx | 51 +- {src => packages/hoc/src}/withApollo.tsx | 16 +- packages/hooks/README.md | 0 packages/hooks/package.json | 24 + packages/testing/README.md | 0 packages/testing/config/jest.config.js | 10 + packages/testing/config/rollup.config.js | 73 + packages/testing/config/tsconfig.cjs.json | 7 + packages/testing/config/tsconfig.json | 7 + packages/testing/lib/index.d.ts | 9 + packages/testing/lib/index.js | 10 + packages/testing/lib/index.js.map | 1 + .../testing/lib/mocks/MockedProvider.d.ts | 22 + packages/testing/lib/mocks/MockedProvider.js | 34 + .../testing/lib/mocks/MockedProvider.js.map | 1 + packages/testing/lib/mocks/mockLink.d.ts | 19 + packages/testing/lib/mocks/mockLink.js | 104 + packages/testing/lib/mocks/mockLink.js.map | 1 + .../lib/mocks/mockSubscriptionLink.d.ts | 22 + .../testing/lib/mocks/mockSubscriptionLink.js | 48 + .../lib/mocks/mockSubscriptionLink.js.map | 1 + packages/testing/lib/react-testing.cjs.js | 5614 +++++++++++++ packages/testing/lib/react-testing.esm.js | 5599 +++++++++++++ packages/testing/lib/react-testing.esm.js.map | 1 + packages/testing/lib/react-testing.umd.js | 5615 +++++++++++++ .../testing/lib/utils/catchAsyncError.d.ts | 2 + packages/testing/lib/utils/catchAsyncError.js | 9 + .../testing/lib/utils/catchAsyncError.js.map | 1 + packages/testing/lib/utils/createClient.d.ts | 4 + packages/testing/lib/utils/createClient.js | 14 + .../testing/lib/utils/createClient.js.map | 1 + packages/testing/lib/utils/flowRight.d.ts | 1 + packages/testing/lib/utils/flowRight.js | 20 + packages/testing/lib/utils/flowRight.js.map | 1 + packages/testing/lib/utils/stripSymbols.d.ts | 1 + packages/testing/lib/utils/stripSymbols.js | 4 + .../testing/lib/utils/stripSymbols.js.map | 1 + packages/testing/lib/utils/wait.d.ts | 1 + packages/testing/lib/utils/wait.js | 4 + packages/testing/lib/utils/wait.js.map | 1 + packages/testing/lib/utils/wrap.d.ts | 2 + packages/testing/lib/utils/wrap.js | 13 + packages/testing/lib/utils/wrap.js.map | 1 + packages/testing/package.json | 52 + packages/testing/src/__tests__/README.md | 3 + packages/testing/src/index.ts | 13 + .../testing/src/mocks/MockedProvider.tsx | 37 +- .../testing/src/mocks/mockLink.ts | 153 +- .../testing/src/mocks/mockSubscriptionLink.ts | 59 + packages/testing/src/utils/catchAsyncError.ts | 7 + .../testing/src/utils}/createClient.ts | 13 +- packages/testing/src/utils/flowRight.ts | 11 + .../testing/src/utils}/stripSymbols.ts | 2 +- .../testing/src/utils}/wait.ts | 2 +- packages/testing/src/utils/wrap.ts | 10 + scripts/prepare-package.sh | 30 - src/ApolloProvider.tsx | 38 - src/index.ts | 34 - src/queryRecycler.ts | 115 - src/renderToStringWithData.ts | 9 - src/utils/flowRight.ts | 11 - test/client/utils/flowRight.test.tsx | 11 - test/fail-no-entry-point.js | 3 - test/test-utils/catchAsyncError.ts | 9 - test/test-utils/enzyme.ts | 4 - test/test-utils/setup.ts | 2 - test/test-utils/shim.ts | 12 - test/test-utils/wrap.ts | 14 - test/typescript-usage.tsx | 157 - tsconfig.cjs.json | 6 - 325 files changed, 27649 insertions(+), 15818 deletions(-) delete mode 100644 .npmignore create mode 100644 .vscode/settings.json create mode 100644 config/jest.config.js create mode 100644 config/prettier.config.js create mode 100644 config/tests-setup.ts rename tsconfig.json => config/tsconfig.base.json (64%) create mode 100644 config/tsconfig.cjs.json delete mode 100644 examples/base/README.md delete mode 100644 examples/base/package.json delete mode 100644 examples/base/public/favicon.ico delete mode 100644 examples/base/public/index.html delete mode 100644 examples/base/public/manifest.json delete mode 100644 examples/base/src/App.js delete mode 100644 examples/base/src/__mocks__/data.js delete mode 100644 examples/base/src/__tests__/App.js delete mode 100644 examples/base/src/__tests__/__snapshots__/App.js.snap delete mode 100644 examples/base/src/index.js delete mode 100644 examples/components/README.md delete mode 100644 examples/components/package.json delete mode 100644 examples/components/public/favicon.ico delete mode 100644 examples/components/public/index.html delete mode 100644 examples/components/public/manifest.json delete mode 100644 examples/components/src/App.js delete mode 100644 examples/components/src/__mocks__/data.js delete mode 100644 examples/components/src/__tests__/__snapshots__/app.js.snap delete mode 100644 examples/components/src/__tests__/__snapshots__/character.js.snap delete mode 100644 examples/components/src/__tests__/app.js delete mode 100644 examples/components/src/__tests__/character.js delete mode 100644 examples/components/src/character.js delete mode 100644 examples/components/src/index.js delete mode 100644 examples/mutation/.gitignore delete mode 100644 examples/mutation/README.md delete mode 100644 examples/mutation/package.json delete mode 100644 examples/mutation/public/favicon.ico delete mode 100644 examples/mutation/public/index.html delete mode 100644 examples/mutation/public/manifest.json delete mode 100644 examples/mutation/src/AddUser.js delete mode 100644 examples/mutation/src/__snapshots__/addUser.test.js.snap delete mode 100644 examples/mutation/src/addUser.test.js delete mode 100644 examples/mutation/src/index.css delete mode 100644 examples/mutation/src/index.js delete mode 100644 examples/rollup/.gitignore delete mode 100644 examples/rollup/README.md delete mode 100644 examples/rollup/index.html delete mode 100644 examples/rollup/main.js delete mode 100644 examples/rollup/package-lock.json delete mode 100644 examples/rollup/package.json delete mode 100644 examples/rollup/rollup.config.js delete mode 100644 examples/ssr/.babelrc delete mode 100644 examples/ssr/.gitignore delete mode 100644 examples/ssr/.meteor/.finished-upgraders delete mode 100644 examples/ssr/.meteor/.gitignore delete mode 100644 examples/ssr/.meteor/.id delete mode 100644 examples/ssr/.meteor/packages delete mode 100644 examples/ssr/.meteor/platforms delete mode 100644 examples/ssr/.meteor/release delete mode 100644 examples/ssr/.meteor/versions delete mode 100644 examples/ssr/README.md delete mode 100644 examples/ssr/client/main.html delete mode 100644 examples/ssr/client/main.js delete mode 100644 examples/ssr/imports/app.js delete mode 100644 examples/ssr/imports/schema.js delete mode 100644 examples/ssr/imports/tests/chromedriver.js delete mode 100644 examples/ssr/nightwatch.json delete mode 100644 examples/ssr/package.json delete mode 100644 examples/ssr/server/main.js delete mode 100644 examples/ssr/tests/ssr.js delete mode 100644 examples/typescript/.gitignore delete mode 100644 examples/typescript/README.md delete mode 100644 examples/typescript/package.json delete mode 100644 examples/typescript/public/favicon.ico delete mode 100644 examples/typescript/public/index.html delete mode 100644 examples/typescript/public/manifest.json delete mode 100644 examples/typescript/schema.json delete mode 100644 examples/typescript/src/App.tsx delete mode 100644 examples/typescript/src/Character.tsx delete mode 100644 examples/typescript/src/__generated__/types.ts delete mode 100644 examples/typescript/src/__mocks__/data.ts delete mode 100644 examples/typescript/src/index.tsx delete mode 100644 examples/typescript/src/queries.ts delete mode 100644 examples/typescript/src/schema.json delete mode 100644 examples/typescript/tsconfig.json delete mode 100644 examples/typescript/tslint.json delete mode 100644 jest.cjs.config.js delete mode 100644 jest.umd.config.js create mode 100644 lerna.json create mode 100644 packages/common/README.md create mode 100644 packages/common/config/jest.config.js rename rollup.config.js => packages/common/config/rollup.config.js (60%) create mode 100644 packages/common/config/tsconfig.cjs.json create mode 100644 packages/common/config/tsconfig.json create mode 100644 packages/common/lib/context/ApolloConsumer.d.ts create mode 100644 packages/common/lib/context/ApolloConsumer.js create mode 100644 packages/common/lib/context/ApolloConsumer.js.map create mode 100644 packages/common/lib/context/ApolloContext.d.ts create mode 100644 packages/common/lib/context/ApolloContext.js create mode 100644 packages/common/lib/context/ApolloContext.js.map create mode 100644 packages/common/lib/context/ApolloProvider.d.ts create mode 100644 packages/common/lib/context/ApolloProvider.js create mode 100644 packages/common/lib/context/ApolloProvider.js.map create mode 100644 packages/common/lib/index.d.ts create mode 100644 packages/common/lib/index.js create mode 100644 packages/common/lib/index.js.map create mode 100644 packages/common/lib/parser/parser.d.ts create mode 100644 packages/common/lib/parser/parser.js create mode 100644 packages/common/lib/parser/parser.js.map create mode 100644 packages/common/lib/react-common.cjs.js create mode 100644 packages/common/lib/react-common.esm.js create mode 100644 packages/common/lib/react-common.esm.js.map create mode 100644 packages/common/lib/react-common.umd.js create mode 100644 packages/common/package.json create mode 100644 packages/common/src/context/ApolloConsumer.d.ts create mode 100644 packages/common/src/context/ApolloConsumer.js create mode 100644 packages/common/src/context/ApolloConsumer.js.map rename {src => packages/common/src/context}/ApolloConsumer.tsx (76%) create mode 100644 packages/common/src/context/ApolloContext.d.ts create mode 100644 packages/common/src/context/ApolloContext.js create mode 100644 packages/common/src/context/ApolloContext.js.map rename {src => packages/common/src/context}/ApolloContext.ts (83%) create mode 100644 packages/common/src/context/ApolloProvider.d.ts create mode 100644 packages/common/src/context/ApolloProvider.js create mode 100644 packages/common/src/context/ApolloProvider.js.map create mode 100644 packages/common/src/context/ApolloProvider.tsx rename {test/client => packages/common/src/context/__tests__}/ApolloConsumer.test.tsx (88%) rename {test/client => packages/common/src/context/__tests__}/ApolloProvider.test.tsx (93%) create mode 100644 packages/common/src/index.d.ts create mode 100644 packages/common/src/index.js create mode 100644 packages/common/src/index.js.map create mode 100644 packages/common/src/index.ts rename {test/internal-api => packages/common/src/parser/__tests__}/parser.test.ts (88%) create mode 100644 packages/common/src/parser/parser.d.ts create mode 100644 packages/common/src/parser/parser.js create mode 100644 packages/common/src/parser/parser.js.map rename {src => packages/common/src/parser}/parser.ts (80%) create mode 100644 packages/components/README.md create mode 100644 packages/components/config/jest.config.js create mode 100644 packages/components/config/rollup.config.js create mode 100644 packages/components/config/tsconfig.cjs.json create mode 100644 packages/components/config/tsconfig.json create mode 100644 packages/components/lib/Mutation.d.ts create mode 100644 packages/components/lib/Mutation.js create mode 100644 packages/components/lib/Mutation.js.map create mode 100644 packages/components/lib/Query.d.ts create mode 100644 packages/components/lib/Query.js create mode 100644 packages/components/lib/Query.js.map create mode 100644 packages/components/lib/Subscription.d.ts create mode 100644 packages/components/lib/Subscription.js create mode 100644 packages/components/lib/Subscription.js.map create mode 100644 packages/components/lib/index.d.ts create mode 100644 packages/components/lib/index.js create mode 100644 packages/components/lib/index.js.map create mode 100644 packages/components/lib/react-components.cjs.js create mode 100644 packages/components/lib/react-components.esm.js create mode 100644 packages/components/lib/react-components.esm.js.map create mode 100644 packages/components/lib/react-components.umd.js create mode 100644 packages/components/lib/ssr/getDataFromTree.d.ts create mode 100644 packages/components/lib/ssr/getDataFromTree.js create mode 100644 packages/components/lib/ssr/getDataFromTree.js.map create mode 100644 packages/components/lib/ssr/renderToStringWithData.d.ts create mode 100644 packages/components/lib/ssr/renderToStringWithData.js create mode 100644 packages/components/lib/ssr/renderToStringWithData.js.map create mode 100644 packages/components/lib/types.d.ts create mode 100644 packages/components/lib/types.js create mode 100644 packages/components/lib/types.js.map create mode 100644 packages/components/lib/useApolloClient.d.ts create mode 100644 packages/components/lib/useApolloClient.js create mode 100644 packages/components/lib/useApolloClient.js.map create mode 100644 packages/components/lib/utils/getClient.d.ts create mode 100644 packages/components/lib/utils/getClient.js create mode 100644 packages/components/lib/utils/getClient.js.map create mode 100644 packages/components/lib/utils/shallowEqual.d.ts create mode 100644 packages/components/lib/utils/shallowEqual.js create mode 100644 packages/components/lib/utils/shallowEqual.js.map create mode 100644 packages/components/package.json rename {src => packages/components/src}/Mutation.tsx (84%) rename {src => packages/components/src}/Query.tsx (90%) rename src/Subscriptions.tsx => packages/components/src/Subscription.tsx (86%) rename {test => packages/components/src/__tests__}/client/Mutation.test.tsx (90%) rename {test => packages/components/src/__tests__}/client/Query.test.tsx (85%) rename {test => packages/components/src/__tests__}/client/Subscription.test.tsx (94%) rename {test => packages/components/src/__tests__}/client/__snapshots__/Query.test.tsx.snap (100%) create mode 100644 packages/components/src/index.ts create mode 100644 packages/components/src/ssr/__tests__/getDataFromTree.test.tsx create mode 100644 packages/components/src/ssr/__tests__/server.test.tsx rename {src => packages/components/src/ssr}/getDataFromTree.ts (92%) mode change 100755 => 100644 create mode 100755 packages/components/src/ssr/renderToStringWithData.ts rename {src => packages/components/src}/types.ts (96%) rename {src => packages/components/src}/useApolloClient.ts (70%) rename src/component-utils.tsx => packages/components/src/utils/getClient.ts (90%) rename {src => packages/components/src}/utils/shallowEqual.ts (100%) create mode 100644 packages/hoc/README.md create mode 100644 packages/hoc/config/jest.config.js create mode 100644 packages/hoc/config/rollup.config.js create mode 100644 packages/hoc/config/tsconfig.cjs.json create mode 100644 packages/hoc/config/tsconfig.json create mode 100644 packages/hoc/lib/graphql.d.ts create mode 100644 packages/hoc/lib/graphql.js create mode 100644 packages/hoc/lib/graphql.js.map create mode 100644 packages/hoc/lib/hoc-utils.d.ts create mode 100644 packages/hoc/lib/hoc-utils.js create mode 100644 packages/hoc/lib/hoc-utils.js.map create mode 100644 packages/hoc/lib/index.d.ts create mode 100644 packages/hoc/lib/index.js create mode 100644 packages/hoc/lib/index.js.map create mode 100644 packages/hoc/lib/mutation-hoc.d.ts create mode 100644 packages/hoc/lib/mutation-hoc.js create mode 100644 packages/hoc/lib/mutation-hoc.js.map create mode 100644 packages/hoc/lib/query-hoc.d.ts create mode 100644 packages/hoc/lib/query-hoc.js create mode 100644 packages/hoc/lib/query-hoc.js.map create mode 100644 packages/hoc/lib/react-hoc.cjs.js create mode 100644 packages/hoc/lib/react-hoc.esm.js create mode 100644 packages/hoc/lib/react-hoc.esm.js.map create mode 100644 packages/hoc/lib/react-hoc.umd.js create mode 100644 packages/hoc/lib/subscription-hoc.d.ts create mode 100644 packages/hoc/lib/subscription-hoc.js create mode 100644 packages/hoc/lib/subscription-hoc.js.map create mode 100644 packages/hoc/lib/withApollo.d.ts create mode 100644 packages/hoc/lib/withApollo.js create mode 100644 packages/hoc/lib/withApollo.js.map create mode 100644 packages/hoc/package.json rename test/test-utils.test.tsx => packages/hoc/src/__tests__/MockedProvider.test.tsx (79%) rename test/__snapshots__/test-utils.test.tsx.snap => packages/hoc/src/__tests__/__snapshots__/MockedProvider.test.tsx.snap (100%) rename {test/client/graphql => packages/hoc/src/__tests__}/client-option.test.tsx (92%) rename {test/client/graphql => packages/hoc/src/__tests__}/fragments.test.tsx (89%) rename {test/client/graphql => packages/hoc/src/__tests__}/mutations/index.test.tsx (88%) rename {test/client/graphql => packages/hoc/src/__tests__}/mutations/lifecycle.test.tsx (92%) rename {test/client/graphql => packages/hoc/src/__tests__}/mutations/queries.test.tsx (87%) rename {test/client/graphql => packages/hoc/src/__tests__}/mutations/recycled-queries.test.tsx (95%) rename {test/client/graphql => packages/hoc/src/__tests__}/queries/__snapshots__/lifecycle.test.tsx.snap (100%) rename {test/client/graphql => packages/hoc/src/__tests__}/queries/api.test.tsx (95%) rename {test/client/graphql => packages/hoc/src/__tests__}/queries/errors.test.tsx (93%) rename {test/client/graphql => packages/hoc/src/__tests__}/queries/index.test.tsx (93%) rename {test/client/graphql => packages/hoc/src/__tests__}/queries/lifecycle.test.tsx (95%) rename {test/client/graphql => packages/hoc/src/__tests__}/queries/loading.test.tsx (94%) rename {test/client/graphql => packages/hoc/src/__tests__}/queries/observableQuery.test.tsx (95%) rename {test/client/graphql => packages/hoc/src/__tests__}/queries/polling.test.tsx (94%) rename {test/client/graphql => packages/hoc/src/__tests__}/queries/reducer.test.tsx (93%) rename {test/client/graphql => packages/hoc/src/__tests__}/queries/skip.test.tsx (94%) rename {test/client/graphql => packages/hoc/src/__tests__}/queries/updateQuery.test.tsx (93%) rename {test/client/graphql => packages/hoc/src/__tests__}/shared-operations.test.tsx (91%) rename {test/client => packages/hoc/src/__tests__/ssr}/getDataFromTree.test.tsx (79%) rename {test/server => packages/hoc/src/__tests__/ssr}/server.test.tsx (67%) rename {test/client/graphql => packages/hoc/src/__tests__}/statics.test.tsx (83%) rename {test/client/graphql => packages/hoc/src/__tests__/subscriptions}/subscriptions.test.tsx (78%) rename {src => packages/hoc/src}/graphql.tsx (68%) rename {src => packages/hoc/src}/hoc-utils.tsx (76%) create mode 100644 packages/hoc/src/index.ts rename {src => packages/hoc/src}/mutation-hoc.tsx (70%) rename {src => packages/hoc/src}/query-hoc.tsx (80%) rename {src => packages/hoc/src}/subscription-hoc.tsx (77%) rename {src => packages/hoc/src}/withApollo.tsx (82%) create mode 100644 packages/hooks/README.md create mode 100644 packages/hooks/package.json create mode 100644 packages/testing/README.md create mode 100644 packages/testing/config/jest.config.js create mode 100644 packages/testing/config/rollup.config.js create mode 100644 packages/testing/config/tsconfig.cjs.json create mode 100644 packages/testing/config/tsconfig.json create mode 100644 packages/testing/lib/index.d.ts create mode 100644 packages/testing/lib/index.js create mode 100644 packages/testing/lib/index.js.map create mode 100644 packages/testing/lib/mocks/MockedProvider.d.ts create mode 100644 packages/testing/lib/mocks/MockedProvider.js create mode 100644 packages/testing/lib/mocks/MockedProvider.js.map create mode 100644 packages/testing/lib/mocks/mockLink.d.ts create mode 100644 packages/testing/lib/mocks/mockLink.js create mode 100644 packages/testing/lib/mocks/mockLink.js.map create mode 100644 packages/testing/lib/mocks/mockSubscriptionLink.d.ts create mode 100644 packages/testing/lib/mocks/mockSubscriptionLink.js create mode 100644 packages/testing/lib/mocks/mockSubscriptionLink.js.map create mode 100644 packages/testing/lib/react-testing.cjs.js create mode 100644 packages/testing/lib/react-testing.esm.js create mode 100644 packages/testing/lib/react-testing.esm.js.map create mode 100644 packages/testing/lib/react-testing.umd.js create mode 100644 packages/testing/lib/utils/catchAsyncError.d.ts create mode 100644 packages/testing/lib/utils/catchAsyncError.js create mode 100644 packages/testing/lib/utils/catchAsyncError.js.map create mode 100644 packages/testing/lib/utils/createClient.d.ts create mode 100644 packages/testing/lib/utils/createClient.js create mode 100644 packages/testing/lib/utils/createClient.js.map create mode 100644 packages/testing/lib/utils/flowRight.d.ts create mode 100644 packages/testing/lib/utils/flowRight.js create mode 100644 packages/testing/lib/utils/flowRight.js.map create mode 100644 packages/testing/lib/utils/stripSymbols.d.ts create mode 100644 packages/testing/lib/utils/stripSymbols.js create mode 100644 packages/testing/lib/utils/stripSymbols.js.map create mode 100644 packages/testing/lib/utils/wait.d.ts create mode 100644 packages/testing/lib/utils/wait.js create mode 100644 packages/testing/lib/utils/wait.js.map create mode 100644 packages/testing/lib/utils/wrap.d.ts create mode 100644 packages/testing/lib/utils/wrap.js create mode 100644 packages/testing/lib/utils/wrap.js.map create mode 100644 packages/testing/package.json create mode 100644 packages/testing/src/__tests__/README.md create mode 100644 packages/testing/src/index.ts rename src/test-utils.tsx => packages/testing/src/mocks/MockedProvider.tsx (61%) rename src/test-links.ts => packages/testing/src/mocks/mockLink.ts (52%) create mode 100644 packages/testing/src/mocks/mockSubscriptionLink.ts create mode 100644 packages/testing/src/utils/catchAsyncError.ts rename {test/test-utils => packages/testing/src/utils}/createClient.ts (50%) create mode 100644 packages/testing/src/utils/flowRight.ts rename {test/test-utils => packages/testing/src/utils}/stripSymbols.ts (78%) rename {test/test-utils => packages/testing/src/utils}/wait.ts (53%) create mode 100644 packages/testing/src/utils/wrap.ts delete mode 100755 scripts/prepare-package.sh delete mode 100644 src/ApolloProvider.tsx delete mode 100644 src/index.ts delete mode 100644 src/queryRecycler.ts delete mode 100755 src/renderToStringWithData.ts delete mode 100644 src/utils/flowRight.ts delete mode 100644 test/client/utils/flowRight.test.tsx delete mode 100644 test/fail-no-entry-point.js delete mode 100644 test/test-utils/catchAsyncError.ts delete mode 100644 test/test-utils/enzyme.ts delete mode 100644 test/test-utils/setup.ts delete mode 100644 test/test-utils/shim.ts delete mode 100644 test/test-utils/wrap.ts delete mode 100644 test/typescript-usage.tsx delete mode 100644 tsconfig.cjs.json diff --git a/.circleci/config.yml b/.circleci/config.yml index 050533adb0..7a57d406fe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,68 +1,14 @@ version: 2 jobs: - Node.js 8: - docker: [{ image: 'circleci/node:8' }] - steps: - - checkout - - run: npm i - - run: - name: Jest suite - command: npm run jest -- --ci --testResultsProcessor="jest-junit" - environment: - JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml' - - store_test_results: - path: reports/junit - - store_artifacts: - path: reports/junit - - Node.js 10: + Tests: docker: [{ image: 'circleci/node:10' }] steps: - checkout - run: npm i - run: name: Jest suite - command: npm run jest -- --ci --testResultsProcessor="jest-junit" - environment: - JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml' - - store_test_results: - path: reports/junit - - store_artifacts: - path: reports/junit - - Typecheck: - docker: [{ image: 'circleci/node:8' }] - steps: - - checkout - - run: npm i - - run: npm run type-check - - Commonjs: - docker: [{ image: 'circleci/node:8' }] - steps: - - checkout - - run: npm i - - run: npm run compile - - run: - name: Jest suite - command: npm run test:compiled:cjs -- --ci --testResultsProcessor="jest-junit" - environment: - JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml' - - store_test_results: - path: reports/junit - - store_artifacts: - path: reports/junit - - UMD: - docker: [{ image: 'circleci/node:8' }] - steps: - - checkout - - run: npm i - - run: npm run compile - - run: - name: Jest suite - command: npm run test:compiled:umd -- --ci --testResultsProcessor="jest-junit" + command: npm run test:ci" environment: JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml' - store_test_results: @@ -70,21 +16,16 @@ jobs: - store_artifacts: path: reports/junit - Filesize: + Bundlesize: docker: [{ image: 'circleci/node:8' }] steps: - checkout - run: npm i - - run: npm run compile - - run: npm run filesize + - run: npm run bundlesize workflows: version: 2 Build and Test: jobs: - - Node.js 8 - - Node.js 10 - - Typecheck - - UMD - - Commonjs - - Filesize + - Tests + - Bundlesize diff --git a/.gitignore b/.gitignore index 80b2880593..738ff62eba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,43 +1,9 @@ -.idea .rpt2_cache - -# Logs -logs -*.log - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul +meta coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directory -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git node_modules - -# don't commit compiled files -lib -test-lib -dist +build npm -.reports - -# don't track yarn.lock but allow contributors to use it for local dev yarn.lock - -.vscode examples/**/package-lock.json +packages/**/package-lock.json diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 7c723fca4e..0000000000 --- a/.npmignore +++ /dev/null @@ -1 +0,0 @@ -bundlesize \ No newline at end of file diff --git a/.prettierignore b/.prettierignore index 58351a5c98..08aac0584c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,8 +1,7 @@ node_modules -lib +build coverage npm package.json -dist *.snap package-lock.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..cac0e10e68 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "editor.formatOnSave": true +} \ No newline at end of file diff --git a/config/jest.config.js b/config/jest.config.js new file mode 100644 index 0000000000..c9a10a8094 --- /dev/null +++ b/config/jest.config.js @@ -0,0 +1,13 @@ +module.exports = { + preset: 'ts-jest', + moduleFileExtensions: ['ts', 'tsx', 'js', 'json'], + rootDir: '..', + projects: [''], + globals: { + 'ts-jest': { + tsConfig: './config/tsconfig.cjs.json', + }, + }, + setupFiles: ['./config/tests-setup.ts'], + coverageDirectory: './meta/coverage', +}; diff --git a/config/prettier.config.js b/config/prettier.config.js new file mode 100644 index 0000000000..79eb96931b --- /dev/null +++ b/config/prettier.config.js @@ -0,0 +1,4 @@ +module.exports = { + singleQuote: true, + trailingComma: 'all' +}; diff --git a/config/tests-setup.ts b/config/tests-setup.ts new file mode 100644 index 0000000000..1ee3c70199 --- /dev/null +++ b/config/tests-setup.ts @@ -0,0 +1,3 @@ +import Enzyme from 'enzyme'; +import Adapter from 'enzyme-adapter-react-16'; +Enzyme.configure({ adapter: new Adapter() }); diff --git a/tsconfig.json b/config/tsconfig.base.json similarity index 64% rename from tsconfig.json rename to config/tsconfig.base.json index a56a721d72..05bbb4c01f 100644 --- a/tsconfig.json +++ b/config/tsconfig.base.json @@ -1,21 +1,19 @@ { "compilerOptions": { "declaration": true, - "experimentalDecorators": true, "jsx": "react", "lib": ["es2015", "esnext.asynciterable", "dom"], "module": "es2015", "moduleResolution": "node", "importHelpers": true, "noUnusedParameters": true, - "outDir": "lib", - "pretty": true, "removeComments": true, "sourceMap": true, "strict": true, "target": "es5", - "esModuleInterop": true + "esModuleInterop": true, + "experimentalDecorators": true }, - "include": ["./src/**/*"], - "exclude": ["./node_modules", "./dist", "./lib"] + "include": ["../packages/*/src/**/*"], + "exclude": ["../packages/*/node_modules", "../packages/*/build"] } diff --git a/config/tsconfig.cjs.json b/config/tsconfig.cjs.json new file mode 100644 index 0000000000..7fef9fe277 --- /dev/null +++ b/config/tsconfig.cjs.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.base", + "compilerOptions": { + "module": "commonjs" + } +} diff --git a/examples/base/README.md b/examples/base/README.md deleted file mode 100644 index 8266b6cf1c..0000000000 --- a/examples/base/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Base Example - -``` -npm install -npm start -``` - -This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app). diff --git a/examples/base/package.json b/examples/base/package.json deleted file mode 100644 index 99ba67ed5a..0000000000 --- a/examples/base/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "base", - "version": "0.1.0", - "private": true, - "dependencies": { - "apollo-boost": "^0.3.0", - "react": "^16.3.0", - "react-apollo": "../../lib", - "react-dom": "^16.3.0", - "react-scripts": "2.1.8" - }, - "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test --env=jsdom", - "eject": "react-scripts eject" - }, - "devDependencies": {}, - "browserslist": [ - ">0.2%", - "not dead", - "not ie <= 11", - "not op_mini all" - ] -} diff --git a/examples/base/public/favicon.ico b/examples/base/public/favicon.ico deleted file mode 100644 index 5c125de5d897c1ff5692a656485b3216123dcd89..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24838 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 - - - - - - - - - - React App - - - -
- - - diff --git a/examples/base/public/manifest.json b/examples/base/public/manifest.json deleted file mode 100644 index be607e4177..0000000000 --- a/examples/base/public/manifest.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "192x192", - "type": "image/png" - } - ], - "start_url": "./index.html", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/examples/base/src/App.js b/examples/base/src/App.js deleted file mode 100644 index 0cd3a57ead..0000000000 --- a/examples/base/src/App.js +++ /dev/null @@ -1,56 +0,0 @@ -import * as React from 'react'; -import { graphql } from 'react-apollo'; -import gql from 'graphql-tag'; - -export const HERO_QUERY = gql` - query GetCharacter($episode: Episode!) { - hero(episode: $episode) { - name - id - friends { - name - id - appearsIn - } - } - } -`; - -export const withCharacter = graphql(HERO_QUERY, { - options: ({ episode }) => ({ - variables: { episode }, - }), - props: ({ data }) => ({ ...data }), -}); - -export const CharacterWithoutData = ({ loading, hero, error }) => { - if (loading) return
Loading
; - if (error) return

ERROR

; - return ( -
- {hero && ( -
-

{hero.name}

- - {hero.friends && - hero.friends.map( - friend => - friend && ( -
- {friend.name}: {friend.appearsIn.map(x => x && x.toLowerCase()).join(', ')} -
- ), - )} -
- )} -
- ); -}; - -export const Character = withCharacter(CharacterWithoutData); - -export const App = () => ( -
- -
-); diff --git a/examples/base/src/__mocks__/data.js b/examples/base/src/__mocks__/data.js deleted file mode 100644 index 729854ef6a..0000000000 --- a/examples/base/src/__mocks__/data.js +++ /dev/null @@ -1,31 +0,0 @@ -export const empty = null; - -export const hero_no_friends = { - name: 'r2d2', - id: '1', - friends: null, -}; - -export const empty_array_friends = { - ...hero_no_friends, - ...{ - friends: [null], - }, -}; - -export const friend_without_appearsIn = { - ...hero_no_friends, - ...{ - friends: [ - { name: 'luke', id: '2', appearsIn: ['NEWHOPE'] }, - { name: 'james', id: '777', appearsIn: [null] }, - ], - }, -}; - -export const full = { - ...hero_no_friends, - ...{ - friends: [{ name: 'luke', id: '2', appearsIn: ['NEWHOPE'] }], - }, -}; diff --git a/examples/base/src/__tests__/App.js b/examples/base/src/__tests__/App.js deleted file mode 100644 index 837f0a8883..0000000000 --- a/examples/base/src/__tests__/App.js +++ /dev/null @@ -1,191 +0,0 @@ -import React from 'react'; -import renderer from 'react-test-renderer'; -import { MockedProvider } from 'react-apollo/test-utils'; - -import { HERO_QUERY, withCharacter, CharacterWithoutData, App } from '../App'; - -const query = HERO_QUERY; - -import { - empty, - hero_no_friends, - empty_array_friends, - friend_without_appearsIn, - full, -} from '../__mocks__/data'; - -class ErrorBoundary extends React.Component { - componentDidCatch(e) { - console.log(e); - } - - render() { - return this.props.children; - } -} - -const variables = { episode: 'NEWHOPE' }; - -describe('withCharacter', () => { - it('shapes the props into variables', done => { - class Container extends React.Component { - componentWillMount() { - try { - expect(this.props.variables).toEqual(variables); - done(); - } catch (e) { - done.fail(e); - } - } - render() { - return null; - } - } - - const ContainerWithData = withCharacter(Container); - const mocks = [{ request: { query, variables }, result: { data: { hero: empty } } }]; - renderer.create( - - - - - , - ); - }); - it('reshapes the data into the passed props', done => { - class Container extends React.Component { - componentWillReceiveProps(next) { - try { - expect(next.hero).toEqual(hero_no_friends); - done(); - } catch (e) { - done.fail(e); - } - } - render() { - return null; - } - } - - const ContainerWithData = withCharacter(Container); - const mocks = [ - { - request: { query, variables }, - result: { data: { hero: hero_no_friends } }, - }, - ]; - renderer.create( - - - - - , - ); - }); - it('has a loading state', done => { - class Container extends React.Component { - componentWillMount() { - expect(this.props.loading).toBe(true); - } - componentWillReceiveProps(next) { - expect(next.loading).toBe(false); - done(); - } - render() { - return null; - } - } - - const ContainerWithData = withCharacter(Container); - const mocks = [ - { - request: { query, variables }, - result: { data: { hero: hero_no_friends } }, - }, - ]; - renderer.create( - - - - - , - ); - }); - it('has a potential error state', done => { - class Container extends React.Component { - componentWillMount() { - expect(this.props.loading).toBe(true); - } - componentWillReceiveProps(next) { - expect(next.loading).toBe(false); - expect(next.error.message).toMatch(/these are not the droids you are looking for/); - done(); - } - render() { - return null; - } - } - - const ContainerWithData = withCharacter(Container); - const mocks = [ - { - request: { query, variables }, - error: new Error('these are not the droids you are looking for'), - }, - ]; - - renderer.create( - - - - - , - ); - }); -}); - -describe('CharacterWithoutData', () => { - it('handles a loading state', () => { - const output = renderer.create(); - expect(output.toJSON()).toMatchSnapshot(); - }); - it('handles an error state', () => { - const output = renderer.create(); - expect(output.toJSON()).toMatchSnapshot(); - }); - it('returns markup for null response', () => { - const output = renderer.create(); - expect(output.toJSON()).toMatchSnapshot(); - }); - it('returns markup for a hero with no friends', () => { - const output = renderer.create(); - expect(output.toJSON()).toMatchSnapshot(); - }); - it('returns markup for empty array of friends', () => { - const output = renderer.create(); - expect(output.toJSON()).toMatchSnapshot(); - }); - it('returns markup for a friend without an appearsIn', () => { - const output = renderer.create(); - expect(output.toJSON()).toMatchSnapshot(); - }); - it('renders a full data result', () => { - const output = renderer.create(); - expect(output.toJSON()).toMatchSnapshot(); - }); -}); - -describe('App', () => { - it('renders the data from NEWHOPE', () => { - const mocks = [{ request: { query, variables }, result: { data: { hero: empty } } }]; - const output = renderer.create( - - - - - , - ); - - expect(output.toJSON()).toMatchSnapshot(); - }); -}); diff --git a/examples/base/src/__tests__/__snapshots__/App.js.snap b/examples/base/src/__tests__/__snapshots__/App.js.snap deleted file mode 100644 index bf9c1e2fe4..0000000000 --- a/examples/base/src/__tests__/__snapshots__/App.js.snap +++ /dev/null @@ -1,78 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`App renders the data from NEWHOPE 1`] = ` -
-
- Loading -
-
-`; - -exports[`CharacterWithoutData handles a loading state 1`] = ` -
- Loading -
-`; - -exports[`CharacterWithoutData handles an error state 1`] = ` -

- ERROR -

-`; - -exports[`CharacterWithoutData renders a full data result 1`] = ` -
-
-

- r2d2 -

-
- luke - : - newhope -
-
-
-`; - -exports[`CharacterWithoutData returns markup for a friend without an appearsIn 1`] = ` -
-
-

- r2d2 -

-
- luke - : - newhope -
-
- james - : - -
-
-
-`; - -exports[`CharacterWithoutData returns markup for a hero with no friends 1`] = ` -
-
-

- r2d2 -

-
-
-`; - -exports[`CharacterWithoutData returns markup for empty array of friends 1`] = ` -
-
-

- r2d2 -

-
-
-`; - -exports[`CharacterWithoutData returns markup for null response 1`] = `
`; diff --git a/examples/base/src/index.js b/examples/base/src/index.js deleted file mode 100644 index a40e42ac41..0000000000 --- a/examples/base/src/index.js +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import { render } from 'react-dom'; -import ApolloClient from 'apollo-boost'; -import { ApolloProvider } from 'react-apollo'; - -import { App } from './App'; - -const client = new ApolloClient({ - uri: 'https://ojo6385vn6.sse.codesandbox.io', -}); - -const WrappedApp = ( - - - -); - -render(WrappedApp, document.getElementById('root')); diff --git a/examples/components/README.md b/examples/components/README.md deleted file mode 100644 index d648497a7f..0000000000 --- a/examples/components/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Components Example - -``` -npm install -npm start -``` - -This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app). diff --git a/examples/components/package.json b/examples/components/package.json deleted file mode 100644 index 61acb2dac4..0000000000 --- a/examples/components/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "components", - "version": "0.1.0", - "private": true, - "dependencies": { - "apollo-boost": "^0.3.0", - "graphql-tag": "^2.9.2", - "react": "^16.5.2", - "react-apollo": "../../lib", - "react-dom": "^16.5.2", - "react-scripts": "2.1.8" - }, - "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test --env=jsdom", - "eject": "react-scripts eject" - }, - "devDependencies": { - "react-testing-library": "6.0.2" - }, - "browserslist": [ - ">0.2%", - "not dead", - "not ie <= 11", - "not op_mini all" - ] -} diff --git a/examples/components/public/favicon.ico b/examples/components/public/favicon.ico deleted file mode 100644 index a11777cc471a4344702741ab1c8a588998b1311a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3870 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 baj7?x%VD!5Cxk2YbYLNVeiXvvpMCWYo=by@ diff --git a/examples/components/public/index.html b/examples/components/public/index.html deleted file mode 100644 index ed0ebafa1b..0000000000 --- a/examples/components/public/index.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - React App - - - -
- - - diff --git a/examples/components/public/manifest.json b/examples/components/public/manifest.json deleted file mode 100644 index ef19ec243e..0000000000 --- a/examples/components/public/manifest.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - } - ], - "start_url": "./index.html", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/examples/components/src/App.js b/examples/components/src/App.js deleted file mode 100644 index 08680b5117..0000000000 --- a/examples/components/src/App.js +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react'; -import { Query } from 'react-apollo'; -import gql from 'graphql-tag'; -import Character from './character'; - -export const HERO_QUERY = gql` - query GetCharacter($episode: Episode!) { - hero(episode: $episode) { - name - id - friends { - name - id - appearsIn - } - } - } -`; - -const App = ({ episode }) => ( - - {result => { - const { loading, error, data } = result; - - if (loading) { - return
Loading
; - } - if (error) { - return

ERROR

; - } - - return ; - }} -
-); - -export default App; diff --git a/examples/components/src/__mocks__/data.js b/examples/components/src/__mocks__/data.js deleted file mode 100644 index 729854ef6a..0000000000 --- a/examples/components/src/__mocks__/data.js +++ /dev/null @@ -1,31 +0,0 @@ -export const empty = null; - -export const hero_no_friends = { - name: 'r2d2', - id: '1', - friends: null, -}; - -export const empty_array_friends = { - ...hero_no_friends, - ...{ - friends: [null], - }, -}; - -export const friend_without_appearsIn = { - ...hero_no_friends, - ...{ - friends: [ - { name: 'luke', id: '2', appearsIn: ['NEWHOPE'] }, - { name: 'james', id: '777', appearsIn: [null] }, - ], - }, -}; - -export const full = { - ...hero_no_friends, - ...{ - friends: [{ name: 'luke', id: '2', appearsIn: ['NEWHOPE'] }], - }, -}; diff --git a/examples/components/src/__tests__/__snapshots__/app.js.snap b/examples/components/src/__tests__/__snapshots__/app.js.snap deleted file mode 100644 index 90133bd792..0000000000 --- a/examples/components/src/__tests__/__snapshots__/app.js.snap +++ /dev/null @@ -1,34 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`App renders data 1`] = ` -
-
-
-

- r2d2 -

-
- luke - : - newhope -
-
-
-
-`; - -exports[`App renders error 1`] = ` -
-

- ERROR -

-
-`; - -exports[`App renders loading 1`] = ` -
-
- Loading -
-
-`; diff --git a/examples/components/src/__tests__/__snapshots__/character.js.snap b/examples/components/src/__tests__/__snapshots__/character.js.snap deleted file mode 100644 index 8bedc5b1ba..0000000000 --- a/examples/components/src/__tests__/__snapshots__/character.js.snap +++ /dev/null @@ -1,52 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Character returns markup for a friend without an appearsIn 1`] = ` -
-
-
-

- r2d2 -

-
- luke - : - newhope -
-
- james - : -
-
-
-
-`; - -exports[`Character returns markup for a hero with no friends 1`] = ` -
-
-
-

- r2d2 -

-
-
-
-`; - -exports[`Character returns markup for empty array of friends 1`] = ` -
-
-
-

- r2d2 -

-
-
-
-`; - -exports[`Character returns markup for null response 1`] = ` -
-
-
-`; diff --git a/examples/components/src/__tests__/app.js b/examples/components/src/__tests__/app.js deleted file mode 100644 index c7b71a6c96..0000000000 --- a/examples/components/src/__tests__/app.js +++ /dev/null @@ -1,72 +0,0 @@ -import React from 'react'; -import renderer from 'react-test-renderer'; -import { MockedProvider } from 'react-apollo/test-utils'; -import { render, wait, cleanup } from 'react-testing-library'; - -import App, { HERO_QUERY } from '../app'; -import { full } from '../__mocks__/data'; - -const request = { - query: HERO_QUERY, - variables: { episode: 'EMPIRE' }, -}; - -const mocks = [ - { - request, - result: { - data: { - hero: full, - }, - }, - }, -]; - -const mocksWithError = [ - { - request, - error: new Error('Something went wrong'), - }, -]; - -describe('App', () => { - it('renders loading', () => { - const { container } = render( - - - , - ); - - expect(container).toMatchSnapshot(); - }); - - it('renders data', async () => { - const { queryByText, container } = render( - - - , - ); - - await waitUntilLoadingIsFinished(queryByText); - - expect(container).toMatchSnapshot(); - }); - - it('renders error', async () => { - const { queryByText, container } = render( - - - , - ); - - await waitUntilLoadingIsFinished(queryByText); - - expect(container).toMatchSnapshot(); - }); -}); - -const waitUntilLoadingIsFinished = queryByText => - wait(() => { - const isLoading = queryByText('Loading') != null; - expect(isLoading).toBe(false); - }); diff --git a/examples/components/src/__tests__/character.js b/examples/components/src/__tests__/character.js deleted file mode 100644 index f802268e71..0000000000 --- a/examples/components/src/__tests__/character.js +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react'; - -import { render } from 'react-testing-library'; -import Character from '../Character'; - -import { - empty, - hero_no_friends, - empty_array_friends, - friend_without_appearsIn, -} from '../__mocks__/data'; - -describe('Character', () => { - it('returns markup for null response', () => { - const { container } = render(); - expect(container).toMatchSnapshot(); - }); - it('returns markup for a hero with no friends', () => { - const { container } = render(); - expect(container).toMatchSnapshot(); - }); - it('returns markup for empty array of friends', () => { - const { container } = render(); - expect(container).toMatchSnapshot(); - }); - it('returns markup for a friend without an appearsIn', () => { - const { container } = render(); - expect(container).toMatchSnapshot(); - }); -}); diff --git a/examples/components/src/character.js b/examples/components/src/character.js deleted file mode 100644 index 91154874c5..0000000000 --- a/examples/components/src/character.js +++ /dev/null @@ -1,24 +0,0 @@ -import React from 'react'; - -const Character = ({ hero }) => { - return ( -
- {hero && ( -
-

{hero.name}

- {hero.friends && - hero.friends.map( - friend => - friend && ( -
- {friend.name}: {friend.appearsIn.map(x => x && x.toLowerCase()).join(', ')} -
- ), - )} -
- )} -
- ); -}; - -export default Character; diff --git a/examples/components/src/index.js b/examples/components/src/index.js deleted file mode 100644 index 4d30e5bf72..0000000000 --- a/examples/components/src/index.js +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import { render } from 'react-dom'; -import ApolloClient from 'apollo-boost'; -import { ApolloProvider } from 'react-apollo'; - -import App from './App'; - -const client = new ApolloClient({ - uri: 'https://ojo6385vn6.sse.codesandbox.io', -}); - -const WrappedApp = ( - - - -); - -render(WrappedApp, document.getElementById('root')); diff --git a/examples/mutation/.gitignore b/examples/mutation/.gitignore deleted file mode 100644 index d30f40ef44..0000000000 --- a/examples/mutation/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. - -# dependencies -/node_modules - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* diff --git a/examples/mutation/README.md b/examples/mutation/README.md deleted file mode 100644 index 426c25f997..0000000000 --- a/examples/mutation/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Mutation Example - -``` -npm install -npm start -``` - -This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app). diff --git a/examples/mutation/package.json b/examples/mutation/package.json deleted file mode 100644 index 4980f1181d..0000000000 --- a/examples/mutation/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "mutation", - "version": "0.1.0", - "private": true, - "dependencies": { - "apollo-boost": "^0.3.0", - "graphql": "^14.0.2", - "react": "^16.5.2", - "react-dom": "^16.5.2", - "react-scripts": "2.1.8", - "react-apollo": "../../lib" - }, - "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test --env=jsdom", - "eject": "react-scripts eject" - }, - "devDependencies": { - "react-testing-library": "6.0.2" - }, - "browserslist": [ - ">0.2%", - "not dead", - "not ie <= 11", - "not op_mini all" - ] -} diff --git a/examples/mutation/public/favicon.ico b/examples/mutation/public/favicon.ico deleted file mode 100644 index a11777cc471a4344702741ab1c8a588998b1311a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3870 zcma);c{J4h9>;%nil|2-o+rCuEF-(I%-F}ijC~o(k~HKAkr0)!FCj~d>`RtpD?8b; zXOC1OD!V*IsqUwzbMF1)-gEDD=A573Z-&G7^LoAC9|WO7Xc0Cx1g^Zu0u_SjAPB
3vGa^W|sj)80f#V0@M_CAZTIO(t--xg= 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 baj7?x%VD!5Cxk2YbYLNVeiXvvpMCWYo=by@ diff --git a/examples/mutation/public/index.html b/examples/mutation/public/index.html deleted file mode 100644 index ed0ebafa1b..0000000000 --- a/examples/mutation/public/index.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - React App - - - -
- - - diff --git a/examples/mutation/public/manifest.json b/examples/mutation/public/manifest.json deleted file mode 100644 index ef19ec243e..0000000000 --- a/examples/mutation/public/manifest.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - } - ], - "start_url": "./index.html", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/examples/mutation/src/AddUser.js b/examples/mutation/src/AddUser.js deleted file mode 100644 index 4b9dcb88b2..0000000000 --- a/examples/mutation/src/AddUser.js +++ /dev/null @@ -1,60 +0,0 @@ -import React from 'react'; -import { Mutation } from 'react-apollo'; -import { gql } from 'apollo-boost'; - -export const ADD_USER = gql` - mutation create($username: String!) { - createUser(username: $username) { - id - username - } - } -`; - -export default class AddUser extends React.Component { - state = { - username: '', - }; - render() { - const { username } = this.state; - - return ( - {}}> - {(addUser, result) => { - const { data, loading, error, called } = result; - - if (!called) { - return ( -
- this.setState({ username: e.target.value })} - /> - -
- ); - } - if (loading) { - return
LOADING
; - } - if (error) { - return
ERROR
; - } - - const { createUser } = data; - - if (createUser) { - const { username, id } = createUser; - - return
{`Created ${username} with id ${id}`}
; - } else { - return null; - } - }} -
- ); - } -} diff --git a/examples/mutation/src/__snapshots__/addUser.test.js.snap b/examples/mutation/src/__snapshots__/addUser.test.js.snap deleted file mode 100644 index 5a38ad8909..0000000000 --- a/examples/mutation/src/__snapshots__/addUser.test.js.snap +++ /dev/null @@ -1,15 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renders content if the mutation has not been called 1`] = ` -
- - -
-`; diff --git a/examples/mutation/src/addUser.test.js b/examples/mutation/src/addUser.test.js deleted file mode 100644 index ef9e181902..0000000000 --- a/examples/mutation/src/addUser.test.js +++ /dev/null @@ -1,86 +0,0 @@ -import React from 'react'; -import { render, fireEvent, wait } from 'react-testing-library'; -import { MockedProvider } from 'react-apollo/test-utils'; - -import AddUser, { ADD_USER } from './AddUser'; - -const request = { - query: ADD_USER, - variables: { username: 'peter' }, -}; - -const mocks = [ - { - request, - result: { - data: { - createUser: { - id: '1', - username: 'peter', - __typename: 'User', - }, - }, - }, - }, -]; - -const mocksWithError = [ - { - request, - error: new Error('Something went wrong'), - }, -]; - -const waitUntilLoadingIsFinished = queryByText => - wait(() => { - expect(queryByText('LOADING')).toBe(null); - }); - -it('renders content if the mutation has not been called', () => { - const { container } = render( - - - , - ); - expect(container.firstChild).toMatchSnapshot(); -}); - -it('fires the mutation', async () => { - const { container, getByPlaceholderText, getByTestId, getByText, queryByText, debug } = render( - - - , - ); - - const inputNode = getByPlaceholderText('Username'); - inputNode.defaultValue = 'peter'; - fireEvent.change(inputNode); - - const buttonNode = getByTestId('add-user-button'); - fireEvent.click(buttonNode); - - getByText('LOADING'); - - await waitUntilLoadingIsFinished(queryByText); - - getByText('Created peter with id 1'); -}); - -it('errors', async () => { - const { getByTestId, getByText, getByPlaceholderText, queryByText } = render( - - - , - ); - - const inputNode = getByPlaceholderText('Username'); - inputNode.value = 'peter'; - fireEvent.change(inputNode); - - const buttonNode = getByTestId('add-user-button'); - fireEvent.click(buttonNode); - - await waitUntilLoadingIsFinished(queryByText); - - getByText('ERROR'); -}); diff --git a/examples/mutation/src/index.css b/examples/mutation/src/index.css deleted file mode 100644 index b4cc7250b9..0000000000 --- a/examples/mutation/src/index.css +++ /dev/null @@ -1,5 +0,0 @@ -body { - margin: 0; - padding: 0; - font-family: sans-serif; -} diff --git a/examples/mutation/src/index.js b/examples/mutation/src/index.js deleted file mode 100644 index 314675e199..0000000000 --- a/examples/mutation/src/index.js +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import { render } from 'react-dom'; -import ApolloClient from 'apollo-boost'; -import { ApolloProvider } from 'react-apollo'; - -import AddUser from './AddUser'; - -const client = new ApolloClient({ - uri: 'https://j1wv1z179v.sse.codesandbox.io', -}); - -const WrappedApp = ( - - - -); - -render(WrappedApp, document.getElementById('root')); diff --git a/examples/rollup/.gitignore b/examples/rollup/.gitignore deleted file mode 100644 index a177082c37..0000000000 --- a/examples/rollup/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -*.min.js -*.min.js.map diff --git a/examples/rollup/README.md b/examples/rollup/README.md deleted file mode 100644 index 46f53cc196..0000000000 --- a/examples/rollup/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# rollup-example - -Example application using essential Apollo Client and React Apollo packages, bundled with [Rollup](https://rollupjs.org) in the best ways we know how. - -The goal of this application is to get a precise, real-world measurement of the total bundle footprint of essential Apollo packages, using a modern bundler, including the weight of dependencies (but excluding `react` and `react-dom`), while also taking into account the overlap between shared dependencies, which is not possible with per-package tools like [bundlephobia.com](https://bundlephobia.com/result?p=apollo-client@2.5.1). - -If you run -```bash -cd react-apollo/examples/rollup -npm install -npm run analyze -``` -in this application, [`source-map-explorer`](http://npmjs.org/package/source-map-explorer) will show you a breakdown of everything in the bundle that we think should be attributed to using Apollo Client and React Apollo. - -When this app was first created, the total stood at about 143KB (minified but *not* compressed with gzip, since that's how `source-map-explorer` works). After gzip, the total was 39KB. - -Of that 143KB, `apollo-client` is the biggest single offender, at 39.5KB, followed closely by `graphql`, at 31.6KB. If we included `react-dom`, it would weigh in at 106KB, but there's not much we can do about that, so we don't bother measuring it. By contrast, Apollo can pick and choose what it imports from the `graphql` package, so the `graphql` package is worth measuring, even though it's not maintained by Apollo. - -We welcome anyone and everyone to examine the measurement methodology we're using here, because early feedback about any inaccuracies will make this application much more useful for deciding where and how to invest future bundle reduction energy. - -Likewise, we hope the analysis produced by this application will inspire grounded discussion of potential bundle reduction strategies, in addition to helping validate them. Please see [issue #2743](https://github.com/apollographql/react-apollo/issues/2743) for more details about that effort. diff --git a/examples/rollup/index.html b/examples/rollup/index.html deleted file mode 100644 index 993cbd915d..0000000000 --- a/examples/rollup/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - -
- - - diff --git a/examples/rollup/main.js b/examples/rollup/main.js deleted file mode 100644 index 8a8fe82db2..0000000000 --- a/examples/rollup/main.js +++ /dev/null @@ -1,50 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import { ApolloClient } from 'apollo-client'; -import { InMemoryCache } from 'apollo-cache-inmemory'; -import { HttpLink } from 'apollo-link-http'; -import { Query, ApolloProvider } from 'react-apollo'; -import gql from 'graphql-tag'; - -const client = new ApolloClient({ - cache: new InMemoryCache(), - link: new HttpLink({ - uri: 'http://localhost:4000/graphql', - }) -}); - -client.writeData({ - data: { - isLoggedIn: false - } -}); - -const IS_LOGGED_IN = gql` - query IsUserLoggedIn { - isLoggedIn @client - } -`; - -function toggle() { - const result = client.readQuery({ query: IS_LOGGED_IN }); - client.writeData({ - data: { - isLoggedIn: !result.isLoggedIn - } - }); -} - -ReactDOM.render( - - - {({data}) => [ - "logged " + (data.isLoggedIn ? "in" : "out"), -
, - , - ]} -
-
, - document.getElementById('root'), -); diff --git a/examples/rollup/package-lock.json b/examples/rollup/package-lock.json deleted file mode 100644 index 1835e78ace..0000000000 --- a/examples/rollup/package-lock.json +++ /dev/null @@ -1,2697 +0,0 @@ -{ - "name": "rollup-example", - "requires": true, - "lockfileVersion": 1, - "dependencies": { - "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/helper-builder-react-jsx": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.3.0.tgz", - "integrity": "sha512-MjA9KgwCuPEkQd9ncSXvSyJ5y+j2sICHyrI0M3L+6fnS4wMSNDc1ARXsbTfbb2cXHn17VisSnU/sHFTCxVxSMw==", - "dev": true, - "requires": { - "@babel/types": "^7.3.0", - "esutils": "^2.0.0" - } - }, - "@babel/helper-module-imports": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz", - "integrity": "sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0" - } - }, - "@babel/helper-plugin-utils": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz", - "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==", - "dev": true - }, - "@babel/highlight": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", - "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@babel/plugin-syntax-jsx": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.2.0.tgz", - "integrity": "sha512-VyN4QANJkRW6lDBmENzRszvZf3/4AXaj9YR7GwrWeeN9tEBPuXbmDYVU9bYBN0D70zCWVwUy0HWq2553VCb6Hw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-react-display-name": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.2.0.tgz", - "integrity": "sha512-Htf/tPa5haZvRMiNSQSFifK12gtr/8vwfr+A9y69uF0QcU77AVu4K7MiHEkTxF7lQoHOL0F9ErqgfNEAKgXj7A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-react-jsx": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.3.0.tgz", - "integrity": "sha512-a/+aRb7R06WcKvQLOu4/TpjKOdvVEKRLWFpKcNuHhiREPgGRB4TQJxq07+EZLS8LFVYpfq1a5lDUnuMdcCpBKg==", - "dev": true, - "requires": { - "@babel/helper-builder-react-jsx": "^7.3.0", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-jsx": "^7.2.0" - } - }, - "@babel/plugin-transform-react-jsx-self": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.2.0.tgz", - "integrity": "sha512-v6S5L/myicZEy+jr6ielB0OR8h+EH/1QFx/YJ7c7Ua+7lqsjj/vW6fD5FR9hB/6y7mGbfT4vAURn3xqBxsUcdg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-jsx": "^7.2.0" - } - }, - "@babel/plugin-transform-react-jsx-source": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.2.0.tgz", - "integrity": "sha512-A32OkKTp4i5U6aE88GwwcuV4HAprUgHcTq0sSafLxjr6AW0QahrCRCjxogkbbcdtpbXkuTOlgpjophCxb6sh5g==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-jsx": "^7.2.0" - } - }, - "@babel/preset-react": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.0.0.tgz", - "integrity": "sha512-oayxyPS4Zj+hF6Et11BwuBkmpgT/zMxyuZgFrMeZID6Hdh3dGlk4sHCAhdBCpuCKW2ppBfl2uCCetlrUIJRY3w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-transform-react-display-name": "^7.0.0", - "@babel/plugin-transform-react-jsx": "^7.0.0", - "@babel/plugin-transform-react-jsx-self": "^7.0.0", - "@babel/plugin-transform-react-jsx-source": "^7.0.0" - } - }, - "@babel/types": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.4.tgz", - "integrity": "sha512-WEkp8MsLftM7O/ty580wAmZzN1nDmCACc5+jFzUt+GUFNNIi3LdRlueYz0YIlmJhlZx1QYDMZL5vdWCL0fNjFQ==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.11", - "to-fast-properties": "^2.0.0" - } - }, - "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true - }, - "@types/node": { - "version": "11.11.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", - "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==", - "dev": true - }, - "@types/zen-observable": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.0.tgz", - "integrity": "sha512-te5lMAWii1uEJ4FwLjzdlbw3+n0FZNOvFXHxQDKeT0dilh7HOzdMzV2TrJVUzq8ep7J4Na8OUYPRLSQkJHAlrg==" - }, - "@zeit/schemas": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@zeit/schemas/-/schemas-2.6.0.tgz", - "integrity": "sha512-uUrgZ8AxS+Lio0fZKAipJjAh415JyrOZowliZAzmnJSsf7piVL5w+G0+gFJ0KSu3QRhvui/7zuvpLz03YjXAhg==" - }, - "accepts": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", - "requires": { - "mime-types": "~2.1.18", - "negotiator": "0.6.1" - } - }, - "acorn": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", - "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", - "dev": true - }, - "ajv": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.3.tgz", - "integrity": "sha512-LqZ9wY+fx3UMiiPd741yB2pj3hhil+hQc8taf4o2QGRFpWgZ2V5C8HA165DY9sS3fJwsk7uT7ZlFEyC3Ig3lLg==", - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true - }, - "ansi-align": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", - "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", - "requires": { - "string-width": "^2.0.0" - } - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "apollo-cache": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/apollo-cache/-/apollo-cache-1.2.1.tgz", - "integrity": "sha512-nzFmep/oKlbzUuDyz6fS6aYhRmfpcHWqNkkA9Bbxwk18RD6LXC4eZkuE0gXRX0IibVBHNjYVK+Szi0Yied4SpQ==", - "requires": { - "apollo-utilities": "^1.2.1", - "tslib": "^1.9.3" - } - }, - "apollo-cache-inmemory": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/apollo-cache-inmemory/-/apollo-cache-inmemory-1.5.1.tgz", - "integrity": "sha512-D3bdpPmWfaKQkWy8lfwUg+K8OBITo3sx0BHLs1B/9vIdOIZ7JNCKq3EUcAgAfInomJUdN0QG1yOfi8M8hxkN1g==", - "requires": { - "apollo-cache": "^1.2.1", - "apollo-utilities": "^1.2.1", - "optimism": "^0.6.9", - "ts-invariant": "^0.2.1", - "tslib": "^1.9.3" - } - }, - "apollo-client": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/apollo-client/-/apollo-client-2.5.1.tgz", - "integrity": "sha512-MNcQKiqLHdGmNJ0rZ0NXaHrToXapJgS/5kPk0FygXt+/FmDCdzqcujI7OPxEC6e9Yw5S/8dIvOXcRNuOMElHkA==", - "requires": { - "@types/zen-observable": "^0.8.0", - "apollo-cache": "1.2.1", - "apollo-link": "^1.0.0", - "apollo-link-dedup": "^1.0.0", - "apollo-utilities": "1.2.1", - "symbol-observable": "^1.0.2", - "ts-invariant": "^0.2.1", - "tslib": "^1.9.3", - "zen-observable": "^0.8.0" - } - }, - "apollo-link": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.2.8.tgz", - "integrity": "sha512-lfzGRxhK9RmiH3HPFi7TIEBhhDY9M5a2ZDnllcfy5QDk7cCQHQ1WQArcw1FK0g1B+mV4Kl72DSrlvZHZJEolrA==", - "requires": { - "zen-observable-ts": "^0.8.15" - } - }, - "apollo-link-dedup": { - "version": "1.0.15", - "resolved": "https://registry.npmjs.org/apollo-link-dedup/-/apollo-link-dedup-1.0.15.tgz", - "integrity": "sha512-14/+Tg7ogcYVrvZa8C7uBQIvX2B/dCKSnojI41yDYGp/t2eWD5ITCWdgjhciXpi0Ij6z+NRyMEebACz3EOwm4w==", - "requires": { - "apollo-link": "^1.2.8" - } - }, - "apollo-link-http": { - "version": "1.5.11", - "resolved": "https://registry.npmjs.org/apollo-link-http/-/apollo-link-http-1.5.11.tgz", - "integrity": "sha512-wDG+I9UmpfaZRPIvTYBgkvqiCgmz6yWgvuzW/S24Q4r4Xrfe6sLpg2FmarhtdP+hdN+IXTLbFNCZ+Trgfpifow==", - "requires": { - "apollo-link": "^1.2.8", - "apollo-link-http-common": "^0.2.10" - } - }, - "apollo-link-http-common": { - "version": "0.2.10", - "resolved": "https://registry.npmjs.org/apollo-link-http-common/-/apollo-link-http-common-0.2.10.tgz", - "integrity": "sha512-KY9nhpAurw3z48OIYV0sCZFXrzWp/wjECsveK+Q9GUhhSe1kEbbUjFfmi+qigg+iELgdp5V8ioRJhinl1vPojw==", - "requires": { - "apollo-link": "^1.2.8" - } - }, - "apollo-utilities": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.2.1.tgz", - "integrity": "sha512-Zv8Udp9XTSFiN8oyXOjf6PMHepD4yxxReLsl6dPUy5Ths7jti3nmlBzZUOxuTWRwZn0MoclqL7RQ5UEJN8MAxg==", - "requires": { - "fast-json-stable-stringify": "^2.0.0", - "ts-invariant": "^0.2.1", - "tslib": "^1.9.3" - } - }, - "arch": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/arch/-/arch-2.1.1.tgz", - "integrity": "sha512-BLM56aPo9vLLFVa8+/+pJLnrZ7QGGTVHWsCwieAWT9o9K8UeGaQbzZbGoabWLOo2ksBCztoXdqBZBplqLDDCSg==" - }, - "arg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arg/-/arg-2.0.0.tgz", - "integrity": "sha512-XxNTUzKnz1ctK3ZIcI2XUPlD96wbHP2nGqkPKpvk/HNRlPveYrXIVSTk9m3LcqOgDPg3B1nMvdV/K8wZd7PG4w==" - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "ast-types": { - "version": "0.9.6", - "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.9.6.tgz", - "integrity": "sha1-ECyenpAF0+fjgpvwxPok7oYu6bk=", - "dev": true - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "base62": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/base62/-/base62-1.2.8.tgz", - "integrity": "sha512-V6YHUbjLxN1ymqNLb1DPHoU1CpfdL7d2YTIp5W3U4hhoG4hhxNmsFDs66M9EXxBiSEke5Bt5dwdfMwwZF70iLA==", - "dev": true - }, - "boxen": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", - "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", - "requires": { - "ansi-align": "^2.0.0", - "camelcase": "^4.0.0", - "chalk": "^2.0.1", - "cli-boxes": "^1.0.0", - "string-width": "^2.0.0", - "term-size": "^1.2.0", - "widest-line": "^2.0.0" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "btoa": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz", - "integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==", - "dev": true - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "builtin-modules": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.0.0.tgz", - "integrity": "sha512-hMIeU4K2ilbXV6Uv93ZZ0Avg/M91RaKXucQ+4me2Do1txxBDyDZWCBa5bJSLqoNTRpXTLwEzIk1KmloenDDjhg==", - "dev": true - }, - "bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "cli-boxes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", - "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=" - }, - "clipboardy": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-1.2.3.tgz", - "integrity": "sha512-2WNImOvCRe6r63Gk9pShfkwXsVtKCroMAevIbiae021mS850UkWPbevxsBz3tnvjZIEGvlwaqCPsw+4ulzNgJA==", - "requires": { - "arch": "^2.1.0", - "execa": "^0.8.0" - }, - "dependencies": { - "execa": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.8.0.tgz", - "integrity": "sha1-2NdrvBtVIX7RkP1t1J08d07PyNo=", - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - } - } - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, - "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", - "dev": true - }, - "commoner": { - "version": "0.10.8", - "resolved": "https://registry.npmjs.org/commoner/-/commoner-0.10.8.tgz", - "integrity": "sha1-NPw2cs0kOT6LtH5wyqApOBH08sU=", - "dev": true, - "requires": { - "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" - } - }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, - "compressible": { - "version": "2.0.16", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.16.tgz", - "integrity": "sha512-JQfEOdnI7dASwCuSPWIeVYwc/zMsu/+tRhoUvEfXz2gxOA2DNjmG5vhtFdBlhWPPGo+RdT9S3tgc/uH5qgDiiA==", - "requires": { - "mime-db": ">= 1.38.0 < 2" - } - }, - "compression": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.3.tgz", - "integrity": "sha512-HSjyBG5N1Nnz7tF2+O7A9XUhyjru71/fwgNb7oIsEVHR0WShfs2tIS/EySLgiTe98aOK18YDlMXpzjCXY/n9mg==", - "requires": { - "accepts": "~1.3.5", - "bytes": "3.0.0", - "compressible": "~2.0.14", - "debug": "2.6.9", - "on-headers": "~1.0.1", - "safe-buffer": "5.1.2", - "vary": "~1.1.2" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "content-disposition": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" - }, - "convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", - "dev": true - }, - "detective": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/detective/-/detective-4.7.1.tgz", - "integrity": "sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig==", - "dev": true, - "requires": { - "acorn": "^5.2.1", - "defined": "^1.0.0" - }, - "dependencies": { - "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", - "dev": true - } - } - }, - "docopt": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/docopt/-/docopt-0.6.2.tgz", - "integrity": "sha1-so6eIiDaXsSffqW7JKR3h0Be6xE=", - "dev": true - }, - "ejs": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.6.1.tgz", - "integrity": "sha512-0xy4A/twfrRCnkhfk8ErDi5DqdAsAqeGxht4xkCUrsvhhbQNs7E+4jV0CN7+NKIY0aHE72+XvqtBIXzD31ZbXQ==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" - }, - "esprima-fb": { - "version": "15001.1001.0-dev-harmony-fb", - "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-15001.1001.0-dev-harmony-fb.tgz", - "integrity": "sha1-Q761fsJujPI3092LM+QlM1d/Jlk=", - "dev": true - }, - "estree-walker": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.0.tgz", - "integrity": "sha512-peq1RfVAVzr3PU/jL31RaOjUKLoZJpObQWJJ+LgfcxDUifyLZ1RjPQZTl0pzj2uJ45b7A7XpyppXvxdEqzo4rw==", - "dev": true - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, - "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "fast-url-parser": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/fast-url-parser/-/fast-url-parser-1.1.3.tgz", - "integrity": "sha1-9K8+qfNNiicc9YrSs3WfQx8LMY0=", - "requires": { - "punycode": "^1.3.2" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "dev": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", - "dev": true - }, - "graphql": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-14.1.1.tgz", - "integrity": "sha512-C5zDzLqvfPAgTtP8AUPIt9keDabrdRAqSWjj2OPRKrKxI9Fb65I36s1uCs1UUBFnSWTdO7hyHi7z1ZbwKMKF6Q==", - "requires": { - "iterall": "^1.2.2" - } - }, - "graphql-tag": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.10.1.tgz", - "integrity": "sha512-jApXqWBzNXQ8jYa/HLkZJaVw9jgwNqZkywa2zfFn16Iv1Zb7ELNHkJaXHR7Quvd5SIGsy6Ny7SUKATgnu05uEg==" - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hoist-non-react-statics": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz", - "integrity": "sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA==", - "requires": { - "react-is": "^16.7.0" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "immutable-tuple": { - "version": "0.4.10", - "resolved": "https://registry.npmjs.org/immutable-tuple/-/immutable-tuple-0.4.10.tgz", - "integrity": "sha512-45jheDbc3Kr5Cw8EtDD+4woGRUV0utIrJBZT8XH0TPZRfm8tzT0/sLGGzyyCCFqFMG5Pv5Igf3WY/arn6+8V9Q==" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" - }, - "is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", - "dev": true - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "iterall": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/iterall/-/iterall-1.2.2.tgz", - "integrity": "sha512-yynBb1g+RFUPY64fTrFv7nsjRrENBQJaX2UL+2Szc9REFrSNm1rpSXHGzhmAy7a9uv3vlvgBlXnf9RqmPH1/DA==" - }, - "jest-worker": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.0.0.tgz", - "integrity": "sha512-s64/OThpfQvoCeHG963MiEZOAAxu8kHsaL/rCMF7lpdzo7vgF0CtPml9hfguOMgykgH/eOm4jFP4ibfHLruytg==", - "dev": true, - "requires": { - "merge-stream": "^1.0.1", - "supports-color": "^6.1.0" - }, - "dependencies": { - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "jstransform": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/jstransform/-/jstransform-11.0.3.tgz", - "integrity": "sha1-CaeJk+CuTU70SH9hVakfYZDLQiM=", - "dev": true, - "requires": { - "base62": "^1.1.0", - "commoner": "^0.10.1", - "esprima-fb": "^15001.1.0-dev-harmony-fb", - "object-assign": "^2.0.0", - "source-map": "^0.4.2" - }, - "dependencies": { - "esprima-fb": { - "version": "15001.1.0-dev-harmony-fb", - "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-15001.1.0-dev-harmony-fb.tgz", - "integrity": "sha1-MKlHMDxrjV6VW+4rmbHSMyBqaQE=", - "dev": true - }, - "object-assign": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-2.1.1.tgz", - "integrity": "sha1-Q8NuXVaf+OSBbE76i+AtJpZ8GKo=", - "dev": true - }, - "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, - "jsx-transform": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsx-transform/-/jsx-transform-2.4.0.tgz", - "integrity": "sha512-kBsq4DOlLEgoKl6LJj/uByL6rFx81VIIVHsZTQXidU1Zf9puR2YJZfNUbXT/MO9pcST9HNaA+5UjF3CdteYD6Q==", - "dev": true, - "requires": { - "esprima-fb": "^15001.1001.0-dev-harmony-fb", - "jstransform": "^11.0.0", - "through2": "^2.0.0" - } - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - }, - "lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" - }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "magic-string": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.2.tgz", - "integrity": "sha512-iLs9mPjh9IuTtRsqqhNGYcZXGei0Nh/A4xirrsqW7c+QhKVFL2vm7U09ru6cHRD22azaP/wMDgI+HCqbETMTtg==", - "dev": true, - "requires": { - "sourcemap-codec": "^1.4.4" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "merge-stream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", - "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", - "dev": true, - "requires": { - "readable-stream": "^2.0.1" - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "mime-db": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" - }, - "mime-types": { - "version": "2.1.22", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", - "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", - "requires": { - "mime-db": "~1.38.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - }, - "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, - "negotiator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "requires": { - "path-key": "^2.0.0" - } - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "opn": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", - "integrity": "sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==", - "dev": true, - "requires": { - "is-wsl": "^1.1.0" - } - }, - "optimism": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.6.9.tgz", - "integrity": "sha512-xoQm2lvXbCA9Kd7SCx6y713Y7sZ6fUc5R6VYpoL5M6svKJbTuvtNopexK8sO8K4s0EOUYHuPN2+yAEsNyRggkQ==", - "requires": { - "immutable-tuple": "^0.4.9" - } - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-to-regexp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-2.2.1.tgz", - "integrity": "sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==" - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true - }, - "prop-types": { - "version": "15.7.2", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", - "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", - "requires": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.8.1" - } - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", - "dev": true - }, - "range-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "react": { - "version": "16.8.3", - "resolved": "https://registry.npmjs.org/react/-/react-16.8.3.tgz", - "integrity": "sha512-3UoSIsEq8yTJuSu0luO1QQWYbgGEILm+eJl2QN/VLDi7hL+EN18M3q3oVZwmVzzBJ3DkM7RMdRwBmZZ+b4IzSA==", - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "prop-types": "^15.6.2", - "scheduler": "^0.13.3" - } - }, - "react-apollo": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/react-apollo/-/react-apollo-2.5.1.tgz", - "integrity": "sha512-obXPcmjJ5O75UkoizcsIbe0PXAXKRqm+SwNu059HQInB3FAab9PIn4wd/KglpPNiB9JXHe8OJDov0lFMcBbHEQ==", - "requires": { - "apollo-utilities": "^1.2.1", - "hoist-non-react-statics": "^3.0.0", - "lodash.isequal": "^4.5.0", - "prop-types": "^15.6.0", - "ts-invariant": "^0.2.1", - "tslib": "^1.9.3" - } - }, - "react-dom": { - "version": "16.8.3", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.8.3.tgz", - "integrity": "sha512-ttMem9yJL4/lpItZAQ2NTFAbV7frotHk5DZEHXUOws2rMmrsvh1Na7ThGT0dTzUIl6pqTOi5tYREfL8AEna3lA==", - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "prop-types": "^15.6.2", - "scheduler": "^0.13.3" - } - }, - "react-is": { - "version": "16.8.3", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.3.tgz", - "integrity": "sha512-Y4rC1ZJmsxxkkPuMLwvKvlL1Zfpbcu+Bf4ZigkHup3v9EfdYhAlWAaVyA19olXq2o2mGn0w+dFKvk3pVVlYcIA==" - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "recast": { - "version": "0.11.23", - "resolved": "https://registry.npmjs.org/recast/-/recast-0.11.23.tgz", - "integrity": "sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM=", - "dev": true, - "requires": { - "ast-types": "0.9.6", - "esprima": "~3.1.0", - "private": "~0.1.5", - "source-map": "~0.5.0" - }, - "dependencies": { - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", - "dev": true - } - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "registry-auth-token": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", - "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", - "requires": { - "rc": "^1.1.6", - "safe-buffer": "^5.0.1" - } - }, - "registry-url": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", - "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", - "requires": { - "rc": "^1.0.1" - } - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "resolve": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - }, - "dependencies": { - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } - } - }, - "rollup": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.7.0.tgz", - "integrity": "sha512-hjuWSCgoQsFSTsmsNP4AH1l1kfkFqW82gW00V9nL81Zr3JtnKn3rvxh18jUAAEMb7qNoHj21PR5SqbK2mhBgMg==", - "dev": true, - "requires": { - "@types/estree": "0.0.39", - "@types/node": "^11.9.5", - "acorn": "^6.1.1" - } - }, - "rollup-plugin-babel": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-4.3.2.tgz", - "integrity": "sha512-KfnizE258L/4enADKX61ozfwGHoqYauvoofghFJBhFnpH9Sb9dNPpWg8QHOaAfVASUYV8w0mCx430i9z0LJoJg==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.0.0", - "rollup-pluginutils": "^2.3.0" - } - }, - "rollup-plugin-commonjs": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.2.1.tgz", - "integrity": "sha512-X0A/Cp/t+zbONFinBhiTZrfuUaVwRIp4xsbKq/2ohA2CDULa/7ONSJTelqxon+Vds2R2t2qJTqJQucKUC8GKkw==", - "dev": true, - "requires": { - "estree-walker": "^0.5.2", - "magic-string": "^0.25.1", - "resolve": "^1.10.0", - "rollup-pluginutils": "^2.3.3" - }, - "dependencies": { - "estree-walker": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", - "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", - "dev": true - } - } - }, - "rollup-plugin-jsx": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/rollup-plugin-jsx/-/rollup-plugin-jsx-1.0.3.tgz", - "integrity": "sha1-knk7yp42+Q/QDZkfaghw5Z3vr60=", - "dev": true, - "requires": { - "jsx-transform": "^2.3.0", - "magic-string": "^0.14.0", - "rollup-pluginutils": "^1.3.1" - }, - "dependencies": { - "estree-walker": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.2.1.tgz", - "integrity": "sha1-va/oCVOD2EFNXcLs9MkXO225QS4=", - "dev": true - }, - "magic-string": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.14.0.tgz", - "integrity": "sha1-VyJK7xcByu7Sc7F6OalW5ysXJGI=", - "dev": true, - "requires": { - "vlq": "^0.2.1" - } - }, - "rollup-pluginutils": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz", - "integrity": "sha1-HhVud4+UtyVb+hs9AXi+j1xVJAg=", - "dev": true, - "requires": { - "estree-walker": "^0.2.1", - "minimatch": "^3.0.2" - } - } - } - }, - "rollup-plugin-node-resolve": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.0.1.tgz", - "integrity": "sha512-fSS7YDuCe0gYqKsr5OvxMloeZYUSgN43Ypi1WeRZzQcWtHgFayV5tUSPYpxuaioIIWaBXl6NrVk0T2/sKwueLg==", - "dev": true, - "requires": { - "builtin-modules": "^3.0.0", - "is-module": "^1.0.0", - "resolve": "^1.10.0" - } - }, - "rollup-plugin-replace": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-replace/-/rollup-plugin-replace-2.1.1.tgz", - "integrity": "sha512-IS5ZYBb3px0UfbDCYzKaKxelLd5dbPHhfplEXbymfvGlz9Ok44At4AjTOWe2qEax73bE8+pnMZN9C7PcVpFNlw==", - "dev": true, - "requires": { - "magic-string": "^0.25.2", - "rollup-pluginutils": "^2.4.1" - } - }, - "rollup-plugin-terser": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-4.0.4.tgz", - "integrity": "sha512-wPANT5XKVJJ8RDUN0+wIr7UPd0lIXBo4UdJ59VmlPCtlFsE20AM+14pe+tk7YunCsWEiuzkDBY3QIkSCjtrPXg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "jest-worker": "^24.0.0", - "serialize-javascript": "^1.6.1", - "terser": "^3.14.1" - } - }, - "rollup-pluginutils": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.4.1.tgz", - "integrity": "sha512-wesMQ9/172IJDIW/lYWm0vW0LiKe5Ekjws481R7z9WTRtmO59cqyM/2uUlxvf6yzm/fElFmHUobeQOYz46dZJw==", - "dev": true, - "requires": { - "estree-walker": "^0.6.0", - "micromatch": "^3.1.10" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "scheduler": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.3.tgz", - "integrity": "sha512-UxN5QRYWtpR1egNWzJcVLk8jlegxAugswQc984lD3kU7NuobsO37/sRfbpTdBjtnD5TBNFA2Q2oLV5+UmPSmEQ==", - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" - } - }, - "serialize-javascript": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.6.1.tgz", - "integrity": "sha512-A5MOagrPFga4YaKQSWHryl7AXvbQkEqpw4NNYMTNYUNV51bA8ABHgYFpqKx+YFFrw59xMV1qGH1R4AgoNIVgCw==", - "dev": true - }, - "serve": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/serve/-/serve-10.1.2.tgz", - "integrity": "sha512-TVH35uwndRlCqSeX3grR3Ntrjx2aBTeu6sx+zTD2CzN2N/rHuEDTvxiBwWbrellJNyWiQFz2xZmoW+UxV+Zahg==", - "requires": { - "@zeit/schemas": "2.6.0", - "ajv": "6.5.3", - "arg": "2.0.0", - "boxen": "1.3.0", - "chalk": "2.4.1", - "clipboardy": "1.2.3", - "compression": "1.7.3", - "serve-handler": "5.0.8", - "update-check": "1.5.2" - } - }, - "serve-handler": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-5.0.8.tgz", - "integrity": "sha512-pqk0SChbBLLHfMIxQ55czjdiW7tj2cFy53svvP8e5VqEN/uB/QpfiTJ8k1uIYeFTDVoi+FGi5aqXScuu88bymg==", - "requires": { - "bytes": "3.0.0", - "content-disposition": "0.5.2", - "fast-url-parser": "1.1.3", - "mime-types": "2.1.18", - "minimatch": "3.0.4", - "path-is-inside": "1.0.2", - "path-to-regexp": "2.2.1", - "range-parser": "1.2.0" - }, - "dependencies": { - "mime-db": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", - "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" - }, - "mime-types": { - "version": "2.1.18", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", - "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", - "requires": { - "mime-db": "~1.33.0" - } - } - } - }, - "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "source-map-explorer": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/source-map-explorer/-/source-map-explorer-1.8.0.tgz", - "integrity": "sha512-1Q0lNSw5J7pChKmjqniOCLbvLFi4KJfrtixk99CzvRcqFiGBJvRHMrw0PjLwKOvbuAo8rNOukJhEPA0Nj85xDw==", - "dev": true, - "requires": { - "btoa": "^1.2.1", - "convert-source-map": "^1.6.0", - "docopt": "^0.6.2", - "ejs": "^2.6.1", - "fs-extra": "^7.0.1", - "glob": "^7.1.3", - "opn": "^5.5.0", - "source-map": "^0.5.1", - "temp": "^0.9.0" - }, - "dependencies": { - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } - } - }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "dev": true, - "requires": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-support": { - "version": "0.5.10", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.10.tgz", - "integrity": "sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, - "sourcemap-codec": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.4.tgz", - "integrity": "sha512-CYAPYdBu34781kLHkaW3m6b/uUSyMOC2R61gcYMWooeuaGtjof86ZA/8T+qVPPt7np1085CR9hmMGrySwEc8Xg==", - "dev": true - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - }, - "symbol-observable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", - "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" - }, - "temp": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/temp/-/temp-0.9.0.tgz", - "integrity": "sha512-YfUhPQCJoNQE5N+FJQcdPz63O3x3sdT4Xju69Gj4iZe0lBKOtnAMi0SLj9xKhGkcGhsxThvTJ/usxtFPo438zQ==", - "dev": true, - "requires": { - "rimraf": "~2.6.2" - } - }, - "term-size": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", - "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", - "requires": { - "execa": "^0.7.0" - } - }, - "terser": { - "version": "3.16.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-3.16.1.tgz", - "integrity": "sha512-JDJjgleBROeek2iBcSNzOHLKsB/MdDf+E/BOAJ0Tk9r7p9/fVobfv7LMJ/g/k3v9SXdmjZnIlFd5nfn/Rt0Xow==", - "dev": true, - "requires": { - "commander": "~2.17.1", - "source-map": "~0.6.1", - "source-map-support": "~0.5.9" - }, - "dependencies": { - "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "ts-invariant": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.2.1.tgz", - "integrity": "sha512-Z/JSxzVmhTo50I+LKagEISFJW3pvPCqsMWLamCTX8Kr3N5aMrnGOqcflbe5hLUzwjvgPfnLzQtHZv0yWQ+FIHg==", - "requires": { - "tslib": "^1.9.3" - } - }, - "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" - }, - "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - } - } - }, - "update-check": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/update-check/-/update-check-1.5.2.tgz", - "integrity": "sha512-1TrmYLuLj/5ZovwUS7fFd1jMH3NnFDN1y1A8dboedIDt7zs/zJMo6TwwlhYKkSeEwzleeiSBV5/3c9ufAQWDaQ==", - "requires": { - "registry-auth-token": "3.3.2", - "registry-url": "3.1.0" - } - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "requires": { - "punycode": "^2.1.0" - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" - }, - "vlq": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", - "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "requires": { - "isexe": "^2.0.0" - } - }, - "widest-line": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", - "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", - "requires": { - "string-width": "^2.1.1" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - }, - "zen-observable": { - "version": "0.8.13", - "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.13.tgz", - "integrity": "sha512-fa+6aDUVvavYsefZw0zaZ/v3ckEtMgCFi30sn91SEZea4y/6jQp05E3omjkX91zV6RVdn15fqnFZ6RKjRGbp2g==" - }, - "zen-observable-ts": { - "version": "0.8.15", - "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-0.8.15.tgz", - "integrity": "sha512-sXKPWiw6JszNEkRv5dQ+lQCttyjHM2Iks74QU5NP8mMPS/NrzTlHDr780gf/wOBqmHkPO6NCLMlsa+fAQ8VE8w==", - "requires": { - "zen-observable": "^0.8.0" - } - } - } -} diff --git a/examples/rollup/package.json b/examples/rollup/package.json deleted file mode 100644 index f02effb5fb..0000000000 --- a/examples/rollup/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "rollup-example", - "private": true, - "scripts": { - "build": "rollup -c", - "start": "npm run build && npx serve", - "analyze": "npm run build && source-map-explorer app-without-react.min.js" - }, - "devDependencies": { - "@babel/preset-react": "7.0.0", - "rollup": "1.7.0", - "rollup-plugin-babel": "4.3.2", - "rollup-plugin-commonjs": "9.2.1", - "rollup-plugin-jsx": "1.0.3", - "rollup-plugin-node-resolve": "4.0.1", - "rollup-plugin-replace": "2.1.1", - "rollup-plugin-terser": "4.0.4", - "source-map-explorer": "1.8.0" - }, - "dependencies": { - "apollo-cache-inmemory": "^1.5.1", - "apollo-client": "^2.5.1", - "apollo-link-http": "^1.5.11", - "graphql": "^14.1.1", - "graphql-tag": "^2.10.1", - "react": "^16.8.3", - "react-apollo": "^2.5.1", - "react-dom": "^16.8.3", - "serve": "^10.1.2", - "tslib": "^1.9.3" - } -} diff --git a/examples/rollup/rollup.config.js b/examples/rollup/rollup.config.js deleted file mode 100644 index eac6a260e0..0000000000 --- a/examples/rollup/rollup.config.js +++ /dev/null @@ -1,112 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import node from 'rollup-plugin-node-resolve'; -import babel from 'rollup-plugin-babel'; -import cjs from 'rollup-plugin-commonjs'; -import replace from 'rollup-plugin-replace'; -import { terser as minify } from 'rollup-plugin-terser'; - -// The source-map-explorer package which powers `npm run analyze` works by -// examining the bundle.min.js.map file, so it's important to include the -// source maps of all the individual package bundles that went into -// building the final application bundle. -const sourceMapLoaderPlugin = { - load(id) { - if (id.endsWith('.esm.js')) { - try { - const map = JSON.parse(fs.readFileSync(id + '.map')); - map.sources.forEach((source, i) => { - map.sources[i] = path.normalize(path.join(id, source)); - }); - return { - code: fs.readFileSync(id, 'utf8'), - map: map, - }; - } catch (e) { - console.log("failed to find source map for " + id); - } - } - return null; - }, -}; - -function build({ - outputPrefix, - externals = [], -}) { - return { - input: "main.js", - output: { - file: outputPrefix + ".min.js", - format: "cjs", - sourcemap: true, - }, - external(id) { - return externals.indexOf(id) >= 0; - }, - plugins: [ - node({ - module: true, - }), - replace({ - // It's important to replace process.env.NODE_ENV earlier in the Rollup - // pipeline (as well as later, during minification), so Rollup can prune - // the module dependency graph using this information. - "process.env.NODE_ENV": JSON.stringify("production"), - }), - sourceMapLoaderPlugin, - babel({ - exclude: "node_modules/**", - presets: [ - require("@babel/preset-react"), - ], - }), - cjs({ - namedExports: { - "node_modules/react/index.js": [ - "Component", - "createElement", - "Children", - ], - "node_modules/prop-types/index.js": [ - "any", - "arrayOf", - "bool", - "func", - "node", - "number", - "object", - "oneOfType", - "string", - ], - }, - }), - minify({ - mangle: { - toplevel: true - }, - compress: { - dead_code: true, - global_defs: { - "@process.env.NODE_ENV": JSON.stringify("production"), - }, - }, - }), - ], - }; -} - -export default [ - build({ - // While react and react-dom are certainly relevant to bundle size, they - // would dwarf the Apollo and graphql-js packages, and there's not much we - // can do about how large they are, since they ship their own minified - // production builds. - externals: ["react", "react-dom"], - outputPrefix: "app-without-react", - }), - build({ - externals: [], - outputPrefix: "app-with-react", - }), -]; diff --git a/examples/ssr/.babelrc b/examples/ssr/.babelrc deleted file mode 100644 index be2d51c02c..0000000000 --- a/examples/ssr/.babelrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "presets": [ - "react" - ], - "plugins": [ - "transform-react-require" - ] -} diff --git a/examples/ssr/.gitignore b/examples/ssr/.gitignore deleted file mode 100644 index 167ab9ffe4..0000000000 --- a/examples/ssr/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -yarn.lock \ No newline at end of file diff --git a/examples/ssr/.meteor/.finished-upgraders b/examples/ssr/.meteor/.finished-upgraders deleted file mode 100644 index 4538749ab8..0000000000 --- a/examples/ssr/.meteor/.finished-upgraders +++ /dev/null @@ -1,18 +0,0 @@ -# This file contains information which helps Meteor properly upgrade your -# app when you run 'meteor update'. You should check it into version control -# with your project. - -notices-for-0.9.0 -notices-for-0.9.1 -0.9.4-platform-file -notices-for-facebook-graph-api-2 -1.2.0-standard-minifiers-package -1.2.0-meteor-platform-split -1.2.0-cordova-changes -1.2.0-breaking-changes -1.3.0-split-minifiers-package -1.4.0-remove-old-dev-bundle-link -1.4.1-add-shell-server-package -1.4.3-split-account-service-packages -1.5-add-dynamic-import-package -1.7-split-underscore-from-meteor-base diff --git a/examples/ssr/.meteor/.gitignore b/examples/ssr/.meteor/.gitignore deleted file mode 100644 index 4083037423..0000000000 --- a/examples/ssr/.meteor/.gitignore +++ /dev/null @@ -1 +0,0 @@ -local diff --git a/examples/ssr/.meteor/.id b/examples/ssr/.meteor/.id deleted file mode 100644 index 14834a5d63..0000000000 --- a/examples/ssr/.meteor/.id +++ /dev/null @@ -1,7 +0,0 @@ -# This file contains a token that is unique to your project. -# Check it into your repository along with the rest of this directory. -# It can be used for purposes such as: -# - ensuring you don't accidentally deploy one app on top of another -# - providing package authors with aggregated statistics - -1vvxvkmbm33jd99rmm5 diff --git a/examples/ssr/.meteor/packages b/examples/ssr/.meteor/packages deleted file mode 100644 index ffd9ef129b..0000000000 --- a/examples/ssr/.meteor/packages +++ /dev/null @@ -1,20 +0,0 @@ -# Meteor packages used by this project, one per line. -# Check this file (and the other files in this directory) into your repository. -# -# 'meteor add' and 'meteor remove' will edit this file for you, -# but you can also edit it by hand. - -meteor-base@1.4.0 # Packages every Meteor app needs to have -mobile-experience@1.0.5 # Packages for a great mobile UX -mongo@1.6.0 # The database Meteor supports right now -static-html # Define static page content in .html files -reactive-var@1.0.11 # Reactive variable for tracker -tracker@1.2.0 # Meteor's client-side reactive programming library - -standard-minifier-css@1.5.2 # CSS minifier run for production mode -standard-minifier-js@2.4.0 # JS minifier run for production mode -es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers -ecmascript@0.12.4 # Enable ECMAScript2015+ syntax in app code -shell-server@0.4.0 # Server-side component of the `meteor shell` command -server-render@0.3.1 -underscore@1.0.10 diff --git a/examples/ssr/.meteor/platforms b/examples/ssr/.meteor/platforms deleted file mode 100644 index efeba1b50c..0000000000 --- a/examples/ssr/.meteor/platforms +++ /dev/null @@ -1,2 +0,0 @@ -server -browser diff --git a/examples/ssr/.meteor/release b/examples/ssr/.meteor/release deleted file mode 100644 index 91e05fc15b..0000000000 --- a/examples/ssr/.meteor/release +++ /dev/null @@ -1 +0,0 @@ -METEOR@1.8.0.2 diff --git a/examples/ssr/.meteor/versions b/examples/ssr/.meteor/versions deleted file mode 100644 index 78c4d79e07..0000000000 --- a/examples/ssr/.meteor/versions +++ /dev/null @@ -1,69 +0,0 @@ -allow-deny@1.1.0 -autoupdate@1.5.0 -babel-compiler@7.2.4 -babel-runtime@1.3.0 -base64@1.0.11 -binary-heap@1.0.11 -blaze-tools@1.0.10 -boilerplate-generator@1.6.0 -caching-compiler@1.2.1 -caching-html-compiler@1.1.3 -callback-hook@1.1.0 -check@1.3.1 -ddp@1.4.0 -ddp-client@2.3.3 -ddp-common@1.4.0 -ddp-server@2.2.0 -deps@1.0.12 -diff-sequence@1.1.1 -dynamic-import@0.5.1 -ecmascript@0.12.4 -ecmascript-runtime@0.7.0 -ecmascript-runtime-client@0.8.0 -ecmascript-runtime-server@0.7.1 -ejson@1.1.0 -es5-shim@4.8.0 -fetch@0.1.0 -geojson-utils@1.0.10 -hot-code-push@1.0.4 -html-tools@1.0.11 -htmljs@1.0.11 -id-map@1.1.0 -inter-process-messaging@0.1.0 -launch-screen@1.1.1 -livedata@1.0.18 -logging@1.1.20 -meteor@1.9.2 -meteor-base@1.4.0 -minifier-css@1.4.1 -minifier-js@2.4.0 -minimongo@1.4.5 -mobile-experience@1.0.5 -mobile-status-bar@1.0.14 -modern-browsers@0.1.3 -modules@0.13.0 -modules-runtime@0.10.3 -mongo@1.6.0 -mongo-decimal@0.1.0 -mongo-dev-server@1.1.0 -mongo-id@1.0.7 -npm-mongo@3.1.1 -ordered-dict@1.1.0 -promise@0.11.2 -random@1.1.0 -reactive-var@1.0.11 -reload@1.2.0 -retry@1.1.0 -routepolicy@1.1.0 -server-render@0.3.1 -shell-server@0.4.0 -socket-stream-client@0.2.2 -spacebars-compiler@1.1.3 -standard-minifier-css@1.5.2 -standard-minifier-js@2.4.0 -static-html@1.2.2 -templating-tools@1.1.2 -tracker@1.2.0 -underscore@1.0.10 -webapp@1.7.2 -webapp-hashing@1.0.9 diff --git a/examples/ssr/README.md b/examples/ssr/README.md deleted file mode 100644 index 34345d5f00..0000000000 --- a/examples/ssr/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# SSR Example - -**Note:** This example uses Meteor. Meteor can be downloaded [here](https://www.meteor.com/install). - -``` -meteor npm install -meteor npm start -``` - -Access: http://localhost:3000 diff --git a/examples/ssr/client/main.html b/examples/ssr/client/main.html deleted file mode 100644 index 3f0523b7cc..0000000000 --- a/examples/ssr/client/main.html +++ /dev/null @@ -1,7 +0,0 @@ - - ssr example - - - -
- diff --git a/examples/ssr/client/main.js b/examples/ssr/client/main.js deleted file mode 100644 index 9e9edad220..0000000000 --- a/examples/ssr/client/main.js +++ /dev/null @@ -1,27 +0,0 @@ -import { hydrate } from 'react-dom'; -import { onPageLoad } from 'meteor/server-render'; -import { ApolloProvider } from 'react-apollo'; -import { ApolloClient } from 'apollo-client'; -import { InMemoryCache } from 'apollo-cache-inmemory'; -import { HttpLink } from 'apollo-link-http'; - -import { App } from '/imports/app'; - -export const start = () => { - const client = new ApolloClient({ - link: new HttpLink({ - uri: 'http://localhost:3000/graphql', - }), - cache: new InMemoryCache().restore(window.__APOLLO_STATE__), - }); - - const WrappedApp = ( - - - - ); - - hydrate(WrappedApp, document.getElementById('app')); -}; - -onPageLoad(start); diff --git a/examples/ssr/imports/app.js b/examples/ssr/imports/app.js deleted file mode 100644 index 2a81f9fa36..0000000000 --- a/examples/ssr/imports/app.js +++ /dev/null @@ -1,49 +0,0 @@ -import { graphql } from 'react-apollo'; -import gql from 'graphql-tag'; - -const HERO_QUERY = gql` - query GetCharacter($episode: Episode!) { - hero(episode: $episode) { - name - id - friends { - name - id - appearsIn - } - } - } -`; - -const withCharacter = graphql(HERO_QUERY, { - options: ({ episode }) => ({ - variables: { episode }, - }), - props: ({ data }) => ({ ...data }), -}); - -export const Character = withCharacter(({ loading, hero, error }) => { - if (loading) return
Loading
; - if (error) return

ERROR

; - return ( -
- {hero && ( -
-

{hero.name}

- - {hero.friends.map(friend => ( -
- {friend.name}: {friend.appearsIn.map(x => x.toLowerCase()).join(', ')} -
- ))} -
- )} -
- ); -}); - -export const App = () => ( -
- -
-); diff --git a/examples/ssr/imports/schema.js b/examples/ssr/imports/schema.js deleted file mode 100644 index d032033fdb..0000000000 --- a/examples/ssr/imports/schema.js +++ /dev/null @@ -1,458 +0,0 @@ -// This is the Star Wars schema used in all of the interactive GraphiQL -// examples on GraphQL.org. License reproduced at the bottom. - -/** - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the license found in the - * LICENSE file in the root directory of this source tree. - */ - -import { makeExecutableSchema } from 'graphql-tools'; - -const schemaString = ` -schema { - query: Query - mutation: Mutation -} -# The query type, represents all of the entry points into our object graph -type Query { - hero(episode: Episode): Character - reviews(episode: Episode!): [Review] - search(text: String): [SearchResult] - character(id: ID!): Character - droid(id: ID!): Droid - human(id: ID!): Human - starship(id: ID!): Starship -} -# The mutation type, represents all updates we can make to our data -type Mutation { - createReview(episode: Episode, review: ReviewInput!): Review -} -# The episodes in the Star Wars trilogy -enum Episode { - # Star Wars Episode IV: A New Hope, released in 1977. - NEWHOPE - # Star Wars Episode V: The Empire Strikes Back, released in 1980. - EMPIRE - # Star Wars Episode VI: Return of the Jedi, released in 1983. - JEDI -} -# A character from the Star Wars universe -interface Character { - # The ID of the character - id: ID! - # The name of the character - name: String! - # The friends of the character, or an empty list if they have none - friends: [Character] - # The friends of the character exposed as a connection with edges - friendsConnection(first: Int, after: ID): FriendsConnection! - # The movies this character appears in - appearsIn: [Episode]! -} -# Units of height -enum LengthUnit { - # The standard unit around the world - METER - # Primarily used in the United States - FOOT -} -# A humanoid creature from the Star Wars universe -type Human implements Character { - # The ID of the human - id: ID! - # What this human calls themselves - name: String! - # Height in the preferred unit, default is meters - height(unit: LengthUnit = METER): Float - # Mass in kilograms, or null if unknown - mass: Float - # This human's friends, or an empty list if they have none - friends: [Character] - # The friends of the human exposed as a connection with edges - friendsConnection(first: Int, after: ID): FriendsConnection! - # The movies this human appears in - appearsIn: [Episode]! - # A list of starships this person has piloted, or an empty list if none - starships: [Starship] -} -# An autonomous mechanical character in the Star Wars universe -type Droid implements Character { - # The ID of the droid - id: ID! - # What others call this droid - name: String! - # This droid's friends, or an empty list if they have none - friends: [Character] - # The friends of the droid exposed as a connection with edges - friendsConnection(first: Int, after: ID): FriendsConnection! - # The movies this droid appears in - appearsIn: [Episode]! - # This droid's primary function - primaryFunction: String -} -# A connection object for a character's friends -type FriendsConnection { - # The total number of friends - totalCount: Int - # The edges for each of the character's friends. - edges: [FriendsEdge] - # A list of the friends, as a convenience when edges are not needed. - friends: [Character] - # Information for paginating this connection - pageInfo: PageInfo! -} -# An edge object for a character's friends -type FriendsEdge { - # A cursor used for pagination - cursor: ID! - # The character represented by this friendship edge - node: Character -} -# Information for paginating this connection -type PageInfo { - startCursor: ID - endCursor: ID - hasNextPage: Boolean! -} -# Represents a review for a movie -type Review { - # The number of stars this review gave, 1-5 - stars: Int! - # Comment about the movie - commentary: String -} -# The input object sent when someone is creating a new review -input ReviewInput { - # 0-5 stars - stars: Int! - # Comment about the movie, optional - commentary: String -} -type Starship { - # The ID of the starship - id: ID! - # The name of the starship - name: String! - # Length of the starship, along the longest axis - length(unit: LengthUnit = METER): Float -} -union SearchResult = Human | Droid | Starship -`; - -/** - * This defines a basic set of data for our Star Wars Schema. - * - * This data is hard coded for the sake of the demo, but you could imagine - * fetching this data from a backend service rather than from hardcoded - * JSON objects in a more complex demo. - */ - -const humans = [ - { - id: '1000', - name: 'Luke Skywalker', - friends: ['1002', '1003', '2000', '2001'], - appearsIn: ['NEWHOPE', 'EMPIRE', 'JEDI'], - height: 1.72, - mass: 77, - starships: ['3001', '3003'], - }, - { - id: '1001', - name: 'Darth Vader', - friends: ['1004'], - appearsIn: ['NEWHOPE', 'EMPIRE', 'JEDI'], - height: 2.02, - mass: 136, - starships: ['3002'], - }, - { - id: '1002', - name: 'Han Solo', - friends: ['1000', '1003', '2001'], - appearsIn: ['NEWHOPE', 'EMPIRE', 'JEDI'], - height: 1.8, - mass: 80, - starships: ['3000', '3003'], - }, - { - id: '1003', - name: 'Leia Organa', - friends: ['1000', '1002', '2000', '2001'], - appearsIn: ['NEWHOPE', 'EMPIRE', 'JEDI'], - height: 1.5, - mass: 49, - starships: [], - }, - { - id: '1004', - name: 'Wilhuff Tarkin', - friends: ['1001'], - appearsIn: ['NEWHOPE'], - height: 1.8, - mass: null, - starships: [], - }, -]; - -const humanData = {}; -humans.forEach(ship => { - humanData[ship.id] = ship; -}); - -const droids = [ - { - id: '2000', - name: 'C-3PO', - friends: ['1000', '1002', '1003', '2001'], - appearsIn: ['NEWHOPE', 'EMPIRE', 'JEDI'], - primaryFunction: 'Protocol', - }, - { - id: '2001', - name: 'R2-D2', - friends: ['1000', '1002', '1003'], - appearsIn: ['NEWHOPE', 'EMPIRE', 'JEDI'], - primaryFunction: 'Astromech', - }, -]; - -const droidData = {}; -droids.forEach(ship => { - droidData[ship.id] = ship; -}); - -const starships = [ - { - id: '3000', - name: 'Millenium Falcon', - length: 34.37, - }, - { - id: '3001', - name: 'X-Wing', - length: 12.5, - }, - { - id: '3002', - name: 'TIE Advanced x1', - length: 9.2, - }, - { - id: '3003', - name: 'Imperial shuttle', - length: 20, - }, -]; - -const starshipData = {}; -starships.forEach(ship => { - starshipData[ship.id] = ship; -}); - -/** - * Helper function to get a character by ID. - */ -function getCharacter(id) { - // Returning a promise just to illustrate GraphQL.js's support. - return Promise.resolve(humanData[id] || droidData[id]); -} - -/** - * Allows us to fetch the undisputed hero of the Star Wars trilogy, R2-D2. - */ -function getHero(episode) { - if (episode === 'EMPIRE') { - // Luke is the hero of Episode V. - return humanData['1000']; - } - // Artoo is the hero otherwise. - return droidData['2001']; -} - -/** - * Allows us to query for the human with the given id. - */ -function getHuman(id) { - return humanData[id]; -} - -/** - * Allows us to query for the droid with the given id. - */ -function getDroid(id) { - return droidData[id]; -} - -function getStarship(id) { - return starshipData[id]; -} - -function toCursor(str) { - return Buffer('cursor' + str).toString('base64'); -} - -function fromCursor(str) { - return Buffer.from(str, 'base64') - .toString() - .slice(6); -} - -const resolvers = { - Query: { - hero: (root, { episode }) => getHero(episode), - character: (root, { id }) => getCharacter(id), - human: (root, { id }) => getHuman(id), - droid: (root, { id }) => getDroid(id), - starship: (root, { id }) => getStarship(id), - reviews: () => null, - search: (root, { text }) => { - const re = new RegExp(text, 'i'); - - const allData = [...humans, ...droids, ...starships]; - - return allData.filter(obj => re.test(obj.name)); - }, - }, - Mutation: { - createReview: (root, { episode, review }) => review, - }, - Character: { - __resolveType(data, context, info) { - if (humanData[data.id]) { - return info.schema.getType('Human'); - } - if (droidData[data.id]) { - return info.schema.getType('Droid'); - } - return null; - }, - }, - Human: { - height: ({ height }, { unit }) => { - if (unit === 'FOOT') { - return height * 3.28084; - } - - return height; - }, - friends: ({ friends }) => friends.map(getCharacter), - friendsConnection: ({ friends }, { first, after }) => { - first = first || friends.length; - after = after ? parseInt(fromCursor(after), 10) : 0; - const edges = friends - .map((friend, i) => ({ - cursor: toCursor(i + 1), - node: getCharacter(friend), - })) - .slice(after, first + after); - const slicedFriends = edges.map(({ node }) => node); - return { - edges, - friends: slicedFriends, - pageInfo: { - startCursor: edges.length > 0 ? edges[0].cursor : null, - hasNextPage: first + after < friends.length, - endCursor: edges.length > 0 ? edges[edges.length - 1].cursor : null, - }, - totalCount: friends.length, - }; - }, - starships: ({ starships }) => starships.map(getStarship), - appearsIn: ({ appearsIn }) => appearsIn, - }, - Droid: { - friends: ({ friends }) => friends.map(getCharacter), - friendsConnection: ({ friends }, { first, after }) => { - first = first || friends.length; - after = after ? parseInt(fromCursor(after), 10) : 0; - const edges = friends - .map((friend, i) => ({ - cursor: toCursor(i + 1), - node: getCharacter(friend), - })) - .slice(after, first + after); - const slicedFriends = edges.map(({ node }) => node); - return { - edges, - friends: slicedFriends, - pageInfo: { - startCursor: edges.length > 0 ? edges[0].cursor : null, - hasNextPage: first + after < friends.length, - endCursor: edges.length > 0 ? edges[edges.length - 1].cursor : null, - }, - totalCount: friends.length, - }; - }, - appearsIn: ({ appearsIn }) => appearsIn, - }, - FriendsConnection: { - edges: ({ edges }) => edges, - friends: ({ friends }) => friends, - pageInfo: ({ pageInfo }) => pageInfo, - totalCount: ({ totalCount }) => totalCount, - }, - FriendsEdge: { - node: ({ node }) => node, - cursor: ({ cursor }) => cursor, - }, - Starship: { - length: ({ length }, { unit }) => { - if (unit === 'FOOT') { - return length * 3.28084; - } - - return length; - }, - }, - SearchResult: { - __resolveType(data, context, info) { - if (humanData[data.id]) { - return info.schema.getType('Human'); - } - if (droidData[data.id]) { - return info.schema.getType('Droid'); - } - if (starshipData[data.id]) { - return info.schema.getType('Starship'); - } - return null; - }, - }, -}; - -export { schemaString as typeDefs, resolvers }; - -/* -License from https://github.com/graphql/graphql.github.io/blob/source/LICENSE - -LICENSE AGREEMENT For graphql.org software - -Facebook, Inc. (“Facebook”) owns all right, title and interest, including all -intellectual property and other proprietary rights, in and to the graphql.org -software. Subject to your compliance with these terms, you are hereby granted a -non-exclusive, worldwide, royalty-free copyright license to (1) use and copy the -graphql.org software; and (2) reproduce and distribute the graphql.org software -as part of your own software (“Your Software”). Facebook reserves all rights not -expressly granted to you in this license agreement. - -THE SOFTWARE AND DOCUMENTATION, IF ANY, ARE PROVIDED "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES (INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE) ARE DISCLAIMED. IN NO -EVENT SHALL FACEBOOK OR ITS AFFILIATES, OFFICES, DIRECTORS OR EMPLOYEES BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -THE USE OF THE SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -You will include in Your Software (e.g., in the file(s), documentation or other -materials accompanying your software): (1) the disclaimer set forth above; (2) -this sentence; and (3) the following copyright notice: - -Copyright (c) 2015, Facebook, Inc. All rights reserved. -*/ diff --git a/examples/ssr/imports/tests/chromedriver.js b/examples/ssr/imports/tests/chromedriver.js deleted file mode 100644 index 3bf15e0242..0000000000 --- a/examples/ssr/imports/tests/chromedriver.js +++ /dev/null @@ -1,18 +0,0 @@ -var chromedriver = require('chromedriver'); - -console.log('here'); -module.exports = { - before: function(done) { - console.log('before'); - try { - chromedriver.start(); - } catch (e) { - console.log(e); - } - done(); - }, - after: function(done) { - chromedriver.stop(); - done(); - }, -}; diff --git a/examples/ssr/nightwatch.json b/examples/ssr/nightwatch.json deleted file mode 100644 index b7e520191f..0000000000 --- a/examples/ssr/nightwatch.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "src_folders": ["tests"], - "globals_path": "./imports/tests/chromedriver.js", - "output_folder": ".reports", - "selenium": { - "start_process": false - }, - "test_settings": { - "default": { - "launch_url": "http://localhost:3000", - "selenium_port": 9515, - "selenium_host": "localhost", - "default_path_prefix": "", - "desiredCapabilities": { - "browserName": "chrome", - "chromeOptions": { - "args": ["--no-sandbox"] - }, - "acceptSslCerts": true - }, - "silent": true, - "screenshots": { - "enabled": false, - "path": "" - } - }, - "chrome": { - "desiredCapabilities": { - "browserName": "chrome" - } - } - } -} diff --git a/examples/ssr/package.json b/examples/ssr/package.json deleted file mode 100644 index c4f5a85c26..0000000000 --- a/examples/ssr/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "ssr", - "private": true, - "scripts": { - "start": "meteor run", - "test": "nightwatch", - "visualize": "meteor --production --extra-packages bundle-visualizer" - }, - "dependencies": { - "@babel/runtime": "^7.1.2", - "apollo-cache-inmemory": "^1.3.7", - "apollo-client": "^2.4.4", - "apollo-link-http": "^1.5.5", - "apollo-server": "^2.1.0", - "apollo-server-express": "^2.1.0", - "babel-runtime": "^6.26.0", - "body-parser": "^1.18.3", - "graphql": "^14.0.2", - "graphql-tag": "^2.9.2", - "graphql-tools": "^4.0.0", - "meteor-node-stubs": "^0.4.1", - "node-fetch": "^2.2.0", - "react": "^16.5.2", - "react-apollo": "^2.5.0-beta.0", - "react-dom": "^16.5.2" - }, - "devDependencies": { - "assert": "1.4.1", - "babel-plugin-transform-react-require": "1.0.1", - "babel-preset-react": "6.24.1", - "cheerio": "1.0.0-rc.2", - "chromedriver": "2.46.0", - "nightwatch": "0.9.21", - "selenium-webdriver": "4.0.0-alpha.1" - } -} diff --git a/examples/ssr/server/main.js b/examples/ssr/server/main.js deleted file mode 100644 index 433f8c63a2..0000000000 --- a/examples/ssr/server/main.js +++ /dev/null @@ -1,53 +0,0 @@ -import { renderToString } from 'react-dom/server'; -import { onPageLoad } from 'meteor/server-render'; -import { ApolloClient } from 'apollo-client'; -import { getMarkupFromTree, ApolloProvider } from 'react-apollo'; -import { InMemoryCache } from 'apollo-cache-inmemory'; -import { HttpLink } from 'apollo-link-http'; -import { WebApp } from 'meteor/webapp'; -import { ApolloServer } from 'apollo-server-express'; -import fetch from 'node-fetch'; - -import { typeDefs, resolvers } from '/imports/schema'; -import { App } from '/imports/app'; - -export const render = async sink => { - const client = new ApolloClient({ - link: new HttpLink({ - uri: 'http://localhost:3000/graphql', - fetch, - }), - cache: new InMemoryCache(), - ssrMode: true, - }); - - const WrappedApp = ( - - - - ); - - const start = Date.now(); - // Load all data from local server - const markup = await getMarkupFromTree({ - tree: WrappedApp, - renderFunction: renderToString, - }); - console.log("server rendering took", Date.now() - start, "ms"); - sink.renderIntoElementById('app', markup); - sink.appendToBody(` - - `); -}; - -// Handle SSR -onPageLoad(render); - -// Expose graphql endpoint -const server = new ApolloServer({ typeDefs, resolvers }); -server.applyMiddleware({ - app: WebApp.connectHandlers, - path: '/graphql', -}); diff --git a/examples/ssr/tests/ssr.js b/examples/ssr/tests/ssr.js deleted file mode 100644 index 33828a1ff6..0000000000 --- a/examples/ssr/tests/ssr.js +++ /dev/null @@ -1,65 +0,0 @@ -const cheerio = require('cheerio'); -const assert = require('assert'); - -/* - * - * This is a smoke test for SSR with react apollo - * It uses Meteor to create a client and server environment - * and uses nightwatch to test against it. - * By using source, we can get access to the SSR markup - * and by using .execute / find / etc we can get the client - * built markup after the app has started up - * - * we check three things below - * 1. __APOLLO_STATE__ matches and is created on the server - * 2. The app markup doesn't change from SSR to boot - * 3. A simple test to verify the h3 is rendered and maintained - * -*/ - -module.exports = { - 'Initial State': function(browser) { - let initialState; - let SSRMarkup; - browser - .url(browser.launchUrl) - .source(function(result) { - const $ = cheerio.load(result.value); - - // verify Initial state - const initial = $('script')[0].children[0].data; - const window = {}; - - // parse SSR data - eval(initial); - initialState = window.__APOLLO_STATE__; - - // save generated markup for comparision - SSRMarkup = $('#app').html(); - - // assert SSR markup with quick check of data - assert.equal($('h3').text(), 'R2-D2'); - }) - // ensure the parsed state matches the server state - .execute( - function() { - return window.__APOLLO_STATE__; - }, - function(result) { - assert.deepEqual(result.value, initialState); - }, - ) - // ensure the markup doesn't change once the app starts up - .execute( - function() { - return document.getElementById('app').innerHTML; - }, - function(result) { - assert.equal(result.value, SSRMarkup); - }, - ) - // ensure h3 value didn't change - .expect.element('h3') - .text.to.equal('R2-D2'); - }, -}; diff --git a/examples/typescript/.gitignore b/examples/typescript/.gitignore deleted file mode 100644 index f4c8ec729b..0000000000 --- a/examples/typescript/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. - -# dependencies -/node_modules - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* -yarn.lock \ No newline at end of file diff --git a/examples/typescript/README.md b/examples/typescript/README.md deleted file mode 100644 index ae628cdc97..0000000000 --- a/examples/typescript/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Typescript Example - -``` -npm install -npm start -``` - -This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app). diff --git a/examples/typescript/package.json b/examples/typescript/package.json deleted file mode 100644 index fd746c5350..0000000000 --- a/examples/typescript/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "typescript-example", - "version": "0.1.0", - "private": true, - "dependencies": { - "apollo-cache-inmemory": "latest", - "apollo-client": "latest", - "apollo-link-http": "latest", - "graphql-tag": "^2.6.1", - "react": "^16.2.0", - "react-apollo": "file:../..", - "react-dom": "^16.2.0" - }, - "devDependencies": { - "@types/graphql": "14.0.7", - "@types/jest": "24.0.11", - "@types/node": "11.11.3", - "@types/prop-types": "15.7.0", - "@types/react": "16.4.18", - "@types/react-dom": "16.8.0", - "@types/react-test-renderer": "16.8.0", - "apollo-codegen": "0.20.2", - "react-scripts-ts": "3.1.0", - "react-test-renderer": "16.8.1", - "typescript": "3.3.4000" - }, - "scripts": { - "start": "react-scripts-ts start", - "build": "react-scripts-ts build", - "test": "react-scripts-ts test --env=jsdom", - "eject": "react-scripts-ts eject", - "schema": "apollo-codegen introspect-schema https://mpjk0plp9.lp.gql.zone/graphql --output ./src/schema.json", - "types": "apollo-codegen generate ./src/**/queries.ts --addTypename --schema ./src/schema.json --target typescript --output ./src/__generated__/types.ts" - } -} diff --git a/examples/typescript/public/favicon.ico b/examples/typescript/public/favicon.ico deleted file mode 100644 index 5c125de5d897c1ff5692a656485b3216123dcd89..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24838 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 - - - - - - - - - - React App - - - -
- - - diff --git a/examples/typescript/public/manifest.json b/examples/typescript/public/manifest.json deleted file mode 100644 index be607e4177..0000000000 --- a/examples/typescript/public/manifest.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "192x192", - "type": "image/png" - } - ], - "start_url": "./index.html", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/examples/typescript/schema.json b/examples/typescript/schema.json deleted file mode 100644 index 63950949e4..0000000000 --- a/examples/typescript/schema.json +++ /dev/null @@ -1,2046 +0,0 @@ -{ - "data": { - "__schema": { - "queryType": { - "name": "Query" - }, - "mutationType": { - "name": "Mutation" - }, - "subscriptionType": null, - "types": [ - { - "kind": "OBJECT", - "name": "Query", - "description": "The query type, represents all of the entry points into our object graph", - "fields": [ - { - "name": "hero", - "description": "", - "args": [ - { - "name": "episode", - "description": "", - "type": { - "kind": "ENUM", - "name": "Episode", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "reviews", - "description": "", - "args": [ - { - "name": "episode", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Episode", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Review", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "search", - "description": "", - "args": [ - { - "name": "text", - "description": "", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "UNION", - "name": "SearchResult", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "character", - "description": "", - "args": [ - { - "name": "id", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "droid", - "description": "", - "args": [ - { - "name": "id", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Droid", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "human", - "description": "", - "args": [ - { - "name": "id", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Human", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "starship", - "description": "", - "args": [ - { - "name": "id", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Starship", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "Episode", - "description": "The episodes in the Star Wars trilogy", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "NEWHOPE", - "description": "Star Wars Episode IV: A New Hope, released in 1977.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "EMPIRE", - "description": "Star Wars Episode V: The Empire Strikes Back, released in 1980.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "JEDI", - "description": "Star Wars Episode VI: Return of the Jedi, released in 1983.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "INTERFACE", - "name": "Character", - "description": "A character from the Star Wars universe", - "fields": [ - { - "name": "id", - "description": "The ID of the character", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The name of the character", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "friends", - "description": "The friends of the character, or an empty list if they have none", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "friendsConnection", - "description": "The friends of the character exposed as a connection with edges", - "args": [ - { - "name": "first", - "description": "", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": "", - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "FriendsConnection", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "appearsIn", - "description": "The movies this character appears in", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Episode", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": [ - { - "kind": "OBJECT", - "name": "Human", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Droid", - "ofType": null - } - ] - }, - { - "kind": "SCALAR", - "name": "ID", - "description": - "The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "String", - "description": - "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Int", - "description": - "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. ", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "FriendsConnection", - "description": "A connection object for a character's friends", - "fields": [ - { - "name": "totalCount", - "description": "The total number of friends", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "The edges for each of the character's friends.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "FriendsEdge", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "friends", - "description": "A list of the friends, as a convenience when edges are not needed.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pageInfo", - "description": "Information for paginating this connection", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "FriendsEdge", - "description": "An edge object for a character's friends", - "fields": [ - { - "name": "cursor", - "description": "A cursor used for pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "node", - "description": "The character represented by this friendship edge", - "args": [], - "type": { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PageInfo", - "description": "Information for paginating this connection", - "fields": [ - { - "name": "startCursor", - "description": "", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "endCursor", - "description": "", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "hasNextPage", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Boolean", - "description": "The `Boolean` scalar type represents `true` or `false`.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Review", - "description": "Represents a review for a movie", - "fields": [ - { - "name": "stars", - "description": "The number of stars this review gave, 1-5", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "commentary", - "description": "Comment about the movie", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "UNION", - "name": "SearchResult", - "description": "", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": [ - { - "kind": "OBJECT", - "name": "Human", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Droid", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Starship", - "ofType": null - } - ] - }, - { - "kind": "OBJECT", - "name": "Human", - "description": "A humanoid creature from the Star Wars universe", - "fields": [ - { - "name": "id", - "description": "The ID of the human", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "What this human calls themselves", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "height", - "description": "Height in the preferred unit, default is meters", - "args": [ - { - "name": "unit", - "description": "", - "type": { - "kind": "ENUM", - "name": "LengthUnit", - "ofType": null - }, - "defaultValue": "METER" - } - ], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mass", - "description": "Mass in kilograms, or null if unknown", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "friends", - "description": "This human's friends, or an empty list if they have none", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "friendsConnection", - "description": "The friends of the human exposed as a connection with edges", - "args": [ - { - "name": "first", - "description": "", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": "", - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "FriendsConnection", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "appearsIn", - "description": "The movies this human appears in", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Episode", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "starships", - "description": - "A list of starships this person has piloted, or an empty list if none", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Starship", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "LengthUnit", - "description": "Units of height", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "METER", - "description": "The standard unit around the world", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FOOT", - "description": "Primarily used in the United States", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Float", - "description": - "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). ", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Starship", - "description": "", - "fields": [ - { - "name": "id", - "description": "The ID of the starship", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The name of the starship", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "length", - "description": "Length of the starship, along the longest axis", - "args": [ - { - "name": "unit", - "description": "", - "type": { - "kind": "ENUM", - "name": "LengthUnit", - "ofType": null - }, - "defaultValue": "METER" - } - ], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Droid", - "description": "An autonomous mechanical character in the Star Wars universe", - "fields": [ - { - "name": "id", - "description": "The ID of the droid", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "What others call this droid", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "friends", - "description": "This droid's friends, or an empty list if they have none", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "friendsConnection", - "description": "The friends of the droid exposed as a connection with edges", - "args": [ - { - "name": "first", - "description": "", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": "", - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "FriendsConnection", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "appearsIn", - "description": "The movies this droid appears in", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Episode", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "primaryFunction", - "description": "This droid's primary function", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Mutation", - "description": "The mutation type, represents all updates we can make to our data", - "fields": [ - { - "name": "createReview", - "description": "", - "args": [ - { - "name": "episode", - "description": "", - "type": { - "kind": "ENUM", - "name": "Episode", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "review", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "ReviewInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Review", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "ReviewInput", - "description": "The input object sent when someone is creating a new review", - "fields": null, - "inputFields": [ - { - "name": "stars", - "description": "0-5 stars", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "commentary", - "description": "Comment about the movie, optional", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Schema", - "description": - "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", - "fields": [ - { - "name": "types", - "description": "A list of all types supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "queryType", - "description": "The type that query operations will be rooted at.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mutationType", - "description": - "If this server supports mutation, the type that mutation operations will be rooted at.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subscriptionType", - "description": - "If this server support subscription, the type that subscription operations will be rooted at.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "directives", - "description": "A list of all directives supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Directive", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Type", - "description": - "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", - "fields": [ - { - "name": "kind", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__TypeKind", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fields", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Field", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "interfaces", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "possibleTypes", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "enumValues", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__EnumValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "inputFields", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ofType", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__TypeKind", - "description": "An enum describing what kind of type a given `__Type` is.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "SCALAR", - "description": "Indicates this type is a scalar.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": - "Indicates this type is an object. `fields` and `interfaces` are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": - "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Indicates this type is a union. `possibleTypes` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Indicates this type is an enum. `enumValues` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": - "Indicates this type is an input object. `inputFields` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "LIST", - "description": "Indicates this type is a list. `ofType` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NON_NULL", - "description": "Indicates this type is a non-null. `ofType` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Field", - "description": - "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__InputValue", - "description": - "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValue", - "description": - "A GraphQL-formatted string representing the default value for this input value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__EnumValue", - "description": - "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Directive", - "description": - "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locations", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__DirectiveLocation", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "onOperation", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Use `locations`." - }, - { - "name": "onFragment", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Use `locations`." - }, - { - "name": "onField", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Use `locations`." - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__DirectiveLocation", - "description": - "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "QUERY", - "description": "Location adjacent to a query operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MUTATION", - "description": "Location adjacent to a mutation operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SUBSCRIPTION", - "description": "Location adjacent to a subscription operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD", - "description": "Location adjacent to a field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_DEFINITION", - "description": "Location adjacent to a fragment definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_SPREAD", - "description": "Location adjacent to a fragment spread.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INLINE_FRAGMENT", - "description": "Location adjacent to an inline fragment.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCHEMA", - "description": "Location adjacent to a schema definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCALAR", - "description": "Location adjacent to a scalar definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "Location adjacent to an object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD_DEFINITION", - "description": "Location adjacent to a field definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ARGUMENT_DEFINITION", - "description": "Location adjacent to an argument definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "Location adjacent to an interface definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Location adjacent to a union definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Location adjacent to an enum definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM_VALUE", - "description": "Location adjacent to an enum value definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "Location adjacent to an input object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_FIELD_DEFINITION", - "description": "Location adjacent to an input object field definition.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - } - ], - "directives": [ - { - "name": "skip", - "description": - "Directs the executor to skip this field or fragment when the `if` argument is true.", - "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], - "args": [ - { - "name": "if", - "description": "Skipped when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - } - ] - }, - { - "name": "include", - "description": - "Directs the executor to include this field or fragment only when the `if` argument is true.", - "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], - "args": [ - { - "name": "if", - "description": "Included when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - } - ] - }, - { - "name": "deprecated", - "description": "Marks an element of a GraphQL schema as no longer supported.", - "locations": ["FIELD_DEFINITION", "ENUM_VALUE"], - "args": [ - { - "name": "reason", - "description": - "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted in [Markdown](https://daringfireball.net/projects/markdown/).", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": "\"No longer supported\"" - } - ] - } - ] - } - } -} diff --git a/examples/typescript/src/App.tsx b/examples/typescript/src/App.tsx deleted file mode 100644 index caf68e6018..0000000000 --- a/examples/typescript/src/App.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from 'react'; -import Character from './Character'; -import { Episode } from './__generated__/types'; - -export const App = () => ; diff --git a/examples/typescript/src/Character.tsx b/examples/typescript/src/Character.tsx deleted file mode 100644 index eb4485cfda..0000000000 --- a/examples/typescript/src/Character.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import * as React from 'react'; -import { GetCharacterQuery, GetCharacterQueryVariables, Episode } from './__generated__/types'; -import { GetCharacter as QUERY } from './queries'; -import { Query } from 'react-apollo'; - -export interface CharacterProps { - episode: Episode; -} - -export const Character: React.SFC = props => { - const { episode } = props; - - return ( - query={QUERY} variables={{ episode }}> - {({ loading, data, error }) => { - if (loading) return
Loading
; - if (error) return

ERROR

; - if (!data) return
no data
; - - const { hero } = data; - return ( -
- {hero && ( -
-

{hero.name}

- {hero.friends && - hero.friends.map( - friend => - friend && ( -
- {friend.name}:{' '} - {friend.appearsIn.map(x => x && x.toLowerCase()).join(', ')} -
- ), - )} -
- )} -
- ); - }} - - ); -}; - -export default Character; diff --git a/examples/typescript/src/__generated__/types.ts b/examples/typescript/src/__generated__/types.ts deleted file mode 100644 index d9aeeedd15..0000000000 --- a/examples/typescript/src/__generated__/types.ts +++ /dev/null @@ -1,78 +0,0 @@ -// This file was automatically generated and should not be edited. - -// The episodes in the Star Wars trilogy -export enum Episode { - NEWHOPE = 'NEWHOPE', // Star Wars Episode IV: A New Hope, released in 1977. - EMPIRE = 'EMPIRE', // Star Wars Episode V: The Empire Strikes Back, released in 1980. - JEDI = 'JEDI', // Star Wars Episode VI: Return of the Jedi, released in 1983. -} - -export interface GetCharacterQueryVariables { - episode: Episode; -} - -export interface GetCharacterQuery { - hero: - | ( - | { - __typename: 'Human'; - // The name of the character - name: string; - // The ID of the character - id: string; - // The friends of the character, or an empty list if they have none - friends: Array< - | ( - | { - __typename: 'Human'; - // The name of the character - name: string; - // The ID of the character - id: string; - // The movies this character appears in - appearsIn: Array; - } - | { - __typename: 'Droid'; - // The name of the character - name: string; - // The ID of the character - id: string; - // The movies this character appears in - appearsIn: Array; - }) - | null - > | null; - } - | { - __typename: 'Droid'; - // The name of the character - name: string; - // The ID of the character - id: string; - // The friends of the character, or an empty list if they have none - friends: Array< - | ( - | { - __typename: 'Human'; - // The name of the character - name: string; - // The ID of the character - id: string; - // The movies this character appears in - appearsIn: Array; - } - | { - __typename: 'Droid'; - // The name of the character - name: string; - // The ID of the character - id: string; - // The movies this character appears in - appearsIn: Array; - }) - | null - > | null; - }) - | null; -} diff --git a/examples/typescript/src/__mocks__/data.ts b/examples/typescript/src/__mocks__/data.ts deleted file mode 100644 index 8383a1ce6d..0000000000 --- a/examples/typescript/src/__mocks__/data.ts +++ /dev/null @@ -1,32 +0,0 @@ -export const empty = null; - -export const hero_no_friends = { - __typename: 'Droid', - name: 'r2d2', - id: '1', - friends: null, -}; - -export const empty_array_friends = { - ...hero_no_friends, - ...{ - friends: [null], - }, -}; - -export const friend_without_appearsIn = { - ...hero_no_friends, - ...{ - friends: [ - { name: 'luke', id: '2', appearsIn: ['NEWHOPE'] }, - { name: 'james', id: '777', appearsIn: [null] }, - ], - }, -}; - -export const full = { - ...hero_no_friends, - ...{ - friends: [{ name: 'luke', id: '2', appearsIn: ['NEWHOPE'] }], - }, -}; diff --git a/examples/typescript/src/index.tsx b/examples/typescript/src/index.tsx deleted file mode 100644 index 46be04ad44..0000000000 --- a/examples/typescript/src/index.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from 'react'; -import { render } from 'react-dom'; -import { ApolloClient } from 'apollo-client'; -import { createHttpLink } from 'apollo-link-http'; -import { InMemoryCache } from 'apollo-cache-inmemory'; -import { ApolloProvider } from 'react-apollo'; - -import { App } from './App'; - -const httpLink = createHttpLink({ - uri: 'https://ojo6385vn6.sse.codesandbox.io', -}); - -const client = new ApolloClient({ - cache: new InMemoryCache(), - link: httpLink, -}); - -const WrappedApp = ( - - - -); - -render(WrappedApp, document.getElementById('root')); diff --git a/examples/typescript/src/queries.ts b/examples/typescript/src/queries.ts deleted file mode 100644 index 82b6f83f97..0000000000 --- a/examples/typescript/src/queries.ts +++ /dev/null @@ -1,15 +0,0 @@ -import gql from 'graphql-tag'; - -export const GetCharacter = gql` - query GetCharacter($episode: Episode!) { - hero(episode: $episode) { - name - id - friends { - name - id - appearsIn - } - } - } -`; diff --git a/examples/typescript/src/schema.json b/examples/typescript/src/schema.json deleted file mode 100644 index 63950949e4..0000000000 --- a/examples/typescript/src/schema.json +++ /dev/null @@ -1,2046 +0,0 @@ -{ - "data": { - "__schema": { - "queryType": { - "name": "Query" - }, - "mutationType": { - "name": "Mutation" - }, - "subscriptionType": null, - "types": [ - { - "kind": "OBJECT", - "name": "Query", - "description": "The query type, represents all of the entry points into our object graph", - "fields": [ - { - "name": "hero", - "description": "", - "args": [ - { - "name": "episode", - "description": "", - "type": { - "kind": "ENUM", - "name": "Episode", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "reviews", - "description": "", - "args": [ - { - "name": "episode", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Episode", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Review", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "search", - "description": "", - "args": [ - { - "name": "text", - "description": "", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "UNION", - "name": "SearchResult", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "character", - "description": "", - "args": [ - { - "name": "id", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "droid", - "description": "", - "args": [ - { - "name": "id", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Droid", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "human", - "description": "", - "args": [ - { - "name": "id", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Human", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "starship", - "description": "", - "args": [ - { - "name": "id", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Starship", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "Episode", - "description": "The episodes in the Star Wars trilogy", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "NEWHOPE", - "description": "Star Wars Episode IV: A New Hope, released in 1977.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "EMPIRE", - "description": "Star Wars Episode V: The Empire Strikes Back, released in 1980.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "JEDI", - "description": "Star Wars Episode VI: Return of the Jedi, released in 1983.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "INTERFACE", - "name": "Character", - "description": "A character from the Star Wars universe", - "fields": [ - { - "name": "id", - "description": "The ID of the character", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The name of the character", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "friends", - "description": "The friends of the character, or an empty list if they have none", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "friendsConnection", - "description": "The friends of the character exposed as a connection with edges", - "args": [ - { - "name": "first", - "description": "", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": "", - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "FriendsConnection", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "appearsIn", - "description": "The movies this character appears in", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Episode", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": [ - { - "kind": "OBJECT", - "name": "Human", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Droid", - "ofType": null - } - ] - }, - { - "kind": "SCALAR", - "name": "ID", - "description": - "The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "String", - "description": - "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Int", - "description": - "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. ", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "FriendsConnection", - "description": "A connection object for a character's friends", - "fields": [ - { - "name": "totalCount", - "description": "The total number of friends", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "The edges for each of the character's friends.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "FriendsEdge", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "friends", - "description": "A list of the friends, as a convenience when edges are not needed.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pageInfo", - "description": "Information for paginating this connection", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "FriendsEdge", - "description": "An edge object for a character's friends", - "fields": [ - { - "name": "cursor", - "description": "A cursor used for pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "node", - "description": "The character represented by this friendship edge", - "args": [], - "type": { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PageInfo", - "description": "Information for paginating this connection", - "fields": [ - { - "name": "startCursor", - "description": "", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "endCursor", - "description": "", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "hasNextPage", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Boolean", - "description": "The `Boolean` scalar type represents `true` or `false`.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Review", - "description": "Represents a review for a movie", - "fields": [ - { - "name": "stars", - "description": "The number of stars this review gave, 1-5", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "commentary", - "description": "Comment about the movie", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "UNION", - "name": "SearchResult", - "description": "", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": [ - { - "kind": "OBJECT", - "name": "Human", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Droid", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Starship", - "ofType": null - } - ] - }, - { - "kind": "OBJECT", - "name": "Human", - "description": "A humanoid creature from the Star Wars universe", - "fields": [ - { - "name": "id", - "description": "The ID of the human", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "What this human calls themselves", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "height", - "description": "Height in the preferred unit, default is meters", - "args": [ - { - "name": "unit", - "description": "", - "type": { - "kind": "ENUM", - "name": "LengthUnit", - "ofType": null - }, - "defaultValue": "METER" - } - ], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mass", - "description": "Mass in kilograms, or null if unknown", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "friends", - "description": "This human's friends, or an empty list if they have none", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "friendsConnection", - "description": "The friends of the human exposed as a connection with edges", - "args": [ - { - "name": "first", - "description": "", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": "", - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "FriendsConnection", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "appearsIn", - "description": "The movies this human appears in", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Episode", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "starships", - "description": - "A list of starships this person has piloted, or an empty list if none", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Starship", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "LengthUnit", - "description": "Units of height", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "METER", - "description": "The standard unit around the world", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FOOT", - "description": "Primarily used in the United States", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Float", - "description": - "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). ", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Starship", - "description": "", - "fields": [ - { - "name": "id", - "description": "The ID of the starship", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The name of the starship", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "length", - "description": "Length of the starship, along the longest axis", - "args": [ - { - "name": "unit", - "description": "", - "type": { - "kind": "ENUM", - "name": "LengthUnit", - "ofType": null - }, - "defaultValue": "METER" - } - ], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Droid", - "description": "An autonomous mechanical character in the Star Wars universe", - "fields": [ - { - "name": "id", - "description": "The ID of the droid", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "What others call this droid", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "friends", - "description": "This droid's friends, or an empty list if they have none", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "friendsConnection", - "description": "The friends of the droid exposed as a connection with edges", - "args": [ - { - "name": "first", - "description": "", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": "", - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "FriendsConnection", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "appearsIn", - "description": "The movies this droid appears in", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Episode", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "primaryFunction", - "description": "This droid's primary function", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Character", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Mutation", - "description": "The mutation type, represents all updates we can make to our data", - "fields": [ - { - "name": "createReview", - "description": "", - "args": [ - { - "name": "episode", - "description": "", - "type": { - "kind": "ENUM", - "name": "Episode", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "review", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "ReviewInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Review", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "ReviewInput", - "description": "The input object sent when someone is creating a new review", - "fields": null, - "inputFields": [ - { - "name": "stars", - "description": "0-5 stars", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "commentary", - "description": "Comment about the movie, optional", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Schema", - "description": - "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", - "fields": [ - { - "name": "types", - "description": "A list of all types supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "queryType", - "description": "The type that query operations will be rooted at.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mutationType", - "description": - "If this server supports mutation, the type that mutation operations will be rooted at.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subscriptionType", - "description": - "If this server support subscription, the type that subscription operations will be rooted at.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "directives", - "description": "A list of all directives supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Directive", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Type", - "description": - "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", - "fields": [ - { - "name": "kind", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__TypeKind", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fields", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Field", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "interfaces", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "possibleTypes", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "enumValues", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__EnumValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "inputFields", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ofType", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__TypeKind", - "description": "An enum describing what kind of type a given `__Type` is.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "SCALAR", - "description": "Indicates this type is a scalar.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": - "Indicates this type is an object. `fields` and `interfaces` are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": - "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Indicates this type is a union. `possibleTypes` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Indicates this type is an enum. `enumValues` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": - "Indicates this type is an input object. `inputFields` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "LIST", - "description": "Indicates this type is a list. `ofType` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NON_NULL", - "description": "Indicates this type is a non-null. `ofType` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Field", - "description": - "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__InputValue", - "description": - "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValue", - "description": - "A GraphQL-formatted string representing the default value for this input value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__EnumValue", - "description": - "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Directive", - "description": - "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locations", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__DirectiveLocation", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "onOperation", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Use `locations`." - }, - { - "name": "onFragment", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Use `locations`." - }, - { - "name": "onField", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Use `locations`." - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__DirectiveLocation", - "description": - "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "QUERY", - "description": "Location adjacent to a query operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MUTATION", - "description": "Location adjacent to a mutation operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SUBSCRIPTION", - "description": "Location adjacent to a subscription operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD", - "description": "Location adjacent to a field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_DEFINITION", - "description": "Location adjacent to a fragment definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_SPREAD", - "description": "Location adjacent to a fragment spread.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INLINE_FRAGMENT", - "description": "Location adjacent to an inline fragment.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCHEMA", - "description": "Location adjacent to a schema definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCALAR", - "description": "Location adjacent to a scalar definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "Location adjacent to an object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD_DEFINITION", - "description": "Location adjacent to a field definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ARGUMENT_DEFINITION", - "description": "Location adjacent to an argument definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "Location adjacent to an interface definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Location adjacent to a union definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Location adjacent to an enum definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM_VALUE", - "description": "Location adjacent to an enum value definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "Location adjacent to an input object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_FIELD_DEFINITION", - "description": "Location adjacent to an input object field definition.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - } - ], - "directives": [ - { - "name": "skip", - "description": - "Directs the executor to skip this field or fragment when the `if` argument is true.", - "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], - "args": [ - { - "name": "if", - "description": "Skipped when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - } - ] - }, - { - "name": "include", - "description": - "Directs the executor to include this field or fragment only when the `if` argument is true.", - "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], - "args": [ - { - "name": "if", - "description": "Included when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - } - ] - }, - { - "name": "deprecated", - "description": "Marks an element of a GraphQL schema as no longer supported.", - "locations": ["FIELD_DEFINITION", "ENUM_VALUE"], - "args": [ - { - "name": "reason", - "description": - "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted in [Markdown](https://daringfireball.net/projects/markdown/).", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": "\"No longer supported\"" - } - ] - } - ] - } - } -} diff --git a/examples/typescript/tsconfig.json b/examples/typescript/tsconfig.json deleted file mode 100644 index b7ec128e6b..0000000000 --- a/examples/typescript/tsconfig.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "compilerOptions": { - "outDir": "build/dist", - "module": "commonjs", - "target": "es2015", - "lib": ["es2015", "dom", "esnext.asynciterable"], - "sourceMap": true, - "allowJs": true, - "jsx": "react", - "moduleResolution": "node", - "rootDir": "src", - "forceConsistentCasingInFileNames": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noImplicitAny": true, - "strictNullChecks": true, - "suppressImplicitAnyIndexErrors": true, - "noUnusedLocals": true - }, - "exclude": [ - "node_modules", - "build", - "scripts", - "acceptance-tests", - "webpack", - "jest", - "src/setupTests.ts" - ], - "types": ["typePatches"] -} diff --git a/examples/typescript/tslint.json b/examples/typescript/tslint.json deleted file mode 100644 index 7bc08c7a6b..0000000000 --- a/examples/typescript/tslint.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "rules": { - "ban": false, - "class-name": true, - "interface-name": [true, "never-prefix"], - "jsdoc-format": true, - "label-position": true, - "member-ordering": [ - true, - "public-before-private", - "static-before-instance", - "variables-before-functions" - ], - "no-any": true, - "no-arg": true, - "no-bitwise": true, - "no-construct": true, - "no-debugger": true, - "no-duplicate-variable": true, - "no-empty": true, - "no-eval": true, - "no-shadowed-variable": true, - "no-switch-case-fall-through": true, - "no-unused-expression": true, - "no-use-before-declare": true, - "radix": true, - "switch-default": true, - "triple-equals": [true, "allow-null-check"], - "typedef": [true, "parameter", "property-declaration"], - "variable-name": [ - true, - "ban-keywords", - "check-format", - "allow-leading-underscore", - "allow-pascal-case" - ] - } -} diff --git a/jest.cjs.config.js b/jest.cjs.config.js deleted file mode 100644 index 374ef2e589..0000000000 --- a/jest.cjs.config.js +++ /dev/null @@ -1,13 +0,0 @@ -const { jest } = require('./package.json'); - -jest.moduleNameMapper = { - '\\.\\./src$': '/lib/react-apollo.cjs.js', - '\\.\\./src/test-utils': '/lib/test-utils.js', - // Force other imports to /src/whatever to fail - '\\.\\./src': '/test/fail-no-entry-point.js', -}; - -// Ignore tests that don't go against the public API -jest.modulePathIgnorePatterns.push('/test/internal-api'); - -module.exports = jest; diff --git a/jest.umd.config.js b/jest.umd.config.js deleted file mode 100644 index 91b61dd8cb..0000000000 --- a/jest.umd.config.js +++ /dev/null @@ -1,13 +0,0 @@ -const { jest } = require('./package.json'); - -jest.moduleNameMapper = { - '\\.\\./src$': '/lib/react-apollo.umd.js', - '\\.\\./src/test-utils': '/lib/test-utils.js', - // Force other imports to /src/whatever to fail - '\\.\\./src': '/test/fail-no-entry-point.js', -}; - -// Ignore tests that don't go against the public API -jest.modulePathIgnorePatterns.push('/test/internal-api'); - -module.exports = jest; diff --git a/lerna.json b/lerna.json new file mode 100644 index 0000000000..7926728a68 --- /dev/null +++ b/lerna.json @@ -0,0 +1,4 @@ +{ + "packages": ["packages/*"], + "version": "independent" +} diff --git a/package-lock.json b/package-lock.json index d623eeecb2..0d1d5baee8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,9 +1,81 @@ { - "name": "react-apollo", - "version": "2.5.3", - "lockfileVersion": 1, + "name": "apollo-react-monorepo", "requires": true, + "lockfileVersion": 1, "dependencies": { + "@apollo/react-common": { + "version": "file:packages/common", + "requires": { + "ts-invariant": "^0.4.0", + "tslib": "^1.9.3" + }, + "dependencies": { + "ts-invariant": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.4.0.tgz", + "integrity": "sha512-dI1qXTqHx/QP6SvwSCen4sEza+CtB9KvHQREdpMVRzt05VlSPEfNxus4PsJWdK9ZfiI4yJnAB8j3+jcD3ct21g==", + "requires": { + "tslib": "^1.9.3" + } + }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" + } + } + }, + "@apollo/react-components": { + "version": "file:packages/components", + "requires": { + "@apollo/react-common": "file:packages/common", + "hoist-non-react-statics": "^3.3.0", + "lodash.isequal": "^4.5.0", + "prop-types": "^15.7.2", + "ts-invariant": "^0.4.0", + "tslib": "^1.9.3" + }, + "dependencies": { + "ts-invariant": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.4.0.tgz", + "integrity": "sha512-dI1qXTqHx/QP6SvwSCen4sEza+CtB9KvHQREdpMVRzt05VlSPEfNxus4PsJWdK9ZfiI4yJnAB8j3+jcD3ct21g==", + "requires": { + "tslib": "^1.9.3" + } + } + } + }, + "@apollo/react-hoc": { + "version": "file:packages/hoc", + "requires": { + "@apollo/react-common": "file:packages/common", + "@apollo/react-components": "file:packages/components", + "ts-invariant": "^0.4.0", + "tslib": "^1.9.3" + }, + "dependencies": { + "ts-invariant": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.4.0.tgz", + "integrity": "sha512-dI1qXTqHx/QP6SvwSCen4sEza+CtB9KvHQREdpMVRzt05VlSPEfNxus4PsJWdK9ZfiI4yJnAB8j3+jcD3ct21g==", + "requires": { + "tslib": "^1.9.3" + } + } + } + }, + "@apollo/react-hooks": { + "version": "file:packages/hooks" + }, + "@apollo/react-testing": { + "version": "file:packages/testing", + "requires": { + "@apollo/react-common": "file:packages/common", + "lodash.isequal": "^4.5.0", + "tslib": "^1.9.3" + } + }, "@babel/code-frame": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", @@ -14,18 +86,18 @@ } }, "@babel/core": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.3.4.tgz", - "integrity": "sha512-jRsuseXBo9pN197KnDwhhaaBzyZr2oIcLHHTt2oDdQrej5Qp57dCCJafWx5ivU8/alEYDpssYqv1MUqcxwQlrA==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.4.3.tgz", + "integrity": "sha512-oDpASqKFlbspQfzAE7yaeTmdljSH2ADIvBlb0RwbStltTuWa0+7CCI1fYVINNv9saHPa1W7oaKeuNuKj+RQCvA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.3.4", - "@babel/helpers": "^7.2.0", - "@babel/parser": "^7.3.4", - "@babel/template": "^7.2.2", - "@babel/traverse": "^7.3.4", - "@babel/types": "^7.3.4", + "@babel/generator": "^7.4.0", + "@babel/helpers": "^7.4.3", + "@babel/parser": "^7.4.3", + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0", "convert-source-map": "^1.1.0", "debug": "^4.1.0", "json5": "^2.1.0", @@ -44,46 +116,37 @@ "ms": "^2.1.1" } }, - "json5": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", - "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true } } }, "@babel/generator": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.3.4.tgz", - "integrity": "sha512-8EXhHRFqlVVWXPezBW5keTiQi/rJMQTg/Y9uVCEZ0CAF3PKtCCaVRnp64Ii1ujhkoDhhF1fVsImoN4yJ2uz4Wg==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.0.tgz", + "integrity": "sha512-/v5I+a1jhGSKLgZDcmAUZ4K/VePi43eRkUs3yePW1HB1iANOD5tqJXwGSG4BZhSksP8J9ejSlwGeTiiOFZOrXQ==", "dev": true, "requires": { - "@babel/types": "^7.3.4", + "@babel/types": "^7.4.0", "jsesc": "^2.5.1", "lodash": "^4.17.11", "source-map": "^0.5.0", "trim-right": "^1.0.1" }, "dependencies": { - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true } } @@ -115,23 +178,23 @@ "dev": true }, "@babel/helper-split-export-declaration": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz", - "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.0.tgz", + "integrity": "sha512-7Cuc6JZiYShaZnybDmfwhY4UYHzI6rlqhWjaIqbsJGsIqPimEYy5uh3akSRLMg65LSdSEnJ8a8/bWQN6u2oMGw==", "dev": true, "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.4.0" } }, "@babel/helpers": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.3.1.tgz", - "integrity": "sha512-Q82R3jKsVpUV99mgX50gOPCWwco9Ec5Iln/8Vyu4osNIOQgSrd9RFrQeUvmvddFNoLwMyOUWU+5ckioEKpDoGA==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.4.3.tgz", + "integrity": "sha512-BMh7X0oZqb36CfyhvtbSmcWc3GXocfxv3yNsAEuM0l+fAqSO22rQrUpijr3oE/10jCTrB6/0b9kzmG4VetCj8Q==", "dev": true, "requires": { - "@babel/template": "^7.1.2", - "@babel/traverse": "^7.1.5", - "@babel/types": "^7.3.0" + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0" } }, "@babel/highlight": { @@ -143,43 +206,12 @@ "chalk": "^2.0.0", "esutils": "^2.0.2", "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "@babel/parser": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.4.tgz", - "integrity": "sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.3.tgz", + "integrity": "sha512-gxpEUhTS1sGA63EGQGuA+WESPR/6tz6ng7tSHFCmaTJK/cGK8y37cBTspX+U2xCAue2IQVvF6Z0oigmjwD8YGQ==", "dev": true }, "@babel/plugin-syntax-object-rest-spread": { @@ -192,45 +224,37 @@ } }, "@babel/runtime": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.3.4.tgz", - "integrity": "sha512-IvfvnMdSaLBateu0jfsYIpZTxAc2cKEXEMiezGGN75QcBcecDUKd3PgLAncT0oOgxKy8dd8hrJKj9MfzgfZd6g==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", + "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", "dev": true, "requires": { - "regenerator-runtime": "^0.12.0" - }, - "dependencies": { - "regenerator-runtime": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", - "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==", - "dev": true - } + "regenerator-runtime": "^0.13.2" } }, "@babel/template": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.2.2.tgz", - "integrity": "sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.0.tgz", + "integrity": "sha512-SOWwxxClTTh5NdbbYZ0BmaBVzxzTh2tO/TeLTbF6MO6EzVhHTnff8CdBXx3mEtazFBoysmEM6GU/wF+SuSx4Fw==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.2.2", - "@babel/types": "^7.2.2" + "@babel/parser": "^7.4.0", + "@babel/types": "^7.4.0" } }, "@babel/traverse": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.3.4.tgz", - "integrity": "sha512-TvTHKp6471OYEcE/91uWmhR6PrrYywQntCHSaZ8CM8Vmp+pjAusal4nGB2WCCQd0rvI7nOMKn9GnbcvTUz3/ZQ==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.3.tgz", + "integrity": "sha512-HmA01qrtaCwwJWpSKpA948cBvU5BrmviAief/b3AVw936DtcdsTexlbyzNuDnthwhOQ37xshn7hvQaEQk7ISYQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.3.4", + "@babel/generator": "^7.4.0", "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.0.0", - "@babel/parser": "^7.3.4", - "@babel/types": "^7.3.4", + "@babel/helper-split-export-declaration": "^7.4.0", + "@babel/parser": "^7.4.3", + "@babel/types": "^7.4.0", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.11" @@ -245,12 +269,6 @@ "ms": "^2.1.1" } }, - "globals": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", - "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", - "dev": true - }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", @@ -260,22 +278,14 @@ } }, "@babel/types": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.4.tgz", - "integrity": "sha512-WEkp8MsLftM7O/ty580wAmZzN1nDmCACc5+jFzUt+GUFNNIi3LdRlueYz0YIlmJhlZx1QYDMZL5vdWCL0fNjFQ==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.0.tgz", + "integrity": "sha512-aPvkXyU2SPOnztlgo8n9cEiXW755mgyvueUPcpStqdzoSPm0fjO0vQBjLkt3JKJW7ufikfcnMTTPsN1xaTsBPA==", "dev": true, "requires": { "esutils": "^2.0.2", "lodash": "^4.17.11", "to-fast-properties": "^2.0.0" - }, - "dependencies": { - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true - } } }, "@cnakazawa/watch": { @@ -286,181 +296,87 @@ "requires": { "exec-sh": "^0.3.2", "minimist": "^1.2.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } } }, "@jest/console": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.3.0.tgz", - "integrity": "sha512-NaCty/OOei6rSDcbPdMiCbYCI0KGFGPgGO6B09lwWt5QTxnkuhKYET9El5u5z1GAcSxkQmSMtM63e24YabCWqA==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.7.1.tgz", + "integrity": "sha512-iNhtIy2M8bXlAOULWVTUxmnelTLFneTNEkHCgPmgd+zNwy9zVddJ6oS5rZ9iwoscNdT5mMwUd0C51v/fSlzItg==", "dev": true, "requires": { "@jest/source-map": "^24.3.0", - "@types/node": "*", "chalk": "^2.0.1", "slash": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "@jest/core": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-24.5.0.tgz", - "integrity": "sha512-RDZArRzAs51YS7dXG1pbXbWGxK53rvUu8mCDYsgqqqQ6uSOaTjcVyBl2Jce0exT2rSLk38ca7az7t2f3b0/oYQ==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-24.7.1.tgz", + "integrity": "sha512-ivlZ8HX/FOASfHcb5DJpSPFps8ydfUYzLZfgFFqjkLijYysnIEOieg72YRhO4ZUB32xu40hsSMmaw+IGYeKONA==", "dev": true, "requires": { - "@jest/console": "^24.3.0", - "@jest/reporters": "^24.5.0", - "@jest/test-result": "^24.5.0", - "@jest/transform": "^24.5.0", - "@jest/types": "^24.5.0", + "@jest/console": "^24.7.1", + "@jest/reporters": "^24.7.1", + "@jest/test-result": "^24.7.1", + "@jest/transform": "^24.7.1", + "@jest/types": "^24.7.0", "ansi-escapes": "^3.0.0", "chalk": "^2.0.1", "exit": "^0.1.2", "graceful-fs": "^4.1.15", - "jest-changed-files": "^24.5.0", - "jest-config": "^24.5.0", - "jest-haste-map": "^24.5.0", - "jest-message-util": "^24.5.0", + "jest-changed-files": "^24.7.0", + "jest-config": "^24.7.1", + "jest-haste-map": "^24.7.1", + "jest-message-util": "^24.7.1", "jest-regex-util": "^24.3.0", - "jest-resolve-dependencies": "^24.5.0", - "jest-runner": "^24.5.0", - "jest-runtime": "^24.5.0", - "jest-snapshot": "^24.5.0", - "jest-util": "^24.5.0", - "jest-validate": "^24.5.0", - "jest-watcher": "^24.5.0", + "jest-resolve-dependencies": "^24.7.1", + "jest-runner": "^24.7.1", + "jest-runtime": "^24.7.1", + "jest-snapshot": "^24.7.1", + "jest-util": "^24.7.1", + "jest-validate": "^24.7.0", + "jest-watcher": "^24.7.1", "micromatch": "^3.1.10", "p-each-series": "^1.0.0", "pirates": "^4.0.1", "realpath-native": "^1.1.0", "rimraf": "^2.5.4", "strip-ansi": "^5.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "strip-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz", - "integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "@jest/environment": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-24.5.0.tgz", - "integrity": "sha512-tzUHR9SHjMXwM8QmfHb/EJNbF0fjbH4ieefJBvtwO8YErLTrecc1ROj0uo2VnIT6SlpEGZnvdCK6VgKYBo8LsA==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-24.7.1.tgz", + "integrity": "sha512-wmcTTYc4/KqA+U5h1zQd5FXXynfa7VGP2NfF+c6QeGJ7c+2nStgh65RQWNX62SC716dTtqheTRrZl0j+54oGHw==", "dev": true, "requires": { - "@jest/fake-timers": "^24.5.0", - "@jest/transform": "^24.5.0", - "@jest/types": "^24.5.0", - "@types/node": "*", - "jest-mock": "^24.5.0" + "@jest/fake-timers": "^24.7.1", + "@jest/transform": "^24.7.1", + "@jest/types": "^24.7.0", + "jest-mock": "^24.7.0" } }, "@jest/fake-timers": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-24.5.0.tgz", - "integrity": "sha512-i59KVt3QBz9d+4Qr4QxsKgsIg+NjfuCjSOWj3RQhjF5JNy+eVJDhANQ4WzulzNCHd72srMAykwtRn5NYDGVraw==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-24.7.1.tgz", + "integrity": "sha512-4vSQJDKfR2jScOe12L9282uiwuwQv9Lk7mgrCSZHA9evB9efB/qx8i0KJxsAKtp8fgJYBJdYY7ZU6u3F4/pyjA==", "dev": true, "requires": { - "@jest/types": "^24.5.0", - "@types/node": "*", - "jest-message-util": "^24.5.0", - "jest-mock": "^24.5.0" + "@jest/types": "^24.7.0", + "jest-message-util": "^24.7.1", + "jest-mock": "^24.7.0" } }, "@jest/reporters": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-24.5.0.tgz", - "integrity": "sha512-vfpceiaKtGgnuC3ss5czWOihKOUSyjJA4M4udm6nH8xgqsuQYcyDCi4nMMcBKsHXWgz9/V5G7iisnZGfOh1w6Q==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-24.7.1.tgz", + "integrity": "sha512-bO+WYNwHLNhrjB9EbPL4kX/mCCG4ZhhfWmO3m4FSpbgr7N83MFejayz30kKjgqr7smLyeaRFCBQMbXpUgnhAJw==", "dev": true, "requires": { - "@jest/environment": "^24.5.0", - "@jest/test-result": "^24.5.0", - "@jest/transform": "^24.5.0", - "@jest/types": "^24.5.0", + "@jest/environment": "^24.7.1", + "@jest/test-result": "^24.7.1", + "@jest/transform": "^24.7.1", + "@jest/types": "^24.7.0", "chalk": "^2.0.1", "exit": "^0.1.2", "glob": "^7.1.2", @@ -468,58 +384,15 @@ "istanbul-lib-coverage": "^2.0.2", "istanbul-lib-instrument": "^3.0.1", "istanbul-lib-source-maps": "^3.0.1", - "jest-haste-map": "^24.5.0", - "jest-resolve": "^24.5.0", - "jest-runtime": "^24.5.0", - "jest-util": "^24.5.0", - "jest-worker": "^24.4.0", + "jest-haste-map": "^24.7.1", + "jest-resolve": "^24.7.1", + "jest-runtime": "^24.7.1", + "jest-util": "^24.7.1", + "jest-worker": "^24.6.0", "node-notifier": "^5.2.1", "slash": "^2.0.0", "source-map": "^0.6.0", "string-length": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "@jest/source-map": { @@ -531,107 +404,68 @@ "callsites": "^3.0.0", "graceful-fs": "^4.1.15", "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } } }, "@jest/test-result": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-24.5.0.tgz", - "integrity": "sha512-u66j2vBfa8Bli1+o3rCaVnVYa9O8CAFZeqiqLVhnarXtreSXG33YQ6vNYBogT7+nYiFNOohTU21BKiHlgmxD5A==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-24.7.1.tgz", + "integrity": "sha512-3U7wITxstdEc2HMfBX7Yx3JZgiNBubwDqQMh+BXmZXHa3G13YWF3p6cK+5g0hGkN3iufg/vGPl3hLxQXD74Npg==", + "dev": true, + "requires": { + "@jest/console": "^24.7.1", + "@jest/types": "^24.7.0", + "@types/istanbul-lib-coverage": "^2.0.0" + } + }, + "@jest/test-sequencer": { + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-24.7.1.tgz", + "integrity": "sha512-84HQkCpVZI/G1zq53gHJvSmhUer4aMYp9tTaffW28Ih5OxfCg8hGr3nTSbL1OhVDRrFZwvF+/R9gY6JRkDUpUA==", "dev": true, "requires": { - "@jest/console": "^24.3.0", - "@jest/types": "^24.5.0", - "@types/istanbul-lib-coverage": "^1.1.0" + "@jest/test-result": "^24.7.1", + "jest-haste-map": "^24.7.1", + "jest-runner": "^24.7.1", + "jest-runtime": "^24.7.1" } }, "@jest/transform": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-24.5.0.tgz", - "integrity": "sha512-XSsDz1gdR/QMmB8UCKlweAReQsZrD/DK7FuDlNo/pE8EcKMrfi2kqLRk8h8Gy/PDzgqJj64jNEzOce9pR8oj1w==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-24.7.1.tgz", + "integrity": "sha512-EsOUqP9ULuJ66IkZQhI5LufCHlTbi7hrcllRMUEV/tOgqBVQi93+9qEvkX0n8mYpVXQ8VjwmICeRgg58mrtIEw==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/types": "^24.5.0", + "@jest/types": "^24.7.0", "babel-plugin-istanbul": "^5.1.0", "chalk": "^2.0.1", "convert-source-map": "^1.4.0", "fast-json-stable-stringify": "^2.0.0", "graceful-fs": "^4.1.15", - "jest-haste-map": "^24.5.0", + "jest-haste-map": "^24.7.1", "jest-regex-util": "^24.3.0", - "jest-util": "^24.5.0", + "jest-util": "^24.7.1", "micromatch": "^3.1.10", "realpath-native": "^1.1.0", "slash": "^2.0.0", "source-map": "^0.6.1", "write-file-atomic": "2.4.1" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "@jest/types": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.5.0.tgz", - "integrity": "sha512-kN7RFzNMf2R8UDadPOl6ReyI+MT8xfqRuAnuVL+i4gwjv/zubdDK+EDeLHYwq1j0CSSR2W/MmgaRlMZJzXdmVA==", + "version": "24.7.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.7.0.tgz", + "integrity": "sha512-ipJUa2rFWiKoBqMKP63Myb6h9+iT3FHRTF2M8OR6irxWzItisa8i4dcSg14IbvmXUnBlHBlUQPYUHWyX3UPpYA==", "dev": true, "requires": { - "@types/istanbul-lib-coverage": "^1.1.0", + "@types/istanbul-lib-coverage": "^2.0.0", "@types/yargs": "^12.0.9" } }, "@types/babel__core": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.0.tgz", - "integrity": "sha512-wJTeJRt7BToFx3USrCDs2BhEi4ijBInTQjOIukj6a/5tEkwpFMVZ+1ppgmE+Q/FQyc5P/VWUbx7I9NELrKruHA==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.1.tgz", + "integrity": "sha512-+hjBtgcFPYyCTo0A15+nxrCVJL7aC6Acg87TXd5OW3QhHswdrOLoles+ldL2Uk8q++7yIfl4tURtztccdeeyOw==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -704,30 +538,25 @@ "dev": true }, "@types/graphql": { - "version": "14.0.7", - "resolved": "https://registry.npmjs.org/@types/graphql/-/graphql-14.0.7.tgz", - "integrity": "sha512-BoLDjdvLQsXPZLJux3lEZANwGr3Xag56Ngy0U3y8uoRSDdeLcn43H3oBcgZlnd++iOQElBpaRVDHPzEDekyvXQ==", + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/@types/graphql/-/graphql-14.2.0.tgz", + "integrity": "sha512-lELg5m6eBOmATWyCZl8qULEOvnPIUG6B443yXKj930glXIgwQirIBPp5rthP2amJW0YSzUg2s5sfgba4mRRCNw==", "dev": true }, "@types/hoist-non-react-statics": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz", - "integrity": "sha512-O2OGyW9wlO2bbDmZRH17MecArQfsIa1g//ve2IJk6BnmwEglFz5kdhP1BlgeqjVNH5IHIhsc83DWFo8StCe8+Q==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", + "integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==", "dev": true, "requires": { - "@types/react": "*" + "@types/react": "*", + "hoist-non-react-statics": "^3.3.0" } }, - "@types/invariant": { - "version": "2.2.29", - "resolved": "https://registry.npmjs.org/@types/invariant/-/invariant-2.2.29.tgz", - "integrity": "sha512-lRVw09gOvgviOfeUrKc/pmTiRZ7g7oDOU6OAutyuSHpm1/o2RaBQvRhgK8QEdu+FFuw/wnWb29A/iuxv9i8OpQ==", - "dev": true - }, "@types/istanbul-lib-coverage": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz", - "integrity": "sha512-ohkhb9LehJy+PA40rDtGAji61NCgdtKLAlFoYp4cnuuQEswwdK3vz9SOIkkyc3wrk8dzjphQApNs56yyXLStaQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.0.tgz", + "integrity": "sha512-eAtOAFZefEnfJiRFQBGw1eYqa5GTLCZ1y86N0XSI/D6EB+E8z6VPV/UL7Gi5UEclFqoQk+6NRqEDsfmDLXn8sg==", "dev": true }, "@types/jest": { @@ -761,15 +590,9 @@ } }, "@types/node": { - "version": "11.11.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.3.tgz", - "integrity": "sha512-wp6IOGu1lxsfnrD+5mX6qwSwWuqsdkKKxTN4aQc4wByHAKZJf9/D4KXPQ1POUjEbnCP5LMggB0OEFNY9OTsMqg==", - "dev": true - }, - "@types/object-assign": { - "version": "4.0.30", - "resolved": "https://registry.npmjs.org/@types/object-assign/-/object-assign-4.0.30.tgz", - "integrity": "sha1-iUk3HVqZ9Dge4PHfCpt6GH4H5lI=", + "version": "11.13.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.4.tgz", + "integrity": "sha512-+rabAZZ3Yn7tF/XPGHupKIL5EcAbrLxnTr/hgQICxbeuAfWtT0UZSfULE+ndusckBItcv4o6ZeOJplQikVcLvQ==", "dev": true }, "@types/prop-types": { @@ -779,9 +602,9 @@ "dev": true }, "@types/react": { - "version": "16.8.8", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.8.8.tgz", - "integrity": "sha512-xwEvyet96u7WnB96kqY0yY7qxx/pEpU51QeACkKFtrgjjXITQn0oO1iwPEraXVgh10ZFPix7gs1R4OJXF7P5sg==", + "version": "16.8.13", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.8.13.tgz", + "integrity": "sha512-otJ4ntMuHGrvm67CdDJMAls4WqotmAmW0g3HmWi9LCjSWXrxoXY/nHXrtmMfvPEEmGFNm6NdgMsJmnfH820Qaw==", "dev": true, "requires": { "@types/prop-types": "*", @@ -789,9 +612,9 @@ } }, "@types/react-dom": { - "version": "16.8.2", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.8.2.tgz", - "integrity": "sha512-MX7n1wq3G/De15RGAAqnmidzhr2Y9O/ClxPxyqaNg96pGyeXUYPSvujgzEVpLo9oIP4Wn1UETl+rxTN02KEpBw==", + "version": "16.8.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.8.3.tgz", + "integrity": "sha512-HF5hD5YR3z9Mn6kXcW1VKe4AQ04ZlZj1EdLBae61hzQ3eEWWxMgNLUbIxeZp40BnSxqY1eAYLsH9QopQcxzScA==", "dev": true, "requires": { "@types/react": "*" @@ -815,6 +638,15 @@ "@types/react": "*" } }, + "@types/resolve": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", + "integrity": "sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/stack-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", @@ -822,9 +654,9 @@ "dev": true }, "@types/yargs": { - "version": "12.0.9", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-12.0.9.tgz", - "integrity": "sha512-sCZy4SxP9rN2w30Hlmg5dtdRwgYQfYRiLo9usw8X9cxlf+H4FqM1xX7+sNH7NNKVdbXMJWqva7iyy+fxh/V7fA==", + "version": "12.0.12", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-12.0.12.tgz", + "integrity": "sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw==", "dev": true }, "@types/zen-observable": { @@ -875,6 +707,24 @@ "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", "dev": true }, + "airbnb-prop-types": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/airbnb-prop-types/-/airbnb-prop-types-2.13.2.tgz", + "integrity": "sha512-2FN6DlHr6JCSxPPi25EnqGaXC4OC3/B3k1lCd6MMYrZ51/Gf/1qDfaR+JElzWa+Tl7cY2aYOlsYJGFeQyVHIeQ==", + "dev": true, + "requires": { + "array.prototype.find": "^2.0.4", + "function.prototype.name": "^1.1.0", + "has": "^1.0.3", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object.assign": "^4.1.0", + "object.entries": "^1.1.0", + "prop-types": "^15.7.2", + "prop-types-exact": "^1.2.0", + "react-is": "^16.8.6" + } + }, "ajv": { "version": "6.10.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", @@ -887,49 +737,6 @@ "uri-js": "^4.2.2" } }, - "ansi-align": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", - "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", - "dev": true, - "requires": { - "string-width": "^3.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz", - "integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, "ansi-escapes": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", @@ -937,16 +744,19 @@ "dev": true }, "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } }, "anymatch": { "version": "2.0.0", @@ -979,17 +789,6 @@ "optimism": "^0.6.9", "ts-invariant": "^0.2.1", "tslib": "^1.9.3" - }, - "dependencies": { - "ts-invariant": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.2.1.tgz", - "integrity": "sha512-Z/JSxzVmhTo50I+LKagEISFJW3pvPCqsMWLamCTX8Kr3N5aMrnGOqcflbe5hLUzwjvgPfnLzQtHZv0yWQ+FIHg==", - "dev": true, - "requires": { - "tslib": "^1.9.3" - } - } } }, "apollo-client": { @@ -1007,17 +806,6 @@ "ts-invariant": "^0.2.1", "tslib": "^1.9.3", "zen-observable": "^0.8.0" - }, - "dependencies": { - "ts-invariant": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.2.1.tgz", - "integrity": "sha512-Z/JSxzVmhTo50I+LKagEISFJW3pvPCqsMWLamCTX8Kr3N5aMrnGOqcflbe5hLUzwjvgPfnLzQtHZv0yWQ+FIHg==", - "dev": true, - "requires": { - "tslib": "^1.9.3" - } - } } }, "apollo-link": { @@ -1030,6 +818,17 @@ "ts-invariant": "^0.3.2", "tslib": "^1.9.3", "zen-observable-ts": "^0.8.18" + }, + "dependencies": { + "ts-invariant": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.3.3.tgz", + "integrity": "sha512-UReOKsrJFGC9tUblgSRWo+BsVNbEd77Cl6WiV/XpMlkifXwNIJbknViCucHvVZkXSC/mcWeRnIGdY7uprcwvdQ==", + "dev": true, + "requires": { + "tslib": "^1.9.3" + } + } } }, "apollo-link-dedup": { @@ -1040,50 +839,17 @@ "requires": { "apollo-link": "^1.2.11", "tslib": "^1.9.3" - }, - "dependencies": { - "apollo-link": { - "version": "1.2.11", - "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.2.11.tgz", - "integrity": "sha512-PQvRCg13VduLy3X/0L79M6uOpTh5iHdxnxYuo8yL7sJlWybKRJwsv4IcRBJpMFbChOOaHY7Og9wgPo6DLKDKDA==", - "dev": true, - "requires": { - "apollo-utilities": "^1.2.1", - "ts-invariant": "^0.3.2", - "tslib": "^1.9.3", - "zen-observable-ts": "^0.8.18" - } - }, - "zen-observable-ts": { - "version": "0.8.18", - "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-0.8.18.tgz", - "integrity": "sha512-q7d05s75Rn1j39U5Oapg3HI2wzriVwERVo4N7uFGpIYuHB9ff02P/E92P9B8T7QVC93jCMHpbXH7X0eVR5LA7A==", - "dev": true, - "requires": { - "tslib": "^1.9.3", - "zen-observable": "^0.8.0" - } - } } }, "apollo-utilities": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.2.1.tgz", "integrity": "sha512-Zv8Udp9XTSFiN8oyXOjf6PMHepD4yxxReLsl6dPUy5Ths7jti3nmlBzZUOxuTWRwZn0MoclqL7RQ5UEJN8MAxg==", + "dev": true, "requires": { "fast-json-stable-stringify": "^2.0.0", "ts-invariant": "^0.2.1", "tslib": "^1.9.3" - }, - "dependencies": { - "ts-invariant": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.2.1.tgz", - "integrity": "sha512-Z/JSxzVmhTo50I+LKagEISFJW3pvPCqsMWLamCTX8Kr3N5aMrnGOqcflbe5hLUzwjvgPfnLzQtHZv0yWQ+FIHg==", - "requires": { - "tslib": "^1.9.3" - } - } } }, "append-transform": { @@ -1109,6 +875,32 @@ "requires": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "argparse": { @@ -1156,6 +948,16 @@ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, + "array.prototype.find": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.0.4.tgz", + "integrity": "sha1-VWpcU2LAhkgyPdrrnenRS8GGTJA=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.7.0" + } + }, "array.prototype.flat": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.1.tgz", @@ -1201,9 +1003,9 @@ "dev": true }, "ast-types": { - "version": "0.12.2", - "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.12.2.tgz", - "integrity": "sha512-8c83xDLJM/dLDyXNLiR6afRRm4dPKN6KAnKqytRK3DBJul9lA+atxdQkNDkSVPdTqea5HiRq3lnnOIZ0MBpvdg==", + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.12.3.tgz", + "integrity": "sha512-wJUcAfrdW+IgDoMGNz5MmcvahKgB7BwIbLupdKVVHxHNYt+HVR2k35swdYNv9aZpF8nvlkjbnkp2rrNwxGckZA==", "dev": true }, "astral-regex": { @@ -1261,739 +1063,777 @@ "is-buffer": "^1.1.5" } }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "babel-jest": { + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.7.1.tgz", + "integrity": "sha512-GPnLqfk8Mtt0i4OemjWkChi73A3ALs4w2/QbG64uAj8b5mmwzxc7jbJVRZt8NJkxi6FopVHog9S3xX6UJKb2qg==", "dev": true, "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "dev": true - } - } - }, - "babel-core": { - "version": "6.26.3", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", - "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "babel-generator": "^6.26.0", - "babel-helpers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-register": "^6.26.0", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "convert-source-map": "^1.5.1", - "debug": "^2.6.9", - "json5": "^0.5.1", - "lodash": "^4.17.4", - "minimatch": "^3.0.4", - "path-is-absolute": "^1.0.1", - "private": "^0.1.8", - "slash": "^1.0.0", - "source-map": "^0.5.7" + "@jest/transform": "^24.7.1", + "@jest/types": "^24.7.0", + "@types/babel__core": "^7.1.0", + "babel-plugin-istanbul": "^5.1.0", + "babel-preset-jest": "^24.6.0", + "chalk": "^2.4.2", + "slash": "^2.0.0" } }, - "babel-generator": { - "version": "6.26.1", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "babel-plugin-istanbul": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.1.tgz", + "integrity": "sha512-RNNVv2lsHAXJQsEJ5jonQwrJVWK8AcZpG1oxhnjCUaAjL7xahYLANhPUZbzEQHjKy1NMYUwn+0NPKQc8iSY4xQ==", "dev": true, "requires": { - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "detect-indent": "^4.0.0", - "jsesc": "^1.3.0", - "lodash": "^4.17.4", - "source-map": "^0.5.7", - "trim-right": "^1.0.1" + "find-up": "^3.0.0", + "istanbul-lib-instrument": "^3.0.0", + "test-exclude": "^5.0.0" } }, - "babel-helper-builder-binary-assignment-operator-visitor": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", - "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "babel-plugin-jest-hoist": { + "version": "24.6.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.6.0.tgz", + "integrity": "sha512-3pKNH6hMt9SbOv0F3WVmy5CWQ4uogS3k0GY5XLyQHJ9EGpAT9XWkFd2ZiXXtkwFHdAHa5j7w7kfxSP5lAIwu7w==", "dev": true, "requires": { - "babel-helper-explode-assignable-expression": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "@types/babel__traverse": "^7.0.6" } }, - "babel-helper-call-delegate": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", - "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "babel-preset-jest": { + "version": "24.6.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz", + "integrity": "sha512-pdZqLEdmy1ZK5kyRUfvBb2IfTPb2BUvIJczlPspS8fWmBQslNNDBqVfh7BW5leOVJMDZKzjD8XEyABTk6gQ5yw==", "dev": true, "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" + "@babel/plugin-syntax-object-rest-spread": "^7.0.0", + "babel-plugin-jest-hoist": "^24.6.0" } }, - "babel-helper-define-map": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", - "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "dev": true, "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } } }, - "babel-helper-explode-assignable-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", - "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "dev": true, "requires": { - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" + "tweetnacl": "^0.14.3" } }, - "babel-helper-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", - "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "bl": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", + "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", "dev": true, "requires": { - "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" + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, - "babel-helper-get-function-arity": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", - "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "block-stream": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", "dev": true, "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "inherits": "~2.0.0" } }, - "babel-helper-hoist-variables": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", - "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "babel-helper-optimise-call-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", - "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } } }, - "babel-helper-regex": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", - "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "brotli-size": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/brotli-size/-/brotli-size-0.0.1.tgz", + "integrity": "sha1-jBruoBzSLzWbBIlRGFvVOf8Mgp8=", "dev": true, "requires": { - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" + "duplexer": "^0.1.1", + "iltorb": "^1.0.9" } }, - "babel-helper-remap-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", - "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "browser-process-hrtime": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", + "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", + "dev": true + }, + "browser-resolve": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", + "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", "dev": true, "requires": { - "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" + "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + } } }, - "babel-helper-replace-supers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", - "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", "dev": true, "requires": { - "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" + "fast-json-stable-stringify": "2.x" } }, - "babel-helpers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", - "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "bser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.0.0.tgz", + "integrity": "sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=", "dev": true, "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" + "node-int64": "^0.4.0" } }, - "babel-jest": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.5.0.tgz", - "integrity": "sha512-0fKCXyRwxFTJL0UXDJiT2xYxO9Lu2vBd9n+cC+eDjESzcVG3s2DRGAxbzJX21fceB1WYoBjAh8pQ83dKcl003g==", + "buffer-alloc": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", + "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", "dev": true, "requires": { - "@jest/transform": "^24.5.0", - "@jest/types": "^24.5.0", - "@types/babel__core": "^7.1.0", - "babel-plugin-istanbul": "^5.1.0", - "babel-preset-jest": "^24.3.0", - "chalk": "^2.4.2", - "slash": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" + } + }, + "buffer-alloc-unsafe": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", + "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", + "dev": true + }, + "buffer-fill": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", + "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", + "dev": true + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "builtin-modules": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", + "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", + "dev": true + }, + "bundlesize": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/bundlesize/-/bundlesize-0.17.1.tgz", + "integrity": "sha512-p5I5Tpoug9aOVGg4kQETMJ8xquY66mX9XI19kXkkAFnmDhDXwSF+1jq1OjBGz7h27TAulM3k2wLEJPvickTt0A==", + "dev": true, + "requires": { + "axios": "^0.17.0", + "brotli-size": "0.0.1", + "bytes": "^3.0.0", + "ci-env": "^1.4.0", + "commander": "^2.11.0", + "github-build": "^1.2.0", + "glob": "^7.1.2", + "gzip-size": "^4.0.0", + "prettycli": "^1.4.3", + "read-pkg-up": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, "requires": { - "color-convert": "^1.9.0" + "locate-path": "^2.0.0" } }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" } }, - "slash": { + "p-locate": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", "dev": true, "requires": { - "has-flag": "^3.0.0" + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" } } } }, - "babel-messages": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "dev": true, "requires": { - "babel-runtime": "^6.22.0" + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" } }, - "babel-plugin-check-es2015-constants": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", - "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "capture-exit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", + "integrity": "sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==", "dev": true, "requires": { - "babel-runtime": "^6.22.0" + "rsvp": "^4.8.4" } }, - "babel-plugin-istanbul": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.1.tgz", - "integrity": "sha512-RNNVv2lsHAXJQsEJ5jonQwrJVWK8AcZpG1oxhnjCUaAjL7xahYLANhPUZbzEQHjKy1NMYUwn+0NPKQc8iSY4xQ==", + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { - "find-up": "^3.0.0", - "istanbul-lib-instrument": "^3.0.0", - "test-exclude": "^5.0.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, - "babel-plugin-jest-hoist": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.3.0.tgz", - "integrity": "sha512-nWh4N1mVH55Tzhx2isvUN5ebM5CDUvIpXPZYMRazQughie/EqGnbR+czzoQlhUmJG9pPJmYDRhvocotb2THl1w==", + "change-emitter": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/change-emitter/-/change-emitter-0.1.6.tgz", + "integrity": "sha1-6LL+PX8at9aaMhma/5HqaTFAlRU=", + "dev": true + }, + "cheerio": { + "version": "1.0.0-rc.3", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.3.tgz", + "integrity": "sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==", "dev": true, "requires": { - "@types/babel__traverse": "^7.0.6" + "css-select": "~1.2.0", + "dom-serializer": "~0.1.1", + "entities": "~1.1.1", + "htmlparser2": "^3.9.1", + "lodash": "^4.15.0", + "parse5": "^3.0.1" } }, - "babel-plugin-syntax-async-functions": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", - "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", + "chownr": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", + "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", "dev": true }, - "babel-plugin-syntax-exponentiation-operator": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", - "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", + "ci-env": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/ci-env/-/ci-env-1.7.0.tgz", + "integrity": "sha512-ifHfV5JmACoTnoPxwjKjUUAekL1UCKZ9EU27GaaSkLVopkV3H1w0eYIpY+aAiX31SVEtTrZFMS94EFETSj0vIA==", "dev": true }, - "babel-plugin-syntax-trailing-function-commas": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", - "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, - "babel-plugin-transform-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", - "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "dev": true, "requires": { - "babel-helper-remap-async-to-generator": "^6.24.1", - "babel-plugin-syntax-async-functions": "^6.8.0", - "babel-runtime": "^6.22.0" + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } } }, - "babel-plugin-transform-es2015-arrow-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", - "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "dev": true, "requires": { - "babel-runtime": "^6.22.0" + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } } }, - "babel-plugin-transform-es2015-block-scoped-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", - "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true }, - "babel-plugin-transform-es2015-block-scoping": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", - "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true }, - "babel-plugin-transform-es2015-classes": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", - "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", "dev": true, "requires": { - "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" + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" } }, - "babel-plugin-transform-es2015-computed-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", - "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" + "color-name": "1.1.3" } }, - "babel-plugin-transform-es2015-destructuring": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", - "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true }, - "babel-plugin-transform-es2015-duplicate-keys": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", - "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "combined-stream": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", "dev": true, "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "delayed-stream": "~1.0.0" } }, - "babel-plugin-transform-es2015-for-of": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", - "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } + "commander": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "dev": true }, - "babel-plugin-transform-es2015-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", - "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", - "dev": true, - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } + "compare-versions": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.4.0.tgz", + "integrity": "sha512-tK69D7oNXXqUW3ZNo/z7NXTEz22TCF0pTE+YF9cxvaAM9XnkLo1fV621xCLrRR6aevJlKxExkss0vWqUCUpqdg==", + "dev": true }, - "babel-plugin-transform-es2015-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", - "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true }, - "babel-plugin-transform-es2015-modules-amd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", - "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", - "dev": true, - "requires": { - "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, - "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.2", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", - "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", - "dev": true, - "requires": { - "babel-plugin-transform-strict-mode": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-types": "^6.26.0" - } + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true }, - "babel-plugin-transform-es2015-modules-systemjs": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", - "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", + "convert-source-map": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", + "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", "dev": true, "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" + "safe-buffer": "~5.1.1" } }, - "babel-plugin-transform-es2015-modules-umd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", - "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", - "dev": true, - "requires": { - "babel-plugin-transform-es2015-modules-amd": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true }, - "babel-plugin-transform-es2015-object-super": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", - "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", - "dev": true, - "requires": { - "babel-helper-replace-supers": "^6.24.1", - "babel-runtime": "^6.22.0" - } + "core-js": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=", + "dev": true }, - "babel-plugin-transform-es2015-parameters": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", - "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", - "dev": true, - "requires": { - "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" - } + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true }, - "babel-plugin-transform-es2015-shorthand-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", - "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } }, - "babel-plugin-transform-es2015-spread": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", - "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "css-select": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", + "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", "dev": true, "requires": { - "babel-runtime": "^6.22.0" + "boolbase": "~1.0.0", + "css-what": "2.1", + "domutils": "1.5.1", + "nth-check": "~1.0.1" } }, - "babel-plugin-transform-es2015-sticky-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", - "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", - "dev": true, - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } + "css-what": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", + "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==", + "dev": true }, - "babel-plugin-transform-es2015-template-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", - "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } + "cssom": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.6.tgz", + "integrity": "sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A==", + "dev": true }, - "babel-plugin-transform-es2015-typeof-symbol": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", - "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "cssstyle": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.2.2.tgz", + "integrity": "sha512-43wY3kl1CVQSvL7wUY1qXkxVGkStjpkDmVjiIKX8R97uhajy8Bybay78uOtqvh7Q5GK75dNPfW0geWjE6qQQow==", "dev": true, "requires": { - "babel-runtime": "^6.22.0" + "cssom": "0.3.x" } }, - "babel-plugin-transform-es2015-unicode-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", - "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", - "dev": true, - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "regexpu-core": "^2.0.0" - } + "csstype": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.3.tgz", + "integrity": "sha512-rINUZXOkcBmoHWEyu7JdHu5JMzkGRoMX4ov9830WNgxf5UYxcBUO0QTKAqeJ5EZfSdlrcJYkC8WwfVW7JYi4yg==", + "dev": true }, - "babel-plugin-transform-exponentiation-operator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", - "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "dev": true, "requires": { - "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", - "babel-plugin-syntax-exponentiation-operator": "^6.8.0", - "babel-runtime": "^6.22.0" + "assert-plus": "^1.0.0" } }, - "babel-plugin-transform-regenerator": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", - "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", + "data-urls": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", + "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==", "dev": true, "requires": { - "regenerator-transform": "^0.10.0" + "abab": "^2.0.0", + "whatwg-mimetype": "^2.2.0", + "whatwg-url": "^7.0.0" + }, + "dependencies": { + "whatwg-url": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", + "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + } } }, - "babel-plugin-transform-strict-mode": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", - "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "ms": "2.0.0" } }, - "babel-preset-env": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz", - "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==", - "dev": true, - "requires": { - "babel-plugin-check-es2015-constants": "^6.22.0", - "babel-plugin-syntax-trailing-function-commas": "^6.22.0", - "babel-plugin-transform-async-to-generator": "^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.23.0", - "babel-plugin-transform-es2015-classes": "^6.23.0", - "babel-plugin-transform-es2015-computed-properties": "^6.22.0", - "babel-plugin-transform-es2015-destructuring": "^6.23.0", - "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", - "babel-plugin-transform-es2015-for-of": "^6.23.0", - "babel-plugin-transform-es2015-function-name": "^6.22.0", - "babel-plugin-transform-es2015-literals": "^6.22.0", - "babel-plugin-transform-es2015-modules-amd": "^6.22.0", - "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", - "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", - "babel-plugin-transform-es2015-modules-umd": "^6.23.0", - "babel-plugin-transform-es2015-object-super": "^6.22.0", - "babel-plugin-transform-es2015-parameters": "^6.23.0", - "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", - "babel-plugin-transform-es2015-spread": "^6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", - "babel-plugin-transform-es2015-template-literals": "^6.22.0", - "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", - "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", - "babel-plugin-transform-exponentiation-operator": "^6.22.0", - "babel-plugin-transform-regenerator": "^6.22.0", - "browserslist": "^3.2.6", - "invariant": "^2.2.2", - "semver": "^5.3.0" - } + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true }, - "babel-preset-jest": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.3.0.tgz", - "integrity": "sha512-VGTV2QYBa/Kn3WCOKdfS31j9qomaXSgJqi65B6o05/1GsJyj9LVhSljM9ro4S+IBGj/ENhNBuH9bpqzztKAQSw==", - "dev": true, - "requires": { - "@babel/plugin-syntax-object-rest-spread": "^7.0.0", - "babel-plugin-jest-hoist": "^24.3.0" - } + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true }, - "babel-register": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", - "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", "dev": true, "requires": { - "babel-core": "^6.26.0", - "babel-runtime": "^6.26.0", - "core-js": "^2.5.0", - "home-or-tmp": "^2.0.0", - "lodash": "^4.17.4", - "mkdirp": "^0.5.1", - "source-map-support": "^0.4.15" + "mimic-response": "^1.0.0" } }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "dev": true, - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true }, - "babel-template": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "lodash": "^4.17.4" - } + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true }, - "babel-traverse": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "default-require-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", + "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", "dev": true, "requires": { - "babel-code-frame": "^6.26.0", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" + "strip-bom": "^3.0.0" } }, - "babel-types": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "dev": true, "requires": { - "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", - "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" + "object-keys": "^1.0.12" } }, - "babylon": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", "dev": true, "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" }, "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, "is-accessor-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", @@ -2025,443 +1865,309 @@ } } }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "bl": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", - "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", - "dev": true, - "requires": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" - } - }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "dev": true, - "requires": { - "inherits": "~2.0.0" - } - }, - "bluebird": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", - "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==", + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, - "boolbase": { + "delegates": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true }, - "boxen": { + "detect-libc": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-0.2.0.tgz", + "integrity": "sha1-R/31ZzSKF+wl/L8LnkRjSKdvn7U=", + "dev": true + }, + "detect-newline": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-2.1.0.tgz", - "integrity": "sha512-luq3RQOt2U5sUX+fiu+qnT+wWnHDcATLpEe63jvge6GUZO99AKbVRfp97d2jgLvq1iQa0ORzaAm4lGVG52ZSlw==", - "dev": true, + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", + "dev": true + }, + "diff-sequences": { + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.3.0.tgz", + "integrity": "sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw==", + "dev": true + }, + "discontinuous-range": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz", + "integrity": "sha1-44Mx8IRLukm5qctxx3FYWqsbxlo=", + "dev": true + }, + "dom-serializer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", + "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", + "dev": true, "requires": { - "ansi-align": "^3.0.0", - "camelcase": "^5.0.0", - "chalk": "^2.4.1", - "cli-boxes": "^1.0.0", - "string-width": "^3.0.0", - "term-size": "^1.2.0", - "widest-line": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "camelcase": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz", - "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz", - "integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "domelementtype": "^1.3.0", + "entities": "^1.1.1" } }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "dev": true + }, + "domexception": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", + "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", "dev": true, "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "webidl-conversions": "^4.0.2" } }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "domhandler": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", "dev": true, "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" + "domelementtype": "1" } }, - "brotli-size": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/brotli-size/-/brotli-size-0.0.1.tgz", - "integrity": "sha1-jBruoBzSLzWbBIlRGFvVOf8Mgp8=", + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", "dev": true, "requires": { - "duplexer": "^0.1.1", - "iltorb": "^1.0.9" + "dom-serializer": "0", + "domelementtype": "1" } }, - "browser-process-hrtime": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", - "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", "dev": true }, - "browser-resolve": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", - "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "dev": true, "requires": { - "resolve": "1.1.7" - }, - "dependencies": { - "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true - } + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" } }, - "browserslist": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", - "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==", + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", "dev": true, "requires": { - "caniuse-lite": "^1.0.30000844", - "electron-to-chromium": "^1.3.47" + "iconv-lite": "~0.4.13" } }, - "bs-logger": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", - "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "dev": true, "requires": { - "fast-json-stable-stringify": "2.x" + "once": "^1.4.0" } }, - "bser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.0.0.tgz", - "integrity": "sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=", + "entities": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", + "dev": true + }, + "enzyme": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/enzyme/-/enzyme-3.9.0.tgz", + "integrity": "sha512-JqxI2BRFHbmiP7/UFqvsjxTirWoM1HfeaJrmVSZ9a1EADKkZgdPcAuISPMpoUiHlac9J4dYt81MC5BBIrbJGMg==", "dev": true, "requires": { - "node-int64": "^0.4.0" + "array.prototype.flat": "^1.2.1", + "cheerio": "^1.0.0-rc.2", + "function.prototype.name": "^1.1.0", + "has": "^1.0.3", + "html-element-map": "^1.0.0", + "is-boolean-object": "^1.0.0", + "is-callable": "^1.1.4", + "is-number-object": "^1.0.3", + "is-regex": "^1.0.4", + "is-string": "^1.0.4", + "is-subset": "^0.1.1", + "lodash.escape": "^4.0.1", + "lodash.isequal": "^4.5.0", + "object-inspect": "^1.6.0", + "object-is": "^1.0.1", + "object.assign": "^4.1.0", + "object.entries": "^1.0.4", + "object.values": "^1.0.4", + "raf": "^3.4.0", + "rst-selector-parser": "^2.2.3", + "string.prototype.trim": "^1.1.2" } }, - "buffer-alloc": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", - "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "enzyme-adapter-react-16": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.12.1.tgz", + "integrity": "sha512-GB61gvY97XvrA6qljExGY+lgI6BBwz+ASLaRKct9VQ3ozu0EraqcNn3CcrUckSGIqFGa1+CxO5gj5is5t3lwrw==", "dev": true, "requires": { - "buffer-alloc-unsafe": "^1.1.0", - "buffer-fill": "^1.0.0" + "enzyme-adapter-utils": "^1.11.0", + "object.assign": "^4.1.0", + "object.values": "^1.1.0", + "prop-types": "^15.7.2", + "react-is": "^16.8.6", + "react-test-renderer": "^16.0.0-0", + "semver": "^5.6.0" } }, - "buffer-alloc-unsafe": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", - "dev": true - }, - "buffer-fill": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", - "dev": true - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true + "enzyme-adapter-utils": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/enzyme-adapter-utils/-/enzyme-adapter-utils-1.11.0.tgz", + "integrity": "sha512-0VZeoE9MNx+QjTfsjmO1Mo+lMfunucYB4wt5ficU85WB/LoetTJrbuujmHP3PJx6pSoaAuLA+Mq877x4LoxdNg==", + "dev": true, + "requires": { + "airbnb-prop-types": "^2.12.0", + "function.prototype.name": "^1.1.0", + "object.assign": "^4.1.0", + "object.fromentries": "^2.0.0", + "prop-types": "^15.7.2", + "semver": "^5.6.0" + } }, - "builtin-modules": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.0.0.tgz", - "integrity": "sha512-hMIeU4K2ilbXV6Uv93ZZ0Avg/M91RaKXucQ+4me2Do1txxBDyDZWCBa5bJSLqoNTRpXTLwEzIk1KmloenDDjhg==", - "dev": true + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } }, - "bundlesize": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/bundlesize/-/bundlesize-0.17.1.tgz", - "integrity": "sha512-p5I5Tpoug9aOVGg4kQETMJ8xquY66mX9XI19kXkkAFnmDhDXwSF+1jq1OjBGz7h27TAulM3k2wLEJPvickTt0A==", + "es-abstract": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", "dev": true, "requires": { - "axios": "^0.17.0", - "brotli-size": "0.0.1", - "bytes": "^3.0.0", - "ci-env": "^1.4.0", - "commander": "^2.11.0", - "github-build": "^1.2.0", - "glob": "^7.1.2", - "gzip-size": "^4.0.0", - "prettycli": "^1.4.3", - "read-pkg-up": "^3.0.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - } - } + "es-to-primitive": "^1.2.0", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-keys": "^1.0.12" } }, - "bytes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "escodegen": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.1.tgz", + "integrity": "sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw==", "dev": true, "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true + } } }, - "callsites": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.0.0.tgz", - "integrity": "sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw==", + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", "dev": true }, - "caniuse-lite": { - "version": "1.0.30000948", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000948.tgz", - "integrity": "sha512-Lw4y7oz1X5MOMZm+2IFaSISqVVQvUuD+ZUSfeYK/SlYiMjkHN/eJ2PDfJehW5NA6JjrxYSSnIWfwjeObQMEjFQ==", + "estree-walker": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.0.tgz", + "integrity": "sha512-peq1RfVAVzr3PU/jL31RaOjUKLoZJpObQWJJ+LgfcxDUifyLZ1RjPQZTl0pzj2uJ45b7A7XpyppXvxdEqzo4rw==", "dev": true }, - "capture-exit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", - "integrity": "sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==", - "dev": true, - "requires": { - "rsvp": "^4.8.4" - } - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "change-emitter": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/change-emitter/-/change-emitter-0.1.6.tgz", - "integrity": "sha1-6LL+PX8at9aaMhma/5HqaTFAlRU=", + "exec-sh": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.2.tgz", + "integrity": "sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg==", "dev": true }, - "cheerio": { - "version": "1.0.0-rc.2", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.2.tgz", - "integrity": "sha1-S59TqBsn5NXawxwP/Qz6A8xoMNs=", + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", "dev": true, "requires": { - "css-select": "~1.2.0", - "dom-serializer": "~0.1.0", - "entities": "~1.1.1", - "htmlparser2": "^3.9.1", - "lodash": "^4.15.0", - "parse5": "^3.0.1" + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" } }, - "chownr": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", - "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", - "dev": true - }, - "ci-env": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ci-env/-/ci-env-1.7.0.tgz", - "integrity": "sha512-ifHfV5JmACoTnoPxwjKjUUAekL1UCKZ9EU27GaaSkLVopkV3H1w0eYIpY+aAiX31SVEtTrZFMS94EFETSj0vIA==", - "dev": true - }, - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", "dev": true }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { - "arr-union": "^3.1.0", + "debug": "^2.3.3", "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -2472,1051 +2178,915 @@ "requires": { "is-descriptor": "^0.1.0" } - } - } - }, - "cli-boxes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", - "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", - "dev": true - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "is-extendable": "^0.1.0" } } } }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "expand-template": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-1.1.1.tgz", + "integrity": "sha512-cebqLtV8KOZfw0UI8TEFWxtczxxC1jvyUvx6H4fyp1K1FN7A4Q+uggVUlOsI1K8AGU0rwOGqP8nCapdrw8CYQg==", "dev": true }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "expect": { + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/expect/-/expect-24.7.1.tgz", + "integrity": "sha512-mGfvMTPduksV3xoI0xur56pQsg2vJjNf5+a+bXOjqCkiCBbmCayrBbHS/75y9K430cfqyocPr2ZjiNiRx4SRKw==", "dev": true, "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" + "@jest/types": "^24.7.0", + "ansi-styles": "^3.2.0", + "jest-get-type": "^24.3.0", + "jest-matcher-utils": "^24.7.0", + "jest-message-util": "^24.7.1", + "jest-regex-util": "^24.3.0" } }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "dev": true, "requires": { - "color-name": "1.1.3" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } } }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "colors": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", - "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==", - "dev": true - }, - "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { - "delayed-stream": "~1.0.0" + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } } }, - "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", - "dev": true - }, - "compare-versions": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.4.0.tgz", - "integrity": "sha512-tK69D7oNXXqUW3ZNo/z7NXTEz22TCF0pTE+YF9cxvaAM9XnkLo1fV621xCLrRR6aevJlKxExkss0vWqUCUpqdg==", + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", "dev": true }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", "dev": true }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", "dev": true }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "fb-watchman": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.0.tgz", + "integrity": "sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=", "dev": true, "requires": { - "safe-buffer": "~5.1.1" + "bser": "^2.0.0" } }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "core-js": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz", - "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==", - "dev": true + "fbjs": { + "version": "0.8.17", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.17.tgz", + "integrity": "sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=", + "dev": true, + "requires": { + "core-js": "^1.0.0", + "isomorphic-fetch": "^2.1.1", + "loose-envify": "^1.0.0", + "object-assign": "^4.1.0", + "promise": "^7.1.1", + "setimmediate": "^1.0.5", + "ua-parser-js": "^0.7.18" + } }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true + "fileset": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz", + "integrity": "sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA=", + "dev": true, + "requires": { + "glob": "^7.0.3", + "minimatch": "^3.0.3" + } }, - "coveralls": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.3.tgz", - "integrity": "sha512-viNfeGlda2zJr8Gj1zqXpDMRjw9uM54p7wzZdvLRyOgnAfCe974Dq4veZkjJdxQXbmdppu6flEajFYseHYaUhg==", + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { - "growl": "~> 1.10.0", - "js-yaml": "^3.11.0", - "lcov-parse": "^0.0.10", - "log-driver": "^1.2.7", - "minimist": "^1.2.0", - "request": "^2.86.0" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" }, "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } } } }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "locate-path": "^3.0.0" } }, - "css-select": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", - "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", + "follow-redirects": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.7.0.tgz", + "integrity": "sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ==", "dev": true, "requires": { - "boolbase": "~1.0.0", - "css-what": "2.1", - "domutils": "1.5.1", - "nth-check": "~1.0.1" + "debug": "^3.2.6" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } } }, - "css-what": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", - "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==", - "dev": true - }, - "cssom": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.6.tgz", - "integrity": "sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A==", + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, - "cssstyle": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.2.1.tgz", - "integrity": "sha512-7DYm8qe+gPx/h77QlCyFmX80+fGaE/6A/Ekl0zaszYOubvySO2saYFdQ78P29D0UsULxFKCetDGNaNRUdSF+2A==", - "dev": true, - "requires": { - "cssom": "0.3.x" - } - }, - "csstype": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.3.tgz", - "integrity": "sha512-rINUZXOkcBmoHWEyu7JdHu5JMzkGRoMX4ov9830WNgxf5UYxcBUO0QTKAqeJ5EZfSdlrcJYkC8WwfVW7JYi4yg==", + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", "dev": true }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "data-urls": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", - "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==", + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dev": true, "requires": { - "abab": "^2.0.0", - "whatwg-mimetype": "^2.2.0", - "whatwg-url": "^7.0.0" - }, - "dependencies": { - "whatwg-url": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", - "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", - "dev": true, - "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - } + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" } }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, "requires": { - "ms": "2.0.0" + "map-cache": "^0.2.2" } }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", "dev": true }, - "decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", - "dev": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, - "deep-assign": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/deep-assign/-/deep-assign-2.0.0.tgz", - "integrity": "sha1-6+BrHwfwja5ZdiDj3RYi83GhxXI=", + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", "dev": true, "requires": { - "is-obj": "^1.0.0" + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" } }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "default-require-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", - "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", - "dev": true, - "requires": { - "strip-bom": "^3.0.0" - } - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "requires": { - "object-keys": "^1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "fsevents": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz", + "integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==", "dev": true, + "optional": true, "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" + "nan": "^2.9.2", + "node-pre-gyp": "^0.10.0" }, "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "optional": true + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "dev": true, + "optional": true, "requires": { - "kind-of": "^6.0.0" + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" } }, - "is-data-descriptor": { + "balanced-match": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true, + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "optional": true, "requires": { - "kind-of": "^6.0.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "is-descriptor": { + "chownr": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", + "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true, + "optional": true + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true, + "optional": true + }, + "core-util-is": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true, + "optional": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "optional": true, "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" + "ms": "2.0.0" } - } - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "dev": true - }, - "detect-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", - "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - }, - "detect-libc": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-0.2.0.tgz", - "integrity": "sha1-R/31ZzSKF+wl/L8LnkRjSKdvn7U=", - "dev": true - }, - "detect-newline": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", - "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", - "dev": true - }, - "diff-sequences": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.3.0.tgz", - "integrity": "sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw==", - "dev": true - }, - "discontinuous-range": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz", - "integrity": "sha1-44Mx8IRLukm5qctxx3FYWqsbxlo=", - "dev": true - }, - "dom-serializer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", - "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", - "dev": true, - "requires": { - "domelementtype": "^1.3.0", - "entities": "^1.1.1" - } - }, - "dom-walk": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz", - "integrity": "sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg=", - "dev": true - }, - "domelementtype": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", - "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", - "dev": true - }, - "domexception": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", - "dev": true, - "requires": { - "webidl-conversions": "^4.0.2" - } - }, - "domhandler": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", - "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", - "dev": true, - "requires": { - "domelementtype": "1" - } - }, - "domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", - "dev": true, - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, - "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", - "dev": true - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "electron-to-chromium": { - "version": "1.3.116", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.116.tgz", - "integrity": "sha512-NKwKAXzur5vFCZYBHpdWjTMO8QptNLNP80nItkSIgUOapPAo9Uia+RvkCaZJtO7fhQaVElSvBPWEc2ku6cKsPA==", - "dev": true - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "encoding": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", - "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", - "dev": true, - "requires": { - "iconv-lite": "~0.4.13" - } - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "entities": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", - "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", - "dev": true - }, - "enzyme": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/enzyme/-/enzyme-3.9.0.tgz", - "integrity": "sha512-JqxI2BRFHbmiP7/UFqvsjxTirWoM1HfeaJrmVSZ9a1EADKkZgdPcAuISPMpoUiHlac9J4dYt81MC5BBIrbJGMg==", - "dev": true, - "requires": { - "array.prototype.flat": "^1.2.1", - "cheerio": "^1.0.0-rc.2", - "function.prototype.name": "^1.1.0", - "has": "^1.0.3", - "html-element-map": "^1.0.0", - "is-boolean-object": "^1.0.0", - "is-callable": "^1.1.4", - "is-number-object": "^1.0.3", - "is-regex": "^1.0.4", - "is-string": "^1.0.4", - "is-subset": "^0.1.1", - "lodash.escape": "^4.0.1", - "lodash.isequal": "^4.5.0", - "object-inspect": "^1.6.0", - "object-is": "^1.0.1", - "object.assign": "^4.1.0", - "object.entries": "^1.0.4", - "object.values": "^1.0.4", - "raf": "^3.4.0", - "rst-selector-parser": "^2.2.3", - "string.prototype.trim": "^1.1.2" - } - }, - "enzyme-adapter-react-16": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.11.2.tgz", - "integrity": "sha512-2ruTTCPRb0lPuw/vKTXGVZVBZqh83MNDnakMhzxhpJcIbneEwNy2Cv0KvL97pl57/GOazJHflWNLjwWhex5AAA==", - "dev": true, - "requires": { - "enzyme-adapter-utils": "^1.10.1", - "object.assign": "^4.1.0", - "object.values": "^1.1.0", - "prop-types": "^15.7.2", - "react-is": "^16.8.4", - "react-test-renderer": "^16.0.0-0", - "semver": "^5.6.0" - } - }, - "enzyme-adapter-utils": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/enzyme-adapter-utils/-/enzyme-adapter-utils-1.10.1.tgz", - "integrity": "sha512-oasinhhLoBuZsIkTe8mx0HiudtfErUtG0Ooe1FOplu/t4c9rOmyG5gtrBASK6u4whHIRWvv0cbZMElzNTR21SA==", - "dev": true, - "requires": { - "function.prototype.name": "^1.1.0", - "object.assign": "^4.1.0", - "object.fromentries": "^2.0.0", - "prop-types": "^15.7.2", - "semver": "^5.6.0" - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es-abstract": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", - "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.0", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "is-callable": "^1.1.4", - "is-regex": "^1.0.4", - "object-keys": "^1.0.12" - } - }, - "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "escodegen": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.1.tgz", - "integrity": "sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw==", - "dev": true, - "requires": { - "esprima": "^3.1.3", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", - "dev": true }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true, "optional": true - } - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", - "dev": true - }, - "estree-walker": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", - "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", - "dev": true - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, - "event-stream": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", - "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", - "dev": true, - "requires": { - "duplexer": "~0.1.1", - "from": "~0", - "map-stream": "~0.1.0", - "pause-stream": "0.0.11", - "split": "0.3", - "stream-combiner": "~0.0.4", - "through": "~2.3.1" - } - }, - "exec-sh": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.2.tgz", - "integrity": "sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg==", - "dev": true - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "dependencies": { - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", + "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "dev": true, + "optional": true, "requires": { - "pump": "^3.0.0" + "minipass": "^2.2.1" } }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, + "optional": true, "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" } - } - } - }, - "exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", - "dev": true - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, + "optional": true, "requires": { - "is-descriptor": "^0.1.0" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } - } - } - }, - "expand-template": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-1.1.1.tgz", - "integrity": "sha512-cebqLtV8KOZfw0UI8TEFWxtczxxC1jvyUvx6H4fyp1K1FN7A4Q+uggVUlOsI1K8AGU0rwOGqP8nCapdrw8CYQg==", - "dev": true - }, - "expect": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-24.5.0.tgz", - "integrity": "sha512-p2Gmc0CLxOgkyA93ySWmHFYHUPFIHG6XZ06l7WArWAsrqYVaVEkOU5NtT5i68KUyGKbkQgDCkiT65bWmdoL6Bw==", - "dev": true, - "requires": { - "@jest/types": "^24.5.0", - "ansi-styles": "^3.2.0", - "jest-get-type": "^24.3.0", - "jest-matcher-utils": "^24.5.0", - "jest-message-util": "^24.5.0", - "jest-regex-util": "^24.3.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true, + "optional": true + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "optional": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true, + "optional": true + }, + "minipass": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", + "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", + "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "optional": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + }, + "needle": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.4.tgz", + "integrity": "sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==", + "dev": true, + "optional": true, + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz", + "integrity": "sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A==", + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz", + "integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==", + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.2.0.tgz", + "integrity": "sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ==", + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, + "optional": true, "requires": { - "color-convert": "^1.9.0" + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" } - } - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, + "optional": true, "requires": { - "is-descriptor": "^1.0.0" + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true, + "optional": true + } } }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, + "optional": true, "requires": { - "kind-of": "^6.0.0" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, + "optional": true, "requires": { - "kind-of": "^6.0.0" + "glob": "^7.1.3" } }, - "is-descriptor": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true, + "optional": true + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true, + "optional": true + }, + "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, + "optional": true, "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } - } - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "fb-watchman": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.0.tgz", - "integrity": "sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=", - "dev": true, - "requires": { - "bser": "^2.0.0" - } - }, - "fbjs": { - "version": "0.8.17", - "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.17.tgz", - "integrity": "sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=", - "dev": true, - "requires": { - "core-js": "^1.0.0", - "isomorphic-fetch": "^2.1.1", - "loose-envify": "^1.0.0", - "object-assign": "^4.1.0", - "promise": "^7.1.1", - "setimmediate": "^1.0.5", - "ua-parser-js": "^0.7.18" - }, - "dependencies": { - "core-js": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", - "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=", - "dev": true - } - } - }, - "fileset": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz", - "integrity": "sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA=", - "dev": true, - "requires": { - "glob": "^7.0.3", - "minimatch": "^3.0.3" - } - }, - "filesize": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/filesize/-/filesize-3.6.1.tgz", - "integrity": "sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg==", - "dev": true - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "follow-redirects": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.7.0.tgz", - "integrity": "sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ==", - "dev": true, - "requires": { - "debug": "^3.2.6" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, + "optional": true, "requires": { - "ms": "^2.1.1" + "safe-buffer": "~5.1.0" } }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - } - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "from": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", - "dev": true - }, - "fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true - }, - "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "optional": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.8", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", + "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true, + "optional": true + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", + "dev": true, + "optional": true + } } }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, "fstream": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", @@ -3560,6 +3130,43 @@ "string-width": "^1.0.1", "strip-ansi": "^3.0.1", "wide-align": "^1.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } } }, "get-caller-file": { @@ -3569,10 +3176,13 @@ "dev": true }, "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } }, "get-value": { "version": "2.0.6", @@ -3638,20 +3248,10 @@ "path-is-absolute": "^1.0.0" } }, - "global": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", - "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", - "dev": true, - "requires": { - "min-document": "^2.19.0", - "process": "~0.5.1" - } - }, "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", + "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", "dev": true }, "graceful-fs": { @@ -3661,9 +3261,9 @@ "dev": true }, "graphql": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-14.1.1.tgz", - "integrity": "sha512-C5zDzLqvfPAgTtP8AUPIt9keDabrdRAqSWjj2OPRKrKxI9Fb65I36s1uCs1UUBFnSWTdO7hyHi7z1ZbwKMKF6Q==", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-14.2.1.tgz", + "integrity": "sha512-2PL1UbvKeSjy/lUeJqHk+eR9CvuErXoCNwJI4jm3oNFEeY+9ELqHNKO1ZuSxAkasPkpWbmT/iMRMFxd3cEL3tQ==", "dev": true, "requires": { "iterall": "^1.2.2" @@ -3675,12 +3275,6 @@ "integrity": "sha512-jApXqWBzNXQ8jYa/HLkZJaVw9jgwNqZkywa2zfFn16Iv1Zb7ELNHkJaXHR7Quvd5SIGsy6Ny7SUKATgnu05uEg==", "dev": true }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, "growly": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", @@ -3698,23 +3292,15 @@ } }, "handlebars": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.0.tgz", - "integrity": "sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.1.tgz", + "integrity": "sha512-3Zhi6C0euYZL5sM0Zcy7lInLXKQ+YLcF/olbN010mzGQ4XVm50JeyBnMqofHh696GrciGruC7kCcApPDJvVgwA==", "dev": true, "requires": { - "async": "^2.5.0", + "neo-async": "^2.6.0", "optimist": "^0.6.1", "source-map": "^0.6.1", "uglify-js": "^3.1.4" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } } }, "har-schema": { @@ -3742,15 +3328,6 @@ "function-bind": "^1.1.1" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -3809,16 +3386,6 @@ "react-is": "^16.7.0" } }, - "home-or-tmp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", - "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", - "dev": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.1" - } - }, "hosted-git-info": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", @@ -3826,9 +3393,9 @@ "dev": true }, "html-element-map": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/html-element-map/-/html-element-map-1.0.0.tgz", - "integrity": "sha512-/SP6aOiM5Ai9zALvCxDubIeez0LvG3qP7R9GcRDnJEP/HBmv0A8A9K0o8+HFudcFt46+i921ANjzKsjPjb7Enw==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/html-element-map/-/html-element-map-1.0.1.tgz", + "integrity": "sha512-BZSfdEm6n706/lBfXKWa4frZRZcT5k1cOusw95ijZsHlI+GdgY0v95h6IzO3iIDf2ROwq570YTwqNPqHcNMozw==", "dev": true, "requires": { "array-filter": "^1.0.0" @@ -3855,19 +3422,6 @@ "entities": "^1.1.1", "inherits": "^2.0.1", "readable-stream": "^3.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.2.0.tgz", - "integrity": "sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } } }, "http-signature": { @@ -3955,6 +3509,12 @@ "loose-envify": "^1.0.0" } }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true + }, "is-accessor-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", @@ -4059,28 +3619,16 @@ "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", "dev": true }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true }, "is-generator-fn": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.0.0.tgz", - "integrity": "sha512-elzyIdM7iKoFHzcrndIqjYomImhxrFRnGP3galODoII4TB9gI7mZ+FnlLQmmjf27SxHS2gKEeyhX5/+YRS6H9g==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", "dev": true }, "is-module": { @@ -4115,12 +3663,6 @@ "integrity": "sha1-8mWrian0RQNO9q/xWo8AsA9VF5k=", "dev": true }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "dev": true - }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -4210,18 +3752,6 @@ "requires": { "node-fetch": "^1.0.1", "whatwg-fetch": ">=0.10.0" - }, - "dependencies": { - "node-fetch": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", - "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", - "dev": true, - "requires": { - "encoding": "^0.1.11", - "is-stream": "^1.0.1" - } - } } }, "isstream": { @@ -4289,350 +3819,144 @@ "requires": { "istanbul-lib-coverage": "^2.0.3", "make-dir": "^1.3.0", - "supports-color": "^6.0.0" - }, - "dependencies": { - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.2.tgz", - "integrity": "sha512-JX4v0CiKTGp9fZPmoxpu9YEkPbEqCqBbO3403VabKjH+NRXo72HafD5UgnjTEqHL2SAjaZK1XDuDOkn6I5QVfQ==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.3", - "make-dir": "^1.3.0", - "rimraf": "^2.6.2", - "source-map": "^0.6.1" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "istanbul-reports": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.1.1.tgz", - "integrity": "sha512-FzNahnidyEPBCI0HcufJoSEoKykesRlFcSzQqjH9x0+LC8tnnE/p/90PBLu8iZTxr8yYZNyTtiAujUqyN+CIxw==", - "dev": true, - "requires": { - "handlebars": "^4.1.0" - } - }, - "iterall": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/iterall/-/iterall-1.2.2.tgz", - "integrity": "sha512-yynBb1g+RFUPY64fTrFv7nsjRrENBQJaX2UL+2Szc9REFrSNm1rpSXHGzhmAy7a9uv3vlvgBlXnf9RqmPH1/DA==", - "dev": true - }, - "jest": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-24.5.0.tgz", - "integrity": "sha512-lxL+Fq5/RH7inxxmfS2aZLCf8MsS+YCUBfeiNO6BWz/MmjhDGaIEA/2bzEf9q4Q0X+mtFHiinHFvQ0u+RvW/qQ==", - "dev": true, - "requires": { - "import-local": "^2.0.0", - "jest-cli": "^24.5.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "camelcase": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz", - "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "jest-cli": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.5.0.tgz", - "integrity": "sha512-P+Jp0SLO4KWN0cGlNtC7JV0dW1eSFR7eRpoOucP2UM0sqlzp/bVHeo71Omonvigrj9AvCKy7NtQANtqJ7FXz8g==", - "dev": true, - "requires": { - "@jest/core": "^24.5.0", - "@jest/test-result": "^24.5.0", - "@jest/types": "^24.5.0", - "chalk": "^2.0.1", - "exit": "^0.1.2", - "import-local": "^2.0.0", - "is-ci": "^2.0.0", - "jest-config": "^24.5.0", - "jest-util": "^24.5.0", - "jest-validate": "^24.5.0", - "prompts": "^2.0.1", - "realpath-native": "^1.1.0", - "yargs": "^12.0.2" - } - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "mem": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.2.0.tgz", - "integrity": "sha512-5fJxa68urlY0Ir8ijatKa3eRz5lwXnRCTvo9+TbTGAuTFJOwpGcY0X05moBd0nW45965Njt4CDI2GFQoG8DvqA==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - } - }, - "mimic-fn": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.0.0.tgz", - "integrity": "sha512-jbex9Yd/3lmICXwYT6gA/j2mNQGU48wCh/VzRd+/Y/PjYQtlg1gLMdZqvu9s/xH7qKvngxRObl56XZR609IMbA==", - "dev": true - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, + "supports-color": "^6.0.0" + }, + "dependencies": { "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", "dev": true, "requires": { "has-flag": "^3.0.0" } - }, - "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + } + } + }, + "istanbul-lib-source-maps": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.2.tgz", + "integrity": "sha512-JX4v0CiKTGp9fZPmoxpu9YEkPbEqCqBbO3403VabKjH+NRXo72HafD5UgnjTEqHL2SAjaZK1XDuDOkn6I5QVfQ==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^2.0.3", + "make-dir": "^1.3.0", + "rimraf": "^2.6.2", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" + "ms": "^2.1.1" } }, - "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.1.1.tgz", + "integrity": "sha512-FzNahnidyEPBCI0HcufJoSEoKykesRlFcSzQqjH9x0+LC8tnnE/p/90PBLu8iZTxr8yYZNyTtiAujUqyN+CIxw==", + "dev": true, + "requires": { + "handlebars": "^4.1.0" + } + }, + "iterall": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/iterall/-/iterall-1.2.2.tgz", + "integrity": "sha512-yynBb1g+RFUPY64fTrFv7nsjRrENBQJaX2UL+2Szc9REFrSNm1rpSXHGzhmAy7a9uv3vlvgBlXnf9RqmPH1/DA==", + "dev": true + }, + "jest": { + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/jest/-/jest-24.7.1.tgz", + "integrity": "sha512-AbvRar5r++izmqo5gdbAjTeA6uNRGoNRuj5vHB0OnDXo2DXWZJVuaObiGgtlvhKb+cWy2oYbQSfxv7Q7GjnAtA==", + "dev": true, + "requires": { + "import-local": "^2.0.0", + "jest-cli": "^24.7.1" + }, + "dependencies": { + "jest-cli": { + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.7.1.tgz", + "integrity": "sha512-32OBoSCVPzcTslGFl6yVCMzB2SqX3IrWwZCY5mZYkb0D2WsogmU3eV2o8z7+gRQa4o4sZPX/k7GU+II7CxM6WQ==", "dev": true, "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "@jest/core": "^24.7.1", + "@jest/test-result": "^24.7.1", + "@jest/types": "^24.7.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "import-local": "^2.0.0", + "is-ci": "^2.0.0", + "jest-config": "^24.7.1", + "jest-util": "^24.7.1", + "jest-validate": "^24.7.0", + "prompts": "^2.0.1", + "realpath-native": "^1.1.0", + "yargs": "^12.0.2" } } } }, "jest-changed-files": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.5.0.tgz", - "integrity": "sha512-Ikl29dosYnTsH9pYa1Tv9POkILBhN/TLZ37xbzgNsZ1D2+2n+8oEZS2yP1BrHn/T4Rs4Ggwwbp/x8CKOS5YJOg==", + "version": "24.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.7.0.tgz", + "integrity": "sha512-33BgewurnwSfJrW7T5/ZAXGE44o7swLslwh8aUckzq2e17/2Os1V0QU506ZNik3hjs8MgnEMKNkcud442NCDTw==", "dev": true, "requires": { - "@jest/types": "^24.5.0", + "@jest/types": "^24.7.0", "execa": "^1.0.0", "throat": "^4.0.0" } }, "jest-config": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.5.0.tgz", - "integrity": "sha512-t2UTh0Z2uZhGBNVseF8wA2DS2SuBiLOL6qpLq18+OZGfFUxTM7BzUVKyHFN/vuN+s/aslY1COW95j1Rw81huOQ==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.7.1.tgz", + "integrity": "sha512-8FlJNLI+X+MU37j7j8RE4DnJkvAghXmBWdArVzypW6WxfGuxiL/CCkzBg0gHtXhD2rxla3IMOSUAHylSKYJ83g==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/types": "^24.5.0", - "babel-jest": "^24.5.0", + "@jest/test-sequencer": "^24.7.1", + "@jest/types": "^24.7.0", + "babel-jest": "^24.7.1", "chalk": "^2.0.1", "glob": "^7.1.1", - "jest-environment-jsdom": "^24.5.0", - "jest-environment-node": "^24.5.0", + "jest-environment-jsdom": "^24.7.1", + "jest-environment-node": "^24.7.1", "jest-get-type": "^24.3.0", - "jest-jasmine2": "^24.5.0", + "jest-jasmine2": "^24.7.1", "jest-regex-util": "^24.3.0", - "jest-resolve": "^24.5.0", - "jest-util": "^24.5.0", - "jest-validate": "^24.5.0", + "jest-resolve": "^24.7.1", + "jest-util": "^24.7.1", + "jest-validate": "^24.7.0", "micromatch": "^3.1.10", - "pretty-format": "^24.5.0", + "pretty-format": "^24.7.0", "realpath-native": "^1.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "jest-diff": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.5.0.tgz", - "integrity": "sha512-mCILZd9r7zqL9Uh6yNoXjwGQx0/J43OD2vvWVKwOEOLZliQOsojXwqboubAQ+Tszrb6DHGmNU7m4whGeB9YOqw==", + "version": "24.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.7.0.tgz", + "integrity": "sha512-ULQZ5B1lWpH70O4xsANC4tf4Ko6RrpwhE3PtG6ERjMg1TiYTC2Wp4IntJVGro6a8HG9luYHhhmF4grF0Pltckg==", "dev": true, "requires": { "chalk": "^2.0.1", "diff-sequences": "^24.3.0", "jest-get-type": "^24.3.0", - "pretty-format": "^24.5.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "pretty-format": "^24.7.0" } }, "jest-docblock": { @@ -4645,116 +3969,43 @@ } }, "jest-each": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-24.5.0.tgz", - "integrity": "sha512-6gy3Kh37PwIT5sNvNY2VchtIFOOBh8UCYnBlxXMb5sr5wpJUDPTUATX2Axq1Vfk+HWTMpsYPeVYp4TXx5uqUBw==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-24.7.1.tgz", + "integrity": "sha512-4fsS8fEfLa3lfnI1Jw6NxjhyRTgfpuOVTeUZZFyVYqeTa4hPhr2YkToUhouuLTrL2eMGOfpbdMyRx0GQ/VooKA==", "dev": true, "requires": { - "@jest/types": "^24.5.0", + "@jest/types": "^24.7.0", "chalk": "^2.0.1", "jest-get-type": "^24.3.0", - "jest-util": "^24.5.0", - "pretty-format": "^24.5.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "jest-util": "^24.7.1", + "pretty-format": "^24.7.0" } }, "jest-environment-jsdom": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.5.0.tgz", - "integrity": "sha512-62Ih5HbdAWcsqBx2ktUnor/mABBo1U111AvZWcLKeWN/n/gc5ZvDBKe4Og44fQdHKiXClrNGC6G0mBo6wrPeGQ==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.7.1.tgz", + "integrity": "sha512-Gnhb+RqE2JuQGb3kJsLF8vfqjt3PHKSstq4Xc8ic+ax7QKo4Z0RWGucU3YV+DwKR3T9SYc+3YCUQEJs8r7+Jxg==", "dev": true, "requires": { - "@jest/environment": "^24.5.0", - "@jest/fake-timers": "^24.5.0", - "@jest/types": "^24.5.0", - "jest-mock": "^24.5.0", - "jest-util": "^24.5.0", + "@jest/environment": "^24.7.1", + "@jest/fake-timers": "^24.7.1", + "@jest/types": "^24.7.0", + "jest-mock": "^24.7.0", + "jest-util": "^24.7.1", "jsdom": "^11.5.1" - }, - "dependencies": { - "jsdom": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", - "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", - "dev": true, - "requires": { - "abab": "^2.0.0", - "acorn": "^5.5.3", - "acorn-globals": "^4.1.0", - "array-equal": "^1.0.0", - "cssom": ">= 0.3.2 < 0.4.0", - "cssstyle": "^1.0.0", - "data-urls": "^1.0.0", - "domexception": "^1.0.1", - "escodegen": "^1.9.1", - "html-encoding-sniffer": "^1.0.2", - "left-pad": "^1.3.0", - "nwsapi": "^2.0.7", - "parse5": "4.0.0", - "pn": "^1.1.0", - "request": "^2.87.0", - "request-promise-native": "^1.0.5", - "sax": "^1.2.4", - "symbol-tree": "^3.2.2", - "tough-cookie": "^2.3.4", - "w3c-hr-time": "^1.0.1", - "webidl-conversions": "^4.0.2", - "whatwg-encoding": "^1.0.3", - "whatwg-mimetype": "^2.1.0", - "whatwg-url": "^6.4.1", - "ws": "^5.2.0", - "xml-name-validator": "^3.0.0" - } - }, - "parse5": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", - "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", - "dev": true - } } }, "jest-environment-node": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.5.0.tgz", - "integrity": "sha512-du6FuyWr/GbKLsmAbzNF9mpr2Iu2zWSaq/BNHzX+vgOcts9f2ayXBweS7RAhr+6bLp6qRpMB6utAMF5Ygktxnw==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.7.1.tgz", + "integrity": "sha512-GJJQt1p9/C6aj6yNZMvovZuxTUd+BEJprETdvTKSb4kHcw4mFj8777USQV0FJoJ4V3djpOwA5eWyPwfq//PFBA==", "dev": true, "requires": { - "@jest/environment": "^24.5.0", - "@jest/fake-timers": "^24.5.0", - "@jest/types": "^24.5.0", - "jest-mock": "^24.5.0", - "jest-util": "^24.5.0" + "@jest/environment": "^24.7.1", + "@jest/fake-timers": "^24.7.1", + "@jest/types": "^24.7.0", + "jest-mock": "^24.7.0", + "jest-util": "^24.7.1" } }, "jest-get-type": { @@ -4764,75 +4015,47 @@ "dev": true }, "jest-haste-map": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.5.0.tgz", - "integrity": "sha512-mb4Yrcjw9vBgSvobDwH8QUovxApdimGcOkp+V1ucGGw4Uvr3VzZQBJhNm1UY3dXYm4XXyTW2G7IBEZ9pM2ggRQ==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.7.1.tgz", + "integrity": "sha512-g0tWkzjpHD2qa03mTKhlydbmmYiA2KdcJe762SbfFo/7NIMgBWAA0XqQlApPwkWOF7Cxoi/gUqL0i6DIoLpMBw==", "dev": true, "requires": { - "@jest/types": "^24.5.0", + "@jest/types": "^24.7.0", + "anymatch": "^2.0.0", "fb-watchman": "^2.0.0", + "fsevents": "^1.2.7", "graceful-fs": "^4.1.15", "invariant": "^2.2.4", "jest-serializer": "^24.4.0", - "jest-util": "^24.5.0", - "jest-worker": "^24.4.0", + "jest-util": "^24.7.1", + "jest-worker": "^24.6.0", "micromatch": "^3.1.10", - "sane": "^4.0.3" + "sane": "^4.0.3", + "walker": "^1.0.7" } }, "jest-jasmine2": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.5.0.tgz", - "integrity": "sha512-sfVrxVcx1rNUbBeyIyhkqZ4q+seNKyAG6iM0S2TYBdQsXjoFDdqWFfsUxb6uXSsbimbXX/NMkJIwUZ1uT9+/Aw==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.7.1.tgz", + "integrity": "sha512-Y/9AOJDV1XS44wNwCaThq4Pw3gBPiOv/s6NcbOAkVRRUEPu+36L2xoPsqQXsDrxoBerqeyslpn2TpCI8Zr6J2w==", "dev": true, "requires": { "@babel/traverse": "^7.1.0", - "@jest/environment": "^24.5.0", - "@jest/test-result": "^24.5.0", - "@jest/types": "^24.5.0", + "@jest/environment": "^24.7.1", + "@jest/test-result": "^24.7.1", + "@jest/types": "^24.7.0", "chalk": "^2.0.1", "co": "^4.6.0", - "expect": "^24.5.0", + "expect": "^24.7.1", "is-generator-fn": "^2.0.0", - "jest-each": "^24.5.0", - "jest-matcher-utils": "^24.5.0", - "jest-message-util": "^24.5.0", - "jest-runtime": "^24.5.0", - "jest-snapshot": "^24.5.0", - "jest-util": "^24.5.0", - "pretty-format": "^24.5.0", + "jest-each": "^24.7.1", + "jest-matcher-utils": "^24.7.0", + "jest-message-util": "^24.7.1", + "jest-runtime": "^24.7.1", + "jest-snapshot": "^24.7.1", + "jest-util": "^24.7.1", + "pretty-format": "^24.7.0", "throat": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "jest-junit": { @@ -4865,117 +4088,49 @@ } }, "jest-leak-detector": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.5.0.tgz", - "integrity": "sha512-LZKBjGovFRx3cRBkqmIg+BZnxbrLqhQl09IziMk3oeh1OV81Hg30RUIx885mq8qBv1PA0comB9bjKcuyNO1bCQ==", + "version": "24.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.7.0.tgz", + "integrity": "sha512-zV0qHKZGXtmPVVzT99CVEcHE9XDf+8LwiE0Ob7jjezERiGVljmqKFWpV2IkG+rkFIEUHFEkMiICu7wnoPM/RoQ==", "dev": true, "requires": { - "pretty-format": "^24.5.0" + "pretty-format": "^24.7.0" } }, "jest-matcher-utils": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.5.0.tgz", - "integrity": "sha512-QM1nmLROjLj8GMGzg5VBra3I9hLpjMPtF1YqzQS3rvWn2ltGZLrGAO1KQ9zUCVi5aCvrkbS5Ndm2evIP9yZg1Q==", + "version": "24.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.7.0.tgz", + "integrity": "sha512-158ieSgk3LNXeUhbVJYRXyTPSCqNgVXOp/GT7O94mYd3pk/8+odKTyR1JLtNOQSPzNi8NFYVONtvSWA/e1RDXg==", "dev": true, "requires": { "chalk": "^2.0.1", - "jest-diff": "^24.5.0", + "jest-diff": "^24.7.0", "jest-get-type": "^24.3.0", - "pretty-format": "^24.5.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "pretty-format": "^24.7.0" } }, "jest-message-util": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.5.0.tgz", - "integrity": "sha512-6ZYgdOojowCGiV0D8WdgctZEAe+EcFU+KrVds+0ZjvpZurUW2/oKJGltJ6FWY2joZwYXN5VL36GPV6pNVRqRnQ==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.7.1.tgz", + "integrity": "sha512-dk0gqVtyqezCHbcbk60CdIf+8UHgD+lmRHifeH3JRcnAqh4nEyPytSc9/L1+cQyxC+ceaeP696N4ATe7L+omcg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@jest/test-result": "^24.5.0", - "@jest/types": "^24.5.0", + "@jest/test-result": "^24.7.1", + "@jest/types": "^24.7.0", "@types/stack-utils": "^1.0.1", "chalk": "^2.0.1", "micromatch": "^3.1.10", "slash": "^2.0.0", "stack-utils": "^1.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "jest-mock": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-24.5.0.tgz", - "integrity": "sha512-ZnAtkWrKf48eERgAOiUxVoFavVBziO2pAi2MfZ1+bGXVkDfxWLxU0//oJBkgwbsv6OAmuLBz4XFFqvCFMqnGUw==", + "version": "24.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-24.7.0.tgz", + "integrity": "sha512-6taW4B4WUcEiT2V9BbOmwyGuwuAFT2G8yghF7nyNW1/2gq5+6aTqSPcS9lS6ArvEkX55vbPAS/Jarx5LSm4Fng==", "dev": true, "requires": { - "@jest/types": "^24.5.0" + "@jest/types": "^24.7.0" } }, "jest-pnp-resolver": { @@ -4991,310 +4146,85 @@ "dev": true }, "jest-resolve": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.5.0.tgz", - "integrity": "sha512-ZIfGqLX1Rg8xJpQqNjdoO8MuxHV1q/i2OO1hLXjgCWFWs5bsedS8UrOdgjUqqNae6DXA+pCyRmdcB7lQEEbXew==", - "dev": true, - "requires": { - "@jest/types": "^24.5.0", - "browser-resolve": "^1.11.3", - "chalk": "^2.0.1", - "jest-pnp-resolver": "^1.2.1", - "realpath-native": "^1.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "jest-resolve-dependencies": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.5.0.tgz", - "integrity": "sha512-dRVM1D+gWrFfrq2vlL5P9P/i8kB4BOYqYf3S7xczZ+A6PC3SgXYSErX/ScW/469pWMboM1uAhgLF+39nXlirCQ==", - "dev": true, - "requires": { - "@jest/types": "^24.5.0", - "jest-regex-util": "^24.3.0", - "jest-snapshot": "^24.5.0" - } - }, - "jest-runner": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.5.0.tgz", - "integrity": "sha512-oqsiS9TkIZV5dVkD+GmbNfWBRPIvxqmlTQ+AQUJUQ07n+4xTSDc40r+aKBynHw9/tLzafC00DIbJjB2cOZdvMA==", - "dev": true, - "requires": { - "@jest/console": "^24.3.0", - "@jest/environment": "^24.5.0", - "@jest/test-result": "^24.5.0", - "@jest/types": "^24.5.0", - "chalk": "^2.4.2", - "exit": "^0.1.2", - "graceful-fs": "^4.1.15", - "jest-config": "^24.5.0", - "jest-docblock": "^24.3.0", - "jest-haste-map": "^24.5.0", - "jest-jasmine2": "^24.5.0", - "jest-leak-detector": "^24.5.0", - "jest-message-util": "^24.5.0", - "jest-resolve": "^24.5.0", - "jest-runtime": "^24.5.0", - "jest-util": "^24.5.0", - "jest-worker": "^24.4.0", - "source-map-support": "^0.5.6", - "throat": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.11", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.11.tgz", - "integrity": "sha512-//sajEx/fGL3iw6fltKMdPvy8kL3kJ2O3iuYlRoT3k9Kb4BjOoZ+BZzaNHeuaruSt+Kf3Zk9tnfAQg9/AJqUVQ==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.7.1.tgz", + "integrity": "sha512-Bgrc+/UUZpGJ4323sQyj85hV9d+ANyPNu6XfRDUcyFNX1QrZpSoM0kE4Mb2vZMAYTJZsBFzYe8X1UaOkOELSbw==", + "dev": true, + "requires": { + "@jest/types": "^24.7.0", + "browser-resolve": "^1.11.3", + "chalk": "^2.0.1", + "jest-pnp-resolver": "^1.2.1", + "realpath-native": "^1.1.0" + } + }, + "jest-resolve-dependencies": { + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.7.1.tgz", + "integrity": "sha512-2Eyh5LJB2liNzfk4eo7bD1ZyBbqEJIyyrFtZG555cSWW9xVHxII2NuOkSl1yUYTAYCAmM2f2aIT5A7HzNmubyg==", + "dev": true, + "requires": { + "@jest/types": "^24.7.0", + "jest-regex-util": "^24.3.0", + "jest-snapshot": "^24.7.1" + } + }, + "jest-runner": { + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.7.1.tgz", + "integrity": "sha512-aNFc9liWU/xt+G9pobdKZ4qTeG/wnJrJna3VqunziDNsWT3EBpmxXZRBMKCsNMyfy+A/XHiV+tsMLufdsNdgCw==", + "dev": true, + "requires": { + "@jest/console": "^24.7.1", + "@jest/environment": "^24.7.1", + "@jest/test-result": "^24.7.1", + "@jest/types": "^24.7.0", + "chalk": "^2.4.2", + "exit": "^0.1.2", + "graceful-fs": "^4.1.15", + "jest-config": "^24.7.1", + "jest-docblock": "^24.3.0", + "jest-haste-map": "^24.7.1", + "jest-jasmine2": "^24.7.1", + "jest-leak-detector": "^24.7.0", + "jest-message-util": "^24.7.1", + "jest-resolve": "^24.7.1", + "jest-runtime": "^24.7.1", + "jest-util": "^24.7.1", + "jest-worker": "^24.6.0", + "source-map-support": "^0.5.6", + "throat": "^4.0.0" } }, "jest-runtime": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.5.0.tgz", - "integrity": "sha512-GTFHzfLdwpaeoDPilNpBrorlPoNZuZrwKKzKJs09vWwHo+9TOsIIuszK8cWOuKC7ss07aN1922Ge8fsGdsqCuw==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.7.1.tgz", + "integrity": "sha512-0VAbyBy7tll3R+82IPJpf6QZkokzXPIS71aDeqh+WzPRXRCNz6StQ45otFariPdJ4FmXpDiArdhZrzNAC3sj6A==", "dev": true, "requires": { - "@jest/console": "^24.3.0", - "@jest/environment": "^24.5.0", + "@jest/console": "^24.7.1", + "@jest/environment": "^24.7.1", "@jest/source-map": "^24.3.0", - "@jest/transform": "^24.5.0", - "@jest/types": "^24.5.0", + "@jest/transform": "^24.7.1", + "@jest/types": "^24.7.0", "@types/yargs": "^12.0.2", "chalk": "^2.0.1", "exit": "^0.1.2", "glob": "^7.1.3", "graceful-fs": "^4.1.15", - "jest-config": "^24.5.0", - "jest-haste-map": "^24.5.0", - "jest-message-util": "^24.5.0", - "jest-mock": "^24.5.0", + "jest-config": "^24.7.1", + "jest-haste-map": "^24.7.1", + "jest-message-util": "^24.7.1", + "jest-mock": "^24.7.0", "jest-regex-util": "^24.3.0", - "jest-resolve": "^24.5.0", - "jest-snapshot": "^24.5.0", - "jest-util": "^24.5.0", - "jest-validate": "^24.5.0", + "jest-resolve": "^24.7.1", + "jest-snapshot": "^24.7.1", + "jest-util": "^24.7.1", + "jest-validate": "^24.7.0", "realpath-native": "^1.1.0", "slash": "^2.0.0", "strip-bom": "^3.0.0", "yargs": "^12.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "camelcase": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz", - "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "mem": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.2.0.tgz", - "integrity": "sha512-5fJxa68urlY0Ir8ijatKa3eRz5lwXnRCTvo9+TbTGAuTFJOwpGcY0X05moBd0nW45965Njt4CDI2GFQoG8DvqA==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - } - }, - "mimic-fn": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.0.0.tgz", - "integrity": "sha512-jbex9Yd/3lmICXwYT6gA/j2mNQGU48wCh/VzRd+/Y/PjYQtlg1gLMdZqvu9s/xH7qKvngxRObl56XZR609IMbA==", - "dev": true - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" - } - }, - "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } } }, "jest-serializer": { @@ -5304,68 +4234,36 @@ "dev": true }, "jest-snapshot": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.5.0.tgz", - "integrity": "sha512-eBEeJb5ROk0NcpodmSKnCVgMOo+Qsu5z9EDl3tGffwPzK1yV37mjGWF2YeIz1NkntgTzP+fUL4s09a0+0dpVWA==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.7.1.tgz", + "integrity": "sha512-8Xk5O4p+JsZZn4RCNUS3pxA+ORKpEKepE+a5ejIKrId9CwrVN0NY+vkqEkXqlstA5NMBkNahXkR/4qEBy0t5yA==", "dev": true, "requires": { "@babel/types": "^7.0.0", - "@jest/types": "^24.5.0", + "@jest/types": "^24.7.0", "chalk": "^2.0.1", - "expect": "^24.5.0", - "jest-diff": "^24.5.0", - "jest-matcher-utils": "^24.5.0", - "jest-message-util": "^24.5.0", - "jest-resolve": "^24.5.0", + "expect": "^24.7.1", + "jest-diff": "^24.7.0", + "jest-matcher-utils": "^24.7.0", + "jest-message-util": "^24.7.1", + "jest-resolve": "^24.7.1", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "pretty-format": "^24.5.0", + "pretty-format": "^24.7.0", "semver": "^5.5.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "jest-util": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.5.0.tgz", - "integrity": "sha512-Xy8JsD0jvBz85K7VsTIQDuY44s+hYJyppAhcsHsOsGisVtdhar6fajf2UOf2mEVEgh15ZSdA0zkCuheN8cbr1Q==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.7.1.tgz", + "integrity": "sha512-/KilOue2n2rZ5AnEBYoxOXkeTu6vi7cjgQ8MXEkih0oeAXT6JkS3fr7/j8+engCjciOU1Nq5loMSKe0A1oeX0A==", "dev": true, "requires": { - "@jest/console": "^24.3.0", - "@jest/fake-timers": "^24.5.0", + "@jest/console": "^24.7.1", + "@jest/fake-timers": "^24.7.1", "@jest/source-map": "^24.3.0", - "@jest/test-result": "^24.5.0", - "@jest/types": "^24.5.0", - "@types/node": "*", + "@jest/test-result": "^24.7.1", + "@jest/types": "^24.7.0", "callsites": "^3.0.0", "chalk": "^2.0.1", "graceful-fs": "^4.1.15", @@ -5373,156 +4271,43 @@ "mkdirp": "^0.5.1", "slash": "^2.0.0", "source-map": "^0.6.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "jest-validate": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.5.0.tgz", - "integrity": "sha512-gg0dYszxjgK2o11unSIJhkOFZqNRQbWOAB2/LOUdsd2LfD9oXiMeuee8XsT0iRy5EvSccBgB4h/9HRbIo3MHgQ==", + "version": "24.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.7.0.tgz", + "integrity": "sha512-cgai/gts9B2chz1rqVdmLhzYxQbgQurh1PEQSvSgPZ8KGa1AqXsqC45W5wKEwzxKrWqypuQrQxnF4+G9VejJJA==", "dev": true, "requires": { - "@jest/types": "^24.5.0", + "@jest/types": "^24.7.0", "camelcase": "^5.0.0", "chalk": "^2.0.1", "jest-get-type": "^24.3.0", "leven": "^2.1.0", - "pretty-format": "^24.5.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "camelcase": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz", - "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "pretty-format": "^24.7.0" } }, "jest-watcher": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.5.0.tgz", - "integrity": "sha512-/hCpgR6bg0nKvD3nv4KasdTxuhwfViVMHUATJlnGCD0r1QrmIssimPbmc5KfAQblAVxkD8xrzuij9vfPUk1/rA==", + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.7.1.tgz", + "integrity": "sha512-Wd6TepHLRHVKLNPacEsBwlp9raeBIO+01xrN24Dek4ggTS8HHnOzYSFnvp+6MtkkJ3KfMzy220KTi95e2rRkrw==", "dev": true, "requires": { - "@jest/test-result": "^24.5.0", - "@jest/types": "^24.5.0", - "@types/node": "*", + "@jest/test-result": "^24.7.1", + "@jest/types": "^24.7.0", "@types/yargs": "^12.0.9", "ansi-escapes": "^3.0.0", "chalk": "^2.0.1", - "jest-util": "^24.5.0", + "jest-util": "^24.7.1", "string-length": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "jest-worker": { - "version": "24.4.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.4.0.tgz", - "integrity": "sha512-BH9X/klG9vxwoO99ZBUbZFfV8qO0XNZ5SIiCyYK2zOuJBl6YJVAeNIQjcoOVNu4HGEHeYEKsUWws8kSlSbZ9YQ==", + "version": "24.6.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.6.0.tgz", + "integrity": "sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ==", "dev": true, "requires": { - "@types/node": "*", "merge-stream": "^1.0.1", "supports-color": "^6.1.0" }, @@ -5544,9 +4329,9 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { - "version": "3.12.2", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.2.tgz", - "integrity": "sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -5560,87 +4345,51 @@ "dev": true }, "jsdom": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-14.0.0.tgz", - "integrity": "sha512-/VkyPmdtbwqpJSkwDx3YyJ3U1oawYNB/h5z8vTUZGAzjtu2OHTeFRfnJqyMHsJ5Cyes23trOmvUpM1GfHH1leA==", + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", + "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", "dev": true, "requires": { "abab": "^2.0.0", - "acorn": "^6.0.4", - "acorn-globals": "^4.3.0", + "acorn": "^5.5.3", + "acorn-globals": "^4.1.0", "array-equal": "^1.0.0", - "cssom": "^0.3.4", - "cssstyle": "^1.1.1", - "data-urls": "^1.1.0", + "cssom": ">= 0.3.2 < 0.4.0", + "cssstyle": "^1.0.0", + "data-urls": "^1.0.0", "domexception": "^1.0.1", - "escodegen": "^1.11.0", + "escodegen": "^1.9.1", "html-encoding-sniffer": "^1.0.2", - "nwsapi": "^2.0.9", - "parse5": "5.1.0", + "left-pad": "^1.3.0", + "nwsapi": "^2.0.7", + "parse5": "4.0.0", "pn": "^1.1.0", - "request": "^2.88.0", + "request": "^2.87.0", "request-promise-native": "^1.0.5", - "saxes": "^3.1.5", + "sax": "^1.2.4", "symbol-tree": "^3.2.2", - "tough-cookie": "^2.5.0", + "tough-cookie": "^2.3.4", "w3c-hr-time": "^1.0.1", - "w3c-xmlserializer": "^1.0.1", "webidl-conversions": "^4.0.2", - "whatwg-encoding": "^1.0.5", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^7.0.0", - "ws": "^6.1.2", + "whatwg-encoding": "^1.0.3", + "whatwg-mimetype": "^2.1.0", + "whatwg-url": "^6.4.1", + "ws": "^5.2.0", "xml-name-validator": "^3.0.0" }, "dependencies": { - "acorn": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", - "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", - "dev": true - }, "parse5": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.0.tgz", - "integrity": "sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", "dev": true - }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, - "whatwg-url": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", - "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", - "dev": true, - "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - }, - "ws": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.0.tgz", - "integrity": "sha512-deZYUNlt2O4buFCa3t5bKLf8A7FPP/TVjwOeVNpw818Ma5nk4MLXls2eoEGS39o8119QIYxTrTDoPQ5B/gTD6w==", - "dev": true, - "requires": { - "async-limiter": "~1.0.0" - } } } }, "jsesc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", - "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, "json-parse-better-errors": { @@ -5668,10 +4417,13 @@ "dev": true }, "json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", + "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } }, "jsonfile": { "version": "4.0.0", @@ -5701,16 +4453,19 @@ "dev": true }, "kleur": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.2.tgz", - "integrity": "sha512-3h7B2WRT5LNXOtQiAaWonilegHcPSf9nLVXlSTci8lu1dZUuui61+EsPEZqSVxY7rXYmB2DVKMQILxaO5WL61Q==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "dev": true }, - "lcov-parse": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", - "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", - "dev": true + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, + "requires": { + "invert-kv": "^2.0.0" + } }, "left-pad": { "version": "1.3.0", @@ -5774,12 +4529,6 @@ "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, - "lodash.includes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=", - "dev": true - }, "lodash.isequal": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", @@ -5797,12 +4546,6 @@ "integrity": "sha1-Ph8lZcQxdU1Uq1fy7RdBk5KFyh0=", "dev": true }, - "log-driver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", - "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", - "dev": true - }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -5811,16 +4554,6 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, "magic-string": { "version": "0.25.2", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.2.tgz", @@ -5869,12 +4602,6 @@ "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true }, - "map-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", - "dev": true - }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -5884,6 +4611,17 @@ "object-visit": "^1.0.0" } }, + "mem": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + } + }, "merge-stream": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", @@ -5891,6 +4629,32 @@ "dev": true, "requires": { "readable-stream": "^2.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "micromatch": { @@ -5912,27 +4676,6 @@ "regex-not": "^1.0.0", "snapdragon": "^0.8.1", "to-regex": "^3.0.2" - }, - "dependencies": { - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - } - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } } }, "mime-db": { @@ -5950,21 +4693,18 @@ "mime-db": "~1.38.0" } }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, "mimic-response": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", "dev": true }, - "min-document": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", - "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", - "dev": true, - "requires": { - "dom-walk": "^0.1.0" - } - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -5975,9 +4715,9 @@ } }, "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, "mixin-deep": { @@ -6008,6 +4748,14 @@ "dev": true, "requires": { "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } } }, "moo": { @@ -6023,9 +4771,9 @@ "dev": true }, "nan": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.1.tgz", - "integrity": "sha512-I6YB/YEuDeUZMmhscXKxGgZlFnhsn5y0hgOZBadkzfTRrZBtJDZeg6eQf7PYMIEclwmorTKK8GztsyOUSVBREA==", + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", "dev": true }, "nanomatch": { @@ -6045,35 +4793,8 @@ "regex-not": "^1.0.0", "snapdragon": "^0.8.1", "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - } - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } } }, - "napi-build-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.1.tgz", - "integrity": "sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA==", - "dev": true - }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -6093,6 +4814,12 @@ "semver": "^5.4.1" } }, + "neo-async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", + "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==", + "dev": true + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -6108,11 +4835,15 @@ "semver": "^5.4.1" } }, - "node-cleanup": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/node-cleanup/-/node-cleanup-2.1.2.tgz", - "integrity": "sha1-esGavSl+Caf3KnFUXZUbUX5N3iw=", - "dev": true + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "dev": true, + "requires": { + "encoding": "^0.1.11", + "is-stream": "^1.0.1" + } }, "node-gyp": { "version": "3.8.0", @@ -6240,9 +4971,9 @@ "dev": true }, "nwsapi": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.1.tgz", - "integrity": "sha512-T5GaA1J/d34AC8mkrFD2O0DR17kwJ702ZOtJOsS8RpbsQZVOC2/xYFb1i/cw+xdM54JIlMuojjDOYct8GIWtwg==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.3.tgz", + "integrity": "sha512-RowAaJGEgYXEZfQ7tvvdtAQUKPyTR6T6wNu0fwlNsGQYr/h3yQc6oI8WnVZh3Y/Sylwc+dtAlvPqfFZjhTyk3A==", "dev": true }, "oauth-sign": { @@ -6300,9 +5031,9 @@ "dev": true }, "object-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", - "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, "object-visit": { @@ -6407,6 +5138,14 @@ "requires": { "minimist": "~0.0.1", "wordwrap": "~0.0.2" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + } } }, "optionator": { @@ -6437,6 +5176,17 @@ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -6475,9 +5225,9 @@ "dev": true }, "p-is-promise": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", - "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", "dev": true }, "p-limit": { @@ -6505,9 +5255,9 @@ "dev": true }, "p-try": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "parse-json": { @@ -6568,15 +5318,6 @@ "pify": "^3.0.0" } }, - "pause-stream": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", - "dev": true, - "requires": { - "through": "~2.3" - } - }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -6648,11 +5389,15 @@ "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } } } }, @@ -6662,39 +5407,16 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, - "prettier": { - "version": "1.16.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.4.tgz", - "integrity": "sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g==", - "dev": true - }, "pretty-format": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.5.0.tgz", - "integrity": "sha512-/3RuSghukCf8Riu5Ncve0iI+BzVkbRU5EeUoArKARZobREycuH5O4waxvaNIloEXdb0qwgmEAed5vTpX1HNROQ==", + "version": "24.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.7.0.tgz", + "integrity": "sha512-apen5cjf/U4dj7tHetpC7UEFCvtAgnNZnBDkfPv3fokzIqyOJckAG9OlAPC1BlFALnqT/lGB2tl9EJjlK6eCsA==", "dev": true, "requires": { - "@jest/types": "^24.5.0", + "@jest/types": "^24.7.0", "ansi-regex": "^4.0.0", "ansi-styles": "^3.2.0", "react-is": "^16.8.4" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - } } }, "prettycli": { @@ -6706,15 +5428,6 @@ "chalk": "2.1.0" }, "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, "chalk": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", @@ -6749,12 +5462,6 @@ "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", "dev": true }, - "process": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", - "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=", - "dev": true - }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", @@ -6771,9 +5478,9 @@ } }, "prompts": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.0.3.tgz", - "integrity": "sha512-H8oWEoRZpybm6NV4to9/1limhttEo13xK62pNvn2JzY0MA03p7s0OjtmhXyon3uJmxiJJVSuUwEJFFssI3eBiQ==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.0.4.tgz", + "integrity": "sha512-HTzM3UWp/99A0gk51gAegwo1QRYA7xjcZufMNe33rCclFszUYAuHe1fIN/3ZmiHeGPkUsNaRyQm1hHOfM0PKxA==", "dev": true, "requires": { "kleur": "^3.0.2", @@ -6790,21 +5497,17 @@ "react-is": "^16.8.1" } }, - "ps-tree": { + "prop-types-exact": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz", - "integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==", + "resolved": "https://registry.npmjs.org/prop-types-exact/-/prop-types-exact-1.2.0.tgz", + "integrity": "sha512-K+Tk3Kd9V0odiXFP9fwDHUYRyvK3Nun3GVyPapSIs5OBkITAm15W0CPFD/YKTkMUAbc0b9CUwRQp2ybiBIq+eA==", "dev": true, "requires": { - "event-stream": "=3.3.4" + "has": "^1.0.3", + "object.assign": "^4.1.0", + "reflect.ownkeys": "^0.2.0" } }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, "psl": { "version": "1.1.31", "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", @@ -6812,9 +5515,9 @@ "dev": true }, "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, "requires": { "end-of-stream": "^1.1.0", @@ -6868,44 +5571,36 @@ "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } } }, "react": { - "version": "16.8.4", - "resolved": "https://registry.npmjs.org/react/-/react-16.8.4.tgz", - "integrity": "sha512-0GQ6gFXfUH7aZcjGVymlPOASTuSjlQL4ZtVC5YKH+3JL6bBLCVO21DknzmaPlI90LN253ojj02nsapy+j7wIjg==", + "version": "16.8.6", + "resolved": "https://registry.npmjs.org/react/-/react-16.8.6.tgz", + "integrity": "sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw==", "dev": true, "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", "prop-types": "^15.6.2", - "scheduler": "^0.13.4" + "scheduler": "^0.13.6" } }, "react-dom": { - "version": "16.8.4", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.8.4.tgz", - "integrity": "sha512-Ob2wK7XG2tUDt7ps7LtLzGYYB6DXMCLj0G5fO6WeEICtT4/HdpOi7W/xLzZnR6RCG1tYza60nMdqtxzA8FaPJQ==", + "version": "16.8.6", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.8.6.tgz", + "integrity": "sha512-1nL7PIq9LTL3fthPqwkvr2zY7phIPjYrT0jp4HjyEQrEROnw4dG41VVwi/wfoCneoleqrNX7iAD+pXebJZwrwA==", "dev": true, "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", "prop-types": "^15.6.2", - "scheduler": "^0.13.4" + "scheduler": "^0.13.6" } }, "react-is": { - "version": "16.8.4", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.4.tgz", - "integrity": "sha512-PVadd+WaUDOAciICm/J1waJaSvgq+4rHE/K70j0PFqKhkTBsPv/82UGQJNXAngz1fOQLLxI6z1sEDmJDQhCTAA==" + "version": "16.8.6", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", + "integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==" }, "react-lifecycles-compat": { "version": "3.0.4", @@ -6914,15 +5609,15 @@ "dev": true }, "react-test-renderer": { - "version": "16.8.4", - "resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-16.8.4.tgz", - "integrity": "sha512-jQ9Tf/ilIGSr55Cz23AZ/7H3ABEdo9oy2zF9nDHZyhLHDSLKuoILxw2ifpBfuuwQvj4LCoqdru9iZf7gwFH28A==", + "version": "16.8.6", + "resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-16.8.6.tgz", + "integrity": "sha512-H2srzU5IWYT6cZXof6AhUcx/wEyJddQ8l7cLM/F7gDXYyPr4oq+vCIxJYXVGhId1J706sqziAjuOEjyNkfgoEw==", "dev": true, "requires": { "object-assign": "^4.1.1", "prop-types": "^15.6.2", - "react-is": "^16.8.4", - "scheduler": "^0.13.4" + "react-is": "^16.8.6", + "scheduler": "^0.13.6" } }, "read-pkg": { @@ -6947,18 +5642,14 @@ } }, "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", + "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", "dev": true, "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } }, "realpath-native": { @@ -6971,23 +5662,15 @@ } }, "recast": { - "version": "0.17.3", - "resolved": "https://registry.npmjs.org/recast/-/recast-0.17.3.tgz", - "integrity": "sha512-NwQguXPwHqaVb6M7tsY11+8RDoAKHGRdymPGDxHJrsxOlNADQh0b08uz/MgYp1R1wmHuSBK4A4I5Oq+cE1J40g==", + "version": "0.17.5", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.17.5.tgz", + "integrity": "sha512-K+DgfAMIyEjNKjaFSWgg9TTu7wFgU/4KTyw4E9vl6M5QPDuUYbyt49Yzb0EIDbZks+6lXk/UZ9eTuE4jlLyf2A==", "dev": true, "requires": { - "ast-types": "0.12.2", + "ast-types": "0.12.3", "esprima": "~4.0.0", "private": "^0.1.8", "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } } }, "recompose": { @@ -7012,50 +5695,18 @@ } } }, - "recursive-rename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/recursive-rename/-/recursive-rename-2.0.0.tgz", - "integrity": "sha1-da66Q08kJk1QjR2Dr5U9iYknMec=", - "dev": true, - "requires": { - "babel-runtime": "^6.23.0", - "bluebird": "^3.5.0", - "colors": "^1.1.2", - "global": "^4.3.2", - "minimist": "^1.2.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } - } - }, - "regenerate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "reflect.ownkeys": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz", + "integrity": "sha1-dJrO7H8/34tj+SegSAnpDFwLNGA=", "dev": true }, "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", + "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==", "dev": true }, - "regenerator-transform": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", - "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", - "dev": true, - "requires": { - "babel-runtime": "^6.18.0", - "babel-types": "^6.19.0", - "private": "^0.1.6" - } - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -7064,61 +5715,6 @@ "requires": { "extend-shallow": "^3.0.2", "safe-regex": "^1.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - } - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "regexpu-core": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", - "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", - "dev": true, - "requires": { - "regenerate": "^1.2.1", - "regjsgen": "^0.2.0", - "regjsparser": "^0.1.4" - } - }, - "regjsgen": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", - "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", - "dev": true - }, - "regjsparser": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", - "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - } } }, "remove-trailing-separator": { @@ -7139,15 +5735,6 @@ "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, "request": { "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", @@ -7174,6 +5761,24 @@ "tough-cookie": "~2.4.3", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } + } } }, "request-promise-core": { @@ -7254,13 +5859,13 @@ } }, "rollup": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.7.0.tgz", - "integrity": "sha512-hjuWSCgoQsFSTsmsNP4AH1l1kfkFqW82gW00V9nL81Zr3JtnKn3rvxh18jUAAEMb7qNoHj21PR5SqbK2mhBgMg==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.9.3.tgz", + "integrity": "sha512-20iIOjee5n3H6W6CXsVdYs2xw86j4l+LQLM6yACynt+YJCwkqaYNHAjQ/dhVBIKsFpHwPqHamn/GHq+3Zp8ybQ==", "dev": true, "requires": { "@types/estree": "0.0.39", - "@types/node": "^11.9.5", + "@types/node": "^11.13.2", "acorn": "^6.1.1" }, "dependencies": { @@ -7273,113 +5878,33 @@ } }, "rollup-plugin-commonjs": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.2.1.tgz", - "integrity": "sha512-X0A/Cp/t+zbONFinBhiTZrfuUaVwRIp4xsbKq/2ohA2CDULa/7ONSJTelqxon+Vds2R2t2qJTqJQucKUC8GKkw==", + "version": "9.3.4", + "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.3.4.tgz", + "integrity": "sha512-DTZOvRoiVIHHLFBCL4pFxOaJt8pagxsVldEXBOn6wl3/V21wVaj17HFfyzTsQUuou3sZL3lEJZVWKPFblJfI6w==", "dev": true, "requires": { - "estree-walker": "^0.5.2", - "magic-string": "^0.25.1", + "estree-walker": "^0.6.0", + "magic-string": "^0.25.2", "resolve": "^1.10.0", - "rollup-pluginutils": "^2.3.3" - } - }, - "rollup-plugin-filesize": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-filesize/-/rollup-plugin-filesize-6.0.1.tgz", - "integrity": "sha512-wtxHShJofSxJRuYGGxgwIJyxxW+Mgu/vGGcsOUJVN+US6jE+gQYphSS3H2PS2HCVfxDtERtL0gjptk1gYru9rA==", - "dev": true, - "requires": { - "boxen": "^2.0.0", - "brotli-size": "0.0.3", - "colors": "^1.3.2", - "deep-assign": "^2.0.0", - "filesize": "^3.6.1", - "gzip-size": "^5.0.0", - "terser": "^3.10.0" + "rollup-pluginutils": "^2.6.0" }, "dependencies": { - "brotli-size": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/brotli-size/-/brotli-size-0.0.3.tgz", - "integrity": "sha512-bBIdd8uUGxKGldAVykxOqPegl+HlIm4FpXJamwWw5x77WCE8jO7AhXFE1YXOhOB28gS+2pTQete0FqRE6U5hQQ==", - "dev": true, - "requires": { - "duplexer": "^0.1.1", - "iltorb": "^2.0.5" - } - }, - "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", - "dev": true - }, - "expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", - "dev": true - }, - "gzip-size": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.0.0.tgz", - "integrity": "sha512-5iI7omclyqrnWw4XbXAmGhPsABkSIDQonv2K0h61lybgofWa6iZyvrI3r2zsJH4P8Nb64fFVzlvfhs0g7BBxAA==", - "dev": true, - "requires": { - "duplexer": "^0.1.1", - "pify": "^3.0.0" - } - }, - "iltorb": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/iltorb/-/iltorb-2.4.2.tgz", - "integrity": "sha512-RvsVTHt1Pw1/Zcepfd+3jinu38rO8IBFVONcroT9Dwrb5RSNE/CEX7uy1yZKN/kYCQB7FWx/oQgXhN9qAwZY9Q==", - "dev": true, - "requires": { - "detect-libc": "^1.0.3", - "nan": "^2.12.1", - "npmlog": "^4.1.2", - "prebuild-install": "^5.2.4", - "which-pm-runs": "^1.0.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "prebuild-install": { - "version": "5.2.5", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.2.5.tgz", - "integrity": "sha512-6uZgMVg7yDfqlP5CPurVhtq3hUKBFNufiar4J5hZrlHTo59DDBEtyxw01xCdFss9j0Zb9+qzFVf/s4niayba3w==", + "rollup-pluginutils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.6.0.tgz", + "integrity": "sha512-aGQwspEF8oPKvg37u3p7h0cYNwmJR1sCBMZGZ5b9qy8HGtETknqjzcxrDRrcAnJNXN18lBH4Q9vZYth/p4n8jQ==", "dev": true, "requires": { - "detect-libc": "^1.0.3", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.0", - "mkdirp": "^0.5.1", - "napi-build-utils": "^1.0.1", - "node-abi": "^2.7.0", - "noop-logger": "^0.1.1", - "npmlog": "^4.0.1", - "os-homedir": "^1.0.1", - "pump": "^2.0.1", - "rc": "^1.2.7", - "simple-get": "^2.7.0", - "tar-fs": "^1.13.0", - "tunnel-agent": "^0.6.0", - "which-pm-runs": "^1.0.0" + "estree-walker": "^0.6.0", + "micromatch": "^3.1.10" } } } }, "rollup-plugin-invariant": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-invariant/-/rollup-plugin-invariant-0.4.2.tgz", - "integrity": "sha512-GXVoh7fnzEElVEbzt7gOWHnkB+nWd9WGQex70SKvl49RXvnWKSHu4Nk6M/7tqDKFMHvRUpEo6qWD7bv48vmg7g==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-invariant/-/rollup-plugin-invariant-0.5.2.tgz", + "integrity": "sha512-/47dp/HJPbDxasQHFv7lTBZVi+AKcCVSiZ6++AG983XFL5bYrxps81D0BwDBTCu5s8tW4wVsZLF+7t4ilx4iqQ==", "dev": true, "requires": { "recast": "^0.17.2", @@ -7388,11 +5913,12 @@ } }, "rollup-plugin-node-resolve": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.0.1.tgz", - "integrity": "sha512-fSS7YDuCe0gYqKsr5OvxMloeZYUSgN43Ypi1WeRZzQcWtHgFayV5tUSPYpxuaioIIWaBXl6NrVk0T2/sKwueLg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.2.2.tgz", + "integrity": "sha512-fkTHihF4Tzc95ZotKJNZZgxZPzslj+twk6UNWSBn3ln1mSV55atjsi7CDODdw/NNlteaf/jjjvrAj62p7OQjaQ==", "dev": true, "requires": { + "@types/resolve": "0.0.8", "builtin-modules": "^3.0.0", "is-module": "^1.0.0", "resolve": "^1.10.0" @@ -7430,14 +5956,6 @@ "requires": { "estree-walker": "^0.6.0", "micromatch": "^3.1.10" - }, - "dependencies": { - "estree-walker": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.0.tgz", - "integrity": "sha512-peq1RfVAVzr3PU/jL31RaOjUKLoZJpObQWJJ+LgfcxDUifyLZ1RjPQZTl0pzj2uJ45b7A7XpyppXvxdEqzo4rw==", - "dev": true - } } }, "rst-selector-parser": { @@ -7492,14 +6010,6 @@ "micromatch": "^3.1.4", "minimist": "^1.1.1", "walker": "~1.0.5" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } } }, "sax": { @@ -7508,19 +6018,10 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true }, - "saxes": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-3.1.9.tgz", - "integrity": "sha512-FZeKhJglhJHk7eWG5YM0z46VHmI3KJpMBAQm3xa9meDvd+wevB5GuBB0wc0exPInZiBBHqi00DbS8AcvCGCFMw==", - "dev": true, - "requires": { - "xmlchars": "^1.3.1" - } - }, "scheduler": { - "version": "0.13.4", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.4.tgz", - "integrity": "sha512-cvSOlRPxOHs5dAhP9yiS/6IDmVAVxmk33f0CtTJRkmUWcb1Us+t7b1wqdzoC0REw2muC9V5f1L/w5R5uKGaepA==", + "version": "0.13.6", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.6.tgz", + "integrity": "sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==", "dev": true, "requires": { "loose-envify": "^1.1.0", @@ -7528,9 +6029,9 @@ } }, "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "dev": true }, "serialize-javascript": { @@ -7555,6 +6056,17 @@ "is-extendable": "^0.1.1", "is-plain-object": "^2.0.3", "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "setimmediate": { @@ -7614,9 +6126,9 @@ "dev": true }, "slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", "dev": true }, "snapdragon": { @@ -7643,6 +6155,21 @@ "requires": { "is-descriptor": "^0.1.0" } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true } } }, @@ -7718,9 +6245,9 @@ } }, "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, "source-map-resolve": { @@ -7737,12 +6264,13 @@ } }, "source-map-support": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", + "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", "dev": true, "requires": { - "source-map": "^0.5.6" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" } }, "source-map-url": { @@ -7784,20 +6312,11 @@ } }, "spdx-license-ids": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", - "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", + "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", "dev": true }, - "split": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", - "dev": true, - "requires": { - "through": "2" - } - }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -7805,27 +6324,6 @@ "dev": true, "requires": { "extend-shallow": "^3.0.0" - }, - "dependencies": { - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - } - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } } }, "sprintf-js": { @@ -7884,21 +6382,6 @@ "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", "dev": true }, - "stream-combiner": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", - "dev": true, - "requires": { - "duplexer": "~0.1.1" - } - }, - "string-argv": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.1.2.tgz", - "integrity": "sha512-mBqPGEOMNJKXRo7z0keX0wlAhbBAjilUdPW13nN0PecVryZxdHIeM7TqbsSUA7VYuS00HGC6mojP7DlQzfa9ZA==", - "dev": true - }, "string-length": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz", @@ -7927,14 +6410,30 @@ } }, "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } } }, "string.prototype.trim": { @@ -7949,21 +6448,21 @@ } }, "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", + "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", "dev": true, "requires": { "safe-buffer": "~5.1.0" } }, "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "^4.1.0" } }, "strip-bom": { @@ -7985,10 +6484,13 @@ "dev": true }, "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } }, "symbol-observable": { "version": "1.2.0", @@ -8050,70 +6552,30 @@ "readable-stream": "^2.3.0", "to-buffer": "^1.1.1", "xtend": "^4.0.0" - } - }, - "term-size": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", - "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", - "dev": true, - "requires": { - "execa": "^0.7.0" }, "dependencies": { - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } - } - } - }, - "terser": { - "version": "3.17.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-3.17.0.tgz", - "integrity": "sha512-/FQzzPJmCpjAH9Xvk2paiWrFq+5M6aVOf+2KRbwhByISDX/EujxsK+BAvrhb6H+2rtrLCHK9N01wO014vrIwVQ==", - "dev": true, - "requires": { - "commander": "^2.19.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.10" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true }, - "source-map-support": { - "version": "0.5.11", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.11.tgz", - "integrity": "sha512-//sajEx/fGL3iw6fltKMdPvy8kL3kJ2O3iuYlRoT3k9Kb4BjOoZ+BZzaNHeuaruSt+Kf3Zk9tnfAQg9/AJqUVQ==", + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "safe-buffer": "~5.1.0" } } } @@ -8136,12 +6598,6 @@ "integrity": "sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=", "dev": true }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, "tmpl": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", @@ -8155,9 +6611,9 @@ "dev": true }, "to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, "to-object-path": { @@ -8190,27 +6646,6 @@ "extend-shallow": "^3.0.2", "regex-not": "^1.0.2", "safe-regex": "^1.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - } - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } } }, "to-regex-range": { @@ -8224,21 +6659,13 @@ } }, "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", "dev": true, "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - } + "psl": "^1.1.28", + "punycode": "^2.1.1" } }, "tr46": { @@ -8257,17 +6684,18 @@ "dev": true }, "ts-invariant": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.3.2.tgz", - "integrity": "sha512-QsY8BCaRnHiB5T6iE4DPlJMAKEG3gzMiUco9FEt1jUXQf0XP6zi0idT0i0rMTu8A326JqNSDsmlkA9dRSh1TRg==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.2.1.tgz", + "integrity": "sha512-Z/JSxzVmhTo50I+LKagEISFJW3pvPCqsMWLamCTX8Kr3N5aMrnGOqcflbe5hLUzwjvgPfnLzQtHZv0yWQ+FIHg==", + "dev": true, "requires": { "tslib": "^1.9.3" } }, "ts-jest": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.0.0.tgz", - "integrity": "sha512-o8BO3TkMREpAATaFTrXkovMsCpBl2z4NDBoLJuWZcJJj1ijI49UnvDMfVpj+iogn/Jl8Pbhuei5nc/Ti+frEHw==", + "version": "24.0.2", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.0.2.tgz", + "integrity": "sha512-h6ZCZiA1EQgjczxq+uGLXQlNgeg02WWJBbeT8j6nyIBRQdglqbvzDoHahTEIiS6Eor6x8mK6PfZ7brQ9Q6tzHw==", "dev": true, "requires": { "bs-logger": "0.x", @@ -8281,19 +6709,10 @@ "yargs-parser": "10.x" }, "dependencies": { - "json5": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", - "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", "dev": true }, "yargs-parser": { @@ -8307,47 +6726,6 @@ } } }, - "tsc-watch": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/tsc-watch/-/tsc-watch-2.1.2.tgz", - "integrity": "sha512-w80windZ4HAFpq2qtva/WsgfyYqS4CXTow+KjyO+AmYRFIDhzODUIK2BJW7M1Y8sL8NZUH0b4U1ET3436Q7Ctw==", - "dev": true, - "requires": { - "cross-spawn": "^5.1.0", - "node-cleanup": "^2.1.2", - "ps-tree": "^1.2.0", - "string-argv": "^0.1.1", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, "tslib": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", @@ -8378,28 +6756,11 @@ } }, "typescript": { - "version": "3.3.4000", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", - "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.3.tgz", + "integrity": "sha512-FFgHdPt4T/duxx6Ndf7hwgMZZjZpB+U0nMNGVCYPq0rEzWKjEDobm4J6yb3CS7naZ0yURFqdw9Gwc7UOh/P9oQ==", "dev": true }, - "typescript-require": { - "version": "0.2.10", - "resolved": "https://registry.npmjs.org/typescript-require/-/typescript-require-0.2.10.tgz", - "integrity": "sha1-jI7iqnXzUwtWC4ScKSfNNpfrpo4=", - "dev": true, - "requires": { - "typescript": "^1.5.3" - }, - "dependencies": { - "typescript": { - "version": "1.8.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-1.8.10.tgz", - "integrity": "sha1-tHXW4N/wv1DyluXKbvn7tccyDx4=", - "dev": true - } - } - }, "ua-parser-js": { "version": "0.7.19", "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.19.tgz", @@ -8407,27 +6768,13 @@ "dev": true }, "uglify-js": { - "version": "3.4.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", - "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.4.tgz", + "integrity": "sha512-GpKo28q/7Bm5BcX9vOu4S46FwisbPbAmkkqPnGIpKvKTM96I85N6XHQV+k4I6FA2wxgLhcsSyHoNhzucwCflvA==", "dev": true, "requires": { - "commander": "~2.17.1", + "commander": "~2.20.0", "source-map": "~0.6.1" - }, - "dependencies": { - "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } } }, "union-value": { @@ -8442,6 +6789,15 @@ "set-value": "^0.4.3" }, "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, "set-value": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", @@ -8575,17 +6931,6 @@ "browser-process-hrtime": "^0.1.2" } }, - "w3c-xmlserializer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-1.0.1.tgz", - "integrity": "sha512-XZGI1OH/OLQr/NaJhhPmzhngwcAnZDLytsvXnRmlYeRkmbb0I7sqFFA22erq4WQR0sUu17ZSQOAV9mFwCqKRNg==", - "dev": true, - "requires": { - "domexception": "^1.0.1", - "webidl-conversions": "^4.0.2", - "xml-name-validator": "^3.0.0" - } - }, "walker": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", @@ -8663,64 +7008,59 @@ "string-width": "^1.0.2 || 2" } }, - "widest-line": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", - "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { - "string-width": "^2.1.1" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^2.0.0" } } } }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -8759,12 +7099,6 @@ "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", "dev": true }, - "xmlchars": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-1.3.1.tgz", - "integrity": "sha512-tGkGJkN8XqCod7OT+EvGYK5Z4SfDQGD30zAa58OcnAa0RRWgzUEK72tkXhsX1FZd+rgnhRxFtmO+ihkp8LHSkw==", - "dev": true - }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", @@ -8772,21 +7106,45 @@ "dev": true }, "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } }, "zen-observable": { - "version": "0.8.13", - "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.13.tgz", - "integrity": "sha512-fa+6aDUVvavYsefZw0zaZ/v3ckEtMgCFi30sn91SEZea4y/6jQp05E3omjkX91zV6RVdn15fqnFZ6RKjRGbp2g==", + "version": "0.8.14", + "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.14.tgz", + "integrity": "sha512-kQz39uonEjEESwh+qCi83kcC3rZJGh4mrZW7xjkSQYXkq//JZHTtKo+6yuVloTgMtzsIWOJrjIrKvk/dqm0L5g==", "dev": true }, "zen-observable-ts": { diff --git a/package.json b/package.json index 161182acda..d6f75d0819 100644 --- a/package.json +++ b/package.json @@ -1,52 +1,79 @@ { - "name": "react-apollo", - "version": "2.5.3", - "author": "opensource@apollographql.com", + "name": "apollo-react-monorepo", "private": true, - "description": "React data container for Apollo Client", - "keywords": [ - "apollo", - "graphql", - "react" - ], + "author": "opensource@apollographql.com", "license": "MIT", - "main": "lib/react-apollo.cjs.js", - "module": "lib/react-apollo.esm.js", - "react-native": { - "react-dom/server": false - }, - "typings": "lib/index.d.ts", - "repository": { - "type": "git", - "url": "apollographql/react-apollo" - }, "scripts": { - "compile": "tsc -p ./tsconfig.cjs.json", - "deploy": "cd lib && npm publish", - "filesize": "bundlesize", - "jest": "jest --runInBand --coverage", - "postcompile": "rollup -c && ./scripts/prepare-package.sh", - "precompile": "rimraf lib", - "predeploy": "npm run compile", - "prefilesize": "npm run compile", - "prettier": "prettier --write \"./**/*.{js,jsx,ts*,md,graphql,json}\"", - "test": "npm run type-check && npm run jest", - "test-watch": "jest --watch", - "test:compiled": "npm run test:compiled:cjs && npm run test:compiled:umd", - "test:compiled:cjs": "jest --config jest.cjs.config.js --runInBand", - "test:compiled:umd": "jest --config jest.umd.config.js --runInBand", - "type-check": "tsc --project tsconfig.json --noEmit ", - "watch": "tsc-watch --onSuccess \"npm run postcompile\"" + "postinstall": "lerna exec -- npm install --package-lock=false && lerna run prepare", + "build": "lerna run build", + "test": "jest --config ./config/jest.config.js", + "test:watch": "jest --config ./config/jest.config.js --watch", + "test:coverage": "jest --config ./config/jest.config.js --verbose --coverage", + "test:ci": "npm run test:coverage -- --ci --maxWorkers=2 --reporters=default --reporters=jest-junit", + "bundlesize": "lerna run build && bundlesize", + "prettier": "prettier --config ./config/prettier.config.js --write \"./**/*.{js,jsx,ts*,md,graphql,json}\"", + "deploy": "lerna publish --contents ./build/dist", + "clean": "rm -Rf ./node_modules ./meta && lerna exec -- npm run clean" }, - "babel": { - "presets": [ - "env" - ] + "dependencies": { + "@apollo/react-common": "file:./packages/common", + "@apollo/react-components": "file:./packages/components", + "@apollo/react-hoc": "file:./packages/hoc", + "@apollo/react-hooks": "file:./packages/hooks", + "@apollo/react-testing": "file:./packages/testing" + }, + "devDependencies": { + "@types/enzyme": "^3.9.1", + "@types/enzyme-adapter-react-16": "^1.0.5", + "@types/graphql": "^14.2.0", + "@types/hoist-non-react-statics": "^3.3.1", + "@types/jest": "^24.0.11", + "@types/lodash.isequal": "^4.5.5", + "@types/react": "^16.8.13", + "@types/react-dom": "^16.8.3", + "@types/react-test-renderer": "^16.8.1", + "@types/recompose": "^0.30.5", + "apollo-cache": "^1.2.1", + "apollo-cache-inmemory": "^1.5.1", + "apollo-client": "^2.5.1", + "apollo-link": "^1.2.11", + "bundlesize": "^0.17.1", + "enzyme": "^3.9.0", + "enzyme-adapter-react-16": "^1.12.1", + "graphql": "^14.2.1", + "graphql-tag": "^2.10.1", + "jest": "^24.7.1", + "jest-junit": "^6.3.0", + "lodash.times": "^4.3.2", + "react": "^16.8.6", + "react-dom": "^16.8.6", + "react-test-renderer": "^16.8.6", + "recompose": "^0.30.0", + "rollup": "^1.9.3", + "rollup-plugin-commonjs": "^9.3.4", + "rollup-plugin-invariant": "^0.5.2", + "rollup-plugin-node-resolve": "^4.2.2", + "rollup-plugin-typescript2": "^0.20.1", + "rollup-plugin-uglify": "^6.0.2", + "ts-jest": "^24.0.2", + "typescript": "^3.4.3", + "zen-observable-ts": "^0.8.18" }, "bundlesize": [ { - "path": "./dist/bundlesize.js", - "maxSize": "5.4 KB" + "name": "@apollo/react-common", + "path": "./packages/common/meta/bundlesize/bundlesize.js", + "maxSize": "1 KB" + }, + { + "name": "@apollo/react-components", + "path": "./packages/components/meta/bundlesize/bundlesize.js", + "maxSize": "4 KB" + }, + { + "name": "@apollo/react-hoc", + "path": "./packages/hoc/meta/bundlesize/bundlesize.js", + "maxSize": "1.5 KB" } ], "renovate": { @@ -54,102 +81,5 @@ "apollo-open-source" ], "automerge": false - }, - "jest": { - "testEnvironment": "jsdom", - "transform": { - "^.+\\.tsx?$": "ts-jest", - "^.+\\.jsx?$": "babel-jest" - }, - "moduleFileExtensions": [ - "ts", - "tsx", - "js", - "json" - ], - "modulePathIgnorePatterns": [ - "/examples", - "/test/typescript-usage.tsx", - "/test/fail-no-entry-point.js" - ], - "projects": [ - "" - ], - "testRegex": "(/test/(?!test-utils\b)\b.*|\\.(test|spec))\\.(ts|tsx|js)$", - "setupFiles": [ - "/test/test-utils/setup.ts" - ] - }, - "prettier": { - "singleQuote": true, - "trailingComma": "all" - }, - "peerDependencies": { - "apollo-client": "^2.5.1", - "react": "^16.8.0", - "react-dom": "^16.8.0", - "graphql": "^14.1.0" - }, - "sideEffects": false, - "devDependencies": { - "@types/enzyme": "3.9.1", - "@types/enzyme-adapter-react-16": "1.0.5", - "@types/graphql": "14.0.7", - "@types/hoist-non-react-statics": "3.3.0", - "@types/invariant": "2.2.29", - "@types/jest": "24.0.11", - "@types/lodash.isequal": "4.5.5", - "@types/object-assign": "4.0.30", - "@types/prop-types": "15.7.0", - "@types/react": "16.8.8", - "@types/react-dom": "16.8.2", - "@types/react-test-renderer": "16.8.1", - "@types/recompose": "0.30.5", - "@types/zen-observable": "0.8.0", - "apollo-cache": "1.2.1", - "apollo-cache-inmemory": "1.5.1", - "apollo-client": "2.5.1", - "apollo-link": "1.2.11", - "babel-core": "6.26.3", - "babel-jest": "24.5.0", - "babel-preset-env": "1.7.0", - "bundlesize": "0.17.1", - "coveralls": "3.0.3", - "enzyme": "3.9.0", - "enzyme-adapter-react-16": "1.11.2", - "graphql": "14.1.1", - "graphql-tag": "2.10.1", - "jest": "24.5.0", - "jest-junit": "6.3.0", - "jsdom": "14.0.0", - "lodash.includes": "4.3.0", - "lodash.times": "4.3.2", - "prettier": "1.16.4", - "react": "16.8.4", - "react-dom": "16.8.4", - "react-test-renderer": "16.8.4", - "recompose": "0.30.0", - "recursive-rename": "2.0.0", - "rimraf": "2.6.3", - "rollup": "1.7.0", - "rollup-plugin-commonjs": "9.2.1", - "rollup-plugin-filesize": "6.0.1", - "rollup-plugin-invariant": "0.4.2", - "rollup-plugin-node-resolve": "4.0.1", - "rollup-plugin-typescript2": "0.20.1", - "rollup-plugin-uglify": "6.0.2", - "ts-jest": "24.0.0", - "tsc-watch": "2.1.2", - "typescript": "3.3.4000", - "typescript-require": "0.2.10", - "zen-observable-ts": "0.8.18" - }, - "dependencies": { - "apollo-utilities": "^1.2.1", - "hoist-non-react-statics": "^3.3.0", - "lodash.isequal": "^4.5.0", - "prop-types": "^15.7.2", - "ts-invariant": "^0.3.2", - "tslib": "^1.9.3" } } diff --git a/packages/common/README.md b/packages/common/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/common/config/jest.config.js b/packages/common/config/jest.config.js new file mode 100644 index 0000000000..9e9b87422b --- /dev/null +++ b/packages/common/config/jest.config.js @@ -0,0 +1,6 @@ +const commonJestConfig = require('../../../config/jest.config'); + +module.exports = { + ...commonJestConfig, + setupFiles: ['../../config/tests-setup.ts'], +}; diff --git a/rollup.config.js b/packages/common/config/rollup.config.js similarity index 60% rename from rollup.config.js rename to packages/common/config/rollup.config.js index 716ae9b7ac..d19fc129d7 100644 --- a/rollup.config.js +++ b/packages/common/config/rollup.config.js @@ -2,7 +2,6 @@ import node from 'rollup-plugin-node-resolve'; import { uglify } from 'rollup-plugin-uglify'; import typescript from 'typescript'; import typescriptPlugin from 'rollup-plugin-typescript2'; -import filesize from 'rollup-plugin-filesize'; import invariantPlugin from 'rollup-plugin-invariant'; function onwarn(message) { @@ -14,65 +13,67 @@ function onwarn(message) { } const globals = { - 'apollo-client': 'apollo.core', - 'hoist-non-react-statics': 'hoistNonReactStatics', - 'prop-types': 'propTypes', - 'react': 'react', + react: 'React', 'ts-invariant': 'invariant', - 'tslib': 'tslib', - 'lodash.isequal': 'isEqual', + tslib: 'tslib', }; function external(id) { return Object.prototype.hasOwnProperty.call(globals, id); } +const SRC_DIR = './src'; +const LIB_DIR = './lib'; + export default [ { - input: 'src/index.ts', + input: `${SRC_DIR}/index.ts`, output: { - file: 'lib/react-apollo.esm.js', + file: `${LIB_DIR}/react-common.esm.js`, format: 'esm', sourcemap: true, globals, }, external, plugins: [ - node({ module: true }), - typescriptPlugin({ typescript }), + node({ mainFields: ['module'] }), + typescriptPlugin({ + typescript, + tsconfig: './config/tsconfig.json', + clean: true, + }), invariantPlugin(), - filesize(), ], onwarn, }, { - input: 'lib/react-apollo.esm.js', + input: `${LIB_DIR}/react-common.esm.js`, output: { - file: 'lib/react-apollo.cjs.js', + file: `${LIB_DIR}/react-common.cjs.js`, format: 'cjs', - name: 'react-apollo', + name: 'react-common', globals, }, external, onwarn, }, { - input: 'lib/react-apollo.esm.js', + input: `${LIB_DIR}/react-common.esm.js`, output: { - file: 'lib/react-apollo.umd.js', + file: `${LIB_DIR}/react-common.umd.js`, format: 'umd', - name: 'react-apollo', + name: 'react-common', globals, }, external, onwarn, }, { - input: 'lib/react-apollo.esm.js', + input: `${LIB_DIR}/react-common.esm.js`, output: { - file: 'dist/bundlesize.js', + file: './meta/bundlesize/bundlesize.js', format: 'cjs', - name: 'react-apollo', + name: 'react-common', globals, }, external, @@ -83,9 +84,9 @@ export default [ }, compress: { global_defs: { - "@process.env.NODE_ENV": JSON.stringify("production"), + '@process.env.NODE_ENV': JSON.stringify('production'), }, - } + }, }), ], onwarn, diff --git a/packages/common/config/tsconfig.cjs.json b/packages/common/config/tsconfig.cjs.json new file mode 100644 index 0000000000..2733c030d0 --- /dev/null +++ b/packages/common/config/tsconfig.cjs.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../config/tsconfig.cjs.json", + "compilerOptions": { + "outDir": "../lib" + }, + "include": ["../src/**/*"], + "exclude": ["../src/**/__tests__/**/*", "../src/**/__mocks__/**/*"] +} diff --git a/packages/common/config/tsconfig.json b/packages/common/config/tsconfig.json new file mode 100644 index 0000000000..fc21045590 --- /dev/null +++ b/packages/common/config/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../config/tsconfig.base.json", + "compilerOptions": { + "outDir": "../lib" + }, + "include": ["../src/**/*"], + "exclude": ["../src/**/__tests__/**/*", "../src/**/__mocks__/**/*"] +} diff --git a/packages/common/lib/context/ApolloConsumer.d.ts b/packages/common/lib/context/ApolloConsumer.d.ts new file mode 100644 index 0000000000..7526d9dc04 --- /dev/null +++ b/packages/common/lib/context/ApolloConsumer.d.ts @@ -0,0 +1,6 @@ +import React from 'react'; +import ApolloClient from 'apollo-client'; +export interface ApolloConsumerProps { + children: (client: ApolloClient) => React.ReactElement | null; +} +export declare const ApolloConsumer: React.FC; diff --git a/packages/common/lib/context/ApolloConsumer.js b/packages/common/lib/context/ApolloConsumer.js new file mode 100644 index 0000000000..14653441cf --- /dev/null +++ b/packages/common/lib/context/ApolloConsumer.js @@ -0,0 +1,14 @@ +import React from 'react'; +import { InvariantError } from 'ts-invariant'; +import { getApolloContext } from './ApolloContext'; +export var ApolloConsumer = function (props) { + var ApolloContext = getApolloContext(); + return (React.createElement(ApolloContext.Consumer, null, function (context) { + if (!context || !context.client) { + throw new InvariantError('Could not find "client" in the context of ApolloConsumer. ' + + 'Wrap the root component in an .'); + } + return props.children(context.client); + })); +}; +//# sourceMappingURL=ApolloConsumer.js.map \ No newline at end of file diff --git a/packages/common/lib/context/ApolloConsumer.js.map b/packages/common/lib/context/ApolloConsumer.js.map new file mode 100644 index 0000000000..bf280171a0 --- /dev/null +++ b/packages/common/lib/context/ApolloConsumer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloConsumer.js","sourceRoot":"","sources":["../../src/context/ApolloConsumer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAMnD,MAAM,CAAC,IAAM,cAAc,GAAkC,UAAA,KAAK;IAChE,IAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,QACpB,UAAC,OAAY;QACZ,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAC/B,MAAM,IAAI,cAAc,CACtB,4DAA4D;gBAC1D,iDAAiD,CACpD,CAAC;SACH;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC,CACsB,CAC1B,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/common/lib/context/ApolloContext.d.ts b/packages/common/lib/context/ApolloContext.d.ts new file mode 100644 index 0000000000..872e003e6e --- /dev/null +++ b/packages/common/lib/context/ApolloContext.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import ApolloClient from 'apollo-client'; +export interface ApolloContextValue { + client?: ApolloClient; + renderPromises?: Record; +} +export declare function getApolloContext(): React.Context; +export declare function resetApolloContext(): void; diff --git a/packages/common/lib/context/ApolloContext.js b/packages/common/lib/context/ApolloContext.js new file mode 100644 index 0000000000..7479ce3f64 --- /dev/null +++ b/packages/common/lib/context/ApolloContext.js @@ -0,0 +1,12 @@ +import React from 'react'; +var apolloContext; +export function getApolloContext() { + if (!apolloContext) { + apolloContext = React.createContext({}); + } + return apolloContext; +} +export function resetApolloContext() { + apolloContext = React.createContext({}); +} +//# sourceMappingURL=ApolloContext.js.map \ No newline at end of file diff --git a/packages/common/lib/context/ApolloContext.js.map b/packages/common/lib/context/ApolloContext.js.map new file mode 100644 index 0000000000..56a8e4077d --- /dev/null +++ b/packages/common/lib/context/ApolloContext.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloContext.js","sourceRoot":"","sources":["../../src/context/ApolloContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,IAAI,aAAgD,CAAC;AAErD,MAAM,UAAU,gBAAgB;IAC9B,IAAI,CAAC,aAAa,EAAE;QAClB,aAAa,GAAG,KAAK,CAAC,aAAa,CAAqB,EAAE,CAAC,CAAC;KAC7D;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAqB,EAAE,CAAC,CAAC;AAC9D,CAAC"} \ No newline at end of file diff --git a/packages/common/lib/context/ApolloProvider.d.ts b/packages/common/lib/context/ApolloProvider.d.ts new file mode 100644 index 0000000000..830abd0b9f --- /dev/null +++ b/packages/common/lib/context/ApolloProvider.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +import ApolloClient from 'apollo-client'; +export interface ApolloProviderProps { + client: ApolloClient; + children: React.ReactNode; +} +export declare const ApolloProvider: React.FC>; diff --git a/packages/common/lib/context/ApolloProvider.js b/packages/common/lib/context/ApolloProvider.js new file mode 100644 index 0000000000..f4bfcf7b1d --- /dev/null +++ b/packages/common/lib/context/ApolloProvider.js @@ -0,0 +1,17 @@ +import React from 'react'; +import { invariant } from 'ts-invariant'; +import { getApolloContext } from './ApolloContext'; +export var ApolloProvider = function (_a) { + var client = _a.client, children = _a.children; + var ApolloContext = getApolloContext(); + return (React.createElement(ApolloContext.Consumer, null, function (context) { + if (context === void 0) { context = {}; } + if (client) { + context.client = client; + } + invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' + + 'sure you pass in your client via the "client" prop.'); + return (React.createElement(ApolloContext.Provider, { value: context }, children)); + })); +}; +//# sourceMappingURL=ApolloProvider.js.map \ No newline at end of file diff --git a/packages/common/lib/context/ApolloProvider.js.map b/packages/common/lib/context/ApolloProvider.js.map new file mode 100644 index 0000000000..7e34a514aa --- /dev/null +++ b/packages/common/lib/context/ApolloProvider.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloProvider.js","sourceRoot":"","sources":["../../src/context/ApolloProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAOnD,MAAM,CAAC,IAAM,cAAc,GAAuC,UAAC,EAGlE;QAFC,kBAAM,EACN,sBAAQ;IAER,IAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,QACpB,UAAC,OAAY;QAAZ,wBAAA,EAAA,YAAY;QACZ,IAAI,MAAM,EAAE;YACV,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;SACzB;QAED,SAAS,CACP,OAAO,CAAC,MAAM,EACd,wDAAwD;YACtD,qDAAqD,CACxD,CAAC;QAEF,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,IACnC,QAAQ,CACc,CAC1B,CAAC;IACJ,CAAC,CACsB,CAC1B,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/common/lib/index.d.ts b/packages/common/lib/index.d.ts new file mode 100644 index 0000000000..d6413f7ffa --- /dev/null +++ b/packages/common/lib/index.d.ts @@ -0,0 +1,4 @@ +export { ApolloContextValue, getApolloContext, resetApolloContext, } from './context/ApolloContext'; +export { ApolloProvider } from './context/ApolloProvider'; +export { ApolloConsumer } from './context/ApolloConsumer'; +export { parser, DocumentType, IDocumentDefinition } from './parser/parser'; diff --git a/packages/common/lib/index.js b/packages/common/lib/index.js new file mode 100644 index 0000000000..3967cea47f --- /dev/null +++ b/packages/common/lib/index.js @@ -0,0 +1,5 @@ +export { getApolloContext, resetApolloContext, } from './context/ApolloContext'; +export { ApolloProvider } from './context/ApolloProvider'; +export { ApolloConsumer } from './context/ApolloConsumer'; +export { parser, DocumentType } from './parser/parser'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/common/lib/index.js.map b/packages/common/lib/index.js.map new file mode 100644 index 0000000000..f5aa16e0eb --- /dev/null +++ b/packages/common/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,YAAY,EAAuB,MAAM,iBAAiB,CAAC"} \ No newline at end of file diff --git a/packages/common/lib/parser/parser.d.ts b/packages/common/lib/parser/parser.d.ts new file mode 100644 index 0000000000..65a1076732 --- /dev/null +++ b/packages/common/lib/parser/parser.d.ts @@ -0,0 +1,12 @@ +import { DocumentNode, VariableDefinitionNode } from 'graphql'; +export declare enum DocumentType { + Query = 0, + Mutation = 1, + Subscription = 2 +} +export interface IDocumentDefinition { + type: DocumentType; + name: string; + variables: ReadonlyArray; +} +export declare function parser(document: DocumentNode): IDocumentDefinition; diff --git a/packages/common/lib/parser/parser.js b/packages/common/lib/parser/parser.js new file mode 100644 index 0000000000..a12383b297 --- /dev/null +++ b/packages/common/lib/parser/parser.js @@ -0,0 +1,57 @@ +import { invariant } from 'ts-invariant'; +export var DocumentType; +(function (DocumentType) { + DocumentType[DocumentType["Query"] = 0] = "Query"; + DocumentType[DocumentType["Mutation"] = 1] = "Mutation"; + DocumentType[DocumentType["Subscription"] = 2] = "Subscription"; +})(DocumentType || (DocumentType = {})); +var cache = new Map(); +export function parser(document) { + var cached = cache.get(document); + if (cached) + return cached; + var variables, type, name; + invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " + + "DocumentNode. You may need to use 'graphql-tag' or another method " + + "to convert your operation into a document"); + var fragments = document.definitions.filter(function (x) { return x.kind === 'FragmentDefinition'; }); + var queries = document.definitions.filter(function (x) { + return x.kind === 'OperationDefinition' && x.operation === 'query'; + }); + var mutations = document.definitions.filter(function (x) { + return x.kind === 'OperationDefinition' && x.operation === 'mutation'; + }); + var subscriptions = document.definitions.filter(function (x) { + return x.kind === 'OperationDefinition' && x.operation === 'subscription'; + }); + invariant(!fragments.length || + (queries.length || mutations.length || subscriptions.length), "Passing only a fragment to 'graphql' is not yet supported. " + + "You must include a query, subscription or mutation as well"); + invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " + + (document + " had " + queries.length + " queries, " + subscriptions.length + " ") + + ("subscriptions and " + mutations.length + " mutations. ") + + "You can use 'compose' to join multiple operation types to a component"); + type = queries.length ? DocumentType.Query : DocumentType.Mutation; + if (!queries.length && !mutations.length) + type = DocumentType.Subscription; + var definitions = queries.length + ? queries + : mutations.length + ? mutations + : subscriptions; + invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " + + (definitions.length + " definitions. ") + + "You can use 'compose' to join multiple operation types to a component"); + var definition = definitions[0]; + variables = definition.variableDefinitions || []; + if (definition.name && definition.name.kind === 'Name') { + name = definition.name.value; + } + else { + name = 'data'; + } + var payload = { name: name, type: type, variables: variables }; + cache.set(document, payload); + return payload; +} +//# sourceMappingURL=parser.js.map \ No newline at end of file diff --git a/packages/common/lib/parser/parser.js.map b/packages/common/lib/parser/parser.js.map new file mode 100644 index 0000000000..4f54d21e30 --- /dev/null +++ b/packages/common/lib/parser/parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/packages/common/lib/react-common.cjs.js b/packages/common/lib/react-common.cjs.js new file mode 100644 index 0000000000..d7ac6a097c --- /dev/null +++ b/packages/common/lib/react-common.cjs.js @@ -0,0 +1,107 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var React = _interopDefault(require('react')); +var tsInvariant = require('ts-invariant'); + +var apolloContext; +function getApolloContext() { + if (!apolloContext) { + apolloContext = React.createContext({}); + } + return apolloContext; +} +function resetApolloContext() { + apolloContext = React.createContext({}); +} + +var ApolloProvider = function (_a) { + var client = _a.client, children = _a.children; + var ApolloContext = getApolloContext(); + return React.createElement(ApolloContext.Consumer, null, function (context) { + if (context === void 0) { context = {}; } + if (client) { + context.client = client; + } + process.env.NODE_ENV === "production" ? tsInvariant.invariant(context.client) : tsInvariant.invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' + + 'sure you pass in your client via the "client" prop.'); + return (React.createElement(ApolloContext.Provider, { value: context }, children)); + }); +}; + +var ApolloConsumer = function (props) { + var ApolloContext = getApolloContext(); + return React.createElement(ApolloContext.Consumer, null, function (context) { + if (!context || !context.client) { + throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError() : new tsInvariant.InvariantError('Could not find "client" in the context of ApolloConsumer. ' + + 'Wrap the root component in an .'); + } + return props.children(context.client); + }); +}; + + +(function (DocumentType) { + DocumentType[DocumentType["Query"] = 0] = "Query"; + DocumentType[DocumentType["Mutation"] = 1] = "Mutation"; + DocumentType[DocumentType["Subscription"] = 2] = "Subscription"; +})(exports.DocumentType || (exports.DocumentType = {})); +var cache = new Map(); +function parser(document) { + var cached = cache.get(document); + if (cached) + return cached; + var variables, type, name; + process.env.NODE_ENV === "production" ? tsInvariant.invariant(!!document && !!document.kind) : tsInvariant.invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " + + "DocumentNode. You may need to use 'graphql-tag' or another method " + + "to convert your operation into a document"); + var fragments = document.definitions.filter(function (x) { return x.kind === 'FragmentDefinition'; }); + var queries = document.definitions.filter(function (x) { + return x.kind === 'OperationDefinition' && x.operation === 'query'; + }); + var mutations = document.definitions.filter(function (x) { + return x.kind === 'OperationDefinition' && x.operation === 'mutation'; + }); + var subscriptions = document.definitions.filter(function (x) { + return x.kind === 'OperationDefinition' && x.operation === 'subscription'; + }); + process.env.NODE_ENV === "production" ? tsInvariant.invariant(!fragments.length || + (queries.length || mutations.length || subscriptions.length)) : tsInvariant.invariant(!fragments.length || + (queries.length || mutations.length || subscriptions.length), "Passing only a fragment to 'graphql' is not yet supported. " + + "You must include a query, subscription or mutation as well"); + process.env.NODE_ENV === "production" ? tsInvariant.invariant(queries.length + mutations.length + subscriptions.length <= 1) : tsInvariant.invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " + + (document + " had " + queries.length + " queries, " + subscriptions.length + " ") + + ("subscriptions and " + mutations.length + " mutations. ") + + "You can use 'compose' to join multiple operation types to a component"); + type = queries.length ? exports.DocumentType.Query : exports.DocumentType.Mutation; + if (!queries.length && !mutations.length) + type = exports.DocumentType.Subscription; + var definitions = queries.length + ? queries + : mutations.length + ? mutations + : subscriptions; + process.env.NODE_ENV === "production" ? tsInvariant.invariant(definitions.length === 1) : tsInvariant.invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " + + (definitions.length + " definitions. ") + + "You can use 'compose' to join multiple operation types to a component"); + var definition = definitions[0]; + variables = definition.variableDefinitions || []; + if (definition.name && definition.name.kind === 'Name') { + name = definition.name.value; + } + else { + name = 'data'; + } + var payload = { name: name, type: type, variables: variables }; + cache.set(document, payload); + return payload; +} + +exports.ApolloConsumer = ApolloConsumer; +exports.ApolloProvider = ApolloProvider; +exports.getApolloContext = getApolloContext; +exports.parser = parser; +exports.resetApolloContext = resetApolloContext; diff --git a/packages/common/lib/react-common.esm.js b/packages/common/lib/react-common.esm.js new file mode 100644 index 0000000000..556af4b934 --- /dev/null +++ b/packages/common/lib/react-common.esm.js @@ -0,0 +1,98 @@ +import React from 'react'; +import { invariant, InvariantError } from 'ts-invariant'; + +var apolloContext; +function getApolloContext() { + if (!apolloContext) { + apolloContext = React.createContext({}); + } + return apolloContext; +} +function resetApolloContext() { + apolloContext = React.createContext({}); +} + +var ApolloProvider = function (_a) { + var client = _a.client, children = _a.children; + var ApolloContext = getApolloContext(); + return React.createElement(ApolloContext.Consumer, null, function (context) { + if (context === void 0) { context = {}; } + if (client) { + context.client = client; + } + process.env.NODE_ENV === "production" ? invariant(context.client) : invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' + + 'sure you pass in your client via the "client" prop.'); + return (React.createElement(ApolloContext.Provider, { value: context }, children)); + }); +}; + +var ApolloConsumer = function (props) { + var ApolloContext = getApolloContext(); + return React.createElement(ApolloContext.Consumer, null, function (context) { + if (!context || !context.client) { + throw process.env.NODE_ENV === "production" ? new InvariantError() : new InvariantError('Could not find "client" in the context of ApolloConsumer. ' + + 'Wrap the root component in an .'); + } + return props.children(context.client); + }); +}; + +var DocumentType; +(function (DocumentType) { + DocumentType[DocumentType["Query"] = 0] = "Query"; + DocumentType[DocumentType["Mutation"] = 1] = "Mutation"; + DocumentType[DocumentType["Subscription"] = 2] = "Subscription"; +})(DocumentType || (DocumentType = {})); +var cache = new Map(); +function parser(document) { + var cached = cache.get(document); + if (cached) + return cached; + var variables, type, name; + process.env.NODE_ENV === "production" ? invariant(!!document && !!document.kind) : invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " + + "DocumentNode. You may need to use 'graphql-tag' or another method " + + "to convert your operation into a document"); + var fragments = document.definitions.filter(function (x) { return x.kind === 'FragmentDefinition'; }); + var queries = document.definitions.filter(function (x) { + return x.kind === 'OperationDefinition' && x.operation === 'query'; + }); + var mutations = document.definitions.filter(function (x) { + return x.kind === 'OperationDefinition' && x.operation === 'mutation'; + }); + var subscriptions = document.definitions.filter(function (x) { + return x.kind === 'OperationDefinition' && x.operation === 'subscription'; + }); + process.env.NODE_ENV === "production" ? invariant(!fragments.length || + (queries.length || mutations.length || subscriptions.length)) : invariant(!fragments.length || + (queries.length || mutations.length || subscriptions.length), "Passing only a fragment to 'graphql' is not yet supported. " + + "You must include a query, subscription or mutation as well"); + process.env.NODE_ENV === "production" ? invariant(queries.length + mutations.length + subscriptions.length <= 1) : invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " + + (document + " had " + queries.length + " queries, " + subscriptions.length + " ") + + ("subscriptions and " + mutations.length + " mutations. ") + + "You can use 'compose' to join multiple operation types to a component"); + type = queries.length ? DocumentType.Query : DocumentType.Mutation; + if (!queries.length && !mutations.length) + type = DocumentType.Subscription; + var definitions = queries.length + ? queries + : mutations.length + ? mutations + : subscriptions; + process.env.NODE_ENV === "production" ? invariant(definitions.length === 1) : invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " + + (definitions.length + " definitions. ") + + "You can use 'compose' to join multiple operation types to a component"); + var definition = definitions[0]; + variables = definition.variableDefinitions || []; + if (definition.name && definition.name.kind === 'Name') { + name = definition.name.value; + } + else { + name = 'data'; + } + var payload = { name: name, type: type, variables: variables }; + cache.set(document, payload); + return payload; +} + +export { ApolloConsumer, ApolloProvider, DocumentType, getApolloContext, parser, resetApolloContext }; +//# sourceMappingURL=react-common.esm.js.map diff --git a/packages/common/lib/react-common.esm.js.map b/packages/common/lib/react-common.esm.js.map new file mode 100644 index 0000000000..62ab59cb8c --- /dev/null +++ b/packages/common/lib/react-common.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"react-common.esm.js","sources":["../src/context/ApolloContext.js","../src/context/ApolloProvider.js","../src/context/ApolloConsumer.js","../src/parser/parser.js"],"sourcesContent":["import React from 'react';\nvar apolloContext;\nexport function getApolloContext() {\n if (!apolloContext) {\n apolloContext = React.createContext({});\n }\n return apolloContext;\n}\nexport function resetApolloContext() {\n apolloContext = React.createContext({});\n}\n//# sourceMappingURL=ApolloContext.js.map","import React from 'react';\nimport { invariant } from 'ts-invariant';\nimport { getApolloContext } from './ApolloContext';\nexport var ApolloProvider = function (_a) {\n var client = _a.client, children = _a.children;\n var ApolloContext = getApolloContext();\n return (React.createElement(ApolloContext.Consumer, null, function (context) {\n if (context === void 0) { context = {}; }\n if (client) {\n context.client = client;\n }\n invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +\n 'sure you pass in your client via the \"client\" prop.');\n return (React.createElement(ApolloContext.Provider, { value: context }, children));\n }));\n};\n//# sourceMappingURL=ApolloProvider.js.map","import React from 'react';\nimport { InvariantError } from 'ts-invariant';\nimport { getApolloContext } from './ApolloContext';\nexport var ApolloConsumer = function (props) {\n var ApolloContext = getApolloContext();\n return (React.createElement(ApolloContext.Consumer, null, function (context) {\n if (!context || !context.client) {\n throw new InvariantError('Could not find \"client\" in the context of ApolloConsumer. ' +\n 'Wrap the root component in an .');\n }\n return props.children(context.client);\n }));\n};\n//# sourceMappingURL=ApolloConsumer.js.map","import { invariant } from 'ts-invariant';\nexport var DocumentType;\n(function (DocumentType) {\n DocumentType[DocumentType[\"Query\"] = 0] = \"Query\";\n DocumentType[DocumentType[\"Mutation\"] = 1] = \"Mutation\";\n DocumentType[DocumentType[\"Subscription\"] = 2] = \"Subscription\";\n})(DocumentType || (DocumentType = {}));\nvar cache = new Map();\nexport function parser(document) {\n var cached = cache.get(document);\n if (cached)\n return cached;\n var variables, type, name;\n invariant(!!document && !!document.kind, \"Argument of \" + document + \" passed to parser was not a valid GraphQL \" +\n \"DocumentNode. You may need to use 'graphql-tag' or another method \" +\n \"to convert your operation into a document\");\n var fragments = document.definitions.filter(function (x) { return x.kind === 'FragmentDefinition'; });\n var queries = document.definitions.filter(function (x) {\n return x.kind === 'OperationDefinition' && x.operation === 'query';\n });\n var mutations = document.definitions.filter(function (x) {\n return x.kind === 'OperationDefinition' && x.operation === 'mutation';\n });\n var subscriptions = document.definitions.filter(function (x) {\n return x.kind === 'OperationDefinition' && x.operation === 'subscription';\n });\n invariant(!fragments.length ||\n (queries.length || mutations.length || subscriptions.length), \"Passing only a fragment to 'graphql' is not yet supported. \" +\n \"You must include a query, subscription or mutation as well\");\n invariant(queries.length + mutations.length + subscriptions.length <= 1, \"react-apollo only supports a query, subscription, or a mutation per HOC. \" +\n (document + \" had \" + queries.length + \" queries, \" + subscriptions.length + \" \") +\n (\"subscriptions and \" + mutations.length + \" mutations. \") +\n \"You can use 'compose' to join multiple operation types to a component\");\n type = queries.length ? DocumentType.Query : DocumentType.Mutation;\n if (!queries.length && !mutations.length)\n type = DocumentType.Subscription;\n var definitions = queries.length\n ? queries\n : mutations.length\n ? mutations\n : subscriptions;\n invariant(definitions.length === 1, \"react-apollo only supports one definition per HOC. \" + document + \" had \" +\n (definitions.length + \" definitions. \") +\n \"You can use 'compose' to join multiple operation types to a component\");\n var definition = definitions[0];\n variables = definition.variableDefinitions || [];\n if (definition.name && definition.name.kind === 'Name') {\n name = definition.name.value;\n }\n else {\n name = 'data';\n }\n var payload = { name: name, type: type, variables: variables };\n cache.set(document, payload);\n return payload;\n}\n//# sourceMappingURL=parser.js.map"],"names":[],"mappings":";;;AACA,IAAI,aAAa,CAAC;AAClB,AAAO,SAAS,gBAAgB,GAAG;IAC/B,IAAI,CAAC,aAAa,EAAE;QAChB,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;KAC3C;IACD,OAAO,aAAa,CAAC;CACxB;AACD,AAAO,SAAS,kBAAkB,GAAG;IACjC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;CAC3C;;ACPS,IAAC,cAAc,GAAG,UAAU,EAAE,EAAE;IACtC,IAAI,MAAM,GAAG,EAAE,CAAC,MAAM,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;IAC/C,IAAI,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACvC,OAAO,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE;QACxE,IAAI,OAAO,KAAK,KAAK,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,CAAC,EAAE;QACzC,IAAI,MAAM,EAAE;YACR,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;SAC3B;QACD,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,wDAAwD;YAClJ,qDAAqD,CAAC,CAAC;QAC3D,QAAQ,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,CAAC,EAAE;KACtF,CAAC,CAAC;CACN;;ACZS,IAAC,cAAc,GAAG,UAAU,KAAK,EAAE;IACzC,IAAI,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACvC,OAAO,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE;QACxE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAC7B,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,GAAG,IAAI,cAAc,EAAE,GAAG,IAAI,cAAc,CAAC,4DAA4D;gBAChJ,iDAAiD,CAAC,CAAC;SAC1D;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;KACzC,CAAC,CAAC;CACN;;ACXS,IAAC,YAAY,CAAC;AACxB,CAAC,UAAU,YAAY,EAAE;IACrB,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC;IAClD,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;IACxD,YAAY,CAAC,YAAY,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,cAAc,CAAC;CACnE,EAAE,YAAY,KAAK,YAAY,GAAG,EAAE,CAAC,CAAC,CAAC;AACxC,IAAI,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;AACtB,AAAO,SAAS,MAAM,CAAC,QAAQ,EAAE;IAC7B,IAAI,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjC,IAAI,MAAM;QACN,OAAO,MAAM,CAAC;IAClB,IAAI,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC;IAC1B,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,QAAQ,GAAG,4CAA4C;QAChM,oEAAoE;QACpE,2CAA2C,CAAC,CAAC;IACjD,IAAI,SAAS,GAAG,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,IAAI,KAAK,oBAAoB,CAAC,EAAE,CAAC,CAAC;IACtG,IAAI,OAAO,GAAG,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;QACnD,OAAO,CAAC,CAAC,IAAI,KAAK,qBAAqB,IAAI,CAAC,CAAC,SAAS,KAAK,OAAO,CAAC;KACtE,CAAC,CAAC;IACH,IAAI,SAAS,GAAG,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;QACrD,OAAO,CAAC,CAAC,IAAI,KAAK,qBAAqB,IAAI,CAAC,CAAC,SAAS,KAAK,UAAU,CAAC;KACzE,CAAC,CAAC;IACH,IAAI,aAAa,GAAG,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;QACzD,OAAO,CAAC,CAAC,IAAI,KAAK,qBAAqB,IAAI,CAAC,CAAC,SAAS,KAAK,cAAc,CAAC;KAC7E,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,GAAG,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM;SAC9D,OAAO,CAAC,MAAM,IAAI,SAAS,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM;SAC1F,OAAO,CAAC,MAAM,IAAI,SAAS,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE,6DAA6D;QAC3H,4DAA4D,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,IAAI,CAAC,EAAE,2EAA2E;SAClQ,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,YAAY,GAAG,aAAa,CAAC,MAAM,GAAG,GAAG,CAAC;SAChF,oBAAoB,GAAG,SAAS,CAAC,MAAM,GAAG,cAAc,CAAC;QAC1D,uEAAuE,CAAC,CAAC;IAC7E,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,YAAY,CAAC,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC;IACnE,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM;QACpC,IAAI,GAAG,YAAY,CAAC,YAAY,CAAC;IACrC,IAAI,WAAW,GAAG,OAAO,CAAC,MAAM;UAC1B,OAAO;UACP,SAAS,CAAC,MAAM;cACZ,SAAS;cACT,aAAa,CAAC;IACxB,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,GAAG,SAAS,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,GAAG,SAAS,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,qDAAqD,GAAG,QAAQ,GAAG,OAAO;SACvL,WAAW,CAAC,MAAM,GAAG,gBAAgB,CAAC;QACvC,uEAAuE,CAAC,CAAC;IAC7E,IAAI,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IAChC,SAAS,GAAG,UAAU,CAAC,mBAAmB,IAAI,EAAE,CAAC;IACjD,IAAI,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE;QACpD,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;KAChC;SACI;QACD,IAAI,GAAG,MAAM,CAAC;KACjB;IACD,IAAI,OAAO,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;IAC/D,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC7B,OAAO,OAAO,CAAC;CAClB;;;;"} \ No newline at end of file diff --git a/packages/common/lib/react-common.umd.js b/packages/common/lib/react-common.umd.js new file mode 100644 index 0000000000..25571f65b4 --- /dev/null +++ b/packages/common/lib/react-common.umd.js @@ -0,0 +1,110 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('ts-invariant')) : + typeof define === 'function' && define.amd ? define(['exports', 'react', 'ts-invariant'], factory) : + (global = global || self, factory(global['react-common'] = {}, global.React, global.invariant)); +}(this, function (exports, React, tsInvariant) { 'use strict'; + + React = React && React.hasOwnProperty('default') ? React['default'] : React; + + var apolloContext; + function getApolloContext() { + if (!apolloContext) { + apolloContext = React.createContext({}); + } + return apolloContext; + } + function resetApolloContext() { + apolloContext = React.createContext({}); + } + + var ApolloProvider = function (_a) { + var client = _a.client, children = _a.children; + var ApolloContext = getApolloContext(); + return React.createElement(ApolloContext.Consumer, null, function (context) { + if (context === void 0) { context = {}; } + if (client) { + context.client = client; + } + process.env.NODE_ENV === "production" ? tsInvariant.invariant(context.client) : tsInvariant.invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' + + 'sure you pass in your client via the "client" prop.'); + return (React.createElement(ApolloContext.Provider, { value: context }, children)); + }); + }; + + var ApolloConsumer = function (props) { + var ApolloContext = getApolloContext(); + return React.createElement(ApolloContext.Consumer, null, function (context) { + if (!context || !context.client) { + throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError() : new tsInvariant.InvariantError('Could not find "client" in the context of ApolloConsumer. ' + + 'Wrap the root component in an .'); + } + return props.children(context.client); + }); + }; + + + (function (DocumentType) { + DocumentType[DocumentType["Query"] = 0] = "Query"; + DocumentType[DocumentType["Mutation"] = 1] = "Mutation"; + DocumentType[DocumentType["Subscription"] = 2] = "Subscription"; + })(exports.DocumentType || (exports.DocumentType = {})); + var cache = new Map(); + function parser(document) { + var cached = cache.get(document); + if (cached) + return cached; + var variables, type, name; + process.env.NODE_ENV === "production" ? tsInvariant.invariant(!!document && !!document.kind) : tsInvariant.invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " + + "DocumentNode. You may need to use 'graphql-tag' or another method " + + "to convert your operation into a document"); + var fragments = document.definitions.filter(function (x) { return x.kind === 'FragmentDefinition'; }); + var queries = document.definitions.filter(function (x) { + return x.kind === 'OperationDefinition' && x.operation === 'query'; + }); + var mutations = document.definitions.filter(function (x) { + return x.kind === 'OperationDefinition' && x.operation === 'mutation'; + }); + var subscriptions = document.definitions.filter(function (x) { + return x.kind === 'OperationDefinition' && x.operation === 'subscription'; + }); + process.env.NODE_ENV === "production" ? tsInvariant.invariant(!fragments.length || + (queries.length || mutations.length || subscriptions.length)) : tsInvariant.invariant(!fragments.length || + (queries.length || mutations.length || subscriptions.length), "Passing only a fragment to 'graphql' is not yet supported. " + + "You must include a query, subscription or mutation as well"); + process.env.NODE_ENV === "production" ? tsInvariant.invariant(queries.length + mutations.length + subscriptions.length <= 1) : tsInvariant.invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " + + (document + " had " + queries.length + " queries, " + subscriptions.length + " ") + + ("subscriptions and " + mutations.length + " mutations. ") + + "You can use 'compose' to join multiple operation types to a component"); + type = queries.length ? exports.DocumentType.Query : exports.DocumentType.Mutation; + if (!queries.length && !mutations.length) + type = exports.DocumentType.Subscription; + var definitions = queries.length + ? queries + : mutations.length + ? mutations + : subscriptions; + process.env.NODE_ENV === "production" ? tsInvariant.invariant(definitions.length === 1) : tsInvariant.invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " + + (definitions.length + " definitions. ") + + "You can use 'compose' to join multiple operation types to a component"); + var definition = definitions[0]; + variables = definition.variableDefinitions || []; + if (definition.name && definition.name.kind === 'Name') { + name = definition.name.value; + } + else { + name = 'data'; + } + var payload = { name: name, type: type, variables: variables }; + cache.set(document, payload); + return payload; + } + + exports.ApolloConsumer = ApolloConsumer; + exports.ApolloProvider = ApolloProvider; + exports.getApolloContext = getApolloContext; + exports.parser = parser; + exports.resetApolloContext = resetApolloContext; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); diff --git a/packages/common/package.json b/packages/common/package.json new file mode 100644 index 0000000000..45b2c9a603 --- /dev/null +++ b/packages/common/package.json @@ -0,0 +1,47 @@ +{ + "name": "@apollo/react-common", + "description": "React Apollo common utilities.", + "version": "0.0.1", + "author": "opensource@apollographql.com", + "keywords": [ + "apollo", + "graphql", + "react" + ], + "license": "MIT", + "main": "./lib/react-common.cjs.js", + "module": "./lib/react-common.esm.js", + "typings": "./lib/index.d.ts", + "repository": { + "type": "git", + "url": "apollographql/react-apollo" + }, + "sideEffects": false, + "scripts": { + "clean": "rm -Rf ./node_modules ./lib/* ./meta/bundlesize/* ./meta/coverage/*", + "prepare": "npm run build", + "prebuild": "npm run clean", + "build": "tsc -p ./config/tsconfig.json", + "postbuild": "../../node_modules/rollup/bin/rollup -c ./config/rollup.config.js", + "watch": "tsc-watch --onSuccess \"npm run postbuild\"", + "predeploy": "npm run build", + "deploy": "npm publish", + "test": "jest --config ./config/jest.config.js", + "test:watch": "jest --config ./config/jest.config.js --watch", + "test:full": "npm run type-check && jest --config ./config/jest.config.js --coverage" + }, + "peerDependencies": { + "apollo-client": "^2.5.1", + "react": "^16.8.6", + "graphql": "^14.2.1" + }, + "dependencies": { + "ts-invariant": "^0.4.0", + "tslib": "^1.9.3" + }, + "files": [ + "./README.md", + "./package.json", + "./lib" + ] +} diff --git a/packages/common/src/context/ApolloConsumer.d.ts b/packages/common/src/context/ApolloConsumer.d.ts new file mode 100644 index 0000000000..7526d9dc04 --- /dev/null +++ b/packages/common/src/context/ApolloConsumer.d.ts @@ -0,0 +1,6 @@ +import React from 'react'; +import ApolloClient from 'apollo-client'; +export interface ApolloConsumerProps { + children: (client: ApolloClient) => React.ReactElement | null; +} +export declare const ApolloConsumer: React.FC; diff --git a/packages/common/src/context/ApolloConsumer.js b/packages/common/src/context/ApolloConsumer.js new file mode 100644 index 0000000000..14653441cf --- /dev/null +++ b/packages/common/src/context/ApolloConsumer.js @@ -0,0 +1,14 @@ +import React from 'react'; +import { InvariantError } from 'ts-invariant'; +import { getApolloContext } from './ApolloContext'; +export var ApolloConsumer = function (props) { + var ApolloContext = getApolloContext(); + return (React.createElement(ApolloContext.Consumer, null, function (context) { + if (!context || !context.client) { + throw new InvariantError('Could not find "client" in the context of ApolloConsumer. ' + + 'Wrap the root component in an .'); + } + return props.children(context.client); + })); +}; +//# sourceMappingURL=ApolloConsumer.js.map \ No newline at end of file diff --git a/packages/common/src/context/ApolloConsumer.js.map b/packages/common/src/context/ApolloConsumer.js.map new file mode 100644 index 0000000000..fb88b21549 --- /dev/null +++ b/packages/common/src/context/ApolloConsumer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloConsumer.js","sourceRoot":"","sources":["ApolloConsumer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAMnD,MAAM,CAAC,IAAM,cAAc,GAAkC,UAAA,KAAK;IAChE,IAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,QACpB,UAAC,OAAY;QACZ,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAC/B,MAAM,IAAI,cAAc,CACtB,4DAA4D;gBAC1D,iDAAiD,CACpD,CAAC;SACH;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC,CACsB,CAC1B,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/src/ApolloConsumer.tsx b/packages/common/src/context/ApolloConsumer.tsx similarity index 76% rename from src/ApolloConsumer.tsx rename to packages/common/src/context/ApolloConsumer.tsx index 7f66979e35..7245289330 100644 --- a/src/ApolloConsumer.tsx +++ b/packages/common/src/context/ApolloConsumer.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import ApolloClient from 'apollo-client'; import { InvariantError } from 'ts-invariant'; @@ -8,8 +8,7 @@ export interface ApolloConsumerProps { children: (client: ApolloClient) => React.ReactElement | null; } - -const ApolloConsumer: React.FC = (props) => { +export const ApolloConsumer: React.FC = props => { const ApolloContext = getApolloContext(); return ( @@ -17,7 +16,7 @@ const ApolloConsumer: React.FC = (props) => { if (!context || !context.client) { throw new InvariantError( 'Could not find "client" in the context of ApolloConsumer. ' + - 'Wrap the root component in an .' + 'Wrap the root component in an .', ); } return props.children(context.client); @@ -25,5 +24,3 @@ const ApolloConsumer: React.FC = (props) => { ); }; - -export default ApolloConsumer; diff --git a/packages/common/src/context/ApolloContext.d.ts b/packages/common/src/context/ApolloContext.d.ts new file mode 100644 index 0000000000..872e003e6e --- /dev/null +++ b/packages/common/src/context/ApolloContext.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import ApolloClient from 'apollo-client'; +export interface ApolloContextValue { + client?: ApolloClient; + renderPromises?: Record; +} +export declare function getApolloContext(): React.Context; +export declare function resetApolloContext(): void; diff --git a/packages/common/src/context/ApolloContext.js b/packages/common/src/context/ApolloContext.js new file mode 100644 index 0000000000..7479ce3f64 --- /dev/null +++ b/packages/common/src/context/ApolloContext.js @@ -0,0 +1,12 @@ +import React from 'react'; +var apolloContext; +export function getApolloContext() { + if (!apolloContext) { + apolloContext = React.createContext({}); + } + return apolloContext; +} +export function resetApolloContext() { + apolloContext = React.createContext({}); +} +//# sourceMappingURL=ApolloContext.js.map \ No newline at end of file diff --git a/packages/common/src/context/ApolloContext.js.map b/packages/common/src/context/ApolloContext.js.map new file mode 100644 index 0000000000..2686d28e46 --- /dev/null +++ b/packages/common/src/context/ApolloContext.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloContext.js","sourceRoot":"","sources":["ApolloContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,IAAI,aAAgD,CAAC;AAErD,MAAM,UAAU,gBAAgB;IAC9B,IAAI,CAAC,aAAa,EAAE;QAClB,aAAa,GAAG,KAAK,CAAC,aAAa,CAAqB,EAAE,CAAC,CAAC;KAC7D;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAqB,EAAE,CAAC,CAAC;AAC9D,CAAC"} \ No newline at end of file diff --git a/src/ApolloContext.ts b/packages/common/src/context/ApolloContext.ts similarity index 83% rename from src/ApolloContext.ts rename to packages/common/src/context/ApolloContext.ts index e6b9a13ba1..db132cf42f 100644 --- a/src/ApolloContext.ts +++ b/packages/common/src/context/ApolloContext.ts @@ -1,11 +1,9 @@ import React from 'react'; import ApolloClient from 'apollo-client'; -import { RenderPromises } from './getDataFromTree'; - export interface ApolloContextValue { client?: ApolloClient; - renderPromises?: RenderPromises; + renderPromises?: Record; } let apolloContext: React.Context; diff --git a/packages/common/src/context/ApolloProvider.d.ts b/packages/common/src/context/ApolloProvider.d.ts new file mode 100644 index 0000000000..830abd0b9f --- /dev/null +++ b/packages/common/src/context/ApolloProvider.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +import ApolloClient from 'apollo-client'; +export interface ApolloProviderProps { + client: ApolloClient; + children: React.ReactNode; +} +export declare const ApolloProvider: React.FC>; diff --git a/packages/common/src/context/ApolloProvider.js b/packages/common/src/context/ApolloProvider.js new file mode 100644 index 0000000000..f4bfcf7b1d --- /dev/null +++ b/packages/common/src/context/ApolloProvider.js @@ -0,0 +1,17 @@ +import React from 'react'; +import { invariant } from 'ts-invariant'; +import { getApolloContext } from './ApolloContext'; +export var ApolloProvider = function (_a) { + var client = _a.client, children = _a.children; + var ApolloContext = getApolloContext(); + return (React.createElement(ApolloContext.Consumer, null, function (context) { + if (context === void 0) { context = {}; } + if (client) { + context.client = client; + } + invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' + + 'sure you pass in your client via the "client" prop.'); + return (React.createElement(ApolloContext.Provider, { value: context }, children)); + })); +}; +//# sourceMappingURL=ApolloProvider.js.map \ No newline at end of file diff --git a/packages/common/src/context/ApolloProvider.js.map b/packages/common/src/context/ApolloProvider.js.map new file mode 100644 index 0000000000..b5a2002c97 --- /dev/null +++ b/packages/common/src/context/ApolloProvider.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloProvider.js","sourceRoot":"","sources":["ApolloProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAOnD,MAAM,CAAC,IAAM,cAAc,GAAuC,UAAC,EAGlE;QAFC,kBAAM,EACN,sBAAQ;IAER,IAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,QACpB,UAAC,OAAY;QAAZ,wBAAA,EAAA,YAAY;QACZ,IAAI,MAAM,EAAE;YACV,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;SACzB;QAED,SAAS,CACP,OAAO,CAAC,MAAM,EACd,wDAAwD;YACtD,qDAAqD,CACxD,CAAC;QAEF,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,IACnC,QAAQ,CACc,CAC1B,CAAC;IACJ,CAAC,CACsB,CAC1B,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/common/src/context/ApolloProvider.tsx b/packages/common/src/context/ApolloProvider.tsx new file mode 100644 index 0000000000..8a79ef9b9b --- /dev/null +++ b/packages/common/src/context/ApolloProvider.tsx @@ -0,0 +1,38 @@ +import React from 'react'; +import ApolloClient from 'apollo-client'; +import { invariant } from 'ts-invariant'; + +import { getApolloContext } from './ApolloContext'; + +export interface ApolloProviderProps { + client: ApolloClient; + children: React.ReactNode; +} + +export const ApolloProvider: React.FC> = ({ + client, + children, +}) => { + const ApolloContext = getApolloContext(); + return ( + + {(context = {}) => { + if (client) { + context.client = client; + } + + invariant( + context.client, + 'ApolloProvider was not passed a client instance. Make ' + + 'sure you pass in your client via the "client" prop.', + ); + + return ( + + {children} + + ); + }} + + ); +}; diff --git a/test/client/ApolloConsumer.test.tsx b/packages/common/src/context/__tests__/ApolloConsumer.test.tsx similarity index 88% rename from test/client/ApolloConsumer.test.tsx rename to packages/common/src/context/__tests__/ApolloConsumer.test.tsx index 01fd5fda7b..43a03cc368 100644 --- a/test/client/ApolloConsumer.test.tsx +++ b/packages/common/src/context/__tests__/ApolloConsumer.test.tsx @@ -1,10 +1,13 @@ -import * as React from 'react'; +import React from 'react'; import ApolloClient from 'apollo-client'; import { InMemoryCache as Cache } from 'apollo-cache-inmemory'; import { ApolloLink } from 'apollo-link'; -import { ApolloProvider, ApolloConsumer, getApolloContext } from '../../src'; import { mount } from 'enzyme'; +import { ApolloProvider } from '../ApolloProvider'; +import { ApolloConsumer } from '../ApolloConsumer'; +import { getApolloContext } from '../ApolloContext'; + const client = new ApolloClient({ cache: new Cache(), link: new ApolloLink((o, f) => (f ? f(o) : null)), @@ -51,7 +54,7 @@ describe(' component', () => { mount( {() => null} - + , ); }).toThrowError( 'Could not find "client" in the context of ApolloConsumer. Wrap the root component in an ', diff --git a/test/client/ApolloProvider.test.tsx b/packages/common/src/context/__tests__/ApolloProvider.test.tsx similarity index 93% rename from test/client/ApolloProvider.test.tsx rename to packages/common/src/context/__tests__/ApolloProvider.test.tsx index 78bc563e4b..8581301de3 100644 --- a/test/client/ApolloProvider.test.tsx +++ b/packages/common/src/context/__tests__/ApolloProvider.test.tsx @@ -1,11 +1,12 @@ -import * as React from 'react'; -import * as TestUtils from 'react-dom/test-utils'; +import React from 'react'; +import TestUtils from 'react-dom/test-utils'; import { shallow, mount } from 'enzyme'; import ApolloClient from 'apollo-client'; import { InMemoryCache as Cache } from 'apollo-cache-inmemory'; import { ApolloLink } from 'apollo-link'; -import { ApolloProvider, getApolloContext } from '../../src'; +import { ApolloProvider } from '../ApolloProvider'; +import { getApolloContext } from '../ApolloContext'; describe(' Component', () => { const client = new ApolloClient({ @@ -84,7 +85,7 @@ describe(' Component', () => {
- + , ); }).toThrowError( 'ApolloProvider was not passed a client instance. Make ' + @@ -97,7 +98,7 @@ describe(' Component', () => { const wrapper = mount(
- + , ); expect(wrapper.contains(
)).toBeTruthy(); }); @@ -107,11 +108,11 @@ describe(' Component', () => { - + , ); const children = wrapper.find(Child); expect(children).toHaveLength(2); - children.forEach((node) => { + children.forEach(node => { expect(node.instance().context.client).toEqual(client); }); }); diff --git a/packages/common/src/index.d.ts b/packages/common/src/index.d.ts new file mode 100644 index 0000000000..d6413f7ffa --- /dev/null +++ b/packages/common/src/index.d.ts @@ -0,0 +1,4 @@ +export { ApolloContextValue, getApolloContext, resetApolloContext, } from './context/ApolloContext'; +export { ApolloProvider } from './context/ApolloProvider'; +export { ApolloConsumer } from './context/ApolloConsumer'; +export { parser, DocumentType, IDocumentDefinition } from './parser/parser'; diff --git a/packages/common/src/index.js b/packages/common/src/index.js new file mode 100644 index 0000000000..3967cea47f --- /dev/null +++ b/packages/common/src/index.js @@ -0,0 +1,5 @@ +export { getApolloContext, resetApolloContext, } from './context/ApolloContext'; +export { ApolloProvider } from './context/ApolloProvider'; +export { ApolloConsumer } from './context/ApolloConsumer'; +export { parser, DocumentType } from './parser/parser'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/common/src/index.js.map b/packages/common/src/index.js.map new file mode 100644 index 0000000000..89fbafb522 --- /dev/null +++ b/packages/common/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,YAAY,EAAuB,MAAM,iBAAiB,CAAC"} \ No newline at end of file diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts new file mode 100644 index 0000000000..a6e313f259 --- /dev/null +++ b/packages/common/src/index.ts @@ -0,0 +1,8 @@ +export { + ApolloContextValue, + getApolloContext, + resetApolloContext, +} from './context/ApolloContext'; +export { ApolloProvider } from './context/ApolloProvider'; +export { ApolloConsumer } from './context/ApolloConsumer'; +export { parser, DocumentType, IDocumentDefinition } from './parser/parser'; diff --git a/test/internal-api/parser.test.ts b/packages/common/src/parser/__tests__/parser.test.ts similarity index 88% rename from test/internal-api/parser.test.ts rename to packages/common/src/parser/__tests__/parser.test.ts index d586ba8a5d..424d6f74a2 100644 --- a/test/internal-api/parser.test.ts +++ b/packages/common/src/parser/__tests__/parser.test.ts @@ -1,15 +1,9 @@ import gql from 'graphql-tag'; -import { parser, DocumentType } from '../../src/parser'; +import { parser, DocumentType } from '../parser'; -// import { OperationDefinition } from 'graphql'; FIXME: Doesn't exist anymore type OperationDefinition = any; describe('parser', () => { - // XXX can this be tested with strictly typed functions? - // it('should error on an invalid document', () => { - // expect(parser('{ user { name } }')).to.throw(); - // }); - it('should error if both a query and a mutation is present', () => { const query = gql` query { @@ -52,9 +46,9 @@ describe('parser', () => { const query = ` query One { user { name } } `; - expect( - parser.bind(null, query as any) - ).toThrowError(/not a valid GraphQL DocumentNode/); + expect(parser.bind(null, query as any)).toThrowError( + /not a valid GraphQL DocumentNode/, + ); }); it('should return the name of the operation', () => { @@ -191,7 +185,9 @@ describe('parser', () => { } `; definition = subscription.definitions[0] as OperationDefinition; - expect(parser(subscription).variables).toEqual(definition.variableDefinitions); + expect(parser(subscription).variables).toEqual( + definition.variableDefinitions, + ); }); it('should not error if the operation has no variables', () => { @@ -223,6 +219,8 @@ describe('parser', () => { } `; definition = subscription.definitions[0] as OperationDefinition; - expect(parser(subscription).variables).toEqual(definition.variableDefinitions); + expect(parser(subscription).variables).toEqual( + definition.variableDefinitions, + ); }); }); diff --git a/packages/common/src/parser/parser.d.ts b/packages/common/src/parser/parser.d.ts new file mode 100644 index 0000000000..65a1076732 --- /dev/null +++ b/packages/common/src/parser/parser.d.ts @@ -0,0 +1,12 @@ +import { DocumentNode, VariableDefinitionNode } from 'graphql'; +export declare enum DocumentType { + Query = 0, + Mutation = 1, + Subscription = 2 +} +export interface IDocumentDefinition { + type: DocumentType; + name: string; + variables: ReadonlyArray; +} +export declare function parser(document: DocumentNode): IDocumentDefinition; diff --git a/packages/common/src/parser/parser.js b/packages/common/src/parser/parser.js new file mode 100644 index 0000000000..a12383b297 --- /dev/null +++ b/packages/common/src/parser/parser.js @@ -0,0 +1,57 @@ +import { invariant } from 'ts-invariant'; +export var DocumentType; +(function (DocumentType) { + DocumentType[DocumentType["Query"] = 0] = "Query"; + DocumentType[DocumentType["Mutation"] = 1] = "Mutation"; + DocumentType[DocumentType["Subscription"] = 2] = "Subscription"; +})(DocumentType || (DocumentType = {})); +var cache = new Map(); +export function parser(document) { + var cached = cache.get(document); + if (cached) + return cached; + var variables, type, name; + invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " + + "DocumentNode. You may need to use 'graphql-tag' or another method " + + "to convert your operation into a document"); + var fragments = document.definitions.filter(function (x) { return x.kind === 'FragmentDefinition'; }); + var queries = document.definitions.filter(function (x) { + return x.kind === 'OperationDefinition' && x.operation === 'query'; + }); + var mutations = document.definitions.filter(function (x) { + return x.kind === 'OperationDefinition' && x.operation === 'mutation'; + }); + var subscriptions = document.definitions.filter(function (x) { + return x.kind === 'OperationDefinition' && x.operation === 'subscription'; + }); + invariant(!fragments.length || + (queries.length || mutations.length || subscriptions.length), "Passing only a fragment to 'graphql' is not yet supported. " + + "You must include a query, subscription or mutation as well"); + invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " + + (document + " had " + queries.length + " queries, " + subscriptions.length + " ") + + ("subscriptions and " + mutations.length + " mutations. ") + + "You can use 'compose' to join multiple operation types to a component"); + type = queries.length ? DocumentType.Query : DocumentType.Mutation; + if (!queries.length && !mutations.length) + type = DocumentType.Subscription; + var definitions = queries.length + ? queries + : mutations.length + ? mutations + : subscriptions; + invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " + + (definitions.length + " definitions. ") + + "You can use 'compose' to join multiple operation types to a component"); + var definition = definitions[0]; + variables = definition.variableDefinitions || []; + if (definition.name && definition.name.kind === 'Name') { + name = definition.name.value; + } + else { + name = 'data'; + } + var payload = { name: name, type: type, variables: variables }; + cache.set(document, payload); + return payload; +} +//# sourceMappingURL=parser.js.map \ No newline at end of file diff --git a/packages/common/src/parser/parser.js.map b/packages/common/src/parser/parser.js.map new file mode 100644 index 0000000000..ac02d3e4f7 --- /dev/null +++ b/packages/common/src/parser/parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parser.js","sourceRoot":"","sources":["parser.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/src/parser.ts b/packages/common/src/parser/parser.ts similarity index 80% rename from src/parser.ts rename to packages/common/src/parser/parser.ts index a619f5b651..35bc111c0b 100644 --- a/src/parser.ts +++ b/packages/common/src/parser/parser.ts @@ -4,7 +4,6 @@ import { VariableDefinitionNode, OperationDefinitionNode, } from 'graphql'; - import { invariant } from 'ts-invariant'; export enum DocumentType { @@ -21,18 +20,13 @@ export interface IDocumentDefinition { const cache = new Map(); -// the parser is mainly a safety check for the HOC +// This parser is mostly used to saftey check incoming documents. export function parser(document: DocumentNode): IDocumentDefinition { const cached = cache.get(document); if (cached) return cached; - // variables - let variables, type, name; - /* - - Saftey checks for proper usage of react-apollo + let variables, type, name; - */ invariant( !!document && !!document.kind, `Argument of ${document} passed to parser was not a valid GraphQL ` + @@ -45,19 +39,23 @@ export function parser(document: DocumentNode): IDocumentDefinition { ); const queries = document.definitions.filter( - (x: DefinitionNode) => x.kind === 'OperationDefinition' && x.operation === 'query', + (x: DefinitionNode) => + x.kind === 'OperationDefinition' && x.operation === 'query', ); const mutations = document.definitions.filter( - (x: DefinitionNode) => x.kind === 'OperationDefinition' && x.operation === 'mutation', + (x: DefinitionNode) => + x.kind === 'OperationDefinition' && x.operation === 'mutation', ); const subscriptions = document.definitions.filter( - (x: DefinitionNode) => x.kind === 'OperationDefinition' && x.operation === 'subscription', + (x: DefinitionNode) => + x.kind === 'OperationDefinition' && x.operation === 'subscription', ); invariant( - !fragments.length || (queries.length || mutations.length || subscriptions.length), + !fragments.length || + (queries.length || mutations.length || subscriptions.length), `Passing only a fragment to 'graphql' is not yet supported. ` + `You must include a query, subscription or mutation as well`, ); @@ -73,7 +71,11 @@ export function parser(document: DocumentNode): IDocumentDefinition { type = queries.length ? DocumentType.Query : DocumentType.Mutation; if (!queries.length && !mutations.length) type = DocumentType.Subscription; - const definitions = queries.length ? queries : mutations.length ? mutations : subscriptions; + const definitions = queries.length + ? queries + : mutations.length + ? mutations + : subscriptions; invariant( definitions.length === 1, diff --git a/packages/components/README.md b/packages/components/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/components/config/jest.config.js b/packages/components/config/jest.config.js new file mode 100644 index 0000000000..9e9b87422b --- /dev/null +++ b/packages/components/config/jest.config.js @@ -0,0 +1,6 @@ +const commonJestConfig = require('../../../config/jest.config'); + +module.exports = { + ...commonJestConfig, + setupFiles: ['../../config/tests-setup.ts'], +}; diff --git a/packages/components/config/rollup.config.js b/packages/components/config/rollup.config.js new file mode 100644 index 0000000000..0d2280ab02 --- /dev/null +++ b/packages/components/config/rollup.config.js @@ -0,0 +1,99 @@ +import node from 'rollup-plugin-node-resolve'; +import { uglify } from 'rollup-plugin-uglify'; +import typescript from 'typescript'; +import typescriptPlugin from 'rollup-plugin-typescript2'; +import invariantPlugin from 'rollup-plugin-invariant'; + +function onwarn(message) { + const suppressed = ['UNRESOLVED_IMPORT', 'THIS_IS_UNDEFINED']; + + if (!suppressed.find(code => message.code === code)) { + return console.warn(message.message); + } +} + +const globals = { + 'apollo-client': 'apollo.core', + 'hoist-non-react-statics': 'hoistNonReactStatics', + 'prop-types': 'PropTypes', + react: 'React', + 'ts-invariant': 'invariant', + tslib: 'tslib', + 'lodash.isequal': 'isEqual', + '@apollo/react-common': 'apolloReactCommon', +}; + +function external(id) { + return Object.prototype.hasOwnProperty.call(globals, id); +} + +const SRC_DIR = './src'; +const LIB_DIR = './lib'; + +export default [ + { + input: `${SRC_DIR}/index.ts`, + output: { + file: `${LIB_DIR}/react-components.esm.js`, + format: 'esm', + sourcemap: true, + globals, + }, + external, + plugins: [ + node({ mainFields: ['module'] }), + typescriptPlugin({ + typescript, + tsconfig: './config/tsconfig.json', + clean: true, + }), + invariantPlugin(), + ], + onwarn, + }, + { + input: `${LIB_DIR}/react-components.esm.js`, + output: { + file: `${LIB_DIR}/react-components.cjs.js`, + format: 'cjs', + name: 'react-components', + globals, + }, + external, + onwarn, + }, + { + input: `${LIB_DIR}/react-components.esm.js`, + output: { + file: `${LIB_DIR}/react-components.umd.js`, + format: 'umd', + name: 'react-components', + globals, + }, + external, + onwarn, + }, + { + input: `${LIB_DIR}/react-components.esm.js`, + output: { + file: './meta/bundlesize/bundlesize.js', + format: 'cjs', + name: 'react-components', + globals, + }, + external, + plugins: [ + uglify({ + mangle: { + toplevel: true, + }, + compress: { + global_defs: { + '@process.env.NODE_ENV': JSON.stringify('production'), + }, + }, + }), + ], + onwarn, + }, +]; diff --git a/packages/components/config/tsconfig.cjs.json b/packages/components/config/tsconfig.cjs.json new file mode 100644 index 0000000000..2733c030d0 --- /dev/null +++ b/packages/components/config/tsconfig.cjs.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../config/tsconfig.cjs.json", + "compilerOptions": { + "outDir": "../lib" + }, + "include": ["../src/**/*"], + "exclude": ["../src/**/__tests__/**/*", "../src/**/__mocks__/**/*"] +} diff --git a/packages/components/config/tsconfig.json b/packages/components/config/tsconfig.json new file mode 100644 index 0000000000..fc21045590 --- /dev/null +++ b/packages/components/config/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../config/tsconfig.base.json", + "compilerOptions": { + "outDir": "../lib" + }, + "include": ["../src/**/*"], + "exclude": ["../src/**/__tests__/**/*", "../src/**/__mocks__/**/*"] +} diff --git a/packages/components/lib/Mutation.d.ts b/packages/components/lib/Mutation.d.ts new file mode 100644 index 0000000000..8326215707 --- /dev/null +++ b/packages/components/lib/Mutation.d.ts @@ -0,0 +1,88 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import ApolloClient, { PureQueryOptions, ApolloError, FetchPolicy } from 'apollo-client'; +import { DataProxy } from 'apollo-cache'; +import { DocumentNode, GraphQLError } from 'graphql'; +import { ApolloContextValue } from '@apollo/react-common'; +import { OperationVariables, RefetchQueriesProviderFn } from './types'; +export interface MutationResult> { + data?: TData; + error?: ApolloError; + loading: boolean; + called: boolean; + client: ApolloClient; +} +export interface ExecutionResult> { + data?: T; + extensions?: Record; + errors?: GraphQLError[]; +} +export declare type MutationUpdaterFn = (proxy: DataProxy, mutationResult: FetchResult) => void; +export declare type FetchResult, C = Record, E = Record> = ExecutionResult & { + extensions?: E; + context?: C; +}; +export declare type MutationOptions, TVariables = OperationVariables> = { + variables?: TVariables; + optimisticResponse?: TData; + refetchQueries?: Array | RefetchQueriesProviderFn; + awaitRefetchQueries?: boolean; + update?: MutationUpdaterFn; + context?: Record; + fetchPolicy?: FetchPolicy; +}; +export declare type MutationFn = (options?: MutationOptions) => Promise>; +export interface MutationProps { + client?: ApolloClient; + mutation: DocumentNode; + ignoreResults?: boolean; + optimisticResponse?: TData; + variables?: TVariables; + refetchQueries?: Array | RefetchQueriesProviderFn; + awaitRefetchQueries?: boolean; + update?: MutationUpdaterFn; + children: (mutateFn: MutationFn, result: MutationResult) => React.ReactNode; + onCompleted?: (data: TData) => void; + onError?: (error: ApolloError) => void; + context?: Record; + fetchPolicy?: FetchPolicy; +} +export interface MutationState { + called: boolean; + loading: boolean; + error?: ApolloError; + data?: TData; +} +export declare class Mutation extends React.Component, MutationState> { + static contextType: React.Context; + static propTypes: { + mutation: PropTypes.Validator; + variables: PropTypes.Requireable; + optimisticResponse: PropTypes.Requireable; + refetchQueries: PropTypes.Requireable<((...args: any[]) => any) | (string | object | null)[]>; + awaitRefetchQueries: PropTypes.Requireable; + update: PropTypes.Requireable<(...args: any[]) => any>; + children: PropTypes.Validator<(...args: any[]) => any>; + onCompleted: PropTypes.Requireable<(...args: any[]) => any>; + onError: PropTypes.Requireable<(...args: any[]) => any>; + fetchPolicy: PropTypes.Requireable; + }; + private mostRecentMutationId; + private hasMounted; + constructor(props: MutationProps, context: ApolloContextValue); + componentDidMount(): void; + componentDidUpdate(prevProps: MutationProps): void; + componentWillUnmount(): void; + render(): React.ReactNode; + private runMutation; + private mutate; + private onMutationStart; + private onMutationCompleted; + private onMutationError; + private generateNewMutationId; + private isMostRecentMutation; + private verifyDocumentIsMutation; + private currentClient; +} diff --git a/packages/components/lib/Mutation.js b/packages/components/lib/Mutation.js new file mode 100644 index 0000000000..263e1fd5ae --- /dev/null +++ b/packages/components/lib/Mutation.js @@ -0,0 +1,144 @@ +import * as tslib_1 from "tslib"; +import React from 'react'; +import PropTypes from 'prop-types'; +import { ApolloError, } from 'apollo-client'; +import { invariant } from 'ts-invariant'; +import { getApolloContext, parser, DocumentType, } from '@apollo/react-common'; +import { getClient } from './utils/getClient'; +var Mutation = (function (_super) { + tslib_1.__extends(Mutation, _super); + function Mutation(props, context) { + var _this = _super.call(this, props, context) || this; + _this.hasMounted = false; + _this.runMutation = function (options) { + if (options === void 0) { options = {}; } + _this.onMutationStart(); + var mutationId = _this.generateNewMutationId(); + return _this.mutate(options) + .then(function (response) { + _this.onMutationCompleted(response, mutationId); + return response; + }) + .catch(function (e) { + _this.onMutationError(e, mutationId); + if (!_this.props.onError) + throw e; + }); + }; + _this.mutate = function (options) { + var _a = _this.props, mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, update = _a.update, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, fetchPolicy = _a.fetchPolicy; + var mutateOptions = tslib_1.__assign({}, options); + var refetchQueries = mutateOptions.refetchQueries || _this.props.refetchQueries; + var mutateVariables = Object.assign({}, variables, mutateOptions.variables); + delete mutateOptions.variables; + return _this.currentClient().mutate(tslib_1.__assign({ mutation: mutation, + optimisticResponse: optimisticResponse, + refetchQueries: refetchQueries, + awaitRefetchQueries: awaitRefetchQueries, + update: update, + context: context, + fetchPolicy: fetchPolicy, variables: mutateVariables }, mutateOptions)); + }; + _this.onMutationStart = function () { + if (!_this.state.loading && !_this.props.ignoreResults) { + _this.setState({ + loading: true, + error: undefined, + data: undefined, + called: true, + }); + } + }; + _this.onMutationCompleted = function (response, mutationId) { + var _a = _this.props, onCompleted = _a.onCompleted, ignoreResults = _a.ignoreResults; + var data = response.data, errors = response.errors; + var error = errors && errors.length > 0 + ? new ApolloError({ graphQLErrors: errors }) + : undefined; + var callOncomplete = function () { + return onCompleted ? onCompleted(data) : null; + }; + if (_this.hasMounted && + _this.isMostRecentMutation(mutationId) && + !ignoreResults) { + _this.setState({ loading: false, data: data, error: error }, callOncomplete); + } + else { + callOncomplete(); + } + }; + _this.onMutationError = function (error, mutationId) { + var onError = _this.props.onError; + var callOnError = function () { return (onError ? onError(error) : null); }; + if (_this.hasMounted && _this.isMostRecentMutation(mutationId)) { + _this.setState({ loading: false, error: error }, callOnError); + } + else { + callOnError(); + } + }; + _this.generateNewMutationId = function () { + _this.mostRecentMutationId = _this.mostRecentMutationId + 1; + return _this.mostRecentMutationId; + }; + _this.isMostRecentMutation = function (mutationId) { + return _this.mostRecentMutationId === mutationId; + }; + _this.verifyDocumentIsMutation = function (mutation) { + var operation = parser(mutation); + invariant(operation.type === DocumentType.Mutation, "The component requires a graphql mutation, but got a " + (operation.type === DocumentType.Query ? 'query' : 'subscription') + "."); + }; + _this.verifyDocumentIsMutation(props.mutation); + _this.mostRecentMutationId = 0; + _this.state = { + called: false, + loading: false, + }; + return _this; + } + Mutation.prototype.componentDidMount = function () { + this.hasMounted = true; + }; + Mutation.prototype.componentDidUpdate = function (prevProps) { + if (this.props.mutation !== prevProps.mutation) { + this.verifyDocumentIsMutation(this.props.mutation); + } + }; + Mutation.prototype.componentWillUnmount = function () { + this.hasMounted = false; + }; + Mutation.prototype.render = function () { + var children = this.props.children; + var _a = this.state, loading = _a.loading, data = _a.data, error = _a.error, called = _a.called; + var result = { + called: called, + loading: loading, + data: data, + error: error, + client: this.currentClient(), + }; + return children(this.runMutation, result); + }; + Mutation.prototype.currentClient = function () { + return getClient(this.props, this.context); + }; + Mutation.contextType = getApolloContext(); + Mutation.propTypes = { + mutation: PropTypes.object.isRequired, + variables: PropTypes.object, + optimisticResponse: PropTypes.object, + refetchQueries: PropTypes.oneOfType([ + PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])), + PropTypes.func, + ]), + awaitRefetchQueries: PropTypes.bool, + update: PropTypes.func, + children: PropTypes.func.isRequired, + onCompleted: PropTypes.func, + onError: PropTypes.func, + fetchPolicy: PropTypes.string, + }; + return Mutation; +}(React.Component)); +export { Mutation }; +//# sourceMappingURL=Mutation.js.map \ No newline at end of file diff --git a/packages/components/lib/Mutation.js.map b/packages/components/lib/Mutation.js.map new file mode 100644 index 0000000000..a1484edc8b --- /dev/null +++ b/packages/components/lib/Mutation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Mutation.js","sourceRoot":"","sources":["../src/Mutation.tsx"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/packages/components/lib/Query.d.ts b/packages/components/lib/Query.d.ts new file mode 100644 index 0000000000..997cfd44e1 --- /dev/null +++ b/packages/components/lib/Query.d.ts @@ -0,0 +1,65 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import ApolloClient, { ObservableQuery, ApolloError, ApolloQueryResult, NetworkStatus, FetchMoreOptions, FetchMoreQueryOptions } from 'apollo-client'; +import { DocumentNode } from 'graphql'; +import { ApolloContextValue } from '@apollo/react-common'; +import { OperationVariables, QueryOpts } from './types'; +export declare type ObservableQueryFields = Pick, 'startPolling' | 'stopPolling' | 'subscribeToMore' | 'updateQuery' | 'refetch' | 'variables'> & { + fetchMore: ((fetchMoreOptions: FetchMoreQueryOptions & FetchMoreOptions) => Promise>) & ((fetchMoreOptions: { + query: DocumentNode; + } & FetchMoreQueryOptions & FetchMoreOptions) => Promise>); +}; +export interface QueryResult extends ObservableQueryFields { + client: ApolloClient; + data: TData | undefined; + error?: ApolloError; + loading: boolean; + networkStatus: NetworkStatus; +} +export interface QueryProps extends QueryOpts { + children: (result: QueryResult) => React.ReactNode; + query: DocumentNode; + displayName?: string; + skip?: boolean; + onCompleted?: (data: TData) => void; + onError?: (error: ApolloError) => void; +} +export declare class Query extends React.Component> { + static propTypes: { + client: PropTypes.Requireable; + children: PropTypes.Validator<(...args: any[]) => any>; + fetchPolicy: PropTypes.Requireable; + notifyOnNetworkStatusChange: PropTypes.Requireable; + onCompleted: PropTypes.Requireable<(...args: any[]) => any>; + onError: PropTypes.Requireable<(...args: any[]) => any>; + pollInterval: PropTypes.Requireable; + query: PropTypes.Validator; + variables: PropTypes.Requireable; + ssr: PropTypes.Requireable; + partialRefetch: PropTypes.Requireable; + }; + private previousClient?; + private observableQuery?; + private observableQuerySubscription?; + private previousQuery?; + private hasMounted; + private operation?; + private previousOptions; + private previousResult; + componentDidMount(): void; + componentDidUpdate(prevProps: QueryProps): void; + componentWillUnmount(): void; + render(): React.ReactNode; + fetchData(client: ApolloClient, context: ApolloContextValue): Promise> | boolean; + private extractOptsFromProps; + private initializeObservableQuery; + private updateObservableQuery; + private startQuerySubscription; + private removeQuerySubscription; + private resubscribeToQuery; + private updateCurrentData; + private handleErrorOrCompleted; + private getQueryResult; + private currentClient; + private renderData; +} diff --git a/packages/components/lib/Query.js b/packages/components/lib/Query.js new file mode 100644 index 0000000000..89598c4142 --- /dev/null +++ b/packages/components/lib/Query.js @@ -0,0 +1,249 @@ +import * as tslib_1 from "tslib"; +import React from 'react'; +import PropTypes from 'prop-types'; +import { ApolloError, NetworkStatus, } from 'apollo-client'; +import { getApolloContext, parser, DocumentType, } from '@apollo/react-common'; +import isEqual from 'lodash.isequal'; +import { invariant } from 'ts-invariant'; +import { getClient } from './utils/getClient'; +import shallowEqual from './utils/shallowEqual'; +function observableQueryFields(observable) { + var fields = { + variables: observable.variables, + refetch: observable.refetch.bind(observable), + fetchMore: observable.fetchMore.bind(observable), + updateQuery: observable.updateQuery.bind(observable), + startPolling: observable.startPolling.bind(observable), + stopPolling: observable.stopPolling.bind(observable), + subscribeToMore: observable.subscribeToMore.bind(observable), + }; + return fields; +} +var Query = (function (_super) { + tslib_1.__extends(Query, _super); + function Query() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.hasMounted = false; + _this.previousOptions = null; + _this.previousResult = null; + _this.startQuerySubscription = function (client) { + if (_this.observableQuerySubscription) + return; + _this.observableQuerySubscription = _this.observableQuery.subscribe({ + next: function (_a) { + var loading = _a.loading, networkStatus = _a.networkStatus, data = _a.data; + var previousResult = _this.previousResult; + if (previousResult && + previousResult.loading === loading && + previousResult.networkStatus === networkStatus && + shallowEqual(previousResult.data, data || {})) { + return; + } + _this.updateCurrentData(); + }, + error: function (error) { + var previousResult = _this.previousResult; + if (!previousResult || + previousResult.networkStatus === NetworkStatus.refetch) { + _this.resubscribeToQuery(client); + } + if (!error.hasOwnProperty('graphQLErrors')) + throw error; + _this.updateCurrentData(); + }, + }); + }; + _this.removeQuerySubscription = function () { + if (_this.observableQuerySubscription) { + _this.observableQuerySubscription.unsubscribe(); + delete _this.observableQuerySubscription; + } + }; + _this.updateCurrentData = function () { + _this.handleErrorOrCompleted(); + if (_this.hasMounted) + _this.forceUpdate(); + }; + _this.handleErrorOrCompleted = function () { + var result = _this.observableQuery.getCurrentResult(); + var data = result.data, loading = result.loading, error = result.error; + var _a = _this.props, onCompleted = _a.onCompleted, onError = _a.onError; + if (onCompleted && !loading && !error) { + onCompleted(data); + } + else if (onError && !loading && error) { + onError(error); + } + }; + _this.getQueryResult = function (client) { + var result = { + data: Object.create(null), + }; + Object.assign(result, observableQueryFields(_this.observableQuery)); + if (_this.props.skip) { + result = tslib_1.__assign({}, result, { data: undefined, error: undefined, loading: false }); + } + else { + var currentResult = _this.observableQuery.getCurrentResult(); + var loading = currentResult.loading, partial = currentResult.partial, networkStatus = currentResult.networkStatus, errors = currentResult.errors; + var error = currentResult.error, data = currentResult.data; + data = data || Object.create(null); + if (errors && errors.length > 0) { + error = new ApolloError({ graphQLErrors: errors }); + } + Object.assign(result, { loading: loading, networkStatus: networkStatus, error: error }); + if (loading) { + var previousData = _this.previousResult + ? _this.previousResult.data + : {}; + Object.assign(result.data, previousData, data); + } + else if (error) { + Object.assign(result, { + data: (_this.observableQuery.getLastResult() || {}).data, + }); + } + else { + var fetchPolicy = _this.observableQuery.options.fetchPolicy; + var partialRefetch = _this.props.partialRefetch; + if (partialRefetch && + Object.keys(data).length === 0 && + partial && + fetchPolicy !== 'cache-only') { + Object.assign(result, { + loading: true, + networkStatus: NetworkStatus.loading, + }); + result.refetch(); + return result; + } + Object.assign(result.data, data); + } + } + result.client = client; + _this.previousResult = result; + return result; + }; + return _this; + } + Query.prototype.componentDidMount = function () { + this.hasMounted = true; + }; + Query.prototype.componentDidUpdate = function (prevProps) { + var isDiffRequest = !isEqual(prevProps.query, this.props.query) || + !isEqual(prevProps.variables, this.props.variables); + if (isDiffRequest) { + this.handleErrorOrCompleted(); + } + }; + Query.prototype.componentWillUnmount = function () { + this.removeQuerySubscription(); + this.hasMounted = false; + }; + Query.prototype.render = function () { + var _this = this; + var ApolloContext = getApolloContext(); + return (React.createElement(ApolloContext.Consumer, null, function (context) { + return _this.renderData(context); + })); + }; + Query.prototype.fetchData = function (client, context) { + if (this.props.skip) + return false; + var _a = this.props, children = _a.children, ssr = _a.ssr, displayName = _a.displayName, skip = _a.skip, onCompleted = _a.onCompleted, onError = _a.onError, partialRefetch = _a.partialRefetch, opts = tslib_1.__rest(_a, ["children", "ssr", "displayName", "skip", "onCompleted", "onError", "partialRefetch"]); + var fetchPolicy = opts.fetchPolicy; + if (ssr === false) + return false; + if (fetchPolicy === 'network-only' || fetchPolicy === 'cache-and-network') { + fetchPolicy = 'cache-first'; + } + var observable = client.watchQuery(tslib_1.__assign({}, opts, { fetchPolicy: fetchPolicy })); + if (context && context.renderPromises) { + context.renderPromises.registerSSRObservable(this, observable); + } + var result = this.observableQuery.getCurrentResult(); + return result.loading ? observable.result() : false; + }; + Query.prototype.extractOptsFromProps = function (props) { + this.operation = parser(props.query); + invariant(this.operation.type === DocumentType.Query, "The component requires a graphql query, but got a " + (this.operation.type === DocumentType.Mutation + ? 'mutation' + : 'subscription') + "."); + var displayName = props.displayName || 'Query'; + return tslib_1.__assign({}, props, { displayName: displayName, context: props.context || {}, metadata: { reactComponent: { displayName: displayName } } }); + }; + Query.prototype.initializeObservableQuery = function (client, props, context) { + if (context && context.renderPromises) { + this.observableQuery = context.renderPromises.getSSRObservable(this); + } + if (!this.observableQuery) { + var options = this.extractOptsFromProps(props); + this.previousOptions = tslib_1.__assign({}, options, { children: null }); + this.observableQuery = client.watchQuery(options); + } + }; + Query.prototype.updateObservableQuery = function (client, context) { + if (!this.observableQuery) { + this.initializeObservableQuery(client, this.props, context); + } + var newOptions = tslib_1.__assign({}, this.extractOptsFromProps(this.props), { children: null }); + if (!isEqual(newOptions, this.previousOptions)) { + this.previousOptions = newOptions; + this.observableQuery.setOptions(newOptions) + .catch(function () { return null; }); + } + }; + Query.prototype.resubscribeToQuery = function (client) { + this.removeQuerySubscription(); + var lastError = this.observableQuery.getLastError(); + var lastResult = this.observableQuery.getLastResult(); + this.observableQuery.resetLastResults(); + this.startQuerySubscription(client); + Object.assign(this.observableQuery, { lastError: lastError, lastResult: lastResult }); + }; + Query.prototype.currentClient = function (context) { + var client = getClient(this.props, context); + if (this.previousClient !== client) { + this.previousClient = client; + this.removeQuerySubscription(); + this.observableQuery = null; + this.previousResult = null; + } + return client; + }; + Query.prototype.renderData = function (context) { + var _this = this; + var client = this.currentClient(context); + var _a = this.props, skip = _a.skip, query = _a.query; + if (skip || query !== this.previousQuery) { + this.removeQuerySubscription(); + this.observableQuery = null; + this.previousQuery = query; + } + this.updateObservableQuery(client, context); + if (!skip) { + this.startQuerySubscription(client); + } + var finish = function () { return _this.props.children(_this.getQueryResult(client)); }; + if (context && context.renderPromises) { + return context.renderPromises.addQueryPromise(this, finish, client, context); + } + return finish(); + }; + Query.propTypes = { + client: PropTypes.object, + children: PropTypes.func.isRequired, + fetchPolicy: PropTypes.string, + notifyOnNetworkStatusChange: PropTypes.bool, + onCompleted: PropTypes.func, + onError: PropTypes.func, + pollInterval: PropTypes.number, + query: PropTypes.object.isRequired, + variables: PropTypes.object, + ssr: PropTypes.bool, + partialRefetch: PropTypes.bool, + }; + return Query; +}(React.Component)); +export { Query }; +//# sourceMappingURL=Query.js.map \ No newline at end of file diff --git a/packages/components/lib/Query.js.map b/packages/components/lib/Query.js.map new file mode 100644 index 0000000000..fd0ac38409 --- /dev/null +++ b/packages/components/lib/Query.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Query.js","sourceRoot":"","sources":["../src/Query.tsx"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/packages/components/lib/Subscription.d.ts b/packages/components/lib/Subscription.d.ts new file mode 100644 index 0000000000..e052de40e6 --- /dev/null +++ b/packages/components/lib/Subscription.d.ts @@ -0,0 +1,58 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import ApolloClient, { ApolloError, FetchPolicy } from 'apollo-client'; +import { DocumentNode } from 'graphql'; +import { ApolloContextValue } from '@apollo/react-common'; +import { OperationVariables } from './types'; +export interface SubscriptionResult { + loading: boolean; + data?: TData; + error?: ApolloError; +} +export interface OnSubscriptionDataOptions { + client: ApolloClient; + subscriptionData: SubscriptionResult; +} +export interface SubscriptionProps { + subscription: DocumentNode; + variables?: TVariables; + fetchPolicy?: FetchPolicy; + shouldResubscribe?: any; + client?: ApolloClient; + onSubscriptionData?: (options: OnSubscriptionDataOptions) => any; + onSubscriptionComplete?: () => void; + children?: (result: SubscriptionResult) => React.ReactNode; +} +export interface SubscriptionState { + loading: boolean; + data?: TData; + error?: ApolloError; +} +export declare class Subscription extends React.Component, SubscriptionState> { + static contextType: React.Context; + static propTypes: { + subscription: PropTypes.Validator; + variables: PropTypes.Requireable; + children: PropTypes.Requireable<(...args: any[]) => any>; + onSubscriptionData: PropTypes.Requireable<(...args: any[]) => any>; + onSubscriptionComplete: PropTypes.Requireable<(...args: any[]) => any>; + shouldResubscribe: PropTypes.Requireable any)>; + }; + private client; + private previousState?; + private previousProps?; + private observableQuery?; + private observableQuerySubscription?; + constructor(props: SubscriptionProps, context: ApolloContextValue); + componentDidMount(): void; + componentWillUnmount(): void; + render(): any; + private initialize; + private startSubscription; + private getInitialState; + private updateCurrentData; + private updateError; + private completeSubscription; + private endSubscription; + private newClient; +} diff --git a/packages/components/lib/Subscription.js b/packages/components/lib/Subscription.js new file mode 100644 index 0000000000..aa42ebeaad --- /dev/null +++ b/packages/components/lib/Subscription.js @@ -0,0 +1,131 @@ +import * as tslib_1 from "tslib"; +import React from 'react'; +import PropTypes from 'prop-types'; +import { getApolloContext } from '@apollo/react-common'; +import { getClient } from './utils/getClient'; +import shallowEqual from './utils/shallowEqual'; +var Subscription = (function (_super) { + tslib_1.__extends(Subscription, _super); + function Subscription(props, context) { + var _this = _super.call(this, props, context) || this; + _this.initialize = function (props) { + if (_this.observableQuery) + return; + _this.observableQuery = _this.client.subscribe({ + query: props.subscription, + variables: props.variables, + fetchPolicy: props.fetchPolicy, + }); + }; + _this.startSubscription = function () { + if (_this.observableQuerySubscription) + return; + _this.observableQuerySubscription = _this.observableQuery.subscribe({ + next: _this.updateCurrentData, + error: _this.updateError, + complete: _this.completeSubscription, + }); + }; + _this.getInitialState = function () { return ({ + loading: true, + error: undefined, + data: undefined, + }); }; + _this.updateCurrentData = function (result) { + var onSubscriptionData = _this.props.onSubscriptionData; + if (onSubscriptionData) { + onSubscriptionData({ + client: _this.client, + subscriptionData: result, + }); + } + _this.setState({ + data: result.data, + loading: false, + error: undefined, + }, function () { + delete _this.previousState; + }); + }; + _this.updateError = function (error) { + _this.setState({ + error: error, + loading: false, + }); + }; + _this.completeSubscription = function () { + var onSubscriptionComplete = _this.props.onSubscriptionComplete; + if (onSubscriptionComplete) + onSubscriptionComplete(); + _this.endSubscription(); + }; + _this.endSubscription = function () { + if (_this.observableQuerySubscription) { + _this.observableQuerySubscription.unsubscribe(); + delete _this.observableQuerySubscription; + } + }; + _this.newClient = function () { + var clientChanged = false; + var client = getClient(_this.props, _this.context); + if (client !== _this.client) { + clientChanged = true; + _this.client = client; + _this.endSubscription(); + delete _this.observableQuery; + } + return clientChanged; + }; + _this.client = getClient(props, context); + _this.initialize(props); + _this.state = _this.getInitialState(); + return _this; + } + Subscription.prototype.componentDidMount = function () { + this.startSubscription(); + }; + Subscription.prototype.componentWillUnmount = function () { + this.endSubscription(); + }; + Subscription.prototype.render = function () { + var currentState = this.state; + if (this.newClient()) { + currentState = this.getInitialState(); + } + var shouldResubscribe = this.props.shouldResubscribe; + if (typeof shouldResubscribe === 'function') { + shouldResubscribe = !!shouldResubscribe(this.props); + } + if (shouldResubscribe !== false && + this.previousProps && + (!shallowEqual(this.previousProps.variables, this.props.variables) || + this.previousProps.subscription !== this.props.subscription)) { + this.endSubscription(); + delete this.observableQuery; + if (!this.previousState) { + currentState = this.getInitialState(); + } + } + this.initialize(this.props); + this.startSubscription(); + var renderFn = this.props.children; + if (!renderFn) + return null; + var result = tslib_1.__assign({}, currentState, { variables: this.props.variables }); + this.previousState = currentState; + this.previousProps = this.props; + return renderFn(result); + }; + Subscription.contextType = getApolloContext(); + Subscription.propTypes = { + subscription: PropTypes.object.isRequired, + variables: PropTypes.object, + children: PropTypes.func, + onSubscriptionData: PropTypes.func, + onSubscriptionComplete: PropTypes.func, + shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]), + }; + return Subscription; +}(React.Component)); +export { Subscription }; +//# sourceMappingURL=Subscription.js.map \ No newline at end of file diff --git a/packages/components/lib/Subscription.js.map b/packages/components/lib/Subscription.js.map new file mode 100644 index 0000000000..bd6be5cf60 --- /dev/null +++ b/packages/components/lib/Subscription.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Subscription.js","sourceRoot":"","sources":["../src/Subscription.tsx"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/packages/components/lib/index.d.ts b/packages/components/lib/index.d.ts new file mode 100644 index 0000000000..9b430e4d05 --- /dev/null +++ b/packages/components/lib/index.d.ts @@ -0,0 +1,8 @@ +export { getApolloContext, resetApolloContext, ApolloProvider, ApolloConsumer, } from '@apollo/react-common'; +export { Query, ObservableQueryFields, QueryResult, QueryProps } from './Query'; +export { Mutation, MutationResult, ExecutionResult, MutationUpdaterFn, FetchResult, MutationOptions, MutationFn, MutationProps, MutationState, } from './Mutation'; +export { Subscription, SubscriptionResult, OnSubscriptionDataOptions, SubscriptionProps, SubscriptionState, } from './Subscription'; +export { RenderPromises, getDataFromTree, getMarkupFromTree, } from './ssr/getDataFromTree'; +export { renderToStringWithData } from './ssr/renderToStringWithData'; +export { useApolloClient } from './useApolloClient'; +export * from './types'; diff --git a/packages/components/lib/index.js b/packages/components/lib/index.js new file mode 100644 index 0000000000..8a53296ed8 --- /dev/null +++ b/packages/components/lib/index.js @@ -0,0 +1,8 @@ +export { getApolloContext, resetApolloContext, ApolloProvider, ApolloConsumer, } from '@apollo/react-common'; +export { Query } from './Query'; +export { Mutation, } from './Mutation'; +export { Subscription, } from './Subscription'; +export { RenderPromises, getDataFromTree, getMarkupFromTree, } from './ssr/getDataFromTree'; +export { renderToStringWithData } from './ssr/renderToStringWithData'; +export { useApolloClient } from './useApolloClient'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/components/lib/index.js.map b/packages/components/lib/index.js.map new file mode 100644 index 0000000000..28012e8055 --- /dev/null +++ b/packages/components/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,cAAc,GACf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KAAK,EAAkD,MAAM,SAAS,CAAC;AAEhF,OAAO,EACL,QAAQ,GAST,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,YAAY,GAKb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,cAAc,EACd,eAAe,EACf,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"} \ No newline at end of file diff --git a/packages/components/lib/react-components.cjs.js b/packages/components/lib/react-components.cjs.js new file mode 100644 index 0000000000..f36f0836c9 --- /dev/null +++ b/packages/components/lib/react-components.cjs.js @@ -0,0 +1,666 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var reactCommon = require('@apollo/react-common'); +var tslib = require('tslib'); +var React = _interopDefault(require('react')); +var PropTypes = _interopDefault(require('prop-types')); +var apolloClient = require('apollo-client'); +var isEqual = _interopDefault(require('lodash.isequal')); +var tsInvariant = require('ts-invariant'); + +function getClient(props, context) { + var client = props.client || context.client; + process.env.NODE_ENV === "production" ? tsInvariant.invariant(!!client) : tsInvariant.invariant(!!client, 'Could not find "client" in the context or passed in as a prop. ' + + 'Wrap the root component in an , or pass an ' + + 'ApolloClient instance in via props.'); + return client; +} + +var hasOwnProperty = Object.prototype.hasOwnProperty; +function is(x, y) { + if (x === y) { + return x !== 0 || y !== 0 || 1 / x === 1 / y; + } + return x !== x && y !== y; +} +function isObject(obj) { + return obj !== null && typeof obj === "object"; +} +function shallowEqual(objA, objB) { + if (is(objA, objB)) { + return true; + } + if (!isObject(objA) || !isObject(objB)) { + return false; + } + var keys = Object.keys(objA); + if (keys.length !== Object.keys(objB).length) { + return false; + } + return keys.every(function (key) { return hasOwnProperty.call(objB, key) && is(objA[key], objB[key]); }); +} + +function observableQueryFields(observable) { + var fields = { + variables: observable.variables, + refetch: observable.refetch.bind(observable), + fetchMore: observable.fetchMore.bind(observable), + updateQuery: observable.updateQuery.bind(observable), + startPolling: observable.startPolling.bind(observable), + stopPolling: observable.stopPolling.bind(observable), + subscribeToMore: observable.subscribeToMore.bind(observable), + }; + return fields; +} +var Query = (function (_super) { + tslib.__extends(Query, _super); + function Query() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.hasMounted = false; + _this.previousOptions = null; + _this.previousResult = null; + _this.startQuerySubscription = function (client) { + if (_this.observableQuerySubscription) + return; + _this.observableQuerySubscription = _this.observableQuery.subscribe({ + next: function (_a) { + var loading = _a.loading, networkStatus = _a.networkStatus, data = _a.data; + var previousResult = _this.previousResult; + if (previousResult && + previousResult.loading === loading && + previousResult.networkStatus === networkStatus && + shallowEqual(previousResult.data, data || {})) { + return; + } + _this.updateCurrentData(); + }, + error: function (error) { + var previousResult = _this.previousResult; + if (!previousResult || + previousResult.networkStatus === apolloClient.NetworkStatus.refetch) { + _this.resubscribeToQuery(client); + } + if (!error.hasOwnProperty('graphQLErrors')) + throw error; + _this.updateCurrentData(); + }, + }); + }; + _this.removeQuerySubscription = function () { + if (_this.observableQuerySubscription) { + _this.observableQuerySubscription.unsubscribe(); + delete _this.observableQuerySubscription; + } + }; + _this.updateCurrentData = function () { + _this.handleErrorOrCompleted(); + if (_this.hasMounted) + _this.forceUpdate(); + }; + _this.handleErrorOrCompleted = function () { + var result = _this.observableQuery.getCurrentResult(); + var data = result.data, loading = result.loading, error = result.error; + var _a = _this.props, onCompleted = _a.onCompleted, onError = _a.onError; + if (onCompleted && !loading && !error) { + onCompleted(data); + } + else if (onError && !loading && error) { + onError(error); + } + }; + _this.getQueryResult = function (client) { + var result = { + data: Object.create(null), + }; + Object.assign(result, observableQueryFields(_this.observableQuery)); + if (_this.props.skip) { + result = tslib.__assign({}, result, { data: undefined, error: undefined, loading: false }); + } + else { + var currentResult = _this.observableQuery.getCurrentResult(); + var loading = currentResult.loading, partial = currentResult.partial, networkStatus = currentResult.networkStatus, errors = currentResult.errors; + var error = currentResult.error, data = currentResult.data; + data = data || Object.create(null); + if (errors && errors.length > 0) { + error = new apolloClient.ApolloError({ graphQLErrors: errors }); + } + Object.assign(result, { loading: loading, networkStatus: networkStatus, error: error }); + if (loading) { + var previousData = _this.previousResult + ? _this.previousResult.data + : {}; + Object.assign(result.data, previousData, data); + } + else if (error) { + Object.assign(result, { + data: (_this.observableQuery.getLastResult() || {}).data, + }); + } + else { + var fetchPolicy = _this.observableQuery.options.fetchPolicy; + var partialRefetch = _this.props.partialRefetch; + if (partialRefetch && + Object.keys(data).length === 0 && + partial && + fetchPolicy !== 'cache-only') { + Object.assign(result, { + loading: true, + networkStatus: apolloClient.NetworkStatus.loading, + }); + result.refetch(); + return result; + } + Object.assign(result.data, data); + } + } + result.client = client; + _this.previousResult = result; + return result; + }; + return _this; + } + Query.prototype.componentDidMount = function () { + this.hasMounted = true; + }; + Query.prototype.componentDidUpdate = function (prevProps) { + var isDiffRequest = !isEqual(prevProps.query, this.props.query) || + !isEqual(prevProps.variables, this.props.variables); + if (isDiffRequest) { + this.handleErrorOrCompleted(); + } + }; + Query.prototype.componentWillUnmount = function () { + this.removeQuerySubscription(); + this.hasMounted = false; + }; + Query.prototype.render = function () { + var _this = this; + var ApolloContext = reactCommon.getApolloContext(); + return (React.createElement(ApolloContext.Consumer, null, function (context) { + return _this.renderData(context); + })); + }; + Query.prototype.fetchData = function (client, context) { + if (this.props.skip) + return false; + var _a = this.props, children = _a.children, ssr = _a.ssr, displayName = _a.displayName, skip = _a.skip, onCompleted = _a.onCompleted, onError = _a.onError, partialRefetch = _a.partialRefetch, opts = tslib.__rest(_a, ["children", "ssr", "displayName", "skip", "onCompleted", "onError", "partialRefetch"]); + var fetchPolicy = opts.fetchPolicy; + if (ssr === false) + return false; + if (fetchPolicy === 'network-only' || fetchPolicy === 'cache-and-network') { + fetchPolicy = 'cache-first'; + } + var observable = client.watchQuery(tslib.__assign({}, opts, { fetchPolicy: fetchPolicy })); + if (context && context.renderPromises) { + context.renderPromises.registerSSRObservable(this, observable); + } + var result = this.observableQuery.getCurrentResult(); + return result.loading ? observable.result() : false; + }; + Query.prototype.extractOptsFromProps = function (props) { + this.operation = reactCommon.parser(props.query); + process.env.NODE_ENV === "production" ? tsInvariant.invariant(this.operation.type === reactCommon.DocumentType.Query) : tsInvariant.invariant(this.operation.type === reactCommon.DocumentType.Query, "The component requires a graphql query, but got a " + (this.operation.type === reactCommon.DocumentType.Mutation + ? 'mutation' + : 'subscription') + "."); + var displayName = props.displayName || 'Query'; + return tslib.__assign({}, props, { displayName: displayName, context: props.context || {}, metadata: { reactComponent: { displayName: displayName } } }); + }; + Query.prototype.initializeObservableQuery = function (client, props, context) { + if (context && context.renderPromises) { + this.observableQuery = context.renderPromises.getSSRObservable(this); + } + if (!this.observableQuery) { + var options = this.extractOptsFromProps(props); + this.previousOptions = tslib.__assign({}, options, { children: null }); + this.observableQuery = client.watchQuery(options); + } + }; + Query.prototype.updateObservableQuery = function (client, context) { + if (!this.observableQuery) { + this.initializeObservableQuery(client, this.props, context); + } + var newOptions = tslib.__assign({}, this.extractOptsFromProps(this.props), { children: null }); + if (!isEqual(newOptions, this.previousOptions)) { + this.previousOptions = newOptions; + this.observableQuery.setOptions(newOptions) + .catch(function () { return null; }); + } + }; + Query.prototype.resubscribeToQuery = function (client) { + this.removeQuerySubscription(); + var lastError = this.observableQuery.getLastError(); + var lastResult = this.observableQuery.getLastResult(); + this.observableQuery.resetLastResults(); + this.startQuerySubscription(client); + Object.assign(this.observableQuery, { lastError: lastError, lastResult: lastResult }); + }; + Query.prototype.currentClient = function (context) { + var client = getClient(this.props, context); + if (this.previousClient !== client) { + this.previousClient = client; + this.removeQuerySubscription(); + this.observableQuery = null; + this.previousResult = null; + } + return client; + }; + Query.prototype.renderData = function (context) { + var _this = this; + var client = this.currentClient(context); + var _a = this.props, skip = _a.skip, query = _a.query; + if (skip || query !== this.previousQuery) { + this.removeQuerySubscription(); + this.observableQuery = null; + this.previousQuery = query; + } + this.updateObservableQuery(client, context); + if (!skip) { + this.startQuerySubscription(client); + } + var finish = function () { return _this.props.children(_this.getQueryResult(client)); }; + if (context && context.renderPromises) { + return context.renderPromises.addQueryPromise(this, finish, client, context); + } + return finish(); + }; + Query.propTypes = { + client: PropTypes.object, + children: PropTypes.func.isRequired, + fetchPolicy: PropTypes.string, + notifyOnNetworkStatusChange: PropTypes.bool, + onCompleted: PropTypes.func, + onError: PropTypes.func, + pollInterval: PropTypes.number, + query: PropTypes.object.isRequired, + variables: PropTypes.object, + ssr: PropTypes.bool, + partialRefetch: PropTypes.bool, + }; + return Query; +}(React.Component)); + +var Mutation = (function (_super) { + tslib.__extends(Mutation, _super); + function Mutation(props, context) { + var _this = _super.call(this, props, context) || this; + _this.hasMounted = false; + _this.runMutation = function (options) { + if (options === void 0) { options = {}; } + _this.onMutationStart(); + var mutationId = _this.generateNewMutationId(); + return _this.mutate(options) + .then(function (response) { + _this.onMutationCompleted(response, mutationId); + return response; + }) + .catch(function (e) { + _this.onMutationError(e, mutationId); + if (!_this.props.onError) + throw e; + }); + }; + _this.mutate = function (options) { + var _a = _this.props, mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, update = _a.update, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, fetchPolicy = _a.fetchPolicy; + var mutateOptions = tslib.__assign({}, options); + var refetchQueries = mutateOptions.refetchQueries || _this.props.refetchQueries; + var mutateVariables = Object.assign({}, variables, mutateOptions.variables); + delete mutateOptions.variables; + return _this.currentClient().mutate(tslib.__assign({ mutation: mutation, + optimisticResponse: optimisticResponse, + refetchQueries: refetchQueries, + awaitRefetchQueries: awaitRefetchQueries, + update: update, + context: context, + fetchPolicy: fetchPolicy, variables: mutateVariables }, mutateOptions)); + }; + _this.onMutationStart = function () { + if (!_this.state.loading && !_this.props.ignoreResults) { + _this.setState({ + loading: true, + error: undefined, + data: undefined, + called: true, + }); + } + }; + _this.onMutationCompleted = function (response, mutationId) { + var _a = _this.props, onCompleted = _a.onCompleted, ignoreResults = _a.ignoreResults; + var data = response.data, errors = response.errors; + var error = errors && errors.length > 0 + ? new apolloClient.ApolloError({ graphQLErrors: errors }) + : undefined; + var callOncomplete = function () { + return onCompleted ? onCompleted(data) : null; + }; + if (_this.hasMounted && + _this.isMostRecentMutation(mutationId) && + !ignoreResults) { + _this.setState({ loading: false, data: data, error: error }, callOncomplete); + } + else { + callOncomplete(); + } + }; + _this.onMutationError = function (error, mutationId) { + var onError = _this.props.onError; + var callOnError = function () { return (onError ? onError(error) : null); }; + if (_this.hasMounted && _this.isMostRecentMutation(mutationId)) { + _this.setState({ loading: false, error: error }, callOnError); + } + else { + callOnError(); + } + }; + _this.generateNewMutationId = function () { + _this.mostRecentMutationId = _this.mostRecentMutationId + 1; + return _this.mostRecentMutationId; + }; + _this.isMostRecentMutation = function (mutationId) { + return _this.mostRecentMutationId === mutationId; + }; + _this.verifyDocumentIsMutation = function (mutation) { + var operation = reactCommon.parser(mutation); + process.env.NODE_ENV === "production" ? tsInvariant.invariant(operation.type === reactCommon.DocumentType.Mutation) : tsInvariant.invariant(operation.type === reactCommon.DocumentType.Mutation, "The component requires a graphql mutation, but got a " + (operation.type === reactCommon.DocumentType.Query ? 'query' : 'subscription') + "."); + }; + _this.verifyDocumentIsMutation(props.mutation); + _this.mostRecentMutationId = 0; + _this.state = { + called: false, + loading: false, + }; + return _this; + } + Mutation.prototype.componentDidMount = function () { + this.hasMounted = true; + }; + Mutation.prototype.componentDidUpdate = function (prevProps) { + if (this.props.mutation !== prevProps.mutation) { + this.verifyDocumentIsMutation(this.props.mutation); + } + }; + Mutation.prototype.componentWillUnmount = function () { + this.hasMounted = false; + }; + Mutation.prototype.render = function () { + var children = this.props.children; + var _a = this.state, loading = _a.loading, data = _a.data, error = _a.error, called = _a.called; + var result = { + called: called, + loading: loading, + data: data, + error: error, + client: this.currentClient(), + }; + return children(this.runMutation, result); + }; + Mutation.prototype.currentClient = function () { + return getClient(this.props, this.context); + }; + Mutation.contextType = reactCommon.getApolloContext(); + Mutation.propTypes = { + mutation: PropTypes.object.isRequired, + variables: PropTypes.object, + optimisticResponse: PropTypes.object, + refetchQueries: PropTypes.oneOfType([ + PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])), + PropTypes.func, + ]), + awaitRefetchQueries: PropTypes.bool, + update: PropTypes.func, + children: PropTypes.func.isRequired, + onCompleted: PropTypes.func, + onError: PropTypes.func, + fetchPolicy: PropTypes.string, + }; + return Mutation; +}(React.Component)); + +var Subscription = (function (_super) { + tslib.__extends(Subscription, _super); + function Subscription(props, context) { + var _this = _super.call(this, props, context) || this; + _this.initialize = function (props) { + if (_this.observableQuery) + return; + _this.observableQuery = _this.client.subscribe({ + query: props.subscription, + variables: props.variables, + fetchPolicy: props.fetchPolicy, + }); + }; + _this.startSubscription = function () { + if (_this.observableQuerySubscription) + return; + _this.observableQuerySubscription = _this.observableQuery.subscribe({ + next: _this.updateCurrentData, + error: _this.updateError, + complete: _this.completeSubscription, + }); + }; + _this.getInitialState = function () { return ({ + loading: true, + error: undefined, + data: undefined, + }); }; + _this.updateCurrentData = function (result) { + var onSubscriptionData = _this.props.onSubscriptionData; + if (onSubscriptionData) { + onSubscriptionData({ + client: _this.client, + subscriptionData: result, + }); + } + _this.setState({ + data: result.data, + loading: false, + error: undefined, + }, function () { + delete _this.previousState; + }); + }; + _this.updateError = function (error) { + _this.setState({ + error: error, + loading: false, + }); + }; + _this.completeSubscription = function () { + var onSubscriptionComplete = _this.props.onSubscriptionComplete; + if (onSubscriptionComplete) + onSubscriptionComplete(); + _this.endSubscription(); + }; + _this.endSubscription = function () { + if (_this.observableQuerySubscription) { + _this.observableQuerySubscription.unsubscribe(); + delete _this.observableQuerySubscription; + } + }; + _this.newClient = function () { + var clientChanged = false; + var client = getClient(_this.props, _this.context); + if (client !== _this.client) { + clientChanged = true; + _this.client = client; + _this.endSubscription(); + delete _this.observableQuery; + } + return clientChanged; + }; + _this.client = getClient(props, context); + _this.initialize(props); + _this.state = _this.getInitialState(); + return _this; + } + Subscription.prototype.componentDidMount = function () { + this.startSubscription(); + }; + Subscription.prototype.componentWillUnmount = function () { + this.endSubscription(); + }; + Subscription.prototype.render = function () { + var currentState = this.state; + if (this.newClient()) { + currentState = this.getInitialState(); + } + var shouldResubscribe = this.props.shouldResubscribe; + if (typeof shouldResubscribe === 'function') { + shouldResubscribe = !!shouldResubscribe(this.props); + } + if (shouldResubscribe !== false && + this.previousProps && + (!shallowEqual(this.previousProps.variables, this.props.variables) || + this.previousProps.subscription !== this.props.subscription)) { + this.endSubscription(); + delete this.observableQuery; + if (!this.previousState) { + currentState = this.getInitialState(); + } + } + this.initialize(this.props); + this.startSubscription(); + var renderFn = this.props.children; + if (!renderFn) + return null; + var result = tslib.__assign({}, currentState, { variables: this.props.variables }); + this.previousState = currentState; + this.previousProps = this.props; + return renderFn(result); + }; + Subscription.contextType = reactCommon.getApolloContext(); + Subscription.propTypes = { + subscription: PropTypes.object.isRequired, + variables: PropTypes.object, + children: PropTypes.func, + onSubscriptionData: PropTypes.func, + onSubscriptionComplete: PropTypes.func, + shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]), + }; + return Subscription; +}(React.Component)); + +function makeDefaultQueryInfo() { + return { + seen: false, + observable: null, + }; +} +var RenderPromises = (function () { + function RenderPromises() { + this.queryPromises = new Map(); + this.queryInfoTrie = new Map(); + } + RenderPromises.prototype.registerSSRObservable = function (queryInstance, observable) { + this.lookupQueryInfo(queryInstance).observable = observable; + }; + RenderPromises.prototype.getSSRObservable = function (queryInstance) { + return this.lookupQueryInfo(queryInstance).observable; + }; + RenderPromises.prototype.addQueryPromise = function (queryInstance, finish, client, context) { + var info = this.lookupQueryInfo(queryInstance); + if (!info.seen) { + this.queryPromises.set(queryInstance, new Promise(function (resolve) { + resolve(queryInstance.fetchData(client, context)); + })); + return null; + } + return finish(); + }; + RenderPromises.prototype.hasPromises = function () { + return this.queryPromises.size > 0; + }; + RenderPromises.prototype.consumeAndAwaitPromises = function () { + var _this = this; + var promises = []; + this.queryPromises.forEach(function (promise, queryInstance) { + _this.lookupQueryInfo(queryInstance).seen = true; + promises.push(promise); + }); + this.queryPromises.clear(); + return Promise.all(promises); + }; + RenderPromises.prototype.lookupQueryInfo = function (queryInstance) { + var queryInfoTrie = this.queryInfoTrie; + var _a = queryInstance.props, query = _a.query, variables = _a.variables; + var varMap = queryInfoTrie.get(query) || new Map(); + if (!queryInfoTrie.has(query)) + queryInfoTrie.set(query, varMap); + var variablesString = JSON.stringify(variables); + var info = varMap.get(variablesString) || makeDefaultQueryInfo(); + if (!varMap.has(variablesString)) + varMap.set(variablesString, info); + return info; + }; + return RenderPromises; +}()); +function getDataFromTree(tree, context) { + if (context === void 0) { context = {}; } + return getMarkupFromTree({ + tree: tree, + context: context, + renderFunction: require('react-dom/server').renderToStaticMarkup, + }); +} +function getMarkupFromTree(_a) { + var tree = _a.tree, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.renderFunction, renderFunction = _c === void 0 ? require('react-dom/server').renderToStaticMarkup : _c; + var renderPromises = new RenderPromises(); + function process() { + var ApolloContext = reactCommon.getApolloContext(); + var html = renderFunction(React.createElement(ApolloContext.Provider, { value: tslib.__assign({}, context, { renderPromises: renderPromises }) }, tree)); + return renderPromises.hasPromises() + ? renderPromises.consumeAndAwaitPromises().then(process) + : html; + } + return Promise.resolve().then(process); +} + +function renderToStringWithData(component) { + return getMarkupFromTree({ + tree: component, + renderFunction: require('react-dom/server').renderToString, + }); +} + +function useApolloClient() { + var client = React.useContext(reactCommon.getApolloContext()).client; + process.env.NODE_ENV === "production" ? tsInvariant.invariant(!client) : tsInvariant.invariant(!client, 'No Apollo Client instance can be found. Please ensure that you ' + + 'have called `ApolloProvider` higher up in your tree.'); + return client; +} + +Object.defineProperty(exports, 'ApolloConsumer', { + enumerable: true, + get: function () { + return reactCommon.ApolloConsumer; + } +}); +Object.defineProperty(exports, 'ApolloProvider', { + enumerable: true, + get: function () { + return reactCommon.ApolloProvider; + } +}); +Object.defineProperty(exports, 'getApolloContext', { + enumerable: true, + get: function () { + return reactCommon.getApolloContext; + } +}); +Object.defineProperty(exports, 'resetApolloContext', { + enumerable: true, + get: function () { + return reactCommon.resetApolloContext; + } +}); +exports.Mutation = Mutation; +exports.Query = Query; +exports.RenderPromises = RenderPromises; +exports.Subscription = Subscription; +exports.getDataFromTree = getDataFromTree; +exports.getMarkupFromTree = getMarkupFromTree; +exports.renderToStringWithData = renderToStringWithData; +exports.useApolloClient = useApolloClient; diff --git a/packages/components/lib/react-components.esm.js b/packages/components/lib/react-components.esm.js new file mode 100644 index 0000000000..17d0a7aac8 --- /dev/null +++ b/packages/components/lib/react-components.esm.js @@ -0,0 +1,631 @@ +import { getApolloContext, parser, DocumentType } from '@apollo/react-common'; +export { ApolloConsumer, ApolloProvider, getApolloContext, resetApolloContext } from '@apollo/react-common'; +import { __extends, __assign, __rest } from 'tslib'; +import React from 'react'; +import PropTypes from 'prop-types'; +import { NetworkStatus, ApolloError } from 'apollo-client'; +import isEqual from 'lodash.isequal'; +import { invariant } from 'ts-invariant'; + +function getClient(props, context) { + var client = props.client || context.client; + process.env.NODE_ENV === "production" ? invariant(!!client) : invariant(!!client, 'Could not find "client" in the context or passed in as a prop. ' + + 'Wrap the root component in an , or pass an ' + + 'ApolloClient instance in via props.'); + return client; +} + +var hasOwnProperty = Object.prototype.hasOwnProperty; +function is(x, y) { + if (x === y) { + return x !== 0 || y !== 0 || 1 / x === 1 / y; + } + return x !== x && y !== y; +} +function isObject(obj) { + return obj !== null && typeof obj === "object"; +} +function shallowEqual(objA, objB) { + if (is(objA, objB)) { + return true; + } + if (!isObject(objA) || !isObject(objB)) { + return false; + } + var keys = Object.keys(objA); + if (keys.length !== Object.keys(objB).length) { + return false; + } + return keys.every(function (key) { return hasOwnProperty.call(objB, key) && is(objA[key], objB[key]); }); +} + +function observableQueryFields(observable) { + var fields = { + variables: observable.variables, + refetch: observable.refetch.bind(observable), + fetchMore: observable.fetchMore.bind(observable), + updateQuery: observable.updateQuery.bind(observable), + startPolling: observable.startPolling.bind(observable), + stopPolling: observable.stopPolling.bind(observable), + subscribeToMore: observable.subscribeToMore.bind(observable), + }; + return fields; +} +var Query = (function (_super) { + __extends(Query, _super); + function Query() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.hasMounted = false; + _this.previousOptions = null; + _this.previousResult = null; + _this.startQuerySubscription = function (client) { + if (_this.observableQuerySubscription) + return; + _this.observableQuerySubscription = _this.observableQuery.subscribe({ + next: function (_a) { + var loading = _a.loading, networkStatus = _a.networkStatus, data = _a.data; + var previousResult = _this.previousResult; + if (previousResult && + previousResult.loading === loading && + previousResult.networkStatus === networkStatus && + shallowEqual(previousResult.data, data || {})) { + return; + } + _this.updateCurrentData(); + }, + error: function (error) { + var previousResult = _this.previousResult; + if (!previousResult || + previousResult.networkStatus === NetworkStatus.refetch) { + _this.resubscribeToQuery(client); + } + if (!error.hasOwnProperty('graphQLErrors')) + throw error; + _this.updateCurrentData(); + }, + }); + }; + _this.removeQuerySubscription = function () { + if (_this.observableQuerySubscription) { + _this.observableQuerySubscription.unsubscribe(); + delete _this.observableQuerySubscription; + } + }; + _this.updateCurrentData = function () { + _this.handleErrorOrCompleted(); + if (_this.hasMounted) + _this.forceUpdate(); + }; + _this.handleErrorOrCompleted = function () { + var result = _this.observableQuery.getCurrentResult(); + var data = result.data, loading = result.loading, error = result.error; + var _a = _this.props, onCompleted = _a.onCompleted, onError = _a.onError; + if (onCompleted && !loading && !error) { + onCompleted(data); + } + else if (onError && !loading && error) { + onError(error); + } + }; + _this.getQueryResult = function (client) { + var result = { + data: Object.create(null), + }; + Object.assign(result, observableQueryFields(_this.observableQuery)); + if (_this.props.skip) { + result = __assign({}, result, { data: undefined, error: undefined, loading: false }); + } + else { + var currentResult = _this.observableQuery.getCurrentResult(); + var loading = currentResult.loading, partial = currentResult.partial, networkStatus = currentResult.networkStatus, errors = currentResult.errors; + var error = currentResult.error, data = currentResult.data; + data = data || Object.create(null); + if (errors && errors.length > 0) { + error = new ApolloError({ graphQLErrors: errors }); + } + Object.assign(result, { loading: loading, networkStatus: networkStatus, error: error }); + if (loading) { + var previousData = _this.previousResult + ? _this.previousResult.data + : {}; + Object.assign(result.data, previousData, data); + } + else if (error) { + Object.assign(result, { + data: (_this.observableQuery.getLastResult() || {}).data, + }); + } + else { + var fetchPolicy = _this.observableQuery.options.fetchPolicy; + var partialRefetch = _this.props.partialRefetch; + if (partialRefetch && + Object.keys(data).length === 0 && + partial && + fetchPolicy !== 'cache-only') { + Object.assign(result, { + loading: true, + networkStatus: NetworkStatus.loading, + }); + result.refetch(); + return result; + } + Object.assign(result.data, data); + } + } + result.client = client; + _this.previousResult = result; + return result; + }; + return _this; + } + Query.prototype.componentDidMount = function () { + this.hasMounted = true; + }; + Query.prototype.componentDidUpdate = function (prevProps) { + var isDiffRequest = !isEqual(prevProps.query, this.props.query) || + !isEqual(prevProps.variables, this.props.variables); + if (isDiffRequest) { + this.handleErrorOrCompleted(); + } + }; + Query.prototype.componentWillUnmount = function () { + this.removeQuerySubscription(); + this.hasMounted = false; + }; + Query.prototype.render = function () { + var _this = this; + var ApolloContext = getApolloContext(); + return (React.createElement(ApolloContext.Consumer, null, function (context) { + return _this.renderData(context); + })); + }; + Query.prototype.fetchData = function (client, context) { + if (this.props.skip) + return false; + var _a = this.props, children = _a.children, ssr = _a.ssr, displayName = _a.displayName, skip = _a.skip, onCompleted = _a.onCompleted, onError = _a.onError, partialRefetch = _a.partialRefetch, opts = __rest(_a, ["children", "ssr", "displayName", "skip", "onCompleted", "onError", "partialRefetch"]); + var fetchPolicy = opts.fetchPolicy; + if (ssr === false) + return false; + if (fetchPolicy === 'network-only' || fetchPolicy === 'cache-and-network') { + fetchPolicy = 'cache-first'; + } + var observable = client.watchQuery(__assign({}, opts, { fetchPolicy: fetchPolicy })); + if (context && context.renderPromises) { + context.renderPromises.registerSSRObservable(this, observable); + } + var result = this.observableQuery.getCurrentResult(); + return result.loading ? observable.result() : false; + }; + Query.prototype.extractOptsFromProps = function (props) { + this.operation = parser(props.query); + process.env.NODE_ENV === "production" ? invariant(this.operation.type === DocumentType.Query) : invariant(this.operation.type === DocumentType.Query, "The component requires a graphql query, but got a " + (this.operation.type === DocumentType.Mutation + ? 'mutation' + : 'subscription') + "."); + var displayName = props.displayName || 'Query'; + return __assign({}, props, { displayName: displayName, context: props.context || {}, metadata: { reactComponent: { displayName: displayName } } }); + }; + Query.prototype.initializeObservableQuery = function (client, props, context) { + if (context && context.renderPromises) { + this.observableQuery = context.renderPromises.getSSRObservable(this); + } + if (!this.observableQuery) { + var options = this.extractOptsFromProps(props); + this.previousOptions = __assign({}, options, { children: null }); + this.observableQuery = client.watchQuery(options); + } + }; + Query.prototype.updateObservableQuery = function (client, context) { + if (!this.observableQuery) { + this.initializeObservableQuery(client, this.props, context); + } + var newOptions = __assign({}, this.extractOptsFromProps(this.props), { children: null }); + if (!isEqual(newOptions, this.previousOptions)) { + this.previousOptions = newOptions; + this.observableQuery.setOptions(newOptions) + .catch(function () { return null; }); + } + }; + Query.prototype.resubscribeToQuery = function (client) { + this.removeQuerySubscription(); + var lastError = this.observableQuery.getLastError(); + var lastResult = this.observableQuery.getLastResult(); + this.observableQuery.resetLastResults(); + this.startQuerySubscription(client); + Object.assign(this.observableQuery, { lastError: lastError, lastResult: lastResult }); + }; + Query.prototype.currentClient = function (context) { + var client = getClient(this.props, context); + if (this.previousClient !== client) { + this.previousClient = client; + this.removeQuerySubscription(); + this.observableQuery = null; + this.previousResult = null; + } + return client; + }; + Query.prototype.renderData = function (context) { + var _this = this; + var client = this.currentClient(context); + var _a = this.props, skip = _a.skip, query = _a.query; + if (skip || query !== this.previousQuery) { + this.removeQuerySubscription(); + this.observableQuery = null; + this.previousQuery = query; + } + this.updateObservableQuery(client, context); + if (!skip) { + this.startQuerySubscription(client); + } + var finish = function () { return _this.props.children(_this.getQueryResult(client)); }; + if (context && context.renderPromises) { + return context.renderPromises.addQueryPromise(this, finish, client, context); + } + return finish(); + }; + Query.propTypes = { + client: PropTypes.object, + children: PropTypes.func.isRequired, + fetchPolicy: PropTypes.string, + notifyOnNetworkStatusChange: PropTypes.bool, + onCompleted: PropTypes.func, + onError: PropTypes.func, + pollInterval: PropTypes.number, + query: PropTypes.object.isRequired, + variables: PropTypes.object, + ssr: PropTypes.bool, + partialRefetch: PropTypes.bool, + }; + return Query; +}(React.Component)); + +var Mutation = (function (_super) { + __extends(Mutation, _super); + function Mutation(props, context) { + var _this = _super.call(this, props, context) || this; + _this.hasMounted = false; + _this.runMutation = function (options) { + if (options === void 0) { options = {}; } + _this.onMutationStart(); + var mutationId = _this.generateNewMutationId(); + return _this.mutate(options) + .then(function (response) { + _this.onMutationCompleted(response, mutationId); + return response; + }) + .catch(function (e) { + _this.onMutationError(e, mutationId); + if (!_this.props.onError) + throw e; + }); + }; + _this.mutate = function (options) { + var _a = _this.props, mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, update = _a.update, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, fetchPolicy = _a.fetchPolicy; + var mutateOptions = __assign({}, options); + var refetchQueries = mutateOptions.refetchQueries || _this.props.refetchQueries; + var mutateVariables = Object.assign({}, variables, mutateOptions.variables); + delete mutateOptions.variables; + return _this.currentClient().mutate(__assign({ mutation: mutation, + optimisticResponse: optimisticResponse, + refetchQueries: refetchQueries, + awaitRefetchQueries: awaitRefetchQueries, + update: update, + context: context, + fetchPolicy: fetchPolicy, variables: mutateVariables }, mutateOptions)); + }; + _this.onMutationStart = function () { + if (!_this.state.loading && !_this.props.ignoreResults) { + _this.setState({ + loading: true, + error: undefined, + data: undefined, + called: true, + }); + } + }; + _this.onMutationCompleted = function (response, mutationId) { + var _a = _this.props, onCompleted = _a.onCompleted, ignoreResults = _a.ignoreResults; + var data = response.data, errors = response.errors; + var error = errors && errors.length > 0 + ? new ApolloError({ graphQLErrors: errors }) + : undefined; + var callOncomplete = function () { + return onCompleted ? onCompleted(data) : null; + }; + if (_this.hasMounted && + _this.isMostRecentMutation(mutationId) && + !ignoreResults) { + _this.setState({ loading: false, data: data, error: error }, callOncomplete); + } + else { + callOncomplete(); + } + }; + _this.onMutationError = function (error, mutationId) { + var onError = _this.props.onError; + var callOnError = function () { return (onError ? onError(error) : null); }; + if (_this.hasMounted && _this.isMostRecentMutation(mutationId)) { + _this.setState({ loading: false, error: error }, callOnError); + } + else { + callOnError(); + } + }; + _this.generateNewMutationId = function () { + _this.mostRecentMutationId = _this.mostRecentMutationId + 1; + return _this.mostRecentMutationId; + }; + _this.isMostRecentMutation = function (mutationId) { + return _this.mostRecentMutationId === mutationId; + }; + _this.verifyDocumentIsMutation = function (mutation) { + var operation = parser(mutation); + process.env.NODE_ENV === "production" ? invariant(operation.type === DocumentType.Mutation) : invariant(operation.type === DocumentType.Mutation, "The component requires a graphql mutation, but got a " + (operation.type === DocumentType.Query ? 'query' : 'subscription') + "."); + }; + _this.verifyDocumentIsMutation(props.mutation); + _this.mostRecentMutationId = 0; + _this.state = { + called: false, + loading: false, + }; + return _this; + } + Mutation.prototype.componentDidMount = function () { + this.hasMounted = true; + }; + Mutation.prototype.componentDidUpdate = function (prevProps) { + if (this.props.mutation !== prevProps.mutation) { + this.verifyDocumentIsMutation(this.props.mutation); + } + }; + Mutation.prototype.componentWillUnmount = function () { + this.hasMounted = false; + }; + Mutation.prototype.render = function () { + var children = this.props.children; + var _a = this.state, loading = _a.loading, data = _a.data, error = _a.error, called = _a.called; + var result = { + called: called, + loading: loading, + data: data, + error: error, + client: this.currentClient(), + }; + return children(this.runMutation, result); + }; + Mutation.prototype.currentClient = function () { + return getClient(this.props, this.context); + }; + Mutation.contextType = getApolloContext(); + Mutation.propTypes = { + mutation: PropTypes.object.isRequired, + variables: PropTypes.object, + optimisticResponse: PropTypes.object, + refetchQueries: PropTypes.oneOfType([ + PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])), + PropTypes.func, + ]), + awaitRefetchQueries: PropTypes.bool, + update: PropTypes.func, + children: PropTypes.func.isRequired, + onCompleted: PropTypes.func, + onError: PropTypes.func, + fetchPolicy: PropTypes.string, + }; + return Mutation; +}(React.Component)); + +var Subscription = (function (_super) { + __extends(Subscription, _super); + function Subscription(props, context) { + var _this = _super.call(this, props, context) || this; + _this.initialize = function (props) { + if (_this.observableQuery) + return; + _this.observableQuery = _this.client.subscribe({ + query: props.subscription, + variables: props.variables, + fetchPolicy: props.fetchPolicy, + }); + }; + _this.startSubscription = function () { + if (_this.observableQuerySubscription) + return; + _this.observableQuerySubscription = _this.observableQuery.subscribe({ + next: _this.updateCurrentData, + error: _this.updateError, + complete: _this.completeSubscription, + }); + }; + _this.getInitialState = function () { return ({ + loading: true, + error: undefined, + data: undefined, + }); }; + _this.updateCurrentData = function (result) { + var onSubscriptionData = _this.props.onSubscriptionData; + if (onSubscriptionData) { + onSubscriptionData({ + client: _this.client, + subscriptionData: result, + }); + } + _this.setState({ + data: result.data, + loading: false, + error: undefined, + }, function () { + delete _this.previousState; + }); + }; + _this.updateError = function (error) { + _this.setState({ + error: error, + loading: false, + }); + }; + _this.completeSubscription = function () { + var onSubscriptionComplete = _this.props.onSubscriptionComplete; + if (onSubscriptionComplete) + onSubscriptionComplete(); + _this.endSubscription(); + }; + _this.endSubscription = function () { + if (_this.observableQuerySubscription) { + _this.observableQuerySubscription.unsubscribe(); + delete _this.observableQuerySubscription; + } + }; + _this.newClient = function () { + var clientChanged = false; + var client = getClient(_this.props, _this.context); + if (client !== _this.client) { + clientChanged = true; + _this.client = client; + _this.endSubscription(); + delete _this.observableQuery; + } + return clientChanged; + }; + _this.client = getClient(props, context); + _this.initialize(props); + _this.state = _this.getInitialState(); + return _this; + } + Subscription.prototype.componentDidMount = function () { + this.startSubscription(); + }; + Subscription.prototype.componentWillUnmount = function () { + this.endSubscription(); + }; + Subscription.prototype.render = function () { + var currentState = this.state; + if (this.newClient()) { + currentState = this.getInitialState(); + } + var shouldResubscribe = this.props.shouldResubscribe; + if (typeof shouldResubscribe === 'function') { + shouldResubscribe = !!shouldResubscribe(this.props); + } + if (shouldResubscribe !== false && + this.previousProps && + (!shallowEqual(this.previousProps.variables, this.props.variables) || + this.previousProps.subscription !== this.props.subscription)) { + this.endSubscription(); + delete this.observableQuery; + if (!this.previousState) { + currentState = this.getInitialState(); + } + } + this.initialize(this.props); + this.startSubscription(); + var renderFn = this.props.children; + if (!renderFn) + return null; + var result = __assign({}, currentState, { variables: this.props.variables }); + this.previousState = currentState; + this.previousProps = this.props; + return renderFn(result); + }; + Subscription.contextType = getApolloContext(); + Subscription.propTypes = { + subscription: PropTypes.object.isRequired, + variables: PropTypes.object, + children: PropTypes.func, + onSubscriptionData: PropTypes.func, + onSubscriptionComplete: PropTypes.func, + shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]), + }; + return Subscription; +}(React.Component)); + +function makeDefaultQueryInfo() { + return { + seen: false, + observable: null, + }; +} +var RenderPromises = (function () { + function RenderPromises() { + this.queryPromises = new Map(); + this.queryInfoTrie = new Map(); + } + RenderPromises.prototype.registerSSRObservable = function (queryInstance, observable) { + this.lookupQueryInfo(queryInstance).observable = observable; + }; + RenderPromises.prototype.getSSRObservable = function (queryInstance) { + return this.lookupQueryInfo(queryInstance).observable; + }; + RenderPromises.prototype.addQueryPromise = function (queryInstance, finish, client, context) { + var info = this.lookupQueryInfo(queryInstance); + if (!info.seen) { + this.queryPromises.set(queryInstance, new Promise(function (resolve) { + resolve(queryInstance.fetchData(client, context)); + })); + return null; + } + return finish(); + }; + RenderPromises.prototype.hasPromises = function () { + return this.queryPromises.size > 0; + }; + RenderPromises.prototype.consumeAndAwaitPromises = function () { + var _this = this; + var promises = []; + this.queryPromises.forEach(function (promise, queryInstance) { + _this.lookupQueryInfo(queryInstance).seen = true; + promises.push(promise); + }); + this.queryPromises.clear(); + return Promise.all(promises); + }; + RenderPromises.prototype.lookupQueryInfo = function (queryInstance) { + var queryInfoTrie = this.queryInfoTrie; + var _a = queryInstance.props, query = _a.query, variables = _a.variables; + var varMap = queryInfoTrie.get(query) || new Map(); + if (!queryInfoTrie.has(query)) + queryInfoTrie.set(query, varMap); + var variablesString = JSON.stringify(variables); + var info = varMap.get(variablesString) || makeDefaultQueryInfo(); + if (!varMap.has(variablesString)) + varMap.set(variablesString, info); + return info; + }; + return RenderPromises; +}()); +function getDataFromTree(tree, context) { + if (context === void 0) { context = {}; } + return getMarkupFromTree({ + tree: tree, + context: context, + renderFunction: require('react-dom/server').renderToStaticMarkup, + }); +} +function getMarkupFromTree(_a) { + var tree = _a.tree, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.renderFunction, renderFunction = _c === void 0 ? require('react-dom/server').renderToStaticMarkup : _c; + var renderPromises = new RenderPromises(); + function process() { + var ApolloContext = getApolloContext(); + var html = renderFunction(React.createElement(ApolloContext.Provider, { value: __assign({}, context, { renderPromises: renderPromises }) }, tree)); + return renderPromises.hasPromises() + ? renderPromises.consumeAndAwaitPromises().then(process) + : html; + } + return Promise.resolve().then(process); +} + +function renderToStringWithData(component) { + return getMarkupFromTree({ + tree: component, + renderFunction: require('react-dom/server').renderToString, + }); +} + +function useApolloClient() { + var client = React.useContext(getApolloContext()).client; + process.env.NODE_ENV === "production" ? invariant(!client) : invariant(!client, 'No Apollo Client instance can be found. Please ensure that you ' + + 'have called `ApolloProvider` higher up in your tree.'); + return client; +} + +export { Mutation, Query, RenderPromises, Subscription, getDataFromTree, getMarkupFromTree, renderToStringWithData, useApolloClient }; +//# sourceMappingURL=react-components.esm.js.map diff --git a/packages/components/lib/react-components.esm.js.map b/packages/components/lib/react-components.esm.js.map new file mode 100644 index 0000000000..c0d55aea6e --- /dev/null +++ b/packages/components/lib/react-components.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"react-components.esm.js","sources":["../src/utils/getClient.ts","../src/utils/shallowEqual.ts","../src/Query.tsx","../src/Mutation.tsx","../src/Subscription.tsx","../src/ssr/getDataFromTree.ts","../src/ssr/renderToStringWithData.ts","../src/useApolloClient.ts"],"sourcesContent":["import ApolloClient from 'apollo-client';\nimport { invariant } from 'ts-invariant';\n\nimport { ApolloContextValue } from '@apollo/react-common';\n\nexport interface CommonComponentProps {\n client?: ApolloClient;\n}\n\nexport function getClient(\n props: CommonComponentProps,\n context: ApolloContextValue,\n): ApolloClient {\n const client = props.client || context.client;\n\n invariant(\n !!client,\n 'Could not find \"client\" in the context or passed in as a prop. ' +\n 'Wrap the root component in an , or pass an ' +\n 'ApolloClient instance in via props.',\n );\n\n return client as ApolloClient;\n}\n","const { hasOwnProperty } = Object.prototype;\n\nfunction is(x: any, y: any) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n }\n return x !== x && y !== y;\n}\n\nfunction isObject(obj: any): obj is { [key: string]: any } {\n return obj !== null && typeof obj === \"object\";\n}\n\nexport default function shallowEqual(objA: any, objB: any) {\n if (is(objA, objB)) {\n return true;\n }\n\n if (!isObject(objA) || !isObject(objB)) {\n return false;\n }\n\n const keys = Object.keys(objA);\n\n if (keys.length !== Object.keys(objB).length) {\n return false;\n }\n\n return keys.every(\n key => hasOwnProperty.call(objB, key) && is(objA[key], objB[key]),\n );\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ApolloClient, {\n ObservableQuery,\n ApolloError,\n ApolloQueryResult,\n NetworkStatus,\n FetchMoreOptions,\n FetchMoreQueryOptions,\n} from 'apollo-client';\nimport { DocumentNode } from 'graphql';\nimport { ZenObservable } from 'zen-observable-ts';\nimport {\n getApolloContext,\n ApolloContextValue,\n parser,\n DocumentType,\n IDocumentDefinition,\n} from '@apollo/react-common';\nimport isEqual from 'lodash.isequal';\nimport { invariant } from 'ts-invariant';\n\nimport { OperationVariables, QueryOpts } from './types';\nimport { getClient } from './utils/getClient';\nimport shallowEqual from './utils/shallowEqual';\n\nexport type ObservableQueryFields = Pick<\n ObservableQuery,\n | 'startPolling'\n | 'stopPolling'\n | 'subscribeToMore'\n | 'updateQuery'\n | 'refetch'\n | 'variables'\n> & {\n fetchMore: ((\n fetchMoreOptions: FetchMoreQueryOptions &\n FetchMoreOptions,\n ) => Promise>) &\n ((\n fetchMoreOptions: { query: DocumentNode } & FetchMoreQueryOptions<\n TVariables2,\n K\n > &\n FetchMoreOptions,\n ) => Promise>);\n};\n\nfunction observableQueryFields(\n observable: ObservableQuery,\n): ObservableQueryFields {\n const fields = {\n variables: observable.variables,\n refetch: observable.refetch.bind(observable),\n fetchMore: observable.fetchMore.bind(observable),\n updateQuery: observable.updateQuery.bind(observable),\n startPolling: observable.startPolling.bind(observable),\n stopPolling: observable.stopPolling.bind(observable),\n subscribeToMore: observable.subscribeToMore.bind(observable),\n };\n // TODO: Need to cast this because we improved the type of `updateQuery` to be parametric\n // on variables, while the type in Apollo client just has object.\n // Consider removing this when that is properly typed\n return fields as ObservableQueryFields;\n}\n\nexport interface QueryResult\n extends ObservableQueryFields {\n client: ApolloClient;\n data: TData | undefined;\n error?: ApolloError;\n loading: boolean;\n networkStatus: NetworkStatus;\n}\n\nexport interface QueryProps\n extends QueryOpts {\n children: (result: QueryResult) => React.ReactNode;\n query: DocumentNode;\n displayName?: string;\n skip?: boolean;\n onCompleted?: (data: TData) => void;\n onError?: (error: ApolloError) => void;\n}\n\nexport class Query<\n TData = any,\n TVariables = OperationVariables\n> extends React.Component> {\n static propTypes = {\n client: PropTypes.object,\n children: PropTypes.func.isRequired,\n fetchPolicy: PropTypes.string,\n notifyOnNetworkStatusChange: PropTypes.bool,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n pollInterval: PropTypes.number,\n query: PropTypes.object.isRequired,\n variables: PropTypes.object,\n ssr: PropTypes.bool,\n partialRefetch: PropTypes.bool,\n };\n\n private previousClient?: ApolloClient;\n\n // Note that we delete `observableQuerySubscription` if we unsubscribe but\n // never delete `observableQuery` once it is created. We only delete\n // `observableQuery` when we unmount the component.\n private observableQuery?: ObservableQuery | null;\n private observableQuerySubscription?: ZenObservable.Subscription;\n\n private previousQuery?: DocumentNode;\n private hasMounted: boolean = false;\n private operation?: IDocumentDefinition;\n private previousOptions: {} | null = null;\n private previousResult: ApolloQueryResult | null = null;\n\n componentDidMount() {\n this.hasMounted = true;\n }\n\n componentDidUpdate(prevProps: QueryProps) {\n const isDiffRequest =\n !isEqual(prevProps.query, this.props.query) ||\n !isEqual(prevProps.variables, this.props.variables);\n if (isDiffRequest) {\n // If specified, `onError` / `onCompleted` callbacks are called here\n // after local cache results are loaded.\n this.handleErrorOrCompleted();\n }\n }\n\n componentWillUnmount() {\n this.removeQuerySubscription();\n this.hasMounted = false;\n }\n\n render(): React.ReactNode {\n const ApolloContext = getApolloContext();\n return (\n \n {(context: ApolloContextValue) => {\n return this.renderData(context);\n }}\n \n );\n }\n\n // For server-side rendering (see getDataFromTree.ts)\n fetchData(\n client: ApolloClient,\n context: ApolloContextValue,\n ): Promise> | boolean {\n if (this.props.skip) return false;\n\n // pull off react options\n const {\n children,\n ssr,\n displayName,\n skip,\n onCompleted,\n onError,\n partialRefetch,\n ...opts\n } = this.props;\n\n let { fetchPolicy } = opts;\n if (ssr === false) return false;\n if (fetchPolicy === 'network-only' || fetchPolicy === 'cache-and-network') {\n fetchPolicy = 'cache-first'; // ignore force fetch in SSR;\n }\n\n const observable = client.watchQuery({\n ...opts,\n fetchPolicy,\n });\n\n // Register the SSR observable, so it can be re-used once the value comes back.\n if (context && context.renderPromises) {\n context.renderPromises.registerSSRObservable(this, observable);\n }\n\n const result = this.observableQuery!.getCurrentResult();\n return result.loading ? observable.result() : false;\n }\n\n private extractOptsFromProps(props: QueryProps) {\n this.operation = parser(props.query);\n\n invariant(\n this.operation.type === DocumentType.Query,\n `The component requires a graphql query, but got a ${\n this.operation.type === DocumentType.Mutation\n ? 'mutation'\n : 'subscription'\n }.`,\n );\n\n const displayName = props.displayName || 'Query';\n\n return {\n ...props,\n displayName,\n context: props.context || {},\n metadata: { reactComponent: { displayName } },\n };\n }\n\n private initializeObservableQuery(\n client: ApolloClient,\n props: QueryProps,\n context: ApolloContextValue,\n ) {\n // See if there is an existing observable that was used to fetch the same data and\n // if so, use it instead since it will contain the proper queryId to fetch\n // the result set. This is used during SSR.\n if (context && context.renderPromises) {\n this.observableQuery = context.renderPromises.getSSRObservable(this);\n }\n\n if (!this.observableQuery) {\n const options = this.extractOptsFromProps(props);\n this.previousOptions = { ...options, children: null };\n this.observableQuery = client.watchQuery(options);\n }\n }\n\n private updateObservableQuery(\n client: ApolloClient,\n context: ApolloContextValue,\n ) {\n // if we skipped initially, we may not have yet created the observable\n if (!this.observableQuery) {\n this.initializeObservableQuery(client, this.props, context);\n }\n\n const newOptions = {\n ...this.extractOptsFromProps(this.props),\n children: null,\n };\n\n if (!isEqual(newOptions, this.previousOptions)) {\n this.previousOptions = newOptions;\n this.observableQuery!.setOptions(newOptions)\n // The error will be passed to the child container, so we don't\n // need to log it here. We could conceivably log something if\n // an option was set. OTOH we don't log errors w/ the original\n // query. See https://github.com/apollostack/react-apollo/issues/404\n .catch(() => null);\n }\n }\n\n private startQuerySubscription = (client: ApolloClient) => {\n if (this.observableQuerySubscription) return;\n\n this.observableQuerySubscription = this.observableQuery!.subscribe({\n next: ({ loading, networkStatus, data }) => {\n const { previousResult } = this;\n if (\n previousResult &&\n previousResult.loading === loading &&\n previousResult.networkStatus === networkStatus &&\n shallowEqual(previousResult.data, data || {})\n ) {\n return;\n }\n\n this.updateCurrentData();\n },\n error: error => {\n const { previousResult } = this;\n if (\n !previousResult ||\n previousResult.networkStatus === NetworkStatus.refetch\n ) {\n this.resubscribeToQuery(client);\n }\n\n if (!error.hasOwnProperty('graphQLErrors')) throw error;\n this.updateCurrentData();\n },\n });\n };\n\n private removeQuerySubscription = () => {\n if (this.observableQuerySubscription) {\n this.observableQuerySubscription.unsubscribe();\n delete this.observableQuerySubscription;\n }\n };\n\n private resubscribeToQuery(client: ApolloClient) {\n this.removeQuerySubscription();\n\n // Unfortunately, if `lastError` is set in the current\n // `observableQuery` when the subscription is re-created,\n // the subscription will immediately receive the error, which will\n // cause it to terminate again. To avoid this, we first clear\n // the last error/result from the `observableQuery` before re-starting\n // the subscription, and restore it afterwards (so the subscription\n // has a chance to stay open).\n const lastError = this.observableQuery!.getLastError();\n const lastResult = this.observableQuery!.getLastResult();\n this.observableQuery!.resetLastResults();\n this.startQuerySubscription(client);\n Object.assign(this.observableQuery!, { lastError, lastResult });\n }\n\n private updateCurrentData = () => {\n // If specified, `onError` / `onCompleted` callbacks are called here\n // after a network based Query result has been received.\n this.handleErrorOrCompleted();\n\n if (this.hasMounted) this.forceUpdate();\n };\n\n private handleErrorOrCompleted = () => {\n const result = this.observableQuery!.getCurrentResult();\n const { data, loading, error } = result;\n const { onCompleted, onError } = this.props;\n if (onCompleted && !loading && !error) {\n onCompleted(data as TData);\n } else if (onError && !loading && error) {\n onError(error);\n }\n };\n\n private getQueryResult = (\n client: ApolloClient,\n ): QueryResult => {\n let result = {\n data: Object.create(null) as TData,\n } as any;\n\n // Attach bound methods\n Object.assign(result, observableQueryFields(this.observableQuery!));\n\n // When skipping a query (ie. we're not querying for data but still want\n // to render children), make sure the `data` is cleared out and\n // `loading` is set to `false` (since we aren't loading anything).\n if (this.props.skip) {\n result = {\n ...result,\n data: undefined,\n error: undefined,\n loading: false,\n };\n } else {\n // Fetch the current result (if any) from the store.\n const currentResult = this.observableQuery!.getCurrentResult();\n const { loading, partial, networkStatus, errors } = currentResult;\n let { error, data } = currentResult;\n data = data || (Object.create(null) as TData);\n\n // Until a set naming convention for networkError and graphQLErrors is\n // decided upon, we map errors (graphQLErrors) to the error props.\n if (errors && errors.length > 0) {\n error = new ApolloError({ graphQLErrors: errors });\n }\n\n Object.assign(result, { loading, networkStatus, error });\n\n if (loading) {\n const previousData = this.previousResult\n ? this.previousResult.data\n : {};\n Object.assign(result.data, previousData, data);\n } else if (error) {\n Object.assign(result, {\n data: (this.observableQuery!.getLastResult() || {}).data,\n });\n } else {\n const { fetchPolicy } = this.observableQuery!.options;\n const { partialRefetch } = this.props;\n if (\n partialRefetch &&\n Object.keys(data).length === 0 &&\n partial &&\n fetchPolicy !== 'cache-only'\n ) {\n // When a `Query` component is mounted, and a mutation is executed\n // that returns the same ID as the mounted `Query`, but has less\n // fields in its result, Apollo Client's `QueryManager` returns the\n // data as an empty Object since a hit can't be found in the cache.\n // This can lead to application errors when the UI elements rendered by\n // the original `Query` component are expecting certain data values to\n // exist, and they're all of a sudden stripped away. To help avoid\n // this we'll attempt to refetch the `Query` data.\n Object.assign(result, {\n loading: true,\n networkStatus: NetworkStatus.loading,\n });\n result.refetch();\n return result;\n }\n\n Object.assign(result.data, data);\n }\n }\n\n result.client = client;\n this.previousResult = result;\n return result;\n };\n\n private currentClient(context: any) {\n const client = getClient(this.props, context);\n if (this.previousClient !== client) {\n this.previousClient = client;\n this.removeQuerySubscription();\n this.observableQuery = null;\n this.previousResult = null;\n }\n return client;\n }\n\n private renderData(context: ApolloContextValue): React.ReactNode {\n const client = this.currentClient(context);\n\n const { skip, query } = this.props;\n if (skip || query !== this.previousQuery) {\n this.removeQuerySubscription();\n this.observableQuery = null;\n this.previousQuery = query;\n }\n\n this.updateObservableQuery(client, context);\n\n if (!skip) {\n this.startQuerySubscription(client);\n }\n\n const finish = () => this.props.children(this.getQueryResult(client));\n if (context && context.renderPromises) {\n return context.renderPromises.addQueryPromise(\n this,\n finish,\n client,\n context,\n );\n }\n return finish();\n }\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ApolloClient, {\n PureQueryOptions,\n ApolloError,\n FetchPolicy,\n} from 'apollo-client';\nimport { DataProxy } from 'apollo-cache';\nimport { invariant } from 'ts-invariant';\nimport { DocumentNode, GraphQLError } from 'graphql';\nimport {\n getApolloContext,\n ApolloContextValue,\n parser,\n DocumentType,\n} from '@apollo/react-common';\n\nimport { OperationVariables, RefetchQueriesProviderFn } from './types';\nimport { getClient } from './utils/getClient';\n\nexport interface MutationResult> {\n data?: TData;\n error?: ApolloError;\n loading: boolean;\n called: boolean;\n client: ApolloClient;\n}\n\nexport interface ExecutionResult> {\n data?: T;\n extensions?: Record;\n errors?: GraphQLError[];\n}\n\nexport declare type MutationUpdaterFn<\n T = {\n [key: string]: any;\n }\n> = (proxy: DataProxy, mutationResult: FetchResult) => void;\n\nexport declare type FetchResult<\n TData = Record,\n C = Record,\n E = Record\n> = ExecutionResult & {\n extensions?: E;\n context?: C;\n};\n\nexport declare type MutationOptions<\n TData = Record,\n TVariables = OperationVariables\n> = {\n variables?: TVariables;\n optimisticResponse?: TData;\n refetchQueries?: Array | RefetchQueriesProviderFn;\n awaitRefetchQueries?: boolean;\n update?: MutationUpdaterFn;\n context?: Record;\n fetchPolicy?: FetchPolicy;\n};\n\nexport declare type MutationFn = (\n options?: MutationOptions,\n) => Promise>;\n\nexport interface MutationProps {\n client?: ApolloClient;\n mutation: DocumentNode;\n ignoreResults?: boolean;\n optimisticResponse?: TData;\n variables?: TVariables;\n refetchQueries?: Array | RefetchQueriesProviderFn;\n awaitRefetchQueries?: boolean;\n update?: MutationUpdaterFn;\n children: (\n mutateFn: MutationFn,\n result: MutationResult,\n ) => React.ReactNode;\n onCompleted?: (data: TData) => void;\n onError?: (error: ApolloError) => void;\n context?: Record;\n fetchPolicy?: FetchPolicy;\n}\n\nexport interface MutationState {\n called: boolean;\n loading: boolean;\n error?: ApolloError;\n data?: TData;\n}\n\nexport class Mutation<\n TData = any,\n TVariables = OperationVariables\n> extends React.Component<\n MutationProps,\n MutationState\n> {\n static contextType = getApolloContext();\n\n static propTypes = {\n mutation: PropTypes.object.isRequired,\n variables: PropTypes.object,\n optimisticResponse: PropTypes.object,\n refetchQueries: PropTypes.oneOfType([\n PropTypes.arrayOf(\n PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n ),\n PropTypes.func,\n ]),\n awaitRefetchQueries: PropTypes.bool,\n update: PropTypes.func,\n children: PropTypes.func.isRequired,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n fetchPolicy: PropTypes.string,\n };\n\n private mostRecentMutationId: number;\n private hasMounted: boolean = false;\n\n constructor(\n props: MutationProps,\n context: ApolloContextValue,\n ) {\n super(props, context);\n this.verifyDocumentIsMutation(props.mutation);\n this.mostRecentMutationId = 0;\n this.state = {\n called: false,\n loading: false,\n };\n }\n\n componentDidMount() {\n this.hasMounted = true;\n }\n\n componentDidUpdate(prevProps: MutationProps) {\n if (this.props.mutation !== prevProps.mutation) {\n this.verifyDocumentIsMutation(this.props.mutation);\n }\n }\n\n componentWillUnmount() {\n this.hasMounted = false;\n }\n\n render() {\n const { children } = this.props;\n const { loading, data, error, called } = this.state;\n\n const result = {\n called,\n loading,\n data,\n error,\n client: this.currentClient(),\n };\n\n return children(this.runMutation, result);\n }\n\n private runMutation = (options: MutationOptions = {}) => {\n this.onMutationStart();\n const mutationId = this.generateNewMutationId();\n\n return this.mutate(options)\n .then((response: ExecutionResult) => {\n this.onMutationCompleted(response, mutationId);\n return response;\n })\n .catch((e: ApolloError) => {\n this.onMutationError(e, mutationId);\n if (!this.props.onError) throw e;\n });\n };\n\n private mutate = (options: MutationOptions) => {\n const {\n mutation,\n variables,\n optimisticResponse,\n update,\n context = {},\n awaitRefetchQueries = false,\n fetchPolicy,\n } = this.props;\n const mutateOptions = { ...options };\n\n let refetchQueries =\n mutateOptions.refetchQueries || this.props.refetchQueries;\n const mutateVariables = Object.assign(\n {},\n variables,\n mutateOptions.variables,\n );\n delete mutateOptions.variables;\n\n return this.currentClient().mutate({\n mutation,\n optimisticResponse,\n refetchQueries,\n awaitRefetchQueries,\n update,\n context,\n fetchPolicy,\n variables: mutateVariables,\n ...mutateOptions,\n });\n };\n\n private onMutationStart = () => {\n if (!this.state.loading && !this.props.ignoreResults) {\n this.setState({\n loading: true,\n error: undefined,\n data: undefined,\n called: true,\n });\n }\n };\n\n private onMutationCompleted = (\n response: ExecutionResult,\n mutationId: number,\n ) => {\n const { onCompleted, ignoreResults } = this.props;\n\n const { data, errors } = response;\n const error =\n errors && errors.length > 0\n ? new ApolloError({ graphQLErrors: errors })\n : undefined;\n\n const callOncomplete = () =>\n onCompleted ? onCompleted(data as TData) : null;\n\n if (\n this.hasMounted &&\n this.isMostRecentMutation(mutationId) &&\n !ignoreResults\n ) {\n this.setState({ loading: false, data, error }, callOncomplete);\n } else {\n callOncomplete();\n }\n };\n\n private onMutationError = (error: ApolloError, mutationId: number) => {\n const { onError } = this.props;\n const callOnError = () => (onError ? onError(error) : null);\n\n if (this.hasMounted && this.isMostRecentMutation(mutationId)) {\n this.setState({ loading: false, error }, callOnError);\n } else {\n callOnError();\n }\n };\n\n private generateNewMutationId = (): number => {\n this.mostRecentMutationId = this.mostRecentMutationId + 1;\n return this.mostRecentMutationId;\n };\n\n private isMostRecentMutation = (mutationId: number) => {\n return this.mostRecentMutationId === mutationId;\n };\n\n private verifyDocumentIsMutation = (mutation: DocumentNode) => {\n const operation = parser(mutation);\n invariant(\n operation.type === DocumentType.Mutation,\n `The component requires a graphql mutation, but got a ${\n operation.type === DocumentType.Query ? 'query' : 'subscription'\n }.`,\n );\n };\n\n private currentClient() {\n return getClient(this.props, this.context);\n }\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ApolloClient, { ApolloError, FetchPolicy } from 'apollo-client';\nimport { Observable } from 'apollo-link';\nimport { DocumentNode } from 'graphql';\nimport { ZenObservable } from 'zen-observable-ts';\nimport { getApolloContext, ApolloContextValue } from '@apollo/react-common';\n\nimport { OperationVariables } from './types';\nimport { getClient } from './utils/getClient';\nimport shallowEqual from './utils/shallowEqual';\n\nexport interface SubscriptionResult {\n loading: boolean;\n data?: TData;\n error?: ApolloError;\n}\n\nexport interface OnSubscriptionDataOptions {\n client: ApolloClient;\n subscriptionData: SubscriptionResult;\n}\n\nexport interface SubscriptionProps<\n TData = any,\n TVariables = OperationVariables\n> {\n subscription: DocumentNode;\n variables?: TVariables;\n fetchPolicy?: FetchPolicy;\n shouldResubscribe?: any;\n client?: ApolloClient;\n onSubscriptionData?: (options: OnSubscriptionDataOptions) => any;\n onSubscriptionComplete?: () => void;\n children?: (result: SubscriptionResult) => React.ReactNode;\n}\n\nexport interface SubscriptionState {\n loading: boolean;\n data?: TData;\n error?: ApolloError;\n}\n\nexport class Subscription<\n TData = any,\n TVariables = any\n> extends React.Component<\n SubscriptionProps,\n SubscriptionState\n> {\n static contextType = getApolloContext();\n\n static propTypes = {\n subscription: PropTypes.object.isRequired,\n variables: PropTypes.object,\n children: PropTypes.func,\n onSubscriptionData: PropTypes.func,\n onSubscriptionComplete: PropTypes.func,\n shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\n };\n\n private client: ApolloClient;\n private previousState?: Readonly>;\n private previousProps?: Readonly>;\n private observableQuery?: Observable;\n private observableQuerySubscription?: ZenObservable.Subscription;\n\n constructor(\n props: SubscriptionProps,\n context: ApolloContextValue,\n ) {\n super(props, context);\n this.client = getClient(props, context);\n this.initialize(props);\n this.state = this.getInitialState();\n }\n\n componentDidMount() {\n this.startSubscription();\n }\n\n componentWillUnmount() {\n this.endSubscription();\n }\n\n render() {\n let currentState = this.state;\n\n if (this.newClient()) {\n currentState = this.getInitialState();\n }\n\n let { shouldResubscribe } = this.props;\n if (typeof shouldResubscribe === 'function') {\n shouldResubscribe = !!shouldResubscribe(this.props);\n }\n\n if (\n shouldResubscribe !== false &&\n this.previousProps &&\n (!shallowEqual(this.previousProps.variables, this.props.variables) ||\n this.previousProps.subscription !== this.props.subscription)\n ) {\n this.endSubscription();\n delete this.observableQuery;\n\n if (!this.previousState) {\n currentState = this.getInitialState();\n }\n }\n\n this.initialize(this.props);\n this.startSubscription();\n\n const renderFn: any = this.props.children;\n if (!renderFn) return null;\n\n const result = { ...currentState, variables: this.props.variables };\n this.previousState = currentState;\n this.previousProps = this.props;\n return renderFn(result);\n }\n\n private initialize = (props: SubscriptionProps) => {\n if (this.observableQuery) return;\n this.observableQuery = this.client.subscribe({\n query: props.subscription,\n variables: props.variables,\n fetchPolicy: props.fetchPolicy,\n });\n };\n\n private startSubscription = () => {\n if (this.observableQuerySubscription) return;\n this.observableQuerySubscription = this.observableQuery!.subscribe({\n next: this.updateCurrentData,\n error: this.updateError,\n complete: this.completeSubscription,\n });\n };\n\n private getInitialState = () => ({\n loading: true,\n error: undefined,\n data: undefined,\n });\n\n private updateCurrentData = (result: SubscriptionResult) => {\n const {\n props: { onSubscriptionData },\n } = this;\n\n if (onSubscriptionData) {\n onSubscriptionData({\n client: this.client,\n subscriptionData: result,\n });\n }\n\n this.setState(\n {\n data: result.data,\n loading: false,\n error: undefined,\n },\n () => {\n delete this.previousState;\n },\n );\n };\n\n private updateError = (error: any) => {\n this.setState({\n error,\n loading: false,\n });\n };\n\n private completeSubscription = () => {\n const { onSubscriptionComplete } = this.props;\n if (onSubscriptionComplete) onSubscriptionComplete();\n this.endSubscription();\n };\n\n private endSubscription = () => {\n if (this.observableQuerySubscription) {\n this.observableQuerySubscription.unsubscribe();\n delete this.observableQuerySubscription;\n }\n };\n\n private newClient = () => {\n let clientChanged = false;\n const client = getClient(this.props, this.context);\n if (client !== this.client) {\n clientChanged = true;\n this.client = client;\n this.endSubscription();\n delete this.observableQuery;\n }\n return clientChanged;\n };\n}\n","import React from 'react';\nimport { ApolloClient, ObservableQuery } from 'apollo-client';\nimport { DocumentNode } from 'graphql';\nimport { getApolloContext, ApolloContextValue } from '@apollo/react-common';\n\nimport { Query } from '../Query';\n\ntype QueryInfo = {\n seen: boolean;\n observable: ObservableQuery | null;\n};\n\nfunction makeDefaultQueryInfo(): QueryInfo {\n return {\n seen: false,\n observable: null,\n };\n}\n\nexport class RenderPromises {\n // Map from Query component instances to pending fetchData promises.\n private queryPromises = new Map, Promise>();\n\n // Two-layered map from (query document, stringified variables) to QueryInfo\n // objects. These QueryInfo objects are intended to survive through the whole\n // getMarkupFromTree process, whereas specific Query instances do not survive\n // beyond a single call to renderToStaticMarkup.\n private queryInfoTrie = new Map>();\n\n // Registers the server side rendered observable.\n public registerSSRObservable(\n queryInstance: Query,\n observable: ObservableQuery,\n ) {\n this.lookupQueryInfo(queryInstance).observable = observable;\n }\n\n // Get's the cached observable that matches the SSR Query instances query and variables.\n public getSSRObservable(\n queryInstance: Query,\n ) {\n return this.lookupQueryInfo(queryInstance).observable;\n }\n\n public addQueryPromise(\n queryInstance: Query,\n finish: () => React.ReactNode,\n client: ApolloClient,\n context: ApolloContextValue,\n ): React.ReactNode {\n const info = this.lookupQueryInfo(queryInstance);\n if (!info.seen) {\n this.queryPromises.set(\n queryInstance,\n new Promise(resolve => {\n resolve(queryInstance.fetchData(client, context));\n }),\n );\n // Render null to abandon this subtree for this rendering, so that we\n // can wait for the data to arrive.\n return null;\n }\n return finish();\n }\n\n public hasPromises() {\n return this.queryPromises.size > 0;\n }\n\n public consumeAndAwaitPromises() {\n const promises: Promise[] = [];\n this.queryPromises.forEach((promise, queryInstance) => {\n // Make sure we never try to call fetchData for this query document and\n // these variables again. Since the queryInstance objects change with\n // every rendering, deduplicating them by query and variables is the\n // best we can do. If a different Query component happens to have the\n // same query document and variables, it will be immediately rendered\n // by calling finish() in addQueryPromise, which could result in the\n // rendering of an unwanted loading state, but that's not nearly as bad\n // as getting stuck in an infinite rendering loop because we kept calling\n // queryInstance.fetchData for the same Query component indefinitely.\n this.lookupQueryInfo(queryInstance).seen = true;\n promises.push(promise);\n });\n this.queryPromises.clear();\n return Promise.all(promises);\n }\n\n private lookupQueryInfo(\n queryInstance: Query,\n ): QueryInfo {\n const { queryInfoTrie } = this;\n const { query, variables } = queryInstance.props;\n const varMap = queryInfoTrie.get(query) || new Map();\n if (!queryInfoTrie.has(query)) queryInfoTrie.set(query, varMap);\n const variablesString = JSON.stringify(variables);\n const info = varMap.get(variablesString) || makeDefaultQueryInfo();\n if (!varMap.has(variablesString)) varMap.set(variablesString, info);\n return info;\n }\n}\n\nexport function getDataFromTree(\n tree: React.ReactNode,\n context: { [key: string]: any } = {},\n) {\n return getMarkupFromTree({\n tree,\n context,\n // If you need to configure this renderFunction, call getMarkupFromTree\n // directly instead of getDataFromTree.\n renderFunction: require('react-dom/server').renderToStaticMarkup,\n });\n}\n\nexport type GetMarkupFromTreeOptions = {\n tree: React.ReactNode;\n context?: { [key: string]: any };\n renderFunction?: (tree: React.ReactElement) => string;\n};\n\nexport function getMarkupFromTree({\n tree,\n context = {},\n // The rendering function is configurable! We use renderToStaticMarkup as\n // the default, because it's a little less expensive than renderToString,\n // and legacy usage of getDataFromTree ignores the return value anyway.\n renderFunction = require('react-dom/server').renderToStaticMarkup,\n}: GetMarkupFromTreeOptions): Promise {\n const renderPromises = new RenderPromises();\n\n function process(): Promise | string {\n // Always re-render from the rootElement, even though it might seem\n // better to render the children of the component responsible for the\n // promise, because it is not possible to reconstruct the full context\n // of the original rendering (including all unknown context provider\n // elements) for a subtree of the orginal component tree.\n const ApolloContext = getApolloContext();\n const html = renderFunction(\n React.createElement(\n ApolloContext.Provider,\n { value: { ...context, renderPromises } },\n tree,\n ),\n );\n\n return renderPromises.hasPromises()\n ? renderPromises.consumeAndAwaitPromises().then(process)\n : html;\n }\n\n return Promise.resolve().then(process);\n}\n","import { ReactElement } from 'react';\nimport { getMarkupFromTree } from './getDataFromTree';\n\nexport function renderToStringWithData(\n component: ReactElement,\n): Promise {\n return getMarkupFromTree({\n tree: component,\n renderFunction: require('react-dom/server').renderToString,\n });\n}\n","import React from 'react';\nimport { invariant } from 'ts-invariant';\nimport { getApolloContext } from '@apollo/react-common';\n\nexport function useApolloClient() {\n const { client } = React.useContext(getApolloContext());\n invariant(\n !client,\n 'No Apollo Client instance can be found. Please ensure that you ' +\n 'have called `ApolloProvider` higher up in your tree.',\n );\n return client;\n}\n"],"names":["tslib_1.__extends"],"mappings":"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"} \ No newline at end of file diff --git a/packages/components/lib/react-components.umd.js b/packages/components/lib/react-components.umd.js new file mode 100644 index 0000000000..a1d8d46638 --- /dev/null +++ b/packages/components/lib/react-components.umd.js @@ -0,0 +1,666 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@apollo/react-common'), require('tslib'), require('react'), require('prop-types'), require('apollo-client'), require('lodash.isequal'), require('ts-invariant')) : + typeof define === 'function' && define.amd ? define(['exports', '@apollo/react-common', 'tslib', 'react', 'prop-types', 'apollo-client', 'lodash.isequal', 'ts-invariant'], factory) : + (global = global || self, factory(global['react-components'] = {}, global.apolloReactCommon, global.tslib, global.React, global.PropTypes, global.apollo.core, global.isEqual, global.invariant)); +}(this, function (exports, reactCommon, tslib, React, PropTypes, apolloClient, isEqual, tsInvariant) { 'use strict'; + + React = React && React.hasOwnProperty('default') ? React['default'] : React; + PropTypes = PropTypes && PropTypes.hasOwnProperty('default') ? PropTypes['default'] : PropTypes; + isEqual = isEqual && isEqual.hasOwnProperty('default') ? isEqual['default'] : isEqual; + + function getClient(props, context) { + var client = props.client || context.client; + process.env.NODE_ENV === "production" ? tsInvariant.invariant(!!client) : tsInvariant.invariant(!!client, 'Could not find "client" in the context or passed in as a prop. ' + + 'Wrap the root component in an , or pass an ' + + 'ApolloClient instance in via props.'); + return client; + } + + var hasOwnProperty = Object.prototype.hasOwnProperty; + function is(x, y) { + if (x === y) { + return x !== 0 || y !== 0 || 1 / x === 1 / y; + } + return x !== x && y !== y; + } + function isObject(obj) { + return obj !== null && typeof obj === "object"; + } + function shallowEqual(objA, objB) { + if (is(objA, objB)) { + return true; + } + if (!isObject(objA) || !isObject(objB)) { + return false; + } + var keys = Object.keys(objA); + if (keys.length !== Object.keys(objB).length) { + return false; + } + return keys.every(function (key) { return hasOwnProperty.call(objB, key) && is(objA[key], objB[key]); }); + } + + function observableQueryFields(observable) { + var fields = { + variables: observable.variables, + refetch: observable.refetch.bind(observable), + fetchMore: observable.fetchMore.bind(observable), + updateQuery: observable.updateQuery.bind(observable), + startPolling: observable.startPolling.bind(observable), + stopPolling: observable.stopPolling.bind(observable), + subscribeToMore: observable.subscribeToMore.bind(observable), + }; + return fields; + } + var Query = (function (_super) { + tslib.__extends(Query, _super); + function Query() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.hasMounted = false; + _this.previousOptions = null; + _this.previousResult = null; + _this.startQuerySubscription = function (client) { + if (_this.observableQuerySubscription) + return; + _this.observableQuerySubscription = _this.observableQuery.subscribe({ + next: function (_a) { + var loading = _a.loading, networkStatus = _a.networkStatus, data = _a.data; + var previousResult = _this.previousResult; + if (previousResult && + previousResult.loading === loading && + previousResult.networkStatus === networkStatus && + shallowEqual(previousResult.data, data || {})) { + return; + } + _this.updateCurrentData(); + }, + error: function (error) { + var previousResult = _this.previousResult; + if (!previousResult || + previousResult.networkStatus === apolloClient.NetworkStatus.refetch) { + _this.resubscribeToQuery(client); + } + if (!error.hasOwnProperty('graphQLErrors')) + throw error; + _this.updateCurrentData(); + }, + }); + }; + _this.removeQuerySubscription = function () { + if (_this.observableQuerySubscription) { + _this.observableQuerySubscription.unsubscribe(); + delete _this.observableQuerySubscription; + } + }; + _this.updateCurrentData = function () { + _this.handleErrorOrCompleted(); + if (_this.hasMounted) + _this.forceUpdate(); + }; + _this.handleErrorOrCompleted = function () { + var result = _this.observableQuery.getCurrentResult(); + var data = result.data, loading = result.loading, error = result.error; + var _a = _this.props, onCompleted = _a.onCompleted, onError = _a.onError; + if (onCompleted && !loading && !error) { + onCompleted(data); + } + else if (onError && !loading && error) { + onError(error); + } + }; + _this.getQueryResult = function (client) { + var result = { + data: Object.create(null), + }; + Object.assign(result, observableQueryFields(_this.observableQuery)); + if (_this.props.skip) { + result = tslib.__assign({}, result, { data: undefined, error: undefined, loading: false }); + } + else { + var currentResult = _this.observableQuery.getCurrentResult(); + var loading = currentResult.loading, partial = currentResult.partial, networkStatus = currentResult.networkStatus, errors = currentResult.errors; + var error = currentResult.error, data = currentResult.data; + data = data || Object.create(null); + if (errors && errors.length > 0) { + error = new apolloClient.ApolloError({ graphQLErrors: errors }); + } + Object.assign(result, { loading: loading, networkStatus: networkStatus, error: error }); + if (loading) { + var previousData = _this.previousResult + ? _this.previousResult.data + : {}; + Object.assign(result.data, previousData, data); + } + else if (error) { + Object.assign(result, { + data: (_this.observableQuery.getLastResult() || {}).data, + }); + } + else { + var fetchPolicy = _this.observableQuery.options.fetchPolicy; + var partialRefetch = _this.props.partialRefetch; + if (partialRefetch && + Object.keys(data).length === 0 && + partial && + fetchPolicy !== 'cache-only') { + Object.assign(result, { + loading: true, + networkStatus: apolloClient.NetworkStatus.loading, + }); + result.refetch(); + return result; + } + Object.assign(result.data, data); + } + } + result.client = client; + _this.previousResult = result; + return result; + }; + return _this; + } + Query.prototype.componentDidMount = function () { + this.hasMounted = true; + }; + Query.prototype.componentDidUpdate = function (prevProps) { + var isDiffRequest = !isEqual(prevProps.query, this.props.query) || + !isEqual(prevProps.variables, this.props.variables); + if (isDiffRequest) { + this.handleErrorOrCompleted(); + } + }; + Query.prototype.componentWillUnmount = function () { + this.removeQuerySubscription(); + this.hasMounted = false; + }; + Query.prototype.render = function () { + var _this = this; + var ApolloContext = reactCommon.getApolloContext(); + return (React.createElement(ApolloContext.Consumer, null, function (context) { + return _this.renderData(context); + })); + }; + Query.prototype.fetchData = function (client, context) { + if (this.props.skip) + return false; + var _a = this.props, children = _a.children, ssr = _a.ssr, displayName = _a.displayName, skip = _a.skip, onCompleted = _a.onCompleted, onError = _a.onError, partialRefetch = _a.partialRefetch, opts = tslib.__rest(_a, ["children", "ssr", "displayName", "skip", "onCompleted", "onError", "partialRefetch"]); + var fetchPolicy = opts.fetchPolicy; + if (ssr === false) + return false; + if (fetchPolicy === 'network-only' || fetchPolicy === 'cache-and-network') { + fetchPolicy = 'cache-first'; + } + var observable = client.watchQuery(tslib.__assign({}, opts, { fetchPolicy: fetchPolicy })); + if (context && context.renderPromises) { + context.renderPromises.registerSSRObservable(this, observable); + } + var result = this.observableQuery.getCurrentResult(); + return result.loading ? observable.result() : false; + }; + Query.prototype.extractOptsFromProps = function (props) { + this.operation = reactCommon.parser(props.query); + process.env.NODE_ENV === "production" ? tsInvariant.invariant(this.operation.type === reactCommon.DocumentType.Query) : tsInvariant.invariant(this.operation.type === reactCommon.DocumentType.Query, "The component requires a graphql query, but got a " + (this.operation.type === reactCommon.DocumentType.Mutation + ? 'mutation' + : 'subscription') + "."); + var displayName = props.displayName || 'Query'; + return tslib.__assign({}, props, { displayName: displayName, context: props.context || {}, metadata: { reactComponent: { displayName: displayName } } }); + }; + Query.prototype.initializeObservableQuery = function (client, props, context) { + if (context && context.renderPromises) { + this.observableQuery = context.renderPromises.getSSRObservable(this); + } + if (!this.observableQuery) { + var options = this.extractOptsFromProps(props); + this.previousOptions = tslib.__assign({}, options, { children: null }); + this.observableQuery = client.watchQuery(options); + } + }; + Query.prototype.updateObservableQuery = function (client, context) { + if (!this.observableQuery) { + this.initializeObservableQuery(client, this.props, context); + } + var newOptions = tslib.__assign({}, this.extractOptsFromProps(this.props), { children: null }); + if (!isEqual(newOptions, this.previousOptions)) { + this.previousOptions = newOptions; + this.observableQuery.setOptions(newOptions) + .catch(function () { return null; }); + } + }; + Query.prototype.resubscribeToQuery = function (client) { + this.removeQuerySubscription(); + var lastError = this.observableQuery.getLastError(); + var lastResult = this.observableQuery.getLastResult(); + this.observableQuery.resetLastResults(); + this.startQuerySubscription(client); + Object.assign(this.observableQuery, { lastError: lastError, lastResult: lastResult }); + }; + Query.prototype.currentClient = function (context) { + var client = getClient(this.props, context); + if (this.previousClient !== client) { + this.previousClient = client; + this.removeQuerySubscription(); + this.observableQuery = null; + this.previousResult = null; + } + return client; + }; + Query.prototype.renderData = function (context) { + var _this = this; + var client = this.currentClient(context); + var _a = this.props, skip = _a.skip, query = _a.query; + if (skip || query !== this.previousQuery) { + this.removeQuerySubscription(); + this.observableQuery = null; + this.previousQuery = query; + } + this.updateObservableQuery(client, context); + if (!skip) { + this.startQuerySubscription(client); + } + var finish = function () { return _this.props.children(_this.getQueryResult(client)); }; + if (context && context.renderPromises) { + return context.renderPromises.addQueryPromise(this, finish, client, context); + } + return finish(); + }; + Query.propTypes = { + client: PropTypes.object, + children: PropTypes.func.isRequired, + fetchPolicy: PropTypes.string, + notifyOnNetworkStatusChange: PropTypes.bool, + onCompleted: PropTypes.func, + onError: PropTypes.func, + pollInterval: PropTypes.number, + query: PropTypes.object.isRequired, + variables: PropTypes.object, + ssr: PropTypes.bool, + partialRefetch: PropTypes.bool, + }; + return Query; + }(React.Component)); + + var Mutation = (function (_super) { + tslib.__extends(Mutation, _super); + function Mutation(props, context) { + var _this = _super.call(this, props, context) || this; + _this.hasMounted = false; + _this.runMutation = function (options) { + if (options === void 0) { options = {}; } + _this.onMutationStart(); + var mutationId = _this.generateNewMutationId(); + return _this.mutate(options) + .then(function (response) { + _this.onMutationCompleted(response, mutationId); + return response; + }) + .catch(function (e) { + _this.onMutationError(e, mutationId); + if (!_this.props.onError) + throw e; + }); + }; + _this.mutate = function (options) { + var _a = _this.props, mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, update = _a.update, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, fetchPolicy = _a.fetchPolicy; + var mutateOptions = tslib.__assign({}, options); + var refetchQueries = mutateOptions.refetchQueries || _this.props.refetchQueries; + var mutateVariables = Object.assign({}, variables, mutateOptions.variables); + delete mutateOptions.variables; + return _this.currentClient().mutate(tslib.__assign({ mutation: mutation, + optimisticResponse: optimisticResponse, + refetchQueries: refetchQueries, + awaitRefetchQueries: awaitRefetchQueries, + update: update, + context: context, + fetchPolicy: fetchPolicy, variables: mutateVariables }, mutateOptions)); + }; + _this.onMutationStart = function () { + if (!_this.state.loading && !_this.props.ignoreResults) { + _this.setState({ + loading: true, + error: undefined, + data: undefined, + called: true, + }); + } + }; + _this.onMutationCompleted = function (response, mutationId) { + var _a = _this.props, onCompleted = _a.onCompleted, ignoreResults = _a.ignoreResults; + var data = response.data, errors = response.errors; + var error = errors && errors.length > 0 + ? new apolloClient.ApolloError({ graphQLErrors: errors }) + : undefined; + var callOncomplete = function () { + return onCompleted ? onCompleted(data) : null; + }; + if (_this.hasMounted && + _this.isMostRecentMutation(mutationId) && + !ignoreResults) { + _this.setState({ loading: false, data: data, error: error }, callOncomplete); + } + else { + callOncomplete(); + } + }; + _this.onMutationError = function (error, mutationId) { + var onError = _this.props.onError; + var callOnError = function () { return (onError ? onError(error) : null); }; + if (_this.hasMounted && _this.isMostRecentMutation(mutationId)) { + _this.setState({ loading: false, error: error }, callOnError); + } + else { + callOnError(); + } + }; + _this.generateNewMutationId = function () { + _this.mostRecentMutationId = _this.mostRecentMutationId + 1; + return _this.mostRecentMutationId; + }; + _this.isMostRecentMutation = function (mutationId) { + return _this.mostRecentMutationId === mutationId; + }; + _this.verifyDocumentIsMutation = function (mutation) { + var operation = reactCommon.parser(mutation); + process.env.NODE_ENV === "production" ? tsInvariant.invariant(operation.type === reactCommon.DocumentType.Mutation) : tsInvariant.invariant(operation.type === reactCommon.DocumentType.Mutation, "The component requires a graphql mutation, but got a " + (operation.type === reactCommon.DocumentType.Query ? 'query' : 'subscription') + "."); + }; + _this.verifyDocumentIsMutation(props.mutation); + _this.mostRecentMutationId = 0; + _this.state = { + called: false, + loading: false, + }; + return _this; + } + Mutation.prototype.componentDidMount = function () { + this.hasMounted = true; + }; + Mutation.prototype.componentDidUpdate = function (prevProps) { + if (this.props.mutation !== prevProps.mutation) { + this.verifyDocumentIsMutation(this.props.mutation); + } + }; + Mutation.prototype.componentWillUnmount = function () { + this.hasMounted = false; + }; + Mutation.prototype.render = function () { + var children = this.props.children; + var _a = this.state, loading = _a.loading, data = _a.data, error = _a.error, called = _a.called; + var result = { + called: called, + loading: loading, + data: data, + error: error, + client: this.currentClient(), + }; + return children(this.runMutation, result); + }; + Mutation.prototype.currentClient = function () { + return getClient(this.props, this.context); + }; + Mutation.contextType = reactCommon.getApolloContext(); + Mutation.propTypes = { + mutation: PropTypes.object.isRequired, + variables: PropTypes.object, + optimisticResponse: PropTypes.object, + refetchQueries: PropTypes.oneOfType([ + PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])), + PropTypes.func, + ]), + awaitRefetchQueries: PropTypes.bool, + update: PropTypes.func, + children: PropTypes.func.isRequired, + onCompleted: PropTypes.func, + onError: PropTypes.func, + fetchPolicy: PropTypes.string, + }; + return Mutation; + }(React.Component)); + + var Subscription = (function (_super) { + tslib.__extends(Subscription, _super); + function Subscription(props, context) { + var _this = _super.call(this, props, context) || this; + _this.initialize = function (props) { + if (_this.observableQuery) + return; + _this.observableQuery = _this.client.subscribe({ + query: props.subscription, + variables: props.variables, + fetchPolicy: props.fetchPolicy, + }); + }; + _this.startSubscription = function () { + if (_this.observableQuerySubscription) + return; + _this.observableQuerySubscription = _this.observableQuery.subscribe({ + next: _this.updateCurrentData, + error: _this.updateError, + complete: _this.completeSubscription, + }); + }; + _this.getInitialState = function () { return ({ + loading: true, + error: undefined, + data: undefined, + }); }; + _this.updateCurrentData = function (result) { + var onSubscriptionData = _this.props.onSubscriptionData; + if (onSubscriptionData) { + onSubscriptionData({ + client: _this.client, + subscriptionData: result, + }); + } + _this.setState({ + data: result.data, + loading: false, + error: undefined, + }, function () { + delete _this.previousState; + }); + }; + _this.updateError = function (error) { + _this.setState({ + error: error, + loading: false, + }); + }; + _this.completeSubscription = function () { + var onSubscriptionComplete = _this.props.onSubscriptionComplete; + if (onSubscriptionComplete) + onSubscriptionComplete(); + _this.endSubscription(); + }; + _this.endSubscription = function () { + if (_this.observableQuerySubscription) { + _this.observableQuerySubscription.unsubscribe(); + delete _this.observableQuerySubscription; + } + }; + _this.newClient = function () { + var clientChanged = false; + var client = getClient(_this.props, _this.context); + if (client !== _this.client) { + clientChanged = true; + _this.client = client; + _this.endSubscription(); + delete _this.observableQuery; + } + return clientChanged; + }; + _this.client = getClient(props, context); + _this.initialize(props); + _this.state = _this.getInitialState(); + return _this; + } + Subscription.prototype.componentDidMount = function () { + this.startSubscription(); + }; + Subscription.prototype.componentWillUnmount = function () { + this.endSubscription(); + }; + Subscription.prototype.render = function () { + var currentState = this.state; + if (this.newClient()) { + currentState = this.getInitialState(); + } + var shouldResubscribe = this.props.shouldResubscribe; + if (typeof shouldResubscribe === 'function') { + shouldResubscribe = !!shouldResubscribe(this.props); + } + if (shouldResubscribe !== false && + this.previousProps && + (!shallowEqual(this.previousProps.variables, this.props.variables) || + this.previousProps.subscription !== this.props.subscription)) { + this.endSubscription(); + delete this.observableQuery; + if (!this.previousState) { + currentState = this.getInitialState(); + } + } + this.initialize(this.props); + this.startSubscription(); + var renderFn = this.props.children; + if (!renderFn) + return null; + var result = tslib.__assign({}, currentState, { variables: this.props.variables }); + this.previousState = currentState; + this.previousProps = this.props; + return renderFn(result); + }; + Subscription.contextType = reactCommon.getApolloContext(); + Subscription.propTypes = { + subscription: PropTypes.object.isRequired, + variables: PropTypes.object, + children: PropTypes.func, + onSubscriptionData: PropTypes.func, + onSubscriptionComplete: PropTypes.func, + shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]), + }; + return Subscription; + }(React.Component)); + + function makeDefaultQueryInfo() { + return { + seen: false, + observable: null, + }; + } + var RenderPromises = (function () { + function RenderPromises() { + this.queryPromises = new Map(); + this.queryInfoTrie = new Map(); + } + RenderPromises.prototype.registerSSRObservable = function (queryInstance, observable) { + this.lookupQueryInfo(queryInstance).observable = observable; + }; + RenderPromises.prototype.getSSRObservable = function (queryInstance) { + return this.lookupQueryInfo(queryInstance).observable; + }; + RenderPromises.prototype.addQueryPromise = function (queryInstance, finish, client, context) { + var info = this.lookupQueryInfo(queryInstance); + if (!info.seen) { + this.queryPromises.set(queryInstance, new Promise(function (resolve) { + resolve(queryInstance.fetchData(client, context)); + })); + return null; + } + return finish(); + }; + RenderPromises.prototype.hasPromises = function () { + return this.queryPromises.size > 0; + }; + RenderPromises.prototype.consumeAndAwaitPromises = function () { + var _this = this; + var promises = []; + this.queryPromises.forEach(function (promise, queryInstance) { + _this.lookupQueryInfo(queryInstance).seen = true; + promises.push(promise); + }); + this.queryPromises.clear(); + return Promise.all(promises); + }; + RenderPromises.prototype.lookupQueryInfo = function (queryInstance) { + var queryInfoTrie = this.queryInfoTrie; + var _a = queryInstance.props, query = _a.query, variables = _a.variables; + var varMap = queryInfoTrie.get(query) || new Map(); + if (!queryInfoTrie.has(query)) + queryInfoTrie.set(query, varMap); + var variablesString = JSON.stringify(variables); + var info = varMap.get(variablesString) || makeDefaultQueryInfo(); + if (!varMap.has(variablesString)) + varMap.set(variablesString, info); + return info; + }; + return RenderPromises; + }()); + function getDataFromTree(tree, context) { + if (context === void 0) { context = {}; } + return getMarkupFromTree({ + tree: tree, + context: context, + renderFunction: require('react-dom/server').renderToStaticMarkup, + }); + } + function getMarkupFromTree(_a) { + var tree = _a.tree, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.renderFunction, renderFunction = _c === void 0 ? require('react-dom/server').renderToStaticMarkup : _c; + var renderPromises = new RenderPromises(); + function process() { + var ApolloContext = reactCommon.getApolloContext(); + var html = renderFunction(React.createElement(ApolloContext.Provider, { value: tslib.__assign({}, context, { renderPromises: renderPromises }) }, tree)); + return renderPromises.hasPromises() + ? renderPromises.consumeAndAwaitPromises().then(process) + : html; + } + return Promise.resolve().then(process); + } + + function renderToStringWithData(component) { + return getMarkupFromTree({ + tree: component, + renderFunction: require('react-dom/server').renderToString, + }); + } + + function useApolloClient() { + var client = React.useContext(reactCommon.getApolloContext()).client; + process.env.NODE_ENV === "production" ? tsInvariant.invariant(!client) : tsInvariant.invariant(!client, 'No Apollo Client instance can be found. Please ensure that you ' + + 'have called `ApolloProvider` higher up in your tree.'); + return client; + } + + Object.defineProperty(exports, 'ApolloConsumer', { + enumerable: true, + get: function () { + return reactCommon.ApolloConsumer; + } + }); + Object.defineProperty(exports, 'ApolloProvider', { + enumerable: true, + get: function () { + return reactCommon.ApolloProvider; + } + }); + Object.defineProperty(exports, 'getApolloContext', { + enumerable: true, + get: function () { + return reactCommon.getApolloContext; + } + }); + Object.defineProperty(exports, 'resetApolloContext', { + enumerable: true, + get: function () { + return reactCommon.resetApolloContext; + } + }); + exports.Mutation = Mutation; + exports.Query = Query; + exports.RenderPromises = RenderPromises; + exports.Subscription = Subscription; + exports.getDataFromTree = getDataFromTree; + exports.getMarkupFromTree = getMarkupFromTree; + exports.renderToStringWithData = renderToStringWithData; + exports.useApolloClient = useApolloClient; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); diff --git a/packages/components/lib/ssr/getDataFromTree.d.ts b/packages/components/lib/ssr/getDataFromTree.d.ts new file mode 100644 index 0000000000..0b0bdb27f3 --- /dev/null +++ b/packages/components/lib/ssr/getDataFromTree.d.ts @@ -0,0 +1,25 @@ +import React from 'react'; +import { ApolloClient, ObservableQuery } from 'apollo-client'; +import { ApolloContextValue } from '@apollo/react-common'; +import { Query } from '../Query'; +export declare class RenderPromises { + private queryPromises; + private queryInfoTrie; + registerSSRObservable(queryInstance: Query, observable: ObservableQuery): void; + getSSRObservable(queryInstance: Query): ObservableQuery | null; + addQueryPromise(queryInstance: Query, finish: () => React.ReactNode, client: ApolloClient, context: ApolloContextValue): React.ReactNode; + hasPromises(): boolean; + consumeAndAwaitPromises(): Promise; + private lookupQueryInfo; +} +export declare function getDataFromTree(tree: React.ReactNode, context?: { + [key: string]: any; +}): Promise; +export declare type GetMarkupFromTreeOptions = { + tree: React.ReactNode; + context?: { + [key: string]: any; + }; + renderFunction?: (tree: React.ReactElement) => string; +}; +export declare function getMarkupFromTree({ tree, context, renderFunction, }: GetMarkupFromTreeOptions): Promise; diff --git a/packages/components/lib/ssr/getDataFromTree.js b/packages/components/lib/ssr/getDataFromTree.js new file mode 100644 index 0000000000..69c626e3cb --- /dev/null +++ b/packages/components/lib/ssr/getDataFromTree.js @@ -0,0 +1,79 @@ +import * as tslib_1 from "tslib"; +import React from 'react'; +import { getApolloContext } from '@apollo/react-common'; +function makeDefaultQueryInfo() { + return { + seen: false, + observable: null, + }; +} +var RenderPromises = (function () { + function RenderPromises() { + this.queryPromises = new Map(); + this.queryInfoTrie = new Map(); + } + RenderPromises.prototype.registerSSRObservable = function (queryInstance, observable) { + this.lookupQueryInfo(queryInstance).observable = observable; + }; + RenderPromises.prototype.getSSRObservable = function (queryInstance) { + return this.lookupQueryInfo(queryInstance).observable; + }; + RenderPromises.prototype.addQueryPromise = function (queryInstance, finish, client, context) { + var info = this.lookupQueryInfo(queryInstance); + if (!info.seen) { + this.queryPromises.set(queryInstance, new Promise(function (resolve) { + resolve(queryInstance.fetchData(client, context)); + })); + return null; + } + return finish(); + }; + RenderPromises.prototype.hasPromises = function () { + return this.queryPromises.size > 0; + }; + RenderPromises.prototype.consumeAndAwaitPromises = function () { + var _this = this; + var promises = []; + this.queryPromises.forEach(function (promise, queryInstance) { + _this.lookupQueryInfo(queryInstance).seen = true; + promises.push(promise); + }); + this.queryPromises.clear(); + return Promise.all(promises); + }; + RenderPromises.prototype.lookupQueryInfo = function (queryInstance) { + var queryInfoTrie = this.queryInfoTrie; + var _a = queryInstance.props, query = _a.query, variables = _a.variables; + var varMap = queryInfoTrie.get(query) || new Map(); + if (!queryInfoTrie.has(query)) + queryInfoTrie.set(query, varMap); + var variablesString = JSON.stringify(variables); + var info = varMap.get(variablesString) || makeDefaultQueryInfo(); + if (!varMap.has(variablesString)) + varMap.set(variablesString, info); + return info; + }; + return RenderPromises; +}()); +export { RenderPromises }; +export function getDataFromTree(tree, context) { + if (context === void 0) { context = {}; } + return getMarkupFromTree({ + tree: tree, + context: context, + renderFunction: require('react-dom/server').renderToStaticMarkup, + }); +} +export function getMarkupFromTree(_a) { + var tree = _a.tree, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.renderFunction, renderFunction = _c === void 0 ? require('react-dom/server').renderToStaticMarkup : _c; + var renderPromises = new RenderPromises(); + function process() { + var ApolloContext = getApolloContext(); + var html = renderFunction(React.createElement(ApolloContext.Provider, { value: tslib_1.__assign({}, context, { renderPromises: renderPromises }) }, tree)); + return renderPromises.hasPromises() + ? renderPromises.consumeAndAwaitPromises().then(process) + : html; + } + return Promise.resolve().then(process); +} +//# sourceMappingURL=getDataFromTree.js.map \ No newline at end of file diff --git a/packages/components/lib/ssr/getDataFromTree.js.map b/packages/components/lib/ssr/getDataFromTree.js.map new file mode 100644 index 0000000000..dfba4ac14f --- /dev/null +++ b/packages/components/lib/ssr/getDataFromTree.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getDataFromTree.js","sourceRoot":"","sources":["../../src/ssr/getDataFromTree.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAsB,MAAM,sBAAsB,CAAC;AAS5E,SAAS,oBAAoB;IAC3B,OAAO;QACL,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,IAAI;KACjB,CAAC;AACJ,CAAC;AAED;IAAA;QAEU,kBAAa,GAAG,IAAI,GAAG,EAAiC,CAAC;QAMzD,kBAAa,GAAG,IAAI,GAAG,EAAwC,CAAC;IAyE1E,CAAC;IAtEQ,8CAAqB,GAA5B,UACE,aAAuC,EACvC,UAA4C;QAE5C,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,UAAU,GAAG,UAAU,CAAC;IAC9D,CAAC;IAGM,yCAAgB,GAAvB,UACE,aAAuC;QAEvC,OAAO,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC;IACxD,CAAC;IAEM,wCAAe,GAAtB,UACE,aAAuC,EACvC,MAA6B,EAC7B,MAA4B,EAC5B,OAA2B;QAE3B,IAAM,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACd,IAAI,CAAC,aAAa,CAAC,GAAG,CACpB,aAAa,EACb,IAAI,OAAO,CAAC,UAAA,OAAO;gBACjB,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;YACpD,CAAC,CAAC,CACH,CAAC;YAGF,OAAO,IAAI,CAAC;SACb;QACD,OAAO,MAAM,EAAE,CAAC;IAClB,CAAC;IAEM,oCAAW,GAAlB;QACE,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,CAAC;IACrC,CAAC;IAEM,gDAAuB,GAA9B;QAAA,iBAiBC;QAhBC,IAAM,QAAQ,GAAmB,EAAE,CAAC;QACpC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,UAAC,OAAO,EAAE,aAAa;YAUhD,KAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC;YAChD,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QAC3B,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAEO,wCAAe,GAAvB,UACE,aAAuC;QAE/B,IAAA,kCAAa,CAAU;QACzB,IAAA,wBAA0C,EAAxC,gBAAK,EAAE,wBAAiC,CAAC;QACjD,IAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,EAAqB,CAAC;QACxE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAChE,IAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAClD,IAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,oBAAoB,EAAE,CAAC;QACnE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC;YAAE,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QACpE,OAAO,IAAI,CAAC;IACd,CAAC;IACH,qBAAC;AAAD,CAAC,AAjFD,IAiFC;;AAED,MAAM,UAAU,eAAe,CAC7B,IAAqB,EACrB,OAAoC;IAApC,wBAAA,EAAA,YAAoC;IAEpC,OAAO,iBAAiB,CAAC;QACvB,IAAI,MAAA;QACJ,OAAO,SAAA;QAGP,cAAc,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC,oBAAoB;KACjE,CAAC,CAAC;AACL,CAAC;AAQD,MAAM,UAAU,iBAAiB,CAAC,EAOP;QANzB,cAAI,EACJ,eAAY,EAAZ,iCAAY,EAIZ,sBAAiE,EAAjE,sFAAiE;IAEjE,IAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC;IAE5C,SAAS,OAAO;QAMd,IAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;QACzC,IAAM,IAAI,GAAG,cAAc,CACzB,KAAK,CAAC,aAAa,CACjB,aAAa,CAAC,QAAQ,EACtB,EAAE,KAAK,uBAAO,OAAO,IAAE,cAAc,gBAAA,GAAE,EAAE,EACzC,IAAI,CACL,CACF,CAAC;QAEF,OAAO,cAAc,CAAC,WAAW,EAAE;YACjC,CAAC,CAAC,cAAc,CAAC,uBAAuB,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;YACxD,CAAC,CAAC,IAAI,CAAC;IACX,CAAC;IAED,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACzC,CAAC"} \ No newline at end of file diff --git a/packages/components/lib/ssr/renderToStringWithData.d.ts b/packages/components/lib/ssr/renderToStringWithData.d.ts new file mode 100644 index 0000000000..b891f03a37 --- /dev/null +++ b/packages/components/lib/ssr/renderToStringWithData.d.ts @@ -0,0 +1,2 @@ +import { ReactElement } from 'react'; +export declare function renderToStringWithData(component: ReactElement): Promise; diff --git a/packages/components/lib/ssr/renderToStringWithData.js b/packages/components/lib/ssr/renderToStringWithData.js new file mode 100644 index 0000000000..70b7df052e --- /dev/null +++ b/packages/components/lib/ssr/renderToStringWithData.js @@ -0,0 +1,8 @@ +import { getMarkupFromTree } from './getDataFromTree'; +export function renderToStringWithData(component) { + return getMarkupFromTree({ + tree: component, + renderFunction: require('react-dom/server').renderToString, + }); +} +//# sourceMappingURL=renderToStringWithData.js.map \ No newline at end of file diff --git a/packages/components/lib/ssr/renderToStringWithData.js.map b/packages/components/lib/ssr/renderToStringWithData.js.map new file mode 100644 index 0000000000..078a897297 --- /dev/null +++ b/packages/components/lib/ssr/renderToStringWithData.js.map @@ -0,0 +1 @@ +{"version":3,"file":"renderToStringWithData.js","sourceRoot":"","sources":["../../src/ssr/renderToStringWithData.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,UAAU,sBAAsB,CACpC,SAA4B;IAE5B,OAAO,iBAAiB,CAAC;QACvB,IAAI,EAAE,SAAS;QACf,cAAc,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC,cAAc;KAC3D,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/packages/components/lib/types.d.ts b/packages/components/lib/types.d.ts new file mode 100644 index 0000000000..de6158c414 --- /dev/null +++ b/packages/components/lib/types.d.ts @@ -0,0 +1,71 @@ +import ApolloClient, { ApolloQueryResult, ApolloError, FetchPolicy, ErrorPolicy, FetchMoreOptions, UpdateQueryOptions, FetchMoreQueryOptions, SubscribeToMoreOptions, PureQueryOptions, MutationUpdaterFn } from 'apollo-client'; +import { MutationFn } from './Mutation'; +export interface Context { + [key: string]: any; +} +export declare type OperationVariables = { + [key: string]: any; +}; +export declare type RefetchQueriesProviderFn = (...args: any[]) => Array; +export interface MutationOpts { + variables?: TGraphQLVariables; + optimisticResponse?: TData; + refetchQueries?: Array | RefetchQueriesProviderFn; + awaitRefetchQueries?: boolean; + errorPolicy?: ErrorPolicy; + update?: MutationUpdaterFn; + client?: ApolloClient; + notifyOnNetworkStatusChange?: boolean; + context?: Context; + onCompleted?: (data: TData) => void; + onError?: (error: ApolloError) => void; + fetchPolicy?: FetchPolicy; +} +export interface QueryOpts { + ssr?: boolean; + variables?: TGraphQLVariables; + fetchPolicy?: FetchPolicy; + errorPolicy?: ErrorPolicy; + pollInterval?: number; + client?: ApolloClient; + notifyOnNetworkStatusChange?: boolean; + context?: Context; + partialRefetch?: boolean; +} +export interface QueryControls { + error?: ApolloError; + networkStatus: number; + loading: boolean; + variables: TGraphQLVariables; + fetchMore: (fetchMoreOptions: FetchMoreQueryOptions & FetchMoreOptions) => Promise>; + refetch: (variables?: TGraphQLVariables) => Promise>; + startPolling: (pollInterval: number) => void; + stopPolling: () => void; + subscribeToMore: (options: SubscribeToMoreOptions) => () => void; + updateQuery: (mapFn: (previousQueryResult: any, options: UpdateQueryOptions) => any) => void; +} +export declare type DataValue = QueryControls & Partial; +export interface DataProps { + data: DataValue; +} +export interface MutateProps { + mutate: MutationFn; +} +export declare type ChildProps = TProps & Partial> & Partial>; +export declare type ChildDataProps = TProps & DataProps; +export declare type ChildMutateProps = TProps & MutateProps; +export declare type NamedProps = TProps & { + ownProps: R; +}; +export interface OptionProps extends Partial>, Partial> { + ownProps: TProps; +} +export interface OperationOption> { + options?: QueryOpts | MutationOpts | ((props: TProps) => QueryOpts | MutationOpts); + props?: (props: OptionProps, lastProps?: TChildProps | void) => TChildProps; + skip?: boolean | ((props: TProps) => boolean); + name?: string; + withRef?: boolean; + shouldResubscribe?: (props: TProps, nextProps: TProps) => boolean; + alias?: string; +} diff --git a/packages/components/lib/types.js b/packages/components/lib/types.js new file mode 100644 index 0000000000..2d3b1b79e9 --- /dev/null +++ b/packages/components/lib/types.js @@ -0,0 +1,2 @@ +; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/packages/components/lib/types.js.map b/packages/components/lib/types.js.map new file mode 100644 index 0000000000..3977c4de29 --- /dev/null +++ b/packages/components/lib/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAgBC,CAAC"} \ No newline at end of file diff --git a/packages/components/lib/useApolloClient.d.ts b/packages/components/lib/useApolloClient.d.ts new file mode 100644 index 0000000000..51727bc89a --- /dev/null +++ b/packages/components/lib/useApolloClient.d.ts @@ -0,0 +1 @@ +export declare function useApolloClient(): import("apollo-client").default | undefined; diff --git a/packages/components/lib/useApolloClient.js b/packages/components/lib/useApolloClient.js new file mode 100644 index 0000000000..e4faec2fd7 --- /dev/null +++ b/packages/components/lib/useApolloClient.js @@ -0,0 +1,10 @@ +import React from 'react'; +import { invariant } from 'ts-invariant'; +import { getApolloContext } from '@apollo/react-common'; +export function useApolloClient() { + var client = React.useContext(getApolloContext()).client; + invariant(!client, 'No Apollo Client instance can be found. Please ensure that you ' + + 'have called `ApolloProvider` higher up in your tree.'); + return client; +} +//# sourceMappingURL=useApolloClient.js.map \ No newline at end of file diff --git a/packages/components/lib/useApolloClient.js.map b/packages/components/lib/useApolloClient.js.map new file mode 100644 index 0000000000..733efcd648 --- /dev/null +++ b/packages/components/lib/useApolloClient.js.map @@ -0,0 +1 @@ +{"version":3,"file":"useApolloClient.js","sourceRoot":"","sources":["../src/useApolloClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,UAAU,eAAe;IACrB,IAAA,oDAAM,CAA0C;IACxD,SAAS,CACP,CAAC,MAAM,EACP,iEAAiE;QAC/D,sDAAsD,CACzD,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/packages/components/lib/utils/getClient.d.ts b/packages/components/lib/utils/getClient.d.ts new file mode 100644 index 0000000000..cb160863a6 --- /dev/null +++ b/packages/components/lib/utils/getClient.d.ts @@ -0,0 +1,6 @@ +import ApolloClient from 'apollo-client'; +import { ApolloContextValue } from '@apollo/react-common'; +export interface CommonComponentProps { + client?: ApolloClient; +} +export declare function getClient(props: CommonComponentProps, context: ApolloContextValue): ApolloClient; diff --git a/packages/components/lib/utils/getClient.js b/packages/components/lib/utils/getClient.js new file mode 100644 index 0000000000..bc4e8fe26a --- /dev/null +++ b/packages/components/lib/utils/getClient.js @@ -0,0 +1,9 @@ +import { invariant } from 'ts-invariant'; +export function getClient(props, context) { + var client = props.client || context.client; + invariant(!!client, 'Could not find "client" in the context or passed in as a prop. ' + + 'Wrap the root component in an , or pass an ' + + 'ApolloClient instance in via props.'); + return client; +} +//# sourceMappingURL=getClient.js.map \ No newline at end of file diff --git a/packages/components/lib/utils/getClient.js.map b/packages/components/lib/utils/getClient.js.map new file mode 100644 index 0000000000..dc3f682576 --- /dev/null +++ b/packages/components/lib/utils/getClient.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getClient.js","sourceRoot":"","sources":["../../src/utils/getClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAQzC,MAAM,UAAU,SAAS,CACvB,KAA2B,EAC3B,OAA2B;IAE3B,IAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAE9C,SAAS,CACP,CAAC,CAAC,MAAM,EACR,iEAAiE;QAC/D,6DAA6D;QAC7D,qCAAqC,CACxC,CAAC;IAEF,OAAO,MAA8B,CAAC;AACxC,CAAC"} \ No newline at end of file diff --git a/packages/components/lib/utils/shallowEqual.d.ts b/packages/components/lib/utils/shallowEqual.d.ts new file mode 100644 index 0000000000..23d43e010d --- /dev/null +++ b/packages/components/lib/utils/shallowEqual.d.ts @@ -0,0 +1 @@ +export default function shallowEqual(objA: any, objB: any): boolean; diff --git a/packages/components/lib/utils/shallowEqual.js b/packages/components/lib/utils/shallowEqual.js new file mode 100644 index 0000000000..b193e89491 --- /dev/null +++ b/packages/components/lib/utils/shallowEqual.js @@ -0,0 +1,24 @@ +var hasOwnProperty = Object.prototype.hasOwnProperty; +function is(x, y) { + if (x === y) { + return x !== 0 || y !== 0 || 1 / x === 1 / y; + } + return x !== x && y !== y; +} +function isObject(obj) { + return obj !== null && typeof obj === "object"; +} +export default function shallowEqual(objA, objB) { + if (is(objA, objB)) { + return true; + } + if (!isObject(objA) || !isObject(objB)) { + return false; + } + var keys = Object.keys(objA); + if (keys.length !== Object.keys(objB).length) { + return false; + } + return keys.every(function (key) { return hasOwnProperty.call(objB, key) && is(objA[key], objB[key]); }); +} +//# sourceMappingURL=shallowEqual.js.map \ No newline at end of file diff --git a/packages/components/lib/utils/shallowEqual.js.map b/packages/components/lib/utils/shallowEqual.js.map new file mode 100644 index 0000000000..6b028cc2a0 --- /dev/null +++ b/packages/components/lib/utils/shallowEqual.js.map @@ -0,0 +1 @@ +{"version":3,"file":"shallowEqual.js","sourceRoot":"","sources":["../../src/utils/shallowEqual.ts"],"names":[],"mappings":"AAAQ,IAAA,gDAAc,CAAsB;AAE5C,SAAS,EAAE,CAAC,CAAM,EAAE,CAAM;IACxB,IAAI,CAAC,KAAK,CAAC,EAAE;QACX,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KAC9C;IACD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,QAAQ,CAAC,GAAQ;IACxB,OAAO,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC;AACjD,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,IAAS,EAAE,IAAS;IACvD,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IAED,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QACtC,OAAO,KAAK,CAAC;KACd;IAED,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE/B,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE;QAC5C,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC,KAAK,CACf,UAAA,GAAG,IAAI,OAAA,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAA1D,CAA0D,CAClE,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/packages/components/package.json b/packages/components/package.json new file mode 100644 index 0000000000..a1f700ea6d --- /dev/null +++ b/packages/components/package.json @@ -0,0 +1,58 @@ +{ + "name": "@apollo/react-components", + "description": "React Apollo Query, Mutation and Subscription components.", + "version": "0.0.1", + "author": "opensource@apollographql.com", + "keywords": [ + "apollo", + "graphql", + "react", + "components" + ], + "license": "MIT", + "main": "./lib/react-components.cjs.js", + "module": "./lib/react-components.esm.js", + "typings": "./lib/index.d.ts", + "repository": { + "type": "git", + "url": "apollographql/react-apollo" + }, + "sideEffects": false, + "scripts": { + "clean": "rm -Rf ./node_modules ./lib/* ./meta/bundlesize/* ./meta/coverage/*", + "prepare": "npm run build", + "prebuild": "npm run clean", + "build": "tsc -p ./config/tsconfig.json", + "postbuild": "../../node_modules/rollup/bin/rollup -c ./config/rollup.config.js", + "watch": "tsc-watch --onSuccess \"npm run postbuild\"", + "predeploy": "npm run build", + "deploy": "npm publish", + "test": "jest --config ./config/jest.config.js", + "test:watch": "jest --config ./config/jest.config.js --watch", + "test:full": "npm run type-check && jest --config ./config/jest.config.js --coverage" + }, + "peerDependencies": { + "apollo-cache": "^1.2.1", + "apollo-client": "^2.5.1", + "apollo-link": "^1.2.11", + "graphql": "^14.2.1", + "react": "^16.8.6", + "react-dom": "^16.8.6" + }, + "dependencies": { + "@apollo/react-common": "file:../common", + "hoist-non-react-statics": "^3.3.0", + "lodash.isequal": "^4.5.0", + "prop-types": "^15.7.2", + "ts-invariant": "^0.4.0", + "tslib": "^1.9.3" + }, + "devDependencies": { + "@apollo/react-testing": "file:../common" + }, + "files": [ + "./README.md", + "./package.json", + "./lib" + ] +} diff --git a/src/Mutation.tsx b/packages/components/src/Mutation.tsx similarity index 84% rename from src/Mutation.tsx rename to packages/components/src/Mutation.tsx index ad4cb00bd2..ad3193c60d 100644 --- a/src/Mutation.tsx +++ b/packages/components/src/Mutation.tsx @@ -1,14 +1,22 @@ -import * as React from 'react'; -import * as PropTypes from 'prop-types'; -import ApolloClient, { PureQueryOptions, ApolloError, FetchPolicy } from 'apollo-client'; +import React from 'react'; +import PropTypes from 'prop-types'; +import ApolloClient, { + PureQueryOptions, + ApolloError, + FetchPolicy, +} from 'apollo-client'; import { DataProxy } from 'apollo-cache'; import { invariant } from 'ts-invariant'; import { DocumentNode, GraphQLError } from 'graphql'; +import { + getApolloContext, + ApolloContextValue, + parser, + DocumentType, +} from '@apollo/react-common'; import { OperationVariables, RefetchQueriesProviderFn } from './types'; -import { parser, DocumentType } from './parser'; -import { getClient } from './component-utils'; -import { getApolloContext, ApolloContextValue } from './ApolloContext'; +import { getClient } from './utils/getClient'; export interface MutationResult> { data?: TData; @@ -82,7 +90,10 @@ export interface MutationState { data?: TData; } -class Mutation extends React.Component< +export class Mutation< + TData = any, + TVariables = OperationVariables +> extends React.Component< MutationProps, MutationState > { @@ -93,7 +104,9 @@ class Mutation extends React.Compo variables: PropTypes.object, optimisticResponse: PropTypes.object, refetchQueries: PropTypes.oneOfType([ - PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])), + PropTypes.arrayOf( + PropTypes.oneOfType([PropTypes.string, PropTypes.object]), + ), PropTypes.func, ]), awaitRefetchQueries: PropTypes.bool, @@ -176,8 +189,13 @@ class Mutation extends React.Compo } = this.props; const mutateOptions = { ...options }; - let refetchQueries = mutateOptions.refetchQueries || this.props.refetchQueries; - const mutateVariables = Object.assign({}, variables, mutateOptions.variables); + let refetchQueries = + mutateOptions.refetchQueries || this.props.refetchQueries; + const mutateVariables = Object.assign( + {}, + variables, + mutateOptions.variables, + ); delete mutateOptions.variables; return this.currentClient().mutate({ @@ -204,16 +222,26 @@ class Mutation extends React.Compo } }; - private onMutationCompleted = (response: ExecutionResult, mutationId: number) => { + private onMutationCompleted = ( + response: ExecutionResult, + mutationId: number, + ) => { const { onCompleted, ignoreResults } = this.props; const { data, errors } = response; const error = - errors && errors.length > 0 ? new ApolloError({ graphQLErrors: errors }) : undefined; - - const callOncomplete = () => (onCompleted ? onCompleted(data as TData) : null); - - if (this.hasMounted && this.isMostRecentMutation(mutationId) && !ignoreResults) { + errors && errors.length > 0 + ? new ApolloError({ graphQLErrors: errors }) + : undefined; + + const callOncomplete = () => + onCompleted ? onCompleted(data as TData) : null; + + if ( + this.hasMounted && + this.isMostRecentMutation(mutationId) && + !ignoreResults + ) { this.setState({ loading: false, data, error }, callOncomplete); } else { callOncomplete(); @@ -254,5 +282,3 @@ class Mutation extends React.Compo return getClient(this.props, this.context); } } - -export default Mutation; diff --git a/src/Query.tsx b/packages/components/src/Query.tsx similarity index 90% rename from src/Query.tsx rename to packages/components/src/Query.tsx index ff5b9b4574..c6d826220d 100644 --- a/src/Query.tsx +++ b/packages/components/src/Query.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as PropTypes from 'prop-types'; +import React from 'react'; +import PropTypes from 'prop-types'; import ApolloClient, { ObservableQuery, ApolloError, @@ -10,24 +10,38 @@ import ApolloClient, { } from 'apollo-client'; import { DocumentNode } from 'graphql'; import { ZenObservable } from 'zen-observable-ts'; +import { + getApolloContext, + ApolloContextValue, + parser, + DocumentType, + IDocumentDefinition, +} from '@apollo/react-common'; +import isEqual from 'lodash.isequal'; +import { invariant } from 'ts-invariant'; import { OperationVariables, QueryOpts } from './types'; -import { parser, DocumentType, IDocumentDefinition } from './parser'; -import { getClient } from './component-utils'; -import { getApolloContext, ApolloContextValue } from './ApolloContext'; -import isEqual from 'lodash.isequal'; +import { getClient } from './utils/getClient'; import shallowEqual from './utils/shallowEqual'; -import { invariant } from 'ts-invariant'; export type ObservableQueryFields = Pick< ObservableQuery, - 'startPolling' | 'stopPolling' | 'subscribeToMore' | 'updateQuery' | 'refetch' | 'variables' + | 'startPolling' + | 'stopPolling' + | 'subscribeToMore' + | 'updateQuery' + | 'refetch' + | 'variables' > & { fetchMore: (( - fetchMoreOptions: FetchMoreQueryOptions & FetchMoreOptions, + fetchMoreOptions: FetchMoreQueryOptions & + FetchMoreOptions, ) => Promise>) & (( - fetchMoreOptions: { query: DocumentNode } & FetchMoreQueryOptions & + fetchMoreOptions: { query: DocumentNode } & FetchMoreQueryOptions< + TVariables2, + K + > & FetchMoreOptions, ) => Promise>); }; @@ -59,7 +73,8 @@ export interface QueryResult networkStatus: NetworkStatus; } -export interface QueryProps extends QueryOpts { +export interface QueryProps + extends QueryOpts { children: (result: QueryResult) => React.ReactNode; query: DocumentNode; displayName?: string; @@ -68,9 +83,10 @@ export interface QueryProps extend onError?: (error: ApolloError) => void; } -export default class Query extends React.Component< - QueryProps -> { +export class Query< + TData = any, + TVariables = OperationVariables +> extends React.Component> { static propTypes = { client: PropTypes.object, children: PropTypes.func.isRequired, @@ -175,7 +191,9 @@ export default class Query extends invariant( this.operation.type === DocumentType.Query, `The component requires a graphql query, but got a ${ - this.operation.type === DocumentType.Mutation ? 'mutation' : 'subscription' + this.operation.type === DocumentType.Mutation + ? 'mutation' + : 'subscription' }.`, ); @@ -185,7 +203,7 @@ export default class Query extends ...props, displayName, context: props.context || {}, - metadata: { reactComponent: { displayName }}, + metadata: { reactComponent: { displayName } }, }; } @@ -306,11 +324,13 @@ export default class Query extends } else if (onError && !loading && error) { onError(error); } - } + }; - private getQueryResult = (client: ApolloClient): QueryResult => { + private getQueryResult = ( + client: ApolloClient, + ): QueryResult => { let result = { - data: Object.create(null) as TData + data: Object.create(null) as TData, } as any; // Attach bound methods @@ -331,7 +351,7 @@ export default class Query extends const currentResult = this.observableQuery!.getCurrentResult(); const { loading, partial, networkStatus, errors } = currentResult; let { error, data } = currentResult; - data = data || Object.create(null) as TData; + data = data || (Object.create(null) as TData); // Until a set naming convention for networkError and graphQLErrors is // decided upon, we map errors (graphQLErrors) to the error props. @@ -342,8 +362,9 @@ export default class Query extends Object.assign(result, { loading, networkStatus, error }); if (loading) { - const previousData = - this.previousResult ? this.previousResult.data : {}; + const previousData = this.previousResult + ? this.previousResult.data + : {}; Object.assign(result.data, previousData, data); } else if (error) { Object.assign(result, { @@ -366,7 +387,10 @@ export default class Query extends // the original `Query` component are expecting certain data values to // exist, and they're all of a sudden stripped away. To help avoid // this we'll attempt to refetch the `Query` data. - Object.assign(result, { loading: true, networkStatus: NetworkStatus.loading }); + Object.assign(result, { + loading: true, + networkStatus: NetworkStatus.loading, + }); result.refetch(); return result; } @@ -378,7 +402,7 @@ export default class Query extends result.client = client; this.previousResult = result; return result; - } + }; private currentClient(context: any) { const client = getClient(this.props, context); @@ -407,8 +431,7 @@ export default class Query extends this.startQuerySubscription(client); } - const finish = - () => this.props.children(this.getQueryResult(client)); + const finish = () => this.props.children(this.getQueryResult(client)); if (context && context.renderPromises) { return context.renderPromises.addQueryPromise( this, diff --git a/src/Subscriptions.tsx b/packages/components/src/Subscription.tsx similarity index 86% rename from src/Subscriptions.tsx rename to packages/components/src/Subscription.tsx index d109a96f13..69e51af869 100644 --- a/src/Subscriptions.tsx +++ b/packages/components/src/Subscription.tsx @@ -1,14 +1,14 @@ -import * as React from 'react'; -import * as PropTypes from 'prop-types'; +import React from 'react'; +import PropTypes from 'prop-types'; import ApolloClient, { ApolloError, FetchPolicy } from 'apollo-client'; import { Observable } from 'apollo-link'; import { DocumentNode } from 'graphql'; import { ZenObservable } from 'zen-observable-ts'; +import { getApolloContext, ApolloContextValue } from '@apollo/react-common'; import { OperationVariables } from './types'; -import { getClient } from './component-utils'; +import { getClient } from './utils/getClient'; import shallowEqual from './utils/shallowEqual'; -import { getApolloContext, ApolloContextValue } from './ApolloContext'; export interface SubscriptionResult { loading: boolean; @@ -21,7 +21,10 @@ export interface OnSubscriptionDataOptions { subscriptionData: SubscriptionResult; } -export interface SubscriptionProps { +export interface SubscriptionProps< + TData = any, + TVariables = OperationVariables +> { subscription: DocumentNode; variables?: TVariables; fetchPolicy?: FetchPolicy; @@ -38,7 +41,10 @@ export interface SubscriptionState { error?: ApolloError; } -class Subscription extends React.Component< +export class Subscription< + TData = any, + TVariables = any +> extends React.Component< SubscriptionProps, SubscriptionState > { @@ -93,7 +99,7 @@ class Subscription extends React.Component< shouldResubscribe !== false && this.previousProps && (!shallowEqual(this.previousProps.variables, this.props.variables) || - this.previousProps.subscription !== this.props.subscription) + this.previousProps.subscription !== this.props.subscription) ) { this.endSubscription(); delete this.observableQuery; @@ -129,7 +135,7 @@ class Subscription extends React.Component< this.observableQuerySubscription = this.observableQuery!.subscribe({ next: this.updateCurrentData, error: this.updateError, - complete: this.completeSubscription + complete: this.completeSubscription, }); }; @@ -140,22 +146,27 @@ class Subscription extends React.Component< }); private updateCurrentData = (result: SubscriptionResult) => { - const { props: { onSubscriptionData } } = this; + const { + props: { onSubscriptionData }, + } = this; if (onSubscriptionData) { onSubscriptionData({ client: this.client, - subscriptionData: result + subscriptionData: result, }); } - this.setState({ - data: result.data, - loading: false, - error: undefined, - }, () => { - delete this.previousState; - }); + this.setState( + { + data: result.data, + loading: false, + error: undefined, + }, + () => { + delete this.previousState; + }, + ); }; private updateError = (error: any) => { @@ -190,5 +201,3 @@ class Subscription extends React.Component< return clientChanged; }; } - -export default Subscription; diff --git a/test/client/Mutation.test.tsx b/packages/components/src/__tests__/client/Mutation.test.tsx similarity index 90% rename from test/client/Mutation.test.tsx rename to packages/components/src/__tests__/client/Mutation.test.tsx index eaa95c9150..820859ae1e 100644 --- a/test/client/Mutation.test.tsx +++ b/packages/components/src/__tests__/client/Mutation.test.tsx @@ -1,15 +1,20 @@ -import * as React from 'react'; +import React from 'react'; import { mount } from 'enzyme'; import gql from 'graphql-tag'; import { ApolloClient, ApolloError } from 'apollo-client'; import { InMemoryCache as Cache } from 'apollo-cache-inmemory'; import { DataProxy } from 'apollo-cache'; import { ExecutionResult, GraphQLError } from 'graphql'; +import { ApolloProvider } from '@apollo/react-common'; +import { + MockedProvider, + MockLink, + mockSingleLink, + stripSymbols, +} from '@apollo/react-testing'; -import { ApolloProvider, Mutation, Query } from '../../src'; -import { MockedProvider, MockLink, mockSingleLink } from '../../src/test-utils'; - -import stripSymbols from '../test-utils/stripSymbols'; +import { Mutation } from '../../Mutation'; +import { Query } from '../../Query'; const mutation = gql` mutation createTodo($text: String!) { @@ -99,7 +104,9 @@ it('pick prop client over context client', async done => { ]; const mocksProps = mock('This is the result of the prop client mutation.'); - const mocksContext = mock('This is the result of the context client mutation.'); + const mocksContext = mock( + 'This is the result of the context client mutation.', + ); function mockClient(m: any) { return new ApolloClient({ @@ -116,7 +123,9 @@ it('pick prop client over context client', async done => { return ( - {createTodo =>