From 46dae5bdd46951d88548f728edfdebdf6be45ecd Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Tue, 28 Sep 2021 01:02:18 -0300 Subject: [PATCH 01/49] general refactoring --- package.json | 10 +---- packages/babel-plugin/.babelrc | 2 +- packages/babel-plugin/__tests__/index.js | 52 +++++++++++----------- packages/babel-plugin/src/insert-fields.js | 18 ++++---- packages/babel-plugin/src/sort-query.js | 10 +++-- packages/bindings/src/index.ts | 45 ++++++++++--------- packages/core/src/build-query-tree.ts | 3 +- packages/core/src/index.ts | 14 +++--- packages/core/src/map-objects.ts | 3 +- packages/core/src/util.ts | 6 +-- packages/preact/src/consumer.ts | 7 ++- packages/react/src/index.ts | 5 ++- packages/test-utils/src/mock-server.ts | 4 +- packages/types/index.d.ts | 6 ++- yarn.lock | 37 --------------- 15 files changed, 99 insertions(+), 123 deletions(-) diff --git a/package.json b/package.json index b068b651..354f7951 100644 --- a/package.json +++ b/package.json @@ -33,9 +33,7 @@ }, "eslintConfig": { "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" + "eslint:recommended" ], "parser": "@typescript-eslint/parser", "parserOptions": { @@ -46,7 +44,6 @@ } }, "plugins": [ - "@typescript-eslint", "prefer-let" ], "env": { @@ -58,9 +55,7 @@ }, "rules": { "prefer-const": 0, - "prefer-let/prefer-let": 2, - "@typescript-eslint/ban-ts-comment": 1, - "@typescript-eslint/no-empty-function": 1 + "prefer-let/prefer-let": 2 }, "ignorePatterns": [ "packages/bundle", @@ -81,7 +76,6 @@ "@types/react-test-renderer": "^17.0.1", "@types/uuid": "^8.3.1", "@types/ws": "^8.2.0", - "@typescript-eslint/eslint-plugin": "^4.9.1", "@typescript-eslint/parser": "^4.9.1", "babel-plugin-jsx-pragmatic": "^1.0.2", "babel-plugin-tester": "^10.0.0", diff --git a/packages/babel-plugin/.babelrc b/packages/babel-plugin/.babelrc index 31d8ce64..a6c42326 100644 --- a/packages/babel-plugin/.babelrc +++ b/packages/babel-plugin/.babelrc @@ -1,3 +1,3 @@ { - "presets": [["@babel/preset-env", { "targets": { "node": 4 } }]] + "presets": [["@babel/preset-env", { "targets": { "node": "current" } }]] } diff --git a/packages/babel-plugin/__tests__/index.js b/packages/babel-plugin/__tests__/index.js index d08bb184..c85f4b71 100644 --- a/packages/babel-plugin/__tests__/index.js +++ b/packages/babel-plugin/__tests__/index.js @@ -6,61 +6,61 @@ pluginTester({ pluginName: "@grafoo/babel-plugin", pluginOptions: { schema: "__tests__/schema.graphql", - idFields: ["id"], + idFields: ["id"] }, tests: { "should throw if a import is not default": { code: 'import { gql } from "@grafoo/core/tag";', - error: true, + error: true }, "should throw if a schema is not present on the root directory": { pluginOptions: { - idFields: ["id"], + idFields: ["id"] }, code: ` import gql from "@grafoo/core/tag"; let query = gql\`{ hello }\`; `, - error: true, + error: true }, "should throw if a tagged template string literal has expressions in it": { code: ` import gql from "@grafoo/core/tag"; let query = gql\`{ user(id: "\${1}") { name } }\`; `, - error: true, + error: true }, "should remove the imported path": { code: 'import gql from "@grafoo/core/tag";', - snapshot: true, + snapshot: true }, "should throw if idFields is not defined": { pluginOptions: { - schema: "__tests__/schema.graphql", + schema: "__tests__/schema.graphql" }, code: ` import gql from "@grafoo/core/tag"; let query = gql\`{ hello }\`; `, - error: true, + error: true }, "should throw if during client instatiation options is passed with a type other then object": { code: ` import createClient from "@grafoo/core"; let query = createClient(someTransport, "I AM ERROR"); `, - error: true, + error: true }, "should throw if the type of some field in `idFields` is not of type string": { pluginOptions: { schema: "__tests__/schema.graphql", - idFields: ["id", true], + idFields: ["id", true] }, code: ` import createClient from "@grafoo/core"; let query = createClient(someTransport); `, - error: true, + error: true }, "should replace a tagged template literal with the compiled grafoo object": { code: ` @@ -78,13 +78,13 @@ pluginTester({ } \`; `, - snapshot: true, + snapshot: true }, "should compress the query string if the option compress is specified": { pluginOptions: { schema: "__tests__/schema.graphql", idFields: ["id"], - compress: true, + compress: true }, code: ` import gql from "@grafoo/core/tag"; @@ -101,13 +101,13 @@ pluginTester({ } \`; `, - snapshot: true, + snapshot: true }, "should generate md5 hash and add it to object if the option generateIds is specified": { pluginOptions: { schema: "__tests__/schema.graphql", idFields: ["id"], - generateIds: true, + generateIds: true }, code: ` import gql from "@grafoo/core/tag"; @@ -124,12 +124,12 @@ pluginTester({ } \`; `, - snapshot: true, + snapshot: true }, "should not generate md5 hash and add it to object if the option generateIds is falsey": { pluginOptions: { schema: "__tests__/schema.graphql", - idFields: ["id"], + idFields: ["id"] }, code: ` import gql from "@grafoo/core/tag"; @@ -146,21 +146,21 @@ pluginTester({ } \`; `, - snapshot: true, + snapshot: true }, "should include `idFields` in the client instantiation if options are not provided": { code: ` import createClient from "@grafoo/core"; let query = createClient(someTransport); `, - snapshot: true, + snapshot: true }, "should include `idFields` in the client instantiation if not present in options": { code: ` import createClient from "@grafoo/core"; let query = createClient(someTransport, {}); `, - snapshot: true, + snapshot: true }, "should include `idFields` in the client instantiation if options is a variable": { code: ` @@ -168,7 +168,7 @@ pluginTester({ let options = {}; let query = createClient(someTransport, options); `, - snapshot: true, + snapshot: true }, "should overide `idFields` in the client instantiation if options is a variable": { code: ` @@ -176,7 +176,7 @@ pluginTester({ let options = { idFields: ["err"] }; let query = createClient(someTransport, options); `, - snapshot: true, + snapshot: true }, "should throw if `idFields` in the client instantiation if options is not an object variable": { code: ` @@ -184,7 +184,7 @@ pluginTester({ let options = []; let query = createClient(someTransport, options); `, - error: true, + error: true }, "should include `idFields` in the client instantiation even if options are provided": { code: ` @@ -193,7 +193,7 @@ pluginTester({ headers: () => ({ authorization: "some-token" }) }); `, - snapshot: true, - }, - }, + snapshot: true + } + } }); diff --git a/packages/babel-plugin/src/insert-fields.js b/packages/babel-plugin/src/insert-fields.js index e2afa5d8..f3e662c8 100644 --- a/packages/babel-plugin/src/insert-fields.js +++ b/packages/babel-plugin/src/insert-fields.js @@ -46,25 +46,25 @@ export default function insertFields(schemaStr, documentAst, idFields) { [] ); - for (let field of idFields) { - if (selections.some((_) => _.name && _.name.value === field)) { + for (let id of idFields) { + if (selections.some((s) => s.name && s.name.value === id)) { continue; // Skip already declared fields } - let typeHasField = typeFields.some((_) => _ === field); - let typeInterfacesHasField = typeInterfacesFields.some((_) => _ === field); + let typeHasId = typeFields.some((s) => s === id); + let typeInterfacesHasId = typeInterfacesFields.some((s) => s === id); if ( - typeHasField || - (field === "__typename" && !isFragment) || - (typeInterfacesHasField && !isFragment) + typeHasId || + (id === "__typename" && !isFragment) || + (typeInterfacesHasId && !isFragment) ) { - insertField(selections, field); + insertField(selections, id); } } isFragment = false; - }, + } }; return visit(documentAst, visitWithTypeInfo(typeInfo, visitor)); diff --git a/packages/babel-plugin/src/sort-query.js b/packages/babel-plugin/src/sort-query.js index 1f07fb2c..185bf7fb 100644 --- a/packages/babel-plugin/src/sort-query.js +++ b/packages/babel-plugin/src/sort-query.js @@ -6,8 +6,10 @@ function sort(array, fn) { return ( array && array.sort((prev, next) => { - if (fn(prev) < fn(next)) return -1; - if (fn(prev) > fn(next)) return 1; + let a = fn(prev); + let b = fn(next); + if (a < b) return -1; + if (a > b) return 1; return 0; }) ); @@ -18,7 +20,7 @@ export default function sortQuery(document) { Document(node) { node.definitions = [ ...sort(node.definitions.filter((def) => def.kind === "FragmentDefinition")), - ...node.definitions.filter((def) => def.kind !== "FragmentDefinition"), + ...node.definitions.filter((def) => def.kind !== "FragmentDefinition") ]; }, OperationDefinition(node) { @@ -43,6 +45,6 @@ export default function sortQuery(document) { }, Directive(node) { sort(node.arguments); - }, + } }); } diff --git a/packages/bindings/src/index.ts b/packages/bindings/src/index.ts index 75c75fbe..61ad476d 100644 --- a/packages/bindings/src/index.ts +++ b/packages/bindings/src/index.ts @@ -5,6 +5,8 @@ import { GrafooConsumerProps, ObjectsMap, Variables, + GraphQlError, + GraphQlPayload } from "@grafoo/types"; export default function createBindings( @@ -54,20 +56,21 @@ export default function createBindings( for (let key in props.mutations) { let { update, optimisticUpdate, query: mutationQuery } = props.mutations[key]; - boundMutations[key] = (mutationVariables) => { + boundMutations[key] = async ( + mutationVariables + ): Promise]>> => { if (props.query && optimisticUpdate) { writeToCache(optimisticUpdate(data, mutationVariables)); } - return client - .execute(mutationQuery, mutationVariables) - .then((mutationResponse) => { - if (props.query && update && mutationResponse.data) { - writeToCache(update(data, mutationResponse.data)); - } - - return mutationResponse; - }); + let mutationResponse = await client.execute( + mutationQuery, + mutationVariables + ); + if (props.query && update && mutationResponse.data) { + writeToCache(update(data, mutationResponse.data)); + } + return mutationResponse; }; } } @@ -76,7 +79,11 @@ export default function createBindings( client.write(props.query, variables, dataUpdate); } - function performUpdate(boundStateUpdate?) { + function performUpdate(boundStateUpdate?: { + errors: GraphQlError[]; + loaded: boolean; + loading: boolean; + }) { ({ data, objects } = client.read(props.query, variables)); Object.assign(boundState, boundStateUpdate); @@ -88,7 +95,7 @@ export default function createBindings( return Object.assign({ client }, boundState, boundMutations, data); } - function load(nextVariables?: Variables) { + async function load(nextVariables?: Variables): Promise { if (nextVariables) { variables = nextVariables; } @@ -99,15 +106,13 @@ export default function createBindings( updater(); } - return client.execute(props.query, variables).then(({ data, errors }) => { - if (data) { - lockListenUpdate = 1; - - writeToCache(data); - } + let { data, errors } = await client.execute(props.query, variables); + if (data) { + lockListenUpdate = 1; - performUpdate({ errors, loaded: !!data, loading: false }); - }); + writeToCache(data); + } + performUpdate({ errors, loaded: !!data, loading: false }); } return { getState, unbind, load }; diff --git a/packages/core/src/build-query-tree.ts b/packages/core/src/build-query-tree.ts index 787d12b4..8222ef4a 100644 --- a/packages/core/src/build-query-tree.ts +++ b/packages/core/src/build-query-tree.ts @@ -1,6 +1,7 @@ +import { ObjectsMap } from "@grafoo/types"; import { idFromProps, isNotNullObject } from "./util"; -export default function buildQueryTree(tree, objects, idFields) { +export default function buildQueryTree(tree: T, objects: ObjectsMap, idFields: string[]): T { // clone resulting query tree let queryTree = tree; let stack = []; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index f919f4fe..c1da1292 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -5,7 +5,7 @@ import { Listener, ObjectsMap, Variables, - GrafooTransport, + GrafooTransport } from "@grafoo/types"; import buildQueryTree from "./build-query-tree"; import mapObjects from "./map-objects"; @@ -48,7 +48,7 @@ export default function createClient( for (let i in paths) { let { name, args } = paths[i]; let pathData = { - [name]: (data as { data: T }).data ? (data as { data: T }).data[name] : data[name], + [name]: (data as { data: T }).data ? (data as { data: T }).data[name] : data[name] }; let pathObjects = mapObjects(pathData, idFields); @@ -56,7 +56,7 @@ export default function createClient( pathsMap[getPathId(i, args, variables)] = { data: pathData, - objects: Object.keys(pathObjects), + objects: Object.keys(pathObjects) }; } @@ -75,8 +75,12 @@ export default function createClient( for (let i in listeners) listeners[i](objects); } - function read({ paths }: GrafooObject, variables?: Variables) { - let data = {}; + function read( + { paths }: GrafooObject, + variables?: Variables + ): { data?: T; objects?: ObjectsMap; partial?: boolean } { + // @ts-ignore + let data: T = {}; let objects: ObjectsMap = {}; let partial = false; diff --git a/packages/core/src/map-objects.ts b/packages/core/src/map-objects.ts index 18a8bf54..a8df7d8d 100644 --- a/packages/core/src/map-objects.ts +++ b/packages/core/src/map-objects.ts @@ -1,6 +1,7 @@ +import { ObjectsMap } from "@grafoo/types"; import { isNotNullObject, idFromProps } from "./util"; -export default function mapObjects(tree, idFields) { +export default function mapObjects(tree: T, idFields: string[]): ObjectsMap { // map in which objects will be stored // having their extracted ids from props as key let map = {}; diff --git a/packages/core/src/util.ts b/packages/core/src/util.ts index 93b39847..47f763ec 100644 --- a/packages/core/src/util.ts +++ b/packages/core/src/util.ts @@ -1,6 +1,6 @@ import { Variables } from "@grafoo/types"; -export let idFromProps = (branch, idFields) => { +export let idFromProps = (branch: { [key: string]: string }, idFields: string | any[]): string => { branch = branch || {}; let identifier = ""; @@ -11,9 +11,9 @@ export let idFromProps = (branch, idFields) => { return identifier; }; -export let isNotNullObject = (obj) => obj && typeof obj == "object"; +export let isNotNullObject = (obj: any): boolean => obj && typeof obj == "object"; -export let getPathId = (path: string, args: string[], variables?: Variables) => { +export let getPathId = (path: string, args: string[], variables?: Variables): string => { variables = variables || {}; let finalPath = path; let i = args.length; diff --git a/packages/preact/src/consumer.ts b/packages/preact/src/consumer.ts index aa0d046f..a709b4a8 100644 --- a/packages/preact/src/consumer.ts +++ b/packages/preact/src/consumer.ts @@ -3,7 +3,7 @@ import { Context, GrafooBoundState, GrafooBoundMutations, - GrafooConsumerProps, + GrafooConsumerProps } from "@grafoo/types"; import { Component, VNode } from "preact"; @@ -53,7 +53,10 @@ export class Consumer extends Component, + state: GrafooBoundState & T & GrafooBoundMutations + ): VNode { return props.children[0](state); } } diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 417cf392..814227ca 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -4,6 +4,7 @@ import { GrafooConsumerProps, GrafooBoundState, GrafooBoundMutations, + GrafooClient } from "@grafoo/types"; import { Component, createContext, createElement, ReactElement, ReactNode, FC } from "react"; @@ -39,7 +40,7 @@ export let Provider: FC = (props) => class GrafooConsumer extends Component> { state: GrafooBoundState & T & GrafooBoundMutations; - constructor(props) { + constructor(props: GrafooReactConsumerProps) { super(props); let bindings = createBindings(props.client, props, () => { @@ -75,6 +76,6 @@ class GrafooConsumer extends Component> { * U = Mutations */ export let Consumer: ConsumerType = (props: GrafooReactConsumerProps) => - createElement(ctx.Consumer, null, (client) => + createElement(ctx.Consumer, null, (client: GrafooClient) => createElement(GrafooConsumer, Object.assign({ client }, props)) ); diff --git a/packages/test-utils/src/mock-server.ts b/packages/test-utils/src/mock-server.ts index e5159ffd..62b520f7 100644 --- a/packages/test-utils/src/mock-server.ts +++ b/packages/test-utils/src/mock-server.ts @@ -111,12 +111,12 @@ let resolvers = { let schema = makeExecutableSchema({ typeDefs: typeDefs, resolvers: resolvers }); -interface ExecuteQueryArg { +type ExecuteQueryArg = { query: string; variables?: { [key: string]: unknown; }; -} +}; export function executeQuery({ query, variables }: ExecuteQueryArg): Promise> { // @ts-ignore diff --git a/packages/types/index.d.ts b/packages/types/index.d.ts index b4ea7280..d219f671 100644 --- a/packages/types/index.d.ts +++ b/packages/types/index.d.ts @@ -17,7 +17,7 @@ export interface GraphQlPayload { } export interface Variables { - [key: string]: any; + [key: string]: unknown; } /** @@ -39,8 +39,9 @@ export interface ObjectsMap { export interface PathsMap { [key: string]: { - data: { [key: string]: any }; + data: { [key: string]: unknown }; objects: string[]; + partial?: boolean; }; } @@ -148,6 +149,7 @@ export type GrafooBoundMutations = { * U = Mutations */ export interface GrafooConsumerProps { + client: GrafooClient; query?: GrafooObject; variables?: Variables; mutations?: GrafooMutations; diff --git a/yarn.lock b/yarn.lock index 5863a47b..03aa457e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2217,11 +2217,6 @@ jest-diff "^27.0.0" pretty-format "^27.0.0" -"@types/json-schema@^7.0.7": - version "7.0.9" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" - integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== - "@types/minimatch@^3.0.3": version "3.0.5" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" @@ -2314,31 +2309,6 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^4.9.1": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.2.tgz#9f41efaee32cdab7ace94b15bd19b756dd099b0a" - integrity sha512-w63SCQ4bIwWN/+3FxzpnWrDjQRXVEGiTt9tJTRptRXeFvdZc/wLiz3FQUwNQ2CVoRGI6KUWMNUj/pk63noUfcA== - dependencies: - "@typescript-eslint/experimental-utils" "4.31.2" - "@typescript-eslint/scope-manager" "4.31.2" - debug "^4.3.1" - functional-red-black-tree "^1.0.1" - regexpp "^3.1.0" - semver "^7.3.5" - tsutils "^3.21.0" - -"@typescript-eslint/experimental-utils@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.2.tgz#98727a9c1e977dd5d20c8705e69cd3c2a86553fa" - integrity sha512-3tm2T4nyA970yQ6R3JZV9l0yilE2FedYg8dcXrTar34zC9r6JB7WyBQbpIVongKPlhEMjhQ01qkwrzWy38Bk1Q== - dependencies: - "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.31.2" - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/typescript-estree" "4.31.2" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - "@typescript-eslint/parser@^4.9.1": version "4.31.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.31.2.tgz#54aa75986e3302d91eff2bbbaa6ecfa8084e9c34" @@ -3726,13 +3696,6 @@ eslint-utils@^2.1.0: dependencies: eslint-visitor-keys "^1.1.0" -eslint-utils@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" - integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== - dependencies: - eslint-visitor-keys "^2.0.0" - eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" From 9336493d3620adcb9bc1ede5bd9ce92d6578b780 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Sun, 3 Oct 2021 19:58:12 -0300 Subject: [PATCH 02/49] Refactor typing system --- packages/babel-plugin/src/index.js | 26 ++++++++++++-------------- packages/core/__tests__/index.ts | 23 +++++++++++------------ packages/test-utils/src/mock-server.ts | 2 +- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/packages/babel-plugin/src/index.js b/packages/babel-plugin/src/index.js index c66df5a3..61018eb0 100644 --- a/packages/babel-plugin/src/index.js +++ b/packages/babel-plugin/src/index.js @@ -111,33 +111,31 @@ export default function transform({ types: t }) { TaggedTemplateExpression(path) { if (tagIdentifiers.some((name) => t.isIdentifier(path.node.tag, { name }))) { - try { - let quasi = path.get("quasi"); + let quasi = path.get("quasi"); - if (quasi.get("expressions").length) { - throw path.buildCodeFrameError( - "@grafoo/core/tag: interpolation is not supported in a graphql tagged template literal." - ); - } + if (quasi.get("expressions").length) { + throw path.buildCodeFrameError( + "@grafoo/core/tag: interpolation is not supported in a graphql tagged template literal." + ); + } + try { let source = quasi.node.quasis.reduce((src, q) => src + q.value.raw, ""); - path.replaceWith(parseLiteral(compileDocument(source, opts))); } catch (error) { if (error.code === "ENOENT") { throw new Error( "Could not find a schema in the root directory! " + - "Please use the `schema` option to specify your schema path, " + - "or the `schemaUrl` to specify your graphql endpoint." + "Please use the `schema` option to specify your schema path" ); } - throw path.buildCodeFrameError(error.message); + throw path.buildCodeFrameError(error); } } - }, + } }); - }, - }, + } + } }; } diff --git a/packages/core/__tests__/index.ts b/packages/core/__tests__/index.ts index e115f49c..9846c62c 100644 --- a/packages/core/__tests__/index.ts +++ b/packages/core/__tests__/index.ts @@ -115,18 +115,18 @@ let POSTS = graphql` } `; -function mockTrasport(query: string, variables: Variables) { +function mockTransport(query: string, variables: Variables) { return executeQuery({ query, variables }); } describe("@grafoo/core", () => { let client: GrafooClient; beforeEach(() => { - client = createClient(mockTrasport, { idFields: ["id"] }); + client = createClient(mockTransport, { idFields: ["id"] }); }); it("should be instantiable", () => { - expect(() => createClient(mockTrasport, { idFields: ["id"] })).not.toThrow(); + expect(() => createClient(mockTransport, { idFields: ["id"] })).not.toThrow(); expect(typeof client.execute).toBe("function"); expect(typeof client.listen).toBe("function"); expect(typeof client.write).toBe("function"); @@ -136,9 +136,14 @@ describe("@grafoo/core", () => { }); it("should perform query requests", async () => { - let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; + let data = await executeQuery({ query: SIMPLE_AUTHORS.query }); + expect(data).toEqual(await client.execute(SIMPLE_AUTHORS)); + }); + it("should perform query requests with fragments", async () => { + let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; let { query, frags } = POST_WITH_FRAGMENT; + if (frags) for (let frag in frags) query += " " + frags[frag]; let data = await executeQuery({ query, variables }); @@ -146,12 +151,6 @@ describe("@grafoo/core", () => { expect(data).toEqual(await client.execute(POST_WITH_FRAGMENT, variables)); }); - it("should perform query requests with fragments", async () => { - let data = await executeQuery({ query: SIMPLE_AUTHORS.query }); - - expect(data).toEqual(await client.execute(SIMPLE_AUTHORS)); - }); - it("should write queries to the client", async () => { let data = await executeQuery(POSTS_AND_AUTHORS); @@ -344,7 +343,7 @@ describe("@grafoo/core", () => { client.write(POSTS_AND_AUTHORS, data); - client = createClient(mockTrasport, { idFields: ["id"], initialState: client.flush() }); + client = createClient(mockTransport, { idFields: ["id"], initialState: client.flush() }); expect(client.read(POSTS_AND_AUTHORS).data).toEqual(data); }); @@ -364,7 +363,7 @@ describe("@grafoo/core", () => { it("should accept `idFields` array in options", async () => { let { data } = await executeQuery(AUTHORS); - let client = createClient(mockTrasport, { idFields: ["__typename", "id"] }); + let client = createClient(mockTransport, { idFields: ["__typename", "id"] }); client.write(AUTHORS, data); diff --git a/packages/test-utils/src/mock-server.ts b/packages/test-utils/src/mock-server.ts index 62b520f7..5cb2a9ca 100644 --- a/packages/test-utils/src/mock-server.ts +++ b/packages/test-utils/src/mock-server.ts @@ -19,7 +19,7 @@ let Query = { return db.data.authors; }, post(_, args) { - return db.data.posts.find((author) => author.id === args.id); + return db.data.posts.find((post) => post.id === args.id); }, posts() { return db.data.posts; From f8c902e43e0c7d371a703f3685a953a27fe0e072 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Sun, 3 Oct 2021 19:58:53 -0300 Subject: [PATCH 03/49] Refactor typing system --- packages/bindings/__tests__/index.ts | 326 +++++----- packages/bindings/src/index.ts | 98 +-- packages/bundle/package.json | 2 +- packages/core/__tests__/index.ts | 126 ++-- packages/core/src/build-query-tree.ts | 8 +- packages/core/src/index.ts | 127 +++- packages/core/src/map-objects.ts | 4 +- packages/core/src/util.ts | 4 +- packages/core/tag.d.ts | 6 +- packages/http-transport/__tests__/index.ts | 4 +- packages/http-transport/src/index.ts | 11 +- packages/react/package.json | 8 +- packages/react/src/index.ts | 9 +- packages/test-utils/src/mock-server.ts | 2 +- packages/types/index.d.ts | 150 ----- yarn.lock | 658 ++++++++++++++++++++- 16 files changed, 1079 insertions(+), 464 deletions(-) diff --git a/packages/bindings/__tests__/index.ts b/packages/bindings/__tests__/index.ts index fc53356c..144b22f1 100644 --- a/packages/bindings/__tests__/index.ts +++ b/packages/bindings/__tests__/index.ts @@ -1,57 +1,33 @@ import createBindings from "../src"; +import fetch from "node-fetch"; import graphql from "@grafoo/core/tag"; -import createClient from "@grafoo/core"; -import { GrafooClient, GrafooMutations, Variables } from "@grafoo/types"; +import createClient, { GrafooClient } from "@grafoo/core"; import { mockQueryRequest } from "@grafoo/test-utils"; import createTransport from "@grafoo/http-transport"; -interface Post { +// @ts-ignore +globalThis.fetch = fetch; + +type Post = { title: string; content: string; id: string; __typename: string; author: Author; -} +}; -interface Author { +type Author = { name: string; id: string; __typename: string; posts?: Array; -} +}; -interface Authors { +type AuthorsQuery = { authors: Author[]; -} - -interface CreateAuthor { - createAuthor: { - name: string; - id: string; - __typename: string; - posts?: Array; - }; -} - -interface DeleteAuthor { - deleteAuthor: { - name: string; - id: string; - __typename: string; - posts?: Array; - }; -} - -interface UpdateAuthor { - updateAuthor: { - name: string; - id: string; - __typename: string; - posts?: Array; - }; -} +}; -let AUTHORS = graphql` +let AUTHORS = graphql` query { authors { name @@ -63,8 +39,16 @@ let AUTHORS = graphql` } `; -let AUTHOR = graphql` - query($id: ID!) { +type AuthorQuery = { + author: Author; +}; + +type AuthorQueryInput = { + id: string; +}; + +let AUTHOR = graphql` + query ($id: ID!) { author(id: $id) { name posts { @@ -75,7 +59,13 @@ let AUTHOR = graphql` } `; -let POSTS_AND_AUTHORS = graphql` +type PostsQuery = { + posts: Post[]; +}; + +type PostsAndAuthorsQuery = AuthorsQuery & PostsQuery; + +let POSTS_AND_AUTHORS = graphql` query { posts { title @@ -95,8 +85,21 @@ let POSTS_AND_AUTHORS = graphql` } `; -let CREATE_AUTHOR = graphql` - mutation($name: String!) { +type CreateAuthorMutation = { + createAuthor: { + name: string; + id: string; + __typename: string; + posts?: Array; + }; +}; + +type CreateAuthorInput = { + name: string; +}; + +let CREATE_AUTHOR = graphql` + mutation ($name: String!) { createAuthor(name: $name) { name posts { @@ -107,8 +110,21 @@ let CREATE_AUTHOR = graphql` } `; -let DELETE_AUTHOR = graphql` - mutation($id: ID!) { +type DeleteAuthorMutation = { + deleteAuthor: { + name: string; + id: string; + __typename: string; + posts?: Array; + }; +}; + +type DeleteAuthorInput = { + id: string; +}; + +let DELETE_AUTHOR = graphql` + mutation ($id: ID!) { deleteAuthor(id: $id) { name posts { @@ -119,8 +135,22 @@ let DELETE_AUTHOR = graphql` } `; -let UPDATE_AUTHOR = graphql` - mutation($id: ID!, $name: String) { +type UpdateAuthorMutation = { + updateAuthor: { + name: string; + id: string; + __typename: string; + posts?: Array; + }; +}; + +type UpdateAuthorInput = { + id?: string; + name?: string; +}; + +let UPDATE_AUTHOR = graphql` + mutation ($id: ID!, $name: String) { updateAuthor(id: $id, name: $name) { name posts { @@ -141,7 +171,7 @@ describe("@grafoo/bindings", () => { it("should be evocable given the minimal props", () => { let bindings; - expect(() => (bindings = createBindings(client, {}, () => void 0))).not.toThrow(); + expect(() => (bindings = createBindings(client, () => {}, {}))).not.toThrow(); Object.keys(bindings).forEach((fn) => { expect(typeof bindings[fn]).toBe("function"); @@ -151,7 +181,7 @@ describe("@grafoo/bindings", () => { }); it("should not provide any data if no query or mutation is given", () => { - let bindings = createBindings(client, {}, () => void 0); + let bindings = createBindings(client, () => {}, {}); let props = bindings.getState(); @@ -159,11 +189,11 @@ describe("@grafoo/bindings", () => { }); it("should execute a query", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); let renderFn = jest.fn(); - let bindings = createBindings(client, { query: AUTHORS }, renderFn); + let bindings = createBindings(client, renderFn, { query: AUTHORS }); expect(bindings.getState()).toMatchObject({ loaded: false, loading: true }); @@ -173,11 +203,11 @@ describe("@grafoo/bindings", () => { }); it("should notify a loading state", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); let renderFn = jest.fn(); - let bindings = createBindings(client, { query: AUTHORS }, renderFn); + let bindings = createBindings(client, renderFn, { query: AUTHORS }); await bindings.load(); @@ -194,31 +224,31 @@ describe("@grafoo/bindings", () => { }); it("should provide the data if the query is already cached", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); - let bindings = createBindings(client, { query: AUTHORS }, () => void 0); + let bindings = createBindings(client, () => {}, { query: AUTHORS }); expect(bindings.getState()).toMatchObject({ ...data, loaded: true, loading: false }); }); it("should provide the data if a query is partialy cached", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); - let bindings = createBindings(client, { query: POSTS_AND_AUTHORS }, () => void 0); + let bindings = createBindings(client, () => {}, { query: POSTS_AND_AUTHORS }); expect(bindings.getState()).toMatchObject({ ...data, loaded: false, loading: true }); }); it("should trigger updater function if the cache has been updated", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); let renderFn = jest.fn(); - let bindings = createBindings(client, { query: AUTHORS }, renderFn); + let bindings = createBindings(client, renderFn, { query: AUTHORS }); client.write(AUTHORS, data); @@ -227,33 +257,33 @@ describe("@grafoo/bindings", () => { }); it("should provide the state for a cached query", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); let renderFn = jest.fn(); - let bindings = createBindings(client, { query: AUTHORS }, renderFn); + let bindings = createBindings(client, renderFn, { query: AUTHORS }); expect(bindings.getState()).toMatchObject(data); }); it("should stop updating if unbind has been called", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); let renderFn = jest.fn(); - let bindings = createBindings(client, { query: AUTHORS }, renderFn); + let bindings = createBindings(client, renderFn, { query: AUTHORS }); await bindings.load(); bindings.unbind(); client.write(AUTHORS, { - authors: data.authors.map((a, i) => (!i ? { ...a, name: "Homer" } : a)), + authors: data.authors.map((a, i) => (!i ? { ...a, name: "Homer" } : a)) }); - expect(client.read(AUTHORS).data.authors[0].name).toBe("Homer"); + expect(client.read(AUTHORS).data.authors[0].name).toBe("Homer"); expect(renderFn).toHaveBeenCalledTimes(1); expect(bindings.getState()).toMatchObject(data); }); @@ -265,7 +295,7 @@ describe("@grafoo/bindings", () => { let renderFn = jest.fn(); - let bindings = createBindings(client, { query: FailAuthors }, renderFn); + let bindings = createBindings(client, renderFn, { query: FailAuthors }); await bindings.load(); @@ -274,13 +304,11 @@ describe("@grafoo/bindings", () => { }); it("should perform a simple mutation", async () => { - interface Mutations { - createAuthor: CreateAuthor; - } - - let mutations: GrafooMutations = { createAuthor: { query: CREATE_AUTHOR } }; - - let bindings = createBindings(client, { mutations }, () => void 0); + let bindings = createBindings(client, () => {}, { + mutations: { + createAuthor: { query: CREATE_AUTHOR } + } + }); let props = bindings.getState(); @@ -294,24 +322,20 @@ describe("@grafoo/bindings", () => { }); it("should perform mutation with a cache update", async () => { - await mockQueryRequest(AUTHORS); - - interface Mutations { - createAuthor: CreateAuthor; - } + await mockQueryRequest(AUTHORS); - let mutations: GrafooMutations = { + let mutations = { createAuthor: { query: CREATE_AUTHOR, update: ({ authors }, data) => ({ - authors: [data.createAuthor, ...authors], - }), - }, + authors: [data.createAuthor, ...authors] + }) + } }; let update = jest.spyOn(mutations.createAuthor, "update"); - let bindings = createBindings(client, { query: AUTHORS, mutations }, () => void 0); + let bindings = createBindings(client, () => {}, { query: AUTHORS, mutations }); let props = bindings.getState(); @@ -321,7 +345,10 @@ describe("@grafoo/bindings", () => { let variables = { name: "Homer" }; - let { data } = await mockQueryRequest({ query: CREATE_AUTHOR.query, variables }); + let { data } = await mockQueryRequest({ + query: CREATE_AUTHOR.query, + variables + }); let { authors } = bindings.getState(); @@ -333,26 +360,22 @@ describe("@grafoo/bindings", () => { it("should perform optimistic update", async () => { await mockQueryRequest(AUTHORS); - interface Mutations { - createAuthor: CreateAuthor; - } - - let mutations: GrafooMutations = { + let mutations = { createAuthor: { query: CREATE_AUTHOR, optimisticUpdate: ({ authors }, variables: Author) => ({ - authors: [{ ...variables, id: "tempID" }, ...authors], + authors: [{ ...variables, id: "tempID" }, ...authors] }), update: ({ authors }, data) => ({ - authors: authors.map((p) => (p.id === "tempID" ? data.createAuthor : p)), - }), - }, + authors: authors.map((p) => (p.id === "tempID" ? data.createAuthor : p)) + }) + } }; let optimisticUpdate = jest.spyOn(mutations.createAuthor, "optimisticUpdate"); let update = jest.spyOn(mutations.createAuthor, "update"); - let bindings = createBindings(client, { query: AUTHORS, mutations }, () => void 0); + let bindings = createBindings(client, () => {}, { query: AUTHORS, mutations }); let props = bindings.getState(); @@ -362,7 +385,10 @@ describe("@grafoo/bindings", () => { let variables = { name: "Peter" }; - let { data } = await mockQueryRequest({ query: CREATE_AUTHOR.query, variables }); + let { data } = await mockQueryRequest({ + query: CREATE_AUTHOR.query, + variables + }); let { authors } = bindings.getState(); @@ -379,28 +405,26 @@ describe("@grafoo/bindings", () => { it("should update if query objects has less keys then nextObjects", async () => { let { query } = CREATE_AUTHOR; - let author = (await mockQueryRequest({ query, variables: { name: "gustav" } })) - .data.createAuthor; - let { data } = await mockQueryRequest(AUTHORS); + let { + data: { createAuthor: author } + } = await mockQueryRequest({ query, variables: { name: "gustav" } }); + let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); - interface Mutations { - removeAuthor: DeleteAuthor; - } - - let mutations: GrafooMutations = { - removeAuthor: { - query: DELETE_AUTHOR, - optimisticUpdate: ({ authors }, { id }: Author) => ({ - authors: authors.filter((author) => author.id !== id), - }), - }, - }; - let renderFn = jest.fn(); - let bindings = createBindings(client, { query: AUTHORS, mutations }, renderFn); + let bindings = createBindings(client, renderFn, { + query: AUTHORS, + mutations: { + removeAuthor: { + query: DELETE_AUTHOR, + optimisticUpdate: ({ authors }, { id }) => ({ + authors: authors.filter((author) => author.id !== id) + }) + } + } + }); let { removeAuthor } = bindings.getState(); @@ -413,32 +437,28 @@ describe("@grafoo/bindings", () => { it("should update if query objects is modified", async () => { let { query } = CREATE_AUTHOR; - let author = ( - await mockQueryRequest({ - query, - variables: { name: "sven" }, - }) - ).data.createAuthor; - let { data } = await mockQueryRequest(AUTHORS); + let { + data: { createAuthor: author } + } = await mockQueryRequest({ + query, + variables: { name: "sven" } + }); + let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); - interface Mutations { - updateAuthor: UpdateAuthor; - } - - let mutations: GrafooMutations = { + let mutations = { updateAuthor: { query: UPDATE_AUTHOR, optimisticUpdate: ({ authors }, variables: Author) => ({ - authors: authors.map((author) => (author.id === variables.id ? variables : author)), - }), - }, + authors: authors.map((author) => (author.id === variables.id ? variables : author)) + }) + } }; let renderFn = jest.fn(); - let bindings = createBindings(client, { query: AUTHORS, mutations }, renderFn); + let bindings = createBindings(client, renderFn, { query: AUTHORS, mutations }); let { updateAuthor } = bindings.getState(); @@ -452,13 +472,13 @@ describe("@grafoo/bindings", () => { }); it("should not update if query objects is not modified", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); let renderFn = jest.fn(); - createBindings(client, { query: AUTHORS }, renderFn); + createBindings(client, renderFn, { query: AUTHORS }); client.write(AUTHORS, data); @@ -466,49 +486,43 @@ describe("@grafoo/bindings", () => { }); it("should accept multiple mutations", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); - interface Mutations { - createAuthor: CreateAuthor; - updateAuthor: UpdateAuthor; - deleteAuthor: DeleteAuthor; - } - - let mutations: GrafooMutations = { + let mutations = { createAuthor: { query: CREATE_AUTHOR, optimisticUpdate: ({ authors }, variables: Author) => ({ - authors: [{ ...variables, id: "tempID" }, ...authors], - }), - update: ({ authors }, data: CreateAuthor) => ({ - authors: authors.map((author) => (author.id === "tempID" ? data.createAuthor : author)), + authors: [{ ...variables, id: "tempID" }, ...authors] }), + update: ({ authors }, data: CreateAuthorMutation) => ({ + authors: authors.map((author) => (author.id === "tempID" ? data.createAuthor : author)) + }) }, updateAuthor: { query: UPDATE_AUTHOR, optimisticUpdate: ({ authors }, variables: Author) => ({ - authors: authors.map((author) => (author.id === variables.id ? variables : author)), - }), + authors: authors.map((author) => (author.id === variables.id ? variables : author)) + }) }, deleteAuthor: { query: DELETE_AUTHOR, optimisticUpdate: ({ authors }, variables: Author) => ({ - authors: authors.map((author) => (author.id === variables.id ? variables : author)), - }), - }, + authors: authors.map((author) => (author.id === variables.id ? variables : author)) + }) + } }; let renderFn = jest.fn(); - let bindings = createBindings(client, { query: AUTHORS, mutations }, renderFn); + let bindings = createBindings(client, renderFn, { query: AUTHORS, mutations }); let props = bindings.getState(); try { - let variables: Variables = { name: "mikel" }; - let { data } = await mockQueryRequest({ + let variables = { name: "mikel" }; + let { data } = await mockQueryRequest({ query: CREATE_AUTHOR.query, - variables, + variables }); expect(await mockQueryRequest({ query: CREATE_AUTHOR.query, variables })).toEqual( await props.createAuthor(variables) @@ -530,27 +544,23 @@ describe("@grafoo/bindings", () => { it("should update variables when new variables are passed", async () => { let { - data: { authors }, - } = await mockQueryRequest(AUTHORS); + data: { authors } + } = await mockQueryRequest(AUTHORS); let [author1, author2] = authors; let author1Variables = { id: author1.id }; let author2Variables = { id: author2.id }; - let bindings = createBindings<{ author: Author }>( - client, - { query: AUTHOR, variables: author1Variables }, - () => {} - ); + let bindings = createBindings(client, () => {}, { query: AUTHOR, variables: author1Variables }); await mockQueryRequest({ query: AUTHOR.query, variables: author1Variables }); await bindings.load(); expect(bindings.getState().author).toMatchObject(author1); - expect(client.read<{ author: Author }>(AUTHOR, author1Variables).data.author).toEqual(author1); + expect(client.read(AUTHOR, author1Variables).data.author).toEqual(author1); await mockQueryRequest({ query: AUTHOR.query, variables: author2Variables }); await bindings.load(author2Variables); expect(bindings.getState().author).toMatchObject(author2); - expect(client.read<{ author: Author }>(AUTHOR, author2Variables).data.author).toEqual(author2); + expect(client.read(AUTHOR, author2Variables).data.author).toEqual(author2); }); }); diff --git a/packages/bindings/src/index.ts b/packages/bindings/src/index.ts index 61ad476d..2e9003f0 100644 --- a/packages/bindings/src/index.ts +++ b/packages/bindings/src/index.ts @@ -1,35 +1,57 @@ import { GrafooClient, - GrafooBindings, - GrafooBoundMutations, - GrafooConsumerProps, - ObjectsMap, - Variables, + GrafooObjectsMap, GraphQlError, - GraphQlPayload -} from "@grafoo/types"; - -export default function createBindings( + GraphQlPayload, + GrafooObject +} from "@grafoo/core"; + +export type GrafooMutation = { + query: T; + update?: (props: U["_queryType"], data: T["_queryType"]) => T["_queryType"]; + optimisticUpdate?: (props: U["_queryType"], variables: T["_variablesType"]) => T["_queryType"]; +}; + +export type GrafooMutations = { + [k: string]: GrafooMutation; +}; + +export type GrafooBountMutations> = { + [V in keyof U]: ( + variables: U[V]["query"]["_variablesType"] + ) => Promise>; +}; + +export type GrafooConsumerProps> = { + query?: T; + variables?: T["_variablesType"]; + mutations?: U; + skip?: boolean; +}; + +export default function createBindings>( client: GrafooClient, - props: GrafooConsumerProps, - updater: () => void -): GrafooBindings { + updater: () => void, + props: GrafooConsumerProps +) { + type CP = GrafooConsumerProps; + let { variables } = props; - let data: T; - let objects: ObjectsMap; - let boundMutations = {} as GrafooBoundMutations; + let data: CP["query"]["_queryType"]; + let objects: GrafooObjectsMap; + let partial = false; + let boundMutations = {} as GrafooBountMutations; let unbind = () => {}; - let lockListenUpdate = 0; + let lockListenUpdate = false; let loaded = false; - let partial = false; if (props.query) { - ({ data, objects, partial } = client.read(props.query, variables)); + ({ data, objects, partial } = client.read(props.query, variables)); loaded = !!data && !partial; unbind = client.listen((nextObjects) => { - if (lockListenUpdate) return (lockListenUpdate = 0); + if (lockListenUpdate) return (lockListenUpdate = false); objects = objects || {}; @@ -56,26 +78,23 @@ export default function createBindings( for (let key in props.mutations) { let { update, optimisticUpdate, query: mutationQuery } = props.mutations[key]; - boundMutations[key] = async ( - mutationVariables - ): Promise]>> => { + boundMutations[key] = (mutationVariables) => { if (props.query && optimisticUpdate) { writeToCache(optimisticUpdate(data, mutationVariables)); } - let mutationResponse = await client.execute( - mutationQuery, - mutationVariables - ); - if (props.query && update && mutationResponse.data) { - writeToCache(update(data, mutationResponse.data)); - } - return mutationResponse; + return client.execute(mutationQuery, mutationVariables).then((mutationResponse) => { + if (props.query && update && mutationResponse.data) { + writeToCache(update(data, mutationResponse.data)); + } + + return mutationResponse; + }); }; } } - function writeToCache(dataUpdate: T) { + function writeToCache(dataUpdate: CP["query"]["_queryType"]) { client.write(props.query, variables, dataUpdate); } @@ -84,7 +103,7 @@ export default function createBindings( loaded: boolean; loading: boolean; }) { - ({ data, objects } = client.read(props.query, variables)); + ({ data, objects } = client.read(props.query, variables)); Object.assign(boundState, boundStateUpdate); @@ -95,7 +114,7 @@ export default function createBindings( return Object.assign({ client }, boundState, boundMutations, data); } - async function load(nextVariables?: Variables): Promise { + function load(nextVariables?: CP["query"]["_variablesType"]) { if (nextVariables) { variables = nextVariables; } @@ -106,13 +125,14 @@ export default function createBindings( updater(); } - let { data, errors } = await client.execute(props.query, variables); - if (data) { - lockListenUpdate = 1; + return client.execute(props.query, variables).then(({ data, errors }) => { + if (data) { + lockListenUpdate = true; - writeToCache(data); - } - performUpdate({ errors, loaded: !!data, loading: false }); + writeToCache(data); + } + performUpdate({ errors, loaded: !!data, loading: false }); + }); } return { getState, unbind, load }; diff --git a/packages/bundle/package.json b/packages/bundle/package.json index 19961692..52c95f96 100644 --- a/packages/bundle/package.json +++ b/packages/bundle/package.json @@ -5,7 +5,7 @@ "main": "index.js", "dependencies": { "mri": "^1.1.1", - "rollup": "^2.34.2", + "rollup": "^2.58.0", "rollup-plugin-buble": "^0.19.2", "rollup-plugin-filesize": "^9.1.0", "rollup-plugin-node-resolve": "^5.2.0", diff --git a/packages/core/__tests__/index.ts b/packages/core/__tests__/index.ts index 9846c62c..5bd73040 100644 --- a/packages/core/__tests__/index.ts +++ b/packages/core/__tests__/index.ts @@ -1,41 +1,27 @@ import graphql from "@grafoo/core/tag"; import { executeQuery } from "@grafoo/test-utils"; -import { GrafooClient, Variables } from "@grafoo/types"; -import createClient from "../src"; +import createClient, { GrafooClient } from "../src"; -interface Post { +type Post = { title: string; content: string; id: string; __typename: string; author: Author; -} +}; -interface Author { +type Author = { name: string; id: string; __typename: string; posts?: Array; -} +}; -interface AuthorsQuery { +type AuthorsQuery = { authors: Author[]; -} - -interface PostQuery { - post: Post; -} - -interface PostsAndAuthorsQuery { - authors: Author[]; - posts: Post[]; -} - -interface PostsQuery { - posts: Post[]; -} +}; -let AUTHORS = graphql` +let AUTHORS = graphql` query { authors { name @@ -47,7 +33,7 @@ let AUTHORS = graphql` } `; -let SIMPLE_AUTHORS = graphql` +let SIMPLE_AUTHORS = graphql` query { authors { name @@ -55,7 +41,12 @@ let SIMPLE_AUTHORS = graphql` } `; -let POSTS_AND_AUTHORS = graphql` +type PostsAndAuthorsQuery = { + authors: Author[]; + posts: Post[]; +}; + +let POSTS_AND_AUTHORS = graphql` query { posts { title @@ -75,7 +66,15 @@ let POSTS_AND_AUTHORS = graphql` } `; -let POST = graphql` +type PostQuery = { + post: Post; +}; + +type PostQueryArgs = { + postId: string; +}; + +let POST = graphql` query ($postId: ID!) { post(id: $postId) { title @@ -87,7 +86,7 @@ let POST = graphql` } `; -let POST_WITH_FRAGMENT = graphql` +let POST_WITH_FRAGMENT = graphql` query ($postId: ID!) { post(id: $postId) { title @@ -103,7 +102,11 @@ let POST_WITH_FRAGMENT = graphql` } `; -let POSTS = graphql` +type PostsQuery = { + posts: Post[]; +}; + +let POSTS = graphql` query { posts { title @@ -115,7 +118,7 @@ let POSTS = graphql` } `; -function mockTransport(query: string, variables: Variables) { +function mockTransport(query, variables) { return executeQuery({ query, variables }); } @@ -136,7 +139,7 @@ describe("@grafoo/core", () => { }); it("should perform query requests", async () => { - let data = await executeQuery({ query: SIMPLE_AUTHORS.query }); + let data = await client.execute(SIMPLE_AUTHORS); expect(data).toEqual(await client.execute(SIMPLE_AUTHORS)); }); @@ -152,7 +155,7 @@ describe("@grafoo/core", () => { }); it("should write queries to the client", async () => { - let data = await executeQuery(POSTS_AND_AUTHORS); + let data = await client.execute(POSTS_AND_AUTHORS); client.write(POSTS_AND_AUTHORS, data); @@ -170,19 +173,19 @@ describe("@grafoo/core", () => { }); it("should write queries partially to the client", async () => { - let { data } = await executeQuery(POSTS); + let data = await client.execute(POSTS); - expect(() => client.write(POSTS_AND_AUTHORS, data)).not.toThrow(); + expect(() => client.write(POSTS_AND_AUTHORS, data as any)).not.toThrow(); expect(() => client.read(POSTS)).not.toThrow(); expect(() => client.read(AUTHORS)).not.toThrow(); }); it("should read queries from the client", async () => { - let { data } = await executeQuery(AUTHORS); + let { data } = await client.execute(AUTHORS); client.write(AUTHORS, data); - let result = client.read(AUTHORS); + let result = client.read(AUTHORS); let { authors } = data; @@ -195,45 +198,45 @@ describe("@grafoo/core", () => { it("should handle queries with variables", async () => { let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; - let { data } = await executeQuery({ query: POST.query, variables }); + let { data } = await client.execute(POST, variables); client.write(POST, variables, data); expect(client.read(POST, { postId: "123" })).toEqual({}); - expect(client.read(POST, variables).data.post.id).toBe(variables.postId); + expect(client.read(POST, variables).data.post.id).toBe(variables.postId); }); it("should distinguish between calls to the same query with different variables", async () => { let v1 = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; let v2 = { postId: "77c483dd-6529-4c72-9bb6-bbfd69f65682" }; - let { data: d1 } = await executeQuery({ query: POST.query, variables: v1 }); + let { data: d1 } = await client.execute(POST, v1); client.write(POST, v1, d1); expect(client.read(POST, { postId: "not found" })).toEqual({}); - expect(client.read(POST, v1).data.post.id).toBe(v1.postId); + expect(client.read(POST, v1).data.post.id).toBe(v1.postId); - let d2 = await executeQuery({ query: POST.query, variables: v2 }); + let d2 = await client.execute(POST, v2); client.write(POST, v2, d2); - expect(client.read(POST, v1).data.post.id).toBe(v1.postId); - expect(client.read(POST, v2).data.post.id).toBe(v2.postId); + expect(client.read(POST, v1).data.post.id).toBe(v1.postId); + expect(client.read(POST, v2).data.post.id).toBe(v2.postId); }); it("should flag if a query result is partial", async () => { - let { data } = await executeQuery({ query: POSTS.query }); + let { data } = await client.execute(POSTS); client.write(POSTS, data); - expect(client.read(POSTS_AND_AUTHORS).partial).toBe(true); + expect(client.read(POSTS_AND_AUTHORS).partial).toBe(true); }); it("should remove unused objects from objectsMap", async () => { - let { data } = await executeQuery(SIMPLE_AUTHORS); + let { data } = await client.execute(SIMPLE_AUTHORS); client.write(SIMPLE_AUTHORS, data); - let authorToBeRemoved: Author = data.authors[0]; + let authorToBeRemoved = data.authors[0]; let ids = Object.keys(client.flush().objectsMap); @@ -251,46 +254,46 @@ describe("@grafoo/core", () => { it("should perform update to client", async () => { let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; - let { data } = await executeQuery({ query: POST.query, variables }); + let { data } = await client.execute(POST, variables); client.write(POST, variables, data); let { data: { post } - } = client.read(POST, variables); + } = client.read(POST, variables); expect(post.title).toBe("Quam odit"); client.write(POST, variables, { post: { ...post, title: "updated title" } }); - expect(client.read(POST, variables).data.post.title).toBe("updated title"); + expect(client.read(POST, variables).data.post.title).toBe("updated title"); }); it("should reflect updates on queries with shared objects", async () => { let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; - let postData = (await executeQuery({ query: POST.query, variables })).data; - let postsData = (await executeQuery({ query: POSTS.query, variables })).data; + let { data: postData } = await client.execute(POST, variables); + let { data: postsData } = await client.execute(POSTS, variables); client.write(POSTS, postsData); - let { posts } = client.read(POSTS).data; + let { posts } = client.read(POSTS).data; expect(posts.find((p) => p.id === variables.postId).title).toBe("Quam odit"); client.write(POST, variables, { post: { ...postData.post, title: "updated title" } }); - let { posts: updatedPosts } = client.read(POSTS, variables).data; + let { posts: updatedPosts } = client.read(POSTS, variables).data; expect(updatedPosts.find((p) => p.id === variables.postId).title).toBe("updated title"); }); it("should merge objects in the client when removing or adding properties", async () => { let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; - let data = (await executeQuery({ query: POST.query, variables })).data; + let { data } = await client.execute(POST, variables); client.write(POST, variables, data); - let post = JSON.parse(JSON.stringify(client.read(POST, variables).data.post)); + let post = JSON.parse(JSON.stringify(client.read(POST, variables).data.post)); delete post.__typename; @@ -298,7 +301,7 @@ describe("@grafoo/core", () => { client.write(POST, variables, { post }); - expect(client.read(POST, variables).data.post).toEqual({ + expect(client.read(POST, variables).data.post).toEqual({ __typename: "Post", author: { __typename: "Author", @@ -314,7 +317,7 @@ describe("@grafoo/core", () => { it("should call client listeners on write with paths objects as arguments", async () => { let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; - let data = (await executeQuery({ query: POST.query, variables })).data; + let { data } = await client.execute(POST, variables); let listener = jest.fn(); let listener2 = jest.fn(); @@ -339,9 +342,9 @@ describe("@grafoo/core", () => { }); it("should be able read from the client with a declared initialState", async () => { - let { data } = await executeQuery(POSTS_AND_AUTHORS); + let { data } = await client.execute(POSTS_AND_AUTHORS); - client.write(POSTS_AND_AUTHORS, data); + client.write(POSTS_AND_AUTHORS, data as any); client = createClient(mockTransport, { idFields: ["id"], initialState: client.flush() }); @@ -350,7 +353,7 @@ describe("@grafoo/core", () => { it("should allow cache to be cleared using reset()", () => { let data = { authors: [{ name: "deleteme" }] }; - client.write(SIMPLE_AUTHORS, data); + client.write(SIMPLE_AUTHORS, data as any); expect(client.read(SIMPLE_AUTHORS).data).toEqual(data); client.reset(); expect(client.read(SIMPLE_AUTHORS).data).toEqual(undefined); @@ -361,11 +364,10 @@ describe("@grafoo/core", () => { }); it("should accept `idFields` array in options", async () => { - let { data } = await executeQuery(AUTHORS); - let client = createClient(mockTransport, { idFields: ["__typename", "id"] }); + let { data } = await client.execute(AUTHORS); - client.write(AUTHORS, data); + client.write(AUTHORS, data as any); let cachedIds = Object.keys(client.flush().objectsMap); diff --git a/packages/core/src/build-query-tree.ts b/packages/core/src/build-query-tree.ts index 8222ef4a..c9f054a3 100644 --- a/packages/core/src/build-query-tree.ts +++ b/packages/core/src/build-query-tree.ts @@ -1,7 +1,11 @@ -import { ObjectsMap } from "@grafoo/types"; +import { GrafooObjectsMap } from "."; import { idFromProps, isNotNullObject } from "./util"; -export default function buildQueryTree(tree: T, objects: ObjectsMap, idFields: string[]): T { +export default function buildQueryTree( + tree: T, + objects: GrafooObjectsMap, + idFields: string[] +): T { // clone resulting query tree let queryTree = tree; let stack = []; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index c1da1292..9ccadf0b 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,31 +1,113 @@ -import { - GrafooClient, - GrafooClientOptions, - GrafooObject, - Listener, - ObjectsMap, - Variables, - GrafooTransport -} from "@grafoo/types"; import buildQueryTree from "./build-query-tree"; import mapObjects from "./map-objects"; import { getPathId } from "./util"; +export type GraphQlError = { + message: string; + locations: { line: number; column: number }[]; + path: string[]; +}; + +/** + * T = QueryData + */ +export type GraphQlPayload = { + data: T; + errors?: GraphQlError[]; +}; + +/** + * T = QueryData + */ +export type GrafooTransport = ( + query: string, + variables?: unknown, + id?: string +) => Promise>; + +export type GrafooObjectsMap = { + [key: string]: Record; +}; + +export type GrafooPathsMap = { + [key: string]: { + data: { [key: string]: unknown }; + objects: string[]; + partial?: boolean; + }; +}; + +export type GrafooListener = (objects: GrafooObjectsMap) => void; + +export type GrafooInitialState = { + objectsMap: GrafooObjectsMap; + pathsMap: GrafooPathsMap; +}; + +export type GrafooObject = { + frags?: { + [key: string]: string; + }; + paths: { + [key: string]: { + name: string; + args: string[]; + }; + }; + query: string; + id?: string; + _queryType: T; + _variablesType: U; +}; + +export type GrafooClient = { + execute: ( + grafooObject: T, + variables?: T["_variablesType"] + ) => Promise>; + listen: (listener: GrafooListener) => () => void; + write: { + ( + grafooObject: T, + variables: T["_variablesType"], + data: T["_queryType"] | { data: T["_queryType"] } + ): void; + ( + grafooObject: T, + data: T["_queryType"] | { data: T["_queryType"] } + ): void; + }; + read: ( + grafooObject: T, + variables?: T["_variablesType"] + ) => { data?: T["_queryType"]; objects?: GrafooObjectsMap; partial?: boolean }; + flush: () => GrafooInitialState; + reset: () => void; +}; + +export type GrafooClientOptions = { + initialState?: GrafooInitialState; + idFields?: Array; +}; + export default function createClient( transport: GrafooTransport, options?: GrafooClientOptions ): GrafooClient { let { initialState, idFields } = options; let { pathsMap, objectsMap } = initialState || { pathsMap: {}, objectsMap: {} }; - let listeners: Listener[] = []; + let listeners: GrafooListener[] = []; - function execute({ query, frags, id }: GrafooObject, variables?: Variables) { + function execute( + { query, frags, id }: T, + variables?: T["_variablesType"] + ) { if (frags) for (let frag in frags) query += frags[frag]; return transport(query, variables, id); } - function listen(listener: Listener) { + function listen(listener: GrafooListener) { listeners.push(listener); return () => { @@ -37,13 +119,17 @@ export default function createClient( }; } - function write({ paths }: GrafooObject, variables: Variables, data?: T | { data: T }) { + function write( + { paths }: T, + variables: T["_variablesType"], + data?: T["_queryType"] | { data: T["_queryType"] } + ) { if (!data) { data = variables as typeof data; variables = undefined; } - let objects: ObjectsMap = {}; + let objects: GrafooObjectsMap = {}; for (let i in paths) { let { name, args } = paths[i]; @@ -75,13 +161,12 @@ export default function createClient( for (let i in listeners) listeners[i](objects); } - function read( - { paths }: GrafooObject, - variables?: Variables - ): { data?: T; objects?: ObjectsMap; partial?: boolean } { - // @ts-ignore - let data: T = {}; - let objects: ObjectsMap = {}; + function read( + { paths }: T, + variables?: T["_variablesType"] + ): { data?: T["_queryType"]; objects?: GrafooObjectsMap; partial?: boolean } { + let data: T["_queryType"] = {}; + let objects: GrafooObjectsMap = {}; let partial = false; for (let i in paths) { diff --git a/packages/core/src/map-objects.ts b/packages/core/src/map-objects.ts index a8df7d8d..56dd1d05 100644 --- a/packages/core/src/map-objects.ts +++ b/packages/core/src/map-objects.ts @@ -1,7 +1,7 @@ -import { ObjectsMap } from "@grafoo/types"; +import { GrafooObjectsMap } from "."; import { isNotNullObject, idFromProps } from "./util"; -export default function mapObjects(tree: T, idFields: string[]): ObjectsMap { +export default function mapObjects(tree: T, idFields: string[]): GrafooObjectsMap { // map in which objects will be stored // having their extracted ids from props as key let map = {}; diff --git a/packages/core/src/util.ts b/packages/core/src/util.ts index 47f763ec..d0b3f8bf 100644 --- a/packages/core/src/util.ts +++ b/packages/core/src/util.ts @@ -1,5 +1,3 @@ -import { Variables } from "@grafoo/types"; - export let idFromProps = (branch: { [key: string]: string }, idFields: string | any[]): string => { branch = branch || {}; let identifier = ""; @@ -13,7 +11,7 @@ export let idFromProps = (branch: { [key: string]: string }, idFields: string | export let isNotNullObject = (obj: any): boolean => obj && typeof obj == "object"; -export let getPathId = (path: string, args: string[], variables?: Variables): string => { +export let getPathId = (path: string, args: string[], variables?: unknown): string => { variables = variables || {}; let finalPath = path; let i = args.length; diff --git a/packages/core/tag.d.ts b/packages/core/tag.d.ts index 11234c48..66cd1315 100644 --- a/packages/core/tag.d.ts +++ b/packages/core/tag.d.ts @@ -1,5 +1,7 @@ declare module "@grafoo/core/tag" { - import { GrafooObject } from "@grafoo/types"; + import { GrafooObject } from "@grafoo/core"; - export default function graphql(strs: TemplateStringsArray): GrafooObject; + export default function graphql( + strs: TemplateStringsArray + ): GrafooObject; } diff --git a/packages/http-transport/__tests__/index.ts b/packages/http-transport/__tests__/index.ts index 3aba89e9..93c043c4 100644 --- a/packages/http-transport/__tests__/index.ts +++ b/packages/http-transport/__tests__/index.ts @@ -1,6 +1,4 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ - -import { GrafooTransport } from "@grafoo/types"; +import { GrafooTransport } from "@grafoo/core"; import createTransport from "../src"; jest.mock("node-fetch", () => require("fetch-mock").sandbox()); diff --git a/packages/http-transport/src/index.ts b/packages/http-transport/src/index.ts index 28d5d4ff..2543425d 100644 --- a/packages/http-transport/src/index.ts +++ b/packages/http-transport/src/index.ts @@ -1,10 +1,7 @@ -import { GraphQlPayload, GrafooTransport, Variables } from "@grafoo/types"; +import { GraphQlPayload } from "@grafoo/core"; -export default function createTransport( - url: string, - options?: RequestInit | (() => RequestInit) -): GrafooTransport { - return (query: string, variables?: Variables): Promise> => { +export default function createTransport(url: string, options?: RequestInit | (() => RequestInit)) { + return (query: string, variables?: unknown): Promise> => { options = typeof options == "function" ? options() : options || {}; return fetch( @@ -12,7 +9,7 @@ export default function createTransport( Object.assign(options, { body: JSON.stringify({ query, variables }), method: "POST", - headers: Object.assign({ "Content-Type": "application/json" }, options.headers), + headers: Object.assign({ "Content-Type": "application/json" }, options.headers) }) ).then((response) => response.json()); }; diff --git a/packages/react/package.json b/packages/react/package.json index 37705e30..6457a556 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -41,5 +41,11 @@ "@grafoo/bindings": "^1.4.1", "@grafoo/types": "^1.4.1" }, - "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" + "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974", + "devDependencies": { + "@types/node": "^16.10.2", + "@types/react": "^17.0.26", + "@typescript-eslint/parser": "^4.32.0", + "jest": "^27.2.4" + } } diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 814227ca..c03ec888 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -1,11 +1,4 @@ import createBindings from "@grafoo/bindings"; -import { - Context, - GrafooConsumerProps, - GrafooBoundState, - GrafooBoundMutations, - GrafooClient -} from "@grafoo/types"; import { Component, createContext, createElement, ReactElement, ReactNode, FC } from "react"; /** @@ -43,7 +36,7 @@ class GrafooConsumer extends Component> { constructor(props: GrafooReactConsumerProps) { super(props); - let bindings = createBindings(props.client, props, () => { + let bindings = createBindings(props.client, props, () => { this.setState(bindings.getState()); }); diff --git a/packages/test-utils/src/mock-server.ts b/packages/test-utils/src/mock-server.ts index 5cb2a9ca..870cd034 100644 --- a/packages/test-utils/src/mock-server.ts +++ b/packages/test-utils/src/mock-server.ts @@ -1,4 +1,4 @@ -import { GraphQlPayload } from "@grafoo/types"; +import { GraphQlPayload } from "@grafoo/core"; import fetchMock from "fetch-mock"; import fs from "fs"; import { graphql } from "graphql"; diff --git a/packages/types/index.d.ts b/packages/types/index.d.ts index d219f671..0bcf0666 100644 --- a/packages/types/index.d.ts +++ b/packages/types/index.d.ts @@ -2,156 +2,6 @@ * GrafooTransport */ -export interface GraphQlError { - message: string; - locations: { line: number; column: number }[]; - path: string[]; -} - -/** - * T = QueryData - */ -export interface GraphQlPayload { - data: T; - errors?: GraphQlError[]; -} - -export interface Variables { - [key: string]: unknown; -} - -/** - * T = QueryData - */ -export type GrafooTransport = ( - query: string, - variables?: Variables, - id?: string -) => Promise>; - /** * Core */ - -export interface ObjectsMap { - [key: string]: Record; -} - -export interface PathsMap { - [key: string]: { - data: { [key: string]: unknown }; - objects: string[]; - partial?: boolean; - }; -} - -export type Listener = (objects: ObjectsMap) => void; - -export interface InitialState { - objectsMap: ObjectsMap; - pathsMap: PathsMap; -} - -export interface GrafooClient { - execute: (grafooObject: GrafooObject, variables?: Variables) => Promise>; - listen: (listener: Listener) => () => void; - write: { - (grafooObject: GrafooObject, variables: Variables, data: T | { data: T }): void; - (grafooObject: GrafooObject, data: T | { data: T }): void; - }; - read: ( - grafooObject: GrafooObject, - variables?: Variables - ) => { data?: T; objects?: ObjectsMap; partial?: boolean }; - flush: () => InitialState; - reset: () => void; -} - -export interface GrafooClientOptions { - initialState?: InitialState; - idFields?: Array; -} - -export interface GrafooObject { - frags?: { - [key: string]: string; - }; - paths: { - [key: string]: { - name: string; - args: string[]; - }; - }; - query: string; - id?: string; -} - -/** - * Bindings - */ - -/** - * T = Query - * U = Mutations - */ -export interface GrafooBindings { - getState(): GrafooBoundState & T & GrafooBoundMutations; - unbind(): void; - load(variables?: Variables): void; -} - -export interface GrafooBoundState { - client: GrafooClient; - errors?: GraphQlError[]; - load?: (variables?: Variables) => void; - loaded?: boolean; - loading?: boolean; -} - -/** - * T = Query - * U = Mutations - */ -export type UpdateFn = (props: T, data?: U) => T; - -/** - * T = Query - */ -export type OptimisticUpdateFn = (props: T, variables?: Variables) => T; - -/** - * T = Query - * U = Mutations - * V = keyof Mutation - */ -export type GrafooMutations = { - [V in keyof U]: { - query: GrafooObject; - optimisticUpdate?: OptimisticUpdateFn; - update?: UpdateFn; - }; -}; - -export interface Context { - client: GrafooClient; -} - -/** - * T = Mutations - * U = keyof Mutations - */ -export type GrafooBoundMutations = { - [U in keyof T]: (variables?: Variables) => Promise>; -}; - -/** - * T = Query - * U = Mutations - */ -export interface GrafooConsumerProps { - client: GrafooClient; - query?: GrafooObject; - variables?: Variables; - mutations?: GrafooMutations; - skip?: boolean; -} diff --git a/yarn.lock b/yarn.lock index 03aa457e..69dc55a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1090,6 +1090,18 @@ jest-util "^27.2.0" slash "^3.0.0" +"@jest/console@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.2.4.tgz#2f1a4bf82b9940065d4818fac271def99ec55e5e" + integrity sha512-94znCKynPZpDpYHQ6esRJSc11AmONrVkBOBZiD7S+bSubHhrUfbS95EY5HIOxhm4PQO7cnvZkL3oJcY0oMA+Wg== + dependencies: + "@jest/types" "^27.2.4" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^27.2.4" + jest-util "^27.2.4" + slash "^3.0.0" + "@jest/core@^27.2.2": version "27.2.2" resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.2.tgz#9eea16101b2f04bf799dcdbdf1792d4ef7553ecf" @@ -1125,6 +1137,40 @@ slash "^3.0.0" strip-ansi "^6.0.0" +"@jest/core@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.4.tgz#0b932da787d64848eab720dbb88e5b7a3f86e539" + integrity sha512-UNQLyy+rXoojNm2MGlapgzWhZD1CT1zcHZQYeiD0xE7MtJfC19Q6J5D/Lm2l7i4V97T30usKDoEtjI8vKwWcLg== + dependencies: + "@jest/console" "^27.2.4" + "@jest/reporters" "^27.2.4" + "@jest/test-result" "^27.2.4" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + emittery "^0.8.1" + exit "^0.1.2" + graceful-fs "^4.2.4" + jest-changed-files "^27.2.4" + jest-config "^27.2.4" + jest-haste-map "^27.2.4" + jest-message-util "^27.2.4" + jest-regex-util "^27.0.6" + jest-resolve "^27.2.4" + jest-resolve-dependencies "^27.2.4" + jest-runner "^27.2.4" + jest-runtime "^27.2.4" + jest-snapshot "^27.2.4" + jest-util "^27.2.4" + jest-validate "^27.2.4" + jest-watcher "^27.2.4" + micromatch "^4.0.4" + rimraf "^3.0.0" + slash "^3.0.0" + strip-ansi "^6.0.0" + "@jest/environment@^27.2.2": version "27.2.2" resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.2.tgz#2e57b9d2cc01028b0e35fae5833c1c63df4c5e41" @@ -1135,6 +1181,16 @@ "@types/node" "*" jest-mock "^27.1.1" +"@jest/environment@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.4.tgz#db3e60f7dd30ab950f6ce2d6d7293ed9a6b7cbcd" + integrity sha512-wkuui5yr3SSQW0XD0Qm3TATUbL/WE3LDEM3ulC+RCQhMf2yxhci8x7svGkZ4ivJ6Pc94oOzpZ6cdHBAMSYd1ew== + dependencies: + "@jest/fake-timers" "^27.2.4" + "@jest/types" "^27.2.4" + "@types/node" "*" + jest-mock "^27.2.4" + "@jest/fake-timers@^27.2.2": version "27.2.2" resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.2.tgz#43e6f191c95ae74e95d0ddba2ecb8470b4a288b7" @@ -1147,6 +1203,18 @@ jest-mock "^27.1.1" jest-util "^27.2.0" +"@jest/fake-timers@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.4.tgz#00df08bd60332bd59503cb5b6db21e4903785f86" + integrity sha512-cs/TzvwWUM7kAA6Qm/890SK6JJ2pD5RfDNM3SSEom6BmdyV6OiWP1qf/pqo6ts6xwpcM36oN0wSEzcZWc6/B6w== + dependencies: + "@jest/types" "^27.2.4" + "@sinonjs/fake-timers" "^8.0.1" + "@types/node" "*" + jest-message-util "^27.2.4" + jest-mock "^27.2.4" + jest-util "^27.2.4" + "@jest/globals@^27.2.2": version "27.2.2" resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.2.tgz#df66aaafda5c69b2bb0dae548e3cfb345f549c31" @@ -1156,6 +1224,15 @@ "@jest/types" "^27.1.1" expect "^27.2.2" +"@jest/globals@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.4.tgz#0aeb22b011f8c8c4b8ff3b4dbd1ee0392fe0dd8a" + integrity sha512-DRsRs5dh0i+fA9mGHylTU19+8fhzNJoEzrgsu+zgJoZth3x8/0juCQ8nVVdW1er4Cqifb/ET7/hACYVPD0dBEA== + dependencies: + "@jest/environment" "^27.2.4" + "@jest/types" "^27.2.4" + expect "^27.2.4" + "@jest/reporters@^27.2.2": version "27.2.2" resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.2.tgz#e2d41cd9f8088676b81b9a9908cb1ba67bdbee78" @@ -1186,6 +1263,36 @@ terminal-link "^2.0.0" v8-to-istanbul "^8.0.0" +"@jest/reporters@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.4.tgz#1482ff007f2e919d85c54b1563abb8b2ea2d5198" + integrity sha512-LHeSdDnDZkDnJ8kvnjcqV8P1Yv/32yL4d4XfR5gBiy3xGO0onwll1QEbvtW96fIwhx2nejug0GTaEdNDoyr3fQ== + dependencies: + "@bcoe/v8-coverage" "^0.2.3" + "@jest/console" "^27.2.4" + "@jest/test-result" "^27.2.4" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" + chalk "^4.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.2" + graceful-fs "^4.2.4" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-instrument "^4.0.3" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.0.2" + jest-haste-map "^27.2.4" + jest-resolve "^27.2.4" + jest-util "^27.2.4" + jest-worker "^27.2.4" + slash "^3.0.0" + source-map "^0.6.0" + string-length "^4.0.1" + terminal-link "^2.0.0" + v8-to-istanbul "^8.1.0" + "@jest/source-map@^27.0.6": version "27.0.6" resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.0.6.tgz#be9e9b93565d49b0548b86e232092491fb60551f" @@ -1205,6 +1312,16 @@ "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" +"@jest/test-result@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.4.tgz#d1ca8298d168f1b0be834bfb543b1ac0294c05d7" + integrity sha512-eU+PRo0+lIS01b0dTmMdVZ0TtcRSxEaYquZTRFMQz6CvsehGhx9bRzi9Zdw6VROviJyv7rstU+qAMX5pNBmnfQ== + dependencies: + "@jest/console" "^27.2.4" + "@jest/types" "^27.2.4" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + "@jest/test-sequencer@^27.2.2": version "27.2.2" resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.2.tgz#9a6d735317f525741a5913ee3cdefeffc9b0aba6" @@ -1215,6 +1332,16 @@ jest-haste-map "^27.2.2" jest-runtime "^27.2.2" +"@jest/test-sequencer@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.4.tgz#df66422a3e9e7440ce8b7498e255fa6b52c0bc03" + integrity sha512-fpk5eknU3/DXE2QCCG1wv/a468+cfPo3Asu6d6yUtM9LOPh709ubZqrhuUOYfM8hXMrIpIdrv1CdCrWWabX0rQ== + dependencies: + "@jest/test-result" "^27.2.4" + graceful-fs "^4.2.4" + jest-haste-map "^27.2.4" + jest-runtime "^27.2.4" + "@jest/transform@^27.2.2": version "27.2.2" resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.2.tgz#89b16b4de84354fb48d15712b3ea34cadc1cb600" @@ -1236,6 +1363,27 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" +"@jest/transform@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.4.tgz#2fe5b6836895f7a1b8bdec442c51e83943c62733" + integrity sha512-n5FlX2TH0oQGwyVDKPxdJ5nI2sO7TJBFe3u3KaAtt7TOiV4yL+Y+rSFDl+Ic5MpbiA/eqXmLAQxjnBmWgS2rEA== + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^27.2.4" + babel-plugin-istanbul "^6.0.0" + chalk "^4.0.0" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.2.4" + jest-haste-map "^27.2.4" + jest-regex-util "^27.0.6" + jest-util "^27.2.4" + micromatch "^4.0.4" + pirates "^4.0.1" + slash "^3.0.0" + source-map "^0.6.1" + write-file-atomic "^3.0.0" + "@jest/types@^27.1.1": version "27.1.1" resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.1.1.tgz#77a3fc014f906c65752d12123a0134359707c0ad" @@ -1247,6 +1395,17 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" +"@jest/types@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.4.tgz#2430042a66e00dc5b140c3636f4474d464c21ee8" + integrity sha512-IDO2ezTxeMvQAHxzG/ZvEyA47q0aVfzT95rGFl7bZs/Go0aIucvfDbS2rmnoEdXxlLQhcolmoG/wvL/uKx4tKA== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^16.0.0" + chalk "^4.0.0" + "@lerna/add@4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@lerna/add/-/add-4.0.0.tgz#c36f57d132502a57b9e7058d1548b7a565ef183f" @@ -2137,6 +2296,13 @@ dependencies: "@sinonjs/commons" "^1.7.0" +"@sinonjs/fake-timers@^8.0.1": + version "8.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.0.1.tgz#1c1c9a91419f804e59ae8df316a07dd1c3a76b94" + integrity sha512-AU7kwFxreVd6OAXcAFlKSmZquiRUU0FvYm44k1Y1QbK7Co4m0aqfGMhjykIeQp/H6rcl+nFmj0zfdUcGVs9Dew== + dependencies: + "@sinonjs/commons" "^1.7.0" + "@tootallnate/once@1": version "1.1.2" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" @@ -2232,6 +2398,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.1.tgz#f3647623199ca920960006b3dccf633ea905f243" integrity sha512-4/Z9DMPKFexZj/Gn3LylFgamNKHm4K3QDi0gz9B26Uk0c8izYf97B5fxfpspMNkWlFupblKM/nV8+NA9Ffvr+w== +"@types/node@^16.10.2": + version "16.10.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.2.tgz#5764ca9aa94470adb4e1185fe2e9f19458992b2e" + integrity sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ== + "@types/normalize-package-data@^2.4.0": version "2.4.1" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" @@ -2268,6 +2439,15 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/react@^17.0.26": + version "17.0.26" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.26.tgz#960ea4b3518cc154ed7df3b35656c508df653331" + integrity sha512-MXxuXrH2xOcv5cp/su4oz69dNQnSA90JjFw5HBd5wifw6Ihi94j7dRJm7qNsB30tnruXSCPc9qmlhGop4nh9Hw== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + "@types/resolve@0.0.8": version "0.0.8" resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" @@ -2309,6 +2489,16 @@ dependencies: "@types/yargs-parser" "*" +"@typescript-eslint/parser@^4.32.0": + version "4.32.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.32.0.tgz#751ecca0e2fecd3d44484a9b3049ffc1871616e5" + integrity sha512-lhtYqQ2iEPV5JqV7K+uOVlPePjClj4dOw7K4/Z1F2yvjIUvyr13yJnDzkK6uon4BjHYuHy3EG0c2Z9jEhFk56w== + dependencies: + "@typescript-eslint/scope-manager" "4.32.0" + "@typescript-eslint/types" "4.32.0" + "@typescript-eslint/typescript-estree" "4.32.0" + debug "^4.3.1" + "@typescript-eslint/parser@^4.9.1": version "4.31.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.31.2.tgz#54aa75986e3302d91eff2bbbaa6ecfa8084e9c34" @@ -2327,11 +2517,24 @@ "@typescript-eslint/types" "4.31.2" "@typescript-eslint/visitor-keys" "4.31.2" +"@typescript-eslint/scope-manager@4.32.0": + version "4.32.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.32.0.tgz#e03c8668f8b954072b3f944d5b799c0c9225a7d5" + integrity sha512-DK+fMSHdM216C0OM/KR1lHXjP1CNtVIhJ54kQxfOE6x8UGFAjha8cXgDMBEIYS2XCYjjCtvTkjQYwL3uvGOo0w== + dependencies: + "@typescript-eslint/types" "4.32.0" + "@typescript-eslint/visitor-keys" "4.32.0" + "@typescript-eslint/types@4.31.2": version "4.31.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.31.2.tgz#2aea7177d6d744521a168ed4668eddbd912dfadf" integrity sha512-kWiTTBCTKEdBGrZKwFvOlGNcAsKGJSBc8xLvSjSppFO88AqGxGNYtF36EuEYG6XZ9vT0xX8RNiHbQUKglbSi1w== +"@typescript-eslint/types@4.32.0": + version "4.32.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.32.0.tgz#52c633c18da47aee09449144bf59565ab36df00d" + integrity sha512-LE7Z7BAv0E2UvqzogssGf1x7GPpUalgG07nGCBYb1oK4mFsOiFC/VrSMKbZQzFJdN2JL5XYmsx7C7FX9p9ns0w== + "@typescript-eslint/typescript-estree@4.31.2": version "4.31.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.2.tgz#abfd50594d8056b37e7428df3b2d185ef2d0060c" @@ -2345,6 +2548,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@4.32.0": + version "4.32.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.32.0.tgz#db00ccc41ccedc8d7367ea3f50c6994b8efa9f3b" + integrity sha512-tRYCgJ3g1UjMw1cGG8Yn1KzOzNlQ6u1h9AmEtPhb5V5a1TmiHWcRyF/Ic+91M4f43QeChyYlVTcf3DvDTZR9vw== + dependencies: + "@typescript-eslint/types" "4.32.0" + "@typescript-eslint/visitor-keys" "4.32.0" + debug "^4.3.1" + globby "^11.0.3" + is-glob "^4.0.1" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@4.31.2": version "4.31.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.2.tgz#7d5b4a4705db7fe59ecffb273c1d082760f635cc" @@ -2353,6 +2569,14 @@ "@typescript-eslint/types" "4.31.2" eslint-visitor-keys "^2.0.0" +"@typescript-eslint/visitor-keys@4.32.0": + version "4.32.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.32.0.tgz#455ba8b51242f2722a497ffae29313f33b14cb7f" + integrity sha512-e7NE0qz8W+atzv3Cy9qaQ7BTLwWsm084Z0c4nIO2l3Bp6u9WIgdqCgyPyV5oSPDMIW3b20H59OOCmVk3jw3Ptw== + dependencies: + "@typescript-eslint/types" "4.32.0" + eslint-visitor-keys "^2.0.0" + JSONStream@^1.0.4: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -2635,6 +2859,20 @@ babel-jest@^27.2.2: graceful-fs "^4.2.4" slash "^3.0.0" +babel-jest@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.4.tgz#21ed6729d51bdd75470bbbf3c8b08d86209fb0dc" + integrity sha512-f24OmxyWymk5jfgLdlCMu4fTs4ldxFBIdn5sJdhvGC1m08rSkJ5hYbWkNmfBSvE/DjhCVNSHXepxsI6THGfGsg== + dependencies: + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" + "@types/babel__core" "^7.1.14" + babel-plugin-istanbul "^6.0.0" + babel-preset-jest "^27.2.0" + chalk "^4.0.0" + graceful-fs "^4.2.4" + slash "^3.0.0" + babel-literal-to-ast@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/babel-literal-to-ast/-/babel-literal-to-ast-2.1.0.tgz#c8b12f9c36a8cee13572d65aabf6cff8adb1e8b3" @@ -3842,6 +4080,18 @@ expect@^27.2.2: jest-message-util "^27.2.2" jest-regex-util "^27.0.6" +expect@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.4.tgz#4debf546050bcdad8914a8c95fec7662e02bf67c" + integrity sha512-gOtuonQ8TCnbNNCSw2fhVzRf8EFYDII4nB5NmG4IEV0rbUnW1I5zXvoTntU4iicB/Uh0oZr20NGlOLdJiwsOZA== + dependencies: + "@jest/types" "^27.2.4" + ansi-styles "^5.0.0" + jest-get-type "^27.0.6" + jest-matcher-utils "^27.2.4" + jest-message-util "^27.2.4" + jest-regex-util "^27.0.6" + extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -4856,6 +5106,15 @@ jest-changed-files@^27.1.1: execa "^5.0.0" throat "^6.0.1" +jest-changed-files@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.2.4.tgz#d7de46e90e5a599c47e260760f5ab53516e835e6" + integrity sha512-eeO1C1u4ex7pdTroYXezr+rbr957myyVoKGjcY4R1TJi3A+9v+4fu1Iv9J4eLq1bgFyT3O3iRWU9lZsEE7J72Q== + dependencies: + "@jest/types" "^27.2.4" + execa "^5.0.0" + throat "^6.0.1" + jest-circus@^27.2.2: version "27.2.2" resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.2.tgz#a3647082f3eba1226f7664a36a2b7ebf45ceaf7b" @@ -4881,6 +5140,31 @@ jest-circus@^27.2.2: stack-utils "^2.0.3" throat "^6.0.1" +jest-circus@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.4.tgz#3bd898a29dcaf6a506f3f1b780dff5f67ca83c23" + integrity sha512-TtheheTElrGjlsY9VxkzUU1qwIx05ItIusMVKnvNkMt4o/PeegLRcjq3Db2Jz0GGdBalJdbzLZBgeulZAJxJWA== + dependencies: + "@jest/environment" "^27.2.4" + "@jest/test-result" "^27.2.4" + "@jest/types" "^27.2.4" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + dedent "^0.7.0" + expect "^27.2.4" + is-generator-fn "^2.0.0" + jest-each "^27.2.4" + jest-matcher-utils "^27.2.4" + jest-message-util "^27.2.4" + jest-runtime "^27.2.4" + jest-snapshot "^27.2.4" + jest-util "^27.2.4" + pretty-format "^27.2.4" + slash "^3.0.0" + stack-utils "^2.0.3" + throat "^6.0.1" + jest-cli@^27.2.2: version "27.2.2" resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.2.tgz#0973a717c109f23de642b63486f3cb71c5a971be" @@ -4899,6 +5183,24 @@ jest-cli@^27.2.2: prompts "^2.0.1" yargs "^16.0.3" +jest-cli@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.4.tgz#acda7f367aa6e674723fc1a7334e0ae1799448d2" + integrity sha512-4kpQQkg74HYLaXo3nzwtg4PYxSLgL7puz1LXHj5Tu85KmlIpxQFjRkXlx4V47CYFFIDoyl3rHA/cXOxUWyMpNg== + dependencies: + "@jest/core" "^27.2.4" + "@jest/test-result" "^27.2.4" + "@jest/types" "^27.2.4" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.4" + import-local "^3.0.2" + jest-config "^27.2.4" + jest-util "^27.2.4" + jest-validate "^27.2.4" + prompts "^2.0.1" + yargs "^16.2.0" + jest-config@^27.2.2: version "27.2.2" resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.2.tgz#970d8466c60ac106ac9d7d0b8dcf3ff150fa713a" @@ -4926,6 +5228,33 @@ jest-config@^27.2.2: micromatch "^4.0.4" pretty-format "^27.2.2" +jest-config@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.4.tgz#0204969f5ae2e5190d47be2c14c04d631b7836e2" + integrity sha512-tWy0UxhdzqiKyp4l5Vq4HxLyD+gH5td+GCF3c22/DJ0bYAOsMo+qi2XtbJI6oYMH5JOJQs9nLW/r34nvFCehjA== + dependencies: + "@babel/core" "^7.1.0" + "@jest/test-sequencer" "^27.2.4" + "@jest/types" "^27.2.4" + babel-jest "^27.2.4" + chalk "^4.0.0" + deepmerge "^4.2.2" + glob "^7.1.1" + graceful-fs "^4.2.4" + is-ci "^3.0.0" + jest-circus "^27.2.4" + jest-environment-jsdom "^27.2.4" + jest-environment-node "^27.2.4" + jest-get-type "^27.0.6" + jest-jasmine2 "^27.2.4" + jest-regex-util "^27.0.6" + jest-resolve "^27.2.4" + jest-runner "^27.2.4" + jest-util "^27.2.4" + jest-validate "^27.2.4" + micromatch "^4.0.4" + pretty-format "^27.2.4" + jest-diff@^27.0.0, jest-diff@^27.2.2: version "27.2.2" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.2.tgz#3992fe5f55f209676c5d3fd956e3f3d4145f76b8" @@ -4936,6 +5265,16 @@ jest-diff@^27.0.0, jest-diff@^27.2.2: jest-get-type "^27.0.6" pretty-format "^27.2.2" +jest-diff@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.4.tgz#171c51d3d2c105c457100fee6e7bf7cee51c8d8c" + integrity sha512-bLAVlDSCR3gqUPGv+4nzVpEXGsHh98HjUL7Vb2hVyyuBDoQmja8eJb0imUABsuxBeUVmf47taJSAd9nDrwWKEg== + dependencies: + chalk "^4.0.0" + diff-sequences "^27.0.6" + jest-get-type "^27.0.6" + pretty-format "^27.2.4" + jest-docblock@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.0.6.tgz#cc78266acf7fe693ca462cbbda0ea4e639e4e5f3" @@ -4954,6 +5293,17 @@ jest-each@^27.2.2: jest-util "^27.2.0" pretty-format "^27.2.2" +jest-each@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.2.4.tgz#b4f280aafd63129ba82e345f0e74c5a10200aeef" + integrity sha512-w9XVc+0EDBUTJS4xBNJ7N2JCcWItFd006lFjz77OarAQcQ10eFDBMrfDv2GBJMKlXe9aq0HrIIF51AXcZrRJyg== + dependencies: + "@jest/types" "^27.2.4" + chalk "^4.0.0" + jest-get-type "^27.0.6" + jest-util "^27.2.4" + pretty-format "^27.2.4" + jest-environment-jsdom@^27.2.2: version "27.2.2" resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.2.tgz#fb3075b4be6289961dcc4942e98f1862b3a8c4cb" @@ -4967,6 +5317,19 @@ jest-environment-jsdom@^27.2.2: jest-util "^27.2.0" jsdom "^16.6.0" +jest-environment-jsdom@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.4.tgz#39ae80bbb8675306bfaf0440be1e5f877554539a" + integrity sha512-X70pTXFSypD7AIzKT1mLnDi5hP9w9mdTRcOGOmoDoBrNyNEg4rYm6d4LQWFLc9ps1VnMuDOkFSG0wjSNYGjkng== + dependencies: + "@jest/environment" "^27.2.4" + "@jest/fake-timers" "^27.2.4" + "@jest/types" "^27.2.4" + "@types/node" "*" + jest-mock "^27.2.4" + jest-util "^27.2.4" + jsdom "^16.6.0" + jest-environment-node@^27.2.2: version "27.2.2" resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.2.tgz#60ba7d7fee956f68964d47a785d0195ce125aaa3" @@ -4979,6 +5342,18 @@ jest-environment-node@^27.2.2: jest-mock "^27.1.1" jest-util "^27.2.0" +jest-environment-node@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.4.tgz#b79f98cb36e0c9111aac859c9c99f04eb2f74ff6" + integrity sha512-ZbVbFSnbzTvhLOIkqh5lcLuGCCFvtG4xTXIRPK99rV2KzQT3kNg16KZwfTnLNlIiWCE8do960eToeDfcqmpSAw== + dependencies: + "@jest/environment" "^27.2.4" + "@jest/fake-timers" "^27.2.4" + "@jest/types" "^27.2.4" + "@types/node" "*" + jest-mock "^27.2.4" + jest-util "^27.2.4" + jest-get-type@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" @@ -5004,6 +5379,26 @@ jest-haste-map@^27.2.2: optionalDependencies: fsevents "^2.3.2" +jest-haste-map@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.2.4.tgz#f8974807bedf07348ca9fd24e5861ab7c8e61aba" + integrity sha512-bkJ4bT00T2K+1NZXbRcyKnbJ42I6QBvoDNMTAQQDBhaGNnZreiQKUNqax0e6hLTx7E75pKDeltVu3V1HAdu+YA== + dependencies: + "@jest/types" "^27.2.4" + "@types/graceful-fs" "^4.1.2" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.4" + jest-regex-util "^27.0.6" + jest-serializer "^27.0.6" + jest-util "^27.2.4" + jest-worker "^27.2.4" + micromatch "^4.0.4" + walker "^1.0.7" + optionalDependencies: + fsevents "^2.3.2" + jest-jasmine2@^27.2.2: version "27.2.2" resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.2.tgz#bf87c8820a192c86b65a7c4c1a54caae52124f04" @@ -5028,6 +5423,30 @@ jest-jasmine2@^27.2.2: pretty-format "^27.2.2" throat "^6.0.1" +jest-jasmine2@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.4.tgz#4a1608133dbdb4d68b5929bfd785503ed9c9ba51" + integrity sha512-fcffjO/xLWLVnW2ct3No4EksxM5RyPwHDYu9QU+90cC+/eSMLkFAxS55vkqsxexOO5zSsZ3foVpMQcg/amSeIQ== + dependencies: + "@babel/traverse" "^7.1.0" + "@jest/environment" "^27.2.4" + "@jest/source-map" "^27.0.6" + "@jest/test-result" "^27.2.4" + "@jest/types" "^27.2.4" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + expect "^27.2.4" + is-generator-fn "^2.0.0" + jest-each "^27.2.4" + jest-matcher-utils "^27.2.4" + jest-message-util "^27.2.4" + jest-runtime "^27.2.4" + jest-snapshot "^27.2.4" + jest-util "^27.2.4" + pretty-format "^27.2.4" + throat "^6.0.1" + jest-leak-detector@^27.2.2: version "27.2.2" resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.2.tgz#5af54273efcf5114ad406f4448860c2396319e12" @@ -5036,6 +5455,14 @@ jest-leak-detector@^27.2.2: jest-get-type "^27.0.6" pretty-format "^27.2.2" +jest-leak-detector@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.4.tgz#9bb7eab26a73bb280e9298be8d80f389288ec8f1" + integrity sha512-SrcHWbe0EHg/bw2uBjVoHacTo5xosl068x2Q0aWsjr2yYuW2XwqrSkZV4lurUop0jhv1709ymG4or+8E4sH27Q== + dependencies: + jest-get-type "^27.0.6" + pretty-format "^27.2.4" + jest-matcher-utils@^27.2.2: version "27.2.2" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.2.tgz#a6c0a10dce6bfe8250bbed3e2f1b206568d73bde" @@ -5046,6 +5473,16 @@ jest-matcher-utils@^27.2.2: jest-get-type "^27.0.6" pretty-format "^27.2.2" +jest-matcher-utils@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.4.tgz#008fff018151415ad1b6cfc083fd70fe1e012525" + integrity sha512-nQeLfFAIPPkyhkDfifAPfP/U5wm1x0fLtAzqXZSSKckXDNuk2aaOfQiDYv1Mgf5GY6yOsxfUnvNm3dDjXM+BXw== + dependencies: + chalk "^4.0.0" + jest-diff "^27.2.4" + jest-get-type "^27.0.6" + pretty-format "^27.2.4" + jest-message-util@^27.2.2: version "27.2.2" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.2.tgz#cdbb1b82dfe5f601ae35f5c6a28bf7823e6bcf99" @@ -5061,6 +5498,21 @@ jest-message-util@^27.2.2: slash "^3.0.0" stack-utils "^2.0.3" +jest-message-util@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.4.tgz#667e8c0f2b973156d1bac7398a7f677705cafaca" + integrity sha512-wbKT/BNGnBVB9nzi+IoaLkXt6fbSvqUxx+IYY66YFh96J3goY33BAaNG3uPqaw/Sh/FR9YpXGVDfd5DJdbh4nA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@jest/types" "^27.2.4" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.4" + micromatch "^4.0.4" + pretty-format "^27.2.4" + slash "^3.0.0" + stack-utils "^2.0.3" + jest-mock@^27.1.1: version "27.1.1" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.1.1.tgz#c7a2e81301fdcf3dab114931d23d89ec9d0c3a82" @@ -5069,6 +5521,14 @@ jest-mock@^27.1.1: "@jest/types" "^27.1.1" "@types/node" "*" +jest-mock@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.2.4.tgz#c8f0ef33f73d8ff53e3f60b16d59f1128f4072ae" + integrity sha512-iVRU905rutaAoUcrt5Tm1JoHHWi24YabqEGXjPJI4tAyA6wZ7mzDi3GrZ+M7ebgWBqUkZE93GAx1STk7yCMIQA== + dependencies: + "@jest/types" "^27.2.4" + "@types/node" "*" + jest-pnp-resolver@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" @@ -5088,6 +5548,15 @@ jest-resolve-dependencies@^27.2.2: jest-regex-util "^27.0.6" jest-snapshot "^27.2.2" +jest-resolve-dependencies@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.4.tgz#20c41cc02b66aa45169b282356ec73b133013089" + integrity sha512-i5s7Uh9B3Q6uwxLpMhNKlgBf6pcemvWaORxsW1zNF/YCY3jd5EftvnGBI+fxVwJ1CBxkVfxqCvm1lpZkbaoGmg== + dependencies: + "@jest/types" "^27.2.4" + jest-regex-util "^27.0.6" + jest-snapshot "^27.2.4" + jest-resolve@^27.2.2: version "27.2.2" resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.2.tgz#1bad93dbc6c20edb874e6720e82e4e48900b120b" @@ -5104,6 +5573,22 @@ jest-resolve@^27.2.2: resolve "^1.20.0" slash "^3.0.0" +jest-resolve@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.4.tgz#d3b999f073ff84a8ae109ce99ff7f3223048701a" + integrity sha512-IsAO/3+3BZnKjI2I4f3835TBK/90dxR7Otgufn3mnrDFTByOSXclDi3G2XJsawGV4/18IMLARJ+V7Wm7t+J89Q== + dependencies: + "@jest/types" "^27.2.4" + chalk "^4.0.0" + escalade "^3.1.1" + graceful-fs "^4.2.4" + jest-haste-map "^27.2.4" + jest-pnp-resolver "^1.2.2" + jest-util "^27.2.4" + jest-validate "^27.2.4" + resolve "^1.20.0" + slash "^3.0.0" + jest-runner@^27.2.2: version "27.2.2" resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.2.tgz#e719a8ce2a16575677105f692fdff7cd00602325" @@ -5132,6 +5617,34 @@ jest-runner@^27.2.2: source-map-support "^0.5.6" throat "^6.0.1" +jest-runner@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.4.tgz#d816f4cb4af04f3cba703afcf5a35a335b77cad4" + integrity sha512-hIo5PPuNUyVDidZS8EetntuuJbQ+4IHWxmHgYZz9FIDbG2wcZjrP6b52uMDjAEQiHAn8yn8ynNe+TL8UuGFYKg== + dependencies: + "@jest/console" "^27.2.4" + "@jest/environment" "^27.2.4" + "@jest/test-result" "^27.2.4" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.8.1" + exit "^0.1.2" + graceful-fs "^4.2.4" + jest-docblock "^27.0.6" + jest-environment-jsdom "^27.2.4" + jest-environment-node "^27.2.4" + jest-haste-map "^27.2.4" + jest-leak-detector "^27.2.4" + jest-message-util "^27.2.4" + jest-resolve "^27.2.4" + jest-runtime "^27.2.4" + jest-util "^27.2.4" + jest-worker "^27.2.4" + source-map-support "^0.5.6" + throat "^6.0.1" + jest-runtime@^27.2.2: version "27.2.2" resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.2.tgz#cc29d3adde948d531657a67d33c9f8d9bb58a6fc" @@ -5165,6 +5678,39 @@ jest-runtime@^27.2.2: strip-bom "^4.0.0" yargs "^16.0.3" +jest-runtime@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.4.tgz#170044041e5d30625ab8d753516bbe503f213a5c" + integrity sha512-ICKzzYdjIi70P17MZsLLIgIQFCQmIjMFf+xYww3aUySiUA/QBPUTdUqo5B2eg4HOn9/KkUsV0z6GVgaqAPBJvg== + dependencies: + "@jest/console" "^27.2.4" + "@jest/environment" "^27.2.4" + "@jest/fake-timers" "^27.2.4" + "@jest/globals" "^27.2.4" + "@jest/source-map" "^27.0.6" + "@jest/test-result" "^27.2.4" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" + "@types/yargs" "^16.0.0" + chalk "^4.0.0" + cjs-module-lexer "^1.0.0" + collect-v8-coverage "^1.0.0" + execa "^5.0.0" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.2.4" + jest-haste-map "^27.2.4" + jest-message-util "^27.2.4" + jest-mock "^27.2.4" + jest-regex-util "^27.0.6" + jest-resolve "^27.2.4" + jest-snapshot "^27.2.4" + jest-util "^27.2.4" + jest-validate "^27.2.4" + slash "^3.0.0" + strip-bom "^4.0.0" + yargs "^16.2.0" + jest-serializer@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.0.6.tgz#93a6c74e0132b81a2d54623251c46c498bb5bec1" @@ -5203,6 +5749,36 @@ jest-snapshot@^27.2.2: pretty-format "^27.2.2" semver "^7.3.2" +jest-snapshot@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.4.tgz#277b2269437e3ffcb91d95a73b24becf33c5a871" + integrity sha512-5DFxK31rYS8X8C6WXsFx8XxrxW3PGa6+9IrUcZdTLg1aEyXDGIeiBh4jbwvh655bg/9vTETbEj/njfZicHTZZw== + dependencies: + "@babel/core" "^7.7.2" + "@babel/generator" "^7.7.2" + "@babel/parser" "^7.7.2" + "@babel/plugin-syntax-typescript" "^7.7.2" + "@babel/traverse" "^7.7.2" + "@babel/types" "^7.0.0" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" + "@types/babel__traverse" "^7.0.4" + "@types/prettier" "^2.1.5" + babel-preset-current-node-syntax "^1.0.0" + chalk "^4.0.0" + expect "^27.2.4" + graceful-fs "^4.2.4" + jest-diff "^27.2.4" + jest-get-type "^27.0.6" + jest-haste-map "^27.2.4" + jest-matcher-utils "^27.2.4" + jest-message-util "^27.2.4" + jest-resolve "^27.2.4" + jest-util "^27.2.4" + natural-compare "^1.4.0" + pretty-format "^27.2.4" + semver "^7.3.2" + jest-util@^27.2.0: version "27.2.0" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.0.tgz#bfccb85cfafae752257319e825a5b8d4ada470dc" @@ -5215,6 +5791,18 @@ jest-util@^27.2.0: is-ci "^3.0.0" picomatch "^2.2.3" +jest-util@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.4.tgz#3d7ce081b2e7f4cfe0156452ac01f3cb456cc656" + integrity sha512-mW++4u+fSvAt3YBWm5IpbmRAceUqa2B++JlUZTiuEt2AmNYn0Yw5oay4cP17TGsMINRNPSGiJ2zNnX60g+VbFg== + dependencies: + "@jest/types" "^27.2.4" + "@types/node" "*" + chalk "^4.0.0" + graceful-fs "^4.2.4" + is-ci "^3.0.0" + picomatch "^2.2.3" + jest-validate@^27.2.2: version "27.2.2" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.2.tgz#e672118f1d9aa57b25b4c7998edc101dabd7020b" @@ -5227,6 +5815,18 @@ jest-validate@^27.2.2: leven "^3.1.0" pretty-format "^27.2.2" +jest-validate@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.4.tgz#b66d462b2fb93d7e16a47d1aa8763d5600bf2cfa" + integrity sha512-VMtbxbkd7LHnIH7PChdDtrluCFRJ4b1YV2YJzNwwsASMWftq/HgqiqjvptBOWyWOtevgO3f14wPxkPcLlVBRog== + dependencies: + "@jest/types" "^27.2.4" + camelcase "^6.2.0" + chalk "^4.0.0" + jest-get-type "^27.0.6" + leven "^3.1.0" + pretty-format "^27.2.4" + jest-watcher@^27.2.2: version "27.2.2" resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.2.tgz#8b00253d7e880c6637b402228a76f2fe5ea08132" @@ -5240,6 +5840,19 @@ jest-watcher@^27.2.2: jest-util "^27.2.0" string-length "^4.0.1" +jest-watcher@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.4.tgz#b1d5c39ab94f59f4f35f66cc96f7761a10e0cfc4" + integrity sha512-LXC/0+dKxhK7cfF7reflRYlzDIaQE+fL4ynhKhzg8IMILNMuI4xcjXXfUJady7OR4/TZeMg7X8eHx8uan9vqaQ== + dependencies: + "@jest/test-result" "^27.2.4" + "@jest/types" "^27.2.4" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + jest-util "^27.2.4" + string-length "^4.0.1" + jest-worker@^26.2.1: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" @@ -5258,6 +5871,15 @@ jest-worker@^27.2.2: merge-stream "^2.0.0" supports-color "^8.0.0" +jest-worker@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.4.tgz#881455df75e22e7726a53f43703ab74d6b36f82d" + integrity sha512-Zq9A2Pw59KkVjBBKD1i3iE2e22oSjXhUKKuAK1HGX8flGwkm6NMozyEYzKd41hXc64dbd/0eWFeEEuxqXyhM+g== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + jest@^27.2.2: version "27.2.2" resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.2.tgz#445a4c16aa4c4ae6e512d62fb6f8b2624cbd6c26" @@ -5267,6 +5889,15 @@ jest@^27.2.2: import-local "^3.0.2" jest-cli "^27.2.2" +jest@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.4.tgz#70e27bef873138afc123aa4769f7124c50ad3efb" + integrity sha512-h4uqb1EQLfPulWyUFFWv9e9Nn8sCqsJ/j3wk/KCY0p4s4s0ICCfP3iMf6hRf5hEhsDyvyrCgKiZXma63gMz16A== + dependencies: + "@jest/core" "^27.2.4" + import-local "^3.0.2" + jest-cli "^27.2.4" + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -6638,6 +7269,16 @@ pretty-format@^27.0.0, pretty-format@^27.2.2: ansi-styles "^5.0.0" react-is "^17.0.1" +pretty-format@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.4.tgz#08ea39c5eab41b082852d7093059a091f6ddc748" + integrity sha512-NUjw22WJHldzxyps2YjLZkUj6q1HvjqFezkB9Y2cklN8NtVZN/kZEXGZdFw4uny3oENzV5EEMESrkI0YDUH8vg== + dependencies: + "@jest/types" "^27.2.4" + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^17.0.1" + pretty-format@^3.5.1: version "3.8.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-3.8.0.tgz#bfbed56d5e9a776645f4b1ff7aa1a3ac4fa3c385" @@ -7152,10 +7793,10 @@ rollup-pluginutils@^2.3.3, rollup-pluginutils@^2.8.1: dependencies: estree-walker "^0.6.1" -rollup@^2.34.2: - version "2.57.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.57.0.tgz#c1694475eb22e1022477c0f4635fd0ac80713173" - integrity sha512-bKQIh1rWKofRee6mv8SrF2HdP6pea5QkwBZSMImJysFj39gQuiV8MEPBjXOCpzk3wSYp63M2v2wkWBmFC8O/rg== +rollup@^2.58.0: + version "2.58.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.58.0.tgz#a643983365e7bf7f5b7c62a8331b983b7c4c67fb" + integrity sha512-NOXpusKnaRpbS7ZVSzcEXqxcLDOagN6iFS8p45RkoiMqPHDLwJm758UF05KlMoCRbLBTZsPOIa887gZJ1AiXvw== optionalDependencies: fsevents "~2.3.2" @@ -8104,6 +8745,15 @@ v8-to-istanbul@^8.0.0: convert-source-map "^1.6.0" source-map "^0.7.3" +v8-to-istanbul@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz#0aeb763894f1a0a1676adf8a8b7612a38902446c" + integrity sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^1.6.0" + source-map "^0.7.3" + validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" From de3c5a1aedcc768757bebf97510e97019e138a55 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Tue, 5 Oct 2021 15:06:49 -0300 Subject: [PATCH 04/49] complete react module refactored --- package.json | 15 +- packages/babel-plugin/package.json | 5 +- packages/babel-plugin/src/index.js | 5 +- packages/bindings/__tests__/index.ts | 8 +- packages/bindings/package.json | 2 +- packages/bindings/src/index.ts | 78 +- packages/bundle/index.js | 16 +- packages/core/package.json | 3 - packages/http-transport/package.json | 3 +- packages/react/.babelrc | 2 +- packages/react/__tests__/index.tsx | 469 +++++------- packages/react/package.json | 8 +- packages/react/src/index.ts | 107 ++- scripts/resolver.js | 14 +- yarn.lock | 1011 +++++--------------------- 15 files changed, 481 insertions(+), 1265 deletions(-) diff --git a/package.json b/package.json index 354f7951..f66b12ed 100644 --- a/package.json +++ b/package.json @@ -70,14 +70,14 @@ "@babel/preset-typescript": "^7.0.0", "@babel/register": "^7.0.0", "@graphql-tools/schema": "^8.2.0", + "@testing-library/react-hooks": "^7.0.2", "@types/jest": "^27.0.2", - "@types/node": "^16.10.1", - "@types/react": "^17.0.24", - "@types/react-test-renderer": "^17.0.1", + "@types/node": "^16.10.2", + "@types/node-fetch": "^3.0.3", + "@types/react": "^17.0.27", "@types/uuid": "^8.3.1", "@types/ws": "^8.2.0", - "@typescript-eslint/parser": "^4.9.1", - "babel-plugin-jsx-pragmatic": "^1.0.2", + "@typescript-eslint/parser": "^4.32.0", "babel-plugin-tester": "^10.0.0", "casual": "^1.5.19", "codecov": "^3.2.0", @@ -86,7 +86,7 @@ "fetch-mock": "^9.11.0", "graphql": "^15.4.0", "husky": "^7.0.2", - "jest": "^27.2.2", + "jest": "^27.2.4", "lerna": "^4.0.0", "lint-staged": "^11.1.2", "lowdb": "^3.0.0", @@ -94,8 +94,7 @@ "preact": "^8.3.0", "preact-render-spy": "^1.3.0", "prettier": "^2.2.1", - "react": "^16.8.2", - "react-test-renderer": "^16.8.2", + "react": "^17.0.2", "resolve.exports": "^1.0.2", "rimraf": "^3.0.2", "typescript": "^4.1.2", diff --git a/packages/babel-plugin/package.json b/packages/babel-plugin/package.json index 180542e2..53921ad8 100644 --- a/packages/babel-plugin/package.json +++ b/packages/babel-plugin/package.json @@ -32,8 +32,5 @@ "graphql": "^15.4.0", "graphql-query-compress": "^1.0.0" }, - "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974", - "devDependencies": { - "graphql": "^15.4.0" - } + "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" } diff --git a/packages/babel-plugin/src/index.js b/packages/babel-plugin/src/index.js index 61018eb0..6b183bff 100644 --- a/packages/babel-plugin/src/index.js +++ b/packages/babel-plugin/src/index.js @@ -35,8 +35,9 @@ export default function transform({ types: t }) { if (source.value === "@grafoo/core") { let defaultSpecifier = specifiers.find((s) => t.isImportDefaultSpecifier(s)); - - clientFactoryIdentifiers.push(defaultSpecifier.local.name); + if (defaultSpecifier) { + clientFactoryIdentifiers.push(defaultSpecifier.local.name); + } } if (source.value === "@grafoo/core/tag") { diff --git a/packages/bindings/__tests__/index.ts b/packages/bindings/__tests__/index.ts index 144b22f1..5f9c2586 100644 --- a/packages/bindings/__tests__/index.ts +++ b/packages/bindings/__tests__/index.ts @@ -12,14 +12,14 @@ type Post = { title: string; content: string; id: string; - __typename: string; + __typename?: string; author: Author; }; type Author = { name: string; id: string; - __typename: string; + __typename?: string; posts?: Array; }; @@ -185,7 +185,7 @@ describe("@grafoo/bindings", () => { let props = bindings.getState(); - expect(props).toEqual({ client }); + expect(props).toEqual({ loaded: false, loading: false }); }); it("should execute a query", async () => { @@ -450,7 +450,7 @@ describe("@grafoo/bindings", () => { let mutations = { updateAuthor: { query: UPDATE_AUTHOR, - optimisticUpdate: ({ authors }, variables: Author) => ({ + optimisticUpdate: ({ authors }, variables) => ({ authors: authors.map((author) => (author.id === variables.id ? variables : author)) }) } diff --git a/packages/bindings/package.json b/packages/bindings/package.json index f8509363..781c88d7 100644 --- a/packages/bindings/package.json +++ b/packages/bindings/package.json @@ -32,7 +32,7 @@ ] }, "dependencies": { - "@grafoo/types": "^1.4.1" + "@grafoo/core": "^1.4.1" }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" } diff --git a/packages/bindings/src/index.ts b/packages/bindings/src/index.ts index 2e9003f0..b654dc77 100644 --- a/packages/bindings/src/index.ts +++ b/packages/bindings/src/index.ts @@ -6,47 +6,49 @@ import { GrafooObject } from "@grafoo/core"; -export type GrafooMutation = { - query: T; - update?: (props: U["_queryType"], data: T["_queryType"]) => T["_queryType"]; - optimisticUpdate?: (props: U["_queryType"], variables: T["_variablesType"]) => T["_queryType"]; +export type GrafooBoundMutations> = { + [U in keyof T]: ( + variables: T[U]["_variablesType"] + ) => Promise>; }; -export type GrafooMutations = { - [k: string]: GrafooMutation; +export type GrafooBoundState = { + loaded?: boolean; + loading?: boolean; + errors?: GraphQlError[]; }; -export type GrafooBountMutations> = { - [V in keyof U]: ( - variables: U[V]["query"]["_variablesType"] - ) => Promise>; +export type GrafooMutation = { + query: U; + update?: (props: T["_queryType"], data: U["_queryType"]) => T["_queryType"]; + optimisticUpdate?: (props: T["_queryType"], variables: U["_variablesType"]) => T["_queryType"]; }; -export type GrafooConsumerProps> = { +export type GrafooConsumerProps> = { query?: T; variables?: T["_variablesType"]; - mutations?: U; + mutations?: { + [V in keyof U]: GrafooMutation; + }; skip?: boolean; }; -export default function createBindings>( - client: GrafooClient, - updater: () => void, - props: GrafooConsumerProps -) { +export default function createBindings< + T extends GrafooObject, + U extends Record +>(client: GrafooClient, updater: () => void, props: GrafooConsumerProps) { type CP = GrafooConsumerProps; - - let { variables } = props; + let { query, variables, mutations, skip } = props; let data: CP["query"]["_queryType"]; + let boundMutations = {} as GrafooBoundMutations; let objects: GrafooObjectsMap; let partial = false; - let boundMutations = {} as GrafooBountMutations; let unbind = () => {}; let lockListenUpdate = false; let loaded = false; - if (props.query) { - ({ data, objects, partial } = client.read(props.query, variables)); + if (query) { + ({ data, objects, partial } = client.read(query, variables)); loaded = !!data && !partial; @@ -72,19 +74,19 @@ export default function createBindings { - if (props.query && optimisticUpdate) { + if (query && optimisticUpdate) { writeToCache(optimisticUpdate(data, mutationVariables)); } return client.execute(mutationQuery, mutationVariables).then((mutationResponse) => { - if (props.query && update && mutationResponse.data) { + if (query && update && mutationResponse.data) { writeToCache(update(data, mutationResponse.data)); } @@ -95,23 +97,18 @@ export default function createBindings { + return client.execute(query, variables).then(({ data, errors }) => { if (data) { lockListenUpdate = true; - writeToCache(data); } - performUpdate({ errors, loaded: !!data, loading: false }); + + performUpdate(Object.assign({ loaded: !!data, loading: false }, errors && { errors })); }); } diff --git a/packages/bundle/index.js b/packages/bundle/index.js index 73c3a4b8..af9a362a 100755 --- a/packages/bundle/index.js +++ b/packages/bundle/index.js @@ -26,13 +26,13 @@ module.exports = function build(opts) { nodeResolve(), typescript({ typescript: ts, - tsconfigOverride: tsconfig, + tsconfigOverride: tsconfig }), buble({ transforms: { dangerousForOf: true, - dangerousTaggedTemplateString: true, - }, + dangerousTaggedTemplateString: true + } }), !opts.skipCompression && terser({ @@ -40,18 +40,18 @@ module.exports = function build(opts) { compress: { keep_infinity: true, pure_getters: true }, warnings: true, toplevel: true, - mangle: {}, + mangle: {} }), - fileSize(), - ].filter(Boolean), + fileSize() + ].filter(Boolean) }).then(function (bundle) { return bundle.write({ file: path.join(opts.rootPath, "dist/index.js"), sourcemap: true, format: opts.format || "esm", treeshake: { - propertyReadSideEffects: false, - }, + propertyReadSideEffects: false + } }); }); }; diff --git a/packages/core/package.json b/packages/core/package.json index ba6aa1fd..685aeae4 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -31,8 +31,5 @@ "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob)/)" ] }, - "dependencies": { - "@grafoo/types": "^1.4.1" - }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" } diff --git a/packages/http-transport/package.json b/packages/http-transport/package.json index 7dfccb28..1cdee0fe 100644 --- a/packages/http-transport/package.json +++ b/packages/http-transport/package.json @@ -30,8 +30,7 @@ ] }, "dependencies": { - "@grafoo/types": "^1.4.1", - "grafoo-bundle": "^1.4.1" + "@grafoo/core": "^1.4.1" }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" } diff --git a/packages/react/.babelrc b/packages/react/.babelrc index 3ebce728..8eac686b 100644 --- a/packages/react/.babelrc +++ b/packages/react/.babelrc @@ -1,6 +1,6 @@ { "presets": [ - ["@babel/preset-env", { "targets": { "node": 10 } }], + ["@babel/preset-env", { "targets": { "node": "current" } }], "@babel/preset-react", "@babel/preset-typescript" ], diff --git a/packages/react/__tests__/index.tsx b/packages/react/__tests__/index.tsx index e34e87c9..c18967e5 100644 --- a/packages/react/__tests__/index.tsx +++ b/packages/react/__tests__/index.tsx @@ -2,36 +2,40 @@ * @jest-environment jsdom */ -import createClient from "@grafoo/core"; +import fetch from "node-fetch"; +import * as React from "react"; import graphql from "@grafoo/core/tag"; +import createClient from "@grafoo/core"; import createTrasport from "@grafoo/http-transport"; import { mockQueryRequest } from "@grafoo/test-utils"; -import { GrafooClient, Variables } from "@grafoo/types"; -import * as React from "react"; -import * as TestRenderer from "react-test-renderer"; -import { Consumer, Provider } from "../src"; +import { renderHook, act } from "@testing-library/react-hooks"; + +import { GrafooProvider, useGrafoo } from "../src"; -interface Post { +// @ts-ignore +globalThis.fetch = fetch; + +type Post = { title: string; content: string; id: string; - __typename: string; + __typename?: string; author: Author; -} +}; -interface Author { +type Author = { name: string; id: string; - __typename: string; + __typename?: string; posts?: Array; -} +}; -interface Authors { +type AuthorsQuery = { authors: Author[]; -} +}; -let AUTHORS = graphql` - { +let AUTHORS = graphql` + query { authors { name posts { @@ -42,24 +46,38 @@ let AUTHORS = graphql` } `; -let AUTHOR = graphql` - query ($id: ID!) { - author(id: $id) { +let SIMPLE_AUTHORS = graphql` + query { + authors { name } } `; -let CREATE_AUTHOR = graphql` - mutation ($name: String!) { - createAuthor(name: $name) { +type AuthorQuery = { + author: Author; +}; + +type AuthorQueryInput = { + id: string; +}; + +let AUTHOR = graphql` + query ($id: ID!) { + author(id: $id) { name } } `; -let POSTS_AND_AUTHORS = graphql` - { +type PostsQuery = { + posts: Post[]; +}; + +type PostsAndAuthorsQuery = AuthorsQuery & PostsQuery; + +let POSTS_AND_AUTHORS = graphql` + query { posts { title body @@ -78,37 +96,50 @@ let POSTS_AND_AUTHORS = graphql` } `; +type CreateAuthorMutation = { + createAuthor: { + name: string; + id: string; + __typename: string; + posts?: Array; + }; +}; + +type CreateAuthorInput = { + name: string; +}; + +let CREATE_AUTHOR = graphql` + mutation ($name: String!) { + createAuthor(name: $name) { + name + posts { + title + body + } + } + } +`; + describe("@grafoo/react", () => { - let client: GrafooClient; + let client; + let wrapper: React.FC; beforeEach(() => { jest.resetAllMocks(); let transport = createTrasport("https://some.graphql.api/"); client = createClient(transport, { idFields: ["id"] }); + wrapper = (props) => {props.children}; }); it("should not crash if a query is not given as prop", () => { - expect(() => - TestRenderer.create( - - {() => null} - - ) - ).not.toThrow(); + expect(() => renderHook(() => useGrafoo({}), { wrapper })).not.toThrow(); }); it("should not fetch a query if skip prop is set to true", async () => { - await mockQueryRequest(AUTHORS); - let spy = jest.spyOn(window, "fetch"); - TestRenderer.create( - - - {() => null} - - - ); + renderHook(() => useGrafoo({ query: AUTHORS, skip: true }), { wrapper }); expect(spy).not.toHaveBeenCalled(); }); @@ -118,284 +149,172 @@ describe("@grafoo/react", () => { let spy = jest.spyOn(client, "listen"); - TestRenderer.create( - - - {() => null} - - - ); + renderHook(() => useGrafoo({ query: AUTHORS, skip: true }), { wrapper }); expect(spy).toHaveBeenCalled(); }); - it("should not crash on unmount", () => { - let testRenderer = TestRenderer.create( - - - {() => null} - - - ); - - expect(() => testRenderer.unmount()).not.toThrow(); - }); - it("should execute render with default render argument", () => { - let mockRender = jest.fn().mockReturnValue(null); - - TestRenderer.create( - - - {mockRender} - - - ); + let { result } = renderHook(() => useGrafoo({ query: AUTHORS, skip: true }), { wrapper }); - let [[call]] = mockRender.mock.calls; - - expect(call).toMatchObject({ loading: false, loaded: false }); - expect(typeof call.load).toBe("function"); + expect(result.current).toEqual({ loading: false, loaded: false }); }); - it("should execute render with the right data if a query is specified", (done) => { - mockQueryRequest(AUTHORS).then(({ data }) => { - let mockRender = createMockRenderFn(done, [ - (props) => expect(props).toMatchObject({ loading: true, loaded: false }), - (props) => expect(props).toMatchObject({ loading: false, loaded: true, ...data }) - ]); - - TestRenderer.create( - - {mockRender} - - ); + it("should execute render with the right data if a query is specified", async () => { + let { data } = await mockQueryRequest(AUTHORS); + let { result, waitForNextUpdate } = renderHook(() => useGrafoo({ query: AUTHORS }), { + wrapper }); - }); - it("should render if skip changed value to true", (done) => { - mockQueryRequest(AUTHORS).then(async ({ data }) => { - let mockRender = createMockRenderFn(done, [ - (props) => expect(props).toMatchObject({ loading: false, loaded: false }), - (props) => expect(props).toMatchObject({ loading: true, loaded: false }), - (props) => expect(props).toMatchObject({ loading: false, loaded: true, ...data }) - ]); - - let App: React.FC<{ skip?: boolean }> = ({ skip = false }) => ( - - - {mockRender} - - - ); - - let ctx = TestRenderer.create(); - - ctx.update(); - await new Promise((resolve) => setTimeout(resolve, 10)); - ctx.update(); - }); + expect(result.current).toEqual({ loading: true, loaded: false }); + await waitForNextUpdate(); + expect(result.current).toEqual({ loading: false, loaded: true, ...data }); }); - it("should rerender if variables prop has changed", (done) => { - mockQueryRequest(AUTHORS).then(async ({ data }) => { - let mock = async (variables: Variables) => { - return ( - await mockQueryRequest<{ author: Author }>({ - query: AUTHOR.query, - variables - }) - ).data.author; - }; - - let firstVariables = { id: data.authors[0].id }; - let secondVariables = { id: data.authors[1].id }; - let firstAuthor = await mock(firstVariables); - let secondAuthor; - - let mockRender = createMockRenderFn(done, [ - (props) => expect(props).toMatchObject({ loading: true, loaded: false }), - (props) => expect(props.author).toMatchObject(firstAuthor), - (props) => - expect(props).toMatchObject({ loading: true, loaded: true, author: firstAuthor }), - (props) => expect(props.author).toMatchObject(secondAuthor) - ]); - - class AuthorComponent extends React.Component { - constructor(props, context) { - super(props, context); - - this.state = firstVariables; - - setTimeout(async () => { - secondAuthor = await mock(secondVariables); - - this.setState(secondVariables); - }, 100); + it("should render if skip changed value to false", async () => { + let { data } = await mockQueryRequest(AUTHORS); + let { result, rerender, waitForNextUpdate } = renderHook<{ skip: boolean }, any>( + ({ skip }) => useGrafoo({ query: AUTHORS, skip }), + { + wrapper, + initialProps: { + skip: true } + } + ); + + expect(result.current).toEqual({ loading: false, loaded: false }); + rerender({ skip: false }); + expect(result.current).toEqual({ loading: true, loaded: false }); + await waitForNextUpdate(); + expect(result.current).toEqual({ loading: false, loaded: true, ...data }); + }); - render() { - return ( - - {mockRender} - - ); + it("should rerender if variables prop has changed", async () => { + let { + data: { authors } + } = await mockQueryRequest(SIMPLE_AUTHORS); + let author1 = authors[0]; + let author2 = authors[1]; + + await mockQueryRequest({ ...AUTHOR, variables: { id: author1.id } }); + let { result, rerender, waitForNextUpdate } = renderHook<{ id: string }, any>( + ({ id }) => useGrafoo({ query: AUTHOR, variables: { id } }), + { + wrapper, + initialProps: { + id: author1.id } } + ); - TestRenderer.create( - - - - ); - }); + expect(result.current).toEqual({ loading: true, loaded: false }); + await waitForNextUpdate(); + expect(result.current).toEqual({ loading: false, loaded: true, author: author1 }); + await mockQueryRequest({ ...AUTHOR, variables: { id: author2.id } }); + rerender({ id: author2.id }); + expect(result.current).toEqual({ loading: true, loaded: true, author: author1 }); + await waitForNextUpdate(); + expect(result.current).toEqual({ loading: false, loaded: true, author: author2 }); }); - it("should not trigger a network request if the query is already cached", (done) => { - mockQueryRequest(AUTHORS).then(({ data }) => { - client.write(AUTHORS, data); + it("should not try to load a query if it's already cached", async () => { + let { data } = await mockQueryRequest(AUTHORS); + client.write(AUTHORS, data); + jest.resetAllMocks(); - jest.resetAllMocks(); + let spy = jest.spyOn(client, "execute"); + let { result } = renderHook(() => useGrafoo({ query: AUTHORS }), { wrapper }); - let spy = jest.spyOn(client, "execute"); + expect(result.current).toEqual({ loading: false, loaded: true, ...data }); + expect(spy).not.toHaveBeenCalled(); + }); - let mockRender = createMockRenderFn(done, [ - (props) => expect(props).toMatchObject({ loading: false, loaded: true, ...data }) - ]); + it("should handle mutations", async () => { + let variables = { name: "Bart" }; - TestRenderer.create( - - {mockRender} - - ); + let data = await mockQueryRequest({ ...CREATE_AUTHOR, variables }); + let { result } = renderHook( + () => useGrafoo({ mutations: { createAuthor: { query: CREATE_AUTHOR } } }), + { wrapper } + ); - expect(spy).not.toHaveBeenCalled(); - }); + let res = await result.current.createAuthor(variables); + expect(res).toEqual(data); }); - it("should handle simple mutations", (done) => { - let variables = { name: "Bart" }; + it("should handle mutations with cache update", async () => { + let { data } = await mockQueryRequest(AUTHORS); + let { result, waitForNextUpdate } = renderHook( + () => + useGrafoo({ + query: AUTHORS, + mutations: { + createAuthor: { + query: CREATE_AUTHOR, + optimisticUpdate: ({ authors }, variables) => ({ + authors: [...authors, { ...variables, id: "tempID" }] + }), + update: ({ authors }, data) => ({ + authors: authors.map((a) => (a.id === "tempID" ? data.createAuthor : a)) + }) + } + } + }), + { wrapper } + ); - mockQueryRequest({ query: CREATE_AUTHOR.query, variables }).then(({ data }) => { - let mockRender = createMockRenderFn(done, [ - (props) => { - props.createAuthor(variables).then((res) => { - expect(res.data).toEqual(data); - }); - } - ]); + expect(result.current).toMatchObject({ loading: true, loaded: false }); + expect(typeof result.current.createAuthor).toBe("function"); - let mutations = { createAuthor: { query: CREATE_AUTHOR } }; + await waitForNextUpdate(); - TestRenderer.create( - - {mockRender} - - ); - }); - }); + expect(result.current).toMatchObject({ loading: false, loaded: true, ...data }); - it("should handle mutations with cache update", (done) => { - mockQueryRequest(AUTHORS).then(({ data }) => { - let mockRender = createMockRenderFn(done, [ - (props) => { - expect(props).toMatchObject({ loading: true, loaded: false }); - expect(typeof props.createAuthor).toBe("function"); - }, - (props) => { - expect(props).toMatchObject({ loading: false, loaded: true, ...data }); - let variables = { name: "Homer" }; - mockQueryRequest({ query: CREATE_AUTHOR.query, variables }).then(() => { - props.createAuthor(variables); - }); - }, - (props) => { - expect(props.authors.length).toBe(data.authors.length + 1); - let newAuthor = props.authors.find((a) => a.id === "tempID"); - expect(newAuthor).toMatchObject({ name: "Homer", id: "tempID" }); - }, - (props) => { - expect(props.authors.find((a) => a.id === "tempID")).toBeUndefined(); - expect(props.authors.find((a) => a.name === "Homer")).toBeTruthy(); - } - ]); - - TestRenderer.create( - - ({ - authors: [...authors, { ...variables, id: "tempID" }] - }), - update: ({ authors }, data) => ({ - authors: authors.map((a) => (a.id === "tempID" ? (data as any).createAuthor : a)) - }) - } - }} - > - {mockRender} - - - ); + let variables = { name: "Homer" }; + await mockQueryRequest({ ...CREATE_AUTHOR, variables }); + act(() => { + result.current.createAuthor(variables); }); - }); - it("should reflect updates that happen outside of the component", (done) => { - mockQueryRequest(AUTHORS).then(({ data }) => { - client.write(AUTHORS, data); + expect(result.current.authors.length).toBe(data.authors.length + 1); + let newAuthor = result.current.authors.find((a) => a.id === "tempID"); + expect(newAuthor).toEqual({ name: "Homer", id: "tempID" }); - let mockRender = createMockRenderFn(done, [ - (props) => expect(props).toMatchObject({ loading: false, loaded: true, ...data }), - (props) => expect(props.authors[0].name).toBe("Homer") - ]); + await waitForNextUpdate(); - TestRenderer.create( - - {mockRender} - - ); - - client.write(AUTHORS, { - authors: data.authors.map((a, i) => (!i ? { ...a, name: "Homer" } : a)) - }); - }); + expect(result.current.authors.find((a) => a.id === "tempID")).toBeUndefined(); + expect(result.current.authors.find((a) => a.name === "Homer")).toBeTruthy(); }); - it("should not trigger a network request if a query field is cached", (done) => { - mockQueryRequest(POSTS_AND_AUTHORS).then(({ data }) => { - client.write(POSTS_AND_AUTHORS, data); + it("should reflect updates that happen outside of the component", async () => { + let { data } = await mockQueryRequest(AUTHORS); - let spy = jest.spyOn(client, "execute"); + client.write(AUTHORS, data); - let mockRender = createMockRenderFn(done, [ - (props) => { - expect(props).toMatchObject({ authors: data.authors, loading: false, loaded: true }); - expect(spy).not.toHaveBeenCalled(); - } - ]); + let { result } = renderHook(() => useGrafoo({ query: AUTHORS }), { wrapper }); - TestRenderer.create( - - {mockRender} - - ); + expect(result.current).toEqual({ loading: false, loaded: true, ...data }); + + act(() => { + client.write(AUTHORS, { + authors: data.authors.map((a, i) => (!i ? { ...a, name: "Lisa" } : a)) + }); }); + + expect(result.current.authors[0].name).toBe("Lisa"); }); -}); -function createMockRenderFn(done, assertionsFns) { - let currentRender = 0; + it("should not trigger a network request if a query field is cached", async () => { + let { data } = await mockQueryRequest(POSTS_AND_AUTHORS); - return (props) => { - let assert = assertionsFns[currentRender]; + client.write(POSTS_AND_AUTHORS, data); - if (assert) assertionsFns[currentRender](props); + let { result } = renderHook(() => useGrafoo({ query: AUTHORS }), { wrapper }); - if (currentRender++ === assertionsFns.length - 1) done(); + let spy = jest.spyOn(client, "execute"); - return null; - }; -} + expect(result.current).toEqual({ authors: data.authors, loading: false, loaded: true }); + expect(spy).not.toHaveBeenCalled(); + }); +}); diff --git a/packages/react/package.json b/packages/react/package.json index 6457a556..7d05f21a 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -35,17 +35,15 @@ ] }, "peerDependencies": { - "react": ">=16.4" + "react": ">=16.8" }, "dependencies": { "@grafoo/bindings": "^1.4.1", - "@grafoo/types": "^1.4.1" + "@grafoo/core": "^1.4.1" }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974", "devDependencies": { "@types/node": "^16.10.2", - "@types/react": "^17.0.26", - "@typescript-eslint/parser": "^4.32.0", - "jest": "^27.2.4" + "@types/react": "^17.0.27" } } diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index c03ec888..bc85b41a 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -1,74 +1,61 @@ -import createBindings from "@grafoo/bindings"; -import { Component, createContext, createElement, ReactElement, ReactNode, FC } from "react"; +import * as React from "react"; +import createBindings, { GrafooConsumerProps } from "@grafoo/bindings"; +import { GrafooClient, GrafooObject } from "@grafoo/core"; -/** - * T = Query - * U = Mutations - */ -type GrafooRenderFn = ( - renderProps: GrafooBoundState & T & GrafooBoundMutations -) => ReactNode; +// @ts-ignore +export let GrafooContext = React.createContext({}); -/** - * T = Query - * U = Mutations - */ -type GrafooReactConsumerProps = GrafooConsumerProps & { - children: GrafooRenderFn; +type GrafooProviderProps = { + client: GrafooClient; }; -/** - * T = Query - * U = Mutations - */ -interface ConsumerType extends FC { - (props: GrafooReactConsumerProps): ReactElement | null; -} - -let ctx = createContext({}); - -export let Provider: FC = (props) => - createElement(ctx.Provider, { value: props.client }, props.children); - -class GrafooConsumer extends Component> { - state: GrafooBoundState & T & GrafooBoundMutations; +export let GrafooProvider: React.FC = (props) => + React.createElement(GrafooContext.Provider, { value: props.client }, props.children); - constructor(props: GrafooReactConsumerProps) { - super(props); +export function useGrafoo>( + props: GrafooConsumerProps +) { + let client = React.useContext(GrafooContext); + let update = React.useCallback(() => setState(bindings.getState()), []); + let bindings = React.useMemo(() => createBindings(client, update, props), []); + let [state, setState] = React.useState(() => bindings.getState()); + let variables = React.useRef(props.variables); - let bindings = createBindings(props.client, props, () => { - this.setState(bindings.getState()); - }); + React.useEffect(() => { + if (!props.skip && props.query && !state.loaded) { + bindings.load(); + } - this.state = bindings.getState(); + return () => { + bindings.unbind(); + }; + }, []); + + React.useEffect(() => { + if ( + (!props.skip && props.query && !state.loaded) || + !deepEqual(variables.current, props.variables) + ) { + variables.current = props.variables; + bindings.load(props.variables); + } + }, [props.skip, props.variables]); + + return state; +} - this.componentDidMount = () => { - if (props.skip || !props.query || this.state.loaded) return; +let deepEqual = (x: any, y: any) => { + if (x === y) return true; - bindings.load(); - }; + if (isPrimitive(x) && isPrimitive(y)) return x === y; - this.componentWillReceiveProps = (next) => { - if ((!this.state.loaded && !next.skip) || props.variables !== next.variables) { - bindings.load(next.variables); - } - }; + if (Object.keys(x).length !== Object.keys(y).length) return false; - this.componentWillUnmount = () => { - bindings.unbind(); - }; + for (let i in x) { + if (!(i in y) || !deepEqual(x[i], y[i])) return false; } - render() { - return this.props.children(this.state); - } -} + return true; +}; -/** - * T = Query - * U = Mutations - */ -export let Consumer: ConsumerType = (props: GrafooReactConsumerProps) => - createElement(ctx.Consumer, null, (client: GrafooClient) => - createElement(GrafooConsumer, Object.assign({ client }, props)) - ); +let isPrimitive = (obj: any) => obj !== Object(obj); diff --git a/scripts/resolver.js b/scripts/resolver.js index 6cad796d..027581e8 100644 --- a/scripts/resolver.js +++ b/scripts/resolver.js @@ -3,8 +3,14 @@ let { resolve } = require("resolve.exports"); module.exports = (request, options) => options.defaultResolver(request, { ...options, - packageFilter: (package) => ({ - ...package, - main: package.main || resolve(package, ".") - }) + packageFilter: (package) => { + try { + return { + ...package, + main: package.main || resolve(package, ".") + }; + } catch (e) { + return package; + } + } }); diff --git a/yarn.lock b/yarn.lock index 69dc55a3..6dc3f833 100644 --- a/yarn.lock +++ b/yarn.lock @@ -954,7 +954,7 @@ pirates "^4.0.0" source-map-support "^0.5.16" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.13.8", "@babel/runtime@^7.8.4": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.8", "@babel/runtime@^7.8.4": version "7.15.4" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a" integrity sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw== @@ -1037,9 +1037,9 @@ value-or-promise "1.0.10" "@graphql-tools/utils@^8.2.0", "@graphql-tools/utils@^8.2.2": - version "8.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-8.2.3.tgz#9d7b9e7e116d11d26c2687f4d9cfb2b54568838b" - integrity sha512-RR+aiusf2gIfnPmrDIH1uA45QuPiHB54RD+BmWyMcl88tWAjeJtqZeWPqUTq/1EXrNeocJAJQqogHV4Fbbzx3A== + version "8.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-8.2.4.tgz#89f92c8dc0cdb6b9f32c90e904aa90e66a2e0a58" + integrity sha512-uB+JL7CqTKJ2Q5zXA+a2la1cA8YYPcc0RHO/3mK54hxlZa2Z5/9k9XrNfMof4LZQefTaBM7M6QWtaxGklJln4A== dependencies: tslib "~2.3.0" @@ -1078,18 +1078,6 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.2.2.tgz#a977245155c519ac2ef713ec0e722d13eda893c9" - integrity sha512-m7tbzPWyvSFfoanTknJoDnaeruDARsUe555tkVjG/qeaRDKwyPqqbgs4yFx583gmoETiAts1deeYozR5sVRhNA== - dependencies: - "@jest/types" "^27.1.1" - "@types/node" "*" - chalk "^4.0.0" - jest-message-util "^27.2.2" - jest-util "^27.2.0" - slash "^3.0.0" - "@jest/console@^27.2.4": version "27.2.4" resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.2.4.tgz#2f1a4bf82b9940065d4818fac271def99ec55e5e" @@ -1102,41 +1090,6 @@ jest-util "^27.2.4" slash "^3.0.0" -"@jest/core@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.2.tgz#9eea16101b2f04bf799dcdbdf1792d4ef7553ecf" - integrity sha512-4b9km/h9pAGdCkwWYtbfoeiOtajOlGmr5rL1Eq6JCAVbOevOqxWHxJ6daWxRJW9eF6keXJoJ1H+uVAVcdZu8Bg== - dependencies: - "@jest/console" "^27.2.2" - "@jest/reporters" "^27.2.2" - "@jest/test-result" "^27.2.2" - "@jest/transform" "^27.2.2" - "@jest/types" "^27.1.1" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - emittery "^0.8.1" - exit "^0.1.2" - graceful-fs "^4.2.4" - jest-changed-files "^27.1.1" - jest-config "^27.2.2" - jest-haste-map "^27.2.2" - jest-message-util "^27.2.2" - jest-regex-util "^27.0.6" - jest-resolve "^27.2.2" - jest-resolve-dependencies "^27.2.2" - jest-runner "^27.2.2" - jest-runtime "^27.2.2" - jest-snapshot "^27.2.2" - jest-util "^27.2.0" - jest-validate "^27.2.2" - jest-watcher "^27.2.2" - micromatch "^4.0.4" - p-each-series "^2.1.0" - rimraf "^3.0.0" - slash "^3.0.0" - strip-ansi "^6.0.0" - "@jest/core@^27.2.4": version "27.2.4" resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.4.tgz#0b932da787d64848eab720dbb88e5b7a3f86e539" @@ -1171,16 +1124,6 @@ slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.2.tgz#2e57b9d2cc01028b0e35fae5833c1c63df4c5e41" - integrity sha512-gO9gVnZfn5ldeOJ5q+35Kru9QWGHEqZCB7W/M+8mD6uCwOGC9HR6mzpLSNRuDsxY/KhaGBYHpgFqtpe4Rl1gDQ== - dependencies: - "@jest/fake-timers" "^27.2.2" - "@jest/types" "^27.1.1" - "@types/node" "*" - jest-mock "^27.1.1" - "@jest/environment@^27.2.4": version "27.2.4" resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.4.tgz#db3e60f7dd30ab950f6ce2d6d7293ed9a6b7cbcd" @@ -1191,18 +1134,6 @@ "@types/node" "*" jest-mock "^27.2.4" -"@jest/fake-timers@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.2.tgz#43e6f191c95ae74e95d0ddba2ecb8470b4a288b7" - integrity sha512-gDIIqs0yxyjyxEI9HlJ8SEJ4uCc8qr8BupG1Hcx7tvyk/SLocyXE63rFxL+HQ0ZLMvSyEcJUmYnvvHH1osWiGA== - dependencies: - "@jest/types" "^27.1.1" - "@sinonjs/fake-timers" "^7.0.2" - "@types/node" "*" - jest-message-util "^27.2.2" - jest-mock "^27.1.1" - jest-util "^27.2.0" - "@jest/fake-timers@^27.2.4": version "27.2.4" resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.4.tgz#00df08bd60332bd59503cb5b6db21e4903785f86" @@ -1215,15 +1146,6 @@ jest-mock "^27.2.4" jest-util "^27.2.4" -"@jest/globals@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.2.tgz#df66aaafda5c69b2bb0dae548e3cfb345f549c31" - integrity sha512-fWa/Luwod1hyehnuep+zCnOTqTVvyc4HLUU/1VpFNOEu0tCWNSODyvKSSOjtb1bGOpCNjgaDcyjzo5f7rl6a7g== - dependencies: - "@jest/environment" "^27.2.2" - "@jest/types" "^27.1.1" - expect "^27.2.2" - "@jest/globals@^27.2.4": version "27.2.4" resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.4.tgz#0aeb22b011f8c8c4b8ff3b4dbd1ee0392fe0dd8a" @@ -1233,36 +1155,6 @@ "@jest/types" "^27.2.4" expect "^27.2.4" -"@jest/reporters@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.2.tgz#e2d41cd9f8088676b81b9a9908cb1ba67bdbee78" - integrity sha512-ufwZ8XoLChEfPffDeVGroYbhbcYPom3zKDiv4Flhe97rr/o2IfUXoWkDUDoyJ3/V36RFIMjokSu0IJ/pbFtbHg== - dependencies: - "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.2.2" - "@jest/test-result" "^27.2.2" - "@jest/transform" "^27.2.2" - "@jest/types" "^27.1.1" - chalk "^4.0.0" - collect-v8-coverage "^1.0.0" - exit "^0.1.2" - glob "^7.1.2" - graceful-fs "^4.2.4" - istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^4.0.3" - istanbul-lib-report "^3.0.0" - istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.0.2" - jest-haste-map "^27.2.2" - jest-resolve "^27.2.2" - jest-util "^27.2.0" - jest-worker "^27.2.2" - slash "^3.0.0" - source-map "^0.6.0" - string-length "^4.0.1" - terminal-link "^2.0.0" - v8-to-istanbul "^8.0.0" - "@jest/reporters@^27.2.4": version "27.2.4" resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.4.tgz#1482ff007f2e919d85c54b1563abb8b2ea2d5198" @@ -1302,16 +1194,6 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.2.tgz#cd4ba1ca9b0521e463bd4b32349ba1842277563b" - integrity sha512-yENoDEoWlEFI7l5z7UYyJb/y5Q8RqbPd4neAVhKr6l+vVaQOPKf8V/IseSMJI9+urDUIxgssA7RGNyCRhGjZvw== - dependencies: - "@jest/console" "^27.2.2" - "@jest/types" "^27.1.1" - "@types/istanbul-lib-coverage" "^2.0.0" - collect-v8-coverage "^1.0.0" - "@jest/test-result@^27.2.4": version "27.2.4" resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.4.tgz#d1ca8298d168f1b0be834bfb543b1ac0294c05d7" @@ -1322,16 +1204,6 @@ "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.2.tgz#9a6d735317f525741a5913ee3cdefeffc9b0aba6" - integrity sha512-YnJqwNQP2Zeu0S4TMqkxg6NN7Y1EFq715n/nThNKrvIS9wmRZjDt2XYqsHbuvhAFjshi0iKDQ813NewFITBH+Q== - dependencies: - "@jest/test-result" "^27.2.2" - graceful-fs "^4.2.4" - jest-haste-map "^27.2.2" - jest-runtime "^27.2.2" - "@jest/test-sequencer@^27.2.4": version "27.2.4" resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.4.tgz#df66422a3e9e7440ce8b7498e255fa6b52c0bc03" @@ -1342,27 +1214,6 @@ jest-haste-map "^27.2.4" jest-runtime "^27.2.4" -"@jest/transform@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.2.tgz#89b16b4de84354fb48d15712b3ea34cadc1cb600" - integrity sha512-l4Z/7PpajrOjCiXLWLfMY7fgljY0H8EwW7qdzPXXuv2aQF8kY2+Uyj3O+9Popnaw1V7JCw32L8EeI/thqFDkPA== - dependencies: - "@babel/core" "^7.1.0" - "@jest/types" "^27.1.1" - babel-plugin-istanbul "^6.0.0" - chalk "^4.0.0" - convert-source-map "^1.4.0" - fast-json-stable-stringify "^2.0.0" - graceful-fs "^4.2.4" - jest-haste-map "^27.2.2" - jest-regex-util "^27.0.6" - jest-util "^27.2.0" - micromatch "^4.0.4" - pirates "^4.0.1" - slash "^3.0.0" - source-map "^0.6.1" - write-file-atomic "^3.0.0" - "@jest/transform@^27.2.4": version "27.2.4" resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.4.tgz#2fe5b6836895f7a1b8bdec442c51e83943c62733" @@ -1384,17 +1235,6 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^27.1.1": - version "27.1.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.1.1.tgz#77a3fc014f906c65752d12123a0134359707c0ad" - integrity sha512-yqJPDDseb0mXgKqmNqypCsb85C22K1aY5+LUxh7syIM9n/b0AsaltxNy+o6tt29VcfGDpYEve175bm3uOhcehA== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^16.0.0" - chalk "^4.0.0" - "@jest/types@^27.2.4": version "27.2.4" resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.4.tgz#2430042a66e00dc5b140c3636f4474d464c21ee8" @@ -2206,34 +2046,34 @@ "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^10.5.0": - version "10.6.0" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-10.6.0.tgz#13278af3cbe7bb141dc4ae02c24eaff209efadfb" - integrity sha512-/iQtZq+zuQJrwawFyjixh333xPu4/KJKk0bFM/Omm4kFlTGw0dWXfq6xCOe5DqONW0faW29Cc9r6p2mvl72aTQ== +"@octokit/openapi-types@^10.6.4": + version "10.6.4" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-10.6.4.tgz#c8b5b1f5c60ab7c62858abe2ef57bc709f426a30" + integrity sha512-JVmwWzYTIs6jACYOwD6zu5rdrqGIYsiAsLzTCxdrWIPNKNVjEF6vPTL20shmgJ4qZsq7WPBcLXLsaQD+NLChfg== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz#e07896739618dab8da7d4077c658003775f95437" integrity sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw== -"@octokit/plugin-paginate-rest@^2.16.0": - version "2.16.5" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.16.5.tgz#4d8098410f4c4697d33979f06f38d2ed2574adf1" - integrity sha512-2PfRGymdBypqRes4Xelu0BAZZRCV/Qg0xgo8UB10UKoghCM+zg640+T5WkRsRD0edwfLBPP3VsJgDyDTG4EIYg== +"@octokit/plugin-paginate-rest@^2.16.4": + version "2.16.7" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.16.7.tgz#d25b6e650ba5a007002986f5fda66958d44e70a4" + integrity sha512-TMlyVhMPx6La1Ud4PSY4YxqAvb9YPEMs/7R1nBSbsw4wNqG73aBqls0r0dRRCWe5Pm0ZUGS9a94N46iAxlOR8A== dependencies: - "@octokit/types" "^6.31.0" + "@octokit/types" "^6.31.3" "@octokit/plugin-request-log@^1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== -"@octokit/plugin-rest-endpoint-methods@5.11.2": - version "5.11.2" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.11.2.tgz#f3c374cdf4197b25ee62d8e132538115039fb4cc" - integrity sha512-oOJ/gC3e6XS5OyvLhS32BslGkKAyt/tgbLJUH1PKfIyDiRm4c6lSm+NHpy/L9WcdiCQji0RPglXTIH+8degjBg== +"@octokit/plugin-rest-endpoint-methods@5.11.4": + version "5.11.4" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.11.4.tgz#221dedcbdc45d6bfa54228d469e8c34acb4e0e34" + integrity sha512-iS+GYTijrPUiEiLoDsGJhrbXIvOPfm2+schvr+FxNMs7PeE9Nl4bAMhE8ftfNX3Z1xLxSKwEZh0O7GbWurX5HQ== dependencies: - "@octokit/types" "^6.31.0" + "@octokit/types" "^6.31.2" deprecation "^2.3.1" "@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": @@ -2246,9 +2086,9 @@ once "^1.4.0" "@octokit/request@^5.6.0": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.1.tgz#f97aff075c37ab1d427c49082fefeef0dba2d8ce" - integrity sha512-Ls2cfs1OfXaOKzkcxnqw5MR6drMA/zWX/LIS/p8Yjdz7QKTPQLMsB3R+OvoxE6XnXeXEE2X7xe4G4l4X0gRiKQ== + version "5.6.2" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.2.tgz#1aa74d5da7b9e04ac60ef232edd9a7438dcf32d8" + integrity sha512-je66CvSEVf0jCpRISxkUcCa0UkxmFs6eGDRSbfJtAVwbLH5ceqF+YEyC8lj8ystKyZTy8adWr0qmkY52EfOeLA== dependencies: "@octokit/endpoint" "^6.0.1" "@octokit/request-error" "^2.1.0" @@ -2258,21 +2098,21 @@ universal-user-agent "^6.0.0" "@octokit/rest@^18.1.0": - version "18.11.1" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.11.1.tgz#6baa998fcb6ede938e4df6e2567846bc7cb50b72" - integrity sha512-UadwFo10+5TQ/gm/E1r1M3Wkz8WUNyX3TLBO64YmlyZFoCPPLwdhVDHFJ+XGL/+sErPiyps3drvx1I9vMncunA== + version "18.11.4" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.11.4.tgz#9fb6d826244554fbf8c110b9064018d7198eec51" + integrity sha512-QplypCyYxqMK05JdMSm/bDWZO8VWWaBdzQ9tbF9rEV9rIEiICh+v6q+Vu/Y5hdze8JJaxfUC+PBC7vrnEkZvZg== dependencies: "@octokit/core" "^3.5.1" - "@octokit/plugin-paginate-rest" "^2.16.0" + "@octokit/plugin-paginate-rest" "^2.16.4" "@octokit/plugin-request-log" "^1.0.4" - "@octokit/plugin-rest-endpoint-methods" "5.11.2" + "@octokit/plugin-rest-endpoint-methods" "5.11.4" -"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.31.0": - version "6.31.0" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.31.0.tgz#b444852100090d1c5d0015614860c6131dc217e8" - integrity sha512-xobpvYmMYoFSxZB6jL1TPTMMZkxZIBlY145ZKibBJDKCczP1FrLLougtuVOZywGVZdcYs8oq2Bxb3aMjqIFeiw== +"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.31.2", "@octokit/types@^6.31.3": + version "6.31.3" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.31.3.tgz#14c2961baea853b2bf148d892256357a936343f8" + integrity sha512-IUG3uMpsLHrtEL6sCVXbxCgnbKcgpkS4K7gVEytLDvYYalkK3XcuMCHK1YPD8xJglSJAOAbL4MgXp47rS9G49w== dependencies: - "@octokit/openapi-types" "^10.5.0" + "@octokit/openapi-types" "^10.6.4" "@rollup/pluginutils@^4.1.0": version "4.1.1" @@ -2289,13 +2129,6 @@ dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^7.0.2": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-7.1.2.tgz#2524eae70c4910edccf99b2f4e6efc5894aff7b5" - integrity sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg== - dependencies: - "@sinonjs/commons" "^1.7.0" - "@sinonjs/fake-timers@^8.0.1": version "8.0.1" resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.0.1.tgz#1c1c9a91419f804e59ae8df316a07dd1c3a76b94" @@ -2303,6 +2136,17 @@ dependencies: "@sinonjs/commons" "^1.7.0" +"@testing-library/react-hooks@^7.0.2": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@testing-library/react-hooks/-/react-hooks-7.0.2.tgz#3388d07f562d91e7f2431a4a21b5186062ecfee0" + integrity sha512-dYxpz8u9m4q1TuzfcUApqi8iFfR6R0FaMbr2hjZJy1uC8z+bO/K4v8Gs9eogGKYQop7QsrBTFkv/BCF7MzD2Cg== + dependencies: + "@babel/runtime" "^7.12.5" + "@types/react" ">=16.9.0" + "@types/react-dom" ">=16.9.0" + "@types/react-test-renderer" ">=16.9.0" + react-error-boundary "^3.1.0" + "@tootallnate/once@1": version "1.1.2" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" @@ -2393,12 +2237,14 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== -"@types/node@*", "@types/node@^16.10.1": - version "16.10.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.1.tgz#f3647623199ca920960006b3dccf633ea905f243" - integrity sha512-4/Z9DMPKFexZj/Gn3LylFgamNKHm4K3QDi0gz9B26Uk0c8izYf97B5fxfpspMNkWlFupblKM/nV8+NA9Ffvr+w== +"@types/node-fetch@^3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-3.0.3.tgz#9d969c9a748e841554a40ee435d26e53fa3ee899" + integrity sha512-HhggYPH5N+AQe/OmN6fmhKmRRt2XuNJow+R3pQwJxOOF9GuwM7O2mheyGeIrs5MOIeNjDEdgdoyHBOrFeJBR3g== + dependencies: + node-fetch "*" -"@types/node@^16.10.2": +"@types/node@*", "@types/node@^16.10.2": version "16.10.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.2.tgz#5764ca9aa94470adb4e1185fe2e9f19458992b2e" integrity sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ== @@ -2414,35 +2260,33 @@ integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== "@types/prettier@*", "@types/prettier@^2.1.5": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.0.tgz#900b13362610ccd3570fb6eefb911a6732973d00" - integrity sha512-WHRsy5nMpjXfU9B0LqOqPT06EI2+8Xv5NERy0pLxJLbU98q7uhcGogQzfX+rXpU7S5mgHsLxHrLCufZcV/P8TQ== + version "2.4.1" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.1.tgz#e1303048d5389563e130f5bdd89d37a99acb75eb" + integrity sha512-Fo79ojj3vdEZOHg3wR9ksAMRz4P3S5fDB5e/YWZiFnyFQI1WY2Vftu9XoXVVtJfxB7Bpce/QTqWSSntkz2Znrw== "@types/prop-types@*": version "15.7.4" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11" integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ== -"@types/react-test-renderer@^17.0.1": +"@types/react-dom@>=16.9.0": + version "17.0.9" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.9.tgz#441a981da9d7be117042e1a6fd3dac4b30f55add" + integrity sha512-wIvGxLfgpVDSAMH5utdL9Ngm5Owu0VsGmldro3ORLXV8CShrL8awVj06NuEXFQ5xyaYfdca7Sgbk/50Ri1GdPg== + dependencies: + "@types/react" "*" + +"@types/react-test-renderer@>=16.9.0": version "17.0.1" resolved "https://registry.yarnpkg.com/@types/react-test-renderer/-/react-test-renderer-17.0.1.tgz#3120f7d1c157fba9df0118dae20cb0297ee0e06b" integrity sha512-3Fi2O6Zzq/f3QR9dRnlnHso9bMl7weKCviFmfF6B4LS1Uat6Hkm15k0ZAQuDz+UBq6B3+g+NM6IT2nr5QgPzCw== dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^17.0.24": - version "17.0.24" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.24.tgz#7e1b3f78d0fc53782543f9bce6d949959a5880bd" - integrity sha512-eIpyco99gTH+FTI3J7Oi/OH8MZoFMJuztNRimDOJwH4iGIsKV2qkGnk4M9VzlaVWeEEWLWSQRy0FEA0Kz218cg== - dependencies: - "@types/prop-types" "*" - "@types/scheduler" "*" - csstype "^3.0.2" - -"@types/react@^17.0.26": - version "17.0.26" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.26.tgz#960ea4b3518cc154ed7df3b35656c508df653331" - integrity sha512-MXxuXrH2xOcv5cp/su4oz69dNQnSA90JjFw5HBd5wifw6Ihi94j7dRJm7qNsB30tnruXSCPc9qmlhGop4nh9Hw== +"@types/react@*", "@types/react@>=16.9.0", "@types/react@^17.0.27": + version "17.0.27" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.27.tgz#6498ed9b3ad117e818deb5525fa1946c09f2e0e6" + integrity sha512-zgiJwtsggVGtr53MndV7jfiUESTqrbxOcBvwfe6KS/9bzaVPCTDieTWnFNecVNx6EAaapg5xsLLWFfHHR437AA== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -2499,24 +2343,6 @@ "@typescript-eslint/typescript-estree" "4.32.0" debug "^4.3.1" -"@typescript-eslint/parser@^4.9.1": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.31.2.tgz#54aa75986e3302d91eff2bbbaa6ecfa8084e9c34" - integrity sha512-EcdO0E7M/sv23S/rLvenHkb58l3XhuSZzKf6DBvLgHqOYdL6YFMYVtreGFWirxaU2mS1GYDby3Lyxco7X5+Vjw== - dependencies: - "@typescript-eslint/scope-manager" "4.31.2" - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/typescript-estree" "4.31.2" - debug "^4.3.1" - -"@typescript-eslint/scope-manager@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.31.2.tgz#1d528cb3ed3bcd88019c20a57c18b897b073923a" - integrity sha512-2JGwudpFoR/3Czq6mPpE8zBPYdHWFGL6lUNIGolbKQeSNv4EAiHaR5GVDQaLA0FwgcdcMtRk+SBJbFGL7+La5w== - dependencies: - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/visitor-keys" "4.31.2" - "@typescript-eslint/scope-manager@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.32.0.tgz#e03c8668f8b954072b3f944d5b799c0c9225a7d5" @@ -2525,29 +2351,11 @@ "@typescript-eslint/types" "4.32.0" "@typescript-eslint/visitor-keys" "4.32.0" -"@typescript-eslint/types@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.31.2.tgz#2aea7177d6d744521a168ed4668eddbd912dfadf" - integrity sha512-kWiTTBCTKEdBGrZKwFvOlGNcAsKGJSBc8xLvSjSppFO88AqGxGNYtF36EuEYG6XZ9vT0xX8RNiHbQUKglbSi1w== - "@typescript-eslint/types@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.32.0.tgz#52c633c18da47aee09449144bf59565ab36df00d" integrity sha512-LE7Z7BAv0E2UvqzogssGf1x7GPpUalgG07nGCBYb1oK4mFsOiFC/VrSMKbZQzFJdN2JL5XYmsx7C7FX9p9ns0w== -"@typescript-eslint/typescript-estree@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.2.tgz#abfd50594d8056b37e7428df3b2d185ef2d0060c" - integrity sha512-ieBq8U9at6PvaC7/Z6oe8D3czeW5d//Fo1xkF/s9394VR0bg/UaMYPdARiWyKX+lLEjY3w/FNZJxitMsiWv+wA== - dependencies: - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/visitor-keys" "4.31.2" - debug "^4.3.1" - globby "^11.0.3" - is-glob "^4.0.1" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.32.0.tgz#db00ccc41ccedc8d7367ea3f50c6994b8efa9f3b" @@ -2561,14 +2369,6 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.2.tgz#7d5b4a4705db7fe59ecffb273c1d082760f635cc" - integrity sha512-PrBId7EQq2Nibns7dd/ch6S6/M4/iwLM9McbgeEbCXfxdwRUNxJ4UNreJ6Gh3fI2GNKNrWnQxKL7oCPmngKBug== - dependencies: - "@typescript-eslint/types" "4.31.2" - eslint-visitor-keys "^2.0.0" - "@typescript-eslint/visitor-keys@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.32.0.tgz#455ba8b51242f2722a497ffae29313f33b14cb7f" @@ -2683,11 +2483,11 @@ ajv@^8.0.1: uri-js "^4.2.2" ansi-align@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb" - integrity sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw== + version "3.0.1" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" + integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== dependencies: - string-width "^3.0.0" + string-width "^4.1.0" ansi-colors@^4.1.1: version "4.1.1" @@ -2711,11 +2511,6 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= -ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" @@ -2845,20 +2640,6 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== -babel-jest@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.2.tgz#d7e96f3f6f56be692de948092697e1bfea7f1184" - integrity sha512-XNFNNfGKnZXzhej7TleVP4s9ktH5JjRW8Rmcbb223JJwKB/gmTyeWN0JfiPtSgnjIjDXtKNoixiy0QUHtv3vFA== - dependencies: - "@jest/transform" "^27.2.2" - "@jest/types" "^27.1.1" - "@types/babel__core" "^7.1.14" - babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^27.2.0" - chalk "^4.0.0" - graceful-fs "^4.2.4" - slash "^3.0.0" - babel-jest@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.4.tgz#21ed6729d51bdd75470bbbf3c8b08d86209fb0dc" @@ -2910,13 +2691,6 @@ babel-plugin-jest-hoist@^27.2.0: "@types/babel__core" "^7.0.0" "@types/babel__traverse" "^7.0.6" -babel-plugin-jsx-pragmatic@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/babel-plugin-jsx-pragmatic/-/babel-plugin-jsx-pragmatic-1.0.2.tgz#41e2beb8642235f34b2a7ab12ca39e07201b8e59" - integrity sha1-QeK+uGQiNfNLKnqxLKOeByAbjlk= - dependencies: - babel-plugin-syntax-jsx "^6.0.0" - babel-plugin-polyfill-corejs2@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz#e9124785e6fd94f94b618a7954e5693053bf5327" @@ -2941,11 +2715,6 @@ babel-plugin-polyfill-regenerator@^0.2.2: dependencies: "@babel/helper-define-polyfill-provider" "^0.2.2" -babel-plugin-syntax-jsx@^6.0.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" - integrity sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY= - babel-plugin-tester@^10.0.0: version "10.1.0" resolved "https://registry.yarnpkg.com/babel-plugin-tester/-/babel-plugin-tester-10.1.0.tgz#e099ee1d8dec538439c427a7d12aad132885757b" @@ -3045,15 +2814,15 @@ browser-process-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== -browserslist@^4.16.6, browserslist@^4.17.0: - version "4.17.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.1.tgz#a98d104f54af441290b7d592626dd541fa642eb9" - integrity sha512-aLD0ZMDSnF4lUt4ZDNgqi5BUn9BZ7YdQdI/cYlILrhdSSZJLU9aNZoD5/NBmM4SK34APB2e83MOsRt1EnkuyaQ== +browserslist@^4.16.6, browserslist@^4.17.1: + version "4.17.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.2.tgz#aa15dbd2fab399a399fe4df601bb09363c5458a6" + integrity sha512-jSDZyqJmkKMEMi7SZAgX5UltFdR5NAO43vY0AwTpu4X3sGH7GLLQ83KiUomgrnvZRCeW0yPPnKqnxPqQOER9zQ== dependencies: - caniuse-lite "^1.0.30001259" - electron-to-chromium "^1.3.846" + caniuse-lite "^1.0.30001261" + electron-to-chromium "^1.3.854" escalade "^3.1.1" - nanocolors "^0.1.5" + nanocolors "^0.2.12" node-releases "^1.1.76" bser@2.1.1: @@ -3158,12 +2927,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== -caniuse-lite@^1.0.30001259: - version "1.0.30001260" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001260.tgz#e3be3f34ddad735ca4a2736fa9e768ef34316270" - integrity sha512-Fhjc/k8725ItmrvW5QomzxLeojewxvqiYCKeFcfFEhut28IVLdpHU19dneOmltZQIE5HNbawj1HYD+1f2bM1Dg== - dependencies: - nanocolors "^0.1.0" +caniuse-lite@^1.0.30001261: + version "1.0.30001264" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001264.tgz#88f625a60efb6724c7c62ac698bc8dbd9757e55b" + integrity sha512-Ftfqqfcs/ePiUmyaySsQ4PUsdcYyXG2rfoBVsk3iY1ahHaJEw65vfb7Suzqm+cEkwwPIv/XWkg27iCpRavH4zA== caseless@~0.12.0: version "0.12.0" @@ -3526,17 +3293,17 @@ convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.6.0, safe-buffer "~5.1.1" core-js-compat@^3.16.0, core-js-compat@^3.16.2: - version "3.18.0" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.18.0.tgz#fb360652201e8ac8da812718c008cd0482ed9b42" - integrity sha512-tRVjOJu4PxdXjRMEgbP7lqWy1TWJu9a01oBkn8d+dNrhgmBwdTkzhHZpVJnEmhISLdoJI1lX08rcBcHi3TZIWg== + version "3.18.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.18.1.tgz#01942a0877caf9c6e5007c027183cf0bdae6a191" + integrity sha512-XJMYx58zo4W0kLPmIingVZA10+7TuKrMLPt83+EzDmxFJQUMcTVVmQ+n5JP4r6Z14qSzhQBRi3NSWoeVyKKXUg== dependencies: - browserslist "^4.17.0" + browserslist "^4.17.1" semver "7.0.0" core-js@^3.0.0: - version "3.18.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.18.0.tgz#9af3f4a6df9ba3428a3fb1b171f1503b3f40cc49" - integrity sha512-WJeQqq6jOYgVgg4NrXKL0KLQhi0CT4ZOCvFL+3CQ5o7I6J8HkT5wd53EadMfqTDp1so/MT1J+w2ujhWcCJtN7w== + version "3.18.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.18.1.tgz#289d4be2ce0085d40fc1244c0b1a54c00454622f" + integrity sha512-vJlUi/7YdlCZeL6fXvWNaLUPh/id12WXj3MbkMw5uOyF0PfWPBNOCNbs53YqgrvtujLNlt9JQpruyIKkUZ+PKA== core-util-is@1.0.2: version "1.0.2" @@ -3791,21 +3558,16 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -electron-to-chromium@^1.3.846: - version "1.3.850" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.850.tgz#c56c72abfeab051b4b328beb894461c5912d0456" - integrity sha512-ZzkDcdzePeF4dhoGZQT77V2CyJOpwfTZEOg4h0x6R/jQhGt/rIRpbRyVreWLtD7B/WsVxo91URm2WxMKR9JQZA== +electron-to-chromium@^1.3.854: + version "1.3.857" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.857.tgz#dcc239ff8a12b6e4b501e6a5ad20fd0d5a3210f9" + integrity sha512-a5kIr2lajm4bJ5E4D3fp8Y/BRB0Dx2VOcCRE5Gtb679mXIME/OFhWler8Gy2ksrf8gFX+EFCSIGA33FB3gqYpg== emittery@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" integrity sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg== -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -3847,10 +3609,10 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.18.0-next.2, es-abstract@^1.18.2: - version "1.18.6" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.6.tgz#2c44e3ea7a6255039164d26559777a6d978cb456" - integrity sha512-kAeIT4cku5eNLNuUKhlmtuk1/TRZvQoYccn6TO0cSVdf1kzB0T7+dYuVK9MWM7l+/53W2Q8M7N2c6MQvhXFcUQ== +es-abstract@^1.18.0-next.2, es-abstract@^1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" + integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== dependencies: call-bind "^1.0.2" es-to-primitive "^1.2.1" @@ -3863,7 +3625,9 @@ es-abstract@^1.18.0-next.2, es-abstract@^1.18.2: is-callable "^1.2.4" is-negative-zero "^2.0.1" is-regex "^1.1.4" + is-shared-array-buffer "^1.0.1" is-string "^1.0.7" + is-weakref "^1.0.1" object-inspect "^1.11.0" object-keys "^1.1.1" object.assign "^4.1.2" @@ -4068,18 +3832,6 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.2.tgz#65c414697415c0867ef588813e9c729ebab8a9a9" - integrity sha512-sjHBeEk47/eshN9oLbvPJZMgHQihOXXQzSMPCJ4MqKShbU9HOVFSNHEEU4dp4ujzxFSiNvPFzB2AMOFmkizhvA== - dependencies: - "@jest/types" "^27.1.1" - ansi-styles "^5.0.0" - jest-get-type "^27.0.6" - jest-matcher-utils "^27.2.2" - jest-message-util "^27.2.2" - jest-regex-util "^27.0.6" - expect@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.4.tgz#4debf546050bcdad8914a8c95fec7662e02bf67c" @@ -4864,9 +4616,9 @@ is-ci@^3.0.0: ci-info "^3.1.1" is-core-module@^2.2.0, is-core-module@^2.5.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.6.0.tgz#d7553b2526fe59b92ba3e40c8df757ec8a709e19" - integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ== + version "2.7.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.7.0.tgz#3c0ef7d31b4acfc574f80c58409d568a836848e3" + integrity sha512-ByY+tjCciCr+9nLryBYcSD50EOGWt95c7tIsKTG1J2ixKKXPvF7Ej3AVd+UfDydAJom3biBGDBALaO79ktwgEQ== dependencies: has "^1.0.3" @@ -4905,9 +4657,9 @@ is-generator-fn@^2.0.0: integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" @@ -4988,6 +4740,11 @@ is-regexp@^1.0.0: resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= +is-shared-array-buffer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" + integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== + is-ssh@^1.3.0: version "1.3.3" resolved "https://registry.yarnpkg.com/is-ssh/-/is-ssh-1.3.3.tgz#7f133285ccd7f2c2c7fc897b771b53d95a2b2c7e" @@ -5036,6 +4793,13 @@ is-unicode-supported@^0.1.0: resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== +is-weakref@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.1.tgz#842dba4ec17fa9ac9850df2d6efbc1737274f2a2" + integrity sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ== + dependencies: + call-bind "^1.0.0" + isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -5097,15 +4861,6 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.1.1.tgz#9b3f67a34cc58e3e811e2e1e21529837653e4200" - integrity sha512-5TV9+fYlC2A6hu3qtoyGHprBwCAn0AuGA77bZdUgYvVlRMjHXo063VcWTEAyx6XAZ85DYHqp0+aHKbPlfRDRvA== - dependencies: - "@jest/types" "^27.1.1" - execa "^5.0.0" - throat "^6.0.1" - jest-changed-files@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.2.4.tgz#d7de46e90e5a599c47e260760f5ab53516e835e6" @@ -5115,31 +4870,6 @@ jest-changed-files@^27.2.4: execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.2.tgz#a3647082f3eba1226f7664a36a2b7ebf45ceaf7b" - integrity sha512-8txlqs0EDrvPasCgwfLMkG0l3F4FxqQa6lxOsvYfOl04eSJjRw3F4gk9shakuC00nMD+VT+SMtFYXxe64f0VZw== - dependencies: - "@jest/environment" "^27.2.2" - "@jest/test-result" "^27.2.2" - "@jest/types" "^27.1.1" - "@types/node" "*" - chalk "^4.0.0" - co "^4.6.0" - dedent "^0.7.0" - expect "^27.2.2" - is-generator-fn "^2.0.0" - jest-each "^27.2.2" - jest-matcher-utils "^27.2.2" - jest-message-util "^27.2.2" - jest-runtime "^27.2.2" - jest-snapshot "^27.2.2" - jest-util "^27.2.0" - pretty-format "^27.2.2" - slash "^3.0.0" - stack-utils "^2.0.3" - throat "^6.0.1" - jest-circus@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.4.tgz#3bd898a29dcaf6a506f3f1b780dff5f67ca83c23" @@ -5165,24 +4895,6 @@ jest-circus@^27.2.4: stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.2.tgz#0973a717c109f23de642b63486f3cb71c5a971be" - integrity sha512-jbEythw22LR/IHYgNrjWdO74wO9wyujCxTMjbky0GLav4rC4y6qDQr4TqQ2JPP51eDYJ2awVn83advEVSs5Brg== - dependencies: - "@jest/core" "^27.2.2" - "@jest/test-result" "^27.2.2" - "@jest/types" "^27.1.1" - chalk "^4.0.0" - exit "^0.1.2" - graceful-fs "^4.2.4" - import-local "^3.0.2" - jest-config "^27.2.2" - jest-util "^27.2.0" - jest-validate "^27.2.2" - prompts "^2.0.1" - yargs "^16.0.3" - jest-cli@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.4.tgz#acda7f367aa6e674723fc1a7334e0ae1799448d2" @@ -5201,33 +4913,6 @@ jest-cli@^27.2.4: prompts "^2.0.1" yargs "^16.2.0" -jest-config@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.2.tgz#970d8466c60ac106ac9d7d0b8dcf3ff150fa713a" - integrity sha512-2nhms3lp52ZpU0636bB6zIFHjDVtYxzFQIOHZjBFUeXcb6b41sEkWojbHaJ4FEIO44UbccTLa7tvNpiFCgPE7w== - dependencies: - "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.2.2" - "@jest/types" "^27.1.1" - babel-jest "^27.2.2" - chalk "^4.0.0" - deepmerge "^4.2.2" - glob "^7.1.1" - graceful-fs "^4.2.4" - is-ci "^3.0.0" - jest-circus "^27.2.2" - jest-environment-jsdom "^27.2.2" - jest-environment-node "^27.2.2" - jest-get-type "^27.0.6" - jest-jasmine2 "^27.2.2" - jest-regex-util "^27.0.6" - jest-resolve "^27.2.2" - jest-runner "^27.2.2" - jest-util "^27.2.0" - jest-validate "^27.2.2" - micromatch "^4.0.4" - pretty-format "^27.2.2" - jest-config@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.4.tgz#0204969f5ae2e5190d47be2c14c04d631b7836e2" @@ -5255,17 +4940,7 @@ jest-config@^27.2.4: micromatch "^4.0.4" pretty-format "^27.2.4" -jest-diff@^27.0.0, jest-diff@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.2.tgz#3992fe5f55f209676c5d3fd956e3f3d4145f76b8" - integrity sha512-o3LaDbQDSaMJif4yztJAULI4xVatxbBasbKLbEw3K8CiRdDdbxMrLArS9EKDHQFYh6Tgfrm1PC2mIYR1xhu0hQ== - dependencies: - chalk "^4.0.0" - diff-sequences "^27.0.6" - jest-get-type "^27.0.6" - pretty-format "^27.2.2" - -jest-diff@^27.2.4: +jest-diff@^27.0.0, jest-diff@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.4.tgz#171c51d3d2c105c457100fee6e7bf7cee51c8d8c" integrity sha512-bLAVlDSCR3gqUPGv+4nzVpEXGsHh98HjUL7Vb2hVyyuBDoQmja8eJb0imUABsuxBeUVmf47taJSAd9nDrwWKEg== @@ -5282,17 +4957,6 @@ jest-docblock@^27.0.6: dependencies: detect-newline "^3.0.0" -jest-each@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.2.2.tgz#62da8dd68b9fc61ab6e9e344692eeb1251f8c91d" - integrity sha512-ZCDhkvwHeXHsxoFxvW43fabL18iLiVDxaipG5XWG7dSd+XWXXpzMQvBWYT9Wvzhg5x4hvrLQ24LtiOKw3I09xA== - dependencies: - "@jest/types" "^27.1.1" - chalk "^4.0.0" - jest-get-type "^27.0.6" - jest-util "^27.2.0" - pretty-format "^27.2.2" - jest-each@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.2.4.tgz#b4f280aafd63129ba82e345f0e74c5a10200aeef" @@ -5304,19 +4968,6 @@ jest-each@^27.2.4: jest-util "^27.2.4" pretty-format "^27.2.4" -jest-environment-jsdom@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.2.tgz#fb3075b4be6289961dcc4942e98f1862b3a8c4cb" - integrity sha512-mzCLEdnpGWDJmNB6WIPLlZM+hpXdeiya9TryiByqcUdpliNV1O+LGC2SewzjmB4IblabGfvr3KcPN0Nme2wnDw== - dependencies: - "@jest/environment" "^27.2.2" - "@jest/fake-timers" "^27.2.2" - "@jest/types" "^27.1.1" - "@types/node" "*" - jest-mock "^27.1.1" - jest-util "^27.2.0" - jsdom "^16.6.0" - jest-environment-jsdom@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.4.tgz#39ae80bbb8675306bfaf0440be1e5f877554539a" @@ -5330,18 +4981,6 @@ jest-environment-jsdom@^27.2.4: jest-util "^27.2.4" jsdom "^16.6.0" -jest-environment-node@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.2.tgz#60ba7d7fee956f68964d47a785d0195ce125aaa3" - integrity sha512-XgUscWs6H6UNqC96/QJjmUGZzzpql/JyprLSXVu7wkgM8tjbJdEkSqwrVAvJPm1yu526ImrmsIoh2BTHxkwL/g== - dependencies: - "@jest/environment" "^27.2.2" - "@jest/fake-timers" "^27.2.2" - "@jest/types" "^27.1.1" - "@types/node" "*" - jest-mock "^27.1.1" - jest-util "^27.2.0" - jest-environment-node@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.4.tgz#b79f98cb36e0c9111aac859c9c99f04eb2f74ff6" @@ -5359,26 +4998,6 @@ jest-get-type@^27.0.6: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== -jest-haste-map@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.2.2.tgz#81ccb57b1e1cd513aaaadf5016aad5dab0ede552" - integrity sha512-kaKiq+GbAvk6/sq++Ymor4Vzk6+lr0vbKs2HDVPdkKsHX2lIJRyvhypZG/QsNfQnROKWIZSpUpGuv2HySSosvA== - dependencies: - "@jest/types" "^27.1.1" - "@types/graceful-fs" "^4.1.2" - "@types/node" "*" - anymatch "^3.0.3" - fb-watchman "^2.0.0" - graceful-fs "^4.2.4" - jest-regex-util "^27.0.6" - jest-serializer "^27.0.6" - jest-util "^27.2.0" - jest-worker "^27.2.2" - micromatch "^4.0.4" - walker "^1.0.7" - optionalDependencies: - fsevents "^2.3.2" - jest-haste-map@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.2.4.tgz#f8974807bedf07348ca9fd24e5861ab7c8e61aba" @@ -5399,30 +5018,6 @@ jest-haste-map@^27.2.4: optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.2.tgz#bf87c8820a192c86b65a7c4c1a54caae52124f04" - integrity sha512-SczhZNfmZID9HbJ1GHhO4EzeL/PMRGeAUw23ddPUdd6kFijEZpT2yOxyNCBUKAsVQ/14OB60kjgnbuFOboZUNg== - dependencies: - "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.2.2" - "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.2.2" - "@jest/types" "^27.1.1" - "@types/node" "*" - chalk "^4.0.0" - co "^4.6.0" - expect "^27.2.2" - is-generator-fn "^2.0.0" - jest-each "^27.2.2" - jest-matcher-utils "^27.2.2" - jest-message-util "^27.2.2" - jest-runtime "^27.2.2" - jest-snapshot "^27.2.2" - jest-util "^27.2.0" - pretty-format "^27.2.2" - throat "^6.0.1" - jest-jasmine2@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.4.tgz#4a1608133dbdb4d68b5929bfd785503ed9c9ba51" @@ -5447,14 +5042,6 @@ jest-jasmine2@^27.2.4: pretty-format "^27.2.4" throat "^6.0.1" -jest-leak-detector@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.2.tgz#5af54273efcf5114ad406f4448860c2396319e12" - integrity sha512-fQIYKkhXUs/4EpE4wO1AVsv7aNH3o0km1BGq3vxvSfYdwG9GLMf+b0z/ghLmBYNxb+tVpm/zv2caoKm3GfTazg== - dependencies: - jest-get-type "^27.0.6" - pretty-format "^27.2.2" - jest-leak-detector@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.4.tgz#9bb7eab26a73bb280e9298be8d80f389288ec8f1" @@ -5463,16 +5050,6 @@ jest-leak-detector@^27.2.4: jest-get-type "^27.0.6" pretty-format "^27.2.4" -jest-matcher-utils@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.2.tgz#a6c0a10dce6bfe8250bbed3e2f1b206568d73bde" - integrity sha512-xN3wT4p2i9DGB6zmL3XxYp5lJmq9Q6ff8XKlMtVVBS2SAshmgsPBALJFQ8dWRd2G/xf5q/N0SD0Mipt8QBA26A== - dependencies: - chalk "^4.0.0" - jest-diff "^27.2.2" - jest-get-type "^27.0.6" - pretty-format "^27.2.2" - jest-matcher-utils@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.4.tgz#008fff018151415ad1b6cfc083fd70fe1e012525" @@ -5483,21 +5060,6 @@ jest-matcher-utils@^27.2.4: jest-get-type "^27.0.6" pretty-format "^27.2.4" -jest-message-util@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.2.tgz#cdbb1b82dfe5f601ae35f5c6a28bf7823e6bcf99" - integrity sha512-/iS5/m2FSF7Nn6APFoxFymJpyhB/gPf0CJa7uFSkbYaWvrADUfQ9NTsuyjpszKErOS2/huFs44ysWhlQTKvL8Q== - dependencies: - "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.1.1" - "@types/stack-utils" "^2.0.0" - chalk "^4.0.0" - graceful-fs "^4.2.4" - micromatch "^4.0.4" - pretty-format "^27.2.2" - slash "^3.0.0" - stack-utils "^2.0.3" - jest-message-util@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.4.tgz#667e8c0f2b973156d1bac7398a7f677705cafaca" @@ -5513,14 +5075,6 @@ jest-message-util@^27.2.4: slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.1.1.tgz#c7a2e81301fdcf3dab114931d23d89ec9d0c3a82" - integrity sha512-SClsFKuYBf+6SSi8jtAYOuPw8DDMsTElUWEae3zq7vDhH01ayVSIHUSIa8UgbDOUalCFp6gNsaikN0rbxN4dbw== - dependencies: - "@jest/types" "^27.1.1" - "@types/node" "*" - jest-mock@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.2.4.tgz#c8f0ef33f73d8ff53e3f60b16d59f1128f4072ae" @@ -5539,15 +5093,6 @@ jest-regex-util@^27.0.6: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.2.tgz#7467c67cb8b5630ec28e2f0c72a0b62e56668083" - integrity sha512-nvJS+DyY51HHdZnMIwXg7fimQ5ylFx4+quQXspQXde2rXYy+4v75UYoX/J65Ln8mKCNc6YF8HEhfGaRBOrxxHg== - dependencies: - "@jest/types" "^27.1.1" - jest-regex-util "^27.0.6" - jest-snapshot "^27.2.2" - jest-resolve-dependencies@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.4.tgz#20c41cc02b66aa45169b282356ec73b133013089" @@ -5557,22 +5102,6 @@ jest-resolve-dependencies@^27.2.4: jest-regex-util "^27.0.6" jest-snapshot "^27.2.4" -jest-resolve@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.2.tgz#1bad93dbc6c20edb874e6720e82e4e48900b120b" - integrity sha512-tfbHcBs/hJTb3fPQ/3hLWR+TsLNTzzK98TU+zIAsrL9nNzWfWROwopUOmiSUqmHMZW5t9au/433kSF2/Af+tTw== - dependencies: - "@jest/types" "^27.1.1" - chalk "^4.0.0" - escalade "^3.1.1" - graceful-fs "^4.2.4" - jest-haste-map "^27.2.2" - jest-pnp-resolver "^1.2.2" - jest-util "^27.2.0" - jest-validate "^27.2.2" - resolve "^1.20.0" - slash "^3.0.0" - jest-resolve@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.4.tgz#d3b999f073ff84a8ae109ce99ff7f3223048701a" @@ -5589,34 +5118,6 @@ jest-resolve@^27.2.4: resolve "^1.20.0" slash "^3.0.0" -jest-runner@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.2.tgz#e719a8ce2a16575677105f692fdff7cd00602325" - integrity sha512-+bUFwBq+yTnvsOFuxetoQtkuOnqdAk2YuIGjlLmc7xLAXn/V1vjhXrLencgij0BUTTUvG9Aul3+5XDss4Wa8Eg== - dependencies: - "@jest/console" "^27.2.2" - "@jest/environment" "^27.2.2" - "@jest/test-result" "^27.2.2" - "@jest/transform" "^27.2.2" - "@jest/types" "^27.1.1" - "@types/node" "*" - chalk "^4.0.0" - emittery "^0.8.1" - exit "^0.1.2" - graceful-fs "^4.2.4" - jest-docblock "^27.0.6" - jest-environment-jsdom "^27.2.2" - jest-environment-node "^27.2.2" - jest-haste-map "^27.2.2" - jest-leak-detector "^27.2.2" - jest-message-util "^27.2.2" - jest-resolve "^27.2.2" - jest-runtime "^27.2.2" - jest-util "^27.2.0" - jest-worker "^27.2.2" - source-map-support "^0.5.6" - throat "^6.0.1" - jest-runner@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.4.tgz#d816f4cb4af04f3cba703afcf5a35a335b77cad4" @@ -5645,39 +5146,6 @@ jest-runner@^27.2.4: source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.2.tgz#cc29d3adde948d531657a67d33c9f8d9bb58a6fc" - integrity sha512-PtTHCK5jT+KrIpKpjJsltu/dK5uGhBtTNLOk1Z+ZD2Jrxam2qQsOqDFYLszcK0jc2TLTNsrVpclqSftn7y3aXA== - dependencies: - "@jest/console" "^27.2.2" - "@jest/environment" "^27.2.2" - "@jest/fake-timers" "^27.2.2" - "@jest/globals" "^27.2.2" - "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.2.2" - "@jest/transform" "^27.2.2" - "@jest/types" "^27.1.1" - "@types/yargs" "^16.0.0" - chalk "^4.0.0" - cjs-module-lexer "^1.0.0" - collect-v8-coverage "^1.0.0" - execa "^5.0.0" - exit "^0.1.2" - glob "^7.1.3" - graceful-fs "^4.2.4" - jest-haste-map "^27.2.2" - jest-message-util "^27.2.2" - jest-mock "^27.1.1" - jest-regex-util "^27.0.6" - jest-resolve "^27.2.2" - jest-snapshot "^27.2.2" - jest-util "^27.2.0" - jest-validate "^27.2.2" - slash "^3.0.0" - strip-bom "^4.0.0" - yargs "^16.0.3" - jest-runtime@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.4.tgz#170044041e5d30625ab8d753516bbe503f213a5c" @@ -5719,36 +5187,6 @@ jest-serializer@^27.0.6: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.2.tgz#898f0eedde658e723461d3cdcaedb404e716fa01" - integrity sha512-7ODSvULMiiOVuuLvLZpDlpqqTqX9hDfdmijho5auVu9qRYREolvrvgH4kSNOKfcqV3EZOTuLKNdqsz1PM20PQA== - dependencies: - "@babel/core" "^7.7.2" - "@babel/generator" "^7.7.2" - "@babel/parser" "^7.7.2" - "@babel/plugin-syntax-typescript" "^7.7.2" - "@babel/traverse" "^7.7.2" - "@babel/types" "^7.0.0" - "@jest/transform" "^27.2.2" - "@jest/types" "^27.1.1" - "@types/babel__traverse" "^7.0.4" - "@types/prettier" "^2.1.5" - babel-preset-current-node-syntax "^1.0.0" - chalk "^4.0.0" - expect "^27.2.2" - graceful-fs "^4.2.4" - jest-diff "^27.2.2" - jest-get-type "^27.0.6" - jest-haste-map "^27.2.2" - jest-matcher-utils "^27.2.2" - jest-message-util "^27.2.2" - jest-resolve "^27.2.2" - jest-util "^27.2.0" - natural-compare "^1.4.0" - pretty-format "^27.2.2" - semver "^7.3.2" - jest-snapshot@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.4.tgz#277b2269437e3ffcb91d95a73b24becf33c5a871" @@ -5779,18 +5217,6 @@ jest-snapshot@^27.2.4: pretty-format "^27.2.4" semver "^7.3.2" -jest-util@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.0.tgz#bfccb85cfafae752257319e825a5b8d4ada470dc" - integrity sha512-T5ZJCNeFpqcLBpx+Hl9r9KoxBCUqeWlJ1Htli+vryigZVJ1vuLB9j35grEBASp4R13KFkV7jM52bBGnArpJN6A== - dependencies: - "@jest/types" "^27.1.1" - "@types/node" "*" - chalk "^4.0.0" - graceful-fs "^4.2.4" - is-ci "^3.0.0" - picomatch "^2.2.3" - jest-util@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.4.tgz#3d7ce081b2e7f4cfe0156452ac01f3cb456cc656" @@ -5803,18 +5229,6 @@ jest-util@^27.2.4: is-ci "^3.0.0" picomatch "^2.2.3" -jest-validate@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.2.tgz#e672118f1d9aa57b25b4c7998edc101dabd7020b" - integrity sha512-01mwTAs2kgDuX98Ua3Xhdhp5lXsLU4eyg6k56adTtrXnU/GbLd9uAsh5nc4MWVtUXMeNmHUyEiD4ibLqE8MuNw== - dependencies: - "@jest/types" "^27.1.1" - camelcase "^6.2.0" - chalk "^4.0.0" - jest-get-type "^27.0.6" - leven "^3.1.0" - pretty-format "^27.2.2" - jest-validate@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.4.tgz#b66d462b2fb93d7e16a47d1aa8763d5600bf2cfa" @@ -5827,19 +5241,6 @@ jest-validate@^27.2.4: leven "^3.1.0" pretty-format "^27.2.4" -jest-watcher@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.2.tgz#8b00253d7e880c6637b402228a76f2fe5ea08132" - integrity sha512-7HJwZq06BCfM99RacCVzXO90B20/dNJvq+Ouiu/VrFdFRCpbnnqlQUEk4KAhBSllgDrTPgKu422SCF5KKBHDRA== - dependencies: - "@jest/test-result" "^27.2.2" - "@jest/types" "^27.1.1" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - jest-util "^27.2.0" - string-length "^4.0.1" - jest-watcher@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.4.tgz#b1d5c39ab94f59f4f35f66cc96f7761a10e0cfc4" @@ -5862,15 +5263,6 @@ jest-worker@^26.2.1: merge-stream "^2.0.0" supports-color "^7.0.0" -jest-worker@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.2.tgz#636deeae8068abbf2b34b4eb9505f8d4e5bd625c" - integrity sha512-aG1xq9KgWB2CPC8YdMIlI8uZgga2LFNcGbHJxO8ctfXAydSaThR4EewKQGg3tBOC+kS3vhPGgymsBdi9VINjPw== - dependencies: - "@types/node" "*" - merge-stream "^2.0.0" - supports-color "^8.0.0" - jest-worker@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.4.tgz#881455df75e22e7726a53f43703ab74d6b36f82d" @@ -5880,15 +5272,6 @@ jest-worker@^27.2.4: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.2.tgz#445a4c16aa4c4ae6e512d62fb6f8b2624cbd6c26" - integrity sha512-XAB/9akDTe3/V0wPNKWfP9Y/NT1QPiCqyRBYGbC66EA9EvgAzdaFEqhFGLaDJ5UP2yIyXUMtju9a9IMrlYbZTQ== - dependencies: - "@jest/core" "^27.2.2" - import-local "^3.0.2" - jest-cli "^27.2.2" - jest@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.4.tgz#70e27bef873138afc123aa4769f7124c50ad3efb" @@ -6272,7 +5655,7 @@ log-update@^4.0.0: slice-ansi "^4.0.0" wrap-ansi "^6.2.0" -loose-envify@^1.1.0, loose-envify@^1.4.0: +loose-envify@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -6415,17 +5798,17 @@ micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" -mime-db@1.49.0: - version "1.49.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed" - integrity sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA== +mime-db@1.50.0: + version "1.50.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.50.0.tgz#abd4ac94e98d3c0e185016c67ab45d5fde40c11f" + integrity sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A== mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.32" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5" - integrity sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A== + version "2.1.33" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.33.tgz#1fa12a904472fafd068e48d9e8401f74d3f70edb" + integrity sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g== dependencies: - mime-db "1.49.0" + mime-db "1.50.0" mimic-fn@^2.1.0: version "2.1.0" @@ -6597,10 +5980,10 @@ mute-stream@0.0.8, mute-stream@~0.0.4: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== -nanocolors@^0.1.0, nanocolors@^0.1.5: - version "0.1.12" - resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.1.12.tgz#8577482c58cbd7b5bb1681db4cf48f11a87fd5f6" - integrity sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ== +nanocolors@^0.2.12: + version "0.2.12" + resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.2.12.tgz#4d05932e70116078673ea4cc6699a1c56cc77777" + integrity sha512-SFNdALvzW+rVlzqexid6epYdt8H9Zol7xDoQarioEFcFN0JHo4CYNztAxmtfgGTVRCmFlEOqqhBpoFGKqSAMug== natural-compare@^1.4.0: version "1.4.0" @@ -6617,14 +6000,7 @@ neo-async@^2.6.0: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -node-fetch@^2.6.1: - version "2.6.5" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.5.tgz#42735537d7f080a7e5f78b6c549b7146be1742fd" - integrity sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ== - dependencies: - whatwg-url "^5.0.0" - -node-fetch@^3.0.0: +node-fetch@*, node-fetch@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.0.0.tgz#79da7146a520036f2c5f644e4a26095f17e411ea" integrity sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q== @@ -6632,6 +6008,13 @@ node-fetch@^3.0.0: data-uri-to-buffer "^3.0.1" fetch-blob "^3.1.2" +node-fetch@^2.6.1: + version "2.6.5" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.5.tgz#42735537d7f080a7e5f78b6c549b7146be1742fd" + integrity sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ== + dependencies: + whatwg-url "^5.0.0" + node-gyp@^5.0.2: version "5.1.1" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-5.1.1.tgz#eb915f7b631c937d282e33aed44cb7a025f62a3e" @@ -6676,9 +6059,9 @@ node-modules-regexp@^1.0.0: integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= node-releases@^1.1.76: - version "1.1.76" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.76.tgz#df245b062b0cafbd5282ab6792f7dccc2d97f36e" - integrity sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA== + version "1.1.77" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.77.tgz#50b0cfede855dd374e7585bf228ff34e57c1c32e" + integrity sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ== nopt@^4.0.1: version "4.0.3" @@ -6871,13 +6254,13 @@ object.assign@^4.1.0, object.assign@^4.1.2: object-keys "^1.1.1" object.entries@^1.0.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.4.tgz#43ccf9a50bc5fd5b649d45ab1a579f24e088cafd" - integrity sha512-h4LWKWE+wKQGhtMjZEBud7uLGhqyLwj8fpHOarZhD2uY3C9cRtk57VQ89ke3moByLXMedqs3XCHzyb4AmA2DjA== + version "1.1.5" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861" + integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.2" + es-abstract "^1.19.1" object.getownpropertydescriptors@^2.0.3: version "2.1.2" @@ -6949,11 +6332,6 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -p-each-series@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.2.0.tgz#105ab0357ce72b202a8a8b94933672657b5e2a9a" - integrity sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA== - p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -7259,17 +6637,7 @@ prettier@^2.0.1, prettier@^2.2.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== -pretty-format@^27.0.0, pretty-format@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.2.tgz#c080f1ab7ac64302e4d438f208596fc649dbeeb3" - integrity sha512-+DdLh+rtaElc2SQOE/YPH8k2g3Rf2OXWEpy06p8Szs3hdVSYD87QOOlYRHWAeb/59XTmeVmRKvDD0svHqf6ycA== - dependencies: - "@jest/types" "^27.1.1" - ansi-regex "^5.0.1" - ansi-styles "^5.0.0" - react-is "^17.0.1" - -pretty-format@^27.2.4: +pretty-format@^27.0.0, pretty-format@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.4.tgz#08ea39c5eab41b082852d7093059a091f6ddc748" integrity sha512-NUjw22WJHldzxyps2YjLZkUj6q1HvjqFezkB9Y2cklN8NtVZN/kZEXGZdFw4uny3oENzV5EEMESrkI0YDUH8vg== @@ -7322,15 +6690,6 @@ promzard@^0.3.0: dependencies: read "1" -prop-types@^15.6.2: - version "15.7.2" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" - integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== - dependencies: - loose-envify "^1.4.0" - object-assign "^4.1.1" - react-is "^16.8.1" - proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" @@ -7405,34 +6764,25 @@ randombytes@^2.1.0: dependencies: safe-buffer "^5.1.0" -react-is@^16.8.1, react-is@^16.8.6: - version "16.13.1" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" - integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== +react-error-boundary@^3.1.0: + version "3.1.3" + resolved "https://registry.yarnpkg.com/react-error-boundary/-/react-error-boundary-3.1.3.tgz#276bfa05de8ac17b863587c9e0647522c25e2a0b" + integrity sha512-A+F9HHy9fvt9t8SNDlonq01prnU8AmkjvGKV4kk8seB9kU3xMEO8J/PQlLVmoOIDODl5U2kufSBs4vrWIqhsAA== + dependencies: + "@babel/runtime" "^7.12.5" react-is@^17.0.1: version "17.0.2" resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== -react-test-renderer@^16.8.2: - version "16.14.0" - resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.14.0.tgz#e98360087348e260c56d4fe2315e970480c228ae" - integrity sha512-L8yPjqPE5CZO6rKsKXRO/rVPiaCOy0tQQJbC+UjPNlobl5mad59lvPjwFsQHTvL03caVDIVr9x9/OSgDe6I5Eg== - dependencies: - object-assign "^4.1.1" - prop-types "^15.6.2" - react-is "^16.8.6" - scheduler "^0.19.1" - -react@^16.8.2: - version "16.14.0" - resolved "https://registry.yarnpkg.com/react/-/react-16.14.0.tgz#94d776ddd0aaa37da3eda8fc5b6b18a4c9a3114d" - integrity sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g== +react@^17.0.2: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" + integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.2" read-cmd-shim@^2.0.0: version "2.0.0" @@ -7841,14 +7191,6 @@ saxes@^5.0.1: dependencies: xmlchars "^2.2.0" -scheduler@^0.19.1: - version "0.19.1" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196" - integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - semver-compare@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" @@ -7917,9 +7259,9 @@ side-channel@^1.0.4: object-inspect "^1.9.0" signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: - version "3.0.4" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.4.tgz#366a4684d175b9cab2081e3681fda3747b6c51d7" - integrity sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q== + version "3.0.5" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f" + integrity sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ== sisteransi@^1.0.5: version "1.0.5" @@ -8158,16 +7500,7 @@ string-width@^1.0.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string-width@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2: +string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -8229,13 +7562,6 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -8319,16 +7645,16 @@ symbol-tree@^3.2.4: integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== table@^6.0.9: - version "6.7.1" - resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2" - integrity sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg== + version "6.7.2" + resolved "https://registry.yarnpkg.com/table/-/table-6.7.2.tgz#a8d39b9f5966693ca8b0feba270a78722cbaf3b0" + integrity sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g== dependencies: ajv "^8.0.1" lodash.clonedeep "^4.5.0" lodash.truncate "^4.4.2" slice-ansi "^4.0.0" - string-width "^4.2.0" - strip-ansi "^6.0.0" + string-width "^4.2.3" + strip-ansi "^6.0.1" tar@^4.4.12: version "4.4.19" @@ -8736,15 +8062,6 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== -v8-to-istanbul@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.0.0.tgz#4229f2a99e367f3f018fa1d5c2b8ec684667c69c" - integrity sha512-LkmXi8UUNxnCC+JlH7/fsfsKr5AU110l+SYGJimWNkWhxbN5EyeOtm1MJ0hhvqMMOhGwBj1Fp70Yv9i+hX0QAg== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^1.6.0" - source-map "^0.7.3" - v8-to-istanbul@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz#0aeb763894f1a0a1676adf8a8b7612a38902446c" @@ -9048,7 +8365,7 @@ yargs-parser@^20.2.2, yargs-parser@^20.2.3: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs@^16.0.3, yargs@^16.2.0: +yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== From ee5821ccf478db9f2606607a4e624504da43c316 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Tue, 5 Oct 2021 19:35:56 -0300 Subject: [PATCH 05/49] remove packages to be deprecated --- package.json | 12 +- packages/babel-plugin/package.json | 2 +- packages/bindings/__tests__/index.ts | 3 +- packages/bundle/index.js | 7 - packages/http-transport/.babelrc | 6 - packages/http-transport/.npmignore | 5 - packages/http-transport/__tests__/index.ts | 86 ---- .../http-transport/__tests__/tsconfig.json | 4 - packages/http-transport/package.json | 36 -- packages/http-transport/readme.md | 96 ---- packages/http-transport/tsconfig.json | 12 - packages/preact/.babelrc | 14 - packages/preact/.npmignore | 5 - packages/preact/__tests__/index.tsx | 424 ------------------ packages/preact/__tests__/tsconfig.json | 4 - packages/preact/package.json | 44 -- packages/preact/readme.md | 132 ------ packages/preact/schema.graphql | 28 -- packages/preact/src/consumer.ts | 62 --- packages/preact/src/index.ts | 2 - packages/preact/src/provider.ts | 14 - packages/preact/tsconfig.json | 15 - packages/react/__tests__/index.tsx | 5 +- packages/react/src/index.ts | 10 +- .../src/http-transport.ts} | 10 +- packages/test-utils/src/index.ts | 1 + packages/types/index.d.ts | 7 - packages/types/package.json | 13 - packages/types/readme.md | 58 --- scripts/build.js | 4 +- yarn.lock | 281 ++++++++---- 31 files changed, 226 insertions(+), 1176 deletions(-) delete mode 100644 packages/http-transport/.babelrc delete mode 100644 packages/http-transport/.npmignore delete mode 100644 packages/http-transport/__tests__/index.ts delete mode 100644 packages/http-transport/__tests__/tsconfig.json delete mode 100644 packages/http-transport/package.json delete mode 100644 packages/http-transport/readme.md delete mode 100644 packages/http-transport/tsconfig.json delete mode 100644 packages/preact/.babelrc delete mode 100644 packages/preact/.npmignore delete mode 100644 packages/preact/__tests__/index.tsx delete mode 100644 packages/preact/__tests__/tsconfig.json delete mode 100644 packages/preact/package.json delete mode 100644 packages/preact/readme.md delete mode 100644 packages/preact/schema.graphql delete mode 100644 packages/preact/src/consumer.ts delete mode 100644 packages/preact/src/index.ts delete mode 100644 packages/preact/src/provider.ts delete mode 100644 packages/preact/tsconfig.json rename packages/{http-transport/src/index.ts => test-utils/src/http-transport.ts} (57%) delete mode 100644 packages/types/index.d.ts delete mode 100644 packages/types/package.json delete mode 100644 packages/types/readme.md diff --git a/package.json b/package.json index f66b12ed..9f142ff7 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,8 @@ "@babel/preset-typescript": "^7.0.0", "@babel/register": "^7.0.0", "@graphql-tools/schema": "^8.2.0", + "@testing-library/preact": "^2.0.1", + "@testing-library/preact-hooks": "^1.1.0", "@testing-library/react-hooks": "^7.0.2", "@types/jest": "^27.0.2", "@types/node": "^16.10.2", @@ -77,24 +79,26 @@ "@types/react": "^17.0.27", "@types/uuid": "^8.3.1", "@types/ws": "^8.2.0", - "@typescript-eslint/parser": "^4.32.0", + "@typescript-eslint/parser": "^4.33.0", + "babel-plugin-jsx-pragmatic": "^1.0.2", "babel-plugin-tester": "^10.0.0", "casual": "^1.5.19", "codecov": "^3.2.0", "eslint": "^7.15.0", "eslint-plugin-prefer-let": "^1.1.0", "fetch-mock": "^9.11.0", - "graphql": "^15.4.0", + "graphql": "^15.6.1", "husky": "^7.0.2", "jest": "^27.2.4", "lerna": "^4.0.0", - "lint-staged": "^11.1.2", + "lint-staged": "^11.2.0", "lowdb": "^3.0.0", "node-fetch": "^3.0.0", - "preact": "^8.3.0", + "preact": "^10.5.14", "preact-render-spy": "^1.3.0", "prettier": "^2.2.1", "react": "^17.0.2", + "react-test-renderer": "^17.0.2", "resolve.exports": "^1.0.2", "rimraf": "^3.0.2", "typescript": "^4.1.2", diff --git a/packages/babel-plugin/package.json b/packages/babel-plugin/package.json index 53921ad8..58d0cd76 100644 --- a/packages/babel-plugin/package.json +++ b/packages/babel-plugin/package.json @@ -29,7 +29,7 @@ "dependencies": { "babel-literal-to-ast": "^2.1.0", "crypto-js": "^4.0.0", - "graphql": "^15.4.0", + "graphql": "^15.6.1", "graphql-query-compress": "^1.0.0" }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" diff --git a/packages/bindings/__tests__/index.ts b/packages/bindings/__tests__/index.ts index 5f9c2586..6b21a211 100644 --- a/packages/bindings/__tests__/index.ts +++ b/packages/bindings/__tests__/index.ts @@ -2,8 +2,7 @@ import createBindings from "../src"; import fetch from "node-fetch"; import graphql from "@grafoo/core/tag"; import createClient, { GrafooClient } from "@grafoo/core"; -import { mockQueryRequest } from "@grafoo/test-utils"; -import createTransport from "@grafoo/http-transport"; +import { mockQueryRequest, createTransport } from "@grafoo/test-utils"; // @ts-ignore globalThis.fetch = fetch; diff --git a/packages/bundle/index.js b/packages/bundle/index.js index af9a362a..7b798f31 100755 --- a/packages/bundle/index.js +++ b/packages/bundle/index.js @@ -1,7 +1,6 @@ var fs = require("fs"); var path = require("path"); var rollup = require("rollup").rollup; -var buble = require("rollup-plugin-buble"); var fileSize = require("rollup-plugin-filesize"); var nodeResolve = require("rollup-plugin-node-resolve"); var terser = require("rollup-plugin-terser").terser; @@ -28,12 +27,6 @@ module.exports = function build(opts) { typescript: ts, tsconfigOverride: tsconfig }), - buble({ - transforms: { - dangerousForOf: true, - dangerousTaggedTemplateString: true - } - }), !opts.skipCompression && terser({ output: { comments: false }, diff --git a/packages/http-transport/.babelrc b/packages/http-transport/.babelrc deleted file mode 100644 index 6e63b6e0..00000000 --- a/packages/http-transport/.babelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "presets": [ - ["@babel/preset-env", { "targets": { "node": "current" } }], - "@babel/preset-typescript" - ] -} diff --git a/packages/http-transport/.npmignore b/packages/http-transport/.npmignore deleted file mode 100644 index bd8c7c39..00000000 --- a/packages/http-transport/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -coverage -__tests__ -.rpt2_cache -.babelrc -schema.graphql diff --git a/packages/http-transport/__tests__/index.ts b/packages/http-transport/__tests__/index.ts deleted file mode 100644 index 93c043c4..00000000 --- a/packages/http-transport/__tests__/index.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { GrafooTransport } from "@grafoo/core"; -import createTransport from "../src"; - -jest.mock("node-fetch", () => require("fetch-mock").sandbox()); -let fetchMock = require("node-fetch"); -global.fetch = fetchMock; - -let fakeAPI = "http://fake-api.com/graphql"; -let query = "{ hello }"; - -describe("@grafoo/http-transport", () => { - let request: GrafooTransport; - beforeEach(() => { - request = createTransport(fakeAPI); - fetchMock.restore(); - }); - - it("should perform a simple request", async () => { - await mock(async () => { - await request(query); - - let [, { body, headers, method }] = fetchMock.lastCall(); - - expect(method).toBe("POST"); - expect(body).toBe(JSON.stringify({ query })); - expect(headers).toEqual({ "Content-Type": "application/json" }); - }); - }); - - it("should perform a request with variables", async () => { - await mock(async () => { - let variables = { some: "variable" }; - - await request(query, variables); - - let [, { body }] = fetchMock.lastCall(); - - expect(JSON.parse(body as string).variables).toEqual(variables); - }); - }); - - it("should accept fetchObjects as an object", async () => { - request = createTransport(fakeAPI, { headers: { authorization: "Bearer some-token" } }); - - await mock(async () => { - await request(query); - - let [, { headers }] = fetchMock.lastCall(); - - expect(headers).toEqual({ - authorization: "Bearer some-token", - "Content-Type": "application/json" - }); - }); - }); - - it("should accept fetchObjects as a function", async () => { - request = createTransport(fakeAPI, () => ({ headers: { authorization: "Bearer some-token" } })); - - await mock(async () => { - await request(query); - - let [, { headers }] = fetchMock.lastCall(); - - expect(headers).toEqual({ - authorization: "Bearer some-token", - "Content-Type": "application/json" - }); - }); - }); - - it("should handle graphql errors", async () => { - let response = { data: null, errors: [{ message: "I AM ERROR!" }] }; - - await mock( - async () => expect(request(query)).resolves.toMatchObject({ errors: response.errors }), - response - ); - }); -}); - -async function mock(testFn, response?: any) { - fetchMock.mock(fakeAPI, response || { data: { hello: "world" } }); - - await testFn(); -} diff --git a/packages/http-transport/__tests__/tsconfig.json b/packages/http-transport/__tests__/tsconfig.json deleted file mode 100644 index 97adb0a4..00000000 --- a/packages/http-transport/__tests__/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../tsconfig", - "include": ["."] -} diff --git a/packages/http-transport/package.json b/packages/http-transport/package.json deleted file mode 100644 index 1cdee0fe..00000000 --- a/packages/http-transport/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "@grafoo/http-transport", - "description": "grafoo client standard transport", - "version": "1.4.1", - "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/transport", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "author": "malbernaz", - "license": "MIT", - "keywords": [ - "graphql", - "graphql-client", - "grafoo" - ], - "publishConfig": { - "access": "public" - }, - "scripts": { - "build": "grafoo-bundle --input src/index.ts", - "test": "jest", - "test:coverage": "jest --coverage" - }, - "jest": { - "transform": { - "^.+\\.(ts|tsx|js)$": "/../../scripts/jest-setup.js" - }, - "resolver": "/../../scripts/resolver.js", - "transformIgnorePatterns": [ - "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob)/)" - ] - }, - "dependencies": { - "@grafoo/core": "^1.4.1" - }, - "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" -} diff --git a/packages/http-transport/readme.md b/packages/http-transport/readme.md deleted file mode 100644 index bc5c11c7..00000000 --- a/packages/http-transport/readme.md +++ /dev/null @@ -1,96 +0,0 @@ -# `@grafoo/http-transport` - -

A Simple HTTP Client for GraphQL Servers

- -

- - build - - - coverage - - - npm - - - downloads - - - size - - - code style: prettier - - - mantained with: lerna - - - slack - -

- -## Install - -``` -$ npm i @grafoo/http-transport -``` - -## Usage - -`@grafoo/http-transport` default export is a factory that accepts as arguments `uri` and `fetchOptions` (that can be an object or a function): - -```js -import createTransport from "@grafoo/http-transport"; - -const request = createTransport("http://some.graphql.api", () => ({ - headers: { - authorization: storage.getItem("authorization") - } -})); - -const USER_QUERY = ` - query($id: ID!) { - user(id: $id) { - name - } - } -`; - -const variables = { id: 123 }; - -request(USER_QUERY, variables).then(({ data }) => { - console.log(data.user); -}); -``` - -## Warning - -As this package uses `fetch` and `Object.assign` under the hood, make sure to install the proper polyfills if you want to use it in your project. - -## LICENSE - -[MIT](https://github.com/grafoojs/grafoo/blob/master/LICENSE) diff --git a/packages/http-transport/tsconfig.json b/packages/http-transport/tsconfig.json deleted file mode 100644 index e291682a..00000000 --- a/packages/http-transport/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "moduleResolution": "node", - "strict": false, - "lib": ["esnext", "dom"], - "noUnusedLocals": true, - "noUnusedParameters": true, - "checkJs": false, - "downlevelIteration": true - }, - "include": ["src"] -} diff --git a/packages/preact/.babelrc b/packages/preact/.babelrc deleted file mode 100644 index 3801fd21..00000000 --- a/packages/preact/.babelrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "presets": [ - ["@babel/preset-env", { "targets": { "node": 10 } }], - ["@babel/preset-react", { "pragma": "h" }], - ["@babel/preset-typescript", { "jsxPragma": "h" }] - ], - "plugins": [ - ["babel-plugin-jsx-pragmatic", { "module": "preact", "export": "h", "import": "h" }], - [ - "module:@grafoo/babel-plugin", - { "schema": "schema.graphql", "idFields": ["id", "__typename"] } - ] - ] -} diff --git a/packages/preact/.npmignore b/packages/preact/.npmignore deleted file mode 100644 index bd8c7c39..00000000 --- a/packages/preact/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -coverage -__tests__ -.rpt2_cache -.babelrc -schema.graphql diff --git a/packages/preact/__tests__/index.tsx b/packages/preact/__tests__/index.tsx deleted file mode 100644 index 8249c21d..00000000 --- a/packages/preact/__tests__/index.tsx +++ /dev/null @@ -1,424 +0,0 @@ -/** - * @jest-environment jsdom - */ - -import createClient from "@grafoo/core"; -import graphql from "@grafoo/core/tag"; -import createTransport from "@grafoo/http-transport"; -import { mockQueryRequest } from "@grafoo/test-utils"; -import { GrafooClient } from "@grafoo/types"; -import { h, FunctionalComponent, Component } from "preact"; -import { render } from "preact-render-spy"; -import { Consumer, Provider } from "../src"; - -interface Post { - title: string; - content: string; - id: string; - __typename: string; - author: Author; -} - -interface Author { - name: string; - id: string; - __typename: string; - posts?: Array; -} - -interface Authors { - authors: Author[]; -} - -let AUTHOR = graphql` - query ($id: ID!) { - author(id: $id) { - name - } - } -`; - -let AUTHORS = graphql` - { - authors { - name - posts { - title - body - } - } - } -`; - -let CREATE_AUTHOR = graphql` - mutation ($name: String!) { - createAuthor(name: $name) { - name - } - } -`; - -let POSTS_AND_AUTHORS = graphql` - { - posts { - title - body - author { - name - } - } - - authors { - name - posts { - title - body - } - } - } -`; - -describe("@grafoo/preact", () => { - let client: GrafooClient; - - beforeEach(() => { - jest.resetAllMocks(); - - let transport = createTransport("https://some.graphql.api/"); - client = createClient(transport, { idFields: ["id"] }); - }); - - describe("", () => { - it("should provide the client in it's context", (done) => { - let Comp = (_, context) => { - expect(context.client).toBe(client); - - return null; - }; - - render( - - - - ); - - done(); - }); - }); - - describe("", () => { - it("should not crash if a query is not given as prop", () => { - expect(() => - render( - - {() => null} - - ) - ).not.toThrow(); - }); - - it("should not fetch a query if skip prop is set to true", async () => { - await mockQueryRequest(AUTHORS); - - let spy = jest.spyOn(window, "fetch"); - - render( - - - {() => null} - - - ); - - expect(spy).not.toHaveBeenCalled(); - }); - - it("should trigger listen on client instance", async () => { - await mockQueryRequest(AUTHORS); - - let spy = jest.spyOn(client, "listen"); - - render( - - - {() => null} - - - ); - - expect(spy).toHaveBeenCalled(); - }); - - it("should not crash on unmount", () => { - let ctx = render( - - - {() => null} - - - ); - - expect(() => ctx.render(null)).not.toThrow(); - }); - - it("should execute render with default render argument", () => { - let mockRender = jest.fn(); - - render( - - - {mockRender} - - - ); - - let [[call]] = mockRender.mock.calls; - - expect(call).toMatchObject({ loading: false, loaded: false }); - expect(typeof call.load).toBe("function"); - }); - - it("should execute render with the right data if a query is specified", (done) => { - mockQueryRequest(AUTHORS).then(({ data }) => { - let mockRender = createMockRenderFn(done, [ - (props) => expect(props).toMatchObject({ loading: true, loaded: false }), - (props) => expect(props).toMatchObject({ loading: false, loaded: true, ...data }) - ]); - - render( - - {mockRender} - - ); - }); - }); - - it("should render if skip changed value to true", (done) => { - mockQueryRequest(AUTHORS).then(async ({ data }) => { - let mockRender = createMockRenderFn(done, [ - (props) => expect(props).toMatchObject({ loading: false, loaded: false }), - (props) => expect(props).toMatchObject({ loading: true, loaded: false }), - (props) => expect(props).toMatchObject({ loading: false, loaded: true, ...data }), - (props) => expect(props).toMatchObject({ loading: false, loaded: true, ...data }) - ]); - - let App: FunctionalComponent<{ skip?: boolean }> = ({ skip = false }) => ( - - - {mockRender} - - - ); - - let ctx = render(); - - ctx.render(); - - await new Promise((resolve) => setTimeout(resolve, 10)); - - ctx.render(); - }); - }); - - it("should rerender if variables prop has changed", (done) => { - mockQueryRequest(AUTHORS).then(async ({ data }) => { - let mock = async (variables) => { - return ( - await mockQueryRequest<{ author: Author }>({ - query: AUTHOR.query, - variables - }) - ).data.author; - }; - - let firstVariables = { id: data.authors[0].id }; - let secondVariables = { id: data.authors[1].id }; - let firstAuthor = await mock(firstVariables); - let secondAuthor; - - let mockRender = createMockRenderFn(done, [ - (props) => expect(props).toMatchObject({ loading: true, loaded: false }), - (props) => expect(props.author).toMatchObject(firstAuthor), - (props) => - expect(props).toMatchObject({ loading: true, loaded: true, author: firstAuthor }), - (props) => expect(props.author).toMatchObject(secondAuthor) - ]); - - class AuthorComponent extends Component { - constructor(props, context) { - super(props, context); - - this.state = firstVariables; - - setTimeout(async () => { - secondAuthor = await mock(secondVariables); - - this.setState(secondVariables); - }, 100); - } - - render(_, variables) { - return ( - - {mockRender} - - ); - } - } - - render( - - - - ); - }); - }); - - it("should not trigger a network request if the query is already cached", (done) => { - mockQueryRequest(AUTHORS).then(({ data }) => { - client.write(AUTHORS, data); - - jest.resetAllMocks(); - - let spy = jest.spyOn(client, "execute"); - - let mockRender = createMockRenderFn(done, [ - (props) => expect(props).toMatchObject({ loading: false, loaded: true, ...data }) - ]); - - render( - - {mockRender} - - ); - - expect(spy).not.toHaveBeenCalled(); - }); - }); - - it("should handle simple mutations", (done) => { - let { query } = CREATE_AUTHOR; - let variables = { name: "Bart" }; - - mockQueryRequest({ query, variables }).then(({ data }) => { - let mockRender = createMockRenderFn(done, [ - (props) => { - props.createAuthor(variables).then((res) => { - expect(res.data).toEqual(data); - }); - } - ]); - - render( - - {mockRender} - - ); - }); - }); - - it("should handle mutations with cache update", (done) => { - mockQueryRequest(AUTHORS).then(({ data }) => { - let mockRender = createMockRenderFn(done, [ - (props) => { - expect(props).toMatchObject({ loading: true, loaded: false }); - expect(typeof props.createAuthor).toBe("function"); - }, - (props) => { - expect(props).toMatchObject({ loading: false, loaded: true, ...data }); - let variables = { name: "Homer" }; - mockQueryRequest({ query: CREATE_AUTHOR.query, variables }).then(() => { - props.createAuthor(variables); - }); - }, - (props) => { - expect(props.authors.length).toBe(data.authors.length + 1); - let newAuthor = props.authors.find((a) => a.id === "tempID"); - expect(newAuthor).toMatchObject({ name: "Homer", id: "tempID" }); - }, - (props) => { - expect(props.authors.find((a) => a.id === "tempID")).toBeUndefined(); - expect(props.authors.find((a) => a.name === "Homer")).toBeTruthy(); - } - ]); - - render( - - ({ - authors: [...authors, { ...variables, id: "tempID" }] - }), - update: ({ authors }, { createAuthor: author }) => ({ - authors: authors.map((a) => (a.id === "tempID" ? author : a)) - }) - } - }} - > - {mockRender} - - - ); - }); - }); - - it("should reflect updates that happen outside of the component", (done) => { - mockQueryRequest(AUTHORS).then(({ data }) => { - client.write(AUTHORS, data); - - let mockRender = createMockRenderFn(done, [ - (props) => expect(props).toMatchObject({ loading: false, loaded: true, ...data }), - (props) => expect(props.authors[0].name).toBe("Homer") - ]); - - render( - - {mockRender} - - ); - - client.write(AUTHORS, { - authors: data.authors.map((a, i) => (!i ? { ...a, name: "Homer" } : a)) - }); - }); - }); - - it("should not trigger a network request if a query field is cached", (done) => { - mockQueryRequest(POSTS_AND_AUTHORS).then(({ data }) => { - client.write(POSTS_AND_AUTHORS, data); - - let spy = jest.spyOn(client, "execute"); - - let mockRender = createMockRenderFn(done, [ - (props) => { - expect(props).toMatchObject({ authors: data.authors, loading: false, loaded: true }); - expect(spy).not.toHaveBeenCalled(); - } - ]); - - render( - - {mockRender} - - ); - }); - }); - }); -}); - -function createMockRenderFn(done, assertionsFns) { - let currentRender = 0; - - return (props) => { - let assert = assertionsFns[currentRender]; - - if (assert) assertionsFns[currentRender](props); - - if (currentRender++ === assertionsFns.length - 1) done(); - - return null; - }; -} diff --git a/packages/preact/__tests__/tsconfig.json b/packages/preact/__tests__/tsconfig.json deleted file mode 100644 index 97adb0a4..00000000 --- a/packages/preact/__tests__/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../tsconfig", - "include": ["."] -} diff --git a/packages/preact/package.json b/packages/preact/package.json deleted file mode 100644 index 02524392..00000000 --- a/packages/preact/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "@grafoo/preact", - "version": "1.4.1", - "description": "grafoo client preact bindings", - "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/preact", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "author": "malbernaz", - "license": "MIT", - "keywords": [ - "babel", - "babel-plugin", - "graphql", - "graphql-client", - "grafoo", - "preact", - "preactjs" - ], - "publishConfig": { - "access": "public" - }, - "scripts": { - "build": "grafoo-bundle --input src/index.ts", - "test": "jest", - "test:coverage": "jest --coverage" - }, - "jest": { - "transform": { - "^.+\\.(ts|tsx|js)$": "/../../scripts/jest-setup.js" - }, - "resolver": "/../../scripts/resolver.js", - "transformIgnorePatterns": [ - "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob)/)" - ] - }, - "peerDependencies": { - "preact": ">=8.3" - }, - "dependencies": { - "@grafoo/bindings": "^1.4.1", - "@grafoo/types": "^1.4.1" - }, - "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" -} diff --git a/packages/preact/readme.md b/packages/preact/readme.md deleted file mode 100644 index d8c4fc65..00000000 --- a/packages/preact/readme.md +++ /dev/null @@ -1,132 +0,0 @@ -# `@grafoo/preact` - -

Grafoo Preact Bindings

- -

- - build - - - coverage - - - npm - - - downloads - - - size - - - code style: prettier - - - mantained with: lerna - - - slack - -

- -## Install - -``` -$ npm i @grafoo/{core,react} && npm i -D @grafoo/babel-plugin -``` - -## API - -For documentation please refer to [`@grafoo/react`](https://github.com/grafoojs/grafoo/tree/master/packages/react)'s page since both modules share the same API. - -## Example - -**`index.js`** - -```jsx -import { h, render } from "preact"; -import createClient from "@grafoo/core"; -import { Provider } from "@grafoo/preact"; - -import Posts from "./Posts"; - -function fetchQuery(query, variables) { - const init = { - method: "POST", - body: JSON.stringify({ query, variables }), - headers: { - "content-type": "application/json" - } - }; - - return fetch("http://some.graphql.api", init).then(res => res.json()); -} - -const client = createClient(fetchQuery); - -render( - - - , - document.getElementById("mnt") -); -``` - -**`Posts.js`** - -```jsx -import { h } from "preact"; -import gql from "@grafoo/core/tag"; -import { Consumer } from "@grafoo/preact"; - -const ALL_POSTS = gql` - query getPosts($orderBy: PostOrderBy) { - allPosts(orderBy: $orderBy) { - title - content - createdAt - updatedAt - } - } -`; - -export default function Posts() { - return ( - - {({ client, load, loaded, loading, errors, allPosts }) => ( -

- 👆 do whatever you want with the variables above 👆 -

- )} -
- ); -} -``` - -## LICENSE - -[MIT](https://github.com/grafoojs/grafoo/blob/master/LICENSE) diff --git a/packages/preact/schema.graphql b/packages/preact/schema.graphql deleted file mode 100644 index 8011416b..00000000 --- a/packages/preact/schema.graphql +++ /dev/null @@ -1,28 +0,0 @@ -type Query { - author(id: ID!): Author! - authors: [Author!]! - post(id: ID!): Post! - posts: [Post!]! -} - -type Mutation { - createAuthor(name: String!): Author! - updateAuthor(id: ID!, name: String): Author! - deleteAuthor(id: ID!): Author! - createPost(title: String!, body: String!, author: ID!): Post! - updatePost(id: ID!, title: String, body: String): Post! - deletePost(id: ID!): Post! -} - -type Author { - id: ID! - name: String! - posts: [Post!] -} - -type Post { - id: ID! - title: String! - body: String! - author: Author! -} diff --git a/packages/preact/src/consumer.ts b/packages/preact/src/consumer.ts deleted file mode 100644 index a709b4a8..00000000 --- a/packages/preact/src/consumer.ts +++ /dev/null @@ -1,62 +0,0 @@ -import createBindings from "@grafoo/bindings"; -import { - Context, - GrafooBoundState, - GrafooBoundMutations, - GrafooConsumerProps -} from "@grafoo/types"; -import { Component, VNode } from "preact"; - -/** - * T = Query - * U = Mutations - */ -type GrafooRenderFn = (renderProps: GrafooBoundState & T & GrafooBoundMutations) => VNode; - -/** - * T = Query - * U = Mutations - */ -type GrafooPreactConsumerProps = GrafooConsumerProps & { - children?: GrafooRenderFn; -}; - -/** - * T = Query - * U = Mutations - */ -export class Consumer extends Component> { - state: GrafooBoundState & T & GrafooBoundMutations; - - constructor(props: GrafooPreactConsumerProps, context: Context) { - super(props, context); - - let bindings = createBindings(context.client, props, () => { - this.setState(bindings.getState()); - }); - - this.state = bindings.getState(); - - this.componentDidMount = () => { - if (props.skip || !props.query || this.state.loaded) return; - - this.state.load(); - }; - - this.componentWillReceiveProps = (next) => { - if ((!this.state.loaded && !next.skip) || props.variables !== next.variables) - this.state.load(next.variables); - }; - - this.componentWillUnmount = () => { - bindings.unbind(); - }; - } - - render( - props: GrafooPreactConsumerProps, - state: GrafooBoundState & T & GrafooBoundMutations - ): VNode { - return props.children[0](state); - } -} diff --git a/packages/preact/src/index.ts b/packages/preact/src/index.ts deleted file mode 100644 index d386ed57..00000000 --- a/packages/preact/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./provider"; -export * from "./consumer"; diff --git a/packages/preact/src/provider.ts b/packages/preact/src/provider.ts deleted file mode 100644 index ae5ae6ca..00000000 --- a/packages/preact/src/provider.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Context } from "@grafoo/types"; -import { Component } from "preact"; - -type GrafooPreactProviderProps = Context & { children?: JSX.Element }; - -export class Provider extends Component { - getChildContext(): Context { - return { client: this.props.client }; - } - - render(props: GrafooPreactProviderProps): JSX.Element { - return props.children[0]; - } -} diff --git a/packages/preact/tsconfig.json b/packages/preact/tsconfig.json deleted file mode 100644 index c79891e5..00000000 --- a/packages/preact/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "compilerOptions": { - "moduleResolution": "node", - "strict": false, - "noUnusedLocals": true, - "noUnusedParameters": true, - "checkJs": false, - "downlevelIteration": true, - "jsx": "react", - "jsxFactory": "h", - "lib": ["dom", "esnext"], - "types": ["preact", "jest"] - }, - "include": ["src"] -} diff --git a/packages/react/__tests__/index.tsx b/packages/react/__tests__/index.tsx index c18967e5..3ee708b9 100644 --- a/packages/react/__tests__/index.tsx +++ b/packages/react/__tests__/index.tsx @@ -6,8 +6,7 @@ import fetch from "node-fetch"; import * as React from "react"; import graphql from "@grafoo/core/tag"; import createClient from "@grafoo/core"; -import createTrasport from "@grafoo/http-transport"; -import { mockQueryRequest } from "@grafoo/test-utils"; +import { mockQueryRequest, createTransport } from "@grafoo/test-utils"; import { renderHook, act } from "@testing-library/react-hooks"; import { GrafooProvider, useGrafoo } from "../src"; @@ -127,7 +126,7 @@ describe("@grafoo/react", () => { beforeEach(() => { jest.resetAllMocks(); - let transport = createTrasport("https://some.graphql.api/"); + let transport = createTransport("https://some.graphql.api/"); client = createClient(transport, { idFields: ["id"] }); wrapper = (props) => {props.children}; }); diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index bc85b41a..ec127135 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -1,11 +1,15 @@ import * as React from "react"; -import createBindings, { GrafooConsumerProps } from "@grafoo/bindings"; import { GrafooClient, GrafooObject } from "@grafoo/core"; +import createBindings, { + GrafooConsumerProps, + GrafooBoundState, + GrafooBoundMutations +} from "@grafoo/bindings"; // @ts-ignore export let GrafooContext = React.createContext({}); -type GrafooProviderProps = { +export type GrafooProviderProps = { client: GrafooClient; }; @@ -14,7 +18,7 @@ export let GrafooProvider: React.FC = (props) => export function useGrafoo>( props: GrafooConsumerProps -) { +): GrafooBoundState & T["_queryType"] & GrafooBoundMutations { let client = React.useContext(GrafooContext); let update = React.useCallback(() => setState(bindings.getState()), []); let bindings = React.useMemo(() => createBindings(client, update, props), []); diff --git a/packages/http-transport/src/index.ts b/packages/test-utils/src/http-transport.ts similarity index 57% rename from packages/http-transport/src/index.ts rename to packages/test-utils/src/http-transport.ts index 2543425d..71d11b76 100644 --- a/packages/http-transport/src/index.ts +++ b/packages/test-utils/src/http-transport.ts @@ -1,16 +1,18 @@ import { GraphQlPayload } from "@grafoo/core"; -export default function createTransport(url: string, options?: RequestInit | (() => RequestInit)) { - return (query: string, variables?: unknown): Promise> => { +export function createTransport(url: string, options?: RequestInit | (() => RequestInit)) { + return async (query: string, variables?: unknown): Promise> => { options = typeof options == "function" ? options() : options || {}; - return fetch( + let response = await fetch( url, Object.assign(options, { body: JSON.stringify({ query, variables }), method: "POST", headers: Object.assign({ "Content-Type": "application/json" }, options.headers) }) - ).then((response) => response.json()); + ); + + return await response.json(); }; } diff --git a/packages/test-utils/src/index.ts b/packages/test-utils/src/index.ts index d4af12cf..38effacd 100644 --- a/packages/test-utils/src/index.ts +++ b/packages/test-utils/src/index.ts @@ -1,2 +1,3 @@ export * from "./db"; export * from "./mock-server"; +export * from "./http-transport"; diff --git a/packages/types/index.d.ts b/packages/types/index.d.ts deleted file mode 100644 index 0bcf0666..00000000 --- a/packages/types/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * GrafooTransport - */ - -/** - * Core - */ diff --git a/packages/types/package.json b/packages/types/package.json deleted file mode 100644 index c6105b69..00000000 --- a/packages/types/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "@grafoo/types", - "version": "1.4.1", - "description": "grafoo client typescript definitions", - "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/types", - "types": "index.d.ts", - "author": "malbernaz", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" -} diff --git a/packages/types/readme.md b/packages/types/readme.md deleted file mode 100644 index b6466d4f..00000000 --- a/packages/types/readme.md +++ /dev/null @@ -1,58 +0,0 @@ -# `@grafoo/types` - -

Grafoo Typescript Definitions

- -

- - build - - - coverage - - - npm - - - downloads - - - code style: prettier - - - mantained with: lerna - - - slack - -

- -## Install - -``` -$ npm i @grafoo/types -``` - -## LICENSE - -[MIT](https://github.com/grafoojs/grafoo/blob/master/LICENSE) diff --git a/scripts/build.js b/scripts/build.js index 1aad51ac..fd0ee243 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -4,13 +4,13 @@ let { exec } = require("child_process"); let pkgsRoot = join(__dirname, "..", "packages"); -let withDeps = ["react", "preact"]; +let withDeps = ["react"]; let noDeps = readdirSync(pkgsRoot).filter((x) => !withDeps.some((y) => y === x)); let command = exec( [ `lerna run --scope "@grafoo/*(${noDeps.join("|")})" build`, - `lerna run --scope "@grafoo/*(${withDeps.join("|")})" build`, + `lerna run --scope "@grafoo/*(${withDeps.join("|")})" build` ].join(" && ") ); diff --git a/yarn.lock b/yarn.lock index 6dc3f833..44d6db6e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -954,7 +954,15 @@ pirates "^4.0.0" source-map-support "^0.5.16" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.8", "@babel/runtime@^7.8.4": +"@babel/runtime-corejs3@^7.10.2": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.15.4.tgz#403139af262b9a6e8f9ba04a6fdcebf8de692bf1" + integrity sha512-lWcAqKeB624/twtTc3w6w/2o9RqJPaNBhPGK6DKLSiwuVWC7WFkypWyNg+CpZoyJH0jVzv1uMtXZ/5/lQOLtCg== + dependencies: + core-js-pure "^3.16.0" + regenerator-runtime "^0.13.4" + +"@babel/runtime@^7.0.0", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.8", "@babel/runtime@^7.8.4": version "7.15.4" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a" integrity sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw== @@ -1235,6 +1243,17 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" +"@jest/types@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" + integrity sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^15.0.0" + chalk "^4.0.0" + "@jest/types@^27.2.4": version "27.2.4" resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.4.tgz#2430042a66e00dc5b140c3636f4474d464c21ee8" @@ -2136,6 +2155,32 @@ dependencies: "@sinonjs/commons" "^1.7.0" +"@testing-library/dom@^7.16.2": + version "7.31.2" + resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.31.2.tgz#df361db38f5212b88555068ab8119f5d841a8c4a" + integrity sha512-3UqjCpey6HiTZT92vODYLPxTBWlM8ZOOjr3LX5F37/VRipW2M1kX6I/Cm4VXzteZqfGfagg8yXywpcOgQBlNsQ== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/runtime" "^7.12.5" + "@types/aria-query" "^4.2.0" + aria-query "^4.2.2" + chalk "^4.1.0" + dom-accessibility-api "^0.5.6" + lz-string "^1.4.4" + pretty-format "^26.6.2" + +"@testing-library/preact-hooks@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@testing-library/preact-hooks/-/preact-hooks-1.1.0.tgz#f4e197ec77b295ce6c122c560c46b5b03bc4f015" + integrity sha512-+JIor+NsOHkK3oIrwMDGKGHXTN0JJi462dBJlj4FNbGaDPTlctE6eu2ranWQirh7/FJMkWfzQCP+tk7jmY8ZrQ== + +"@testing-library/preact@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@testing-library/preact/-/preact-2.0.1.tgz#c69200b16c4eda58986c8d65e1043ad9cbe409d3" + integrity sha512-79kwVOY+3caoLgaPbiPzikjgY0Aya7Fc7TvGtR1upCnz2wrtmPDnN2t9vO7I7vDP2zoA+feSwOH5Q0BFErhaaQ== + dependencies: + "@testing-library/dom" "^7.16.2" + "@testing-library/react-hooks@^7.0.2": version "7.0.2" resolved "https://registry.yarnpkg.com/@testing-library/react-hooks/-/react-hooks-7.0.2.tgz#3388d07f562d91e7f2431a4a21b5186062ecfee0" @@ -2152,6 +2197,11 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== +"@types/aria-query@^4.2.0": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.2.tgz#ed4e0ad92306a704f9fb132a0cfcf77486dbe2bc" + integrity sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig== + "@types/babel-plugin-tester@^9.0.0": version "9.0.4" resolved "https://registry.yarnpkg.com/@types/babel-plugin-tester/-/babel-plugin-tester-9.0.4.tgz#f5f9274149c6c789984f69ae4edbc383e33f679c" @@ -2326,6 +2376,13 @@ resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== +"@types/yargs@^15.0.0": + version "15.0.14" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.14.tgz#26d821ddb89e70492160b66d10a0eb6df8f6fb06" + integrity sha512-yEJzHoxf6SyQGhBhIYGXQDSCkJjB6HohDShto7m8vaKg9Yp0Yn8+71J9eakh2bnPg6BfsH9PRMhiRTZnd4eXGQ== + dependencies: + "@types/yargs-parser" "*" + "@types/yargs@^16.0.0": version "16.0.4" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.4.tgz#26aad98dd2c2a38e421086ea9ad42b9e51642977" @@ -2333,48 +2390,48 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/parser@^4.32.0": - version "4.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.32.0.tgz#751ecca0e2fecd3d44484a9b3049ffc1871616e5" - integrity sha512-lhtYqQ2iEPV5JqV7K+uOVlPePjClj4dOw7K4/Z1F2yvjIUvyr13yJnDzkK6uon4BjHYuHy3EG0c2Z9jEhFk56w== +"@typescript-eslint/parser@^4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899" + integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA== dependencies: - "@typescript-eslint/scope-manager" "4.32.0" - "@typescript-eslint/types" "4.32.0" - "@typescript-eslint/typescript-estree" "4.32.0" + "@typescript-eslint/scope-manager" "4.33.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/typescript-estree" "4.33.0" debug "^4.3.1" -"@typescript-eslint/scope-manager@4.32.0": - version "4.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.32.0.tgz#e03c8668f8b954072b3f944d5b799c0c9225a7d5" - integrity sha512-DK+fMSHdM216C0OM/KR1lHXjP1CNtVIhJ54kQxfOE6x8UGFAjha8cXgDMBEIYS2XCYjjCtvTkjQYwL3uvGOo0w== +"@typescript-eslint/scope-manager@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" + integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== dependencies: - "@typescript-eslint/types" "4.32.0" - "@typescript-eslint/visitor-keys" "4.32.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" -"@typescript-eslint/types@4.32.0": - version "4.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.32.0.tgz#52c633c18da47aee09449144bf59565ab36df00d" - integrity sha512-LE7Z7BAv0E2UvqzogssGf1x7GPpUalgG07nGCBYb1oK4mFsOiFC/VrSMKbZQzFJdN2JL5XYmsx7C7FX9p9ns0w== +"@typescript-eslint/types@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" + integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== -"@typescript-eslint/typescript-estree@4.32.0": - version "4.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.32.0.tgz#db00ccc41ccedc8d7367ea3f50c6994b8efa9f3b" - integrity sha512-tRYCgJ3g1UjMw1cGG8Yn1KzOzNlQ6u1h9AmEtPhb5V5a1TmiHWcRyF/Ic+91M4f43QeChyYlVTcf3DvDTZR9vw== +"@typescript-eslint/typescript-estree@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" + integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== dependencies: - "@typescript-eslint/types" "4.32.0" - "@typescript-eslint/visitor-keys" "4.32.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" debug "^4.3.1" globby "^11.0.3" is-glob "^4.0.1" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@4.32.0": - version "4.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.32.0.tgz#455ba8b51242f2722a497ffae29313f33b14cb7f" - integrity sha512-e7NE0qz8W+atzv3Cy9qaQ7BTLwWsm084Z0c4nIO2l3Bp6u9WIgdqCgyPyV5oSPDMIW3b20H59OOCmVk3jw3Ptw== +"@typescript-eslint/visitor-keys@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" + integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== dependencies: - "@typescript-eslint/types" "4.32.0" + "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" JSONStream@^1.0.4: @@ -2511,7 +2568,7 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= -ansi-regex@^5.0.1: +ansi-regex@^5.0.0, ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== @@ -2573,6 +2630,14 @@ argv@0.0.2: resolved "https://registry.yarnpkg.com/argv/-/argv-0.0.2.tgz#ecbd16f8949b157183711b1bda334f37840185ab" integrity sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas= +aria-query@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" + integrity sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA== + dependencies: + "@babel/runtime" "^7.10.2" + "@babel/runtime-corejs3" "^7.10.2" + array-differ@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-3.0.0.tgz#3cbb3d0f316810eafcc47624734237d6aee4ae6b" @@ -2691,6 +2756,13 @@ babel-plugin-jest-hoist@^27.2.0: "@types/babel__core" "^7.0.0" "@types/babel__traverse" "^7.0.6" +babel-plugin-jsx-pragmatic@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/babel-plugin-jsx-pragmatic/-/babel-plugin-jsx-pragmatic-1.0.2.tgz#41e2beb8642235f34b2a7ab12ca39e07201b8e59" + integrity sha1-QeK+uGQiNfNLKnqxLKOeByAbjlk= + dependencies: + babel-plugin-syntax-jsx "^6.0.0" + babel-plugin-polyfill-corejs2@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz#e9124785e6fd94f94b618a7954e5693053bf5327" @@ -2715,6 +2787,11 @@ babel-plugin-polyfill-regenerator@^0.2.2: dependencies: "@babel/helper-define-polyfill-provider" "^0.2.2" +babel-plugin-syntax-jsx@^6.0.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" + integrity sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY= + babel-plugin-tester@^10.0.0: version "10.1.0" resolved "https://registry.yarnpkg.com/babel-plugin-tester/-/babel-plugin-tester-10.1.0.tgz#e099ee1d8dec538439c427a7d12aad132885757b" @@ -2954,7 +3031,7 @@ chalk@^2.0.0, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1: +chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -3029,7 +3106,7 @@ cli-cursor@^3.1.0: dependencies: restore-cursor "^3.1.0" -cli-truncate@^2.1.0: +cli-truncate@2.1.0, cli-truncate@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-2.1.0.tgz#c39e28bf05edcde5be3b98992a22deed5a2b93c7" integrity sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg== @@ -3157,10 +3234,10 @@ commander@^4.0.1: resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== -commander@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" - integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== +commander@^8.2.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-8.2.0.tgz#37fe2bde301d87d47a53adeff8b5915db1381ca8" + integrity sha512-LLKxDvHeL91/8MIyTAD5BFMNtoIwztGPMiM/7Bl8rIPmHCZXRxmSWr91h57dpOpnQ6jIUqEWdXE/uBYMfiVZDA== commondir@^1.0.1: version "1.0.1" @@ -3300,6 +3377,11 @@ core-js-compat@^3.16.0, core-js-compat@^3.16.2: browserslist "^4.17.1" semver "7.0.0" +core-js-pure@^3.16.0: + version "3.18.2" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.18.2.tgz#d8cc11d4885ea919f3de776d45e720e4c769d406" + integrity sha512-4hMMLUlZhKJKOWbbGD1/VDUxGPEhEoN/T01k7bx271WiBKCvCfkgPzy0IeRS4PB50p6/N1q/SZL4B/TRsTE5bA== + core-js@^3.0.0: version "3.18.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.18.1.tgz#289d4be2ce0085d40fc1244c0b1a54c00454622f" @@ -3315,7 +3397,7 @@ core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== -cosmiconfig@^7.0.0: +cosmiconfig@^7.0.0, cosmiconfig@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== @@ -3393,7 +3475,7 @@ dateformat@^3.0.0: resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== -debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: +debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== @@ -3519,6 +3601,11 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" +dom-accessibility-api@^0.5.6: + version "0.5.7" + resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.7.tgz#8c2aa6325968f2933160a0b7dbb380893ddf3e7d" + integrity sha512-ml3lJIq9YjUfM9TUnEPvEYWFSwivwIGBPKpewX7tii7fwCazA8yCioGdqQcNsItPpfFvSJ3VIdMQPj60LJhcQA== + domexception@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" @@ -3812,7 +3899,7 @@ eventemitter3@^4.0.4: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== -execa@^5.0.0: +execa@^5.0.0, execa@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== @@ -4290,10 +4377,10 @@ graphql-query-compress@^1.0.0: dependencies: tokenizr "1.5.7" -graphql@^15.4.0: - version "15.6.0" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.6.0.tgz#e69323c6a9780a1a4b9ddf7e35ca8904bb04df02" - integrity sha512-WJR872Zlc9hckiEPhXgyUftXH48jp2EjO5tgBBOyNMRJZ9fviL2mJBD6CAysk6N5S0r9BTs09Qk39nnJBkvOXQ== +graphql@^15.6.1: + version "15.6.1" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.6.1.tgz#9125bdf057553525da251e19e96dab3d3855ddfc" + integrity sha512-3i5lu0z6dRvJ48QP9kFxBkJ7h4Kso7PS8eahyTFz5Jm6CvQfLtNIE8LX9N6JLnXTuwR+sIYnXzaWp6anOg0QQw== gzip-size@^6.0.0: version "6.0.0" @@ -4788,11 +4875,6 @@ is-typedarray@^1.0.0, is-typedarray@~1.0.0: resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= -is-unicode-supported@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" - integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== - is-weakref@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.1.tgz#842dba4ec17fa9ac9850df2d6efbc1737274f2a2" @@ -5496,27 +5578,27 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= -lint-staged@^11.1.2: - version "11.1.2" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-11.1.2.tgz#4dd78782ae43ee6ebf2969cad9af67a46b33cd90" - integrity sha512-6lYpNoA9wGqkL6Hew/4n1H6lRqF3qCsujVT0Oq5Z4hiSAM7S6NksPJ3gnr7A7R52xCtiZMcEUNNQ6d6X5Bvh9w== +lint-staged@^11.2.0: + version "11.2.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-11.2.0.tgz#6b9774a74b3eb4bef5c59fb6475bff84d6853008" + integrity sha512-0KIcRuO4HQS2Su7qWtjrfTXgSklvyIb9Fk9qVWRZkGHa5S81Vj6WBbs+ogQBvHUwLJYq1eQ4R+H82GSak4OM7w== dependencies: - chalk "^4.1.1" - cli-truncate "^2.1.0" - commander "^7.2.0" - cosmiconfig "^7.0.0" - debug "^4.3.1" + cli-truncate "2.1.0" + colorette "^1.4.0" + commander "^8.2.0" + cosmiconfig "^7.0.1" + debug "^4.3.2" enquirer "^2.3.6" - execa "^5.0.0" - listr2 "^3.8.2" - log-symbols "^4.1.0" + execa "^5.1.1" + listr2 "^3.12.2" micromatch "^4.0.4" normalize-path "^3.0.0" please-upgrade-node "^3.2.0" string-argv "0.3.1" - stringify-object "^3.3.0" + stringify-object "3.3.0" + supports-color "8.1.1" -listr2@^3.8.2: +listr2@^3.12.2: version "3.12.2" resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.12.2.tgz#2d55cc627111603ad4768a9e87c9c7bb9b49997e" integrity sha512-64xC2CJ/As/xgVI3wbhlPWVPx0wfTqbUAkpb7bjDi0thSWMqrf07UFhrfsGoo8YSXmF049Rp9C0cjLC8rZxK9A== @@ -5637,14 +5719,6 @@ lodash@^4.17.15, lodash@^4.17.19, lodash@^4.7.0: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" - integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== - dependencies: - chalk "^4.1.0" - is-unicode-supported "^0.1.0" - log-update@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/log-update/-/log-update-4.0.0.tgz#589ecd352471f2a1c0c570287543a64dfd20e0a1" @@ -5676,6 +5750,11 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +lz-string@^1.4.4: + version "1.4.4" + resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26" + integrity sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY= + magic-string@^0.25.3: version "0.25.7" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" @@ -6617,10 +6696,10 @@ preact-render-to-string@^3.6.3: dependencies: pretty-format "^3.5.1" -preact@^8.3.0: - version "8.5.3" - resolved "https://registry.yarnpkg.com/preact/-/preact-8.5.3.tgz#78c2a5562fcecb1fed1d0055fa4ac1e27bde17c1" - integrity sha512-O3kKP+1YdgqHOFsZF2a9JVdtqD+RPzCQc3rP+Ualf7V6rmRDchZ9MJbiGTT7LuyqFKZqlHSOyO/oMFmI2lVTsw== +preact@^10.5.14: + version "10.5.14" + resolved "https://registry.yarnpkg.com/preact/-/preact-10.5.14.tgz#0b14a2eefba3c10a57116b90d1a65f5f00cd2701" + integrity sha512-KojoltCrshZ099ksUZ2OQKfbH66uquFoxHSbnwKbTJHeQNvx42EmC7wQVWNuDt6vC5s3nudRHFtKbpY4ijKlaQ== prelude-ls@^1.2.1: version "1.2.1" @@ -6637,6 +6716,16 @@ prettier@^2.0.1, prettier@^2.2.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== +pretty-format@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" + integrity sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg== + dependencies: + "@jest/types" "^26.6.2" + ansi-regex "^5.0.0" + ansi-styles "^4.0.0" + react-is "^17.0.1" + pretty-format@^27.0.0, pretty-format@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.4.tgz#08ea39c5eab41b082852d7093059a091f6ddc748" @@ -6771,11 +6860,29 @@ react-error-boundary@^3.1.0: dependencies: "@babel/runtime" "^7.12.5" -react-is@^17.0.1: +"react-is@^16.12.0 || ^17.0.0", react-is@^17.0.1, react-is@^17.0.2: version "17.0.2" resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== +react-shallow-renderer@^16.13.1: + version "16.14.1" + resolved "https://registry.yarnpkg.com/react-shallow-renderer/-/react-shallow-renderer-16.14.1.tgz#bf0d02df8a519a558fd9b8215442efa5c840e124" + integrity sha512-rkIMcQi01/+kxiTE9D3fdS959U1g7gs+/rborw++42m1O9FAQiNI/UNRZExVUoAOprn4umcXf+pFRou8i4zuBg== + dependencies: + object-assign "^4.1.1" + react-is "^16.12.0 || ^17.0.0" + +react-test-renderer@^17.0.2: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-17.0.2.tgz#4cd4ae5ef1ad5670fc0ef776e8cc7e1231d9866c" + integrity sha512-yaQ9cB89c17PUb0x6UfWRs7kQCorVdHlutU1boVPEsB8IDZH6n9tHxMacc3y0JoXOJUsZb/t/Mb8FUWMKaM7iQ== + dependencies: + object-assign "^4.1.1" + react-is "^17.0.2" + react-shallow-renderer "^16.13.1" + scheduler "^0.20.2" + react@^17.0.2: version "17.0.2" resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" @@ -7191,6 +7298,14 @@ saxes@^5.0.1: dependencies: xmlchars "^2.2.0" +scheduler@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91" + integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + semver-compare@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" @@ -7539,7 +7654,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -stringify-object@^3.3.0: +stringify-object@3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== @@ -7610,6 +7725,13 @@ stubs@^3.0.0: resolved "https://registry.yarnpkg.com/stubs/-/stubs-3.0.0.tgz#e8d2ba1fa9c90570303c030b6900f7d5f89abe5b" integrity sha1-6NK6H6nJBXAwPAMLaQD31fiavls= +supports-color@8.1.1, supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -7624,13 +7746,6 @@ supports-color@^7.0.0, supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -supports-color@^8.0.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - supports-hyperlinks@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz#4f77b42488765891774b70c79babd87f9bd594bb" From d5654555a28503fc96ef84b3d2b2d5eb82763963 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Tue, 5 Oct 2021 20:13:17 -0300 Subject: [PATCH 06/49] updates --- packages/bundle/index.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/bundle/index.js b/packages/bundle/index.js index 7b798f31..4b143b78 100755 --- a/packages/bundle/index.js +++ b/packages/bundle/index.js @@ -1,16 +1,16 @@ -var fs = require("fs"); -var path = require("path"); -var rollup = require("rollup").rollup; -var fileSize = require("rollup-plugin-filesize"); -var nodeResolve = require("rollup-plugin-node-resolve"); -var terser = require("rollup-plugin-terser").terser; -var typescript = require("rollup-plugin-typescript2"); -var ts = require("typescript"); +let fs = require("fs"); +let path = require("path"); +let rollup = require("rollup").rollup; +let fileSize = require("rollup-plugin-filesize"); +let nodeResolve = require("rollup-plugin-node-resolve"); +let terser = require("rollup-plugin-terser").terser; +let typescript = require("rollup-plugin-typescript2"); +let ts = require("typescript"); module.exports = function build(opts) { - var pkg = JSON.parse(fs.readFileSync(path.join(opts.rootPath, "package.json"), "utf-8")); - var tsconfig = JSON.parse(fs.readFileSync(path.join(opts.rootPath, "tsconfig.json"), "utf-8")); - var peerDependencies = pkg.peerDependencies || {}; + let pkg = JSON.parse(fs.readFileSync(path.join(opts.rootPath, "package.json"), "utf-8")); + let tsconfig = JSON.parse(fs.readFileSync(path.join(opts.rootPath, "tsconfig.json"), "utf-8")); + let peerDependencies = pkg.peerDependencies || {}; tsconfig.compilerOptions.target = "esnext"; tsconfig.compilerOptions.module = "esnext"; @@ -37,7 +37,7 @@ module.exports = function build(opts) { }), fileSize() ].filter(Boolean) - }).then(function (bundle) { + }).then((bundle) => { return bundle.write({ file: path.join(opts.rootPath, "dist/index.js"), sourcemap: true, From 63a52637858d7ce754ddbace2392bcca654a7b12 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Tue, 5 Oct 2021 20:26:04 -0300 Subject: [PATCH 07/49] udpate --- packages/bundle/cli.js | 2 -- packages/bundle/package.json | 1 - yarn.lock | 57 +++--------------------------------- 3 files changed, 4 insertions(+), 56 deletions(-) diff --git a/packages/bundle/cli.js b/packages/bundle/cli.js index c298b437..5a19c8de 100755 --- a/packages/bundle/cli.js +++ b/packages/bundle/cli.js @@ -1,7 +1,5 @@ #!/usr/bin/env node -/* eslint-disable no-console */ - var mri = require("mri"); var build = require("."); diff --git a/packages/bundle/package.json b/packages/bundle/package.json index 52c95f96..72b8616b 100644 --- a/packages/bundle/package.json +++ b/packages/bundle/package.json @@ -6,7 +6,6 @@ "dependencies": { "mri": "^1.1.1", "rollup": "^2.58.0", - "rollup-plugin-buble": "^0.19.2", "rollup-plugin-filesize": "^9.1.0", "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-terser": "^7.0.2", diff --git a/yarn.lock b/yarn.lock index 44d6db6e..c397a51e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2452,11 +2452,6 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -acorn-dynamic-import@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948" - integrity sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw== - acorn-globals@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45" @@ -2465,7 +2460,7 @@ acorn-globals@^6.0.0: acorn "^7.1.1" acorn-walk "^7.1.1" -acorn-jsx@^5.0.1, acorn-jsx@^5.3.1: +acorn-jsx@^5.3.1: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== @@ -2475,11 +2470,6 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== -acorn@^6.1.1: - version "6.4.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" - integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== - acorn@^7.1.1, acorn@^7.4.0: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" @@ -2909,20 +2899,6 @@ bser@2.1.1: dependencies: node-int64 "^0.4.0" -buble@^0.19.8: - version "0.19.8" - resolved "https://registry.yarnpkg.com/buble/-/buble-0.19.8.tgz#d642f0081afab66dccd897d7b6360d94030b9d3d" - integrity sha512-IoGZzrUTY5fKXVkgGHw3QeXFMUNBFv+9l8a4QJKG1JhG3nCMHTdEX1DCOg8568E2Q9qvAQIiSokv6Jsgx8p2cA== - dependencies: - acorn "^6.1.1" - acorn-dynamic-import "^4.0.0" - acorn-jsx "^5.0.1" - chalk "^2.4.2" - magic-string "^0.25.3" - minimist "^1.2.0" - os-homedir "^2.0.0" - regexpu-core "^4.5.4" - buffer-from@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" @@ -3022,7 +2998,7 @@ casual@^1.5.19: mersenne-twister "^1.0.1" moment "^2.15.2" -chalk@^2.0.0, chalk@^2.4.2: +chalk@^2.0.0: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -5755,13 +5731,6 @@ lz-string@^1.4.4: resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26" integrity sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY= -magic-string@^0.25.3: - version "0.25.7" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" - integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== - dependencies: - sourcemap-codec "^1.4.4" - make-dir@^2.0.0, make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -6393,11 +6362,6 @@ os-homedir@^1.0.0: resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= -os-homedir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-2.0.0.tgz#a0c76bb001a8392a503cbd46e7e650b3423a923c" - integrity sha512-saRNz0DSC5C/I++gFIaJTXoFJMRwiP5zHar5vV3xQ2TkgEw6hDCcU5F272JjUylpiVgBrZNQHnfjkLabTfb92Q== - os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -7062,7 +7026,7 @@ regexpp@^3.1.0: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== -regexpu-core@^4.5.4, regexpu-core@^4.7.1: +regexpu-core@^4.7.1: version "4.8.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.8.0.tgz#e5605ba361b67b1718478501327502f4479a98f0" integrity sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg== @@ -7189,14 +7153,6 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" -rollup-plugin-buble@^0.19.2: - version "0.19.8" - resolved "https://registry.yarnpkg.com/rollup-plugin-buble/-/rollup-plugin-buble-0.19.8.tgz#f9232e2bb62a7573d04f9705c1bd6f02c2a02c6a" - integrity sha512-8J4zPk2DQdk3rxeZvxgzhHh/rm5nJkjwgcsUYisCQg1QbT5yagW+hehYEW7ZNns/NVbDCTv4JQ7h4fC8qKGOKw== - dependencies: - buble "^0.19.8" - rollup-pluginutils "^2.3.3" - rollup-plugin-filesize@^9.1.0: version "9.1.1" resolved "https://registry.yarnpkg.com/rollup-plugin-filesize/-/rollup-plugin-filesize-9.1.1.tgz#31a6b02b27ce08082ef0970cfe4c451714ff91c4" @@ -7243,7 +7199,7 @@ rollup-plugin-typescript2@^0.30.0: resolve "1.20.0" tslib "2.1.0" -rollup-pluginutils@^2.3.3, rollup-pluginutils@^2.8.1: +rollup-pluginutils@^2.8.1: version "2.8.2" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== @@ -7484,11 +7440,6 @@ source-map@^0.7.3, source-map@~0.7.2: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== -sourcemap-codec@^1.4.4: - version "1.4.8" - resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" - integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== - spdx-correct@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" From d0ba7c3f7be574d0fcff9ae34e2c83431ba843aa Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Sat, 9 Oct 2021 18:15:27 -0300 Subject: [PATCH 08/49] rename types; change write signature --- packages/babel-plugin/src/compile-document.js | 18 +-- packages/bindings/__tests__/index.ts | 30 ++-- packages/bindings/src/index.ts | 58 ++++---- packages/core/__tests__/build-query-tree.ts | 45 +++--- packages/core/__tests__/index.ts | 103 ++++++------- .../{map-objects.ts => map-records.ts} | 54 +++---- packages/core/src/build-query-tree.ts | 22 ++- packages/core/src/index.ts | 139 ++++++++---------- .../src/{map-objects.ts => map-records.ts} | 10 +- packages/core/src/util.ts | 2 +- packages/core/tag.d.ts | 4 +- packages/react/__tests__/index.tsx | 20 +-- packages/react/src/index.ts | 4 +- 13 files changed, 249 insertions(+), 260 deletions(-) rename packages/core/__tests__/{map-objects.ts => map-records.ts} (54%) rename packages/core/src/{map-objects.ts => map-records.ts} (77%) diff --git a/packages/babel-plugin/src/compile-document.js b/packages/babel-plugin/src/compile-document.js index fe4b2d20..e1d39414 100644 --- a/packages/babel-plugin/src/compile-document.js +++ b/packages/babel-plugin/src/compile-document.js @@ -45,7 +45,7 @@ export default function compileDocument(source, opts) { throw new Error("@grafoo/core/tag: only one operation definition is accepted per tag."); } - let grafooObj = {}; + let grafooQuery = {}; if (oprs.length) { let printed = print(oprs[0]); @@ -56,12 +56,12 @@ export default function compileDocument(source, opts) { // Document is also sorted by "sortDocument" therefore // selections, fields, etc order shouldn't matter either if (opts.generateIds) { - grafooObj.id = md5Hash(compressed).toString(); + grafooQuery.id = md5Hash(compressed).toString(); } - grafooObj.query = opts.compress ? compressed : printed; + grafooQuery.query = opts.compress ? compressed : printed; - grafooObj.paths = oprs[0].selectionSet.selections.reduce( + grafooQuery.paths = oprs[0].selectionSet.selections.reduce( (acc, s) => Object.assign(acc, { // TODO: generate hashes as well @@ -73,20 +73,20 @@ export default function compileDocument(source, opts) { a = a.value; } return a.name.value; - }), - }, + }) + } }), {} ); } if (frags.length) { - grafooObj.frags = {}; + grafooQuery.frags = {}; for (let frag of frags) { - grafooObj.frags[frag.name.value] = opts.compress ? compress(print(frag)) : print(frag); + grafooQuery.frags[frag.name.value] = opts.compress ? compress(print(frag)) : print(frag); } } - return grafooObj; + return grafooQuery; } diff --git a/packages/bindings/__tests__/index.ts b/packages/bindings/__tests__/index.ts index 6b21a211..3e06c8c4 100644 --- a/packages/bindings/__tests__/index.ts +++ b/packages/bindings/__tests__/index.ts @@ -223,27 +223,27 @@ describe("@grafoo/bindings", () => { }); it("should provide the data if the query is already cached", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let data = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); let bindings = createBindings(client, () => {}, { query: AUTHORS }); - expect(bindings.getState()).toMatchObject({ ...data, loaded: true, loading: false }); + expect(bindings.getState()).toMatchObject({ ...data.data, loaded: true, loading: false }); }); it("should provide the data if a query is partialy cached", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let data = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); let bindings = createBindings(client, () => {}, { query: POSTS_AND_AUTHORS }); - expect(bindings.getState()).toMatchObject({ ...data, loaded: false, loading: true }); + expect(bindings.getState()).toMatchObject({ ...data.data, loaded: false, loading: true }); }); it("should trigger updater function if the cache has been updated", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let data = await mockQueryRequest(AUTHORS); let renderFn = jest.fn(); @@ -252,11 +252,11 @@ describe("@grafoo/bindings", () => { client.write(AUTHORS, data); expect(renderFn).toHaveBeenCalled(); - expect(bindings.getState()).toMatchObject(data); + expect(bindings.getState()).toMatchObject(data.data); }); it("should provide the state for a cached query", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let data = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); @@ -264,7 +264,7 @@ describe("@grafoo/bindings", () => { let bindings = createBindings(client, renderFn, { query: AUTHORS }); - expect(bindings.getState()).toMatchObject(data); + expect(bindings.getState()).toMatchObject(data.data); }); it("should stop updating if unbind has been called", async () => { @@ -279,7 +279,9 @@ describe("@grafoo/bindings", () => { bindings.unbind(); client.write(AUTHORS, { - authors: data.authors.map((a, i) => (!i ? { ...a, name: "Homer" } : a)) + data: { + authors: data.authors.map((a, i) => (!i ? { ...a, name: "Homer" } : a)) + } }); expect(client.read(AUTHORS).data.authors[0].name).toBe("Homer"); @@ -362,7 +364,7 @@ describe("@grafoo/bindings", () => { let mutations = { createAuthor: { query: CREATE_AUTHOR, - optimisticUpdate: ({ authors }, variables: Author) => ({ + optimisticUpdate: ({ authors }, variables) => ({ authors: [{ ...variables, id: "tempID" }, ...authors] }), update: ({ authors }, data) => ({ @@ -407,7 +409,7 @@ describe("@grafoo/bindings", () => { let { data: { createAuthor: author } } = await mockQueryRequest({ query, variables: { name: "gustav" } }); - let { data } = await mockQueryRequest(AUTHORS); + let data = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); @@ -442,7 +444,7 @@ describe("@grafoo/bindings", () => { query, variables: { name: "sven" } }); - let { data } = await mockQueryRequest(AUTHORS); + let data = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); @@ -471,7 +473,7 @@ describe("@grafoo/bindings", () => { }); it("should not update if query objects is not modified", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let data = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); @@ -485,7 +487,7 @@ describe("@grafoo/bindings", () => { }); it("should accept multiple mutations", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let data = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); let mutations = { diff --git a/packages/bindings/src/index.ts b/packages/bindings/src/index.ts index b654dc77..e3d7613d 100644 --- a/packages/bindings/src/index.ts +++ b/packages/bindings/src/index.ts @@ -1,12 +1,12 @@ import { GrafooClient, - GrafooObjectsMap, + GrafooRecords, GraphQlError, GraphQlPayload, - GrafooObject + GrafooQuery } from "@grafoo/core"; -export type GrafooBoundMutations> = { +export type GrafooBoundMutations> = { [U in keyof T]: ( variables: T[U]["_variablesType"] ) => Promise>; @@ -18,58 +18,60 @@ export type GrafooBoundState = { errors?: GraphQlError[]; }; -export type GrafooMutation = { +export type GrafooMutation = { query: U; update?: (props: T["_queryType"], data: U["_queryType"]) => T["_queryType"]; optimisticUpdate?: (props: T["_queryType"], variables: U["_variablesType"]) => T["_queryType"]; }; -export type GrafooConsumerProps> = { +export type GrafooMutations> = { + [V in keyof U]: GrafooMutation; +}; + +export type GrafooConsumerProps> = { query?: T; variables?: T["_variablesType"]; - mutations?: { - [V in keyof U]: GrafooMutation; - }; + mutations?: GrafooMutations; skip?: boolean; }; export default function createBindings< - T extends GrafooObject, - U extends Record + T extends GrafooQuery, + U extends Record >(client: GrafooClient, updater: () => void, props: GrafooConsumerProps) { type CP = GrafooConsumerProps; let { query, variables, mutations, skip } = props; let data: CP["query"]["_queryType"]; let boundMutations = {} as GrafooBoundMutations; - let objects: GrafooObjectsMap; + let records: GrafooRecords; let partial = false; let unbind = () => {}; let lockListenUpdate = false; let loaded = false; if (query) { - ({ data, objects, partial } = client.read(query, variables)); + ({ data, records, partial } = client.read(query, variables)); loaded = !!data && !partial; - unbind = client.listen((nextObjects) => { + unbind = client.listen((nextRecords) => { if (lockListenUpdate) return (lockListenUpdate = false); - objects = objects || {}; + records = records || {}; - for (let i in nextObjects) { - // object has been inserted - if (!(i in objects)) return performUpdate(); + for (let i in nextRecords) { + // record has been inserted + if (!(i in records)) return performUpdate(); - for (let j in nextObjects[i]) { - // object has been updated - if (nextObjects[i][j] !== objects[i][j]) return performUpdate(); + for (let j in nextRecords[i]) { + // record has been updated + if (nextRecords[i][j] !== records[i][j]) return performUpdate(); } } - for (let i in objects) { - // object has been removed - if (!(i in nextObjects)) return performUpdate(); + for (let i in records) { + // record has been removed + if (!(i in nextRecords)) return performUpdate(); } }); } @@ -82,12 +84,12 @@ export default function createBindings< boundMutations[key] = (mutationVariables) => { if (query && optimisticUpdate) { - writeToCache(optimisticUpdate(data, mutationVariables)); + writeToCache({ data: optimisticUpdate(data, mutationVariables) }); } return client.execute(mutationQuery, mutationVariables).then((mutationResponse) => { if (query && update && mutationResponse.data) { - writeToCache(update(data, mutationResponse.data)); + writeToCache({ data: update(data, mutationResponse.data) }); } return mutationResponse; @@ -96,12 +98,12 @@ export default function createBindings< } } - function writeToCache(dataUpdate: CP["query"]["_queryType"]) { + function writeToCache(dataUpdate: { data: CP["query"]["_queryType"] }) { client.write(query, variables, dataUpdate); } function performUpdate(boundStateUpdate?: GrafooBoundState) { - ({ data, objects } = client.read(query, variables)); + ({ data, records } = client.read(query, variables)); Object.assign(boundState, boundStateUpdate); updater(); @@ -124,7 +126,7 @@ export default function createBindings< return client.execute(query, variables).then(({ data, errors }) => { if (data) { lockListenUpdate = true; - writeToCache(data); + writeToCache({ data }); } performUpdate(Object.assign({ loaded: !!data, loading: false }, errors && { errors })); diff --git a/packages/core/__tests__/build-query-tree.ts b/packages/core/__tests__/build-query-tree.ts index 8d3f0b5c..30d5be5a 100644 --- a/packages/core/__tests__/build-query-tree.ts +++ b/packages/core/__tests__/build-query-tree.ts @@ -6,66 +6,71 @@ let tree = { title: "foo", id: "1", author: { - name: "miguel", + name: "homer", id: "2", posts: [ { id: "1", content: "a post content", author: { - name: "miguel", + name: "homer", lastName: "albernaz", - id: "2", - }, - }, - ], - }, + id: "2" + } + } + ] + } }, - { title: "bar", id: "3", author: { name: "vicente", id: "4" } }, - { title: "baz", id: "5", author: { name: "laura", id: "6" } }, - ], + { title: "bar", id: "3", author: { name: "bart", id: "4" } }, + { title: "baz", id: "5", author: { name: "lisa", id: "6" } } + ] }; let idFields = ["id"]; describe("build-query-tree", () => { it("should update values of a resulting query tree", () => { - let objects = { + let records = { "1": { title: "foobar", id: "1", content: "a new post content" }, - "2": { name: "miguel", id: "2", lastName: "coelho" }, + "2": { name: "homer", id: "2", lastName: "simpson" } }; - let { posts } = buildQueryTree(tree, objects, idFields); + let { posts } = buildQueryTree(tree, records, idFields); expect(posts[0].title).toBe("foobar"); + // @ts-ignore expect(posts[0].content).toBe("a new post content"); - expect(posts[0].author.lastName).toBe("coelho"); + // @ts-ignore + expect(posts[0].author.lastName).toBe("simpson"); }); it("should add all properties of an object to its corresponding branch", () => { - let objects = { + let records = { "1": { title: "foo", id: "1", content: "a post content" }, - "2": { name: "miguel", id: "2", lastName: "coelho" }, + "2": { name: "homer", id: "2", lastName: "simpson" } }; - let [post] = buildQueryTree(tree, objects, idFields).posts; + let [post] = buildQueryTree(tree, records, idFields).posts; + // @ts-ignore expect(post.content).toBeTruthy(); + // @ts-ignore expect(post.author.lastName).toBeTruthy(); + // @ts-ignore expect(post.author.posts[0].title).toBeTruthy(); }); it("should not remove a property from a branch", () => { - let objects = { + let records = { "1": { id: "1" }, "2": { id: "2" }, "3": { id: "3" }, "4": { id: "4" }, "5": { id: "5" }, - "6": { id: "6" }, + "6": { id: "6" } }; - let newTree = buildQueryTree(tree, objects, idFields); + let newTree = buildQueryTree(tree, records, idFields); expect(newTree).toEqual(tree); }); diff --git a/packages/core/__tests__/index.ts b/packages/core/__tests__/index.ts index 5bd73040..9f43195e 100644 --- a/packages/core/__tests__/index.ts +++ b/packages/core/__tests__/index.ts @@ -3,17 +3,17 @@ import { executeQuery } from "@grafoo/test-utils"; import createClient, { GrafooClient } from "../src"; type Post = { - title: string; - content: string; - id: string; - __typename: string; - author: Author; + title?: string; + content?: string; + id?: string; + __typename?: string; + author?: Author; }; type Author = { - name: string; - id: string; - __typename: string; + name?: string; + id?: string; + __typename?: string; posts?: Array; }; @@ -160,16 +160,16 @@ describe("@grafoo/core", () => { client.write(POSTS_AND_AUTHORS, data); let { authors, posts } = data.data; - let { objectsMap, pathsMap } = client.flush(); + let { records, paths } = client.flush(); expect(authors).toEqual( - pathsMap["authors{__typename id name posts{__typename body id title}}"].data.authors + paths["authors{__typename id name posts{__typename body id title}}"].data.authors ); expect(posts).toEqual( - pathsMap["posts{__typename author{__typename id name}body id title}"].data.posts + paths["posts{__typename author{__typename id name}body id title}"].data.posts ); - expect(authors.every((author) => Boolean(objectsMap[author.id]))).toBe(true); - expect(posts.every((post) => Boolean(objectsMap[post.id]))).toBe(true); + expect(authors.every((author) => Boolean(records[author.id]))).toBe(true); + expect(posts.every((post) => Boolean(records[post.id]))).toBe(true); }); it("should write queries partially to the client", async () => { @@ -181,24 +181,24 @@ describe("@grafoo/core", () => { }); it("should read queries from the client", async () => { - let { data } = await client.execute(AUTHORS); + let data = await client.execute(AUTHORS); client.write(AUTHORS, data); let result = client.read(AUTHORS); - let { authors } = data; + let { authors } = data.data; expect(authors).toEqual(result.data.authors); - expect(authors.every((author) => Boolean(result.objects[author.id]))).toBe(true); + expect(authors.every((author) => Boolean(result.records[author.id]))).toBe(true); expect( - authors.every((author) => author.posts.every((post) => Boolean(result.objects[post.id]))) + authors.every((author) => author.posts.every((post) => Boolean(result.records[post.id]))) ).toBe(true); }); it("should handle queries with variables", async () => { let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; - let { data } = await client.execute(POST, variables); + let data = await client.execute(POST, variables); client.write(POST, variables, data); @@ -210,7 +210,7 @@ describe("@grafoo/core", () => { let v1 = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; let v2 = { postId: "77c483dd-6529-4c72-9bb6-bbfd69f65682" }; - let { data: d1 } = await client.execute(POST, v1); + let d1 = await client.execute(POST, v1); client.write(POST, v1, d1); expect(client.read(POST, { postId: "not found" })).toEqual({}); @@ -224,29 +224,31 @@ describe("@grafoo/core", () => { }); it("should flag if a query result is partial", async () => { - let { data } = await client.execute(POSTS); + let data = await client.execute(POSTS); client.write(POSTS, data); expect(client.read(POSTS_AND_AUTHORS).partial).toBe(true); }); - it("should remove unused objects from objectsMap", async () => { - let { data } = await client.execute(SIMPLE_AUTHORS); + it("should remove unused records from state records", async () => { + let data = await client.execute(SIMPLE_AUTHORS); client.write(SIMPLE_AUTHORS, data); - let authorToBeRemoved = data.authors[0]; + let authorToBeRemoved = data.data.authors[0]; - let ids = Object.keys(client.flush().objectsMap); + let ids = Object.keys(client.flush().records); expect(ids.some((id) => id === authorToBeRemoved.id)).toBe(true); client.write(SIMPLE_AUTHORS, { - authors: data.authors.filter((author) => author.id !== authorToBeRemoved.id) + data: { + authors: data.data.authors.filter((author) => author.id !== authorToBeRemoved.id) + } }); - let nextIds = Object.keys(client.flush().objectsMap); + let nextIds = Object.keys(client.flush().records); expect(nextIds.length).toBe(ids.length - 1); expect(nextIds.some((id) => id === authorToBeRemoved.id)).toBe(false); @@ -254,7 +256,7 @@ describe("@grafoo/core", () => { it("should perform update to client", async () => { let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; - let { data } = await client.execute(POST, variables); + let data = await client.execute(POST, variables); client.write(POST, variables, data); @@ -264,15 +266,17 @@ describe("@grafoo/core", () => { expect(post.title).toBe("Quam odit"); - client.write(POST, variables, { post: { ...post, title: "updated title" } }); + client.write(POST, variables, { + data: { post: { ...post, title: "updated title" } } + }); expect(client.read(POST, variables).data.post.title).toBe("updated title"); }); - it("should reflect updates on queries with shared objects", async () => { + it("should reflect updates on queries when shared records change", async () => { let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; - let { data: postData } = await client.execute(POST, variables); - let { data: postsData } = await client.execute(POSTS, variables); + let postData = await client.execute(POST, variables); + let postsData = await client.execute(POSTS, variables); client.write(POSTS, postsData); @@ -280,16 +284,18 @@ describe("@grafoo/core", () => { expect(posts.find((p) => p.id === variables.postId).title).toBe("Quam odit"); - client.write(POST, variables, { post: { ...postData.post, title: "updated title" } }); + client.write(POST, variables, { + data: { post: { ...postData.data.post, title: "updated title" } } + }); let { posts: updatedPosts } = client.read(POSTS, variables).data; expect(updatedPosts.find((p) => p.id === variables.postId).title).toBe("updated title"); }); - it("should merge objects in the client when removing or adding properties", async () => { + it("should merge records in the client when removing or adding properties", async () => { let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; - let { data } = await client.execute(POST, variables); + let data = await client.execute(POST, variables); client.write(POST, variables, data); @@ -299,7 +305,7 @@ describe("@grafoo/core", () => { post.foo = "bar"; - client.write(POST, variables, { post }); + client.write(POST, variables, { data: { post } }); expect(client.read(POST, variables).data.post).toEqual({ __typename: "Post", @@ -315,9 +321,9 @@ describe("@grafoo/core", () => { }); }); - it("should call client listeners on write with paths objects as arguments", async () => { + it("should call client listeners on write with paths records as arguments", async () => { let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; - let { data } = await client.execute(POST, variables); + let data = await client.execute(POST, variables); let listener = jest.fn(); let listener2 = jest.fn(); @@ -327,7 +333,7 @@ describe("@grafoo/core", () => { client.write(POST, variables, data); - expect(listener).toHaveBeenCalledWith(client.read(POST, variables).objects); + expect(listener).toHaveBeenCalledWith(client.read(POST, variables).records); unlisten(); client.write(POST, variables, data); @@ -342,34 +348,31 @@ describe("@grafoo/core", () => { }); it("should be able read from the client with a declared initialState", async () => { - let { data } = await client.execute(POSTS_AND_AUTHORS); + let data = await client.execute(POSTS_AND_AUTHORS); - client.write(POSTS_AND_AUTHORS, data as any); + client.write(POSTS_AND_AUTHORS, data); client = createClient(mockTransport, { idFields: ["id"], initialState: client.flush() }); - expect(client.read(POSTS_AND_AUTHORS).data).toEqual(data); + expect(client.read(POSTS_AND_AUTHORS).data).toEqual(data.data); }); it("should allow cache to be cleared using reset()", () => { - let data = { authors: [{ name: "deleteme" }] }; - client.write(SIMPLE_AUTHORS, data as any); + let data: AuthorsQuery = { authors: [{ name: "deleteme" }] }; + client.write(SIMPLE_AUTHORS, { data }); expect(client.read(SIMPLE_AUTHORS).data).toEqual(data); client.reset(); expect(client.read(SIMPLE_AUTHORS).data).toEqual(undefined); - expect(client.flush()).toEqual({ - objectsMap: {}, - pathsMap: {} - }); + expect(client.flush()).toEqual({ records: {}, paths: {} }); }); it("should accept `idFields` array in options", async () => { let client = createClient(mockTransport, { idFields: ["__typename", "id"] }); - let { data } = await client.execute(AUTHORS); + let data = await client.execute(AUTHORS); - client.write(AUTHORS, data as any); + client.write(AUTHORS, data); - let cachedIds = Object.keys(client.flush().objectsMap); + let cachedIds = Object.keys(client.flush().records); expect(cachedIds.every((key) => /(Post|Author)/.test(key))).toBe(true); }); diff --git a/packages/core/__tests__/map-objects.ts b/packages/core/__tests__/map-records.ts similarity index 54% rename from packages/core/__tests__/map-objects.ts rename to packages/core/__tests__/map-records.ts index 9b496c4e..380aaa2f 100644 --- a/packages/core/__tests__/map-objects.ts +++ b/packages/core/__tests__/map-records.ts @@ -1,4 +1,4 @@ -import mapObjects from "../src/map-objects"; +import mapRecords from "../src/map-records"; let tree = { posts: [ @@ -7,7 +7,7 @@ let tree = { id: "1", __typename: "Post", author: { - name: "miguel", + name: "homer", id: "2", __typename: "Author", posts: [ @@ -17,46 +17,46 @@ let tree = { __typename: "Post", content: "a post content", author: { - name: "miguel", - lastName: "albernaz", + name: "homer", + lastName: "simpson", id: "2", - __typename: "Author", - }, - }, - ], - }, + __typename: "Author" + } + } + ] + } }, { title: "bar", id: "3", __typename: "Post", - author: { name: "vicente", id: "4", __typename: "Author" }, + author: { name: "bart", id: "4", __typename: "Author" } }, { title: "baz", id: "5", __typename: "Post", - author: { name: "laura", id: "6", __typename: "Author" }, - }, - ], + author: { name: "lisa", id: "6", __typename: "Author" } + } + ] }; let idFields = ["id"]; describe("map-objects", () => { - it("should return the correct map of objects", () => { - let objects = mapObjects(tree, idFields); + it("should return the correct map of records", () => { + let records = mapRecords(tree, idFields); let expected = { "1": { title: "foo", id: "1", __typename: "Post", content: "a post content" }, - "2": { name: "miguel", id: "2", __typename: "Author", lastName: "albernaz" }, + "2": { name: "homer", id: "2", __typename: "Author", lastName: "simpson" }, "3": { title: "bar", __typename: "Post", id: "3" }, - "4": { name: "vicente", id: "4", __typename: "Author" }, + "4": { name: "bart", id: "4", __typename: "Author" }, "5": { title: "baz", __typename: "Post", id: "5" }, - "6": { name: "laura", id: "6", __typename: "Author" }, + "6": { name: "lisa", id: "6", __typename: "Author" } }; - expect(objects).toEqual(expected); + expect(records).toEqual(expected); }); it("should accept null values", () => { @@ -64,24 +64,24 @@ describe("map-objects", () => { data: { me: { id: "5a3ab7e93f662a108d978a6e", - username: "malbernaz", - email: "albernazmiguel@gmail.com", + username: "hsimpson", + email: "simpsonhomer@gmail.com", name: null, - bio: null, - }, - }, + bio: null + } + } }; - expect(() => mapObjects(result, idFields)).not.toThrow(); + expect(() => mapRecords(result, idFields)).not.toThrow(); }); it("should build an object identifier based on the `idFields` cache option", () => { let idFields = ["__typename", "id"]; - let objects = mapObjects(tree, idFields); + let records = mapRecords(tree, idFields); let expected = ["Post1", "Author2", "Post3", "Author4", "Post5", "Author6"]; - expect(Object.keys(objects).every((obj) => expected.some((exp) => exp === obj))).toBe(true); + expect(Object.keys(records).every((obj) => expected.some((exp) => exp === obj))).toBe(true); }); }); diff --git a/packages/core/src/build-query-tree.ts b/packages/core/src/build-query-tree.ts index c9f054a3..00ef4775 100644 --- a/packages/core/src/build-query-tree.ts +++ b/packages/core/src/build-query-tree.ts @@ -1,11 +1,7 @@ -import { GrafooObjectsMap } from "."; -import { idFromProps, isNotNullObject } from "./util"; +import { GrafooRecords } from "."; +import { idFromBranch, isNotNullObject } from "./util"; -export default function buildQueryTree( - tree: T, - objects: GrafooObjectsMap, - idFields: string[] -): T { +export default function buildQueryTree(tree: T, records: GrafooRecords, idFields: string[]): T { // clone resulting query tree let queryTree = tree; let stack = []; @@ -21,15 +17,15 @@ export default function buildQueryTree( // assigns nested branch let branch = currentTree[key]; // get node identifier - let identifier = idFromProps(branch, idFields); - // possible node matching object - let branchObject = objects[identifier]; + let identifier = idFromBranch(branch, idFields); + // possible node matching stored record + let possibleBranchRecord = records[identifier]; // iterates over the child branch properties - for (let i in Object.assign({}, branch, branchObject)) { + for (let i in Object.assign({}, branch, possibleBranchRecord)) { // assigns to the child branch all properties retrieved - // from the corresponding object retrieved from the objects cache - if (identifier && branchObject) branch[i] = branchObject[i] || branch[i]; + // from the corresponding record retrieved from the records cache + if (identifier && possibleBranchRecord) branch[i] = possibleBranchRecord[i] || branch[i]; // pushes properties of the child branch and the branch it self to the stack if (isNotNullObject(branch[i])) stack.push([i, branch]); diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 9ccadf0b..039235d5 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,5 +1,5 @@ import buildQueryTree from "./build-query-tree"; -import mapObjects from "./map-objects"; +import mapRecords from "./map-records"; import { getPathId } from "./util"; export type GraphQlError = { @@ -8,79 +8,61 @@ export type GraphQlError = { path: string[]; }; -/** - * T = QueryData - */ export type GraphQlPayload = { data: T; errors?: GraphQlError[]; }; -/** - * T = QueryData - */ export type GrafooTransport = ( query: string, variables?: unknown, id?: string ) => Promise>; -export type GrafooObjectsMap = { - [key: string]: Record; -}; +export type GrafooRecords = Record>; -export type GrafooPathsMap = { - [key: string]: { - data: { [key: string]: unknown }; - objects: string[]; +export type GrafooPaths = Record< + string, + { + data: Record; + records: string[]; partial?: boolean; - }; -}; + } +>; -export type GrafooListener = (objects: GrafooObjectsMap) => void; +export type GrafooListener = (objects: GrafooRecords) => void; export type GrafooInitialState = { - objectsMap: GrafooObjectsMap; - pathsMap: GrafooPathsMap; + records: GrafooRecords; + paths: GrafooPaths; }; -export type GrafooObject = { - frags?: { - [key: string]: string; - }; - paths: { - [key: string]: { - name: string; - args: string[]; - }; - }; +export type GrafooQuery = { query: string; - id?: string; + frags?: Record; + paths: Record; _queryType: T; _variablesType: U; }; export type GrafooClient = { - execute: ( - grafooObject: T, + execute: ( + query: T, variables?: T["_variablesType"] ) => Promise>; listen: (listener: GrafooListener) => () => void; write: { - ( - grafooObject: T, + ( + query: T, variables: T["_variablesType"], - data: T["_queryType"] | { data: T["_queryType"] } - ): void; - ( - grafooObject: T, - data: T["_queryType"] | { data: T["_queryType"] } + payload: { data: T["_queryType"] } ): void; + (query: T, payload: { data: T["_queryType"] }): void; }; - read: ( - grafooObject: T, + read: ( + query: T, variables?: T["_variablesType"] - ) => { data?: T["_queryType"]; objects?: GrafooObjectsMap; partial?: boolean }; + ) => { data?: T["_queryType"]; records?: GrafooRecords; partial?: boolean }; flush: () => GrafooInitialState; reset: () => void; }; @@ -95,16 +77,13 @@ export default function createClient( options?: GrafooClientOptions ): GrafooClient { let { initialState, idFields } = options; - let { pathsMap, objectsMap } = initialState || { pathsMap: {}, objectsMap: {} }; + let { paths, records } = initialState || { paths: {}, records: {} }; let listeners: GrafooListener[] = []; - function execute( - { query, frags, id }: T, - variables?: T["_variablesType"] - ) { + function execute({ query, frags }: T, variables?: T["_variablesType"]) { if (frags) for (let frag in frags) query += frags[frag]; - return transport(query, variables, id); + return transport(query, variables); } function listen(listener: GrafooListener) { @@ -119,81 +98,81 @@ export default function createClient( }; } - function write( - { paths }: T, + function write( + query: T, variables: T["_variablesType"], - data?: T["_queryType"] | { data: T["_queryType"] } + payload?: { data: T["_queryType"] } ) { - if (!data) { - data = variables as typeof data; + if (!payload) { + payload = variables as { data: T["_queryType"] }; variables = undefined; } - let objects: GrafooObjectsMap = {}; + let queryRecords: GrafooRecords = {}; - for (let i in paths) { - let { name, args } = paths[i]; + for (let i in query.paths) { + let { name, args } = query.paths[i]; let pathData = { - [name]: (data as { data: T }).data ? (data as { data: T }).data[name] : data[name] + [name]: payload.data[name] }; - let pathObjects = mapObjects(pathData, idFields); + let pathRecords = mapRecords(pathData, idFields); - Object.assign(objects, pathObjects); + Object.assign(queryRecords, pathRecords); - pathsMap[getPathId(i, args, variables)] = { + paths[getPathId(i, args, variables)] = { data: pathData, - objects: Object.keys(pathObjects) + records: Object.keys(pathRecords) }; } // assign new values to objects in objectsMap - for (let i in objects) { - objectsMap[i] = objects[i] = Object.assign({}, objectsMap[i], objects[i]); + for (let i in queryRecords) { + records[i] = queryRecords[i] = Object.assign({}, records[i], queryRecords[i]); } // clean cache - let pathsObjects = []; - for (let i in pathsMap) pathsObjects = pathsObjects.concat(pathsMap[i].objects); - let allObjects = new Set(pathsObjects); - for (let i in objectsMap) if (!allObjects.has(i)) delete objectsMap[i]; + let idsList: string[] = []; + for (let i in paths) idsList = idsList.concat(paths[i].records); + let allIds = new Set(idsList); + for (let i in records) if (!allIds.has(i)) delete records[i]; // run listeners - for (let i in listeners) listeners[i](objects); + for (let i in listeners) listeners[i](queryRecords); } - function read( - { paths }: T, + function read( + query: T, variables?: T["_variablesType"] - ): { data?: T["_queryType"]; objects?: GrafooObjectsMap; partial?: boolean } { + ): { data?: T["_queryType"]; records?: GrafooRecords; partial?: boolean } { let data: T["_queryType"] = {}; - let objects: GrafooObjectsMap = {}; + let queryRecords: GrafooRecords = {}; let partial = false; - for (let i in paths) { - let { name, args } = paths[i]; - let currentPath = pathsMap[getPathId(i, args, variables)]; + for (let i in query.paths) { + let { name, args } = query.paths[i]; + let currentPath = paths[getPathId(i, args, variables)]; if (currentPath) { data[name] = currentPath.data[name]; - for (let i of currentPath.objects) objects[i] = objectsMap[i]; + for (let i of currentPath.records) queryRecords[i] = records[i]; } else { partial = true; } } return Object.keys(data).length - ? { data: buildQueryTree(data, objectsMap, idFields), objects, partial } + ? { data: buildQueryTree(data, records, idFields), records: queryRecords, partial } : {}; } function flush() { - return { objectsMap, pathsMap }; + return { records, paths }; } function reset() { - pathsMap = {}; - objectsMap = {}; + paths = {}; + records = {}; } return { execute, listen, write, read, flush, reset }; diff --git a/packages/core/src/map-objects.ts b/packages/core/src/map-records.ts similarity index 77% rename from packages/core/src/map-objects.ts rename to packages/core/src/map-records.ts index 56dd1d05..de995e02 100644 --- a/packages/core/src/map-objects.ts +++ b/packages/core/src/map-records.ts @@ -1,8 +1,8 @@ -import { GrafooObjectsMap } from "."; -import { isNotNullObject, idFromProps } from "./util"; +import { GrafooRecords } from "."; +import { isNotNullObject, idFromBranch } from "./util"; -export default function mapObjects(tree: T, idFields: string[]): GrafooObjectsMap { - // map in which objects will be stored +export default function mapRecords(tree: T, idFields: string[]): GrafooRecords { + // map in which records will be stored // having their extracted ids from props as key let map = {}; let stack = []; @@ -26,7 +26,7 @@ export default function mapObjects(tree: T, idFields: string[]): GrafooObject } // node identifier - let identifier = idFromProps(branch, idFields); + let identifier = idFromBranch(branch, idFields); // if branch is a node, assign the value of filtered branch to it if (identifier) map[identifier] = Object.assign({}, map[identifier], filteredBranch); diff --git a/packages/core/src/util.ts b/packages/core/src/util.ts index d0b3f8bf..9b5fc8d3 100644 --- a/packages/core/src/util.ts +++ b/packages/core/src/util.ts @@ -1,4 +1,4 @@ -export let idFromProps = (branch: { [key: string]: string }, idFields: string | any[]): string => { +export let idFromBranch = (branch: { [key: string]: string }, idFields: string | any[]): string => { branch = branch || {}; let identifier = ""; diff --git a/packages/core/tag.d.ts b/packages/core/tag.d.ts index 66cd1315..9cd4141a 100644 --- a/packages/core/tag.d.ts +++ b/packages/core/tag.d.ts @@ -1,7 +1,7 @@ declare module "@grafoo/core/tag" { - import { GrafooObject } from "@grafoo/core"; + import { GrafooQuery } from "@grafoo/core"; export default function graphql( strs: TemplateStringsArray - ): GrafooObject; + ): GrafooQuery; } diff --git a/packages/react/__tests__/index.tsx b/packages/react/__tests__/index.tsx index 3ee708b9..d615aa1a 100644 --- a/packages/react/__tests__/index.tsx +++ b/packages/react/__tests__/index.tsx @@ -5,7 +5,7 @@ import fetch from "node-fetch"; import * as React from "react"; import graphql from "@grafoo/core/tag"; -import createClient from "@grafoo/core"; +import createClient, { GrafooClient } from "@grafoo/core"; import { mockQueryRequest, createTransport } from "@grafoo/test-utils"; import { renderHook, act } from "@testing-library/react-hooks"; @@ -121,7 +121,7 @@ let CREATE_AUTHOR = graphql` `; describe("@grafoo/react", () => { - let client; + let client: GrafooClient; let wrapper: React.FC; beforeEach(() => { @@ -218,14 +218,14 @@ describe("@grafoo/react", () => { }); it("should not try to load a query if it's already cached", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let data = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); jest.resetAllMocks(); let spy = jest.spyOn(client, "execute"); let { result } = renderHook(() => useGrafoo({ query: AUTHORS }), { wrapper }); - expect(result.current).toEqual({ loading: false, loaded: true, ...data }); + expect(result.current).toEqual({ loading: false, loaded: true, ...data.data }); expect(spy).not.toHaveBeenCalled(); }); @@ -287,17 +287,19 @@ describe("@grafoo/react", () => { }); it("should reflect updates that happen outside of the component", async () => { - let { data } = await mockQueryRequest(AUTHORS); + let data = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); let { result } = renderHook(() => useGrafoo({ query: AUTHORS }), { wrapper }); - expect(result.current).toEqual({ loading: false, loaded: true, ...data }); + expect(result.current).toEqual({ loading: false, loaded: true, ...data.data }); act(() => { client.write(AUTHORS, { - authors: data.authors.map((a, i) => (!i ? { ...a, name: "Lisa" } : a)) + data: { + authors: data.data.authors.map((a, i) => (!i ? { ...a, name: "Lisa" } : a)) + } }); }); @@ -305,7 +307,7 @@ describe("@grafoo/react", () => { }); it("should not trigger a network request if a query field is cached", async () => { - let { data } = await mockQueryRequest(POSTS_AND_AUTHORS); + let data = await mockQueryRequest(POSTS_AND_AUTHORS); client.write(POSTS_AND_AUTHORS, data); @@ -313,7 +315,7 @@ describe("@grafoo/react", () => { let spy = jest.spyOn(client, "execute"); - expect(result.current).toEqual({ authors: data.authors, loading: false, loaded: true }); + expect(result.current).toEqual({ authors: data.data.authors, loading: false, loaded: true }); expect(spy).not.toHaveBeenCalled(); }); }); diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index ec127135..f774f921 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -1,5 +1,5 @@ import * as React from "react"; -import { GrafooClient, GrafooObject } from "@grafoo/core"; +import { GrafooClient, GrafooQuery } from "@grafoo/core"; import createBindings, { GrafooConsumerProps, GrafooBoundState, @@ -16,7 +16,7 @@ export type GrafooProviderProps = { export let GrafooProvider: React.FC = (props) => React.createElement(GrafooContext.Provider, { value: props.client }, props.children); -export function useGrafoo>( +export function useGrafoo>( props: GrafooConsumerProps ): GrafooBoundState & T["_queryType"] & GrafooBoundMutations { let client = React.useContext(GrafooContext); From 8a4d0d5defa51e1371d9f38ded7e5e874217680c Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Thu, 14 Oct 2021 23:15:47 -0300 Subject: [PATCH 09/49] babel plugin refactor in typescript; new client resolver --- packages/babel-plugin/.babelrc | 5 +- .../__tests__/__snapshots__/index.js.snap | 6 +- ...ompile-document.js => compile-document.ts} | 20 +-- .../__tests__/generate-client-resolvers.ts | 115 ++++++++++++++++++ .../{insert-fields.js => insert-fields.ts} | 87 ++----------- .../babel-plugin/__tests__/schema.graphql | 46 +++---- .../{sort-query.js => sort-query.ts} | 10 +- packages/babel-plugin/package.json | 10 +- packages/babel-plugin/src/compile-document.js | 92 -------------- packages/babel-plugin/src/compile-document.ts | 107 ++++++++++++++++ .../src/generate-client-resolvers.ts | 78 ++++++++++++ .../babel-plugin/src/{index.js => index.ts} | 26 +++- packages/babel-plugin/src/insert-fields.js | 71 ----------- packages/babel-plugin/src/insert-fields.ts | 97 +++++++++++++++ packages/babel-plugin/src/sort-query.js | 50 -------- packages/babel-plugin/src/sort-query.ts | 74 +++++++++++ packages/babel-plugin/tsconfig.json | 15 +++ packages/bindings/__tests__/index.ts | 113 +++++++++-------- packages/bindings/src/index.ts | 82 +++++++------ packages/core/__tests__/index.ts | 49 ++++---- packages/core/src/index.ts | 41 ++++--- packages/core/src/util.ts | 4 +- packages/react/__tests__/index.tsx | 36 +++--- packages/react/src/index.ts | 16 +-- yarn.lock | 20 ++- 25 files changed, 747 insertions(+), 523 deletions(-) rename packages/babel-plugin/__tests__/{compile-document.js => compile-document.ts} (78%) create mode 100644 packages/babel-plugin/__tests__/generate-client-resolvers.ts rename packages/babel-plugin/__tests__/{insert-fields.js => insert-fields.ts} (74%) rename packages/babel-plugin/__tests__/{sort-query.js => sort-query.ts} (91%) delete mode 100644 packages/babel-plugin/src/compile-document.js create mode 100644 packages/babel-plugin/src/compile-document.ts create mode 100644 packages/babel-plugin/src/generate-client-resolvers.ts rename packages/babel-plugin/src/{index.js => index.ts} (86%) delete mode 100644 packages/babel-plugin/src/insert-fields.js create mode 100644 packages/babel-plugin/src/insert-fields.ts delete mode 100644 packages/babel-plugin/src/sort-query.js create mode 100644 packages/babel-plugin/src/sort-query.ts create mode 100644 packages/babel-plugin/tsconfig.json diff --git a/packages/babel-plugin/.babelrc b/packages/babel-plugin/.babelrc index a6c42326..6e63b6e0 100644 --- a/packages/babel-plugin/.babelrc +++ b/packages/babel-plugin/.babelrc @@ -1,3 +1,6 @@ { - "presets": [["@babel/preset-env", { "targets": { "node": "current" } }]] + "presets": [ + ["@babel/preset-env", { "targets": { "node": "current" } }], + "@babel/preset-typescript" + ] } diff --git a/packages/babel-plugin/__tests__/__snapshots__/index.js.snap b/packages/babel-plugin/__tests__/__snapshots__/index.js.snap index 38c22b35..74ce2f10 100644 --- a/packages/babel-plugin/__tests__/__snapshots__/index.js.snap +++ b/packages/babel-plugin/__tests__/__snapshots__/index.js.snap @@ -58,7 +58,7 @@ let query = gql\` let query = { id: "6e0697df8f2453f2643bbd1e8a39c348", query: - "query ($id: ID!, $offset: Int!, $start: Int!) {\\n posts(offset: $offset, start: $start) {\\n authors {\\n id\\n name\\n username\\n }\\n body\\n createdAt\\n id\\n tags {\\n id\\n name\\n }\\n title\\n }\\n user(id: $id) {\\n id\\n name\\n username\\n }\\n}", + "query($id:ID!,$offset:Int!,$start:Int!){posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}user(id:$id){id name username}}", paths: { "posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}": { @@ -162,7 +162,7 @@ let query = gql\` let query = { query: - "query ($id: ID!, $offset: Int!, $start: Int!) {\\n posts(offset: $offset, start: $start) {\\n authors {\\n id\\n name\\n username\\n }\\n body\\n createdAt\\n id\\n tags {\\n id\\n name\\n }\\n title\\n }\\n user(id: $id) {\\n id\\n name\\n username\\n }\\n}", + "query($id:ID!,$offset:Int!,$start:Int!){posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}user(id:$id){id name username}}", paths: { "posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}": { @@ -226,7 +226,7 @@ let query = gql\` let query = { query: - "query ($id: ID!, $offset: Int!, $start: Int!) {\\n posts(offset: $offset, start: $start) {\\n authors {\\n id\\n name\\n username\\n }\\n body\\n createdAt\\n id\\n tags {\\n id\\n name\\n }\\n title\\n }\\n user(id: $id) {\\n id\\n name\\n username\\n }\\n}", + "query($id:ID!,$offset:Int!,$start:Int!){posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}user(id:$id){id name username}}", paths: { "posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}": { diff --git a/packages/babel-plugin/__tests__/compile-document.js b/packages/babel-plugin/__tests__/compile-document.ts similarity index 78% rename from packages/babel-plugin/__tests__/compile-document.js rename to packages/babel-plugin/__tests__/compile-document.ts index 8f623963..394d1f0e 100644 --- a/packages/babel-plugin/__tests__/compile-document.js +++ b/packages/babel-plugin/__tests__/compile-document.ts @@ -1,11 +1,11 @@ import * as babel from "@babel/core"; -import plugin from "../src"; +import plugin, { Options } from "../src"; -let transform = (program, opts) => +let transform = (program: string, opts?: Options) => babel.transform(program, { plugins: [ - [plugin, Object.assign({ schema: "__tests__/schema.graphql", idFields: ["id"] }, opts)], - ], + [plugin, Object.assign({ schema: "__tests__/schema.graphql", idFields: ["id"] }, opts)] + ] }); describe("compile document", () => { @@ -18,18 +18,6 @@ describe("compile document", () => { expect(() => transform(program, { schema: "?" })).toThrow(); }); - it("should throw if more then one operation is specified", () => { - let program = ` - import gql from "@grafoo/core/tag"; - let query = gql\` - { hello } - { goodbye } - \`; - `; - - expect(() => transform(program)).toThrow(); - }); - it("should accept fragments", () => { let program = ` import gql from "@grafoo/core/tag"; diff --git a/packages/babel-plugin/__tests__/generate-client-resolvers.ts b/packages/babel-plugin/__tests__/generate-client-resolvers.ts new file mode 100644 index 00000000..fdfe41d2 --- /dev/null +++ b/packages/babel-plugin/__tests__/generate-client-resolvers.ts @@ -0,0 +1,115 @@ +import * as fs from "fs"; +import * as path from "path"; +import { parse, buildASTSchema } from "graphql"; + +import generateClientResolver from "../src/generate-client-resolvers"; + +let graphql = (s: TemplateStringsArray) => parse(s[0]); +let schemaString = fs.readFileSync(path.join(__dirname, "schema.graphql"), "utf-8"); +let schema = buildASTSchema(parse(schemaString)); + +describe("generateClientResolver", () => { + it("should create the client resolver object in the correct shape", () => { + let query = graphql` + query { + posts { + id + ...PostStuff + author { + ...AuthorStuff + } + } + + author { + id + name + posts { + ... on Post { + id + title + } + } + } + } + `; + + expect(generateClientResolver(schema, query)).toEqual({ + select: [ + { + name: "posts", + scalars: ["id"], + fragments: ["PostStuff"], + select: [ + { + name: "author", + fragments: ["AuthorStuff"] + } + ] + }, + { + name: "author", + scalars: ["id", "name"], + select: [ + { + name: "posts", + scalars: ["id", "title"] + } + ] + } + ] + }); + + let fragments = graphql` + fragment AuthorStuff on Author { + id + name + posts(from: 1, to: 10) { + ...PostStuff + id + } + } + + fragment PostStuff on Post { + title + } + `; + + expect(generateClientResolver(schema, fragments)).toEqual({ + select: [ + { + name: "AuthorStuff", + scalars: ["id", "name"], + select: [ + { + name: "posts", + args: ["from", "to"], + fragments: ["PostStuff"], + scalars: ["id"] + } + ] + }, + { + name: "PostStuff", + scalars: ["title"] + } + ] + }); + }); +}); + +// const values = { +// posts: [ +// ["record", { author: "record" }], +// ["record", { author: "record" }], +// ["record", { author: "record" }], +// ["record", { author: "record" }], +// ["record", { author: "record" }], +// ["record", { author: "record" }], +// ["record", { author: "record" }], +// ["record", { author: "record" }], +// ], +// authors: [ +// ["record", { posts: ["record", "record", "record", "record"] }], +// ["record", { posts: ["record", "record", "record", "record"] }], +// ] +// } diff --git a/packages/babel-plugin/__tests__/insert-fields.js b/packages/babel-plugin/__tests__/insert-fields.ts similarity index 74% rename from packages/babel-plugin/__tests__/insert-fields.js rename to packages/babel-plugin/__tests__/insert-fields.ts index ca0a39d8..29007003 100644 --- a/packages/babel-plugin/__tests__/insert-fields.js +++ b/packages/babel-plugin/__tests__/insert-fields.ts @@ -1,28 +1,29 @@ import fs from "fs"; -import { parse, print } from "graphql"; +import { buildASTSchema, parse, print } from "graphql"; import path from "path"; import insertFields from "../src/insert-fields"; -let schema = fs.readFileSync(path.join(__dirname, "schema.graphql"), "utf-8"); +let schemaString = fs.readFileSync(path.join(__dirname, "schema.graphql"), "utf-8"); +let schema = buildASTSchema(parse(schemaString)); let cases = [ { should: "should insert a field", input: "{ author { name } }", expectedOutput: "{ author { name id } }", - idFields: ["id"], + idFields: ["id"] }, { should: "should insert more then a field if specified", input: "{ author { name } }", expectedOutput: "{ author { name username email id } }", - idFields: ["username", "email", "id"], + idFields: ["username", "email", "id"] }, { should: "should insert `__typename` if specified", input: "{ author { name } }", expectedOutput: "{ author { name __typename } }", - idFields: ["__typename"], + idFields: ["__typename"] }, { should: "should insert props in queries with fragments", @@ -56,7 +57,7 @@ let cases = [ } } `, - idFields: ["id"], + idFields: ["id"] }, { should: "should insert props in queries with inline fragments", @@ -88,7 +89,7 @@ let cases = [ } } `, - idFields: ["id", "__typename"], + idFields: ["id", "__typename"] }, { should: "should not insert `__typename` inside fragments", @@ -122,7 +123,7 @@ let cases = [ } } `, - idFields: ["__typename"], + idFields: ["__typename"] }, { should: "should not insert `__typename` inside inline fragments", @@ -152,69 +153,7 @@ let cases = [ } } `, - idFields: ["__typename"], - }, - { - should: "should insert field present on a fragment", - input: ` - { - user { - ...UserFrag - } - } - - fragment UserFrag on Author { - name - posts { - title - } - } - `, - expectedOutput: ` - { - user { - ...UserFrag - } - } - - fragment UserFrag on Author { - name - posts { - title - } - bio - } - `, - idFields: ["bio"], - }, - { - should: "should insert field present in an inline fragment", - input: ` - { - user { - name - ...on Author { - posts { - title - } - } - } - } - `, - expectedOutput: ` - { - user { - name - ...on Author { - posts { - title - } - bio - } - } - } - `, - idFields: ["bio"], + idFields: ["__typename"] }, { should: "should insert fields in inline fragments while leaving unions", @@ -244,7 +183,7 @@ let cases = [ } } `, - idFields: ["id"], + idFields: ["id"] }, { should: "should not insert `__typename` in an operation definition", @@ -272,8 +211,8 @@ let cases = [ } } `, - idFields: ["id", "__typename"], - }, + idFields: ["id", "__typename"] + } ]; describe("insert-fields", () => { diff --git a/packages/babel-plugin/__tests__/schema.graphql b/packages/babel-plugin/__tests__/schema.graphql index d8100b4d..55365803 100644 --- a/packages/babel-plugin/__tests__/schema.graphql +++ b/packages/babel-plugin/__tests__/schema.graphql @@ -1,12 +1,3 @@ -type Mutation { - createPost(title: String!, body: String!, authors: [ID!]!, tags: [String!]): Post - deletePost(id: ID): Post - createTag(name: String!): Tag - register(username: String!, email: String!, password: String!): User - login(email: String!, password: String!): String - updateUser(username: String, name: String, bio: String, email: String, password: String): User -} - type Post { id: ID! title: String! @@ -15,22 +6,11 @@ type Post { published: Boolean! createdAt: String! updateAt: String! - authors: [User!]! + authors: [Author!]! + author: Author! tags: [Tag!]! } -type Query { - author(id: ID!): Author - authors(start: Int!, offset: Int!): [Author] - posts(start: Int!, offset: Int!): [Post] - post(id: ID!): Post - tag(id: ID!): Tag - users(start: Int!, offset: Int!): [User] - user(id: ID!): User - me: User - viewer: Viewer -} - union Viewer = Visitor | User type Tag { @@ -50,6 +30,7 @@ interface User { } type Author implements User { + id: ID! name: String bio: String posts: [Post!]! @@ -59,3 +40,24 @@ type Visitor { id: ID! ip: String! } + +type Mutation { + createPost(title: String!, body: String!, authors: [ID!]!, tags: [String!]): Post + deletePost(id: ID): Post + createTag(name: String!): Tag + register(username: String!, email: String!, password: String!): User + login(email: String!, password: String!): String + updateUser(username: String, name: String, bio: String, email: String, password: String): User +} + +type Query { + author(id: ID!): Author + authors(start: Int!, offset: Int!): [Author] + posts(start: Int!, offset: Int!): [Post] + post(id: ID!): Post + tag(id: ID!): Tag + users(start: Int!, offset: Int!): [User] + user(id: ID!): User + me: User + viewer: Viewer +} diff --git a/packages/babel-plugin/__tests__/sort-query.js b/packages/babel-plugin/__tests__/sort-query.ts similarity index 91% rename from packages/babel-plugin/__tests__/sort-query.js rename to packages/babel-plugin/__tests__/sort-query.ts index da9ee68b..d586b3fa 100644 --- a/packages/babel-plugin/__tests__/sort-query.js +++ b/packages/babel-plugin/__tests__/sort-query.ts @@ -3,14 +3,14 @@ import sortQuery from "../src/sort-query"; let gql = String.raw; -function print(query, sort = false) { +function print(query: string, sort = false) { return sort ? graphqlPrint(sortQuery(parse(query))) : graphqlPrint(parse(query)); } describe("sort-query", () => { it("should sort fields, variable declarations and arguments", () => { let query = gql` - query($f: ID, $e: ID, $d: ID, $c: ID, $b: ID, $a: ID) { + query ($f: ID, $e: ID, $d: ID, $c: ID, $b: ID, $a: ID) { f e d @@ -34,7 +34,7 @@ describe("sort-query", () => { `; let expected = gql` - query($a: ID, $b: ID, $c: ID, $d: ID, $e: ID, $f: ID) { + query ($a: ID, $b: ID, $c: ID, $d: ID, $e: ID, $f: ID) { a(a: $a, b: $b, c: $c, d: $d, e: $e, f: $f) { a(a: $a, b: $b, c: $c, d: $d, e: $e, f: $f) { b @@ -148,13 +148,13 @@ describe("sort-query", () => { it("should sort directives", () => { let query = gql` - query($c: ID, $b: ID, $a: ID) { + query ($c: ID, $b: ID, $a: ID) { someField @c(c: $c) @a(a: $a) @b(c: $b) } `; let expected = gql` - query($a: ID, $b: ID, $c: ID) { + query ($a: ID, $b: ID, $c: ID) { someField @a(a: $a) @b(c: $b) @c(c: $c) } `; diff --git a/packages/babel-plugin/package.json b/packages/babel-plugin/package.json index 58d0cd76..dbaad5a5 100644 --- a/packages/babel-plugin/package.json +++ b/packages/babel-plugin/package.json @@ -17,17 +17,21 @@ "access": "public" }, "scripts": { - "build": "babel src --out-dir dist", + "build": "tsc", "test": "jest", "test:coverage": "jest --coverage" }, "jest": { "transform": { "^.+\\.(ts|tsx|js)$": "/../../scripts/jest-setup.js" - } + }, + "resolver": "/../../scripts/resolver.js", + "transformIgnorePatterns": [ + "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob)/)" + ] }, "dependencies": { - "babel-literal-to-ast": "^2.1.0", + "@babel/parser": "^7.15.8", "crypto-js": "^4.0.0", "graphql": "^15.6.1", "graphql-query-compress": "^1.0.0" diff --git a/packages/babel-plugin/src/compile-document.js b/packages/babel-plugin/src/compile-document.js deleted file mode 100644 index e1d39414..00000000 --- a/packages/babel-plugin/src/compile-document.js +++ /dev/null @@ -1,92 +0,0 @@ -import fs from "fs"; -import { parse, print } from "graphql"; -import compress from "graphql-query-compress"; -import md5Hash from "crypto-js/md5"; -import path from "path"; -import insertFields from "./insert-fields"; -import sortDocument from "./sort-query"; - -let schema; -function getSchema(schemaPath) { - if (schema) return schema; - - let fullPath; - - if (!schemaPath) { - let schemaJson = path.join(process.cwd(), "schema.json"); - let schemaGraphql = path.join(process.cwd(), "schema.graphql"); - let schemaGql = path.join(process.cwd(), "schema.gql"); - - fullPath = fs.existsSync(schemaJson) - ? schemaJson - : fs.existsSync(schemaGraphql) - ? schemaGraphql - : fs.existsSync(schemaGql) - ? schemaGql - : undefined; - } else { - fullPath = path.join(process.cwd(), schemaPath); - } - - fs.accessSync(fullPath, fs.F_OK); - - schema = fs.readFileSync(fullPath, "utf-8"); - - return schema; -} - -export default function compileDocument(source, opts) { - let schema = getSchema(opts.schema); - let doc = sortDocument(insertFields(schema, parse(source), opts.idFields)); - let oprs = doc.definitions.filter((d) => d.kind === "OperationDefinition"); - let frags = doc.definitions.filter((d) => d.kind === "FragmentDefinition"); - - if (oprs.length > 1) { - throw new Error("@grafoo/core/tag: only one operation definition is accepted per tag."); - } - - let grafooQuery = {}; - - if (oprs.length) { - let printed = print(oprs[0]); - let compressed = compress(printed); - - // Use compressed version to get same hash even if - // query has different whitespaces, newlines, etc - // Document is also sorted by "sortDocument" therefore - // selections, fields, etc order shouldn't matter either - if (opts.generateIds) { - grafooQuery.id = md5Hash(compressed).toString(); - } - - grafooQuery.query = opts.compress ? compressed : printed; - - grafooQuery.paths = oprs[0].selectionSet.selections.reduce( - (acc, s) => - Object.assign(acc, { - // TODO: generate hashes as well - // based on compress(print(s))? - [compress(print(s))]: { - name: s.name.value, - args: s.arguments.map((a) => { - if (a.value && a.value.kind === "Variable") { - a = a.value; - } - return a.name.value; - }) - } - }), - {} - ); - } - - if (frags.length) { - grafooQuery.frags = {}; - - for (let frag of frags) { - grafooQuery.frags[frag.name.value] = opts.compress ? compress(print(frag)) : print(frag); - } - } - - return grafooQuery; -} diff --git a/packages/babel-plugin/src/compile-document.ts b/packages/babel-plugin/src/compile-document.ts new file mode 100644 index 00000000..c74a7eaa --- /dev/null +++ b/packages/babel-plugin/src/compile-document.ts @@ -0,0 +1,107 @@ +import * as fs from "fs"; +import * as path from "path"; +import { + DocumentNode, + FieldNode, + FragmentDefinitionNode, + buildASTSchema, + parse, + print, + getOperationAST +} from "graphql"; +import compress from "graphql-query-compress"; +import md5Hash from "crypto-js/md5"; +import { GrafooQuery } from "@grafoo/core"; + +import insertFields from "./insert-fields"; +import sortDocument from "./sort-query"; +import { Options } from "."; +import generateClientResolver from "./generate-client-resolvers"; + +let schema: string; +function getSchema(schemaPath: string) { + if (schema) return schema; + + let fullPath: string; + + if (!schemaPath) { + let schemaJson = path.join(process.cwd(), "schema.json"); + let schemaGraphql = path.join(process.cwd(), "schema.graphql"); + let schemaGql = path.join(process.cwd(), "schema.gql"); + + fullPath = fs.existsSync(schemaJson) + ? schemaJson + : fs.existsSync(schemaGraphql) + ? schemaGraphql + : fs.existsSync(schemaGql) + ? schemaGql + : undefined; + } else { + fullPath = path.join(process.cwd(), schemaPath); + } + + // @ts-ignore + fs.accessSync(fullPath, fs.F_OK); + + schema = fs.readFileSync(fullPath, "utf-8"); + + return schema; +} + +export default function compileDocument(source: string, opts: Options) { + let schemaString = getSchema(opts.schema); + let schema = buildASTSchema(parse(schemaString)); + let document = sortDocument(insertFields(schema, parse(source), opts.idFields)) as DocumentNode; + let frags = document.definitions.filter( + (d) => d.kind === "FragmentDefinition" + ) as FragmentDefinitionNode[]; + + let grafooQuery = {} as GrafooQuery; + + let operation = getOperationAST(document); + let fragments: DocumentNode = { + ...document, + definitions: document.definitions.filter((d) => d.kind === "FragmentDefinition") + }; + + if (operation) { + let compressedQuery = compress(print(operation)); + + // Use compressedQuery version to get same hash even if + // query has different whitespaces, newlines, etc + // Document is also sorted by "sortDocument" therefore + // selections, fields, etc order shouldn't matter either + if (opts.generateIds) { + // @ts-ignore + grafooQuery.id = md5Hash(compressedQuery).toString(); + } + + grafooQuery.query = compressedQuery; + + grafooQuery.paths = (operation.selectionSet.selections as FieldNode[]).reduce( + (acc, s) => + Object.assign(acc, { + // TODO: generate hashes as well + // based on compress(print(s))? + [compress(print(s))]: { + name: s.name.value, + args: s.arguments.map((a) => a.name.value) + } + }), + {} + ); + } + + grafooQuery.selections = generateClientResolver(schema, operation); + grafooQuery.fragments = generateClientResolver(schema, fragments); + + if (frags.length) { + grafooQuery.frags = {}; + + for (let frag of frags) { + grafooQuery.frags[frag.name.value] = compress(print(frag)); + } + } + + return JSON.stringify(grafooQuery); +} diff --git a/packages/babel-plugin/src/generate-client-resolvers.ts b/packages/babel-plugin/src/generate-client-resolvers.ts new file mode 100644 index 00000000..d6bd446e --- /dev/null +++ b/packages/babel-plugin/src/generate-client-resolvers.ts @@ -0,0 +1,78 @@ +import { GrafooSelection } from "@grafoo/core"; +import { + ASTNode, + FieldNode, + FragmentDefinitionNode, + GraphQLNonNull, + GraphQLScalarType, + GraphQLSchema, + TypeInfo, + visit, + visitWithTypeInfo +} from "graphql"; + +let getNonNullType = (typeInfo: TypeInfo) => { + let currentType = typeInfo.getType(); + if (currentType instanceof GraphQLNonNull) currentType = currentType.ofType; + return currentType; +}; + +let findPath = (clientResolver: GrafooSelection, currentFields: string[]) => { + let selection = clientResolver; + for (let field of currentFields) { + selection = selection.select.find((s) => s.name === field); + } + return selection; +}; + +export default function generateClientResolver(schema: GraphQLSchema, document: ASTNode) { + let t = new TypeInfo(schema); + let clientResolver: GrafooSelection = { select: [] }; + let currentFields = []; + + let incrementClientResolver = (node: FieldNode | FragmentDefinitionNode) => { + let selection = findPath(clientResolver, currentFields); + if (!(getNonNullType(t) instanceof GraphQLScalarType)) { + let newSelection: GrafooSelection = { name: node.name.value }; + let args = (node as FieldNode).arguments?.map((a) => a.name.value) ?? []; + if (args.length) newSelection.args = args; + + selection.select = selection.select ?? []; + selection.select.push(newSelection); + + currentFields.push(node.name.value); + } else { + selection.scalars = selection.scalars ?? []; + selection.scalars.push(node.name.value); + } + }; + + visit( + document, + visitWithTypeInfo(t, { + enter: { + Field(node) { + incrementClientResolver(node); + }, + FragmentDefinition(node) { + incrementClientResolver(node); + }, + FragmentSpread(node) { + let selection = findPath(clientResolver, currentFields); + selection.fragments = selection.fragments ?? []; + selection.fragments.push(node.name.value); + } + }, + leave: { + Field() { + if (!(getNonNullType(t) instanceof GraphQLScalarType)) currentFields.pop(); + }, + FragmentDefinition() { + if (!(getNonNullType(t) instanceof GraphQLScalarType)) currentFields.pop(); + } + } + }) + ); + + return clientResolver; +} diff --git a/packages/babel-plugin/src/index.js b/packages/babel-plugin/src/index.ts similarity index 86% rename from packages/babel-plugin/src/index.js rename to packages/babel-plugin/src/index.ts index 6b183bff..8310f846 100644 --- a/packages/babel-plugin/src/index.js +++ b/packages/babel-plugin/src/index.ts @@ -1,7 +1,19 @@ -import parseLiteral from "babel-literal-to-ast"; +import type * as BabelCoreNamespace from "@babel/core"; +import type { PluginObj } from "@babel/core"; +import { parseExpression } from "@babel/parser"; + import compileDocument from "./compile-document"; -export default function transform({ types: t }) { +type Babel = typeof BabelCoreNamespace; + +export type Options = { + schema: string; + compress?: boolean; + generateIds?: boolean; + idFields?: string[]; +}; + +export default function transform({ types: t }: Babel): PluginObj<{ opts: Options }> { return { visitor: { Program(programPath, { opts }) { @@ -71,19 +83,23 @@ export default function transform({ types: t }) { if (t.isIdentifier(args[1])) { let name = args[1].name; + // @ts-ignore let { init } = path.scope.bindings[name].path.node; if (path.scope.hasBinding(name)) { if (t.isObjectExpression(init)) { + // @ts-ignore let idFieldsProp = init.properties.find((arg) => arg.key.name === "idFields"); if (idFieldsProp) { + // @ts-ignore idFieldsProp.value = idFieldsArrayAst; } else { init.properties.push(clientObjectAst); } } else { throw path.buildCodeFrameError( + // @ts-ignore callee.name + " second argument must be of type object, instead got " + args[1].type + @@ -92,15 +108,18 @@ export default function transform({ types: t }) { } } } else if (t.isObjectExpression(args[1])) { + // @ts-ignore let idFieldsProp = args[1].properties.find((arg) => arg.key.name === "idFields"); if (idFieldsProp) { + // @ts-ignore idFieldsProp.value = idFieldsArrayAst; } else { args[1].properties.push(clientObjectAst); } } else { throw path.buildCodeFrameError( + // @ts-ignore callee.name + " second argument must be of type object, instead got " + args[1].type + @@ -122,7 +141,8 @@ export default function transform({ types: t }) { try { let source = quasi.node.quasis.reduce((src, q) => src + q.value.raw, ""); - path.replaceWith(parseLiteral(compileDocument(source, opts))); + let document = compileDocument(source, opts); + path.replaceWith(parseExpression(document)); } catch (error) { if (error.code === "ENOENT") { throw new Error( diff --git a/packages/babel-plugin/src/insert-fields.js b/packages/babel-plugin/src/insert-fields.js deleted file mode 100644 index f3e662c8..00000000 --- a/packages/babel-plugin/src/insert-fields.js +++ /dev/null @@ -1,71 +0,0 @@ -import { TypeInfo, buildASTSchema, parse, visit, visitWithTypeInfo } from "graphql"; - -function getType(typeInfo) { - let currentType = typeInfo.getType(); - while (currentType.ofType) currentType = currentType.ofType; - return currentType; -} - -function insertField(selections, value) { - selections.push({ kind: "Field", name: { kind: "Name", value } }); -} - -export default function insertFields(schemaStr, documentAst, idFields) { - let typeInfo = new TypeInfo(buildASTSchema(parse(schemaStr))); - - let isOperationDefinition = false; - let isFragment = false; - - let visitor = { - OperationDefinition() { - isOperationDefinition = true; - }, - InlineFragment() { - isFragment = true; - }, - FragmentDefinition() { - isFragment = true; - }, - SelectionSet({ selections }) { - if (isOperationDefinition) { - isOperationDefinition = false; - - return; - } - - let type = getType(typeInfo); - - if (type.astNode.kind === "UnionTypeDefinition") { - return; - } - - let typeFields = Object.keys(type.getFields()); - let typeInterfaces = type.getInterfaces ? type.getInterfaces() : []; - let typeInterfacesFields = typeInterfaces.reduce( - (acc, next) => acc.concat(Object.keys(next.getFields())), - [] - ); - - for (let id of idFields) { - if (selections.some((s) => s.name && s.name.value === id)) { - continue; // Skip already declared fields - } - - let typeHasId = typeFields.some((s) => s === id); - let typeInterfacesHasId = typeInterfacesFields.some((s) => s === id); - - if ( - typeHasId || - (id === "__typename" && !isFragment) || - (typeInterfacesHasId && !isFragment) - ) { - insertField(selections, id); - } - } - - isFragment = false; - } - }; - - return visit(documentAst, visitWithTypeInfo(typeInfo, visitor)); -} diff --git a/packages/babel-plugin/src/insert-fields.ts b/packages/babel-plugin/src/insert-fields.ts new file mode 100644 index 00000000..0da6b3f0 --- /dev/null +++ b/packages/babel-plugin/src/insert-fields.ts @@ -0,0 +1,97 @@ +import { + ASTKindToNode, + DocumentNode, + FieldNode, + GraphQLSchema, + GraphQLUnionType, + TypeInfo, + Visitor, + visit, + visitWithTypeInfo +} from "graphql"; + +function getType(typeInfo) { + let currentType = typeInfo.getType(); + while (currentType.ofType) currentType = currentType.ofType; + return currentType; +} + +export default function insertFields( + schema: GraphQLSchema, + documentAst: DocumentNode, + idFields: string[] +): DocumentNode { + let typeInfo = new TypeInfo(schema); + let unionChildrenTypes = []; + let isOperationDefinition = false; + let isFragment = false; + + let visitor: Visitor = { + OperationDefinition() { + isOperationDefinition = true; + }, + InlineFragment() { + isFragment = true; + }, + FragmentDefinition() { + isFragment = true; + }, + SelectionSet(node) { + let { selections } = node; + let newSelections = []; + + if (isOperationDefinition) { + isOperationDefinition = false; + return; + } + + let t = getType(typeInfo); + + if (t.astNode.kind === "UnionTypeDefinition") { + unionChildrenTypes.push( + ...(typeInfo.getType() as GraphQLUnionType).astNode.types.map((t) => t.name.value) + ); + + return; + } + + let typeFields = Object.keys(t.getFields()); + let typeInterfaces = t.getInterfaces(); + let typeInterfacesFields = typeInterfaces.reduce( + (acc, next) => acc.concat(Object.keys(next.getFields())), + [] + ); + + for (let id of idFields) { + if ((selections as FieldNode[]).some((s) => s.name?.value === id)) { + continue; // Skip already declared fields + } + + let typeHasId = typeFields.some((s) => s === id); + let typeInterfacesHasId = typeInterfacesFields.some((s) => s === id); + + if ( + typeHasId || + (id === "__typename" && !isFragment) || + (typeInterfacesHasId && !isFragment) + ) { + newSelections.push({ kind: "Field", name: { kind: "Name", value: id } }); + } + } + + let result = { ...node, selections: [...selections, ...newSelections] }; + + if (isFragment) { + isFragment = false; + + if (unionChildrenTypes.includes(t.inspect())) return result; + + return; + } + + return result; + } + }; + + return visit(documentAst, visitWithTypeInfo(typeInfo, visitor)); +} diff --git a/packages/babel-plugin/src/sort-query.js b/packages/babel-plugin/src/sort-query.js deleted file mode 100644 index 185bf7fb..00000000 --- a/packages/babel-plugin/src/sort-query.js +++ /dev/null @@ -1,50 +0,0 @@ -import { visit } from "graphql"; - -function sort(array, fn) { - fn = fn || ((obj) => obj.name.value); - - return ( - array && - array.sort((prev, next) => { - let a = fn(prev); - let b = fn(next); - if (a < b) return -1; - if (a > b) return 1; - return 0; - }) - ); -} - -export default function sortQuery(document) { - return visit(document, { - Document(node) { - node.definitions = [ - ...sort(node.definitions.filter((def) => def.kind === "FragmentDefinition")), - ...node.definitions.filter((def) => def.kind !== "FragmentDefinition") - ]; - }, - OperationDefinition(node) { - sort(node.directives); - sort(node.variableDefinitions, (_) => _.variable.name.value); - }, - SelectionSet(node) { - sort(node.selections, (_) => (_.alias || _.name || _.typeCondition.name).value); - }, - Field(node) { - sort(node.directives); - sort(node.arguments); - }, - InlineFragment(node) { - sort(node.directives); - }, - FragmentSpread(node) { - sort(node.directives); - }, - FragmentDefinition(node) { - sort(node.directives); - }, - Directive(node) { - sort(node.arguments); - } - }); -} diff --git a/packages/babel-plugin/src/sort-query.ts b/packages/babel-plugin/src/sort-query.ts new file mode 100644 index 00000000..b152184f --- /dev/null +++ b/packages/babel-plugin/src/sort-query.ts @@ -0,0 +1,74 @@ +import { ASTNode, visit } from "graphql"; + +function sort(array: readonly ASTNode[], fn?: (f: any) => string) { + fn = fn || ((obj) => obj.name.value); + + return ( + array && + array.slice().sort((prev, next) => { + let a = fn(prev); + let b = fn(next); + if (a < b) return -1; + if (a > b) return 1; + return 0; + }) + ); +} + +export default function sortQuery(document: ASTNode): ASTNode { + return visit(document, { + Document(node) { + return { + ...node, + definitions: [ + ...sort(node.definitions.filter((def) => def.kind === "FragmentDefinition")), + ...node.definitions.filter((def) => def.kind !== "FragmentDefinition") + ] + }; + }, + OperationDefinition(node) { + return { + ...node, + directives: sort(node.directives), + variableDefinitions: sort(node.variableDefinitions, (_) => _.variable.name.value) + }; + }, + SelectionSet(node) { + return { + ...node, + selections: sort(node.selections, (_) => (_.alias || _.name || _.typeCondition.name).value) + }; + }, + Field(node) { + return { + ...node, + directives: sort(node.directives), + arguments: sort(node.arguments) + }; + }, + InlineFragment(node) { + return { + ...node, + directives: sort(node.directives) + }; + }, + FragmentSpread(node) { + return { + ...node, + directives: sort(node.directives) + }; + }, + FragmentDefinition(node) { + return { + ...node, + directives: sort(node.directives) + }; + }, + Directive(node) { + return { + ...node, + arguments: sort(node.arguments) + }; + } + }); +} diff --git a/packages/babel-plugin/tsconfig.json b/packages/babel-plugin/tsconfig.json new file mode 100644 index 00000000..aa4e1c88 --- /dev/null +++ b/packages/babel-plugin/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "moduleResolution": "node", + "strict": false, + "lib": ["esnext", "dom"], + "noUnusedLocals": true, + "noUnusedParameters": true, + "checkJs": false, + "downlevelIteration": true, + "esModuleInterop": true, + "outDir": "./dist", + "module": "commonjs" + }, + "include": ["src"] +} diff --git a/packages/bindings/__tests__/index.ts b/packages/bindings/__tests__/index.ts index 3e06c8c4..827ae910 100644 --- a/packages/bindings/__tests__/index.ts +++ b/packages/bindings/__tests__/index.ts @@ -194,11 +194,16 @@ describe("@grafoo/bindings", () => { let bindings = createBindings(client, renderFn, { query: AUTHORS }); - expect(bindings.getState()).toMatchObject({ loaded: false, loading: true }); + expect(bindings.getState()).toEqual({ loaded: false, loading: false }); await bindings.load(); - expect(bindings.getState()).toMatchObject({ ...data, loaded: true, loading: false }); + let results = renderFn.mock.calls.map((c) => c[0]); + + expect(results).toEqual([ + { loaded: false, loading: true }, + { ...data, loaded: true, loading: false } + ]); }); it("should notify a loading state", async () => { @@ -208,55 +213,54 @@ describe("@grafoo/bindings", () => { let bindings = createBindings(client, renderFn, { query: AUTHORS }); + await bindings.load(); await bindings.load(); - expect(renderFn).toHaveBeenCalledTimes(1); - expect(bindings.getState()).toMatchObject({ ...data, loaded: true, loading: false }); - - let reloadPromise = bindings.load(); - - expect(bindings.getState().loading).toBe(true); - - await reloadPromise; + let results = renderFn.mock.calls.map((c) => c[0]); - expect(bindings.getState().loading).toBe(false); + expect(results).toEqual([ + { loaded: false, loading: true }, + { loaded: true, loading: false, ...data }, + { loaded: true, loading: true, ...data }, + { loaded: true, loading: false, ...data } + ]); }); it("should provide the data if the query is already cached", async () => { - let data = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); let bindings = createBindings(client, () => {}, { query: AUTHORS }); - expect(bindings.getState()).toMatchObject({ ...data.data, loaded: true, loading: false }); + expect(bindings.getState()).toEqual({ ...data, loaded: true, loading: false }); }); it("should provide the data if a query is partialy cached", async () => { - let data = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); let bindings = createBindings(client, () => {}, { query: POSTS_AND_AUTHORS }); - expect(bindings.getState()).toMatchObject({ ...data.data, loaded: false, loading: true }); + expect(bindings.getState()).toEqual({ ...data, loaded: false, loading: false }); }); it("should trigger updater function if the cache has been updated", async () => { - let data = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); let renderFn = jest.fn(); - let bindings = createBindings(client, renderFn, { query: AUTHORS }); + createBindings(client, renderFn, { query: AUTHORS }); client.write(AUTHORS, data); - expect(renderFn).toHaveBeenCalled(); - expect(bindings.getState()).toMatchObject(data.data); + expect(renderFn).toHaveBeenCalledTimes(1); + expect(renderFn).toHaveBeenCalledWith({ ...data, loaded: true, loading: false }); }); it("should provide the state for a cached query", async () => { - let data = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); @@ -264,7 +268,7 @@ describe("@grafoo/bindings", () => { let bindings = createBindings(client, renderFn, { query: AUTHORS }); - expect(bindings.getState()).toMatchObject(data.data); + expect(bindings.getState()).toEqual({ ...data, loaded: true, loading: false }); }); it("should stop updating if unbind has been called", async () => { @@ -279,14 +283,12 @@ describe("@grafoo/bindings", () => { bindings.unbind(); client.write(AUTHORS, { - data: { - authors: data.authors.map((a, i) => (!i ? { ...a, name: "Homer" } : a)) - } + authors: data.authors.map((a, i) => (!i ? { ...a, name: "Homer" } : a)) }); expect(client.read(AUTHORS).data.authors[0].name).toBe("Homer"); - expect(renderFn).toHaveBeenCalledTimes(1); - expect(bindings.getState()).toMatchObject(data); + expect(renderFn).toHaveBeenCalledTimes(2); + expect(bindings.getState().authors).toEqual(data.authors); }); it("should provide errors on bad request", async () => { @@ -300,8 +302,8 @@ describe("@grafoo/bindings", () => { await bindings.load(); - expect(renderFn).toHaveBeenCalledTimes(1); - expect(bindings.getState()).toMatchObject({ errors }); + expect(renderFn).toHaveBeenCalledTimes(2); + expect(bindings.getState()).toEqual({ loading: false, loaded: false, errors }); }); it("should perform a simple mutation", async () => { @@ -409,7 +411,7 @@ describe("@grafoo/bindings", () => { let { data: { createAuthor: author } } = await mockQueryRequest({ query, variables: { name: "gustav" } }); - let data = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); @@ -444,7 +446,7 @@ describe("@grafoo/bindings", () => { query, variables: { name: "sven" } }); - let data = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); @@ -473,7 +475,7 @@ describe("@grafoo/bindings", () => { }); it("should not update if query objects is not modified", async () => { - let data = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); @@ -487,8 +489,8 @@ describe("@grafoo/bindings", () => { }); it("should accept multiple mutations", async () => { - let data = await mockQueryRequest(AUTHORS); - client.write(AUTHORS, data); + let authors = await mockQueryRequest(AUTHORS); + client.write(AUTHORS, authors.data); let mutations = { createAuthor: { @@ -515,32 +517,27 @@ describe("@grafoo/bindings", () => { }; let renderFn = jest.fn(); - let bindings = createBindings(client, renderFn, { query: AUTHORS, mutations }); let props = bindings.getState(); - try { - let variables = { name: "mikel" }; - let { data } = await mockQueryRequest({ - query: CREATE_AUTHOR.query, - variables - }); - expect(await mockQueryRequest({ query: CREATE_AUTHOR.query, variables })).toEqual( - await props.createAuthor(variables) - ); - - variables = { ...data.createAuthor, name: "miguel" }; - expect(await mockQueryRequest({ query: UPDATE_AUTHOR.query, variables })).toEqual( - await props.updateAuthor(variables) - ); - - variables = data.createAuthor; - expect(await mockQueryRequest({ query: DELETE_AUTHOR.query, variables })).toEqual( - await props.deleteAuthor(data.createAuthor) - ); - } catch (err) { - console.error(err); - } + let variables = { name: "mikel" }; + let { data } = await mockQueryRequest({ + query: CREATE_AUTHOR.query, + variables + }); + expect(await mockQueryRequest({ query: CREATE_AUTHOR.query, variables })).toEqual( + await props.createAuthor(variables) + ); + + variables = { ...data.createAuthor, name: "miguel" }; + expect(await mockQueryRequest({ query: UPDATE_AUTHOR.query, variables })).toEqual( + await props.updateAuthor(variables) + ); + + variables = data.createAuthor; + expect(await mockQueryRequest({ query: DELETE_AUTHOR.query, variables })).toEqual( + await props.deleteAuthor(data.createAuthor) + ); }); it("should update variables when new variables are passed", async () => { @@ -556,12 +553,12 @@ describe("@grafoo/bindings", () => { await mockQueryRequest({ query: AUTHOR.query, variables: author1Variables }); await bindings.load(); - expect(bindings.getState().author).toMatchObject(author1); + expect(bindings.getState().author).toEqual(author1); expect(client.read(AUTHOR, author1Variables).data.author).toEqual(author1); await mockQueryRequest({ query: AUTHOR.query, variables: author2Variables }); await bindings.load(author2Variables); - expect(bindings.getState().author).toMatchObject(author2); + expect(bindings.getState().author).toEqual(author2); expect(client.read(AUTHOR, author2Variables).data.author).toEqual(author2); }); }); diff --git a/packages/bindings/src/index.ts b/packages/bindings/src/index.ts index e3d7613d..6a90a281 100644 --- a/packages/bindings/src/index.ts +++ b/packages/bindings/src/index.ts @@ -12,11 +12,15 @@ export type GrafooBoundMutations> = { ) => Promise>; }; -export type GrafooBoundState = { - loaded?: boolean; - loading?: boolean; - errors?: GraphQlError[]; -}; +export type GrafooBoundState< + T extends GrafooQuery, + U extends Record +> = T["_queryType"] & + GrafooBoundMutations & { + loaded: boolean; + loading: boolean; + errors?: GraphQlError[]; + }; export type GrafooMutation = { query: U; @@ -32,64 +36,66 @@ export type GrafooConsumerProps; - skip?: boolean; }; export default function createBindings< T extends GrafooQuery, U extends Record ->(client: GrafooClient, updater: () => void, props: GrafooConsumerProps) { +>( + client: GrafooClient, + updater: (state: GrafooBoundState) => void, + props: GrafooConsumerProps +) { type CP = GrafooConsumerProps; - let { query, variables, mutations, skip } = props; + let { query, variables, mutations } = props; let data: CP["query"]["_queryType"]; + let errors: GraphQlError[]; let boundMutations = {} as GrafooBoundMutations; let records: GrafooRecords; let partial = false; let unbind = () => {}; - let lockListenUpdate = false; - let loaded = false; + let preventListenUpdate = false; if (query) { ({ data, records, partial } = client.read(query, variables)); - loaded = !!data && !partial; - unbind = client.listen((nextRecords) => { - if (lockListenUpdate) return (lockListenUpdate = false); + if (preventListenUpdate) { + preventListenUpdate = false; + return; + } records = records || {}; for (let i in nextRecords) { // record has been inserted - if (!(i in records)) return performUpdate(); + if (!(i in records)) return getUpdateFromClient(); for (let j in nextRecords[i]) { // record has been updated - if (nextRecords[i][j] !== records[i][j]) return performUpdate(); + if (nextRecords[i][j] !== records[i][j]) return getUpdateFromClient(); } } for (let i in records) { // record has been removed - if (!(i in nextRecords)) return performUpdate(); + if (!(i in nextRecords)) return getUpdateFromClient(); } }); } - let boundState: GrafooBoundState = { loaded, loading: !!query && !skip && !loaded }; - if (mutations) { for (let key in mutations) { let { update, optimisticUpdate, query: mutationQuery } = mutations[key]; boundMutations[key] = (mutationVariables) => { if (query && optimisticUpdate) { - writeToCache({ data: optimisticUpdate(data, mutationVariables) }); + client.write(query, variables, optimisticUpdate(data, mutationVariables)); } return client.execute(mutationQuery, mutationVariables).then((mutationResponse) => { if (query && update && mutationResponse.data) { - writeToCache({ data: update(data, mutationResponse.data) }); + client.write(query, variables, update(data, mutationResponse.data)); } return mutationResponse; @@ -98,19 +104,16 @@ export default function createBindings< } } - function writeToCache(dataUpdate: { data: CP["query"]["_queryType"] }) { - client.write(query, variables, dataUpdate); - } - - function performUpdate(boundStateUpdate?: GrafooBoundState) { - ({ data, records } = client.read(query, variables)); + let state = { loaded: !!data && !partial, loading: false }; - Object.assign(boundState, boundStateUpdate); - updater(); + function getUpdateFromClient() { + ({ data, partial } = client.read(query, variables)); + Object.assign(state, { loaded: !!data && !partial }); + updater(getState()); } - function getState() { - return Object.assign({}, boundState, boundMutations, data); + function getState(): GrafooBoundState { + return Object.assign({}, state, boundMutations, data); } function load(nextVariables?: CP["query"]["_variablesType"]) { @@ -118,20 +121,23 @@ export default function createBindings< variables = nextVariables; } - if (!boundState.loading) { - Object.assign(boundState, { loading: true }); - updater(); + if (!state.loading) { + Object.assign(state, { loading: true }); + updater(getState()); } - return client.execute(query, variables).then(({ data, errors }) => { + return client.execute(query, variables).then((res) => { + ({ data, errors } = res); + if (data) { - lockListenUpdate = true; - writeToCache({ data }); + preventListenUpdate = true; + client.write(query, variables, data); } - performUpdate(Object.assign({ loaded: !!data, loading: false }, errors && { errors })); + Object.assign(state, { loaded: !!data, loading: false }, errors && { errors }); + updater(getState()); }); } - return { getState, unbind, load }; + return { unbind, getState, load }; } diff --git a/packages/core/__tests__/index.ts b/packages/core/__tests__/index.ts index 9f43195e..ae6558dd 100644 --- a/packages/core/__tests__/index.ts +++ b/packages/core/__tests__/index.ts @@ -155,11 +155,11 @@ describe("@grafoo/core", () => { }); it("should write queries to the client", async () => { - let data = await client.execute(POSTS_AND_AUTHORS); + let { data } = await client.execute(POSTS_AND_AUTHORS); client.write(POSTS_AND_AUTHORS, data); - let { authors, posts } = data.data; + let { authors, posts } = data; let { records, paths } = client.flush(); expect(authors).toEqual( @@ -181,13 +181,13 @@ describe("@grafoo/core", () => { }); it("should read queries from the client", async () => { - let data = await client.execute(AUTHORS); + let { data } = await client.execute(AUTHORS); client.write(AUTHORS, data); let result = client.read(AUTHORS); - let { authors } = data.data; + let { authors } = data; expect(authors).toEqual(result.data.authors); expect(authors.every((author) => Boolean(result.records[author.id]))).toBe(true); @@ -198,7 +198,7 @@ describe("@grafoo/core", () => { it("should handle queries with variables", async () => { let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; - let data = await client.execute(POST, variables); + let { data } = await client.execute(POST, variables); client.write(POST, variables, data); @@ -211,20 +211,20 @@ describe("@grafoo/core", () => { let v2 = { postId: "77c483dd-6529-4c72-9bb6-bbfd69f65682" }; let d1 = await client.execute(POST, v1); - client.write(POST, v1, d1); + client.write(POST, v1, d1.data); expect(client.read(POST, { postId: "not found" })).toEqual({}); expect(client.read(POST, v1).data.post.id).toBe(v1.postId); let d2 = await client.execute(POST, v2); - client.write(POST, v2, d2); + client.write(POST, v2, d2.data); expect(client.read(POST, v1).data.post.id).toBe(v1.postId); expect(client.read(POST, v2).data.post.id).toBe(v2.postId); }); it("should flag if a query result is partial", async () => { - let data = await client.execute(POSTS); + let { data } = await client.execute(POSTS); client.write(POSTS, data); @@ -232,20 +232,18 @@ describe("@grafoo/core", () => { }); it("should remove unused records from state records", async () => { - let data = await client.execute(SIMPLE_AUTHORS); + let { data } = await client.execute(SIMPLE_AUTHORS); client.write(SIMPLE_AUTHORS, data); - let authorToBeRemoved = data.data.authors[0]; + let authorToBeRemoved = data.authors[0]; let ids = Object.keys(client.flush().records); expect(ids.some((id) => id === authorToBeRemoved.id)).toBe(true); client.write(SIMPLE_AUTHORS, { - data: { - authors: data.data.authors.filter((author) => author.id !== authorToBeRemoved.id) - } + authors: data.authors.filter((author) => author.id !== authorToBeRemoved.id) }); let nextIds = Object.keys(client.flush().records); @@ -256,7 +254,7 @@ describe("@grafoo/core", () => { it("should perform update to client", async () => { let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; - let data = await client.execute(POST, variables); + let { data } = await client.execute(POST, variables); client.write(POST, variables, data); @@ -266,10 +264,7 @@ describe("@grafoo/core", () => { expect(post.title).toBe("Quam odit"); - client.write(POST, variables, { - data: { post: { ...post, title: "updated title" } } - }); - + client.write(POST, variables, { post: { ...post, title: "updated title" } }); expect(client.read(POST, variables).data.post.title).toBe("updated title"); }); @@ -278,14 +273,14 @@ describe("@grafoo/core", () => { let postData = await client.execute(POST, variables); let postsData = await client.execute(POSTS, variables); - client.write(POSTS, postsData); + client.write(POSTS, postsData.data); let { posts } = client.read(POSTS).data; expect(posts.find((p) => p.id === variables.postId).title).toBe("Quam odit"); client.write(POST, variables, { - data: { post: { ...postData.data.post, title: "updated title" } } + post: { ...postData.data.post, title: "updated title" } }); let { posts: updatedPosts } = client.read(POSTS, variables).data; @@ -295,7 +290,7 @@ describe("@grafoo/core", () => { it("should merge records in the client when removing or adding properties", async () => { let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; - let data = await client.execute(POST, variables); + let { data } = await client.execute(POST, variables); client.write(POST, variables, data); @@ -305,7 +300,7 @@ describe("@grafoo/core", () => { post.foo = "bar"; - client.write(POST, variables, { data: { post } }); + client.write(POST, variables, { post }); expect(client.read(POST, variables).data.post).toEqual({ __typename: "Post", @@ -323,7 +318,7 @@ describe("@grafoo/core", () => { it("should call client listeners on write with paths records as arguments", async () => { let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; - let data = await client.execute(POST, variables); + let { data } = await client.execute(POST, variables); let listener = jest.fn(); let listener2 = jest.fn(); @@ -348,18 +343,18 @@ describe("@grafoo/core", () => { }); it("should be able read from the client with a declared initialState", async () => { - let data = await client.execute(POSTS_AND_AUTHORS); + let { data } = await client.execute(POSTS_AND_AUTHORS); client.write(POSTS_AND_AUTHORS, data); client = createClient(mockTransport, { idFields: ["id"], initialState: client.flush() }); - expect(client.read(POSTS_AND_AUTHORS).data).toEqual(data.data); + expect(client.read(POSTS_AND_AUTHORS).data).toEqual(data); }); it("should allow cache to be cleared using reset()", () => { let data: AuthorsQuery = { authors: [{ name: "deleteme" }] }; - client.write(SIMPLE_AUTHORS, { data }); + client.write(SIMPLE_AUTHORS, data); expect(client.read(SIMPLE_AUTHORS).data).toEqual(data); client.reset(); expect(client.read(SIMPLE_AUTHORS).data).toEqual(undefined); @@ -368,7 +363,7 @@ describe("@grafoo/core", () => { it("should accept `idFields` array in options", async () => { let client = createClient(mockTransport, { idFields: ["__typename", "id"] }); - let data = await client.execute(AUTHORS); + let { data } = await client.execute(AUTHORS); client.write(AUTHORS, data); diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 039235d5..f2c416b4 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -37,10 +37,20 @@ export type GrafooInitialState = { paths: GrafooPaths; }; +export type GrafooSelection = { + name?: string; + args?: string[]; + scalars?: string[]; + select?: GrafooSelection[]; + fragments?: string[]; +}; + export type GrafooQuery = { query: string; frags?: Record; paths: Record; + selections: GrafooSelection; + fragments: GrafooSelection; _queryType: T; _variablesType: U; }; @@ -52,12 +62,8 @@ export type GrafooClient = { ) => Promise>; listen: (listener: GrafooListener) => () => void; write: { - ( - query: T, - variables: T["_variablesType"], - payload: { data: T["_queryType"] } - ): void; - (query: T, payload: { data: T["_queryType"] }): void; + (query: T, variables: T["_variablesType"], data: T["_queryType"]): void; + (query: T, data: T["_queryType"]): void; }; read: ( query: T, @@ -101,31 +107,32 @@ export default function createClient( function write( query: T, variables: T["_variablesType"], - payload?: { data: T["_queryType"] } + data?: T["_queryType"] ) { - if (!payload) { - payload = variables as { data: T["_queryType"] }; + if (!data) { + data = variables as T["_queryType"]; variables = undefined; } let queryRecords: GrafooRecords = {}; - for (let i in query.paths) { - let { name, args } = query.paths[i]; + for (let path in query.paths) { + let { name, args } = query.paths[path]; let pathData = { - [name]: payload.data[name] + [name]: data[name] }; + let pathRecords = mapRecords(pathData, idFields); Object.assign(queryRecords, pathRecords); - paths[getPathId(i, args, variables)] = { + paths[getPathId(path, args, variables)] = { data: pathData, records: Object.keys(pathRecords) }; } - // assign new values to objects in objectsMap + // assign new values to records for (let i in queryRecords) { records[i] = queryRecords[i] = Object.assign({}, records[i], queryRecords[i]); } @@ -148,9 +155,9 @@ export default function createClient( let queryRecords: GrafooRecords = {}; let partial = false; - for (let i in query.paths) { - let { name, args } = query.paths[i]; - let currentPath = paths[getPathId(i, args, variables)]; + for (let path in query.paths) { + let { name, args } = query.paths[path]; + let currentPath = paths[getPathId(path, args, variables)]; if (currentPath) { data[name] = currentPath.data[name]; diff --git a/packages/core/src/util.ts b/packages/core/src/util.ts index 9b5fc8d3..8deae57e 100644 --- a/packages/core/src/util.ts +++ b/packages/core/src/util.ts @@ -1,4 +1,4 @@ -export let idFromBranch = (branch: { [key: string]: string }, idFields: string | any[]): string => { +export let idFromBranch = (branch: Record, idFields: string[]): string => { branch = branch || {}; let identifier = ""; @@ -9,7 +9,7 @@ export let idFromBranch = (branch: { [key: string]: string }, idFields: string | return identifier; }; -export let isNotNullObject = (obj: any): boolean => obj && typeof obj == "object"; +export let isNotNullObject = (obj: any): boolean => typeof obj === "object" && obj; export let getPathId = (path: string, args: string[], variables?: unknown): string => { variables = variables || {}; diff --git a/packages/react/__tests__/index.tsx b/packages/react/__tests__/index.tsx index d615aa1a..7f8f76a9 100644 --- a/packages/react/__tests__/index.tsx +++ b/packages/react/__tests__/index.tsx @@ -135,10 +135,10 @@ describe("@grafoo/react", () => { expect(() => renderHook(() => useGrafoo({}), { wrapper })).not.toThrow(); }); - it("should not fetch a query if skip prop is set to true", async () => { + it("should not fetch a query if lazy prop is set to true", async () => { let spy = jest.spyOn(window, "fetch"); - renderHook(() => useGrafoo({ query: AUTHORS, skip: true }), { wrapper }); + renderHook(() => useGrafoo({ query: AUTHORS, lazy: true }), { wrapper }); expect(spy).not.toHaveBeenCalled(); }); @@ -148,13 +148,13 @@ describe("@grafoo/react", () => { let spy = jest.spyOn(client, "listen"); - renderHook(() => useGrafoo({ query: AUTHORS, skip: true }), { wrapper }); + renderHook(() => useGrafoo({ query: AUTHORS, lazy: true }), { wrapper }); expect(spy).toHaveBeenCalled(); }); it("should execute render with default render argument", () => { - let { result } = renderHook(() => useGrafoo({ query: AUTHORS, skip: true }), { wrapper }); + let { result } = renderHook(() => useGrafoo({ query: AUTHORS, lazy: true }), { wrapper }); expect(result.current).toEqual({ loading: false, loaded: false }); }); @@ -170,20 +170,20 @@ describe("@grafoo/react", () => { expect(result.current).toEqual({ loading: false, loaded: true, ...data }); }); - it("should render if skip changed value to false", async () => { + it("should render if lazy changed value to false", async () => { let { data } = await mockQueryRequest(AUTHORS); - let { result, rerender, waitForNextUpdate } = renderHook<{ skip: boolean }, any>( - ({ skip }) => useGrafoo({ query: AUTHORS, skip }), + let { result, rerender, waitForNextUpdate } = renderHook<{ lazy: boolean }, any>( + ({ lazy }) => useGrafoo({ query: AUTHORS, lazy }), { wrapper, initialProps: { - skip: true + lazy: true } } ); expect(result.current).toEqual({ loading: false, loaded: false }); - rerender({ skip: false }); + rerender({ lazy: false }); expect(result.current).toEqual({ loading: true, loaded: false }); await waitForNextUpdate(); expect(result.current).toEqual({ loading: false, loaded: true, ...data }); @@ -218,14 +218,14 @@ describe("@grafoo/react", () => { }); it("should not try to load a query if it's already cached", async () => { - let data = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); jest.resetAllMocks(); let spy = jest.spyOn(client, "execute"); let { result } = renderHook(() => useGrafoo({ query: AUTHORS }), { wrapper }); - expect(result.current).toEqual({ loading: false, loaded: true, ...data.data }); + expect(result.current).toEqual({ loading: false, loaded: true, ...data }); expect(spy).not.toHaveBeenCalled(); }); @@ -287,27 +287,25 @@ describe("@grafoo/react", () => { }); it("should reflect updates that happen outside of the component", async () => { - let data = await mockQueryRequest(AUTHORS); + let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); let { result } = renderHook(() => useGrafoo({ query: AUTHORS }), { wrapper }); - expect(result.current).toEqual({ loading: false, loaded: true, ...data.data }); + expect(result.current).toEqual({ loading: false, loaded: true, ...data }); act(() => { client.write(AUTHORS, { - data: { - authors: data.data.authors.map((a, i) => (!i ? { ...a, name: "Lisa" } : a)) - } + authors: data.authors.map((a, i) => (!i ? { ...a, name: "Lisa" } : a)) }); }); expect(result.current.authors[0].name).toBe("Lisa"); }); - it("should not trigger a network request if a query field is cached", async () => { - let data = await mockQueryRequest(POSTS_AND_AUTHORS); + it("should not try to fetch a query data if it's already cached", async () => { + let { data } = await mockQueryRequest(POSTS_AND_AUTHORS); client.write(POSTS_AND_AUTHORS, data); @@ -315,7 +313,7 @@ describe("@grafoo/react", () => { let spy = jest.spyOn(client, "execute"); - expect(result.current).toEqual({ authors: data.data.authors, loading: false, loaded: true }); + expect(result.current).toEqual({ authors: data.authors, loading: false, loaded: true }); expect(spy).not.toHaveBeenCalled(); }); }); diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index f774f921..4b06c862 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -1,10 +1,6 @@ import * as React from "react"; import { GrafooClient, GrafooQuery } from "@grafoo/core"; -import createBindings, { - GrafooConsumerProps, - GrafooBoundState, - GrafooBoundMutations -} from "@grafoo/bindings"; +import createBindings, { GrafooConsumerProps, GrafooBoundState } from "@grafoo/bindings"; // @ts-ignore export let GrafooContext = React.createContext({}); @@ -17,8 +13,8 @@ export let GrafooProvider: React.FC = (props) => React.createElement(GrafooContext.Provider, { value: props.client }, props.children); export function useGrafoo>( - props: GrafooConsumerProps -): GrafooBoundState & T["_queryType"] & GrafooBoundMutations { + props: { lazy?: boolean } & GrafooConsumerProps +): GrafooBoundState { let client = React.useContext(GrafooContext); let update = React.useCallback(() => setState(bindings.getState()), []); let bindings = React.useMemo(() => createBindings(client, update, props), []); @@ -26,7 +22,7 @@ export function useGrafoo { - if (!props.skip && props.query && !state.loaded) { + if (!props.lazy && props.query && !state.loaded) { bindings.load(); } @@ -37,13 +33,13 @@ export function useGrafoo { if ( - (!props.skip && props.query && !state.loaded) || + (!props.lazy && props.query && !state.loaded) || !deepEqual(variables.current, props.variables) ) { variables.current = props.variables; bindings.load(props.variables); } - }, [props.skip, props.variables]); + }, [props.lazy, props.variables]); return state; } diff --git a/yarn.lock b/yarn.lock index c397a51e..e79503ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -274,11 +274,16 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.15.4", "@babel/parser@^7.15.5", "@babel/parser@^7.7.2": +"@babel/parser@^7.1.0", "@babel/parser@^7.15.4", "@babel/parser@^7.15.5", "@babel/parser@^7.7.2": version "7.15.7" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.7.tgz#0c3ed4a2eb07b165dfa85b3cc45c727334c4edae" integrity sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g== +"@babel/parser@^7.15.8": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.8.tgz#7bacdcbe71bdc3ff936d510c15dcea7cf0b99016" + integrity sha512-BRYa3wcQnjS/nqI8Ac94pYYpJfojHVvVXJ97+IDCImX4Jc8W8Xv1+47enbruk+q1etOpsQNwnfFcNGw+gtPGxA== + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.15.4": version "7.15.4" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.15.4.tgz#dbdeabb1e80f622d9f0b583efb2999605e0a567e" @@ -978,7 +983,7 @@ "@babel/parser" "^7.15.4" "@babel/types" "^7.15.4" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.1.6", "@babel/traverse@^7.13.0", "@babel/traverse@^7.15.4", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.15.4", "@babel/traverse@^7.7.2": version "7.15.4" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.4.tgz#ff8510367a144bfbff552d9e18e28f3e2889c22d" integrity sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA== @@ -993,7 +998,7 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.1.6", "@babel/types@^7.14.9", "@babel/types@^7.15.4", "@babel/types@^7.15.6", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": +"@babel/types@^7.0.0", "@babel/types@^7.14.9", "@babel/types@^7.15.4", "@babel/types@^7.15.6", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.15.6" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f" integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig== @@ -2709,15 +2714,6 @@ babel-jest@^27.2.4: graceful-fs "^4.2.4" slash "^3.0.0" -babel-literal-to-ast@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/babel-literal-to-ast/-/babel-literal-to-ast-2.1.0.tgz#c8b12f9c36a8cee13572d65aabf6cff8adb1e8b3" - integrity sha512-CxfpQ0ysQ0bZOhlaPgcWjl79Em16Rhqc6++UAFn0A3duiXmuyhhj8yyl9PYbj0I0CyjrHovdDbp2QEKT7uIMxw== - dependencies: - "@babel/parser" "^7.1.6" - "@babel/traverse" "^7.1.6" - "@babel/types" "^7.1.6" - babel-plugin-dynamic-import-node@^2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" From f0b26f35d2a5b89790afb63c2e3beb09116435eb Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Fri, 15 Oct 2021 21:20:43 -0300 Subject: [PATCH 10/49] store values logic implemented --- .../__tests__/generate-client-resolvers.ts | 58 +-- packages/babel-plugin/src/compile-document.ts | 8 +- .../src/generate-client-resolvers.ts | 12 +- packages/core/__tests__/map-records.ts | 2 +- packages/core/__tests__/store-values.ts | 383 ++++++++++++++++++ packages/core/src/index.ts | 5 +- packages/core/src/store-values.ts | 59 +++ packages/core/src/util.ts | 34 +- 8 files changed, 488 insertions(+), 73 deletions(-) create mode 100644 packages/core/__tests__/store-values.ts create mode 100644 packages/core/src/store-values.ts diff --git a/packages/babel-plugin/__tests__/generate-client-resolvers.ts b/packages/babel-plugin/__tests__/generate-client-resolvers.ts index fdfe41d2..f1e0c3b4 100644 --- a/packages/babel-plugin/__tests__/generate-client-resolvers.ts +++ b/packages/babel-plugin/__tests__/generate-client-resolvers.ts @@ -34,29 +34,17 @@ describe("generateClientResolver", () => { `; expect(generateClientResolver(schema, query)).toEqual({ - select: [ - { - name: "posts", + select: { + posts: { scalars: ["id"], fragments: ["PostStuff"], - select: [ - { - name: "author", - fragments: ["AuthorStuff"] - } - ] + select: { author: { fragments: ["AuthorStuff"] } } }, - { - name: "author", + author: { scalars: ["id", "name"], - select: [ - { - name: "posts", - scalars: ["id", "title"] - } - ] + select: { posts: { scalars: ["id", "title"] } } } - ] + } }); let fragments = graphql` @@ -75,41 +63,21 @@ describe("generateClientResolver", () => { `; expect(generateClientResolver(schema, fragments)).toEqual({ - select: [ - { - name: "AuthorStuff", + select: { + AuthorStuff: { scalars: ["id", "name"], - select: [ - { - name: "posts", + select: { + posts: { args: ["from", "to"], fragments: ["PostStuff"], scalars: ["id"] } - ] + } }, - { - name: "PostStuff", + PostStuff: { scalars: ["title"] } - ] + } }); }); }); - -// const values = { -// posts: [ -// ["record", { author: "record" }], -// ["record", { author: "record" }], -// ["record", { author: "record" }], -// ["record", { author: "record" }], -// ["record", { author: "record" }], -// ["record", { author: "record" }], -// ["record", { author: "record" }], -// ["record", { author: "record" }], -// ], -// authors: [ -// ["record", { posts: ["record", "record", "record", "record"] }], -// ["record", { posts: ["record", "record", "record", "record"] }], -// ] -// } diff --git a/packages/babel-plugin/src/compile-document.ts b/packages/babel-plugin/src/compile-document.ts index c74a7eaa..cdf6677b 100644 --- a/packages/babel-plugin/src/compile-document.ts +++ b/packages/babel-plugin/src/compile-document.ts @@ -85,7 +85,13 @@ export default function compileDocument(source: string, opts: Options) { // based on compress(print(s))? [compress(print(s))]: { name: s.name.value, - args: s.arguments.map((a) => a.name.value) + args: s.arguments.map((a) => { + if (a.value?.kind === "Variable") { + return a.value.name.value; + } + + return a.name.value; + }) } }), {} diff --git a/packages/babel-plugin/src/generate-client-resolvers.ts b/packages/babel-plugin/src/generate-client-resolvers.ts index d6bd446e..df03a93d 100644 --- a/packages/babel-plugin/src/generate-client-resolvers.ts +++ b/packages/babel-plugin/src/generate-client-resolvers.ts @@ -19,26 +19,24 @@ let getNonNullType = (typeInfo: TypeInfo) => { let findPath = (clientResolver: GrafooSelection, currentFields: string[]) => { let selection = clientResolver; - for (let field of currentFields) { - selection = selection.select.find((s) => s.name === field); - } + for (let field of currentFields) selection = selection.select[field]; return selection; }; export default function generateClientResolver(schema: GraphQLSchema, document: ASTNode) { let t = new TypeInfo(schema); - let clientResolver: GrafooSelection = { select: [] }; + let clientResolver = { select: {} } as GrafooSelection; let currentFields = []; let incrementClientResolver = (node: FieldNode | FragmentDefinitionNode) => { let selection = findPath(clientResolver, currentFields); if (!(getNonNullType(t) instanceof GraphQLScalarType)) { - let newSelection: GrafooSelection = { name: node.name.value }; + let newSelection: GrafooSelection = {}; let args = (node as FieldNode).arguments?.map((a) => a.name.value) ?? []; if (args.length) newSelection.args = args; - selection.select = selection.select ?? []; - selection.select.push(newSelection); + selection.select = selection.select ?? {}; + selection.select[node.name.value] = newSelection; currentFields.push(node.name.value); } else { diff --git a/packages/core/__tests__/map-records.ts b/packages/core/__tests__/map-records.ts index 380aaa2f..df013052 100644 --- a/packages/core/__tests__/map-records.ts +++ b/packages/core/__tests__/map-records.ts @@ -80,7 +80,7 @@ describe("map-objects", () => { let records = mapRecords(tree, idFields); - let expected = ["Post1", "Author2", "Post3", "Author4", "Post5", "Author6"]; + let expected = ["Post:1", "Author:2", "Post:3", "Author:4", "Post:5", "Author:6"]; expect(Object.keys(records).every((obj) => expected.some((exp) => exp === obj))).toBe(true); }); diff --git a/packages/core/__tests__/store-values.ts b/packages/core/__tests__/store-values.ts new file mode 100644 index 00000000..4739cf1f --- /dev/null +++ b/packages/core/__tests__/store-values.ts @@ -0,0 +1,383 @@ +import graphql from "@grafoo/core/tag"; +import storeValues from "../src/store-values"; + +let tree = { + authors: [ + { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + name: "Murphy Abshire", + posts: [ + { + body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus.", + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + title: "Quam et qui" + }, + { + body: "Ducimus harum delectus consectetur.", + id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", + title: "Quam odit" + }, + { + body: "Qui natus repellat porro.", + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + title: "Numquam ducimus rerum" + }, + { + body: "Amet eos dolores.", + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + title: "Possimus et ullam" + } + ] + }, + { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + name: "Rebekah Gleason", + posts: [ + { + body: "Facilis voluptas mollitia est temporibus voluptatem quibusdam itaque soluta.", + id: "9007748e-5e37-4f3a-8da2-b2041505a867", + title: "Et praesentium" + }, + { + body: "Architecto et totam rerum esse omnis nihil eius autem.", + id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", + title: "Sunt nemo" + }, + { + body: "Architecto fugiat odit quam est est maxime quos exercitationem.", + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", + title: "Aut aspernatur qui" + }, + { + body: "Vel voluptatibus quis esse non fuga debitis.", + id: "90b11972-305f-43f8-a6a8-ddad70d1459b", + title: "Iure rerum ratione" + } + ] + } + ], + posts: [ + { + author: { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + name: "Murphy Abshire" + }, + body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus.", + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + title: "Quam et qui" + }, + { + author: { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + name: "Murphy Abshire" + }, + body: "Ducimus harum delectus consectetur.", + id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", + title: "Quam odit" + }, + { + author: { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + name: "Murphy Abshire" + }, + body: "Qui natus repellat porro.", + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + title: "Numquam ducimus rerum" + }, + { + author: { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + name: "Murphy Abshire" + }, + body: "Amet eos dolores.", + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + title: "Possimus et ullam" + }, + { + author: { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + name: "Rebekah Gleason" + }, + body: "Facilis voluptas mollitia est temporibus voluptatem quibusdam itaque soluta.", + id: "9007748e-5e37-4f3a-8da2-b2041505a867", + title: "Et praesentium" + }, + { + author: { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + name: "Rebekah Gleason" + }, + body: "Architecto et totam rerum esse omnis nihil eius autem.", + id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", + title: "Sunt nemo" + }, + { + author: { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + name: "Rebekah Gleason" + }, + body: "Architecto fugiat odit quam est est maxime quos exercitationem.", + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", + title: "Aut aspernatur qui" + }, + { + author: { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + name: "Rebekah Gleason" + }, + body: "Vel voluptatibus quis esse non fuga debitis.", + id: "90b11972-305f-43f8-a6a8-ddad70d1459b", + title: "Iure rerum ratione" + } + ] +}; + +let POSTS_AND_AUTHORS = graphql` + query { + posts { + title + body + author { + name + } + } + + authors { + name + posts { + title + body + } + } + } +`; + +let idFields = ["id"]; + +test("test1", () => { + storeValues(tree, idFields, POSTS_AND_AUTHORS); +}); + +let data = { + posts: [ + { + author: { + name: "Murphy Abshire", + posts: [ + { + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + title: "Quam et qui" + }, + { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", title: "Quam odit" }, + { + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + title: "Numquam ducimus rerum" + }, + { + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + title: "Possimus et ullam" + } + ], + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" + }, + body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus.", + title: "Quam et qui", + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd" + }, + { + author: { + name: "Murphy Abshire", + posts: [ + { + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + title: "Quam et qui" + }, + { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", title: "Quam odit" }, + { + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + title: "Numquam ducimus rerum" + }, + { + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + title: "Possimus et ullam" + } + ], + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" + }, + body: "Ducimus harum delectus consectetur.", + title: "Quam odit", + id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" + }, + { + author: { + name: "Murphy Abshire", + posts: [ + { + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + title: "Quam et qui" + }, + { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", title: "Quam odit" }, + { + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + title: "Numquam ducimus rerum" + }, + { + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + title: "Possimus et ullam" + } + ], + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" + }, + body: "Qui natus repellat porro.", + title: "Numquam ducimus rerum", + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f" + }, + { + author: { + name: "Murphy Abshire", + posts: [ + { + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + title: "Quam et qui" + }, + { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", title: "Quam odit" }, + { + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + title: "Numquam ducimus rerum" + }, + { + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + title: "Possimus et ullam" + } + ], + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" + }, + body: "Amet eos dolores.", + title: "Possimus et ullam", + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d" + }, + { + author: { + name: "Rebekah Gleason", + posts: [ + { + id: "9007748e-5e37-4f3a-8da2-b2041505a867", + title: "Et praesentium" + }, + { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", title: "Sunt nemo" }, + { + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", + title: "Aut aspernatur qui" + }, + { + id: "90b11972-305f-43f8-a6a8-ddad70d1459b", + title: "Iure rerum ratione" + } + ], + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" + }, + body: "Facilis voluptas mollitia est temporibus voluptatem quibusdam itaque soluta.", + title: "Et praesentium", + id: "9007748e-5e37-4f3a-8da2-b2041505a867" + }, + { + author: { + name: "Rebekah Gleason", + posts: [ + { + id: "9007748e-5e37-4f3a-8da2-b2041505a867", + title: "Et praesentium" + }, + { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", title: "Sunt nemo" }, + { + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", + title: "Aut aspernatur qui" + }, + { + id: "90b11972-305f-43f8-a6a8-ddad70d1459b", + title: "Iure rerum ratione" + } + ], + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" + }, + body: "Architecto et totam rerum esse omnis nihil eius autem.", + title: "Sunt nemo", + id: "77c483dd-6529-4c72-9bb6-bbfd69f65682" + }, + { + author: { + name: "Rebekah Gleason", + posts: [ + { + id: "9007748e-5e37-4f3a-8da2-b2041505a867", + title: "Et praesentium" + }, + { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", title: "Sunt nemo" }, + { + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", + title: "Aut aspernatur qui" + }, + { + id: "90b11972-305f-43f8-a6a8-ddad70d1459b", + title: "Iure rerum ratione" + } + ], + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" + }, + body: "Architecto fugiat odit quam est est maxime quos exercitationem.", + title: "Aut aspernatur qui", + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae" + }, + { + author: { + name: "Rebekah Gleason", + posts: [ + { + id: "9007748e-5e37-4f3a-8da2-b2041505a867", + title: "Et praesentium" + }, + { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", title: "Sunt nemo" }, + { + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", + title: "Aut aspernatur qui" + }, + { + id: "90b11972-305f-43f8-a6a8-ddad70d1459b", + title: "Iure rerum ratione" + } + ], + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" + }, + body: "Vel voluptatibus quis esse non fuga debitis.", + title: "Iure rerum ratione", + id: "90b11972-305f-43f8-a6a8-ddad70d1459b" + } + ] +}; + +let POSTS_WITH_FRAGMENTS = graphql` + query { + posts { + ...P + } + } + + fragment P on Post { + title + body + author { + ...A + } + } + + fragment A on Author { + name + posts { + title + } + } +`; + +test("test2", () => { + storeValues(data, idFields, POSTS_WITH_FRAGMENTS); +}); diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index f2c416b4..64bba795 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -37,12 +37,13 @@ export type GrafooInitialState = { paths: GrafooPaths; }; +export type GrafooShape = { id: string } | { [key: string]: GrafooShape } | GrafooShape[]; + export type GrafooSelection = { - name?: string; args?: string[]; scalars?: string[]; - select?: GrafooSelection[]; fragments?: string[]; + select?: Record; }; export type GrafooQuery = { diff --git a/packages/core/src/store-values.ts b/packages/core/src/store-values.ts new file mode 100644 index 00000000..357ccf75 --- /dev/null +++ b/packages/core/src/store-values.ts @@ -0,0 +1,59 @@ +import { GrafooQuery, GrafooRecords, GrafooSelection, GrafooShape } from "."; +import { idFromBranch, isNotNullObject, getPathId } from "./util"; + +export default function storeValues( + tree: unknown, + idFields: string[], + { selections, fragments }: GrafooQuery, + variables?: Record +) { + let shape = {} as GrafooShape; + let stack = [] as [string, unknown, GrafooSelection, GrafooShape][]; + let records = {} as GrafooRecords; + + for (let [k, v] of Object.entries(tree)) { + stack.push([k, v, selections, shape]); + } + + while (stack.length) { + let [path, branch, selection, shape] = stack.shift(); + + if (isNotNullObject(branch)) { + let isBrachList = Array.isArray(branch); + let currentSelection = isNaN(path as any) ? selection.select[path] : selection; + let queryPath = isNaN(path as any) ? path : getPathId(path, currentSelection.args, variables); + + if (currentSelection.fragments) { + for (let f of currentSelection.fragments) { + let fragment = fragments.select[f]; + + currentSelection = { + scalars: currentSelection.scalars?.concat(fragment.scalars), + args: currentSelection.args?.concat(fragment.args), + select: Object.assign({}, currentSelection.select, fragment.select), + fragments: fragment.fragments + }; + } + } + + if (isBrachList) { + shape[queryPath] = []; + } else { + let id = idFromBranch(branch, idFields); + + records[id] = records[id] || {}; + for (let field of currentSelection.scalars || []) { + records[id][field] = branch[field]; + } + + shape[queryPath] = { id }; + } + + for (let [k, v] of Object.entries(branch)) { + stack.unshift([k, v, currentSelection, shape[path]]); + } + } + } + + return { shape, records }; +} diff --git a/packages/core/src/util.ts b/packages/core/src/util.ts index 8deae57e..aaa83c26 100644 --- a/packages/core/src/util.ts +++ b/packages/core/src/util.ts @@ -1,22 +1,22 @@ -export let idFromBranch = (branch: Record, idFields: string[]): string => { - branch = branch || {}; - let identifier = ""; +export let idFromBranch = (branch: T, idFields: string[]) => + branch + ? idFields + .map((i) => branch[i]) + .filter(Boolean) + .join(":") + : ""; - for (let i = 0; i < idFields.length; i++) { - branch[idFields[i]] && (identifier += branch[idFields[i]]); - } +export let isNotNullObject = (obj: unknown) => obj && typeof obj === "object"; - return identifier; -}; - -export let isNotNullObject = (obj: any): boolean => typeof obj === "object" && obj; - -export let getPathId = (path: string, args: string[], variables?: unknown): string => { +export let getPathId = (path: string, args: string[], variables?: unknown) => { variables = variables || {}; - let finalPath = path; - let i = args.length; - - while (i--) finalPath += ":" + variables[args[i]]; + args = args || []; - return finalPath; + return ( + path + + args + .map((a) => `${a}:${JSON.stringify(variables[a])}`) + .filter(Boolean) + .join(":") + ); }; From 48bdcea2382b110df2bde25ae79e2d361f78380a Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Mon, 18 Oct 2021 21:38:16 -0300 Subject: [PATCH 11/49] resolve values logic implemented --- packages/bindings/schema.graphql | 6 +- .../__tests__/data/author-with-arguments.ts | 47 ++ .../core/__tests__/data/posts-and-authors.ts | 238 +++++++++ .../__tests__/data/posts-with-fragments.ts | 348 +++++++++++++ packages/core/__tests__/resolve-values.ts | 112 +++++ packages/core/__tests__/store-values.ts | 459 ++++-------------- packages/core/package.json | 3 +- packages/core/schema.graphql | 6 +- packages/core/src/index.ts | 2 +- packages/core/src/resolve-values.ts | 37 ++ packages/core/src/store-values.ts | 63 +-- packages/core/src/util.ts | 48 +- packages/react/schema.graphql | 6 +- packages/test-utils/schema.graphql | 6 +- packages/test-utils/src/mock-server.ts | 16 +- 15 files changed, 966 insertions(+), 431 deletions(-) create mode 100644 packages/core/__tests__/data/author-with-arguments.ts create mode 100644 packages/core/__tests__/data/posts-and-authors.ts create mode 100644 packages/core/__tests__/data/posts-with-fragments.ts create mode 100644 packages/core/__tests__/resolve-values.ts create mode 100644 packages/core/src/resolve-values.ts diff --git a/packages/bindings/schema.graphql b/packages/bindings/schema.graphql index 8011416b..8c99e2cc 100644 --- a/packages/bindings/schema.graphql +++ b/packages/bindings/schema.graphql @@ -1,8 +1,8 @@ type Query { author(id: ID!): Author! - authors: [Author!]! + authors(from: Int, to: Int): [Author!]! post(id: ID!): Post! - posts: [Post!]! + posts(from: Int, to: Int): [Post!]! } type Mutation { @@ -17,7 +17,7 @@ type Mutation { type Author { id: ID! name: String! - posts: [Post!] + posts(from: Int, to: Int): [Post!] } type Post { diff --git a/packages/core/__tests__/data/author-with-arguments.ts b/packages/core/__tests__/data/author-with-arguments.ts new file mode 100644 index 00000000..57cfe61f --- /dev/null +++ b/packages/core/__tests__/data/author-with-arguments.ts @@ -0,0 +1,47 @@ +export let data = { + author: { + __typename: "Author", + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + name: "Murphy Abshire", + posts: [ + { + __typename: "Post", + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + title: "Quam et qui" + }, + { + __typename: "Post", + id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", + title: "Quam odit" + } + ] + } +}; + +export let path = { + "author:id:a1d3a2bc-e503-4640-9178-23cbd36b542c": { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + "posts:from:0:to:2": [ + { id: "9c6abd58-0cc5-4341-87a2-ede364685ebd" }, + { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" } + ] + } +}; + +export let records = { + "a1d3a2bc-e503-4640-9178-23cbd36b542c": { + __typename: "Author", + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + name: "Murphy Abshire" + }, + "2c969ce7-02ae-42b1-a94d-7d0a38804c85": { + __typename: "Post", + id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", + title: "Quam odit" + }, + "9c6abd58-0cc5-4341-87a2-ede364685ebd": { + __typename: "Post", + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + title: "Quam et qui" + } +}; diff --git a/packages/core/__tests__/data/posts-and-authors.ts b/packages/core/__tests__/data/posts-and-authors.ts new file mode 100644 index 00000000..03f84fd9 --- /dev/null +++ b/packages/core/__tests__/data/posts-and-authors.ts @@ -0,0 +1,238 @@ +export let data = { + authors: [ + { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + name: "Murphy Abshire", + posts: [ + { + body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus.", + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + title: "Quam et qui" + }, + { + body: "Ducimus harum delectus consectetur.", + id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", + title: "Quam odit" + }, + { + body: "Qui natus repellat porro.", + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + title: "Numquam ducimus rerum" + }, + { + body: "Amet eos dolores.", + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + title: "Possimus et ullam" + } + ] + }, + { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + name: "Rebekah Gleason", + posts: [ + { + body: "Facilis voluptas mollitia est temporibus voluptatem quibusdam itaque soluta.", + id: "9007748e-5e37-4f3a-8da2-b2041505a867", + title: "Et praesentium" + }, + { + body: "Architecto et totam rerum esse omnis nihil eius autem.", + id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", + title: "Sunt nemo" + }, + { + body: "Architecto fugiat odit quam est est maxime quos exercitationem.", + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", + title: "Aut aspernatur qui" + }, + { + body: "Vel voluptatibus quis esse non fuga debitis.", + id: "90b11972-305f-43f8-a6a8-ddad70d1459b", + title: "Iure rerum ratione" + } + ] + } + ], + posts: [ + { + author: { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + name: "Murphy Abshire" + }, + body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus.", + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + title: "Quam et qui" + }, + { + author: { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + name: "Murphy Abshire" + }, + body: "Ducimus harum delectus consectetur.", + id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", + title: "Quam odit" + }, + { + author: { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + name: "Murphy Abshire" + }, + body: "Qui natus repellat porro.", + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + title: "Numquam ducimus rerum" + }, + { + author: { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + name: "Murphy Abshire" + }, + body: "Amet eos dolores.", + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + title: "Possimus et ullam" + }, + { + author: { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + name: "Rebekah Gleason" + }, + body: "Facilis voluptas mollitia est temporibus voluptatem quibusdam itaque soluta.", + id: "9007748e-5e37-4f3a-8da2-b2041505a867", + title: "Et praesentium" + }, + { + author: { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + name: "Rebekah Gleason" + }, + body: "Architecto et totam rerum esse omnis nihil eius autem.", + id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", + title: "Sunt nemo" + }, + { + author: { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + name: "Rebekah Gleason" + }, + body: "Architecto fugiat odit quam est est maxime quos exercitationem.", + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", + title: "Aut aspernatur qui" + }, + { + author: { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + name: "Rebekah Gleason" + }, + body: "Vel voluptatibus quis esse non fuga debitis.", + id: "90b11972-305f-43f8-a6a8-ddad70d1459b", + title: "Iure rerum ratione" + } + ] +}; + +export let path = { + authors: [ + { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + posts: [ + { id: "9c6abd58-0cc5-4341-87a2-ede364685ebd" }, + { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }, + { id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f" }, + { id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d" } + ] + }, + { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + posts: [ + { id: "9007748e-5e37-4f3a-8da2-b2041505a867" }, + { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682" }, + { id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae" }, + { id: "90b11972-305f-43f8-a6a8-ddad70d1459b" } + ] + } + ], + posts: [ + { + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + author: { id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" } + }, + { + id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", + author: { id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" } + }, + { + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + author: { id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" } + }, + { + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + author: { id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" } + }, + { + id: "9007748e-5e37-4f3a-8da2-b2041505a867", + author: { id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" } + }, + { + id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", + author: { id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" } + }, + { + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", + author: { id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" } + }, + { + id: "90b11972-305f-43f8-a6a8-ddad70d1459b", + author: { id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" } + } + ] +}; + +export let records = { + "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6": { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + name: "Rebekah Gleason" + }, + "90b11972-305f-43f8-a6a8-ddad70d1459b": { + body: "Vel voluptatibus quis esse non fuga debitis.", + id: "90b11972-305f-43f8-a6a8-ddad70d1459b", + title: "Iure rerum ratione" + }, + "802e2565-3b33-4b89-9fbc-e0c8d1dbddae": { + body: "Architecto fugiat odit quam est est maxime quos exercitationem.", + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", + title: "Aut aspernatur qui" + }, + "77c483dd-6529-4c72-9bb6-bbfd69f65682": { + body: "Architecto et totam rerum esse omnis nihil eius autem.", + id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", + title: "Sunt nemo" + }, + "9007748e-5e37-4f3a-8da2-b2041505a867": { + body: "Facilis voluptas mollitia est temporibus voluptatem quibusdam itaque soluta.", + id: "9007748e-5e37-4f3a-8da2-b2041505a867", + title: "Et praesentium" + }, + "a1d3a2bc-e503-4640-9178-23cbd36b542c": { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + name: "Murphy Abshire" + }, + "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d": { + body: "Amet eos dolores.", + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + title: "Possimus et ullam" + }, + "a2bce5f8-2eb7-423d-994f-d8002bd0509f": { + body: "Qui natus repellat porro.", + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + title: "Numquam ducimus rerum" + }, + "2c969ce7-02ae-42b1-a94d-7d0a38804c85": { + body: "Ducimus harum delectus consectetur.", + id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", + title: "Quam odit" + }, + "9c6abd58-0cc5-4341-87a2-ede364685ebd": { + body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus.", + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + title: "Quam et qui" + } +}; diff --git a/packages/core/__tests__/data/posts-with-fragments.ts b/packages/core/__tests__/data/posts-with-fragments.ts new file mode 100644 index 00000000..f95a5a02 --- /dev/null +++ b/packages/core/__tests__/data/posts-with-fragments.ts @@ -0,0 +1,348 @@ +export let data = { + posts: [ + { + author: { + name: "Murphy Abshire", + posts: [ + { + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + title: "Quam et qui" + }, + { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", title: "Quam odit" }, + { + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + title: "Numquam ducimus rerum" + }, + { + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + title: "Possimus et ullam" + } + ], + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" + }, + body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus.", + title: "Quam et qui", + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd" + }, + { + author: { + name: "Murphy Abshire", + posts: [ + { + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + title: "Quam et qui" + }, + { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", title: "Quam odit" }, + { + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + title: "Numquam ducimus rerum" + }, + { + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + title: "Possimus et ullam" + } + ], + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" + }, + body: "Ducimus harum delectus consectetur.", + title: "Quam odit", + id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" + }, + { + author: { + name: "Murphy Abshire", + posts: [ + { + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + title: "Quam et qui" + }, + { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", title: "Quam odit" }, + { + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + title: "Numquam ducimus rerum" + }, + { + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + title: "Possimus et ullam" + } + ], + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" + }, + body: "Qui natus repellat porro.", + title: "Numquam ducimus rerum", + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f" + }, + { + author: { + name: "Murphy Abshire", + posts: [ + { + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + title: "Quam et qui" + }, + { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", title: "Quam odit" }, + { + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + title: "Numquam ducimus rerum" + }, + { + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + title: "Possimus et ullam" + } + ], + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" + }, + body: "Amet eos dolores.", + title: "Possimus et ullam", + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d" + }, + { + author: { + name: "Rebekah Gleason", + posts: [ + { + id: "9007748e-5e37-4f3a-8da2-b2041505a867", + title: "Et praesentium" + }, + { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", title: "Sunt nemo" }, + { + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", + title: "Aut aspernatur qui" + }, + { + id: "90b11972-305f-43f8-a6a8-ddad70d1459b", + title: "Iure rerum ratione" + } + ], + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" + }, + body: "Facilis voluptas mollitia est temporibus voluptatem quibusdam itaque soluta.", + title: "Et praesentium", + id: "9007748e-5e37-4f3a-8da2-b2041505a867" + }, + { + author: { + name: "Rebekah Gleason", + posts: [ + { + id: "9007748e-5e37-4f3a-8da2-b2041505a867", + title: "Et praesentium" + }, + { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", title: "Sunt nemo" }, + { + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", + title: "Aut aspernatur qui" + }, + { + id: "90b11972-305f-43f8-a6a8-ddad70d1459b", + title: "Iure rerum ratione" + } + ], + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" + }, + body: "Architecto et totam rerum esse omnis nihil eius autem.", + title: "Sunt nemo", + id: "77c483dd-6529-4c72-9bb6-bbfd69f65682" + }, + { + author: { + name: "Rebekah Gleason", + posts: [ + { + id: "9007748e-5e37-4f3a-8da2-b2041505a867", + title: "Et praesentium" + }, + { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", title: "Sunt nemo" }, + { + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", + title: "Aut aspernatur qui" + }, + { + id: "90b11972-305f-43f8-a6a8-ddad70d1459b", + title: "Iure rerum ratione" + } + ], + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" + }, + body: "Architecto fugiat odit quam est est maxime quos exercitationem.", + title: "Aut aspernatur qui", + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae" + }, + { + author: { + name: "Rebekah Gleason", + posts: [ + { + id: "9007748e-5e37-4f3a-8da2-b2041505a867", + title: "Et praesentium" + }, + { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", title: "Sunt nemo" }, + { + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", + title: "Aut aspernatur qui" + }, + { + id: "90b11972-305f-43f8-a6a8-ddad70d1459b", + title: "Iure rerum ratione" + } + ], + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" + }, + body: "Vel voluptatibus quis esse non fuga debitis.", + title: "Iure rerum ratione", + id: "90b11972-305f-43f8-a6a8-ddad70d1459b" + } + ] +}; + +export let path = { + posts: [ + { + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + author: { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + posts: [ + { id: "9c6abd58-0cc5-4341-87a2-ede364685ebd" }, + { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }, + { id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f" }, + { id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d" } + ] + } + }, + { + id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", + author: { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + posts: [ + { id: "9c6abd58-0cc5-4341-87a2-ede364685ebd" }, + { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }, + { id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f" }, + { id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d" } + ] + } + }, + { + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + author: { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + posts: [ + { id: "9c6abd58-0cc5-4341-87a2-ede364685ebd" }, + { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }, + { id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f" }, + { id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d" } + ] + } + }, + { + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + author: { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + posts: [ + { id: "9c6abd58-0cc5-4341-87a2-ede364685ebd" }, + { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }, + { id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f" }, + { id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d" } + ] + } + }, + { + id: "9007748e-5e37-4f3a-8da2-b2041505a867", + author: { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + posts: [ + { id: "9007748e-5e37-4f3a-8da2-b2041505a867" }, + { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682" }, + { id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae" }, + { id: "90b11972-305f-43f8-a6a8-ddad70d1459b" } + ] + } + }, + { + id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", + author: { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + posts: [ + { id: "9007748e-5e37-4f3a-8da2-b2041505a867" }, + { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682" }, + { id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae" }, + { id: "90b11972-305f-43f8-a6a8-ddad70d1459b" } + ] + } + }, + { + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", + author: { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + posts: [ + { id: "9007748e-5e37-4f3a-8da2-b2041505a867" }, + { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682" }, + { id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae" }, + { id: "90b11972-305f-43f8-a6a8-ddad70d1459b" } + ] + } + }, + { + id: "90b11972-305f-43f8-a6a8-ddad70d1459b", + author: { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + posts: [ + { id: "9007748e-5e37-4f3a-8da2-b2041505a867" }, + { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682" }, + { id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae" }, + { id: "90b11972-305f-43f8-a6a8-ddad70d1459b" } + ] + } + } + ] +}; + +export let records = { + "90b11972-305f-43f8-a6a8-ddad70d1459b": { + id: "90b11972-305f-43f8-a6a8-ddad70d1459b", + body: "Vel voluptatibus quis esse non fuga debitis.", + title: "Iure rerum ratione" + }, + "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6": { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + name: "Rebekah Gleason" + }, + "802e2565-3b33-4b89-9fbc-e0c8d1dbddae": { + id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", + title: "Aut aspernatur qui", + body: "Architecto fugiat odit quam est est maxime quos exercitationem." + }, + "77c483dd-6529-4c72-9bb6-bbfd69f65682": { + id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", + title: "Sunt nemo", + body: "Architecto et totam rerum esse omnis nihil eius autem." + }, + "9007748e-5e37-4f3a-8da2-b2041505a867": { + id: "9007748e-5e37-4f3a-8da2-b2041505a867", + title: "Et praesentium", + body: "Facilis voluptas mollitia est temporibus voluptatem quibusdam itaque soluta." + }, + "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d": { + id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + body: "Amet eos dolores.", + title: "Possimus et ullam" + }, + "a1d3a2bc-e503-4640-9178-23cbd36b542c": { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + name: "Murphy Abshire" + }, + "a2bce5f8-2eb7-423d-994f-d8002bd0509f": { + id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + title: "Numquam ducimus rerum", + body: "Qui natus repellat porro." + }, + "2c969ce7-02ae-42b1-a94d-7d0a38804c85": { + id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", + title: "Quam odit", + body: "Ducimus harum delectus consectetur." + }, + "9c6abd58-0cc5-4341-87a2-ede364685ebd": { + id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + title: "Quam et qui", + body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus." + } +}; diff --git a/packages/core/__tests__/resolve-values.ts b/packages/core/__tests__/resolve-values.ts new file mode 100644 index 00000000..5cc6452e --- /dev/null +++ b/packages/core/__tests__/resolve-values.ts @@ -0,0 +1,112 @@ +import graphql from "@grafoo/core/tag"; +import resolveValues from "../src/resolve-values"; +import * as postsAndAuthors from "./data/posts-and-authors"; +import * as postsWithFragments from "./data/posts-with-fragments"; +import * as authorWithArguments from "./data/author-with-arguments"; + +describe("resolveValues", () => { + it("should resolve the data given a simple query, a path and the records", () => { + let query = graphql` + query { + posts { + title + body + author { + name + } + } + + authors { + name + posts { + title + body + } + } + } + `; + + expect(resolveValues(query, postsAndAuthors.path, postsAndAuthors.records)).toEqual( + postsAndAuthors.data + ); + }); + + it("should resolve the data given a query with fragments, a path and the records", () => { + let query = graphql` + query { + posts { + ...P + } + } + + fragment P on Post { + title + body + author { + ...A + } + } + + fragment A on Author { + name + posts { + title + } + } + `; + + expect(resolveValues(query, postsWithFragments.path, postsWithFragments.records)).toEqual( + postsWithFragments.data + ); + }); + + it("should resolve the data given a query with arguments, a path and the records", () => { + let query = graphql` + query ($id: ID!, $from: Int, $to: Int) { + author(id: $id) { + name + posts(from: $from, to: $to) { + title + } + } + } + `; + + let variables = { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + from: 0, + to: 2 + }; + + expect( + resolveValues(query, authorWithArguments.path, authorWithArguments.records, variables) + ).toEqual(authorWithArguments.data); + }); + + it("should resolve the data given a query with fragments and arguments, a path and the records", () => { + let query = graphql` + query ($id: ID!, $from: Int, $to: Int) { + author(id: $id) { + name + ...AuthorStuff + } + } + + fragment AuthorStuff on Author { + posts(from: $from, to: $to) { + title + } + } + `; + + let variables = { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + from: 0, + to: 2 + }; + + expect( + resolveValues(query, authorWithArguments.path, authorWithArguments.records, variables) + ).toEqual(authorWithArguments.data); + }); +}); diff --git a/packages/core/__tests__/store-values.ts b/packages/core/__tests__/store-values.ts index 4739cf1f..eb409331 100644 --- a/packages/core/__tests__/store-values.ts +++ b/packages/core/__tests__/store-values.ts @@ -1,383 +1,118 @@ import graphql from "@grafoo/core/tag"; import storeValues from "../src/store-values"; +import * as postsAndAuthors from "./data/posts-and-authors"; +import * as postsWithFragments from "./data/posts-with-fragments"; +import * as authorWithArguments from "./data/author-with-arguments"; -let tree = { - authors: [ - { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - name: "Murphy Abshire", - posts: [ - { - body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus.", - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", - title: "Quam et qui" - }, - { - body: "Ducimus harum delectus consectetur.", - id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", - title: "Quam odit" - }, - { - body: "Qui natus repellat porro.", - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", - title: "Numquam ducimus rerum" - }, - { - body: "Amet eos dolores.", - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", - title: "Possimus et ullam" +let idFields = ["id"]; + +describe("storeValues", () => { + test("should yield correct path and records to a normal query", () => { + let POSTS_AND_AUTHORS = graphql` + query { + posts { + title + body + author { + name + } } - ] - }, - { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - name: "Rebekah Gleason", - posts: [ - { - body: "Facilis voluptas mollitia est temporibus voluptatem quibusdam itaque soluta.", - id: "9007748e-5e37-4f3a-8da2-b2041505a867", - title: "Et praesentium" - }, - { - body: "Architecto et totam rerum esse omnis nihil eius autem.", - id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", - title: "Sunt nemo" - }, - { - body: "Architecto fugiat odit quam est est maxime quos exercitationem.", - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", - title: "Aut aspernatur qui" - }, - { - body: "Vel voluptatibus quis esse non fuga debitis.", - id: "90b11972-305f-43f8-a6a8-ddad70d1459b", - title: "Iure rerum ratione" + + authors { + name + posts { + title + body + } } - ] - } - ], - posts: [ - { - author: { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - name: "Murphy Abshire" - }, - body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus.", - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", - title: "Quam et qui" - }, - { - author: { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - name: "Murphy Abshire" - }, - body: "Ducimus harum delectus consectetur.", - id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", - title: "Quam odit" - }, - { - author: { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - name: "Murphy Abshire" - }, - body: "Qui natus repellat porro.", - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", - title: "Numquam ducimus rerum" - }, - { - author: { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - name: "Murphy Abshire" - }, - body: "Amet eos dolores.", - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", - title: "Possimus et ullam" - }, - { - author: { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - name: "Rebekah Gleason" - }, - body: "Facilis voluptas mollitia est temporibus voluptatem quibusdam itaque soluta.", - id: "9007748e-5e37-4f3a-8da2-b2041505a867", - title: "Et praesentium" - }, - { - author: { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - name: "Rebekah Gleason" - }, - body: "Architecto et totam rerum esse omnis nihil eius autem.", - id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", - title: "Sunt nemo" - }, - { - author: { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - name: "Rebekah Gleason" - }, - body: "Architecto fugiat odit quam est est maxime quos exercitationem.", - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", - title: "Aut aspernatur qui" - }, - { - author: { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - name: "Rebekah Gleason" - }, - body: "Vel voluptatibus quis esse non fuga debitis.", - id: "90b11972-305f-43f8-a6a8-ddad70d1459b", - title: "Iure rerum ratione" - } - ] -}; + } + `; -let POSTS_AND_AUTHORS = graphql` - query { - posts { - title - body - author { - name + let { path, records } = storeValues(postsAndAuthors.data, POSTS_AND_AUTHORS, idFields); + + expect(path).toEqual(postsAndAuthors.path); + expect(records).toEqual(postsAndAuthors.records); + }); + + test("should yield correct path and records to queries with fragments", () => { + let query = graphql` + query { + posts { + ...P + } } - } - authors { - name - posts { + fragment P on Post { title body + author { + ...A + } } - } - } -`; -let idFields = ["id"]; + fragment A on Author { + name + posts { + title + } + } + `; -test("test1", () => { - storeValues(tree, idFields, POSTS_AND_AUTHORS); -}); + let { path, records } = storeValues(postsWithFragments.data, query, idFields); -let data = { - posts: [ - { - author: { - name: "Murphy Abshire", - posts: [ - { - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", - title: "Quam et qui" - }, - { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", title: "Quam odit" }, - { - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", - title: "Numquam ducimus rerum" - }, - { - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", - title: "Possimus et ullam" - } - ], - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" - }, - body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus.", - title: "Quam et qui", - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd" - }, - { - author: { - name: "Murphy Abshire", - posts: [ - { - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", - title: "Quam et qui" - }, - { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", title: "Quam odit" }, - { - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", - title: "Numquam ducimus rerum" - }, - { - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", - title: "Possimus et ullam" - } - ], - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" - }, - body: "Ducimus harum delectus consectetur.", - title: "Quam odit", - id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" - }, - { - author: { - name: "Murphy Abshire", - posts: [ - { - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", - title: "Quam et qui" - }, - { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", title: "Quam odit" }, - { - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", - title: "Numquam ducimus rerum" - }, - { - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", - title: "Possimus et ullam" - } - ], - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" - }, - body: "Qui natus repellat porro.", - title: "Numquam ducimus rerum", - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f" - }, - { - author: { - name: "Murphy Abshire", - posts: [ - { - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", - title: "Quam et qui" - }, - { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", title: "Quam odit" }, - { - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", - title: "Numquam ducimus rerum" - }, - { - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", - title: "Possimus et ullam" - } - ], - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" - }, - body: "Amet eos dolores.", - title: "Possimus et ullam", - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d" - }, - { - author: { - name: "Rebekah Gleason", - posts: [ - { - id: "9007748e-5e37-4f3a-8da2-b2041505a867", - title: "Et praesentium" - }, - { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", title: "Sunt nemo" }, - { - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", - title: "Aut aspernatur qui" - }, - { - id: "90b11972-305f-43f8-a6a8-ddad70d1459b", - title: "Iure rerum ratione" - } - ], - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" - }, - body: "Facilis voluptas mollitia est temporibus voluptatem quibusdam itaque soluta.", - title: "Et praesentium", - id: "9007748e-5e37-4f3a-8da2-b2041505a867" - }, - { - author: { - name: "Rebekah Gleason", - posts: [ - { - id: "9007748e-5e37-4f3a-8da2-b2041505a867", - title: "Et praesentium" - }, - { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", title: "Sunt nemo" }, - { - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", - title: "Aut aspernatur qui" - }, - { - id: "90b11972-305f-43f8-a6a8-ddad70d1459b", - title: "Iure rerum ratione" - } - ], - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" - }, - body: "Architecto et totam rerum esse omnis nihil eius autem.", - title: "Sunt nemo", - id: "77c483dd-6529-4c72-9bb6-bbfd69f65682" - }, - { - author: { - name: "Rebekah Gleason", - posts: [ - { - id: "9007748e-5e37-4f3a-8da2-b2041505a867", - title: "Et praesentium" - }, - { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", title: "Sunt nemo" }, - { - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", - title: "Aut aspernatur qui" - }, - { - id: "90b11972-305f-43f8-a6a8-ddad70d1459b", - title: "Iure rerum ratione" + expect(path).toEqual(postsWithFragments.path); + expect(records).toEqual(postsWithFragments.records); + }); + + test("should yield correct path and records to queries with arguments", () => { + let query = graphql` + query ($id: ID!, $from: Int, $to: Int) { + author(id: $id) { + name + posts(from: $from, to: $to) { + title } - ], - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" - }, - body: "Architecto fugiat odit quam est est maxime quos exercitationem.", - title: "Aut aspernatur qui", - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae" - }, - { - author: { - name: "Rebekah Gleason", - posts: [ - { - id: "9007748e-5e37-4f3a-8da2-b2041505a867", - title: "Et praesentium" - }, - { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", title: "Sunt nemo" }, - { - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", - title: "Aut aspernatur qui" - }, - { - id: "90b11972-305f-43f8-a6a8-ddad70d1459b", - title: "Iure rerum ratione" + } + } + `; + + let variables = { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + from: 0, + to: 2 + }; + + let { path, records } = storeValues(authorWithArguments.data, query, idFields, variables); + + expect(path).toEqual(authorWithArguments.path); + expect(records).toEqual(authorWithArguments.records); + }); + + test("should yield correct path and records to queries with arguments and fragments", () => { + let query = graphql` + query ($id: ID!, $from: Int, $to: Int) { + author(id: $id) { + name + posts(from: $from, to: $to) { + ...PostStuff } - ], - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" - }, - body: "Vel voluptatibus quis esse non fuga debitis.", - title: "Iure rerum ratione", - id: "90b11972-305f-43f8-a6a8-ddad70d1459b" - } - ] -}; + } + } -let POSTS_WITH_FRAGMENTS = graphql` - query { - posts { - ...P - } - } + fragment PostStuff on Post { + title + } + `; - fragment P on Post { - title - body - author { - ...A - } - } + let variables = { + id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + from: 0, + to: 2 + }; - fragment A on Author { - name - posts { - title - } - } -`; + let { path, records } = storeValues(authorWithArguments.data, query, idFields, variables); -test("test2", () => { - storeValues(data, idFields, POSTS_WITH_FRAGMENTS); + expect(path).toEqual(authorWithArguments.path); + expect(records).toEqual(authorWithArguments.records); + }); }); diff --git a/packages/core/package.json b/packages/core/package.json index 685aeae4..0c06c0fd 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -29,7 +29,8 @@ "resolver": "/../../scripts/resolver.js", "transformIgnorePatterns": [ "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob)/)" - ] + ], + "modulePathIgnorePatterns": ["/__tests__/data"] }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" } diff --git a/packages/core/schema.graphql b/packages/core/schema.graphql index 8011416b..8c99e2cc 100644 --- a/packages/core/schema.graphql +++ b/packages/core/schema.graphql @@ -1,8 +1,8 @@ type Query { author(id: ID!): Author! - authors: [Author!]! + authors(from: Int, to: Int): [Author!]! post(id: ID!): Post! - posts: [Post!]! + posts(from: Int, to: Int): [Post!]! } type Mutation { @@ -17,7 +17,7 @@ type Mutation { type Author { id: ID! name: String! - posts: [Post!] + posts(from: Int, to: Int): [Post!] } type Post { diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 64bba795..63c19d39 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -37,7 +37,7 @@ export type GrafooInitialState = { paths: GrafooPaths; }; -export type GrafooShape = { id: string } | { [key: string]: GrafooShape } | GrafooShape[]; +export type GrafooShape = ({ id?: string } | { [key: string]: GrafooShape }) | GrafooShape[]; export type GrafooSelection = { args?: string[]; diff --git a/packages/core/src/resolve-values.ts b/packages/core/src/resolve-values.ts new file mode 100644 index 00000000..dab0fee0 --- /dev/null +++ b/packages/core/src/resolve-values.ts @@ -0,0 +1,37 @@ +import { GrafooQuery, GrafooRecords, GrafooSelection, GrafooShape } from "."; +import { getPathId, resolveSelection } from "./util"; + +export default function resolveValues( + { selections, fragments }: GrafooQuery, + shape: GrafooShape, + records: GrafooRecords, + variables?: Record +) { + let data = {} as T; + let stack: [string, GrafooSelection, GrafooShape, T][] = [["", selections, shape, data]]; + + while (stack.length) { + let [name, select, path, data] = stack.shift(); + + if (Array.isArray(path)) { + for (let [k, v] of Object.entries(path)) { + data[k] = Array.isArray(v) ? [] : {}; + stack.unshift([name, select, v, data[k]]); + } + } else { + let currentSelection = resolveSelection(select, fragments); + + for (let s of currentSelection.scalars) { + data[s] = records[path.id as string][s]; + } + + for (let [k, v] of Object.entries(currentSelection.select)) { + let pathId = getPathId(k, v.args, variables); + data[k] = Array.isArray(path[pathId]) ? [] : {}; + stack.unshift([k, v, path[pathId], data[k]]); + } + } + } + + return data; +} diff --git a/packages/core/src/store-values.ts b/packages/core/src/store-values.ts index 357ccf75..60d2bd23 100644 --- a/packages/core/src/store-values.ts +++ b/packages/core/src/store-values.ts @@ -1,59 +1,44 @@ import { GrafooQuery, GrafooRecords, GrafooSelection, GrafooShape } from "."; -import { idFromBranch, isNotNullObject, getPathId } from "./util"; +import { idFromBranch, getPathId, resolveSelection } from "./util"; -export default function storeValues( - tree: unknown, - idFields: string[], +export default function storeValues( + tree: T, { selections, fragments }: GrafooQuery, + idFields: string[], variables?: Record ) { - let shape = {} as GrafooShape; - let stack = [] as [string, unknown, GrafooSelection, GrafooShape][]; - let records = {} as GrafooRecords; - - for (let [k, v] of Object.entries(tree)) { - stack.push([k, v, selections, shape]); - } + let path: GrafooShape = {}; + let records: GrafooRecords = {}; + let stack: [string, T, GrafooSelection, GrafooShape][] = [["", tree, selections, path]]; while (stack.length) { - let [path, branch, selection, shape] = stack.shift(); - - if (isNotNullObject(branch)) { - let isBrachList = Array.isArray(branch); - let currentSelection = isNaN(path as any) ? selection.select[path] : selection; - let queryPath = isNaN(path as any) ? path : getPathId(path, currentSelection.args, variables); - - if (currentSelection.fragments) { - for (let f of currentSelection.fragments) { - let fragment = fragments.select[f]; - - currentSelection = { - scalars: currentSelection.scalars?.concat(fragment.scalars), - args: currentSelection.args?.concat(fragment.args), - select: Object.assign({}, currentSelection.select, fragment.select), - fragments: fragment.fragments - }; - } - } + let [name, branch, select, path] = stack.shift(); + let isListItem = isNaN(name as any); + let currentSelection = resolveSelection(isListItem ? select.select[name] : select, fragments); + let pathId = isListItem ? getPathId(name, currentSelection.args, variables) : name; - if (isBrachList) { - shape[queryPath] = []; - } else { - let id = idFromBranch(branch, idFields); + if (Array.isArray(branch)) { + path[pathId] = []; + } else { + let id = idFromBranch(branch, idFields); + if (id) { records[id] = records[id] || {}; - for (let field of currentSelection.scalars || []) { + + for (let field of currentSelection.scalars) { records[id][field] = branch[field]; } - shape[queryPath] = { id }; + path[pathId] = { id }; } + } - for (let [k, v] of Object.entries(branch)) { - stack.unshift([k, v, currentSelection, shape[path]]); + for (let [k, v] of Object.entries(branch)) { + if (typeof v === "object") { + stack.unshift([k, v, currentSelection, path[pathId] || path]); } } } - return { shape, records }; + return { path, records }; } diff --git a/packages/core/src/util.ts b/packages/core/src/util.ts index aaa83c26..ab1f13ad 100644 --- a/packages/core/src/util.ts +++ b/packages/core/src/util.ts @@ -1,3 +1,5 @@ +import { GrafooSelection } from "."; + export let idFromBranch = (branch: T, idFields: string[]) => branch ? idFields @@ -8,15 +10,43 @@ export let idFromBranch = (branch: T, idFields: string[]) => export let isNotNullObject = (obj: unknown) => obj && typeof obj === "object"; -export let getPathId = (path: string, args: string[], variables?: unknown) => { +export function getPathId(path: string, args: string[], variables?: unknown) { variables = variables || {}; args = args || []; - return ( - path + - args - .map((a) => `${a}:${JSON.stringify(variables[a])}`) - .filter(Boolean) - .join(":") - ); -}; + return [path] + .concat( + args + .map( + (a) => `${a}:${variables[a] === "object" ? JSON.stringify(variables[a]) : variables[a]}` + ) + .filter(Boolean) + ) + .join(":"); +} + +export function resolveSelection( + selection: GrafooSelection, + fragments: GrafooSelection +): GrafooSelection { + let newArgs = selection.args ?? []; + let newScalars = selection.scalars ?? []; + let newSelection = selection.select ?? {}; + let newFragments = []; + + if (selection.fragments) { + for (let f of selection.fragments) { + let fragment = fragments.select[f]; + newScalars = [...newScalars, ...(fragment.scalars ?? [])]; + newFragments = [...newFragments, ...(fragment.fragments ?? [])]; + newSelection = { ...newSelection, ...fragment.select }; + } + } + + return { + args: newArgs, + select: newSelection, + scalars: [...new Set(newScalars)], + fragments: [...new Set(newFragments)] + }; +} diff --git a/packages/react/schema.graphql b/packages/react/schema.graphql index 8011416b..8c99e2cc 100644 --- a/packages/react/schema.graphql +++ b/packages/react/schema.graphql @@ -1,8 +1,8 @@ type Query { author(id: ID!): Author! - authors: [Author!]! + authors(from: Int, to: Int): [Author!]! post(id: ID!): Post! - posts: [Post!]! + posts(from: Int, to: Int): [Post!]! } type Mutation { @@ -17,7 +17,7 @@ type Mutation { type Author { id: ID! name: String! - posts: [Post!] + posts(from: Int, to: Int): [Post!] } type Post { diff --git a/packages/test-utils/schema.graphql b/packages/test-utils/schema.graphql index 8011416b..8c99e2cc 100644 --- a/packages/test-utils/schema.graphql +++ b/packages/test-utils/schema.graphql @@ -1,8 +1,8 @@ type Query { author(id: ID!): Author! - authors: [Author!]! + authors(from: Int, to: Int): [Author!]! post(id: ID!): Post! - posts: [Post!]! + posts(from: Int, to: Int): [Post!]! } type Mutation { @@ -17,7 +17,7 @@ type Mutation { type Author { id: ID! name: String! - posts: [Post!] + posts(from: Int, to: Int): [Post!] } type Post { diff --git a/packages/test-utils/src/mock-server.ts b/packages/test-utils/src/mock-server.ts index 870cd034..24c10941 100644 --- a/packages/test-utils/src/mock-server.ts +++ b/packages/test-utils/src/mock-server.ts @@ -15,14 +15,16 @@ let Query = { author(_, args) { return db.data.authors.find((author) => author.id === args.id); }, - authors() { - return db.data.authors; + authors(_, args) { + let { authors } = db.data; + return authors.slice(args.from ?? 0, args.to ?? authors.length); }, post(_, args) { return db.data.posts.find((post) => post.id === args.id); }, - posts() { - return db.data.posts; + posts(_, args) { + let { posts } = db.data; + return posts.slice(args.from ?? 0, args.to ?? posts.length); } }; @@ -87,12 +89,12 @@ let Mutation = { }; let Author = { - posts(author) { - let s = author.posts + posts(author, args) { + let posts = author.posts ? author.posts.map((id) => db.data.posts.find((post) => post.id === id)) : null; - return s; + return posts.slice(args.from ?? 0, args.to ?? posts.length); } }; From 39986c5d20d244643e3f9b09e6452fd537d7045c Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Tue, 19 Oct 2021 20:01:21 -0300 Subject: [PATCH 12/49] core working with new engine implementation --- .../__tests__/__snapshots__/index.js.snap | 168 ++++++++++++---- .../__tests__/generate-client-resolvers.ts | 19 +- packages/babel-plugin/src/compile-document.ts | 67 +------ .../src/generate-client-resolvers.ts | 12 +- packages/core/__tests__/build-query-tree.ts | 77 ------- packages/core/__tests__/index.ts | 52 ++--- packages/core/__tests__/map-records.ts | 87 -------- packages/core/__tests__/resolve-values.ts | 41 +++- packages/core/__tests__/store-values.ts | 10 +- packages/core/src/build-query-tree.ts | 36 ---- packages/core/src/client.ts | 72 +++++++ packages/core/src/index.ts | 189 +----------------- packages/core/src/map-records.ts | 36 ---- packages/core/src/resolve-values.ts | 38 +++- packages/core/src/store-values.ts | 27 +-- packages/core/src/types.ts | 66 ++++++ packages/core/src/util.ts | 32 +-- 17 files changed, 420 insertions(+), 609 deletions(-) delete mode 100644 packages/core/__tests__/build-query-tree.ts delete mode 100644 packages/core/__tests__/map-records.ts delete mode 100644 packages/core/src/build-query-tree.ts create mode 100644 packages/core/src/client.ts delete mode 100644 packages/core/src/map-records.ts create mode 100644 packages/core/src/types.ts diff --git a/packages/babel-plugin/__tests__/__snapshots__/index.js.snap b/packages/babel-plugin/__tests__/__snapshots__/index.js.snap index 74ce2f10..fa60069f 100644 --- a/packages/babel-plugin/__tests__/__snapshots__/index.js.snap +++ b/packages/babel-plugin/__tests__/__snapshots__/index.js.snap @@ -19,18 +19,41 @@ let query = gql\` ↓ ↓ ↓ ↓ ↓ ↓ let query = { - query: + document: "query($id:ID!,$offset:Int!,$start:Int!){posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}user(id:$id){id name username}}", - paths: { - "posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}": - { - name: "posts", - args: ["offset", "start"] + operation: { + select: { + posts: { + args: { + offset: "$offset", + start: "$start" + }, + select: { + authors: { + scalars: ["id", "name"], + select: { + username: {} + } + }, + tags: { + scalars: ["id", "name"] + } + }, + scalars: ["body", "createdAt", "id", "title"] }, - "user(id:$id){id name username}": { - name: "user", - args: ["id"] + user: { + args: { + id: "$id" + }, + scalars: ["id", "username"], + select: { + name: {} + } + } } + }, + fragments: { + select: {} } }; @@ -56,20 +79,43 @@ let query = gql\` ↓ ↓ ↓ ↓ ↓ ↓ let query = { - id: "6e0697df8f2453f2643bbd1e8a39c348", - query: + document: "query($id:ID!,$offset:Int!,$start:Int!){posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}user(id:$id){id name username}}", - paths: { - "posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}": - { - name: "posts", - args: ["offset", "start"] + operation: { + select: { + posts: { + args: { + offset: "$offset", + start: "$start" + }, + select: { + authors: { + scalars: ["id", "name"], + select: { + username: {} + } + }, + tags: { + scalars: ["id", "name"] + } + }, + scalars: ["body", "createdAt", "id", "title"] }, - "user(id:$id){id name username}": { - name: "user", - args: ["id"] + user: { + args: { + id: "$id" + }, + scalars: ["id", "username"], + select: { + name: {} + } + } } - } + }, + fragments: { + select: {} + }, + id: "6e0697df8f2453f2643bbd1e8a39c348" }; @@ -161,18 +207,41 @@ let query = gql\` ↓ ↓ ↓ ↓ ↓ ↓ let query = { - query: + document: "query($id:ID!,$offset:Int!,$start:Int!){posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}user(id:$id){id name username}}", - paths: { - "posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}": - { - name: "posts", - args: ["offset", "start"] + operation: { + select: { + posts: { + args: { + offset: "$offset", + start: "$start" + }, + select: { + authors: { + scalars: ["id", "name"], + select: { + username: {} + } + }, + tags: { + scalars: ["id", "name"] + } + }, + scalars: ["body", "createdAt", "id", "title"] }, - "user(id:$id){id name username}": { - name: "user", - args: ["id"] + user: { + args: { + id: "$id" + }, + scalars: ["id", "username"], + select: { + name: {} + } + } } + }, + fragments: { + select: {} } }; @@ -225,18 +294,41 @@ let query = gql\` ↓ ↓ ↓ ↓ ↓ ↓ let query = { - query: + document: "query($id:ID!,$offset:Int!,$start:Int!){posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}user(id:$id){id name username}}", - paths: { - "posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}": - { - name: "posts", - args: ["offset", "start"] + operation: { + select: { + posts: { + args: { + offset: "$offset", + start: "$start" + }, + select: { + authors: { + scalars: ["id", "name"], + select: { + username: {} + } + }, + tags: { + scalars: ["id", "name"] + } + }, + scalars: ["body", "createdAt", "id", "title"] }, - "user(id:$id){id name username}": { - name: "user", - args: ["id"] + user: { + args: { + id: "$id" + }, + scalars: ["id", "username"], + select: { + name: {} + } + } } + }, + fragments: { + select: {} } }; diff --git a/packages/babel-plugin/__tests__/generate-client-resolvers.ts b/packages/babel-plugin/__tests__/generate-client-resolvers.ts index f1e0c3b4..6d74b5e5 100644 --- a/packages/babel-plugin/__tests__/generate-client-resolvers.ts +++ b/packages/babel-plugin/__tests__/generate-client-resolvers.ts @@ -68,7 +68,7 @@ describe("generateClientResolver", () => { scalars: ["id", "name"], select: { posts: { - args: ["from", "to"], + args: { from: "1", to: "10" }, fragments: ["PostStuff"], scalars: ["id"] } @@ -79,5 +79,22 @@ describe("generateClientResolver", () => { } } }); + + let operationWithVariables = graphql` + query ($id: ID) { + author(id: $id) { + name + } + } + `; + + expect(generateClientResolver(schema, operationWithVariables)).toEqual({ + select: { + author: { + args: { id: "$id" }, + scalars: ["name"] + } + } + }); }); }); diff --git a/packages/babel-plugin/src/compile-document.ts b/packages/babel-plugin/src/compile-document.ts index cdf6677b..f81b08a3 100644 --- a/packages/babel-plugin/src/compile-document.ts +++ b/packages/babel-plugin/src/compile-document.ts @@ -1,14 +1,6 @@ import * as fs from "fs"; import * as path from "path"; -import { - DocumentNode, - FieldNode, - FragmentDefinitionNode, - buildASTSchema, - parse, - print, - getOperationAST -} from "graphql"; +import { DocumentNode, buildASTSchema, parse, print, getOperationAST } from "graphql"; import compress from "graphql-query-compress"; import md5Hash from "crypto-js/md5"; import { GrafooQuery } from "@grafoo/core"; @@ -52,61 +44,20 @@ export default function compileDocument(source: string, opts: Options) { let schemaString = getSchema(opts.schema); let schema = buildASTSchema(parse(schemaString)); let document = sortDocument(insertFields(schema, parse(source), opts.idFields)) as DocumentNode; - let frags = document.definitions.filter( - (d) => d.kind === "FragmentDefinition" - ) as FragmentDefinitionNode[]; - - let grafooQuery = {} as GrafooQuery; - let operation = getOperationAST(document); let fragments: DocumentNode = { ...document, definitions: document.definitions.filter((d) => d.kind === "FragmentDefinition") }; + let compressedDocument = compress(print(document)); + let grafooQuery: GrafooQuery = { + document: compressedDocument, + operation: generateClientResolver(schema, operation), + fragments: generateClientResolver(schema, fragments) + }; - if (operation) { - let compressedQuery = compress(print(operation)); - - // Use compressedQuery version to get same hash even if - // query has different whitespaces, newlines, etc - // Document is also sorted by "sortDocument" therefore - // selections, fields, etc order shouldn't matter either - if (opts.generateIds) { - // @ts-ignore - grafooQuery.id = md5Hash(compressedQuery).toString(); - } - - grafooQuery.query = compressedQuery; - - grafooQuery.paths = (operation.selectionSet.selections as FieldNode[]).reduce( - (acc, s) => - Object.assign(acc, { - // TODO: generate hashes as well - // based on compress(print(s))? - [compress(print(s))]: { - name: s.name.value, - args: s.arguments.map((a) => { - if (a.value?.kind === "Variable") { - return a.value.name.value; - } - - return a.name.value; - }) - } - }), - {} - ); - } - - grafooQuery.selections = generateClientResolver(schema, operation); - grafooQuery.fragments = generateClientResolver(schema, fragments); - - if (frags.length) { - grafooQuery.frags = {}; - - for (let frag of frags) { - grafooQuery.frags[frag.name.value] = compress(print(frag)); - } + if (opts.generateIds) { + grafooQuery.id = md5Hash(compressedDocument).toString(); } return JSON.stringify(grafooQuery); diff --git a/packages/babel-plugin/src/generate-client-resolvers.ts b/packages/babel-plugin/src/generate-client-resolvers.ts index df03a93d..7447f98e 100644 --- a/packages/babel-plugin/src/generate-client-resolvers.ts +++ b/packages/babel-plugin/src/generate-client-resolvers.ts @@ -8,7 +8,8 @@ import { GraphQLSchema, TypeInfo, visit, - visitWithTypeInfo + visitWithTypeInfo, + print } from "graphql"; let getNonNullType = (typeInfo: TypeInfo) => { @@ -32,8 +33,13 @@ export default function generateClientResolver(schema: GraphQLSchema, document: let selection = findPath(clientResolver, currentFields); if (!(getNonNullType(t) instanceof GraphQLScalarType)) { let newSelection: GrafooSelection = {}; - let args = (node as FieldNode).arguments?.map((a) => a.name.value) ?? []; - if (args.length) newSelection.args = args; + + if (node.kind === "Field" && node.arguments?.length) { + newSelection.args = node.arguments.reduce( + (args, arg) => ({ ...args, [arg.name.value]: print(arg.value) }), + {} + ); + } selection.select = selection.select ?? {}; selection.select[node.name.value] = newSelection; diff --git a/packages/core/__tests__/build-query-tree.ts b/packages/core/__tests__/build-query-tree.ts deleted file mode 100644 index 30d5be5a..00000000 --- a/packages/core/__tests__/build-query-tree.ts +++ /dev/null @@ -1,77 +0,0 @@ -import buildQueryTree from "../src/build-query-tree"; - -let tree = { - posts: [ - { - title: "foo", - id: "1", - author: { - name: "homer", - id: "2", - posts: [ - { - id: "1", - content: "a post content", - author: { - name: "homer", - lastName: "albernaz", - id: "2" - } - } - ] - } - }, - { title: "bar", id: "3", author: { name: "bart", id: "4" } }, - { title: "baz", id: "5", author: { name: "lisa", id: "6" } } - ] -}; - -let idFields = ["id"]; - -describe("build-query-tree", () => { - it("should update values of a resulting query tree", () => { - let records = { - "1": { title: "foobar", id: "1", content: "a new post content" }, - "2": { name: "homer", id: "2", lastName: "simpson" } - }; - - let { posts } = buildQueryTree(tree, records, idFields); - - expect(posts[0].title).toBe("foobar"); - // @ts-ignore - expect(posts[0].content).toBe("a new post content"); - // @ts-ignore - expect(posts[0].author.lastName).toBe("simpson"); - }); - - it("should add all properties of an object to its corresponding branch", () => { - let records = { - "1": { title: "foo", id: "1", content: "a post content" }, - "2": { name: "homer", id: "2", lastName: "simpson" } - }; - - let [post] = buildQueryTree(tree, records, idFields).posts; - - // @ts-ignore - expect(post.content).toBeTruthy(); - // @ts-ignore - expect(post.author.lastName).toBeTruthy(); - // @ts-ignore - expect(post.author.posts[0].title).toBeTruthy(); - }); - - it("should not remove a property from a branch", () => { - let records = { - "1": { id: "1" }, - "2": { id: "2" }, - "3": { id: "3" }, - "4": { id: "4" }, - "5": { id: "5" }, - "6": { id: "6" } - }; - - let newTree = buildQueryTree(tree, records, idFields); - - expect(newTree).toEqual(tree); - }); -}); diff --git a/packages/core/__tests__/index.ts b/packages/core/__tests__/index.ts index ae6558dd..d967d05d 100644 --- a/packages/core/__tests__/index.ts +++ b/packages/core/__tests__/index.ts @@ -1,6 +1,7 @@ import graphql from "@grafoo/core/tag"; import { executeQuery } from "@grafoo/test-utils"; -import createClient, { GrafooClient } from "../src"; +import createClient from "../src"; +import { GrafooClient } from "../src/types"; type Post = { title?: string; @@ -145,11 +146,8 @@ describe("@grafoo/core", () => { it("should perform query requests with fragments", async () => { let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; - let { query, frags } = POST_WITH_FRAGMENT; - if (frags) for (let frag in frags) query += " " + frags[frag]; - - let data = await executeQuery({ query, variables }); + let data = await executeQuery({ query: POST_WITH_FRAGMENT.document, variables }); expect(data).toEqual(await client.execute(POST_WITH_FRAGMENT, variables)); }); @@ -160,24 +158,19 @@ describe("@grafoo/core", () => { client.write(POSTS_AND_AUTHORS, data); let { authors, posts } = data; - let { records, paths } = client.flush(); - - expect(authors).toEqual( - paths["authors{__typename id name posts{__typename body id title}}"].data.authors - ); - expect(posts).toEqual( - paths["posts{__typename author{__typename id name}body id title}"].data.posts - ); + let { records } = client.flush(); + expect(authors.every((author) => Boolean(records[author.id]))).toBe(true); expect(posts.every((post) => Boolean(records[post.id]))).toBe(true); }); it("should write queries partially to the client", async () => { - let data = await client.execute(POSTS); + let { data } = await client.execute(POSTS); + + client.write(POSTS_AND_AUTHORS, data as any); - expect(() => client.write(POSTS_AND_AUTHORS, data as any)).not.toThrow(); - expect(() => client.read(POSTS)).not.toThrow(); - expect(() => client.read(AUTHORS)).not.toThrow(); + expect(client.read(POSTS).data).toEqual(data); + expect(client.read(AUTHORS).data).toEqual({ authors: {} }); }); it("should read queries from the client", async () => { @@ -191,9 +184,7 @@ describe("@grafoo/core", () => { expect(authors).toEqual(result.data.authors); expect(authors.every((author) => Boolean(result.records[author.id]))).toBe(true); - expect( - authors.every((author) => author.posts.every((post) => Boolean(result.records[post.id]))) - ).toBe(true); + expect(authors.every((a) => a.posts.every((post) => !!result.records[post.id]))).toBe(true); }); it("should handle queries with variables", async () => { @@ -202,7 +193,7 @@ describe("@grafoo/core", () => { client.write(POST, variables, data); - expect(client.read(POST, { postId: "123" })).toEqual({}); + expect(client.read(POST, { postId: "123" }).data).toEqual({ post: {} }); expect(client.read(POST, variables).data.post.id).toBe(variables.postId); }); @@ -213,7 +204,6 @@ describe("@grafoo/core", () => { let d1 = await client.execute(POST, v1); client.write(POST, v1, d1.data); - expect(client.read(POST, { postId: "not found" })).toEqual({}); expect(client.read(POST, v1).data.post.id).toBe(v1.postId); let d2 = await client.execute(POST, v2); @@ -231,7 +221,7 @@ describe("@grafoo/core", () => { expect(client.read(POSTS_AND_AUTHORS).partial).toBe(true); }); - it("should remove unused records from state records", async () => { + it.skip("should remove unused records from state records", async () => { let { data } = await client.execute(SIMPLE_AUTHORS); client.write(SIMPLE_AUTHORS, data); @@ -296,9 +286,7 @@ describe("@grafoo/core", () => { let post = JSON.parse(JSON.stringify(client.read(POST, variables).data.post)); - delete post.__typename; - - post.foo = "bar"; + post.title = "updated title"; client.write(POST, variables, { post }); @@ -311,8 +299,7 @@ describe("@grafoo/core", () => { }, body: "Ducimus harum delectus consectetur.", id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", - title: "Quam odit", - foo: "bar" + title: "updated title" }); }); @@ -352,12 +339,11 @@ describe("@grafoo/core", () => { expect(client.read(POSTS_AND_AUTHORS).data).toEqual(data); }); - it("should allow cache to be cleared using reset()", () => { - let data: AuthorsQuery = { authors: [{ name: "deleteme" }] }; - client.write(SIMPLE_AUTHORS, data); - expect(client.read(SIMPLE_AUTHORS).data).toEqual(data); + it("should clear cache if reset is called", async () => { + let { data } = await client.execute(AUTHORS); + client.write(AUTHORS, data); + expect(client.read(AUTHORS).data).toEqual(data); client.reset(); - expect(client.read(SIMPLE_AUTHORS).data).toEqual(undefined); expect(client.flush()).toEqual({ records: {}, paths: {} }); }); diff --git a/packages/core/__tests__/map-records.ts b/packages/core/__tests__/map-records.ts deleted file mode 100644 index df013052..00000000 --- a/packages/core/__tests__/map-records.ts +++ /dev/null @@ -1,87 +0,0 @@ -import mapRecords from "../src/map-records"; - -let tree = { - posts: [ - { - title: "foo", - id: "1", - __typename: "Post", - author: { - name: "homer", - id: "2", - __typename: "Author", - posts: [ - { - title: "foo", - id: "1", - __typename: "Post", - content: "a post content", - author: { - name: "homer", - lastName: "simpson", - id: "2", - __typename: "Author" - } - } - ] - } - }, - { - title: "bar", - id: "3", - __typename: "Post", - author: { name: "bart", id: "4", __typename: "Author" } - }, - { - title: "baz", - id: "5", - __typename: "Post", - author: { name: "lisa", id: "6", __typename: "Author" } - } - ] -}; - -let idFields = ["id"]; - -describe("map-objects", () => { - it("should return the correct map of records", () => { - let records = mapRecords(tree, idFields); - - let expected = { - "1": { title: "foo", id: "1", __typename: "Post", content: "a post content" }, - "2": { name: "homer", id: "2", __typename: "Author", lastName: "simpson" }, - "3": { title: "bar", __typename: "Post", id: "3" }, - "4": { name: "bart", id: "4", __typename: "Author" }, - "5": { title: "baz", __typename: "Post", id: "5" }, - "6": { name: "lisa", id: "6", __typename: "Author" } - }; - - expect(records).toEqual(expected); - }); - - it("should accept null values", () => { - let result = { - data: { - me: { - id: "5a3ab7e93f662a108d978a6e", - username: "hsimpson", - email: "simpsonhomer@gmail.com", - name: null, - bio: null - } - } - }; - - expect(() => mapRecords(result, idFields)).not.toThrow(); - }); - - it("should build an object identifier based on the `idFields` cache option", () => { - let idFields = ["__typename", "id"]; - - let records = mapRecords(tree, idFields); - - let expected = ["Post:1", "Author:2", "Post:3", "Author:4", "Post:5", "Author:6"]; - - expect(Object.keys(records).every((obj) => expected.some((exp) => exp === obj))).toBe(true); - }); -}); diff --git a/packages/core/__tests__/resolve-values.ts b/packages/core/__tests__/resolve-values.ts index 5cc6452e..da01981c 100644 --- a/packages/core/__tests__/resolve-values.ts +++ b/packages/core/__tests__/resolve-values.ts @@ -26,9 +26,10 @@ describe("resolveValues", () => { } `; - expect(resolveValues(query, postsAndAuthors.path, postsAndAuthors.records)).toEqual( - postsAndAuthors.data - ); + let { data, records } = resolveValues(query, {}, postsAndAuthors.path, postsAndAuthors.records); + + expect(data).toEqual(postsAndAuthors.data); + expect(records).toEqual(postsAndAuthors.records); }); it("should resolve the data given a query with fragments, a path and the records", () => { @@ -55,9 +56,15 @@ describe("resolveValues", () => { } `; - expect(resolveValues(query, postsWithFragments.path, postsWithFragments.records)).toEqual( - postsWithFragments.data + let { data, records } = resolveValues( + query, + {}, + postsWithFragments.path, + postsWithFragments.records ); + + expect(data).toEqual(postsWithFragments.data); + expect(records).toEqual(postsWithFragments.records); }); it("should resolve the data given a query with arguments, a path and the records", () => { @@ -78,9 +85,15 @@ describe("resolveValues", () => { to: 2 }; - expect( - resolveValues(query, authorWithArguments.path, authorWithArguments.records, variables) - ).toEqual(authorWithArguments.data); + let { data, records } = resolveValues( + query, + variables, + authorWithArguments.path, + authorWithArguments.records + ); + + expect(data).toEqual(authorWithArguments.data); + expect(records).toEqual(authorWithArguments.records); }); it("should resolve the data given a query with fragments and arguments, a path and the records", () => { @@ -105,8 +118,14 @@ describe("resolveValues", () => { to: 2 }; - expect( - resolveValues(query, authorWithArguments.path, authorWithArguments.records, variables) - ).toEqual(authorWithArguments.data); + let { data, records } = resolveValues( + query, + variables, + authorWithArguments.path, + authorWithArguments.records + ); + + expect(data).toEqual(authorWithArguments.data); + expect(records).toEqual(authorWithArguments.records); }); }); diff --git a/packages/core/__tests__/store-values.ts b/packages/core/__tests__/store-values.ts index eb409331..ec6a55d5 100644 --- a/packages/core/__tests__/store-values.ts +++ b/packages/core/__tests__/store-values.ts @@ -8,7 +8,7 @@ let idFields = ["id"]; describe("storeValues", () => { test("should yield correct path and records to a normal query", () => { - let POSTS_AND_AUTHORS = graphql` + let query = graphql` query { posts { title @@ -28,7 +28,7 @@ describe("storeValues", () => { } `; - let { path, records } = storeValues(postsAndAuthors.data, POSTS_AND_AUTHORS, idFields); + let { path, records } = storeValues(query, {}, postsAndAuthors.data, idFields); expect(path).toEqual(postsAndAuthors.path); expect(records).toEqual(postsAndAuthors.records); @@ -58,7 +58,7 @@ describe("storeValues", () => { } `; - let { path, records } = storeValues(postsWithFragments.data, query, idFields); + let { path, records } = storeValues(query, {}, postsWithFragments.data, idFields); expect(path).toEqual(postsWithFragments.path); expect(records).toEqual(postsWithFragments.records); @@ -82,7 +82,7 @@ describe("storeValues", () => { to: 2 }; - let { path, records } = storeValues(authorWithArguments.data, query, idFields, variables); + let { path, records } = storeValues(query, variables, authorWithArguments.data, idFields); expect(path).toEqual(authorWithArguments.path); expect(records).toEqual(authorWithArguments.records); @@ -110,7 +110,7 @@ describe("storeValues", () => { to: 2 }; - let { path, records } = storeValues(authorWithArguments.data, query, idFields, variables); + let { path, records } = storeValues(query, variables, authorWithArguments.data, idFields); expect(path).toEqual(authorWithArguments.path); expect(records).toEqual(authorWithArguments.records); diff --git a/packages/core/src/build-query-tree.ts b/packages/core/src/build-query-tree.ts deleted file mode 100644 index 00ef4775..00000000 --- a/packages/core/src/build-query-tree.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { GrafooRecords } from "."; -import { idFromBranch, isNotNullObject } from "./util"; - -export default function buildQueryTree(tree: T, records: GrafooRecords, idFields: string[]): T { - // clone resulting query tree - let queryTree = tree; - let stack = []; - - // populates stack with the properties of the query tree and the query tree it self - for (let i in queryTree) stack.push([i, queryTree]); - - // will loop until the stack is empty - while (stack.length) { - // pops a stack entry extracting the current key of the tree's branch - // (eg: a node or an edge) and the branch it self - let [key, currentTree] = stack.pop(); - // assigns nested branch - let branch = currentTree[key]; - // get node identifier - let identifier = idFromBranch(branch, idFields); - // possible node matching stored record - let possibleBranchRecord = records[identifier]; - - // iterates over the child branch properties - for (let i in Object.assign({}, branch, possibleBranchRecord)) { - // assigns to the child branch all properties retrieved - // from the corresponding record retrieved from the records cache - if (identifier && possibleBranchRecord) branch[i] = possibleBranchRecord[i] || branch[i]; - - // pushes properties of the child branch and the branch it self to the stack - if (isNotNullObject(branch[i])) stack.push([i, branch]); - } - } - - return queryTree; -} diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts new file mode 100644 index 00000000..16e82480 --- /dev/null +++ b/packages/core/src/client.ts @@ -0,0 +1,72 @@ +import storeValues from "./store-values"; +import resolveValues from "./resolve-values"; +import { + GrafooClient, + GrafooClientOptions, + GrafooListener, + GrafooPath, + GrafooQuery, + GrafooRecords, + GrafooTransport +} from "./types"; + +export default function createClient( + transport: GrafooTransport, + options?: GrafooClientOptions +): GrafooClient { + let { initialState = { paths: {}, records: {} }, idFields } = options; + let paths: GrafooPath = initialState.paths ?? {}; + let records: GrafooRecords = initialState.records ?? {}; + let listeners: GrafooListener[] = []; + + function execute(query: T, variables?: T["_variablesType"]) { + return transport(query.document, variables); + } + + function listen(listener: GrafooListener) { + listeners.push(listener); + return () => { + let index = listeners.indexOf(listener); + if (index < 0) return; + listeners.splice(index, 1); + }; + } + + function write( + query: T, + variables: T["_variablesType"], + data?: T["_queryType"] + ) { + if (!data) { + data = variables as T["_queryType"]; + variables = {}; + } + + let result = storeValues(query, variables, data, idFields); + let queryRecords = result.records; + Object.assign(paths, result.path); + + // assign new values to records + for (let i in queryRecords) { + Object.assign(records, { [i]: { ...records[i], ...queryRecords[i] } }); + } + + // run listeners + for (let i in listeners) listeners[i](queryRecords); + } + + function read(query: T, variables?: T["_variablesType"]) { + return resolveValues(query, variables, paths, records); + } + + function flush() { + return { records, paths }; + } + + function reset() { + paths = {}; + records = {}; + } + + return { execute, listen, write, read, flush, reset }; +} diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 63c19d39..336b9279 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,187 +1,2 @@ -import buildQueryTree from "./build-query-tree"; -import mapRecords from "./map-records"; -import { getPathId } from "./util"; - -export type GraphQlError = { - message: string; - locations: { line: number; column: number }[]; - path: string[]; -}; - -export type GraphQlPayload = { - data: T; - errors?: GraphQlError[]; -}; - -export type GrafooTransport = ( - query: string, - variables?: unknown, - id?: string -) => Promise>; - -export type GrafooRecords = Record>; - -export type GrafooPaths = Record< - string, - { - data: Record; - records: string[]; - partial?: boolean; - } ->; - -export type GrafooListener = (objects: GrafooRecords) => void; - -export type GrafooInitialState = { - records: GrafooRecords; - paths: GrafooPaths; -}; - -export type GrafooShape = ({ id?: string } | { [key: string]: GrafooShape }) | GrafooShape[]; - -export type GrafooSelection = { - args?: string[]; - scalars?: string[]; - fragments?: string[]; - select?: Record; -}; - -export type GrafooQuery = { - query: string; - frags?: Record; - paths: Record; - selections: GrafooSelection; - fragments: GrafooSelection; - _queryType: T; - _variablesType: U; -}; - -export type GrafooClient = { - execute: ( - query: T, - variables?: T["_variablesType"] - ) => Promise>; - listen: (listener: GrafooListener) => () => void; - write: { - (query: T, variables: T["_variablesType"], data: T["_queryType"]): void; - (query: T, data: T["_queryType"]): void; - }; - read: ( - query: T, - variables?: T["_variablesType"] - ) => { data?: T["_queryType"]; records?: GrafooRecords; partial?: boolean }; - flush: () => GrafooInitialState; - reset: () => void; -}; - -export type GrafooClientOptions = { - initialState?: GrafooInitialState; - idFields?: Array; -}; - -export default function createClient( - transport: GrafooTransport, - options?: GrafooClientOptions -): GrafooClient { - let { initialState, idFields } = options; - let { paths, records } = initialState || { paths: {}, records: {} }; - let listeners: GrafooListener[] = []; - - function execute({ query, frags }: T, variables?: T["_variablesType"]) { - if (frags) for (let frag in frags) query += frags[frag]; - - return transport(query, variables); - } - - function listen(listener: GrafooListener) { - listeners.push(listener); - - return () => { - let index = listeners.indexOf(listener); - - if (index < 0) return; - - listeners.splice(index, 1); - }; - } - - function write( - query: T, - variables: T["_variablesType"], - data?: T["_queryType"] - ) { - if (!data) { - data = variables as T["_queryType"]; - variables = undefined; - } - - let queryRecords: GrafooRecords = {}; - - for (let path in query.paths) { - let { name, args } = query.paths[path]; - let pathData = { - [name]: data[name] - }; - - let pathRecords = mapRecords(pathData, idFields); - - Object.assign(queryRecords, pathRecords); - - paths[getPathId(path, args, variables)] = { - data: pathData, - records: Object.keys(pathRecords) - }; - } - - // assign new values to records - for (let i in queryRecords) { - records[i] = queryRecords[i] = Object.assign({}, records[i], queryRecords[i]); - } - - // clean cache - let idsList: string[] = []; - for (let i in paths) idsList = idsList.concat(paths[i].records); - let allIds = new Set(idsList); - for (let i in records) if (!allIds.has(i)) delete records[i]; - - // run listeners - for (let i in listeners) listeners[i](queryRecords); - } - - function read( - query: T, - variables?: T["_variablesType"] - ): { data?: T["_queryType"]; records?: GrafooRecords; partial?: boolean } { - let data: T["_queryType"] = {}; - let queryRecords: GrafooRecords = {}; - let partial = false; - - for (let path in query.paths) { - let { name, args } = query.paths[path]; - let currentPath = paths[getPathId(path, args, variables)]; - - if (currentPath) { - data[name] = currentPath.data[name]; - - for (let i of currentPath.records) queryRecords[i] = records[i]; - } else { - partial = true; - } - } - - return Object.keys(data).length - ? { data: buildQueryTree(data, records, idFields), records: queryRecords, partial } - : {}; - } - - function flush() { - return { records, paths }; - } - - function reset() { - paths = {}; - records = {}; - } - - return { execute, listen, write, read, flush, reset }; -} +export * from "./types"; +export { default } from "./client"; diff --git a/packages/core/src/map-records.ts b/packages/core/src/map-records.ts deleted file mode 100644 index de995e02..00000000 --- a/packages/core/src/map-records.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { GrafooRecords } from "."; -import { isNotNullObject, idFromBranch } from "./util"; - -export default function mapRecords(tree: T, idFields: string[]): GrafooRecords { - // map in which records will be stored - // having their extracted ids from props as key - let map = {}; - let stack = []; - - // populates the stack with the tree branches - for (let i in tree) stack.push(tree[i]); - - // will run until the stack is empty - while (stack.length) { - // pops the current branch from the stack - let branch = stack.pop(); - // next node to be traversed. nested branches will be removed - let filteredBranch = {}; - - // iterate over branch properties - // if the property is a branch it will be added to the stack - // else if it is not a branch it will be added to filtered branch - for (let i in branch) { - let branchVal = branch[i]; - (isNotNullObject(branchVal) && stack.push(branchVal)) || (filteredBranch[i] = branchVal); - } - - // node identifier - let identifier = idFromBranch(branch, idFields); - - // if branch is a node, assign the value of filtered branch to it - if (identifier) map[identifier] = Object.assign({}, map[identifier], filteredBranch); - } - - return map; -} diff --git a/packages/core/src/resolve-values.ts b/packages/core/src/resolve-values.ts index dab0fee0..f1cabaa2 100644 --- a/packages/core/src/resolve-values.ts +++ b/packages/core/src/resolve-values.ts @@ -1,18 +1,27 @@ -import { GrafooQuery, GrafooRecords, GrafooSelection, GrafooShape } from "."; +import { GrafooPath, GrafooQuery, GrafooRecords, GrafooSelection } from "./types"; import { getPathId, resolveSelection } from "./util"; -export default function resolveValues( - { selections, fragments }: GrafooQuery, - shape: GrafooShape, - records: GrafooRecords, - variables?: Record +export default function resolveValues( + { operation, fragments }: T, + variables: T["_variablesType"], + allPaths: GrafooPath, + allRecords: GrafooRecords ) { - let data = {} as T; - let stack: [string, GrafooSelection, GrafooShape, T][] = [["", selections, shape, data]]; + let data = {} as T["_queryType"]; + let records: GrafooRecords = {}; + let partial = false; + let stack: [string, GrafooSelection, GrafooPath, T["_queryType"]][] = [ + ["", operation, allPaths, data] + ]; while (stack.length) { let [name, select, path, data] = stack.shift(); + if (!path) { + partial = true; + continue; + } + if (Array.isArray(path)) { for (let [k, v] of Object.entries(path)) { data[k] = Array.isArray(v) ? [] : {}; @@ -20,18 +29,25 @@ export default function resolveValues( } } else { let currentSelection = resolveSelection(select, fragments); + let { id } = path; + let record = allRecords[id as string]; - for (let s of currentSelection.scalars) { - data[s] = records[path.id as string][s]; + if (id) { + records[id as string] = record; + + for (let s of currentSelection.scalars) { + data[s] = record[s]; + } } for (let [k, v] of Object.entries(currentSelection.select)) { let pathId = getPathId(k, v.args, variables); + data[k] = Array.isArray(path[pathId]) ? [] : {}; stack.unshift([k, v, path[pathId], data[k]]); } } } - return data; + return { data, records, partial }; } diff --git a/packages/core/src/store-values.ts b/packages/core/src/store-values.ts index 60d2bd23..d992695e 100644 --- a/packages/core/src/store-values.ts +++ b/packages/core/src/store-values.ts @@ -1,21 +1,24 @@ -import { GrafooQuery, GrafooRecords, GrafooSelection, GrafooShape } from "."; +import { GrafooPath, GrafooQuery, GrafooRecords, GrafooSelection } from "./types"; import { idFromBranch, getPathId, resolveSelection } from "./util"; -export default function storeValues( - tree: T, - { selections, fragments }: GrafooQuery, - idFields: string[], - variables?: Record +export default function storeValues( + query: T, + variables: T["_variablesType"], + tree: T["_queryType"], + idFields: string[] ) { - let path: GrafooShape = {}; + let { operation, fragments } = query; + let path: GrafooPath = {}; let records: GrafooRecords = {}; - let stack: [string, T, GrafooSelection, GrafooShape][] = [["", tree, selections, path]]; + let stack: [string, T["_queryType"], GrafooSelection, GrafooPath][] = [ + ["", tree, operation, path] + ]; while (stack.length) { let [name, branch, select, path] = stack.shift(); let isListItem = isNaN(name as any); - let currentSelection = resolveSelection(isListItem ? select.select[name] : select, fragments); - let pathId = isListItem ? getPathId(name, currentSelection.args, variables) : name; + let resolvedSelection = resolveSelection(isListItem ? select.select[name] : select, fragments); + let pathId = isListItem ? getPathId(name, resolvedSelection.args, variables) : name; if (Array.isArray(branch)) { path[pathId] = []; @@ -25,7 +28,7 @@ export default function storeValues( if (id) { records[id] = records[id] || {}; - for (let field of currentSelection.scalars) { + for (let field of resolvedSelection.scalars) { records[id][field] = branch[field]; } @@ -35,7 +38,7 @@ export default function storeValues( for (let [k, v] of Object.entries(branch)) { if (typeof v === "object") { - stack.unshift([k, v, currentSelection, path[pathId] || path]); + stack.unshift([k, v, resolvedSelection, path[pathId] || path]); } } } diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts new file mode 100644 index 00000000..ac29c54b --- /dev/null +++ b/packages/core/src/types.ts @@ -0,0 +1,66 @@ +export type GraphQlError = { + message: string; + locations: { line: number; column: number }[]; + path: string[]; +}; + +export type GraphQlPayload = { + data: T; + errors?: GraphQlError[]; +}; + +export type GrafooTransport = ( + query: string, + variables?: unknown, + id?: string +) => Promise>; + +export type GrafooRecords = Record>; + +export type GrafooListener = (objects: GrafooRecords) => void; + +export type GrafooInitialState = { + records: GrafooRecords; + paths: GrafooPath; +}; + +export type GrafooPath = ({ id?: string } | { [key: string]: GrafooPath }) | GrafooPath[]; + +export type GrafooSelection = { + args?: Record; + scalars?: string[]; + fragments?: string[]; + select?: Record; +}; + +export type GrafooQuery = { + document: string; + id?: string; + operation?: GrafooSelection; + fragments?: GrafooSelection; + _queryType?: T; + _variablesType?: U; +}; + +export type GrafooClient = { + execute: ( + query: T, + variables?: T["_variablesType"] + ) => Promise>; + write: { + (query: T, variables: T["_variablesType"], data: T["_queryType"]): void; + (query: T, data: T["_queryType"]): void; + }; + read: ( + query: T, + variables?: T["_variablesType"] + ) => { data?: T["_queryType"]; records?: GrafooRecords; partial?: boolean }; + listen: (listener: GrafooListener) => () => void; + flush: () => GrafooInitialState; + reset: () => void; +}; + +export type GrafooClientOptions = { + initialState?: GrafooInitialState; + idFields?: Array; +}; diff --git a/packages/core/src/util.ts b/packages/core/src/util.ts index ab1f13ad..ccaff204 100644 --- a/packages/core/src/util.ts +++ b/packages/core/src/util.ts @@ -1,4 +1,4 @@ -import { GrafooSelection } from "."; +import { GrafooQuery, GrafooSelection } from "./types"; export let idFromBranch = (branch: T, idFields: string[]) => branch @@ -10,26 +10,30 @@ export let idFromBranch = (branch: T, idFields: string[]) => export let isNotNullObject = (obj: unknown) => obj && typeof obj === "object"; -export function getPathId(path: string, args: string[], variables?: unknown) { +export function getPathId( + path: string, + args: Record = {}, + variables: T["_variablesType"] +) { variables = variables || {}; - args = args || []; - - return [path] - .concat( - args - .map( - (a) => `${a}:${variables[a] === "object" ? JSON.stringify(variables[a]) : variables[a]}` - ) - .filter(Boolean) - ) - .join(":"); + args = args || {}; + + let ids = Object.entries(args).map(([name, value]) => { + let rgx = /^\$(?\w+)/i; + let { variable } = rgx.exec(value)?.groups ?? {}; + let finalValue = variable ? variables[variable] : value; + + return `${name}:${finalValue}`; + }); + + return [path].concat(ids).join(":"); } export function resolveSelection( selection: GrafooSelection, fragments: GrafooSelection ): GrafooSelection { - let newArgs = selection.args ?? []; + let newArgs = selection.args ?? {}; let newScalars = selection.scalars ?? []; let newSelection = selection.select ?? {}; let newFragments = []; From da7831e361de8f0291dd3f512eea27f509557efe Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Wed, 20 Oct 2021 01:55:30 -0300 Subject: [PATCH 13/49] all green --- packages/bindings/__tests__/index.ts | 44 +++---- packages/bindings/src/bindings.ts | 106 ++++++++++++++++ packages/bindings/src/index.ts | 145 +--------------------- packages/bindings/src/types.ts | 33 +++++ packages/bundle/package.json | 2 +- packages/core/__tests__/index.ts | 27 +--- packages/core/__tests__/resolve-values.ts | 48 +++++++ packages/core/__tests__/store-values.ts | 38 +++++- packages/core/src/resolve-values.ts | 28 ++--- packages/core/src/store-values.ts | 27 ++-- packages/core/src/types.ts | 5 +- packages/core/src/util.ts | 2 +- packages/react/__tests__/index.tsx | 10 +- packages/test-utils/src/mock-server.ts | 13 +- yarn.lock | 5 + 15 files changed, 295 insertions(+), 238 deletions(-) create mode 100644 packages/bindings/src/bindings.ts create mode 100644 packages/bindings/src/types.ts diff --git a/packages/bindings/__tests__/index.ts b/packages/bindings/__tests__/index.ts index 827ae910..0c4fc641 100644 --- a/packages/bindings/__tests__/index.ts +++ b/packages/bindings/__tests__/index.ts @@ -292,13 +292,13 @@ describe("@grafoo/bindings", () => { }); it("should provide errors on bad request", async () => { - let FailAuthors = { ...AUTHORS, query: AUTHORS.query.substr(1) }; + let failedQuery = { ...AUTHORS, document: AUTHORS.document.substr(1) }; - let { errors } = await mockQueryRequest(FailAuthors); + let { errors } = await mockQueryRequest(failedQuery); let renderFn = jest.fn(); - let bindings = createBindings(client, renderFn, { query: FailAuthors }); + let bindings = createBindings(client, renderFn, { query: failedQuery }); await bindings.load(); @@ -317,7 +317,7 @@ describe("@grafoo/bindings", () => { let variables = { name: "Bart" }; - let { data } = await mockQueryRequest({ query: CREATE_AUTHOR.query, variables }); + let { data } = await mockQueryRequest(CREATE_AUTHOR, variables); let { data: mutationData } = await props.createAuthor(variables); @@ -348,10 +348,7 @@ describe("@grafoo/bindings", () => { let variables = { name: "Homer" }; - let { data } = await mockQueryRequest({ - query: CREATE_AUTHOR.query, - variables - }); + let { data } = await mockQueryRequest(CREATE_AUTHOR, variables); let { authors } = bindings.getState(); @@ -388,10 +385,7 @@ describe("@grafoo/bindings", () => { let variables = { name: "Peter" }; - let { data } = await mockQueryRequest({ - query: CREATE_AUTHOR.query, - variables - }); + let { data } = await mockQueryRequest(CREATE_AUTHOR, variables); let { authors } = bindings.getState(); @@ -407,10 +401,9 @@ describe("@grafoo/bindings", () => { }); it("should update if query objects has less keys then nextObjects", async () => { - let { query } = CREATE_AUTHOR; let { data: { createAuthor: author } - } = await mockQueryRequest({ query, variables: { name: "gustav" } }); + } = await mockQueryRequest(CREATE_AUTHOR, { name: "gustav" }); let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); @@ -439,13 +432,9 @@ describe("@grafoo/bindings", () => { }); it("should update if query objects is modified", async () => { - let { query } = CREATE_AUTHOR; let { data: { createAuthor: author } - } = await mockQueryRequest({ - query, - variables: { name: "sven" } - }); + } = await mockQueryRequest(CREATE_AUTHOR, { name: "sven" }); let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); @@ -467,7 +456,7 @@ describe("@grafoo/bindings", () => { let variables = { ...author, name: "johan" }; - await mockQueryRequest({ query: UPDATE_AUTHOR.query, variables }); + await mockQueryRequest(UPDATE_AUTHOR, variables); await updateAuthor(variables); @@ -521,21 +510,18 @@ describe("@grafoo/bindings", () => { let props = bindings.getState(); let variables = { name: "mikel" }; - let { data } = await mockQueryRequest({ - query: CREATE_AUTHOR.query, - variables - }); - expect(await mockQueryRequest({ query: CREATE_AUTHOR.query, variables })).toEqual( + let { data } = await mockQueryRequest(CREATE_AUTHOR, variables); + expect(await mockQueryRequest(CREATE_AUTHOR, variables)).toEqual( await props.createAuthor(variables) ); variables = { ...data.createAuthor, name: "miguel" }; - expect(await mockQueryRequest({ query: UPDATE_AUTHOR.query, variables })).toEqual( + expect(await mockQueryRequest(UPDATE_AUTHOR, variables)).toEqual( await props.updateAuthor(variables) ); variables = data.createAuthor; - expect(await mockQueryRequest({ query: DELETE_AUTHOR.query, variables })).toEqual( + expect(await mockQueryRequest(DELETE_AUTHOR, variables)).toEqual( await props.deleteAuthor(data.createAuthor) ); }); @@ -551,12 +537,12 @@ describe("@grafoo/bindings", () => { let bindings = createBindings(client, () => {}, { query: AUTHOR, variables: author1Variables }); - await mockQueryRequest({ query: AUTHOR.query, variables: author1Variables }); + await mockQueryRequest(AUTHOR, author1Variables); await bindings.load(); expect(bindings.getState().author).toEqual(author1); expect(client.read(AUTHOR, author1Variables).data.author).toEqual(author1); - await mockQueryRequest({ query: AUTHOR.query, variables: author2Variables }); + await mockQueryRequest(AUTHOR, author2Variables); await bindings.load(author2Variables); expect(bindings.getState().author).toEqual(author2); expect(client.read(AUTHOR, author2Variables).data.author).toEqual(author2); diff --git a/packages/bindings/src/bindings.ts b/packages/bindings/src/bindings.ts new file mode 100644 index 00000000..ed1dd4a3 --- /dev/null +++ b/packages/bindings/src/bindings.ts @@ -0,0 +1,106 @@ +import { GrafooClient, GrafooRecords, GraphQlError, GrafooQuery } from "@grafoo/core"; +import { GrafooBoundMutations, GrafooBoundState, GrafooConsumerProps } from "./types"; + +export default function createBindings< + T extends GrafooQuery, + U extends Record +>( + client: GrafooClient, + updater: (state: GrafooBoundState) => void, + props: GrafooConsumerProps +) { + type CP = GrafooConsumerProps; + let { query, variables, mutations } = props; + let data: CP["query"]["_queryType"]; + let errors: GraphQlError[]; + let boundMutations = {} as GrafooBoundMutations; + let records: GrafooRecords; + let partial = false; + let unbind = () => {}; + let preventListenUpdate = false; + + if (query) { + ({ data, records, partial } = client.read(query, variables)); + + unbind = client.listen((nextRecords) => { + if (preventListenUpdate) { + preventListenUpdate = false; + return; + } + + records = records || {}; + + for (let i in nextRecords) { + // record has been inserted + if (!(i in records)) return getUpdateFromClient(); + + for (let j in nextRecords[i]) { + // record has been updated + if (nextRecords[i][j] !== records[i][j]) return getUpdateFromClient(); + } + } + + for (let i in records) { + // record has been removed + if (!(i in nextRecords)) return getUpdateFromClient(); + } + }); + } + + if (mutations) { + for (let key in mutations) { + let { update, optimisticUpdate, query: mutationQuery } = mutations[key]; + + boundMutations[key] = (mutationVariables) => { + if (query && optimisticUpdate) { + client.write(query, variables, optimisticUpdate(data, mutationVariables)); + } + + return client.execute(mutationQuery, mutationVariables).then((mutationResponse) => { + if (query && update && mutationResponse.data) { + client.write(query, variables, update(data, mutationResponse.data)); + } + + return mutationResponse; + }); + }; + } + } + + let state = { loaded: !!data && !partial, loading: false }; + + function getUpdateFromClient() { + ({ data, partial } = client.read(query, variables)); + Object.assign(state, { loaded: !!data && !partial }); + updater(getState()); + } + + function getState(): GrafooBoundState { + return Object.assign({}, state, boundMutations, data); + } + + function load(nextVariables?: CP["query"]["_variablesType"]) { + if (nextVariables) { + variables = nextVariables; + } + + if (!state.loading) { + Object.assign(state, { loading: true }); + updater(getState()); + } + + return client.execute(query, variables).then((res) => { + ({ data, errors } = res); + + if (data) { + preventListenUpdate = true; + client.write(query, variables, data); + } + + Object.assign(state, { loaded: !!data, loading: false }, errors && { errors }); + updater(getState()); + }); + } + + return { unbind, getState, load }; +} diff --git a/packages/bindings/src/index.ts b/packages/bindings/src/index.ts index 6a90a281..4991630d 100644 --- a/packages/bindings/src/index.ts +++ b/packages/bindings/src/index.ts @@ -1,143 +1,2 @@ -import { - GrafooClient, - GrafooRecords, - GraphQlError, - GraphQlPayload, - GrafooQuery -} from "@grafoo/core"; - -export type GrafooBoundMutations> = { - [U in keyof T]: ( - variables: T[U]["_variablesType"] - ) => Promise>; -}; - -export type GrafooBoundState< - T extends GrafooQuery, - U extends Record -> = T["_queryType"] & - GrafooBoundMutations & { - loaded: boolean; - loading: boolean; - errors?: GraphQlError[]; - }; - -export type GrafooMutation = { - query: U; - update?: (props: T["_queryType"], data: U["_queryType"]) => T["_queryType"]; - optimisticUpdate?: (props: T["_queryType"], variables: U["_variablesType"]) => T["_queryType"]; -}; - -export type GrafooMutations> = { - [V in keyof U]: GrafooMutation; -}; - -export type GrafooConsumerProps> = { - query?: T; - variables?: T["_variablesType"]; - mutations?: GrafooMutations; -}; - -export default function createBindings< - T extends GrafooQuery, - U extends Record ->( - client: GrafooClient, - updater: (state: GrafooBoundState) => void, - props: GrafooConsumerProps -) { - type CP = GrafooConsumerProps; - let { query, variables, mutations } = props; - let data: CP["query"]["_queryType"]; - let errors: GraphQlError[]; - let boundMutations = {} as GrafooBoundMutations; - let records: GrafooRecords; - let partial = false; - let unbind = () => {}; - let preventListenUpdate = false; - - if (query) { - ({ data, records, partial } = client.read(query, variables)); - - unbind = client.listen((nextRecords) => { - if (preventListenUpdate) { - preventListenUpdate = false; - return; - } - - records = records || {}; - - for (let i in nextRecords) { - // record has been inserted - if (!(i in records)) return getUpdateFromClient(); - - for (let j in nextRecords[i]) { - // record has been updated - if (nextRecords[i][j] !== records[i][j]) return getUpdateFromClient(); - } - } - - for (let i in records) { - // record has been removed - if (!(i in nextRecords)) return getUpdateFromClient(); - } - }); - } - - if (mutations) { - for (let key in mutations) { - let { update, optimisticUpdate, query: mutationQuery } = mutations[key]; - - boundMutations[key] = (mutationVariables) => { - if (query && optimisticUpdate) { - client.write(query, variables, optimisticUpdate(data, mutationVariables)); - } - - return client.execute(mutationQuery, mutationVariables).then((mutationResponse) => { - if (query && update && mutationResponse.data) { - client.write(query, variables, update(data, mutationResponse.data)); - } - - return mutationResponse; - }); - }; - } - } - - let state = { loaded: !!data && !partial, loading: false }; - - function getUpdateFromClient() { - ({ data, partial } = client.read(query, variables)); - Object.assign(state, { loaded: !!data && !partial }); - updater(getState()); - } - - function getState(): GrafooBoundState { - return Object.assign({}, state, boundMutations, data); - } - - function load(nextVariables?: CP["query"]["_variablesType"]) { - if (nextVariables) { - variables = nextVariables; - } - - if (!state.loading) { - Object.assign(state, { loading: true }); - updater(getState()); - } - - return client.execute(query, variables).then((res) => { - ({ data, errors } = res); - - if (data) { - preventListenUpdate = true; - client.write(query, variables, data); - } - - Object.assign(state, { loaded: !!data, loading: false }, errors && { errors }); - updater(getState()); - }); - } - - return { unbind, getState, load }; -} +export * from "./types"; +export { default } from "./bindings"; diff --git a/packages/bindings/src/types.ts b/packages/bindings/src/types.ts new file mode 100644 index 00000000..f21fa331 --- /dev/null +++ b/packages/bindings/src/types.ts @@ -0,0 +1,33 @@ +import { GraphQlError, GraphQlPayload, GrafooQuery } from "@grafoo/core"; + +export type GrafooBoundMutations> = { + [U in keyof T]: ( + variables: T[U]["_variablesType"] + ) => Promise>; +}; + +export type GrafooBoundState< + T extends GrafooQuery, + U extends Record +> = T["_queryType"] & + GrafooBoundMutations & { + loaded: boolean; + loading: boolean; + errors?: GraphQlError[]; + }; + +export type GrafooMutation = { + query: U; + update?: (props: T["_queryType"], data: U["_queryType"]) => T["_queryType"]; + optimisticUpdate?: (props: T["_queryType"], variables: U["_variablesType"]) => T["_queryType"]; +}; + +export type GrafooMutations> = { + [V in keyof U]: GrafooMutation; +}; + +export type GrafooConsumerProps> = { + query?: T; + variables?: T["_variablesType"]; + mutations?: GrafooMutations; +}; diff --git a/packages/bundle/package.json b/packages/bundle/package.json index 72b8616b..9b771868 100644 --- a/packages/bundle/package.json +++ b/packages/bundle/package.json @@ -10,7 +10,7 @@ "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-terser": "^7.0.2", "rollup-plugin-typescript2": "^0.30.0", - "typescript": "^4.1.2" + "typescript": "^4.4.4" }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" } diff --git a/packages/core/__tests__/index.ts b/packages/core/__tests__/index.ts index d967d05d..e5a11197 100644 --- a/packages/core/__tests__/index.ts +++ b/packages/core/__tests__/index.ts @@ -169,8 +169,8 @@ describe("@grafoo/core", () => { client.write(POSTS_AND_AUTHORS, data as any); - expect(client.read(POSTS).data).toEqual(data); - expect(client.read(AUTHORS).data).toEqual({ authors: {} }); + expect(client.read(POSTS)).toMatchObject({ data, partial: false }); + expect(client.read(AUTHORS)).toEqual({ data: {}, records: {}, partial: true }); }); it("should read queries from the client", async () => { @@ -193,7 +193,7 @@ describe("@grafoo/core", () => { client.write(POST, variables, data); - expect(client.read(POST, { postId: "123" }).data).toEqual({ post: {} }); + expect(client.read(POST, { postId: "123" }).data).toEqual({}); expect(client.read(POST, variables).data.post.id).toBe(variables.postId); }); @@ -221,27 +221,6 @@ describe("@grafoo/core", () => { expect(client.read(POSTS_AND_AUTHORS).partial).toBe(true); }); - it.skip("should remove unused records from state records", async () => { - let { data } = await client.execute(SIMPLE_AUTHORS); - - client.write(SIMPLE_AUTHORS, data); - - let authorToBeRemoved = data.authors[0]; - - let ids = Object.keys(client.flush().records); - - expect(ids.some((id) => id === authorToBeRemoved.id)).toBe(true); - - client.write(SIMPLE_AUTHORS, { - authors: data.authors.filter((author) => author.id !== authorToBeRemoved.id) - }); - - let nextIds = Object.keys(client.flush().records); - - expect(nextIds.length).toBe(ids.length - 1); - expect(nextIds.some((id) => id === authorToBeRemoved.id)).toBe(false); - }); - it("should perform update to client", async () => { let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; let { data } = await client.execute(POST, variables); diff --git a/packages/core/__tests__/resolve-values.ts b/packages/core/__tests__/resolve-values.ts index da01981c..31177912 100644 --- a/packages/core/__tests__/resolve-values.ts +++ b/packages/core/__tests__/resolve-values.ts @@ -128,4 +128,52 @@ describe("resolveValues", () => { expect(data).toEqual(authorWithArguments.data); expect(records).toEqual(authorWithArguments.records); }); + + it("should yield empty objects for data and records if no paths are given", () => { + let query = graphql` + query { + authors { + name + } + } + `; + + let { data, records, partial } = resolveValues(query, {}, {}, {}); + + expect(data).toEqual({}); + expect(records).toEqual({}); + expect(partial).toEqual(true); + }); + + it("should be able to resolve values partially", () => { + let query = graphql` + query { + posts { + title + body + author { + name + } + } + + authors { + name + posts { + title + body + } + } + } + `; + + let { data, partial } = resolveValues( + query, + {}, + { authors: postsAndAuthors.path.authors }, + postsAndAuthors.records + ); + + expect(data).toEqual({ authors: postsAndAuthors.data.authors }); + expect(partial).toEqual(true); + }); }); diff --git a/packages/core/__tests__/store-values.ts b/packages/core/__tests__/store-values.ts index ec6a55d5..bb4bf8a6 100644 --- a/packages/core/__tests__/store-values.ts +++ b/packages/core/__tests__/store-values.ts @@ -7,7 +7,7 @@ import * as authorWithArguments from "./data/author-with-arguments"; let idFields = ["id"]; describe("storeValues", () => { - test("should yield correct path and records to a normal query", () => { + it("should yield correct path and records to a normal query", () => { let query = graphql` query { posts { @@ -34,7 +34,7 @@ describe("storeValues", () => { expect(records).toEqual(postsAndAuthors.records); }); - test("should yield correct path and records to queries with fragments", () => { + it("should yield correct path and records to queries with fragments", () => { let query = graphql` query { posts { @@ -64,7 +64,7 @@ describe("storeValues", () => { expect(records).toEqual(postsWithFragments.records); }); - test("should yield correct path and records to queries with arguments", () => { + it("should yield correct path and records to queries with arguments", () => { let query = graphql` query ($id: ID!, $from: Int, $to: Int) { author(id: $id) { @@ -88,7 +88,7 @@ describe("storeValues", () => { expect(records).toEqual(authorWithArguments.records); }); - test("should yield correct path and records to queries with arguments and fragments", () => { + it("should yield correct path and records to queries with arguments and fragments", () => { let query = graphql` query ($id: ID!, $from: Int, $to: Int) { author(id: $id) { @@ -115,4 +115,34 @@ describe("storeValues", () => { expect(path).toEqual(authorWithArguments.path); expect(records).toEqual(authorWithArguments.records); }); + + it("should deal correctly with null values", () => { + let query = graphql` + query { + authors { + name + } + } + `; + + let data = { authors: postsAndAuthors.data.authors }; + data.authors[0].posts = null; + + let { path } = storeValues(query, {}, data, idFields); + + expect(path).toEqual({ + authors: [ + { id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", posts: null }, + { + id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", + posts: [ + { id: "9007748e-5e37-4f3a-8da2-b2041505a867" }, + { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682" }, + { id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae" }, + { id: "90b11972-305f-43f8-a6a8-ddad70d1459b" } + ] + } + ] + }); + }); }); diff --git a/packages/core/src/resolve-values.ts b/packages/core/src/resolve-values.ts index f1cabaa2..3adde8b7 100644 --- a/packages/core/src/resolve-values.ts +++ b/packages/core/src/resolve-values.ts @@ -11,40 +11,40 @@ export default function resolveValues( let records: GrafooRecords = {}; let partial = false; let stack: [string, GrafooSelection, GrafooPath, T["_queryType"]][] = [ - ["", operation, allPaths, data] + [, operation, allPaths, data] ]; while (stack.length) { let [name, select, path, data] = stack.shift(); - if (!path) { - partial = true; - continue; - } - if (Array.isArray(path)) { for (let [k, v] of Object.entries(path)) { - data[k] = Array.isArray(v) ? [] : {}; + data[k] = v !== null ? (Array.isArray(v) ? [] : {}) : null; stack.unshift([name, select, v, data[k]]); } } else { - let currentSelection = resolveSelection(select, fragments); + let currentSelect = resolveSelection(select, fragments); let { id } = path; - let record = allRecords[id as string]; + let record = allRecords[id]; if (id) { - records[id as string] = record; + records[id] = record; - for (let s of currentSelection.scalars) { + for (let s of currentSelect.scalars) { data[s] = record[s]; } } - for (let [k, v] of Object.entries(currentSelection.select)) { + for (let [k, v] of Object.entries(currentSelect.select)) { let pathId = getPathId(k, v.args, variables); + let newPath = path[pathId]; - data[k] = Array.isArray(path[pathId]) ? [] : {}; - stack.unshift([k, v, path[pathId], data[k]]); + if (newPath === undefined) { + partial = true; + } else { + data[k] = newPath !== null ? (Array.isArray(path[pathId]) ? [] : {}) : null; + if (newPath) stack.unshift([k, v, newPath, data[k]]); + } } } } diff --git a/packages/core/src/store-values.ts b/packages/core/src/store-values.ts index d992695e..100a6532 100644 --- a/packages/core/src/store-values.ts +++ b/packages/core/src/store-values.ts @@ -17,28 +17,33 @@ export default function storeValues( while (stack.length) { let [name, branch, select, path] = stack.shift(); let isListItem = isNaN(name as any); - let resolvedSelection = resolveSelection(isListItem ? select.select[name] : select, fragments); - let pathId = isListItem ? getPathId(name, resolvedSelection.args, variables) : name; + let currentSelect = resolveSelection(isListItem ? select.select[name] : select, fragments); + let pathId = isListItem ? getPathId(name, currentSelect.args, variables) : name; + + if (!branch) { + path[pathId] = null; + continue; + } if (Array.isArray(branch)) { path[pathId] = []; - } else { - let id = idFromBranch(branch, idFields); + } - if (id) { - records[id] = records[id] || {}; + let id = idFromBranch(branch, idFields); - for (let field of resolvedSelection.scalars) { - records[id][field] = branch[field]; - } + if (id) { + records[id] = records[id] || {}; - path[pathId] = { id }; + for (let field of currentSelect.scalars) { + records[id][field] = branch[field]; } + + path[pathId] = { id }; } for (let [k, v] of Object.entries(branch)) { if (typeof v === "object") { - stack.unshift([k, v, resolvedSelection, path[pathId] || path]); + stack.unshift([k, v, currentSelect, path[pathId] || path]); } } } diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index ac29c54b..52ad8ed3 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -24,7 +24,10 @@ export type GrafooInitialState = { paths: GrafooPath; }; -export type GrafooPath = ({ id?: string } | { [key: string]: GrafooPath }) | GrafooPath[]; +export type GrafooPath = + | { [U in keyof T]: U extends "id" ? string : GrafooPath } + | GrafooPath[] + | null; export type GrafooSelection = { args?: Record; diff --git a/packages/core/src/util.ts b/packages/core/src/util.ts index ccaff204..d62f2ed0 100644 --- a/packages/core/src/util.ts +++ b/packages/core/src/util.ts @@ -30,7 +30,7 @@ export function getPathId( } export function resolveSelection( - selection: GrafooSelection, + selection: GrafooSelection = {}, fragments: GrafooSelection ): GrafooSelection { let newArgs = selection.args ?? {}; diff --git a/packages/react/__tests__/index.tsx b/packages/react/__tests__/index.tsx index 7f8f76a9..e901f3b3 100644 --- a/packages/react/__tests__/index.tsx +++ b/packages/react/__tests__/index.tsx @@ -196,7 +196,7 @@ describe("@grafoo/react", () => { let author1 = authors[0]; let author2 = authors[1]; - await mockQueryRequest({ ...AUTHOR, variables: { id: author1.id } }); + await mockQueryRequest(AUTHOR, { id: author1.id }); let { result, rerender, waitForNextUpdate } = renderHook<{ id: string }, any>( ({ id }) => useGrafoo({ query: AUTHOR, variables: { id } }), { @@ -210,7 +210,7 @@ describe("@grafoo/react", () => { expect(result.current).toEqual({ loading: true, loaded: false }); await waitForNextUpdate(); expect(result.current).toEqual({ loading: false, loaded: true, author: author1 }); - await mockQueryRequest({ ...AUTHOR, variables: { id: author2.id } }); + await mockQueryRequest(AUTHOR, { id: author2.id }); rerender({ id: author2.id }); expect(result.current).toEqual({ loading: true, loaded: true, author: author1 }); await waitForNextUpdate(); @@ -232,7 +232,7 @@ describe("@grafoo/react", () => { it("should handle mutations", async () => { let variables = { name: "Bart" }; - let data = await mockQueryRequest({ ...CREATE_AUTHOR, variables }); + let data = await mockQueryRequest(CREATE_AUTHOR, variables); let { result } = renderHook( () => useGrafoo({ mutations: { createAuthor: { query: CREATE_AUTHOR } } }), { wrapper } @@ -271,7 +271,7 @@ describe("@grafoo/react", () => { expect(result.current).toMatchObject({ loading: false, loaded: true, ...data }); let variables = { name: "Homer" }; - await mockQueryRequest({ ...CREATE_AUTHOR, variables }); + await mockQueryRequest(CREATE_AUTHOR, variables); act(() => { result.current.createAuthor(variables); }); @@ -293,7 +293,7 @@ describe("@grafoo/react", () => { let { result } = renderHook(() => useGrafoo({ query: AUTHORS }), { wrapper }); - expect(result.current).toEqual({ loading: false, loaded: true, ...data }); + expect(result.current).toMatchObject({ loading: false, loaded: true, ...data }); act(() => { client.write(AUTHORS, { diff --git a/packages/test-utils/src/mock-server.ts b/packages/test-utils/src/mock-server.ts index 24c10941..f5eadd75 100644 --- a/packages/test-utils/src/mock-server.ts +++ b/packages/test-utils/src/mock-server.ts @@ -17,14 +17,14 @@ let Query = { }, authors(_, args) { let { authors } = db.data; - return authors.slice(args.from ?? 0, args.to ?? authors.length); + return authors?.slice(args.from ?? 0, args.to ?? authors.length) ?? null; }, post(_, args) { return db.data.posts.find((post) => post.id === args.id); }, posts(_, args) { let { posts } = db.data; - return posts.slice(args.from ?? 0, args.to ?? posts.length); + return posts?.slice(args.from ?? 0, args.to ?? posts.length) ?? null; } }; @@ -94,7 +94,7 @@ let Author = { ? author.posts.map((id) => db.data.posts.find((post) => post.id === id)) : null; - return posts.slice(args.from ?? 0, args.to ?? posts.length); + return posts?.slice(args.from ?? 0, args.to ?? posts.length) ?? null; } }; @@ -125,11 +125,14 @@ export function executeQuery({ query, variables }: ExecuteQueryArg): Promise< return graphql({ schema: schema, source: query, variableValues: variables }); } -export async function mockQueryRequest(request: ExecuteQueryArg): Promise> { +export async function mockQueryRequest( + query: { document: string }, + variables?: Record +): Promise> { fetchMock.reset(); fetchMock.restore(); - let response = await executeQuery(request); + let response = await executeQuery({ query: query.document, variables }); fetchMock.post("*", response); return response; diff --git a/yarn.lock b/yarn.lock index e79503ed..76db6c41 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8001,6 +8001,11 @@ typescript@^4.1.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324" integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA== +typescript@^4.4.4: + version "4.4.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c" + integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== + uglify-js@^3.1.4: version "3.14.2" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.14.2.tgz#d7dd6a46ca57214f54a2d0a43cad0f35db82ac99" From 51a7ea4c21fedcf451b13b5ecf0a1f5060559a86 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Thu, 21 Oct 2021 20:46:23 -0300 Subject: [PATCH 14/49] move compile logic to it's own package --- package.json | 3 +- .../__tests__/__snapshots__/index.js.snap | 119 ++++++++++++------ .../__tests__/compile-document.ts | 63 ---------- packages/babel-plugin/__tests__/index.js | 38 +++++- packages/babel-plugin/package.json | 7 +- packages/babel-plugin/src/compile-document.ts | 64 ---------- packages/babel-plugin/src/index.ts | 57 +++++++-- packages/compiler/.babelrc | 6 + .../__tests__/generate-client-resolvers.ts | 0 .../__tests__/insert-fields.ts | 0 packages/compiler/__tests__/schema.graphql | 63 ++++++++++ .../__tests__/sort-query.ts | 0 packages/compiler/package.json | 38 ++++++ .../src/generate-client-resolvers.ts | 0 packages/compiler/src/index.ts | 39 ++++++ .../src/insert-fields.ts | 0 .../src/sort-query.ts | 0 packages/compiler/tsconfig.json | 15 +++ packages/core/src/index.ts | 1 + packages/core/src/resolve-values.ts | 13 +- packages/core/src/store-values.ts | 9 +- packages/core/src/tag.ts | 11 ++ packages/core/src/types.ts | 2 +- packages/core/src/util.ts | 8 +- scripts/build.js | 2 +- yarn.lock | 37 +----- 26 files changed, 365 insertions(+), 230 deletions(-) delete mode 100644 packages/babel-plugin/__tests__/compile-document.ts delete mode 100644 packages/babel-plugin/src/compile-document.ts create mode 100644 packages/compiler/.babelrc rename packages/{babel-plugin => compiler}/__tests__/generate-client-resolvers.ts (100%) rename packages/{babel-plugin => compiler}/__tests__/insert-fields.ts (100%) create mode 100644 packages/compiler/__tests__/schema.graphql rename packages/{babel-plugin => compiler}/__tests__/sort-query.ts (100%) create mode 100644 packages/compiler/package.json rename packages/{babel-plugin => compiler}/src/generate-client-resolvers.ts (100%) create mode 100644 packages/compiler/src/index.ts rename packages/{babel-plugin => compiler}/src/insert-fields.ts (100%) rename packages/{babel-plugin => compiler}/src/sort-query.ts (100%) create mode 100644 packages/compiler/tsconfig.json create mode 100644 packages/core/src/tag.ts diff --git a/package.json b/package.json index 9f142ff7..771ac71b 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "devDependencies": { "@babel/cli": "^7.0.0", "@babel/core": "^7.0.0", + "@babel/parser": "^7.15.8", "@babel/preset-env": "^7.0.0", "@babel/preset-react": "^7.0.0", "@babel/preset-typescript": "^7.0.0", @@ -73,6 +74,7 @@ "@testing-library/preact": "^2.0.1", "@testing-library/preact-hooks": "^1.1.0", "@testing-library/react-hooks": "^7.0.2", + "@types/crypto-js": "^4.0.2", "@types/jest": "^27.0.2", "@types/node": "^16.10.2", "@types/node-fetch": "^3.0.3", @@ -95,7 +97,6 @@ "lowdb": "^3.0.0", "node-fetch": "^3.0.0", "preact": "^10.5.14", - "preact-render-spy": "^1.3.0", "prettier": "^2.2.1", "react": "^17.0.2", "react-test-renderer": "^17.0.2", diff --git a/packages/babel-plugin/__tests__/__snapshots__/index.js.snap b/packages/babel-plugin/__tests__/__snapshots__/index.js.snap index fa60069f..fe281714 100644 --- a/packages/babel-plugin/__tests__/__snapshots__/index.js.snap +++ b/packages/babel-plugin/__tests__/__snapshots__/index.js.snap @@ -1,54 +1,37 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`@grafoo/babel-plugin should compress the query string if the option compress is specified: should compress the query string if the option compress is specified 1`] = ` +exports[`@grafoo/babel-plugin should be able to use named import gql from @grafoo/core: should be able to use named import gql from @grafoo/core 1`] = ` -import gql from "@grafoo/core/tag"; +import { gql } from "@grafoo/core"; +let query = gql\`{ authors {name} }\`; + + ↓ ↓ ↓ ↓ ↓ ↓ + +import { gql } from "@grafoo/core"; let query = gql\` - query($start: Int!, $offset: Int!, $id: ID!) { - posts(start: $start, offset: $offset) { - title - body - createdAt - tags { name } - authors { name username } + { + authors { + name } - user(id: $id) { name username } } \`; + +`; + +exports[`@grafoo/babel-plugin should be able to use named import graphql from @grafoo/core: should be able to use named import graphql from @grafoo/core 1`] = ` + +import { graphql } from "@grafoo/core"; +let query = graphql\`{ authors {name} }\`; + ↓ ↓ ↓ ↓ ↓ ↓ let query = { - document: - "query($id:ID!,$offset:Int!,$start:Int!){posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}user(id:$id){id name username}}", + document: "{authors{id name}}", operation: { select: { - posts: { - args: { - offset: "$offset", - start: "$start" - }, - select: { - authors: { - scalars: ["id", "name"], - select: { - username: {} - } - }, - tags: { - scalars: ["id", "name"] - } - }, - scalars: ["body", "createdAt", "id", "title"] - }, - user: { - args: { - id: "$id" - }, - scalars: ["id", "username"], - select: { - name: {} - } + authors: { + scalars: ["id", "name"] } } }, @@ -186,6 +169,66 @@ let options = { let query = createClient(someTransport, options); +`; + +exports[`@grafoo/babel-plugin should not compress a query if the option compress is specified: should not compress a query if the option compress is specified 1`] = ` + +import gql from "@grafoo/core/tag"; +let query = gql\` + query($start: Int!, $offset: Int!, $id: ID!) { + posts(start: $start, offset: $offset) { + title + body + createdAt + tags { name } + authors { name username } + } + user(id: $id) { name username } + } +\`; + + ↓ ↓ ↓ ↓ ↓ ↓ + +let query = { + document: + "query ($id: ID!, $offset: Int!, $start: Int!) {\\n posts(offset: $offset, start: $start) {\\n authors {\\n id\\n name\\n username\\n }\\n body\\n createdAt\\n id\\n tags {\\n id\\n name\\n }\\n title\\n }\\n user(id: $id) {\\n id\\n name\\n username\\n }\\n}\\n", + operation: { + select: { + posts: { + args: { + offset: "$offset", + start: "$start" + }, + select: { + authors: { + scalars: ["id", "name"], + select: { + username: {} + } + }, + tags: { + scalars: ["id", "name"] + } + }, + scalars: ["body", "createdAt", "id", "title"] + }, + user: { + args: { + id: "$id" + }, + scalars: ["id", "username"], + select: { + name: {} + } + } + } + }, + fragments: { + select: {} + } +}; + + `; exports[`@grafoo/babel-plugin should not generate md5 hash and add it to object if the option generateIds is falsey: should not generate md5 hash and add it to object if the option generateIds is falsey 1`] = ` diff --git a/packages/babel-plugin/__tests__/compile-document.ts b/packages/babel-plugin/__tests__/compile-document.ts deleted file mode 100644 index 394d1f0e..00000000 --- a/packages/babel-plugin/__tests__/compile-document.ts +++ /dev/null @@ -1,63 +0,0 @@ -import * as babel from "@babel/core"; -import plugin, { Options } from "../src"; - -let transform = (program: string, opts?: Options) => - babel.transform(program, { - plugins: [ - [plugin, Object.assign({ schema: "__tests__/schema.graphql", idFields: ["id"] }, opts)] - ] - }); - -describe("compile document", () => { - it("should throw if a schema path points to a inexistent file", () => { - let program = ` - import gql from "@grafoo/core/tag"; - let query = gql\`{ hello }\`; - `; - - expect(() => transform(program, { schema: "?" })).toThrow(); - }); - - it("should accept fragments", () => { - let program = ` - import gql from "@grafoo/core/tag"; - let query = gql\` - fragment UserInfo on User { - name - bio - } - \`; - `; - - expect(() => transform(program)).not.toThrow(); - }); - - it("should accept named queries", () => { - let program = ` - import gql from "@grafoo/core/tag"; - let query = gql\` - query NamedQuery { - me { id } - } - \`; - `; - - expect(() => transform(program)).not.toThrow(); - }); - - it("should accept named queries with arguments", () => { - let program = ` - import gql from "@grafoo/core/tag"; - let query = gql\` - query NamedQuery($var: ID!) { - post(id: $var) { - id - title - } - } - \`; - `; - - expect(() => transform(program)).not.toThrow(); - }); -}); diff --git a/packages/babel-plugin/__tests__/index.js b/packages/babel-plugin/__tests__/index.js index c85f4b71..a73887d6 100644 --- a/packages/babel-plugin/__tests__/index.js +++ b/packages/babel-plugin/__tests__/index.js @@ -9,10 +9,6 @@ pluginTester({ idFields: ["id"] }, tests: { - "should throw if a import is not default": { - code: 'import { gql } from "@grafoo/core/tag";', - error: true - }, "should throw if a schema is not present on the root directory": { pluginOptions: { idFields: ["id"] @@ -23,6 +19,10 @@ pluginTester({ `, error: true }, + "should throw if a import is not default": { + code: 'import { gql } from "@grafoo/core/tag";', + error: true + }, "should throw if a tagged template string literal has expressions in it": { code: ` import gql from "@grafoo/core/tag"; @@ -63,6 +63,10 @@ pluginTester({ error: true }, "should replace a tagged template literal with the compiled grafoo object": { + pluginOptions: { + schema: "__tests__/schema.graphql", + idFields: ["id"] + }, code: ` import gql from "@grafoo/core/tag"; let query = gql\` @@ -80,11 +84,11 @@ pluginTester({ `, snapshot: true }, - "should compress the query string if the option compress is specified": { + "should not compress a query if the option compress is specified": { pluginOptions: { schema: "__tests__/schema.graphql", idFields: ["id"], - compress: true + compress: false }, code: ` import gql from "@grafoo/core/tag"; @@ -194,6 +198,28 @@ pluginTester({ }); `, snapshot: true + }, + "should be able to use named import graphql from @grafoo/core": { + pluginOptions: { + schema: "__tests__/schema.graphql", + idFields: ["id"] + }, + code: ` + import { graphql } from "@grafoo/core"; + let query = graphql\`{ authors {name} }\`; + `, + snapshot: true + }, + "should be able to use named import gql from @grafoo/core": { + pluginOptions: { + schema: "__tests__/schema.graphql", + idFields: ["id"] + }, + code: ` + import { gql } from "@grafoo/core"; + let query = gql\`{ authors {name} }\`; + `, + snapshot: true } } }); diff --git a/packages/babel-plugin/package.json b/packages/babel-plugin/package.json index dbaad5a5..bdb6abe0 100644 --- a/packages/babel-plugin/package.json +++ b/packages/babel-plugin/package.json @@ -17,7 +17,7 @@ "access": "public" }, "scripts": { - "build": "tsc", + "build": "tsc --declaration", "test": "jest", "test:coverage": "jest --coverage" }, @@ -31,10 +31,7 @@ ] }, "dependencies": { - "@babel/parser": "^7.15.8", - "crypto-js": "^4.0.0", - "graphql": "^15.6.1", - "graphql-query-compress": "^1.0.0" + "@grafoo/compiler": "^1.4.1" }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" } diff --git a/packages/babel-plugin/src/compile-document.ts b/packages/babel-plugin/src/compile-document.ts deleted file mode 100644 index f81b08a3..00000000 --- a/packages/babel-plugin/src/compile-document.ts +++ /dev/null @@ -1,64 +0,0 @@ -import * as fs from "fs"; -import * as path from "path"; -import { DocumentNode, buildASTSchema, parse, print, getOperationAST } from "graphql"; -import compress from "graphql-query-compress"; -import md5Hash from "crypto-js/md5"; -import { GrafooQuery } from "@grafoo/core"; - -import insertFields from "./insert-fields"; -import sortDocument from "./sort-query"; -import { Options } from "."; -import generateClientResolver from "./generate-client-resolvers"; - -let schema: string; -function getSchema(schemaPath: string) { - if (schema) return schema; - - let fullPath: string; - - if (!schemaPath) { - let schemaJson = path.join(process.cwd(), "schema.json"); - let schemaGraphql = path.join(process.cwd(), "schema.graphql"); - let schemaGql = path.join(process.cwd(), "schema.gql"); - - fullPath = fs.existsSync(schemaJson) - ? schemaJson - : fs.existsSync(schemaGraphql) - ? schemaGraphql - : fs.existsSync(schemaGql) - ? schemaGql - : undefined; - } else { - fullPath = path.join(process.cwd(), schemaPath); - } - - // @ts-ignore - fs.accessSync(fullPath, fs.F_OK); - - schema = fs.readFileSync(fullPath, "utf-8"); - - return schema; -} - -export default function compileDocument(source: string, opts: Options) { - let schemaString = getSchema(opts.schema); - let schema = buildASTSchema(parse(schemaString)); - let document = sortDocument(insertFields(schema, parse(source), opts.idFields)) as DocumentNode; - let operation = getOperationAST(document); - let fragments: DocumentNode = { - ...document, - definitions: document.definitions.filter((d) => d.kind === "FragmentDefinition") - }; - let compressedDocument = compress(print(document)); - let grafooQuery: GrafooQuery = { - document: compressedDocument, - operation: generateClientResolver(schema, operation), - fragments: generateClientResolver(schema, fragments) - }; - - if (opts.generateIds) { - grafooQuery.id = md5Hash(compressedDocument).toString(); - } - - return JSON.stringify(grafooQuery); -} diff --git a/packages/babel-plugin/src/index.ts b/packages/babel-plugin/src/index.ts index 8310f846..15cd643f 100644 --- a/packages/babel-plugin/src/index.ts +++ b/packages/babel-plugin/src/index.ts @@ -1,27 +1,52 @@ +import * as fs from "fs"; +import * as path from "path"; import type * as BabelCoreNamespace from "@babel/core"; import type { PluginObj } from "@babel/core"; import { parseExpression } from "@babel/parser"; - -import compileDocument from "./compile-document"; +import compileDocument, { Options } from "@grafoo/compiler"; type Babel = typeof BabelCoreNamespace; -export type Options = { - schema: string; - compress?: boolean; - generateIds?: boolean; - idFields?: string[]; -}; +let schema: string; +function getSchema(schemaPath: string) { + if (schema) return schema; + + let fullPath: string; + + if (!schemaPath) { + let schemaJson = path.join(process.cwd(), "schema.json"); + let schemaGraphql = path.join(process.cwd(), "schema.graphql"); + let schemaGql = path.join(process.cwd(), "schema.gql"); + + fullPath = fs.existsSync(schemaJson) + ? schemaJson + : fs.existsSync(schemaGraphql) + ? schemaGraphql + : fs.existsSync(schemaGql) + ? schemaGql + : undefined; + } else { + fullPath = path.join(process.cwd(), schemaPath); + } + + // @ts-ignore + fs.accessSync(fullPath, fs.F_OK); + + schema = fs.readFileSync(fullPath, "utf-8"); + + return schema; +} export default function transform({ types: t }: Babel): PluginObj<{ opts: Options }> { return { visitor: { Program(programPath, { opts }) { + let schemaString = getSchema(opts.schema); let tagIdentifiers = []; let clientFactoryIdentifiers = []; if (typeof opts.compress !== "boolean") { - opts.compress = process.env.NODE_ENV === "production"; + opts.compress = true; } if (typeof opts.generateIds !== "boolean") { @@ -47,9 +72,19 @@ export default function transform({ types: t }: Babel): PluginObj<{ opts: Option if (source.value === "@grafoo/core") { let defaultSpecifier = specifiers.find((s) => t.isImportDefaultSpecifier(s)); + let gqlTag = specifiers.find((s) => s.local.name === "graphql"); + if (defaultSpecifier) { clientFactoryIdentifiers.push(defaultSpecifier.local.name); } + + if (gqlTag) { + tagIdentifiers.push(gqlTag.local.name); + + if (specifiers.length === 1) { + path.remove(); + } + } } if (source.value === "@grafoo/core/tag") { @@ -141,8 +176,8 @@ export default function transform({ types: t }: Babel): PluginObj<{ opts: Option try { let source = quasi.node.quasis.reduce((src, q) => src + q.value.raw, ""); - let document = compileDocument(source, opts); - path.replaceWith(parseExpression(document)); + let query = compileDocument(source, schemaString, opts); + path.replaceWith(parseExpression(query)); } catch (error) { if (error.code === "ENOENT") { throw new Error( diff --git a/packages/compiler/.babelrc b/packages/compiler/.babelrc new file mode 100644 index 00000000..6e63b6e0 --- /dev/null +++ b/packages/compiler/.babelrc @@ -0,0 +1,6 @@ +{ + "presets": [ + ["@babel/preset-env", { "targets": { "node": "current" } }], + "@babel/preset-typescript" + ] +} diff --git a/packages/babel-plugin/__tests__/generate-client-resolvers.ts b/packages/compiler/__tests__/generate-client-resolvers.ts similarity index 100% rename from packages/babel-plugin/__tests__/generate-client-resolvers.ts rename to packages/compiler/__tests__/generate-client-resolvers.ts diff --git a/packages/babel-plugin/__tests__/insert-fields.ts b/packages/compiler/__tests__/insert-fields.ts similarity index 100% rename from packages/babel-plugin/__tests__/insert-fields.ts rename to packages/compiler/__tests__/insert-fields.ts diff --git a/packages/compiler/__tests__/schema.graphql b/packages/compiler/__tests__/schema.graphql new file mode 100644 index 00000000..55365803 --- /dev/null +++ b/packages/compiler/__tests__/schema.graphql @@ -0,0 +1,63 @@ +type Post { + id: ID! + title: String! + slug: String! + body: String! + published: Boolean! + createdAt: String! + updateAt: String! + authors: [Author!]! + author: Author! + tags: [Tag!]! +} + +union Viewer = Visitor | User + +type Tag { + id: ID! + name: String! + posts: [Post!]! + createdAt: String! + updateAt: String! +} + +interface User { + id: ID! + username: String! + email: String! + createdAt: String! + updatedAt: String! +} + +type Author implements User { + id: ID! + name: String + bio: String + posts: [Post!]! +} + +type Visitor { + id: ID! + ip: String! +} + +type Mutation { + createPost(title: String!, body: String!, authors: [ID!]!, tags: [String!]): Post + deletePost(id: ID): Post + createTag(name: String!): Tag + register(username: String!, email: String!, password: String!): User + login(email: String!, password: String!): String + updateUser(username: String, name: String, bio: String, email: String, password: String): User +} + +type Query { + author(id: ID!): Author + authors(start: Int!, offset: Int!): [Author] + posts(start: Int!, offset: Int!): [Post] + post(id: ID!): Post + tag(id: ID!): Tag + users(start: Int!, offset: Int!): [User] + user(id: ID!): User + me: User + viewer: Viewer +} diff --git a/packages/babel-plugin/__tests__/sort-query.ts b/packages/compiler/__tests__/sort-query.ts similarity index 100% rename from packages/babel-plugin/__tests__/sort-query.ts rename to packages/compiler/__tests__/sort-query.ts diff --git a/packages/compiler/package.json b/packages/compiler/package.json new file mode 100644 index 00000000..d7985e1a --- /dev/null +++ b/packages/compiler/package.json @@ -0,0 +1,38 @@ +{ + "name": "@grafoo/compiler", + "version": "1.4.1", + "description": "grafoo client babel plugin", + "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/babel-plugin", + "main": "dist/index.js", + "author": "malbernaz", + "license": "MIT", + "keywords": [ + "graphql", + "graphql-client", + "grafoo", + "compiler" + ], + "publishConfig": { + "access": "public" + }, + "scripts": { + "build": "tsc --declaration", + "test": "jest", + "test:coverage": "jest --coverage" + }, + "jest": { + "transform": { + "^.+\\.(ts|tsx|js)$": "/../../scripts/jest-setup.js" + }, + "resolver": "/../../scripts/resolver.js", + "transformIgnorePatterns": [ + "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob)/)" + ] + }, + "dependencies": { + "crypto-js": "^4.0.0", + "graphql": "^15.6.1", + "graphql-query-compress": "^1.0.0" + }, + "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" +} diff --git a/packages/babel-plugin/src/generate-client-resolvers.ts b/packages/compiler/src/generate-client-resolvers.ts similarity index 100% rename from packages/babel-plugin/src/generate-client-resolvers.ts rename to packages/compiler/src/generate-client-resolvers.ts diff --git a/packages/compiler/src/index.ts b/packages/compiler/src/index.ts new file mode 100644 index 00000000..0edebed5 --- /dev/null +++ b/packages/compiler/src/index.ts @@ -0,0 +1,39 @@ +import { DocumentNode, buildASTSchema, parse, print, getOperationAST } from "graphql"; +import compress from "graphql-query-compress"; +import md5Hash from "crypto-js/md5"; +import { GrafooQuery } from "@grafoo/core"; + +import insertFields from "./insert-fields"; +import sortDocument from "./sort-query"; +import generateClientResolver from "./generate-client-resolvers"; + +export type Options = { + schema: string; + compress?: boolean; + generateIds?: boolean; + idFields?: string[]; +}; + +export default function compileDocument(source: string, schemaString: string, opts: Options) { + let schema = buildASTSchema(parse(schemaString)); + let document = sortDocument(insertFields(schema, parse(source), opts.idFields)) as DocumentNode; + let operation = getOperationAST(document); + let fragments = { + ...document, + definitions: document.definitions.filter((d) => d.kind === "FragmentDefinition") + }; + let documentStr = print(document); + let compressedDocumentStr = compress(documentStr); + + let grafooQuery: GrafooQuery = { + document: opts.compress ? compressedDocumentStr : documentStr, + operation: generateClientResolver(schema, operation), + fragments: generateClientResolver(schema, fragments) + }; + + if (opts.generateIds) { + grafooQuery.id = md5Hash(compressedDocumentStr).toString(); + } + + return JSON.stringify(grafooQuery); +} diff --git a/packages/babel-plugin/src/insert-fields.ts b/packages/compiler/src/insert-fields.ts similarity index 100% rename from packages/babel-plugin/src/insert-fields.ts rename to packages/compiler/src/insert-fields.ts diff --git a/packages/babel-plugin/src/sort-query.ts b/packages/compiler/src/sort-query.ts similarity index 100% rename from packages/babel-plugin/src/sort-query.ts rename to packages/compiler/src/sort-query.ts diff --git a/packages/compiler/tsconfig.json b/packages/compiler/tsconfig.json new file mode 100644 index 00000000..aa4e1c88 --- /dev/null +++ b/packages/compiler/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "moduleResolution": "node", + "strict": false, + "lib": ["esnext", "dom"], + "noUnusedLocals": true, + "noUnusedParameters": true, + "checkJs": false, + "downlevelIteration": true, + "esModuleInterop": true, + "outDir": "./dist", + "module": "commonjs" + }, + "include": ["src"] +} diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 336b9279..cd4ce4ed 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,2 +1,3 @@ export * from "./types"; +export * from "./tag"; export { default } from "./client"; diff --git a/packages/core/src/resolve-values.ts b/packages/core/src/resolve-values.ts index 3adde8b7..50963553 100644 --- a/packages/core/src/resolve-values.ts +++ b/packages/core/src/resolve-values.ts @@ -1,5 +1,5 @@ import { GrafooPath, GrafooQuery, GrafooRecords, GrafooSelection } from "./types"; -import { getPathId, resolveSelection } from "./util"; +import { getPathId, getPathType, resolveSelection } from "./util"; export default function resolveValues( { operation, fragments }: T, @@ -14,12 +14,16 @@ export default function resolveValues( [, operation, allPaths, data] ]; + // traverse trough operation selection while (stack.length) { let [name, select, path, data] = stack.shift(); if (Array.isArray(path)) { + // if path is a list increment the stack with + // the current selection and the path list children for (let [k, v] of Object.entries(path)) { - data[k] = v !== null ? (Array.isArray(v) ? [] : {}) : null; + // assign data type to data key given the path type + data[k] = getPathType(v); stack.unshift([name, select, v, data[k]]); } } else { @@ -30,6 +34,7 @@ export default function resolveValues( if (id) { records[id] = record; + // get scalars from client records for (let s of currentSelect.scalars) { data[s] = record[s]; } @@ -39,10 +44,12 @@ export default function resolveValues( let pathId = getPathId(k, v.args, variables); let newPath = path[pathId]; + // skip selection if path is undefined if (newPath === undefined) { partial = true; } else { - data[k] = newPath !== null ? (Array.isArray(path[pathId]) ? [] : {}) : null; + // assign data type to data key given the path type + data[k] = getPathType(newPath); if (newPath) stack.unshift([k, v, newPath, data[k]]); } } diff --git a/packages/core/src/store-values.ts b/packages/core/src/store-values.ts index 100a6532..f0ad6506 100644 --- a/packages/core/src/store-values.ts +++ b/packages/core/src/store-values.ts @@ -10,16 +10,16 @@ export default function storeValues( let { operation, fragments } = query; let path: GrafooPath = {}; let records: GrafooRecords = {}; - let stack: [string, T["_queryType"], GrafooSelection, GrafooPath][] = [ - ["", tree, operation, path] - ]; + let stack: [string, T["_queryType"], GrafooSelection, GrafooPath][] = [[, tree, operation, path]]; + // traverse data tree while (stack.length) { let [name, branch, select, path] = stack.shift(); let isListItem = isNaN(name as any); let currentSelect = resolveSelection(isListItem ? select.select[name] : select, fragments); let pathId = isListItem ? getPathId(name, currentSelect.args, variables) : name; + // skip if a branch is null or undefined if (!branch) { path[pathId] = null; continue; @@ -34,13 +34,16 @@ export default function storeValues( if (id) { records[id] = records[id] || {}; + // create record with branch scalar values for (let field of currentSelect.scalars) { records[id][field] = branch[field]; } + // increment path with id pointing to a record path[pathId] = { id }; } + // look for new branches and increment stack for (let [k, v] of Object.entries(branch)) { if (typeof v === "object") { stack.unshift([k, v, currentSelect, path[pathId] || path]); diff --git a/packages/core/src/tag.ts b/packages/core/src/tag.ts new file mode 100644 index 00000000..2ef18fb4 --- /dev/null +++ b/packages/core/src/tag.ts @@ -0,0 +1,11 @@ +/* eslint-disable */ + +import { GrafooQuery } from "./types"; + +export declare function graphql( + strs: TemplateStringsArray +): GrafooQuery; + +export declare function gql( + strs: TemplateStringsArray +): GrafooQuery; diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 52ad8ed3..26a4d2c5 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -25,7 +25,7 @@ export type GrafooInitialState = { }; export type GrafooPath = - | { [U in keyof T]: U extends "id" ? string : GrafooPath } + | { [U in keyof T]?: U extends "id" ? string : GrafooPath } | GrafooPath[] | null; diff --git a/packages/core/src/util.ts b/packages/core/src/util.ts index d62f2ed0..ffb38969 100644 --- a/packages/core/src/util.ts +++ b/packages/core/src/util.ts @@ -1,4 +1,4 @@ -import { GrafooQuery, GrafooSelection } from "./types"; +import { GrafooPath, GrafooQuery, GrafooSelection } from "./types"; export let idFromBranch = (branch: T, idFields: string[]) => branch @@ -8,8 +8,6 @@ export let idFromBranch = (branch: T, idFields: string[]) => .join(":") : ""; -export let isNotNullObject = (obj: unknown) => obj && typeof obj === "object"; - export function getPathId( path: string, args: Record = {}, @@ -54,3 +52,7 @@ export function resolveSelection( fragments: [...new Set(newFragments)] }; } + +export function getPathType(path: GrafooPath) { + return path ? (Array.isArray(path) ? [] : {}) : null; +} diff --git a/scripts/build.js b/scripts/build.js index fd0ee243..6bad0963 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -4,7 +4,7 @@ let { exec } = require("child_process"); let pkgsRoot = join(__dirname, "..", "packages"); -let withDeps = ["react"]; +let withDeps = ["react", "core"]; let noDeps = readdirSync(pkgsRoot).filter((x) => !withDeps.some((y) => y === x)); let command = exec( diff --git a/yarn.lock b/yarn.lock index 76db6c41..a5975f2a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2248,6 +2248,11 @@ dependencies: "@babel/types" "^7.3.0" +"@types/crypto-js@^4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@types/crypto-js/-/crypto-js-4.0.2.tgz#4524325a175bf819fec6e42560c389ce1fb92c97" + integrity sha512-sCVniU+h3GcGqxOmng11BRvf9TfN9yIs8KKjB8C8d75W69cpTfZG80gau9yTx5SxF3gvHGbJhdESzzvnjtf3Og== + "@types/graceful-fs@^4.1.2": version "4.1.5" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" @@ -3668,7 +3673,7 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.18.0-next.2, es-abstract@^1.19.1: +es-abstract@^1.18.0-next.2: version "1.19.1" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== @@ -6297,15 +6302,6 @@ object.assign@^4.1.0, object.assign@^4.1.2: has-symbols "^1.0.1" object-keys "^1.1.1" -object.entries@^1.0.4: - version "1.1.5" - resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861" - integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" - object.getownpropertydescriptors@^2.0.3: version "2.1.2" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz#1bd63aeacf0d5d2d2f31b5e393b03a7c601a23f7" @@ -6640,22 +6636,6 @@ please-upgrade-node@^3.2.0: dependencies: semver-compare "^1.0.0" -preact-render-spy@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/preact-render-spy/-/preact-render-spy-1.3.0.tgz#f64b83f4de33d9696e69e5b08c4ae5e29decd6d1" - integrity sha512-6gdi9mCMlhNPv4JRoQNSKu2kEbhStfJT/bN+n3gb/NwGKNmFg9q8eac9qFTSCswsOWmkdDk2WJiUoHZImIPSyA== - dependencies: - lodash.isequal "^4.5.0" - object.entries "^1.0.4" - preact-render-to-string "^3.6.3" - -preact-render-to-string@^3.6.3: - version "3.8.2" - resolved "https://registry.yarnpkg.com/preact-render-to-string/-/preact-render-to-string-3.8.2.tgz#bd72964d705a57da3a9e72098acaa073dd3ceff9" - integrity sha512-przuZPajiurStGgxMoJP0EJeC4xj5CgHv+M7GfF3YxAdhGgEWAkhOSE0xympAFN20uMayntBZpttIZqqLl77fw== - dependencies: - pretty-format "^3.5.1" - preact@^10.5.14: version "10.5.14" resolved "https://registry.yarnpkg.com/preact/-/preact-10.5.14.tgz#0b14a2eefba3c10a57116b90d1a65f5f00cd2701" @@ -6696,11 +6676,6 @@ pretty-format@^27.0.0, pretty-format@^27.2.4: ansi-styles "^5.0.0" react-is "^17.0.1" -pretty-format@^3.5.1: - version "3.8.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-3.8.0.tgz#bfbed56d5e9a776645f4b1ff7aa1a3ac4fa3c385" - integrity sha1-v77VbV6ad2ZF9LH/eqGjrE+jw4U= - process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" From df61cc28326d42c95c57f70e2a5a6ccd7ceb5479 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Thu, 21 Oct 2021 20:50:41 -0300 Subject: [PATCH 15/49] help ci --- packages/babel-plugin/package.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/babel-plugin/package.json b/packages/babel-plugin/package.json index bdb6abe0..c7772cf1 100644 --- a/packages/babel-plugin/package.json +++ b/packages/babel-plugin/package.json @@ -30,8 +30,5 @@ "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob)/)" ] }, - "dependencies": { - "@grafoo/compiler": "^1.4.1" - }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" } From 4792e81a375a9798e1bfc7c3f4dc4767996415f9 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Thu, 21 Oct 2021 20:53:01 -0300 Subject: [PATCH 16/49] ci didn't work --- packages/babel-plugin/package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/babel-plugin/package.json b/packages/babel-plugin/package.json index c7772cf1..bdb6abe0 100644 --- a/packages/babel-plugin/package.json +++ b/packages/babel-plugin/package.json @@ -30,5 +30,8 @@ "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob)/)" ] }, + "dependencies": { + "@grafoo/compiler": "^1.4.1" + }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" } From 3a1afa190a6b3903850ef7ed2e62944583355c2b Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Thu, 21 Oct 2021 20:59:24 -0300 Subject: [PATCH 17/49] chore(release): publish v1.4.2-next.0 --- lerna.json | 6 ++++-- packages/babel-plugin/package.json | 4 ++-- packages/bindings/package.json | 4 ++-- packages/bundle/package.json | 2 +- packages/compiler/package.json | 2 +- packages/core/package.json | 6 ++++-- packages/react/package.json | 6 +++--- packages/test-utils/package.json | 2 +- 8 files changed, 18 insertions(+), 14 deletions(-) diff --git a/lerna.json b/lerna.json index 7eca74c6..8cbadeb7 100644 --- a/lerna.json +++ b/lerna.json @@ -1,8 +1,10 @@ { - "packages": ["packages/*"], + "packages": [ + "packages/*" + ], "npmClient": "yarn", "useWorkspaces": true, - "version": "1.4.1", + "version": "1.4.2-next.0", "command": { "publish": { "message": "chore(release): publish %s", diff --git a/packages/babel-plugin/package.json b/packages/babel-plugin/package.json index bdb6abe0..48842a6d 100644 --- a/packages/babel-plugin/package.json +++ b/packages/babel-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@grafoo/babel-plugin", - "version": "1.4.1", + "version": "1.4.2-next.0", "description": "grafoo client babel plugin", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/babel-plugin", "main": "dist/index.js", @@ -31,7 +31,7 @@ ] }, "dependencies": { - "@grafoo/compiler": "^1.4.1" + "@grafoo/compiler": "^1.4.2-next.0" }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" } diff --git a/packages/bindings/package.json b/packages/bindings/package.json index 781c88d7..284ccf54 100644 --- a/packages/bindings/package.json +++ b/packages/bindings/package.json @@ -1,6 +1,6 @@ { "name": "@grafoo/bindings", - "version": "1.4.1", + "version": "1.4.2-next.0", "description": "grafoo client internal helper for building framework bindings", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/bindings", "main": "dist/index.js", @@ -32,7 +32,7 @@ ] }, "dependencies": { - "@grafoo/core": "^1.4.1" + "@grafoo/core": "^1.4.2-next.0" }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" } diff --git a/packages/bundle/package.json b/packages/bundle/package.json index 9b771868..f016df4b 100644 --- a/packages/bundle/package.json +++ b/packages/bundle/package.json @@ -1,6 +1,6 @@ { "name": "grafoo-bundle", - "version": "1.4.1", + "version": "1.4.2-next.0", "bin": "cli.js", "main": "index.js", "dependencies": { diff --git a/packages/compiler/package.json b/packages/compiler/package.json index d7985e1a..8a0a5c2d 100644 --- a/packages/compiler/package.json +++ b/packages/compiler/package.json @@ -1,6 +1,6 @@ { "name": "@grafoo/compiler", - "version": "1.4.1", + "version": "1.4.2-next.0", "description": "grafoo client babel plugin", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/babel-plugin", "main": "dist/index.js", diff --git a/packages/core/package.json b/packages/core/package.json index 0c06c0fd..f950a160 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@grafoo/core", - "version": "1.4.1", + "version": "1.4.2-next.0", "description": "grafoo client core", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/core", "main": "dist/index.js", @@ -30,7 +30,9 @@ "transformIgnorePatterns": [ "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob)/)" ], - "modulePathIgnorePatterns": ["/__tests__/data"] + "modulePathIgnorePatterns": [ + "/__tests__/data" + ] }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" } diff --git a/packages/react/package.json b/packages/react/package.json index 7d05f21a..bf115db8 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@grafoo/react", - "version": "1.4.1", + "version": "1.4.2-next.0", "description": "grafoo client react bindings", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/react", "main": "dist/index.js", @@ -38,8 +38,8 @@ "react": ">=16.8" }, "dependencies": { - "@grafoo/bindings": "^1.4.1", - "@grafoo/core": "^1.4.1" + "@grafoo/bindings": "^1.4.2-next.0", + "@grafoo/core": "^1.4.2-next.0" }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974", "devDependencies": { diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index ff6c25e4..f6eb82b4 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@grafoo/test-utils", - "version": "1.4.1", + "version": "1.4.2-next.0", "main": "dist/index.js", "publishConfig": { "access": "public" From c07ca327ec1f2cf17187939cf4c6efc47ed8e996 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Thu, 21 Oct 2021 21:22:49 -0300 Subject: [PATCH 18/49] fix --- packages/core/src/resolve-values.ts | 4 ++-- packages/core/src/store-values.ts | 4 +++- packages/core/src/types.ts | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/core/src/resolve-values.ts b/packages/core/src/resolve-values.ts index 50963553..73d2cc4c 100644 --- a/packages/core/src/resolve-values.ts +++ b/packages/core/src/resolve-values.ts @@ -10,8 +10,8 @@ export default function resolveValues( let data = {} as T["_queryType"]; let records: GrafooRecords = {}; let partial = false; - let stack: [string, GrafooSelection, GrafooPath, T["_queryType"]][] = [ - [, operation, allPaths, data] + let stack: [string, GrafooSelection, GrafooPath<{ id?: string }>, T["_queryType"]][] = [ + ["", operation, allPaths, data] ]; // traverse trough operation selection diff --git a/packages/core/src/store-values.ts b/packages/core/src/store-values.ts index f0ad6506..bf380b24 100644 --- a/packages/core/src/store-values.ts +++ b/packages/core/src/store-values.ts @@ -10,7 +10,9 @@ export default function storeValues( let { operation, fragments } = query; let path: GrafooPath = {}; let records: GrafooRecords = {}; - let stack: [string, T["_queryType"], GrafooSelection, GrafooPath][] = [[, tree, operation, path]]; + let stack: [string, T["_queryType"], GrafooSelection, GrafooPath][] = [ + ["", tree, operation, path] + ]; // traverse data tree while (stack.length) { diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 26a4d2c5..08c5ec76 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -24,8 +24,8 @@ export type GrafooInitialState = { paths: GrafooPath; }; -export type GrafooPath = - | { [U in keyof T]?: U extends "id" ? string : GrafooPath } +export type GrafooPath = + | { [U in keyof T]: U extends "id" ? string : GrafooPath } | GrafooPath[] | null; From 21d3d8bd149554f2203768de3d040d8ca5d66fa7 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Thu, 21 Oct 2021 21:23:21 -0300 Subject: [PATCH 19/49] chore(release): publish v1.4.3-next.0 --- lerna.json | 2 +- packages/bindings/package.json | 4 ++-- packages/core/package.json | 2 +- packages/react/package.json | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lerna.json b/lerna.json index 8cbadeb7..da965bc2 100644 --- a/lerna.json +++ b/lerna.json @@ -4,7 +4,7 @@ ], "npmClient": "yarn", "useWorkspaces": true, - "version": "1.4.2-next.0", + "version": "1.4.3-next.0", "command": { "publish": { "message": "chore(release): publish %s", diff --git a/packages/bindings/package.json b/packages/bindings/package.json index 284ccf54..b09f1801 100644 --- a/packages/bindings/package.json +++ b/packages/bindings/package.json @@ -1,6 +1,6 @@ { "name": "@grafoo/bindings", - "version": "1.4.2-next.0", + "version": "1.4.3-next.0", "description": "grafoo client internal helper for building framework bindings", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/bindings", "main": "dist/index.js", @@ -32,7 +32,7 @@ ] }, "dependencies": { - "@grafoo/core": "^1.4.2-next.0" + "@grafoo/core": "^1.4.3-next.0" }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" } diff --git a/packages/core/package.json b/packages/core/package.json index f950a160..2c089d27 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@grafoo/core", - "version": "1.4.2-next.0", + "version": "1.4.3-next.0", "description": "grafoo client core", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/core", "main": "dist/index.js", diff --git a/packages/react/package.json b/packages/react/package.json index bf115db8..8f8cd3b1 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@grafoo/react", - "version": "1.4.2-next.0", + "version": "1.4.3-next.0", "description": "grafoo client react bindings", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/react", "main": "dist/index.js", @@ -38,8 +38,8 @@ "react": ">=16.8" }, "dependencies": { - "@grafoo/bindings": "^1.4.2-next.0", - "@grafoo/core": "^1.4.2-next.0" + "@grafoo/bindings": "^1.4.3-next.0", + "@grafoo/core": "^1.4.3-next.0" }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974", "devDependencies": { From c8e3f32bb9b9d02e51d903b517d50cad8b04c2e6 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Fri, 22 Oct 2021 21:01:55 -0300 Subject: [PATCH 20/49] remove redundant tests --- package.json | 3 --- packages/core/src/types.ts | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/package.json b/package.json index 771ac71b..80b4ec7c 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,6 @@ "trailingComma": "none" }, "eslintConfig": { - "extends": [ - "eslint:recommended" - ], "parser": "@typescript-eslint/parser", "parserOptions": { "sourceType": "module", diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 08c5ec76..ba1c5cdd 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -24,7 +24,7 @@ export type GrafooInitialState = { paths: GrafooPath; }; -export type GrafooPath = +export type GrafooPath = | { [U in keyof T]: U extends "id" ? string : GrafooPath } | GrafooPath[] | null; From bd3d35c3f9263a683e06d9145278a226b32318c0 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Fri, 22 Oct 2021 21:12:34 -0300 Subject: [PATCH 21/49] remove unused deps --- package.json | 27 +- yarn.lock | 1185 ++++++++++++++++++++++++-------------------------- 2 files changed, 583 insertions(+), 629 deletions(-) diff --git a/package.json b/package.json index 80b4ec7c..24da4504 100644 --- a/package.json +++ b/package.json @@ -61,45 +61,42 @@ }, "devDependencies": { "@babel/cli": "^7.0.0", - "@babel/core": "^7.0.0", + "@babel/core": "^7.15.8", "@babel/parser": "^7.15.8", - "@babel/preset-env": "^7.0.0", + "@babel/preset-env": "^7.15.8", "@babel/preset-react": "^7.0.0", "@babel/preset-typescript": "^7.0.0", "@babel/register": "^7.0.0", - "@graphql-tools/schema": "^8.2.0", - "@testing-library/preact": "^2.0.1", - "@testing-library/preact-hooks": "^1.1.0", + "@graphql-tools/schema": "^8.3.0", "@testing-library/react-hooks": "^7.0.2", "@types/crypto-js": "^4.0.2", "@types/jest": "^27.0.2", - "@types/node": "^16.10.2", + "@types/node": "^16.11.4", "@types/node-fetch": "^3.0.3", - "@types/react": "^17.0.27", + "@types/react": "^17.0.31", "@types/uuid": "^8.3.1", "@types/ws": "^8.2.0", - "@typescript-eslint/parser": "^4.33.0", + "@typescript-eslint/parser": "^5.1.0", "babel-plugin-jsx-pragmatic": "^1.0.2", "babel-plugin-tester": "^10.0.0", "casual": "^1.5.19", "codecov": "^3.2.0", - "eslint": "^7.15.0", + "eslint": "^8.1.0", "eslint-plugin-prefer-let": "^1.1.0", "fetch-mock": "^9.11.0", "graphql": "^15.6.1", - "husky": "^7.0.2", - "jest": "^27.2.4", + "husky": "^7.0.4", + "jest": "^27.3.1", "lerna": "^4.0.0", - "lint-staged": "^11.2.0", + "lint-staged": "^11.2.3", "lowdb": "^3.0.0", "node-fetch": "^3.0.0", - "preact": "^10.5.14", "prettier": "^2.2.1", "react": "^17.0.2", "react-test-renderer": "^17.0.2", - "resolve.exports": "^1.0.2", + "resolve.exports": "^1.1.0", "rimraf": "^3.0.2", - "typescript": "^4.1.2", + "typescript": "^4.4.4", "uuid": "^8.3.2" } } diff --git a/yarn.lock b/yarn.lock index a5975f2a..4f981178 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18,13 +18,6 @@ "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" chokidar "^3.4.0" -"@babel/code-frame@7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== - dependencies: - "@babel/highlight" "^7.10.4" - "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" @@ -32,6 +25,13 @@ dependencies: "@babel/highlight" "^7.14.5" +"@babel/code-frame@^7.15.8": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.15.8.tgz#45990c47adadb00c03677baa89221f7cc23d2503" + integrity sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg== + dependencies: + "@babel/highlight" "^7.14.5" + "@babel/compat-data@^7.13.11", "@babel/compat-data@^7.15.0": version "7.15.0" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" @@ -58,6 +58,27 @@ semver "^6.3.0" source-map "^0.5.0" +"@babel/core@^7.15.8": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.8.tgz#195b9f2bffe995d2c6c159e72fe525b4114e8c10" + integrity sha512-3UG9dsxvYBMYwRv+gS41WKHno4K60/9GPy1CJaH6xy3Elq8CTtvtjT5R5jmNhXfCYLX2mTw+7/aq5ak/gOE0og== + dependencies: + "@babel/code-frame" "^7.15.8" + "@babel/generator" "^7.15.8" + "@babel/helper-compilation-targets" "^7.15.4" + "@babel/helper-module-transforms" "^7.15.8" + "@babel/helpers" "^7.15.4" + "@babel/parser" "^7.15.8" + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.6" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.1.2" + semver "^6.3.0" + source-map "^0.5.0" + "@babel/generator@^7.15.4", "@babel/generator@^7.7.2": version "7.15.4" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.4.tgz#85acb159a267ca6324f9793986991ee2022a05b0" @@ -67,6 +88,15 @@ jsesc "^2.5.1" source-map "^0.5.0" +"@babel/generator@^7.15.8": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.8.tgz#fa56be6b596952ceb231048cf84ee499a19c0cd1" + integrity sha512-ECmAKstXbp1cvpTTZciZCgfOt6iN64lR0d+euv3UZisU5awfRawOvg07Utn/qBGuH4bRIEZKrA/4LzZyXhZr8g== + dependencies: + "@babel/types" "^7.15.6" + jsesc "^2.5.1" + source-map "^0.5.0" + "@babel/helper-annotate-as-pure@^7.14.5", "@babel/helper-annotate-as-pure@^7.15.4": version "7.15.4" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.15.4.tgz#3d0e43b00c5e49fdb6c57e421601a7a658d5f835" @@ -184,6 +214,20 @@ "@babel/traverse" "^7.15.4" "@babel/types" "^7.15.6" +"@babel/helper-module-transforms@^7.15.8": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.8.tgz#d8c0e75a87a52e374a8f25f855174786a09498b2" + integrity sha512-DfAfA6PfpG8t4S6npwzLvTUpp0sS7JrcuaMiy1Y5645laRJIp/LiLGIBbQKaXSInK8tiGNI7FL7L8UvB8gdUZg== + dependencies: + "@babel/helper-module-imports" "^7.15.4" + "@babel/helper-replace-supers" "^7.15.4" + "@babel/helper-simple-access" "^7.15.4" + "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/helper-validator-identifier" "^7.15.7" + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.6" + "@babel/helper-optimise-call-expression@^7.15.4": version "7.15.4" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz#f310a5121a3b9cc52d9ab19122bd729822dee171" @@ -265,7 +309,7 @@ "@babel/traverse" "^7.15.4" "@babel/types" "^7.15.4" -"@babel/highlight@^7.10.4", "@babel/highlight@^7.14.5": +"@babel/highlight@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== @@ -293,10 +337,10 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.15.4" "@babel/plugin-proposal-optional-chaining" "^7.14.5" -"@babel/plugin-proposal-async-generator-functions@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.15.4.tgz#f82aabe96c135d2ceaa917feb9f5fca31635277e" - integrity sha512-2zt2g5vTXpMC3OmK6uyjvdXptbhBXfA77XGrd3gh93zwG8lZYBLOBImiGBEG0RANu3JqKEACCz5CGk73OJROBw== +"@babel/plugin-proposal-async-generator-functions@^7.15.8": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.15.8.tgz#a3100f785fab4357987c4223ab1b02b599048403" + integrity sha512-2Z5F2R2ibINTc63mY7FLqGfEbmofrHU9FitJW1Q7aPaKFhiPvSq6QEt/BoWN5oME3GVyjcRuNNSRbb9LC0CSWA== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/helper-remap-async-to-generator" "^7.15.4" @@ -784,13 +828,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-spread@^7.14.6": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.14.6.tgz#6bd40e57fe7de94aa904851963b5616652f73144" - integrity sha512-Zr0x0YroFJku7n7+/HH3A2eIrGMjbmAIbJSVv0IZ+t3U2WUQUA64S/oeied2e+MaGSjmt4alzBCsK9E8gh+fag== +"@babel/plugin-transform-spread@^7.15.8": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.15.8.tgz#79d5aa27f68d700449b2da07691dfa32d2f6d468" + integrity sha512-/daZ8s2tNaRekl9YJa9X4bzjpeRZLt122cpgFnQPLGUe61PH8zMEBmYqKkW5xF5JUEh5buEGXJoQpqBmIbpmEQ== dependencies: "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.15.4" "@babel/plugin-transform-sticky-regex@^7.14.5": version "7.14.5" @@ -837,17 +881,17 @@ "@babel/helper-create-regexp-features-plugin" "^7.14.5" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/preset-env@^7.0.0": - version "7.15.6" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.15.6.tgz#0f3898db9d63d320f21b17380d8462779de57659" - integrity sha512-L+6jcGn7EWu7zqaO2uoTDjjMBW+88FXzV8KvrBl2z6MtRNxlsmUNRlZPaNNPUTgqhyC5DHNFk/2Jmra+ublZWw== +"@babel/preset-env@^7.15.8": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.15.8.tgz#f527ce5bcb121cd199f6b502bf23e420b3ff8dba" + integrity sha512-rCC0wH8husJgY4FPbHsiYyiLxSY8oMDJH7Rl6RQMknbN9oDDHhM9RDFvnGM2MgkbUJzSQB4gtuwygY5mCqGSsA== dependencies: "@babel/compat-data" "^7.15.0" "@babel/helper-compilation-targets" "^7.15.4" "@babel/helper-plugin-utils" "^7.14.5" "@babel/helper-validator-option" "^7.14.5" "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.15.4" - "@babel/plugin-proposal-async-generator-functions" "^7.15.4" + "@babel/plugin-proposal-async-generator-functions" "^7.15.8" "@babel/plugin-proposal-class-properties" "^7.14.5" "@babel/plugin-proposal-class-static-block" "^7.15.4" "@babel/plugin-proposal-dynamic-import" "^7.14.5" @@ -902,7 +946,7 @@ "@babel/plugin-transform-regenerator" "^7.14.5" "@babel/plugin-transform-reserved-words" "^7.14.5" "@babel/plugin-transform-shorthand-properties" "^7.14.5" - "@babel/plugin-transform-spread" "^7.14.6" + "@babel/plugin-transform-spread" "^7.15.8" "@babel/plugin-transform-sticky-regex" "^7.14.5" "@babel/plugin-transform-template-literals" "^7.14.5" "@babel/plugin-transform-typeof-symbol" "^7.14.5" @@ -911,7 +955,7 @@ "@babel/preset-modules" "^0.1.4" "@babel/types" "^7.15.6" babel-plugin-polyfill-corejs2 "^0.2.2" - babel-plugin-polyfill-corejs3 "^0.2.2" + babel-plugin-polyfill-corejs3 "^0.2.5" babel-plugin-polyfill-regenerator "^0.2.2" core-js-compat "^3.16.0" semver "^6.3.0" @@ -959,15 +1003,7 @@ pirates "^4.0.0" source-map-support "^0.5.16" -"@babel/runtime-corejs3@^7.10.2": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.15.4.tgz#403139af262b9a6e8f9ba04a6fdcebf8de692bf1" - integrity sha512-lWcAqKeB624/twtTc3w6w/2o9RqJPaNBhPGK6DKLSiwuVWC7WFkypWyNg+CpZoyJH0jVzv1uMtXZ/5/lQOLtCg== - dependencies: - core-js-pure "^3.16.0" - regenerator-runtime "^0.13.4" - -"@babel/runtime@^7.0.0", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.8", "@babel/runtime@^7.8.4": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.8", "@babel/runtime@^7.8.4": version "7.15.4" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a" integrity sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw== @@ -1011,14 +1047,14 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@eslint/eslintrc@^0.4.3": - version "0.4.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" - integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== +"@eslint/eslintrc@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.3.tgz#41f08c597025605f672251dcc4e8be66b5ed7366" + integrity sha512-DHI1wDPoKCBPoLZA3qDR91+3te/wDSc1YhKg3jR8NxKKRJq2hwHwcWv31cSwSYvIBrmbENoYMWcenW8uproQqg== dependencies: ajv "^6.12.4" - debug "^4.1.1" - espree "^7.3.0" + debug "^4.3.2" + espree "^9.0.0" globals "^13.9.0" ignore "^4.0.6" import-fresh "^3.2.1" @@ -1031,35 +1067,35 @@ resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.2.tgz#30aa825f11d438671d585bd44e7fd564535fc210" integrity sha512-82cpyJyKRoQoRi+14ibCeGPu0CwypgtBAdBhq1WfvagpCZNKqwXbKwXllYSMG91DhmG4jt9gN8eP6lGOtozuaw== -"@graphql-tools/merge@^8.1.0": - version "8.1.2" - resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-8.1.2.tgz#50f5763927c51de764d09c5bfd20261671976e24" - integrity sha512-kFLd4kKNJXYXnKIhM8q9zgGAtbLmsy3WmGdDxYq3YHBJUogucAxnivQYyRIseUq37KGmSAIWu3pBQ23TKGsGOw== +"@graphql-tools/merge@^8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-8.2.0.tgz#8f6638eeecf19f59fef28598024308e0452dd0a2" + integrity sha512-nfMLYF7zczjnIbChZtqbvozRfuRweMD1Fe9HHd4RXd3Tcsj6E17srW0QJfxUoIIWh4pitj+XwZAwhj1PWBDU7g== dependencies: - "@graphql-tools/utils" "^8.2.2" + "@graphql-tools/utils" "^8.4.0" tslib "~2.3.0" -"@graphql-tools/schema@^8.2.0": - version "8.2.0" - resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-8.2.0.tgz#ae75cbb2df6cee9ed6d89fce56be467ab23758dc" - integrity sha512-ufmI5mJQa8NJczzfkh0pUttKvspqDcT5LLakA3jUmOrrE4d4NVj6onZlazdTzF5sAepSNqanFnwhrxZpCAJMKg== +"@graphql-tools/schema@^8.3.0": + version "8.3.0" + resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-8.3.0.tgz#ddf4297859c6d7ac1ebbbd91460260ed424115db" + integrity sha512-OJD4Q1Xa3sffRiHzy0sskZz9ZWeqaujINfoim4CTk5Y9es1LS+WnKi25wVhmL2SGzzmKuAv7oDn+dpQAlM+Gfw== dependencies: - "@graphql-tools/merge" "^8.1.0" - "@graphql-tools/utils" "^8.2.0" + "@graphql-tools/merge" "^8.2.0" + "@graphql-tools/utils" "^8.4.0" tslib "~2.3.0" - value-or-promise "1.0.10" + value-or-promise "1.0.11" -"@graphql-tools/utils@^8.2.0", "@graphql-tools/utils@^8.2.2": - version "8.2.4" - resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-8.2.4.tgz#89f92c8dc0cdb6b9f32c90e904aa90e66a2e0a58" - integrity sha512-uB+JL7CqTKJ2Q5zXA+a2la1cA8YYPcc0RHO/3mK54hxlZa2Z5/9k9XrNfMof4LZQefTaBM7M6QWtaxGklJln4A== +"@graphql-tools/utils@^8.4.0": + version "8.5.0" + resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-8.5.0.tgz#439487ac756d9458a33091e5e0435ddf8e794f3e" + integrity sha512-jMwLm6YdN+Vbqntg5GHqDvGLpLa/xPSpRs/c40d0rBuel77wo7AaQ8jHeBSpp9y+7kp7HrGSWff1u7yJ7F8ppw== dependencies: tslib "~2.3.0" -"@humanwhocodes/config-array@^0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" - integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== +"@humanwhocodes/config-array@^0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.6.0.tgz#b5621fdb3b32309d2d16575456cbc277fa8f021a" + integrity sha512-JQlEKbcgEUjBFhLIF4iqM7u/9lwgHRBcpHrmUNCALK0Q3amXN6lxdoXLnF0sm11E9VqTmBALR87IlUg1bZ8A9A== dependencies: "@humanwhocodes/object-schema" "^1.2.0" debug "^4.1.1" @@ -1091,93 +1127,94 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.2.4.tgz#2f1a4bf82b9940065d4818fac271def99ec55e5e" - integrity sha512-94znCKynPZpDpYHQ6esRJSc11AmONrVkBOBZiD7S+bSubHhrUfbS95EY5HIOxhm4PQO7cnvZkL3oJcY0oMA+Wg== +"@jest/console@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.3.1.tgz#e8ea3a475d3f8162f23d69efbfaa9cbe486bee93" + integrity sha512-RkFNWmv0iui+qsOr/29q9dyfKTTT5DCuP31kUwg7rmOKPT/ozLeGLKJKVIiOfbiKyleUZKIrHwhmiZWVe8IMdw== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.2.4" - jest-util "^27.2.4" + jest-message-util "^27.3.1" + jest-util "^27.3.1" slash "^3.0.0" -"@jest/core@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.4.tgz#0b932da787d64848eab720dbb88e5b7a3f86e539" - integrity sha512-UNQLyy+rXoojNm2MGlapgzWhZD1CT1zcHZQYeiD0xE7MtJfC19Q6J5D/Lm2l7i4V97T30usKDoEtjI8vKwWcLg== +"@jest/core@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.3.1.tgz#04992ef1b58b17c459afb87ab56d81e63d386925" + integrity sha512-DMNE90RR5QKx0EA+wqe3/TNEwiRpOkhshKNxtLxd4rt3IZpCt+RSL+FoJsGeblRZmqdK4upHA/mKKGPPRAifhg== dependencies: - "@jest/console" "^27.2.4" - "@jest/reporters" "^27.2.4" - "@jest/test-result" "^27.2.4" - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/console" "^27.3.1" + "@jest/reporters" "^27.3.1" + "@jest/test-result" "^27.3.1" + "@jest/transform" "^27.3.1" + "@jest/types" "^27.2.5" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^27.2.4" - jest-config "^27.2.4" - jest-haste-map "^27.2.4" - jest-message-util "^27.2.4" + jest-changed-files "^27.3.0" + jest-config "^27.3.1" + jest-haste-map "^27.3.1" + jest-message-util "^27.3.1" jest-regex-util "^27.0.6" - jest-resolve "^27.2.4" - jest-resolve-dependencies "^27.2.4" - jest-runner "^27.2.4" - jest-runtime "^27.2.4" - jest-snapshot "^27.2.4" - jest-util "^27.2.4" - jest-validate "^27.2.4" - jest-watcher "^27.2.4" + jest-resolve "^27.3.1" + jest-resolve-dependencies "^27.3.1" + jest-runner "^27.3.1" + jest-runtime "^27.3.1" + jest-snapshot "^27.3.1" + jest-util "^27.3.1" + jest-validate "^27.3.1" + jest-watcher "^27.3.1" micromatch "^4.0.4" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.4.tgz#db3e60f7dd30ab950f6ce2d6d7293ed9a6b7cbcd" - integrity sha512-wkuui5yr3SSQW0XD0Qm3TATUbL/WE3LDEM3ulC+RCQhMf2yxhci8x7svGkZ4ivJ6Pc94oOzpZ6cdHBAMSYd1ew== +"@jest/environment@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.3.1.tgz#2182defbce8d385fd51c5e7c7050f510bd4c86b1" + integrity sha512-BCKCj4mOVLme6Tanoyc9k0ultp3pnmuyHw73UHRPeeZxirsU/7E3HC4le/VDb/SMzE1JcPnto+XBKFOcoiJzVw== dependencies: - "@jest/fake-timers" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/fake-timers" "^27.3.1" + "@jest/types" "^27.2.5" "@types/node" "*" - jest-mock "^27.2.4" + jest-mock "^27.3.0" -"@jest/fake-timers@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.4.tgz#00df08bd60332bd59503cb5b6db21e4903785f86" - integrity sha512-cs/TzvwWUM7kAA6Qm/890SK6JJ2pD5RfDNM3SSEom6BmdyV6OiWP1qf/pqo6ts6xwpcM36oN0wSEzcZWc6/B6w== +"@jest/fake-timers@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.3.1.tgz#1fad860ee9b13034762cdb94266e95609dfce641" + integrity sha512-M3ZFgwwlqJtWZ+QkBG5NmC23A9w+A6ZxNsO5nJxJsKYt4yguBd3i8TpjQz5NfCX91nEve1KqD9RA2Q+Q1uWqoA== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" "@sinonjs/fake-timers" "^8.0.1" "@types/node" "*" - jest-message-util "^27.2.4" - jest-mock "^27.2.4" - jest-util "^27.2.4" + jest-message-util "^27.3.1" + jest-mock "^27.3.0" + jest-util "^27.3.1" -"@jest/globals@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.4.tgz#0aeb22b011f8c8c4b8ff3b4dbd1ee0392fe0dd8a" - integrity sha512-DRsRs5dh0i+fA9mGHylTU19+8fhzNJoEzrgsu+zgJoZth3x8/0juCQ8nVVdW1er4Cqifb/ET7/hACYVPD0dBEA== +"@jest/globals@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.3.1.tgz#ce1dfb03d379237a9da6c1b99ecfaca1922a5f9e" + integrity sha512-Q651FWiWQAIFiN+zS51xqhdZ8g9b88nGCobC87argAxA7nMfNQq0Q0i9zTfQYgLa6qFXk2cGANEqfK051CZ8Pg== dependencies: - "@jest/environment" "^27.2.4" - "@jest/types" "^27.2.4" - expect "^27.2.4" + "@jest/environment" "^27.3.1" + "@jest/types" "^27.2.5" + expect "^27.3.1" -"@jest/reporters@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.4.tgz#1482ff007f2e919d85c54b1563abb8b2ea2d5198" - integrity sha512-LHeSdDnDZkDnJ8kvnjcqV8P1Yv/32yL4d4XfR5gBiy3xGO0onwll1QEbvtW96fIwhx2nejug0GTaEdNDoyr3fQ== +"@jest/reporters@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.3.1.tgz#28b5c1f5789481e23788048fa822ed15486430b9" + integrity sha512-m2YxPmL9Qn1emFVgZGEiMwDntDxRRQ2D58tiDQlwYTg5GvbFOKseYCcHtn0WsI8CG4vzPglo3nqbOiT8ySBT/w== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.2.4" - "@jest/test-result" "^27.2.4" - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/console" "^27.3.1" + "@jest/test-result" "^27.3.1" + "@jest/transform" "^27.3.1" + "@jest/types" "^27.2.5" + "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -1188,10 +1225,10 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.2.4" - jest-resolve "^27.2.4" - jest-util "^27.2.4" - jest-worker "^27.2.4" + jest-haste-map "^27.3.1" + jest-resolve "^27.3.1" + jest-util "^27.3.1" + jest-worker "^27.3.1" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" @@ -1207,62 +1244,62 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.4.tgz#d1ca8298d168f1b0be834bfb543b1ac0294c05d7" - integrity sha512-eU+PRo0+lIS01b0dTmMdVZ0TtcRSxEaYquZTRFMQz6CvsehGhx9bRzi9Zdw6VROviJyv7rstU+qAMX5pNBmnfQ== +"@jest/test-result@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.3.1.tgz#89adee8b771877c69b3b8d59f52f29dccc300194" + integrity sha512-mLn6Thm+w2yl0opM8J/QnPTqrfS4FoXsXF2WIWJb2O/GBSyResL71BRuMYbYRsGt7ELwS5JGcEcGb52BNrumgg== dependencies: - "@jest/console" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/console" "^27.3.1" + "@jest/types" "^27.2.5" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.4.tgz#df66422a3e9e7440ce8b7498e255fa6b52c0bc03" - integrity sha512-fpk5eknU3/DXE2QCCG1wv/a468+cfPo3Asu6d6yUtM9LOPh709ubZqrhuUOYfM8hXMrIpIdrv1CdCrWWabX0rQ== +"@jest/test-sequencer@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.3.1.tgz#4b3bde2dbb05ee74afdae608cf0768e3354683b1" + integrity sha512-siySLo07IMEdSjA4fqEnxfIX8lB/lWYsBPwNFtkOvsFQvmBrL3yj3k3uFNZv/JDyApTakRpxbKLJ3CT8UGVCrA== dependencies: - "@jest/test-result" "^27.2.4" + "@jest/test-result" "^27.3.1" graceful-fs "^4.2.4" - jest-haste-map "^27.2.4" - jest-runtime "^27.2.4" + jest-haste-map "^27.3.1" + jest-runtime "^27.3.1" -"@jest/transform@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.4.tgz#2fe5b6836895f7a1b8bdec442c51e83943c62733" - integrity sha512-n5FlX2TH0oQGwyVDKPxdJ5nI2sO7TJBFe3u3KaAtt7TOiV4yL+Y+rSFDl+Ic5MpbiA/eqXmLAQxjnBmWgS2rEA== +"@jest/transform@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.3.1.tgz#ff80eafbeabe811e9025e4b6f452126718455220" + integrity sha512-3fSvQ02kuvjOI1C1ssqMVBKJpZf6nwoCiSu00zAKh5nrp3SptNtZy/8s5deayHnqxhjD9CWDJ+yqQwuQ0ZafXQ== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.2.4" + jest-haste-map "^27.3.1" jest-regex-util "^27.0.6" - jest-util "^27.2.4" + jest-util "^27.3.1" micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" - integrity sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ== +"@jest/types@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.4.tgz#2430042a66e00dc5b140c3636f4474d464c21ee8" + integrity sha512-IDO2ezTxeMvQAHxzG/ZvEyA47q0aVfzT95rGFl7bZs/Go0aIucvfDbS2rmnoEdXxlLQhcolmoG/wvL/uKx4tKA== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" - "@types/yargs" "^15.0.0" + "@types/yargs" "^16.0.0" chalk "^4.0.0" -"@jest/types@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.4.tgz#2430042a66e00dc5b140c3636f4474d464c21ee8" - integrity sha512-IDO2ezTxeMvQAHxzG/ZvEyA47q0aVfzT95rGFl7bZs/Go0aIucvfDbS2rmnoEdXxlLQhcolmoG/wvL/uKx4tKA== +"@jest/types@^27.2.5": + version "27.2.5" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.5.tgz#420765c052605e75686982d24b061b4cbba22132" + integrity sha512-nmuM4VuDtCZcY+eTpw+0nvstwReMsjPoj7ZR80/BbixulhLaiX+fbv8oeLW8WZlJMcsGQsTmMKT/iTZu1Uy/lQ== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" @@ -2160,32 +2197,6 @@ dependencies: "@sinonjs/commons" "^1.7.0" -"@testing-library/dom@^7.16.2": - version "7.31.2" - resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.31.2.tgz#df361db38f5212b88555068ab8119f5d841a8c4a" - integrity sha512-3UqjCpey6HiTZT92vODYLPxTBWlM8ZOOjr3LX5F37/VRipW2M1kX6I/Cm4VXzteZqfGfagg8yXywpcOgQBlNsQ== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/runtime" "^7.12.5" - "@types/aria-query" "^4.2.0" - aria-query "^4.2.2" - chalk "^4.1.0" - dom-accessibility-api "^0.5.6" - lz-string "^1.4.4" - pretty-format "^26.6.2" - -"@testing-library/preact-hooks@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@testing-library/preact-hooks/-/preact-hooks-1.1.0.tgz#f4e197ec77b295ce6c122c560c46b5b03bc4f015" - integrity sha512-+JIor+NsOHkK3oIrwMDGKGHXTN0JJi462dBJlj4FNbGaDPTlctE6eu2ranWQirh7/FJMkWfzQCP+tk7jmY8ZrQ== - -"@testing-library/preact@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@testing-library/preact/-/preact-2.0.1.tgz#c69200b16c4eda58986c8d65e1043ad9cbe409d3" - integrity sha512-79kwVOY+3caoLgaPbiPzikjgY0Aya7Fc7TvGtR1upCnz2wrtmPDnN2t9vO7I7vDP2zoA+feSwOH5Q0BFErhaaQ== - dependencies: - "@testing-library/dom" "^7.16.2" - "@testing-library/react-hooks@^7.0.2": version "7.0.2" resolved "https://registry.yarnpkg.com/@testing-library/react-hooks/-/react-hooks-7.0.2.tgz#3388d07f562d91e7f2431a4a21b5186062ecfee0" @@ -2202,11 +2213,6 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== -"@types/aria-query@^4.2.0": - version "4.2.2" - resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.2.tgz#ed4e0ad92306a704f9fb132a0cfcf77486dbe2bc" - integrity sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig== - "@types/babel-plugin-tester@^9.0.0": version "9.0.4" resolved "https://registry.yarnpkg.com/@types/babel-plugin-tester/-/babel-plugin-tester-9.0.4.tgz#f5f9274149c6c789984f69ae4edbc383e33f679c" @@ -2309,6 +2315,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.2.tgz#5764ca9aa94470adb4e1185fe2e9f19458992b2e" integrity sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ== +"@types/node@^16.11.4": + version "16.11.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.4.tgz#90771124822d6663814f7c1c9b45a6654d8fd964" + integrity sha512-TMgXmy0v2xWyuCSCJM6NCna2snndD8yvQF67J29ipdzMcsPa9u+o0tjF5+EQNdhcuZplYuouYqpc4zcd5I6amQ== + "@types/normalize-package-data@^2.4.0": version "2.4.1" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" @@ -2352,6 +2363,15 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/react@^17.0.31": + version "17.0.31" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.31.tgz#fe05ebf91ff3ae35bb6b13f6c1b461db8089dff8" + integrity sha512-MQSR5EL4JZtdWRvqDgz9kXhSDDoy2zMTYyg7UhP+FZ5ttUOocWyxiqFJiI57sUG0BtaEX7WDXYQlkCYkb3X9vQ== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + "@types/resolve@0.0.8": version "0.0.8" resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" @@ -2386,13 +2406,6 @@ resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== -"@types/yargs@^15.0.0": - version "15.0.14" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.14.tgz#26d821ddb89e70492160b66d10a0eb6df8f6fb06" - integrity sha512-yEJzHoxf6SyQGhBhIYGXQDSCkJjB6HohDShto7m8vaKg9Yp0Yn8+71J9eakh2bnPg6BfsH9PRMhiRTZnd4eXGQ== - dependencies: - "@types/yargs-parser" "*" - "@types/yargs@^16.0.0": version "16.0.4" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.4.tgz#26aad98dd2c2a38e421086ea9ad42b9e51642977" @@ -2400,49 +2413,49 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/parser@^4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899" - integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA== +"@typescript-eslint/parser@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.1.0.tgz#6c7f837d210d2bc0a811e7ea742af414f4e00908" + integrity sha512-vx1P+mhCtYw3+bRHmbalq/VKP2Y3gnzNgxGxfEWc6OFpuEL7iQdAeq11Ke3Rhy8NjgB+AHsIWEwni3e+Y7djKA== dependencies: - "@typescript-eslint/scope-manager" "4.33.0" - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/typescript-estree" "4.33.0" - debug "^4.3.1" + "@typescript-eslint/scope-manager" "5.1.0" + "@typescript-eslint/types" "5.1.0" + "@typescript-eslint/typescript-estree" "5.1.0" + debug "^4.3.2" -"@typescript-eslint/scope-manager@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" - integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== +"@typescript-eslint/scope-manager@5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.1.0.tgz#6f1f26ad66a8f71bbb33b635e74fec43f76b44df" + integrity sha512-yYlyVjvn5lvwCL37i4hPsa1s0ORsjkauhTqbb8MnpvUs7xykmcjGqwlNZ2Q5QpoqkJ1odlM2bqHqJwa28qV6Tw== dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" + "@typescript-eslint/types" "5.1.0" + "@typescript-eslint/visitor-keys" "5.1.0" -"@typescript-eslint/types@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" - integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== +"@typescript-eslint/types@5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.1.0.tgz#a8a75ddfc611660de6be17d3ad950302385607a9" + integrity sha512-sEwNINVxcB4ZgC6Fe6rUyMlvsB2jvVdgxjZEjQUQVlaSPMNamDOwO6/TB98kFt4sYYfNhdhTPBEQqNQZjMMswA== -"@typescript-eslint/typescript-estree@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" - integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== +"@typescript-eslint/typescript-estree@5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.1.0.tgz#132aea34372df09decda961cb42457433aa6e83d" + integrity sha512-SSz+l9YrIIsW4s0ZqaEfnjl156XQ4VRmJsbA0ZE1XkXrD3cRpzuZSVCyqeCMR3EBjF27IisWakbBDGhGNIOvfQ== dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" - debug "^4.3.1" - globby "^11.0.3" - is-glob "^4.0.1" + "@typescript-eslint/types" "5.1.0" + "@typescript-eslint/visitor-keys" "5.1.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" - integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== +"@typescript-eslint/visitor-keys@5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.1.0.tgz#e01a01b27eb173092705ae983aa1451bd1842630" + integrity sha512-uqNXepKBg81JVwjuqAxYrXa1Ql/YDzM+8g/pS+TCPxba0wZttl8m5DkrasbfnmJGHs4lQ2jTbcZ5azGhI7kK+w== dependencies: - "@typescript-eslint/types" "4.33.0" - eslint-visitor-keys "^2.0.0" + "@typescript-eslint/types" "5.1.0" + eslint-visitor-keys "^3.0.0" JSONStream@^1.0.4: version "1.3.5" @@ -2480,12 +2493,12 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== -acorn@^7.1.1, acorn@^7.4.0: +acorn@^7.1.1: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4: +acorn@^8.2.4, acorn@^8.5.0: version "8.5.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== @@ -2529,16 +2542,6 @@ ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.1: - version "8.6.3" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.3.tgz#11a66527761dc3e9a3845ea775d2d3c0414e8764" - integrity sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - ansi-align@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" @@ -2568,7 +2571,7 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= -ansi-regex@^5.0.0, ansi-regex@^5.0.1: +ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== @@ -2625,19 +2628,16 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + argv@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/argv/-/argv-0.0.2.tgz#ecbd16f8949b157183711b1bda334f37840185ab" integrity sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas= -aria-query@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" - integrity sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA== - dependencies: - "@babel/runtime" "^7.10.2" - "@babel/runtime-corejs3" "^7.10.2" - array-differ@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-3.0.0.tgz#3cbb3d0f316810eafcc47624734237d6aee4ae6b" @@ -2705,13 +2705,13 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== -babel-jest@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.4.tgz#21ed6729d51bdd75470bbbf3c8b08d86209fb0dc" - integrity sha512-f24OmxyWymk5jfgLdlCMu4fTs4ldxFBIdn5sJdhvGC1m08rSkJ5hYbWkNmfBSvE/DjhCVNSHXepxsI6THGfGsg== +babel-jest@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.3.1.tgz#0636a3404c68e07001e434ac4956d82da8a80022" + integrity sha512-SjIF8hh/ir0peae2D6S6ZKRhUy7q/DnpH7k/V6fT4Bgs/LXXUztOpX4G2tCgq8mLo5HA9mN6NmlFMeYtKmIsTQ== dependencies: - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/transform" "^27.3.1" + "@jest/types" "^27.2.5" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" babel-preset-jest "^27.2.0" @@ -2763,7 +2763,7 @@ babel-plugin-polyfill-corejs2@^0.2.2: "@babel/helper-define-polyfill-provider" "^0.2.2" semver "^6.1.1" -babel-plugin-polyfill-corejs3@^0.2.2: +babel-plugin-polyfill-corejs3@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.5.tgz#2779846a16a1652244ae268b1e906ada107faf92" integrity sha512-ninF5MQNwAX9Z7c9ED+H2pGt1mXdP4TqzlHKyPIYmJIYz0N+++uwdM7RnJukklhzJ54Q84vA4ZJkgs7lu5vqcw== @@ -3056,7 +3056,7 @@ ci-info@^2.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== -ci-info@^3.1.1: +ci-info@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.2.0.tgz#2876cb948a498797b5236f0095bc057d0dca38b6" integrity sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A== @@ -3354,11 +3354,6 @@ core-js-compat@^3.16.0, core-js-compat@^3.16.2: browserslist "^4.17.1" semver "7.0.0" -core-js-pure@^3.16.0: - version "3.18.2" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.18.2.tgz#d8cc11d4885ea919f3de776d45e720e4c769d406" - integrity sha512-4hMMLUlZhKJKOWbbGD1/VDUxGPEhEoN/T01k7bx271WiBKCvCfkgPzy0IeRS4PB50p6/N1q/SZL4B/TRsTE5bA== - core-js@^3.0.0: version "3.18.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.18.1.tgz#289d4be2ce0085d40fc1244c0b1a54c00454622f" @@ -3452,7 +3447,7 @@ dateformat@^3.0.0: resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== -debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== @@ -3578,11 +3573,6 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dom-accessibility-api@^0.5.6: - version "0.5.7" - resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.7.tgz#8c2aa6325968f2933160a0b7dbb380893ddf3e7d" - integrity sha512-ml3lJIq9YjUfM9TUnEPvEYWFSwivwIGBPKpewX7tii7fwCazA8yCioGdqQcNsItPpfFvSJ3VIdMQPj60LJhcQA== - domexception@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" @@ -3747,62 +3737,61 @@ eslint-plugin-prefer-let@^1.1.0: dependencies: requireindex "~1.2.0" -eslint-scope@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== +eslint-scope@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-6.0.0.tgz#9cf45b13c5ac8f3d4c50f46a5121f61b3e318978" + integrity sha512-uRDL9MWmQCkaFus8RF5K9/L/2fn+80yoW3jkD53l4shjCh26fCtvJGasxjUqP5OT87SYTxCVA3BwTUzuELx9kA== dependencies: esrecurse "^4.3.0" - estraverse "^4.1.1" + estraverse "^5.2.0" -eslint-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + eslint-visitor-keys "^2.0.0" eslint-visitor-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint@^7.15.0: - version "7.32.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" - integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== +eslint-visitor-keys@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz#e32e99c6cdc2eb063f204eda5db67bfe58bb4186" + integrity sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q== + +eslint@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.1.0.tgz#00f1f7dbf4134f26588e6c9f2efe970760f64664" + integrity sha512-JZvNneArGSUsluHWJ8g8MMs3CfIEzwaLx9KyH4tZ2i+R2/rPWzL8c0zg3rHdwYVpN/1sB9gqnjHwz9HoeJpGHw== dependencies: - "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.3" - "@humanwhocodes/config-array" "^0.5.0" + "@eslint/eslintrc" "^1.0.3" + "@humanwhocodes/config-array" "^0.6.0" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" - debug "^4.0.1" + debug "^4.3.2" doctrine "^3.0.0" enquirer "^2.3.5" escape-string-regexp "^4.0.0" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.1" + eslint-scope "^6.0.0" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.0.0" + espree "^9.0.0" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" - glob-parent "^5.1.2" + glob-parent "^6.0.1" globals "^13.6.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" - js-yaml "^3.13.1" + js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" @@ -3810,22 +3799,21 @@ eslint@^7.15.0: natural-compare "^1.4.0" optionator "^0.9.1" progress "^2.0.0" - regexpp "^3.1.0" + regexpp "^3.2.0" semver "^7.2.1" strip-ansi "^6.0.0" strip-json-comments "^3.1.0" - table "^6.0.9" text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^7.3.0, espree@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" - integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== +espree@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.0.0.tgz#e90a2965698228502e771c7a58489b1a9d107090" + integrity sha512-r5EQJcYZ2oaGbeR0jR0fFVijGOcwai07/690YRXLINuhmVeRY4UKSAsQPe/0BNuDgwP7Ophoc1PRsr2E3tkbdQ== dependencies: - acorn "^7.4.0" + acorn "^8.5.0" acorn-jsx "^5.3.1" - eslint-visitor-keys "^1.3.0" + eslint-visitor-keys "^3.0.0" esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" @@ -3846,11 +3834,6 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - estraverse@^5.1.0, estraverse@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" @@ -3896,16 +3879,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.4.tgz#4debf546050bcdad8914a8c95fec7662e02bf67c" - integrity sha512-gOtuonQ8TCnbNNCSw2fhVzRf8EFYDII4nB5NmG4IEV0rbUnW1I5zXvoTntU4iicB/Uh0oZr20NGlOLdJiwsOZA== +expect@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.3.1.tgz#d0f170b1f5c8a2009bab0beffd4bb94f043e38e7" + integrity sha512-MrNXV2sL9iDRebWPGOGFdPQRl2eDQNu/uhxIMShjjx74T6kC6jFIkmQ6OqXDtevjGUkyB2IT56RzDBqXf/QPCg== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" ansi-styles "^5.0.0" - jest-get-type "^27.0.6" - jest-matcher-utils "^27.2.4" - jest-message-util "^27.2.4" + jest-get-type "^27.3.1" + jest-matcher-utils "^27.3.1" + jest-message-util "^27.3.1" jest-regex-util "^27.0.6" extend@~3.0.2: @@ -4301,6 +4284,13 @@ glob-parent@^5.1.1, glob-parent@^5.1.2, glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" +glob-parent@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + glob-to-regexp@^0.4.0: version "0.4.1" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" @@ -4330,7 +4320,7 @@ globals@^13.6.0, globals@^13.9.0: dependencies: type-fest "^0.20.2" -globby@^11.0.2, globby@^11.0.3: +globby@^11.0.2, globby@^11.0.4: version "11.0.4" resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== @@ -4502,10 +4492,10 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -husky@^7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.2.tgz#21900da0f30199acca43a46c043c4ad84ae88dff" - integrity sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg== +husky@^7.0.4: + version "7.0.4" + resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535" + integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ== iconv-lite@0.4.24, iconv-lite@^0.4.24: version "0.4.24" @@ -4672,13 +4662,6 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-ci@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.0.tgz#c7e7be3c9d8eef7d0fa144390bd1e4b88dc4c994" - integrity sha512-kDXyttuLeslKAHYL/K28F2YkM3x5jvFPEw3yXbRptXydjD9rpLEz+C5K5iutY9ZiUu6AP41JdvRQwF4Iqs4ZCQ== - dependencies: - ci-info "^3.1.1" - is-core-module@^2.2.0, is-core-module@^2.5.0: version "2.7.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.7.0.tgz#3c0ef7d31b4acfc574f80c58409d568a836848e3" @@ -4720,7 +4703,7 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== @@ -4920,86 +4903,86 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.2.4.tgz#d7de46e90e5a599c47e260760f5ab53516e835e6" - integrity sha512-eeO1C1u4ex7pdTroYXezr+rbr957myyVoKGjcY4R1TJi3A+9v+4fu1Iv9J4eLq1bgFyT3O3iRWU9lZsEE7J72Q== +jest-changed-files@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.3.0.tgz#22a02cc2b34583fc66e443171dc271c0529d263c" + integrity sha512-9DJs9garMHv4RhylUMZgbdCJ3+jHSkpL9aaVKp13xtXAD80qLTLrqcDZL1PHA9dYA0bCI86Nv2BhkLpLhrBcPg== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.4.tgz#3bd898a29dcaf6a506f3f1b780dff5f67ca83c23" - integrity sha512-TtheheTElrGjlsY9VxkzUU1qwIx05ItIusMVKnvNkMt4o/PeegLRcjq3Db2Jz0GGdBalJdbzLZBgeulZAJxJWA== +jest-circus@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.3.1.tgz#1679e74387cbbf0c6a8b42de963250a6469e0797" + integrity sha512-v1dsM9II6gvXokgqq6Yh2jHCpfg7ZqV4jWY66u7npz24JnhP3NHxI0sKT7+ZMQ7IrOWHYAaeEllOySbDbWsiXw== dependencies: - "@jest/environment" "^27.2.4" - "@jest/test-result" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/environment" "^27.3.1" + "@jest/test-result" "^27.3.1" + "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.2.4" + expect "^27.3.1" is-generator-fn "^2.0.0" - jest-each "^27.2.4" - jest-matcher-utils "^27.2.4" - jest-message-util "^27.2.4" - jest-runtime "^27.2.4" - jest-snapshot "^27.2.4" - jest-util "^27.2.4" - pretty-format "^27.2.4" + jest-each "^27.3.1" + jest-matcher-utils "^27.3.1" + jest-message-util "^27.3.1" + jest-runtime "^27.3.1" + jest-snapshot "^27.3.1" + jest-util "^27.3.1" + pretty-format "^27.3.1" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.4.tgz#acda7f367aa6e674723fc1a7334e0ae1799448d2" - integrity sha512-4kpQQkg74HYLaXo3nzwtg4PYxSLgL7puz1LXHj5Tu85KmlIpxQFjRkXlx4V47CYFFIDoyl3rHA/cXOxUWyMpNg== +jest-cli@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.3.1.tgz#b576f9d146ba6643ce0a162d782b40152b6b1d16" + integrity sha512-WHnCqpfK+6EvT62me6WVs8NhtbjAS4/6vZJnk7/2+oOr50cwAzG4Wxt6RXX0hu6m1169ZGMlhYYUNeKBXCph/Q== dependencies: - "@jest/core" "^27.2.4" - "@jest/test-result" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/core" "^27.3.1" + "@jest/test-result" "^27.3.1" + "@jest/types" "^27.2.5" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.2.4" - jest-util "^27.2.4" - jest-validate "^27.2.4" + jest-config "^27.3.1" + jest-util "^27.3.1" + jest-validate "^27.3.1" prompts "^2.0.1" yargs "^16.2.0" -jest-config@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.4.tgz#0204969f5ae2e5190d47be2c14c04d631b7836e2" - integrity sha512-tWy0UxhdzqiKyp4l5Vq4HxLyD+gH5td+GCF3c22/DJ0bYAOsMo+qi2XtbJI6oYMH5JOJQs9nLW/r34nvFCehjA== +jest-config@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.3.1.tgz#cb3b7f6aaa8c0a7daad4f2b9573899ca7e09bbad" + integrity sha512-KY8xOIbIACZ/vdYCKSopL44I0xboxC751IX+DXL2+Wx6DKNycyEfV3rryC3BPm5Uq/BBqDoMrKuqLEUNJmMKKg== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.2.4" - "@jest/types" "^27.2.4" - babel-jest "^27.2.4" + "@jest/test-sequencer" "^27.3.1" + "@jest/types" "^27.2.5" + babel-jest "^27.3.1" chalk "^4.0.0" + ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" - is-ci "^3.0.0" - jest-circus "^27.2.4" - jest-environment-jsdom "^27.2.4" - jest-environment-node "^27.2.4" - jest-get-type "^27.0.6" - jest-jasmine2 "^27.2.4" + jest-circus "^27.3.1" + jest-environment-jsdom "^27.3.1" + jest-environment-node "^27.3.1" + jest-get-type "^27.3.1" + jest-jasmine2 "^27.3.1" jest-regex-util "^27.0.6" - jest-resolve "^27.2.4" - jest-runner "^27.2.4" - jest-util "^27.2.4" - jest-validate "^27.2.4" + jest-resolve "^27.3.1" + jest-runner "^27.3.1" + jest-util "^27.3.1" + jest-validate "^27.3.1" micromatch "^4.0.4" - pretty-format "^27.2.4" + pretty-format "^27.3.1" -jest-diff@^27.0.0, jest-diff@^27.2.4: +jest-diff@^27.0.0: version "27.2.4" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.4.tgz#171c51d3d2c105c457100fee6e7bf7cee51c8d8c" integrity sha512-bLAVlDSCR3gqUPGv+4nzVpEXGsHh98HjUL7Vb2hVyyuBDoQmja8eJb0imUABsuxBeUVmf47taJSAd9nDrwWKEg== @@ -5009,6 +4992,16 @@ jest-diff@^27.0.0, jest-diff@^27.2.4: jest-get-type "^27.0.6" pretty-format "^27.2.4" +jest-diff@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.3.1.tgz#d2775fea15411f5f5aeda2a5e02c2f36440f6d55" + integrity sha512-PCeuAH4AWUo2O5+ksW4pL9v5xJAcIKPUPfIhZBcG1RKv/0+dvaWTQK1Nrau8d67dp65fOqbeMdoil+6PedyEPQ== + dependencies: + chalk "^4.0.0" + diff-sequences "^27.0.6" + jest-get-type "^27.3.1" + pretty-format "^27.3.1" + jest-docblock@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.0.6.tgz#cc78266acf7fe693ca462cbbda0ea4e639e4e5f3" @@ -5016,53 +5009,58 @@ jest-docblock@^27.0.6: dependencies: detect-newline "^3.0.0" -jest-each@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.2.4.tgz#b4f280aafd63129ba82e345f0e74c5a10200aeef" - integrity sha512-w9XVc+0EDBUTJS4xBNJ7N2JCcWItFd006lFjz77OarAQcQ10eFDBMrfDv2GBJMKlXe9aq0HrIIF51AXcZrRJyg== +jest-each@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.3.1.tgz#14c56bb4f18dd18dc6bdd853919b5f16a17761ff" + integrity sha512-E4SwfzKJWYcvOYCjOxhZcxwL+AY0uFMvdCOwvzgutJiaiodFjkxQQDxHm8FQBeTqDnSmKsQWn7ldMRzTn2zJaQ== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" chalk "^4.0.0" - jest-get-type "^27.0.6" - jest-util "^27.2.4" - pretty-format "^27.2.4" - -jest-environment-jsdom@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.4.tgz#39ae80bbb8675306bfaf0440be1e5f877554539a" - integrity sha512-X70pTXFSypD7AIzKT1mLnDi5hP9w9mdTRcOGOmoDoBrNyNEg4rYm6d4LQWFLc9ps1VnMuDOkFSG0wjSNYGjkng== - dependencies: - "@jest/environment" "^27.2.4" - "@jest/fake-timers" "^27.2.4" - "@jest/types" "^27.2.4" + jest-get-type "^27.3.1" + jest-util "^27.3.1" + pretty-format "^27.3.1" + +jest-environment-jsdom@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.3.1.tgz#63ac36d68f7a9303494df783494856222b57f73e" + integrity sha512-3MOy8qMzIkQlfb3W1TfrD7uZHj+xx8Olix5vMENkj5djPmRqndMaXtpnaZkxmxM+Qc3lo+yVzJjzuXbCcZjAlg== + dependencies: + "@jest/environment" "^27.3.1" + "@jest/fake-timers" "^27.3.1" + "@jest/types" "^27.2.5" "@types/node" "*" - jest-mock "^27.2.4" - jest-util "^27.2.4" + jest-mock "^27.3.0" + jest-util "^27.3.1" jsdom "^16.6.0" -jest-environment-node@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.4.tgz#b79f98cb36e0c9111aac859c9c99f04eb2f74ff6" - integrity sha512-ZbVbFSnbzTvhLOIkqh5lcLuGCCFvtG4xTXIRPK99rV2KzQT3kNg16KZwfTnLNlIiWCE8do960eToeDfcqmpSAw== +jest-environment-node@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.3.1.tgz#af7d0eed04edafb740311b303f3fe7c8c27014bb" + integrity sha512-T89F/FgkE8waqrTSA7/ydMkcc52uYPgZZ6q8OaZgyiZkJb5QNNCF6oPZjH9IfPFfcc9uBWh1574N0kY0pSvTXw== dependencies: - "@jest/environment" "^27.2.4" - "@jest/fake-timers" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/environment" "^27.3.1" + "@jest/fake-timers" "^27.3.1" + "@jest/types" "^27.2.5" "@types/node" "*" - jest-mock "^27.2.4" - jest-util "^27.2.4" + jest-mock "^27.3.0" + jest-util "^27.3.1" jest-get-type@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== -jest-haste-map@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.2.4.tgz#f8974807bedf07348ca9fd24e5861ab7c8e61aba" - integrity sha512-bkJ4bT00T2K+1NZXbRcyKnbJ42I6QBvoDNMTAQQDBhaGNnZreiQKUNqax0e6hLTx7E75pKDeltVu3V1HAdu+YA== +jest-get-type@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.3.1.tgz#a8a2b0a12b50169773099eee60a0e6dd11423eff" + integrity sha512-+Ilqi8hgHSAdhlQ3s12CAVNd8H96ZkQBfYoXmArzZnOfAtVAJEiPDBirjByEblvG/4LPJmkL+nBqPO3A1YJAEg== + +jest-haste-map@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.3.1.tgz#7656fbd64bf48bda904e759fc9d93e2c807353ee" + integrity sha512-lYfNZIzwPccDJZIyk9Iz5iQMM/MH56NIIcGj7AFU1YyA4ewWFBl8z+YPJuSCRML/ee2cCt2y3W4K3VXPT6Nhzg== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" @@ -5070,76 +5068,76 @@ jest-haste-map@^27.2.4: graceful-fs "^4.2.4" jest-regex-util "^27.0.6" jest-serializer "^27.0.6" - jest-util "^27.2.4" - jest-worker "^27.2.4" + jest-util "^27.3.1" + jest-worker "^27.3.1" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.4.tgz#4a1608133dbdb4d68b5929bfd785503ed9c9ba51" - integrity sha512-fcffjO/xLWLVnW2ct3No4EksxM5RyPwHDYu9QU+90cC+/eSMLkFAxS55vkqsxexOO5zSsZ3foVpMQcg/amSeIQ== +jest-jasmine2@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.3.1.tgz#df6d3d07c7dafc344feb43a0072a6f09458d32b0" + integrity sha512-WK11ZUetDQaC09w4/j7o4FZDUIp+4iYWH/Lik34Pv7ukL+DuXFGdnmmi7dT58J2ZYKFB5r13GyE0z3NPeyJmsg== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.2.4" + "@jest/environment" "^27.3.1" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/test-result" "^27.3.1" + "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.2.4" + expect "^27.3.1" is-generator-fn "^2.0.0" - jest-each "^27.2.4" - jest-matcher-utils "^27.2.4" - jest-message-util "^27.2.4" - jest-runtime "^27.2.4" - jest-snapshot "^27.2.4" - jest-util "^27.2.4" - pretty-format "^27.2.4" + jest-each "^27.3.1" + jest-matcher-utils "^27.3.1" + jest-message-util "^27.3.1" + jest-runtime "^27.3.1" + jest-snapshot "^27.3.1" + jest-util "^27.3.1" + pretty-format "^27.3.1" throat "^6.0.1" -jest-leak-detector@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.4.tgz#9bb7eab26a73bb280e9298be8d80f389288ec8f1" - integrity sha512-SrcHWbe0EHg/bw2uBjVoHacTo5xosl068x2Q0aWsjr2yYuW2XwqrSkZV4lurUop0jhv1709ymG4or+8E4sH27Q== +jest-leak-detector@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.3.1.tgz#7fb632c2992ef707a1e73286e1e704f9cc1772b2" + integrity sha512-78QstU9tXbaHzwlRlKmTpjP9k4Pvre5l0r8Spo4SbFFVy/4Abg9I6ZjHwjg2QyKEAMg020XcjP+UgLZIY50yEg== dependencies: - jest-get-type "^27.0.6" - pretty-format "^27.2.4" + jest-get-type "^27.3.1" + pretty-format "^27.3.1" -jest-matcher-utils@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.4.tgz#008fff018151415ad1b6cfc083fd70fe1e012525" - integrity sha512-nQeLfFAIPPkyhkDfifAPfP/U5wm1x0fLtAzqXZSSKckXDNuk2aaOfQiDYv1Mgf5GY6yOsxfUnvNm3dDjXM+BXw== +jest-matcher-utils@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.3.1.tgz#257ad61e54a6d4044e080d85dbdc4a08811e9c1c" + integrity sha512-hX8N7zXS4k+8bC1Aj0OWpGb7D3gIXxYvPNK1inP5xvE4ztbz3rc4AkI6jGVaerepBnfWB17FL5lWFJT3s7qo8w== dependencies: chalk "^4.0.0" - jest-diff "^27.2.4" - jest-get-type "^27.0.6" - pretty-format "^27.2.4" + jest-diff "^27.3.1" + jest-get-type "^27.3.1" + pretty-format "^27.3.1" -jest-message-util@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.4.tgz#667e8c0f2b973156d1bac7398a7f677705cafaca" - integrity sha512-wbKT/BNGnBVB9nzi+IoaLkXt6fbSvqUxx+IYY66YFh96J3goY33BAaNG3uPqaw/Sh/FR9YpXGVDfd5DJdbh4nA== +jest-message-util@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.3.1.tgz#f7c25688ad3410ab10bcb862bcfe3152345c6436" + integrity sha512-bh3JEmxsTZ/9rTm0jQrPElbY2+y48Rw2t47uMfByNyUVR+OfPh4anuyKsGqsNkXk/TI4JbLRZx+7p7Hdt6q1yg== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.2.4" + pretty-format "^27.3.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.2.4.tgz#c8f0ef33f73d8ff53e3f60b16d59f1128f4072ae" - integrity sha512-iVRU905rutaAoUcrt5Tm1JoHHWi24YabqEGXjPJI4tAyA6wZ7mzDi3GrZ+M7ebgWBqUkZE93GAx1STk7yCMIQA== +jest-mock@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.3.0.tgz#ddf0ec3cc3e68c8ccd489bef4d1f525571a1b867" + integrity sha512-ziZiLk0elZOQjD08bLkegBzv5hCABu/c8Ytx45nJKkysQwGaonvmTxwjLqEA4qGdasq9o2I8/HtdGMNnVsMTGw== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -5152,72 +5150,71 @@ jest-regex-util@^27.0.6: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.4.tgz#20c41cc02b66aa45169b282356ec73b133013089" - integrity sha512-i5s7Uh9B3Q6uwxLpMhNKlgBf6pcemvWaORxsW1zNF/YCY3jd5EftvnGBI+fxVwJ1CBxkVfxqCvm1lpZkbaoGmg== +jest-resolve-dependencies@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.3.1.tgz#85b99bdbdfa46e2c81c6228fc4c91076f624f6e2" + integrity sha512-X7iLzY8pCiYOnvYo2YrK3P9oSE8/3N2f4pUZMJ8IUcZnT81vlSonya1KTO9ZfKGuC+svE6FHK/XOb8SsoRUV1A== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" jest-regex-util "^27.0.6" - jest-snapshot "^27.2.4" + jest-snapshot "^27.3.1" -jest-resolve@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.4.tgz#d3b999f073ff84a8ae109ce99ff7f3223048701a" - integrity sha512-IsAO/3+3BZnKjI2I4f3835TBK/90dxR7Otgufn3mnrDFTByOSXclDi3G2XJsawGV4/18IMLARJ+V7Wm7t+J89Q== +jest-resolve@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.3.1.tgz#0e5542172a1aa0270be6f66a65888647bdd74a3e" + integrity sha512-Dfzt25CFSPo3Y3GCbxynRBZzxq9AdyNN+x/v2IqYx6KVT5Z6me2Z/PsSGFSv3cOSUZqJ9pHxilao/I/m9FouLw== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" chalk "^4.0.0" - escalade "^3.1.1" graceful-fs "^4.2.4" - jest-haste-map "^27.2.4" + jest-haste-map "^27.3.1" jest-pnp-resolver "^1.2.2" - jest-util "^27.2.4" - jest-validate "^27.2.4" + jest-util "^27.3.1" + jest-validate "^27.3.1" resolve "^1.20.0" + resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.4.tgz#d816f4cb4af04f3cba703afcf5a35a335b77cad4" - integrity sha512-hIo5PPuNUyVDidZS8EetntuuJbQ+4IHWxmHgYZz9FIDbG2wcZjrP6b52uMDjAEQiHAn8yn8ynNe+TL8UuGFYKg== +jest-runner@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.3.1.tgz#1d594dcbf3bd8600a7e839e790384559eaf96e3e" + integrity sha512-r4W6kBn6sPr3TBwQNmqE94mPlYVn7fLBseeJfo4E2uCTmAyDFm2O5DYAQAFP7Q3YfiA/bMwg8TVsciP7k0xOww== dependencies: - "@jest/console" "^27.2.4" - "@jest/environment" "^27.2.4" - "@jest/test-result" "^27.2.4" - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/console" "^27.3.1" + "@jest/environment" "^27.3.1" + "@jest/test-result" "^27.3.1" + "@jest/transform" "^27.3.1" + "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.0.6" - jest-environment-jsdom "^27.2.4" - jest-environment-node "^27.2.4" - jest-haste-map "^27.2.4" - jest-leak-detector "^27.2.4" - jest-message-util "^27.2.4" - jest-resolve "^27.2.4" - jest-runtime "^27.2.4" - jest-util "^27.2.4" - jest-worker "^27.2.4" + jest-environment-jsdom "^27.3.1" + jest-environment-node "^27.3.1" + jest-haste-map "^27.3.1" + jest-leak-detector "^27.3.1" + jest-message-util "^27.3.1" + jest-resolve "^27.3.1" + jest-runtime "^27.3.1" + jest-util "^27.3.1" + jest-worker "^27.3.1" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.4.tgz#170044041e5d30625ab8d753516bbe503f213a5c" - integrity sha512-ICKzzYdjIi70P17MZsLLIgIQFCQmIjMFf+xYww3aUySiUA/QBPUTdUqo5B2eg4HOn9/KkUsV0z6GVgaqAPBJvg== +jest-runtime@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.3.1.tgz#80fa32eb85fe5af575865ddf379874777ee993d7" + integrity sha512-qtO6VxPbS8umqhEDpjA4pqTkKQ1Hy4ZSi9mDVeE9Za7LKBo2LdW2jmT+Iod3XFaJqINikZQsn2wEi0j9wPRbLg== dependencies: - "@jest/console" "^27.2.4" - "@jest/environment" "^27.2.4" - "@jest/fake-timers" "^27.2.4" - "@jest/globals" "^27.2.4" + "@jest/console" "^27.3.1" + "@jest/environment" "^27.3.1" + "@jest/globals" "^27.3.1" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.2.4" - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/test-result" "^27.3.1" + "@jest/transform" "^27.3.1" + "@jest/types" "^27.2.5" "@types/yargs" "^16.0.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" @@ -5226,14 +5223,14 @@ jest-runtime@^27.2.4: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.2.4" - jest-message-util "^27.2.4" - jest-mock "^27.2.4" + jest-haste-map "^27.3.1" + jest-message-util "^27.3.1" + jest-mock "^27.3.0" jest-regex-util "^27.0.6" - jest-resolve "^27.2.4" - jest-snapshot "^27.2.4" - jest-util "^27.2.4" - jest-validate "^27.2.4" + jest-resolve "^27.3.1" + jest-snapshot "^27.3.1" + jest-util "^27.3.1" + jest-validate "^27.3.1" slash "^3.0.0" strip-bom "^4.0.0" yargs "^16.2.0" @@ -5246,10 +5243,10 @@ jest-serializer@^27.0.6: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.4.tgz#277b2269437e3ffcb91d95a73b24becf33c5a871" - integrity sha512-5DFxK31rYS8X8C6WXsFx8XxrxW3PGa6+9IrUcZdTLg1aEyXDGIeiBh4jbwvh655bg/9vTETbEj/njfZicHTZZw== +jest-snapshot@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.3.1.tgz#1da5c0712a252d70917d46c037054f5918c49ee4" + integrity sha512-APZyBvSgQgOT0XumwfFu7X3G5elj6TGhCBLbBdn3R1IzYustPGPE38F51dBWMQ8hRXa9je0vAdeVDtqHLvB6lg== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -5257,60 +5254,60 @@ jest-snapshot@^27.2.4: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/transform" "^27.3.1" + "@jest/types" "^27.2.5" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.2.4" + expect "^27.3.1" graceful-fs "^4.2.4" - jest-diff "^27.2.4" - jest-get-type "^27.0.6" - jest-haste-map "^27.2.4" - jest-matcher-utils "^27.2.4" - jest-message-util "^27.2.4" - jest-resolve "^27.2.4" - jest-util "^27.2.4" + jest-diff "^27.3.1" + jest-get-type "^27.3.1" + jest-haste-map "^27.3.1" + jest-matcher-utils "^27.3.1" + jest-message-util "^27.3.1" + jest-resolve "^27.3.1" + jest-util "^27.3.1" natural-compare "^1.4.0" - pretty-format "^27.2.4" + pretty-format "^27.3.1" semver "^7.3.2" -jest-util@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.4.tgz#3d7ce081b2e7f4cfe0156452ac01f3cb456cc656" - integrity sha512-mW++4u+fSvAt3YBWm5IpbmRAceUqa2B++JlUZTiuEt2AmNYn0Yw5oay4cP17TGsMINRNPSGiJ2zNnX60g+VbFg== +jest-util@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.3.1.tgz#a58cdc7b6c8a560caac9ed6bdfc4e4ff23f80429" + integrity sha512-8fg+ifEH3GDryLQf/eKZck1DEs2YuVPBCMOaHQxVVLmQwl/CDhWzrvChTX4efLZxGrw+AA0mSXv78cyytBt/uw== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" + ci-info "^3.2.0" graceful-fs "^4.2.4" - is-ci "^3.0.0" picomatch "^2.2.3" -jest-validate@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.4.tgz#b66d462b2fb93d7e16a47d1aa8763d5600bf2cfa" - integrity sha512-VMtbxbkd7LHnIH7PChdDtrluCFRJ4b1YV2YJzNwwsASMWftq/HgqiqjvptBOWyWOtevgO3f14wPxkPcLlVBRog== +jest-validate@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.3.1.tgz#3a395d61a19cd13ae9054af8cdaf299116ef8a24" + integrity sha512-3H0XCHDFLA9uDII67Bwi1Vy7AqwA5HqEEjyy934lgVhtJ3eisw6ShOF1MDmRPspyikef5MyExvIm0/TuLzZ86Q== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^27.0.6" + jest-get-type "^27.3.1" leven "^3.1.0" - pretty-format "^27.2.4" + pretty-format "^27.3.1" -jest-watcher@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.4.tgz#b1d5c39ab94f59f4f35f66cc96f7761a10e0cfc4" - integrity sha512-LXC/0+dKxhK7cfF7reflRYlzDIaQE+fL4ynhKhzg8IMILNMuI4xcjXXfUJady7OR4/TZeMg7X8eHx8uan9vqaQ== +jest-watcher@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.3.1.tgz#ba5e0bc6aa843612b54ddb7f009d1cbff7e05f3e" + integrity sha512-9/xbV6chABsGHWh9yPaAGYVVKurWoP3ZMCv6h+O1v9/+pkOroigs6WzZ0e9gLP/njokUwM7yQhr01LKJVMkaZA== dependencies: - "@jest/test-result" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/test-result" "^27.3.1" + "@jest/types" "^27.2.5" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.2.4" + jest-util "^27.3.1" string-length "^4.0.1" jest-worker@^26.2.1: @@ -5322,23 +5319,23 @@ jest-worker@^26.2.1: merge-stream "^2.0.0" supports-color "^7.0.0" -jest-worker@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.4.tgz#881455df75e22e7726a53f43703ab74d6b36f82d" - integrity sha512-Zq9A2Pw59KkVjBBKD1i3iE2e22oSjXhUKKuAK1HGX8flGwkm6NMozyEYzKd41hXc64dbd/0eWFeEEuxqXyhM+g== +jest-worker@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.3.1.tgz#0def7feae5b8042be38479799aeb7b5facac24b2" + integrity sha512-ks3WCzsiZaOPJl/oMsDjaf0TRiSv7ctNgs0FqRr2nARsovz6AWWy4oLElwcquGSz692DzgZQrCLScPNs5YlC4g== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.4.tgz#70e27bef873138afc123aa4769f7124c50ad3efb" - integrity sha512-h4uqb1EQLfPulWyUFFWv9e9Nn8sCqsJ/j3wk/KCY0p4s4s0ICCfP3iMf6hRf5hEhsDyvyrCgKiZXma63gMz16A== +jest@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.3.1.tgz#b5bab64e8f56b6f7e275ba1836898b0d9f1e5c8a" + integrity sha512-U2AX0AgQGd5EzMsiZpYt8HyZ+nSVIh5ujQ9CPp9EQZJMjXIiSZpJNweZl0swatKRoqHWgGKM3zaSwm4Zaz87ng== dependencies: - "@jest/core" "^27.2.4" + "@jest/core" "^27.3.1" import-local "^3.0.2" - jest-cli "^27.2.4" + jest-cli "^27.3.1" "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" @@ -5353,6 +5350,13 @@ js-yaml@3.14.1, js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -5416,11 +5420,6 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema-traverse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" - integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== - json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" @@ -5555,10 +5554,10 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= -lint-staged@^11.2.0: - version "11.2.0" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-11.2.0.tgz#6b9774a74b3eb4bef5c59fb6475bff84d6853008" - integrity sha512-0KIcRuO4HQS2Su7qWtjrfTXgSklvyIb9Fk9qVWRZkGHa5S81Vj6WBbs+ogQBvHUwLJYq1eQ4R+H82GSak4OM7w== +lint-staged@^11.2.3: + version "11.2.3" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-11.2.3.tgz#fc3f4569cc4f46553309dfc1447b8aef69f744fb" + integrity sha512-Tfmhk8O2XFMD25EswHPv+OYhUjsijy5D7liTdxeXvhG2rsadmOLFtyj8lmlfoFFXY8oXWAIOKpoI+lJe1DB1mw== dependencies: cli-truncate "2.1.0" colorette "^1.4.0" @@ -5636,11 +5635,6 @@ lodash._reinterpolate@^3.0.0: resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= -lodash.clonedeep@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" - integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= - lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -5686,11 +5680,6 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash.truncate@^4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" - integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= - lodash@^4.17.15, lodash@^4.17.19, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -5727,11 +5716,6 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -lz-string@^1.4.4: - version "1.4.4" - resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26" - integrity sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY= - make-dir@^2.0.0, make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -6636,11 +6620,6 @@ please-upgrade-node@^3.2.0: dependencies: semver-compare "^1.0.0" -preact@^10.5.14: - version "10.5.14" - resolved "https://registry.yarnpkg.com/preact/-/preact-10.5.14.tgz#0b14a2eefba3c10a57116b90d1a65f5f00cd2701" - integrity sha512-KojoltCrshZ099ksUZ2OQKfbH66uquFoxHSbnwKbTJHeQNvx42EmC7wQVWNuDt6vC5s3nudRHFtKbpY4ijKlaQ== - prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -6656,16 +6635,6 @@ prettier@^2.0.1, prettier@^2.2.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== -pretty-format@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" - integrity sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg== - dependencies: - "@jest/types" "^26.6.2" - ansi-regex "^5.0.0" - ansi-styles "^4.0.0" - react-is "^17.0.1" - pretty-format@^27.0.0, pretty-format@^27.2.4: version "27.2.4" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.4.tgz#08ea39c5eab41b082852d7093059a091f6ddc748" @@ -6676,6 +6645,16 @@ pretty-format@^27.0.0, pretty-format@^27.2.4: ansi-styles "^5.0.0" react-is "^17.0.1" +pretty-format@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.3.1.tgz#7e9486365ccdd4a502061fa761d3ab9ca1b78df5" + integrity sha512-DR/c+pvFc52nLimLROYjnXPtolawm+uWDxr4FjuLDLUn+ktWnSN851KoHwHzzqq6rfCOjkzN8FLgDrSub6UDuA== + dependencies: + "@jest/types" "^27.2.5" + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^17.0.1" + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -6992,7 +6971,7 @@ regenerator-transform@^0.14.2: dependencies: "@babel/runtime" "^7.8.4" -regexpp@^3.1.0: +regexpp@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== @@ -7052,11 +7031,6 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= -require-from-string@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - requireindex@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef" @@ -7079,10 +7053,10 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve.exports@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.0.2.tgz#98c82ba8a4d3f9fcc32cbfa6f950b803d77b6c21" - integrity sha512-1+PDdTR3xrGWB/NzXLkzS1+PQlJ+BOR2baBGJSVat4HasiY1mnkyAQws3FUTmBDB79oK54QFaDM8Ig9nUtJwvQ== +resolve.exports@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" + integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== resolve@1.20.0, resolve@^1.10.0, resolve@^1.11.1, resolve@^1.14.2, resolve@^1.20.0: version "1.20.0" @@ -7537,7 +7511,7 @@ string-width@^1.0.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: +string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -7681,18 +7655,6 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -table@^6.0.9: - version "6.7.2" - resolved "https://registry.yarnpkg.com/table/-/table-6.7.2.tgz#a8d39b9f5966693ca8b0feba270a78722cbaf3b0" - integrity sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g== - dependencies: - ajv "^8.0.1" - lodash.clonedeep "^4.5.0" - lodash.truncate "^4.4.2" - slice-ansi "^4.0.0" - string-width "^4.2.3" - strip-ansi "^6.0.1" - tar@^4.4.12: version "4.4.19" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3" @@ -7971,11 +7933,6 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^4.1.2: - version "4.4.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324" - integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA== - typescript@^4.4.4: version "4.4.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c" @@ -8128,10 +8085,10 @@ validate-npm-package-name@^3.0.0: dependencies: builtins "^1.0.3" -value-or-promise@1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.10.tgz#5bf041f1e9a8e7043911875547636768a836e446" - integrity sha512-1OwTzvcfXkAfabk60UVr5NdjtjJ0Fg0T5+B1bhxtrOEwSH2fe8y4DnLgoksfCyd8yZCOQQHB0qLMQnwgCjbXLQ== +value-or-promise@1.0.11: + version "1.0.11" + resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.11.tgz#3e90299af31dd014fe843fe309cefa7c1d94b140" + integrity sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg== verror@1.10.0: version "1.10.0" From 65e68d8f445b784c82c820ca26e72693db78d162 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Fri, 22 Oct 2021 21:25:32 -0300 Subject: [PATCH 22/49] clean dependencies --- package.json | 1 - packages/react/package.json | 2 +- yarn.lock | 399 ++++++++++++------------------------ 3 files changed, 137 insertions(+), 265 deletions(-) diff --git a/package.json b/package.json index 24da4504..25df1966 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,6 @@ "@types/crypto-js": "^4.0.2", "@types/jest": "^27.0.2", "@types/node": "^16.11.4", - "@types/node-fetch": "^3.0.3", "@types/react": "^17.0.31", "@types/uuid": "^8.3.1", "@types/ws": "^8.2.0", diff --git a/packages/react/package.json b/packages/react/package.json index 8f8cd3b1..4b556582 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -35,7 +35,7 @@ ] }, "peerDependencies": { - "react": ">=16.8" + "react": ">=17" }, "dependencies": { "@grafoo/bindings": "^1.4.3-next.0", diff --git a/yarn.lock b/yarn.lock index 4f981178..69ddde9b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18,14 +18,7 @@ "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" chokidar "^3.4.0" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" - integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== - dependencies: - "@babel/highlight" "^7.14.5" - -"@babel/code-frame@^7.15.8": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5", "@babel/code-frame@^7.15.8": version "7.15.8" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.15.8.tgz#45990c47adadb00c03677baa89221f7cc23d2503" integrity sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg== @@ -37,28 +30,7 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== -"@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.7.2", "@babel/core@^7.7.5": - version "7.15.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.5.tgz#f8ed9ace730722544609f90c9bb49162dc3bf5b9" - integrity sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.4" - "@babel/helper-compilation-targets" "^7.15.4" - "@babel/helper-module-transforms" "^7.15.4" - "@babel/helpers" "^7.15.4" - "@babel/parser" "^7.15.5" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.1.2" - semver "^6.3.0" - source-map "^0.5.0" - -"@babel/core@^7.15.8": +"@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.15.8", "@babel/core@^7.7.2", "@babel/core@^7.7.5": version "7.15.8" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.8.tgz#195b9f2bffe995d2c6c159e72fe525b4114e8c10" integrity sha512-3UG9dsxvYBMYwRv+gS41WKHno4K60/9GPy1CJaH6xy3Elq8CTtvtjT5R5jmNhXfCYLX2mTw+7/aq5ak/gOE0og== @@ -79,16 +51,7 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.15.4", "@babel/generator@^7.7.2": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.4.tgz#85acb159a267ca6324f9793986991ee2022a05b0" - integrity sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw== - dependencies: - "@babel/types" "^7.15.4" - jsesc "^2.5.1" - source-map "^0.5.0" - -"@babel/generator@^7.15.8": +"@babel/generator@^7.15.4", "@babel/generator@^7.15.8", "@babel/generator@^7.7.2": version "7.15.8" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.8.tgz#fa56be6b596952ceb231048cf84ee499a19c0cd1" integrity sha512-ECmAKstXbp1cvpTTZciZCgfOt6iN64lR0d+euv3UZisU5awfRawOvg07Utn/qBGuH4bRIEZKrA/4LzZyXhZr8g== @@ -200,21 +163,7 @@ dependencies: "@babel/types" "^7.15.4" -"@babel/helper-module-transforms@^7.14.5", "@babel/helper-module-transforms@^7.15.4": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz#7da80c8cbc1f02655d83f8b79d25866afe50d226" - integrity sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw== - dependencies: - "@babel/helper-module-imports" "^7.15.4" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-simple-access" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" - "@babel/helper-validator-identifier" "^7.15.7" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" - -"@babel/helper-module-transforms@^7.15.8": +"@babel/helper-module-transforms@^7.14.5", "@babel/helper-module-transforms@^7.15.4", "@babel/helper-module-transforms@^7.15.8": version "7.15.8" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.8.tgz#d8c0e75a87a52e374a8f25f855174786a09498b2" integrity sha512-DfAfA6PfpG8t4S6npwzLvTUpp0sS7JrcuaMiy1Y5645laRJIp/LiLGIBbQKaXSInK8tiGNI7FL7L8UvB8gdUZg== @@ -318,12 +267,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.15.4", "@babel/parser@^7.15.5", "@babel/parser@^7.7.2": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.7.tgz#0c3ed4a2eb07b165dfa85b3cc45c727334c4edae" - integrity sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g== - -"@babel/parser@^7.15.8": +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.15.4", "@babel/parser@^7.15.8", "@babel/parser@^7.7.2": version "7.15.8" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.8.tgz#7bacdcbe71bdc3ff936d510c15dcea7cf0b99016" integrity sha512-BRYa3wcQnjS/nqI8Ac94pYYpJfojHVvVXJ97+IDCImX4Jc8W8Xv1+47enbruk+q1etOpsQNwnfFcNGw+gtPGxA== @@ -858,9 +802,9 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-transform-typescript@^7.15.0": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.15.4.tgz#db7a062dcf8be5fc096bc0eeb40a13fbfa1fa251" - integrity sha512-sM1/FEjwYjXvMwu1PJStH11kJ154zd/lpY56NQJ5qH2D0mabMv1CAy/kdvS9RP4Xgfj9fBBA3JiSLdDHgXdzOA== + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.15.8.tgz#ff0e6a47de9b2d58652123ab5a879b2ff20665d8" + integrity sha512-ZXIkJpbaf6/EsmjeTbiJN/yMxWPFWvlr7sEG1P95Xb4S4IBcrf2n7s/fItIhsAmOf8oSh3VJPDppO6ExfAfKRQ== dependencies: "@babel/helper-create-class-features-plugin" "^7.15.4" "@babel/helper-plugin-utils" "^7.14.5" @@ -961,9 +905,9 @@ semver "^6.3.0" "@babel/preset-modules@^0.1.4": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.4.tgz#362f2b68c662842970fdb5e254ffc8fc1c2e415e" - integrity sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg== + version "0.1.5" + resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.5.tgz#ef939d6e7f268827e1841638dc6ff95515e115d9" + integrity sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" @@ -1285,17 +1229,6 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.4.tgz#2430042a66e00dc5b140c3636f4474d464c21ee8" - integrity sha512-IDO2ezTxeMvQAHxzG/ZvEyA47q0aVfzT95rGFl7bZs/Go0aIucvfDbS2rmnoEdXxlLQhcolmoG/wvL/uKx4tKA== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^16.0.0" - chalk "^4.0.0" - "@jest/types@^27.2.5": version "27.2.5" resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.5.tgz#420765c052605e75686982d24b061b4cbba22132" @@ -2005,9 +1938,9 @@ fastq "^1.6.0" "@npmcli/ci-detect@^1.0.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@npmcli/ci-detect/-/ci-detect-1.3.0.tgz#6c1d2c625fb6ef1b9dea85ad0a5afcbef85ef22a" - integrity sha512-oN3y7FAROHhrAt7Rr7PnTSwrHrZVRTS2ZbyxeQwSSYD0ifwM3YNgQqbaRmjcWoPyq77MjchusjJDspbzMmip1Q== + version "1.4.0" + resolved "https://registry.yarnpkg.com/@npmcli/ci-detect/-/ci-detect-1.4.0.tgz#18478bbaa900c37bfbd8a2006a6262c62e8b0fe1" + integrity sha512-3BGrt6FLjqM6br5AhWRKTr3u5GIVkjRYeAFrMp3HjnfICrg4xOrVRwFavKT6tsp++bq5dluL5t8ME/Nha/6c1Q== "@npmcli/fs@^1.0.0": version "1.0.0" @@ -2048,9 +1981,9 @@ rimraf "^3.0.2" "@npmcli/node-gyp@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@npmcli/node-gyp/-/node-gyp-1.0.2.tgz#3cdc1f30e9736dbc417373ed803b42b1a0a29ede" - integrity sha512-yrJUe6reVMpktcvagumoqD9r08fH1iRo01gn1u0zoCApa9lnZGEigVKUd2hzsCId4gdtkZZIVscLhNxMECKgRg== + version "1.0.3" + resolved "https://registry.yarnpkg.com/@npmcli/node-gyp/-/node-gyp-1.0.3.tgz#a912e637418ffc5f2db375e93b85837691a43a33" + integrity sha512-fnkhw+fmX65kiLqk6E3BFLXNC26rUhK90zVwe2yncPliVT/Qos3xjhTLE59Df8KnPlcwIERXKVlU1bXoUQ+liA== "@npmcli/promise-spawn@^1.2.0", "@npmcli/promise-spawn@^1.3.2": version "1.3.2" @@ -2107,34 +2040,34 @@ "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^10.6.4": - version "10.6.4" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-10.6.4.tgz#c8b5b1f5c60ab7c62858abe2ef57bc709f426a30" - integrity sha512-JVmwWzYTIs6jACYOwD6zu5rdrqGIYsiAsLzTCxdrWIPNKNVjEF6vPTL20shmgJ4qZsq7WPBcLXLsaQD+NLChfg== +"@octokit/openapi-types@^11.2.0": + version "11.2.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-11.2.0.tgz#b38d7fc3736d52a1e96b230c1ccd4a58a2f400a6" + integrity sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz#e07896739618dab8da7d4077c658003775f95437" integrity sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw== -"@octokit/plugin-paginate-rest@^2.16.4": - version "2.16.7" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.16.7.tgz#d25b6e650ba5a007002986f5fda66958d44e70a4" - integrity sha512-TMlyVhMPx6La1Ud4PSY4YxqAvb9YPEMs/7R1nBSbsw4wNqG73aBqls0r0dRRCWe5Pm0ZUGS9a94N46iAxlOR8A== +"@octokit/plugin-paginate-rest@^2.16.8": + version "2.17.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.17.0.tgz#32e9c7cab2a374421d3d0de239102287d791bce7" + integrity sha512-tzMbrbnam2Mt4AhuyCHvpRkS0oZ5MvwwcQPYGtMv4tUa5kkzG58SVB0fcsLulOZQeRnOgdkZWkRUiyBlh0Bkyw== dependencies: - "@octokit/types" "^6.31.3" + "@octokit/types" "^6.34.0" "@octokit/plugin-request-log@^1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== -"@octokit/plugin-rest-endpoint-methods@5.11.4": - version "5.11.4" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.11.4.tgz#221dedcbdc45d6bfa54228d469e8c34acb4e0e34" - integrity sha512-iS+GYTijrPUiEiLoDsGJhrbXIvOPfm2+schvr+FxNMs7PeE9Nl4bAMhE8ftfNX3Z1xLxSKwEZh0O7GbWurX5HQ== +"@octokit/plugin-rest-endpoint-methods@^5.12.0": + version "5.13.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.13.0.tgz#8c46109021a3412233f6f50d28786f8e552427ba" + integrity sha512-uJjMTkN1KaOIgNtUPMtIXDOjx6dGYysdIFhgA52x4xSadQCz3b/zJexvITDVpANnfKPW/+E0xkOvLntqMYpviA== dependencies: - "@octokit/types" "^6.31.2" + "@octokit/types" "^6.34.0" deprecation "^2.3.1" "@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": @@ -2159,21 +2092,21 @@ universal-user-agent "^6.0.0" "@octokit/rest@^18.1.0": - version "18.11.4" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.11.4.tgz#9fb6d826244554fbf8c110b9064018d7198eec51" - integrity sha512-QplypCyYxqMK05JdMSm/bDWZO8VWWaBdzQ9tbF9rEV9rIEiICh+v6q+Vu/Y5hdze8JJaxfUC+PBC7vrnEkZvZg== + version "18.12.0" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.12.0.tgz#f06bc4952fc87130308d810ca9d00e79f6988881" + integrity sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q== dependencies: "@octokit/core" "^3.5.1" - "@octokit/plugin-paginate-rest" "^2.16.4" + "@octokit/plugin-paginate-rest" "^2.16.8" "@octokit/plugin-request-log" "^1.0.4" - "@octokit/plugin-rest-endpoint-methods" "5.11.4" + "@octokit/plugin-rest-endpoint-methods" "^5.12.0" -"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.31.2", "@octokit/types@^6.31.3": - version "6.31.3" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.31.3.tgz#14c2961baea853b2bf148d892256357a936343f8" - integrity sha512-IUG3uMpsLHrtEL6sCVXbxCgnbKcgpkS4K7gVEytLDvYYalkK3XcuMCHK1YPD8xJglSJAOAbL4MgXp47rS9G49w== +"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.34.0": + version "6.34.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.34.0.tgz#c6021333334d1ecfb5d370a8798162ddf1ae8218" + integrity sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw== dependencies: - "@octokit/openapi-types" "^10.6.4" + "@octokit/openapi-types" "^11.2.0" "@rollup/pluginutils@^4.1.0": version "4.1.1" @@ -2303,19 +2236,7 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== -"@types/node-fetch@^3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-3.0.3.tgz#9d969c9a748e841554a40ee435d26e53fa3ee899" - integrity sha512-HhggYPH5N+AQe/OmN6fmhKmRRt2XuNJow+R3pQwJxOOF9GuwM7O2mheyGeIrs5MOIeNjDEdgdoyHBOrFeJBR3g== - dependencies: - node-fetch "*" - -"@types/node@*", "@types/node@^16.10.2": - version "16.10.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.2.tgz#5764ca9aa94470adb4e1185fe2e9f19458992b2e" - integrity sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ== - -"@types/node@^16.11.4": +"@types/node@*", "@types/node@^16.10.2", "@types/node@^16.11.4": version "16.11.4" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.4.tgz#90771124822d6663814f7c1c9b45a6654d8fd964" integrity sha512-TMgXmy0v2xWyuCSCJM6NCna2snndD8yvQF67J29ipdzMcsPa9u+o0tjF5+EQNdhcuZplYuouYqpc4zcd5I6amQ== @@ -2341,9 +2262,9 @@ integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ== "@types/react-dom@>=16.9.0": - version "17.0.9" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.9.tgz#441a981da9d7be117042e1a6fd3dac4b30f55add" - integrity sha512-wIvGxLfgpVDSAMH5utdL9Ngm5Owu0VsGmldro3ORLXV8CShrL8awVj06NuEXFQ5xyaYfdca7Sgbk/50Ri1GdPg== + version "17.0.10" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.10.tgz#d6972ec018d23cf22b99597f1289343d99ea9d9d" + integrity sha512-8oz3NAUId2z/zQdFI09IMhQPNgIbiP8Lslhv39DIDamr846/0spjZK0vnrMak0iB8EKb9QFTTIdg2Wj2zH5a3g== dependencies: "@types/react" "*" @@ -2354,16 +2275,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@>=16.9.0", "@types/react@^17.0.27": - version "17.0.27" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.27.tgz#6498ed9b3ad117e818deb5525fa1946c09f2e0e6" - integrity sha512-zgiJwtsggVGtr53MndV7jfiUESTqrbxOcBvwfe6KS/9bzaVPCTDieTWnFNecVNx6EAaapg5xsLLWFfHHR437AA== - dependencies: - "@types/prop-types" "*" - "@types/scheduler" "*" - csstype "^3.0.2" - -"@types/react@^17.0.31": +"@types/react@*", "@types/react@>=16.9.0", "@types/react@^17.0.27", "@types/react@^17.0.31": version "17.0.31" resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.31.tgz#fe05ebf91ff3ae35bb6b13f6c1b461db8089dff8" integrity sha512-MQSR5EL4JZtdWRvqDgz9kXhSDDoy2zMTYyg7UhP+FZ5ttUOocWyxiqFJiI57sUG0BtaEX7WDXYQlkCYkb3X9vQ== @@ -2566,11 +2478,6 @@ ansi-regex@^2.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" @@ -2727,14 +2634,14 @@ babel-plugin-dynamic-import-node@^2.3.3: object.assign "^4.1.0" babel-plugin-istanbul@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz#e159ccdc9af95e0b570c75b4573b7c34d671d765" - integrity sha512-AF55rZXpe7trmEylbaE1Gv54wn6rwU03aptvRoVIGP8YykoSxqdVLV1TfwflBCE/QtHmqtP8SWlTENqbK8GCSQ== + version "6.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" + integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@istanbuljs/load-nyc-config" "^1.0.0" "@istanbuljs/schema" "^0.1.2" - istanbul-lib-instrument "^4.0.0" + istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" babel-plugin-jest-hoist@^27.2.0: @@ -2882,16 +2789,16 @@ browser-process-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== -browserslist@^4.16.6, browserslist@^4.17.1: - version "4.17.2" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.2.tgz#aa15dbd2fab399a399fe4df601bb09363c5458a6" - integrity sha512-jSDZyqJmkKMEMi7SZAgX5UltFdR5NAO43vY0AwTpu4X3sGH7GLLQ83KiUomgrnvZRCeW0yPPnKqnxPqQOER9zQ== +browserslist@^4.16.6, browserslist@^4.17.3: + version "4.17.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.4.tgz#72e2508af2a403aec0a49847ef31bd823c57ead4" + integrity sha512-Zg7RpbZpIJRW3am9Lyckue7PLytvVxxhJj1CaJVlCWENsGEAOlnlt8X0ZxGRPp7Bt9o8tIRM5SEXy4BCPMJjLQ== dependencies: - caniuse-lite "^1.0.30001261" - electron-to-chromium "^1.3.854" + caniuse-lite "^1.0.30001265" + electron-to-chromium "^1.3.867" escalade "^3.1.1" - nanocolors "^0.2.12" - node-releases "^1.1.76" + node-releases "^2.0.0" + picocolors "^1.0.0" bser@2.1.1: version "2.1.1" @@ -2981,10 +2888,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== -caniuse-lite@^1.0.30001261: - version "1.0.30001264" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001264.tgz#88f625a60efb6724c7c62ac698bc8dbd9757e55b" - integrity sha512-Ftfqqfcs/ePiUmyaySsQ4PUsdcYyXG2rfoBVsk3iY1ahHaJEw65vfb7Suzqm+cEkwwPIv/XWkg27iCpRavH4zA== +caniuse-lite@^1.0.30001265: + version "1.0.30001271" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001271.tgz#0dda0c9bcae2cf5407cd34cac304186616cc83e8" + integrity sha512-BBruZFWmt3HFdVPS8kceTBIguKxu4f99n5JNp06OlPD/luoAMIaIK5ieV5YjnBLH3Nysai9sxj9rpJj4ZisXOA== caseless@~0.12.0: version "0.12.0" @@ -3212,9 +3119,9 @@ commander@^4.0.1: integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== commander@^8.2.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-8.2.0.tgz#37fe2bde301d87d47a53adeff8b5915db1381ca8" - integrity sha512-LLKxDvHeL91/8MIyTAD5BFMNtoIwztGPMiM/7Bl8rIPmHCZXRxmSWr91h57dpOpnQ6jIUqEWdXE/uBYMfiVZDA== + version "8.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" + integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== commondir@^1.0.1: version "1.0.1" @@ -3347,17 +3254,17 @@ convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.6.0, safe-buffer "~5.1.1" core-js-compat@^3.16.0, core-js-compat@^3.16.2: - version "3.18.1" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.18.1.tgz#01942a0877caf9c6e5007c027183cf0bdae6a191" - integrity sha512-XJMYx58zo4W0kLPmIingVZA10+7TuKrMLPt83+EzDmxFJQUMcTVVmQ+n5JP4r6Z14qSzhQBRi3NSWoeVyKKXUg== + version "3.18.3" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.18.3.tgz#e0e7e87abc55efb547e7fa19169e45fa9df27a67" + integrity sha512-4zP6/y0a2RTHN5bRGT7PTq9lVt3WzvffTNjqnTKsXhkAYNDTkdCLOIfAdOLcQ/7TDdyRj3c+NeHe1NmF1eDScw== dependencies: - browserslist "^4.17.1" + browserslist "^4.17.3" semver "7.0.0" core-js@^3.0.0: - version "3.18.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.18.1.tgz#289d4be2ce0085d40fc1244c0b1a54c00454622f" - integrity sha512-vJlUi/7YdlCZeL6fXvWNaLUPh/id12WXj3MbkMw5uOyF0PfWPBNOCNbs53YqgrvtujLNlt9JQpruyIKkUZ+PKA== + version "3.18.3" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.18.3.tgz#86a0bba2d8ec3df860fefcc07a8d119779f01509" + integrity sha512-tReEhtMReZaPFVw7dajMx0vlsz3oOb8ajgPoHVYGxr8ErnZ6PcYEvvmjGmXlfpnxpkYSdOQttjB+MvVbCGfvLw== core-util-is@1.0.2: version "1.0.2" @@ -3612,10 +3519,10 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -electron-to-chromium@^1.3.854: - version "1.3.857" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.857.tgz#dcc239ff8a12b6e4b501e6a5ad20fd0d5a3210f9" - integrity sha512-a5kIr2lajm4bJ5E4D3fp8Y/BRB0Dx2VOcCRE5Gtb679mXIME/OFhWler8Gy2ksrf8gFX+EFCSIGA33FB3gqYpg== +electron-to-chromium@^1.3.867: + version "1.3.877" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.877.tgz#956870eea7c9d8cf43cc54ea40687fee4dc0c12a" + integrity sha512-fT5mW5Giw5iyVukeHb2XvB4joBKvzHtl8Vs3QzE7APATpFMt/T7RWyUcIKSZzYkKQgpMbu+vDBTCHfQZvh8klA== emittery@^0.8.1: version "0.8.1" @@ -3663,7 +3570,7 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.18.0-next.2: +es-abstract@^1.19.1: version "1.19.1" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== @@ -4537,9 +4444,9 @@ import-fresh@^3.0.0, import-fresh@^3.2.1: resolve-from "^4.0.0" import-local@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6" - integrity sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA== + version "3.0.3" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.3.tgz#4d51c2c495ca9393da259ec66b62e022920211e0" + integrity sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA== dependencies: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" @@ -4663,9 +4570,9 @@ is-ci@^2.0.0: ci-info "^2.0.0" is-core-module@^2.2.0, is-core-module@^2.5.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.7.0.tgz#3c0ef7d31b4acfc574f80c58409d568a836848e3" - integrity sha512-ByY+tjCciCr+9nLryBYcSD50EOGWt95c7tIsKTG1J2ixKKXPvF7Ej3AVd+UfDydAJom3biBGDBALaO79ktwgEQ== + version "2.8.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" + integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== dependencies: has "^1.0.3" @@ -4688,11 +4595,6 @@ is-fullwidth-code-point@^1.0.0: dependencies: number-is-nan "^1.0.0" -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" @@ -4863,11 +4765,11 @@ isstream@~0.1.2: integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= istanbul-lib-coverage@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.1.tgz#e8900b3ed6069759229cf30f7067388d148aeb5e" - integrity sha512-GvCYYTxaCPqwMjobtVcVKvSHtAGe48MNhGjpK8LtVF8K0ISX7hCKl85LgtuaSneWVyQmaGcW3iXVV3GaZSLpmQ== + version "3.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" + integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== -istanbul-lib-instrument@^4.0.0, istanbul-lib-instrument@^4.0.3: +istanbul-lib-instrument@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== @@ -4877,6 +4779,17 @@ istanbul-lib-instrument@^4.0.0, istanbul-lib-instrument@^4.0.3: istanbul-lib-coverage "^3.0.0" semver "^6.3.0" +istanbul-lib-instrument@^5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.0.4.tgz#e976f2aa66ebc6737f236d3ab05b76e36f885c80" + integrity sha512-W6jJF9rLGEISGoCyXRqa/JCGQGmmxPO10TMu7izaUTynxvBvTjqzAIIGCK9USBmIbQAaSWD6XJPrM9Pv5INknw== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.0.0" + semver "^6.3.0" + istanbul-lib-report@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" @@ -4887,18 +4800,18 @@ istanbul-lib-report@^3.0.0: supports-color "^7.1.0" istanbul-lib-source-maps@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz#75743ce6d96bb86dc7ee4352cf6366a23f0b1ad9" - integrity sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg== + version "4.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" + integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== dependencies: debug "^4.1.1" istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" istanbul-reports@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.2.tgz#d593210e5000683750cb09fc0644e4b6e27fd53b" - integrity sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw== + version "3.0.5" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.5.tgz#a2580107e71279ea6d661ddede929ffc6d693384" + integrity sha512-5+19PlhnGabNWB7kOFnuxT8H3T/iIyQzIbQMxXsURmmvKg86P2sbkrGOT77VnHw0Qr0gc2XzRaRfMZYYbSQCJQ== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" @@ -4982,17 +4895,7 @@ jest-config@^27.3.1: micromatch "^4.0.4" pretty-format "^27.3.1" -jest-diff@^27.0.0: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.4.tgz#171c51d3d2c105c457100fee6e7bf7cee51c8d8c" - integrity sha512-bLAVlDSCR3gqUPGv+4nzVpEXGsHh98HjUL7Vb2hVyyuBDoQmja8eJb0imUABsuxBeUVmf47taJSAd9nDrwWKEg== - dependencies: - chalk "^4.0.0" - diff-sequences "^27.0.6" - jest-get-type "^27.0.6" - pretty-format "^27.2.4" - -jest-diff@^27.3.1: +jest-diff@^27.0.0, jest-diff@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.3.1.tgz#d2775fea15411f5f5aeda2a5e02c2f36440f6d55" integrity sha512-PCeuAH4AWUo2O5+ksW4pL9v5xJAcIKPUPfIhZBcG1RKv/0+dvaWTQK1Nrau8d67dp65fOqbeMdoil+6PedyEPQ== @@ -5045,11 +4948,6 @@ jest-environment-node@^27.3.1: jest-mock "^27.3.0" jest-util "^27.3.1" -jest-get-type@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" - integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== - jest-get-type@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.3.1.tgz#a8a2b0a12b50169773099eee60a0e6dd11423eff" @@ -6013,11 +5911,6 @@ mute-stream@0.0.8, mute-stream@~0.0.4: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== -nanocolors@^0.2.12: - version "0.2.12" - resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.2.12.tgz#4d05932e70116078673ea4cc6699a1c56cc77777" - integrity sha512-SFNdALvzW+rVlzqexid6epYdt8H9Zol7xDoQarioEFcFN0JHo4CYNztAxmtfgGTVRCmFlEOqqhBpoFGKqSAMug== - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -6033,14 +5926,6 @@ neo-async@^2.6.0: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -node-fetch@*, node-fetch@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.0.0.tgz#79da7146a520036f2c5f644e4a26095f17e411ea" - integrity sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q== - dependencies: - data-uri-to-buffer "^3.0.1" - fetch-blob "^3.1.2" - node-fetch@^2.6.1: version "2.6.5" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.5.tgz#42735537d7f080a7e5f78b6c549b7146be1742fd" @@ -6048,6 +5933,14 @@ node-fetch@^2.6.1: dependencies: whatwg-url "^5.0.0" +node-fetch@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.0.0.tgz#79da7146a520036f2c5f644e4a26095f17e411ea" + integrity sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q== + dependencies: + data-uri-to-buffer "^3.0.1" + fetch-blob "^3.1.2" + node-gyp@^5.0.2: version "5.1.1" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-5.1.1.tgz#eb915f7b631c937d282e33aed44cb7a025f62a3e" @@ -6091,10 +5984,10 @@ node-modules-regexp@^1.0.0: resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= -node-releases@^1.1.76: - version "1.1.77" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.77.tgz#50b0cfede855dd374e7585bf228ff34e57c1c32e" - integrity sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ== +node-releases@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5" + integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA== nopt@^4.0.1: version "4.0.3" @@ -6287,13 +6180,13 @@ object.assign@^4.1.0, object.assign@^4.1.2: object-keys "^1.1.1" object.getownpropertydescriptors@^2.0.3: - version "2.1.2" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz#1bd63aeacf0d5d2d2f31b5e393b03a7c601a23f7" - integrity sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ== + version "2.1.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.3.tgz#b223cf38e17fefb97a63c10c91df72ccb386df9e" + integrity sha512-VdDoCwvJI4QdC6ndjpqFmoL3/+HxffFBbcJzKi5hwLLqqx3mdbedRpfZDdK0SrOSauj8X4GzBvnDZl4vTN7dOw== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" + es-abstract "^1.19.1" once@^1.3.0, once@^1.4.0: version "1.4.0" @@ -6567,6 +6460,11 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3: version "2.3.0" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" @@ -6635,17 +6533,7 @@ prettier@^2.0.1, prettier@^2.2.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== -pretty-format@^27.0.0, pretty-format@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.4.tgz#08ea39c5eab41b082852d7093059a091f6ddc748" - integrity sha512-NUjw22WJHldzxyps2YjLZkUj6q1HvjqFezkB9Y2cklN8NtVZN/kZEXGZdFw4uny3oENzV5EEMESrkI0YDUH8vg== - dependencies: - "@jest/types" "^27.2.4" - ansi-regex "^5.0.1" - ansi-styles "^5.0.0" - react-is "^17.0.1" - -pretty-format@^27.3.1: +pretty-format@^27.0.0, pretty-format@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.3.1.tgz#7e9486365ccdd4a502061fa761d3ab9ca1b78df5" integrity sha512-DR/c+pvFc52nLimLROYjnXPtolawm+uWDxr4FjuLDLUn+ktWnSN851KoHwHzzqq6rfCOjkzN8FLgDrSub6UDuA== @@ -6679,9 +6567,9 @@ promise-retry@^2.0.1: retry "^0.12.0" prompts@^2.0.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.1.tgz#befd3b1195ba052f9fd2fde8a486c4e82ee77f61" - integrity sha512-EQyfIuO2hPDsX1L/blblV+H7I0knhgAd82cVneCwcdND9B8AuCDuRcBH6yIcG4dFzlOUqbazQqwGjx5xmsNLuQ== + version "2.4.2" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" + integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== dependencies: kleur "^3.0.3" sisteransi "^1.0.5" @@ -6797,7 +6685,7 @@ react-test-renderer@^17.0.2: react-shallow-renderer "^16.13.1" scheduler "^0.20.2" -react@^17.0.2: +react@^17.0.27: version "17.0.2" resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== @@ -7503,15 +7391,7 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2": - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2: +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -7566,13 +7446,6 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -8216,11 +8089,11 @@ which@^2.0.1, which@^2.0.2: isexe "^2.0.0" wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + version "1.1.5" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" + integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== dependencies: - string-width "^1.0.2 || 2" + string-width "^1.0.2 || 2 || 3 || 4" widest-line@^3.1.0: version "3.1.0" From dcf0c40e2bbdb2a967dcaade26f7fad26f68a9a7 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Fri, 22 Oct 2021 21:28:49 -0300 Subject: [PATCH 23/49] update circleci image --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dc6ef567..37cedc1c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: cimg/node:14.15.1 + - image: cimg/node:16.12.0 steps: - checkout From 3629b748e23211adeb62ea5aad2bbce2ca1b7e8f Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Fri, 22 Oct 2021 21:35:23 -0300 Subject: [PATCH 24/49] update build script --- scripts/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.js b/scripts/build.js index 6bad0963..3d3010c7 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -4,7 +4,7 @@ let { exec } = require("child_process"); let pkgsRoot = join(__dirname, "..", "packages"); -let withDeps = ["react", "core"]; +let withDeps = ["react", "test-utils"]; let noDeps = readdirSync(pkgsRoot).filter((x) => !withDeps.some((y) => y === x)); let command = exec( From fe081fe77f725685bd7a29992529fa2bb4bb108c Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Fri, 22 Oct 2021 21:49:19 -0300 Subject: [PATCH 25/49] fix build --- packages/test-utils/package.json | 2 +- scripts/build.js | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index f6eb82b4..fcf99e34 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -7,6 +7,6 @@ "access": "public" }, "scripts": { - "build": "tsc" + "build": "tsc --declaration" } } diff --git a/scripts/build.js b/scripts/build.js index 3d3010c7..4706cf87 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -1,18 +1,10 @@ -let { readdirSync } = require("fs"); -let { join } = require("path"); let { exec } = require("child_process"); -let pkgsRoot = join(__dirname, "..", "packages"); - -let withDeps = ["react", "test-utils"]; -let noDeps = readdirSync(pkgsRoot).filter((x) => !withDeps.some((y) => y === x)); - -let command = exec( - [ - `lerna run --scope "@grafoo/*(${noDeps.join("|")})" build`, - `lerna run --scope "@grafoo/*(${withDeps.join("|")})" build` - ].join(" && ") +let commands = ["core", "bindings", "react", "test-utils", "compiler", "babel-plugin"].map( + (p) => `lerna run --scope @grafoo/${p} build` ); +let command = exec(commands.join(" && ")); + command.stdout.pipe(process.stdout); command.stderr.pipe(process.stderr); From 4d7cd5b95cf570faf2115f43089f15f8670c655c Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Sat, 23 Oct 2021 04:44:04 -0300 Subject: [PATCH 26/49] update gitignore --- .gitignore | 123 +++++++++++++++++++++++------------------------------ 1 file changed, 53 insertions(+), 70 deletions(-) diff --git a/.gitignore b/.gitignore index e7673510..9ada2288 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,11 @@ logs npm-debug.log* yarn-debug.log* yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json # Runtime data pids @@ -16,11 +21,12 @@ lib-cov # Coverage directory used by tools like istanbul coverage +*.lcov # nyc test coverage .nyc_output -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) @@ -36,8 +42,11 @@ build/Release node_modules/ jspm_packages/ -# Typescript v1 declaration files -typings/ +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo # Optional npm cache directory .npm @@ -45,6 +54,12 @@ typings/ # Optional eslint cache .eslintcache +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + # Optional REPL history .node_repl_history @@ -56,83 +71,51 @@ typings/ # dotenv environment variables file .env +.env.test +.env.production -# next.js build output -.next -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Typescript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history +# Next.js build output +.next +out -# Output of 'npm pack' -*.tgz +# Nuxt.js build / generate output +.nuxt +dist -# Yarn Integrity file -.yarn-integrity +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public -# dotenv environment variables file -.env +# vuepress build output +.vuepress/dist -# next.js build output -.next +# Serverless directories +.serverless/ -# vscode -.vscode +# FuseBox cache +.fusebox/ -# output directories -dist/ +# DynamoDB Local files +.dynamodb/ -# Typescript -.rpt2_cache +# TernJS port file +.tern-port -# temp folder -temp +# Stores VSCode versions used for testing VSCode extensions +.vscode-test -# mac +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* +# macos .DS_store From ba5a52485c120aad50e3b865afe0d80ade5ab182 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Sun, 24 Oct 2021 23:41:24 -0300 Subject: [PATCH 27/49] replace bundler --- package.json | 5 +- packages/bindings/package.json | 9 +- packages/core/package.json | 9 +- packages/core/src/tag.ts | 2 - packages/react/package.json | 11 +- yarn.lock | 1179 ++++++++++++++++++++++++++++++-- 6 files changed, 1139 insertions(+), 76 deletions(-) diff --git a/package.json b/package.json index 25df1966..46ea9085 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "@types/crypto-js": "^4.0.2", "@types/jest": "^27.0.2", "@types/node": "^16.11.4", - "@types/react": "^17.0.31", + "@types/react": "^17.0.32", "@types/uuid": "^8.3.1", "@types/ws": "^8.2.0", "@typescript-eslint/parser": "^5.1.0", @@ -87,8 +87,9 @@ "husky": "^7.0.4", "jest": "^27.3.1", "lerna": "^4.0.0", - "lint-staged": "^11.2.3", + "lint-staged": "^11.2.4", "lowdb": "^3.0.0", + "microbundle": "^0.14.1", "node-fetch": "^3.0.0", "prettier": "^2.2.1", "react": "^17.0.2", diff --git a/packages/bindings/package.json b/packages/bindings/package.json index b09f1801..08011711 100644 --- a/packages/bindings/package.json +++ b/packages/bindings/package.json @@ -3,8 +3,13 @@ "version": "1.4.3-next.0", "description": "grafoo client internal helper for building framework bindings", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/bindings", + "source": "./src/index.ts", "main": "dist/index.js", - "types": "dist/index.d.ts", + "module": "dist/index.js", + "exports": { + "require": "./dist/index.cjs", + "default": "./dist/index.modern.js" + }, "author": "malbernaz", "license": "MIT", "keywords": [ @@ -18,7 +23,7 @@ "access": "public" }, "scripts": { - "build": "grafoo-bundle --input src/index.ts", + "build": "microbundle", "test": "jest", "test:coverage": "jest --coverage" }, diff --git a/packages/core/package.json b/packages/core/package.json index 2c089d27..305277e7 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -3,8 +3,13 @@ "version": "1.4.3-next.0", "description": "grafoo client core", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/core", + "source": "./src/index.ts", "main": "dist/index.js", - "types": "dist/index.d.ts", + "module": "dist/index.js", + "exports": { + "require": "./dist/index.cjs", + "default": "./dist/index.modern.js" + }, "author": "malbernaz", "license": "MIT", "keywords": [ @@ -18,7 +23,7 @@ "access": "public" }, "scripts": { - "build": "grafoo-bundle --input src/index.ts", + "build": "microbundle", "test": "jest", "test:coverage": "jest --coverage" }, diff --git a/packages/core/src/tag.ts b/packages/core/src/tag.ts index 2ef18fb4..d5788435 100644 --- a/packages/core/src/tag.ts +++ b/packages/core/src/tag.ts @@ -1,5 +1,3 @@ -/* eslint-disable */ - import { GrafooQuery } from "./types"; export declare function graphql( diff --git a/packages/react/package.json b/packages/react/package.json index 4b556582..eb8d09ef 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -3,8 +3,13 @@ "version": "1.4.3-next.0", "description": "grafoo client react bindings", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/react", + "source": "./src/index.ts", "main": "dist/index.js", - "types": "dist/index.d.ts", + "module": "dist/index.js", + "exports": { + "require": "./dist/index.cjs", + "default": "./dist/index.modern.js" + }, "author": "malbernaz", "license": "MIT", "keywords": [ @@ -20,7 +25,7 @@ "access": "public" }, "scripts": { - "build": "grafoo-bundle --input src/index.ts", + "build": "microbundle", "test": "jest", "test:coverage": "jest --coverage", "tsc": "tsc --noEmit" @@ -44,6 +49,6 @@ "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974", "devDependencies": { "@types/node": "^16.10.2", - "@types/react": "^17.0.27" + "@types/react": "^17.0.32" } } diff --git a/yarn.lock b/yarn.lock index 69ddde9b..9fe626f3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -30,7 +30,7 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== -"@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.15.8", "@babel/core@^7.7.2", "@babel/core@^7.7.5": +"@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.12.10", "@babel/core@^7.12.3", "@babel/core@^7.15.8", "@babel/core@^7.7.2", "@babel/core@^7.7.5": version "7.15.8" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.8.tgz#195b9f2bffe995d2c6c159e72fe525b4114e8c10" integrity sha512-3UG9dsxvYBMYwRv+gS41WKHno4K60/9GPy1CJaH6xy3Elq8CTtvtjT5R5jmNhXfCYLX2mTw+7/aq5ak/gOE0og== @@ -85,7 +85,7 @@ browserslist "^4.16.6" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.14.5", "@babel/helper-create-class-features-plugin@^7.15.4": +"@babel/helper-create-class-features-plugin@^7.12.1", "@babel/helper-create-class-features-plugin@^7.14.5", "@babel/helper-create-class-features-plugin@^7.15.4": version "7.15.4" resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.15.4.tgz#7f977c17bd12a5fba363cb19bea090394bf37d2e" integrity sha512-7ZmzFi+DwJx6A7mHRwbuucEYpyBwmh2Ca0RvI6z2+WLZYCqV0JOaLb+u0zbtmDicebgKBZgqbYfLaKNqSgv5Pw== @@ -156,7 +156,7 @@ dependencies: "@babel/types" "^7.15.4" -"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.14.5", "@babel/helper-module-imports@^7.15.4": +"@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.14.5", "@babel/helper-module-imports@^7.15.4": version "7.15.4" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz#e18007d230632dea19b47853b984476e7b4e103f" integrity sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA== @@ -267,7 +267,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.15.4", "@babel/parser@^7.15.8", "@babel/parser@^7.7.2": +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.15.4", "@babel/parser@^7.15.8", "@babel/parser@^7.3.3", "@babel/parser@^7.7.2": version "7.15.8" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.8.tgz#7bacdcbe71bdc3ff936d510c15dcea7cf0b99016" integrity sha512-BRYa3wcQnjS/nqI8Ac94pYYpJfojHVvVXJ97+IDCImX4Jc8W8Xv1+47enbruk+q1etOpsQNwnfFcNGw+gtPGxA== @@ -290,6 +290,14 @@ "@babel/helper-remap-async-to-generator" "^7.15.4" "@babel/plugin-syntax-async-generators" "^7.8.4" +"@babel/plugin-proposal-class-properties@7.12.1": + version "7.12.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.12.1.tgz#a082ff541f2a29a4821065b8add9346c0c16e5de" + integrity sha512-cKp3dlQsFsEs5CWKnN7BnSHOd0EOW8EKpEjkoz1pO2E5KzIDNV9Ros1b0CnmbVgAGXJubOYVBOGCT1OmJwOI7w== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.12.1" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-proposal-class-properties@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.14.5.tgz#40d1ee140c5b1e31a350f4f5eed945096559b42e" @@ -451,7 +459,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-import-meta@^7.8.3": +"@babel/plugin-syntax-flow@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.14.5.tgz#2ff654999497d7d7d142493260005263731da180" + integrity sha512-9WK5ZwKCdWHxVuU13XNT6X73FGmutAXeor5lGFq6qhOFtMFUF4jkbijuyUdZZlpYq6E2hZeZf/u3959X9wsv0Q== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-import-meta@^7.10.4", "@babel/plugin-syntax-import-meta@^7.8.3": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== @@ -465,7 +480,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@^7.14.5": +"@babel/plugin-syntax-jsx@^7.12.1", "@babel/plugin-syntax-jsx@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.14.5.tgz#000e2e25d8673cce49300517a3eda44c263e4201" integrity sha512-ohuFIsOMXJnbOMRfX7/w7LocdR6R7whhuRD4ax8IipLcLPlZGJKkBxgHp++U4N/vKyU16/YDQr2f5seajD3jIw== @@ -615,6 +630,14 @@ "@babel/helper-builder-binary-assignment-operator-visitor" "^7.14.5" "@babel/helper-plugin-utils" "^7.14.5" +"@babel/plugin-transform-flow-strip-types@^7.12.10", "@babel/plugin-transform-flow-strip-types@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.14.5.tgz#0dc9c1d11dcdc873417903d6df4bed019ef0f85e" + integrity sha512-KhcolBKfXbvjwI3TV7r7TkYm8oNXHNBqGOy6JDVwtecFaRoKYsUUqJdS10q0YDKW1c6aZQgO+Ys3LfGkox8pXA== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-syntax-flow" "^7.14.5" + "@babel/plugin-transform-for-of@^7.15.4": version "7.15.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.15.4.tgz#25c62cce2718cfb29715f416e75d5263fb36a8c2" @@ -732,7 +755,7 @@ dependencies: "@babel/plugin-transform-react-jsx" "^7.14.5" -"@babel/plugin-transform-react-jsx@^7.14.5": +"@babel/plugin-transform-react-jsx@^7.12.11", "@babel/plugin-transform-react-jsx@^7.14.5": version "7.14.9" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.14.9.tgz#3314b2163033abac5200a869c4de242cd50a914c" integrity sha512-30PeETvS+AeD1f58i1OVyoDlVYQhap/K20ZrMjLmmzmC2AYR/G43D4sdJAaDAqCD3MYpSWbmrz3kES158QSLjw== @@ -751,7 +774,7 @@ "@babel/helper-annotate-as-pure" "^7.14.5" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-regenerator@^7.14.5": +"@babel/plugin-transform-regenerator@^7.12.1", "@babel/plugin-transform-regenerator@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.14.5.tgz#9676fd5707ed28f522727c5b3c0aa8544440b04f" integrity sha512-NVIY1W3ITDP5xQl50NgTKlZ0GrotKtLna08/uGY6ErQt6VEQZXla86x/CTddm5gZdcr+5GSsvMeTmWA5Ii6pkg== @@ -825,7 +848,7 @@ "@babel/helper-create-regexp-features-plugin" "^7.14.5" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/preset-env@^7.15.8": +"@babel/preset-env@^7.12.11", "@babel/preset-env@^7.15.8": version "7.15.8" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.15.8.tgz#f527ce5bcb121cd199f6b502bf23e420b3ff8dba" integrity sha512-rCC0wH8husJgY4FPbHsiYyiLxSY8oMDJH7Rl6RQMknbN9oDDHhM9RDFvnGM2MgkbUJzSQB4gtuwygY5mCqGSsA== @@ -904,6 +927,15 @@ core-js-compat "^3.16.0" semver "^6.3.0" +"@babel/preset-flow@^7.12.1": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.14.5.tgz#a1810b0780c8b48ab0bece8e7ab8d0d37712751c" + integrity sha512-pP5QEb4qRUSVGzzKx9xqRuHUrM/jEzMqdrZpdMA+oUCRgd5zM1qGr5y5+ZgAL/1tVv1H0dyk5t4SKJntqyiVtg== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-validator-option" "^7.14.5" + "@babel/plugin-transform-flow-strip-types" "^7.14.5" + "@babel/preset-modules@^0.1.4": version "0.1.5" resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.5.tgz#ef939d6e7f268827e1841638dc6ff95515e115d9" @@ -915,7 +947,7 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/preset-react@^7.0.0": +"@babel/preset-react@^7.0.0", "@babel/preset-react@^7.12.10": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.14.5.tgz#0fbb769513f899c2c56f3a882fa79673c2d4ab3c" integrity sha512-XFxBkjyObLvBaAvkx1Ie95Iaq4S/GUEIrejyrntQ/VCMKUYvKLoyKxOBzJ2kjA3b6rC9/KL6KXfDC2GqvLiNqQ== @@ -2108,6 +2140,62 @@ dependencies: "@octokit/openapi-types" "^11.2.0" +"@rollup/plugin-alias@^3.1.1": + version "3.1.8" + resolved "https://registry.yarnpkg.com/@rollup/plugin-alias/-/plugin-alias-3.1.8.tgz#645fd84659e08d3d1b059408fcdf69c1dd435a6b" + integrity sha512-tf7HeSs/06wO2LPqKNY3Ckbvy0JRe7Jyn98bXnt/gfrxbe+AJucoNJlsEVi9sdgbQtXemjbakCpO/76JVgnHpA== + dependencies: + slash "^3.0.0" + +"@rollup/plugin-babel@^5.2.2": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.0.tgz#9cb1c5146ddd6a4968ad96f209c50c62f92f9879" + integrity sha512-9uIC8HZOnVLrLHxayq/PTzw+uS25E14KPUBh5ktF+18Mjo5yK0ToMMx6epY0uEgkjwJw0aBW4x2horYXh8juWw== + dependencies: + "@babel/helper-module-imports" "^7.10.4" + "@rollup/pluginutils" "^3.1.0" + +"@rollup/plugin-commonjs@^17.0.0": + version "17.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-17.1.0.tgz#757ec88737dffa8aa913eb392fade2e45aef2a2d" + integrity sha512-PoMdXCw0ZyvjpCMT5aV4nkL0QywxP29sODQsSGeDpr/oI49Qq9tRtAsb/LbYbDzFlOydVEqHmmZWFtXJEAX9ew== + dependencies: + "@rollup/pluginutils" "^3.1.0" + commondir "^1.0.1" + estree-walker "^2.0.1" + glob "^7.1.6" + is-reference "^1.2.1" + magic-string "^0.25.7" + resolve "^1.17.0" + +"@rollup/plugin-json@^4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.1.0.tgz#54e09867ae6963c593844d8bd7a9c718294496f3" + integrity sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw== + dependencies: + "@rollup/pluginutils" "^3.0.8" + +"@rollup/plugin-node-resolve@^11.0.1": + version "11.2.1" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60" + integrity sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg== + dependencies: + "@rollup/pluginutils" "^3.1.0" + "@types/resolve" "1.17.1" + builtin-modules "^3.1.0" + deepmerge "^4.2.2" + is-module "^1.0.0" + resolve "^1.19.0" + +"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" + integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== + dependencies: + "@types/estree" "0.0.39" + estree-walker "^1.0.1" + picomatch "^2.2.2" + "@rollup/pluginutils@^4.1.0": version "4.1.1" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.1.tgz#1d4da86dd4eded15656a57d933fda2b9a08d47ec" @@ -2130,6 +2218,15 @@ dependencies: "@sinonjs/commons" "^1.7.0" +"@surma/rollup-plugin-off-main-thread@^2.2.2": + version "2.2.2" + resolved "https://registry.yarnpkg.com/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-2.2.2.tgz#12e062b299c9305c1e6c30fdac89c3222e0aa83f" + integrity sha512-dOD6nGZ79RmWKDRQuC7SOGXMvDkkLwBogu+epfVFMKiy2kOUtLZkb8wV/ettuMt37YJAJKYCKUmxSbZL2LkUQg== + dependencies: + ejs "^3.1.6" + json5 "^2.2.0" + magic-string "^0.25.0" + "@testing-library/react-hooks@^7.0.2": version "7.0.2" resolved "https://registry.yarnpkg.com/@testing-library/react-hooks/-/react-hooks-7.0.2.tgz#3388d07f562d91e7f2431a4a21b5186062ecfee0" @@ -2146,6 +2243,11 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== +"@trysound/sax@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" + integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA== + "@types/babel-plugin-tester@^9.0.0": version "9.0.4" resolved "https://registry.yarnpkg.com/@types/babel-plugin-tester/-/babel-plugin-tester-9.0.4.tgz#f5f9274149c6c789984f69ae4edbc383e33f679c" @@ -2192,6 +2294,16 @@ resolved "https://registry.yarnpkg.com/@types/crypto-js/-/crypto-js-4.0.2.tgz#4524325a175bf819fec6e42560c389ce1fb92c97" integrity sha512-sCVniU+h3GcGqxOmng11BRvf9TfN9yIs8KKjB8C8d75W69cpTfZG80gau9yTx5SxF3gvHGbJhdESzzvnjtf3Og== +"@types/estree@*": + version "0.0.50" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" + integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== + +"@types/estree@0.0.39": + version "0.0.39" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" + integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== + "@types/graceful-fs@^4.1.2": version "4.1.5" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" @@ -2275,10 +2387,10 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@>=16.9.0", "@types/react@^17.0.27", "@types/react@^17.0.31": - version "17.0.31" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.31.tgz#fe05ebf91ff3ae35bb6b13f6c1b461db8089dff8" - integrity sha512-MQSR5EL4JZtdWRvqDgz9kXhSDDoy2zMTYyg7UhP+FZ5ttUOocWyxiqFJiI57sUG0BtaEX7WDXYQlkCYkb3X9vQ== +"@types/react@*", "@types/react@>=16.9.0", "@types/react@^17.0.32": + version "17.0.32" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.32.tgz#89a161286bbe2325d4d516420a27364a324909f4" + integrity sha512-hAm1pmwA3oZWbkB985RFwNvBRMG0F3KWSiC4/hNmanigKZMiKQoH5Q6etNw8HIDztTGfvXyOjPvdNnvBUCuaPg== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -2291,6 +2403,13 @@ dependencies: "@types/node" "*" +"@types/resolve@1.17.1": + version "1.17.1" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" + integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== + dependencies: + "@types/node" "*" + "@types/scheduler@*": version "0.16.2" resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" @@ -2454,6 +2573,11 @@ ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +alphanum-sort@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" + integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM= + ansi-align@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" @@ -2483,6 +2607,11 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -2592,16 +2721,38 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== +async@0.9.x: + version "0.9.2" + resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d" + integrity sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0= + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= +asyncro@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/asyncro/-/asyncro-3.0.0.tgz#3c7a732e263bc4a42499042f48d7d858e9c0134e" + integrity sha512-nEnWYfrBmA3taTiuiOoZYmgJ/CNrSoQLeLs29SeLcPu60yaw/mHDBHV0iOZ051fTvsTHxpCY+gXibqT9wbQYfg== + at-least-node@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== +autoprefixer@^10.1.0: + version "10.3.7" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.3.7.tgz#cef2562058406bd378c94aacda36bb46a97b3186" + integrity sha512-EmGpu0nnQVmMhX8ROoJ7Mx8mKYPlcUHuxkwrRYEYMz85lu7H09v8w6R1P0JPdn/hKU32GjpLBFEOuIlDWCRWvg== + dependencies: + browserslist "^4.17.3" + caniuse-lite "^1.0.30001264" + fraction.js "^4.1.1" + normalize-range "^0.1.2" + picocolors "^0.2.1" + postcss-value-parser "^4.1.0" + aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" @@ -2661,6 +2812,15 @@ babel-plugin-jsx-pragmatic@^1.0.2: dependencies: babel-plugin-syntax-jsx "^6.0.0" +babel-plugin-macros@^3.0.1: + version "3.1.0" + resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" + integrity sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg== + dependencies: + "@babel/runtime" "^7.12.5" + cosmiconfig "^7.0.0" + resolve "^1.19.0" + babel-plugin-polyfill-corejs2@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz#e9124785e6fd94f94b618a7954e5693053bf5327" @@ -2700,6 +2860,18 @@ babel-plugin-tester@^10.0.0: prettier "^2.0.1" strip-indent "^3.0.0" +babel-plugin-transform-async-to-promises@^0.8.15: + version "0.8.15" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-promises/-/babel-plugin-transform-async-to-promises-0.8.15.tgz#13b6d8ef13676b4e3c576d3600b85344bb1ba346" + integrity sha512-fDXP68ZqcinZO2WCiimCL9zhGjGXOnn3D33zvbh+yheZ/qOrNVVDDIBtAaM3Faz8TRvQzHiRKsu3hfrBAhEncQ== + +babel-plugin-transform-replace-expressions@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-replace-expressions/-/babel-plugin-transform-replace-expressions-0.2.0.tgz#59cba8df4b4a675e7c78cd21548f8e7685bbc30d" + integrity sha512-Eh1rRd9hWEYgkgoA3D0kGp7xJ/wgVshgsqmq60iC4HVWD+Lux+fNHSHBa2v1Hsv+dHflShC71qKhiH40OiPtDA== + dependencies: + "@babel/parser" "^7.3.3" + babel-preset-current-node-syntax@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" @@ -2743,11 +2915,21 @@ before-after-hook@^2.2.0: resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.2.tgz#a6e8ca41028d90ee2c24222f201c90956091613e" integrity sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ== +big.js@^5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" + integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== + binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== +boolbase@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= + boxen@^5.0.0: version "5.1.2" resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" @@ -2777,7 +2959,7 @@ braces@^3.0.1, braces@~3.0.2: dependencies: fill-range "^7.0.1" -brotli-size@4.0.0: +brotli-size@4.0.0, brotli-size@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/brotli-size/-/brotli-size-4.0.0.tgz#a05ee3faad3c0e700a2f2da826ba6b4d76e69e5e" integrity sha512-uA9fOtlTRC0iqKfzff1W34DXUA3GyVqbUaeo3Rw3d4gd1eavKVCETXrn3NzO74W+UVkG3UHu8WxUi+XvKI/huA== @@ -2789,15 +2971,15 @@ browser-process-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== -browserslist@^4.16.6, browserslist@^4.17.3: - version "4.17.4" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.4.tgz#72e2508af2a403aec0a49847ef31bd823c57ead4" - integrity sha512-Zg7RpbZpIJRW3am9Lyckue7PLytvVxxhJj1CaJVlCWENsGEAOlnlt8X0ZxGRPp7Bt9o8tIRM5SEXy4BCPMJjLQ== +browserslist@^4.0.0, browserslist@^4.16.0, browserslist@^4.16.6, browserslist@^4.17.3: + version "4.17.5" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.5.tgz#c827bbe172a4c22b123f5e337533ceebadfdd559" + integrity sha512-I3ekeB92mmpctWBoLXe0d5wPS2cBuRvvW0JyyJHMrk9/HmP2ZjrTboNAZ8iuGqaEIlKguljbQY32OkOJIRrgoA== dependencies: - caniuse-lite "^1.0.30001265" - electron-to-chromium "^1.3.867" + caniuse-lite "^1.0.30001271" + electron-to-chromium "^1.3.878" escalade "^3.1.1" - node-releases "^2.0.0" + node-releases "^2.0.1" picocolors "^1.0.0" bser@2.1.1: @@ -2888,7 +3070,17 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== -caniuse-lite@^1.0.30001265: +caniuse-api@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-3.0.0.tgz#5e4d90e2274961d46291997df599e3ed008ee4c0" + integrity sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw== + dependencies: + browserslist "^4.0.0" + caniuse-lite "^1.0.0" + lodash.memoize "^4.1.2" + lodash.uniq "^4.5.0" + +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001264, caniuse-lite@^1.0.30001271: version "1.0.30001271" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001271.tgz#0dda0c9bcae2cf5407cd34cac304186616cc83e8" integrity sha512-BBruZFWmt3HFdVPS8kceTBIguKxu4f99n5JNp06OlPD/luoAMIaIK5ieV5YjnBLH3Nysai9sxj9rpJj4ZisXOA== @@ -2906,7 +3098,18 @@ casual@^1.5.19: mersenne-twister "^1.0.1" moment "^2.15.2" -chalk@^2.0.0: +chalk@^1.0.0, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + 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" + +chalk@^2.0.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -3083,11 +3286,21 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +colord@^2.0.1, colord@^2.6: + version "2.9.1" + resolved "https://registry.yarnpkg.com/colord/-/colord-2.9.1.tgz#c961ea0efeb57c9f0f4834458f26cb9cc4a3f90e" + integrity sha512-4LBMSt09vR0uLnPVkOUBnmxgoaeN4ewRbx801wY/bXcltXfpR/G46OdWn96XpYmCWuYvO46aBZP4NgX8HpNAcw== + colorette@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40" integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g== +colorette@^2.0.16: + version "2.0.16" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.16.tgz#713b9af84fdb000139f04546bd4a93f62a5085da" + integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g== + colors@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" @@ -3118,6 +3331,11 @@ commander@^4.0.1: resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== +commander@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== + commander@^8.2.0: version "8.3.0" resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" @@ -3151,6 +3369,13 @@ concat-stream@^2.0.0: readable-stream "^3.0.2" typedarray "^0.0.6" +concat-with-sourcemaps@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz#d4ea93f05ae25790951b99e7b3b09e3908a4082e" + integrity sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg== + dependencies: + source-map "^0.6.1" + config-chain@^1.1.12: version "1.1.13" resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.13.tgz#fad0795aa6a6cdaff9ed1b68e9dff94372c232f4" @@ -3221,9 +3446,9 @@ conventional-commits-filter@^2.0.7: modify-values "^1.0.0" conventional-commits-parser@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.2.2.tgz#190fb9900c6e02be0c0bca9b03d57e24982639fd" - integrity sha512-Jr9KAKgqAkwXMRHjxDwO/zOCDKod1XdAESHAGuJX38iZ7ZzVti/tvVoysO0suMsdAObp9NQ2rHSsSbnAqZ5f5g== + version "3.2.3" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.2.3.tgz#fc43704698239451e3ef35fd1d8ed644f46bd86e" + integrity sha512-YyRDR7On9H07ICFpRm/igcdjIqebXbvf4Cff+Pf0BrBys1i1EOzx9iFXNlAbdrLAR8jf7bkUYkDAr8pEy0q4Pw== dependencies: JSONStream "^1.0.4" is-text-path "^1.0.1" @@ -3276,7 +3501,7 @@ core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== -cosmiconfig@^7.0.0, cosmiconfig@^7.0.1: +cosmiconfig@^7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== @@ -3301,6 +3526,104 @@ crypto-js@^4.0.0: resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.1.1.tgz#9e485bcf03521041bd85844786b83fb7619736cf" integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw== +css-color-names@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-1.0.1.tgz#6ff7ee81a823ad46e020fa2fd6ab40a887e2ba67" + integrity sha512-/loXYOch1qU1biStIFsHH8SxTmOseh1IJqFvy8IujXOm1h+QjUdDhkzOrR5HG8K8mlxREj0yfi8ewCHx0eMxzA== + +css-declaration-sorter@^6.0.3: + version "6.1.3" + resolved "https://registry.yarnpkg.com/css-declaration-sorter/-/css-declaration-sorter-6.1.3.tgz#e9852e4cf940ba79f509d9425b137d1f94438dc2" + integrity sha512-SvjQjNRZgh4ULK1LDJ2AduPKUKxIqmtU7ZAyi47BTV+M90Qvxr9AB6lKlLbDUfXqI9IQeYA8LbAsCZPpJEV3aA== + dependencies: + timsort "^0.3.0" + +css-select@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.1.3.tgz#a70440f70317f2669118ad74ff105e65849c7067" + integrity sha512-gT3wBNd9Nj49rAbmtFHj1cljIAOLYSX1nZ8CB7TBO3INYckygm5B7LISU/szY//YmdiSLbJvDLOx9VnMVpMBxA== + dependencies: + boolbase "^1.0.0" + css-what "^5.0.0" + domhandler "^4.2.0" + domutils "^2.6.0" + nth-check "^2.0.0" + +css-tree@^1.1.2, css-tree@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.1.3.tgz#eb4870fb6fd7707327ec95c2ff2ab09b5e8db91d" + integrity sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q== + dependencies: + mdn-data "2.0.14" + source-map "^0.6.1" + +css-what@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.1.0.tgz#3f7b707aadf633baf62c2ceb8579b545bb40f7fe" + integrity sha512-arSMRWIIFY0hV8pIxZMEfmMI47Wj3R/aWpZDDxWYCPEiOMv6tfOrnpDtgxBYPEQD4V0Y/958+1TdC3iWTFcUPw== + +cssesc@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" + integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== + +cssnano-preset-default@^5.1.4: + version "5.1.4" + resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-5.1.4.tgz#359943bf00c5c8e05489f12dd25f3006f2c1cbd2" + integrity sha512-sPpQNDQBI3R/QsYxQvfB4mXeEcWuw0wGtKtmS5eg8wudyStYMgKOQT39G07EbW1LB56AOYrinRS9f0ig4Y3MhQ== + dependencies: + css-declaration-sorter "^6.0.3" + cssnano-utils "^2.0.1" + postcss-calc "^8.0.0" + postcss-colormin "^5.2.0" + postcss-convert-values "^5.0.1" + postcss-discard-comments "^5.0.1" + postcss-discard-duplicates "^5.0.1" + postcss-discard-empty "^5.0.1" + postcss-discard-overridden "^5.0.1" + postcss-merge-longhand "^5.0.2" + postcss-merge-rules "^5.0.2" + postcss-minify-font-values "^5.0.1" + postcss-minify-gradients "^5.0.2" + postcss-minify-params "^5.0.1" + postcss-minify-selectors "^5.1.0" + postcss-normalize-charset "^5.0.1" + postcss-normalize-display-values "^5.0.1" + postcss-normalize-positions "^5.0.1" + postcss-normalize-repeat-style "^5.0.1" + postcss-normalize-string "^5.0.1" + postcss-normalize-timing-functions "^5.0.1" + postcss-normalize-unicode "^5.0.1" + postcss-normalize-url "^5.0.2" + postcss-normalize-whitespace "^5.0.1" + postcss-ordered-values "^5.0.2" + postcss-reduce-initial "^5.0.1" + postcss-reduce-transforms "^5.0.1" + postcss-svgo "^5.0.2" + postcss-unique-selectors "^5.0.1" + +cssnano-utils@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/cssnano-utils/-/cssnano-utils-2.0.1.tgz#8660aa2b37ed869d2e2f22918196a9a8b6498ce2" + integrity sha512-i8vLRZTnEH9ubIyfdZCAdIdgnHAUeQeByEeQ2I7oTilvP9oHO6RScpeq3GsFUVqeB8uZgOQ9pw8utofNn32hhQ== + +cssnano@^5.0.1: + version "5.0.8" + resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-5.0.8.tgz#39ad166256980fcc64faa08c9bb18bb5789ecfa9" + integrity sha512-Lda7geZU0Yu+RZi2SGpjYuQz4HI4/1Y+BhdD0jL7NXAQ5larCzVn+PUGuZbDMYz904AXXCOgO5L1teSvgu7aFg== + dependencies: + cssnano-preset-default "^5.1.4" + is-resolvable "^1.1.0" + lilconfig "^2.0.3" + yaml "^1.10.2" + +csso@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/csso/-/csso-4.2.0.tgz#ea3a561346e8dc9f546d6febedd50187cf389529" + integrity sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA== + dependencies: + css-tree "^1.1.2" + cssom@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" @@ -3480,6 +3803,20 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" +dom-serializer@^1.0.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.3.2.tgz#6206437d32ceefaec7161803230c7a20bc1b4d91" + integrity sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig== + dependencies: + domelementtype "^2.0.1" + domhandler "^4.2.0" + entities "^2.0.0" + +domelementtype@^2.0.1, domelementtype@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.2.0.tgz#9a0b6c2782ed6a1c7323d42267183df9bd8b1d57" + integrity sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A== + domexception@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" @@ -3487,6 +3824,22 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" +domhandler@^4.2.0: + version "4.2.2" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.2.2.tgz#e825d721d19a86b8c201a35264e226c678ee755f" + integrity sha512-PzE9aBMsdZO8TK4BnuJwH0QT41wgMbRzuZrHUcpYncEjmQazq8QEaBWgLG7ZyC/DAZKEgglpIA6j4Qn/HmxS3w== + dependencies: + domelementtype "^2.2.0" + +domutils@^2.6.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" + integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A== + dependencies: + dom-serializer "^1.0.1" + domelementtype "^2.2.0" + domhandler "^4.2.0" + dot-prop@^5.1.0: version "5.3.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" @@ -3519,10 +3872,17 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -electron-to-chromium@^1.3.867: - version "1.3.877" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.877.tgz#956870eea7c9d8cf43cc54ea40687fee4dc0c12a" - integrity sha512-fT5mW5Giw5iyVukeHb2XvB4joBKvzHtl8Vs3QzE7APATpFMt/T7RWyUcIKSZzYkKQgpMbu+vDBTCHfQZvh8klA== +ejs@^3.1.6: + version "3.1.6" + resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.6.tgz#5bfd0a0689743bb5268b3550cceeebbc1702822a" + integrity sha512-9lt9Zse4hPucPkoP7FHDF0LQAlGyF9JVpnClFLFH3aSSbxmyoqINRpp/9wePWJTUl4KOQwRL72Iw3InHPDkoGw== + dependencies: + jake "^10.6.1" + +electron-to-chromium@^1.3.878: + version "1.3.878" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.878.tgz#baa9fb5c24b9b580f08fb245cbb52a22f8fc8fa8" + integrity sha512-O6yxWCN9ph2AdspAIszBnd9v8s11hQx8ub9w4UGApzmNRnoKhbulOWqbO8THEQec/aEHtvy+donHZMlh6l1rbA== emittery@^0.8.1: version "0.8.1" @@ -3534,6 +3894,11 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +emojis-list@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" + integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== + encoding@^0.1.12: version "0.1.13" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" @@ -3548,6 +3913,11 @@ enquirer@^2.3.5, enquirer@^2.3.6: dependencies: ansi-colors "^4.1.1" +entities@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" + integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== + env-paths@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" @@ -3610,7 +3980,7 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= @@ -3751,6 +4121,11 @@ estree-walker@^0.6.1: resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== +estree-walker@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" + integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== + estree-walker@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" @@ -3892,6 +4267,14 @@ fetch-mock@^9.11.0: querystring "^0.2.0" whatwg-url "^6.5.0" +figures@^1.0.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + integrity sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4= + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + figures@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" @@ -3906,6 +4289,13 @@ file-entry-cache@^6.0.1: dependencies: flat-cache "^3.0.4" +filelist@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.2.tgz#80202f21462d4d1c2e214119b1807c1bc0380e5b" + integrity sha512-z7O0IS8Plc39rTCq6i6iHxk43duYOn8uFJiWSewIq0Bww1RNybVHSCjahmcC87ZqAm4OTvFzlzeGu3XAzG1ctQ== + dependencies: + minimatch "^3.0.4" + filesize@^6.1.0: version "6.4.0" resolved "https://registry.yarnpkg.com/filesize/-/filesize-6.4.0.tgz#914f50471dd66fdca3cefe628bd0cde4ef769bcd" @@ -3999,6 +4389,11 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" +fraction.js@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.1.1.tgz#ac4e520473dae67012d618aab91eda09bcb400ff" + integrity sha512-MHOhvvxHTfRFpF1geTK9czMIZ6xclsEor2wkIGYYq+PxcQqT7vStJqjhe6S1TenZrMZzo+wlqOufBDVepUEgPg== + fs-extra@8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" @@ -4071,6 +4466,13 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" +generic-names@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/generic-names/-/generic-names-2.0.1.tgz#f8a378ead2ccaa7a34f0317b05554832ae41b872" + integrity sha512-kPCHWa1m9wGG/OwQpeweTwM/PYiQLrUIxXbt/P4Nic3LbGjCP0YwrALHW1uNLKZ0LIMg+RF+XRlj2ekT9ZlZAQ== + dependencies: + loader-utils "^1.1.0" + gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -4227,6 +4629,11 @@ globals@^13.6.0, globals@^13.9.0: dependencies: type-fest "^0.20.2" +globalyzer@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/globalyzer/-/globalyzer-0.1.0.tgz#cb76da79555669a1519d5a8edf093afaa0bf1465" + integrity sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q== + globby@^11.0.2, globby@^11.0.4: version "11.0.4" resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" @@ -4239,6 +4646,11 @@ globby@^11.0.2, globby@^11.0.4: merge2 "^1.3.0" slash "^3.0.0" +globrex@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098" + integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg== + graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.3, graceful-fs@^4.2.4: version "4.2.8" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" @@ -4256,6 +4668,13 @@ graphql@^15.6.1: resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.6.1.tgz#9125bdf057553525da251e19e96dab3d3855ddfc" integrity sha512-3i5lu0z6dRvJ48QP9kFxBkJ7h4Kso7PS8eahyTFz5Jm6CvQfLtNIE8LX9N6JLnXTuwR+sIYnXzaWp6anOg0QQw== +gzip-size@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-3.0.0.tgz#546188e9bdc337f673772f81660464b389dce520" + integrity sha1-VGGI6b3DN/Zzdy+BZgRks4nc5SA= + dependencies: + duplexer "^0.1.1" + gzip-size@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-6.0.0.tgz#065367fd50c239c0671cbcbad5be3e2eeb10e462" @@ -4293,6 +4712,13 @@ hard-rejection@^2.1.0: resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + has-bigints@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" @@ -4418,6 +4844,16 @@ iconv-lite@^0.6.2: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" +icss-replace-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz#06ea6f83679a7749e386cfe1fe812ae5db223ded" + integrity sha1-Bupvg2ead0njhs/h/oEq5dsiPe0= + +icss-utils@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae" + integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA== + ignore-walk@3.0.4, ignore-walk@^3.0.3: version "3.0.4" resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.4.tgz#c9a09f69b7c7b479a5d74ac1a3c0d4236d2a6335" @@ -4435,6 +4871,13 @@ ignore@^5.1.4: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== +import-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-3.0.0.tgz#20845547718015126ea9b3676b7592fb8bd4cf92" + integrity sha512-4pnzH16plW+hgvRECbDWpQl3cqtvSofHWh44met7ESfZ8UZOWWddm8hEyDTqREJ9RbYHY8gi8DqmaelApoOGMg== + dependencies: + import-from "^3.0.0" + import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -4443,6 +4886,13 @@ import-fresh@^3.0.0, import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" +import-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-from/-/import-from-3.0.0.tgz#055cfec38cd5a27d8057ca51376d7d3bf0891966" + integrity sha512-CiuXOFFSzkU5x/CR0+z7T91Iht4CXgfCxVOFRhh2Zyhg5wOpWvvDLQUsWl+gcN+QscYBjez8hDCt85O7RLDttQ== + dependencies: + resolve-from "^5.0.0" + import-local@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.3.tgz#4d51c2c495ca9393da259ec66b62e022920211e0" @@ -4530,6 +4980,11 @@ ip@^1.1.5: resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= +is-absolute-url@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-3.0.3.tgz#96c6a22b6a23929b11ea0afb1836c36ad4a5d698" + integrity sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q== + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -4676,6 +5131,13 @@ is-potential-custom-element-name@^1.0.1: resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== +is-reference@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" + integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== + dependencies: + "@types/estree" "*" + is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -4689,6 +5151,11 @@ is-regexp@^1.0.0: resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= +is-resolvable@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" + integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== + is-shared-array-buffer@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" @@ -4816,6 +5283,16 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +jake@^10.6.1: + version "10.8.2" + resolved "https://registry.yarnpkg.com/jake/-/jake-10.8.2.tgz#ebc9de8558160a66d82d0eadc6a2e58fbc500a7b" + integrity sha512-eLpKyrfG3mzvGE2Du8VoPbeSkRry093+tyNjdYaBbJS9v17knImYGNXQCUV0gLxQtF82m3E8iRb/wdSQZLoq7A== + dependencies: + async "0.9.x" + chalk "^2.4.2" + filelist "^1.0.1" + minimatch "^3.0.4" + jest-changed-files@^27.3.0: version "27.3.0" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.3.0.tgz#22a02cc2b34583fc66e443171dc271c0529d263c" @@ -5333,7 +5810,14 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -json5@^2.1.2: +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + dependencies: + minimist "^1.2.0" + +json5@^2.1.2, json5@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== @@ -5381,6 +5865,11 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== +kleur@^4.1.3: + version "4.1.4" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.4.tgz#8c202987d7e577766d039a8cd461934c01cda04d" + integrity sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA== + lerna@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/lerna/-/lerna-4.0.0.tgz#b139d685d50ea0ca1be87713a7c2f44a5b678e9e" @@ -5447,23 +5936,29 @@ libnpmpublish@^4.0.0: semver "^7.1.3" ssri "^8.0.1" +lilconfig@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.3.tgz#68f3005e921dafbd2a2afb48379986aa6d2579fd" + integrity sha512-EHKqr/+ZvdKCifpNrJCKxBTgk5XupZA3y/aCPY9mxfgBzmgh93Mt/WqjjQ38oMxXuvDokaKiM3lAgvSH2sjtHg== + lines-and-columns@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= -lint-staged@^11.2.3: - version "11.2.3" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-11.2.3.tgz#fc3f4569cc4f46553309dfc1447b8aef69f744fb" - integrity sha512-Tfmhk8O2XFMD25EswHPv+OYhUjsijy5D7liTdxeXvhG2rsadmOLFtyj8lmlfoFFXY8oXWAIOKpoI+lJe1DB1mw== +lint-staged@^11.2.4: + version "11.2.4" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-11.2.4.tgz#29bc84e0318e6e9d4a7a043513236d066e39ee1d" + integrity sha512-aTUqcPDSV05EyKlMT4N5h7tmnevKfAxI3xZkRb+DHfmcFaoCxfxVvpqlLMCVGy3EYle9JYER2nA5zc4eNTkZVQ== dependencies: cli-truncate "2.1.0" colorette "^1.4.0" commander "^8.2.0" - cosmiconfig "^7.0.1" debug "^4.3.2" enquirer "^2.3.6" execa "^5.1.1" + js-yaml "^4.1.0" + lilconfig "^2.0.3" listr2 "^3.12.2" micromatch "^4.0.4" normalize-path "^3.0.0" @@ -5473,12 +5968,12 @@ lint-staged@^11.2.3: supports-color "8.1.1" listr2@^3.12.2: - version "3.12.2" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.12.2.tgz#2d55cc627111603ad4768a9e87c9c7bb9b49997e" - integrity sha512-64xC2CJ/As/xgVI3wbhlPWVPx0wfTqbUAkpb7bjDi0thSWMqrf07UFhrfsGoo8YSXmF049Rp9C0cjLC8rZxK9A== + version "3.13.1" + resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.13.1.tgz#816e8c1728d50f223795f530d72d248c7fa14602" + integrity sha512-pk4YBDA2cxtpM8iLHbz6oEsfZieJKHf6Pt19NlKaHZZVpqHyVs/Wqr7RfBBCeAFCJchGO7WQHVkUPZTvJMHk8w== dependencies: cli-truncate "^2.1.0" - colorette "^1.4.0" + colorette "^2.0.16" log-update "^4.0.0" p-map "^4.0.0" rxjs "^6.6.7" @@ -5505,6 +6000,15 @@ load-json-file@^6.2.0: strip-bom "^4.0.0" type-fest "^0.6.0" +loader-utils@^1.1.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" + integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== + dependencies: + big.js "^5.2.2" + emojis-list "^3.0.0" + json5 "^1.0.1" + locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -5533,6 +6037,11 @@ lodash._reinterpolate@^3.0.0: resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY= + lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -5548,6 +6057,11 @@ lodash.ismatch@^4.4.0: resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" integrity sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc= +lodash.memoize@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" + integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= + lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" @@ -5578,6 +6092,11 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" +lodash.uniq@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" + integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= + lodash@^4.17.15, lodash@^4.17.19, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -5614,6 +6133,13 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +magic-string@^0.25.0, magic-string@^0.25.7: + version "0.25.7" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" + integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== + dependencies: + sourcemap-codec "^1.4.4" + make-dir@^2.0.0, make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -5672,12 +6198,12 @@ make-fetch-happen@^9.0.1: socks-proxy-agent "^6.0.0" ssri "^8.0.0" -makeerror@1.0.x: - version "1.0.11" - resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" - integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= +makeerror@1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" + integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== dependencies: - tmpl "1.0.x" + tmpl "1.0.5" map-obj@^1.0.0: version "1.0.1" @@ -5689,6 +6215,21 @@ map-obj@^4.0.0: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== +maxmin@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/maxmin/-/maxmin-2.1.0.tgz#4d3b220903d95eee7eb7ac7fa864e72dc09a3166" + integrity sha1-TTsiCQPZXu5+t6x/qGTnLcCaMWY= + dependencies: + chalk "^1.0.0" + figures "^1.0.1" + gzip-size "^3.0.0" + pretty-bytes "^3.0.0" + +mdn-data@2.0.14: + version "2.0.14" + resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" + integrity sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow== + meow@^8.0.0: version "8.1.2" resolved "https://registry.yarnpkg.com/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897" @@ -5721,6 +6262,53 @@ mersenne-twister@^1.0.1: resolved "https://registry.yarnpkg.com/mersenne-twister/-/mersenne-twister-1.1.0.tgz#f916618ee43d7179efcf641bec4531eb9670978a" integrity sha1-+RZhjuQ9cXnvz2Qb7EUx65Zwl4o= +microbundle@^0.14.1: + version "0.14.1" + resolved "https://registry.yarnpkg.com/microbundle/-/microbundle-0.14.1.tgz#a7de2dfa2efce01233dc494bd8dccb4570804aa4" + integrity sha512-/JAAPKWRyvBV0QjmmhgPU9NGuX3Tk1u8EXuMJ+6npFmnm+EtuL8IpJihxmljpUwaoHLyDy+b2ntfWoN6BkDQzA== + dependencies: + "@babel/core" "^7.12.10" + "@babel/plugin-proposal-class-properties" "7.12.1" + "@babel/plugin-syntax-import-meta" "^7.10.4" + "@babel/plugin-syntax-jsx" "^7.12.1" + "@babel/plugin-transform-flow-strip-types" "^7.12.10" + "@babel/plugin-transform-react-jsx" "^7.12.11" + "@babel/plugin-transform-regenerator" "^7.12.1" + "@babel/preset-env" "^7.12.11" + "@babel/preset-flow" "^7.12.1" + "@babel/preset-react" "^7.12.10" + "@rollup/plugin-alias" "^3.1.1" + "@rollup/plugin-babel" "^5.2.2" + "@rollup/plugin-commonjs" "^17.0.0" + "@rollup/plugin-json" "^4.1.0" + "@rollup/plugin-node-resolve" "^11.0.1" + "@surma/rollup-plugin-off-main-thread" "^2.2.2" + asyncro "^3.0.0" + autoprefixer "^10.1.0" + babel-plugin-macros "^3.0.1" + babel-plugin-transform-async-to-promises "^0.8.15" + babel-plugin-transform-replace-expressions "^0.2.0" + brotli-size "^4.0.0" + builtin-modules "^3.1.0" + camelcase "^6.2.0" + escape-string-regexp "^4.0.0" + filesize "^6.1.0" + gzip-size "^6.0.0" + kleur "^4.1.3" + lodash.merge "^4.6.2" + postcss "^8.2.1" + pretty-bytes "^5.4.1" + rollup "^2.35.1" + rollup-plugin-bundle-size "^1.0.3" + rollup-plugin-postcss "^4.0.0" + rollup-plugin-terser "^7.0.2" + rollup-plugin-typescript2 "^0.29.0" + sade "^1.7.4" + terser "^5.7.0" + tiny-glob "^0.2.8" + tslib "^2.0.3" + typescript "^4.1.3" + micromatch@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" @@ -5880,7 +6468,7 @@ moment@^2.15.2: resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3" integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ== -mri@^1.1.1: +mri@^1.1.0, mri@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== @@ -5911,6 +6499,16 @@ mute-stream@0.0.8, mute-stream@~0.0.4: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== +nanocolors@^0.1.12: + version "0.1.12" + resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.1.12.tgz#8577482c58cbd7b5bb1681db4cf48f11a87fd5f6" + integrity sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ== + +nanoid@^3.1.30: + version "3.1.30" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362" + integrity sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -5984,7 +6582,7 @@ node-modules-regexp@^1.0.0: resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= -node-releases@^2.0.0: +node-releases@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5" integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA== @@ -6029,7 +6627,12 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -normalize-url@^6.1.0: +normalize-range@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" + integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI= + +normalize-url@^6.0.1, normalize-url@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== @@ -6139,6 +6742,13 @@ npmlog@^4.1.2: gauge "~2.7.3" set-blocking "~2.0.0" +nth-check@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.0.1.tgz#2efe162f5c3da06a28959fbd3db75dbeea9f0fc2" + integrity sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w== + dependencies: + boolbase "^1.0.0" + number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -6460,6 +7070,11 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= +picocolors@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" + integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA== + picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -6518,6 +7133,287 @@ please-upgrade-node@^3.2.0: dependencies: semver-compare "^1.0.0" +postcss-calc@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-8.0.0.tgz#a05b87aacd132740a5db09462a3612453e5df90a" + integrity sha512-5NglwDrcbiy8XXfPM11F3HeC6hoT9W7GUH/Zi5U/p7u3Irv4rHhdDcIZwG0llHXV4ftsBjpfWMXAnXNl4lnt8g== + dependencies: + postcss-selector-parser "^6.0.2" + postcss-value-parser "^4.0.2" + +postcss-colormin@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-5.2.0.tgz#2b620b88c0ff19683f3349f4cf9e24ebdafb2c88" + integrity sha512-+HC6GfWU3upe5/mqmxuqYZ9B2Wl4lcoUUNkoaX59nEWV4EtADCMiBqui111Bu8R8IvaZTmqmxrqOAqjbHIwXPw== + dependencies: + browserslist "^4.16.6" + caniuse-api "^3.0.0" + colord "^2.0.1" + postcss-value-parser "^4.1.0" + +postcss-convert-values@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-5.0.1.tgz#4ec19d6016534e30e3102fdf414e753398645232" + integrity sha512-C3zR1Do2BkKkCgC0g3sF8TS0koF2G+mN8xxayZx3f10cIRmTaAnpgpRQZjNekTZxM2ciSPoh2IWJm0VZx8NoQg== + dependencies: + postcss-value-parser "^4.1.0" + +postcss-discard-comments@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-5.0.1.tgz#9eae4b747cf760d31f2447c27f0619d5718901fe" + integrity sha512-lgZBPTDvWrbAYY1v5GYEv8fEO/WhKOu/hmZqmCYfrpD6eyDWWzAOsl2rF29lpvziKO02Gc5GJQtlpkTmakwOWg== + +postcss-discard-duplicates@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-5.0.1.tgz#68f7cc6458fe6bab2e46c9f55ae52869f680e66d" + integrity sha512-svx747PWHKOGpAXXQkCc4k/DsWo+6bc5LsVrAsw+OU+Ibi7klFZCyX54gjYzX4TH+f2uzXjRviLARxkMurA2bA== + +postcss-discard-empty@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-5.0.1.tgz#ee136c39e27d5d2ed4da0ee5ed02bc8a9f8bf6d8" + integrity sha512-vfU8CxAQ6YpMxV2SvMcMIyF2LX1ZzWpy0lqHDsOdaKKLQVQGVP1pzhrI9JlsO65s66uQTfkQBKBD/A5gp9STFw== + +postcss-discard-overridden@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-5.0.1.tgz#454b41f707300b98109a75005ca4ab0ff2743ac6" + integrity sha512-Y28H7y93L2BpJhrdUR2SR2fnSsT+3TVx1NmVQLbcnZWwIUpJ7mfcTC6Za9M2PG6w8j7UQRfzxqn8jU2VwFxo3Q== + +postcss-load-config@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-3.1.0.tgz#d39c47091c4aec37f50272373a6a648ef5e97829" + integrity sha512-ipM8Ds01ZUophjDTQYSVP70slFSYg3T0/zyfII5vzhN6V57YSxMgG5syXuwi5VtS8wSf3iL30v0uBdoIVx4Q0g== + dependencies: + import-cwd "^3.0.0" + lilconfig "^2.0.3" + yaml "^1.10.2" + +postcss-merge-longhand@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-5.0.2.tgz#277ada51d9a7958e8ef8cf263103c9384b322a41" + integrity sha512-BMlg9AXSI5G9TBT0Lo/H3PfUy63P84rVz3BjCFE9e9Y9RXQZD3+h3YO1kgTNsNJy7bBc1YQp8DmSnwLIW5VPcw== + dependencies: + css-color-names "^1.0.1" + postcss-value-parser "^4.1.0" + stylehacks "^5.0.1" + +postcss-merge-rules@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-5.0.2.tgz#d6e4d65018badbdb7dcc789c4f39b941305d410a" + integrity sha512-5K+Md7S3GwBewfB4rjDeol6V/RZ8S+v4B66Zk2gChRqLTCC8yjnHQ601omj9TKftS19OPGqZ/XzoqpzNQQLwbg== + dependencies: + browserslist "^4.16.6" + caniuse-api "^3.0.0" + cssnano-utils "^2.0.1" + postcss-selector-parser "^6.0.5" + vendors "^1.0.3" + +postcss-minify-font-values@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-5.0.1.tgz#a90cefbfdaa075bd3dbaa1b33588bb4dc268addf" + integrity sha512-7JS4qIsnqaxk+FXY1E8dHBDmraYFWmuL6cgt0T1SWGRO5bzJf8sUoelwa4P88LEWJZweHevAiDKxHlofuvtIoA== + dependencies: + postcss-value-parser "^4.1.0" + +postcss-minify-gradients@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-5.0.2.tgz#7c175c108f06a5629925d698b3c4cf7bd3864ee5" + integrity sha512-7Do9JP+wqSD6Prittitt2zDLrfzP9pqKs2EcLX7HJYxsxCOwrrcLt4x/ctQTsiOw+/8HYotAoqNkrzItL19SdQ== + dependencies: + colord "^2.6" + cssnano-utils "^2.0.1" + postcss-value-parser "^4.1.0" + +postcss-minify-params@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-5.0.1.tgz#371153ba164b9d8562842fdcd929c98abd9e5b6c" + integrity sha512-4RUC4k2A/Q9mGco1Z8ODc7h+A0z7L7X2ypO1B6V8057eVK6mZ6xwz6QN64nHuHLbqbclkX1wyzRnIrdZehTEHw== + dependencies: + alphanum-sort "^1.0.2" + browserslist "^4.16.0" + cssnano-utils "^2.0.1" + postcss-value-parser "^4.1.0" + uniqs "^2.0.0" + +postcss-minify-selectors@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-5.1.0.tgz#4385c845d3979ff160291774523ffa54eafd5a54" + integrity sha512-NzGBXDa7aPsAcijXZeagnJBKBPMYLaJJzB8CQh6ncvyl2sIndLVWfbcDi0SBjRWk5VqEjXvf8tYwzoKf4Z07og== + dependencies: + alphanum-sort "^1.0.2" + postcss-selector-parser "^6.0.5" + +postcss-modules-extract-imports@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz#cda1f047c0ae80c97dbe28c3e76a43b88025741d" + integrity sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw== + +postcss-modules-local-by-default@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz#ebbb54fae1598eecfdf691a02b3ff3b390a5a51c" + integrity sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ== + dependencies: + icss-utils "^5.0.0" + postcss-selector-parser "^6.0.2" + postcss-value-parser "^4.1.0" + +postcss-modules-scope@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz#9ef3151456d3bbfa120ca44898dfca6f2fa01f06" + integrity sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg== + dependencies: + postcss-selector-parser "^6.0.4" + +postcss-modules-values@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz#d7c5e7e68c3bb3c9b27cbf48ca0bb3ffb4602c9c" + integrity sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ== + dependencies: + icss-utils "^5.0.0" + +postcss-modules@^4.0.0: + version "4.2.2" + resolved "https://registry.yarnpkg.com/postcss-modules/-/postcss-modules-4.2.2.tgz#5e7777c5a8964ea176919d90b2e54ef891321ce5" + integrity sha512-/H08MGEmaalv/OU8j6bUKi/kZr2kqGF6huAW8m9UAgOLWtpFdhA14+gPBoymtqyv+D4MLsmqaF2zvIegdCxJXg== + dependencies: + generic-names "^2.0.1" + icss-replace-symbols "^1.1.0" + lodash.camelcase "^4.3.0" + postcss-modules-extract-imports "^3.0.0" + postcss-modules-local-by-default "^4.0.0" + postcss-modules-scope "^3.0.0" + postcss-modules-values "^4.0.0" + string-hash "^1.1.1" + +postcss-normalize-charset@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-5.0.1.tgz#121559d1bebc55ac8d24af37f67bd4da9efd91d0" + integrity sha512-6J40l6LNYnBdPSk+BHZ8SF+HAkS4q2twe5jnocgd+xWpz/mx/5Sa32m3W1AA8uE8XaXN+eg8trIlfu8V9x61eg== + +postcss-normalize-display-values@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-normalize-display-values/-/postcss-normalize-display-values-5.0.1.tgz#62650b965981a955dffee83363453db82f6ad1fd" + integrity sha512-uupdvWk88kLDXi5HEyI9IaAJTE3/Djbcrqq8YgjvAVuzgVuqIk3SuJWUisT2gaJbZm1H9g5k2w1xXilM3x8DjQ== + dependencies: + cssnano-utils "^2.0.1" + postcss-value-parser "^4.1.0" + +postcss-normalize-positions@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-normalize-positions/-/postcss-normalize-positions-5.0.1.tgz#868f6af1795fdfa86fbbe960dceb47e5f9492fe5" + integrity sha512-rvzWAJai5xej9yWqlCb1OWLd9JjW2Ex2BCPzUJrbaXmtKtgfL8dBMOOMTX6TnvQMtjk3ei1Lswcs78qKO1Skrg== + dependencies: + postcss-value-parser "^4.1.0" + +postcss-normalize-repeat-style@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-5.0.1.tgz#cbc0de1383b57f5bb61ddd6a84653b5e8665b2b5" + integrity sha512-syZ2itq0HTQjj4QtXZOeefomckiV5TaUO6ReIEabCh3wgDs4Mr01pkif0MeVwKyU/LHEkPJnpwFKRxqWA/7O3w== + dependencies: + cssnano-utils "^2.0.1" + postcss-value-parser "^4.1.0" + +postcss-normalize-string@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-normalize-string/-/postcss-normalize-string-5.0.1.tgz#d9eafaa4df78c7a3b973ae346ef0e47c554985b0" + integrity sha512-Ic8GaQ3jPMVl1OEn2U//2pm93AXUcF3wz+OriskdZ1AOuYV25OdgS7w9Xu2LO5cGyhHCgn8dMXh9bO7vi3i9pA== + dependencies: + postcss-value-parser "^4.1.0" + +postcss-normalize-timing-functions@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-5.0.1.tgz#8ee41103b9130429c6cbba736932b75c5e2cb08c" + integrity sha512-cPcBdVN5OsWCNEo5hiXfLUnXfTGtSFiBU9SK8k7ii8UD7OLuznzgNRYkLZow11BkQiiqMcgPyh4ZqXEEUrtQ1Q== + dependencies: + cssnano-utils "^2.0.1" + postcss-value-parser "^4.1.0" + +postcss-normalize-unicode@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-normalize-unicode/-/postcss-normalize-unicode-5.0.1.tgz#82d672d648a411814aa5bf3ae565379ccd9f5e37" + integrity sha512-kAtYD6V3pK0beqrU90gpCQB7g6AOfP/2KIPCVBKJM2EheVsBQmx/Iof+9zR9NFKLAx4Pr9mDhogB27pmn354nA== + dependencies: + browserslist "^4.16.0" + postcss-value-parser "^4.1.0" + +postcss-normalize-url@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-5.0.2.tgz#ddcdfb7cede1270740cf3e4dfc6008bd96abc763" + integrity sha512-k4jLTPUxREQ5bpajFQZpx8bCF2UrlqOTzP9kEqcEnOfwsRshWs2+oAFIHfDQB8GO2PaUaSE0NlTAYtbluZTlHQ== + dependencies: + is-absolute-url "^3.0.3" + normalize-url "^6.0.1" + postcss-value-parser "^4.1.0" + +postcss-normalize-whitespace@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-normalize-whitespace/-/postcss-normalize-whitespace-5.0.1.tgz#b0b40b5bcac83585ff07ead2daf2dcfbeeef8e9a" + integrity sha512-iPklmI5SBnRvwceb/XH568yyzK0qRVuAG+a1HFUsFRf11lEJTiQQa03a4RSCQvLKdcpX7XsI1Gen9LuLoqwiqA== + dependencies: + postcss-value-parser "^4.1.0" + +postcss-ordered-values@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-5.0.2.tgz#1f351426977be00e0f765b3164ad753dac8ed044" + integrity sha512-8AFYDSOYWebJYLyJi3fyjl6CqMEG/UVworjiyK1r573I56kb3e879sCJLGvR3merj+fAdPpVplXKQZv+ey6CgQ== + dependencies: + cssnano-utils "^2.0.1" + postcss-value-parser "^4.1.0" + +postcss-reduce-initial@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-5.0.1.tgz#9d6369865b0f6f6f6b165a0ef5dc1a4856c7e946" + integrity sha512-zlCZPKLLTMAqA3ZWH57HlbCjkD55LX9dsRyxlls+wfuRfqCi5mSlZVan0heX5cHr154Dq9AfbH70LyhrSAezJw== + dependencies: + browserslist "^4.16.0" + caniuse-api "^3.0.0" + +postcss-reduce-transforms@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-5.0.1.tgz#93c12f6a159474aa711d5269923e2383cedcf640" + integrity sha512-a//FjoPeFkRuAguPscTVmRQUODP+f3ke2HqFNgGPwdYnpeC29RZdCBvGRGTsKpMURb/I3p6jdKoBQ2zI+9Q7kA== + dependencies: + cssnano-utils "^2.0.1" + postcss-value-parser "^4.1.0" + +postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.5: + version "6.0.6" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.6.tgz#2c5bba8174ac2f6981ab631a42ab0ee54af332ea" + integrity sha512-9LXrvaaX3+mcv5xkg5kFwqSzSH1JIObIx51PrndZwlmznwXRfxMddDvo9gve3gVR8ZTKgoFDdWkbRFmEhT4PMg== + dependencies: + cssesc "^3.0.0" + util-deprecate "^1.0.2" + +postcss-svgo@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-5.0.2.tgz#bc73c4ea4c5a80fbd4b45e29042c34ceffb9257f" + integrity sha512-YzQuFLZu3U3aheizD+B1joQ94vzPfE6BNUcSYuceNxlVnKKsOtdo6hL9/zyC168Q8EwfLSgaDSalsUGa9f2C0A== + dependencies: + postcss-value-parser "^4.1.0" + svgo "^2.3.0" + +postcss-unique-selectors@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-5.0.1.tgz#3be5c1d7363352eff838bd62b0b07a0abad43bfc" + integrity sha512-gwi1NhHV4FMmPn+qwBNuot1sG1t2OmacLQ/AX29lzyggnjd+MnVD5uqQmpXO3J17KGL2WAxQruj1qTd3H0gG/w== + dependencies: + alphanum-sort "^1.0.2" + postcss-selector-parser "^6.0.5" + uniqs "^2.0.0" + +postcss-value-parser@^4.0.2, postcss-value-parser@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb" + integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ== + +postcss@^8.2.1: + version "8.3.11" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.11.tgz#c3beca7ea811cd5e1c4a3ec6d2e7599ef1f8f858" + integrity sha512-hCmlUAIlUiav8Xdqw3Io4LcpA1DOt7h3LSTAC4G6JGHFFaWzI6qvFt9oilvl8BmkbBRX1IhM90ZAmpk68zccQA== + dependencies: + nanoid "^3.1.30" + picocolors "^1.0.0" + source-map-js "^0.6.2" + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -6533,6 +7429,18 @@ prettier@^2.0.1, prettier@^2.2.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== +pretty-bytes@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-3.0.1.tgz#27d0008d778063a0b4811bb35c79f1bd5d5fbccf" + integrity sha1-J9AAjXeAY6C0gRuzXHnxvV1fvM8= + dependencies: + number-is-nan "^1.0.0" + +pretty-bytes@^5.4.1: + version "5.6.0" + resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" + integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== + pretty-format@^27.0.0, pretty-format@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.3.1.tgz#7e9486365ccdd4a502061fa761d3ab9ca1b78df5" @@ -6566,6 +7474,11 @@ promise-retry@^2.0.1: err-code "^2.0.2" retry "^0.12.0" +promise.series@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/promise.series/-/promise.series-0.2.0.tgz#2cc7ebe959fc3a6619c04ab4dbdc9e452d864bbd" + integrity sha1-LMfr6Vn8OmYZwEq029yeRS2GS70= + prompts@^2.0.1: version "2.4.2" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" @@ -6685,7 +7598,7 @@ react-test-renderer@^17.0.2: react-shallow-renderer "^16.13.1" scheduler "^0.20.2" -react@^17.0.27: +react@^17.0.2: version "17.0.2" resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== @@ -6946,7 +7859,14 @@ resolve.exports@^1.1.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== -resolve@1.20.0, resolve@^1.10.0, resolve@^1.11.1, resolve@^1.14.2, resolve@^1.20.0: +resolve@1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + +resolve@1.20.0, resolve@^1.10.0, resolve@^1.11.1, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -6986,6 +7906,14 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" +rollup-plugin-bundle-size@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/rollup-plugin-bundle-size/-/rollup-plugin-bundle-size-1.0.3.tgz#d245cd988486b4040279f9fd33f357f61673e90f" + integrity sha512-aWj0Pvzq90fqbI5vN1IvUrlf4utOqy+AERYxwWjegH1G8PzheMnrRIgQ5tkwKVtQMDP0bHZEACW/zLDF+XgfXQ== + dependencies: + chalk "^1.1.3" + maxmin "^2.1.0" + rollup-plugin-filesize@^9.1.0: version "9.1.1" resolved "https://registry.yarnpkg.com/rollup-plugin-filesize/-/rollup-plugin-filesize-9.1.1.tgz#31a6b02b27ce08082ef0970cfe4c451714ff91c4" @@ -7011,6 +7939,25 @@ rollup-plugin-node-resolve@^5.2.0: resolve "^1.11.1" rollup-pluginutils "^2.8.1" +rollup-plugin-postcss@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-postcss/-/rollup-plugin-postcss-4.0.1.tgz#2856465b637ec02513676659aabf1ca3840f3af0" + integrity sha512-kUJHlpDGl9+kDfdUUbnerW0Mx1R0PL/6dgciUE/w19swYDBjug7RQfxIRvRGtO/cvCkynYyU8e/YFMI544vskA== + dependencies: + chalk "^4.1.0" + concat-with-sourcemaps "^1.1.0" + cssnano "^5.0.1" + import-cwd "^3.0.0" + p-queue "^6.6.2" + pify "^5.0.0" + postcss-load-config "^3.0.0" + postcss-modules "^4.0.0" + promise.series "^0.2.0" + resolve "^1.19.0" + rollup-pluginutils "^2.8.2" + safe-identifier "^0.4.2" + style-inject "^0.3.0" + rollup-plugin-terser@^7.0.2: version "7.0.2" resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" @@ -7021,6 +7968,17 @@ rollup-plugin-terser@^7.0.2: serialize-javascript "^4.0.0" terser "^5.0.0" +rollup-plugin-typescript2@^0.29.0: + version "0.29.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.29.0.tgz#b7ad83f5241dbc5bdf1e98d9c3fca005ffe39e1a" + integrity sha512-YytahBSZCIjn/elFugEGQR5qTsVhxhUwGZIsA9TmrSsC88qroGo65O5HZP/TTArH2dm0vUmYWhKchhwi2wL9bw== + dependencies: + "@rollup/pluginutils" "^3.1.0" + find-cache-dir "^3.3.1" + fs-extra "8.1.0" + resolve "1.17.0" + tslib "2.0.1" + rollup-plugin-typescript2@^0.30.0: version "0.30.0" resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.30.0.tgz#1cc99ac2309bf4b9d0a3ebdbc2002aecd56083d3" @@ -7032,14 +7990,14 @@ rollup-plugin-typescript2@^0.30.0: resolve "1.20.0" tslib "2.1.0" -rollup-pluginutils@^2.8.1: +rollup-pluginutils@^2.8.1, rollup-pluginutils@^2.8.2: version "2.8.2" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== dependencies: estree-walker "^0.6.1" -rollup@^2.58.0: +rollup@^2.35.1, rollup@^2.58.0: version "2.58.0" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.58.0.tgz#a643983365e7bf7f5b7c62a8331b983b7c4c67fb" integrity sha512-NOXpusKnaRpbS7ZVSzcEXqxcLDOagN6iFS8p45RkoiMqPHDLwJm758UF05KlMoCRbLBTZsPOIa887gZJ1AiXvw== @@ -7065,6 +8023,13 @@ rxjs@^6.6.0, rxjs@^6.6.7: dependencies: tslib "^1.9.0" +sade@^1.7.4: + version "1.7.4" + resolved "https://registry.yarnpkg.com/sade/-/sade-1.7.4.tgz#ea681e0c65d248d2095c90578c03ca0bb1b54691" + integrity sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA== + dependencies: + mri "^1.1.0" + safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -7075,6 +8040,11 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== +safe-identifier@^0.4.2: + version "0.4.2" + resolved "https://registry.yarnpkg.com/safe-identifier/-/safe-identifier-0.4.2.tgz#cf6bfca31c2897c588092d1750d30ef501d59fcb" + integrity sha512-6pNbSMW6OhAi9j+N8V+U715yBQsaWJ7eyEUaOrawX+isg5ZxhUlV1NipNtgaKHmFGiABwt+ZF04Ii+3Xjkg+8w== + "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -7250,6 +8220,11 @@ sort-keys@^4.0.0: dependencies: is-plain-obj "^2.0.0" +source-map-js@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-0.6.2.tgz#0bb5de631b41cfbda6cfba8bd05a80efdfd2385e" + integrity sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug== + source-map-support@^0.5.16, source-map-support@^0.5.6, source-map-support@~0.5.20: version "0.5.20" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" @@ -7273,6 +8248,11 @@ source-map@^0.7.3, source-map@~0.7.2: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== +sourcemap-codec@^1.4.4: + version "1.4.8" + resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" + integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== + spdx-correct@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" @@ -7345,6 +8325,11 @@ ssri@^8.0.0, ssri@^8.0.1: dependencies: minipass "^3.1.1" +stable@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf" + integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w== + stack-utils@^2.0.3: version "2.0.5" resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" @@ -7374,6 +8359,11 @@ string-argv@0.3.1: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== +string-hash@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/string-hash/-/string-hash-1.1.3.tgz#e8aafc0ac1855b4666929ed7dd1275df5d6c811b" + integrity sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs= + string-length@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" @@ -7494,6 +8484,19 @@ stubs@^3.0.0: resolved "https://registry.yarnpkg.com/stubs/-/stubs-3.0.0.tgz#e8d2ba1fa9c90570303c030b6900f7d5f89abe5b" integrity sha1-6NK6H6nJBXAwPAMLaQD31fiavls= +style-inject@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/style-inject/-/style-inject-0.3.0.tgz#d21c477affec91811cc82355832a700d22bf8dd3" + integrity sha512-IezA2qp+vcdlhJaVm5SOdPPTUu0FCEqfNSli2vRuSIBbu5Nq5UvygTk/VzeCqfLz2Atj3dVII5QBKGZRZ0edzw== + +stylehacks@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-5.0.1.tgz#323ec554198520986806388c7fdaebc38d2c06fb" + integrity sha512-Es0rVnHIqbWzveU1b24kbw92HsebBepxfcqe5iix7t9j0PQqhs0IxXVXv0pY2Bxa08CgMkzD6OWql7kbGOuEdA== + dependencies: + browserslist "^4.16.0" + postcss-selector-parser "^6.0.4" + supports-color@8.1.1, supports-color@^8.0.0: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" @@ -7501,6 +8504,11 @@ supports-color@8.1.1, supports-color@^8.0.0: dependencies: has-flag "^4.0.0" +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -7523,6 +8531,19 @@ supports-hyperlinks@^2.0.0: has-flag "^4.0.0" supports-color "^7.0.0" +svgo@^2.3.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/svgo/-/svgo-2.7.0.tgz#e164cded22f4408fe4978f082be80159caea1e2d" + integrity sha512-aDLsGkre4fTDCWvolyW+fs8ZJFABpzLXbtdK1y71CKnHzAnpDxKXPj2mNKj+pyOXUCzFHzuxRJ94XOFygOWV3w== + dependencies: + "@trysound/sax" "0.2.0" + commander "^7.2.0" + css-select "^4.1.3" + css-tree "^1.1.3" + csso "^4.2.0" + nanocolors "^0.1.12" + stable "^0.1.8" + symbol-tree@^3.2.4: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" @@ -7588,7 +8609,7 @@ terminal-link@^2.0.0: ansi-escapes "^4.2.1" supports-hyperlinks "^2.0.0" -terser@^5.0.0, terser@^5.6.0: +terser@^5.0.0, terser@^5.6.0, terser@^5.7.0: version "5.9.0" resolved "https://registry.yarnpkg.com/terser/-/terser-5.9.0.tgz#47d6e629a522963240f2b55fcaa3c99083d2c351" integrity sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ== @@ -7641,6 +8662,19 @@ through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@^2.3.8: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= +timsort@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" + integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= + +tiny-glob@^0.2.8: + version "0.2.9" + resolved "https://registry.yarnpkg.com/tiny-glob/-/tiny-glob-0.2.9.tgz#2212d441ac17928033b110f8b3640683129d31e2" + integrity sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg== + dependencies: + globalyzer "0.1.0" + globrex "^0.1.2" + tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -7648,7 +8682,7 @@ tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" -tmpl@1.0.x: +tmpl@1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== @@ -7711,6 +8745,11 @@ trim-newlines@^3.0.0: resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== +tslib@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e" + integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ== + tslib@2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" @@ -7721,7 +8760,7 @@ tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@~2.3.0: +tslib@^2.0.3, tslib@~2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== @@ -7806,7 +8845,7 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^4.4.4: +typescript@^4.1.3, typescript@^4.4.4: version "4.4.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c" integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== @@ -7859,6 +8898,11 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz#0a36cb9a585c4f6abd51ad1deddb285c165297c8" integrity sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ== +uniqs@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" + integrity sha1-/+3ks2slKQaW5uFl1KWe25mOawI= + unique-filename@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" @@ -7907,7 +8951,7 @@ urlgrey@1.0.0: dependencies: fast-url-parser "^1.1.3" -util-deprecate@^1.0.1, util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= @@ -7963,6 +9007,11 @@ value-or-promise@1.0.11: resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.11.tgz#3e90299af31dd014fe843fe309cefa7c1d94b140" integrity sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg== +vendors@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/vendors/-/vendors-1.0.4.tgz#e2b800a53e7a29b93506c3cf41100d16c4c4ad8e" + integrity sha512-/juG65kTL4Cy2su4P8HjtkTxk6VmJDiOPBufWniqQ6wknac6jNiXS9vU+hO3wgusiyqWlzTbVHi0dyJqRONg3w== + verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" @@ -7987,11 +9036,11 @@ w3c-xmlserializer@^2.0.0: xml-name-validator "^3.0.0" walker@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" - integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= + version "1.0.8" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" + integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== dependencies: - makeerror "1.0.x" + makeerror "1.0.12" wcwidth@^1.0.0: version "1.0.1" @@ -8222,7 +9271,7 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yaml@^1.10.0: +yaml@^1.10.0, yaml@^1.10.2: version "1.10.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== From b0072d2f194e1a0601c118b4a41f6a18fc5235a5 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Sun, 24 Oct 2021 23:41:56 -0300 Subject: [PATCH 28/49] chore(release): publish v1.4.4-next.0 --- lerna.json | 2 +- packages/bindings/package.json | 4 ++-- packages/core/package.json | 2 +- packages/react/package.json | 6 +++--- packages/test-utils/package.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lerna.json b/lerna.json index da965bc2..e1b7f2fd 100644 --- a/lerna.json +++ b/lerna.json @@ -4,7 +4,7 @@ ], "npmClient": "yarn", "useWorkspaces": true, - "version": "1.4.3-next.0", + "version": "1.4.4-next.0", "command": { "publish": { "message": "chore(release): publish %s", diff --git a/packages/bindings/package.json b/packages/bindings/package.json index 08011711..5bf50f26 100644 --- a/packages/bindings/package.json +++ b/packages/bindings/package.json @@ -1,6 +1,6 @@ { "name": "@grafoo/bindings", - "version": "1.4.3-next.0", + "version": "1.4.4-next.0", "description": "grafoo client internal helper for building framework bindings", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/bindings", "source": "./src/index.ts", @@ -37,7 +37,7 @@ ] }, "dependencies": { - "@grafoo/core": "^1.4.3-next.0" + "@grafoo/core": "^1.4.4-next.0" }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" } diff --git a/packages/core/package.json b/packages/core/package.json index 305277e7..786dfb68 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@grafoo/core", - "version": "1.4.3-next.0", + "version": "1.4.4-next.0", "description": "grafoo client core", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/core", "source": "./src/index.ts", diff --git a/packages/react/package.json b/packages/react/package.json index eb8d09ef..98c2fc62 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@grafoo/react", - "version": "1.4.3-next.0", + "version": "1.4.4-next.0", "description": "grafoo client react bindings", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/react", "source": "./src/index.ts", @@ -43,8 +43,8 @@ "react": ">=17" }, "dependencies": { - "@grafoo/bindings": "^1.4.3-next.0", - "@grafoo/core": "^1.4.3-next.0" + "@grafoo/bindings": "^1.4.4-next.0", + "@grafoo/core": "^1.4.4-next.0" }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974", "devDependencies": { diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index fcf99e34..1dbb2a32 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@grafoo/test-utils", - "version": "1.4.2-next.0", + "version": "1.4.4-next.0", "main": "dist/index.js", "publishConfig": { "access": "public" From 50f488d2083a85635361be06e85a2adeb2841965 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Mon, 25 Oct 2021 03:06:15 -0300 Subject: [PATCH 29/49] updates --- packages/bindings/src/bindings.ts | 14 +++++--------- packages/core/src/client.ts | 1 + packages/react/src/index.ts | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/bindings/src/bindings.ts b/packages/bindings/src/bindings.ts index ed1dd4a3..729994ec 100644 --- a/packages/bindings/src/bindings.ts +++ b/packages/bindings/src/bindings.ts @@ -17,16 +17,13 @@ export default function createBindings< let records: GrafooRecords; let partial = false; let unbind = () => {}; - let preventListenUpdate = false; + let preventListenUpdate = true; if (query) { ({ data, records, partial } = client.read(query, variables)); unbind = client.listen((nextRecords) => { - if (preventListenUpdate) { - preventListenUpdate = false; - return; - } + if (preventListenUpdate) return; records = records || {}; @@ -80,9 +77,8 @@ export default function createBindings< } function load(nextVariables?: CP["query"]["_variablesType"]) { - if (nextVariables) { - variables = nextVariables; - } + preventListenUpdate = true; + variables = nextVariables ?? variables; if (!state.loading) { Object.assign(state, { loading: true }); @@ -93,12 +89,12 @@ export default function createBindings< ({ data, errors } = res); if (data) { - preventListenUpdate = true; client.write(query, variables, data); } Object.assign(state, { loaded: !!data, loading: false }, errors && { errors }); updater(getState()); + preventListenUpdate = false; }); } diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts index 16e82480..41b7a93b 100644 --- a/packages/core/src/client.ts +++ b/packages/core/src/client.ts @@ -25,6 +25,7 @@ export default function createClient( function listen(listener: GrafooListener) { listeners.push(listener); + return () => { let index = listeners.indexOf(listener); if (index < 0) return; diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 4b06c862..4a15930a 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -16,7 +16,7 @@ export function useGrafoo ): GrafooBoundState { let client = React.useContext(GrafooContext); - let update = React.useCallback(() => setState(bindings.getState()), []); + let update: (s: GrafooBoundState) => void = React.useCallback((s) => setState(s), []); let bindings = React.useMemo(() => createBindings(client, update, props), []); let [state, setState] = React.useState(() => bindings.getState()); let variables = React.useRef(props.variables); From b69a3932b88ff1320b379dc199aa30badf873dcf Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Mon, 25 Oct 2021 03:08:39 -0300 Subject: [PATCH 30/49] chore(release): publish v1.4.5-next.0 --- lerna.json | 2 +- packages/bindings/package.json | 4 ++-- packages/core/package.json | 2 +- packages/react/package.json | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lerna.json b/lerna.json index e1b7f2fd..a4c5c71f 100644 --- a/lerna.json +++ b/lerna.json @@ -4,7 +4,7 @@ ], "npmClient": "yarn", "useWorkspaces": true, - "version": "1.4.4-next.0", + "version": "1.4.5-next.0", "command": { "publish": { "message": "chore(release): publish %s", diff --git a/packages/bindings/package.json b/packages/bindings/package.json index 5bf50f26..24dd2b66 100644 --- a/packages/bindings/package.json +++ b/packages/bindings/package.json @@ -1,6 +1,6 @@ { "name": "@grafoo/bindings", - "version": "1.4.4-next.0", + "version": "1.4.5-next.0", "description": "grafoo client internal helper for building framework bindings", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/bindings", "source": "./src/index.ts", @@ -37,7 +37,7 @@ ] }, "dependencies": { - "@grafoo/core": "^1.4.4-next.0" + "@grafoo/core": "^1.4.5-next.0" }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" } diff --git a/packages/core/package.json b/packages/core/package.json index 786dfb68..ac31807a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@grafoo/core", - "version": "1.4.4-next.0", + "version": "1.4.5-next.0", "description": "grafoo client core", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/core", "source": "./src/index.ts", diff --git a/packages/react/package.json b/packages/react/package.json index 98c2fc62..f9b8d40c 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@grafoo/react", - "version": "1.4.4-next.0", + "version": "1.4.5-next.0", "description": "grafoo client react bindings", "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/react", "source": "./src/index.ts", @@ -43,8 +43,8 @@ "react": ">=17" }, "dependencies": { - "@grafoo/bindings": "^1.4.4-next.0", - "@grafoo/core": "^1.4.4-next.0" + "@grafoo/bindings": "^1.4.5-next.0", + "@grafoo/core": "^1.4.5-next.0" }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974", "devDependencies": { From 18dfa1b485bed1eb4faf2a7bb45aee655caab825 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Fri, 12 Nov 2021 19:42:52 -0300 Subject: [PATCH 31/49] Tons of tests --- package.json | 30 +- .../babel-plugin/{.babelrc => .babelrc.json} | 0 .../__tests__/__snapshots__/index.js.snap | 15 - packages/babel-plugin/src/index.ts | 70 +- packages/bindings/package.json | 1 + packages/bindings/src/bindings.ts | 22 +- packages/bindings/src/index.ts | 2 +- packages/bindings/src/types.ts | 1 + packages/bundle/cli.js | 11 - packages/bundle/index.js | 50 - packages/bundle/package.json | 16 - packages/bundle/readme.md | 20 - packages/compiler/{.babelrc => .babelrc.json} | 0 .../compiler/src/generate-client-resolvers.ts | 2 +- packages/compiler/src/index.ts | 2 +- packages/compiler/src/insert-fields.ts | 4 +- packages/core/.babelrc | 12 - .../__tests__/data/author-with-arguments.ts | 67 +- .../core/__tests__/data/posts-and-authors.ts | 448 +++-- .../__tests__/data/posts-with-fragments.ts | 596 +++--- packages/core/__tests__/index.ts | 176 +- packages/core/__tests__/resolve-values.ts | 96 +- packages/core/__tests__/store-values.ts | 172 +- packages/core/babel.config.js | 6 + packages/core/package.json | 8 +- packages/core/schema.graphql | 269 ++- packages/core/src/client.ts | 14 +- packages/core/src/resolve-values.ts | 13 +- packages/core/src/store-values.ts | 80 +- packages/core/src/types.ts | 2 +- packages/core/src/util.ts | 4 +- packages/macro/package.json | 28 + packages/macro/src/index.d.ts | 1 + packages/macro/src/index.ts | 98 + packages/macro/tsconfig.json | 15 + packages/react/package.json | 1 + packages/react/src/index.ts | 22 +- packages/test-utils/package.json | 4 + packages/test-utils/src/db.ts | 26 +- packages/test-utils/src/index.ts | 1 + packages/test-utils/src/mock-server.ts | 293 ++- packages/test-utils/src/types.ts | 210 ++ scripts/jest-setup.js | 2 +- yarn.lock | 1781 ++++++++--------- 44 files changed, 2674 insertions(+), 2017 deletions(-) rename packages/babel-plugin/{.babelrc => .babelrc.json} (100%) delete mode 100755 packages/bundle/cli.js delete mode 100755 packages/bundle/index.js delete mode 100644 packages/bundle/package.json delete mode 100644 packages/bundle/readme.md rename packages/compiler/{.babelrc => .babelrc.json} (100%) delete mode 100644 packages/core/.babelrc create mode 100644 packages/core/babel.config.js create mode 100644 packages/macro/package.json create mode 100644 packages/macro/src/index.d.ts create mode 100644 packages/macro/src/index.ts create mode 100644 packages/macro/tsconfig.json create mode 100644 packages/test-utils/src/types.ts diff --git a/package.json b/package.json index 46ea9085..93e069ac 100644 --- a/package.json +++ b/package.json @@ -60,37 +60,39 @@ ] }, "devDependencies": { - "@babel/cli": "^7.0.0", - "@babel/core": "^7.15.8", - "@babel/parser": "^7.15.8", - "@babel/preset-env": "^7.15.8", - "@babel/preset-react": "^7.0.0", - "@babel/preset-typescript": "^7.0.0", - "@babel/register": "^7.0.0", - "@graphql-tools/schema": "^8.3.0", + "@babel/cli": "^7.16.0", + "@babel/core": "^7.16.0", + "@babel/parser": "^7.16.3", + "@babel/plugin-transform-modules-commonjs": "^7.16.0", + "@babel/preset-env": "^7.16.0", + "@babel/preset-react": "^7.16.0", + "@babel/preset-typescript": "^7.16.0", + "@babel/register": "^7.16.0", + "@graphql-tools/schema": "^8.3.1", "@testing-library/react-hooks": "^7.0.2", "@types/crypto-js": "^4.0.2", "@types/jest": "^27.0.2", - "@types/node": "^16.11.4", - "@types/react": "^17.0.32", + "@types/node": "^16.11.7", + "@types/react": "^17.0.34", "@types/uuid": "^8.3.1", "@types/ws": "^8.2.0", - "@typescript-eslint/parser": "^5.1.0", + "@typescript-eslint/parser": "^5.3.1", + "babel-jest": "^27.3.1", "babel-plugin-jsx-pragmatic": "^1.0.2", "babel-plugin-tester": "^10.0.0", "casual": "^1.5.19", "codecov": "^3.2.0", "eslint": "^8.1.0", - "eslint-plugin-prefer-let": "^1.1.0", + "eslint-plugin-prefer-let": "^3.0.1", "fetch-mock": "^9.11.0", "graphql": "^15.6.1", "husky": "^7.0.4", "jest": "^27.3.1", "lerna": "^4.0.0", - "lint-staged": "^11.2.4", + "lint-staged": "^11.2.6", "lowdb": "^3.0.0", "microbundle": "^0.14.1", - "node-fetch": "^3.0.0", + "node-fetch": "^3.1.0", "prettier": "^2.2.1", "react": "^17.0.2", "react-test-renderer": "^17.0.2", diff --git a/packages/babel-plugin/.babelrc b/packages/babel-plugin/.babelrc.json similarity index 100% rename from packages/babel-plugin/.babelrc rename to packages/babel-plugin/.babelrc.json diff --git a/packages/babel-plugin/__tests__/__snapshots__/index.js.snap b/packages/babel-plugin/__tests__/__snapshots__/index.js.snap index fe281714..53e0bfe8 100644 --- a/packages/babel-plugin/__tests__/__snapshots__/index.js.snap +++ b/packages/babel-plugin/__tests__/__snapshots__/index.js.snap @@ -34,9 +34,6 @@ let query = { scalars: ["id", "name"] } } - }, - fragments: { - select: {} } }; @@ -95,9 +92,6 @@ let query = { } } }, - fragments: { - select: {} - }, id: "6e0697df8f2453f2643bbd1e8a39c348" }; @@ -222,9 +216,6 @@ let query = { } } } - }, - fragments: { - select: {} } }; @@ -282,9 +273,6 @@ let query = { } } } - }, - fragments: { - select: {} } }; @@ -369,9 +357,6 @@ let query = { } } } - }, - fragments: { - select: {} } }; diff --git a/packages/babel-plugin/src/index.ts b/packages/babel-plugin/src/index.ts index 15cd643f..2e22070a 100644 --- a/packages/babel-plugin/src/index.ts +++ b/packages/babel-plugin/src/index.ts @@ -9,32 +9,42 @@ type Babel = typeof BabelCoreNamespace; let schema: string; function getSchema(schemaPath: string) { - if (schema) return schema; - - let fullPath: string; - - if (!schemaPath) { - let schemaJson = path.join(process.cwd(), "schema.json"); - let schemaGraphql = path.join(process.cwd(), "schema.graphql"); - let schemaGql = path.join(process.cwd(), "schema.gql"); - - fullPath = fs.existsSync(schemaJson) - ? schemaJson - : fs.existsSync(schemaGraphql) - ? schemaGraphql - : fs.existsSync(schemaGql) - ? schemaGql - : undefined; - } else { - fullPath = path.join(process.cwd(), schemaPath); - } + try { + if (schema) return schema; + + let fullPath: string; + + if (!schemaPath) { + let schemaJson = path.join(process.cwd(), "schema.json"); + let schemaGraphql = path.join(process.cwd(), "schema.graphql"); + let schemaGql = path.join(process.cwd(), "schema.gql"); + + fullPath = fs.existsSync(schemaJson) + ? schemaJson + : fs.existsSync(schemaGraphql) + ? schemaGraphql + : fs.existsSync(schemaGql) + ? schemaGql + : undefined; + } else { + fullPath = path.join(process.cwd(), schemaPath); + } - // @ts-ignore - fs.accessSync(fullPath, fs.F_OK); + fs.accessSync(fullPath, fs.constants.F_OK); - schema = fs.readFileSync(fullPath, "utf-8"); + schema = fs.readFileSync(fullPath, "utf-8"); + + return schema; + } catch (error) { + if (error.code === "ENOENT") { + throw new Error( + "Could not find a schema in the root directory! " + + "Please use the `schema` option to specify your schema path" + ); + } - return schema; + throw error; + } } export default function transform({ types: t }: Babel): PluginObj<{ opts: Options }> { @@ -167,9 +177,10 @@ export default function transform({ types: t }: Babel): PluginObj<{ opts: Option TaggedTemplateExpression(path) { if (tagIdentifiers.some((name) => t.isIdentifier(path.node.tag, { name }))) { let quasi = path.get("quasi"); + let expressions = quasi.get("expressions"); - if (quasi.get("expressions").length) { - throw path.buildCodeFrameError( + if (expressions.length) { + throw expressions[0].buildCodeFrameError( "@grafoo/core/tag: interpolation is not supported in a graphql tagged template literal." ); } @@ -179,14 +190,7 @@ export default function transform({ types: t }: Babel): PluginObj<{ opts: Option let query = compileDocument(source, schemaString, opts); path.replaceWith(parseExpression(query)); } catch (error) { - if (error.code === "ENOENT") { - throw new Error( - "Could not find a schema in the root directory! " + - "Please use the `schema` option to specify your schema path" - ); - } - - throw path.buildCodeFrameError(error); + throw quasi.buildCodeFrameError(error); } } } diff --git a/packages/bindings/package.json b/packages/bindings/package.json index 24dd2b66..1694c062 100644 --- a/packages/bindings/package.json +++ b/packages/bindings/package.json @@ -24,6 +24,7 @@ }, "scripts": { "build": "microbundle", + "watch": "microbundle watch", "test": "jest", "test:coverage": "jest --coverage" }, diff --git a/packages/bindings/src/bindings.ts b/packages/bindings/src/bindings.ts index 729994ec..37650539 100644 --- a/packages/bindings/src/bindings.ts +++ b/packages/bindings/src/bindings.ts @@ -1,6 +1,12 @@ import { GrafooClient, GrafooRecords, GraphQlError, GrafooQuery } from "@grafoo/core"; import { GrafooBoundMutations, GrafooBoundState, GrafooConsumerProps } from "./types"; +export let makeGrafooConfig = >( + init: GrafooConsumerProps +) => init; + +let clone = (data: T) => JSON.parse(JSON.stringify(data)); + export default function createBindings< T extends GrafooQuery, U extends Record @@ -10,7 +16,7 @@ export default function createBindings< props: GrafooConsumerProps ) { type CP = GrafooConsumerProps; - let { query, variables, mutations } = props; + let { query, variables, mutations, skip } = props; let data: CP["query"]["_queryType"]; let errors: GraphQlError[]; let boundMutations = {} as GrafooBoundMutations; @@ -25,8 +31,6 @@ export default function createBindings< unbind = client.listen((nextRecords) => { if (preventListenUpdate) return; - records = records || {}; - for (let i in nextRecords) { // record has been inserted if (!(i in records)) return getUpdateFromClient(); @@ -50,12 +54,12 @@ export default function createBindings< boundMutations[key] = (mutationVariables) => { if (query && optimisticUpdate) { - client.write(query, variables, optimisticUpdate(data, mutationVariables)); + client.write(query, variables, optimisticUpdate(clone(data), mutationVariables)); } return client.execute(mutationQuery, mutationVariables).then((mutationResponse) => { if (query && update && mutationResponse.data) { - client.write(query, variables, update(data, mutationResponse.data)); + client.write(query, variables, update(clone(data), mutationResponse.data)); } return mutationResponse; @@ -64,7 +68,7 @@ export default function createBindings< } } - let state = { loaded: !!data && !partial, loading: false }; + let state = { loaded: !!data && !partial, loading: !!query || !data || skip }; function getUpdateFromClient() { ({ data, partial } = client.read(query, variables)); @@ -77,8 +81,8 @@ export default function createBindings< } function load(nextVariables?: CP["query"]["_variablesType"]) { - preventListenUpdate = true; variables = nextVariables ?? variables; + preventListenUpdate = true; if (!state.loading) { Object.assign(state, { loading: true }); @@ -88,9 +92,7 @@ export default function createBindings< return client.execute(query, variables).then((res) => { ({ data, errors } = res); - if (data) { - client.write(query, variables, data); - } + if (data) client.write(query, variables, data); Object.assign(state, { loaded: !!data, loading: false }, errors && { errors }); updater(getState()); diff --git a/packages/bindings/src/index.ts b/packages/bindings/src/index.ts index 4991630d..243aac83 100644 --- a/packages/bindings/src/index.ts +++ b/packages/bindings/src/index.ts @@ -1,2 +1,2 @@ +export { default, makeGrafooConfig } from "./bindings"; export * from "./types"; -export { default } from "./bindings"; diff --git a/packages/bindings/src/types.ts b/packages/bindings/src/types.ts index f21fa331..91886be1 100644 --- a/packages/bindings/src/types.ts +++ b/packages/bindings/src/types.ts @@ -28,6 +28,7 @@ export type GrafooMutations> = { query?: T; + skip?: boolean; variables?: T["_variablesType"]; mutations?: GrafooMutations; }; diff --git a/packages/bundle/cli.js b/packages/bundle/cli.js deleted file mode 100755 index 5a19c8de..00000000 --- a/packages/bundle/cli.js +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env node - -var mri = require("mri"); -var build = require("."); - -var opts = mri(process.argv.slice(2)); - -opts.skipCompression = !!opts["skip-compression"]; -opts.rootPath = process.cwd(); - -build(opts).catch(console.error); diff --git a/packages/bundle/index.js b/packages/bundle/index.js deleted file mode 100755 index 4b143b78..00000000 --- a/packages/bundle/index.js +++ /dev/null @@ -1,50 +0,0 @@ -let fs = require("fs"); -let path = require("path"); -let rollup = require("rollup").rollup; -let fileSize = require("rollup-plugin-filesize"); -let nodeResolve = require("rollup-plugin-node-resolve"); -let terser = require("rollup-plugin-terser").terser; -let typescript = require("rollup-plugin-typescript2"); -let ts = require("typescript"); - -module.exports = function build(opts) { - let pkg = JSON.parse(fs.readFileSync(path.join(opts.rootPath, "package.json"), "utf-8")); - let tsconfig = JSON.parse(fs.readFileSync(path.join(opts.rootPath, "tsconfig.json"), "utf-8")); - let peerDependencies = pkg.peerDependencies || {}; - - tsconfig.compilerOptions.target = "esnext"; - tsconfig.compilerOptions.module = "esnext"; - tsconfig.compilerOptions.declaration = true; - tsconfig.compilerOptions.outDir = path.join(opts.rootPath, "dist"); - - return rollup({ - input: path.join(opts.rootPath, opts.input), - external: Object.keys(peerDependencies), - sourcemap: true, - plugins: [ - nodeResolve(), - typescript({ - typescript: ts, - tsconfigOverride: tsconfig - }), - !opts.skipCompression && - terser({ - output: { comments: false }, - compress: { keep_infinity: true, pure_getters: true }, - warnings: true, - toplevel: true, - mangle: {} - }), - fileSize() - ].filter(Boolean) - }).then((bundle) => { - return bundle.write({ - file: path.join(opts.rootPath, "dist/index.js"), - sourcemap: true, - format: opts.format || "esm", - treeshake: { - propertyReadSideEffects: false - } - }); - }); -}; diff --git a/packages/bundle/package.json b/packages/bundle/package.json deleted file mode 100644 index f016df4b..00000000 --- a/packages/bundle/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "grafoo-bundle", - "version": "1.4.2-next.0", - "bin": "cli.js", - "main": "index.js", - "dependencies": { - "mri": "^1.1.1", - "rollup": "^2.58.0", - "rollup-plugin-filesize": "^9.1.0", - "rollup-plugin-node-resolve": "^5.2.0", - "rollup-plugin-terser": "^7.0.2", - "rollup-plugin-typescript2": "^0.30.0", - "typescript": "^4.4.4" - }, - "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" -} diff --git a/packages/bundle/readme.md b/packages/bundle/readme.md deleted file mode 100644 index 2fc5178c..00000000 --- a/packages/bundle/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -# `grafoo-bundle` - -**This is and internal cli tool for [Grafoo](https://github.com/grafoojs/grafoo) and it's not meant to be used for anything else**. Basicaly a wrapper around rollup with some configuration already set. - -## Usage - -``` -$ grafoo-bundle --input src/index.ts -``` - -## Options - -```sh ---input # the entrypoint ---skip-compression # avoids minification -``` - -## LICENSE - -[MIT](https://github.com/grafoojs/grafoo/blob/master/LICENSE) diff --git a/packages/compiler/.babelrc b/packages/compiler/.babelrc.json similarity index 100% rename from packages/compiler/.babelrc rename to packages/compiler/.babelrc.json diff --git a/packages/compiler/src/generate-client-resolvers.ts b/packages/compiler/src/generate-client-resolvers.ts index 7447f98e..1bfaf9af 100644 --- a/packages/compiler/src/generate-client-resolvers.ts +++ b/packages/compiler/src/generate-client-resolvers.ts @@ -14,7 +14,7 @@ import { let getNonNullType = (typeInfo: TypeInfo) => { let currentType = typeInfo.getType(); - if (currentType instanceof GraphQLNonNull) currentType = currentType.ofType; + if (currentType && currentType instanceof GraphQLNonNull) currentType = currentType.ofType; return currentType; }; diff --git a/packages/compiler/src/index.ts b/packages/compiler/src/index.ts index 0edebed5..ae35720f 100644 --- a/packages/compiler/src/index.ts +++ b/packages/compiler/src/index.ts @@ -28,7 +28,7 @@ export default function compileDocument(source: string, schemaString: string, op let grafooQuery: GrafooQuery = { document: opts.compress ? compressedDocumentStr : documentStr, operation: generateClientResolver(schema, operation), - fragments: generateClientResolver(schema, fragments) + fragments: fragments.definitions.length ? generateClientResolver(schema, fragments) : undefined }; if (opts.generateIds) { diff --git a/packages/compiler/src/insert-fields.ts b/packages/compiler/src/insert-fields.ts index 0da6b3f0..f735366e 100644 --- a/packages/compiler/src/insert-fields.ts +++ b/packages/compiler/src/insert-fields.ts @@ -12,7 +12,7 @@ import { function getType(typeInfo) { let currentType = typeInfo.getType(); - while (currentType.ofType) currentType = currentType.ofType; + while (currentType?.ofType) currentType = currentType.ofType; return currentType; } @@ -47,6 +47,8 @@ export default function insertFields( let t = getType(typeInfo); + if (!t) return; + if (t.astNode.kind === "UnionTypeDefinition") { unionChildrenTypes.push( ...(typeInfo.getType() as GraphQLUnionType).astNode.types.map((t) => t.name.value) diff --git a/packages/core/.babelrc b/packages/core/.babelrc deleted file mode 100644 index e27da2cc..00000000 --- a/packages/core/.babelrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presets": [ - ["@babel/preset-env", { "targets": { "node": "current" } }], - "@babel/preset-typescript" - ], - "plugins": [ - [ - "module:@grafoo/babel-plugin", - { "schema": "schema.graphql", "idFields": ["id", "__typename"] } - ] - ] -} diff --git a/packages/core/__tests__/data/author-with-arguments.ts b/packages/core/__tests__/data/author-with-arguments.ts index 57cfe61f..05d9acb2 100644 --- a/packages/core/__tests__/data/author-with-arguments.ts +++ b/packages/core/__tests__/data/author-with-arguments.ts @@ -1,47 +1,50 @@ export let data = { author: { __typename: "Author", - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==", name: "Murphy Abshire", - posts: [ - { - __typename: "Post", - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", - title: "Quam et qui" - }, - { - __typename: "Post", - id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", - title: "Quam odit" - } - ] - } -}; - -export let path = { - "author:id:a1d3a2bc-e503-4640-9178-23cbd36b542c": { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - "posts:from:0:to:2": [ - { id: "9c6abd58-0cc5-4341-87a2-ede364685ebd" }, - { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" } - ] + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + __typename: "Post", + id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=", + title: "Quam et qui" + } + } + ] + } } }; export let records = { - "a1d3a2bc-e503-4640-9178-23cbd36b542c": { + "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==": { __typename: "Author", - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==", name: "Murphy Abshire" }, - "2c969ce7-02ae-42b1-a94d-7d0a38804c85": { - __typename: "Post", - id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", - title: "Quam odit" - }, - "9c6abd58-0cc5-4341-87a2-ede364685ebd": { + "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=": { __typename: "Post", - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=", title: "Quam et qui" } }; + +export let path = { + "author:id:QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==": { + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==", + "posts:first:1": { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=" + } + } + ] + } + } +}; diff --git a/packages/core/__tests__/data/posts-and-authors.ts b/packages/core/__tests__/data/posts-and-authors.ts index 03f84fd9..d8bd4cce 100644 --- a/packages/core/__tests__/data/posts-and-authors.ts +++ b/packages/core/__tests__/data/posts-and-authors.ts @@ -1,238 +1,262 @@ export let data = { - authors: [ - { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - name: "Murphy Abshire", - posts: [ - { + authors: { + __typename: "AuthorConnection", + edges: [ + { + __typename: "AuthorEdge", + node: { + __typename: "Author", + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==", + name: "Murphy Abshire", + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + __typename: "Post", + body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus.", + id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=", + title: "Quam et qui" + } + }, + { + __typename: "PostEdge", + node: { + __typename: "Post", + body: "Ducimus harum delectus consectetur.", + id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=", + title: "Quam odit" + } + } + ] + } + } + }, + { + __typename: "AuthorEdge", + node: { + __typename: "Author", + id: "QXV0aG9yOmExZDFjM2YwLTViZDUtNDUzZS1iNGY4LTlmNDE5NDU3ZTVhNg==", + name: "Rebekah Gleason", + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + __typename: "Post", + body: "Qui natus repellat porro.", + id: "UG9zdDphMmJjZTVmOC0yZWI3LTQyM2QtOTk0Zi1kODAwMmJkMDUwOWY=", + title: "Numquam ducimus rerum" + } + }, + { + __typename: "PostEdge", + node: { + __typename: "Post", + body: "Amet eos dolores.", + id: "UG9zdDpiYmI5NjgyMS0wNmZhLTRlMTYtOWUxYi0zYzJhNmZiNzcxMGQ=", + title: "Possimus et ullam" + } + } + ] + } + } + } + ] + }, + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + __typename: "Post", + author: { + __typename: "Author", + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==", + name: "Murphy Abshire" + }, body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus.", - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=", title: "Quam et qui" - }, - { + } + }, + { + __typename: "PostEdge", + node: { + __typename: "Post", + author: { + __typename: "Author", + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==", + name: "Murphy Abshire" + }, body: "Ducimus harum delectus consectetur.", - id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", + id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=", title: "Quam odit" - }, - { + } + }, + { + __typename: "PostEdge", + node: { + __typename: "Post", + author: { + __typename: "Author", + id: "QXV0aG9yOmExZDFjM2YwLTViZDUtNDUzZS1iNGY4LTlmNDE5NDU3ZTVhNg==", + name: "Rebekah Gleason" + }, body: "Qui natus repellat porro.", - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + id: "UG9zdDphMmJjZTVmOC0yZWI3LTQyM2QtOTk0Zi1kODAwMmJkMDUwOWY=", title: "Numquam ducimus rerum" - }, - { + } + }, + { + __typename: "PostEdge", + node: { + __typename: "Post", + author: { + __typename: "Author", + id: "QXV0aG9yOmExZDFjM2YwLTViZDUtNDUzZS1iNGY4LTlmNDE5NDU3ZTVhNg==", + name: "Rebekah Gleason" + }, body: "Amet eos dolores.", - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + id: "UG9zdDpiYmI5NjgyMS0wNmZhLTRlMTYtOWUxYi0zYzJhNmZiNzcxMGQ=", title: "Possimus et ullam" } - ] - }, - { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - name: "Rebekah Gleason", - posts: [ - { - body: "Facilis voluptas mollitia est temporibus voluptatem quibusdam itaque soluta.", - id: "9007748e-5e37-4f3a-8da2-b2041505a867", - title: "Et praesentium" - }, - { - body: "Architecto et totam rerum esse omnis nihil eius autem.", - id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", - title: "Sunt nemo" - }, - { - body: "Architecto fugiat odit quam est est maxime quos exercitationem.", - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", - title: "Aut aspernatur qui" - }, - { - body: "Vel voluptatibus quis esse non fuga debitis.", - id: "90b11972-305f-43f8-a6a8-ddad70d1459b", - title: "Iure rerum ratione" - } - ] - } - ], - posts: [ - { - author: { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - name: "Murphy Abshire" - }, - body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus.", - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", - title: "Quam et qui" - }, - { - author: { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - name: "Murphy Abshire" - }, - body: "Ducimus harum delectus consectetur.", - id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", - title: "Quam odit" - }, - { - author: { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - name: "Murphy Abshire" - }, - body: "Qui natus repellat porro.", - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", - title: "Numquam ducimus rerum" - }, - { - author: { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - name: "Murphy Abshire" - }, - body: "Amet eos dolores.", - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", - title: "Possimus et ullam" - }, - { - author: { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - name: "Rebekah Gleason" - }, - body: "Facilis voluptas mollitia est temporibus voluptatem quibusdam itaque soluta.", - id: "9007748e-5e37-4f3a-8da2-b2041505a867", - title: "Et praesentium" - }, - { - author: { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - name: "Rebekah Gleason" - }, - body: "Architecto et totam rerum esse omnis nihil eius autem.", - id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", - title: "Sunt nemo" - }, - { - author: { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - name: "Rebekah Gleason" - }, - body: "Architecto fugiat odit quam est est maxime quos exercitationem.", - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", - title: "Aut aspernatur qui" - }, - { - author: { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - name: "Rebekah Gleason" - }, - body: "Vel voluptatibus quis esse non fuga debitis.", - id: "90b11972-305f-43f8-a6a8-ddad70d1459b", - title: "Iure rerum ratione" - } - ] -}; - -export let path = { - authors: [ - { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - posts: [ - { id: "9c6abd58-0cc5-4341-87a2-ede364685ebd" }, - { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }, - { id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f" }, - { id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d" } - ] - }, - { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - posts: [ - { id: "9007748e-5e37-4f3a-8da2-b2041505a867" }, - { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682" }, - { id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae" }, - { id: "90b11972-305f-43f8-a6a8-ddad70d1459b" } - ] - } - ], - posts: [ - { - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", - author: { id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" } - }, - { - id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", - author: { id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" } - }, - { - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", - author: { id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" } - }, - { - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", - author: { id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" } - }, - { - id: "9007748e-5e37-4f3a-8da2-b2041505a867", - author: { id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" } - }, - { - id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", - author: { id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" } - }, - { - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", - author: { id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" } - }, - { - id: "90b11972-305f-43f8-a6a8-ddad70d1459b", - author: { id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" } - } - ] + } + ] + } }; export let records = { - "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6": { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - name: "Rebekah Gleason" - }, - "90b11972-305f-43f8-a6a8-ddad70d1459b": { - body: "Vel voluptatibus quis esse non fuga debitis.", - id: "90b11972-305f-43f8-a6a8-ddad70d1459b", - title: "Iure rerum ratione" - }, - "802e2565-3b33-4b89-9fbc-e0c8d1dbddae": { - body: "Architecto fugiat odit quam est est maxime quos exercitationem.", - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", - title: "Aut aspernatur qui" - }, - "77c483dd-6529-4c72-9bb6-bbfd69f65682": { - body: "Architecto et totam rerum esse omnis nihil eius autem.", - id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", - title: "Sunt nemo" - }, - "9007748e-5e37-4f3a-8da2-b2041505a867": { - body: "Facilis voluptas mollitia est temporibus voluptatem quibusdam itaque soluta.", - id: "9007748e-5e37-4f3a-8da2-b2041505a867", - title: "Et praesentium" - }, - "a1d3a2bc-e503-4640-9178-23cbd36b542c": { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - name: "Murphy Abshire" - }, - "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d": { + "UG9zdDpiYmI5NjgyMS0wNmZhLTRlMTYtOWUxYi0zYzJhNmZiNzcxMGQ=": { + __typename: "Post", body: "Amet eos dolores.", - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + id: "UG9zdDpiYmI5NjgyMS0wNmZhLTRlMTYtOWUxYi0zYzJhNmZiNzcxMGQ=", title: "Possimus et ullam" }, - "a2bce5f8-2eb7-423d-994f-d8002bd0509f": { + "QXV0aG9yOmExZDFjM2YwLTViZDUtNDUzZS1iNGY4LTlmNDE5NDU3ZTVhNg==": { + __typename: "Author", + id: "QXV0aG9yOmExZDFjM2YwLTViZDUtNDUzZS1iNGY4LTlmNDE5NDU3ZTVhNg==", + name: "Rebekah Gleason" + }, + "UG9zdDphMmJjZTVmOC0yZWI3LTQyM2QtOTk0Zi1kODAwMmJkMDUwOWY=": { + __typename: "Post", body: "Qui natus repellat porro.", - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + id: "UG9zdDphMmJjZTVmOC0yZWI3LTQyM2QtOTk0Zi1kODAwMmJkMDUwOWY=", title: "Numquam ducimus rerum" }, - "2c969ce7-02ae-42b1-a94d-7d0a38804c85": { + "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=": { + __typename: "Post", body: "Ducimus harum delectus consectetur.", - id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", + id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=", title: "Quam odit" }, - "9c6abd58-0cc5-4341-87a2-ede364685ebd": { + "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==": { + __typename: "Author", + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==", + name: "Murphy Abshire" + }, + "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=": { + __typename: "Post", body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus.", - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=", title: "Quam et qui" } }; + +export let path = { + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=", + author: { + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==" + } + } + }, + { + __typename: "PostEdge", + node: { + id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=", + author: { + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==" + } + } + }, + { + __typename: "PostEdge", + node: { + id: "UG9zdDphMmJjZTVmOC0yZWI3LTQyM2QtOTk0Zi1kODAwMmJkMDUwOWY=", + author: { + id: "QXV0aG9yOmExZDFjM2YwLTViZDUtNDUzZS1iNGY4LTlmNDE5NDU3ZTVhNg==" + } + } + }, + { + __typename: "PostEdge", + node: { + id: "UG9zdDpiYmI5NjgyMS0wNmZhLTRlMTYtOWUxYi0zYzJhNmZiNzcxMGQ=", + author: { + id: "QXV0aG9yOmExZDFjM2YwLTViZDUtNDUzZS1iNGY4LTlmNDE5NDU3ZTVhNg==" + } + } + } + ] + }, + authors: { + __typename: "AuthorConnection", + edges: [ + { + __typename: "AuthorEdge", + node: { + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==", + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=" + } + }, + { + __typename: "PostEdge", + node: { + id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=" + } + } + ] + } + } + }, + { + __typename: "AuthorEdge", + node: { + id: "QXV0aG9yOmExZDFjM2YwLTViZDUtNDUzZS1iNGY4LTlmNDE5NDU3ZTVhNg==", + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + id: "UG9zdDphMmJjZTVmOC0yZWI3LTQyM2QtOTk0Zi1kODAwMmJkMDUwOWY=" + } + }, + { + __typename: "PostEdge", + node: { + id: "UG9zdDpiYmI5NjgyMS0wNmZhLTRlMTYtOWUxYi0zYzJhNmZiNzcxMGQ=" + } + } + ] + } + } + } + ] + } +}; diff --git a/packages/core/__tests__/data/posts-with-fragments.ts b/packages/core/__tests__/data/posts-with-fragments.ts index f95a5a02..c9248a81 100644 --- a/packages/core/__tests__/data/posts-with-fragments.ts +++ b/packages/core/__tests__/data/posts-with-fragments.ts @@ -1,348 +1,296 @@ export let data = { - posts: [ - { - author: { - name: "Murphy Abshire", - posts: [ - { - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", - title: "Quam et qui" + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + author: { + name: "Murphy Abshire", + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + __typename: "Post", + id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=", + title: "Quam et qui" + } + }, + { + __typename: "PostEdge", + node: { + __typename: "Post", + id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=", + title: "Quam odit" + } + } + ] + }, + __typename: "Author", + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==" }, - { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", title: "Quam odit" }, - { - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", - title: "Numquam ducimus rerum" - }, - { - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", - title: "Possimus et ullam" - } - ], - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" + body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus.", + title: "Quam et qui", + __typename: "Post", + id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=" + } }, - body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus.", - title: "Quam et qui", - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd" - }, - { - author: { - name: "Murphy Abshire", - posts: [ - { - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", - title: "Quam et qui" + { + __typename: "PostEdge", + node: { + author: { + name: "Murphy Abshire", + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + __typename: "Post", + id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=", + title: "Quam et qui" + } + }, + { + __typename: "PostEdge", + node: { + __typename: "Post", + id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=", + title: "Quam odit" + } + } + ] + }, + __typename: "Author", + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==" }, - { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", title: "Quam odit" }, - { - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", - title: "Numquam ducimus rerum" - }, - { - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", - title: "Possimus et ullam" - } - ], - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" + body: "Ducimus harum delectus consectetur.", + title: "Quam odit", + __typename: "Post", + id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=" + } }, - body: "Ducimus harum delectus consectetur.", - title: "Quam odit", - id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" - }, - { - author: { - name: "Murphy Abshire", - posts: [ - { - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", - title: "Quam et qui" + { + __typename: "PostEdge", + node: { + author: { + name: "Rebekah Gleason", + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + __typename: "Post", + id: "UG9zdDphMmJjZTVmOC0yZWI3LTQyM2QtOTk0Zi1kODAwMmJkMDUwOWY=", + title: "Numquam ducimus rerum" + } + }, + { + __typename: "PostEdge", + node: { + __typename: "Post", + id: "UG9zdDpiYmI5NjgyMS0wNmZhLTRlMTYtOWUxYi0zYzJhNmZiNzcxMGQ=", + title: "Possimus et ullam" + } + } + ] + }, + __typename: "Author", + id: "QXV0aG9yOmExZDFjM2YwLTViZDUtNDUzZS1iNGY4LTlmNDE5NDU3ZTVhNg==" }, - { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", title: "Quam odit" }, - { - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", - title: "Numquam ducimus rerum" - }, - { - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", - title: "Possimus et ullam" - } - ], - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" + body: "Qui natus repellat porro.", + title: "Numquam ducimus rerum", + __typename: "Post", + id: "UG9zdDphMmJjZTVmOC0yZWI3LTQyM2QtOTk0Zi1kODAwMmJkMDUwOWY=" + } }, - body: "Qui natus repellat porro.", - title: "Numquam ducimus rerum", - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f" - }, - { - author: { - name: "Murphy Abshire", - posts: [ - { - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", - title: "Quam et qui" - }, - { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", title: "Quam odit" }, - { - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", - title: "Numquam ducimus rerum" - }, - { - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", - title: "Possimus et ullam" - } - ], - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c" - }, - body: "Amet eos dolores.", - title: "Possimus et ullam", - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d" - }, - { - author: { - name: "Rebekah Gleason", - posts: [ - { - id: "9007748e-5e37-4f3a-8da2-b2041505a867", - title: "Et praesentium" - }, - { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", title: "Sunt nemo" }, - { - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", - title: "Aut aspernatur qui" - }, - { - id: "90b11972-305f-43f8-a6a8-ddad70d1459b", - title: "Iure rerum ratione" - } - ], - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" - }, - body: "Facilis voluptas mollitia est temporibus voluptatem quibusdam itaque soluta.", - title: "Et praesentium", - id: "9007748e-5e37-4f3a-8da2-b2041505a867" - }, - { - author: { - name: "Rebekah Gleason", - posts: [ - { - id: "9007748e-5e37-4f3a-8da2-b2041505a867", - title: "Et praesentium" - }, - { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", title: "Sunt nemo" }, - { - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", - title: "Aut aspernatur qui" + { + __typename: "PostEdge", + node: { + author: { + name: "Rebekah Gleason", + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + __typename: "Post", + id: "UG9zdDphMmJjZTVmOC0yZWI3LTQyM2QtOTk0Zi1kODAwMmJkMDUwOWY=", + title: "Numquam ducimus rerum" + } + }, + { + __typename: "PostEdge", + node: { + __typename: "Post", + id: "UG9zdDpiYmI5NjgyMS0wNmZhLTRlMTYtOWUxYi0zYzJhNmZiNzcxMGQ=", + title: "Possimus et ullam" + } + } + ] + }, + __typename: "Author", + id: "QXV0aG9yOmExZDFjM2YwLTViZDUtNDUzZS1iNGY4LTlmNDE5NDU3ZTVhNg==" }, - { - id: "90b11972-305f-43f8-a6a8-ddad70d1459b", - title: "Iure rerum ratione" - } - ], - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" - }, - body: "Architecto et totam rerum esse omnis nihil eius autem.", - title: "Sunt nemo", - id: "77c483dd-6529-4c72-9bb6-bbfd69f65682" - }, - { - author: { - name: "Rebekah Gleason", - posts: [ - { - id: "9007748e-5e37-4f3a-8da2-b2041505a867", - title: "Et praesentium" - }, - { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", title: "Sunt nemo" }, - { - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", - title: "Aut aspernatur qui" - }, - { - id: "90b11972-305f-43f8-a6a8-ddad70d1459b", - title: "Iure rerum ratione" - } - ], - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" - }, - body: "Architecto fugiat odit quam est est maxime quos exercitationem.", - title: "Aut aspernatur qui", - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae" - }, - { - author: { - name: "Rebekah Gleason", - posts: [ - { - id: "9007748e-5e37-4f3a-8da2-b2041505a867", - title: "Et praesentium" - }, - { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", title: "Sunt nemo" }, - { - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", - title: "Aut aspernatur qui" - }, - { - id: "90b11972-305f-43f8-a6a8-ddad70d1459b", - title: "Iure rerum ratione" - } - ], - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6" - }, - body: "Vel voluptatibus quis esse non fuga debitis.", - title: "Iure rerum ratione", - id: "90b11972-305f-43f8-a6a8-ddad70d1459b" - } - ] -}; - -export let path = { - posts: [ - { - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", - author: { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - posts: [ - { id: "9c6abd58-0cc5-4341-87a2-ede364685ebd" }, - { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }, - { id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f" }, - { id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d" } - ] - } - }, - { - id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", - author: { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - posts: [ - { id: "9c6abd58-0cc5-4341-87a2-ede364685ebd" }, - { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }, - { id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f" }, - { id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d" } - ] + body: "Amet eos dolores.", + title: "Possimus et ullam", + __typename: "Post", + id: "UG9zdDpiYmI5NjgyMS0wNmZhLTRlMTYtOWUxYi0zYzJhNmZiNzcxMGQ=" + } } - }, - { - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", - author: { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - posts: [ - { id: "9c6abd58-0cc5-4341-87a2-ede364685ebd" }, - { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }, - { id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f" }, - { id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d" } - ] - } - }, - { - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", - author: { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - posts: [ - { id: "9c6abd58-0cc5-4341-87a2-ede364685ebd" }, - { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }, - { id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f" }, - { id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d" } - ] - } - }, - { - id: "9007748e-5e37-4f3a-8da2-b2041505a867", - author: { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - posts: [ - { id: "9007748e-5e37-4f3a-8da2-b2041505a867" }, - { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682" }, - { id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae" }, - { id: "90b11972-305f-43f8-a6a8-ddad70d1459b" } - ] - } - }, - { - id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", - author: { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - posts: [ - { id: "9007748e-5e37-4f3a-8da2-b2041505a867" }, - { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682" }, - { id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae" }, - { id: "90b11972-305f-43f8-a6a8-ddad70d1459b" } - ] - } - }, - { - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", - author: { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - posts: [ - { id: "9007748e-5e37-4f3a-8da2-b2041505a867" }, - { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682" }, - { id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae" }, - { id: "90b11972-305f-43f8-a6a8-ddad70d1459b" } - ] - } - }, - { - id: "90b11972-305f-43f8-a6a8-ddad70d1459b", - author: { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - posts: [ - { id: "9007748e-5e37-4f3a-8da2-b2041505a867" }, - { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682" }, - { id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae" }, - { id: "90b11972-305f-43f8-a6a8-ddad70d1459b" } - ] - } - } - ] + ] + } }; export let records = { - "90b11972-305f-43f8-a6a8-ddad70d1459b": { - id: "90b11972-305f-43f8-a6a8-ddad70d1459b", - body: "Vel voluptatibus quis esse non fuga debitis.", - title: "Iure rerum ratione" - }, - "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6": { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - name: "Rebekah Gleason" - }, - "802e2565-3b33-4b89-9fbc-e0c8d1dbddae": { - id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae", - title: "Aut aspernatur qui", - body: "Architecto fugiat odit quam est est maxime quos exercitationem." - }, - "77c483dd-6529-4c72-9bb6-bbfd69f65682": { - id: "77c483dd-6529-4c72-9bb6-bbfd69f65682", - title: "Sunt nemo", - body: "Architecto et totam rerum esse omnis nihil eius autem." - }, - "9007748e-5e37-4f3a-8da2-b2041505a867": { - id: "9007748e-5e37-4f3a-8da2-b2041505a867", - title: "Et praesentium", - body: "Facilis voluptas mollitia est temporibus voluptatem quibusdam itaque soluta." - }, - "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d": { - id: "bbb96821-06fa-4e16-9e1b-3c2a6fb7710d", + "UG9zdDpiYmI5NjgyMS0wNmZhLTRlMTYtOWUxYi0zYzJhNmZiNzcxMGQ=": { + __typename: "Post", + id: "UG9zdDpiYmI5NjgyMS0wNmZhLTRlMTYtOWUxYi0zYzJhNmZiNzcxMGQ=", body: "Amet eos dolores.", title: "Possimus et ullam" }, - "a1d3a2bc-e503-4640-9178-23cbd36b542c": { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - name: "Murphy Abshire" + "QXV0aG9yOmExZDFjM2YwLTViZDUtNDUzZS1iNGY4LTlmNDE5NDU3ZTVhNg==": { + __typename: "Author", + id: "QXV0aG9yOmExZDFjM2YwLTViZDUtNDUzZS1iNGY4LTlmNDE5NDU3ZTVhNg==", + name: "Rebekah Gleason" }, - "a2bce5f8-2eb7-423d-994f-d8002bd0509f": { - id: "a2bce5f8-2eb7-423d-994f-d8002bd0509f", + "UG9zdDphMmJjZTVmOC0yZWI3LTQyM2QtOTk0Zi1kODAwMmJkMDUwOWY=": { + __typename: "Post", + id: "UG9zdDphMmJjZTVmOC0yZWI3LTQyM2QtOTk0Zi1kODAwMmJkMDUwOWY=", title: "Numquam ducimus rerum", body: "Qui natus repellat porro." }, - "2c969ce7-02ae-42b1-a94d-7d0a38804c85": { - id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", - title: "Quam odit", - body: "Ducimus harum delectus consectetur." + "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=": { + __typename: "Post", + id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=", + body: "Ducimus harum delectus consectetur.", + title: "Quam odit" }, - "9c6abd58-0cc5-4341-87a2-ede364685ebd": { - id: "9c6abd58-0cc5-4341-87a2-ede364685ebd", + "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==": { + __typename: "Author", + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==", + name: "Murphy Abshire" + }, + "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=": { + __typename: "Post", + id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=", title: "Quam et qui", body: "Sit dignissimos ullam tenetur ex minus saepe quo repellendus." } }; + +export let path = { + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=", + author: { + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==", + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=" + } + }, + { + __typename: "PostEdge", + node: { + id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=" + } + } + ] + } + } + } + }, + { + __typename: "PostEdge", + node: { + id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=", + author: { + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==", + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=" + } + }, + { + __typename: "PostEdge", + node: { + id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=" + } + } + ] + } + } + } + }, + { + __typename: "PostEdge", + node: { + id: "UG9zdDphMmJjZTVmOC0yZWI3LTQyM2QtOTk0Zi1kODAwMmJkMDUwOWY=", + author: { + id: "QXV0aG9yOmExZDFjM2YwLTViZDUtNDUzZS1iNGY4LTlmNDE5NDU3ZTVhNg==", + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + id: "UG9zdDphMmJjZTVmOC0yZWI3LTQyM2QtOTk0Zi1kODAwMmJkMDUwOWY=" + } + }, + { + __typename: "PostEdge", + node: { + id: "UG9zdDpiYmI5NjgyMS0wNmZhLTRlMTYtOWUxYi0zYzJhNmZiNzcxMGQ=" + } + } + ] + } + } + } + }, + { + __typename: "PostEdge", + node: { + id: "UG9zdDpiYmI5NjgyMS0wNmZhLTRlMTYtOWUxYi0zYzJhNmZiNzcxMGQ=", + author: { + id: "QXV0aG9yOmExZDFjM2YwLTViZDUtNDUzZS1iNGY4LTlmNDE5NDU3ZTVhNg==", + posts: { + __typename: "PostConnection", + edges: [ + { + __typename: "PostEdge", + node: { + id: "UG9zdDphMmJjZTVmOC0yZWI3LTQyM2QtOTk0Zi1kODAwMmJkMDUwOWY=" + } + }, + { + __typename: "PostEdge", + node: { + id: "UG9zdDpiYmI5NjgyMS0wNmZhLTRlMTYtOWUxYi0zYzJhNmZiNzcxMGQ=" + } + } + ] + } + } + } + } + ] + } +}; diff --git a/packages/core/__tests__/index.ts b/packages/core/__tests__/index.ts index e5a11197..a31627d8 100644 --- a/packages/core/__tests__/index.ts +++ b/packages/core/__tests__/index.ts @@ -1,34 +1,25 @@ import graphql from "@grafoo/core/tag"; -import { executeQuery } from "@grafoo/test-utils"; +import { executeQuery, Query, QueryPostArgs } from "@grafoo/test-utils"; import createClient from "../src"; import { GrafooClient } from "../src/types"; -type Post = { - title?: string; - content?: string; - id?: string; - __typename?: string; - author?: Author; -}; - -type Author = { - name?: string; - id?: string; - __typename?: string; - posts?: Array; -}; - -type AuthorsQuery = { - authors: Author[]; -}; +type AuthorsQuery = Pick; let AUTHORS = graphql` query { authors { - name - posts { - title - body + edges { + node { + name + posts { + edges { + node { + body + title + } + } + } + } } } } @@ -37,47 +28,54 @@ let AUTHORS = graphql` let SIMPLE_AUTHORS = graphql` query { authors { - name + edges { + node { + name + } + } } } `; -type PostsAndAuthorsQuery = { - authors: Author[]; - posts: Post[]; -}; +type PostsAndAuthorsQuery = Pick; let POSTS_AND_AUTHORS = graphql` query { posts { - title - body - author { - name + edges { + node { + title + body + author { + name + } + } } } authors { - name - posts { - title - body + edges { + node { + name + posts { + edges { + node { + body + title + } + } + } + } } } } `; -type PostQuery = { - post: Post; -}; - -type PostQueryArgs = { - postId: string; -}; +type PostQuery = Pick; -let POST = graphql` - query ($postId: ID!) { - post(id: $postId) { +let POST = graphql` + query ($id: ID!) { + post(id: $id) { title body author { @@ -87,9 +85,9 @@ let POST = graphql` } `; -let POST_WITH_FRAGMENT = graphql` - query ($postId: ID!) { - post(id: $postId) { +let POST_WITH_FRAGMENT = graphql` + query ($id: ID!) { + post(id: $id) { title body author { @@ -103,23 +101,25 @@ let POST_WITH_FRAGMENT = graphql` } `; -type PostsQuery = { - posts: Post[]; -}; +type PostsQuery = Pick; let POSTS = graphql` query { posts { - title - body - author { - name + edges { + node { + title + body + author { + name + } + } } } } `; -function mockTransport(query, variables) { +function mockTransport(query: any, variables: any) { return executeQuery({ query, variables }); } @@ -135,7 +135,7 @@ describe("@grafoo/core", () => { expect(typeof client.listen).toBe("function"); expect(typeof client.write).toBe("function"); expect(typeof client.read).toBe("function"); - expect(typeof client.flush).toBe("function"); + expect(typeof client.extract).toBe("function"); expect(typeof client.reset).toBe("function"); }); @@ -145,7 +145,7 @@ describe("@grafoo/core", () => { }); it("should perform query requests with fragments", async () => { - let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; + let variables = { id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; let data = await executeQuery({ query: POST_WITH_FRAGMENT.document, variables }); @@ -158,10 +158,10 @@ describe("@grafoo/core", () => { client.write(POSTS_AND_AUTHORS, data); let { authors, posts } = data; - let { records } = client.flush(); + let { records } = client.extract(); - expect(authors.every((author) => Boolean(records[author.id]))).toBe(true); - expect(posts.every((post) => Boolean(records[post.id]))).toBe(true); + expect(authors.edges.every((a) => Boolean(records[a.node.id]))).toBe(true); + expect(posts.edges.every((p) => Boolean(records[p.node.id]))).toBe(true); }); it("should write queries partially to the client", async () => { @@ -183,34 +183,36 @@ describe("@grafoo/core", () => { let { authors } = data; expect(authors).toEqual(result.data.authors); - expect(authors.every((author) => Boolean(result.records[author.id]))).toBe(true); - expect(authors.every((a) => a.posts.every((post) => !!result.records[post.id]))).toBe(true); + expect(authors.edges.every((a) => Boolean(result.records[a.node.id]))).toBe(true); + expect( + authors.edges.every((a) => a.node.posts.edges.every((p) => !!result.records[p.node.id])) + ).toBe(true); }); it("should handle queries with variables", async () => { - let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; + let variables = { id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=" }; let { data } = await client.execute(POST, variables); client.write(POST, variables, data); - expect(client.read(POST, { postId: "123" }).data).toEqual({}); - expect(client.read(POST, variables).data.post.id).toBe(variables.postId); + expect(client.read(POST, { id: "123" }).data).toEqual({}); + expect(client.read(POST, variables).data.post.id).toBe(variables.id); }); it("should distinguish between calls to the same query with different variables", async () => { - let v1 = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; - let v2 = { postId: "77c483dd-6529-4c72-9bb6-bbfd69f65682" }; + let v1 = { id: "UG9zdDo5YzZhYmQ1OC0wY2M1LTQzNDEtODdhMi1lZGUzNjQ2ODVlYmQ=" }; + let v2 = { id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=" }; let d1 = await client.execute(POST, v1); client.write(POST, v1, d1.data); - expect(client.read(POST, v1).data.post.id).toBe(v1.postId); + expect(client.read(POST, v1).data.post.id).toBe(v1.id); let d2 = await client.execute(POST, v2); client.write(POST, v2, d2.data); - expect(client.read(POST, v1).data.post.id).toBe(v1.postId); - expect(client.read(POST, v2).data.post.id).toBe(v2.postId); + expect(client.read(POST, v1).data.post.id).toBe(v1.id); + expect(client.read(POST, v2).data.post.id).toBe(v2.id); }); it("should flag if a query result is partial", async () => { @@ -222,7 +224,7 @@ describe("@grafoo/core", () => { }); it("should perform update to client", async () => { - let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; + let variables = { id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=" }; let { data } = await client.execute(POST, variables); client.write(POST, variables, data); @@ -234,11 +236,12 @@ describe("@grafoo/core", () => { expect(post.title).toBe("Quam odit"); client.write(POST, variables, { post: { ...post, title: "updated title" } }); + expect(client.read(POST, variables).data.post.title).toBe("updated title"); }); it("should reflect updates on queries when shared records change", async () => { - let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; + let variables = { id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=" }; let postData = await client.execute(POST, variables); let postsData = await client.execute(POSTS, variables); @@ -246,7 +249,7 @@ describe("@grafoo/core", () => { let { posts } = client.read(POSTS).data; - expect(posts.find((p) => p.id === variables.postId).title).toBe("Quam odit"); + expect(posts.edges.find((p) => p.node.id === variables.id).node.title).toBe("Quam odit"); client.write(POST, variables, { post: { ...postData.data.post, title: "updated title" } @@ -254,11 +257,13 @@ describe("@grafoo/core", () => { let { posts: updatedPosts } = client.read(POSTS, variables).data; - expect(updatedPosts.find((p) => p.id === variables.postId).title).toBe("updated title"); + expect(updatedPosts.edges.find((p) => p.node.id === variables.id).node.title).toBe( + "updated title" + ); }); it("should merge records in the client when removing or adding properties", async () => { - let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; + let variables = { id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=" }; let { data } = await client.execute(POST, variables); client.write(POST, variables, data); @@ -270,20 +275,13 @@ describe("@grafoo/core", () => { client.write(POST, variables, { post }); expect(client.read(POST, variables).data.post).toEqual({ - __typename: "Post", - author: { - __typename: "Author", - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - name: "Murphy Abshire" - }, - body: "Ducimus harum delectus consectetur.", - id: "2c969ce7-02ae-42b1-a94d-7d0a38804c85", + ...data.post, title: "updated title" }); }); it("should call client listeners on write with paths records as arguments", async () => { - let variables = { postId: "2c969ce7-02ae-42b1-a94d-7d0a38804c85" }; + let variables = { id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=" }; let { data } = await client.execute(POST, variables); let listener = jest.fn(); @@ -313,7 +311,7 @@ describe("@grafoo/core", () => { client.write(POSTS_AND_AUTHORS, data); - client = createClient(mockTransport, { idFields: ["id"], initialState: client.flush() }); + client = createClient(mockTransport, { idFields: ["id"], initialState: client.extract() }); expect(client.read(POSTS_AND_AUTHORS).data).toEqual(data); }); @@ -323,7 +321,7 @@ describe("@grafoo/core", () => { client.write(AUTHORS, data); expect(client.read(AUTHORS).data).toEqual(data); client.reset(); - expect(client.flush()).toEqual({ records: {}, paths: {} }); + expect(client.extract()).toEqual({ records: {}, paths: {} }); }); it("should accept `idFields` array in options", async () => { @@ -332,7 +330,7 @@ describe("@grafoo/core", () => { client.write(AUTHORS, data); - let cachedIds = Object.keys(client.flush().records); + let cachedIds = Object.keys(client.extract().records); expect(cachedIds.every((key) => /(Post|Author)/.test(key))).toBe(true); }); diff --git a/packages/core/__tests__/resolve-values.ts b/packages/core/__tests__/resolve-values.ts index 31177912..2555e667 100644 --- a/packages/core/__tests__/resolve-values.ts +++ b/packages/core/__tests__/resolve-values.ts @@ -4,27 +4,41 @@ import * as postsAndAuthors from "./data/posts-and-authors"; import * as postsWithFragments from "./data/posts-with-fragments"; import * as authorWithArguments from "./data/author-with-arguments"; -describe("resolveValues", () => { - it("should resolve the data given a simple query, a path and the records", () => { - let query = graphql` - query { - posts { +let POSTS_AND_AUTHORS = graphql` + query { + posts { + edges { + node { title body author { name } } + } + } - authors { + authors { + edges { + node { name posts { - title - body + edges { + node { + body + title + } + } } } } - `; + } + } +`; + +describe("resolveValues", () => { + it("should resolve the data given a simple query, a path and the records", () => { + let query = POSTS_AND_AUTHORS; let { data, records } = resolveValues(query, {}, postsAndAuthors.path, postsAndAuthors.records); @@ -36,7 +50,11 @@ describe("resolveValues", () => { let query = graphql` query { posts { - ...P + edges { + node { + ...P + } + } } } @@ -51,7 +69,11 @@ describe("resolveValues", () => { fragment A on Author { name posts { - title + edges { + node { + title + } + } } } `; @@ -67,22 +89,25 @@ describe("resolveValues", () => { expect(records).toEqual(postsWithFragments.records); }); - it("should resolve the data given a query with arguments, a path and the records", () => { + it("should resolve the data given a query with arguments, a path and the records", async () => { let query = graphql` - query ($id: ID!, $from: Int, $to: Int) { + query ($id: ID!, $first: Int!) { author(id: $id) { name - posts(from: $from, to: $to) { - title + posts(first: $first) { + edges { + node { + title + } + } } } } `; let variables = { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - from: 0, - to: 2 + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==", + first: 1 }; let { data, records } = resolveValues( @@ -98,7 +123,7 @@ describe("resolveValues", () => { it("should resolve the data given a query with fragments and arguments, a path and the records", () => { let query = graphql` - query ($id: ID!, $from: Int, $to: Int) { + query ($id: ID!, $first: Int) { author(id: $id) { name ...AuthorStuff @@ -106,16 +131,19 @@ describe("resolveValues", () => { } fragment AuthorStuff on Author { - posts(from: $from, to: $to) { - title + posts(first: $first) { + edges { + node { + title + } + } } } `; let variables = { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - from: 0, - to: 2 + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==", + first: 1 }; let { data, records } = resolveValues( @@ -146,25 +174,7 @@ describe("resolveValues", () => { }); it("should be able to resolve values partially", () => { - let query = graphql` - query { - posts { - title - body - author { - name - } - } - - authors { - name - posts { - title - body - } - } - } - `; + let query = POSTS_AND_AUTHORS; let { data, partial } = resolveValues( query, diff --git a/packages/core/__tests__/store-values.ts b/packages/core/__tests__/store-values.ts index bb4bf8a6..b2b1b698 100644 --- a/packages/core/__tests__/store-values.ts +++ b/packages/core/__tests__/store-values.ts @@ -1,44 +1,67 @@ import graphql from "@grafoo/core/tag"; +import { GrafooPath, GrafooRecords } from "../src"; import storeValues from "../src/store-values"; import * as postsAndAuthors from "./data/posts-and-authors"; import * as postsWithFragments from "./data/posts-with-fragments"; import * as authorWithArguments from "./data/author-with-arguments"; -let idFields = ["id"]; - -describe("storeValues", () => { - it("should yield correct path and records to a normal query", () => { - let query = graphql` - query { - posts { +let POSTS_AND_AUTHORS = graphql` + query { + posts { + edges { + node { title body author { name } } + } + } - authors { + authors { + edges { + node { name posts { - title - body + edges { + node { + body + title + } + } } } } - `; + } + } +`; + +let idFields = ["id"]; + +describe("storeValues", () => { + it("should yield correct path and records to a normal query", () => { + let query = POSTS_AND_AUTHORS; + let paths: GrafooPath = {}; + let records: GrafooRecords = {}; - let { path, records } = storeValues(query, {}, postsAndAuthors.data, idFields); + storeValues(query, {}, postsAndAuthors.data, paths, records, idFields); - expect(path).toEqual(postsAndAuthors.path); + expect(paths).toEqual(postsAndAuthors.path); expect(records).toEqual(postsAndAuthors.records); }); it("should yield correct path and records to queries with fragments", () => { + let paths: GrafooPath = {}; + let records: GrafooRecords = {}; let query = graphql` query { posts { - ...P + edges { + node { + ...P + } + } } } @@ -53,96 +76,137 @@ describe("storeValues", () => { fragment A on Author { name posts { - title + edges { + node { + title + } + } } } `; - let { path, records } = storeValues(query, {}, postsWithFragments.data, idFields); + storeValues(query, {}, postsWithFragments.data, paths, records, idFields); - expect(path).toEqual(postsWithFragments.path); + expect(paths).toEqual(postsWithFragments.path); expect(records).toEqual(postsWithFragments.records); }); it("should yield correct path and records to queries with arguments", () => { + let paths: GrafooPath = {}; + let records: GrafooRecords = {}; let query = graphql` - query ($id: ID!, $from: Int, $to: Int) { + query ($id: ID!, $first: Int!) { author(id: $id) { name - posts(from: $from, to: $to) { - title + posts(first: $first) { + edges { + node { + title + } + } } } } `; let variables = { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - from: 0, - to: 2 + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==", + first: 1 }; - let { path, records } = storeValues(query, variables, authorWithArguments.data, idFields); + storeValues(query, variables, authorWithArguments.data, paths, records, idFields); - expect(path).toEqual(authorWithArguments.path); + expect(paths).toEqual(authorWithArguments.path); expect(records).toEqual(authorWithArguments.records); }); it("should yield correct path and records to queries with arguments and fragments", () => { + let paths: GrafooPath = {}; + let records: GrafooRecords = {}; let query = graphql` - query ($id: ID!, $from: Int, $to: Int) { + query ($id: ID!, $first: Int) { author(id: $id) { name - posts(from: $from, to: $to) { - ...PostStuff - } + ...AuthorStuff } } - fragment PostStuff on Post { - title + fragment AuthorStuff on Author { + posts(first: $first) { + edges { + node { + title + } + } + } } `; let variables = { - id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", - from: 0, - to: 2 + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==", + first: 1 }; - let { path, records } = storeValues(query, variables, authorWithArguments.data, idFields); + storeValues(query, variables, authorWithArguments.data, paths, records, idFields); - expect(path).toEqual(authorWithArguments.path); + expect(paths).toEqual(authorWithArguments.path); expect(records).toEqual(authorWithArguments.records); }); it("should deal correctly with null values", () => { + let paths: GrafooPath = {}; + let records: GrafooRecords = {}; let query = graphql` query { authors { - name + edges { + node { + name + } + } } } `; let data = { authors: postsAndAuthors.data.authors }; - data.authors[0].posts = null; - - let { path } = storeValues(query, {}, data, idFields); - - expect(path).toEqual({ - authors: [ - { id: "a1d3a2bc-e503-4640-9178-23cbd36b542c", posts: null }, - { - id: "a1d1c3f0-5bd5-453e-b4f8-9f419457e5a6", - posts: [ - { id: "9007748e-5e37-4f3a-8da2-b2041505a867" }, - { id: "77c483dd-6529-4c72-9bb6-bbfd69f65682" }, - { id: "802e2565-3b33-4b89-9fbc-e0c8d1dbddae" }, - { id: "90b11972-305f-43f8-a6a8-ddad70d1459b" } - ] - } - ] + + data.authors.edges[0].node.posts = null; + + storeValues(query, {}, data, paths, records, idFields); + + expect(paths).toEqual({ + authors: { + __typename: "AuthorConnection", + edges: [ + { + __typename: "AuthorEdge", + node: { + id: "QXV0aG9yOmExZDNhMmJjLWU1MDMtNDY0MC05MTc4LTIzY2JkMzZiNTQyYw==", + posts: null + } + }, + { + __typename: "AuthorEdge", + node: { + id: "QXV0aG9yOmExZDFjM2YwLTViZDUtNDUzZS1iNGY4LTlmNDE5NDU3ZTVhNg==", + posts: { + edges: [ + { + node: { + id: "UG9zdDphMmJjZTVmOC0yZWI3LTQyM2QtOTk0Zi1kODAwMmJkMDUwOWY=" + } + }, + { + node: { + id: "UG9zdDpiYmI5NjgyMS0wNmZhLTRlMTYtOWUxYi0zYzJhNmZiNzcxMGQ=" + } + } + ] + } + } + } + ] + } }); }); }); diff --git a/packages/core/babel.config.js b/packages/core/babel.config.js new file mode 100644 index 00000000..a4068631 --- /dev/null +++ b/packages/core/babel.config.js @@ -0,0 +1,6 @@ +module.exports = { + presets: [["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-typescript"], + plugins: [ + ["module:@grafoo/babel-plugin", { schema: "schema.graphql", idFields: ["id", "__typename"] }] + ] +}; diff --git a/packages/core/package.json b/packages/core/package.json index ac31807a..3ffe613d 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -24,16 +24,16 @@ }, "scripts": { "build": "microbundle", - "test": "jest", + "watch": "microbundle watch", + "test": "jest --no-cache", "test:coverage": "jest --coverage" }, "jest": { "transform": { - "^.+\\.(ts|tsx|js)$": "/../../scripts/jest-setup.js" + "^.+\\.(ts|tsx|js)$": "babel-jest" }, - "resolver": "/../../scripts/resolver.js", "transformIgnorePatterns": [ - "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob)/)" + "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob|data-uri-to-buffer|formdata-polyfill)/)" ], "modulePathIgnorePatterns": [ "/__tests__/data" diff --git a/packages/core/schema.graphql b/packages/core/schema.graphql index 8c99e2cc..26c7e6bf 100644 --- a/packages/core/schema.graphql +++ b/packages/core/schema.graphql @@ -1,28 +1,267 @@ type Query { - author(id: ID!): Author! - authors(from: Int, to: Int): [Author!]! - post(id: ID!): Post! - posts(from: Int, to: Int): [Post!]! -} + author(id: ID!): Author + authors( + """ + Returns the items in the list that come after the specified cursor. + """ + after: String -type Mutation { - createAuthor(name: String!): Author! - updateAuthor(id: ID!, name: String): Author! - deleteAuthor(id: ID!): Author! - createPost(title: String!, body: String!, author: ID!): Post! - updatePost(id: ID!, title: String, body: String): Post! - deletePost(id: ID!): Post! + """ + Returns the first n items from the list. + """ + first: Int + + """ + Returns the items in the list that come before the specified cursor. + """ + before: String + + """ + Returns the last n items from the list. + """ + last: Int + ): AuthorConnection + post(id: ID!): Post + posts( + """ + Returns the items in the list that come after the specified cursor. + """ + after: String + + """ + Returns the first n items from the list. + """ + first: Int + + """ + Returns the items in the list that come before the specified cursor. + """ + before: String + + """ + Returns the last n items from the list. + """ + last: Int + ): PostConnection + + """ + Fetches an object given its ID + """ + node( + """ + The ID of an object + """ + id: ID! + ): Node } -type Author { +type Author implements Node { + """ + The ID of an object + """ id: ID! name: String! - posts(from: Int, to: Int): [Post!] + bio: String + posts( + """ + Returns the items in the list that come after the specified cursor. + """ + after: String + + """ + Returns the first n items from the list. + """ + first: Int + + """ + Returns the items in the list that come before the specified cursor. + """ + before: String + + """ + Returns the last n items from the list. + """ + last: Int + ): PostConnection +} + +""" +An object with an ID +""" +interface Node { + """ + The id of the object. + """ + id: ID! +} + +""" +A connection to a list of items. +""" +type PostConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [PostEdge] +} + +""" +Information about pagination in a connection. +""" +type PageInfo { + """ + When paginating forwards, are there more items? + """ + hasNextPage: Boolean! + + """ + When paginating backwards, are there more items? + """ + hasPreviousPage: Boolean! + + """ + When paginating backwards, the cursor to continue. + """ + startCursor: String + + """ + When paginating forwards, the cursor to continue. + """ + endCursor: String +} + +""" +An edge in a connection. +""" +type PostEdge { + """ + The item at the end of the edge + """ + node: Post + + """ + A cursor for use in pagination + """ + cursor: String! } -type Post { +type Post implements Node { + """ + The ID of an object + """ id: ID! title: String! body: String! author: Author! } + +""" +A connection to a list of items. +""" +type AuthorConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [AuthorEdge] +} + +""" +An edge in a connection. +""" +type AuthorEdge { + """ + The item at the end of the edge + """ + node: Author + + """ + A cursor for use in pagination + """ + cursor: String! +} + +type Mutation { + createAuthor(input: CreateAuthorInput!): CreateAuthorPayload + updateAuthor(input: UpdateAuthorInput!): UpdateAuthorPayload + deleteAuthor(input: DeleteAuthorInput!): DeleteAuthorPayload + createPost(input: CreatePostInput!): CreatePostPayload + updatePost(input: UpdatePostInput!): UpdatePostPayload + deletePost(input: DeletePostInput!): DeletePostPayload +} + +type CreateAuthorPayload { + author: Author + clientMutationId: String +} + +input CreateAuthorInput { + name: String! + bio: String + clientMutationId: String +} + +type UpdateAuthorPayload { + author: Author + clientMutationId: String +} + +input UpdateAuthorInput { + id: ID + name: String + bio: String + clientMutationId: String +} + +type DeleteAuthorPayload { + author: Author + clientMutationId: String +} + +input DeleteAuthorInput { + id: ID! + clientMutationId: String +} + +type CreatePostPayload { + post: Post + clientMutationId: String +} + +input CreatePostInput { + title: String! + body: String + authorId: ID! + clientMutationId: String +} + +type UpdatePostPayload { + post: Post + clientMutationId: String +} + +input UpdatePostInput { + id: ID! + title: String + body: String + clientMutationId: String +} + +type DeletePostPayload { + post: Post + clientMutationId: String +} + +input DeletePostInput { + id: ID! + clientMutationId: String +} diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts index 41b7a93b..b9377ddb 100644 --- a/packages/core/src/client.ts +++ b/packages/core/src/client.ts @@ -15,6 +15,7 @@ export default function createClient( options?: GrafooClientOptions ): GrafooClient { let { initialState = { paths: {}, records: {} }, idFields } = options; + let paths: GrafooPath = initialState.paths ?? {}; let records: GrafooRecords = initialState.records ?? {}; let listeners: GrafooListener[] = []; @@ -43,14 +44,7 @@ export default function createClient( variables = {}; } - let result = storeValues(query, variables, data, idFields); - let queryRecords = result.records; - Object.assign(paths, result.path); - - // assign new values to records - for (let i in queryRecords) { - Object.assign(records, { [i]: { ...records[i], ...queryRecords[i] } }); - } + let queryRecords = storeValues(query, variables, data, paths, records, idFields); // run listeners for (let i in listeners) listeners[i](queryRecords); @@ -60,7 +54,7 @@ export default function createClient( return resolveValues(query, variables, paths, records); } - function flush() { + function extract() { return { records, paths }; } @@ -69,5 +63,5 @@ export default function createClient( records = {}; } - return { execute, listen, write, read, flush, reset }; + return { execute, listen, write, read, extract, reset }; } diff --git a/packages/core/src/resolve-values.ts b/packages/core/src/resolve-values.ts index 73d2cc4c..35963de1 100644 --- a/packages/core/src/resolve-values.ts +++ b/packages/core/src/resolve-values.ts @@ -10,8 +10,8 @@ export default function resolveValues( let data = {} as T["_queryType"]; let records: GrafooRecords = {}; let partial = false; - let stack: [string, GrafooSelection, GrafooPath<{ id?: string }>, T["_queryType"]][] = [ - ["", operation, allPaths, data] + let stack: [string | void, GrafooSelection, GrafooPath<{ id?: string }>, T["_queryType"]][] = [ + [undefined, operation, allPaths, data] ]; // traverse trough operation selection @@ -31,14 +31,9 @@ export default function resolveValues( let { id } = path; let record = allRecords[id]; - if (id) { - records[id] = record; + if (id) records[id] = record; - // get scalars from client records - for (let s of currentSelect.scalars) { - data[s] = record[s]; - } - } + for (let s of currentSelect.scalars) data[s] = record?.[s] ?? path?.[s]; for (let [k, v] of Object.entries(currentSelect.select)) { let pathId = getPathId(k, v.args, variables); diff --git a/packages/core/src/store-values.ts b/packages/core/src/store-values.ts index bf380b24..2db3037c 100644 --- a/packages/core/src/store-values.ts +++ b/packages/core/src/store-values.ts @@ -2,56 +2,70 @@ import { GrafooPath, GrafooQuery, GrafooRecords, GrafooSelection } from "./types import { idFromBranch, getPathId, resolveSelection } from "./util"; export default function storeValues( - query: T, + { operation, fragments }: T, variables: T["_variablesType"], - tree: T["_queryType"], + data: T["_queryType"], + allPaths: GrafooPath, + allRecords: GrafooRecords, idFields: string[] ) { - let { operation, fragments } = query; - let path: GrafooPath = {}; let records: GrafooRecords = {}; - let stack: [string, T["_queryType"], GrafooSelection, GrafooPath][] = [ - ["", tree, operation, path] + let stack: [string | void, T["_queryType"], GrafooSelection, GrafooPath][] = [ + [undefined, data, operation, allPaths] ]; // traverse data tree while (stack.length) { let [name, branch, select, path] = stack.shift(); - let isListItem = isNaN(name as any); - let currentSelect = resolveSelection(isListItem ? select.select[name] : select, fragments); - let pathId = isListItem ? getPathId(name, currentSelect.args, variables) : name; - - // skip if a branch is null or undefined - if (!branch) { - path[pathId] = null; - continue; - } - - if (Array.isArray(branch)) { - path[pathId] = []; - } - let id = idFromBranch(branch, idFields); + // on the first iteration name is not defined + if (typeof name === "undefined") { + // add scalars to the path object if the node doesn't have id fields + for (let field of select.scalars ?? []) path[field] = branch[field]; - if (id) { - records[id] = records[id] || {}; + for (let [k, v] of Object.entries(branch)) { + if (typeof v === "object") stack.unshift([k, v, select, path]); + } + } else { + let isListItem = isNaN(parseInt(name)); + let currentSelect = resolveSelection(isListItem ? select.select[name] : select, fragments); + let pathId = isListItem ? getPathId(name, currentSelect.args, variables) : name; - // create record with branch scalar values - for (let field of currentSelect.scalars) { - records[id][field] = branch[field]; + // skip if a branch is null or undefined + if (!branch) { + path[pathId] = branch; + continue; } - // increment path with id pointing to a record - path[pathId] = { id }; - } + if (Array.isArray(branch)) { + path[pathId] = [...(path[pathId] ?? [])]; + } else { + let id = idFromBranch(branch, idFields); + + path[pathId] = { ...path[pathId] }; + + if (id) { + // increment path with id pointing to a record + path[pathId].id = id; + + allRecords[id] = allRecords[id] ?? {}; + + // create record with branch scalar values + for (let field of currentSelect.scalars) allRecords[id][field] = branch[field]; + + records[id] = allRecords[id]; + } else { + // add scalars to the path object if the node doesn't have id fields + for (let field of currentSelect.scalars) path[pathId][field] = branch[field]; + } + } - // look for new branches and increment stack - for (let [k, v] of Object.entries(branch)) { - if (typeof v === "object") { - stack.unshift([k, v, currentSelect, path[pathId] || path]); + // look for new branches and increment stack + for (let [k, v] of Object.entries(branch)) { + if (typeof v === "object") stack.unshift([k, v, currentSelect, path[pathId]]); } } } - return { path, records }; + return records; } diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index ba1c5cdd..4729a58e 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -59,7 +59,7 @@ export type GrafooClient = { variables?: T["_variablesType"] ) => { data?: T["_queryType"]; records?: GrafooRecords; partial?: boolean }; listen: (listener: GrafooListener) => () => void; - flush: () => GrafooInitialState; + extract: () => GrafooInitialState; reset: () => void; }; diff --git a/packages/core/src/util.ts b/packages/core/src/util.ts index ffb38969..604c96f1 100644 --- a/packages/core/src/util.ts +++ b/packages/core/src/util.ts @@ -13,8 +13,8 @@ export function getPathId( args: Record = {}, variables: T["_variablesType"] ) { - variables = variables || {}; - args = args || {}; + variables = variables ?? {}; + args = args ?? {}; let ids = Object.entries(args).map(([name, value]) => { let rgx = /^\$(?\w+)/i; diff --git a/packages/macro/package.json b/packages/macro/package.json new file mode 100644 index 00000000..9ad36580 --- /dev/null +++ b/packages/macro/package.json @@ -0,0 +1,28 @@ +{ + "name": "@grafoo/macro", + "version": "1.4.2-next.0", + "description": "grafoo client babel macro", + "repository": "https://github.com/grafoojs/grafoo/tree/master/packages/macro", + "main": "dist/index.js", + "author": "malbernaz", + "license": "MIT", + "keywords": [ + "babel", + "babel-macro", + "graphql", + "graphql-client", + "grafoo" + ], + "publishConfig": { + "access": "public" + }, + "scripts": { + "build": "tsc --declaration" + }, + "dependencies": { + "@babel/parser": "^7.16.3", + "@grafoo/compiler": "^1.4.2-next.0", + "babel-plugin-macros": "^3.1.0" + }, + "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" +} diff --git a/packages/macro/src/index.d.ts b/packages/macro/src/index.d.ts new file mode 100644 index 00000000..4589f5af --- /dev/null +++ b/packages/macro/src/index.d.ts @@ -0,0 +1 @@ +export { graphql as default } from "@grafoo/core"; diff --git a/packages/macro/src/index.ts b/packages/macro/src/index.ts new file mode 100644 index 00000000..e23b4c1e --- /dev/null +++ b/packages/macro/src/index.ts @@ -0,0 +1,98 @@ +import * as fs from "fs"; +import * as path from "path"; +import type bc from "@babel/core"; +import { parseExpression } from "@babel/parser"; +import { createMacro } from "babel-plugin-macros"; +import compileDocument, { Options } from "@grafoo/compiler"; +import { graphql } from "@grafoo/core"; + +let map = new Map(); + +export default createMacro(({ references }) => { + if (!map.has("opts")) map.set("opts", getOptions()); + if (!map.has("schema")) map.set("schema", getSchema(map.get("opts").schema)); + + for (let ref of references.default) { + let path = ref as bc.NodePath; + let targetPath = path.parentPath; + + if (targetPath.type === "TaggedTemplateExpression") { + let quasi = ref.parentPath.get("quasi") as bc.NodePath; + + let expressions = quasi.get("expressions"); + + if (expressions.length) { + throw expressions[0].buildCodeFrameError( + "@grafoo/macro: interpolation is not supported in a graphql tagged template literal." + ); + } + + try { + let source = quasi.node.quasis.reduce((src, q) => src + q.value.raw, ""); + let query = compileDocument(source, map.get("schema"), map.get("opts")); + targetPath.replaceWith(parseExpression(query)); + } catch (error) { + throw quasi.buildCodeFrameError(error.message); + } + } + } +}) as typeof graphql; + +function getOptions(): Options { + try { + let jsonPath = path.join(process.cwd(), "package.json"); + + fs.accessSync(jsonPath, fs.constants.F_OK); + + let pkg = fs.readFileSync(jsonPath, "utf-8"); + + return JSON.parse(pkg).grafooConfig ?? {}; + } catch (error) { + if (error.code === "ENOENT") { + throw new Error( + "Could not find a schema in the root directory. " + + "Please use the `schema` option to specify your schema path" + ); + } + + throw error; + } +} + +function getSchema(schemaPath: string) { + try { + let fullPath: string; + + if (!schemaPath) { + let schemaJson = path.join(process.cwd(), "schema.json"); + let schemaGraphql = path.join(process.cwd(), "schema.graphql"); + let schemaGql = path.join(process.cwd(), "schema.gql"); + + fullPath = fs.existsSync(schemaJson) + ? schemaJson + : fs.existsSync(schemaGraphql) + ? schemaGraphql + : fs.existsSync(schemaGql) + ? schemaGql + : undefined; + } else { + fullPath = path.join(process.cwd(), schemaPath); + } + + // @ts-ignore + fs.accessSync(fullPath, fs.F_OK); + + let schema = fs.readFileSync(fullPath, "utf-8"); + + return schema; + } catch (error) { + if (error.code === "ENOENT") { + throw new Error( + "Could not find a schema in the root directory. " + + "Please use the `schema` option to specify your schema path" + ); + } + + throw error; + } +} diff --git a/packages/macro/tsconfig.json b/packages/macro/tsconfig.json new file mode 100644 index 00000000..aa4e1c88 --- /dev/null +++ b/packages/macro/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "moduleResolution": "node", + "strict": false, + "lib": ["esnext", "dom"], + "noUnusedLocals": true, + "noUnusedParameters": true, + "checkJs": false, + "downlevelIteration": true, + "esModuleInterop": true, + "outDir": "./dist", + "module": "commonjs" + }, + "include": ["src"] +} diff --git a/packages/react/package.json b/packages/react/package.json index f9b8d40c..0938e4f9 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -26,6 +26,7 @@ }, "scripts": { "build": "microbundle", + "watch": "microbundle watch", "test": "jest", "test:coverage": "jest --coverage", "tsc": "tsc --noEmit" diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 4a15930a..282557bf 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -1,6 +1,10 @@ import * as React from "react"; import { GrafooClient, GrafooQuery } from "@grafoo/core"; -import createBindings, { GrafooConsumerProps, GrafooBoundState } from "@grafoo/bindings"; +import createBindings, { + GrafooConsumerProps, + GrafooBoundState, + makeGrafooConfig +} from "@grafoo/bindings"; // @ts-ignore export let GrafooContext = React.createContext({}); @@ -12,8 +16,10 @@ export type GrafooProviderProps = { export let GrafooProvider: React.FC = (props) => React.createElement(GrafooContext.Provider, { value: props.client }, props.children); +export { makeGrafooConfig }; + export function useGrafoo>( - props: { lazy?: boolean } & GrafooConsumerProps + props: GrafooConsumerProps ): GrafooBoundState { let client = React.useContext(GrafooContext); let update: (s: GrafooBoundState) => void = React.useCallback((s) => setState(s), []); @@ -22,24 +28,20 @@ export function useGrafoo { - if (!props.lazy && props.query && !state.loaded) { - bindings.load(); - } + if (props.query && !props.skip && !state.loaded) bindings.load(); - return () => { - bindings.unbind(); - }; + return () => bindings.unbind(); }, []); React.useEffect(() => { if ( - (!props.lazy && props.query && !state.loaded) || + (props.query && !props.skip && !state.loaded && !state.loading) || !deepEqual(variables.current, props.variables) ) { variables.current = props.variables; bindings.load(props.variables); } - }, [props.lazy, props.variables]); + }, [props.skip, props.variables]); return state; } diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 1dbb2a32..c7574175 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -8,5 +8,9 @@ }, "scripts": { "build": "tsc --declaration" + }, + "dependencies": { + "fetch-mock": "^9.11.0", + "graphql-relay": "^0.9.0" } } diff --git a/packages/test-utils/src/db.ts b/packages/test-utils/src/db.ts index 085fa5d5..5add1a13 100644 --- a/packages/test-utils/src/db.ts +++ b/packages/test-utils/src/db.ts @@ -5,26 +5,44 @@ casual.seed(666); let times = (t: number, fn: (i: number) => void) => Array.from(Array(t), fn); +type Author = { + id: string; + name: string; + posts: string[]; +}; + +type Post = { + title: string; + body?: string; + id: string; + author: string; +}; + +type Db = { + posts: Post[]; + authors: Author[]; +}; + export default function setupDB() { - let db = new Low<{ posts: any[]; authors: any[] }>(new Memory()); + let db = new Low(new Memory()); db.data = { posts: [], authors: [] }; - db.read; times(2, () => db.data.authors.push({ id: casual.uuid, name: casual.first_name + " " + casual.last_name, + posts: [] }) ); db.data.authors.forEach(({ id }) => { - times(4, () => + times(2, () => db.data.posts.push({ author: id, id: casual.uuid, title: casual.title, - body: casual.short_description, + body: casual.short_description }) ); diff --git a/packages/test-utils/src/index.ts b/packages/test-utils/src/index.ts index 38effacd..9a521a65 100644 --- a/packages/test-utils/src/index.ts +++ b/packages/test-utils/src/index.ts @@ -1,3 +1,4 @@ export * from "./db"; export * from "./mock-server"; +export * from "./types"; export * from "./http-transport"; diff --git a/packages/test-utils/src/mock-server.ts b/packages/test-utils/src/mock-server.ts index f5eadd75..9261776d 100644 --- a/packages/test-utils/src/mock-server.ts +++ b/packages/test-utils/src/mock-server.ts @@ -1,123 +1,262 @@ import { GraphQlPayload } from "@grafoo/core"; -import fetchMock from "fetch-mock"; -import fs from "fs"; -import { graphql } from "graphql"; -import { makeExecutableSchema } from "@graphql-tools/schema"; -import path from "path"; +import { + GraphQLID, + GraphQLNonNull, + GraphQLObjectType, + GraphQLSchema, + GraphQLString, + graphql +} from "graphql"; +import { + connectionArgs, + connectionDefinitions, + connectionFromArray, + fromGlobalId, + globalIdField, + mutationWithClientMutationId, + nodeDefinitions +} from "graphql-relay"; import { v4 as uuid } from "uuid"; +import fetchMock from "fetch-mock"; import setupDB from "./db"; let db = setupDB(); -let typeDefs = fs.readFileSync(path.join(__dirname, "..", "schema.graphql"), "utf-8"); +let { nodeInterface, nodeField } = nodeDefinitions( + (globalId) => { + let { type, id } = fromGlobalId(globalId); -let Query = { - author(_, args) { - return db.data.authors.find((author) => author.id === args.id); - }, - authors(_, args) { - let { authors } = db.data; - return authors?.slice(args.from ?? 0, args.to ?? authors.length) ?? null; + switch (type) { + case "Author": + return db.data.authors.find((author) => author.id === id); + case "Post": + return db.data.posts.find((post) => post.id === id); + } }, - post(_, args) { - return db.data.posts.find((post) => post.id === args.id); - }, - posts(_, args) { - let { posts } = db.data; - return posts?.slice(args.from ?? 0, args.to ?? posts.length) ?? null; - } -}; + (obj) => (obj.name ? authorType : postType) +); -let Mutation = { - createAuthor(_, args) { - let newAuthor = Object.assign({}, args, { id: uuid() }); +let authorType = new GraphQLObjectType({ + name: "Author", + interfaces: [nodeInterface], + fields: () => ({ + id: globalIdField(), + name: { type: new GraphQLNonNull(GraphQLString) }, + posts: { + type: postConnection, + args: connectionArgs, + resolve: (author, args) => + connectionFromArray( + author.posts.map((id) => db.data.posts.find((p) => p.id === id)), + args + ) + } + }) +}); - db.data.authors.push(newAuthor); +let { connectionType: authorConnection } = connectionDefinitions({ nodeType: authorType }); + +let postType = new GraphQLObjectType({ + name: "Post", + interfaces: [nodeInterface], + fields: () => ({ + id: globalIdField(), + title: { type: new GraphQLNonNull(GraphQLString) }, + body: { type: new GraphQLNonNull(GraphQLString) }, + author: { + type: new GraphQLNonNull(authorType), + resolve: (post) => db.data.authors.find((a) => a.id === post.author) + } + }) +}); + +let { connectionType: postConnection } = connectionDefinitions({ nodeType: postType }); +let queryType = new GraphQLObjectType({ + name: "Query", + fields: () => ({ + author: { + type: authorType, + args: { + id: { type: new GraphQLNonNull(GraphQLID) } + }, + resolve: (_, args) => { + let { id } = fromGlobalId(args.id); + return db.data.authors.find((a) => a.id === id); + } + }, + authors: { + type: authorConnection, + args: connectionArgs, + resolve: (_, args) => connectionFromArray(db.data.authors, args) + }, + post: { + type: postType, + args: { + id: { type: new GraphQLNonNull(GraphQLID) } + }, + resolve: (_, args) => { + let { id } = fromGlobalId(args.id); + return db.data.posts.find((a) => a.id === id); + } + }, + posts: { + type: postConnection, + args: connectionArgs, + resolve: (_, args) => connectionFromArray(db.data.posts, args) + }, + node: nodeField + }) +}); + +let createAuthor = mutationWithClientMutationId({ + name: "CreateAuthor", + inputFields: { + name: { type: new GraphQLNonNull(GraphQLString) } + }, + outputFields: { + author: { + type: authorType, + resolve: (id) => db.data.authors.find((a) => a.id === id) + } + }, + mutateAndGetPayload: (args) => { + let id = uuid(); + let newAuthor = Object.assign({}, args, { id }); + db.data.authors.push(newAuthor); db.write(); + return id; + } +}); - return newAuthor; +let updateAuthor = mutationWithClientMutationId({ + name: "UpdateAuthor", + inputFields: { + id: { type: GraphQLID }, + name: { type: GraphQLString } + }, + outputFields: { + author: { + type: authorType, + resolve: (id) => db.data.authors.find((a) => a.id === id) + } }, - updateAuthor(_, args) { - let author = Object.assign( - db.data.authors.find((author) => author.id === args.id), + mutateAndGetPayload: (args) => { + Object.assign( + db.data.authors.find((a) => a.id === args.id), args ); - db.write(); + return args.id; + } +}); - return author; +let deleteAuthor = mutationWithClientMutationId({ + name: "DeleteAuthor", + inputFields: { + id: { + type: new GraphQLNonNull(GraphQLID) + } }, - deleteAuthor(_, args) { + outputFields: { + author: { + type: authorType, + resolve: (author) => author + } + }, + mutateAndGetPayload: (args) => { let author = db.data.authors.find(args); - db.data.authors = db.data.authors.filter((a) => a.id !== author.id); db.data.posts = db.data.posts.filter((p) => p.author !== author.id); - db.write(); - return author; - }, - createPost(_, args) { - let newPost = Object.assign({}, args, { id: uuid() }); + } +}); +let createPost = mutationWithClientMutationId({ + name: "CreatePost", + inputFields: { + title: { type: new GraphQLNonNull(GraphQLString) }, + body: { type: GraphQLString }, + authorId: { type: new GraphQLNonNull(GraphQLID) } + }, + outputFields: { + post: { + type: postType, + resolve: (id) => db.data.posts.find((p) => p.id === id) + } + }, + mutateAndGetPayload: (args) => { + let id = uuid(); + db.data.authors.find((a) => a.id === args.authorId).posts.push(id); + let newPost = { title: args.title, body: args.body, author: args.authorId, id }; db.data.posts.push(newPost); - db.write(); + return id; + } +}); - return newPost; +let updatePost = mutationWithClientMutationId({ + name: "UpdatePost", + inputFields: { + id: { type: new GraphQLNonNull(GraphQLID) }, + title: { type: GraphQLString }, + body: { type: GraphQLString } + }, + outputFields: { + post: { + type: postType, + resolve: (id) => db.data.posts.find((p) => p.id === id) + } }, - updatePost(_, args) { - let post = Object.assign( - db.data.posts.find((author) => author.id === args.id), + mutateAndGetPayload: (args) => { + Object.assign( + db.data.posts.find((p) => p.id === args.id), args ); - db.write(); + return args.id; + } +}); - return post; +let deletePost = mutationWithClientMutationId({ + name: "DeletePost", + inputFields: { + id: { type: new GraphQLNonNull(GraphQLID) } }, - deletePost(_, args) { - let post = db.data.posts.find(args); - + outputFields: { + post: { + type: postType, + resolve: (post) => post + } + }, + mutateAndGetPayload: (args) => { + let post = db.data.posts.find((p) => p.id === args.id); + let author = db.data.authors.find((a) => a.id === post.author); + author.posts = author.posts.filter((p) => p !== post.id); db.data.posts = db.data.posts.filter((p) => p.id !== args.id); - db.write(); - return post; } -}; +}); -let Author = { - posts(author, args) { - let posts = author.posts - ? author.posts.map((id) => db.data.posts.find((post) => post.id === id)) - : null; - - return posts?.slice(args.from ?? 0, args.to ?? posts.length) ?? null; - } -}; - -let Post = { - author(post) { - return db.data.authors.find((author) => author.id === post.author); - } -}; - -let resolvers = { - Query: Query, - Mutation: Mutation, - Author: Author, - Post: Post -}; +let mutationType = new GraphQLObjectType({ + name: "Mutation", + fields: () => ({ + createAuthor, + updateAuthor, + deleteAuthor, + createPost, + updatePost, + deletePost + }) +}); -let schema = makeExecutableSchema({ typeDefs: typeDefs, resolvers: resolvers }); +let schema = new GraphQLSchema({ query: queryType, mutation: mutationType }); type ExecuteQueryArg = { query: string; - variables?: { - [key: string]: unknown; - }; + variables?: Record; }; export function executeQuery({ query, variables }: ExecuteQueryArg): Promise> { diff --git a/packages/test-utils/src/types.ts b/packages/test-utils/src/types.ts new file mode 100644 index 00000000..ecfff49d --- /dev/null +++ b/packages/test-utils/src/types.ts @@ -0,0 +1,210 @@ +export type Maybe = T | null; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; + +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; +}; + +export type Query = { + __typename?: "Query"; + author?: Maybe; + authors?: Maybe; + post?: Maybe; + posts?: Maybe; + node?: Maybe; +}; + +export type QueryAuthorArgs = { + id: Scalars["ID"]; +}; + +export type QueryAuthorsArgs = { + after?: Maybe; + first?: Maybe; + before?: Maybe; + last?: Maybe; +}; + +export type QueryPostArgs = { + id: Scalars["ID"]; +}; + +export type QueryPostsArgs = { + after?: Maybe; + first?: Maybe; + before?: Maybe; + last?: Maybe; +}; + +export type QueryNodeArgs = { + id: Scalars["ID"]; +}; + +export type Author = Node & { + __typename?: "Author"; + id: Scalars["ID"]; + name: Scalars["String"]; + posts?: Maybe; +}; + +export type AuthorPostsArgs = { + after?: Maybe; + first?: Maybe; + before?: Maybe; + last?: Maybe; +}; + +export type Node = { + id: Scalars["ID"]; +}; + +export type PostConnection = { + __typename?: "PostConnection"; + pageInfo: PageInfo; + edges?: Maybe>>; +}; + +export type PageInfo = { + __typename?: "PageInfo"; + hasNextPage: Scalars["Boolean"]; + hasPreviousPage: Scalars["Boolean"]; + startCursor?: Maybe; + endCursor?: Maybe; +}; + +export type PostEdge = { + __typename?: "PostEdge"; + node?: Maybe; + cursor: Scalars["String"]; +}; + +export type Post = Node & { + __typename?: "Post"; + id: Scalars["ID"]; + title: Scalars["String"]; + body: Scalars["String"]; + author: Author; +}; + +export type AuthorConnection = { + __typename?: "AuthorConnection"; + pageInfo: PageInfo; + edges?: Maybe>>; +}; + +export type AuthorEdge = { + __typename?: "AuthorEdge"; + node?: Maybe; + cursor: Scalars["String"]; +}; + +export type Mutation = { + __typename?: "Mutation"; + createAuthor?: Maybe; + updateAuthor?: Maybe; + deleteAuthor?: Maybe; + createPost?: Maybe; + updatePost?: Maybe; + deletePost?: Maybe; +}; + +export type MutationCreateAuthorArgs = { + input: CreateAuthorInput; +}; + +export type MutationUpdateAuthorArgs = { + input: UpdateAuthorInput; +}; + +export type MutationDeleteAuthorArgs = { + input: DeleteAuthorInput; +}; + +export type MutationCreatePostArgs = { + input: CreatePostInput; +}; + +export type MutationUpdatePostArgs = { + input: UpdatePostInput; +}; + +export type MutationDeletePostArgs = { + input: DeletePostInput; +}; + +export type CreateAuthorPayload = { + __typename?: "CreateAuthorPayload"; + author?: Maybe; + clientMutationId?: Maybe; +}; + +export type CreateAuthorInput = { + name: Scalars["String"]; + clientMutationId?: Maybe; +}; + +export type UpdateAuthorPayload = { + __typename?: "UpdateAuthorPayload"; + author?: Maybe; + clientMutationId?: Maybe; +}; + +export type UpdateAuthorInput = { + id?: Maybe; + name?: Maybe; + clientMutationId?: Maybe; +}; + +export type DeleteAuthorPayload = { + __typename?: "DeleteAuthorPayload"; + author?: Maybe; + clientMutationId?: Maybe; +}; + +export type DeleteAuthorInput = { + id: Scalars["ID"]; + clientMutationId?: Maybe; +}; + +export type CreatePostPayload = { + __typename?: "CreatePostPayload"; + post?: Maybe; + clientMutationId?: Maybe; +}; + +export type CreatePostInput = { + title: Scalars["String"]; + body?: Maybe; + authorId: Scalars["ID"]; + clientMutationId?: Maybe; +}; + +export type UpdatePostPayload = { + __typename?: "UpdatePostPayload"; + post?: Maybe; + clientMutationId?: Maybe; +}; + +export type UpdatePostInput = { + id: Scalars["ID"]; + title?: Maybe; + body?: Maybe; + clientMutationId?: Maybe; +}; + +export type DeletePostPayload = { + __typename?: "DeletePostPayload"; + post?: Maybe; + clientMutationId?: Maybe; +}; + +export type DeletePostInput = { + id: Scalars["ID"]; + clientMutationId?: Maybe; +}; diff --git a/scripts/jest-setup.js b/scripts/jest-setup.js index 2ef2e202..41901888 100644 --- a/scripts/jest-setup.js +++ b/scripts/jest-setup.js @@ -4,7 +4,7 @@ let { transform } = require("@babel/core"); let config = Object.assign( { sourceMap: "inline", ast: false }, - JSON.parse(fs.readFileSync(path.join(process.cwd(), ".babelrc"), "utf-8")) + require(path.join(process.cwd(), ".babelrc.json")) ); module.exports.process = (src, path) => diff --git a/yarn.lock b/yarn.lock index 9fe626f3..d514d14f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@babel/cli@^7.0.0": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.15.7.tgz#62658abedb786d09c1f70229224b11a65440d7a1" - integrity sha512-YW5wOprO2LzMjoWZ5ZG6jfbY9JnkDxuHDwvnrThnuYtByorova/I0HNXJedrUfwuXFQfYOjcqDA4PU3qlZGZjg== +"@babel/cli@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.16.0.tgz#a729b7a48eb80b49f48a339529fc4129fd7bcef3" + integrity sha512-WLrM42vKX/4atIoQB+eb0ovUof53UUvecb4qGjU2PDDWRiZr50ZpiV8NpcLo7iSxeGYrRG0Mqembsa+UrTAV6Q== dependencies: commander "^4.0.1" convert-source-map "^1.1.0" @@ -18,32 +18,32 @@ "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" chokidar "^3.4.0" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5", "@babel/code-frame@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.15.8.tgz#45990c47adadb00c03677baa89221f7cc23d2503" - integrity sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg== - dependencies: - "@babel/highlight" "^7.14.5" - -"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.15.0": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" - integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== - -"@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.12.10", "@babel/core@^7.12.3", "@babel/core@^7.15.8", "@babel/core@^7.7.2", "@babel/core@^7.7.5": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.8.tgz#195b9f2bffe995d2c6c159e72fe525b4114e8c10" - integrity sha512-3UG9dsxvYBMYwRv+gS41WKHno4K60/9GPy1CJaH6xy3Elq8CTtvtjT5R5jmNhXfCYLX2mTw+7/aq5ak/gOE0og== - dependencies: - "@babel/code-frame" "^7.15.8" - "@babel/generator" "^7.15.8" - "@babel/helper-compilation-targets" "^7.15.4" - "@babel/helper-module-transforms" "^7.15.8" - "@babel/helpers" "^7.15.4" - "@babel/parser" "^7.15.8" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431" + integrity sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA== + dependencies: + "@babel/highlight" "^7.16.0" + +"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.0.tgz#ea269d7f78deb3a7826c39a4048eecda541ebdaa" + integrity sha512-DGjt2QZse5SGd9nfOSqO4WLJ8NN/oHkijbXbPrxuoJO3oIPJL3TciZs9FX+cOHNiY9E9l0opL8g7BmLe3T+9ew== + +"@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.12.10", "@babel/core@^7.12.3", "@babel/core@^7.16.0", "@babel/core@^7.7.2", "@babel/core@^7.7.5": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.0.tgz#c4ff44046f5fe310525cc9eb4ef5147f0c5374d4" + integrity sha512-mYZEvshBRHGsIAiyH5PzCFTCfbWfoYbO/jcSdXQSUQu1/pW0xDZAUP7KEc32heqWTAfAHhV9j1vH8Sav7l+JNQ== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/generator" "^7.16.0" + "@babel/helper-compilation-targets" "^7.16.0" + "@babel/helper-module-transforms" "^7.16.0" + "@babel/helpers" "^7.16.0" + "@babel/parser" "^7.16.0" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -51,64 +51,64 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.15.4", "@babel/generator@^7.15.8", "@babel/generator@^7.7.2": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.8.tgz#fa56be6b596952ceb231048cf84ee499a19c0cd1" - integrity sha512-ECmAKstXbp1cvpTTZciZCgfOt6iN64lR0d+euv3UZisU5awfRawOvg07Utn/qBGuH4bRIEZKrA/4LzZyXhZr8g== +"@babel/generator@^7.16.0", "@babel/generator@^7.7.2": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.0.tgz#d40f3d1d5075e62d3500bccb67f3daa8a95265b2" + integrity sha512-RR8hUCfRQn9j9RPKEVXo9LiwoxLPYn6hNZlvUOR8tSnaxlD0p0+la00ZP9/SnRt6HchKr+X0fO2r8vrETiJGew== dependencies: - "@babel/types" "^7.15.6" + "@babel/types" "^7.16.0" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-annotate-as-pure@^7.14.5", "@babel/helper-annotate-as-pure@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.15.4.tgz#3d0e43b00c5e49fdb6c57e421601a7a658d5f835" - integrity sha512-QwrtdNvUNsPCj2lfNQacsGSQvGX8ee1ttrBrcozUP2Sv/jylewBP/8QFe6ZkBsC8T/GYWonNAWJV4aRR9AL2DA== +"@babel/helper-annotate-as-pure@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.0.tgz#9a1f0ebcda53d9a2d00108c4ceace6a5d5f1f08d" + integrity sha512-ItmYF9vR4zA8cByDocY05o0LGUkp1zhbTQOH1NFyl5xXEqlTJQCEJjieriw+aFpxo16swMxUnUiKS7a/r4vtHg== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.14.5": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.15.4.tgz#21ad815f609b84ee0e3058676c33cf6d1670525f" - integrity sha512-P8o7JP2Mzi0SdC6eWr1zF+AEYvrsZa7GSY1lTayjF5XJhVH0kjLYUZPvTMflP7tBgZoe9gIhTa60QwFpqh/E0Q== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.0.tgz#f1a686b92da794020c26582eb852e9accd0d7882" + integrity sha512-9KuleLT0e77wFUku6TUkqZzCEymBdtuQQ27MhEKzf9UOOJu3cYj98kyaDAzxpC7lV6DGiZFuC8XqDsq8/Kl6aQ== dependencies: - "@babel/helper-explode-assignable-expression" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/helper-explode-assignable-expression" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz#cf6d94f30fbefc139123e27dd6b02f65aeedb7b9" - integrity sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ== +"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.16.0": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz#5b480cd13f68363df6ec4dc8ac8e2da11363cbf0" + integrity sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA== dependencies: - "@babel/compat-data" "^7.15.0" + "@babel/compat-data" "^7.16.0" "@babel/helper-validator-option" "^7.14.5" - browserslist "^4.16.6" + browserslist "^4.17.5" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.12.1", "@babel/helper-create-class-features-plugin@^7.14.5", "@babel/helper-create-class-features-plugin@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.15.4.tgz#7f977c17bd12a5fba363cb19bea090394bf37d2e" - integrity sha512-7ZmzFi+DwJx6A7mHRwbuucEYpyBwmh2Ca0RvI6z2+WLZYCqV0JOaLb+u0zbtmDicebgKBZgqbYfLaKNqSgv5Pw== +"@babel/helper-create-class-features-plugin@^7.12.1", "@babel/helper-create-class-features-plugin@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.0.tgz#090d4d166b342a03a9fec37ef4fd5aeb9c7c6a4b" + integrity sha512-XLwWvqEaq19zFlF5PTgOod4bUA+XbkR4WLQBct1bkzmxJGB0ZEJaoKF4c8cgH9oBtCDuYJ8BP5NB9uFiEgO5QA== dependencies: - "@babel/helper-annotate-as-pure" "^7.15.4" - "@babel/helper-function-name" "^7.15.4" - "@babel/helper-member-expression-to-functions" "^7.15.4" - "@babel/helper-optimise-call-expression" "^7.15.4" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/helper-annotate-as-pure" "^7.16.0" + "@babel/helper-function-name" "^7.16.0" + "@babel/helper-member-expression-to-functions" "^7.16.0" + "@babel/helper-optimise-call-expression" "^7.16.0" + "@babel/helper-replace-supers" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" -"@babel/helper-create-regexp-features-plugin@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.14.5.tgz#c7d5ac5e9cf621c26057722fb7a8a4c5889358c4" - integrity sha512-TLawwqpOErY2HhWbGJ2nZT5wSkR192QpN+nBg1THfBfftrlvOh+WbhrxXCH4q4xJ9Gl16BGPR/48JA+Ryiho/A== +"@babel/helper-create-regexp-features-plugin@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.16.0.tgz#06b2348ce37fccc4f5e18dcd8d75053f2a7c44ff" + integrity sha512-3DyG0zAFAZKcOp7aVr33ddwkxJ0Z0Jr5V99y3I690eYLpukJsJvAbzTy1ewoCqsML8SbIrjH14Jc/nSQ4TvNPA== dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" + "@babel/helper-annotate-as-pure" "^7.16.0" regexpu-core "^4.7.1" -"@babel/helper-define-polyfill-provider@^0.2.2": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.3.tgz#0525edec5094653a282688d34d846e4c75e9c0b6" - integrity sha512-RH3QDAfRMzj7+0Nqu5oqgO5q9mFtQEVvCRsi8qCEfzLR9p2BHfn5FzhSB2oj1fF7I2+DcTORkYaQ6aTR9Cofew== +"@babel/helper-define-polyfill-provider@^0.2.4": + version "0.2.4" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.4.tgz#8867aed79d3ea6cade40f801efb7ac5c66916b10" + integrity sha512-OrpPZ97s+aPi6h2n1OXzdhVis1SGSsMU2aMHgLcOKfsp4/v1NWpx3CWT3lBj5eeBq9cDkPkh+YCfdF7O12uNDQ== dependencies: "@babel/helper-compilation-targets" "^7.13.0" "@babel/helper-module-imports" "^7.12.13" @@ -119,117 +119,117 @@ resolve "^1.14.2" semver "^6.1.2" -"@babel/helper-explode-assignable-expression@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.15.4.tgz#f9aec9d219f271eaf92b9f561598ca6b2682600c" - integrity sha512-J14f/vq8+hdC2KoWLIQSsGrC9EFBKE4NFts8pfMpymfApds+fPqR30AOUWc4tyr56h9l/GA1Sxv2q3dLZWbQ/g== +"@babel/helper-explode-assignable-expression@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.0.tgz#753017337a15f46f9c09f674cff10cee9b9d7778" + integrity sha512-Hk2SLxC9ZbcOhLpg/yMznzJ11W++lg5GMbxt1ev6TXUiJB0N42KPC+7w8a+eWGuqDnUYuwStJoZHM7RgmIOaGQ== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-function-name@^7.14.5", "@babel/helper-function-name@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz#845744dafc4381a4a5fb6afa6c3d36f98a787ebc" - integrity sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw== +"@babel/helper-function-name@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz#b7dd0797d00bbfee4f07e9c4ea5b0e30c8bb1481" + integrity sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog== dependencies: - "@babel/helper-get-function-arity" "^7.15.4" - "@babel/template" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/helper-get-function-arity" "^7.16.0" + "@babel/template" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/helper-get-function-arity@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz#098818934a137fce78b536a3e015864be1e2879b" - integrity sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA== +"@babel/helper-get-function-arity@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz#0088c7486b29a9cb5d948b1a1de46db66e089cfa" + integrity sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-hoist-variables@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz#09993a3259c0e918f99d104261dfdfc033f178df" - integrity sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA== +"@babel/helper-hoist-variables@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz#4c9023c2f1def7e28ff46fc1dbcd36a39beaa81a" + integrity sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-member-expression-to-functions@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz#bfd34dc9bba9824a4658b0317ec2fd571a51e6ef" - integrity sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA== +"@babel/helper-member-expression-to-functions@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.0.tgz#29287040efd197c77636ef75188e81da8bccd5a4" + integrity sha512-bsjlBFPuWT6IWhl28EdrQ+gTvSvj5tqVP5Xeftp07SEuz5pLnsXZuDkDD3Rfcxy0IsHmbZ+7B2/9SHzxO0T+sQ== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.14.5", "@babel/helper-module-imports@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz#e18007d230632dea19b47853b984476e7b4e103f" - integrity sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA== +"@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz#90538e60b672ecf1b448f5f4f5433d37e79a3ec3" + integrity sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-module-transforms@^7.14.5", "@babel/helper-module-transforms@^7.15.4", "@babel/helper-module-transforms@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.8.tgz#d8c0e75a87a52e374a8f25f855174786a09498b2" - integrity sha512-DfAfA6PfpG8t4S6npwzLvTUpp0sS7JrcuaMiy1Y5645laRJIp/LiLGIBbQKaXSInK8tiGNI7FL7L8UvB8gdUZg== +"@babel/helper-module-transforms@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.0.tgz#1c82a8dd4cb34577502ebd2909699b194c3e9bb5" + integrity sha512-My4cr9ATcaBbmaEa8M0dZNA74cfI6gitvUAskgDtAFmAqyFKDSHQo5YstxPbN+lzHl2D9l/YOEFqb2mtUh4gfA== dependencies: - "@babel/helper-module-imports" "^7.15.4" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-simple-access" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/helper-module-imports" "^7.16.0" + "@babel/helper-replace-supers" "^7.16.0" + "@babel/helper-simple-access" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" "@babel/helper-validator-identifier" "^7.15.7" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/helper-optimise-call-expression@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz#f310a5121a3b9cc52d9ab19122bd729822dee171" - integrity sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw== +"@babel/helper-optimise-call-expression@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz#cecdb145d70c54096b1564f8e9f10cd7d193b338" + integrity sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== -"@babel/helper-remap-async-to-generator@^7.14.5", "@babel/helper-remap-async-to-generator@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.15.4.tgz#2637c0731e4c90fbf58ac58b50b2b5a192fc970f" - integrity sha512-v53MxgvMK/HCwckJ1bZrq6dNKlmwlyRNYM6ypaRTdXWGOE2c1/SCa6dL/HimhPulGhZKw9W0QhREM583F/t0vQ== +"@babel/helper-remap-async-to-generator@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.0.tgz#d5aa3b086e13a5fe05238ff40c3a5a0c2dab3ead" + integrity sha512-MLM1IOMe9aQBqMWxcRw8dcb9jlM86NIw7KA0Wri91Xkfied+dE0QuBFSBjMNvqzmS0OSIDsMNC24dBEkPUi7ew== dependencies: - "@babel/helper-annotate-as-pure" "^7.15.4" - "@babel/helper-wrap-function" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/helper-annotate-as-pure" "^7.16.0" + "@babel/helper-wrap-function" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/helper-replace-supers@^7.14.5", "@babel/helper-replace-supers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz#52a8ab26ba918c7f6dee28628b07071ac7b7347a" - integrity sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw== +"@babel/helper-replace-supers@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.16.0.tgz#73055e8d3cf9bcba8ddb55cad93fedc860f68f17" + integrity sha512-TQxuQfSCdoha7cpRNJvfaYxxxzmbxXw/+6cS7V02eeDYyhxderSoMVALvwupA54/pZcOTtVeJ0xccp1nGWladA== dependencies: - "@babel/helper-member-expression-to-functions" "^7.15.4" - "@babel/helper-optimise-call-expression" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/helper-member-expression-to-functions" "^7.16.0" + "@babel/helper-optimise-call-expression" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/helper-simple-access@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz#ac368905abf1de8e9781434b635d8f8674bcc13b" - integrity sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg== +"@babel/helper-simple-access@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz#21d6a27620e383e37534cf6c10bba019a6f90517" + integrity sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-skip-transparent-expression-wrappers@^7.14.5", "@babel/helper-skip-transparent-expression-wrappers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.15.4.tgz#707dbdba1f4ad0fa34f9114fc8197aec7d5da2eb" - integrity sha512-BMRLsdh+D1/aap19TycS4eD1qELGrCBJwzaY9IE8LrpJtJb+H7rQkPIdsfgnMtLBA6DJls7X9z93Z4U8h7xw0A== +"@babel/helper-skip-transparent-expression-wrappers@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz#0ee3388070147c3ae051e487eca3ebb0e2e8bb09" + integrity sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-split-export-declaration@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz#aecab92dcdbef6a10aa3b62ab204b085f776e257" - integrity sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw== +"@babel/helper-split-export-declaration@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz#29672f43663e936df370aaeb22beddb3baec7438" + integrity sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.15.7": +"@babel/helper-validator-identifier@^7.15.7": version "7.15.7" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== @@ -239,55 +239,62 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== -"@babel/helper-wrap-function@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.15.4.tgz#6f754b2446cfaf3d612523e6ab8d79c27c3a3de7" - integrity sha512-Y2o+H/hRV5W8QhIfTpRIBwl57y8PrZt6JM3V8FOo5qarjshHItyH5lXlpMfBfmBefOqSCpKZs/6Dxqp0E/U+uw== +"@babel/helper-wrap-function@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.16.0.tgz#b3cf318afce774dfe75b86767cd6d68f3482e57c" + integrity sha512-VVMGzYY3vkWgCJML+qVLvGIam902mJW0FvT7Avj1zEe0Gn7D93aWdLblYARTxEw+6DhZmtzhBM2zv0ekE5zg1g== dependencies: - "@babel/helper-function-name" "^7.15.4" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/helper-function-name" "^7.16.0" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/helpers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.15.4.tgz#5f40f02050a3027121a3cf48d497c05c555eaf43" - integrity sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ== +"@babel/helpers@^7.16.0": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.3.tgz#27fc64f40b996e7074dc73128c3e5c3e7f55c43c" + integrity sha512-Xn8IhDlBPhvYTvgewPKawhADichOsbkZuzN7qz2BusOM0brChsyXMDJvldWaYMMUNiCQdQzNEioXTp3sC8Nt8w== dependencies: - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.3" + "@babel/types" "^7.16.0" -"@babel/highlight@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" - integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== +"@babel/highlight@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a" + integrity sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g== dependencies: - "@babel/helper-validator-identifier" "^7.14.5" + "@babel/helper-validator-identifier" "^7.15.7" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.15.4", "@babel/parser@^7.15.8", "@babel/parser@^7.3.3", "@babel/parser@^7.7.2": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.8.tgz#7bacdcbe71bdc3ff936d510c15dcea7cf0b99016" - integrity sha512-BRYa3wcQnjS/nqI8Ac94pYYpJfojHVvVXJ97+IDCImX4Jc8W8Xv1+47enbruk+q1etOpsQNwnfFcNGw+gtPGxA== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.0", "@babel/parser@^7.16.3", "@babel/parser@^7.3.3", "@babel/parser@^7.7.2": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.3.tgz#271bafcb811080905a119222edbc17909c82261d" + integrity sha512-dcNwU1O4sx57ClvLBVFbEgx0UZWfd0JQX5X6fxFRCLHelFBGXFfSz6Y0FAq2PEwUqlqLkdVjVr4VASEOuUnLJw== -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.15.4.tgz#dbdeabb1e80f622d9f0b583efb2999605e0a567e" - integrity sha512-eBnpsl9tlhPhpI10kU06JHnrYXwg3+V6CaP2idsCXNef0aeslpqyITXQ74Vfk5uHgY7IG7XP0yIH8b42KSzHog== +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.0": + version "7.16.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.2.tgz#2977fca9b212db153c195674e57cfab807733183" + integrity sha512-h37CvpLSf8gb2lIJ2CgC3t+EjFbi0t8qS7LCS1xcJIlEXE4czlofwaW7W1HA8zpgOCzI9C1nmoqNR1zWkk0pQg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.15.4" - "@babel/plugin-proposal-optional-chaining" "^7.14.5" -"@babel/plugin-proposal-async-generator-functions@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.15.8.tgz#a3100f785fab4357987c4223ab1b02b599048403" - integrity sha512-2Z5F2R2ibINTc63mY7FLqGfEbmofrHU9FitJW1Q7aPaKFhiPvSq6QEt/BoWN5oME3GVyjcRuNNSRbb9LC0CSWA== +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.0.tgz#358972eaab006f5eb0826183b0c93cbcaf13e1e2" + integrity sha512-4tcFwwicpWTrpl9qjf7UsoosaArgImF85AxqCRZlgc3IQDvkUHjJpruXAL58Wmj+T6fypWTC/BakfEkwIL/pwA== dependencies: "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-remap-async-to-generator" "^7.15.4" + "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" + "@babel/plugin-proposal-optional-chaining" "^7.16.0" + +"@babel/plugin-proposal-async-generator-functions@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.0.tgz#11425d47a60364352f668ad5fbc1d6596b2c5caf" + integrity sha512-nyYmIo7ZqKsY6P4lnVmBlxp9B3a96CscbLotlsNuktMHahkDwoPYEjXrZHU0Tj844Z9f1IthVxQln57mhkcExw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-remap-async-to-generator" "^7.16.0" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-proposal-class-properties@7.12.1": @@ -298,123 +305,123 @@ "@babel/helper-create-class-features-plugin" "^7.12.1" "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-proposal-class-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.14.5.tgz#40d1ee140c5b1e31a350f4f5eed945096559b42e" - integrity sha512-q/PLpv5Ko4dVc1LYMpCY7RVAAO4uk55qPwrIuJ5QJ8c6cVuAmhu7I/49JOppXL6gXf7ZHzpRVEUZdYoPLM04Gg== +"@babel/plugin-proposal-class-properties@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.0.tgz#c029618267ddebc7280fa286e0f8ca2a278a2d1a" + integrity sha512-mCF3HcuZSY9Fcx56Lbn+CGdT44ioBMMvjNVldpKtj8tpniETdLjnxdHI1+sDWXIM1nNt+EanJOZ3IG9lzVjs7A== dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-proposal-class-static-block@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.15.4.tgz#3e7ca6128453c089e8b477a99f970c63fc1cb8d7" - integrity sha512-M682XWrrLNk3chXCjoPUQWOyYsB93B9z3mRyjtqqYJWDf2mfCdIYgDrA11cgNVhAQieaq6F2fn2f3wI0U4aTjA== +"@babel/plugin-proposal-class-static-block@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.16.0.tgz#5296942c564d8144c83eea347d0aa8a0b89170e7" + integrity sha512-mAy3sdcY9sKAkf3lQbDiv3olOfiLqI51c9DR9b19uMoR2Z6r5pmGl7dfNFqEvqOyqbf1ta4lknK4gc5PJn3mfA== dependencies: - "@babel/helper-create-class-features-plugin" "^7.15.4" + "@babel/helper-create-class-features-plugin" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-class-static-block" "^7.14.5" -"@babel/plugin-proposal-dynamic-import@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.14.5.tgz#0c6617df461c0c1f8fff3b47cd59772360101d2c" - integrity sha512-ExjiNYc3HDN5PXJx+bwC50GIx/KKanX2HiggnIUAYedbARdImiCU4RhhHfdf0Kd7JNXGpsBBBCOm+bBVy3Gb0g== +"@babel/plugin-proposal-dynamic-import@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.0.tgz#783eca61d50526202f9b296095453977e88659f1" + integrity sha512-QGSA6ExWk95jFQgwz5GQ2Dr95cf7eI7TKutIXXTb7B1gCLTCz5hTjFTQGfLFBBiC5WSNi7udNwWsqbbMh1c4yQ== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-dynamic-import" "^7.8.3" -"@babel/plugin-proposal-export-namespace-from@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.14.5.tgz#dbad244310ce6ccd083072167d8cea83a52faf76" - integrity sha512-g5POA32bXPMmSBu5Dx/iZGLGnKmKPc5AiY7qfZgurzrCYgIztDlHFbznSNCoQuv57YQLnQfaDi7dxCtLDIdXdA== +"@babel/plugin-proposal-export-namespace-from@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.0.tgz#9c01dee40b9d6b847b656aaf4a3976a71740f222" + integrity sha512-CjI4nxM/D+5wCnhD11MHB1AwRSAYeDT+h8gCdcVJZ/OK7+wRzFsf7PFPWVpVpNRkHMmMkQWAHpTq+15IXQ1diA== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-proposal-json-strings@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.5.tgz#38de60db362e83a3d8c944ac858ddf9f0c2239eb" - integrity sha512-NSq2fczJYKVRIsUJyNxrVUMhB27zb7N7pOFGQOhBKJrChbGcgEAqyZrmZswkPk18VMurEeJAaICbfm57vUeTbQ== +"@babel/plugin-proposal-json-strings@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.0.tgz#cae35a95ed1d2a7fa29c4dc41540b84a72e9ab25" + integrity sha512-kouIPuiv8mSi5JkEhzApg5Gn6hFyKPnlkO0a9YSzqRurH8wYzSlf6RJdzluAsbqecdW5pBvDJDfyDIUR/vLxvg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-json-strings" "^7.8.3" -"@babel/plugin-proposal-logical-assignment-operators@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.14.5.tgz#6e6229c2a99b02ab2915f82571e0cc646a40c738" - integrity sha512-YGn2AvZAo9TwyhlLvCCWxD90Xq8xJ4aSgaX3G5D/8DW94L8aaT+dS5cSP+Z06+rCJERGSr9GxMBZ601xoc2taw== +"@babel/plugin-proposal-logical-assignment-operators@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.0.tgz#a711b8ceb3ffddd3ef88d3a49e86dbd3cc7db3fd" + integrity sha512-pbW0fE30sVTYXXm9lpVQQ/Vc+iTeQKiXlaNRZPPN2A2VdlWyAtsUrsQ3xydSlDW00TFMK7a8m3cDTkBF5WnV3Q== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.14.5.tgz#ee38589ce00e2cc59b299ec3ea406fcd3a0fdaf6" - integrity sha512-gun/SOnMqjSb98Nkaq2rTKMwervfdAoz6NphdY0vTfuzMfryj+tDGb2n6UkDKwez+Y8PZDhE3D143v6Gepp4Hg== +"@babel/plugin-proposal-nullish-coalescing-operator@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.0.tgz#44e1cce08fe2427482cf446a91bb451528ed0596" + integrity sha512-3bnHA8CAFm7cG93v8loghDYyQ8r97Qydf63BeYiGgYbjKKB/XP53W15wfRC7dvKfoiJ34f6Rbyyx2btExc8XsQ== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" -"@babel/plugin-proposal-numeric-separator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.14.5.tgz#83631bf33d9a51df184c2102a069ac0c58c05f18" - integrity sha512-yiclALKe0vyZRZE0pS6RXgjUOt87GWv6FYa5zqj15PvhOGFO69R5DusPlgK/1K5dVnCtegTiWu9UaBSrLLJJBg== +"@babel/plugin-proposal-numeric-separator@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.0.tgz#5d418e4fbbf8b9b7d03125d3a52730433a373734" + integrity sha512-FAhE2I6mjispy+vwwd6xWPyEx3NYFS13pikDBWUAFGZvq6POGs5eNchw8+1CYoEgBl9n11I3NkzD7ghn25PQ9Q== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.15.6": - version "7.15.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.15.6.tgz#ef68050c8703d07b25af402cb96cf7f34a68ed11" - integrity sha512-qtOHo7A1Vt+O23qEAX+GdBpqaIuD3i9VRrWgCJeq7WO6H2d14EK3q11urj5Te2MAeK97nMiIdRpwd/ST4JFbNg== +"@babel/plugin-proposal-object-rest-spread@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.16.0.tgz#5fb32f6d924d6e6712810362a60e12a2609872e6" + integrity sha512-LU/+jp89efe5HuWJLmMmFG0+xbz+I2rSI7iLc1AlaeSMDMOGzWlc5yJrMN1d04osXN4sSfpo4O+azkBNBes0jg== dependencies: - "@babel/compat-data" "^7.15.0" - "@babel/helper-compilation-targets" "^7.15.4" + "@babel/compat-data" "^7.16.0" + "@babel/helper-compilation-targets" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.15.4" + "@babel/plugin-transform-parameters" "^7.16.0" -"@babel/plugin-proposal-optional-catch-binding@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.14.5.tgz#939dd6eddeff3a67fdf7b3f044b5347262598c3c" - integrity sha512-3Oyiixm0ur7bzO5ybNcZFlmVsygSIQgdOa7cTfOYCMY+wEPAYhZAJxi3mixKFCTCKUhQXuCTtQ1MzrpL3WT8ZQ== +"@babel/plugin-proposal-optional-catch-binding@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.0.tgz#5910085811ab4c28b00d6ebffa4ab0274d1e5f16" + integrity sha512-kicDo0A/5J0nrsCPbn89mTG3Bm4XgYi0CZtvex9Oyw7gGZE3HXGD0zpQNH+mo+tEfbo8wbmMvJftOwpmPy7aVw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.14.5.tgz#fa83651e60a360e3f13797eef00b8d519695b603" - integrity sha512-ycz+VOzo2UbWNI1rQXxIuMOzrDdHGrI23fRiz/Si2R4kv2XZQ1BK8ccdHwehMKBlcH/joGW/tzrUmo67gbJHlQ== +"@babel/plugin-proposal-optional-chaining@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.0.tgz#56dbc3970825683608e9efb55ea82c2a2d6c8dc0" + integrity sha512-Y4rFpkZODfHrVo70Uaj6cC1JJOt3Pp0MdWSwIKtb8z1/lsjl9AmnB7ErRFV+QNGIfcY1Eruc2UMx5KaRnXjMyg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-proposal-private-methods@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.14.5.tgz#37446495996b2945f30f5be5b60d5e2aa4f5792d" - integrity sha512-838DkdUA1u+QTCplatfq4B7+1lnDa/+QMI89x5WZHBcnNv+47N8QEj2k9I2MUU9xIv8XJ4XvPCviM/Dj7Uwt9g== +"@babel/plugin-proposal-private-methods@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.0.tgz#b4dafb9c717e4301c5776b30d080d6383c89aff6" + integrity sha512-IvHmcTHDFztQGnn6aWq4t12QaBXTKr1whF/dgp9kz84X6GUcwq9utj7z2wFCUfeOup/QKnOlt2k0zxkGFx9ubg== dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-proposal-private-property-in-object@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.15.4.tgz#55c5e3b4d0261fd44fe637e3f624cfb0f484e3e5" - integrity sha512-X0UTixkLf0PCCffxgu5/1RQyGGbgZuKoI+vXP4iSbJSYwPb7hu06omsFGBvQ9lJEvwgrxHdS8B5nbfcd8GyUNA== +"@babel/plugin-proposal-private-property-in-object@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.0.tgz#69e935b2c5c79d2488112d886f0c4e2790fee76f" + integrity sha512-3jQUr/HBbMVZmi72LpjQwlZ55i1queL8KcDTQEkAHihttJnAPrcvG9ZNXIfsd2ugpizZo595egYV6xy+pv4Ofw== dependencies: - "@babel/helper-annotate-as-pure" "^7.15.4" - "@babel/helper-create-class-features-plugin" "^7.15.4" + "@babel/helper-annotate-as-pure" "^7.16.0" + "@babel/helper-create-class-features-plugin" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" -"@babel/plugin-proposal-unicode-property-regex@^7.14.5", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.14.5.tgz#0f95ee0e757a5d647f378daa0eca7e93faa8bbe8" - integrity sha512-6axIeOU5LnY471KenAB9vI8I5j7NQ2d652hIYwVyRfgaZT5UpiqFKCuVXCDMSrU+3VFafnu2c5m3lrWIlr6A5Q== +"@babel/plugin-proposal-unicode-property-regex@^7.16.0", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.0.tgz#890482dfc5ea378e42e19a71e709728cabf18612" + integrity sha512-ti7IdM54NXv29cA4+bNNKEMS4jLMCbJgl+Drv+FgYy0erJLAxNAIXcNjNjrRZEcWq0xJHsNVwQezskMFpF8N9g== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-async-generators@^7.8.4": @@ -459,10 +466,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-flow@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.14.5.tgz#2ff654999497d7d7d142493260005263731da180" - integrity sha512-9WK5ZwKCdWHxVuU13XNT6X73FGmutAXeor5lGFq6qhOFtMFUF4jkbijuyUdZZlpYq6E2hZeZf/u3959X9wsv0Q== +"@babel/plugin-syntax-flow@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.16.0.tgz#07427021d093ed77019408221beaf0272bbcfaec" + integrity sha512-dH91yCo0RyqfzWgoM5Ji9ir8fQ+uFbt9KHM3d2x4jZOuHS6wNA+CRmRUP/BWCsHG2bjc7A2Way6AvH1eQk0wig== dependencies: "@babel/helper-plugin-utils" "^7.14.5" @@ -480,10 +487,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@^7.12.1", "@babel/plugin-syntax-jsx@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.14.5.tgz#000e2e25d8673cce49300517a3eda44c263e4201" - integrity sha512-ohuFIsOMXJnbOMRfX7/w7LocdR6R7whhuRD4ax8IipLcLPlZGJKkBxgHp++U4N/vKyU16/YDQr2f5seajD3jIw== +"@babel/plugin-syntax-jsx@^7.12.1", "@babel/plugin-syntax-jsx@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.16.0.tgz#f9624394317365a9a88c82358d3f8471154698f1" + integrity sha512-8zv2+xiPHwly31RK4RmnEYY5zziuF3O7W2kIDW+07ewWDh6Oi0dRq8kwvulRkFgt6DB97RlKs5c1y068iPlCUg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" @@ -543,336 +550,337 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-typescript@^7.14.5", "@babel/plugin-syntax-typescript@^7.7.2": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.14.5.tgz#b82c6ce471b165b5ce420cf92914d6fb46225716" - integrity sha512-u6OXzDaIXjEstBRRoBCQ/uKQKlbuaeE5in0RvWdA4pN6AhqxTIwUsnHPU1CFZA/amYObMsuWhYfRl3Ch90HD0Q== +"@babel/plugin-syntax-typescript@^7.16.0", "@babel/plugin-syntax-typescript@^7.7.2": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.0.tgz#2feeb13d9334cc582ea9111d3506f773174179bb" + integrity sha512-Xv6mEXqVdaqCBfJFyeab0fH2DnUoMsDmhamxsSi4j8nLd4Vtw213WMJr55xxqipC/YVWyPY3K0blJncPYji+dQ== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-arrow-functions@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.14.5.tgz#f7187d9588a768dd080bf4c9ffe117ea62f7862a" - integrity sha512-KOnO0l4+tD5IfOdi4x8C1XmEIRWUjNRV8wc6K2vz/3e8yAOoZZvsRXRRIF/yo/MAOFb4QjtAw9xSxMXbSMRy8A== +"@babel/plugin-transform-arrow-functions@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.0.tgz#951706f8b449c834ed07bd474c0924c944b95a8e" + integrity sha512-vIFb5250Rbh7roWARvCLvIJ/PtAU5Lhv7BtZ1u24COwpI9Ypjsh+bZcKk6rlIyalK+r0jOc1XQ8I4ovNxNrWrA== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-async-to-generator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.14.5.tgz#72c789084d8f2094acb945633943ef8443d39e67" - integrity sha512-szkbzQ0mNk0rpu76fzDdqSyPu0MuvpXgC+6rz5rpMb5OIRxdmHfQxrktL8CYolL2d8luMCZTR0DpIMIdL27IjA== +"@babel/plugin-transform-async-to-generator@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.0.tgz#df12637f9630ddfa0ef9d7a11bc414d629d38604" + integrity sha512-PbIr7G9kR8tdH6g8Wouir5uVjklETk91GMVSUq+VaOgiinbCkBP6Q7NN/suM/QutZkMJMvcyAriogcYAdhg8Gw== dependencies: - "@babel/helper-module-imports" "^7.14.5" + "@babel/helper-module-imports" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-remap-async-to-generator" "^7.14.5" + "@babel/helper-remap-async-to-generator" "^7.16.0" -"@babel/plugin-transform-block-scoped-functions@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.14.5.tgz#e48641d999d4bc157a67ef336aeb54bc44fd3ad4" - integrity sha512-dtqWqdWZ5NqBX3KzsVCWfQI3A53Ft5pWFCT2eCVUftWZgjc5DpDponbIF1+c+7cSGk2wN0YK7HGL/ezfRbpKBQ== +"@babel/plugin-transform-block-scoped-functions@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.0.tgz#c618763233ad02847805abcac4c345ce9de7145d" + integrity sha512-V14As3haUOP4ZWrLJ3VVx5rCnrYhMSHN/jX7z6FAt5hjRkLsb0snPCmJwSOML5oxkKO4FNoNv7V5hw/y2bjuvg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-block-scoping@^7.15.3": - version "7.15.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.15.3.tgz#94c81a6e2fc230bcce6ef537ac96a1e4d2b3afaf" - integrity sha512-nBAzfZwZb4DkaGtOes1Up1nOAp9TDRRFw4XBzBBSG9QK7KVFmYzgj9o9sbPv7TX5ofL4Auq4wZnxCoPnI/lz2Q== +"@babel/plugin-transform-block-scoping@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.0.tgz#bcf433fb482fe8c3d3b4e8a66b1c4a8e77d37c16" + integrity sha512-27n3l67/R3UrXfizlvHGuTwsRIFyce3D/6a37GRxn28iyTPvNXaW4XvznexRh1zUNLPjbLL22Id0XQElV94ruw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-classes@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.15.4.tgz#50aee17aaf7f332ae44e3bce4c2e10534d5d3bf1" - integrity sha512-Yjvhex8GzBmmPQUvpXRPWQ9WnxXgAFuZSrqOK/eJlOGIXwvv8H3UEdUigl1gb/bnjTrln+e8bkZUYCBt/xYlBg== +"@babel/plugin-transform-classes@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.0.tgz#54cf5ff0b2242c6573d753cd4bfc7077a8b282f5" + integrity sha512-HUxMvy6GtAdd+GKBNYDWCIA776byUQH8zjnfjxwT1P1ARv/wFu8eBDpmXQcLS/IwRtrxIReGiplOwMeyO7nsDQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.15.4" - "@babel/helper-function-name" "^7.15.4" - "@babel/helper-optimise-call-expression" "^7.15.4" + "@babel/helper-annotate-as-pure" "^7.16.0" + "@babel/helper-function-name" "^7.16.0" + "@babel/helper-optimise-call-expression" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/helper-replace-supers" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.14.5.tgz#1b9d78987420d11223d41195461cc43b974b204f" - integrity sha512-pWM+E4283UxaVzLb8UBXv4EIxMovU4zxT1OPnpHJcmnvyY9QbPPTKZfEj31EUvG3/EQRbYAGaYEUZ4yWOBC2xg== +"@babel/plugin-transform-computed-properties@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.0.tgz#e0c385507d21e1b0b076d66bed6d5231b85110b7" + integrity sha512-63l1dRXday6S8V3WFY5mXJwcRAnPYxvFfTlt67bwV1rTyVTM5zrp0DBBb13Kl7+ehkCVwIZPumPpFP/4u70+Tw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-destructuring@^7.14.7": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.14.7.tgz#0ad58ed37e23e22084d109f185260835e5557576" - integrity sha512-0mDE99nK+kVh3xlc5vKwB6wnP9ecuSj+zQCa/n0voENtP/zymdT4HH6QEb65wjjcbqr1Jb/7z9Qp7TF5FtwYGw== +"@babel/plugin-transform-destructuring@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.16.0.tgz#ad3d7e74584ad5ea4eadb1e6642146c590dee33c" + integrity sha512-Q7tBUwjxLTsHEoqktemHBMtb3NYwyJPTJdM+wDwb0g8PZ3kQUIzNvwD5lPaqW/p54TXBc/MXZu9Jr7tbUEUM8Q== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-dotall-regex@^7.14.5", "@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.14.5.tgz#2f6bf76e46bdf8043b4e7e16cf24532629ba0c7a" - integrity sha512-loGlnBdj02MDsFaHhAIJzh7euK89lBrGIdM9EAtHFo6xKygCUGuuWe07o1oZVk287amtW1n0808sQM99aZt3gw== +"@babel/plugin-transform-dotall-regex@^7.16.0", "@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.0.tgz#50bab00c1084b6162d0a58a818031cf57798e06f" + integrity sha512-FXlDZfQeLILfJlC6I1qyEwcHK5UpRCFkaoVyA1nk9A1L1Yu583YO4un2KsLBsu3IJb4CUbctZks8tD9xPQubLw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-duplicate-keys@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.14.5.tgz#365a4844881bdf1501e3a9f0270e7f0f91177954" - integrity sha512-iJjbI53huKbPDAsJ8EmVmvCKeeq21bAze4fu9GBQtSLqfvzj2oRuHVx4ZkDwEhg1htQ+5OBZh/Ab0XDf5iBZ7A== +"@babel/plugin-transform-duplicate-keys@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.0.tgz#8bc2e21813e3e89e5e5bf3b60aa5fc458575a176" + integrity sha512-LIe2kcHKAZOJDNxujvmp6z3mfN6V9lJxubU4fJIGoQCkKe3Ec2OcbdlYP+vW++4MpxwG0d1wSDOJtQW5kLnkZQ== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-exponentiation-operator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.14.5.tgz#5154b8dd6a3dfe6d90923d61724bd3deeb90b493" - integrity sha512-jFazJhMBc9D27o9jDnIE5ZErI0R0m7PbKXVq77FFvqFbzvTMuv8jaAwLZ5PviOLSFttqKIW0/wxNSDbjLk0tYA== +"@babel/plugin-transform-exponentiation-operator@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.0.tgz#a180cd2881e3533cef9d3901e48dad0fbeff4be4" + integrity sha512-OwYEvzFI38hXklsrbNivzpO3fh87skzx8Pnqi4LoSYeav0xHlueSoCJrSgTPfnbyzopo5b3YVAJkFIcUpK2wsw== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.14.5" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-flow-strip-types@^7.12.10", "@babel/plugin-transform-flow-strip-types@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.14.5.tgz#0dc9c1d11dcdc873417903d6df4bed019ef0f85e" - integrity sha512-KhcolBKfXbvjwI3TV7r7TkYm8oNXHNBqGOy6JDVwtecFaRoKYsUUqJdS10q0YDKW1c6aZQgO+Ys3LfGkox8pXA== +"@babel/plugin-transform-flow-strip-types@^7.12.10", "@babel/plugin-transform-flow-strip-types@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.16.0.tgz#edd968dc2041c1b69e451a262e948d6654a79dc2" + integrity sha512-vs/F5roOaO/+WxKfp9PkvLsAyj0G+Q0zbFimHm9X2KDgabN2XmNFoAafmeGEYspUlIF9+MvVmyek9UyHiqeG/w== dependencies: "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-flow" "^7.14.5" + "@babel/plugin-syntax-flow" "^7.16.0" -"@babel/plugin-transform-for-of@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.15.4.tgz#25c62cce2718cfb29715f416e75d5263fb36a8c2" - integrity sha512-DRTY9fA751AFBDh2oxydvVm4SYevs5ILTWLs6xKXps4Re/KG5nfUkr+TdHCrRWB8C69TlzVgA9b3RmGWmgN9LA== +"@babel/plugin-transform-for-of@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.0.tgz#f7abaced155260e2461359bbc7c7248aca5e6bd2" + integrity sha512-5QKUw2kO+GVmKr2wMYSATCTTnHyscl6sxFRAY+rvN7h7WB0lcG0o4NoV6ZQU32OZGVsYUsfLGgPQpDFdkfjlJQ== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-function-name@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.14.5.tgz#e81c65ecb900746d7f31802f6bed1f52d915d6f2" - integrity sha512-vbO6kv0fIzZ1GpmGQuvbwwm+O4Cbm2NrPzwlup9+/3fdkuzo1YqOZcXw26+YUJB84Ja7j9yURWposEHLYwxUfQ== +"@babel/plugin-transform-function-name@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.0.tgz#02e3699c284c6262236599f751065c5d5f1f400e" + integrity sha512-lBzMle9jcOXtSOXUpc7tvvTpENu/NuekNJVova5lCCWCV9/U1ho2HH2y0p6mBg8fPm/syEAbfaaemYGOHCY3mg== dependencies: - "@babel/helper-function-name" "^7.14.5" + "@babel/helper-function-name" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.14.5.tgz#41d06c7ff5d4d09e3cf4587bd3ecf3930c730f78" - integrity sha512-ql33+epql2F49bi8aHXxvLURHkxJbSmMKl9J5yHqg4PLtdE6Uc48CH1GS6TQvZ86eoB/ApZXwm7jlA+B3kra7A== +"@babel/plugin-transform-literals@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.0.tgz#79711e670ffceb31bd298229d50f3621f7980cac" + integrity sha512-gQDlsSF1iv9RU04clgXqRjrPyyoJMTclFt3K1cjLmTKikc0s/6vE3hlDeEVC71wLTRu72Fq7650kABrdTc2wMQ== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-member-expression-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.14.5.tgz#b39cd5212a2bf235a617d320ec2b48bcc091b8a7" - integrity sha512-WkNXxH1VXVTKarWFqmso83xl+2V3Eo28YY5utIkbsmXoItO8Q3aZxN4BTS2k0hz9dGUloHK26mJMyQEYfkn/+Q== +"@babel/plugin-transform-member-expression-literals@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.0.tgz#5251b4cce01eaf8314403d21aedb269d79f5e64b" + integrity sha512-WRpw5HL4Jhnxw8QARzRvwojp9MIE7Tdk3ez6vRyUk1MwgjJN0aNpRoXainLR5SgxmoXx/vsXGZ6OthP6t/RbUg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-modules-amd@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.5.tgz#4fd9ce7e3411cb8b83848480b7041d83004858f7" - integrity sha512-3lpOU8Vxmp3roC4vzFpSdEpGUWSMsHFreTWOMMLzel2gNGfHE5UWIh/LN6ghHs2xurUp4jRFYMUIZhuFbody1g== +"@babel/plugin-transform-modules-amd@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.0.tgz#09abd41e18dcf4fd479c598c1cef7bd39eb1337e" + integrity sha512-rWFhWbCJ9Wdmzln1NmSCqn7P0RAD+ogXG/bd9Kg5c7PKWkJtkiXmYsMBeXjDlzHpVTJ4I/hnjs45zX4dEv81xw== dependencies: - "@babel/helper-module-transforms" "^7.14.5" + "@babel/helper-module-transforms" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.15.4.tgz#8201101240eabb5a76c08ef61b2954f767b6b4c1" - integrity sha512-qg4DPhwG8hKp4BbVDvX1s8cohM8a6Bvptu4l6Iingq5rW+yRUAhe/YRup/YcW2zCOlrysEWVhftIcKzrEZv3sA== +"@babel/plugin-transform-modules-commonjs@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.0.tgz#add58e638c8ddc4875bd9a9ecb5c594613f6c922" + integrity sha512-Dzi+NWqyEotgzk/sb7kgQPJQf7AJkQBWsVp1N6JWc1lBVo0vkElUnGdr1PzUBmfsCCN5OOFya3RtpeHk15oLKQ== dependencies: - "@babel/helper-module-transforms" "^7.15.4" + "@babel/helper-module-transforms" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-simple-access" "^7.15.4" + "@babel/helper-simple-access" "^7.16.0" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-systemjs@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.15.4.tgz#b42890c7349a78c827719f1d2d0cd38c7d268132" - integrity sha512-fJUnlQrl/mezMneR72CKCgtOoahqGJNVKpompKwzv3BrEXdlPspTcyxrZ1XmDTIr9PpULrgEQo3qNKp6dW7ssw== +"@babel/plugin-transform-modules-systemjs@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.16.0.tgz#a92cf240afeb605f4ca16670453024425e421ea4" + integrity sha512-yuGBaHS3lF1m/5R+6fjIke64ii5luRUg97N2wr+z1sF0V+sNSXPxXDdEEL/iYLszsN5VKxVB1IPfEqhzVpiqvg== dependencies: - "@babel/helper-hoist-variables" "^7.15.4" - "@babel/helper-module-transforms" "^7.15.4" + "@babel/helper-hoist-variables" "^7.16.0" + "@babel/helper-module-transforms" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-identifier" "^7.14.9" + "@babel/helper-validator-identifier" "^7.15.7" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-umd@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.5.tgz#fb662dfee697cce274a7cda525190a79096aa6e0" - integrity sha512-RfPGoagSngC06LsGUYyM9QWSXZ8MysEjDJTAea1lqRjNECE3y0qIJF/qbvJxc4oA4s99HumIMdXOrd+TdKaAAA== +"@babel/plugin-transform-modules-umd@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.0.tgz#195f26c2ad6d6a391b70880effce18ce625e06a7" + integrity sha512-nx4f6no57himWiHhxDM5pjwhae5vLpTK2zCnDH8+wNLJy0TVER/LJRHl2bkt6w9Aad2sPD5iNNoUpY3X9sTGDg== dependencies: - "@babel/helper-module-transforms" "^7.14.5" + "@babel/helper-module-transforms" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-named-capturing-groups-regex@^7.14.9": - version "7.14.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.14.9.tgz#c68f5c5d12d2ebaba3762e57c2c4f6347a46e7b2" - integrity sha512-l666wCVYO75mlAtGFfyFwnWmIXQm3kSH0C3IRnJqWcZbWkoihyAdDhFm2ZWaxWTqvBvhVFfJjMRQ0ez4oN1yYA== +"@babel/plugin-transform-named-capturing-groups-regex@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.0.tgz#d3db61cc5d5b97986559967cd5ea83e5c32096ca" + integrity sha512-LogN88uO+7EhxWc8WZuQ8vxdSyVGxhkh8WTC3tzlT8LccMuQdA81e9SGV6zY7kY2LjDhhDOFdQVxdGwPyBCnvg== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.16.0" -"@babel/plugin-transform-new-target@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.14.5.tgz#31bdae8b925dc84076ebfcd2a9940143aed7dbf8" - integrity sha512-Nx054zovz6IIRWEB49RDRuXGI4Gy0GMgqG0cII9L3MxqgXz/+rgII+RU58qpo4g7tNEx1jG7rRVH4ihZoP4esQ== +"@babel/plugin-transform-new-target@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.0.tgz#af823ab576f752215a49937779a41ca65825ab35" + integrity sha512-fhjrDEYv2DBsGN/P6rlqakwRwIp7rBGLPbrKxwh7oVt5NNkIhZVOY2GRV+ULLsQri1bDqwDWnU3vhlmx5B2aCw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-object-super@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.14.5.tgz#d0b5faeac9e98597a161a9cf78c527ed934cdc45" - integrity sha512-MKfOBWzK0pZIrav9z/hkRqIk/2bTv9qvxHzPQc12RcVkMOzpIKnFCNYJip00ssKWYkd8Sf5g0Wr7pqJ+cmtuFg== +"@babel/plugin-transform-object-super@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.0.tgz#fb20d5806dc6491a06296ac14ea8e8d6fedda72b" + integrity sha512-fds+puedQHn4cPLshoHcR1DTMN0q1V9ou0mUjm8whx9pGcNvDrVVrgw+KJzzCaiTdaYhldtrUps8DWVMgrSEyg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-replace-supers" "^7.14.5" + "@babel/helper-replace-supers" "^7.16.0" -"@babel/plugin-transform-parameters@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.15.4.tgz#5f2285cc3160bf48c8502432716b48504d29ed62" - integrity sha512-9WB/GUTO6lvJU3XQsSr6J/WKvBC2hcs4Pew8YxZagi6GkTdniyqp8On5kqdK8MN0LMeu0mGbhPN+O049NV/9FQ== +"@babel/plugin-transform-parameters@^7.16.0": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.3.tgz#fa9e4c874ee5223f891ee6fa8d737f4766d31d15" + integrity sha512-3MaDpJrOXT1MZ/WCmkOFo7EtmVVC8H4EUZVrHvFOsmwkk4lOjQj8rzv8JKUZV4YoQKeoIgk07GO+acPU9IMu/w== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-property-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.14.5.tgz#0ddbaa1f83db3606f1cdf4846fa1dfb473458b34" - integrity sha512-r1uilDthkgXW8Z1vJz2dKYLV1tuw2xsbrp3MrZmD99Wh9vsfKoob+JTgri5VUb/JqyKRXotlOtwgu4stIYCmnw== +"@babel/plugin-transform-property-literals@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.0.tgz#a95c552189a96a00059f6776dc4e00e3690c78d1" + integrity sha512-XLldD4V8+pOqX2hwfWhgwXzGdnDOThxaNTgqagOcpBgIxbUvpgU2FMvo5E1RyHbk756WYgdbS0T8y0Cj9FKkWQ== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-react-display-name@^7.14.5": - version "7.15.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.15.1.tgz#6aaac6099f1fcf6589d35ae6be1b6e10c8c602b9" - integrity sha512-yQZ/i/pUCJAHI/LbtZr413S3VT26qNrEm0M5RRxQJA947/YNYwbZbBaXGDrq6CG5QsZycI1VIP6d7pQaBfP+8Q== +"@babel/plugin-transform-react-display-name@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.16.0.tgz#9a0ad8aa8e8790883a7bd2736f66229a58125676" + integrity sha512-FJFdJAqaCpndL+pIf0aeD/qlQwT7QXOvR6Cc8JPvNhKJBi2zc/DPc4g05Y3fbD/0iWAMQFGij4+Xw+4L/BMpTg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-react-jsx-development@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.14.5.tgz#1a6c73e2f7ed2c42eebc3d2ad60b0c7494fcb9af" - integrity sha512-rdwG/9jC6QybWxVe2UVOa7q6cnTpw8JRRHOxntG/h6g/guAOe6AhtQHJuJh5FwmnXIT1bdm5vC2/5huV8ZOorQ== +"@babel/plugin-transform-react-jsx-development@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.16.0.tgz#1cb52874678d23ab11d0d16488d54730807303ef" + integrity sha512-qq65iSqBRq0Hr3wq57YG2AmW0H6wgTnIzpffTphrUWUgLCOK+zf1f7G0vuOiXrp7dU1qq+fQBoqZ3wCDAkhFzw== dependencies: - "@babel/plugin-transform-react-jsx" "^7.14.5" + "@babel/plugin-transform-react-jsx" "^7.16.0" -"@babel/plugin-transform-react-jsx@^7.12.11", "@babel/plugin-transform-react-jsx@^7.14.5": - version "7.14.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.14.9.tgz#3314b2163033abac5200a869c4de242cd50a914c" - integrity sha512-30PeETvS+AeD1f58i1OVyoDlVYQhap/K20ZrMjLmmzmC2AYR/G43D4sdJAaDAqCD3MYpSWbmrz3kES158QSLjw== +"@babel/plugin-transform-react-jsx@^7.12.11", "@babel/plugin-transform-react-jsx@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.16.0.tgz#55b797d4960c3de04e07ad1c0476e2bc6a4889f1" + integrity sha512-rqDgIbukZ44pqq7NIRPGPGNklshPkvlmvqjdx3OZcGPk4zGIenYkxDTvl3LsSL8gqcc3ZzGmXPE6hR/u/voNOw== dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - "@babel/helper-module-imports" "^7.14.5" + "@babel/helper-annotate-as-pure" "^7.16.0" + "@babel/helper-module-imports" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-jsx" "^7.14.5" - "@babel/types" "^7.14.9" + "@babel/plugin-syntax-jsx" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/plugin-transform-react-pure-annotations@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.14.5.tgz#18de612b84021e3a9802cbc212c9d9f46d0d11fc" - integrity sha512-3X4HpBJimNxW4rhUy/SONPyNQHp5YRr0HhJdT2OH1BRp0of7u3Dkirc7x9FRJMKMqTBI079VZ1hzv7Ouuz///g== +"@babel/plugin-transform-react-pure-annotations@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.16.0.tgz#23db6ddf558d8abde41b8ad9d59f48ad5532ccab" + integrity sha512-NC/Bj2MG+t8Ef5Pdpo34Ay74X4Rt804h5y81PwOpfPtmAK3i6CizmQqwyBQzIepz1Yt8wNr2Z2L7Lu3qBMfZMA== dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" + "@babel/helper-annotate-as-pure" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-regenerator@^7.12.1", "@babel/plugin-transform-regenerator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.14.5.tgz#9676fd5707ed28f522727c5b3c0aa8544440b04f" - integrity sha512-NVIY1W3ITDP5xQl50NgTKlZ0GrotKtLna08/uGY6ErQt6VEQZXla86x/CTddm5gZdcr+5GSsvMeTmWA5Ii6pkg== +"@babel/plugin-transform-regenerator@^7.12.1", "@babel/plugin-transform-regenerator@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.0.tgz#eaee422c84b0232d03aea7db99c97deeaf6125a4" + integrity sha512-JAvGxgKuwS2PihiSFaDrp94XOzzTUeDeOQlcKzVAyaPap7BnZXK/lvMDiubkPTdotPKOIZq9xWXWnggUMYiExg== dependencies: regenerator-transform "^0.14.2" -"@babel/plugin-transform-reserved-words@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.14.5.tgz#c44589b661cfdbef8d4300dcc7469dffa92f8304" - integrity sha512-cv4F2rv1nD4qdexOGsRQXJrOcyb5CrgjUH9PKrrtyhSDBNWGxd0UIitjyJiWagS+EbUGjG++22mGH1Pub8D6Vg== +"@babel/plugin-transform-reserved-words@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.0.tgz#fff4b9dcb19e12619394bda172d14f2d04c0379c" + integrity sha512-Dgs8NNCehHSvXdhEhln8u/TtJxfVwGYCgP2OOr5Z3Ar+B+zXicEOKNTyc+eca2cuEOMtjW6m9P9ijOt8QdqWkg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-shorthand-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.14.5.tgz#97f13855f1409338d8cadcbaca670ad79e091a58" - integrity sha512-xLucks6T1VmGsTB+GWK5Pl9Jl5+nRXD1uoFdA5TSO6xtiNjtXTjKkmPdFXVLGlK5A2/or/wQMKfmQ2Y0XJfn5g== +"@babel/plugin-transform-shorthand-properties@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.0.tgz#090372e3141f7cc324ed70b3daf5379df2fa384d" + integrity sha512-iVb1mTcD8fuhSv3k99+5tlXu5N0v8/DPm2mO3WACLG6al1CGZH7v09HJyUb1TtYl/Z+KrM6pHSIJdZxP5A+xow== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-spread@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.15.8.tgz#79d5aa27f68d700449b2da07691dfa32d2f6d468" - integrity sha512-/daZ8s2tNaRekl9YJa9X4bzjpeRZLt122cpgFnQPLGUe61PH8zMEBmYqKkW5xF5JUEh5buEGXJoQpqBmIbpmEQ== +"@babel/plugin-transform-spread@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.0.tgz#d21ca099bbd53ab307a8621e019a7bd0f40cdcfb" + integrity sha512-Ao4MSYRaLAQczZVp9/7E7QHsCuK92yHRrmVNRe/SlEJjhzivq0BSn8mEraimL8wizHZ3fuaHxKH0iwzI13GyGg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.15.4" + "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" -"@babel/plugin-transform-sticky-regex@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.14.5.tgz#5b617542675e8b7761294381f3c28c633f40aeb9" - integrity sha512-Z7F7GyvEMzIIbwnziAZmnSNpdijdr4dWt+FJNBnBLz5mwDFkqIXU9wmBcWWad3QeJF5hMTkRe4dAq2sUZiG+8A== +"@babel/plugin-transform-sticky-regex@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.0.tgz#c35ea31a02d86be485f6aa510184b677a91738fd" + integrity sha512-/ntT2NljR9foobKk4E/YyOSwcGUXtYWv5tinMK/3RkypyNBNdhHUaq6Orw5DWq9ZcNlS03BIlEALFeQgeVAo4Q== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-template-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.14.5.tgz#a5f2bc233937d8453885dc736bdd8d9ffabf3d93" - integrity sha512-22btZeURqiepOfuy/VkFr+zStqlujWaarpMErvay7goJS6BWwdd6BY9zQyDLDa4x2S3VugxFb162IZ4m/S/+Gg== +"@babel/plugin-transform-template-literals@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.0.tgz#a8eced3a8e7b8e2d40ec4ec4548a45912630d302" + integrity sha512-Rd4Ic89hA/f7xUSJQk5PnC+4so50vBoBfxjdQAdvngwidM8jYIBVxBZ/sARxD4e0yMXRbJVDrYf7dyRtIIKT6Q== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-typeof-symbol@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.14.5.tgz#39af2739e989a2bd291bf6b53f16981423d457d4" - integrity sha512-lXzLD30ffCWseTbMQzrvDWqljvZlHkXU+CnseMhkMNqU1sASnCsz3tSzAaH3vCUXb9PHeUb90ZT1BdFTm1xxJw== +"@babel/plugin-transform-typeof-symbol@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.0.tgz#8b19a244c6f8c9d668dca6a6f754ad6ead1128f2" + integrity sha512-++V2L8Bdf4vcaHi2raILnptTBjGEFxn5315YU+e8+EqXIucA+q349qWngCLpUYqqv233suJ6NOienIVUpS9cqg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-typescript@^7.15.0": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.15.8.tgz#ff0e6a47de9b2d58652123ab5a879b2ff20665d8" - integrity sha512-ZXIkJpbaf6/EsmjeTbiJN/yMxWPFWvlr7sEG1P95Xb4S4IBcrf2n7s/fItIhsAmOf8oSh3VJPDppO6ExfAfKRQ== +"@babel/plugin-transform-typescript@^7.16.0": + version "7.16.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.1.tgz#cc0670b2822b0338355bc1b3d2246a42b8166409" + integrity sha512-NO4XoryBng06jjw/qWEU2LhcLJr1tWkhpMam/H4eas/CDKMX/b2/Ylb6EI256Y7+FVPCawwSM1rrJNOpDiz+Lg== dependencies: - "@babel/helper-create-class-features-plugin" "^7.15.4" + "@babel/helper-create-class-features-plugin" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-typescript" "^7.14.5" + "@babel/plugin-syntax-typescript" "^7.16.0" -"@babel/plugin-transform-unicode-escapes@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.14.5.tgz#9d4bd2a681e3c5d7acf4f57fa9e51175d91d0c6b" - integrity sha512-crTo4jATEOjxj7bt9lbYXcBAM3LZaUrbP2uUdxb6WIorLmjNKSpHfIybgY4B8SRpbf8tEVIWH3Vtm7ayCrKocA== +"@babel/plugin-transform-unicode-escapes@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.0.tgz#1a354064b4c45663a32334f46fa0cf6100b5b1f3" + integrity sha512-VFi4dhgJM7Bpk8lRc5CMaRGlKZ29W9C3geZjt9beuzSUrlJxsNwX7ReLwaL6WEvsOf2EQkyIJEPtF8EXjB/g2A== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-unicode-regex@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.14.5.tgz#4cd09b6c8425dd81255c7ceb3fb1836e7414382e" - integrity sha512-UygduJpC5kHeCiRw/xDVzC+wj8VaYSoKl5JNVmbP7MadpNinAm3SvZCxZ42H37KZBKztz46YC73i9yV34d0Tzw== +"@babel/plugin-transform-unicode-regex@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.0.tgz#293b80950177c8c85aede87cef280259fb995402" + integrity sha512-jHLK4LxhHjvCeZDWyA9c+P9XH1sOxRd1RO9xMtDVRAOND/PczPqizEtVdx4TQF/wyPaewqpT+tgQFYMnN/P94A== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/preset-env@^7.12.11", "@babel/preset-env@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.15.8.tgz#f527ce5bcb121cd199f6b502bf23e420b3ff8dba" - integrity sha512-rCC0wH8husJgY4FPbHsiYyiLxSY8oMDJH7Rl6RQMknbN9oDDHhM9RDFvnGM2MgkbUJzSQB4gtuwygY5mCqGSsA== +"@babel/preset-env@^7.12.11", "@babel/preset-env@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.16.0.tgz#97228393d217560d6a1c6c56f0adb9d12bca67f5" + integrity sha512-cdTu/W0IrviamtnZiTfixPfIncr2M1VqRrkjzZWlr1B4TVYimCFK5jkyOdP4qw2MrlKHi+b3ORj6x8GoCew8Dg== dependencies: - "@babel/compat-data" "^7.15.0" - "@babel/helper-compilation-targets" "^7.15.4" + "@babel/compat-data" "^7.16.0" + "@babel/helper-compilation-targets" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.15.4" - "@babel/plugin-proposal-async-generator-functions" "^7.15.8" - "@babel/plugin-proposal-class-properties" "^7.14.5" - "@babel/plugin-proposal-class-static-block" "^7.15.4" - "@babel/plugin-proposal-dynamic-import" "^7.14.5" - "@babel/plugin-proposal-export-namespace-from" "^7.14.5" - "@babel/plugin-proposal-json-strings" "^7.14.5" - "@babel/plugin-proposal-logical-assignment-operators" "^7.14.5" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.14.5" - "@babel/plugin-proposal-numeric-separator" "^7.14.5" - "@babel/plugin-proposal-object-rest-spread" "^7.15.6" - "@babel/plugin-proposal-optional-catch-binding" "^7.14.5" - "@babel/plugin-proposal-optional-chaining" "^7.14.5" - "@babel/plugin-proposal-private-methods" "^7.14.5" - "@babel/plugin-proposal-private-property-in-object" "^7.15.4" - "@babel/plugin-proposal-unicode-property-regex" "^7.14.5" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.16.0" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.16.0" + "@babel/plugin-proposal-async-generator-functions" "^7.16.0" + "@babel/plugin-proposal-class-properties" "^7.16.0" + "@babel/plugin-proposal-class-static-block" "^7.16.0" + "@babel/plugin-proposal-dynamic-import" "^7.16.0" + "@babel/plugin-proposal-export-namespace-from" "^7.16.0" + "@babel/plugin-proposal-json-strings" "^7.16.0" + "@babel/plugin-proposal-logical-assignment-operators" "^7.16.0" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.16.0" + "@babel/plugin-proposal-numeric-separator" "^7.16.0" + "@babel/plugin-proposal-object-rest-spread" "^7.16.0" + "@babel/plugin-proposal-optional-catch-binding" "^7.16.0" + "@babel/plugin-proposal-optional-chaining" "^7.16.0" + "@babel/plugin-proposal-private-methods" "^7.16.0" + "@babel/plugin-proposal-private-property-in-object" "^7.16.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.16.0" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-class-properties" "^7.12.13" "@babel/plugin-syntax-class-static-block" "^7.14.5" @@ -887,56 +895,56 @@ "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-transform-arrow-functions" "^7.14.5" - "@babel/plugin-transform-async-to-generator" "^7.14.5" - "@babel/plugin-transform-block-scoped-functions" "^7.14.5" - "@babel/plugin-transform-block-scoping" "^7.15.3" - "@babel/plugin-transform-classes" "^7.15.4" - "@babel/plugin-transform-computed-properties" "^7.14.5" - "@babel/plugin-transform-destructuring" "^7.14.7" - "@babel/plugin-transform-dotall-regex" "^7.14.5" - "@babel/plugin-transform-duplicate-keys" "^7.14.5" - "@babel/plugin-transform-exponentiation-operator" "^7.14.5" - "@babel/plugin-transform-for-of" "^7.15.4" - "@babel/plugin-transform-function-name" "^7.14.5" - "@babel/plugin-transform-literals" "^7.14.5" - "@babel/plugin-transform-member-expression-literals" "^7.14.5" - "@babel/plugin-transform-modules-amd" "^7.14.5" - "@babel/plugin-transform-modules-commonjs" "^7.15.4" - "@babel/plugin-transform-modules-systemjs" "^7.15.4" - "@babel/plugin-transform-modules-umd" "^7.14.5" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.14.9" - "@babel/plugin-transform-new-target" "^7.14.5" - "@babel/plugin-transform-object-super" "^7.14.5" - "@babel/plugin-transform-parameters" "^7.15.4" - "@babel/plugin-transform-property-literals" "^7.14.5" - "@babel/plugin-transform-regenerator" "^7.14.5" - "@babel/plugin-transform-reserved-words" "^7.14.5" - "@babel/plugin-transform-shorthand-properties" "^7.14.5" - "@babel/plugin-transform-spread" "^7.15.8" - "@babel/plugin-transform-sticky-regex" "^7.14.5" - "@babel/plugin-transform-template-literals" "^7.14.5" - "@babel/plugin-transform-typeof-symbol" "^7.14.5" - "@babel/plugin-transform-unicode-escapes" "^7.14.5" - "@babel/plugin-transform-unicode-regex" "^7.14.5" - "@babel/preset-modules" "^0.1.4" - "@babel/types" "^7.15.6" - babel-plugin-polyfill-corejs2 "^0.2.2" - babel-plugin-polyfill-corejs3 "^0.2.5" - babel-plugin-polyfill-regenerator "^0.2.2" - core-js-compat "^3.16.0" + "@babel/plugin-transform-arrow-functions" "^7.16.0" + "@babel/plugin-transform-async-to-generator" "^7.16.0" + "@babel/plugin-transform-block-scoped-functions" "^7.16.0" + "@babel/plugin-transform-block-scoping" "^7.16.0" + "@babel/plugin-transform-classes" "^7.16.0" + "@babel/plugin-transform-computed-properties" "^7.16.0" + "@babel/plugin-transform-destructuring" "^7.16.0" + "@babel/plugin-transform-dotall-regex" "^7.16.0" + "@babel/plugin-transform-duplicate-keys" "^7.16.0" + "@babel/plugin-transform-exponentiation-operator" "^7.16.0" + "@babel/plugin-transform-for-of" "^7.16.0" + "@babel/plugin-transform-function-name" "^7.16.0" + "@babel/plugin-transform-literals" "^7.16.0" + "@babel/plugin-transform-member-expression-literals" "^7.16.0" + "@babel/plugin-transform-modules-amd" "^7.16.0" + "@babel/plugin-transform-modules-commonjs" "^7.16.0" + "@babel/plugin-transform-modules-systemjs" "^7.16.0" + "@babel/plugin-transform-modules-umd" "^7.16.0" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.16.0" + "@babel/plugin-transform-new-target" "^7.16.0" + "@babel/plugin-transform-object-super" "^7.16.0" + "@babel/plugin-transform-parameters" "^7.16.0" + "@babel/plugin-transform-property-literals" "^7.16.0" + "@babel/plugin-transform-regenerator" "^7.16.0" + "@babel/plugin-transform-reserved-words" "^7.16.0" + "@babel/plugin-transform-shorthand-properties" "^7.16.0" + "@babel/plugin-transform-spread" "^7.16.0" + "@babel/plugin-transform-sticky-regex" "^7.16.0" + "@babel/plugin-transform-template-literals" "^7.16.0" + "@babel/plugin-transform-typeof-symbol" "^7.16.0" + "@babel/plugin-transform-unicode-escapes" "^7.16.0" + "@babel/plugin-transform-unicode-regex" "^7.16.0" + "@babel/preset-modules" "^0.1.5" + "@babel/types" "^7.16.0" + babel-plugin-polyfill-corejs2 "^0.2.3" + babel-plugin-polyfill-corejs3 "^0.3.0" + babel-plugin-polyfill-regenerator "^0.2.3" + core-js-compat "^3.19.0" semver "^6.3.0" "@babel/preset-flow@^7.12.1": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.14.5.tgz#a1810b0780c8b48ab0bece8e7ab8d0d37712751c" - integrity sha512-pP5QEb4qRUSVGzzKx9xqRuHUrM/jEzMqdrZpdMA+oUCRgd5zM1qGr5y5+ZgAL/1tVv1H0dyk5t4SKJntqyiVtg== + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.16.0.tgz#9f1f6e72714d79460d48058cb5658fc87da7150b" + integrity sha512-e5NE1EoPMpoHFkyFkMSj2h9tu7OolARcUHki8mnBv4NiFK9so+UrhbvT9mV99tMJOUEx8BOj67T6dXvGcTeYeQ== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-transform-flow-strip-types" "^7.14.5" + "@babel/plugin-transform-flow-strip-types" "^7.16.0" -"@babel/preset-modules@^0.1.4": +"@babel/preset-modules@^0.1.5": version "0.1.5" resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.5.tgz#ef939d6e7f268827e1841638dc6ff95515e115d9" integrity sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA== @@ -947,31 +955,31 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/preset-react@^7.0.0", "@babel/preset-react@^7.12.10": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.14.5.tgz#0fbb769513f899c2c56f3a882fa79673c2d4ab3c" - integrity sha512-XFxBkjyObLvBaAvkx1Ie95Iaq4S/GUEIrejyrntQ/VCMKUYvKLoyKxOBzJ2kjA3b6rC9/KL6KXfDC2GqvLiNqQ== +"@babel/preset-react@^7.12.10", "@babel/preset-react@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.16.0.tgz#f71d3e8dff5218478011df037fad52660ee6d82a" + integrity sha512-d31IFW2bLRB28uL1WoElyro8RH5l6531XfxMtCeCmp6RVAF1uTfxxUA0LH1tXl+psZdwfmIbwoG4U5VwgbhtLw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-transform-react-display-name" "^7.14.5" - "@babel/plugin-transform-react-jsx" "^7.14.5" - "@babel/plugin-transform-react-jsx-development" "^7.14.5" - "@babel/plugin-transform-react-pure-annotations" "^7.14.5" + "@babel/plugin-transform-react-display-name" "^7.16.0" + "@babel/plugin-transform-react-jsx" "^7.16.0" + "@babel/plugin-transform-react-jsx-development" "^7.16.0" + "@babel/plugin-transform-react-pure-annotations" "^7.16.0" -"@babel/preset-typescript@^7.0.0": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.15.0.tgz#e8fca638a1a0f64f14e1119f7fe4500277840945" - integrity sha512-lt0Y/8V3y06Wq/8H/u0WakrqciZ7Fz7mwPDHWUJAXlABL5hiUG42BNlRXiELNjeWjO5rWmnNKlx+yzJvxezHow== +"@babel/preset-typescript@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.16.0.tgz#b0b4f105b855fb3d631ec036cdc9d1ffd1fa5eac" + integrity sha512-txegdrZYgO9DlPbv+9QOVpMnKbOtezsLHWsnsRF4AjbSIsVaujrq1qg8HK0mxQpWv0jnejt0yEoW1uWpvbrDTg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-transform-typescript" "^7.15.0" + "@babel/plugin-transform-typescript" "^7.16.0" -"@babel/register@^7.0.0": - version "7.15.3" - resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.15.3.tgz#6b40a549e06ec06c885b2ec42c3dd711f55fe752" - integrity sha512-mj4IY1ZJkorClxKTImccn4T81+UKTo4Ux0+OFSV9hME1ooqS9UV+pJ6BjD0qXPK4T3XW/KNa79XByjeEMZz+fw== +"@babel/register@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.16.0.tgz#f5d2aa14df37cf7146b9759f7c53818360f24ec6" + integrity sha512-lzl4yfs0zVXnooeLE0AAfYaT7F3SPA8yB2Bj4W1BiZwLbMS3MZH35ZvCWSRHvneUugwuM+Wsnrj7h0F7UmU3NQ== dependencies: clone-deep "^4.0.1" find-cache-dir "^2.0.0" @@ -979,43 +987,43 @@ pirates "^4.0.0" source-map-support "^0.5.16" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.8", "@babel/runtime@^7.8.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a" - integrity sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw== +"@babel/runtime@^7.0.0", "@babel/runtime@^7.12.5", "@babel/runtime@^7.8.4": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.3.tgz#b86f0db02a04187a3c17caa77de69840165d42d5" + integrity sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ== dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.15.4", "@babel/template@^7.3.3": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.15.4.tgz#51898d35dcf3faa670c4ee6afcfd517ee139f194" - integrity sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.15.4", "@babel/traverse@^7.7.2": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.4.tgz#ff8510367a144bfbff552d9e18e28f3e2889c22d" - integrity sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.4" - "@babel/helper-function-name" "^7.15.4" - "@babel/helper-hoist-variables" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" +"@babel/template@^7.16.0", "@babel/template@^7.3.3": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.0.tgz#d16a35ebf4cd74e202083356fab21dd89363ddd6" + integrity sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/parser" "^7.16.0" + "@babel/types" "^7.16.0" + +"@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.16.0", "@babel/traverse@^7.16.3", "@babel/traverse@^7.7.2": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.3.tgz#f63e8a938cc1b780f66d9ed3c54f532ca2d14787" + integrity sha512-eolumr1vVMjqevCpwVO99yN/LoGL0EyHiLO5I043aYQvwOJ9eR5UsZSClHVCzfhBduMAsSzgA/6AyqPjNayJag== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/generator" "^7.16.0" + "@babel/helper-function-name" "^7.16.0" + "@babel/helper-hoist-variables" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" + "@babel/parser" "^7.16.3" + "@babel/types" "^7.16.0" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.14.9", "@babel/types@^7.15.4", "@babel/types@^7.15.6", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": - version "7.15.6" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f" - integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig== +"@babel/types@^7.0.0", "@babel/types@^7.16.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.0.tgz#db3b313804f96aadd0b776c4823e127ad67289ba" + integrity sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg== dependencies: - "@babel/helper-validator-identifier" "^7.14.9" + "@babel/helper-validator-identifier" "^7.15.7" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -1023,10 +1031,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@eslint/eslintrc@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.3.tgz#41f08c597025605f672251dcc4e8be66b5ed7366" - integrity sha512-DHI1wDPoKCBPoLZA3qDR91+3te/wDSc1YhKg3jR8NxKKRJq2hwHwcWv31cSwSYvIBrmbENoYMWcenW8uproQqg== +"@eslint/eslintrc@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.4.tgz#dfe0ff7ba270848d10c5add0715e04964c034b31" + integrity sha512-h8Vx6MdxwWI2WM8/zREHMoqdgLNXEL4QX3MWSVMdyNJGvXVOs+6lp+m2hc3FnuMHDc4poxFNI20vCk0OmI4G0Q== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -1034,7 +1042,7 @@ globals "^13.9.0" ignore "^4.0.6" import-fresh "^3.2.1" - js-yaml "^3.13.1" + js-yaml "^4.1.0" minimatch "^3.0.4" strip-json-comments "^3.1.1" @@ -1043,28 +1051,28 @@ resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.2.tgz#30aa825f11d438671d585bd44e7fd564535fc210" integrity sha512-82cpyJyKRoQoRi+14ibCeGPu0CwypgtBAdBhq1WfvagpCZNKqwXbKwXllYSMG91DhmG4jt9gN8eP6lGOtozuaw== -"@graphql-tools/merge@^8.2.0": - version "8.2.0" - resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-8.2.0.tgz#8f6638eeecf19f59fef28598024308e0452dd0a2" - integrity sha512-nfMLYF7zczjnIbChZtqbvozRfuRweMD1Fe9HHd4RXd3Tcsj6E17srW0QJfxUoIIWh4pitj+XwZAwhj1PWBDU7g== +"@graphql-tools/merge@^8.2.1": + version "8.2.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-8.2.1.tgz#bf83aa06a0cfc6a839e52a58057a84498d0d51ff" + integrity sha512-Q240kcUszhXiAYudjuJgNuLgy9CryDP3wp83NOZQezfA6h3ByYKU7xI6DiKrdjyVaGpYN3ppUmdj0uf5GaXzMA== dependencies: - "@graphql-tools/utils" "^8.4.0" + "@graphql-tools/utils" "^8.5.1" tslib "~2.3.0" -"@graphql-tools/schema@^8.3.0": - version "8.3.0" - resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-8.3.0.tgz#ddf4297859c6d7ac1ebbbd91460260ed424115db" - integrity sha512-OJD4Q1Xa3sffRiHzy0sskZz9ZWeqaujINfoim4CTk5Y9es1LS+WnKi25wVhmL2SGzzmKuAv7oDn+dpQAlM+Gfw== +"@graphql-tools/schema@^8.3.1": + version "8.3.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-8.3.1.tgz#1ee9da494d2da457643b3c93502b94c3c4b68c74" + integrity sha512-3R0AJFe715p4GwF067G5i0KCr/XIdvSfDLvTLEiTDQ8V/hwbOHEKHKWlEBHGRQwkG5lwFQlW1aOn7VnlPERnWQ== dependencies: - "@graphql-tools/merge" "^8.2.0" - "@graphql-tools/utils" "^8.4.0" + "@graphql-tools/merge" "^8.2.1" + "@graphql-tools/utils" "^8.5.1" tslib "~2.3.0" value-or-promise "1.0.11" -"@graphql-tools/utils@^8.4.0": - version "8.5.0" - resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-8.5.0.tgz#439487ac756d9458a33091e5e0435ddf8e794f3e" - integrity sha512-jMwLm6YdN+Vbqntg5GHqDvGLpLa/xPSpRs/c40d0rBuel77wo7AaQ8jHeBSpp9y+7kp7HrGSWff1u7yJ7F8ppw== +"@graphql-tools/utils@^8.5.1": + version "8.5.3" + resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-8.5.3.tgz#404062e62cae9453501197039687749c4885356e" + integrity sha512-HDNGWFVa8QQkoQB0H1lftvaO1X5xUaUDk1zr1qDe0xN1NL0E/CrQdJ5UKLqOvH4hkqVUPxQsyOoAZFkaH6rLHg== dependencies: tslib "~2.3.0" @@ -1078,9 +1086,9 @@ minimatch "^3.0.4" "@humanwhocodes/object-schema@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" - integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== "@hutson/parse-repository-url@^3.0.0": version "3.0.2" @@ -2196,14 +2204,6 @@ estree-walker "^1.0.1" picomatch "^2.2.2" -"@rollup/pluginutils@^4.1.0": - version "4.1.1" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.1.tgz#1d4da86dd4eded15656a57d933fda2b9a08d47ec" - integrity sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ== - dependencies: - estree-walker "^2.0.1" - picomatch "^2.2.2" - "@sinonjs/commons@^1.7.0": version "1.8.3" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" @@ -2212,20 +2212,21 @@ type-detect "4.0.8" "@sinonjs/fake-timers@^8.0.1": - version "8.0.1" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.0.1.tgz#1c1c9a91419f804e59ae8df316a07dd1c3a76b94" - integrity sha512-AU7kwFxreVd6OAXcAFlKSmZquiRUU0FvYm44k1Y1QbK7Co4m0aqfGMhjykIeQp/H6rcl+nFmj0zfdUcGVs9Dew== + version "8.1.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz#3fdc2b6cb58935b21bfb8d1625eb1300484316e7" + integrity sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg== dependencies: "@sinonjs/commons" "^1.7.0" "@surma/rollup-plugin-off-main-thread@^2.2.2": - version "2.2.2" - resolved "https://registry.yarnpkg.com/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-2.2.2.tgz#12e062b299c9305c1e6c30fdac89c3222e0aa83f" - integrity sha512-dOD6nGZ79RmWKDRQuC7SOGXMvDkkLwBogu+epfVFMKiy2kOUtLZkb8wV/ettuMt37YJAJKYCKUmxSbZL2LkUQg== + version "2.2.3" + resolved "https://registry.yarnpkg.com/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-2.2.3.tgz#ee34985952ca21558ab0d952f00298ad2190c053" + integrity sha512-lR8q/9W7hZpMWweNiAKU7NQerBnzQQLvi8qnTDU/fxItPhtZVMbPV3lbCwjhIlNBe9Bbr5V+KHshvWmVSG9cxQ== dependencies: ejs "^3.1.6" json5 "^2.2.0" magic-string "^0.25.0" + string.prototype.matchall "^4.0.6" "@testing-library/react-hooks@^7.0.2": version "7.0.2" @@ -2348,10 +2349,10 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== -"@types/node@*", "@types/node@^16.10.2", "@types/node@^16.11.4": - version "16.11.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.4.tgz#90771124822d6663814f7c1c9b45a6654d8fd964" - integrity sha512-TMgXmy0v2xWyuCSCJM6NCna2snndD8yvQF67J29ipdzMcsPa9u+o0tjF5+EQNdhcuZplYuouYqpc4zcd5I6amQ== +"@types/node@*", "@types/node@^16.10.2", "@types/node@^16.11.7": + version "16.11.7" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.7.tgz#36820945061326978c42a01e56b61cd223dfdc42" + integrity sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -2374,9 +2375,9 @@ integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ== "@types/react-dom@>=16.9.0": - version "17.0.10" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.10.tgz#d6972ec018d23cf22b99597f1289343d99ea9d9d" - integrity sha512-8oz3NAUId2z/zQdFI09IMhQPNgIbiP8Lslhv39DIDamr846/0spjZK0vnrMak0iB8EKb9QFTTIdg2Wj2zH5a3g== + version "17.0.11" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.11.tgz#e1eadc3c5e86bdb5f7684e00274ae228e7bcc466" + integrity sha512-f96K3k+24RaLGVu/Y2Ng3e1EbZ8/cVJvypZWd7cy0ofCBaf2lcM46xNhycMZ2xGwbBjRql7hOlZ+e2WlJ5MH3Q== dependencies: "@types/react" "*" @@ -2387,22 +2388,15 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@>=16.9.0", "@types/react@^17.0.32": - version "17.0.32" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.32.tgz#89a161286bbe2325d4d516420a27364a324909f4" - integrity sha512-hAm1pmwA3oZWbkB985RFwNvBRMG0F3KWSiC4/hNmanigKZMiKQoH5Q6etNw8HIDztTGfvXyOjPvdNnvBUCuaPg== +"@types/react@*", "@types/react@>=16.9.0", "@types/react@^17.0.32", "@types/react@^17.0.34": + version "17.0.34" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.34.tgz#797b66d359b692e3f19991b6b07e4b0c706c0102" + integrity sha512-46FEGrMjc2+8XhHXILr+3+/sTe3OfzSPU9YGKILLrUYbQ1CLQC9Daqo1KzENGXAWwrFwiY0l4ZbF20gRvgpWTg== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" csstype "^3.0.2" -"@types/resolve@0.0.8": - version "0.0.8" - resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" - integrity sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ== - dependencies: - "@types/node" "*" - "@types/resolve@1.17.1": version "1.17.1" resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" @@ -2444,48 +2438,48 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/parser@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.1.0.tgz#6c7f837d210d2bc0a811e7ea742af414f4e00908" - integrity sha512-vx1P+mhCtYw3+bRHmbalq/VKP2Y3gnzNgxGxfEWc6OFpuEL7iQdAeq11Ke3Rhy8NjgB+AHsIWEwni3e+Y7djKA== +"@typescript-eslint/parser@^5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.3.1.tgz#8ff1977c3d3200c217b3e4628d43ef92f89e5261" + integrity sha512-TD+ONlx5c+Qhk21x9gsJAMRohWAUMavSOmJgv3JGy9dgPhuBd5Wok0lmMClZDyJNLLZK1JRKiATzCKZNUmoyfw== dependencies: - "@typescript-eslint/scope-manager" "5.1.0" - "@typescript-eslint/types" "5.1.0" - "@typescript-eslint/typescript-estree" "5.1.0" + "@typescript-eslint/scope-manager" "5.3.1" + "@typescript-eslint/types" "5.3.1" + "@typescript-eslint/typescript-estree" "5.3.1" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.1.0.tgz#6f1f26ad66a8f71bbb33b635e74fec43f76b44df" - integrity sha512-yYlyVjvn5lvwCL37i4hPsa1s0ORsjkauhTqbb8MnpvUs7xykmcjGqwlNZ2Q5QpoqkJ1odlM2bqHqJwa28qV6Tw== +"@typescript-eslint/scope-manager@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.3.1.tgz#3cfbfbcf5488fb2a9a6fbbe97963ee1e8d419269" + integrity sha512-XksFVBgAq0Y9H40BDbuPOTUIp7dn4u8oOuhcgGq7EoDP50eqcafkMVGrypyVGvDYHzjhdUCUwuwVUK4JhkMAMg== dependencies: - "@typescript-eslint/types" "5.1.0" - "@typescript-eslint/visitor-keys" "5.1.0" + "@typescript-eslint/types" "5.3.1" + "@typescript-eslint/visitor-keys" "5.3.1" -"@typescript-eslint/types@5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.1.0.tgz#a8a75ddfc611660de6be17d3ad950302385607a9" - integrity sha512-sEwNINVxcB4ZgC6Fe6rUyMlvsB2jvVdgxjZEjQUQVlaSPMNamDOwO6/TB98kFt4sYYfNhdhTPBEQqNQZjMMswA== +"@typescript-eslint/types@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.3.1.tgz#afaa715b69ebfcfde3af8b0403bf27527912f9b7" + integrity sha512-bG7HeBLolxKHtdHG54Uac750eXuQQPpdJfCYuw4ZI3bZ7+GgKClMWM8jExBtp7NSP4m8PmLRM8+lhzkYnSmSxQ== -"@typescript-eslint/typescript-estree@5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.1.0.tgz#132aea34372df09decda961cb42457433aa6e83d" - integrity sha512-SSz+l9YrIIsW4s0ZqaEfnjl156XQ4VRmJsbA0ZE1XkXrD3cRpzuZSVCyqeCMR3EBjF27IisWakbBDGhGNIOvfQ== +"@typescript-eslint/typescript-estree@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.3.1.tgz#50cc4bfb93dc31bc75e08ae52e29fcb786d606ec" + integrity sha512-PwFbh/PKDVo/Wct6N3w+E4rLZxUDgsoII/GrWM2A62ETOzJd4M6s0Mu7w4CWsZraTbaC5UQI+dLeyOIFF1PquQ== dependencies: - "@typescript-eslint/types" "5.1.0" - "@typescript-eslint/visitor-keys" "5.1.0" + "@typescript-eslint/types" "5.3.1" + "@typescript-eslint/visitor-keys" "5.3.1" debug "^4.3.2" globby "^11.0.4" is-glob "^4.0.3" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.1.0.tgz#e01a01b27eb173092705ae983aa1451bd1842630" - integrity sha512-uqNXepKBg81JVwjuqAxYrXa1Ql/YDzM+8g/pS+TCPxba0wZttl8m5DkrasbfnmJGHs4lQ2jTbcZ5azGhI7kK+w== +"@typescript-eslint/visitor-keys@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.3.1.tgz#c2860ff22939352db4f3806f34b21d8ad00588ba" + integrity sha512-3cHUzUuVTuNHx0Gjjt5pEHa87+lzyqOiHXy/Gz+SJOCW1mpw9xQHIIEwnKn+Thph1mgWyZ90nboOcSuZr/jTTQ== dependencies: - "@typescript-eslint/types" "5.1.0" + "@typescript-eslint/types" "5.3.1" eslint-visitor-keys "^3.0.0" JSONStream@^1.0.4: @@ -2578,13 +2572,6 @@ alphanum-sort@^1.0.2: resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM= -ansi-align@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" - integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== - dependencies: - string-width "^4.1.0" - ansi-colors@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" @@ -2705,9 +2692,9 @@ asap@^2.0.0: integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + version "0.2.6" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" + integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== dependencies: safer-buffer "~2.1.0" @@ -2742,15 +2729,15 @@ at-least-node@^1.0.0: integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== autoprefixer@^10.1.0: - version "10.3.7" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.3.7.tgz#cef2562058406bd378c94aacda36bb46a97b3186" - integrity sha512-EmGpu0nnQVmMhX8ROoJ7Mx8mKYPlcUHuxkwrRYEYMz85lu7H09v8w6R1P0JPdn/hKU32GjpLBFEOuIlDWCRWvg== + version "10.4.0" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.0.tgz#c3577eb32a1079a440ec253e404eaf1eb21388c8" + integrity sha512-7FdJ1ONtwzV1G43GDD0kpVMn/qbiNqyOPMFTX5nRffI+7vgWoFEc6DcXOxHJxrWNDXrZh18eDsZjvZGUljSRGA== dependencies: - browserslist "^4.17.3" - caniuse-lite "^1.0.30001264" + browserslist "^4.17.5" + caniuse-lite "^1.0.30001272" fraction.js "^4.1.1" normalize-range "^0.1.2" - picocolors "^0.2.1" + picocolors "^1.0.0" postcss-value-parser "^4.1.0" aws-sign2@~0.7.0: @@ -2812,7 +2799,7 @@ babel-plugin-jsx-pragmatic@^1.0.2: dependencies: babel-plugin-syntax-jsx "^6.0.0" -babel-plugin-macros@^3.0.1: +babel-plugin-macros@^3.0.1, babel-plugin-macros@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" integrity sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg== @@ -2821,29 +2808,29 @@ babel-plugin-macros@^3.0.1: cosmiconfig "^7.0.0" resolve "^1.19.0" -babel-plugin-polyfill-corejs2@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz#e9124785e6fd94f94b618a7954e5693053bf5327" - integrity sha512-kISrENsJ0z5dNPq5eRvcctITNHYXWOA4DUZRFYCz3jYCcvTb/A546LIddmoGNMVYg2U38OyFeNosQwI9ENTqIQ== +babel-plugin-polyfill-corejs2@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.3.tgz#6ed8e30981b062f8fe6aca8873a37ebcc8cc1c0f" + integrity sha512-NDZ0auNRzmAfE1oDDPW2JhzIMXUk+FFe2ICejmt5T4ocKgiQx3e0VCRx9NCAidcMtL2RUZaWtXnmjTCkx0tcbA== dependencies: "@babel/compat-data" "^7.13.11" - "@babel/helper-define-polyfill-provider" "^0.2.2" + "@babel/helper-define-polyfill-provider" "^0.2.4" semver "^6.1.1" -babel-plugin-polyfill-corejs3@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.5.tgz#2779846a16a1652244ae268b1e906ada107faf92" - integrity sha512-ninF5MQNwAX9Z7c9ED+H2pGt1mXdP4TqzlHKyPIYmJIYz0N+++uwdM7RnJukklhzJ54Q84vA4ZJkgs7lu5vqcw== +babel-plugin-polyfill-corejs3@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.3.0.tgz#fa7ca3d1ee9ddc6193600ffb632c9785d54918af" + integrity sha512-JLwi9vloVdXLjzACL80j24bG6/T1gYxwowG44dg6HN/7aTPdyPbJJidf6ajoA3RPHHtW0j9KMrSOLpIZpAnPpg== dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.2" - core-js-compat "^3.16.2" + "@babel/helper-define-polyfill-provider" "^0.2.4" + core-js-compat "^3.18.0" -babel-plugin-polyfill-regenerator@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.2.tgz#b310c8d642acada348c1fa3b3e6ce0e851bee077" - integrity sha512-Goy5ghsc21HgPDFtzRkSirpZVW35meGoTmTOb2bxqdl60ghub4xOidgNTHaZfQ2FaxQsKmwvXtOAkcIS4SMBWg== +babel-plugin-polyfill-regenerator@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.3.tgz#2e9808f5027c4336c994992b48a4262580cb8d6d" + integrity sha512-JVE78oRZPKFIeUqFGrSORNzQnrDwZR16oiWeGM8ZyjBn2XAT5OjP+wXx5ESuo33nUsFUEJYjtklnsKbxW5L+7g== dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.2" + "@babel/helper-define-polyfill-provider" "^0.2.4" babel-plugin-syntax-jsx@^6.0.0: version "6.18.0" @@ -2930,20 +2917,6 @@ boolbase@^1.0.0: resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= -boxen@^5.0.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" - integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== - dependencies: - ansi-align "^3.0.0" - camelcase "^6.2.0" - chalk "^4.1.0" - cli-boxes "^2.2.1" - string-width "^4.2.2" - type-fest "^0.20.2" - widest-line "^3.1.0" - wrap-ansi "^7.0.0" - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -2959,7 +2932,7 @@ braces@^3.0.1, braces@~3.0.2: dependencies: fill-range "^7.0.1" -brotli-size@4.0.0, brotli-size@^4.0.0: +brotli-size@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/brotli-size/-/brotli-size-4.0.0.tgz#a05ee3faad3c0e700a2f2da826ba6b4d76e69e5e" integrity sha512-uA9fOtlTRC0iqKfzff1W34DXUA3GyVqbUaeo3Rw3d4gd1eavKVCETXrn3NzO74W+UVkG3UHu8WxUi+XvKI/huA== @@ -2971,13 +2944,13 @@ browser-process-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== -browserslist@^4.0.0, browserslist@^4.16.0, browserslist@^4.16.6, browserslist@^4.17.3: - version "4.17.5" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.5.tgz#c827bbe172a4c22b123f5e337533ceebadfdd559" - integrity sha512-I3ekeB92mmpctWBoLXe0d5wPS2cBuRvvW0JyyJHMrk9/HmP2ZjrTboNAZ8iuGqaEIlKguljbQY32OkOJIRrgoA== +browserslist@^4.0.0, browserslist@^4.16.0, browserslist@^4.16.6, browserslist@^4.17.5, browserslist@^4.17.6: + version "4.17.6" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.6.tgz#c76be33e7786b497f66cad25a73756c8b938985d" + integrity sha512-uPgz3vyRTlEiCv4ee9KlsKgo2V6qPk7Jsn0KAn2OBqbqKo3iNcPEC1Ti6J4dwnz+aIRfEEEuOzC9IBk8tXUomw== dependencies: - caniuse-lite "^1.0.30001271" - electron-to-chromium "^1.3.878" + caniuse-lite "^1.0.30001274" + electron-to-chromium "^1.3.886" escalade "^3.1.1" node-releases "^2.0.1" picocolors "^1.0.0" @@ -3080,10 +3053,10 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001264, caniuse-lite@^1.0.30001271: - version "1.0.30001271" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001271.tgz#0dda0c9bcae2cf5407cd34cac304186616cc83e8" - integrity sha512-BBruZFWmt3HFdVPS8kceTBIguKxu4f99n5JNp06OlPD/luoAMIaIK5ieV5YjnBLH3Nysai9sxj9rpJj4ZisXOA== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001272, caniuse-lite@^1.0.30001274: + version "1.0.30001279" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001279.tgz#eb06818da481ef5096a3b3760f43e5382ed6b0ce" + integrity sha512-VfEHpzHEXj6/CxggTwSFoZBBYGQfQv9Cf42KPlO79sWXCD1QNKWKsKzFeWL7QpZHJQYAvocqV6Rty1yJMkqWLQ== caseless@~0.12.0: version "0.12.0" @@ -3181,11 +3154,6 @@ clean-stack@^2.0.0: resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== -cli-boxes@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" - integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== - cli-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" @@ -3229,6 +3197,11 @@ clone@^1.0.2: resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= +clone@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" + integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= + cmd-shim@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-4.1.0.tgz#b3a904a6743e9fede4148c6f3800bf2a08135bdd" @@ -3286,7 +3259,7 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -colord@^2.0.1, colord@^2.6: +colord@^2.9.1: version "2.9.1" resolved "https://registry.yarnpkg.com/colord/-/colord-2.9.1.tgz#c961ea0efeb57c9f0f4834458f26cb9cc4a3f90e" integrity sha512-4LBMSt09vR0uLnPVkOUBnmxgoaeN4ewRbx801wY/bXcltXfpR/G46OdWn96XpYmCWuYvO46aBZP4NgX8HpNAcw== @@ -3301,11 +3274,6 @@ colorette@^2.0.16: resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.16.tgz#713b9af84fdb000139f04546bd4a93f62a5085da" integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g== -colors@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" - integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== - columnify@^1.5.4: version "1.5.4" resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" @@ -3478,18 +3446,18 @@ convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.6.0, dependencies: safe-buffer "~5.1.1" -core-js-compat@^3.16.0, core-js-compat@^3.16.2: - version "3.18.3" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.18.3.tgz#e0e7e87abc55efb547e7fa19169e45fa9df27a67" - integrity sha512-4zP6/y0a2RTHN5bRGT7PTq9lVt3WzvffTNjqnTKsXhkAYNDTkdCLOIfAdOLcQ/7TDdyRj3c+NeHe1NmF1eDScw== +core-js-compat@^3.18.0, core-js-compat@^3.19.0: + version "3.19.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.19.1.tgz#fe598f1a9bf37310d77c3813968e9f7c7bb99476" + integrity sha512-Q/VJ7jAF/y68+aUsQJ/afPOewdsGkDtcMb40J8MbuWKlK3Y+wtHq8bTHKPj2WKWLIqmS5JhHs4CzHtz6pT2W6g== dependencies: - browserslist "^4.17.3" + browserslist "^4.17.6" semver "7.0.0" core-js@^3.0.0: - version "3.18.3" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.18.3.tgz#86a0bba2d8ec3df860fefcc07a8d119779f01509" - integrity sha512-tReEhtMReZaPFVw7dajMx0vlsz3oOb8ajgPoHVYGxr8ErnZ6PcYEvvmjGmXlfpnxpkYSdOQttjB+MvVbCGfvLw== + version "3.19.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.19.1.tgz#f6f173cae23e73a7d88fa23b6e9da329276c6641" + integrity sha512-Tnc7E9iKd/b/ff7GFbhwPVzJzPztGrChB8X8GLqoYGdEOG8IpLnK1xPyo3ZoO3HsK6TodJS58VGPOxA+hLHQMg== core-util-is@1.0.2: version "1.0.2" @@ -3501,7 +3469,7 @@ core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== -cosmiconfig@^7.0.0: +cosmiconfig@^7.0.0, cosmiconfig@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== @@ -3567,24 +3535,24 @@ cssesc@^3.0.0: resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== -cssnano-preset-default@^5.1.4: - version "5.1.4" - resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-5.1.4.tgz#359943bf00c5c8e05489f12dd25f3006f2c1cbd2" - integrity sha512-sPpQNDQBI3R/QsYxQvfB4mXeEcWuw0wGtKtmS5eg8wudyStYMgKOQT39G07EbW1LB56AOYrinRS9f0ig4Y3MhQ== +cssnano-preset-default@^5.1.6: + version "5.1.6" + resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-5.1.6.tgz#1bdb83be6a6b1fee6dc5e9ec2e61286bcadcc7a6" + integrity sha512-X2nDeNGBXc0486oHjT2vSj+TdeyVsxRvJUxaOH50hOM6vSDLkKd0+59YXpSZRInJ4sNtBOykS4KsPfhdrU/35w== dependencies: css-declaration-sorter "^6.0.3" cssnano-utils "^2.0.1" postcss-calc "^8.0.0" - postcss-colormin "^5.2.0" - postcss-convert-values "^5.0.1" + postcss-colormin "^5.2.1" + postcss-convert-values "^5.0.2" postcss-discard-comments "^5.0.1" postcss-discard-duplicates "^5.0.1" postcss-discard-empty "^5.0.1" postcss-discard-overridden "^5.0.1" - postcss-merge-longhand "^5.0.2" + postcss-merge-longhand "^5.0.3" postcss-merge-rules "^5.0.2" postcss-minify-font-values "^5.0.1" - postcss-minify-gradients "^5.0.2" + postcss-minify-gradients "^5.0.3" postcss-minify-params "^5.0.1" postcss-minify-selectors "^5.1.0" postcss-normalize-charset "^5.0.1" @@ -3599,7 +3567,7 @@ cssnano-preset-default@^5.1.4: postcss-ordered-values "^5.0.2" postcss-reduce-initial "^5.0.1" postcss-reduce-transforms "^5.0.1" - postcss-svgo "^5.0.2" + postcss-svgo "^5.0.3" postcss-unique-selectors "^5.0.1" cssnano-utils@^2.0.1: @@ -3608,11 +3576,11 @@ cssnano-utils@^2.0.1: integrity sha512-i8vLRZTnEH9ubIyfdZCAdIdgnHAUeQeByEeQ2I7oTilvP9oHO6RScpeq3GsFUVqeB8uZgOQ9pw8utofNn32hhQ== cssnano@^5.0.1: - version "5.0.8" - resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-5.0.8.tgz#39ad166256980fcc64faa08c9bb18bb5789ecfa9" - integrity sha512-Lda7geZU0Yu+RZi2SGpjYuQz4HI4/1Y+BhdD0jL7NXAQ5larCzVn+PUGuZbDMYz904AXXCOgO5L1teSvgu7aFg== + version "5.0.10" + resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-5.0.10.tgz#92207eb7c9c6dc08d318050726f9fad0adf7220b" + integrity sha512-YfNhVJJ04imffOpbPbXP2zjIoByf0m8E2c/s/HnvSvjXgzXMfgopVjAEGvxYOjkOpWuRQDg/OZFjO7WW94Ri8w== dependencies: - cssnano-preset-default "^5.1.4" + cssnano-preset-default "^5.1.6" is-resolvable "^1.1.0" lilconfig "^2.0.3" yaml "^1.10.2" @@ -3658,10 +3626,10 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -data-uri-to-buffer@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz#594b8973938c5bc2c33046535785341abc4f3636" - integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og== +data-uri-to-buffer@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz#b5db46aea50f6176428ac05b73be39a57701a64b" + integrity sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA== data-urls@^2.0.0: version "2.0.0" @@ -3879,10 +3847,10 @@ ejs@^3.1.6: dependencies: jake "^10.6.1" -electron-to-chromium@^1.3.878: - version "1.3.878" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.878.tgz#baa9fb5c24b9b580f08fb245cbb52a22f8fc8fa8" - integrity sha512-O6yxWCN9ph2AdspAIszBnd9v8s11hQx8ub9w4UGApzmNRnoKhbulOWqbO8THEQec/aEHtvy+donHZMlh6l1rbA== +electron-to-chromium@^1.3.886: + version "1.3.893" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.893.tgz#9d804c68953b05ede35409dba0d73dd54c077b4d" + integrity sha512-ChtwF7qB03INq1SyMpue08wc6cve+ktj2UC/Y7se9vB+JryfzziJeYwsgb8jLaCA5GMkHCdn5M62PfSMWhifZg== emittery@^0.8.1: version "0.8.1" @@ -4007,10 +3975,10 @@ escodegen@^2.0.0: optionalDependencies: source-map "~0.6.1" -eslint-plugin-prefer-let@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-let/-/eslint-plugin-prefer-let-1.1.0.tgz#a5eb401a5f6b6995883bac7ebafb7fe5d6e9bedb" - integrity sha512-d7IhB8FZCtnCNQ20e4UTETPJNF3mIES3ZYan9RK/K3sIkEfuL3NfF9t5gxoNRFjeSkhlGpJmZdLGLRGPmKgVfQ== +eslint-plugin-prefer-let@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-let/-/eslint-plugin-prefer-let-3.0.1.tgz#bb9e3af2c3df2df5d7334f35ac7478d794d97215" + integrity sha512-vbznkkBSXB63d4o1o0NIm5C2ey3V5wKr/25dAvPdydQXdowAcnr69cbLgxd2YAG81IV5eddCO55Lp6gL7wSE4w== dependencies: requireindex "~1.2.0" @@ -4035,16 +4003,16 @@ eslint-visitor-keys@^2.0.0: integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== eslint-visitor-keys@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz#e32e99c6cdc2eb063f204eda5db67bfe58bb4186" - integrity sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q== + version "3.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2" + integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== eslint@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.1.0.tgz#00f1f7dbf4134f26588e6c9f2efe970760f64664" - integrity sha512-JZvNneArGSUsluHWJ8g8MMs3CfIEzwaLx9KyH4tZ2i+R2/rPWzL8c0zg3rHdwYVpN/1sB9gqnjHwz9HoeJpGHw== + version "8.2.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.2.0.tgz#44d3fb506d0f866a506d97a0fc0e90ee6d06a815" + integrity sha512-erw7XmM+CLxTOickrimJ1SiF55jiNlVSp2qqm0NuBWPtHYQCegD5ZMaW0c3i5ytPqL+SSLaCxdvQXFPLJn+ABw== dependencies: - "@eslint/eslintrc" "^1.0.3" + "@eslint/eslintrc" "^1.0.4" "@humanwhocodes/config-array" "^0.6.0" ajv "^6.10.0" chalk "^4.0.0" @@ -4078,7 +4046,7 @@ eslint@^8.1.0: progress "^2.0.0" regexpp "^3.2.0" semver "^7.2.1" - strip-ansi "^6.0.0" + strip-ansi "^6.0.1" strip-json-comments "^3.1.0" text-table "^0.2.0" v8-compile-cache "^2.0.3" @@ -4112,9 +4080,9 @@ esrecurse@^4.3.0: estraverse "^5.2.0" estraverse@^5.1.0, estraverse@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" - integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== estree-walker@^0.6.1: version "0.6.1" @@ -4193,9 +4161,9 @@ extsprintf@1.3.0: integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + version "1.4.1" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" + integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -4245,9 +4213,9 @@ fb-watchman@^2.0.0: bser "2.1.1" fetch-blob@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.1.2.tgz#6bc438675f3851ecea51758ac91f6a1cd1bacabd" - integrity sha512-hunJbvy/6OLjCD0uuhLdp0mMPzP/yd2ssd1t2FCJsaA7wkWhpbp9xfuNVpv7Ll4jFhzp6T4LAupSiV9uOeg0VQ== + version "3.1.3" + resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.1.3.tgz#a7dca4855e39d3e3c5a1da62d4ee335c37d26012" + integrity sha512-ax1Y5I9w+9+JiM+wdHkhBoxew+zG4AJ2SvAD1v1szpddUIiPERVGBxrMcB2ZqW0Y3PP8bOWYv2zqQq1Jp2kqUQ== dependencies: web-streams-polyfill "^3.0.3" @@ -4362,9 +4330,9 @@ flat-cache@^3.0.4: rimraf "^3.0.2" flatted@^3.1.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" - integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== + version "3.2.4" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2" + integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== forever-agent@~0.6.1: version "0.6.1" @@ -4389,6 +4357,13 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" +formdata-polyfill@^4.0.10: + version "4.0.10" + resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" + integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== + dependencies: + fetch-blob "^3.1.2" + fraction.js@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.1.1.tgz#ac4e520473dae67012d618aab91eda09bcb400ff" @@ -4623,9 +4598,9 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.6.0, globals@^13.9.0: - version "13.11.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.11.0.tgz#40ef678da117fe7bd2e28f1fab24951bd0255be7" - integrity sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g== + version "13.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.12.0.tgz#4d733760304230a0082ed96e21e5c565f898089e" + integrity sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg== dependencies: type-fest "^0.20.2" @@ -4663,10 +4638,15 @@ graphql-query-compress@^1.0.0: dependencies: tokenizr "1.5.7" +graphql-relay@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/graphql-relay/-/graphql-relay-0.9.0.tgz#d96f19d38b742a390acf10056ddd136034b3e1b4" + integrity sha512-yNJLCqcjz0XpzpmmckRJCSK8a2ZLwTurwrQ09UyGftONh52PbrGpK1UO4yspvj0c7pC+jkN4ZUqVXG3LRrWkXQ== + graphql@^15.6.1: - version "15.6.1" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.6.1.tgz#9125bdf057553525da251e19e96dab3d3855ddfc" - integrity sha512-3i5lu0z6dRvJ48QP9kFxBkJ7h4Kso7PS8eahyTFz5Jm6CvQfLtNIE8LX9N6JLnXTuwR+sIYnXzaWp6anOg0QQw== + version "15.7.2" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.7.2.tgz#85ab0eeb83722977151b3feb4d631b5f2ab287ef" + integrity sha512-AnnKk7hFQFmU/2I9YSQf3xw44ctnSFCfp3zE0N6W174gqe9fWG/2rKaKxROK7CcI3XtERpjEKFqts8o319Kf7A== gzip-size@^3.0.0: version "3.0.0" @@ -4867,9 +4847,9 @@ ignore@^4.0.6: integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== ignore@^5.1.4: - version "5.1.8" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" - integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== + version "5.1.9" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.9.tgz#9ec1a5cbe8e1446ec60d4420060d43aa6e7382fb" + integrity sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ== import-cwd@^3.0.0: version "3.0.0" @@ -5231,7 +5211,7 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul-lib-coverage@^3.0.0: +istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== @@ -5247,14 +5227,14 @@ istanbul-lib-instrument@^4.0.3: semver "^6.3.0" istanbul-lib-instrument@^5.0.4: - version "5.0.4" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.0.4.tgz#e976f2aa66ebc6737f236d3ab05b76e36f885c80" - integrity sha512-W6jJF9rLGEISGoCyXRqa/JCGQGmmxPO10TMu7izaUTynxvBvTjqzAIIGCK9USBmIbQAaSWD6XJPrM9Pv5INknw== + version "5.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz#7b49198b657b27a730b8e9cb601f1e1bff24c59a" + integrity sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q== dependencies: "@babel/core" "^7.12.3" "@babel/parser" "^7.14.7" "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.0.0" + istanbul-lib-coverage "^3.2.0" semver "^6.3.0" istanbul-lib-report@^3.0.0: @@ -5937,28 +5917,27 @@ libnpmpublish@^4.0.0: ssri "^8.0.1" lilconfig@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.3.tgz#68f3005e921dafbd2a2afb48379986aa6d2579fd" - integrity sha512-EHKqr/+ZvdKCifpNrJCKxBTgk5XupZA3y/aCPY9mxfgBzmgh93Mt/WqjjQ38oMxXuvDokaKiM3lAgvSH2sjtHg== + version "2.0.4" + resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.4.tgz#f4507d043d7058b380b6a8f5cb7bcd4b34cee082" + integrity sha512-bfTIN7lEsiooCocSISTWXkiWJkRqtL9wYtYy+8EK3Y41qh3mpwPU0ycTOgjdY9ErwXCc8QyrQp82bdL0Xkm9yA== lines-and-columns@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= -lint-staged@^11.2.4: - version "11.2.4" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-11.2.4.tgz#29bc84e0318e6e9d4a7a043513236d066e39ee1d" - integrity sha512-aTUqcPDSV05EyKlMT4N5h7tmnevKfAxI3xZkRb+DHfmcFaoCxfxVvpqlLMCVGy3EYle9JYER2nA5zc4eNTkZVQ== +lint-staged@^11.2.6: + version "11.2.6" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-11.2.6.tgz#f477b1af0294db054e5937f171679df63baa4c43" + integrity sha512-Vti55pUnpvPE0J9936lKl0ngVeTdSZpEdTNhASbkaWX7J5R9OEifo1INBGQuGW4zmy6OG+TcWPJ3m5yuy5Q8Tg== dependencies: cli-truncate "2.1.0" colorette "^1.4.0" commander "^8.2.0" + cosmiconfig "^7.0.1" debug "^4.3.2" enquirer "^2.3.6" execa "^5.1.1" - js-yaml "^4.1.0" - lilconfig "^2.0.3" listr2 "^3.12.2" micromatch "^4.0.4" normalize-path "^3.0.0" @@ -5968,15 +5947,16 @@ lint-staged@^11.2.4: supports-color "8.1.1" listr2@^3.12.2: - version "3.13.1" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.13.1.tgz#816e8c1728d50f223795f530d72d248c7fa14602" - integrity sha512-pk4YBDA2cxtpM8iLHbz6oEsfZieJKHf6Pt19NlKaHZZVpqHyVs/Wqr7RfBBCeAFCJchGO7WQHVkUPZTvJMHk8w== + version "3.13.3" + resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.13.3.tgz#d8f6095c9371b382c9b1c2bc33c5941d8e177f11" + integrity sha512-VqAgN+XVfyaEjSaFewGPcDs5/3hBbWVaX1VgWv2f52MF7US45JuARlArULctiB44IIcEk3JF7GtoFCLqEdeuPA== dependencies: cli-truncate "^2.1.0" + clone "^2.1.2" colorette "^2.0.16" log-update "^4.0.0" p-map "^4.0.0" - rxjs "^6.6.7" + rxjs "^7.4.0" through "^2.3.8" wrap-ansi "^7.0.0" @@ -6317,17 +6297,17 @@ micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" -mime-db@1.50.0: - version "1.50.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.50.0.tgz#abd4ac94e98d3c0e185016c67ab45d5fde40c11f" - integrity sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A== +mime-db@1.51.0: + version "1.51.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" + integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.33" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.33.tgz#1fa12a904472fafd068e48d9e8401f74d3f70edb" - integrity sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g== + version "2.1.34" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" + integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== dependencies: - mime-db "1.50.0" + mime-db "1.51.0" mimic-fn@^2.1.0: version "2.1.0" @@ -6468,7 +6448,7 @@ moment@^2.15.2: resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3" integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ== -mri@^1.1.0, mri@^1.1.1: +mri@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== @@ -6499,11 +6479,6 @@ mute-stream@0.0.8, mute-stream@~0.0.4: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== -nanocolors@^0.1.12: - version "0.1.12" - resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.1.12.tgz#8577482c58cbd7b5bb1681db4cf48f11a87fd5f6" - integrity sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ== - nanoid@^3.1.30: version "3.1.30" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362" @@ -6525,19 +6500,20 @@ neo-async@^2.6.0: integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== node-fetch@^2.6.1: - version "2.6.5" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.5.tgz#42735537d7f080a7e5f78b6c549b7146be1742fd" - integrity sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ== + version "2.6.6" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.6.tgz#1751a7c01834e8e1697758732e9efb6eeadfaf89" + integrity sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA== dependencies: whatwg-url "^5.0.0" -node-fetch@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.0.0.tgz#79da7146a520036f2c5f644e4a26095f17e411ea" - integrity sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q== +node-fetch@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.1.0.tgz#714f4922dc270239487654eaeeab86b8206cb52e" + integrity sha512-QU0WbIfMUjd5+MUzQOYhenAazakV7Irh1SGkWCsRzBwvm4fAhzEUaHMJ6QLP7gWT6WO9/oH2zhKMMGMuIrDyKw== dependencies: - data-uri-to-buffer "^3.0.1" + data-uri-to-buffer "^4.0.0" fetch-blob "^3.1.2" + formdata-polyfill "^4.0.10" node-gyp@^5.0.2: version "5.1.1" @@ -6948,7 +6924,7 @@ p-waterfall@^2.1.1: dependencies: p-reduce "^2.0.0" -pacote@^11.2.6, pacote@^11.2.7: +pacote@^11.2.6: version "11.3.5" resolved "https://registry.yarnpkg.com/pacote/-/pacote-11.3.5.tgz#73cf1fc3772b533f575e39efa96c50be8c3dc9d2" integrity sha512-fT375Yczn4zi+6Hkk2TBe1x1sP8FgFsEIZ2/iWaXY2r/NkhDJfxbcn5paz1+RTFCyNf+dPnaoBDJoAxXSU8Bkg== @@ -7070,11 +7046,6 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -picocolors@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" - integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA== - picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -7141,20 +7112,20 @@ postcss-calc@^8.0.0: postcss-selector-parser "^6.0.2" postcss-value-parser "^4.0.2" -postcss-colormin@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-5.2.0.tgz#2b620b88c0ff19683f3349f4cf9e24ebdafb2c88" - integrity sha512-+HC6GfWU3upe5/mqmxuqYZ9B2Wl4lcoUUNkoaX59nEWV4EtADCMiBqui111Bu8R8IvaZTmqmxrqOAqjbHIwXPw== +postcss-colormin@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-5.2.1.tgz#6e444a806fd3c578827dbad022762df19334414d" + integrity sha512-VVwMrEYLcHYePUYV99Ymuoi7WhKrMGy/V9/kTS0DkCoJYmmjdOMneyhzYUxcNgteKDVbrewOkSM7Wje/MFwxzA== dependencies: browserslist "^4.16.6" caniuse-api "^3.0.0" - colord "^2.0.1" + colord "^2.9.1" postcss-value-parser "^4.1.0" -postcss-convert-values@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-5.0.1.tgz#4ec19d6016534e30e3102fdf414e753398645232" - integrity sha512-C3zR1Do2BkKkCgC0g3sF8TS0koF2G+mN8xxayZx3f10cIRmTaAnpgpRQZjNekTZxM2ciSPoh2IWJm0VZx8NoQg== +postcss-convert-values@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-5.0.2.tgz#879b849dc3677c7d6bc94b6a2c1a3f0808798059" + integrity sha512-KQ04E2yadmfa1LqXm7UIDwW1ftxU/QWZmz6NKnHnUvJ3LEYbbcX6i329f/ig+WnEByHegulocXrECaZGLpL8Zg== dependencies: postcss-value-parser "^4.1.0" @@ -7187,10 +7158,10 @@ postcss-load-config@^3.0.0: lilconfig "^2.0.3" yaml "^1.10.2" -postcss-merge-longhand@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-5.0.2.tgz#277ada51d9a7958e8ef8cf263103c9384b322a41" - integrity sha512-BMlg9AXSI5G9TBT0Lo/H3PfUy63P84rVz3BjCFE9e9Y9RXQZD3+h3YO1kgTNsNJy7bBc1YQp8DmSnwLIW5VPcw== +postcss-merge-longhand@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-5.0.3.tgz#42194a5ffbaa5513edbf606ef79c44958564658b" + integrity sha512-kmB+1TjMTj/bPw6MCDUiqSA5e/x4fvLffiAdthra3a0m2/IjTrWsTmD3FdSskzUjEwkj5ZHBDEbv5dOcqD7CMQ== dependencies: css-color-names "^1.0.1" postcss-value-parser "^4.1.0" @@ -7214,12 +7185,12 @@ postcss-minify-font-values@^5.0.1: dependencies: postcss-value-parser "^4.1.0" -postcss-minify-gradients@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-5.0.2.tgz#7c175c108f06a5629925d698b3c4cf7bd3864ee5" - integrity sha512-7Do9JP+wqSD6Prittitt2zDLrfzP9pqKs2EcLX7HJYxsxCOwrrcLt4x/ctQTsiOw+/8HYotAoqNkrzItL19SdQ== +postcss-minify-gradients@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-5.0.3.tgz#f970a11cc71e08e9095e78ec3a6b34b91c19550e" + integrity sha512-Z91Ol22nB6XJW+5oe31+YxRsYooxOdFKcbOqY/V8Fxse1Y3vqlNRpi1cxCqoACZTQEhl+xvt4hsbWiV5R+XI9Q== dependencies: - colord "^2.6" + colord "^2.9.1" cssnano-utils "^2.0.1" postcss-value-parser "^4.1.0" @@ -7383,13 +7354,13 @@ postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4, postcss-selector cssesc "^3.0.0" util-deprecate "^1.0.2" -postcss-svgo@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-5.0.2.tgz#bc73c4ea4c5a80fbd4b45e29042c34ceffb9257f" - integrity sha512-YzQuFLZu3U3aheizD+B1joQ94vzPfE6BNUcSYuceNxlVnKKsOtdo6hL9/zyC168Q8EwfLSgaDSalsUGa9f2C0A== +postcss-svgo@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-5.0.3.tgz#d945185756e5dfaae07f9edb0d3cae7ff79f9b30" + integrity sha512-41XZUA1wNDAZrQ3XgWREL/M2zSw8LJPvb5ZWivljBsUQAGoEKMYm6okHsTjJxKYI4M75RQEH4KYlEM52VwdXVA== dependencies: postcss-value-parser "^4.1.0" - svgo "^2.3.0" + svgo "^2.7.0" postcss-unique-selectors@^5.0.1: version "5.0.1" @@ -7569,9 +7540,9 @@ randombytes@^2.1.0: safe-buffer "^5.1.0" react-error-boundary@^3.1.0: - version "3.1.3" - resolved "https://registry.yarnpkg.com/react-error-boundary/-/react-error-boundary-3.1.3.tgz#276bfa05de8ac17b863587c9e0647522c25e2a0b" - integrity sha512-A+F9HHy9fvt9t8SNDlonq01prnU8AmkjvGKV4kk8seB9kU3xMEO8J/PQlLVmoOIDODl5U2kufSBs4vrWIqhsAA== + version "3.1.4" + resolved "https://registry.yarnpkg.com/react-error-boundary/-/react-error-boundary-3.1.4.tgz#255db92b23197108757a888b01e5b729919abde0" + integrity sha512-uM9uPzZJTF6wRQORmSrvOIgt4lJ9MC1sNgEOj2XGsDTRE4kmpWxg7ENK9EWNKJRMAOY9z0MuF4yIfl6gp4sotA== dependencies: "@babel/runtime" "^7.12.5" @@ -7772,6 +7743,14 @@ regenerator-transform@^0.14.2: dependencies: "@babel/runtime" "^7.8.4" +regexp.prototype.flags@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz#7ef352ae8d159e758c0eadca6f8fcb4eef07be26" + integrity sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + regexpp@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" @@ -7866,7 +7845,7 @@ resolve@1.17.0: dependencies: path-parse "^1.0.6" -resolve@1.20.0, resolve@^1.10.0, resolve@^1.11.1, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0: +resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -7914,31 +7893,6 @@ rollup-plugin-bundle-size@^1.0.3: chalk "^1.1.3" maxmin "^2.1.0" -rollup-plugin-filesize@^9.1.0: - version "9.1.1" - resolved "https://registry.yarnpkg.com/rollup-plugin-filesize/-/rollup-plugin-filesize-9.1.1.tgz#31a6b02b27ce08082ef0970cfe4c451714ff91c4" - integrity sha512-x0r2A85TCEdRwF3rm+bcN4eAmbER8tt+YVf88gBQ6sLyH4oGcnNLPQqAUX+v7mIvHC/y59QwZvo6vxaC2ias6Q== - dependencies: - "@babel/runtime" "^7.13.8" - boxen "^5.0.0" - brotli-size "4.0.0" - colors "^1.4.0" - filesize "^6.1.0" - gzip-size "^6.0.0" - pacote "^11.2.7" - terser "^5.6.0" - -rollup-plugin-node-resolve@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-5.2.0.tgz#730f93d10ed202473b1fb54a5997a7db8c6d8523" - integrity sha512-jUlyaDXts7TW2CqQ4GaO5VJ4PwwaV8VUGA7+km3n6k6xtOEacf61u0VXwN80phY/evMcaS+9eIeJ9MOyDxt5Zw== - dependencies: - "@types/resolve" "0.0.8" - builtin-modules "^3.1.0" - is-module "^1.0.0" - resolve "^1.11.1" - rollup-pluginutils "^2.8.1" - rollup-plugin-postcss@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/rollup-plugin-postcss/-/rollup-plugin-postcss-4.0.1.tgz#2856465b637ec02513676659aabf1ca3840f3af0" @@ -7979,28 +7933,17 @@ rollup-plugin-typescript2@^0.29.0: resolve "1.17.0" tslib "2.0.1" -rollup-plugin-typescript2@^0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.30.0.tgz#1cc99ac2309bf4b9d0a3ebdbc2002aecd56083d3" - integrity sha512-NUFszIQyhgDdhRS9ya/VEmsnpTe+GERDMmFo0Y+kf8ds51Xy57nPNGglJY+W6x1vcouA7Au7nsTgsLFj2I0PxQ== - dependencies: - "@rollup/pluginutils" "^4.1.0" - find-cache-dir "^3.3.1" - fs-extra "8.1.0" - resolve "1.20.0" - tslib "2.1.0" - -rollup-pluginutils@^2.8.1, rollup-pluginutils@^2.8.2: +rollup-pluginutils@^2.8.2: version "2.8.2" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== dependencies: estree-walker "^0.6.1" -rollup@^2.35.1, rollup@^2.58.0: - version "2.58.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.58.0.tgz#a643983365e7bf7f5b7c62a8331b983b7c4c67fb" - integrity sha512-NOXpusKnaRpbS7ZVSzcEXqxcLDOagN6iFS8p45RkoiMqPHDLwJm758UF05KlMoCRbLBTZsPOIa887gZJ1AiXvw== +rollup@^2.35.1: + version "2.59.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.59.0.tgz#108c61b0fa0a37ebc8d1f164f281622056f0db59" + integrity sha512-l7s90JQhCQ6JyZjKgo7Lq1dKh2RxatOM+Jr6a9F7WbS9WgKbocyUSeLmZl8evAse7y96Ae98L2k1cBOwWD8nHw== optionalDependencies: fsevents "~2.3.2" @@ -8016,13 +7959,20 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^6.6.0, rxjs@^6.6.7: +rxjs@^6.6.0: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" +rxjs@^7.4.0: + version "7.4.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.4.0.tgz#a12a44d7eebf016f5ff2441b87f28c9a51cebc68" + integrity sha512-7SQDi7xeTMCJpqViXh8gL/lebcwlp3d831F05+9B44A4B0WfsEwUQHR64gsH1kvJ+Ep/J9K2+n1hVl1CsGN23w== + dependencies: + tslib "~2.1.0" + sade@^1.7.4: version "1.7.4" resolved "https://registry.yarnpkg.com/sade/-/sade-1.7.4.tgz#ea681e0c65d248d2095c90578c03ca0bb1b54691" @@ -8381,7 +8331,7 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2: +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -8390,6 +8340,20 @@ string-width@^1.0.1: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string.prototype.matchall@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.6.tgz#5abb5dabc94c7b0ea2380f65ba610b3a544b15fa" + integrity sha512-6WgDX8HmQqvEd7J+G6VtAahhsQIssiZ8zl7zKh1VDMFyL3hRTJP4FTNA3RbIp2TOQ9AYNDcc7e3fH0Qbup+DBg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + get-intrinsic "^1.1.1" + has-symbols "^1.0.2" + internal-slot "^1.0.3" + regexp.prototype.flags "^1.3.1" + side-channel "^1.0.4" + string.prototype.trimend@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" @@ -8531,17 +8495,17 @@ supports-hyperlinks@^2.0.0: has-flag "^4.0.0" supports-color "^7.0.0" -svgo@^2.3.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/svgo/-/svgo-2.7.0.tgz#e164cded22f4408fe4978f082be80159caea1e2d" - integrity sha512-aDLsGkre4fTDCWvolyW+fs8ZJFABpzLXbtdK1y71CKnHzAnpDxKXPj2mNKj+pyOXUCzFHzuxRJ94XOFygOWV3w== +svgo@^2.7.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/svgo/-/svgo-2.8.0.tgz#4ff80cce6710dc2795f0c7c74101e6764cfccd24" + integrity sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg== dependencies: "@trysound/sax" "0.2.0" commander "^7.2.0" css-select "^4.1.3" css-tree "^1.1.3" csso "^4.2.0" - nanocolors "^0.1.12" + picocolors "^1.0.0" stable "^0.1.8" symbol-tree@^3.2.4: @@ -8609,7 +8573,7 @@ terminal-link@^2.0.0: ansi-escapes "^4.2.1" supports-hyperlinks "^2.0.0" -terser@^5.0.0, terser@^5.6.0, terser@^5.7.0: +terser@^5.0.0, terser@^5.7.0: version "5.9.0" resolved "https://registry.yarnpkg.com/terser/-/terser-5.9.0.tgz#47d6e629a522963240f2b55fcaa3c99083d2c351" integrity sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ== @@ -8750,11 +8714,6 @@ tslib@2.0.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e" integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ== -tslib@2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" - integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== - tslib@^1.8.1, tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -8765,6 +8724,11 @@ tslib@^2.0.3, tslib@~2.3.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== +tslib@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" + integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== + tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" @@ -8851,9 +8815,9 @@ typescript@^4.1.3, typescript@^4.4.4: integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== uglify-js@^3.1.4: - version "3.14.2" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.14.2.tgz#d7dd6a46ca57214f54a2d0a43cad0f35db82ac99" - integrity sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A== + version "3.14.3" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.14.3.tgz#c0f25dfea1e8e5323eccf59610be08b6043c15cf" + integrity sha512-mic3aOdiq01DuSVx0TseaEzMIVqebMZ0Z3vaeDhFEh9bsc24hV1TFvN74reA2vs08D0ZWfNjAcJ3UbVLaBss+g== uid-number@0.0.6: version "0.0.6" @@ -9050,9 +9014,9 @@ wcwidth@^1.0.0: defaults "^1.0.3" web-streams-polyfill@^3.0.3: - version "3.1.1" - resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz#1516f2d4ea8f1bdbfed15eb65cb2df87098c8364" - integrity sha512-Czi3fG883e96T4DLEPRvufrF2ydhOOW1+1a6c3gNjH2aIh50DNFBdfwh2AKoOf1rXvpvavAoA11Qdq9+BKjE0Q== + version "3.2.0" + resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz#a6b74026b38e4885869fb5c589e90b95ccfc7965" + integrity sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA== webidl-conversions@^3.0.0: version "3.0.1" @@ -9144,13 +9108,6 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2 || 3 || 4" -widest-line@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" - integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== - dependencies: - string-width "^4.0.0" - word-wrap@^1.2.3, word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" From d041cb17bc33a22ff1fb94bdd1a5570fcc9ec430 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Fri, 19 Nov 2021 18:32:28 -0300 Subject: [PATCH 32/49] New tests; Separate Compiler from babel plugin; babel macro --- packages/bindings/.babelrc | 7 - packages/bindings/.babelrc.json | 22 ++ packages/bindings/__tests__/index.ts | 365 ++++++++++--------------- packages/bindings/package.json | 3 +- packages/bindings/schema.graphql | 269 +++++++++++++++++- packages/bindings/src/bindings.ts | 12 +- packages/bindings/src/types.ts | 11 +- packages/test-utils/src/mock-server.ts | 3 +- 8 files changed, 444 insertions(+), 248 deletions(-) delete mode 100644 packages/bindings/.babelrc create mode 100644 packages/bindings/.babelrc.json diff --git a/packages/bindings/.babelrc b/packages/bindings/.babelrc deleted file mode 100644 index ba0dd976..00000000 --- a/packages/bindings/.babelrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "presets": [ - ["@babel/preset-env", { "targets": { "node": "current" } }], - "@babel/preset-typescript" - ], - "plugins": [["module:@grafoo/babel-plugin", { "schema": "schema.graphql", "idFields": ["id"] }]] -} diff --git a/packages/bindings/.babelrc.json b/packages/bindings/.babelrc.json new file mode 100644 index 00000000..c8010361 --- /dev/null +++ b/packages/bindings/.babelrc.json @@ -0,0 +1,22 @@ +{ + "presets": [ + [ + "@babel/preset-env", + { + "targets": { + "node": "current" + } + } + ], + "@babel/preset-typescript" + ], + "plugins": [ + [ + "module:@grafoo/babel-plugin", + { + "schema": "schema.graphql", + "idFields": ["id"] + } + ] + ] +} diff --git a/packages/bindings/__tests__/index.ts b/packages/bindings/__tests__/index.ts index 0c4fc641..04ce2e94 100644 --- a/packages/bindings/__tests__/index.ts +++ b/packages/bindings/__tests__/index.ts @@ -1,160 +1,112 @@ -import createBindings from "../src"; -import fetch from "node-fetch"; +import createBindings, { makeGrafooConfig } from "../src"; import graphql from "@grafoo/core/tag"; import createClient, { GrafooClient } from "@grafoo/core"; -import { mockQueryRequest, createTransport } from "@grafoo/test-utils"; - -// @ts-ignore -globalThis.fetch = fetch; - -type Post = { - title: string; - content: string; - id: string; - __typename?: string; - author: Author; -}; - -type Author = { - name: string; - id: string; - __typename?: string; - posts?: Array; -}; - -type AuthorsQuery = { - authors: Author[]; -}; +import { + mockQueryRequest, + createTransport, + Query, + Mutation, + CreateAuthorInput, + DeleteAuthorInput, + UpdateAuthorInput +} from "@grafoo/test-utils"; + +type AuthorsQuery = Pick; let AUTHORS = graphql` query { authors { - name - posts { - title - body - } - } - } -`; - -type AuthorQuery = { - author: Author; -}; - -type AuthorQueryInput = { - id: string; -}; - -let AUTHOR = graphql` - query ($id: ID!) { - author(id: $id) { - name - posts { - title - body + edges { + node { + name + posts { + edges { + node { + body + title + } + } + } + } } } } `; -type PostsQuery = { - posts: Post[]; -}; - -type PostsAndAuthorsQuery = AuthorsQuery & PostsQuery; +type PostsAndAuthorsQuery = Pick; let POSTS_AND_AUTHORS = graphql` query { posts { - title - body - author { - name + edges { + node { + title + body + author { + name + } + } } } authors { - name - posts { - title - body + edges { + node { + name + posts { + edges { + node { + body + title + } + } + } + } } } } `; -type CreateAuthorMutation = { - createAuthor: { - name: string; - id: string; - __typename: string; - posts?: Array; - }; +type CreateAuthorMutation = Pick; +type CreateAuthorMutationVariables = { + input: CreateAuthorInput; }; -type CreateAuthorInput = { - name: string; -}; - -let CREATE_AUTHOR = graphql` - mutation ($name: String!) { - createAuthor(name: $name) { - name - posts { - title - body +let CREATE_AUTHOR = graphql` + mutation ($input: CreateAuthorInput!) { + createAuthor(input: $input) { + author { + name } } } `; -type DeleteAuthorMutation = { - deleteAuthor: { - name: string; - id: string; - __typename: string; - posts?: Array; - }; +type DeleteAuthorMutation = Pick; +type DeleteAuthorMutationVariables = { + input: DeleteAuthorInput; }; -type DeleteAuthorInput = { - id: string; -}; - -let DELETE_AUTHOR = graphql` - mutation ($id: ID!) { - deleteAuthor(id: $id) { - name - posts { - title - body +let DELETE_AUTHOR = graphql` + mutation ($input: DeleteAuthorInput!) { + deleteAuthor(input: $input) { + author { + name } } } `; -type UpdateAuthorMutation = { - updateAuthor: { - name: string; - id: string; - __typename: string; - posts?: Array; - }; -}; - -type UpdateAuthorInput = { - id?: string; - name?: string; +type UpdateAuthorMutation = Pick; +type UpdateAuthorMutationVariables = { + input: UpdateAuthorInput; }; -let UPDATE_AUTHOR = graphql` - mutation ($id: ID!, $name: String) { - updateAuthor(id: $id, name: $name) { - name - posts { - title - body +let UPDATE_AUTHOR = graphql` + mutation ($input: UpdateAuthorInput!) { + updateAuthor { + author { + name } } } @@ -181,36 +133,28 @@ describe("@grafoo/bindings", () => { it("should not provide any data if no query or mutation is given", () => { let bindings = createBindings(client, () => {}, {}); + let state = bindings.getState(); - let props = bindings.getState(); - - expect(props).toEqual({ loaded: false, loading: false }); + expect(state).toEqual({ loaded: false, loading: false }); }); it("should execute a query", async () => { let { data } = await mockQueryRequest(AUTHORS); - let renderFn = jest.fn(); - let bindings = createBindings(client, renderFn, { query: AUTHORS }); - expect(bindings.getState()).toEqual({ loaded: false, loading: false }); + expect(bindings.getState()).toEqual({ loaded: false, loading: true }); await bindings.load(); let results = renderFn.mock.calls.map((c) => c[0]); - expect(results).toEqual([ - { loaded: false, loading: true }, - { ...data, loaded: true, loading: false } - ]); + expect(results).toEqual([{ ...data, loaded: true, loading: false }]); }); it("should notify a loading state", async () => { let { data } = await mockQueryRequest(AUTHORS); - let renderFn = jest.fn(); - let bindings = createBindings(client, renderFn, { query: AUTHORS }); await bindings.load(); @@ -219,7 +163,6 @@ describe("@grafoo/bindings", () => { let results = renderFn.mock.calls.map((c) => c[0]); expect(results).toEqual([ - { loaded: false, loading: true }, { loaded: true, loading: false, ...data }, { loaded: true, loading: true, ...data }, { loaded: true, loading: false, ...data } @@ -243,20 +186,7 @@ describe("@grafoo/bindings", () => { let bindings = createBindings(client, () => {}, { query: POSTS_AND_AUTHORS }); - expect(bindings.getState()).toEqual({ ...data, loaded: false, loading: false }); - }); - - it("should trigger updater function if the cache has been updated", async () => { - let { data } = await mockQueryRequest(AUTHORS); - - let renderFn = jest.fn(); - - createBindings(client, renderFn, { query: AUTHORS }); - - client.write(AUTHORS, data); - - expect(renderFn).toHaveBeenCalledTimes(1); - expect(renderFn).toHaveBeenCalledWith({ ...data, loaded: true, loading: false }); + expect(bindings.getState()).toEqual({ ...data, loaded: false, loading: true }); }); it("should provide the state for a cached query", async () => { @@ -265,7 +195,6 @@ describe("@grafoo/bindings", () => { client.write(AUTHORS, data); let renderFn = jest.fn(); - let bindings = createBindings(client, renderFn, { query: AUTHORS }); expect(bindings.getState()).toEqual({ ...data, loaded: true, loading: false }); @@ -273,36 +202,28 @@ describe("@grafoo/bindings", () => { it("should stop updating if unbind has been called", async () => { let { data } = await mockQueryRequest(AUTHORS); - - let renderFn = jest.fn(); - - let bindings = createBindings(client, renderFn, { query: AUTHORS }); + let bindings = createBindings(client, () => {}, { query: AUTHORS }); await bindings.load(); - bindings.unbind(); - client.write(AUTHORS, { - authors: data.authors.map((a, i) => (!i ? { ...a, name: "Homer" } : a)) - }); + let clonedData: AuthorsQuery = JSON.parse(JSON.stringify(data)); + clonedData.authors.edges[0].node.name = "Homer"; - expect(client.read(AUTHORS).data.authors[0].name).toBe("Homer"); - expect(renderFn).toHaveBeenCalledTimes(2); + client.write(AUTHORS, clonedData); + expect(client.read(AUTHORS).data.authors.edges[0].node.name).toBe("Homer"); expect(bindings.getState().authors).toEqual(data.authors); }); it("should provide errors on bad request", async () => { let failedQuery = { ...AUTHORS, document: AUTHORS.document.substr(1) }; - let { errors } = await mockQueryRequest(failedQuery); - let renderFn = jest.fn(); - let bindings = createBindings(client, renderFn, { query: failedQuery }); await bindings.load(); - expect(renderFn).toHaveBeenCalledTimes(2); + expect(renderFn).toHaveBeenCalledTimes(1); expect(bindings.getState()).toEqual({ loading: false, loaded: false, errors }); }); @@ -314,11 +235,8 @@ describe("@grafoo/bindings", () => { }); let props = bindings.getState(); - - let variables = { name: "Bart" }; - + let variables = { input: { name: "Bart" } }; let { data } = await mockQueryRequest(CREATE_AUTHOR, variables); - let { data: mutationData } = await props.createAuthor(variables); expect(mutationData).toEqual(data); @@ -327,29 +245,30 @@ describe("@grafoo/bindings", () => { it("should perform mutation with a cache update", async () => { await mockQueryRequest(AUTHORS); - let mutations = { - createAuthor: { - query: CREATE_AUTHOR, - update: ({ authors }, data) => ({ - authors: [data.createAuthor, ...authors] - }) + let init = makeGrafooConfig({ + query: AUTHORS, + mutations: { + createAuthor: { + query: CREATE_AUTHOR, + update: ({ authors }, data) => ({ + authors: { + edges: [{ node: data.createAuthor.author }, ...authors.edges] + } + }) + } } - }; - - let update = jest.spyOn(mutations.createAuthor, "update"); - - let bindings = createBindings(client, () => {}, { query: AUTHORS, mutations }); + }); + let update = jest.spyOn(init.mutations.createAuthor, "update"); + let bindings = createBindings(client, () => {}, init); let props = bindings.getState(); expect(typeof props.createAuthor).toBe("function"); await bindings.load(); - let variables = { name: "Homer" }; - + let variables = { input: { name: "homer" } }; let { data } = await mockQueryRequest(CREATE_AUTHOR, variables); - let { authors } = bindings.getState(); await props.createAuthor(variables); @@ -360,35 +279,40 @@ describe("@grafoo/bindings", () => { it("should perform optimistic update", async () => { await mockQueryRequest(AUTHORS); - let mutations = { - createAuthor: { - query: CREATE_AUTHOR, - optimisticUpdate: ({ authors }, variables) => ({ - authors: [{ ...variables, id: "tempID" }, ...authors] - }), - update: ({ authors }, data) => ({ - authors: authors.map((p) => (p.id === "tempID" ? data.createAuthor : p)) - }) + let init = makeGrafooConfig({ + query: AUTHORS, + mutations: { + createAuthor: { + query: CREATE_AUTHOR, + optimisticUpdate: ({ authors }, variables) => ({ + authors: { + ...authors, + edges: [{ node: { ...variables.input, id: "tempID" } }, ...authors.edges] + } + }), + update: ({ authors }, data) => ({ + authors: { + edges: authors.edges.map((p) => + p.node.id === "tempID" ? { node: data.createAuthor.author } : p + ) + } + }) + } } - }; - - let optimisticUpdate = jest.spyOn(mutations.createAuthor, "optimisticUpdate"); - let update = jest.spyOn(mutations.createAuthor, "update"); - - let bindings = createBindings(client, () => {}, { query: AUTHORS, mutations }); + }); + let optimisticUpdate = jest.spyOn(init.mutations.createAuthor, "optimisticUpdate"); + let update = jest.spyOn(init.mutations.createAuthor, "update"); + let bindings = createBindings(client, () => {}, init); let props = bindings.getState(); expect(typeof props.createAuthor).toBe("function"); await bindings.load(); - let variables = { name: "Peter" }; - + let variables = { input: { name: "marge" } }; let { data } = await mockQueryRequest(CREATE_AUTHOR, variables); - let { authors } = bindings.getState(); - let createAuthorPromise = props.createAuthor(variables); expect(optimisticUpdate).toHaveBeenCalledWith({ authors }, variables); @@ -402,8 +326,10 @@ describe("@grafoo/bindings", () => { it("should update if query objects has less keys then nextObjects", async () => { let { - data: { createAuthor: author } - } = await mockQueryRequest(CREATE_AUTHOR, { name: "gustav" }); + data: { createAuthor } + } = await mockQueryRequest(CREATE_AUTHOR, { + input: { name: "flanders" } + }); let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); @@ -415,17 +341,19 @@ describe("@grafoo/bindings", () => { mutations: { removeAuthor: { query: DELETE_AUTHOR, - optimisticUpdate: ({ authors }, { id }) => ({ - authors: authors.filter((author) => author.id !== id) + optimisticUpdate: ({ authors }, { input: { id } }) => ({ + authors: { + edges: authors.edges.filter((author) => author.node.id !== id) + } }) } } }); let { removeAuthor } = bindings.getState(); + let variables = { input: { id: createAuthor.author.id } }; - let variables = { id: author.id }; - + await mockQueryRequest(DELETE_AUTHOR, variables); await removeAuthor(variables); expect(renderFn).toHaveBeenCalled(); @@ -433,31 +361,34 @@ describe("@grafoo/bindings", () => { it("should update if query objects is modified", async () => { let { - data: { createAuthor: author } - } = await mockQueryRequest(CREATE_AUTHOR, { name: "sven" }); + data: { createAuthor } + } = await mockQueryRequest(CREATE_AUTHOR, { name: "milhouse" }); let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); - let mutations = { - updateAuthor: { - query: UPDATE_AUTHOR, - optimisticUpdate: ({ authors }, variables) => ({ - authors: authors.map((author) => (author.id === variables.id ? variables : author)) - }) + let init = makeGrafooConfig({ + query: AUTHORS, + mutations: { + updateAuthor: { + query: UPDATE_AUTHOR, + optimisticUpdate: ({ authors }, variables) => ({ + authors: { + edges: authors.edges.map((author) => + author.node.id === variables.input.id ? { node: variables.input } : author + ) + } + }) + } } - }; + }); let renderFn = jest.fn(); - - let bindings = createBindings(client, renderFn, { query: AUTHORS, mutations }); - + let bindings = createBindings(client, renderFn, init); let { updateAuthor } = bindings.getState(); - - let variables = { ...author, name: "johan" }; + let variables = { input: { ...createAuthor.author, name: "moe" } }; await mockQueryRequest(UPDATE_AUTHOR, variables); - await updateAuthor(variables); expect(renderFn).toHaveBeenCalled(); diff --git a/packages/bindings/package.json b/packages/bindings/package.json index 1694c062..c1ad9772 100644 --- a/packages/bindings/package.json +++ b/packages/bindings/package.json @@ -32,9 +32,8 @@ "transform": { "^.+\\.(ts|tsx|js)$": "/../../scripts/jest-setup.js" }, - "resolver": "/../../scripts/resolver.js", "transformIgnorePatterns": [ - "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob)/)" + "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob|data-uri-to-buffer|formdata-polyfill)/)" ] }, "dependencies": { diff --git a/packages/bindings/schema.graphql b/packages/bindings/schema.graphql index 8c99e2cc..26c7e6bf 100644 --- a/packages/bindings/schema.graphql +++ b/packages/bindings/schema.graphql @@ -1,28 +1,267 @@ type Query { - author(id: ID!): Author! - authors(from: Int, to: Int): [Author!]! - post(id: ID!): Post! - posts(from: Int, to: Int): [Post!]! -} + author(id: ID!): Author + authors( + """ + Returns the items in the list that come after the specified cursor. + """ + after: String -type Mutation { - createAuthor(name: String!): Author! - updateAuthor(id: ID!, name: String): Author! - deleteAuthor(id: ID!): Author! - createPost(title: String!, body: String!, author: ID!): Post! - updatePost(id: ID!, title: String, body: String): Post! - deletePost(id: ID!): Post! + """ + Returns the first n items from the list. + """ + first: Int + + """ + Returns the items in the list that come before the specified cursor. + """ + before: String + + """ + Returns the last n items from the list. + """ + last: Int + ): AuthorConnection + post(id: ID!): Post + posts( + """ + Returns the items in the list that come after the specified cursor. + """ + after: String + + """ + Returns the first n items from the list. + """ + first: Int + + """ + Returns the items in the list that come before the specified cursor. + """ + before: String + + """ + Returns the last n items from the list. + """ + last: Int + ): PostConnection + + """ + Fetches an object given its ID + """ + node( + """ + The ID of an object + """ + id: ID! + ): Node } -type Author { +type Author implements Node { + """ + The ID of an object + """ id: ID! name: String! - posts(from: Int, to: Int): [Post!] + bio: String + posts( + """ + Returns the items in the list that come after the specified cursor. + """ + after: String + + """ + Returns the first n items from the list. + """ + first: Int + + """ + Returns the items in the list that come before the specified cursor. + """ + before: String + + """ + Returns the last n items from the list. + """ + last: Int + ): PostConnection +} + +""" +An object with an ID +""" +interface Node { + """ + The id of the object. + """ + id: ID! +} + +""" +A connection to a list of items. +""" +type PostConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [PostEdge] +} + +""" +Information about pagination in a connection. +""" +type PageInfo { + """ + When paginating forwards, are there more items? + """ + hasNextPage: Boolean! + + """ + When paginating backwards, are there more items? + """ + hasPreviousPage: Boolean! + + """ + When paginating backwards, the cursor to continue. + """ + startCursor: String + + """ + When paginating forwards, the cursor to continue. + """ + endCursor: String +} + +""" +An edge in a connection. +""" +type PostEdge { + """ + The item at the end of the edge + """ + node: Post + + """ + A cursor for use in pagination + """ + cursor: String! } -type Post { +type Post implements Node { + """ + The ID of an object + """ id: ID! title: String! body: String! author: Author! } + +""" +A connection to a list of items. +""" +type AuthorConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [AuthorEdge] +} + +""" +An edge in a connection. +""" +type AuthorEdge { + """ + The item at the end of the edge + """ + node: Author + + """ + A cursor for use in pagination + """ + cursor: String! +} + +type Mutation { + createAuthor(input: CreateAuthorInput!): CreateAuthorPayload + updateAuthor(input: UpdateAuthorInput!): UpdateAuthorPayload + deleteAuthor(input: DeleteAuthorInput!): DeleteAuthorPayload + createPost(input: CreatePostInput!): CreatePostPayload + updatePost(input: UpdatePostInput!): UpdatePostPayload + deletePost(input: DeletePostInput!): DeletePostPayload +} + +type CreateAuthorPayload { + author: Author + clientMutationId: String +} + +input CreateAuthorInput { + name: String! + bio: String + clientMutationId: String +} + +type UpdateAuthorPayload { + author: Author + clientMutationId: String +} + +input UpdateAuthorInput { + id: ID + name: String + bio: String + clientMutationId: String +} + +type DeleteAuthorPayload { + author: Author + clientMutationId: String +} + +input DeleteAuthorInput { + id: ID! + clientMutationId: String +} + +type CreatePostPayload { + post: Post + clientMutationId: String +} + +input CreatePostInput { + title: String! + body: String + authorId: ID! + clientMutationId: String +} + +type UpdatePostPayload { + post: Post + clientMutationId: String +} + +input UpdatePostInput { + id: ID! + title: String + body: String + clientMutationId: String +} + +type DeletePostPayload { + post: Post + clientMutationId: String +} + +input DeletePostInput { + id: ID! + clientMutationId: String +} diff --git a/packages/bindings/src/bindings.ts b/packages/bindings/src/bindings.ts index 37650539..36e13973 100644 --- a/packages/bindings/src/bindings.ts +++ b/packages/bindings/src/bindings.ts @@ -16,11 +16,11 @@ export default function createBindings< props: GrafooConsumerProps ) { type CP = GrafooConsumerProps; - let { query, variables, mutations, skip } = props; + let { query, variables, mutations, skip = false } = props; let data: CP["query"]["_queryType"]; let errors: GraphQlError[]; let boundMutations = {} as GrafooBoundMutations; - let records: GrafooRecords; + let records: GrafooRecords = {}; let partial = false; let unbind = () => {}; let preventListenUpdate = true; @@ -68,11 +68,15 @@ export default function createBindings< } } - let state = { loaded: !!data && !partial, loading: !!query || !data || skip }; + let state = { loaded: hasData(), loading: !!query && !skip && !hasData() }; + + function hasData() { + return !!Object.keys(data ?? {}).length && !partial; + } function getUpdateFromClient() { ({ data, partial } = client.read(query, variables)); - Object.assign(state, { loaded: !!data && !partial }); + Object.assign(state, { loaded: hasData() }); updater(getState()); } diff --git a/packages/bindings/src/types.ts b/packages/bindings/src/types.ts index 91886be1..e3dd0b66 100644 --- a/packages/bindings/src/types.ts +++ b/packages/bindings/src/types.ts @@ -1,5 +1,9 @@ import { GraphQlError, GraphQlPayload, GrafooQuery } from "@grafoo/core"; +type DeepPartial = { + [P in keyof T]?: DeepPartial; +}; + export type GrafooBoundMutations> = { [U in keyof T]: ( variables: T[U]["_variablesType"] @@ -18,8 +22,11 @@ export type GrafooBoundState< export type GrafooMutation = { query: U; - update?: (props: T["_queryType"], data: U["_queryType"]) => T["_queryType"]; - optimisticUpdate?: (props: T["_queryType"], variables: U["_variablesType"]) => T["_queryType"]; + update?: (props: T["_queryType"], data: U["_queryType"]) => DeepPartial; + optimisticUpdate?: ( + props: T["_queryType"], + variables: U["_variablesType"] + ) => DeepPartial; }; export type GrafooMutations> = { diff --git a/packages/test-utils/src/mock-server.ts b/packages/test-utils/src/mock-server.ts index 9261776d..676dcbb4 100644 --- a/packages/test-utils/src/mock-server.ts +++ b/packages/test-utils/src/mock-server.ts @@ -165,7 +165,8 @@ let deleteAuthor = mutationWithClientMutationId({ } }, mutateAndGetPayload: (args) => { - let author = db.data.authors.find(args); + let { id } = fromGlobalId(args.id); + let author = db.data.authors.find((a) => a.id === id); db.data.authors = db.data.authors.filter((a) => a.id !== author.id); db.data.posts = db.data.posts.filter((p) => p.author !== author.id); db.write(); From ef5d941f1c90ff00772202ba7d75d3ced64016ac Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Mon, 22 Nov 2021 20:34:43 -0300 Subject: [PATCH 33/49] Fix tests on core and bindings --- packages/bindings/.babelrc.json | 22 --- packages/bindings/__tests__/index.ts | 230 ++++++++-------------- packages/bindings/__tests__/queries.ts | 116 +++++++++++ packages/bindings/babel.config.js | 4 + packages/bindings/package.json | 5 +- packages/bindings/src/bindings.ts | 33 +--- packages/core/__tests__/index.ts | 137 ++----------- packages/core/__tests__/queries.ts | 118 +++++++++++ packages/core/__tests__/resolve-values.ts | 20 +- packages/core/__tests__/store-values.ts | 21 +- packages/core/package.json | 3 +- packages/core/src/client.ts | 28 ++- packages/core/src/resolve-values.ts | 5 +- packages/core/src/store-values.ts | 16 +- packages/core/src/types.ts | 2 +- packages/core/src/util.ts | 22 +++ packages/react/src/index.ts | 3 +- packages/test-utils/src/mock-server.ts | 3 +- 18 files changed, 412 insertions(+), 376 deletions(-) delete mode 100644 packages/bindings/.babelrc.json create mode 100644 packages/bindings/__tests__/queries.ts create mode 100644 packages/bindings/babel.config.js create mode 100644 packages/core/__tests__/queries.ts diff --git a/packages/bindings/.babelrc.json b/packages/bindings/.babelrc.json deleted file mode 100644 index c8010361..00000000 --- a/packages/bindings/.babelrc.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "presets": [ - [ - "@babel/preset-env", - { - "targets": { - "node": "current" - } - } - ], - "@babel/preset-typescript" - ], - "plugins": [ - [ - "module:@grafoo/babel-plugin", - { - "schema": "schema.graphql", - "idFields": ["id"] - } - ] - ] -} diff --git a/packages/bindings/__tests__/index.ts b/packages/bindings/__tests__/index.ts index 04ce2e94..26425fbe 100644 --- a/packages/bindings/__tests__/index.ts +++ b/packages/bindings/__tests__/index.ts @@ -1,116 +1,17 @@ import createBindings, { makeGrafooConfig } from "../src"; -import graphql from "@grafoo/core/tag"; import createClient, { GrafooClient } from "@grafoo/core"; +import { mockQueryRequest, createTransport } from "@grafoo/test-utils"; import { - mockQueryRequest, - createTransport, - Query, - Mutation, - CreateAuthorInput, - DeleteAuthorInput, - UpdateAuthorInput -} from "@grafoo/test-utils"; - -type AuthorsQuery = Pick; - -let AUTHORS = graphql` - query { - authors { - edges { - node { - name - posts { - edges { - node { - body - title - } - } - } - } - } - } - } -`; - -type PostsAndAuthorsQuery = Pick; - -let POSTS_AND_AUTHORS = graphql` - query { - posts { - edges { - node { - title - body - author { - name - } - } - } - } - - authors { - edges { - node { - name - posts { - edges { - node { - body - title - } - } - } - } - } - } - } -`; - -type CreateAuthorMutation = Pick; -type CreateAuthorMutationVariables = { - input: CreateAuthorInput; -}; - -let CREATE_AUTHOR = graphql` - mutation ($input: CreateAuthorInput!) { - createAuthor(input: $input) { - author { - name - } - } - } -`; - -type DeleteAuthorMutation = Pick; -type DeleteAuthorMutationVariables = { - input: DeleteAuthorInput; -}; - -let DELETE_AUTHOR = graphql` - mutation ($input: DeleteAuthorInput!) { - deleteAuthor(input: $input) { - author { - name - } - } - } -`; - -type UpdateAuthorMutation = Pick; -type UpdateAuthorMutationVariables = { - input: UpdateAuthorInput; -}; - -let UPDATE_AUTHOR = graphql` - mutation ($input: UpdateAuthorInput!) { - updateAuthor { - author { - name - } - } - } -`; + AUTHOR, + AUTHORS, + AuthorsQuery, + CREATE_AUTHOR, + CreateAuthorMutation, + DELETE_AUTHOR, + DeleteAuthorMutation, + POSTS_AND_AUTHORS, + UPDATE_AUTHOR +} from "./queries"; describe("@grafoo/bindings", () => { let client: GrafooClient; @@ -324,7 +225,7 @@ describe("@grafoo/bindings", () => { expect(update).toHaveBeenCalledWith({ authors: modifiedAuthors }, data); }); - it("should update if query objects has less keys then nextObjects", async () => { + it("should update if query records has less keys then nextRecords", async () => { let { data: { createAuthor } } = await mockQueryRequest(CREATE_AUTHOR, { @@ -362,7 +263,9 @@ describe("@grafoo/bindings", () => { it("should update if query objects is modified", async () => { let { data: { createAuthor } - } = await mockQueryRequest(CREATE_AUTHOR, { name: "milhouse" }); + } = await mockQueryRequest(CREATE_AUTHOR, { + input: { name: "milhouse" } + }); let { data } = await mockQueryRequest(AUTHORS); client.write(AUTHORS, data); @@ -375,7 +278,9 @@ describe("@grafoo/bindings", () => { optimisticUpdate: ({ authors }, variables) => ({ authors: { edges: authors.edges.map((author) => - author.node.id === variables.input.id ? { node: variables.input } : author + author.node.id === variables.input.id + ? { node: { ...author.node, ...variables.input } } + : author ) } }) @@ -412,48 +317,67 @@ describe("@grafoo/bindings", () => { let authors = await mockQueryRequest(AUTHORS); client.write(AUTHORS, authors.data); - let mutations = { - createAuthor: { - query: CREATE_AUTHOR, - optimisticUpdate: ({ authors }, variables: Author) => ({ - authors: [{ ...variables, id: "tempID" }, ...authors] - }), - update: ({ authors }, data: CreateAuthorMutation) => ({ - authors: authors.map((author) => (author.id === "tempID" ? data.createAuthor : author)) - }) - }, - updateAuthor: { - query: UPDATE_AUTHOR, - optimisticUpdate: ({ authors }, variables: Author) => ({ - authors: authors.map((author) => (author.id === variables.id ? variables : author)) - }) - }, - deleteAuthor: { - query: DELETE_AUTHOR, - optimisticUpdate: ({ authors }, variables: Author) => ({ - authors: authors.map((author) => (author.id === variables.id ? variables : author)) - }) + let init = makeGrafooConfig({ + query: AUTHORS, + mutations: { + createAuthor: { + query: CREATE_AUTHOR, + optimisticUpdate: ({ authors }, variables) => ({ + authors: { + edges: [{ node: { ...variables.input, id: "tempID" } }, ...authors.edges] + } + }), + update: ({ authors }, data) => ({ + authors: { + edges: authors.edges.map((author) => + author.node.id === "tempID" + ? { node: { ...author.node, ...data.createAuthor.author } } + : author + ) + } + }) + }, + updateAuthor: { + query: UPDATE_AUTHOR, + optimisticUpdate: ({ authors }, variables) => ({ + authors: { + edges: authors.edges.map((author) => + author.node.id === variables.input.id + ? { node: { ...author.node, ...variables.input } } + : author + ) + } + }) + }, + deleteAuthor: { + query: DELETE_AUTHOR, + optimisticUpdate: ({ authors }, variables) => ({ + authors: { + edges: authors.edges.filter((author) => author.node.id !== variables.input.id) + } + }) + } } - }; + }); let renderFn = jest.fn(); - let bindings = createBindings(client, renderFn, { query: AUTHORS, mutations }); + let bindings = createBindings(client, renderFn, init); let props = bindings.getState(); - let variables = { name: "mikel" }; - let { data } = await mockQueryRequest(CREATE_AUTHOR, variables); - expect(await mockQueryRequest(CREATE_AUTHOR, variables)).toEqual( - await props.createAuthor(variables) + let createVariables = { input: { name: "crusty" } }; + let { data } = await mockQueryRequest(CREATE_AUTHOR, createVariables); + expect(await mockQueryRequest(CREATE_AUTHOR, createVariables)).toEqual( + await props.createAuthor(createVariables) ); - variables = { ...data.createAuthor, name: "miguel" }; - expect(await mockQueryRequest(UPDATE_AUTHOR, variables)).toEqual( - await props.updateAuthor(variables) + let updateVariables = { input: { ...data.createAuthor.author, name: "lisa" } }; + expect(await mockQueryRequest(UPDATE_AUTHOR, updateVariables)).toEqual( + await props.updateAuthor(updateVariables) ); - variables = data.createAuthor; - expect(await mockQueryRequest(DELETE_AUTHOR, variables)).toEqual( - await props.deleteAuthor(data.createAuthor) + let deleteVariables = { input: { id: data.createAuthor.author.id } }; + expect(await mockQueryRequest(DELETE_AUTHOR, deleteVariables)).toEqual( + await props.deleteAuthor(deleteVariables) ); }); @@ -462,20 +386,20 @@ describe("@grafoo/bindings", () => { data: { authors } } = await mockQueryRequest(AUTHORS); - let [author1, author2] = authors; - let author1Variables = { id: author1.id }; - let author2Variables = { id: author2.id }; + let [author1, author2] = authors.edges; + let author1Variables = { id: author1.node.id }; + let author2Variables = { id: author2.node.id }; let bindings = createBindings(client, () => {}, { query: AUTHOR, variables: author1Variables }); await mockQueryRequest(AUTHOR, author1Variables); await bindings.load(); - expect(bindings.getState().author).toEqual(author1); - expect(client.read(AUTHOR, author1Variables).data.author).toEqual(author1); + expect(bindings.getState().author).toEqual(author1.node); + expect(client.read(AUTHOR, author1Variables).data.author).toEqual(author1.node); await mockQueryRequest(AUTHOR, author2Variables); await bindings.load(author2Variables); - expect(bindings.getState().author).toEqual(author2); - expect(client.read(AUTHOR, author2Variables).data.author).toEqual(author2); + expect(bindings.getState().author).toEqual(author2.node); + expect(client.read(AUTHOR, author2Variables).data.author).toEqual(author2.node); }); }); diff --git a/packages/bindings/__tests__/queries.ts b/packages/bindings/__tests__/queries.ts new file mode 100644 index 00000000..3ed52c02 --- /dev/null +++ b/packages/bindings/__tests__/queries.ts @@ -0,0 +1,116 @@ +import graphql from "@grafoo/core/tag"; +import { + CreateAuthorInput, + DeleteAuthorInput, + Mutation, + Query, + UpdateAuthorInput +} from "@grafoo/test-utils"; + +export type AuthorQuery = Pick; +export type AuthorQueryVariables = { id: string }; +export let AUTHOR = graphql` + query ($id: ID!) { + author(id: $id) { + name + posts { + edges { + node { + body + title + } + } + } + } + } +`; + +export type AuthorsQuery = Pick; +export let AUTHORS = graphql` + query { + authors { + edges { + node { + name + posts { + edges { + node { + body + title + } + } + } + } + } + } + } +`; + +export type PostsAndAuthorsQuery = Pick; +export let POSTS_AND_AUTHORS = graphql` + query { + posts { + edges { + node { + title + body + author { + name + } + } + } + } + + authors { + edges { + node { + name + posts { + edges { + node { + body + title + } + } + } + } + } + } + } +`; + +export type CreateAuthorMutation = Pick; +export type CreateAuthorMutationVariables = { input: CreateAuthorInput }; +export let CREATE_AUTHOR = graphql` + mutation ($input: CreateAuthorInput!) { + createAuthor(input: $input) { + author { + name + } + } + } +`; + +export type DeleteAuthorMutation = Pick; +export type DeleteAuthorMutationVariables = { input: DeleteAuthorInput }; +export let DELETE_AUTHOR = graphql` + mutation ($input: DeleteAuthorInput!) { + deleteAuthor(input: $input) { + author { + name + } + } + } +`; + +export type UpdateAuthorMutation = Pick; +export type UpdateAuthorMutationVariables = { input: UpdateAuthorInput }; +export let UPDATE_AUTHOR = graphql` + mutation ($input: UpdateAuthorInput!) { + updateAuthor(input: $input) { + author { + name + } + } + } +`; diff --git a/packages/bindings/babel.config.js b/packages/bindings/babel.config.js new file mode 100644 index 00000000..6be757f0 --- /dev/null +++ b/packages/bindings/babel.config.js @@ -0,0 +1,4 @@ +module.exports = { + presets: [["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-typescript"], + plugins: [["module:@grafoo/babel-plugin", { schema: "schema.graphql", idFields: ["id"] }]] +}; diff --git a/packages/bindings/package.json b/packages/bindings/package.json index c1ad9772..d9da4ab2 100644 --- a/packages/bindings/package.json +++ b/packages/bindings/package.json @@ -30,10 +30,13 @@ }, "jest": { "transform": { - "^.+\\.(ts|tsx|js)$": "/../../scripts/jest-setup.js" + "^.+\\.(ts|tsx|js)$": "babel-jest" }, "transformIgnorePatterns": [ "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob|data-uri-to-buffer|formdata-polyfill)/)" + ], + "modulePathIgnorePatterns": [ + "/__tests__/queries.ts" ] }, "dependencies": { diff --git a/packages/bindings/src/bindings.ts b/packages/bindings/src/bindings.ts index 36e13973..bc90ecdb 100644 --- a/packages/bindings/src/bindings.ts +++ b/packages/bindings/src/bindings.ts @@ -1,4 +1,4 @@ -import { GrafooClient, GrafooRecords, GraphQlError, GrafooQuery } from "@grafoo/core"; +import { GrafooClient, GraphQlError, GrafooQuery } from "@grafoo/core"; import { GrafooBoundMutations, GrafooBoundState, GrafooConsumerProps } from "./types"; export let makeGrafooConfig = >( @@ -19,35 +19,20 @@ export default function createBindings< let { query, variables, mutations, skip = false } = props; let data: CP["query"]["_queryType"]; let errors: GraphQlError[]; - let boundMutations = {} as GrafooBoundMutations; - let records: GrafooRecords = {}; - let partial = false; + let partial = true; let unbind = () => {}; - let preventListenUpdate = true; if (query) { - ({ data, records, partial } = client.read(query, variables)); + ({ data, partial } = client.read(query, variables)); - unbind = client.listen((nextRecords) => { + unbind = client.listen((shouldUpdate) => { if (preventListenUpdate) return; - - for (let i in nextRecords) { - // record has been inserted - if (!(i in records)) return getUpdateFromClient(); - - for (let j in nextRecords[i]) { - // record has been updated - if (nextRecords[i][j] !== records[i][j]) return getUpdateFromClient(); - } - } - - for (let i in records) { - // record has been removed - if (!(i in nextRecords)) return getUpdateFromClient(); - } + if (shouldUpdate) getUpdateFromClient(); }); } + let boundMutations = {} as GrafooBoundMutations; + if (mutations) { for (let key in mutations) { let { update, optimisticUpdate, query: mutationQuery } = mutations[key]; @@ -68,7 +53,9 @@ export default function createBindings< } } - let state = { loaded: hasData(), loading: !!query && !skip && !hasData() }; + let shouldLoad = !!query && !skip && !hasData(); + let preventListenUpdate = shouldLoad; + let state = { loaded: hasData(), loading: shouldLoad }; function hasData() { return !!Object.keys(data ?? {}).length && !partial; diff --git a/packages/core/__tests__/index.ts b/packages/core/__tests__/index.ts index a31627d8..140067ea 100644 --- a/packages/core/__tests__/index.ts +++ b/packages/core/__tests__/index.ts @@ -1,123 +1,14 @@ -import graphql from "@grafoo/core/tag"; -import { executeQuery, Query, QueryPostArgs } from "@grafoo/test-utils"; +import { executeQuery } from "@grafoo/test-utils"; import createClient from "../src"; import { GrafooClient } from "../src/types"; - -type AuthorsQuery = Pick; - -let AUTHORS = graphql` - query { - authors { - edges { - node { - name - posts { - edges { - node { - body - title - } - } - } - } - } - } - } -`; - -let SIMPLE_AUTHORS = graphql` - query { - authors { - edges { - node { - name - } - } - } - } -`; - -type PostsAndAuthorsQuery = Pick; - -let POSTS_AND_AUTHORS = graphql` - query { - posts { - edges { - node { - title - body - author { - name - } - } - } - } - - authors { - edges { - node { - name - posts { - edges { - node { - body - title - } - } - } - } - } - } - } -`; - -type PostQuery = Pick; - -let POST = graphql` - query ($id: ID!) { - post(id: $id) { - title - body - author { - name - } - } - } -`; - -let POST_WITH_FRAGMENT = graphql` - query ($id: ID!) { - post(id: $id) { - title - body - author { - ...AuthorInfo - } - } - } - - fragment AuthorInfo on Author { - name - } -`; - -type PostsQuery = Pick; - -let POSTS = graphql` - query { - posts { - edges { - node { - title - body - author { - name - } - } - } - } - } -`; +import { + AUTHORS, + POST, + POSTS, + POSTS_AND_AUTHORS, + POST_WITH_FRAGMENT, + SIMPLE_AUTHORS +} from "./queries"; function mockTransport(query: any, variables: any) { return executeQuery({ query, variables }); @@ -170,7 +61,7 @@ describe("@grafoo/core", () => { client.write(POSTS_AND_AUTHORS, data as any); expect(client.read(POSTS)).toMatchObject({ data, partial: false }); - expect(client.read(AUTHORS)).toEqual({ data: {}, records: {}, partial: true }); + expect(client.read(AUTHORS)).toEqual({ data: {}, partial: true }); }); it("should read queries from the client", async () => { @@ -183,10 +74,6 @@ describe("@grafoo/core", () => { let { authors } = data; expect(authors).toEqual(result.data.authors); - expect(authors.edges.every((a) => Boolean(result.records[a.node.id]))).toBe(true); - expect( - authors.edges.every((a) => a.node.posts.edges.every((p) => !!result.records[p.node.id])) - ).toBe(true); }); it("should handle queries with variables", async () => { @@ -280,7 +167,7 @@ describe("@grafoo/core", () => { }); }); - it("should call client listeners on write with paths records as arguments", async () => { + it("should call client listeners on write with a boolean shouldUpdate as arguments", async () => { let variables = { id: "UG9zdDoyYzk2OWNlNy0wMmFlLTQyYjEtYTk0ZC03ZDBhMzg4MDRjODU=" }; let { data } = await client.execute(POST, variables); @@ -292,7 +179,7 @@ describe("@grafoo/core", () => { client.write(POST, variables, data); - expect(listener).toHaveBeenCalledWith(client.read(POST, variables).records); + expect(listener).toHaveBeenCalledWith(true); unlisten(); client.write(POST, variables, data); diff --git a/packages/core/__tests__/queries.ts b/packages/core/__tests__/queries.ts new file mode 100644 index 00000000..9fc69d56 --- /dev/null +++ b/packages/core/__tests__/queries.ts @@ -0,0 +1,118 @@ +import graphql from "@grafoo/core/tag"; +import { Query, QueryPostArgs } from "@grafoo/test-utils"; + +export type AuthorsQuery = Pick; + +export let AUTHORS = graphql` + query { + authors { + edges { + node { + name + posts { + edges { + node { + body + title + } + } + } + } + } + } + } +`; + +export let SIMPLE_AUTHORS = graphql` + query { + authors { + edges { + node { + name + } + } + } + } +`; + +export type PostsAndAuthorsQuery = Pick; + +export let POSTS_AND_AUTHORS = graphql` + query { + posts { + edges { + node { + title + body + author { + name + } + } + } + } + + authors { + edges { + node { + name + posts { + edges { + node { + body + title + } + } + } + } + } + } + } +`; + +export type PostQuery = Pick; + +export let POST = graphql` + query ($id: ID!) { + post(id: $id) { + title + body + author { + name + } + } + } +`; + +export let POST_WITH_FRAGMENT = graphql` + query ($id: ID!) { + post(id: $id) { + title + body + author { + ...AuthorInfo + } + } + } + + fragment AuthorInfo on Author { + name + } +`; + +export type PostsQuery = Pick; + +export let POSTS = graphql` + query { + posts { + edges { + node { + title + body + author { + name + } + } + } + } + } +`; diff --git a/packages/core/__tests__/resolve-values.ts b/packages/core/__tests__/resolve-values.ts index 2555e667..350be4fe 100644 --- a/packages/core/__tests__/resolve-values.ts +++ b/packages/core/__tests__/resolve-values.ts @@ -40,10 +40,9 @@ describe("resolveValues", () => { it("should resolve the data given a simple query, a path and the records", () => { let query = POSTS_AND_AUTHORS; - let { data, records } = resolveValues(query, {}, postsAndAuthors.path, postsAndAuthors.records); + let { data } = resolveValues(query, {}, postsAndAuthors.path, postsAndAuthors.records); expect(data).toEqual(postsAndAuthors.data); - expect(records).toEqual(postsAndAuthors.records); }); it("should resolve the data given a query with fragments, a path and the records", () => { @@ -78,15 +77,9 @@ describe("resolveValues", () => { } `; - let { data, records } = resolveValues( - query, - {}, - postsWithFragments.path, - postsWithFragments.records - ); + let { data } = resolveValues(query, {}, postsWithFragments.path, postsWithFragments.records); expect(data).toEqual(postsWithFragments.data); - expect(records).toEqual(postsWithFragments.records); }); it("should resolve the data given a query with arguments, a path and the records", async () => { @@ -110,7 +103,7 @@ describe("resolveValues", () => { first: 1 }; - let { data, records } = resolveValues( + let { data } = resolveValues( query, variables, authorWithArguments.path, @@ -118,7 +111,6 @@ describe("resolveValues", () => { ); expect(data).toEqual(authorWithArguments.data); - expect(records).toEqual(authorWithArguments.records); }); it("should resolve the data given a query with fragments and arguments, a path and the records", () => { @@ -146,7 +138,7 @@ describe("resolveValues", () => { first: 1 }; - let { data, records } = resolveValues( + let { data } = resolveValues( query, variables, authorWithArguments.path, @@ -154,7 +146,6 @@ describe("resolveValues", () => { ); expect(data).toEqual(authorWithArguments.data); - expect(records).toEqual(authorWithArguments.records); }); it("should yield empty objects for data and records if no paths are given", () => { @@ -166,10 +157,9 @@ describe("resolveValues", () => { } `; - let { data, records, partial } = resolveValues(query, {}, {}, {}); + let { data, partial } = resolveValues(query, {}, {}, {}); expect(data).toEqual({}); - expect(records).toEqual({}); expect(partial).toEqual(true); }); diff --git a/packages/core/__tests__/store-values.ts b/packages/core/__tests__/store-values.ts index b2b1b698..3f5fa4b0 100644 --- a/packages/core/__tests__/store-values.ts +++ b/packages/core/__tests__/store-values.ts @@ -1,5 +1,4 @@ import graphql from "@grafoo/core/tag"; -import { GrafooPath, GrafooRecords } from "../src"; import storeValues from "../src/store-values"; import * as postsAndAuthors from "./data/posts-and-authors"; import * as postsWithFragments from "./data/posts-with-fragments"; @@ -42,18 +41,14 @@ let idFields = ["id"]; describe("storeValues", () => { it("should yield correct path and records to a normal query", () => { let query = POSTS_AND_AUTHORS; - let paths: GrafooPath = {}; - let records: GrafooRecords = {}; - storeValues(query, {}, postsAndAuthors.data, paths, records, idFields); + let { paths, records } = storeValues(query, {}, postsAndAuthors.data, idFields); expect(paths).toEqual(postsAndAuthors.path); expect(records).toEqual(postsAndAuthors.records); }); it("should yield correct path and records to queries with fragments", () => { - let paths: GrafooPath = {}; - let records: GrafooRecords = {}; let query = graphql` query { posts { @@ -85,15 +80,13 @@ describe("storeValues", () => { } `; - storeValues(query, {}, postsWithFragments.data, paths, records, idFields); + let { paths, records } = storeValues(query, {}, postsWithFragments.data, idFields); expect(paths).toEqual(postsWithFragments.path); expect(records).toEqual(postsWithFragments.records); }); it("should yield correct path and records to queries with arguments", () => { - let paths: GrafooPath = {}; - let records: GrafooRecords = {}; let query = graphql` query ($id: ID!, $first: Int!) { author(id: $id) { @@ -114,15 +107,13 @@ describe("storeValues", () => { first: 1 }; - storeValues(query, variables, authorWithArguments.data, paths, records, idFields); + let { paths, records } = storeValues(query, variables, authorWithArguments.data, idFields); expect(paths).toEqual(authorWithArguments.path); expect(records).toEqual(authorWithArguments.records); }); it("should yield correct path and records to queries with arguments and fragments", () => { - let paths: GrafooPath = {}; - let records: GrafooRecords = {}; let query = graphql` query ($id: ID!, $first: Int) { author(id: $id) { @@ -147,15 +138,13 @@ describe("storeValues", () => { first: 1 }; - storeValues(query, variables, authorWithArguments.data, paths, records, idFields); + let { paths, records } = storeValues(query, variables, authorWithArguments.data, idFields); expect(paths).toEqual(authorWithArguments.path); expect(records).toEqual(authorWithArguments.records); }); it("should deal correctly with null values", () => { - let paths: GrafooPath = {}; - let records: GrafooRecords = {}; let query = graphql` query { authors { @@ -172,7 +161,7 @@ describe("storeValues", () => { data.authors.edges[0].node.posts = null; - storeValues(query, {}, data, paths, records, idFields); + let { paths } = storeValues(query, {}, data, idFields); expect(paths).toEqual({ authors: { diff --git a/packages/core/package.json b/packages/core/package.json index 3ffe613d..a332cff2 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -36,7 +36,8 @@ "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob|data-uri-to-buffer|formdata-polyfill)/)" ], "modulePathIgnorePatterns": [ - "/__tests__/data" + "/__tests__/data", + "/__tests__/queries.ts" ] }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974" diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts index b9377ddb..3608fcae 100644 --- a/packages/core/src/client.ts +++ b/packages/core/src/client.ts @@ -9,6 +9,7 @@ import { GrafooRecords, GrafooTransport } from "./types"; +import { deepMerge } from "./util"; export default function createClient( transport: GrafooTransport, @@ -44,10 +45,33 @@ export default function createClient( variables = {}; } - let queryRecords = storeValues(query, variables, data, paths, records, idFields); + let result = storeValues(query, variables, data, idFields); // run listeners - for (let i in listeners) listeners[i](queryRecords); + for (let i in listeners) listeners[i](shouldUpdate(result.records)); + + // update paths and records + deepMerge(paths, result.paths); + deepMerge(records, result.records); + } + + function shouldUpdate(nextRecords: GrafooRecords) { + for (let i in nextRecords) { + // record has been inserted + if (!(i in records)) return true; + + for (let j in nextRecords[i]) { + // record has been updated + if (nextRecords[i][j] !== records[i][j]) return true; + } + } + + for (let i in records) { + // record has been removed + if (!(i in nextRecords)) return true; + } + + return false; } function read(query: T, variables?: T["_variablesType"]) { diff --git a/packages/core/src/resolve-values.ts b/packages/core/src/resolve-values.ts index 35963de1..f670d7dd 100644 --- a/packages/core/src/resolve-values.ts +++ b/packages/core/src/resolve-values.ts @@ -8,7 +8,6 @@ export default function resolveValues( allRecords: GrafooRecords ) { let data = {} as T["_queryType"]; - let records: GrafooRecords = {}; let partial = false; let stack: [string | void, GrafooSelection, GrafooPath<{ id?: string }>, T["_queryType"]][] = [ [undefined, operation, allPaths, data] @@ -31,8 +30,6 @@ export default function resolveValues( let { id } = path; let record = allRecords[id]; - if (id) records[id] = record; - for (let s of currentSelect.scalars) data[s] = record?.[s] ?? path?.[s]; for (let [k, v] of Object.entries(currentSelect.select)) { @@ -51,5 +48,5 @@ export default function resolveValues( } } - return { data, records, partial }; + return { data, partial }; } diff --git a/packages/core/src/store-values.ts b/packages/core/src/store-values.ts index 2db3037c..c1377951 100644 --- a/packages/core/src/store-values.ts +++ b/packages/core/src/store-values.ts @@ -5,13 +5,12 @@ export default function storeValues( { operation, fragments }: T, variables: T["_variablesType"], data: T["_queryType"], - allPaths: GrafooPath, - allRecords: GrafooRecords, idFields: string[] ) { let records: GrafooRecords = {}; + let paths: GrafooPath = {}; let stack: [string | void, T["_queryType"], GrafooSelection, GrafooPath][] = [ - [undefined, data, operation, allPaths] + [undefined, data, operation, paths] ]; // traverse data tree @@ -47,13 +46,10 @@ export default function storeValues( if (id) { // increment path with id pointing to a record path[pathId].id = id; + records[id] = records[id] ?? {}; - allRecords[id] = allRecords[id] ?? {}; - - // create record with branch scalar values - for (let field of currentSelect.scalars) allRecords[id][field] = branch[field]; - - records[id] = allRecords[id]; + // populate record with branch scalar values + for (let field of currentSelect.scalars) records[id][field] = branch[field]; } else { // add scalars to the path object if the node doesn't have id fields for (let field of currentSelect.scalars) path[pathId][field] = branch[field]; @@ -67,5 +63,5 @@ export default function storeValues( } } - return records; + return { paths, records }; } diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 4729a58e..2e168535 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -17,7 +17,7 @@ export type GrafooTransport = ( export type GrafooRecords = Record>; -export type GrafooListener = (objects: GrafooRecords) => void; +export type GrafooListener = (shouldUpdate: boolean) => void; export type GrafooInitialState = { records: GrafooRecords; diff --git a/packages/core/src/util.ts b/packages/core/src/util.ts index 604c96f1..ff82e821 100644 --- a/packages/core/src/util.ts +++ b/packages/core/src/util.ts @@ -56,3 +56,25 @@ export function resolveSelection( export function getPathType(path: GrafooPath) { return path ? (Array.isArray(path) ? [] : {}) : null; } + +export function isObject(item: any) { + return typeof item === "object" && !Array.isArray(item); +} + +export function deepMerge(target: any, ...sources: any[]) { + if (!sources.length) return target; + let source = sources.shift(); + + if (isObject(target) && isObject(source)) { + for (let key in source) { + if (isObject(source[key])) { + if (!target[key]) target[key] = {}; + deepMerge(target[key], source[key]); + } else { + target[key] = source[key]; + } + } + } + + return deepMerge(target, ...sources); +} diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 282557bf..ad26baec 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -28,8 +28,7 @@ export function useGrafoo { - if (props.query && !props.skip && !state.loaded) bindings.load(); - + if (state.loading) bindings.load(); return () => bindings.unbind(); }, []); diff --git a/packages/test-utils/src/mock-server.ts b/packages/test-utils/src/mock-server.ts index 676dcbb4..9e4ebca3 100644 --- a/packages/test-utils/src/mock-server.ts +++ b/packages/test-utils/src/mock-server.ts @@ -142,8 +142,9 @@ let updateAuthor = mutationWithClientMutationId({ } }, mutateAndGetPayload: (args) => { + let { id } = fromGlobalId(args.id); Object.assign( - db.data.authors.find((a) => a.id === args.id), + db.data.authors.find((a) => a.id === id), args ); db.write(); From 09bf664d9c0199dd397b7782b8a09d83acf749c8 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Mon, 22 Nov 2021 20:47:36 -0300 Subject: [PATCH 34/49] adds explicit type to createBindings --- packages/bindings/src/bindings.ts | 9 +++++++-- packages/bindings/src/types.ts | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/bindings/src/bindings.ts b/packages/bindings/src/bindings.ts index bc90ecdb..309027c3 100644 --- a/packages/bindings/src/bindings.ts +++ b/packages/bindings/src/bindings.ts @@ -1,5 +1,10 @@ import { GrafooClient, GraphQlError, GrafooQuery } from "@grafoo/core"; -import { GrafooBoundMutations, GrafooBoundState, GrafooConsumerProps } from "./types"; +import { + GrafooBindings, + GrafooBoundMutations, + GrafooBoundState, + GrafooConsumerProps +} from "./types"; export let makeGrafooConfig = >( init: GrafooConsumerProps @@ -14,7 +19,7 @@ export default function createBindings< client: GrafooClient, updater: (state: GrafooBoundState) => void, props: GrafooConsumerProps -) { +): GrafooBindings { type CP = GrafooConsumerProps; let { query, variables, mutations, skip = false } = props; let data: CP["query"]["_queryType"]; diff --git a/packages/bindings/src/types.ts b/packages/bindings/src/types.ts index e3dd0b66..78fa7eef 100644 --- a/packages/bindings/src/types.ts +++ b/packages/bindings/src/types.ts @@ -20,6 +20,12 @@ export type GrafooBoundState< errors?: GraphQlError[]; }; +export type GrafooBindings> = { + unbind: () => void; + getState: () => GrafooBoundState; + load: (variables?: T["_variablesType"]) => Promise; +}; + export type GrafooMutation = { query: U; update?: (props: T["_queryType"], data: U["_queryType"]) => DeepPartial; From bfdc254931435c3e969efb6d0bada2ce55b1630f Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Mon, 22 Nov 2021 22:45:24 -0300 Subject: [PATCH 35/49] fix all tests --- package.json | 1 - packages/babel-plugin/package.json | 3 +- packages/compiler/package.json | 3 +- packages/core/package.json | 2 +- packages/core/src/client.ts | 27 ++- packages/core/src/types.ts | 2 +- packages/react/.babelrc | 13 -- packages/react/__tests__/index.tsx | 186 +++++-------------- packages/react/__tests__/queries.ts | 116 ++++++++++++ packages/react/babel.config.js | 8 + packages/react/package.json | 8 +- packages/react/schema.graphql | 269 ++++++++++++++++++++++++++-- scripts/jest-setup.js | 11 -- scripts/resolver.js | 16 -- 14 files changed, 447 insertions(+), 218 deletions(-) delete mode 100644 packages/react/.babelrc create mode 100644 packages/react/__tests__/queries.ts create mode 100644 packages/react/babel.config.js delete mode 100644 scripts/jest-setup.js delete mode 100644 scripts/resolver.js diff --git a/package.json b/package.json index 93e069ac..c8d2e877 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,6 @@ "prettier": "^2.2.1", "react": "^17.0.2", "react-test-renderer": "^17.0.2", - "resolve.exports": "^1.1.0", "rimraf": "^3.0.2", "typescript": "^4.4.4", "uuid": "^8.3.2" diff --git a/packages/babel-plugin/package.json b/packages/babel-plugin/package.json index 48842a6d..2c2bd6a7 100644 --- a/packages/babel-plugin/package.json +++ b/packages/babel-plugin/package.json @@ -23,9 +23,8 @@ }, "jest": { "transform": { - "^.+\\.(ts|tsx|js)$": "/../../scripts/jest-setup.js" + "^.+\\.(ts|tsx|js)$": "babel-jest" }, - "resolver": "/../../scripts/resolver.js", "transformIgnorePatterns": [ "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob)/)" ] diff --git a/packages/compiler/package.json b/packages/compiler/package.json index 8a0a5c2d..a8995e05 100644 --- a/packages/compiler/package.json +++ b/packages/compiler/package.json @@ -22,9 +22,8 @@ }, "jest": { "transform": { - "^.+\\.(ts|tsx|js)$": "/../../scripts/jest-setup.js" + "^.+\\.(ts|tsx|js)$": "babel-jest" }, - "resolver": "/../../scripts/resolver.js", "transformIgnorePatterns": [ "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob)/)" ] diff --git a/packages/core/package.json b/packages/core/package.json index a332cff2..7ec966c7 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -25,7 +25,7 @@ "scripts": { "build": "microbundle", "watch": "microbundle watch", - "test": "jest --no-cache", + "test": "jest", "test:coverage": "jest --coverage" }, "jest": { diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts index 3608fcae..c59516b0 100644 --- a/packages/core/src/client.ts +++ b/packages/core/src/client.ts @@ -47,31 +47,28 @@ export default function createClient( let result = storeValues(query, variables, data, idFields); - // run listeners - for (let i in listeners) listeners[i](shouldUpdate(result.records)); - - // update paths and records - deepMerge(paths, result.paths); - deepMerge(records, result.records); - } - - function shouldUpdate(nextRecords: GrafooRecords) { - for (let i in nextRecords) { + let shouldUpdate = false; + for (let i in result.records) { // record has been inserted - if (!(i in records)) return true; + if (!(i in records)) shouldUpdate = true; - for (let j in nextRecords[i]) { + for (let j in result.records[i]) { // record has been updated - if (nextRecords[i][j] !== records[i][j]) return true; + if (result.records[i][j] !== records[i]?.[j]) shouldUpdate = true; } } for (let i in records) { // record has been removed - if (!(i in nextRecords)) return true; + if (!(i in result.records)) shouldUpdate = true; } - return false; + // update paths and records + deepMerge(paths, result.paths); + deepMerge(records, result.records); + + // run listeners + for (let i in listeners) listeners[i](shouldUpdate); } function read(query: T, variables?: T["_variablesType"]) { diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 2e168535..222a7095 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -57,7 +57,7 @@ export type GrafooClient = { read: ( query: T, variables?: T["_variablesType"] - ) => { data?: T["_queryType"]; records?: GrafooRecords; partial?: boolean }; + ) => { data: T["_queryType"]; partial: boolean }; listen: (listener: GrafooListener) => () => void; extract: () => GrafooInitialState; reset: () => void; diff --git a/packages/react/.babelrc b/packages/react/.babelrc deleted file mode 100644 index 8eac686b..00000000 --- a/packages/react/.babelrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "presets": [ - ["@babel/preset-env", { "targets": { "node": "current" } }], - "@babel/preset-react", - "@babel/preset-typescript" - ], - "plugins": [ - [ - "module:@grafoo/babel-plugin", - { "schema": "schema.graphql", "idFields": ["id"] } - ] - ] -} diff --git a/packages/react/__tests__/index.tsx b/packages/react/__tests__/index.tsx index e901f3b3..fe9279aa 100644 --- a/packages/react/__tests__/index.tsx +++ b/packages/react/__tests__/index.tsx @@ -4,122 +4,23 @@ import fetch from "node-fetch"; import * as React from "react"; -import graphql from "@grafoo/core/tag"; import createClient, { GrafooClient } from "@grafoo/core"; import { mockQueryRequest, createTransport } from "@grafoo/test-utils"; import { renderHook, act } from "@testing-library/react-hooks"; import { GrafooProvider, useGrafoo } from "../src"; +import { + AuthorsQuery, + PostsAndAuthorsQuery, + AUTHOR, + AUTHORS, + CREATE_AUTHOR, + POSTS_AND_AUTHORS +} from "./queries"; // @ts-ignore globalThis.fetch = fetch; -type Post = { - title: string; - content: string; - id: string; - __typename?: string; - author: Author; -}; - -type Author = { - name: string; - id: string; - __typename?: string; - posts?: Array; -}; - -type AuthorsQuery = { - authors: Author[]; -}; - -let AUTHORS = graphql` - query { - authors { - name - posts { - title - body - } - } - } -`; - -let SIMPLE_AUTHORS = graphql` - query { - authors { - name - } - } -`; - -type AuthorQuery = { - author: Author; -}; - -type AuthorQueryInput = { - id: string; -}; - -let AUTHOR = graphql` - query ($id: ID!) { - author(id: $id) { - name - } - } -`; - -type PostsQuery = { - posts: Post[]; -}; - -type PostsAndAuthorsQuery = AuthorsQuery & PostsQuery; - -let POSTS_AND_AUTHORS = graphql` - query { - posts { - title - body - author { - name - } - } - - authors { - name - posts { - title - body - } - } - } -`; - -type CreateAuthorMutation = { - createAuthor: { - name: string; - id: string; - __typename: string; - posts?: Array; - }; -}; - -type CreateAuthorInput = { - name: string; -}; - -let CREATE_AUTHOR = graphql` - mutation ($name: String!) { - createAuthor(name: $name) { - name - posts { - title - body - } - } - } -`; - describe("@grafoo/react", () => { let client: GrafooClient; let wrapper: React.FC; @@ -135,10 +36,10 @@ describe("@grafoo/react", () => { expect(() => renderHook(() => useGrafoo({}), { wrapper })).not.toThrow(); }); - it("should not fetch a query if lazy prop is set to true", async () => { + it("should not fetch a query if skip prop is set to true", async () => { let spy = jest.spyOn(window, "fetch"); - renderHook(() => useGrafoo({ query: AUTHORS, lazy: true }), { wrapper }); + renderHook(() => useGrafoo({ query: AUTHORS, skip: true }), { wrapper }); expect(spy).not.toHaveBeenCalled(); }); @@ -148,13 +49,13 @@ describe("@grafoo/react", () => { let spy = jest.spyOn(client, "listen"); - renderHook(() => useGrafoo({ query: AUTHORS, lazy: true }), { wrapper }); + renderHook(() => useGrafoo({ query: AUTHORS, skip: true }), { wrapper }); expect(spy).toHaveBeenCalled(); }); it("should execute render with default render argument", () => { - let { result } = renderHook(() => useGrafoo({ query: AUTHORS, lazy: true }), { wrapper }); + let { result } = renderHook(() => useGrafoo({ query: AUTHORS, skip: true }), { wrapper }); expect(result.current).toEqual({ loading: false, loaded: false }); }); @@ -170,20 +71,20 @@ describe("@grafoo/react", () => { expect(result.current).toEqual({ loading: false, loaded: true, ...data }); }); - it("should render if lazy changed value to false", async () => { + it("should render if skip changed value to false", async () => { let { data } = await mockQueryRequest(AUTHORS); - let { result, rerender, waitForNextUpdate } = renderHook<{ lazy: boolean }, any>( - ({ lazy }) => useGrafoo({ query: AUTHORS, lazy }), + let { result, rerender, waitForNextUpdate } = renderHook<{ skip: boolean }, any>( + ({ skip }) => useGrafoo({ query: AUTHORS, skip }), { wrapper, initialProps: { - lazy: true + skip: true } } ); expect(result.current).toEqual({ loading: false, loaded: false }); - rerender({ lazy: false }); + rerender({ skip: false }); expect(result.current).toEqual({ loading: true, loaded: false }); await waitForNextUpdate(); expect(result.current).toEqual({ loading: false, loaded: true, ...data }); @@ -192,29 +93,29 @@ describe("@grafoo/react", () => { it("should rerender if variables prop has changed", async () => { let { data: { authors } - } = await mockQueryRequest(SIMPLE_AUTHORS); - let author1 = authors[0]; - let author2 = authors[1]; + } = await mockQueryRequest(AUTHORS); + let author1 = authors.edges[0]; + let author2 = authors.edges[1]; - await mockQueryRequest(AUTHOR, { id: author1.id }); + await mockQueryRequest(AUTHOR, { id: author1.node.id }); let { result, rerender, waitForNextUpdate } = renderHook<{ id: string }, any>( ({ id }) => useGrafoo({ query: AUTHOR, variables: { id } }), { wrapper, initialProps: { - id: author1.id + id: author1.node.id } } ); expect(result.current).toEqual({ loading: true, loaded: false }); await waitForNextUpdate(); - expect(result.current).toEqual({ loading: false, loaded: true, author: author1 }); - await mockQueryRequest(AUTHOR, { id: author2.id }); - rerender({ id: author2.id }); - expect(result.current).toEqual({ loading: true, loaded: true, author: author1 }); + expect(result.current).toEqual({ loading: false, loaded: true, author: author1.node }); + await mockQueryRequest(AUTHOR, { id: author2.node.id }); + rerender({ id: author2.node.id }); + expect(result.current).toEqual({ loading: true, loaded: true, author: author1.node }); await waitForNextUpdate(); - expect(result.current).toEqual({ loading: false, loaded: true, author: author2 }); + expect(result.current).toEqual({ loading: false, loaded: true, author: author2.node }); }); it("should not try to load a query if it's already cached", async () => { @@ -230,7 +131,7 @@ describe("@grafoo/react", () => { }); it("should handle mutations", async () => { - let variables = { name: "Bart" }; + let variables = { input: { name: "Bart" } }; let data = await mockQueryRequest(CREATE_AUTHOR, variables); let { result } = renderHook( @@ -252,10 +153,16 @@ describe("@grafoo/react", () => { createAuthor: { query: CREATE_AUTHOR, optimisticUpdate: ({ authors }, variables) => ({ - authors: [...authors, { ...variables, id: "tempID" }] + authors: { + edges: [...authors.edges, { node: { ...variables.input, id: "tempID" } }] + } }), update: ({ authors }, data) => ({ - authors: authors.map((a) => (a.id === "tempID" ? data.createAuthor : a)) + authors: { + edges: authors.edges.map((p) => + p.node.id === "tempID" ? { node: data.createAuthor.author } : p + ) + } }) } } @@ -270,20 +177,20 @@ describe("@grafoo/react", () => { expect(result.current).toMatchObject({ loading: false, loaded: true, ...data }); - let variables = { name: "Homer" }; + let variables = { input: { name: "Homer" } }; await mockQueryRequest(CREATE_AUTHOR, variables); act(() => { result.current.createAuthor(variables); }); - expect(result.current.authors.length).toBe(data.authors.length + 1); - let newAuthor = result.current.authors.find((a) => a.id === "tempID"); - expect(newAuthor).toEqual({ name: "Homer", id: "tempID" }); + expect(result.current.authors.edges.length).toBe(data.authors.edges.length + 1); + let newAuthor = result.current.authors.edges.find((a) => a.node.id === "tempID"); + expect(newAuthor).toEqual({ node: { name: "Homer", id: "tempID" } }); await waitForNextUpdate(); - expect(result.current.authors.find((a) => a.id === "tempID")).toBeUndefined(); - expect(result.current.authors.find((a) => a.name === "Homer")).toBeTruthy(); + expect(result.current.authors.edges.find((a) => a.node.id === "tempID")).toBeUndefined(); + expect(result.current.authors.edges.find((a) => a.node.name === "Homer")).toBeTruthy(); }); it("should reflect updates that happen outside of the component", async () => { @@ -296,12 +203,15 @@ describe("@grafoo/react", () => { expect(result.current).toMatchObject({ loading: false, loaded: true, ...data }); act(() => { - client.write(AUTHORS, { - authors: data.authors.map((a, i) => (!i ? { ...a, name: "Lisa" } : a)) + let newAuthors: AuthorsQuery = JSON.parse(JSON.stringify(data)); + newAuthors.authors.edges.unshift({ + node: { name: "Lisa", id: "tempID" }, + cursor: "tempCursor" }); + client.write(AUTHORS, newAuthors); }); - expect(result.current.authors[0].name).toBe("Lisa"); + expect(result.current.authors.edges[0].node.name).toBe("Lisa"); }); it("should not try to fetch a query data if it's already cached", async () => { diff --git a/packages/react/__tests__/queries.ts b/packages/react/__tests__/queries.ts new file mode 100644 index 00000000..3ed52c02 --- /dev/null +++ b/packages/react/__tests__/queries.ts @@ -0,0 +1,116 @@ +import graphql from "@grafoo/core/tag"; +import { + CreateAuthorInput, + DeleteAuthorInput, + Mutation, + Query, + UpdateAuthorInput +} from "@grafoo/test-utils"; + +export type AuthorQuery = Pick; +export type AuthorQueryVariables = { id: string }; +export let AUTHOR = graphql` + query ($id: ID!) { + author(id: $id) { + name + posts { + edges { + node { + body + title + } + } + } + } + } +`; + +export type AuthorsQuery = Pick; +export let AUTHORS = graphql` + query { + authors { + edges { + node { + name + posts { + edges { + node { + body + title + } + } + } + } + } + } + } +`; + +export type PostsAndAuthorsQuery = Pick; +export let POSTS_AND_AUTHORS = graphql` + query { + posts { + edges { + node { + title + body + author { + name + } + } + } + } + + authors { + edges { + node { + name + posts { + edges { + node { + body + title + } + } + } + } + } + } + } +`; + +export type CreateAuthorMutation = Pick; +export type CreateAuthorMutationVariables = { input: CreateAuthorInput }; +export let CREATE_AUTHOR = graphql` + mutation ($input: CreateAuthorInput!) { + createAuthor(input: $input) { + author { + name + } + } + } +`; + +export type DeleteAuthorMutation = Pick; +export type DeleteAuthorMutationVariables = { input: DeleteAuthorInput }; +export let DELETE_AUTHOR = graphql` + mutation ($input: DeleteAuthorInput!) { + deleteAuthor(input: $input) { + author { + name + } + } + } +`; + +export type UpdateAuthorMutation = Pick; +export type UpdateAuthorMutationVariables = { input: UpdateAuthorInput }; +export let UPDATE_AUTHOR = graphql` + mutation ($input: UpdateAuthorInput!) { + updateAuthor(input: $input) { + author { + name + } + } + } +`; diff --git a/packages/react/babel.config.js b/packages/react/babel.config.js new file mode 100644 index 00000000..2396694d --- /dev/null +++ b/packages/react/babel.config.js @@ -0,0 +1,8 @@ +module.exports = { + presets: [ + ["@babel/preset-env", { targets: { node: "current" } }], + "@babel/preset-react", + "@babel/preset-typescript" + ], + plugins: [["module:@grafoo/babel-plugin", { schema: "schema.graphql", idFields: ["id"] }]] +}; diff --git a/packages/react/package.json b/packages/react/package.json index 0938e4f9..6166f89f 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -33,11 +33,13 @@ }, "jest": { "transform": { - "^.+\\.(ts|tsx|js)$": "/../../scripts/jest-setup.js" + "^.+\\.(ts|tsx|js)$": "babel-jest" }, - "resolver": "/../../scripts/resolver.js", "transformIgnorePatterns": [ - "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob)/)" + "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob|data-uri-to-buffer|formdata-polyfill)/)" + ], + "modulePathIgnorePatterns": [ + "/__tests__/queries.ts" ] }, "peerDependencies": { diff --git a/packages/react/schema.graphql b/packages/react/schema.graphql index 8c99e2cc..26c7e6bf 100644 --- a/packages/react/schema.graphql +++ b/packages/react/schema.graphql @@ -1,28 +1,267 @@ type Query { - author(id: ID!): Author! - authors(from: Int, to: Int): [Author!]! - post(id: ID!): Post! - posts(from: Int, to: Int): [Post!]! -} + author(id: ID!): Author + authors( + """ + Returns the items in the list that come after the specified cursor. + """ + after: String -type Mutation { - createAuthor(name: String!): Author! - updateAuthor(id: ID!, name: String): Author! - deleteAuthor(id: ID!): Author! - createPost(title: String!, body: String!, author: ID!): Post! - updatePost(id: ID!, title: String, body: String): Post! - deletePost(id: ID!): Post! + """ + Returns the first n items from the list. + """ + first: Int + + """ + Returns the items in the list that come before the specified cursor. + """ + before: String + + """ + Returns the last n items from the list. + """ + last: Int + ): AuthorConnection + post(id: ID!): Post + posts( + """ + Returns the items in the list that come after the specified cursor. + """ + after: String + + """ + Returns the first n items from the list. + """ + first: Int + + """ + Returns the items in the list that come before the specified cursor. + """ + before: String + + """ + Returns the last n items from the list. + """ + last: Int + ): PostConnection + + """ + Fetches an object given its ID + """ + node( + """ + The ID of an object + """ + id: ID! + ): Node } -type Author { +type Author implements Node { + """ + The ID of an object + """ id: ID! name: String! - posts(from: Int, to: Int): [Post!] + bio: String + posts( + """ + Returns the items in the list that come after the specified cursor. + """ + after: String + + """ + Returns the first n items from the list. + """ + first: Int + + """ + Returns the items in the list that come before the specified cursor. + """ + before: String + + """ + Returns the last n items from the list. + """ + last: Int + ): PostConnection +} + +""" +An object with an ID +""" +interface Node { + """ + The id of the object. + """ + id: ID! +} + +""" +A connection to a list of items. +""" +type PostConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [PostEdge] +} + +""" +Information about pagination in a connection. +""" +type PageInfo { + """ + When paginating forwards, are there more items? + """ + hasNextPage: Boolean! + + """ + When paginating backwards, are there more items? + """ + hasPreviousPage: Boolean! + + """ + When paginating backwards, the cursor to continue. + """ + startCursor: String + + """ + When paginating forwards, the cursor to continue. + """ + endCursor: String +} + +""" +An edge in a connection. +""" +type PostEdge { + """ + The item at the end of the edge + """ + node: Post + + """ + A cursor for use in pagination + """ + cursor: String! } -type Post { +type Post implements Node { + """ + The ID of an object + """ id: ID! title: String! body: String! author: Author! } + +""" +A connection to a list of items. +""" +type AuthorConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [AuthorEdge] +} + +""" +An edge in a connection. +""" +type AuthorEdge { + """ + The item at the end of the edge + """ + node: Author + + """ + A cursor for use in pagination + """ + cursor: String! +} + +type Mutation { + createAuthor(input: CreateAuthorInput!): CreateAuthorPayload + updateAuthor(input: UpdateAuthorInput!): UpdateAuthorPayload + deleteAuthor(input: DeleteAuthorInput!): DeleteAuthorPayload + createPost(input: CreatePostInput!): CreatePostPayload + updatePost(input: UpdatePostInput!): UpdatePostPayload + deletePost(input: DeletePostInput!): DeletePostPayload +} + +type CreateAuthorPayload { + author: Author + clientMutationId: String +} + +input CreateAuthorInput { + name: String! + bio: String + clientMutationId: String +} + +type UpdateAuthorPayload { + author: Author + clientMutationId: String +} + +input UpdateAuthorInput { + id: ID + name: String + bio: String + clientMutationId: String +} + +type DeleteAuthorPayload { + author: Author + clientMutationId: String +} + +input DeleteAuthorInput { + id: ID! + clientMutationId: String +} + +type CreatePostPayload { + post: Post + clientMutationId: String +} + +input CreatePostInput { + title: String! + body: String + authorId: ID! + clientMutationId: String +} + +type UpdatePostPayload { + post: Post + clientMutationId: String +} + +input UpdatePostInput { + id: ID! + title: String + body: String + clientMutationId: String +} + +type DeletePostPayload { + post: Post + clientMutationId: String +} + +input DeletePostInput { + id: ID! + clientMutationId: String +} diff --git a/scripts/jest-setup.js b/scripts/jest-setup.js deleted file mode 100644 index 41901888..00000000 --- a/scripts/jest-setup.js +++ /dev/null @@ -1,11 +0,0 @@ -let fs = require("fs"); -let path = require("path"); -let { transform } = require("@babel/core"); - -let config = Object.assign( - { sourceMap: "inline", ast: false }, - require(path.join(process.cwd(), ".babelrc.json")) -); - -module.exports.process = (src, path) => - transform(src, Object.assign({}, config, { filename: path })); diff --git a/scripts/resolver.js b/scripts/resolver.js deleted file mode 100644 index 027581e8..00000000 --- a/scripts/resolver.js +++ /dev/null @@ -1,16 +0,0 @@ -let { resolve } = require("resolve.exports"); - -module.exports = (request, options) => - options.defaultResolver(request, { - ...options, - packageFilter: (package) => { - try { - return { - ...package, - main: package.main || resolve(package, ".") - }; - } catch (e) { - return package; - } - } - }); From 7b5fac0cbd17feda544c64d3aa6998cf4063dd4e Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Mon, 22 Nov 2021 23:27:57 -0300 Subject: [PATCH 36/49] updates --- .../__tests__/__snapshots__/index.js.snap | 14 ++++++++------ packages/babel-plugin/src/index.ts | 4 +++- packages/compiler/package.json | 1 + yarn.lock | 7 +++++++ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/packages/babel-plugin/__tests__/__snapshots__/index.js.snap b/packages/babel-plugin/__tests__/__snapshots__/index.js.snap index 53e0bfe8..2038dbef 100644 --- a/packages/babel-plugin/__tests__/__snapshots__/index.js.snap +++ b/packages/babel-plugin/__tests__/__snapshots__/index.js.snap @@ -7,14 +7,16 @@ let query = gql\`{ authors {name} }\`; ↓ ↓ ↓ ↓ ↓ ↓ -import { gql } from "@grafoo/core"; -let query = gql\` - { - authors { - name +let query = { + document: "{authors{id name}}", + operation: { + select: { + authors: { + scalars: ["id", "name"] + } } } -\`; +}; `; diff --git a/packages/babel-plugin/src/index.ts b/packages/babel-plugin/src/index.ts index 2e22070a..c3761736 100644 --- a/packages/babel-plugin/src/index.ts +++ b/packages/babel-plugin/src/index.ts @@ -82,7 +82,9 @@ export default function transform({ types: t }: Babel): PluginObj<{ opts: Option if (source.value === "@grafoo/core") { let defaultSpecifier = specifiers.find((s) => t.isImportDefaultSpecifier(s)); - let gqlTag = specifiers.find((s) => s.local.name === "graphql"); + let gqlTag = specifiers.find( + (s) => s.local.name === "graphql" || s.local.name === "gql" + ); if (defaultSpecifier) { clientFactoryIdentifiers.push(defaultSpecifier.local.name); diff --git a/packages/compiler/package.json b/packages/compiler/package.json index a8995e05..8939035a 100644 --- a/packages/compiler/package.json +++ b/packages/compiler/package.json @@ -29,6 +29,7 @@ ] }, "dependencies": { + "@types/babel-plugin-macros": "^2.8.5", "crypto-js": "^4.0.0", "graphql": "^15.6.1", "graphql-query-compress": "^1.0.0" diff --git a/yarn.lock b/yarn.lock index d514d14f..6b63284f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2249,6 +2249,13 @@ resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA== +"@types/babel-plugin-macros@^2.8.5": + version "2.8.5" + resolved "https://registry.yarnpkg.com/@types/babel-plugin-macros/-/babel-plugin-macros-2.8.5.tgz#04474f9898aa9112afc22fa0e7e53a898fcaba4c" + integrity sha512-+NcIm/VBaSb4xaycov9f4Vmk4hMVPrgISoHEk+kalgVK6BlkwDZbXkW9kt1jCXVczTKXldL5RHIacExaWzxAkA== + dependencies: + "@types/babel__core" "*" + "@types/babel-plugin-tester@^9.0.0": version "9.0.4" resolved "https://registry.yarnpkg.com/@types/babel-plugin-tester/-/babel-plugin-tester-9.0.4.tgz#f5f9274149c6c789984f69ae4edbc383e33f679c" From 67f1256d74d44264acd3604a66d99418945bdc98 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Mon, 22 Nov 2021 23:33:57 -0300 Subject: [PATCH 37/49] updates --- packages/bindings/package.json | 2 +- packages/core/package.json | 2 +- packages/react/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/bindings/package.json b/packages/bindings/package.json index d9da4ab2..3e46a434 100644 --- a/packages/bindings/package.json +++ b/packages/bindings/package.json @@ -33,7 +33,7 @@ "^.+\\.(ts|tsx|js)$": "babel-jest" }, "transformIgnorePatterns": [ - "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob|data-uri-to-buffer|formdata-polyfill)/)" + "node_modules/(?!(lowdb|steno|fetch-mock|node-fetch|fetch-blob|data-uri-to-buffer|formdata-polyfill)/)" ], "modulePathIgnorePatterns": [ "/__tests__/queries.ts" diff --git a/packages/core/package.json b/packages/core/package.json index 7ec966c7..8ad452cf 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -33,7 +33,7 @@ "^.+\\.(ts|tsx|js)$": "babel-jest" }, "transformIgnorePatterns": [ - "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob|data-uri-to-buffer|formdata-polyfill)/)" + "node_modules/(?!(lowdb|steno|fetch-mock|node-fetch|fetch-blob|data-uri-to-buffer|formdata-polyfill)/)" ], "modulePathIgnorePatterns": [ "/__tests__/data", diff --git a/packages/react/package.json b/packages/react/package.json index 6166f89f..992f4034 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -36,7 +36,7 @@ "^.+\\.(ts|tsx|js)$": "babel-jest" }, "transformIgnorePatterns": [ - "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob|data-uri-to-buffer|formdata-polyfill)/)" + "node_modules/(?!(lowdb|steno|fetch-mock|node-fetch|fetch-blob|data-uri-to-buffer|formdata-polyfill)/)" ], "modulePathIgnorePatterns": [ "/__tests__/queries.ts" From ec437eb1fe6ada92585e435046f1e8885a099730 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Mon, 22 Nov 2021 23:41:52 -0300 Subject: [PATCH 38/49] fix build --- packages/bindings/babel.config.js | 11 ++++++++++- packages/core/babel.config.js | 13 ++++++++++--- packages/react/babel.config.js | 11 ++++++++++- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/packages/bindings/babel.config.js b/packages/bindings/babel.config.js index 6be757f0..09fe8b00 100644 --- a/packages/bindings/babel.config.js +++ b/packages/bindings/babel.config.js @@ -1,4 +1,13 @@ module.exports = { presets: [["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-typescript"], - plugins: [["module:@grafoo/babel-plugin", { schema: "schema.graphql", idFields: ["id"] }]] + env: { + test: { + plugins: [ + [ + "module:@grafoo/babel-plugin", + { schema: "schema.graphql", idFields: ["id", "__typename"] } + ] + ] + } + } }; diff --git a/packages/core/babel.config.js b/packages/core/babel.config.js index a4068631..09fe8b00 100644 --- a/packages/core/babel.config.js +++ b/packages/core/babel.config.js @@ -1,6 +1,13 @@ module.exports = { presets: [["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-typescript"], - plugins: [ - ["module:@grafoo/babel-plugin", { schema: "schema.graphql", idFields: ["id", "__typename"] }] - ] + env: { + test: { + plugins: [ + [ + "module:@grafoo/babel-plugin", + { schema: "schema.graphql", idFields: ["id", "__typename"] } + ] + ] + } + } }; diff --git a/packages/react/babel.config.js b/packages/react/babel.config.js index 2396694d..63d2a404 100644 --- a/packages/react/babel.config.js +++ b/packages/react/babel.config.js @@ -4,5 +4,14 @@ module.exports = { "@babel/preset-react", "@babel/preset-typescript" ], - plugins: [["module:@grafoo/babel-plugin", { schema: "schema.graphql", idFields: ["id"] }]] + env: { + test: { + plugins: [ + [ + "module:@grafoo/babel-plugin", + { schema: "schema.graphql", idFields: ["id", "__typename"] } + ] + ] + } + } }; From 2edb06fe54dd89a9dc4d7cdad8d384ad0d39e425 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Wed, 1 Dec 2021 22:45:42 -0300 Subject: [PATCH 39/49] adds tests for macro and rollup plugin --- packages/babel-plugin/.grafoorc.json | 5 + .../__tests__/__snapshots__/index.js.snap | 366 ----- packages/babel-plugin/__tests__/index.js | 225 --- packages/babel-plugin/__tests__/index.ts | 47 + .../{__tests__ => }/schema.graphql | 0 packages/babel-plugin/src/index.ts | 207 +-- packages/bindings/.grafoorc.json | 4 + packages/bindings/__tests__/index.ts | 2 +- packages/bindings/__tests__/queries.ts | 2 +- packages/bindings/babel.config.js | 7 +- packages/compiler/src/index.ts | 83 +- packages/core/.grafoorc.json | 4 + packages/core/__tests__/queries.ts | 2 +- packages/core/__tests__/resolve-values.ts | 2 +- packages/core/__tests__/store-values.ts | 2 +- packages/core/babel.config.js | 7 +- packages/core/src/client.ts | 9 +- packages/core/src/tag.ts | 9 +- packages/core/src/types.ts | 2 +- packages/core/tag.d.ts | 7 - packages/core/tag.js | 8 - packages/macro/.babelrc.json | 6 + packages/macro/.grafoorc.json | 5 + packages/macro/__tests__/index.ts | 36 + packages/macro/package.json | 14 +- packages/macro/schema.graphql | 63 + packages/macro/src/index.d.ts | 1 - packages/macro/src/index.ts | 78 +- packages/react/.grafoorc.json | 4 + packages/react/__tests__/queries.ts | 2 +- packages/react/babel.config.js | 7 +- packages/react/package.json | 4 +- packages/rollup-plugin/.babelrc.json | 6 + packages/rollup-plugin/.grafoorc.json | 5 + packages/rollup-plugin/__tests__/index.ts | 54 + packages/rollup-plugin/package.json | 37 + packages/rollup-plugin/rollup.config.js | 12 + packages/rollup-plugin/schema.graphql | 63 + packages/rollup-plugin/src/index.ts | 98 ++ packages/rollup-plugin/tsconfig.json | 15 + yarn.lock | 1326 ++++++++--------- 41 files changed, 1261 insertions(+), 1575 deletions(-) create mode 100644 packages/babel-plugin/.grafoorc.json delete mode 100644 packages/babel-plugin/__tests__/__snapshots__/index.js.snap delete mode 100644 packages/babel-plugin/__tests__/index.js create mode 100644 packages/babel-plugin/__tests__/index.ts rename packages/babel-plugin/{__tests__ => }/schema.graphql (100%) create mode 100644 packages/bindings/.grafoorc.json create mode 100644 packages/core/.grafoorc.json delete mode 100644 packages/core/tag.d.ts delete mode 100644 packages/core/tag.js create mode 100644 packages/macro/.babelrc.json create mode 100644 packages/macro/.grafoorc.json create mode 100644 packages/macro/__tests__/index.ts create mode 100644 packages/macro/schema.graphql delete mode 100644 packages/macro/src/index.d.ts create mode 100644 packages/react/.grafoorc.json create mode 100644 packages/rollup-plugin/.babelrc.json create mode 100644 packages/rollup-plugin/.grafoorc.json create mode 100644 packages/rollup-plugin/__tests__/index.ts create mode 100644 packages/rollup-plugin/package.json create mode 100644 packages/rollup-plugin/rollup.config.js create mode 100644 packages/rollup-plugin/schema.graphql create mode 100644 packages/rollup-plugin/src/index.ts create mode 100644 packages/rollup-plugin/tsconfig.json diff --git a/packages/babel-plugin/.grafoorc.json b/packages/babel-plugin/.grafoorc.json new file mode 100644 index 00000000..7f30f4ce --- /dev/null +++ b/packages/babel-plugin/.grafoorc.json @@ -0,0 +1,5 @@ +{ + "schema": "schema.graphql", + "idFields": ["id", "__typename"], + "compress": true +} diff --git a/packages/babel-plugin/__tests__/__snapshots__/index.js.snap b/packages/babel-plugin/__tests__/__snapshots__/index.js.snap deleted file mode 100644 index 2038dbef..00000000 --- a/packages/babel-plugin/__tests__/__snapshots__/index.js.snap +++ /dev/null @@ -1,366 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`@grafoo/babel-plugin should be able to use named import gql from @grafoo/core: should be able to use named import gql from @grafoo/core 1`] = ` - -import { gql } from "@grafoo/core"; -let query = gql\`{ authors {name} }\`; - - ↓ ↓ ↓ ↓ ↓ ↓ - -let query = { - document: "{authors{id name}}", - operation: { - select: { - authors: { - scalars: ["id", "name"] - } - } - } -}; - - -`; - -exports[`@grafoo/babel-plugin should be able to use named import graphql from @grafoo/core: should be able to use named import graphql from @grafoo/core 1`] = ` - -import { graphql } from "@grafoo/core"; -let query = graphql\`{ authors {name} }\`; - - ↓ ↓ ↓ ↓ ↓ ↓ - -let query = { - document: "{authors{id name}}", - operation: { - select: { - authors: { - scalars: ["id", "name"] - } - } - } -}; - - -`; - -exports[`@grafoo/babel-plugin should generate md5 hash and add it to object if the option generateIds is specified: should generate md5 hash and add it to object if the option generateIds is specified 1`] = ` - -import gql from "@grafoo/core/tag"; -let query = gql\` - query($start: Int!, $offset: Int!, $id: ID!) { - posts(start: $start, offset: $offset) { - title - body - createdAt - tags { name } - authors { name username } - } - user(id: $id) { name username } - } -\`; - - ↓ ↓ ↓ ↓ ↓ ↓ - -let query = { - document: - "query($id:ID!,$offset:Int!,$start:Int!){posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}user(id:$id){id name username}}", - operation: { - select: { - posts: { - args: { - offset: "$offset", - start: "$start" - }, - select: { - authors: { - scalars: ["id", "name"], - select: { - username: {} - } - }, - tags: { - scalars: ["id", "name"] - } - }, - scalars: ["body", "createdAt", "id", "title"] - }, - user: { - args: { - id: "$id" - }, - scalars: ["id", "username"], - select: { - name: {} - } - } - } - }, - id: "6e0697df8f2453f2643bbd1e8a39c348" -}; - - -`; - -exports[`@grafoo/babel-plugin should include \`idFields\` in the client instantiation even if options are provided: should include \`idFields\` in the client instantiation even if options are provided 1`] = ` - -import createClient from "@grafoo/core"; -let query = createClient(someTransport, { - headers: () => ({ authorization: "some-token" }) -}); - - ↓ ↓ ↓ ↓ ↓ ↓ - -import createClient from "@grafoo/core"; -let query = createClient(someTransport, { - headers: () => ({ - authorization: "some-token" - }), - idFields: ["id"] -}); - - -`; - -exports[`@grafoo/babel-plugin should include \`idFields\` in the client instantiation if not present in options: should include \`idFields\` in the client instantiation if not present in options 1`] = ` - -import createClient from "@grafoo/core"; -let query = createClient(someTransport, {}); - - ↓ ↓ ↓ ↓ ↓ ↓ - -import createClient from "@grafoo/core"; -let query = createClient(someTransport, { - idFields: ["id"] -}); - - -`; - -exports[`@grafoo/babel-plugin should include \`idFields\` in the client instantiation if options are not provided: should include \`idFields\` in the client instantiation if options are not provided 1`] = ` - -import createClient from "@grafoo/core"; -let query = createClient(someTransport); - - ↓ ↓ ↓ ↓ ↓ ↓ - -import createClient from "@grafoo/core"; -let query = createClient(someTransport, { - idFields: ["id"] -}); - - -`; - -exports[`@grafoo/babel-plugin should include \`idFields\` in the client instantiation if options is a variable: should include \`idFields\` in the client instantiation if options is a variable 1`] = ` - -import createClient from "@grafoo/core"; -let options = {}; -let query = createClient(someTransport, options); - - ↓ ↓ ↓ ↓ ↓ ↓ - -import createClient from "@grafoo/core"; -let options = { - idFields: ["id"] -}; -let query = createClient(someTransport, options); - - -`; - -exports[`@grafoo/babel-plugin should not compress a query if the option compress is specified: should not compress a query if the option compress is specified 1`] = ` - -import gql from "@grafoo/core/tag"; -let query = gql\` - query($start: Int!, $offset: Int!, $id: ID!) { - posts(start: $start, offset: $offset) { - title - body - createdAt - tags { name } - authors { name username } - } - user(id: $id) { name username } - } -\`; - - ↓ ↓ ↓ ↓ ↓ ↓ - -let query = { - document: - "query ($id: ID!, $offset: Int!, $start: Int!) {\\n posts(offset: $offset, start: $start) {\\n authors {\\n id\\n name\\n username\\n }\\n body\\n createdAt\\n id\\n tags {\\n id\\n name\\n }\\n title\\n }\\n user(id: $id) {\\n id\\n name\\n username\\n }\\n}\\n", - operation: { - select: { - posts: { - args: { - offset: "$offset", - start: "$start" - }, - select: { - authors: { - scalars: ["id", "name"], - select: { - username: {} - } - }, - tags: { - scalars: ["id", "name"] - } - }, - scalars: ["body", "createdAt", "id", "title"] - }, - user: { - args: { - id: "$id" - }, - scalars: ["id", "username"], - select: { - name: {} - } - } - } - } -}; - - -`; - -exports[`@grafoo/babel-plugin should not generate md5 hash and add it to object if the option generateIds is falsey: should not generate md5 hash and add it to object if the option generateIds is falsey 1`] = ` - -import gql from "@grafoo/core/tag"; -let query = gql\` - query($start: Int!, $offset: Int!, $id: ID!) { - posts(start: $start, offset: $offset) { - title - body - createdAt - tags { name } - authors { name username } - } - user(id: $id) { name username } - } -\`; - - ↓ ↓ ↓ ↓ ↓ ↓ - -let query = { - document: - "query($id:ID!,$offset:Int!,$start:Int!){posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}user(id:$id){id name username}}", - operation: { - select: { - posts: { - args: { - offset: "$offset", - start: "$start" - }, - select: { - authors: { - scalars: ["id", "name"], - select: { - username: {} - } - }, - tags: { - scalars: ["id", "name"] - } - }, - scalars: ["body", "createdAt", "id", "title"] - }, - user: { - args: { - id: "$id" - }, - scalars: ["id", "username"], - select: { - name: {} - } - } - } - } -}; - - -`; - -exports[`@grafoo/babel-plugin should overide \`idFields\` in the client instantiation if options is a variable: should overide \`idFields\` in the client instantiation if options is a variable 1`] = ` - -import createClient from "@grafoo/core"; -let options = { idFields: ["err"] }; -let query = createClient(someTransport, options); - - ↓ ↓ ↓ ↓ ↓ ↓ - -import createClient from "@grafoo/core"; -let options = { - idFields: ["id"] -}; -let query = createClient(someTransport, options); - - -`; - -exports[`@grafoo/babel-plugin should remove the imported path: should remove the imported path 1`] = ` - -import gql from "@grafoo/core/tag"; - - ↓ ↓ ↓ ↓ ↓ ↓ - - - -`; - -exports[`@grafoo/babel-plugin should replace a tagged template literal with the compiled grafoo object: should replace a tagged template literal with the compiled grafoo object 1`] = ` - -import gql from "@grafoo/core/tag"; -let query = gql\` - query($start: Int!, $offset: Int!, $id: ID!) { - posts(start: $start, offset: $offset) { - title - body - createdAt - tags { name } - authors { name username } - } - user(id: $id) { name username } - } -\`; - - ↓ ↓ ↓ ↓ ↓ ↓ - -let query = { - document: - "query($id:ID!,$offset:Int!,$start:Int!){posts(offset:$offset,start:$start){authors{id name username}body createdAt id tags{id name}title}user(id:$id){id name username}}", - operation: { - select: { - posts: { - args: { - offset: "$offset", - start: "$start" - }, - select: { - authors: { - scalars: ["id", "name"], - select: { - username: {} - } - }, - tags: { - scalars: ["id", "name"] - } - }, - scalars: ["body", "createdAt", "id", "title"] - }, - user: { - args: { - id: "$id" - }, - scalars: ["id", "username"], - select: { - name: {} - } - } - } - } -}; - - -`; diff --git a/packages/babel-plugin/__tests__/index.js b/packages/babel-plugin/__tests__/index.js deleted file mode 100644 index a73887d6..00000000 --- a/packages/babel-plugin/__tests__/index.js +++ /dev/null @@ -1,225 +0,0 @@ -import pluginTester from "babel-plugin-tester"; -import plugin from "../src"; - -pluginTester({ - plugin, - pluginName: "@grafoo/babel-plugin", - pluginOptions: { - schema: "__tests__/schema.graphql", - idFields: ["id"] - }, - tests: { - "should throw if a schema is not present on the root directory": { - pluginOptions: { - idFields: ["id"] - }, - code: ` - import gql from "@grafoo/core/tag"; - let query = gql\`{ hello }\`; - `, - error: true - }, - "should throw if a import is not default": { - code: 'import { gql } from "@grafoo/core/tag";', - error: true - }, - "should throw if a tagged template string literal has expressions in it": { - code: ` - import gql from "@grafoo/core/tag"; - let query = gql\`{ user(id: "\${1}") { name } }\`; - `, - error: true - }, - "should remove the imported path": { - code: 'import gql from "@grafoo/core/tag";', - snapshot: true - }, - "should throw if idFields is not defined": { - pluginOptions: { - schema: "__tests__/schema.graphql" - }, - code: ` - import gql from "@grafoo/core/tag"; - let query = gql\`{ hello }\`; - `, - error: true - }, - "should throw if during client instatiation options is passed with a type other then object": { - code: ` - import createClient from "@grafoo/core"; - let query = createClient(someTransport, "I AM ERROR"); - `, - error: true - }, - "should throw if the type of some field in `idFields` is not of type string": { - pluginOptions: { - schema: "__tests__/schema.graphql", - idFields: ["id", true] - }, - code: ` - import createClient from "@grafoo/core"; - let query = createClient(someTransport); - `, - error: true - }, - "should replace a tagged template literal with the compiled grafoo object": { - pluginOptions: { - schema: "__tests__/schema.graphql", - idFields: ["id"] - }, - code: ` - import gql from "@grafoo/core/tag"; - let query = gql\` - query($start: Int!, $offset: Int!, $id: ID!) { - posts(start: $start, offset: $offset) { - title - body - createdAt - tags { name } - authors { name username } - } - user(id: $id) { name username } - } - \`; - `, - snapshot: true - }, - "should not compress a query if the option compress is specified": { - pluginOptions: { - schema: "__tests__/schema.graphql", - idFields: ["id"], - compress: false - }, - code: ` - import gql from "@grafoo/core/tag"; - let query = gql\` - query($start: Int!, $offset: Int!, $id: ID!) { - posts(start: $start, offset: $offset) { - title - body - createdAt - tags { name } - authors { name username } - } - user(id: $id) { name username } - } - \`; - `, - snapshot: true - }, - "should generate md5 hash and add it to object if the option generateIds is specified": { - pluginOptions: { - schema: "__tests__/schema.graphql", - idFields: ["id"], - generateIds: true - }, - code: ` - import gql from "@grafoo/core/tag"; - let query = gql\` - query($start: Int!, $offset: Int!, $id: ID!) { - posts(start: $start, offset: $offset) { - title - body - createdAt - tags { name } - authors { name username } - } - user(id: $id) { name username } - } - \`; - `, - snapshot: true - }, - "should not generate md5 hash and add it to object if the option generateIds is falsey": { - pluginOptions: { - schema: "__tests__/schema.graphql", - idFields: ["id"] - }, - code: ` - import gql from "@grafoo/core/tag"; - let query = gql\` - query($start: Int!, $offset: Int!, $id: ID!) { - posts(start: $start, offset: $offset) { - title - body - createdAt - tags { name } - authors { name username } - } - user(id: $id) { name username } - } - \`; - `, - snapshot: true - }, - "should include `idFields` in the client instantiation if options are not provided": { - code: ` - import createClient from "@grafoo/core"; - let query = createClient(someTransport); - `, - snapshot: true - }, - "should include `idFields` in the client instantiation if not present in options": { - code: ` - import createClient from "@grafoo/core"; - let query = createClient(someTransport, {}); - `, - snapshot: true - }, - "should include `idFields` in the client instantiation if options is a variable": { - code: ` - import createClient from "@grafoo/core"; - let options = {}; - let query = createClient(someTransport, options); - `, - snapshot: true - }, - "should overide `idFields` in the client instantiation if options is a variable": { - code: ` - import createClient from "@grafoo/core"; - let options = { idFields: ["err"] }; - let query = createClient(someTransport, options); - `, - snapshot: true - }, - "should throw if `idFields` in the client instantiation if options is not an object variable": { - code: ` - import createClient from "@grafoo/core"; - let options = []; - let query = createClient(someTransport, options); - `, - error: true - }, - "should include `idFields` in the client instantiation even if options are provided": { - code: ` - import createClient from "@grafoo/core"; - let query = createClient(someTransport, { - headers: () => ({ authorization: "some-token" }) - }); - `, - snapshot: true - }, - "should be able to use named import graphql from @grafoo/core": { - pluginOptions: { - schema: "__tests__/schema.graphql", - idFields: ["id"] - }, - code: ` - import { graphql } from "@grafoo/core"; - let query = graphql\`{ authors {name} }\`; - `, - snapshot: true - }, - "should be able to use named import gql from @grafoo/core": { - pluginOptions: { - schema: "__tests__/schema.graphql", - idFields: ["id"] - }, - code: ` - import { gql } from "@grafoo/core"; - let query = gql\`{ authors {name} }\`; - `, - snapshot: true - } - } -}); diff --git a/packages/babel-plugin/__tests__/index.ts b/packages/babel-plugin/__tests__/index.ts new file mode 100644 index 00000000..165871f3 --- /dev/null +++ b/packages/babel-plugin/__tests__/index.ts @@ -0,0 +1,47 @@ +import pluginTester from "babel-plugin-tester"; +import plugin from "../src"; + +let output = ` +let query = { + document: "{authors{__typename id name}}", + operation: { + select: { + authors: { + scalars: ["__typename", "id", "name"] + } + } + } +}; +`.trim(); + +pluginTester({ + plugin, + pluginName: "@grafoo/babel-plugin", + tests: { + "should remove the imported path": { + code: 'import { graphql, gql } from "@grafoo/core";', + output: "" + }, + "should throw if a tagged template string literal has expressions in it": { + code: ` + import { graphql } from "@grafoo/core"; + let query = graphql\`{ user(id: "\${1}") { name } }\`; + `, + error: true + }, + "should replace a tagged template literal with the compiled grafoo object": { + code: ` + import { graphql } from "@grafoo/core"; + let query = graphql\`{ authors {name} }\`; + `, + output + }, + "should be able to use named import gql from @grafoo/core": { + code: ` + import { gql } from "@grafoo/core"; + let query = gql\`{ authors {name} }\`; + `, + output + } + } +}); diff --git a/packages/babel-plugin/__tests__/schema.graphql b/packages/babel-plugin/schema.graphql similarity index 100% rename from packages/babel-plugin/__tests__/schema.graphql rename to packages/babel-plugin/schema.graphql diff --git a/packages/babel-plugin/src/index.ts b/packages/babel-plugin/src/index.ts index c3761736..46b41e07 100644 --- a/packages/babel-plugin/src/index.ts +++ b/packages/babel-plugin/src/index.ts @@ -1,200 +1,43 @@ -import * as fs from "fs"; -import * as path from "path"; -import type * as BabelCoreNamespace from "@babel/core"; -import type { PluginObj } from "@babel/core"; +import type * as bc from "@babel/core"; import { parseExpression } from "@babel/parser"; -import compileDocument, { Options } from "@grafoo/compiler"; +import compileDocument from "@grafoo/compiler"; -type Babel = typeof BabelCoreNamespace; - -let schema: string; -function getSchema(schemaPath: string) { - try { - if (schema) return schema; - - let fullPath: string; - - if (!schemaPath) { - let schemaJson = path.join(process.cwd(), "schema.json"); - let schemaGraphql = path.join(process.cwd(), "schema.graphql"); - let schemaGql = path.join(process.cwd(), "schema.gql"); - - fullPath = fs.existsSync(schemaJson) - ? schemaJson - : fs.existsSync(schemaGraphql) - ? schemaGraphql - : fs.existsSync(schemaGql) - ? schemaGql - : undefined; - } else { - fullPath = path.join(process.cwd(), schemaPath); - } - - fs.accessSync(fullPath, fs.constants.F_OK); - - schema = fs.readFileSync(fullPath, "utf-8"); - - return schema; - } catch (error) { - if (error.code === "ENOENT") { - throw new Error( - "Could not find a schema in the root directory! " + - "Please use the `schema` option to specify your schema path" - ); - } - - throw error; - } -} - -export default function transform({ types: t }: Babel): PluginObj<{ opts: Options }> { +export default function transform({ types: t }: typeof bc): bc.PluginObj { return { visitor: { - Program(programPath, { opts }) { - let schemaString = getSchema(opts.schema); - let tagIdentifiers = []; - let clientFactoryIdentifiers = []; - - if (typeof opts.compress !== "boolean") { - opts.compress = true; - } - - if (typeof opts.generateIds !== "boolean") { - opts.generateIds = false; - } - - if (!opts.idFields) { - throw new Error("@grafoo/babel-plugin: the `idFields` option is required."); - } - - if ( - !Array.isArray(opts.idFields) || - opts.idFields.some((field) => typeof field !== "string") - ) { - throw new Error( - "@grafoo/babel-plugin: the `idFields` option must be declared as an array of strings." - ); - } - - programPath.traverse({ - ImportDeclaration(path) { - let { source, specifiers } = path.node; - - if (source.value === "@grafoo/core") { - let defaultSpecifier = specifiers.find((s) => t.isImportDefaultSpecifier(s)); - let gqlTag = specifiers.find( - (s) => s.local.name === "graphql" || s.local.name === "gql" - ); - - if (defaultSpecifier) { - clientFactoryIdentifiers.push(defaultSpecifier.local.name); - } - - if (gqlTag) { - tagIdentifiers.push(gqlTag.local.name); - - if (specifiers.length === 1) { - path.remove(); - } - } - } - - if (source.value === "@grafoo/core/tag") { - let defaultSpecifier = specifiers.find((specifier) => - t.isImportDefaultSpecifier(specifier) - ); - - if (!defaultSpecifier) { - throw path.buildCodeFrameError("@grafoo/core/tag: no default import."); - } - - tagIdentifiers.push(defaultSpecifier.local.name); + Program(program) { + let tags = []; - path.remove(); - } - }, - - CallExpression(path) { - let { arguments: args, callee } = path.node; - - let idFieldsArrayAst = t.arrayExpression( - opts.idFields.map((field) => t.stringLiteral(field)) - ); - - let clientObjectAst = t.objectProperty(t.identifier("idFields"), idFieldsArrayAst); + program.traverse({ + ImportSpecifier(path) { + let parentPath = path.parentPath as bc.NodePath; - if (clientFactoryIdentifiers.some((name) => t.isIdentifier(callee, { name }))) { - if (!args[1]) { - args[1] = t.objectExpression([clientObjectAst]); - } + if (parentPath.node.source.value !== "@grafoo/core") return; - if (t.isIdentifier(args[1])) { - let name = args[1].name; - // @ts-ignore - let { init } = path.scope.bindings[name].path.node; + let { name } = path.node.local; - if (path.scope.hasBinding(name)) { - if (t.isObjectExpression(init)) { - // @ts-ignore - let idFieldsProp = init.properties.find((arg) => arg.key.name === "idFields"); + if (!["graphql", "gql"].some((n) => n === name)) return; - if (idFieldsProp) { - // @ts-ignore - idFieldsProp.value = idFieldsArrayAst; - } else { - init.properties.push(clientObjectAst); - } - } else { - throw path.buildCodeFrameError( - // @ts-ignore - callee.name + - " second argument must be of type object, instead got " + - args[1].type + - "." - ); - } - } - } else if (t.isObjectExpression(args[1])) { - // @ts-ignore - let idFieldsProp = args[1].properties.find((arg) => arg.key.name === "idFields"); + tags.push(name); + path.remove(); - if (idFieldsProp) { - // @ts-ignore - idFieldsProp.value = idFieldsArrayAst; - } else { - args[1].properties.push(clientObjectAst); - } - } else { - throw path.buildCodeFrameError( - // @ts-ignore - callee.name + - " second argument must be of type object, instead got " + - args[1].type + - "." - ); - } - } + if (!parentPath.node.specifiers.length) parentPath.remove(); }, - TaggedTemplateExpression(path) { - if (tagIdentifiers.some((name) => t.isIdentifier(path.node.tag, { name }))) { - let quasi = path.get("quasi"); - let expressions = quasi.get("expressions"); + if (!tags.some((n) => t.isIdentifier(path.node.tag, { name: n }))) return; - if (expressions.length) { - throw expressions[0].buildCodeFrameError( - "@grafoo/core/tag: interpolation is not supported in a graphql tagged template literal." - ); - } + let quasi = path.get("quasi"); + let expressions = quasi.get("expressions"); - try { - let source = quasi.node.quasis.reduce((src, q) => src + q.value.raw, ""); - let query = compileDocument(source, schemaString, opts); - path.replaceWith(parseExpression(query)); - } catch (error) { - throw quasi.buildCodeFrameError(error); - } + if (expressions.length) { + throw expressions[0].buildCodeFrameError( + "@grafoo/core: interpolation is not supported in a graphql tagged template literal." + ); } + + let source = quasi.node.quasis.reduce((q, s) => q + s.value.raw, ""); + let query = compileDocument(source); + path.replaceWith(parseExpression(query)); } }); } diff --git a/packages/bindings/.grafoorc.json b/packages/bindings/.grafoorc.json new file mode 100644 index 00000000..0c00d834 --- /dev/null +++ b/packages/bindings/.grafoorc.json @@ -0,0 +1,4 @@ +{ + "schema": "schema.graphql", + "idFields": ["id", "__typename"] +} diff --git a/packages/bindings/__tests__/index.ts b/packages/bindings/__tests__/index.ts index 26425fbe..47e50bff 100644 --- a/packages/bindings/__tests__/index.ts +++ b/packages/bindings/__tests__/index.ts @@ -117,7 +117,7 @@ describe("@grafoo/bindings", () => { }); it("should provide errors on bad request", async () => { - let failedQuery = { ...AUTHORS, document: AUTHORS.document.substr(1) }; + let failedQuery = { ...AUTHORS, document: AUTHORS.document.substring(1) }; let { errors } = await mockQueryRequest(failedQuery); let renderFn = jest.fn(); let bindings = createBindings(client, renderFn, { query: failedQuery }); diff --git a/packages/bindings/__tests__/queries.ts b/packages/bindings/__tests__/queries.ts index 3ed52c02..4a9bbb3e 100644 --- a/packages/bindings/__tests__/queries.ts +++ b/packages/bindings/__tests__/queries.ts @@ -1,4 +1,4 @@ -import graphql from "@grafoo/core/tag"; +import { graphql } from "@grafoo/core"; import { CreateAuthorInput, DeleteAuthorInput, diff --git a/packages/bindings/babel.config.js b/packages/bindings/babel.config.js index 09fe8b00..2524bf5d 100644 --- a/packages/bindings/babel.config.js +++ b/packages/bindings/babel.config.js @@ -2,12 +2,7 @@ module.exports = { presets: [["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-typescript"], env: { test: { - plugins: [ - [ - "module:@grafoo/babel-plugin", - { schema: "schema.graphql", idFields: ["id", "__typename"] } - ] - ] + plugins: ["module:@grafoo/babel-plugin"] } } }; diff --git a/packages/compiler/src/index.ts b/packages/compiler/src/index.ts index ae35720f..8e426552 100644 --- a/packages/compiler/src/index.ts +++ b/packages/compiler/src/index.ts @@ -1,4 +1,13 @@ -import { DocumentNode, buildASTSchema, parse, print, getOperationAST } from "graphql"; +import * as fs from "fs"; +import * as path from "path"; +import { + DocumentNode, + GraphQLSchema, + buildASTSchema, + getOperationAST, + parse, + print +} from "graphql"; import compress from "graphql-query-compress"; import md5Hash from "crypto-js/md5"; import { GrafooQuery } from "@grafoo/core"; @@ -9,13 +18,39 @@ import generateClientResolver from "./generate-client-resolvers"; export type Options = { schema: string; + idFields: string[]; compress?: boolean; generateIds?: boolean; - idFields?: string[]; }; -export default function compileDocument(source: string, schemaString: string, opts: Options) { - let schema = buildASTSchema(parse(schemaString)); +let cache = new Map(); + +export default function compileDocument(source: string) { + if (!cache.has("opts")) { + let opts = getOptions(); + + if (!["schema", "idFields"].some((f) => Object.keys(opts).includes(f))) { + throw new Error( + "The `schema` and `idFields` options are required. Please include then in your .grafoorc." + ); + } + + opts.compress = opts.compress ?? process.env.NODE_ENV === "production"; + opts.generateIds = opts.generateIds ?? false; + + cache.set("opts", opts); + } + + let opts: Options = cache.get("opts"); + let schemaString = getSchema(opts.schema); + let schema: GraphQLSchema; + try { + schema = buildASTSchema(parse(schemaString)); + } catch (error) { + error.message = `Failed to parse ${path.join(process.cwd(), opts.schema)}.`; + throw error; + } + let document = sortDocument(insertFields(schema, parse(source), opts.idFields)) as DocumentNode; let operation = getOperationAST(document); let fragments = { @@ -37,3 +72,43 @@ export default function compileDocument(source: string, schemaString: string, op return JSON.stringify(grafooQuery); } + +export function getOptions(): Options { + try { + let paths = [".grafoorc.json", ".grafoorc"].map((p) => path.join(process.cwd(), p)); + let configPath = paths.find((p) => fs.existsSync(p)); + + fs.accessSync(configPath); + + let config = fs.readFileSync(configPath, "utf-8"); + + return JSON.parse(config); + } catch (error) { + if (error.code === "ENOENT") { + throw new Error("Could not find a .grafoorc or .grafoorc.json in the root directory."); + } + + throw error; + } +} + +export function getSchema(schemaPath: string) { + try { + let fullPath = path.join(process.cwd(), schemaPath); + + fs.accessSync(fullPath); + + let schema = fs.readFileSync(fullPath, "utf-8"); + + return schema; + } catch (error) { + if (error.code === "ENOENT") { + throw new Error( + "Could not find a schema in the root directory. " + + "Please specify the `schema` option in your .grafoorc file." + ); + } + + throw error; + } +} diff --git a/packages/core/.grafoorc.json b/packages/core/.grafoorc.json new file mode 100644 index 00000000..0c00d834 --- /dev/null +++ b/packages/core/.grafoorc.json @@ -0,0 +1,4 @@ +{ + "schema": "schema.graphql", + "idFields": ["id", "__typename"] +} diff --git a/packages/core/__tests__/queries.ts b/packages/core/__tests__/queries.ts index 9fc69d56..d870d137 100644 --- a/packages/core/__tests__/queries.ts +++ b/packages/core/__tests__/queries.ts @@ -1,4 +1,4 @@ -import graphql from "@grafoo/core/tag"; +import { graphql } from "@grafoo/core"; import { Query, QueryPostArgs } from "@grafoo/test-utils"; export type AuthorsQuery = Pick; diff --git a/packages/core/__tests__/resolve-values.ts b/packages/core/__tests__/resolve-values.ts index 350be4fe..c4cfd979 100644 --- a/packages/core/__tests__/resolve-values.ts +++ b/packages/core/__tests__/resolve-values.ts @@ -1,4 +1,4 @@ -import graphql from "@grafoo/core/tag"; +import { graphql } from "@grafoo/core"; import resolveValues from "../src/resolve-values"; import * as postsAndAuthors from "./data/posts-and-authors"; import * as postsWithFragments from "./data/posts-with-fragments"; diff --git a/packages/core/__tests__/store-values.ts b/packages/core/__tests__/store-values.ts index 3f5fa4b0..70c175fb 100644 --- a/packages/core/__tests__/store-values.ts +++ b/packages/core/__tests__/store-values.ts @@ -1,4 +1,4 @@ -import graphql from "@grafoo/core/tag"; +import { graphql } from "@grafoo/core"; import storeValues from "../src/store-values"; import * as postsAndAuthors from "./data/posts-and-authors"; import * as postsWithFragments from "./data/posts-with-fragments"; diff --git a/packages/core/babel.config.js b/packages/core/babel.config.js index 09fe8b00..2524bf5d 100644 --- a/packages/core/babel.config.js +++ b/packages/core/babel.config.js @@ -2,12 +2,7 @@ module.exports = { presets: [["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-typescript"], env: { test: { - plugins: [ - [ - "module:@grafoo/babel-plugin", - { schema: "schema.graphql", idFields: ["id", "__typename"] } - ] - ] + plugins: ["module:@grafoo/babel-plugin"] } } }; diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts index c59516b0..2d8e63ae 100644 --- a/packages/core/src/client.ts +++ b/packages/core/src/client.ts @@ -13,12 +13,11 @@ import { deepMerge } from "./util"; export default function createClient( transport: GrafooTransport, - options?: GrafooClientOptions + options: GrafooClientOptions ): GrafooClient { - let { initialState = { paths: {}, records: {} }, idFields } = options; - - let paths: GrafooPath = initialState.paths ?? {}; - let records: GrafooRecords = initialState.records ?? {}; + let { initialState, idFields } = options; + let paths: GrafooPath = initialState?.paths ?? {}; + let records: GrafooRecords = initialState?.records ?? {}; let listeners: GrafooListener[] = []; function execute(query: T, variables?: T["_variablesType"]) { diff --git a/packages/core/src/tag.ts b/packages/core/src/tag.ts index d5788435..2f0cdf37 100644 --- a/packages/core/src/tag.ts +++ b/packages/core/src/tag.ts @@ -1,9 +1,6 @@ import { GrafooQuery } from "./types"; -export declare function graphql( - strs: TemplateStringsArray -): GrafooQuery; +// @ts-ignore +export function graphql(strs: TemplateStringsArray): GrafooQuery {} -export declare function gql( - strs: TemplateStringsArray -): GrafooQuery; +export let gql = graphql; diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 222a7095..3550b501 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -64,6 +64,6 @@ export type GrafooClient = { }; export type GrafooClientOptions = { + idFields: Array; initialState?: GrafooInitialState; - idFields?: Array; }; diff --git a/packages/core/tag.d.ts b/packages/core/tag.d.ts deleted file mode 100644 index 9cd4141a..00000000 --- a/packages/core/tag.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -declare module "@grafoo/core/tag" { - import { GrafooQuery } from "@grafoo/core"; - - export default function graphql( - strs: TemplateStringsArray - ): GrafooQuery; -} diff --git a/packages/core/tag.js b/packages/core/tag.js deleted file mode 100644 index b9f4afe5..00000000 --- a/packages/core/tag.js +++ /dev/null @@ -1,8 +0,0 @@ -function graphql() { - throw new Error( - "@grafoo/core/tag: if you are getting this error it means your queries are not being transpiled" - ); -} - -module.exports = graphql; -module.exports.default = graphql; diff --git a/packages/macro/.babelrc.json b/packages/macro/.babelrc.json new file mode 100644 index 00000000..6e63b6e0 --- /dev/null +++ b/packages/macro/.babelrc.json @@ -0,0 +1,6 @@ +{ + "presets": [ + ["@babel/preset-env", { "targets": { "node": "current" } }], + "@babel/preset-typescript" + ] +} diff --git a/packages/macro/.grafoorc.json b/packages/macro/.grafoorc.json new file mode 100644 index 00000000..7f30f4ce --- /dev/null +++ b/packages/macro/.grafoorc.json @@ -0,0 +1,5 @@ +{ + "schema": "schema.graphql", + "idFields": ["id", "__typename"], + "compress": true +} diff --git a/packages/macro/__tests__/index.ts b/packages/macro/__tests__/index.ts new file mode 100644 index 00000000..e492008c --- /dev/null +++ b/packages/macro/__tests__/index.ts @@ -0,0 +1,36 @@ +import pluginTester from "babel-plugin-tester"; +import plugin from "babel-plugin-macros"; + +let output = ` +let query = { + document: "{authors{__typename id name}}", + operation: { + select: { + authors: { + scalars: ["__typename", "id", "name"] + } + } + } +}; +`.trim(); + +pluginTester({ + plugin, + pluginName: "@grafoo/macro", + tests: { + "should throw if a tagged template string literal has expressions in it": { + code: ` + import graphql from "@grafoo/macro"; + let query = graphql\`{ user(id: "\${1}") { name } }\`; + `, + error: true + }, + "should replace a tagged template literal with the compiled grafoo object": { + code: ` + import graphql from "@grafoo/macro"; + let query = graphql\`{ authors {name} }\`; + `, + output + } + } +}); diff --git a/packages/macro/package.json b/packages/macro/package.json index 9ad36580..95f34ddf 100644 --- a/packages/macro/package.json +++ b/packages/macro/package.json @@ -17,10 +17,20 @@ "access": "public" }, "scripts": { - "build": "tsc --declaration" + "build": "tsc --declaration", + "test": "jest", + "test:coverage": "jest --coverage" + }, + "jest": { + "transform": { + "^.+\\.(ts|tsx|js)$": "babel-jest" + }, + "transformIgnorePatterns": [ + "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob)/)" + ] }, "dependencies": { - "@babel/parser": "^7.16.3", + "@babel/parser": "^7.16.4", "@grafoo/compiler": "^1.4.2-next.0", "babel-plugin-macros": "^3.1.0" }, diff --git a/packages/macro/schema.graphql b/packages/macro/schema.graphql new file mode 100644 index 00000000..55365803 --- /dev/null +++ b/packages/macro/schema.graphql @@ -0,0 +1,63 @@ +type Post { + id: ID! + title: String! + slug: String! + body: String! + published: Boolean! + createdAt: String! + updateAt: String! + authors: [Author!]! + author: Author! + tags: [Tag!]! +} + +union Viewer = Visitor | User + +type Tag { + id: ID! + name: String! + posts: [Post!]! + createdAt: String! + updateAt: String! +} + +interface User { + id: ID! + username: String! + email: String! + createdAt: String! + updatedAt: String! +} + +type Author implements User { + id: ID! + name: String + bio: String + posts: [Post!]! +} + +type Visitor { + id: ID! + ip: String! +} + +type Mutation { + createPost(title: String!, body: String!, authors: [ID!]!, tags: [String!]): Post + deletePost(id: ID): Post + createTag(name: String!): Tag + register(username: String!, email: String!, password: String!): User + login(email: String!, password: String!): String + updateUser(username: String, name: String, bio: String, email: String, password: String): User +} + +type Query { + author(id: ID!): Author + authors(start: Int!, offset: Int!): [Author] + posts(start: Int!, offset: Int!): [Post] + post(id: ID!): Post + tag(id: ID!): Tag + users(start: Int!, offset: Int!): [User] + user(id: ID!): User + me: User + viewer: Viewer +} diff --git a/packages/macro/src/index.d.ts b/packages/macro/src/index.d.ts deleted file mode 100644 index 4589f5af..00000000 --- a/packages/macro/src/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { graphql as default } from "@grafoo/core"; diff --git a/packages/macro/src/index.ts b/packages/macro/src/index.ts index e23b4c1e..338a3e83 100644 --- a/packages/macro/src/index.ts +++ b/packages/macro/src/index.ts @@ -1,17 +1,10 @@ -import * as fs from "fs"; -import * as path from "path"; import type bc from "@babel/core"; import { parseExpression } from "@babel/parser"; import { createMacro } from "babel-plugin-macros"; -import compileDocument, { Options } from "@grafoo/compiler"; +import compileDocument from "@grafoo/compiler"; import { graphql } from "@grafoo/core"; -let map = new Map(); - export default createMacro(({ references }) => { - if (!map.has("opts")) map.set("opts", getOptions()); - if (!map.has("schema")) map.set("schema", getSchema(map.get("opts").schema)); - for (let ref of references.default) { let path = ref as bc.NodePath; let targetPath = path.parentPath; @@ -27,72 +20,9 @@ export default createMacro(({ references }) => { ); } - try { - let source = quasi.node.quasis.reduce((src, q) => src + q.value.raw, ""); - let query = compileDocument(source, map.get("schema"), map.get("opts")); - targetPath.replaceWith(parseExpression(query)); - } catch (error) { - throw quasi.buildCodeFrameError(error.message); - } + let source = quasi.node.quasis.reduce((src, q) => src + q.value.raw, ""); + let query = compileDocument(source); + targetPath.replaceWith(parseExpression(query)); } } }) as typeof graphql; - -function getOptions(): Options { - try { - let jsonPath = path.join(process.cwd(), "package.json"); - - fs.accessSync(jsonPath, fs.constants.F_OK); - - let pkg = fs.readFileSync(jsonPath, "utf-8"); - - return JSON.parse(pkg).grafooConfig ?? {}; - } catch (error) { - if (error.code === "ENOENT") { - throw new Error( - "Could not find a schema in the root directory. " + - "Please use the `schema` option to specify your schema path" - ); - } - - throw error; - } -} - -function getSchema(schemaPath: string) { - try { - let fullPath: string; - - if (!schemaPath) { - let schemaJson = path.join(process.cwd(), "schema.json"); - let schemaGraphql = path.join(process.cwd(), "schema.graphql"); - let schemaGql = path.join(process.cwd(), "schema.gql"); - - fullPath = fs.existsSync(schemaJson) - ? schemaJson - : fs.existsSync(schemaGraphql) - ? schemaGraphql - : fs.existsSync(schemaGql) - ? schemaGql - : undefined; - } else { - fullPath = path.join(process.cwd(), schemaPath); - } - - // @ts-ignore - fs.accessSync(fullPath, fs.F_OK); - - let schema = fs.readFileSync(fullPath, "utf-8"); - - return schema; - } catch (error) { - if (error.code === "ENOENT") { - throw new Error( - "Could not find a schema in the root directory. " + - "Please use the `schema` option to specify your schema path" - ); - } - - throw error; - } -} diff --git a/packages/react/.grafoorc.json b/packages/react/.grafoorc.json new file mode 100644 index 00000000..0c00d834 --- /dev/null +++ b/packages/react/.grafoorc.json @@ -0,0 +1,4 @@ +{ + "schema": "schema.graphql", + "idFields": ["id", "__typename"] +} diff --git a/packages/react/__tests__/queries.ts b/packages/react/__tests__/queries.ts index 3ed52c02..4a9bbb3e 100644 --- a/packages/react/__tests__/queries.ts +++ b/packages/react/__tests__/queries.ts @@ -1,4 +1,4 @@ -import graphql from "@grafoo/core/tag"; +import { graphql } from "@grafoo/core"; import { CreateAuthorInput, DeleteAuthorInput, diff --git a/packages/react/babel.config.js b/packages/react/babel.config.js index 63d2a404..495f3417 100644 --- a/packages/react/babel.config.js +++ b/packages/react/babel.config.js @@ -6,12 +6,7 @@ module.exports = { ], env: { test: { - plugins: [ - [ - "module:@grafoo/babel-plugin", - { schema: "schema.graphql", idFields: ["id", "__typename"] } - ] - ] + plugins: ["module:@grafoo/babel-plugin"] } } }; diff --git a/packages/react/package.json b/packages/react/package.json index 992f4034..1d441e22 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -51,7 +51,7 @@ }, "gitHead": "0bc67d8b398884a1f387a1813e485d2c5318b974", "devDependencies": { - "@types/node": "^16.10.2", - "@types/react": "^17.0.32" + "@types/node": "^16.11.11", + "@types/react": "^17.0.37" } } diff --git a/packages/rollup-plugin/.babelrc.json b/packages/rollup-plugin/.babelrc.json new file mode 100644 index 00000000..6e63b6e0 --- /dev/null +++ b/packages/rollup-plugin/.babelrc.json @@ -0,0 +1,6 @@ +{ + "presets": [ + ["@babel/preset-env", { "targets": { "node": "current" } }], + "@babel/preset-typescript" + ] +} diff --git a/packages/rollup-plugin/.grafoorc.json b/packages/rollup-plugin/.grafoorc.json new file mode 100644 index 00000000..7f30f4ce --- /dev/null +++ b/packages/rollup-plugin/.grafoorc.json @@ -0,0 +1,5 @@ +{ + "schema": "schema.graphql", + "idFields": ["id", "__typename"], + "compress": true +} diff --git a/packages/rollup-plugin/__tests__/index.ts b/packages/rollup-plugin/__tests__/index.ts new file mode 100644 index 00000000..f3d279fd --- /dev/null +++ b/packages/rollup-plugin/__tests__/index.ts @@ -0,0 +1,54 @@ +import plugin from "../src"; +import { parse } from "acorn"; + +let transform = (input: string) => + plugin().transform.call( + { + parse: (code: string) => + parse(code, { + sourceType: "module", + ecmaVersion: 9 + }) + }, + input, + "file.js" + ); + +let output = + 'let query = {"document":"{authors{__typename id name}}","operation":{"select":{"authors":{"scalars":["__typename","id","name"]}}}};'; + +describe("@grafoo/rollup-plugin", () => { + it("should remove the imported path", () => { + let { code } = transform('import { graphql, gql } from "@grafoo/core";'); + let output = ""; + + expect(code).toBe(output); + }); + + it("should throw if a tagged template string literal has expressions in it", () => { + let code = ` + import { graphql } from "@grafoo/core"; + let query = graphql\`{ user(id: "\${1}") { name } }\`; + `; + + expect(() => transform(code)).toThrow(); + }); + + it("should replace a tagged template literal with the compiled grafoo object", () => { + let { code } = transform(` + import { graphql } from "@grafoo/core"; + let query = graphql\`{ authors {name} }\`; + `); + + expect(code.trim()).toBe(output); + }); + + it("should be able to use named import gql from @grafoo/core", () => { + let { code } = transform(` + import { gql } from "@grafoo/core"; + let query = gql\`{ authors {name} }\`; + `); + + expect(code.trim()).toBe(output); + }); +}); diff --git a/packages/rollup-plugin/package.json b/packages/rollup-plugin/package.json new file mode 100644 index 00000000..edb0c321 --- /dev/null +++ b/packages/rollup-plugin/package.json @@ -0,0 +1,37 @@ +{ + "name": "@grafoo/rollup-plugin", + "version": "1.0.0", + "license": "MIT", + "main": "dist/index.js", + "module": "dist/index.es.js", + "scripts": { + "build": "tsc --declaration", + "test": "jest", + "test:coverage": "jest --coverage" + }, + "jest": { + "transform": { + "^.+\\.(ts|tsx|js)$": "babel-jest" + }, + "transformIgnorePatterns": [ + "node_modules/(?!(lowdb|steno|node-fetch|fetch-blob)/)" + ] + }, + "dependencies": { + "@rollup/pluginutils": "^4.1.1", + "@types/estree": "^0.0.50", + "acorn": "^8.6.0", + "estree-walker": "^2.0.1", + "magic-string": "^0.25.7", + "rollup": "^2.60.2" + }, + "devDependencies": { + "@babel/parser": "^7.16.4", + "@babel/preset-env": "^7.16.4", + "@types/jest": "^27.0.3", + "@types/node": "^16.11.11", + "@types/react": "^17.0.37", + "@types/uuid": "^8.3.3", + "@types/ws": "^8.2.1" + } +} diff --git a/packages/rollup-plugin/rollup.config.js b/packages/rollup-plugin/rollup.config.js new file mode 100644 index 00000000..8c3dbce7 --- /dev/null +++ b/packages/rollup-plugin/rollup.config.js @@ -0,0 +1,12 @@ +import pkg from "./package.json"; +import typescript from "@rollup/plugin-typescript"; + +export default { + input: "src/index.ts", + external: Object.keys(pkg.dependencies), + output: [ + { format: "cjs", file: pkg.main, exports: "auto" }, + { format: "esm", file: pkg.module } + ], + plugins: [typescript()] +}; diff --git a/packages/rollup-plugin/schema.graphql b/packages/rollup-plugin/schema.graphql new file mode 100644 index 00000000..55365803 --- /dev/null +++ b/packages/rollup-plugin/schema.graphql @@ -0,0 +1,63 @@ +type Post { + id: ID! + title: String! + slug: String! + body: String! + published: Boolean! + createdAt: String! + updateAt: String! + authors: [Author!]! + author: Author! + tags: [Tag!]! +} + +union Viewer = Visitor | User + +type Tag { + id: ID! + name: String! + posts: [Post!]! + createdAt: String! + updateAt: String! +} + +interface User { + id: ID! + username: String! + email: String! + createdAt: String! + updatedAt: String! +} + +type Author implements User { + id: ID! + name: String + bio: String + posts: [Post!]! +} + +type Visitor { + id: ID! + ip: String! +} + +type Mutation { + createPost(title: String!, body: String!, authors: [ID!]!, tags: [String!]): Post + deletePost(id: ID): Post + createTag(name: String!): Tag + register(username: String!, email: String!, password: String!): User + login(email: String!, password: String!): String + updateUser(username: String, name: String, bio: String, email: String, password: String): User +} + +type Query { + author(id: ID!): Author + authors(start: Int!, offset: Int!): [Author] + posts(start: Int!, offset: Int!): [Post] + post(id: ID!): Post + tag(id: ID!): Tag + users(start: Int!, offset: Int!): [User] + user(id: ID!): User + me: User + viewer: Viewer +} diff --git a/packages/rollup-plugin/src/index.ts b/packages/rollup-plugin/src/index.ts new file mode 100644 index 00000000..7f206f88 --- /dev/null +++ b/packages/rollup-plugin/src/index.ts @@ -0,0 +1,98 @@ +import { walk } from "estree-walker"; +import { AcornNode, Plugin } from "rollup"; +import MagicString from "magic-string"; +import type { ImportDeclaration, Node } from "estree"; +import { FilterPattern, createFilter } from "@rollup/pluginutils"; +import compileDocument from "@grafoo/compiler"; + +type Options = { + include?: FilterPattern; + exclude?: FilterPattern; + sourceMap?: boolean; +}; + +export default function grafoo(options?: Options): Plugin { + let { include = "**/*.{js,jsx,ts,tsx}", exclude, sourceMap = true } = options ?? {}; + let filter = createFilter(include, exclude); + + return { + name: "@grafoo/rollup-plugin", + transform(code, id) { + if (!filter(id)) return null; + + let ast: AcornNode; + try { + ast = this.parse(code); + } catch (err) { + err.message += ` in ${id}`; + throw err; + } + + let ms = new MagicString(code); + let edited = false; + let tags = []; + + function removeImportSpecifier({ start, end }) { + while (/\s/.test(code[start - 1])) start -= 1; + while (/\s|,/.test(code[end + 1])) end += 1; + ms.remove(start, end); + edited = true; + } + + function removeImportDeclaration({ start, end }) { + ms.remove(start, end); + edited = true; + } + + function replaceTemplateExpression({ start, end }, source: string) { + ms.overwrite(start, end, source); + edited = true; + } + + walk(ast, { + enter(node: Node, parent) { + let parentNode = parent as ImportDeclaration; + + if (node.type === "ImportSpecifier") { + if (parentNode.source.value !== "@grafoo/core") return; + + let { name } = node.local; + + if (["graphql", "gql"].includes(name)) { + tags.push(name); + removeImportSpecifier(node as any); + this.remove(); + + if (!parentNode.specifiers.filter((s) => s.local.name !== name).length) { + removeImportDeclaration(parent as any); + } + } + } + + if (node.type === "TaggedTemplateExpression") { + if (!tags.includes((node.tag as any).name)) return; + + let { quasis, expressions } = node.quasi; + + if (expressions.length) { + throw new Error( + `interpolation is not supported in a grafoo graphql tagged template literal.` + ); + } + + let source = quasis.reduce((q, s) => q + s.value.raw, ""); + let query = compileDocument(source); + replaceTemplateExpression(node as any, query); + } + } + }); + + if (!edited) return null; + + return { + code: ms.toString(), + map: sourceMap ? ms.generateMap() : null + }; + } + }; +} diff --git a/packages/rollup-plugin/tsconfig.json b/packages/rollup-plugin/tsconfig.json new file mode 100644 index 00000000..aa4e1c88 --- /dev/null +++ b/packages/rollup-plugin/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "moduleResolution": "node", + "strict": false, + "lib": ["esnext", "dom"], + "noUnusedLocals": true, + "noUnusedParameters": true, + "checkJs": false, + "downlevelIteration": true, + "esModuleInterop": true, + "outDir": "./dist", + "module": "commonjs" + }, + "include": ["src"] +} diff --git a/yarn.lock b/yarn.lock index 6b63284f..05dd576f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25,10 +25,10 @@ dependencies: "@babel/highlight" "^7.16.0" -"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.0.tgz#ea269d7f78deb3a7826c39a4048eecda541ebdaa" - integrity sha512-DGjt2QZse5SGd9nfOSqO4WLJ8NN/oHkijbXbPrxuoJO3oIPJL3TciZs9FX+cOHNiY9E9l0opL8g7BmLe3T+9ew== +"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.16.0", "@babel/compat-data@^7.16.4": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.4.tgz#081d6bbc336ec5c2435c6346b2ae1fb98b5ac68e" + integrity sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q== "@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.12.10", "@babel/core@^7.12.3", "@babel/core@^7.16.0", "@babel/core@^7.7.2", "@babel/core@^7.7.5": version "7.16.0" @@ -75,7 +75,7 @@ "@babel/helper-explode-assignable-expression" "^7.16.0" "@babel/types" "^7.16.0" -"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.16.0": +"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.16.0", "@babel/helper-compilation-targets@^7.16.3": version "7.16.3" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz#5b480cd13f68363df6ec4dc8ac8e2da11363cbf0" integrity sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA== @@ -105,10 +105,10 @@ "@babel/helper-annotate-as-pure" "^7.16.0" regexpu-core "^4.7.1" -"@babel/helper-define-polyfill-provider@^0.2.4": - version "0.2.4" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.4.tgz#8867aed79d3ea6cade40f801efb7ac5c66916b10" - integrity sha512-OrpPZ97s+aPi6h2n1OXzdhVis1SGSsMU2aMHgLcOKfsp4/v1NWpx3CWT3lBj5eeBq9cDkPkh+YCfdF7O12uNDQ== +"@babel/helper-define-polyfill-provider@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.0.tgz#c5b10cf4b324ff840140bb07e05b8564af2ae971" + integrity sha512-7hfT8lUljl/tM3h+izTX/pO3W3frz2ok6Pk+gzys8iJqDfZrZy2pXjRTZAvG2YmfHun1X4q8/UZRLatMfqc5Tg== dependencies: "@babel/helper-compilation-targets" "^7.13.0" "@babel/helper-module-imports" "^7.12.13" @@ -189,10 +189,10 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== -"@babel/helper-remap-async-to-generator@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.0.tgz#d5aa3b086e13a5fe05238ff40c3a5a0c2dab3ead" - integrity sha512-MLM1IOMe9aQBqMWxcRw8dcb9jlM86NIw7KA0Wri91Xkfied+dE0QuBFSBjMNvqzmS0OSIDsMNC24dBEkPUi7ew== +"@babel/helper-remap-async-to-generator@^7.16.0", "@babel/helper-remap-async-to-generator@^7.16.4": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.4.tgz#5d7902f61349ff6b963e07f06a389ce139fbfe6e" + integrity sha512-vGERmmhR+s7eH5Y/cp8PCVzj4XEjerq8jooMfxFdA5xVtAk9Sh4AQsrWgiErUEBjtGrBtOFKDUcWQFW4/dFwMA== dependencies: "@babel/helper-annotate-as-pure" "^7.16.0" "@babel/helper-wrap-function" "^7.16.0" @@ -267,12 +267,12 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.0", "@babel/parser@^7.16.3", "@babel/parser@^7.3.3", "@babel/parser@^7.7.2": - version "7.16.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.3.tgz#271bafcb811080905a119222edbc17909c82261d" - integrity sha512-dcNwU1O4sx57ClvLBVFbEgx0UZWfd0JQX5X6fxFRCLHelFBGXFfSz6Y0FAq2PEwUqlqLkdVjVr4VASEOuUnLJw== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.0", "@babel/parser@^7.16.3", "@babel/parser@^7.16.4", "@babel/parser@^7.3.3", "@babel/parser@^7.7.2": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.4.tgz#d5f92f57cf2c74ffe9b37981c0e72fee7311372e" + integrity sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng== -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.0": +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.2": version "7.16.2" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.2.tgz#2977fca9b212db153c195674e57cfab807733183" integrity sha512-h37CvpLSf8gb2lIJ2CgC3t+EjFbi0t8qS7LCS1xcJIlEXE4czlofwaW7W1HA8zpgOCzI9C1nmoqNR1zWkk0pQg== @@ -288,13 +288,13 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" "@babel/plugin-proposal-optional-chaining" "^7.16.0" -"@babel/plugin-proposal-async-generator-functions@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.0.tgz#11425d47a60364352f668ad5fbc1d6596b2c5caf" - integrity sha512-nyYmIo7ZqKsY6P4lnVmBlxp9B3a96CscbLotlsNuktMHahkDwoPYEjXrZHU0Tj844Z9f1IthVxQln57mhkcExw== +"@babel/plugin-proposal-async-generator-functions@^7.16.4": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.4.tgz#e606eb6015fec6fa5978c940f315eae4e300b081" + integrity sha512-/CUekqaAaZCQHleSK/9HajvcD/zdnJiKRiuUFq8ITE+0HsPzquf53cpFiqAwl/UfmJbR6n5uGPQSPdrmKOvHHg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-remap-async-to-generator" "^7.16.0" + "@babel/helper-remap-async-to-generator" "^7.16.4" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-proposal-class-properties@7.12.1": @@ -734,7 +734,7 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/helper-replace-supers" "^7.16.0" -"@babel/plugin-transform-parameters@^7.16.0": +"@babel/plugin-transform-parameters@^7.16.0", "@babel/plugin-transform-parameters@^7.16.3": version "7.16.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.3.tgz#fa9e4c874ee5223f891ee6fa8d737f4766d31d15" integrity sha512-3MaDpJrOXT1MZ/WCmkOFo7EtmVVC8H4EUZVrHvFOsmwkk4lOjQj8rzv8JKUZV4YoQKeoIgk07GO+acPU9IMu/w== @@ -855,18 +855,18 @@ "@babel/helper-create-regexp-features-plugin" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/preset-env@^7.12.11", "@babel/preset-env@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.16.0.tgz#97228393d217560d6a1c6c56f0adb9d12bca67f5" - integrity sha512-cdTu/W0IrviamtnZiTfixPfIncr2M1VqRrkjzZWlr1B4TVYimCFK5jkyOdP4qw2MrlKHi+b3ORj6x8GoCew8Dg== +"@babel/preset-env@^7.12.11", "@babel/preset-env@^7.16.0", "@babel/preset-env@^7.16.4": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.16.4.tgz#4f6ec33b2a3fe72d6bfdcdf3859500232563a2e3" + integrity sha512-v0QtNd81v/xKj4gNKeuAerQ/azeNn/G1B1qMLeXOcV8+4TWlD2j3NV1u8q29SDFBXx/NBq5kyEAO+0mpRgacjA== dependencies: - "@babel/compat-data" "^7.16.0" - "@babel/helper-compilation-targets" "^7.16.0" + "@babel/compat-data" "^7.16.4" + "@babel/helper-compilation-targets" "^7.16.3" "@babel/helper-plugin-utils" "^7.14.5" "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.16.0" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.16.2" "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.16.0" - "@babel/plugin-proposal-async-generator-functions" "^7.16.0" + "@babel/plugin-proposal-async-generator-functions" "^7.16.4" "@babel/plugin-proposal-class-properties" "^7.16.0" "@babel/plugin-proposal-class-static-block" "^7.16.0" "@babel/plugin-proposal-dynamic-import" "^7.16.0" @@ -916,7 +916,7 @@ "@babel/plugin-transform-named-capturing-groups-regex" "^7.16.0" "@babel/plugin-transform-new-target" "^7.16.0" "@babel/plugin-transform-object-super" "^7.16.0" - "@babel/plugin-transform-parameters" "^7.16.0" + "@babel/plugin-transform-parameters" "^7.16.3" "@babel/plugin-transform-property-literals" "^7.16.0" "@babel/plugin-transform-regenerator" "^7.16.0" "@babel/plugin-transform-reserved-words" "^7.16.0" @@ -929,10 +929,10 @@ "@babel/plugin-transform-unicode-regex" "^7.16.0" "@babel/preset-modules" "^0.1.5" "@babel/types" "^7.16.0" - babel-plugin-polyfill-corejs2 "^0.2.3" - babel-plugin-polyfill-corejs3 "^0.3.0" - babel-plugin-polyfill-regenerator "^0.2.3" - core-js-compat "^3.19.0" + babel-plugin-polyfill-corejs2 "^0.3.0" + babel-plugin-polyfill-corejs3 "^0.4.0" + babel-plugin-polyfill-regenerator "^0.3.0" + core-js-compat "^3.19.1" semver "^6.3.0" "@babel/preset-flow@^7.12.1": @@ -1111,93 +1111,93 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.3.1.tgz#e8ea3a475d3f8162f23d69efbfaa9cbe486bee93" - integrity sha512-RkFNWmv0iui+qsOr/29q9dyfKTTT5DCuP31kUwg7rmOKPT/ozLeGLKJKVIiOfbiKyleUZKIrHwhmiZWVe8IMdw== +"@jest/console@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.4.2.tgz#7a95612d38c007ddb528ee446fe5e5e785e685ce" + integrity sha512-xknHThRsPB/To1FUbi6pCe43y58qFC03zfb6R7fDb/FfC7k2R3i1l+izRBJf8DI46KhYGRaF14Eo9A3qbBoixg== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.3.1" - jest-util "^27.3.1" + jest-message-util "^27.4.2" + jest-util "^27.4.2" slash "^3.0.0" -"@jest/core@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.3.1.tgz#04992ef1b58b17c459afb87ab56d81e63d386925" - integrity sha512-DMNE90RR5QKx0EA+wqe3/TNEwiRpOkhshKNxtLxd4rt3IZpCt+RSL+FoJsGeblRZmqdK4upHA/mKKGPPRAifhg== +"@jest/core@^27.4.3": + version "27.4.3" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.4.3.tgz#9b9b34f4e6429a633085f476402aa2e3ce707877" + integrity sha512-V9ms3zSxUHxh1E/ZLAiXF7SLejsdFnjWTFizWotMOWvjho0lW5kSjZymhQSodNW0T0ZMQRiha7f8+NcFVm3hJQ== dependencies: - "@jest/console" "^27.3.1" - "@jest/reporters" "^27.3.1" - "@jest/test-result" "^27.3.1" - "@jest/transform" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/console" "^27.4.2" + "@jest/reporters" "^27.4.2" + "@jest/test-result" "^27.4.2" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^27.3.0" - jest-config "^27.3.1" - jest-haste-map "^27.3.1" - jest-message-util "^27.3.1" - jest-regex-util "^27.0.6" - jest-resolve "^27.3.1" - jest-resolve-dependencies "^27.3.1" - jest-runner "^27.3.1" - jest-runtime "^27.3.1" - jest-snapshot "^27.3.1" - jest-util "^27.3.1" - jest-validate "^27.3.1" - jest-watcher "^27.3.1" + jest-changed-files "^27.4.2" + jest-config "^27.4.3" + jest-haste-map "^27.4.2" + jest-message-util "^27.4.2" + jest-regex-util "^27.4.0" + jest-resolve "^27.4.2" + jest-resolve-dependencies "^27.4.2" + jest-runner "^27.4.3" + jest-runtime "^27.4.2" + jest-snapshot "^27.4.2" + jest-util "^27.4.2" + jest-validate "^27.4.2" + jest-watcher "^27.4.2" micromatch "^4.0.4" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.3.1.tgz#2182defbce8d385fd51c5e7c7050f510bd4c86b1" - integrity sha512-BCKCj4mOVLme6Tanoyc9k0ultp3pnmuyHw73UHRPeeZxirsU/7E3HC4le/VDb/SMzE1JcPnto+XBKFOcoiJzVw== +"@jest/environment@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.4.2.tgz#03efabce528dbb09bffd3ec7e39bb0f3f7475cc2" + integrity sha512-uSljKxh/rGlHlmhyeG4ZoVK9hOec+EPBkwTHkHKQ2EqDu5K+MaG9uJZ8o1CbRsSdZqSuhXvJCYhBWsORPPg6qw== dependencies: - "@jest/fake-timers" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/fake-timers" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" - jest-mock "^27.3.0" + jest-mock "^27.4.2" -"@jest/fake-timers@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.3.1.tgz#1fad860ee9b13034762cdb94266e95609dfce641" - integrity sha512-M3ZFgwwlqJtWZ+QkBG5NmC23A9w+A6ZxNsO5nJxJsKYt4yguBd3i8TpjQz5NfCX91nEve1KqD9RA2Q+Q1uWqoA== +"@jest/fake-timers@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.4.2.tgz#d217f86c3ba2027bf29e0b731fd0cb761a72d093" + integrity sha512-f/Xpzn5YQk5adtqBgvw1V6bF8Nx3hY0OIRRpCvWcfPl0EAjdqWPdhH3t/3XpiWZqtjIEHDyMKP9ajpva1l4Zmg== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" "@sinonjs/fake-timers" "^8.0.1" "@types/node" "*" - jest-message-util "^27.3.1" - jest-mock "^27.3.0" - jest-util "^27.3.1" + jest-message-util "^27.4.2" + jest-mock "^27.4.2" + jest-util "^27.4.2" -"@jest/globals@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.3.1.tgz#ce1dfb03d379237a9da6c1b99ecfaca1922a5f9e" - integrity sha512-Q651FWiWQAIFiN+zS51xqhdZ8g9b88nGCobC87argAxA7nMfNQq0Q0i9zTfQYgLa6qFXk2cGANEqfK051CZ8Pg== +"@jest/globals@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.4.2.tgz#56a402c5ebf22eba1d34e900772147f5126ea2d8" + integrity sha512-KkfaHEttlGpXYAQTZHgrESiEPx2q/DKAFLGLFda1uGVrqc17snd3YVPhOxlXOHIzVPs+lQ/SDB2EIvxyGzb3Ew== dependencies: - "@jest/environment" "^27.3.1" - "@jest/types" "^27.2.5" - expect "^27.3.1" + "@jest/environment" "^27.4.2" + "@jest/types" "^27.4.2" + expect "^27.4.2" -"@jest/reporters@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.3.1.tgz#28b5c1f5789481e23788048fa822ed15486430b9" - integrity sha512-m2YxPmL9Qn1emFVgZGEiMwDntDxRRQ2D58tiDQlwYTg5GvbFOKseYCcHtn0WsI8CG4vzPglo3nqbOiT8ySBT/w== +"@jest/reporters@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.4.2.tgz#d3860c5d3f668fa1326ab2bf5989f774e5c03f04" + integrity sha512-sp4aqmdBJtjKetEakzDPcZggPcVIF6w9QLkYBbaWDV6e/SIsHnF1S4KtIH91eEc2fp7ep6V/e1xvdfEoho1d2w== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.3.1" - "@jest/test-result" "^27.3.1" - "@jest/transform" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/console" "^27.4.2" + "@jest/test-result" "^27.4.2" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" @@ -1209,70 +1209,70 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.3.1" - jest-resolve "^27.3.1" - jest-util "^27.3.1" - jest-worker "^27.3.1" + jest-haste-map "^27.4.2" + jest-resolve "^27.4.2" + jest-util "^27.4.2" + jest-worker "^27.4.2" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" terminal-link "^2.0.0" v8-to-istanbul "^8.1.0" -"@jest/source-map@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.0.6.tgz#be9e9b93565d49b0548b86e232092491fb60551f" - integrity sha512-Fek4mi5KQrqmlY07T23JRi0e7Z9bXTOOD86V/uS0EIW4PClvPDqZOyFlLpNJheS6QI0FNX1CgmPjtJ4EA/2M+g== +"@jest/source-map@^27.4.0": + version "27.4.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.4.0.tgz#2f0385d0d884fb3e2554e8f71f8fa957af9a74b6" + integrity sha512-Ntjx9jzP26Bvhbm93z/AKcPRj/9wrkI88/gK60glXDx1q+IeI0rf7Lw2c89Ch6ofonB0On/iRDreQuQ6te9pgQ== dependencies: callsites "^3.0.0" graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.3.1.tgz#89adee8b771877c69b3b8d59f52f29dccc300194" - integrity sha512-mLn6Thm+w2yl0opM8J/QnPTqrfS4FoXsXF2WIWJb2O/GBSyResL71BRuMYbYRsGt7ELwS5JGcEcGb52BNrumgg== +"@jest/test-result@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.4.2.tgz#05fd4a5466ec502f3eae0b39dff2b93ea4d5d9ec" + integrity sha512-kr+bCrra9jfTgxHXHa2UwoQjxvQk3Am6QbpAiJ5x/50LW8llOYrxILkqY0lZRW/hu8FXesnudbql263+EW9iNA== dependencies: - "@jest/console" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/console" "^27.4.2" + "@jest/types" "^27.4.2" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.3.1.tgz#4b3bde2dbb05ee74afdae608cf0768e3354683b1" - integrity sha512-siySLo07IMEdSjA4fqEnxfIX8lB/lWYsBPwNFtkOvsFQvmBrL3yj3k3uFNZv/JDyApTakRpxbKLJ3CT8UGVCrA== +"@jest/test-sequencer@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.4.2.tgz#94bb7e5412d59ae2a8a4b8f9925bb16b6dc82b4c" + integrity sha512-HmHp5mlh9f9GyNej5yCS1JZIFfUGnP9+jEOH5zoq5EmsuZeYD+dGULqyvGDPtuzzbyAFJ6R4+z4SS0VvnFwwGQ== dependencies: - "@jest/test-result" "^27.3.1" + "@jest/test-result" "^27.4.2" graceful-fs "^4.2.4" - jest-haste-map "^27.3.1" - jest-runtime "^27.3.1" + jest-haste-map "^27.4.2" + jest-runtime "^27.4.2" -"@jest/transform@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.3.1.tgz#ff80eafbeabe811e9025e4b6f452126718455220" - integrity sha512-3fSvQ02kuvjOI1C1ssqMVBKJpZf6nwoCiSu00zAKh5nrp3SptNtZy/8s5deayHnqxhjD9CWDJ+yqQwuQ0ZafXQ== +"@jest/transform@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.4.2.tgz#459885e96de2e21fc68b8b371e90aa653966dd0d" + integrity sha512-RTKcPZllfcmLfnlxBya7aypofhdz05+E6QITe55Ex0rxyerkgjmmpMlvVn11V0cP719Ps6WcDYCnDzxnnJUwKg== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.3.1" - jest-regex-util "^27.0.6" - jest-util "^27.3.1" + jest-haste-map "^27.4.2" + jest-regex-util "^27.4.0" + jest-util "^27.4.2" micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^27.2.5": - version "27.2.5" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.5.tgz#420765c052605e75686982d24b061b4cbba22132" - integrity sha512-nmuM4VuDtCZcY+eTpw+0nvstwReMsjPoj7ZR80/BbixulhLaiX+fbv8oeLW8WZlJMcsGQsTmMKT/iTZu1Uy/lQ== +"@jest/types@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.4.2.tgz#96536ebd34da6392c2b7c7737d693885b5dd44a5" + integrity sha512-j35yw0PMTPpZsUoOBiuHzr1zTYoad1cVIE0ajEjcrJONxxrko/IRGKkXx3os0Nsi4Hu3+5VmDbVfq5WhG/pWAg== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" @@ -2204,6 +2204,14 @@ estree-walker "^1.0.1" picomatch "^2.2.2" +"@rollup/pluginutils@^4.1.1": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.1.tgz#1d4da86dd4eded15656a57d933fda2b9a08d47ec" + integrity sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ== + dependencies: + estree-walker "^2.0.1" + picomatch "^2.2.2" + "@sinonjs/commons@^1.7.0": version "1.8.3" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" @@ -2302,7 +2310,7 @@ resolved "https://registry.yarnpkg.com/@types/crypto-js/-/crypto-js-4.0.2.tgz#4524325a175bf819fec6e42560c389ce1fb92c97" integrity sha512-sCVniU+h3GcGqxOmng11BRvf9TfN9yIs8KKjB8C8d75W69cpTfZG80gau9yTx5SxF3gvHGbJhdESzzvnjtf3Og== -"@types/estree@*": +"@types/estree@*", "@types/estree@^0.0.50": version "0.0.50" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== @@ -2338,10 +2346,10 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@^27.0.2": - version "27.0.2" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.2.tgz#ac383c4d4aaddd29bbf2b916d8d105c304a5fcd7" - integrity sha512-4dRxkS/AFX0c5XW6IPMNOydLn2tEhNhJV7DnYK+0bjoJZ+QTmfucBlihX7aoEsh/ocYtkLC73UbnBXBXIxsULA== +"@types/jest@^27.0.2", "@types/jest@^27.0.3": + version "27.0.3" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.3.tgz#0cf9dfe9009e467f70a342f0f94ead19842a783a" + integrity sha512-cmmwv9t7gBYt7hNKH5Spu7Kuu/DotGa+Ff+JGRKZ4db5eh8PnKS4LuebJ3YLUoyOyIHraTGyULn23YtEAm0VSg== dependencies: jest-diff "^27.0.0" pretty-format "^27.0.0" @@ -2356,10 +2364,10 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== -"@types/node@*", "@types/node@^16.10.2", "@types/node@^16.11.7": - version "16.11.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.7.tgz#36820945061326978c42a01e56b61cd223dfdc42" - integrity sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw== +"@types/node@*", "@types/node@^16.11.11", "@types/node@^16.11.7": + version "16.11.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.11.tgz#6ea7342dfb379ea1210835bada87b3c512120234" + integrity sha512-KB0sixD67CeecHC33MYn+eYARkqTheIRNuu97y2XMjR7Wu3XibO1vaY6VBV6O/a89SPI81cEUIYT87UqUWlZNw== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -2372,9 +2380,9 @@ integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== "@types/prettier@*", "@types/prettier@^2.1.5": - version "2.4.1" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.1.tgz#e1303048d5389563e130f5bdd89d37a99acb75eb" - integrity sha512-Fo79ojj3vdEZOHg3wR9ksAMRz4P3S5fDB5e/YWZiFnyFQI1WY2Vftu9XoXVVtJfxB7Bpce/QTqWSSntkz2Znrw== + version "2.4.2" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.2.tgz#4c62fae93eb479660c3bd93f9d24d561597a8281" + integrity sha512-ekoj4qOQYp7CvjX8ZDBgN86w3MqQhLE1hczEJbEIjgFEumDy+na/4AJAbLXfgEWFNB2pKadM5rPFtuSGMWK7xA== "@types/prop-types@*": version "15.7.4" @@ -2395,10 +2403,10 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@>=16.9.0", "@types/react@^17.0.32", "@types/react@^17.0.34": - version "17.0.34" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.34.tgz#797b66d359b692e3f19991b6b07e4b0c706c0102" - integrity sha512-46FEGrMjc2+8XhHXILr+3+/sTe3OfzSPU9YGKILLrUYbQ1CLQC9Daqo1KzENGXAWwrFwiY0l4ZbF20gRvgpWTg== +"@types/react@*", "@types/react@>=16.9.0", "@types/react@^17.0.34", "@types/react@^17.0.37": + version "17.0.37" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.37.tgz#6884d0aa402605935c397ae689deed115caad959" + integrity sha512-2FS1oTqBGcH/s0E+CjrCCR9+JMpsu9b69RTFO+40ua43ZqP5MmQ4iUde/dMjWR909KxZwmOQIFq6AV6NjEG5xg== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -2421,15 +2429,15 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== -"@types/uuid@^8.3.1": - version "8.3.1" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.1.tgz#1a32969cf8f0364b3d8c8af9cc3555b7805df14f" - integrity sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg== +"@types/uuid@^8.3.1", "@types/uuid@^8.3.3": + version "8.3.3" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.3.tgz#c6a60686d953dbd1b1d45e66f4ecdbd5d471b4d0" + integrity sha512-0LbEEx1zxrYB3pgpd1M5lEhLcXjKJnYghvhTRgaBeUivLHMDM1TzF3IJ6hXU2+8uA4Xz+5BA63mtZo5DjVT8iA== -"@types/ws@^8.2.0": - version "8.2.0" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.2.0.tgz#75faefbe2328f3b833cb8dc640658328990d04f3" - integrity sha512-cyeefcUCgJlEk+hk2h3N+MqKKsPViQgF5boi9TTHSK+PoR9KWBb/C5ccPcDyAqgsbAYHTwulch725DV84+pSpg== +"@types/ws@^8.2.0", "@types/ws@^8.2.1": + version "8.2.1" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.2.1.tgz#7bdf6b12869726c9f3cc3c48485efea5d4505274" + integrity sha512-SqQ+LhVZaJi7c7sYVkjWALDigi/Wy7h7Iu72gkQp8Y8OWw/DddEVBrTSKu86pQftV2+Gm8lYM61hadPKqyaIeg== dependencies: "@types/node" "*" @@ -2446,47 +2454,47 @@ "@types/yargs-parser" "*" "@typescript-eslint/parser@^5.3.1": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.3.1.tgz#8ff1977c3d3200c217b3e4628d43ef92f89e5261" - integrity sha512-TD+ONlx5c+Qhk21x9gsJAMRohWAUMavSOmJgv3JGy9dgPhuBd5Wok0lmMClZDyJNLLZK1JRKiATzCKZNUmoyfw== + version "5.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.5.0.tgz#a38070e225330b771074daa659118238793f7fcd" + integrity sha512-JsXBU+kgQOAgzUn2jPrLA+Rd0Y1dswOlX3hp8MuRO1hQDs6xgHtbCXEiAu7bz5hyVURxbXcA2draasMbNqrhmg== dependencies: - "@typescript-eslint/scope-manager" "5.3.1" - "@typescript-eslint/types" "5.3.1" - "@typescript-eslint/typescript-estree" "5.3.1" + "@typescript-eslint/scope-manager" "5.5.0" + "@typescript-eslint/types" "5.5.0" + "@typescript-eslint/typescript-estree" "5.5.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.3.1": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.3.1.tgz#3cfbfbcf5488fb2a9a6fbbe97963ee1e8d419269" - integrity sha512-XksFVBgAq0Y9H40BDbuPOTUIp7dn4u8oOuhcgGq7EoDP50eqcafkMVGrypyVGvDYHzjhdUCUwuwVUK4JhkMAMg== +"@typescript-eslint/scope-manager@5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.5.0.tgz#2b9f3672fa6cddcb4160e7e8b49ef1fd00f83c09" + integrity sha512-0/r656RmRLo7CbN4Mdd+xZyPJ/fPCKhYdU6mnZx+8msAD8nJSP8EyCFkzbd6vNVZzZvWlMYrSNekqGrCBqFQhg== dependencies: - "@typescript-eslint/types" "5.3.1" - "@typescript-eslint/visitor-keys" "5.3.1" + "@typescript-eslint/types" "5.5.0" + "@typescript-eslint/visitor-keys" "5.5.0" -"@typescript-eslint/types@5.3.1": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.3.1.tgz#afaa715b69ebfcfde3af8b0403bf27527912f9b7" - integrity sha512-bG7HeBLolxKHtdHG54Uac750eXuQQPpdJfCYuw4ZI3bZ7+GgKClMWM8jExBtp7NSP4m8PmLRM8+lhzkYnSmSxQ== +"@typescript-eslint/types@5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.5.0.tgz#fee61ae510e84ed950a53937a2b443e078107003" + integrity sha512-OaYTqkW3GnuHxqsxxJ6KypIKd5Uw7bFiQJZRyNi1jbMJnK3Hc/DR4KwB6KJj6PBRkJJoaNwzMNv9vtTk87JhOg== -"@typescript-eslint/typescript-estree@5.3.1": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.3.1.tgz#50cc4bfb93dc31bc75e08ae52e29fcb786d606ec" - integrity sha512-PwFbh/PKDVo/Wct6N3w+E4rLZxUDgsoII/GrWM2A62ETOzJd4M6s0Mu7w4CWsZraTbaC5UQI+dLeyOIFF1PquQ== +"@typescript-eslint/typescript-estree@5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.5.0.tgz#12f422698c1636bd0206086bbec9844c54625ebc" + integrity sha512-pVn8btYUiYrjonhMAO0yG8lm7RApzy2L4RC7Td/mC/qFkyf6vRbGyZozoA94+w6D2Y2GRqpMoCWcwx/EUOzyoQ== dependencies: - "@typescript-eslint/types" "5.3.1" - "@typescript-eslint/visitor-keys" "5.3.1" + "@typescript-eslint/types" "5.5.0" + "@typescript-eslint/visitor-keys" "5.5.0" debug "^4.3.2" globby "^11.0.4" is-glob "^4.0.3" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.3.1": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.3.1.tgz#c2860ff22939352db4f3806f34b21d8ad00588ba" - integrity sha512-3cHUzUuVTuNHx0Gjjt5pEHa87+lzyqOiHXy/Gz+SJOCW1mpw9xQHIIEwnKn+Thph1mgWyZ90nboOcSuZr/jTTQ== +"@typescript-eslint/visitor-keys@5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.5.0.tgz#4787586897b61f26068a3db5c50b3f5d254f9083" + integrity sha512-4GzJ1kRtsWzHhdM40tv0ZKHNSbkDhF0Woi/TDwVJX6UICwJItvP7ZTXbjTkCdrors7ww0sYe0t+cIKDAJwZ7Kw== dependencies: - "@typescript-eslint/types" "5.3.1" + "@typescript-eslint/types" "5.5.0" eslint-visitor-keys "^3.0.0" JSONStream@^1.0.4: @@ -2530,10 +2538,10 @@ acorn@^7.1.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4, acorn@^8.5.0: - version "8.5.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" - integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== +acorn@^8.2.4, acorn@^8.6.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895" + integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw== add-stream@^1.0.0: version "1.0.0" @@ -2757,16 +2765,16 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== -babel-jest@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.3.1.tgz#0636a3404c68e07001e434ac4956d82da8a80022" - integrity sha512-SjIF8hh/ir0peae2D6S6ZKRhUy7q/DnpH7k/V6fT4Bgs/LXXUztOpX4G2tCgq8mLo5HA9mN6NmlFMeYtKmIsTQ== +babel-jest@^27.3.1, babel-jest@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.4.2.tgz#6edf80971045cfd44f3f10b6eda6007d95f62742" + integrity sha512-MADrjb3KBO2eyZCAc6QaJg6RT5u+6oEdDyHO5HEalnpwQ6LrhTsQF2Kj1Wnz2t6UPXIXPk18dSXXOT0wF5yTxA== dependencies: - "@jest/transform" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^27.2.0" + babel-preset-jest "^27.4.0" chalk "^4.0.0" graceful-fs "^4.2.4" slash "^3.0.0" @@ -2789,10 +2797,10 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.2.0.tgz#79f37d43f7e5c4fdc4b2ca3e10cc6cf545626277" - integrity sha512-TOux9khNKdi64mW+0OIhcmbAn75tTlzKhxmiNXevQaPbrBYK7YKjP1jl6NHTJ6XR5UgUrJbCnWlKVnJn29dfjw== +babel-plugin-jest-hoist@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.4.0.tgz#d7831fc0f93573788d80dee7e682482da4c730d6" + integrity sha512-Jcu7qS4OX5kTWBc45Hz7BMmgXuJqRnhatqpUhnzGC3OBYpOmf2tv6jFNwZpwM7wU7MUuv2r9IPS/ZlYOuburVw== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -2815,29 +2823,29 @@ babel-plugin-macros@^3.0.1, babel-plugin-macros@^3.1.0: cosmiconfig "^7.0.0" resolve "^1.19.0" -babel-plugin-polyfill-corejs2@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.3.tgz#6ed8e30981b062f8fe6aca8873a37ebcc8cc1c0f" - integrity sha512-NDZ0auNRzmAfE1oDDPW2JhzIMXUk+FFe2ICejmt5T4ocKgiQx3e0VCRx9NCAidcMtL2RUZaWtXnmjTCkx0tcbA== +babel-plugin-polyfill-corejs2@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.0.tgz#407082d0d355ba565af24126fb6cb8e9115251fd" + integrity sha512-wMDoBJ6uG4u4PNFh72Ty6t3EgfA91puCuAwKIazbQlci+ENb/UU9A3xG5lutjUIiXCIn1CY5L15r9LimiJyrSA== dependencies: "@babel/compat-data" "^7.13.11" - "@babel/helper-define-polyfill-provider" "^0.2.4" + "@babel/helper-define-polyfill-provider" "^0.3.0" semver "^6.1.1" -babel-plugin-polyfill-corejs3@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.3.0.tgz#fa7ca3d1ee9ddc6193600ffb632c9785d54918af" - integrity sha512-JLwi9vloVdXLjzACL80j24bG6/T1gYxwowG44dg6HN/7aTPdyPbJJidf6ajoA3RPHHtW0j9KMrSOLpIZpAnPpg== +babel-plugin-polyfill-corejs3@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.4.0.tgz#0b571f4cf3d67f911512f5c04842a7b8e8263087" + integrity sha512-YxFreYwUfglYKdLUGvIF2nJEsGwj+RhWSX/ije3D2vQPOXuyMLMtg/cCGMDpOA7Nd+MwlNdnGODbd2EwUZPlsw== dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.4" + "@babel/helper-define-polyfill-provider" "^0.3.0" core-js-compat "^3.18.0" -babel-plugin-polyfill-regenerator@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.3.tgz#2e9808f5027c4336c994992b48a4262580cb8d6d" - integrity sha512-JVE78oRZPKFIeUqFGrSORNzQnrDwZR16oiWeGM8ZyjBn2XAT5OjP+wXx5ESuo33nUsFUEJYjtklnsKbxW5L+7g== +babel-plugin-polyfill-regenerator@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.0.tgz#9ebbcd7186e1a33e21c5e20cae4e7983949533be" + integrity sha512-dhAPTDLGoMW5/84wkgwiLRwMnio2i1fUe53EuvtKMv0pn2p3S8OCoV1xAzfJPl0KOX7IB89s2ib85vbYiea3jg== dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.4" + "@babel/helper-define-polyfill-provider" "^0.3.0" babel-plugin-syntax-jsx@^6.0.0: version "6.18.0" @@ -2855,9 +2863,9 @@ babel-plugin-tester@^10.0.0: strip-indent "^3.0.0" babel-plugin-transform-async-to-promises@^0.8.15: - version "0.8.15" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-promises/-/babel-plugin-transform-async-to-promises-0.8.15.tgz#13b6d8ef13676b4e3c576d3600b85344bb1ba346" - integrity sha512-fDXP68ZqcinZO2WCiimCL9zhGjGXOnn3D33zvbh+yheZ/qOrNVVDDIBtAaM3Faz8TRvQzHiRKsu3hfrBAhEncQ== + version "0.8.16" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-promises/-/babel-plugin-transform-async-to-promises-0.8.16.tgz#e7392100cd44f6a56d043c7efd383ffbee1c44a9" + integrity sha512-mm0UMekJVOTuIlkGIEH1fpnExyTIIJ2/L5ixTTI1zAVdMpbG7Em3LiS92p0TCWKiMkHhYYinz/zn2D/BPPJaxA== babel-plugin-transform-replace-expressions@^0.2.0: version "0.2.0" @@ -2884,12 +2892,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.2.0.tgz#556bbbf340608fed5670ab0ea0c8ef2449fba885" - integrity sha512-z7MgQ3peBwN5L5aCqBKnF6iqdlvZvFUQynEhu0J+X9nHLU72jO3iY331lcYrg+AssJ8q7xsv5/3AICzVmJ/wvg== +babel-preset-jest@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.4.0.tgz#70d0e676a282ccb200fbabd7f415db5fdf393bca" + integrity sha512-NK4jGYpnBvNxcGo7/ZpZJr51jCGT+3bwwpVIDY2oNfTxJJldRtB4VAcYdgp1loDE50ODuTu+yBjpMAswv5tlpg== dependencies: - babel-plugin-jest-hoist "^27.2.0" + babel-plugin-jest-hoist "^27.4.0" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -2951,13 +2959,13 @@ browser-process-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== -browserslist@^4.0.0, browserslist@^4.16.0, browserslist@^4.16.6, browserslist@^4.17.5, browserslist@^4.17.6: - version "4.17.6" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.6.tgz#c76be33e7786b497f66cad25a73756c8b938985d" - integrity sha512-uPgz3vyRTlEiCv4ee9KlsKgo2V6qPk7Jsn0KAn2OBqbqKo3iNcPEC1Ti6J4dwnz+aIRfEEEuOzC9IBk8tXUomw== +browserslist@^4.0.0, browserslist@^4.16.0, browserslist@^4.16.6, browserslist@^4.17.5, browserslist@^4.18.1: + version "4.18.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.18.1.tgz#60d3920f25b6860eb917c6c7b185576f4d8b017f" + integrity sha512-8ScCzdpPwR2wQh8IT82CA2VgDwjHyqMovPBZSNH54+tm4Jk2pCuv90gmAdH6J84OCRWi0b4gMe6O6XPXuJnjgQ== dependencies: - caniuse-lite "^1.0.30001274" - electron-to-chromium "^1.3.886" + caniuse-lite "^1.0.30001280" + electron-to-chromium "^1.3.896" escalade "^3.1.1" node-releases "^2.0.1" picocolors "^1.0.0" @@ -3046,9 +3054,9 @@ camelcase@^5.3.1: integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== camelcase@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" - integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== + version "6.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.1.tgz#250fd350cfd555d0d2160b1d51510eaf8326e86e" + integrity sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA== caniuse-api@^3.0.0: version "3.0.0" @@ -3060,10 +3068,10 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001272, caniuse-lite@^1.0.30001274: - version "1.0.30001279" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001279.tgz#eb06818da481ef5096a3b3760f43e5382ed6b0ce" - integrity sha512-VfEHpzHEXj6/CxggTwSFoZBBYGQfQv9Cf42KPlO79sWXCD1QNKWKsKzFeWL7QpZHJQYAvocqV6Rty1yJMkqWLQ== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001272, caniuse-lite@^1.0.30001280: + version "1.0.30001283" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001283.tgz#8573685bdae4d733ef18f78d44ba0ca5fe9e896b" + integrity sha512-9RoKo841j1GQFSJz/nCXOj0sD7tHBtlowjYlrqIUS812x9/emfBLBt6IyMz1zIaYc/eRL8Cs6HPUVi2Hzq4sIg== caseless@~0.12.0: version "0.12.0" @@ -3147,9 +3155,9 @@ ci-info@^2.0.0: integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== ci-info@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.2.0.tgz#2876cb948a498797b5236f0095bc057d0dca38b6" - integrity sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A== + version "3.3.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.0.tgz#b4ed1fb6818dea4803a55c623041f9165d2066b2" + integrity sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw== cjs-module-lexer@^1.0.0: version "1.2.2" @@ -3204,11 +3212,6 @@ clone@^1.0.2: resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= -clone@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" - integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= - cmd-shim@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-4.1.0.tgz#b3a904a6743e9fede4148c6f3800bf2a08135bdd" @@ -3453,18 +3456,18 @@ convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.6.0, dependencies: safe-buffer "~5.1.1" -core-js-compat@^3.18.0, core-js-compat@^3.19.0: - version "3.19.1" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.19.1.tgz#fe598f1a9bf37310d77c3813968e9f7c7bb99476" - integrity sha512-Q/VJ7jAF/y68+aUsQJ/afPOewdsGkDtcMb40J8MbuWKlK3Y+wtHq8bTHKPj2WKWLIqmS5JhHs4CzHtz6pT2W6g== +core-js-compat@^3.18.0, core-js-compat@^3.19.1: + version "3.19.2" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.19.2.tgz#18066a3404a302433cb0aa8be82dd3d75c76e5c4" + integrity sha512-ObBY1W5vx/LFFMaL1P5Udo4Npib6fu+cMokeziWkA8Tns4FcDemKF5j9JvaI5JhdkW8EQJQGJN1EcrzmEwuAqQ== dependencies: - browserslist "^4.17.6" + browserslist "^4.18.1" semver "7.0.0" core-js@^3.0.0: - version "3.19.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.19.1.tgz#f6f173cae23e73a7d88fa23b6e9da329276c6641" - integrity sha512-Tnc7E9iKd/b/ff7GFbhwPVzJzPztGrChB8X8GLqoYGdEOG8IpLnK1xPyo3ZoO3HsK6TodJS58VGPOxA+hLHQMg== + version "3.19.2" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.19.2.tgz#ae216d7f4f7e924d9a2e3ff1e4b1940220f9157b" + integrity sha512-ciYCResnLIATSsXuXnIOH4CbdfgV+H1Ltg16hJFN7/v6OxqnFr/IFGeLacaZ+fHLAm0TBbXwNK9/DNBzBUrO/g== core-util-is@1.0.2: version "1.0.2" @@ -3501,11 +3504,6 @@ crypto-js@^4.0.0: resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.1.1.tgz#9e485bcf03521041bd85844786b83fb7619736cf" integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw== -css-color-names@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-1.0.1.tgz#6ff7ee81a823ad46e020fa2fd6ab40a887e2ba67" - integrity sha512-/loXYOch1qU1biStIFsHH8SxTmOseh1IJqFvy8IujXOm1h+QjUdDhkzOrR5HG8K8mlxREj0yfi8ewCHx0eMxzA== - css-declaration-sorter@^6.0.3: version "6.1.3" resolved "https://registry.yarnpkg.com/css-declaration-sorter/-/css-declaration-sorter-6.1.3.tgz#e9852e4cf940ba79f509d9425b137d1f94438dc2" @@ -3542,10 +3540,10 @@ cssesc@^3.0.0: resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== -cssnano-preset-default@^5.1.6: - version "5.1.6" - resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-5.1.6.tgz#1bdb83be6a6b1fee6dc5e9ec2e61286bcadcc7a6" - integrity sha512-X2nDeNGBXc0486oHjT2vSj+TdeyVsxRvJUxaOH50hOM6vSDLkKd0+59YXpSZRInJ4sNtBOykS4KsPfhdrU/35w== +cssnano-preset-default@^5.1.8: + version "5.1.8" + resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-5.1.8.tgz#7525feb1b72f7b06e57f55064cbdae341d79dea2" + integrity sha512-zWMlP0+AMPBVE852SqTrP0DnhTcTA2C1wAF92TKZ3Va+aUVqLIhkqKlnJIXXdqXD7RN+S1ujuWmNpvrJBiM/vg== dependencies: css-declaration-sorter "^6.0.3" cssnano-utils "^2.0.1" @@ -3556,11 +3554,11 @@ cssnano-preset-default@^5.1.6: postcss-discard-duplicates "^5.0.1" postcss-discard-empty "^5.0.1" postcss-discard-overridden "^5.0.1" - postcss-merge-longhand "^5.0.3" - postcss-merge-rules "^5.0.2" + postcss-merge-longhand "^5.0.4" + postcss-merge-rules "^5.0.3" postcss-minify-font-values "^5.0.1" postcss-minify-gradients "^5.0.3" - postcss-minify-params "^5.0.1" + postcss-minify-params "^5.0.2" postcss-minify-selectors "^5.1.0" postcss-normalize-charset "^5.0.1" postcss-normalize-display-values "^5.0.1" @@ -3569,13 +3567,13 @@ cssnano-preset-default@^5.1.6: postcss-normalize-string "^5.0.1" postcss-normalize-timing-functions "^5.0.1" postcss-normalize-unicode "^5.0.1" - postcss-normalize-url "^5.0.2" + postcss-normalize-url "^5.0.3" postcss-normalize-whitespace "^5.0.1" postcss-ordered-values "^5.0.2" - postcss-reduce-initial "^5.0.1" + postcss-reduce-initial "^5.0.2" postcss-reduce-transforms "^5.0.1" postcss-svgo "^5.0.3" - postcss-unique-selectors "^5.0.1" + postcss-unique-selectors "^5.0.2" cssnano-utils@^2.0.1: version "2.0.1" @@ -3583,11 +3581,11 @@ cssnano-utils@^2.0.1: integrity sha512-i8vLRZTnEH9ubIyfdZCAdIdgnHAUeQeByEeQ2I7oTilvP9oHO6RScpeq3GsFUVqeB8uZgOQ9pw8utofNn32hhQ== cssnano@^5.0.1: - version "5.0.10" - resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-5.0.10.tgz#92207eb7c9c6dc08d318050726f9fad0adf7220b" - integrity sha512-YfNhVJJ04imffOpbPbXP2zjIoByf0m8E2c/s/HnvSvjXgzXMfgopVjAEGvxYOjkOpWuRQDg/OZFjO7WW94Ri8w== + version "5.0.12" + resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-5.0.12.tgz#2c083a1c786fc9dc2d5522bd3c0e331b7cd302ab" + integrity sha512-U38V4x2iJ3ijPdeWqUrEr4eKBB5PbEKsNP5T8xcik2Au3LeMtiMHX0i2Hu9k51FcKofNZumbrcdC6+a521IUHg== dependencies: - cssnano-preset-default "^5.1.6" + cssnano-preset-default "^5.1.8" is-resolvable "^1.1.0" lilconfig "^2.0.3" yaml "^1.10.2" @@ -3617,9 +3615,9 @@ cssstyle@^2.3.0: cssom "~0.3.6" csstype@^3.0.2: - version "3.0.9" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.9.tgz#6410af31b26bd0520933d02cbc64fce9ce3fbf0b" - integrity sha512-rpw6JPxK6Rfg1zLOYCSwle2GFOOsnjmDYDaBwEcwoOg4qlsIVCN789VkBZDJAGi4T07gI4YSutR43t9Zz4Lzuw== + version "3.0.10" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.10.tgz#2ad3a7bed70f35b965707c092e5f30b327c290e5" + integrity sha512-2u44ZG2OcNUO9HDp/Jl8C07x6pU/eTR3ncV91SiK3dhG9TWvRVsCoJw14Ckx5DgWkzGA3waZWO3d7pgqpUI/XA== dargs@^7.0.0: version "7.0.0" @@ -3653,9 +3651,9 @@ dateformat@^3.0.0: integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: - version "4.3.2" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" - integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== + version "4.3.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" + integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== dependencies: ms "2.1.2" @@ -3759,10 +3757,10 @@ dezalgo@^1.0.0: asap "^2.0.0" wrappy "1" -diff-sequences@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723" - integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ== +diff-sequences@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.4.0.tgz#d783920ad8d06ec718a060d00196dfef25b132a5" + integrity sha512-YqiQzkrsmHMH5uuh8OdQFU9/ZpADnwzml8z0O5HvRNda+5UZsaX/xN+AAxfR2hWq1Y7HZnAzO9J5lJXOuDz2Ww== dir-glob@^3.0.1: version "3.0.1" @@ -3800,9 +3798,9 @@ domexception@^2.0.1: webidl-conversions "^5.0.0" domhandler@^4.2.0: - version "4.2.2" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.2.2.tgz#e825d721d19a86b8c201a35264e226c678ee755f" - integrity sha512-PzE9aBMsdZO8TK4BnuJwH0QT41wgMbRzuZrHUcpYncEjmQazq8QEaBWgLG7ZyC/DAZKEgglpIA6j4Qn/HmxS3w== + version "4.3.0" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.0.tgz#16c658c626cf966967e306f966b431f77d4a5626" + integrity sha512-fC0aXNQXqKSFTr2wDNZDhsEYjCiYsDWl3D01kwt25hm1YIPyDGHvvi3rw+PLqHAl/m71MaiF7d5zvBr0p5UB2g== dependencies: domelementtype "^2.2.0" @@ -3854,10 +3852,10 @@ ejs@^3.1.6: dependencies: jake "^10.6.1" -electron-to-chromium@^1.3.886: - version "1.3.893" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.893.tgz#9d804c68953b05ede35409dba0d73dd54c077b4d" - integrity sha512-ChtwF7qB03INq1SyMpue08wc6cve+ktj2UC/Y7se9vB+JryfzziJeYwsgb8jLaCA5GMkHCdn5M62PfSMWhifZg== +electron-to-chromium@^1.3.896: + version "1.4.8" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.8.tgz#e1b7752ac1a75e39b5dd90cc7e29ea08b351c484" + integrity sha512-Cu5+dbg55+1E3ohlsa8HT0s4b8D0gBewXEGG8s5wBl8ynWv60VuvYW25GpsOeTVXpulhyU/U8JYZH+yxASSJBQ== emittery@^0.8.1: version "0.8.1" @@ -3989,10 +3987,10 @@ eslint-plugin-prefer-let@^3.0.1: dependencies: requireindex "~1.2.0" -eslint-scope@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-6.0.0.tgz#9cf45b13c5ac8f3d4c50f46a5121f61b3e318978" - integrity sha512-uRDL9MWmQCkaFus8RF5K9/L/2fn+80yoW3jkD53l4shjCh26fCtvJGasxjUqP5OT87SYTxCVA3BwTUzuELx9kA== +eslint-scope@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.0.tgz#c1f6ea30ac583031f203d65c73e723b01298f153" + integrity sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" @@ -4009,15 +4007,15 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.0.0: +eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2" integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== eslint@^8.1.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.2.0.tgz#44d3fb506d0f866a506d97a0fc0e90ee6d06a815" - integrity sha512-erw7XmM+CLxTOickrimJ1SiF55jiNlVSp2qqm0NuBWPtHYQCegD5ZMaW0c3i5ytPqL+SSLaCxdvQXFPLJn+ABw== + version "8.3.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.3.0.tgz#a3c2409507403c1c7f6c42926111d6cbefbc3e85" + integrity sha512-aIay56Ph6RxOTC7xyr59Kt3ewX185SaGnAr8eWukoPLeriCrvGjvAubxuvaXOfsxhtwV5g0uBOsyhAom4qJdww== dependencies: "@eslint/eslintrc" "^1.0.4" "@humanwhocodes/config-array" "^0.6.0" @@ -4028,10 +4026,10 @@ eslint@^8.1.0: doctrine "^3.0.0" enquirer "^2.3.5" escape-string-regexp "^4.0.0" - eslint-scope "^6.0.0" + eslint-scope "^7.1.0" eslint-utils "^3.0.0" - eslint-visitor-keys "^3.0.0" - espree "^9.0.0" + eslint-visitor-keys "^3.1.0" + espree "^9.1.0" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -4058,14 +4056,14 @@ eslint@^8.1.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.0.0.tgz#e90a2965698228502e771c7a58489b1a9d107090" - integrity sha512-r5EQJcYZ2oaGbeR0jR0fFVijGOcwai07/690YRXLINuhmVeRY4UKSAsQPe/0BNuDgwP7Ophoc1PRsr2E3tkbdQ== +espree@^9.0.0, espree@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.1.0.tgz#ba9d3c9b34eeae205724124e31de4543d59fbf74" + integrity sha512-ZgYLvCS1wxOczBYGcQT9DDWgicXwJ4dbocr9uYN+/eresBAUuBu+O4WzB21ufQ/JqQT8gyp7hJ3z8SHii32mTQ== dependencies: - acorn "^8.5.0" + acorn "^8.6.0" acorn-jsx "^5.3.1" - eslint-visitor-keys "^3.0.0" + eslint-visitor-keys "^3.1.0" esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" @@ -4136,17 +4134,17 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.3.1.tgz#d0f170b1f5c8a2009bab0beffd4bb94f043e38e7" - integrity sha512-MrNXV2sL9iDRebWPGOGFdPQRl2eDQNu/uhxIMShjjx74T6kC6jFIkmQ6OqXDtevjGUkyB2IT56RzDBqXf/QPCg== +expect@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.4.2.tgz#4429b0f7e307771d176de9bdf23229b101db6ef6" + integrity sha512-BjAXIDC6ZOW+WBFNg96J22D27Nq5ohn+oGcuP2rtOtcjuxNoV9McpQ60PcQWhdFOSBIQdR72e+4HdnbZTFSTyg== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" ansi-styles "^5.0.0" - jest-get-type "^27.3.1" - jest-matcher-utils "^27.3.1" - jest-message-util "^27.3.1" - jest-regex-util "^27.0.6" + jest-get-type "^27.4.0" + jest-matcher-utils "^27.4.2" + jest-message-util "^27.4.2" + jest-regex-util "^27.4.0" extend@~3.0.2: version "3.0.2" @@ -4372,9 +4370,9 @@ formdata-polyfill@^4.0.10: fetch-blob "^3.1.2" fraction.js@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.1.1.tgz#ac4e520473dae67012d618aab91eda09bcb400ff" - integrity sha512-MHOhvvxHTfRFpF1geTK9czMIZ6xclsEor2wkIGYYq+PxcQqT7vStJqjhe6S1TenZrMZzo+wlqOufBDVepUEgPg== + version "4.1.2" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.1.2.tgz#13e420a92422b6cf244dff8690ed89401029fbe8" + integrity sha512-o2RiJQ6DZaR/5+Si0qJUIy637QMRudSi9kU/FFzx9EZazrIdnBgpU+3sEWCxAVhH2RtxW2Oz+T4p2o8uOPVcgA== fs-extra@8.1.0: version "8.1.0" @@ -5263,9 +5261,9 @@ istanbul-lib-source-maps@^4.0.0: source-map "^0.6.1" istanbul-reports@^3.0.2: - version "3.0.5" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.5.tgz#a2580107e71279ea6d661ddede929ffc6d693384" - integrity sha512-5+19PlhnGabNWB7kOFnuxT8H3T/iIyQzIbQMxXsURmmvKg86P2sbkrGOT77VnHw0Qr0gc2XzRaRfMZYYbSQCJQ== + version "3.1.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.1.tgz#7085857f17d2441053c6ce5c3b8fdf6882289397" + integrity sha512-q1kvhAXWSsXfMjCdNHNPKZZv94OlspKnoGv+R9RGbnqOOQ0VbNfLFgQDVgi7hHenKsndGq3/o0OBdzDXthWcNw== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" @@ -5280,226 +5278,227 @@ jake@^10.6.1: filelist "^1.0.1" minimatch "^3.0.4" -jest-changed-files@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.3.0.tgz#22a02cc2b34583fc66e443171dc271c0529d263c" - integrity sha512-9DJs9garMHv4RhylUMZgbdCJ3+jHSkpL9aaVKp13xtXAD80qLTLrqcDZL1PHA9dYA0bCI86Nv2BhkLpLhrBcPg== +jest-changed-files@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.4.2.tgz#da2547ea47c6e6a5f6ed336151bd2075736eb4a5" + integrity sha512-/9x8MjekuzUQoPjDHbBiXbNEBauhrPU2ct7m8TfCg69ywt1y/N+yYwGh3gCpnqUS3klYWDU/lSNgv+JhoD2k1A== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.3.1.tgz#1679e74387cbbf0c6a8b42de963250a6469e0797" - integrity sha512-v1dsM9II6gvXokgqq6Yh2jHCpfg7ZqV4jWY66u7npz24JnhP3NHxI0sKT7+ZMQ7IrOWHYAaeEllOySbDbWsiXw== +jest-circus@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.4.2.tgz#466f482207ca9f323b78416c28f4d1fa7588159a" + integrity sha512-2ePUSru1BGMyzxsMvRfu+tNb+PW60rUyMLJBfw1Nrh5zC8RoTPfF+zbE0JToU31a6ZVe4nnrNKWYRzlghAbL0A== dependencies: - "@jest/environment" "^27.3.1" - "@jest/test-result" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/environment" "^27.4.2" + "@jest/test-result" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.3.1" + expect "^27.4.2" is-generator-fn "^2.0.0" - jest-each "^27.3.1" - jest-matcher-utils "^27.3.1" - jest-message-util "^27.3.1" - jest-runtime "^27.3.1" - jest-snapshot "^27.3.1" - jest-util "^27.3.1" - pretty-format "^27.3.1" + jest-each "^27.4.2" + jest-matcher-utils "^27.4.2" + jest-message-util "^27.4.2" + jest-runtime "^27.4.2" + jest-snapshot "^27.4.2" + jest-util "^27.4.2" + pretty-format "^27.4.2" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.3.1.tgz#b576f9d146ba6643ce0a162d782b40152b6b1d16" - integrity sha512-WHnCqpfK+6EvT62me6WVs8NhtbjAS4/6vZJnk7/2+oOr50cwAzG4Wxt6RXX0hu6m1169ZGMlhYYUNeKBXCph/Q== +jest-cli@^27.4.3: + version "27.4.3" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.4.3.tgz#89acba683b9f91c7a5e342e2ea13aa5414836a0d" + integrity sha512-zZSJBXNC/i8UnJPwcKWsqnhGgIF3uoTYP7th32Zej7KNQJdxzOMj+wCfy2Ox3kU7nXErJ36DtYyXDhfiqaiDRw== dependencies: - "@jest/core" "^27.3.1" - "@jest/test-result" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/core" "^27.4.3" + "@jest/test-result" "^27.4.2" + "@jest/types" "^27.4.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.3.1" - jest-util "^27.3.1" - jest-validate "^27.3.1" + jest-config "^27.4.3" + jest-util "^27.4.2" + jest-validate "^27.4.2" prompts "^2.0.1" yargs "^16.2.0" -jest-config@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.3.1.tgz#cb3b7f6aaa8c0a7daad4f2b9573899ca7e09bbad" - integrity sha512-KY8xOIbIACZ/vdYCKSopL44I0xboxC751IX+DXL2+Wx6DKNycyEfV3rryC3BPm5Uq/BBqDoMrKuqLEUNJmMKKg== +jest-config@^27.4.3: + version "27.4.3" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.4.3.tgz#7820e08f7526fa3f725423e2f0fa7888ee0ef9c9" + integrity sha512-DQ10HTSqYtC2pO7s9j2jw+li4xUnm2wLYWH2o7K1ftB8NyvToHsXoLlXxtsGh3AW9gUQR6KY/4B7G+T/NswJBw== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.3.1" - "@jest/types" "^27.2.5" - babel-jest "^27.3.1" + "@jest/test-sequencer" "^27.4.2" + "@jest/types" "^27.4.2" + babel-jest "^27.4.2" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" - jest-circus "^27.3.1" - jest-environment-jsdom "^27.3.1" - jest-environment-node "^27.3.1" - jest-get-type "^27.3.1" - jest-jasmine2 "^27.3.1" - jest-regex-util "^27.0.6" - jest-resolve "^27.3.1" - jest-runner "^27.3.1" - jest-util "^27.3.1" - jest-validate "^27.3.1" + jest-circus "^27.4.2" + jest-environment-jsdom "^27.4.3" + jest-environment-node "^27.4.2" + jest-get-type "^27.4.0" + jest-jasmine2 "^27.4.2" + jest-regex-util "^27.4.0" + jest-resolve "^27.4.2" + jest-runner "^27.4.3" + jest-util "^27.4.2" + jest-validate "^27.4.2" micromatch "^4.0.4" - pretty-format "^27.3.1" + pretty-format "^27.4.2" + slash "^3.0.0" -jest-diff@^27.0.0, jest-diff@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.3.1.tgz#d2775fea15411f5f5aeda2a5e02c2f36440f6d55" - integrity sha512-PCeuAH4AWUo2O5+ksW4pL9v5xJAcIKPUPfIhZBcG1RKv/0+dvaWTQK1Nrau8d67dp65fOqbeMdoil+6PedyEPQ== +jest-diff@^27.0.0, jest-diff@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.4.2.tgz#786b2a5211d854f848e2dcc1e324448e9481f36f" + integrity sha512-ujc9ToyUZDh9KcqvQDkk/gkbf6zSaeEg9AiBxtttXW59H/AcqEYp1ciXAtJp+jXWva5nAf/ePtSsgWwE5mqp4Q== dependencies: chalk "^4.0.0" - diff-sequences "^27.0.6" - jest-get-type "^27.3.1" - pretty-format "^27.3.1" + diff-sequences "^27.4.0" + jest-get-type "^27.4.0" + pretty-format "^27.4.2" -jest-docblock@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.0.6.tgz#cc78266acf7fe693ca462cbbda0ea4e639e4e5f3" - integrity sha512-Fid6dPcjwepTFraz0YxIMCi7dejjJ/KL9FBjPYhBp4Sv1Y9PdhImlKZqYU555BlN4TQKaTc+F2Av1z+anVyGkA== +jest-docblock@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.4.0.tgz#06c78035ca93cbbb84faf8fce64deae79a59f69f" + integrity sha512-7TBazUdCKGV7svZ+gh7C8esAnweJoG+SvcF6Cjqj4l17zA2q1cMwx2JObSioubk317H+cjcHgP+7fTs60paulg== dependencies: detect-newline "^3.0.0" -jest-each@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.3.1.tgz#14c56bb4f18dd18dc6bdd853919b5f16a17761ff" - integrity sha512-E4SwfzKJWYcvOYCjOxhZcxwL+AY0uFMvdCOwvzgutJiaiodFjkxQQDxHm8FQBeTqDnSmKsQWn7ldMRzTn2zJaQ== +jest-each@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.4.2.tgz#19364c82a692d0d26557642098d1f4619c9ee7d3" + integrity sha512-53V2MNyW28CTruB3lXaHNk6PkiIFuzdOC9gR3C6j8YE/ACfrPnz+slB0s17AgU1TtxNzLuHyvNlLJ+8QYw9nBg== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" chalk "^4.0.0" - jest-get-type "^27.3.1" - jest-util "^27.3.1" - pretty-format "^27.3.1" - -jest-environment-jsdom@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.3.1.tgz#63ac36d68f7a9303494df783494856222b57f73e" - integrity sha512-3MOy8qMzIkQlfb3W1TfrD7uZHj+xx8Olix5vMENkj5djPmRqndMaXtpnaZkxmxM+Qc3lo+yVzJjzuXbCcZjAlg== - dependencies: - "@jest/environment" "^27.3.1" - "@jest/fake-timers" "^27.3.1" - "@jest/types" "^27.2.5" + jest-get-type "^27.4.0" + jest-util "^27.4.2" + pretty-format "^27.4.2" + +jest-environment-jsdom@^27.4.3: + version "27.4.3" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.4.3.tgz#74198285f6284888ca9c7486c4e5e67add75aa53" + integrity sha512-x1AUVz3G14LpEJs7KIFUaTINT2n0unOUmvdAby3s/sldUpJJetOJifHo1O/EUQC5fNBowggwJbVulko18y6OWw== + dependencies: + "@jest/environment" "^27.4.2" + "@jest/fake-timers" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" - jest-mock "^27.3.0" - jest-util "^27.3.1" + jest-mock "^27.4.2" + jest-util "^27.4.2" jsdom "^16.6.0" -jest-environment-node@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.3.1.tgz#af7d0eed04edafb740311b303f3fe7c8c27014bb" - integrity sha512-T89F/FgkE8waqrTSA7/ydMkcc52uYPgZZ6q8OaZgyiZkJb5QNNCF6oPZjH9IfPFfcc9uBWh1574N0kY0pSvTXw== +jest-environment-node@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.4.2.tgz#bf5586a0924a8d21c13838121ac0941638c7d15e" + integrity sha512-nzTZ5nJ+FabuZPH2YVci7SZIHpvtNRHPt8+vipLkCnAgXGjVzHm7XJWdnNqXbAkExIgiKeVEkVMNZOZE/LeiIg== dependencies: - "@jest/environment" "^27.3.1" - "@jest/fake-timers" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/environment" "^27.4.2" + "@jest/fake-timers" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" - jest-mock "^27.3.0" - jest-util "^27.3.1" + jest-mock "^27.4.2" + jest-util "^27.4.2" -jest-get-type@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.3.1.tgz#a8a2b0a12b50169773099eee60a0e6dd11423eff" - integrity sha512-+Ilqi8hgHSAdhlQ3s12CAVNd8H96ZkQBfYoXmArzZnOfAtVAJEiPDBirjByEblvG/4LPJmkL+nBqPO3A1YJAEg== +jest-get-type@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.4.0.tgz#7503d2663fffa431638337b3998d39c5e928e9b5" + integrity sha512-tk9o+ld5TWq41DkK14L4wox4s2D9MtTpKaAVzXfr5CUKm5ZK2ExcaFE0qls2W71zE/6R2TxxrK9w2r6svAFDBQ== -jest-haste-map@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.3.1.tgz#7656fbd64bf48bda904e759fc9d93e2c807353ee" - integrity sha512-lYfNZIzwPccDJZIyk9Iz5iQMM/MH56NIIcGj7AFU1YyA4ewWFBl8z+YPJuSCRML/ee2cCt2y3W4K3VXPT6Nhzg== +jest-haste-map@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.4.2.tgz#7fc7d5e568cca704284f4850885b74a0b8b87587" + integrity sha512-foiyAEePORUN2eeJnOtcM1y8qW0ShEd9kTjWVL4sVaMcuCJM6gtHegvYPBRT0mpI/bs4ueThM90+Eoj2ncoNsA== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.4" - jest-regex-util "^27.0.6" - jest-serializer "^27.0.6" - jest-util "^27.3.1" - jest-worker "^27.3.1" + jest-regex-util "^27.4.0" + jest-serializer "^27.4.0" + jest-util "^27.4.2" + jest-worker "^27.4.2" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.3.1.tgz#df6d3d07c7dafc344feb43a0072a6f09458d32b0" - integrity sha512-WK11ZUetDQaC09w4/j7o4FZDUIp+4iYWH/Lik34Pv7ukL+DuXFGdnmmi7dT58J2ZYKFB5r13GyE0z3NPeyJmsg== +jest-jasmine2@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.4.2.tgz#c956c88b9c05ca22afdc779deebc2890cb891797" + integrity sha512-VO/fyAJSH9u0THjbteFiL8qc93ufU+yW+bdieDc8tzTCWwlWzO53UHS5nFK1qmE8izb5Smkn+XHlVt6/l06MKQ== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.3.1" - "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/environment" "^27.4.2" + "@jest/source-map" "^27.4.0" + "@jest/test-result" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.3.1" + expect "^27.4.2" is-generator-fn "^2.0.0" - jest-each "^27.3.1" - jest-matcher-utils "^27.3.1" - jest-message-util "^27.3.1" - jest-runtime "^27.3.1" - jest-snapshot "^27.3.1" - jest-util "^27.3.1" - pretty-format "^27.3.1" + jest-each "^27.4.2" + jest-matcher-utils "^27.4.2" + jest-message-util "^27.4.2" + jest-runtime "^27.4.2" + jest-snapshot "^27.4.2" + jest-util "^27.4.2" + pretty-format "^27.4.2" throat "^6.0.1" -jest-leak-detector@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.3.1.tgz#7fb632c2992ef707a1e73286e1e704f9cc1772b2" - integrity sha512-78QstU9tXbaHzwlRlKmTpjP9k4Pvre5l0r8Spo4SbFFVy/4Abg9I6ZjHwjg2QyKEAMg020XcjP+UgLZIY50yEg== +jest-leak-detector@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.4.2.tgz#7fc3120893a7a911c553f3f2bdff9faa4454abbb" + integrity sha512-ml0KvFYZllzPBJWDei3mDzUhyp/M4ubKebX++fPaudpe8OsxUE+m+P6ciVLboQsrzOCWDjE20/eXew9QMx/VGw== dependencies: - jest-get-type "^27.3.1" - pretty-format "^27.3.1" + jest-get-type "^27.4.0" + pretty-format "^27.4.2" -jest-matcher-utils@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.3.1.tgz#257ad61e54a6d4044e080d85dbdc4a08811e9c1c" - integrity sha512-hX8N7zXS4k+8bC1Aj0OWpGb7D3gIXxYvPNK1inP5xvE4ztbz3rc4AkI6jGVaerepBnfWB17FL5lWFJT3s7qo8w== +jest-matcher-utils@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.4.2.tgz#d17c5038607978a255e0a9a5c32c24e984b6c60b" + integrity sha512-jyP28er3RRtMv+fmYC/PKG8wvAmfGcSNproVTW2Y0P/OY7/hWUOmsPfxN1jOhM+0u2xU984u2yEagGivz9OBGQ== dependencies: chalk "^4.0.0" - jest-diff "^27.3.1" - jest-get-type "^27.3.1" - pretty-format "^27.3.1" + jest-diff "^27.4.2" + jest-get-type "^27.4.0" + pretty-format "^27.4.2" -jest-message-util@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.3.1.tgz#f7c25688ad3410ab10bcb862bcfe3152345c6436" - integrity sha512-bh3JEmxsTZ/9rTm0jQrPElbY2+y48Rw2t47uMfByNyUVR+OfPh4anuyKsGqsNkXk/TI4JbLRZx+7p7Hdt6q1yg== +jest-message-util@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.4.2.tgz#07f3f1bf207d69cf798ce830cc57f1a849f99388" + integrity sha512-OMRqRNd9E0DkBLZpFtZkAGYOXl6ZpoMtQJWTAREJKDOFa0M6ptB7L67tp+cszMBkvSgKOhNtQp2Vbcz3ZZKo/w== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.3.1" + pretty-format "^27.4.2" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.3.0.tgz#ddf0ec3cc3e68c8ccd489bef4d1f525571a1b867" - integrity sha512-ziZiLk0elZOQjD08bLkegBzv5hCABu/c8Ytx45nJKkysQwGaonvmTxwjLqEA4qGdasq9o2I8/HtdGMNnVsMTGw== +jest-mock@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.4.2.tgz#184ff197a25491bfe4570c286daa5d62eb760b88" + integrity sha512-PDDPuyhoukk20JrQKeofK12hqtSka7mWH0QQuxSNgrdiPsrnYYLS6wbzu/HDlxZRzji5ylLRULeuI/vmZZDrYA== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -5507,76 +5506,76 @@ jest-pnp-resolver@^1.2.2: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-regex-util@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" - integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== +jest-regex-util@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.4.0.tgz#e4c45b52653128843d07ad94aec34393ea14fbca" + integrity sha512-WeCpMpNnqJYMQoOjm1nTtsgbR4XHAk1u00qDoNBQoykM280+/TmgA5Qh5giC1ecy6a5d4hbSsHzpBtu5yvlbEg== -jest-resolve-dependencies@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.3.1.tgz#85b99bdbdfa46e2c81c6228fc4c91076f624f6e2" - integrity sha512-X7iLzY8pCiYOnvYo2YrK3P9oSE8/3N2f4pUZMJ8IUcZnT81vlSonya1KTO9ZfKGuC+svE6FHK/XOb8SsoRUV1A== +jest-resolve-dependencies@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.4.2.tgz#2f4f363cca26f75a22aefd496f9c7ae65b3de37f" + integrity sha512-hb++cTpqvOWfU49MCP/JQkxmnrhKoAVqXWFjgYXswRSVGk8Q6bDTSvhbCeYXDtXaymY0y7WrrSIlKogClcKJuw== dependencies: - "@jest/types" "^27.2.5" - jest-regex-util "^27.0.6" - jest-snapshot "^27.3.1" + "@jest/types" "^27.4.2" + jest-regex-util "^27.4.0" + jest-snapshot "^27.4.2" -jest-resolve@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.3.1.tgz#0e5542172a1aa0270be6f66a65888647bdd74a3e" - integrity sha512-Dfzt25CFSPo3Y3GCbxynRBZzxq9AdyNN+x/v2IqYx6KVT5Z6me2Z/PsSGFSv3cOSUZqJ9pHxilao/I/m9FouLw== +jest-resolve@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.4.2.tgz#d3e4cbee7acb4a4f8c8bfc270767bec34d2aefaf" + integrity sha512-d/zqPjxCzMqHlOdRTg8cTpO9jY+1/T74KazT8Ws/LwmwxV5sRMWOkiLjmzUCDj/5IqA5XHNK4Hkmlq9Kdpb9Sg== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" chalk "^4.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.3.1" + jest-haste-map "^27.4.2" jest-pnp-resolver "^1.2.2" - jest-util "^27.3.1" - jest-validate "^27.3.1" + jest-util "^27.4.2" + jest-validate "^27.4.2" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.3.1.tgz#1d594dcbf3bd8600a7e839e790384559eaf96e3e" - integrity sha512-r4W6kBn6sPr3TBwQNmqE94mPlYVn7fLBseeJfo4E2uCTmAyDFm2O5DYAQAFP7Q3YfiA/bMwg8TVsciP7k0xOww== +jest-runner@^27.4.3: + version "27.4.3" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.4.3.tgz#9f05d4733829787778e8a143ade913834d0828dc" + integrity sha512-JgR6Om/j22Fd6ZUUIGTWNcCtuZVYbNrecb4k89W4UyFJoRtHpo2zMKWkmFFFJoqwWGrfrcPLnVBIgkJiTV3cyA== dependencies: - "@jest/console" "^27.3.1" - "@jest/environment" "^27.3.1" - "@jest/test-result" "^27.3.1" - "@jest/transform" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/console" "^27.4.2" + "@jest/environment" "^27.4.2" + "@jest/test-result" "^27.4.2" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-docblock "^27.0.6" - jest-environment-jsdom "^27.3.1" - jest-environment-node "^27.3.1" - jest-haste-map "^27.3.1" - jest-leak-detector "^27.3.1" - jest-message-util "^27.3.1" - jest-resolve "^27.3.1" - jest-runtime "^27.3.1" - jest-util "^27.3.1" - jest-worker "^27.3.1" + jest-docblock "^27.4.0" + jest-environment-jsdom "^27.4.3" + jest-environment-node "^27.4.2" + jest-haste-map "^27.4.2" + jest-leak-detector "^27.4.2" + jest-message-util "^27.4.2" + jest-resolve "^27.4.2" + jest-runtime "^27.4.2" + jest-util "^27.4.2" + jest-worker "^27.4.2" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.3.1.tgz#80fa32eb85fe5af575865ddf379874777ee993d7" - integrity sha512-qtO6VxPbS8umqhEDpjA4pqTkKQ1Hy4ZSi9mDVeE9Za7LKBo2LdW2jmT+Iod3XFaJqINikZQsn2wEi0j9wPRbLg== - dependencies: - "@jest/console" "^27.3.1" - "@jest/environment" "^27.3.1" - "@jest/globals" "^27.3.1" - "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.3.1" - "@jest/transform" "^27.3.1" - "@jest/types" "^27.2.5" +jest-runtime@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.4.2.tgz#d72da8a0e97366c16ad515a2c437191a72600d38" + integrity sha512-eqPgcBaUNaw6j8T5M+dnfAEh6MIrh2YmtskCr9sl50QYpD22Sg+QqHw3J3nmaLzVMbBtOMHFFxLF0Qx8MsZVFQ== + dependencies: + "@jest/console" "^27.4.2" + "@jest/environment" "^27.4.2" + "@jest/globals" "^27.4.2" + "@jest/source-map" "^27.4.0" + "@jest/test-result" "^27.4.2" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" "@types/yargs" "^16.0.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" @@ -5585,30 +5584,30 @@ jest-runtime@^27.3.1: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.3.1" - jest-message-util "^27.3.1" - jest-mock "^27.3.0" - jest-regex-util "^27.0.6" - jest-resolve "^27.3.1" - jest-snapshot "^27.3.1" - jest-util "^27.3.1" - jest-validate "^27.3.1" + jest-haste-map "^27.4.2" + jest-message-util "^27.4.2" + jest-mock "^27.4.2" + jest-regex-util "^27.4.0" + jest-resolve "^27.4.2" + jest-snapshot "^27.4.2" + jest-util "^27.4.2" + jest-validate "^27.4.2" slash "^3.0.0" strip-bom "^4.0.0" yargs "^16.2.0" -jest-serializer@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.0.6.tgz#93a6c74e0132b81a2d54623251c46c498bb5bec1" - integrity sha512-PtGdVK9EGC7dsaziskfqaAPib6wTViY3G8E5wz9tLVPhHyiDNTZn/xjZ4khAw+09QkoOVpn7vF5nPSN6dtBexA== +jest-serializer@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.4.0.tgz#34866586e1cae2388b7d12ffa2c7819edef5958a" + integrity sha512-RDhpcn5f1JYTX2pvJAGDcnsNTnsV9bjYPU8xcV+xPwOXnUPOQwf4ZEuiU6G9H1UztH+OapMgu/ckEVwO87PwnQ== dependencies: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.3.1.tgz#1da5c0712a252d70917d46c037054f5918c49ee4" - integrity sha512-APZyBvSgQgOT0XumwfFu7X3G5elj6TGhCBLbBdn3R1IzYustPGPE38F51dBWMQ8hRXa9je0vAdeVDtqHLvB6lg== +jest-snapshot@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.4.2.tgz#bd1ea04a8fab402e5ab18b788809fa597ddff532" + integrity sha512-DI7lJlNIu6WSQ+esqhnJzEzU70+dV+cNjoF1c+j5FagWEd3KtOyZvVliAH0RWNQ6KSnAAnKSU0qxJ8UXOOhuUQ== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -5616,60 +5615,60 @@ jest-snapshot@^27.3.1: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.3.1" + expect "^27.4.2" graceful-fs "^4.2.4" - jest-diff "^27.3.1" - jest-get-type "^27.3.1" - jest-haste-map "^27.3.1" - jest-matcher-utils "^27.3.1" - jest-message-util "^27.3.1" - jest-resolve "^27.3.1" - jest-util "^27.3.1" + jest-diff "^27.4.2" + jest-get-type "^27.4.0" + jest-haste-map "^27.4.2" + jest-matcher-utils "^27.4.2" + jest-message-util "^27.4.2" + jest-resolve "^27.4.2" + jest-util "^27.4.2" natural-compare "^1.4.0" - pretty-format "^27.3.1" + pretty-format "^27.4.2" semver "^7.3.2" -jest-util@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.3.1.tgz#a58cdc7b6c8a560caac9ed6bdfc4e4ff23f80429" - integrity sha512-8fg+ifEH3GDryLQf/eKZck1DEs2YuVPBCMOaHQxVVLmQwl/CDhWzrvChTX4efLZxGrw+AA0mSXv78cyytBt/uw== +jest-util@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.4.2.tgz#ed95b05b1adfd761e2cda47e0144c6a58e05a621" + integrity sha512-YuxxpXU6nlMan9qyLuxHaMMOzXAl5aGZWCSzben5DhLHemYQxCc4YK+4L3ZrCutT8GPQ+ui9k5D8rUJoDioMnA== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.4" picomatch "^2.2.3" -jest-validate@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.3.1.tgz#3a395d61a19cd13ae9054af8cdaf299116ef8a24" - integrity sha512-3H0XCHDFLA9uDII67Bwi1Vy7AqwA5HqEEjyy934lgVhtJ3eisw6ShOF1MDmRPspyikef5MyExvIm0/TuLzZ86Q== +jest-validate@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.4.2.tgz#eecfcc1b1c9429aa007da08a2bae4e32a81bbbc3" + integrity sha512-hWYsSUej+Fs8ZhOm5vhWzwSLmVaPAxRy+Mr+z5MzeaHm9AxUpXdoVMEW4R86y5gOobVfBsMFLk4Rb+QkiEpx1A== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^27.3.1" + jest-get-type "^27.4.0" leven "^3.1.0" - pretty-format "^27.3.1" + pretty-format "^27.4.2" -jest-watcher@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.3.1.tgz#ba5e0bc6aa843612b54ddb7f009d1cbff7e05f3e" - integrity sha512-9/xbV6chABsGHWh9yPaAGYVVKurWoP3ZMCv6h+O1v9/+pkOroigs6WzZ0e9gLP/njokUwM7yQhr01LKJVMkaZA== +jest-watcher@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.4.2.tgz#c9037edfd80354c9fe90de4b6f8b6e2b8e736744" + integrity sha512-NJvMVyyBeXfDezhWzUOCOYZrUmkSCiatpjpm+nFUid74OZEHk6aMLrZAukIiFDwdbqp6mTM6Ui1w4oc+8EobQg== dependencies: - "@jest/test-result" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/test-result" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.3.1" + jest-util "^27.4.2" string-length "^4.0.1" jest-worker@^26.2.1: @@ -5681,23 +5680,23 @@ jest-worker@^26.2.1: merge-stream "^2.0.0" supports-color "^7.0.0" -jest-worker@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.3.1.tgz#0def7feae5b8042be38479799aeb7b5facac24b2" - integrity sha512-ks3WCzsiZaOPJl/oMsDjaf0TRiSv7ctNgs0FqRr2nARsovz6AWWy4oLElwcquGSz692DzgZQrCLScPNs5YlC4g== +jest-worker@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.4.2.tgz#0fb123d50955af1a450267787f340a1bf7e12bc4" + integrity sha512-0QMy/zPovLfUPyHuOuuU4E+kGACXXE84nRnq6lBVI9GJg5DCBiA97SATi+ZP8CpiJwEQy1oCPjRBf8AnLjN+Ag== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.3.1.tgz#b5bab64e8f56b6f7e275ba1836898b0d9f1e5c8a" - integrity sha512-U2AX0AgQGd5EzMsiZpYt8HyZ+nSVIh5ujQ9CPp9EQZJMjXIiSZpJNweZl0swatKRoqHWgGKM3zaSwm4Zaz87ng== + version "27.4.3" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.4.3.tgz#cf7d1876a84c70efece2e01e4f9dfc2e464d9cbb" + integrity sha512-jwsfVABBzuN3Atm+6h6vIEpTs9+VApODLt4dk2qv1WMOpb1weI1IIZfuwpMiWZ62qvWj78MvdvMHIYdUfqrFaA== dependencies: - "@jest/core" "^27.3.1" + "@jest/core" "^27.4.3" import-local "^3.0.2" - jest-cli "^27.3.1" + jest-cli "^27.4.3" "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" @@ -5782,10 +5781,10 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= +json-schema@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" + integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" @@ -5833,13 +5832,13 @@ jsonparse@^1.2.0, jsonparse@^1.3.1: integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + version "1.4.2" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" + integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== dependencies: assert-plus "1.0.0" extsprintf "1.3.0" - json-schema "0.2.3" + json-schema "0.4.0" verror "1.10.0" kind-of@^6.0.2, kind-of@^6.0.3: @@ -5929,9 +5928,9 @@ lilconfig@^2.0.3: integrity sha512-bfTIN7lEsiooCocSISTWXkiWJkRqtL9wYtYy+8EK3Y41qh3mpwPU0ycTOgjdY9ErwXCc8QyrQp82bdL0Xkm9yA== lines-and-columns@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" - integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + version "1.2.4" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== lint-staged@^11.2.6: version "11.2.6" @@ -5954,15 +5953,15 @@ lint-staged@^11.2.6: supports-color "8.1.1" listr2@^3.12.2: - version "3.13.3" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.13.3.tgz#d8f6095c9371b382c9b1c2bc33c5941d8e177f11" - integrity sha512-VqAgN+XVfyaEjSaFewGPcDs5/3hBbWVaX1VgWv2f52MF7US45JuARlArULctiB44IIcEk3JF7GtoFCLqEdeuPA== + version "3.13.5" + resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.13.5.tgz#105a813f2eb2329c4aae27373a281d610ee4985f" + integrity sha512-3n8heFQDSk+NcwBn3CgxEibZGaRzx+pC64n3YjpMD1qguV4nWus3Al+Oo3KooqFKTQEJ1v7MmnbnyyNspgx3NA== dependencies: cli-truncate "^2.1.0" - clone "^2.1.2" colorette "^2.0.16" log-update "^4.0.0" p-map "^4.0.0" + rfdc "^1.3.0" rxjs "^7.4.0" through "^2.3.8" wrap-ansi "^7.0.0" @@ -6250,9 +6249,9 @@ mersenne-twister@^1.0.1: integrity sha1-+RZhjuQ9cXnvz2Qb7EUx65Zwl4o= microbundle@^0.14.1: - version "0.14.1" - resolved "https://registry.yarnpkg.com/microbundle/-/microbundle-0.14.1.tgz#a7de2dfa2efce01233dc494bd8dccb4570804aa4" - integrity sha512-/JAAPKWRyvBV0QjmmhgPU9NGuX3Tk1u8EXuMJ+6npFmnm+EtuL8IpJihxmljpUwaoHLyDy+b2ntfWoN6BkDQzA== + version "0.14.2" + resolved "https://registry.yarnpkg.com/microbundle/-/microbundle-0.14.2.tgz#2db869c8145bd159aa55058ead47223f58f93bf2" + integrity sha512-jODALfU3w7jnJAqw7Tou9uU8e8zH0GRVWzOd/V7eAvD1fsfb9pyMbmzhFZqnX6SCb54eP1EF5oRyNlSxBAxoag== dependencies: "@babel/core" "^7.12.10" "@babel/plugin-proposal-class-properties" "7.12.1" @@ -7165,25 +7164,23 @@ postcss-load-config@^3.0.0: lilconfig "^2.0.3" yaml "^1.10.2" -postcss-merge-longhand@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-5.0.3.tgz#42194a5ffbaa5513edbf606ef79c44958564658b" - integrity sha512-kmB+1TjMTj/bPw6MCDUiqSA5e/x4fvLffiAdthra3a0m2/IjTrWsTmD3FdSskzUjEwkj5ZHBDEbv5dOcqD7CMQ== +postcss-merge-longhand@^5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-5.0.4.tgz#41f4f3270282ea1a145ece078b7679f0cef21c32" + integrity sha512-2lZrOVD+d81aoYkZDpWu6+3dTAAGkCKbV5DoRhnIR7KOULVrI/R7bcMjhrH9KTRy6iiHKqmtG+n/MMj1WmqHFw== dependencies: - css-color-names "^1.0.1" postcss-value-parser "^4.1.0" stylehacks "^5.0.1" -postcss-merge-rules@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-5.0.2.tgz#d6e4d65018badbdb7dcc789c4f39b941305d410a" - integrity sha512-5K+Md7S3GwBewfB4rjDeol6V/RZ8S+v4B66Zk2gChRqLTCC8yjnHQ601omj9TKftS19OPGqZ/XzoqpzNQQLwbg== +postcss-merge-rules@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-5.0.3.tgz#b5cae31f53129812a77e3eb1eeee448f8cf1a1db" + integrity sha512-cEKTMEbWazVa5NXd8deLdCnXl+6cYG7m2am+1HzqH0EnTdy8fRysatkaXb2dEnR+fdaDxTvuZ5zoBdv6efF6hg== dependencies: browserslist "^4.16.6" caniuse-api "^3.0.0" cssnano-utils "^2.0.1" postcss-selector-parser "^6.0.5" - vendors "^1.0.3" postcss-minify-font-values@^5.0.1: version "5.0.1" @@ -7201,16 +7198,15 @@ postcss-minify-gradients@^5.0.3: cssnano-utils "^2.0.1" postcss-value-parser "^4.1.0" -postcss-minify-params@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-5.0.1.tgz#371153ba164b9d8562842fdcd929c98abd9e5b6c" - integrity sha512-4RUC4k2A/Q9mGco1Z8ODc7h+A0z7L7X2ypO1B6V8057eVK6mZ6xwz6QN64nHuHLbqbclkX1wyzRnIrdZehTEHw== +postcss-minify-params@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-5.0.2.tgz#1b644da903473fbbb18fbe07b8e239883684b85c" + integrity sha512-qJAPuBzxO1yhLad7h2Dzk/F7n1vPyfHfCCh5grjGfjhi1ttCnq4ZXGIW77GSrEbh9Hus9Lc/e/+tB4vh3/GpDg== dependencies: alphanum-sort "^1.0.2" - browserslist "^4.16.0" + browserslist "^4.16.6" cssnano-utils "^2.0.1" postcss-value-parser "^4.1.0" - uniqs "^2.0.0" postcss-minify-selectors@^5.1.0: version "5.1.0" @@ -7313,10 +7309,10 @@ postcss-normalize-unicode@^5.0.1: browserslist "^4.16.0" postcss-value-parser "^4.1.0" -postcss-normalize-url@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-5.0.2.tgz#ddcdfb7cede1270740cf3e4dfc6008bd96abc763" - integrity sha512-k4jLTPUxREQ5bpajFQZpx8bCF2UrlqOTzP9kEqcEnOfwsRshWs2+oAFIHfDQB8GO2PaUaSE0NlTAYtbluZTlHQ== +postcss-normalize-url@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-5.0.3.tgz#42eca6ede57fe69075fab0f88ac8e48916ef931c" + integrity sha512-qWiUMbvkRx3kc1Dp5opzUwc7MBWZcSDK2yofCmdvFBCpx+zFPkxBC1FASQ59Pt+flYfj/nTZSkmF56+XG5elSg== dependencies: is-absolute-url "^3.0.3" normalize-url "^6.0.1" @@ -7337,12 +7333,12 @@ postcss-ordered-values@^5.0.2: cssnano-utils "^2.0.1" postcss-value-parser "^4.1.0" -postcss-reduce-initial@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-5.0.1.tgz#9d6369865b0f6f6f6b165a0ef5dc1a4856c7e946" - integrity sha512-zlCZPKLLTMAqA3ZWH57HlbCjkD55LX9dsRyxlls+wfuRfqCi5mSlZVan0heX5cHr154Dq9AfbH70LyhrSAezJw== +postcss-reduce-initial@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-5.0.2.tgz#fa424ce8aa88a89bc0b6d0f94871b24abe94c048" + integrity sha512-v/kbAAQ+S1V5v9TJvbGkV98V2ERPdU6XvMcKMjqAlYiJ2NtsHGlKYLPjWWcXlaTKNxooId7BGxeraK8qXvzKtw== dependencies: - browserslist "^4.16.0" + browserslist "^4.16.6" caniuse-api "^3.0.0" postcss-reduce-transforms@^5.0.1: @@ -7369,28 +7365,27 @@ postcss-svgo@^5.0.3: postcss-value-parser "^4.1.0" svgo "^2.7.0" -postcss-unique-selectors@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-5.0.1.tgz#3be5c1d7363352eff838bd62b0b07a0abad43bfc" - integrity sha512-gwi1NhHV4FMmPn+qwBNuot1sG1t2OmacLQ/AX29lzyggnjd+MnVD5uqQmpXO3J17KGL2WAxQruj1qTd3H0gG/w== +postcss-unique-selectors@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-5.0.2.tgz#5d6893daf534ae52626708e0d62250890108c0c1" + integrity sha512-w3zBVlrtZm7loQWRPVC0yjUwwpty7OM6DnEHkxcSQXO1bMS3RJ+JUS5LFMSDZHJcvGsRwhZinCWVqn8Kej4EDA== dependencies: alphanum-sort "^1.0.2" postcss-selector-parser "^6.0.5" - uniqs "^2.0.0" postcss-value-parser@^4.0.2, postcss-value-parser@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb" - integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ== + version "4.2.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" + integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== postcss@^8.2.1: - version "8.3.11" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.11.tgz#c3beca7ea811cd5e1c4a3ec6d2e7599ef1f8f858" - integrity sha512-hCmlUAIlUiav8Xdqw3Io4LcpA1DOt7h3LSTAC4G6JGHFFaWzI6qvFt9oilvl8BmkbBRX1IhM90ZAmpk68zccQA== + version "8.4.4" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.4.tgz#d53d4ec6a75fd62557a66bb41978bf47ff0c2869" + integrity sha512-joU6fBsN6EIer28Lj6GDFoC/5yOZzLCfn0zHAn/MYXI7aPt4m4hK5KC5ovEZXy+lnCjmYIbQWngvju2ddyEr8Q== dependencies: nanoid "^3.1.30" picocolors "^1.0.0" - source-map-js "^0.6.2" + source-map-js "^1.0.1" prelude-ls@^1.2.1: version "1.2.1" @@ -7403,9 +7398,9 @@ prelude-ls@~1.1.2: integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prettier@^2.0.1, prettier@^2.2.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" - integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== + version "2.5.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.0.tgz#a6370e2d4594e093270419d9cc47f7670488f893" + integrity sha512-FM/zAKgWTxj40rH03VxzIPdXmj39SwSjwG0heUcNFwI+EMZJnY93yAiKXM3dObIKAM5TA88werc8T/EwhB45eg== pretty-bytes@^3.0.0: version "3.0.1" @@ -7419,12 +7414,12 @@ pretty-bytes@^5.4.1: resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== -pretty-format@^27.0.0, pretty-format@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.3.1.tgz#7e9486365ccdd4a502061fa761d3ab9ca1b78df5" - integrity sha512-DR/c+pvFc52nLimLROYjnXPtolawm+uWDxr4FjuLDLUn+ktWnSN851KoHwHzzqq6rfCOjkzN8FLgDrSub6UDuA== +pretty-format@^27.0.0, pretty-format@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.4.2.tgz#e4ce92ad66c3888423d332b40477c87d1dac1fb8" + integrity sha512-p0wNtJ9oLuvgOQDEIZ9zQjZffK7KtyR6Si0jnXULIDwrlNF8Cuir3AZP0hHv0jmKuNN/edOnbMjnzd4uTcmWiw== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" ansi-regex "^5.0.1" ansi-styles "^5.0.0" react-is "^17.0.1" @@ -7878,6 +7873,11 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== +rfdc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" + integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== + rimraf@^2.6.3: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" @@ -7901,9 +7901,9 @@ rollup-plugin-bundle-size@^1.0.3: maxmin "^2.1.0" rollup-plugin-postcss@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/rollup-plugin-postcss/-/rollup-plugin-postcss-4.0.1.tgz#2856465b637ec02513676659aabf1ca3840f3af0" - integrity sha512-kUJHlpDGl9+kDfdUUbnerW0Mx1R0PL/6dgciUE/w19swYDBjug7RQfxIRvRGtO/cvCkynYyU8e/YFMI544vskA== + version "4.0.2" + resolved "https://registry.yarnpkg.com/rollup-plugin-postcss/-/rollup-plugin-postcss-4.0.2.tgz#15e9462f39475059b368ce0e49c800fa4b1f7050" + integrity sha512-05EaY6zvZdmvPUDi3uCcAQoESDcYnv8ogJJQRp6V5kZ6J6P7uAVJlrTZcaaA20wTH527YTnKfkAoPxWI/jPp4w== dependencies: chalk "^4.1.0" concat-with-sourcemaps "^1.1.0" @@ -7947,10 +7947,10 @@ rollup-pluginutils@^2.8.2: dependencies: estree-walker "^0.6.1" -rollup@^2.35.1: - version "2.59.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.59.0.tgz#108c61b0fa0a37ebc8d1f164f281622056f0db59" - integrity sha512-l7s90JQhCQ6JyZjKgo7Lq1dKh2RxatOM+Jr6a9F7WbS9WgKbocyUSeLmZl8evAse7y96Ae98L2k1cBOwWD8nHw== +rollup@^2.35.1, rollup@^2.60.2: + version "2.60.2" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.60.2.tgz#3f45ace36a9b10b4297181831ea0719922513463" + integrity sha512-1Bgjpq61sPjgoZzuiDSGvbI1tD91giZABgjCQBKM5aYLnzjq52GoDuWVwT/cm/MCxCMPU8gqQvkj8doQ5C8Oqw== optionalDependencies: fsevents "~2.3.2" @@ -8090,9 +8090,9 @@ side-channel@^1.0.4: object-inspect "^1.9.0" signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: - version "3.0.5" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f" - integrity sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ== + version "3.0.6" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.6.tgz#24e630c4b0f03fea446a2bd299e62b4a6ca8d0af" + integrity sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ== sisteransi@^1.0.5: version "1.0.5" @@ -8147,9 +8147,9 @@ socks-proxy-agent@^5.0.0: socks "^2.3.3" socks-proxy-agent@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-6.1.0.tgz#869cf2d7bd10fea96c7ad3111e81726855e285c3" - integrity sha512-57e7lwCN4Tzt3mXz25VxOErJKXlPfXmkMLnk310v/jwW20jWRVcgsOit+xNkN3eIEdB47GwnfAEBLacZ/wVIKg== + version "6.1.1" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-6.1.1.tgz#e664e8f1aaf4e1fb3df945f09e3d94f911137f87" + integrity sha512-t8J0kG3csjA4g6FTbsMOWws+7R7vuRC8aQ/wy3/1OWmsgwA68zs/+cExQ0koSitUDXqhufF/YJr9wtNMZHw5Ew== dependencies: agent-base "^6.0.2" debug "^4.3.1" @@ -8177,15 +8177,15 @@ sort-keys@^4.0.0: dependencies: is-plain-obj "^2.0.0" -source-map-js@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-0.6.2.tgz#0bb5de631b41cfbda6cfba8bd05a80efdfd2385e" - integrity sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug== +source-map-js@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.1.tgz#a1741c131e3c77d048252adfa24e23b908670caf" + integrity sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA== source-map-support@^0.5.16, source-map-support@^0.5.6, source-map-support@~0.5.20: - version "0.5.20" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" - integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -8232,9 +8232,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.10" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz#0d9becccde7003d6c658d487dd48a32f0bf3014b" - integrity sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA== + version "3.0.11" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz#50c0d8c40a14ec1bf449bae69a0ea4685a9d9f95" + integrity sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g== split-on-first@^1.0.0: version "1.1.0" @@ -8581,9 +8581,9 @@ terminal-link@^2.0.0: supports-hyperlinks "^2.0.0" terser@^5.0.0, terser@^5.7.0: - version "5.9.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.9.0.tgz#47d6e629a522963240f2b55fcaa3c99083d2c351" - integrity sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ== + version "5.10.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.10.0.tgz#b86390809c0389105eb0a0b62397563096ddafcc" + integrity sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA== dependencies: commander "^2.20.0" source-map "~0.7.2" @@ -8817,14 +8817,14 @@ typedarray@^0.0.6: integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= typescript@^4.1.3, typescript@^4.4.4: - version "4.4.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c" - integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== + version "4.5.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.2.tgz#8ac1fba9f52256fdb06fb89e4122fa6a346c2998" + integrity sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw== uglify-js@^3.1.4: - version "3.14.3" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.14.3.tgz#c0f25dfea1e8e5323eccf59610be08b6043c15cf" - integrity sha512-mic3aOdiq01DuSVx0TseaEzMIVqebMZ0Z3vaeDhFEh9bsc24hV1TFvN74reA2vs08D0ZWfNjAcJ3UbVLaBss+g== + version "3.14.4" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.14.4.tgz#68756f17d1b90b9d289341736cb9a567d6882f90" + integrity sha512-AbiSR44J0GoCeV81+oxcy/jDOElO2Bx3d0MfQCUShq7JRXaM4KtQopZsq2vFv8bCq2yMaGrw1FgygUd03RyRDA== uid-number@0.0.6: version "0.0.6" @@ -8869,11 +8869,6 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz#0a36cb9a585c4f6abd51ad1deddb285c165297c8" integrity sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ== -uniqs@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" - integrity sha1-/+3ks2slKQaW5uFl1KWe25mOawI= - unique-filename@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" @@ -8978,11 +8973,6 @@ value-or-promise@1.0.11: resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.11.tgz#3e90299af31dd014fe843fe309cefa7c1d94b140" integrity sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg== -vendors@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/vendors/-/vendors-1.0.4.tgz#e2b800a53e7a29b93506c3cf41100d16c4c4ad8e" - integrity sha512-/juG65kTL4Cy2su4P8HjtkTxk6VmJDiOPBufWniqQ6wknac6jNiXS9vU+hO3wgusiyqWlzTbVHi0dyJqRONg3w== - verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" @@ -9201,9 +9191,9 @@ write-pkg@^4.0.0: write-json-file "^3.2.0" ws@^7.4.6: - version "7.5.5" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.5.tgz#8b4bc4af518cfabd0473ae4f99144287b33eb881" - integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== + version "7.5.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.6.tgz#e59fc509fb15ddfb65487ee9765c5a51dec5fe7b" + integrity sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA== xml-name-validator@^3.0.0: version "3.0.0" From 6955e808f6cb326f98bab10e0cb16c5e2ae7b60b Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Wed, 1 Dec 2021 23:02:49 -0300 Subject: [PATCH 40/49] fix tests --- packages/macro/__tests__/index.ts | 5 +++-- packages/macro/src/index.ts | 29 +---------------------------- packages/macro/src/macro.ts | 28 ++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 30 deletions(-) create mode 100644 packages/macro/src/macro.ts diff --git a/packages/macro/__tests__/index.ts b/packages/macro/__tests__/index.ts index e492008c..b44d5919 100644 --- a/packages/macro/__tests__/index.ts +++ b/packages/macro/__tests__/index.ts @@ -17,17 +17,18 @@ let query = { pluginTester({ plugin, pluginName: "@grafoo/macro", + babelOptions: { filename: __filename }, tests: { "should throw if a tagged template string literal has expressions in it": { code: ` - import graphql from "@grafoo/macro"; + import graphql from "../src/macro"; let query = graphql\`{ user(id: "\${1}") { name } }\`; `, error: true }, "should replace a tagged template literal with the compiled grafoo object": { code: ` - import graphql from "@grafoo/macro"; + import graphql from "../src/macro"; let query = graphql\`{ authors {name} }\`; `, output diff --git a/packages/macro/src/index.ts b/packages/macro/src/index.ts index 338a3e83..941179c2 100644 --- a/packages/macro/src/index.ts +++ b/packages/macro/src/index.ts @@ -1,28 +1 @@ -import type bc from "@babel/core"; -import { parseExpression } from "@babel/parser"; -import { createMacro } from "babel-plugin-macros"; -import compileDocument from "@grafoo/compiler"; -import { graphql } from "@grafoo/core"; - -export default createMacro(({ references }) => { - for (let ref of references.default) { - let path = ref as bc.NodePath; - let targetPath = path.parentPath; - - if (targetPath.type === "TaggedTemplateExpression") { - let quasi = ref.parentPath.get("quasi") as bc.NodePath; - - let expressions = quasi.get("expressions"); - - if (expressions.length) { - throw expressions[0].buildCodeFrameError( - "@grafoo/macro: interpolation is not supported in a graphql tagged template literal." - ); - } - - let source = quasi.node.quasis.reduce((src, q) => src + q.value.raw, ""); - let query = compileDocument(source); - targetPath.replaceWith(parseExpression(query)); - } - } -}) as typeof graphql; +export { default } from "./macro"; diff --git a/packages/macro/src/macro.ts b/packages/macro/src/macro.ts new file mode 100644 index 00000000..338a3e83 --- /dev/null +++ b/packages/macro/src/macro.ts @@ -0,0 +1,28 @@ +import type bc from "@babel/core"; +import { parseExpression } from "@babel/parser"; +import { createMacro } from "babel-plugin-macros"; +import compileDocument from "@grafoo/compiler"; +import { graphql } from "@grafoo/core"; + +export default createMacro(({ references }) => { + for (let ref of references.default) { + let path = ref as bc.NodePath; + let targetPath = path.parentPath; + + if (targetPath.type === "TaggedTemplateExpression") { + let quasi = ref.parentPath.get("quasi") as bc.NodePath; + + let expressions = quasi.get("expressions"); + + if (expressions.length) { + throw expressions[0].buildCodeFrameError( + "@grafoo/macro: interpolation is not supported in a graphql tagged template literal." + ); + } + + let source = quasi.node.quasis.reduce((src, q) => src + q.value.raw, ""); + let query = compileDocument(source); + targetPath.replaceWith(parseExpression(query)); + } + } +}) as typeof graphql; From f81a9e82f72522d55c1c5039fed39461cc46198d Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Wed, 1 Dec 2021 23:46:43 -0300 Subject: [PATCH 41/49] remove deeppartial type from mutations --- packages/bindings/__tests__/index.ts | 61 ++++++++++++++++------------ packages/bindings/src/types.ts | 11 +---- packages/react/__tests__/index.tsx | 18 +++++--- 3 files changed, 50 insertions(+), 40 deletions(-) diff --git a/packages/bindings/__tests__/index.ts b/packages/bindings/__tests__/index.ts index 47e50bff..6b5a4970 100644 --- a/packages/bindings/__tests__/index.ts +++ b/packages/bindings/__tests__/index.ts @@ -1,6 +1,11 @@ import createBindings, { makeGrafooConfig } from "../src"; import createClient, { GrafooClient } from "@grafoo/core"; -import { mockQueryRequest, createTransport } from "@grafoo/test-utils"; +import { + mockQueryRequest, + createTransport, + AuthorEdge, + AuthorConnection +} from "@grafoo/test-utils"; import { AUTHOR, AUTHORS, @@ -153,8 +158,8 @@ describe("@grafoo/bindings", () => { query: CREATE_AUTHOR, update: ({ authors }, data) => ({ authors: { - edges: [{ node: data.createAuthor.author }, ...authors.edges] - } + edges: [{ node: data.createAuthor.author } as AuthorEdge, ...authors.edges] + } as AuthorConnection }) } } @@ -188,15 +193,18 @@ describe("@grafoo/bindings", () => { optimisticUpdate: ({ authors }, variables) => ({ authors: { ...authors, - edges: [{ node: { ...variables.input, id: "tempID" } }, ...authors.edges] - } + edges: [ + { node: { ...variables.input, id: "tempID" } } as AuthorEdge, + ...authors.edges + ] + } as AuthorConnection }), update: ({ authors }, data) => ({ authors: { edges: authors.edges.map((p) => - p.node.id === "tempID" ? { node: data.createAuthor.author } : p + p.node.id === "tempID" ? { node: data.createAuthor.author, ...p } : p ) - } + } as AuthorConnection }) } } @@ -245,7 +253,7 @@ describe("@grafoo/bindings", () => { optimisticUpdate: ({ authors }, { input: { id } }) => ({ authors: { edges: authors.edges.filter((author) => author.node.id !== id) - } + } as AuthorConnection }) } } @@ -277,12 +285,12 @@ describe("@grafoo/bindings", () => { query: UPDATE_AUTHOR, optimisticUpdate: ({ authors }, variables) => ({ authors: { - edges: authors.edges.map((author) => - author.node.id === variables.input.id - ? { node: { ...author.node, ...variables.input } } - : author + edges: authors.edges.map((a) => + a.node.id === variables.input.id + ? { ...a, node: { ...a.node, ...variables.input } } + : a ) - } + } as AuthorConnection }) } } @@ -324,29 +332,30 @@ describe("@grafoo/bindings", () => { query: CREATE_AUTHOR, optimisticUpdate: ({ authors }, variables) => ({ authors: { - edges: [{ node: { ...variables.input, id: "tempID" } }, ...authors.edges] - } + edges: [ + { node: { ...variables.input, id: "tempID" } } as AuthorEdge, + ...authors.edges + ] + } as AuthorConnection }), update: ({ authors }, data) => ({ authors: { - edges: authors.edges.map((author) => - author.node.id === "tempID" - ? { node: { ...author.node, ...data.createAuthor.author } } - : author + edges: authors.edges.map((a) => + a.node.id === "tempID" + ? { ...a, node: { ...a.node, ...data.createAuthor.author } } + : a ) - } + } as AuthorConnection }) }, updateAuthor: { query: UPDATE_AUTHOR, optimisticUpdate: ({ authors }, variables) => ({ authors: { - edges: authors.edges.map((author) => - author.node.id === variables.input.id - ? { node: { ...author.node, ...variables.input } } - : author + edges: authors.edges.map((a) => + a.node.id === variables.input.id ? { node: { ...a.node, ...variables.input } } : a ) - } + } as AuthorConnection }) }, deleteAuthor: { @@ -354,7 +363,7 @@ describe("@grafoo/bindings", () => { optimisticUpdate: ({ authors }, variables) => ({ authors: { edges: authors.edges.filter((author) => author.node.id !== variables.input.id) - } + } as AuthorConnection }) } } diff --git a/packages/bindings/src/types.ts b/packages/bindings/src/types.ts index 78fa7eef..8a2ea7c2 100644 --- a/packages/bindings/src/types.ts +++ b/packages/bindings/src/types.ts @@ -1,9 +1,5 @@ import { GraphQlError, GraphQlPayload, GrafooQuery } from "@grafoo/core"; -type DeepPartial = { - [P in keyof T]?: DeepPartial; -}; - export type GrafooBoundMutations> = { [U in keyof T]: ( variables: T[U]["_variablesType"] @@ -28,11 +24,8 @@ export type GrafooBindings = { query: U; - update?: (props: T["_queryType"], data: U["_queryType"]) => DeepPartial; - optimisticUpdate?: ( - props: T["_queryType"], - variables: U["_variablesType"] - ) => DeepPartial; + update?: (props: T["_queryType"], data: U["_queryType"]) => T["_queryType"]; + optimisticUpdate?: (props: T["_queryType"], variables: U["_variablesType"]) => T["_queryType"]; }; export type GrafooMutations> = { diff --git a/packages/react/__tests__/index.tsx b/packages/react/__tests__/index.tsx index fe9279aa..d9396bf2 100644 --- a/packages/react/__tests__/index.tsx +++ b/packages/react/__tests__/index.tsx @@ -5,7 +5,12 @@ import fetch from "node-fetch"; import * as React from "react"; import createClient, { GrafooClient } from "@grafoo/core"; -import { mockQueryRequest, createTransport } from "@grafoo/test-utils"; +import { + mockQueryRequest, + createTransport, + AuthorEdge, + AuthorConnection +} from "@grafoo/test-utils"; import { renderHook, act } from "@testing-library/react-hooks"; import { GrafooProvider, useGrafoo } from "../src"; @@ -154,15 +159,18 @@ describe("@grafoo/react", () => { query: CREATE_AUTHOR, optimisticUpdate: ({ authors }, variables) => ({ authors: { - edges: [...authors.edges, { node: { ...variables.input, id: "tempID" } }] - } + edges: [ + ...authors.edges, + { node: { ...variables.input, id: "tempID" } } as AuthorEdge + ] + } as AuthorConnection }), update: ({ authors }, data) => ({ authors: { edges: authors.edges.map((p) => - p.node.id === "tempID" ? { node: data.createAuthor.author } : p + p.node.id === "tempID" ? { ...p, node: data.createAuthor.author } : p ) - } + } as AuthorConnection }) } } From a54ce6e3cd77eb8a88181ce0bb0b59868428c13f Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Thu, 2 Dec 2021 00:15:21 -0300 Subject: [PATCH 42/49] move first load to bindings --- packages/bindings/__tests__/index.ts | 18 ++++++++++-------- packages/bindings/src/bindings.ts | 2 ++ packages/react/src/index.ts | 3 +-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/bindings/__tests__/index.ts b/packages/bindings/__tests__/index.ts index 6b5a4970..2c52cff1 100644 --- a/packages/bindings/__tests__/index.ts +++ b/packages/bindings/__tests__/index.ts @@ -18,6 +18,8 @@ import { UPDATE_AUTHOR } from "./queries"; +let sleep = (time = 0) => new Promise((resolve) => setTimeout(resolve, time)); + describe("@grafoo/bindings", () => { let client: GrafooClient; beforeEach(() => { @@ -51,7 +53,7 @@ describe("@grafoo/bindings", () => { expect(bindings.getState()).toEqual({ loaded: false, loading: true }); - await bindings.load(); + await sleep(); let results = renderFn.mock.calls.map((c) => c[0]); @@ -63,7 +65,7 @@ describe("@grafoo/bindings", () => { let renderFn = jest.fn(); let bindings = createBindings(client, renderFn, { query: AUTHORS }); - await bindings.load(); + await sleep(); await bindings.load(); let results = renderFn.mock.calls.map((c) => c[0]); @@ -110,7 +112,7 @@ describe("@grafoo/bindings", () => { let { data } = await mockQueryRequest(AUTHORS); let bindings = createBindings(client, () => {}, { query: AUTHORS }); - await bindings.load(); + await sleep(); bindings.unbind(); let clonedData: AuthorsQuery = JSON.parse(JSON.stringify(data)); @@ -127,7 +129,7 @@ describe("@grafoo/bindings", () => { let renderFn = jest.fn(); let bindings = createBindings(client, renderFn, { query: failedQuery }); - await bindings.load(); + await sleep(); expect(renderFn).toHaveBeenCalledTimes(1); expect(bindings.getState()).toEqual({ loading: false, loaded: false, errors }); @@ -171,7 +173,7 @@ describe("@grafoo/bindings", () => { expect(typeof props.createAuthor).toBe("function"); - await bindings.load(); + await sleep(); let variables = { input: { name: "homer" } }; let { data } = await mockQueryRequest(CREATE_AUTHOR, variables); @@ -217,7 +219,7 @@ describe("@grafoo/bindings", () => { expect(typeof props.createAuthor).toBe("function"); - await bindings.load(); + await sleep(); let variables = { input: { name: "marge" } }; let { data } = await mockQueryRequest(CREATE_AUTHOR, variables); @@ -399,10 +401,10 @@ describe("@grafoo/bindings", () => { let author1Variables = { id: author1.node.id }; let author2Variables = { id: author2.node.id }; + await mockQueryRequest(AUTHOR, author1Variables); let bindings = createBindings(client, () => {}, { query: AUTHOR, variables: author1Variables }); + await sleep(); - await mockQueryRequest(AUTHOR, author1Variables); - await bindings.load(); expect(bindings.getState().author).toEqual(author1.node); expect(client.read(AUTHOR, author1Variables).data.author).toEqual(author1.node); diff --git a/packages/bindings/src/bindings.ts b/packages/bindings/src/bindings.ts index 309027c3..c28d3f4d 100644 --- a/packages/bindings/src/bindings.ts +++ b/packages/bindings/src/bindings.ts @@ -62,6 +62,8 @@ export default function createBindings< let preventListenUpdate = shouldLoad; let state = { loaded: hasData(), loading: shouldLoad }; + if (shouldLoad) load(); + function hasData() { return !!Object.keys(data ?? {}).length && !partial; } diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index ad26baec..108e30ec 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -7,7 +7,7 @@ import createBindings, { } from "@grafoo/bindings"; // @ts-ignore -export let GrafooContext = React.createContext({}); +export let GrafooContext = React.createContext(); export type GrafooProviderProps = { client: GrafooClient; @@ -28,7 +28,6 @@ export function useGrafoo { - if (state.loading) bindings.load(); return () => bindings.unbind(); }, []); From 6055cb4979a5c2072a68901593c9a82c809986a6 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Thu, 2 Dec 2021 01:23:36 -0300 Subject: [PATCH 43/49] rename core functions --- packages/bindings/src/bindings.ts | 43 +++++++------------ .../{resolve-values.ts => resolve-data.ts} | 14 +++--- .../{store-values.ts => store-data.ts} | 12 +++--- packages/core/src/client.ts | 10 ++--- .../{resolve-values.ts => resolve-data.ts} | 2 +- .../src/{store-values.ts => store-data.ts} | 2 +- 6 files changed, 36 insertions(+), 47 deletions(-) rename packages/core/__tests__/{resolve-values.ts => resolve-data.ts} (89%) rename packages/core/__tests__/{store-values.ts => store-data.ts} (89%) rename packages/core/src/{resolve-values.ts => resolve-data.ts} (96%) rename packages/core/src/{store-values.ts => store-data.ts} (97%) diff --git a/packages/bindings/src/bindings.ts b/packages/bindings/src/bindings.ts index c28d3f4d..9b8c76b0 100644 --- a/packages/bindings/src/bindings.ts +++ b/packages/bindings/src/bindings.ts @@ -31,8 +31,12 @@ export default function createBindings< ({ data, partial } = client.read(query, variables)); unbind = client.listen((shouldUpdate) => { - if (preventListenUpdate) return; - if (shouldUpdate) getUpdateFromClient(); + if (!state.loading && shouldUpdate) { + ({ data, partial } = client.read(query, variables)); + + state.loaded = !partial; + updater(getState()); + } }); } @@ -47,43 +51,29 @@ export default function createBindings< client.write(query, variables, optimisticUpdate(clone(data), mutationVariables)); } - return client.execute(mutationQuery, mutationVariables).then((mutationResponse) => { - if (query && update && mutationResponse.data) { - client.write(query, variables, update(clone(data), mutationResponse.data)); + return client.execute(mutationQuery, mutationVariables).then((response) => { + if (query && update && response.data) { + client.write(query, variables, update(clone(data), response.data)); } - return mutationResponse; + return response; }); }; } } - let shouldLoad = !!query && !skip && !hasData(); - let preventListenUpdate = shouldLoad; - let state = { loaded: hasData(), loading: shouldLoad }; - - if (shouldLoad) load(); + let getState = () => ({ ...state, ...boundMutations, ...(data as {}) }); - function hasData() { - return !!Object.keys(data ?? {}).length && !partial; - } + let loading = !!query && !skip && partial; + let state = { loaded: !partial, loading }; - function getUpdateFromClient() { - ({ data, partial } = client.read(query, variables)); - Object.assign(state, { loaded: hasData() }); - updater(getState()); - } - - function getState(): GrafooBoundState { - return Object.assign({}, state, boundMutations, data); - } + if (loading) load(); function load(nextVariables?: CP["query"]["_variablesType"]) { variables = nextVariables ?? variables; - preventListenUpdate = true; if (!state.loading) { - Object.assign(state, { loading: true }); + state.loading = true; updater(getState()); } @@ -92,9 +82,8 @@ export default function createBindings< if (data) client.write(query, variables, data); - Object.assign(state, { loaded: !!data, loading: false }, errors && { errors }); + state = { loaded: !!data, loading: false, ...(errors && { errors }) }; updater(getState()); - preventListenUpdate = false; }); } diff --git a/packages/core/__tests__/resolve-values.ts b/packages/core/__tests__/resolve-data.ts similarity index 89% rename from packages/core/__tests__/resolve-values.ts rename to packages/core/__tests__/resolve-data.ts index c4cfd979..0a9e0c05 100644 --- a/packages/core/__tests__/resolve-values.ts +++ b/packages/core/__tests__/resolve-data.ts @@ -1,5 +1,5 @@ import { graphql } from "@grafoo/core"; -import resolveValues from "../src/resolve-values"; +import resolveData from "../src/resolve-data"; import * as postsAndAuthors from "./data/posts-and-authors"; import * as postsWithFragments from "./data/posts-with-fragments"; import * as authorWithArguments from "./data/author-with-arguments"; @@ -40,7 +40,7 @@ describe("resolveValues", () => { it("should resolve the data given a simple query, a path and the records", () => { let query = POSTS_AND_AUTHORS; - let { data } = resolveValues(query, {}, postsAndAuthors.path, postsAndAuthors.records); + let { data } = resolveData(query, {}, postsAndAuthors.path, postsAndAuthors.records); expect(data).toEqual(postsAndAuthors.data); }); @@ -77,7 +77,7 @@ describe("resolveValues", () => { } `; - let { data } = resolveValues(query, {}, postsWithFragments.path, postsWithFragments.records); + let { data } = resolveData(query, {}, postsWithFragments.path, postsWithFragments.records); expect(data).toEqual(postsWithFragments.data); }); @@ -103,7 +103,7 @@ describe("resolveValues", () => { first: 1 }; - let { data } = resolveValues( + let { data } = resolveData( query, variables, authorWithArguments.path, @@ -138,7 +138,7 @@ describe("resolveValues", () => { first: 1 }; - let { data } = resolveValues( + let { data } = resolveData( query, variables, authorWithArguments.path, @@ -157,7 +157,7 @@ describe("resolveValues", () => { } `; - let { data, partial } = resolveValues(query, {}, {}, {}); + let { data, partial } = resolveData(query, {}, {}, {}); expect(data).toEqual({}); expect(partial).toEqual(true); @@ -166,7 +166,7 @@ describe("resolveValues", () => { it("should be able to resolve values partially", () => { let query = POSTS_AND_AUTHORS; - let { data, partial } = resolveValues( + let { data, partial } = resolveData( query, {}, { authors: postsAndAuthors.path.authors }, diff --git a/packages/core/__tests__/store-values.ts b/packages/core/__tests__/store-data.ts similarity index 89% rename from packages/core/__tests__/store-values.ts rename to packages/core/__tests__/store-data.ts index 70c175fb..fce79c1e 100644 --- a/packages/core/__tests__/store-values.ts +++ b/packages/core/__tests__/store-data.ts @@ -1,5 +1,5 @@ import { graphql } from "@grafoo/core"; -import storeValues from "../src/store-values"; +import storeData from "../src/store-data"; import * as postsAndAuthors from "./data/posts-and-authors"; import * as postsWithFragments from "./data/posts-with-fragments"; import * as authorWithArguments from "./data/author-with-arguments"; @@ -42,7 +42,7 @@ describe("storeValues", () => { it("should yield correct path and records to a normal query", () => { let query = POSTS_AND_AUTHORS; - let { paths, records } = storeValues(query, {}, postsAndAuthors.data, idFields); + let { paths, records } = storeData(query, {}, postsAndAuthors.data, idFields); expect(paths).toEqual(postsAndAuthors.path); expect(records).toEqual(postsAndAuthors.records); @@ -80,7 +80,7 @@ describe("storeValues", () => { } `; - let { paths, records } = storeValues(query, {}, postsWithFragments.data, idFields); + let { paths, records } = storeData(query, {}, postsWithFragments.data, idFields); expect(paths).toEqual(postsWithFragments.path); expect(records).toEqual(postsWithFragments.records); @@ -107,7 +107,7 @@ describe("storeValues", () => { first: 1 }; - let { paths, records } = storeValues(query, variables, authorWithArguments.data, idFields); + let { paths, records } = storeData(query, variables, authorWithArguments.data, idFields); expect(paths).toEqual(authorWithArguments.path); expect(records).toEqual(authorWithArguments.records); @@ -138,7 +138,7 @@ describe("storeValues", () => { first: 1 }; - let { paths, records } = storeValues(query, variables, authorWithArguments.data, idFields); + let { paths, records } = storeData(query, variables, authorWithArguments.data, idFields); expect(paths).toEqual(authorWithArguments.path); expect(records).toEqual(authorWithArguments.records); @@ -161,7 +161,7 @@ describe("storeValues", () => { data.authors.edges[0].node.posts = null; - let { paths } = storeValues(query, {}, data, idFields); + let { paths } = storeData(query, {}, data, idFields); expect(paths).toEqual({ authors: { diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts index 2d8e63ae..889279d2 100644 --- a/packages/core/src/client.ts +++ b/packages/core/src/client.ts @@ -1,5 +1,5 @@ -import storeValues from "./store-values"; -import resolveValues from "./resolve-values"; +import storeData from "./store-data"; +import resolveData from "./resolve-data"; import { GrafooClient, GrafooClientOptions, @@ -44,9 +44,9 @@ export default function createClient( variables = {}; } - let result = storeValues(query, variables, data, idFields); - + let result = storeData(query, variables, data, idFields); let shouldUpdate = false; + for (let i in result.records) { // record has been inserted if (!(i in records)) shouldUpdate = true; @@ -71,7 +71,7 @@ export default function createClient( } function read(query: T, variables?: T["_variablesType"]) { - return resolveValues(query, variables, paths, records); + return resolveData(query, variables, paths, records); } function extract() { diff --git a/packages/core/src/resolve-values.ts b/packages/core/src/resolve-data.ts similarity index 96% rename from packages/core/src/resolve-values.ts rename to packages/core/src/resolve-data.ts index f670d7dd..b439f93c 100644 --- a/packages/core/src/resolve-values.ts +++ b/packages/core/src/resolve-data.ts @@ -1,7 +1,7 @@ import { GrafooPath, GrafooQuery, GrafooRecords, GrafooSelection } from "./types"; import { getPathId, getPathType, resolveSelection } from "./util"; -export default function resolveValues( +export default function resolveData( { operation, fragments }: T, variables: T["_variablesType"], allPaths: GrafooPath, diff --git a/packages/core/src/store-values.ts b/packages/core/src/store-data.ts similarity index 97% rename from packages/core/src/store-values.ts rename to packages/core/src/store-data.ts index c1377951..92ab81ae 100644 --- a/packages/core/src/store-values.ts +++ b/packages/core/src/store-data.ts @@ -1,7 +1,7 @@ import { GrafooPath, GrafooQuery, GrafooRecords, GrafooSelection } from "./types"; import { idFromBranch, getPathId, resolveSelection } from "./util"; -export default function storeValues( +export default function storeData( { operation, fragments }: T, variables: T["_variablesType"], data: T["_queryType"], From 537c277d721ded80d425ec47b760d958ff65ce60 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Thu, 2 Dec 2021 03:05:37 -0300 Subject: [PATCH 44/49] updates --- packages/core/src/resolve-data.ts | 33 ++++++++--------- packages/core/src/store-data.ts | 61 +++++++++++++------------------ packages/core/src/util.ts | 4 +- 3 files changed, 43 insertions(+), 55 deletions(-) diff --git a/packages/core/src/resolve-data.ts b/packages/core/src/resolve-data.ts index b439f93c..5a950f44 100644 --- a/packages/core/src/resolve-data.ts +++ b/packages/core/src/resolve-data.ts @@ -9,40 +9,37 @@ export default function resolveData( ) { let data = {} as T["_queryType"]; let partial = false; - let stack: [string | void, GrafooSelection, GrafooPath<{ id?: string }>, T["_queryType"]][] = [ - [undefined, operation, allPaths, data] - ]; + let stack: [GrafooSelection, GrafooPath<{ id?: string }>, any][] = [[operation, allPaths, data]]; - // traverse trough operation selection + // traverse operation selection while (stack.length) { - let [name, select, path, data] = stack.shift(); + let [select, path, data] = stack.shift(); if (Array.isArray(path)) { - // if path is a list increment the stack with - // the current selection and the path list children - for (let [k, v] of Object.entries(path)) { - // assign data type to data key given the path type - data[k] = getPathType(v); - stack.unshift([name, select, v, data[k]]); + // if path is an array increment the stack with + // the current selection and the array children + for (let [index, item] of Object.entries(path)) { + // assign path type to data key + data[index] = getPathType(item); + stack.unshift([select, item, data[index]]); } } else { let currentSelect = resolveSelection(select, fragments); - let { id } = path; - let record = allRecords[id]; + let record = allRecords[path.id]; for (let s of currentSelect.scalars) data[s] = record?.[s] ?? path?.[s]; - for (let [k, v] of Object.entries(currentSelect.select)) { - let pathId = getPathId(k, v.args, variables); + for (let [name, value] of Object.entries(currentSelect.select)) { + let pathId = getPathId(name, value.args, variables); let newPath = path[pathId]; // skip selection if path is undefined if (newPath === undefined) { partial = true; } else { - // assign data type to data key given the path type - data[k] = getPathType(newPath); - if (newPath) stack.unshift([k, v, newPath, data[k]]); + // assign path type to data key + data[name] = getPathType(newPath); + if (newPath) stack.unshift([value, newPath, data[name]]); } } } diff --git a/packages/core/src/store-data.ts b/packages/core/src/store-data.ts index 92ab81ae..63bd8c2a 100644 --- a/packages/core/src/store-data.ts +++ b/packages/core/src/store-data.ts @@ -9,57 +9,48 @@ export default function storeData( ) { let records: GrafooRecords = {}; let paths: GrafooPath = {}; - let stack: [string | void, T["_queryType"], GrafooSelection, GrafooPath][] = [ - [undefined, data, operation, paths] - ]; + let stack: [string, any, GrafooSelection, GrafooPath][] = Object.entries(data).map((e) => [ + ...e, + operation, + paths + ]); // traverse data tree while (stack.length) { let [name, branch, select, path] = stack.shift(); + let isArrayChild = isNaN(parseInt(name)); + let currentSelect = resolveSelection(isArrayChild ? select.select[name] : select, fragments); + let pathId = isArrayChild ? getPathId(name, currentSelect.args, variables) : name; + + // skip if a branch is null or undefined + if (!branch) { + path[pathId] = branch; + continue; + } - // on the first iteration name is not defined - if (typeof name === "undefined") { - // add scalars to the path object if the node doesn't have id fields - for (let field of select.scalars ?? []) path[field] = branch[field]; - - for (let [k, v] of Object.entries(branch)) { - if (typeof v === "object") stack.unshift([k, v, select, path]); - } + if (Array.isArray(branch)) { + path[pathId] = []; } else { - let isListItem = isNaN(parseInt(name)); - let currentSelect = resolveSelection(isListItem ? select.select[name] : select, fragments); - let pathId = isListItem ? getPathId(name, currentSelect.args, variables) : name; - - // skip if a branch is null or undefined - if (!branch) { - path[pathId] = branch; - continue; - } + let id = idFromBranch(branch, idFields); - if (Array.isArray(branch)) { - path[pathId] = [...(path[pathId] ?? [])]; - } else { - let id = idFromBranch(branch, idFields); - - path[pathId] = { ...path[pathId] }; + path[pathId] = { ...(id && { id }) }; + for (let field of currentSelect.scalars) { if (id) { - // increment path with id pointing to a record - path[pathId].id = id; + // create a record records[id] = records[id] ?? {}; - // populate record with branch scalar values - for (let field of currentSelect.scalars) records[id][field] = branch[field]; + records[id][field] = branch[field]; } else { // add scalars to the path object if the node doesn't have id fields - for (let field of currentSelect.scalars) path[pathId][field] = branch[field]; + path[pathId][field] = branch[field]; } } + } - // look for new branches and increment stack - for (let [k, v] of Object.entries(branch)) { - if (typeof v === "object") stack.unshift([k, v, currentSelect, path[pathId]]); - } + // look for new branches and increment stack + for (let [k, v] of Object.entries(branch)) { + if (typeof v === "object") stack.unshift([k, v, currentSelect, path[pathId]]); } } diff --git a/packages/core/src/util.ts b/packages/core/src/util.ts index ff82e821..70f4187d 100644 --- a/packages/core/src/util.ts +++ b/packages/core/src/util.ts @@ -24,7 +24,7 @@ export function getPathId( return `${name}:${finalValue}`; }); - return [path].concat(ids).join(":"); + return [path].concat(ids).join("|"); } export function resolveSelection( @@ -57,7 +57,7 @@ export function getPathType(path: GrafooPath) { return path ? (Array.isArray(path) ? [] : {}) : null; } -export function isObject(item: any) { +function isObject(item: any) { return typeof item === "object" && !Array.isArray(item); } From 09381e625414832a1c9b78f1f0f3a7ab7b4ffb2e Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Thu, 2 Dec 2021 03:12:46 -0300 Subject: [PATCH 45/49] updates --- packages/core/src/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/util.ts b/packages/core/src/util.ts index 70f4187d..a02dc7f5 100644 --- a/packages/core/src/util.ts +++ b/packages/core/src/util.ts @@ -24,7 +24,7 @@ export function getPathId( return `${name}:${finalValue}`; }); - return [path].concat(ids).join("|"); + return [path].concat(ids).join(":"); } export function resolveSelection( From 8f01c1bc28ff171077fe44d5f98366253a5227fe Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Thu, 2 Dec 2021 03:37:05 -0300 Subject: [PATCH 46/49] change core api to receive transport as option --- packages/bindings/__tests__/index.ts | 2 +- packages/core/__tests__/index.ts | 10 +++++----- packages/core/src/client.ts | 15 ++++----------- packages/core/src/types.ts | 1 + packages/react/__tests__/index.tsx | 2 +- 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/packages/bindings/__tests__/index.ts b/packages/bindings/__tests__/index.ts index 2c52cff1..f85fcc2b 100644 --- a/packages/bindings/__tests__/index.ts +++ b/packages/bindings/__tests__/index.ts @@ -25,7 +25,7 @@ describe("@grafoo/bindings", () => { beforeEach(() => { jest.resetAllMocks(); let transport = createTransport("https://some.graphql.api/"); - client = createClient(transport, { idFields: ["id"] }); + client = createClient({ transport, idFields: ["id"] }); }); it("should be evocable given the minimal props", () => { diff --git a/packages/core/__tests__/index.ts b/packages/core/__tests__/index.ts index 140067ea..3bb57432 100644 --- a/packages/core/__tests__/index.ts +++ b/packages/core/__tests__/index.ts @@ -10,18 +10,18 @@ import { SIMPLE_AUTHORS } from "./queries"; -function mockTransport(query: any, variables: any) { +function transport(query: any, variables: any) { return executeQuery({ query, variables }); } describe("@grafoo/core", () => { let client: GrafooClient; beforeEach(() => { - client = createClient(mockTransport, { idFields: ["id"] }); + client = createClient({ transport, idFields: ["id"] }); }); it("should be instantiable", () => { - expect(() => createClient(mockTransport, { idFields: ["id"] })).not.toThrow(); + expect(() => createClient({ transport, idFields: ["id"] })).not.toThrow(); expect(typeof client.execute).toBe("function"); expect(typeof client.listen).toBe("function"); expect(typeof client.write).toBe("function"); @@ -198,7 +198,7 @@ describe("@grafoo/core", () => { client.write(POSTS_AND_AUTHORS, data); - client = createClient(mockTransport, { idFields: ["id"], initialState: client.extract() }); + client = createClient({ transport, idFields: ["id"], initialState: client.extract() }); expect(client.read(POSTS_AND_AUTHORS).data).toEqual(data); }); @@ -212,7 +212,7 @@ describe("@grafoo/core", () => { }); it("should accept `idFields` array in options", async () => { - let client = createClient(mockTransport, { idFields: ["__typename", "id"] }); + let client = createClient({ transport, idFields: ["__typename", "id"] }); let { data } = await client.execute(AUTHORS); client.write(AUTHORS, data); diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts index 889279d2..2ade28b1 100644 --- a/packages/core/src/client.ts +++ b/packages/core/src/client.ts @@ -6,16 +6,12 @@ import { GrafooListener, GrafooPath, GrafooQuery, - GrafooRecords, - GrafooTransport + GrafooRecords } from "./types"; import { deepMerge } from "./util"; -export default function createClient( - transport: GrafooTransport, - options: GrafooClientOptions -): GrafooClient { - let { initialState, idFields } = options; +export default function createClient(options: GrafooClientOptions): GrafooClient { + let { transport, initialState, idFields } = options; let paths: GrafooPath = initialState?.paths ?? {}; let records: GrafooRecords = initialState?.records ?? {}; let listeners: GrafooListener[] = []; @@ -39,10 +35,7 @@ export default function createClient( variables: T["_variablesType"], data?: T["_queryType"] ) { - if (!data) { - data = variables as T["_queryType"]; - variables = {}; - } + if (!data) (data = variables), (variables = {}); let result = storeData(query, variables, data, idFields); let shouldUpdate = false; diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 3550b501..c8a02fd3 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -64,6 +64,7 @@ export type GrafooClient = { }; export type GrafooClientOptions = { + transport: GrafooTransport; idFields: Array; initialState?: GrafooInitialState; }; diff --git a/packages/react/__tests__/index.tsx b/packages/react/__tests__/index.tsx index d9396bf2..483fc36f 100644 --- a/packages/react/__tests__/index.tsx +++ b/packages/react/__tests__/index.tsx @@ -33,7 +33,7 @@ describe("@grafoo/react", () => { beforeEach(() => { jest.resetAllMocks(); let transport = createTransport("https://some.graphql.api/"); - client = createClient(transport, { idFields: ["id"] }); + client = createClient({ transport, idFields: ["id"] }); wrapper = (props) => {props.children}; }); From a4f8cb7807da2daf18efa4cc9fc9e4465b8329f2 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Thu, 2 Dec 2021 03:49:46 -0300 Subject: [PATCH 47/49] refactor core --- packages/core/src/client.ts | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts index 2ade28b1..3c21dc3b 100644 --- a/packages/core/src/client.ts +++ b/packages/core/src/client.ts @@ -38,29 +38,34 @@ export default function createClient(options: GrafooClientOptions): GrafooClient if (!data) (data = variables), (variables = {}); let result = storeData(query, variables, data, idFields); - let shouldUpdate = false; - for (let i in result.records) { + let updateListener = shouldUpdate(result.records); + + // update paths and records + deepMerge(paths, result.paths); + deepMerge(records, result.records); + + // run listeners + for (let i in listeners) listeners[i](updateListener); + } + + function shouldUpdate(nextRecords: GrafooRecords) { + for (let i in nextRecords) { // record has been inserted - if (!(i in records)) shouldUpdate = true; + if (!(i in records)) return true; - for (let j in result.records[i]) { + for (let j in nextRecords[i]) { // record has been updated - if (result.records[i][j] !== records[i]?.[j]) shouldUpdate = true; + if (nextRecords[i][j] !== records[i]?.[j]) return true; } } for (let i in records) { // record has been removed - if (!(i in result.records)) shouldUpdate = true; + if (!(i in nextRecords)) return true; } - // update paths and records - deepMerge(paths, result.paths); - deepMerge(records, result.records); - - // run listeners - for (let i in listeners) listeners[i](shouldUpdate); + return false; } function read(query: T, variables?: T["_variablesType"]) { From 65ad516838ec244af62c09b778e8c6d3513f5479 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Fri, 3 Dec 2021 17:17:38 -0300 Subject: [PATCH 48/49] includes load method to bindings and react change skip name to lazy --- packages/bindings/__tests__/index.ts | 19 ++++++----- packages/bindings/src/bindings.ts | 27 +++++++++------ packages/bindings/src/types.ts | 5 +-- packages/core/src/resolve-data.ts | 2 +- packages/react/__tests__/index.tsx | 49 ++++++++++++++-------------- packages/react/src/index.ts | 4 +-- 6 files changed, 58 insertions(+), 48 deletions(-) diff --git a/packages/bindings/__tests__/index.ts b/packages/bindings/__tests__/index.ts index f85fcc2b..402dcc91 100644 --- a/packages/bindings/__tests__/index.ts +++ b/packages/bindings/__tests__/index.ts @@ -22,6 +22,7 @@ let sleep = (time = 0) => new Promise((resolve) => setTimeout(resolve, time)); describe("@grafoo/bindings", () => { let client: GrafooClient; + let load = expect.any(Function); beforeEach(() => { jest.resetAllMocks(); let transport = createTransport("https://some.graphql.api/"); @@ -51,13 +52,13 @@ describe("@grafoo/bindings", () => { let renderFn = jest.fn(); let bindings = createBindings(client, renderFn, { query: AUTHORS }); - expect(bindings.getState()).toEqual({ loaded: false, loading: true }); + expect(bindings.getState()).toEqual({ load, loaded: false, loading: true }); await sleep(); let results = renderFn.mock.calls.map((c) => c[0]); - expect(results).toEqual([{ ...data, loaded: true, loading: false }]); + expect(results).toEqual([{ ...data, load, loaded: true, loading: false }]); }); it("should notify a loading state", async () => { @@ -71,9 +72,9 @@ describe("@grafoo/bindings", () => { let results = renderFn.mock.calls.map((c) => c[0]); expect(results).toEqual([ - { loaded: true, loading: false, ...data }, - { loaded: true, loading: true, ...data }, - { loaded: true, loading: false, ...data } + { load, loaded: true, loading: false, ...data }, + { load, loaded: true, loading: true, ...data }, + { load, loaded: true, loading: false, ...data } ]); }); @@ -84,7 +85,7 @@ describe("@grafoo/bindings", () => { let bindings = createBindings(client, () => {}, { query: AUTHORS }); - expect(bindings.getState()).toEqual({ ...data, loaded: true, loading: false }); + expect(bindings.getState()).toEqual({ ...data, load, loaded: true, loading: false }); }); it("should provide the data if a query is partialy cached", async () => { @@ -94,7 +95,7 @@ describe("@grafoo/bindings", () => { let bindings = createBindings(client, () => {}, { query: POSTS_AND_AUTHORS }); - expect(bindings.getState()).toEqual({ ...data, loaded: false, loading: true }); + expect(bindings.getState()).toEqual({ ...data, load, loaded: false, loading: true }); }); it("should provide the state for a cached query", async () => { @@ -105,7 +106,7 @@ describe("@grafoo/bindings", () => { let renderFn = jest.fn(); let bindings = createBindings(client, renderFn, { query: AUTHORS }); - expect(bindings.getState()).toEqual({ ...data, loaded: true, loading: false }); + expect(bindings.getState()).toEqual({ ...data, load, loaded: true, loading: false }); }); it("should stop updating if unbind has been called", async () => { @@ -132,7 +133,7 @@ describe("@grafoo/bindings", () => { await sleep(); expect(renderFn).toHaveBeenCalledTimes(1); - expect(bindings.getState()).toEqual({ loading: false, loaded: false, errors }); + expect(bindings.getState()).toEqual({ load, loading: false, loaded: false, errors }); }); it("should perform a simple mutation", async () => { diff --git a/packages/bindings/src/bindings.ts b/packages/bindings/src/bindings.ts index 9b8c76b0..91c38dd4 100644 --- a/packages/bindings/src/bindings.ts +++ b/packages/bindings/src/bindings.ts @@ -21,7 +21,7 @@ export default function createBindings< props: GrafooConsumerProps ): GrafooBindings { type CP = GrafooConsumerProps; - let { query, variables, mutations, skip = false } = props; + let { query, variables, mutations, lazy = false } = props; let data: CP["query"]["_queryType"]; let errors: GraphQlError[]; let partial = true; @@ -51,23 +51,30 @@ export default function createBindings< client.write(query, variables, optimisticUpdate(clone(data), mutationVariables)); } - return client.execute(mutationQuery, mutationVariables).then((response) => { - if (query && update && response.data) { - client.write(query, variables, update(clone(data), response.data)); + return client.execute(mutationQuery, mutationVariables).then((res) => { + if (query && update && res.data) { + client.write(query, variables, update(clone(data), res.data)); } - return response; + return res; }); }; } } - let getState = () => ({ ...state, ...boundMutations, ...(data as {}) }); + let getState = () => ({ + ...state, + ...boundMutations, + ...(query && { load }), + ...(data as {}) + }); - let loading = !!query && !skip && partial; - let state = { loaded: !partial, loading }; + let state = { + loaded: !partial, + loading: !!query && !lazy && partial + }; - if (loading) load(); + if (state.loading) load(); function load(nextVariables?: CP["query"]["_variablesType"]) { variables = nextVariables ?? variables; @@ -77,7 +84,7 @@ export default function createBindings< updater(getState()); } - return client.execute(query, variables).then((res) => { + client.execute(query, variables).then((res) => { ({ data, errors } = res); if (data) client.write(query, variables, data); diff --git a/packages/bindings/src/types.ts b/packages/bindings/src/types.ts index 8a2ea7c2..f7e51781 100644 --- a/packages/bindings/src/types.ts +++ b/packages/bindings/src/types.ts @@ -13,13 +13,14 @@ export type GrafooBoundState< GrafooBoundMutations & { loaded: boolean; loading: boolean; + load?: (variables?: T["_variablesType"]) => void; errors?: GraphQlError[]; }; export type GrafooBindings> = { unbind: () => void; getState: () => GrafooBoundState; - load: (variables?: T["_variablesType"]) => Promise; + load: (variables?: T["_variablesType"]) => void; }; export type GrafooMutation = { @@ -34,7 +35,7 @@ export type GrafooMutations> = { query?: T; - skip?: boolean; + lazy?: boolean; variables?: T["_variablesType"]; mutations?: GrafooMutations; }; diff --git a/packages/core/src/resolve-data.ts b/packages/core/src/resolve-data.ts index 5a950f44..7582cec3 100644 --- a/packages/core/src/resolve-data.ts +++ b/packages/core/src/resolve-data.ts @@ -17,7 +17,7 @@ export default function resolveData( if (Array.isArray(path)) { // if path is an array increment the stack with - // the current selection and the array children + // the current selection and path children for (let [index, item] of Object.entries(path)) { // assign path type to data key data[index] = getPathType(item); diff --git a/packages/react/__tests__/index.tsx b/packages/react/__tests__/index.tsx index 483fc36f..1a592df4 100644 --- a/packages/react/__tests__/index.tsx +++ b/packages/react/__tests__/index.tsx @@ -29,6 +29,7 @@ globalThis.fetch = fetch; describe("@grafoo/react", () => { let client: GrafooClient; let wrapper: React.FC; + let load = expect.any(Function); beforeEach(() => { jest.resetAllMocks(); @@ -41,10 +42,10 @@ describe("@grafoo/react", () => { expect(() => renderHook(() => useGrafoo({}), { wrapper })).not.toThrow(); }); - it("should not fetch a query if skip prop is set to true", async () => { + it("should not fetch a query if lazy prop is set to true", async () => { let spy = jest.spyOn(window, "fetch"); - renderHook(() => useGrafoo({ query: AUTHORS, skip: true }), { wrapper }); + renderHook(() => useGrafoo({ query: AUTHORS, lazy: true }), { wrapper }); expect(spy).not.toHaveBeenCalled(); }); @@ -54,15 +55,15 @@ describe("@grafoo/react", () => { let spy = jest.spyOn(client, "listen"); - renderHook(() => useGrafoo({ query: AUTHORS, skip: true }), { wrapper }); + renderHook(() => useGrafoo({ query: AUTHORS, lazy: true }), { wrapper }); expect(spy).toHaveBeenCalled(); }); it("should execute render with default render argument", () => { - let { result } = renderHook(() => useGrafoo({ query: AUTHORS, skip: true }), { wrapper }); + let { result } = renderHook(() => useGrafoo({ query: AUTHORS, lazy: true }), { wrapper }); - expect(result.current).toEqual({ loading: false, loaded: false }); + expect(result.current).toEqual({ load, loading: false, loaded: false }); }); it("should execute render with the right data if a query is specified", async () => { @@ -71,28 +72,28 @@ describe("@grafoo/react", () => { wrapper }); - expect(result.current).toEqual({ loading: true, loaded: false }); + expect(result.current).toEqual({ load, loading: true, loaded: false }); await waitForNextUpdate(); - expect(result.current).toEqual({ loading: false, loaded: true, ...data }); + expect(result.current).toEqual({ load, loading: false, loaded: true, ...data }); }); - it("should render if skip changed value to false", async () => { + it("should render if lazy changed value to false", async () => { let { data } = await mockQueryRequest(AUTHORS); - let { result, rerender, waitForNextUpdate } = renderHook<{ skip: boolean }, any>( - ({ skip }) => useGrafoo({ query: AUTHORS, skip }), + let { result, rerender, waitForNextUpdate } = renderHook<{ lazy: boolean }, any>( + ({ lazy }) => useGrafoo({ query: AUTHORS, lazy }), { wrapper, initialProps: { - skip: true + lazy: true } } ); - expect(result.current).toEqual({ loading: false, loaded: false }); - rerender({ skip: false }); - expect(result.current).toEqual({ loading: true, loaded: false }); + expect(result.current).toEqual({ load, loading: false, loaded: false }); + rerender({ lazy: false }); + expect(result.current).toEqual({ load, loading: true, loaded: false }); await waitForNextUpdate(); - expect(result.current).toEqual({ loading: false, loaded: true, ...data }); + expect(result.current).toEqual({ load, loading: false, loaded: true, ...data }); }); it("should rerender if variables prop has changed", async () => { @@ -113,14 +114,14 @@ describe("@grafoo/react", () => { } ); - expect(result.current).toEqual({ loading: true, loaded: false }); + expect(result.current).toEqual({ load, loading: true, loaded: false }); await waitForNextUpdate(); - expect(result.current).toEqual({ loading: false, loaded: true, author: author1.node }); + expect(result.current).toEqual({ load, loading: false, loaded: true, author: author1.node }); await mockQueryRequest(AUTHOR, { id: author2.node.id }); rerender({ id: author2.node.id }); - expect(result.current).toEqual({ loading: true, loaded: true, author: author1.node }); + expect(result.current).toEqual({ load, loading: true, loaded: true, author: author1.node }); await waitForNextUpdate(); - expect(result.current).toEqual({ loading: false, loaded: true, author: author2.node }); + expect(result.current).toEqual({ load, loading: false, loaded: true, author: author2.node }); }); it("should not try to load a query if it's already cached", async () => { @@ -131,7 +132,7 @@ describe("@grafoo/react", () => { let spy = jest.spyOn(client, "execute"); let { result } = renderHook(() => useGrafoo({ query: AUTHORS }), { wrapper }); - expect(result.current).toEqual({ loading: false, loaded: true, ...data }); + expect(result.current).toEqual({ load, loading: false, loaded: true, ...data }); expect(spy).not.toHaveBeenCalled(); }); @@ -178,12 +179,12 @@ describe("@grafoo/react", () => { { wrapper } ); - expect(result.current).toMatchObject({ loading: true, loaded: false }); + expect(result.current).toMatchObject({ load, loading: true, loaded: false }); expect(typeof result.current.createAuthor).toBe("function"); await waitForNextUpdate(); - expect(result.current).toMatchObject({ loading: false, loaded: true, ...data }); + expect(result.current).toMatchObject({ load, loading: false, loaded: true, ...data }); let variables = { input: { name: "Homer" } }; await mockQueryRequest(CREATE_AUTHOR, variables); @@ -208,7 +209,7 @@ describe("@grafoo/react", () => { let { result } = renderHook(() => useGrafoo({ query: AUTHORS }), { wrapper }); - expect(result.current).toMatchObject({ loading: false, loaded: true, ...data }); + expect(result.current).toMatchObject({ load, loading: false, loaded: true, ...data }); act(() => { let newAuthors: AuthorsQuery = JSON.parse(JSON.stringify(data)); @@ -231,7 +232,7 @@ describe("@grafoo/react", () => { let spy = jest.spyOn(client, "execute"); - expect(result.current).toEqual({ authors: data.authors, loading: false, loaded: true }); + expect(result.current).toEqual({ authors: data.authors, load, loading: false, loaded: true }); expect(spy).not.toHaveBeenCalled(); }); }); diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 108e30ec..0da1c4b7 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -33,13 +33,13 @@ export function useGrafoo { if ( - (props.query && !props.skip && !state.loaded && !state.loading) || + (props.query && !props.lazy && !state.loaded && !state.loading) || !deepEqual(variables.current, props.variables) ) { variables.current = props.variables; bindings.load(props.variables); } - }, [props.skip, props.variables]); + }, [props.lazy, props.variables]); return state; } From c1cba8e4017b14b7cb89c3200d2b3c537e14a702 Mon Sep 17 00:00:00 2001 From: Miguel Albernaz Date: Fri, 3 Dec 2021 17:42:25 -0300 Subject: [PATCH 49/49] make load return query response; make all exports named --- packages/bindings/__tests__/index.ts | 6 +++--- packages/bindings/src/bindings.ts | 13 ++++++------- packages/bindings/src/index.ts | 2 +- packages/bindings/src/types.ts | 4 ++-- packages/core/__tests__/index.ts | 2 +- packages/core/src/client.ts | 2 +- packages/core/src/index.ts | 2 +- packages/core/src/tag.ts | 2 +- packages/core/src/types.ts | 2 +- packages/react/__tests__/index.tsx | 4 ++-- packages/react/src/index.ts | 7 ++++--- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/packages/bindings/__tests__/index.ts b/packages/bindings/__tests__/index.ts index 402dcc91..2d6b9336 100644 --- a/packages/bindings/__tests__/index.ts +++ b/packages/bindings/__tests__/index.ts @@ -1,5 +1,5 @@ -import createBindings, { makeGrafooConfig } from "../src"; -import createClient, { GrafooClient } from "@grafoo/core"; +import { createBindings, makeGrafooConfig } from "../src"; +import { createClient, GrafooClient } from "@grafoo/core"; import { mockQueryRequest, createTransport, @@ -30,7 +30,7 @@ describe("@grafoo/bindings", () => { }); it("should be evocable given the minimal props", () => { - let bindings; + let bindings: ReturnType; expect(() => (bindings = createBindings(client, () => {}, {}))).not.toThrow(); Object.keys(bindings).forEach((fn) => { diff --git a/packages/bindings/src/bindings.ts b/packages/bindings/src/bindings.ts index 91c38dd4..4af139d9 100644 --- a/packages/bindings/src/bindings.ts +++ b/packages/bindings/src/bindings.ts @@ -12,10 +12,7 @@ export let makeGrafooConfig = (data: T) => JSON.parse(JSON.stringify(data)); -export default function createBindings< - T extends GrafooQuery, - U extends Record ->( +export function createBindings>( client: GrafooClient, updater: (state: GrafooBoundState) => void, props: GrafooConsumerProps @@ -65,8 +62,8 @@ export default function createBindings< let getState = () => ({ ...state, ...boundMutations, - ...(query && { load }), - ...(data as {}) + ...data, + ...(query && { load }) }); let state = { @@ -84,13 +81,15 @@ export default function createBindings< updater(getState()); } - client.execute(query, variables).then((res) => { + return client.execute(query, variables).then((res) => { ({ data, errors } = res); if (data) client.write(query, variables, data); state = { loaded: !!data, loading: false, ...(errors && { errors }) }; updater(getState()); + + return res; }); } diff --git a/packages/bindings/src/index.ts b/packages/bindings/src/index.ts index 243aac83..4a53e5be 100644 --- a/packages/bindings/src/index.ts +++ b/packages/bindings/src/index.ts @@ -1,2 +1,2 @@ -export { default, makeGrafooConfig } from "./bindings"; +export * from "./bindings"; export * from "./types"; diff --git a/packages/bindings/src/types.ts b/packages/bindings/src/types.ts index f7e51781..c6968750 100644 --- a/packages/bindings/src/types.ts +++ b/packages/bindings/src/types.ts @@ -13,14 +13,14 @@ export type GrafooBoundState< GrafooBoundMutations & { loaded: boolean; loading: boolean; - load?: (variables?: T["_variablesType"]) => void; + load?: (variables?: T["_variablesType"]) => Promise>; errors?: GraphQlError[]; }; export type GrafooBindings> = { unbind: () => void; getState: () => GrafooBoundState; - load: (variables?: T["_variablesType"]) => void; + load: (variables?: T["_variablesType"]) => Promise>; }; export type GrafooMutation = { diff --git a/packages/core/__tests__/index.ts b/packages/core/__tests__/index.ts index 3bb57432..8431b921 100644 --- a/packages/core/__tests__/index.ts +++ b/packages/core/__tests__/index.ts @@ -1,5 +1,5 @@ import { executeQuery } from "@grafoo/test-utils"; -import createClient from "../src"; +import { createClient } from "../src"; import { GrafooClient } from "../src/types"; import { AUTHORS, diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts index 3c21dc3b..69170365 100644 --- a/packages/core/src/client.ts +++ b/packages/core/src/client.ts @@ -10,7 +10,7 @@ import { } from "./types"; import { deepMerge } from "./util"; -export default function createClient(options: GrafooClientOptions): GrafooClient { +export function createClient(options: GrafooClientOptions): GrafooClient { let { transport, initialState, idFields } = options; let paths: GrafooPath = initialState?.paths ?? {}; let records: GrafooRecords = initialState?.records ?? {}; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index cd4ce4ed..0bfbe1bf 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,3 +1,3 @@ export * from "./types"; export * from "./tag"; -export { default } from "./client"; +export * from "./client"; diff --git a/packages/core/src/tag.ts b/packages/core/src/tag.ts index 2f0cdf37..51d6a9f1 100644 --- a/packages/core/src/tag.ts +++ b/packages/core/src/tag.ts @@ -1,6 +1,6 @@ import { GrafooQuery } from "./types"; // @ts-ignore -export function graphql(strs: TemplateStringsArray): GrafooQuery {} +export function graphql(strs: TemplateStringsArray): GrafooQuery {} export let gql = graphql; diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index c8a02fd3..3d9e41c5 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -36,7 +36,7 @@ export type GrafooSelection = { select?: Record; }; -export type GrafooQuery = { +export type GrafooQuery = { document: string; id?: string; operation?: GrafooSelection; diff --git a/packages/react/__tests__/index.tsx b/packages/react/__tests__/index.tsx index 1a592df4..c2b4fe1f 100644 --- a/packages/react/__tests__/index.tsx +++ b/packages/react/__tests__/index.tsx @@ -4,7 +4,7 @@ import fetch from "node-fetch"; import * as React from "react"; -import createClient, { GrafooClient } from "@grafoo/core"; +import { createClient } from "@grafoo/core"; import { mockQueryRequest, createTransport, @@ -27,7 +27,7 @@ import { globalThis.fetch = fetch; describe("@grafoo/react", () => { - let client: GrafooClient; + let client: ReturnType; let wrapper: React.FC; let load = expect.any(Function); diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 0da1c4b7..06ef0801 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -1,9 +1,10 @@ import * as React from "react"; import { GrafooClient, GrafooQuery } from "@grafoo/core"; -import createBindings, { +import { + createBindings, + makeGrafooConfig, GrafooConsumerProps, - GrafooBoundState, - makeGrafooConfig + GrafooBoundState } from "@grafoo/bindings"; // @ts-ignore