From 6ea0e053309f78b58df79d847d0ae1b62dec2ce6 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Fri, 5 Mar 2021 20:19:36 -0500 Subject: [PATCH 01/29] init commit of WIP with server and graphiql working --- greenwood.config.js | 2 + packages/cli/src/data/queries/children.gql | 10 - packages/cli/src/data/queries/graph.gql | 10 - packages/cli/src/lifecycles/config.js | 2 +- packages/plugin-graphql/README.md | 37 + packages/plugin-graphql/package.json | 35 + .../data => plugin-graphql/src/core}/cache.js | 0 .../src/core}/client.js | 0 .../src/core}/common.js | 0 .../src/core}/server.js | 11 +- packages/plugin-graphql/src/index.js | 26 + .../plugin-graphql/src/queries/children.gql | 11 + .../src}/queries/config.gql | 0 packages/plugin-graphql/src/queries/graph.gql | 11 + .../src}/queries/menu.gql | 6 +- .../src}/schema/config.js | 0 .../src}/schema/graph.js | 45 +- .../src}/schema/schema.js | 0 yarn.lock | 1157 ++++++++++++++++- 19 files changed, 1271 insertions(+), 92 deletions(-) delete mode 100644 packages/cli/src/data/queries/children.gql delete mode 100644 packages/cli/src/data/queries/graph.gql create mode 100644 packages/plugin-graphql/README.md create mode 100644 packages/plugin-graphql/package.json rename packages/{cli/src/data => plugin-graphql/src/core}/cache.js (100%) rename packages/{cli/src/data => plugin-graphql/src/core}/client.js (100%) rename packages/{cli/src/data => plugin-graphql/src/core}/common.js (100%) rename packages/{cli/src/data => plugin-graphql/src/core}/server.js (70%) create mode 100644 packages/plugin-graphql/src/index.js create mode 100644 packages/plugin-graphql/src/queries/children.gql rename packages/{cli/src/data => plugin-graphql/src}/queries/config.gql (100%) create mode 100644 packages/plugin-graphql/src/queries/graph.gql rename packages/{cli/src/data => plugin-graphql/src}/queries/menu.gql (86%) rename packages/{cli/src/data => plugin-graphql/src}/schema/config.js (100%) rename packages/{cli/src/data => plugin-graphql/src}/schema/graph.js (78%) rename packages/{cli/src/data => plugin-graphql/src}/schema/schema.js (100%) diff --git a/greenwood.config.js b/greenwood.config.js index 3b0aaf883..1629f2a4b 100644 --- a/greenwood.config.js +++ b/greenwood.config.js @@ -1,5 +1,6 @@ const path = require('path'); const pluginGoogleAnalytics = require('./packages/plugin-google-analytics/src/index'); +const pluginGraphQL = require('./packages/plugin-graphql/src/index'); const pluginImportCss = require('./packages/plugin-import-css/src/index'); const pluginPolyfills = require('./packages/plugin-polyfills/src/index'); const pluginPostCss = require('./packages/plugin-postcss/src/index'); @@ -26,6 +27,7 @@ module.exports = { pluginGoogleAnalytics({ analyticsId: 'UA-147204327-1' }), + ...pluginGraphQL(), pluginPolyfills(), pluginPostCss(), ...pluginImportCss() diff --git a/packages/cli/src/data/queries/children.gql b/packages/cli/src/data/queries/children.gql deleted file mode 100644 index 3f7303b29..000000000 --- a/packages/cli/src/data/queries/children.gql +++ /dev/null @@ -1,10 +0,0 @@ -query($parent: String!) { - children(parent: $parent) { - id, - title, - link, - filePath, - fileName, - template - } -} \ No newline at end of file diff --git a/packages/cli/src/data/queries/graph.gql b/packages/cli/src/data/queries/graph.gql deleted file mode 100644 index 7aaf1fd02..000000000 --- a/packages/cli/src/data/queries/graph.gql +++ /dev/null @@ -1,10 +0,0 @@ -query { - graph { - id, - title, - link, - filePath, - fileName, - template - } -} \ No newline at end of file diff --git a/packages/cli/src/lifecycles/config.js b/packages/cli/src/lifecycles/config.js index c938b38a3..7e931844e 100644 --- a/packages/cli/src/lifecycles/config.js +++ b/packages/cli/src/lifecycles/config.js @@ -7,7 +7,7 @@ let defaultConfig = { devServer: { port: 1984 }, - // TODO optimization: 'spa', + optimization: '', title: 'My App', meta: [], plugins: [], diff --git a/packages/plugin-graphql/README.md b/packages/plugin-graphql/README.md new file mode 100644 index 000000000..f693e87b9 --- /dev/null +++ b/packages/plugin-graphql/README.md @@ -0,0 +1,37 @@ +# @greenwood/plugin-graphl + +## Overview +A plugin for Greenwood for using GraphQL to query your content within your application. + +> This package assumes you already have `@greenwood/cli` installed. + +## Installation +You can use your favorite JavaScript package manager to install this package. + +_examples:_ +```bash +# npm +npm -i @greenwood/plugin-graphql --save-dev + +# yarn +yarn add @greenwood/plugin-graphql --dev +``` + +## Usage +Add this plugin to your _greenwood.config.js_ and spread the `export`. + +```javascript +const pluginGraphQL = require('@greenwood/plugin-graphql'); + +module.exports = { + ... + + plugins: [ + ...pluginGraphQL() // notice the spread ... ! + ] +} +``` + +This will then allow you to use a query your content using GraphQL. + +TODO \ No newline at end of file diff --git a/packages/plugin-graphql/package.json b/packages/plugin-graphql/package.json new file mode 100644 index 000000000..8697adbd7 --- /dev/null +++ b/packages/plugin-graphql/package.json @@ -0,0 +1,35 @@ +{ + "name": "@greenwood/plugin-graphql", + "version": "0.10.0-alpha.7", + "description": "A plugin for using GraphQL for querying your content.", + "repository": "https://github.com/ProjectEvergreen/greenwood/tree/master/packages/plugin-graphql", + "author": "Owen Buckley ", + "license": "MIT", + "keywords": [ + "Greenwood", + "GraphQL", + "Static Site Generator", + "NodeJS" + ], + "main": "src/index.js", + "files": [ + "src/" + ], + "publishConfig": { + "access": "public" + }, + "peerDependencies": { + "@greenwood/cli": "^0.4.0" + }, + "dependencies": { + "apollo-cache-inmemory": "^1.6.3", + "apollo-client": "^2.6.4", + "apollo-link-http": "^1.5.16", + "apollo-server": "^2.21.0", + "graphql": "^14.5.8", + "graphql-tag": "^2.10.1" + }, + "devDependencies": { + "@greenwood/cli": "^0.10.0-alpha.7" + } +} diff --git a/packages/cli/src/data/cache.js b/packages/plugin-graphql/src/core/cache.js similarity index 100% rename from packages/cli/src/data/cache.js rename to packages/plugin-graphql/src/core/cache.js diff --git a/packages/cli/src/data/client.js b/packages/plugin-graphql/src/core/client.js similarity index 100% rename from packages/cli/src/data/client.js rename to packages/plugin-graphql/src/core/client.js diff --git a/packages/cli/src/data/common.js b/packages/plugin-graphql/src/core/common.js similarity index 100% rename from packages/cli/src/data/common.js rename to packages/plugin-graphql/src/core/common.js diff --git a/packages/cli/src/data/server.js b/packages/plugin-graphql/src/core/server.js similarity index 70% rename from packages/cli/src/data/server.js rename to packages/plugin-graphql/src/core/server.js index 584a947e6..b31e7dd56 100644 --- a/packages/cli/src/data/server.js +++ b/packages/plugin-graphql/src/core/server.js @@ -2,7 +2,7 @@ const { ApolloServer } = require('apollo-server'); module.exports = (compilation) => { const { config, graph, context } = compilation; - const schema = require('./schema/schema')(graph); + const schema = require('../schema/schema')(graph); const createCache = require('./cache'); const server = new ApolloServer({ @@ -14,11 +14,10 @@ module.exports = (compilation) => { } }, context: async (integrationContext) => { - const { req } = integrationContext; - - if (req.query.q !== 'internal') { - await createCache(req, context); - } + // const { req } = integrationContext; + // if (req.query.q !== 'internal') { + // await createCache(req, context); + // } return { config, diff --git a/packages/plugin-graphql/src/index.js b/packages/plugin-graphql/src/index.js new file mode 100644 index 000000000..17a27b0e1 --- /dev/null +++ b/packages/plugin-graphql/src/index.js @@ -0,0 +1,26 @@ +const { ServerInterface } = require('@greenwood/cli/src/lib/server-interface'); +const graphqlServer = require('./core/server'); + +class GraphQLServer extends ServerInterface { + constructor(compilation, options = {}) { + super(compilation, options); + } + + async start() { + return graphqlServer(this.compilation).listen().then((server) => { + console.log(`GraphQLServer started at ${server.url}`); + }); + } +} + +module.exports = (options = {}) => { + return [{ + type: 'server', + name: 'plugin-graphql:server', + provider: (compilation) => new GraphQLServer(compilation, options) + // }, { + // type: 'resource', + // name: 'plugin-live-reload:resource', + // provider: (compilation) => new LiveReloadResource(compilation, options) + }]; +}; \ No newline at end of file diff --git a/packages/plugin-graphql/src/queries/children.gql b/packages/plugin-graphql/src/queries/children.gql new file mode 100644 index 000000000..295a70a64 --- /dev/null +++ b/packages/plugin-graphql/src/queries/children.gql @@ -0,0 +1,11 @@ +query($parent: String!) { + children(parent: $parent) { + id, + filename, + label, + path, + route, + template, + title + } +} \ No newline at end of file diff --git a/packages/cli/src/data/queries/config.gql b/packages/plugin-graphql/src/queries/config.gql similarity index 100% rename from packages/cli/src/data/queries/config.gql rename to packages/plugin-graphql/src/queries/config.gql diff --git a/packages/plugin-graphql/src/queries/graph.gql b/packages/plugin-graphql/src/queries/graph.gql new file mode 100644 index 000000000..99201dbc6 --- /dev/null +++ b/packages/plugin-graphql/src/queries/graph.gql @@ -0,0 +1,11 @@ +query { + graph { + id, + filename, + label, + path, + route, + template, + title + } +} \ No newline at end of file diff --git a/packages/cli/src/data/queries/menu.gql b/packages/plugin-graphql/src/queries/menu.gql similarity index 86% rename from packages/cli/src/data/queries/menu.gql rename to packages/plugin-graphql/src/queries/menu.gql index 101c77ece..ad205cec3 100644 --- a/packages/cli/src/data/queries/menu.gql +++ b/packages/plugin-graphql/src/queries/menu.gql @@ -2,17 +2,17 @@ query($name: String, $route: String, $order: MenuOrderBy) { menu(name: $name, pathname: $route, orderBy: $order) { item { label, - link + route } children { item { label, - link + route }, children { item { label, - link + route } } } diff --git a/packages/cli/src/data/schema/config.js b/packages/plugin-graphql/src/schema/config.js similarity index 100% rename from packages/cli/src/data/schema/config.js rename to packages/plugin-graphql/src/schema/config.js diff --git a/packages/cli/src/data/schema/graph.js b/packages/plugin-graphql/src/schema/graph.js similarity index 78% rename from packages/cli/src/data/schema/graph.js rename to packages/plugin-graphql/src/schema/graph.js index f5a74b73d..4f8e0afdf 100644 --- a/packages/cli/src/data/schema/graph.js +++ b/packages/plugin-graphql/src/schema/graph.js @@ -77,38 +77,18 @@ const getParsedHeadingsFromPage = (tableOfContents, headingLevel) => { return children; }; -const getDeriveMetaFromRoute = (route) => { - const root = route.split('/')[1] || ''; - const label = root - .replace('/', '') - .replace('-', ' ') - .split(' ') - .map((word) => `${word.charAt(0).toUpperCase()}${word.substring(1)}`) - .join(' '); - - return { - label, - root - }; -}; - const getPagesFromGraph = async (root, query, context) => { const pages = []; const { graph } = context; graph .forEach((page) => { - const { route, mdFile, fileName, template, title, data } = page; - const { label } = getDeriveMetaFromRoute(route); + const { data } = page; const id = page.label; pages.push({ + ...page, id, - filePath: mdFile, - fileName, - template, - title: title !== '' ? title : label, - link: route, data: { ...data } @@ -125,20 +105,16 @@ const getChildrenFromParentRoute = async (root, query, context) => { graph .forEach((page) => { - const { route, mdFile, fileName, template, title, data } = page; - const { label } = getDeriveMetaFromRoute(route); + const { route, path, data } = page; + // const { label } = getDeriveMetaFromRoute(route); const root = route.split('/')[1]; - if (root.indexOf(parent) >= 0 && mdFile !== `./${parent}/index.md`) { + if (root.indexOf(parent) >= 0 && path !== `./${parent}/index.md`) { const id = page.label; pages.push({ id, - filePath: mdFile, - fileName, - template, - title: title !== '' ? title : label, - link: route, + ...page, data: { ...data } @@ -152,17 +128,18 @@ const getChildrenFromParentRoute = async (root, query, context) => { const graphTypeDefs = gql` type Page { data: Data, + filename: String, id: String, - filePath: String, - fileName: String, + label: String, + path: String, + route: String, template: String, - link: String, title: String } type Link { label: String, - link: String + route: String } type Menu { diff --git a/packages/cli/src/data/schema/schema.js b/packages/plugin-graphql/src/schema/schema.js similarity index 100% rename from packages/cli/src/data/schema/schema.js rename to packages/plugin-graphql/src/schema/schema.js diff --git a/yarn.lock b/yarn.lock index df380e91e..2e1ade68c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,52 @@ # yarn lockfile v1 +"@apollo/protobufjs@^1.0.3": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@apollo/protobufjs/-/protobufjs-1.0.5.tgz#a78b726147efc0795e74c8cb8a11aafc6e02f773" + integrity sha512-ZtyaBH1icCgqwIGb3zrtopV2D5Q8yxibkJzlaViM08eOhTQc7rACdYu0pfORFfhllvdMZ3aq69vifYHszY4gNA== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/long" "^4.0.0" + "@types/node" "^10.1.0" + long "^4.0.0" + +"@apollographql/apollo-tools@^0.4.3": + version "0.4.9" + resolved "https://registry.yarnpkg.com/@apollographql/apollo-tools/-/apollo-tools-0.4.9.tgz#6abeef4c4586aec8208f71254b329e48ab50c07e" + integrity sha512-M50pk8oo3CGTu4waGOklIX3YtTZoPfWG9K/G9WB8NpyQGA1OwYTiBFv94XqUtKElTDoFwoMXpMQd3Wy5dINvxA== + dependencies: + apollo-env "^0.6.6" + +"@apollographql/graphql-playground-html@1.6.26": + version "1.6.26" + resolved "https://registry.yarnpkg.com/@apollographql/graphql-playground-html/-/graphql-playground-html-1.6.26.tgz#2f7b610392e2a872722912fc342b43cf8d641cb3" + integrity sha512-XAwXOIab51QyhBxnxySdK3nuMEUohhDsHQ5Rbco/V1vjlP75zZ0ZLHD9dTpXTN8uxKxopb2lUvJTq+M4g2Q0HQ== + dependencies: + xss "^1.0.6" + +"@apollographql/graphql-upload-8-fork@^8.1.3": + version "8.1.3" + resolved "https://registry.yarnpkg.com/@apollographql/graphql-upload-8-fork/-/graphql-upload-8-fork-8.1.3.tgz#a0d4e0d5cec8e126d78bd915c264d6b90f5784bc" + integrity sha512-ssOPUT7euLqDXcdVv3Qs4LoL4BPtfermW1IOouaqEmj36TpHYDmYDIbKoSQxikd9vtMumFnP87OybH7sC9fJ6g== + dependencies: + "@types/express" "*" + "@types/fs-capacitor" "*" + "@types/koa" "*" + busboy "^0.3.1" + fs-capacitor "^2.0.4" + http-errors "^1.7.3" + object-path "^0.11.4" + "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" @@ -1927,6 +1973,59 @@ dependencies: "@types/node" ">= 8" +"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + integrity sha1-m4sMxmPWaafY9vXQiToU00jzD78= + +"@protobufjs/base64@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== + +"@protobufjs/codegen@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== + +"@protobufjs/eventemitter@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + integrity sha1-NVy8mLr61ZePntCV85diHx0Ga3A= + +"@protobufjs/fetch@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + integrity sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU= + dependencies: + "@protobufjs/aspromise" "^1.1.1" + "@protobufjs/inquire" "^1.1.0" + +"@protobufjs/float@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + integrity sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E= + +"@protobufjs/inquire@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + integrity sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik= + +"@protobufjs/path@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + integrity sha1-bMKyDFya1q0NzP0hynZz2Nf79o0= + +"@protobufjs/pool@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + integrity sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q= + +"@protobufjs/utf8@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= + "@rollup/plugin-babel@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.0.tgz#9cb1c5146ddd6a4968ad96f209c50c62f92f9879" @@ -1989,11 +2088,55 @@ resolved "https://registry.yarnpkg.com/@rollup/stream/-/stream-2.0.0.tgz#2ada818c2d042e37f63119d7bf8bbfc71792f641" integrity sha512-HsCyY/phZMys1zFUYoYlnDJGG9zMmYFfEjDKNQa00CYgjeyGD4cLdO6KNIkBh61AWOZfOsTPuGtNmFCsjQOfFg== +"@types/accepts@*", "@types/accepts@^1.3.5": + version "1.3.5" + resolved "https://registry.yarnpkg.com/@types/accepts/-/accepts-1.3.5.tgz#c34bec115cfc746e04fe5a059df4ce7e7b391575" + integrity sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ== + dependencies: + "@types/node" "*" + +"@types/body-parser@*", "@types/body-parser@1.19.0": + version "1.19.0" + resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.0.tgz#0685b3c47eb3006ffed117cdd55164b61f80538f" + integrity sha512-W98JrE0j2K78swW4ukqMleo8R7h/pFETjM2DQ90MF6XK2i4LO4W3gQ71Lt4w3bfm2EvVSyWHplECvB5sK22yFQ== + dependencies: + "@types/connect" "*" + "@types/node" "*" + "@types/color-name@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== +"@types/connect@*": + version "3.4.34" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.34.tgz#170a40223a6d666006d93ca128af2beb1d9b1901" + integrity sha512-ePPA/JuI+X0vb+gSWlPKOY0NdNAie/rPUqX2GUPpbZwiKTkSPhjXWuee47E4MtE54QVzGCQMQkAL6JhV2E1+cQ== + dependencies: + "@types/node" "*" + +"@types/content-disposition@*": + version "0.5.3" + resolved "https://registry.yarnpkg.com/@types/content-disposition/-/content-disposition-0.5.3.tgz#0aa116701955c2faa0717fc69cd1596095e49d96" + integrity sha512-P1bffQfhD3O4LW0ioENXUhZ9OIa0Zn+P7M+pWgkCKaT53wVLSq0mrKksCID/FGHpFhRSxRGhgrQmfhRuzwtKdg== + +"@types/cookies@*": + version "0.7.6" + resolved "https://registry.yarnpkg.com/@types/cookies/-/cookies-0.7.6.tgz#71212c5391a976d3bae57d4b09fac20fc6bda504" + integrity sha512-FK4U5Qyn7/Sc5ih233OuHO0qAkOpEcD/eG6584yEiLKizTFRny86qHLe/rej3HFQrkBuUjF4whFliAdODbVN/w== + dependencies: + "@types/connect" "*" + "@types/express" "*" + "@types/keygrip" "*" + "@types/node" "*" + +"@types/cors@2.8.8": + version "2.8.8" + resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.8.tgz#317a8d8561995c60e35b9e0fcaa8d36660c98092" + integrity sha512-fO3gf3DxU2Trcbr75O7obVndW/X5k8rJNZkLXlQWStTHhP71PkRqjwPIEI0yMnJdg9R9OasjU+Bsr+Hr1xy/0w== + dependencies: + "@types/express" "*" + "@types/estree@*": version "0.0.46" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.46.tgz#0fb6bfbbeabd7a30880504993369c4bf1deab1fe" @@ -2004,6 +2147,42 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== +"@types/express-serve-static-core@*", "@types/express-serve-static-core@4.17.18", "@types/express-serve-static-core@^4.17.18": + version "4.17.18" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.18.tgz#8371e260f40e0e1ca0c116a9afcd9426fa094c40" + integrity sha512-m4JTwx5RUBNZvky/JJ8swEJPKFd8si08pPF2PfizYjGZOKr/svUWPcoUmLow6MmPzhasphB7gSTINY67xn3JNA== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + +"@types/express@*": + version "4.17.11" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.11.tgz#debe3caa6f8e5fcda96b47bd54e2f40c4ee59545" + integrity sha512-no+R6rW60JEc59977wIxreQVsIEOAYwgCqldrA/vkpCnbD7MqTefO97lmoBe4WE0F156bC4uLSP1XHDOySnChg== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "^4.17.18" + "@types/qs" "*" + "@types/serve-static" "*" + +"@types/express@4.17.7": + version "4.17.7" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.7.tgz#42045be6475636d9801369cd4418ef65cdb0dd59" + integrity sha512-dCOT5lcmV/uC2J9k0rPafATeeyz+99xTt54ReX11/LObZgfzJqZNcW27zGhYyX+9iSEGXGt5qLPwRSvBZcLvtQ== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "*" + "@types/qs" "*" + "@types/serve-static" "*" + +"@types/fs-capacitor@*": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/fs-capacitor/-/fs-capacitor-2.0.0.tgz#17113e25817f584f58100fb7a08eed288b81956e" + integrity sha512-FKVPOCFbhCvZxpVAMhdBdTfVfXUpsh15wFHgqOKxh9N9vzWZVuWCSijZ5T4U34XYNnuj2oduh6xcs1i+LPI+BQ== + dependencies: + "@types/node" "*" + "@types/glob@*", "@types/glob@^7.1.1": version "7.1.3" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183" @@ -2019,6 +2198,47 @@ dependencies: "@types/unist" "*" +"@types/http-assert@*": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@types/http-assert/-/http-assert-1.5.1.tgz#d775e93630c2469c2f980fc27e3143240335db3b" + integrity sha512-PGAK759pxyfXE78NbKxyfRcWYA/KwW17X290cNev/qAsn9eQIxkH4shoNBafH37wewhDG/0p1cHPbK6+SzZjWQ== + +"@types/http-errors@*": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@types/http-errors/-/http-errors-1.8.0.tgz#682477dbbbd07cd032731cb3b0e7eaee3d026b69" + integrity sha512-2aoSC4UUbHDj2uCsCxcG/vRMXey/m17bC7UwitVm5hn22nI8O8Y9iDpA76Orc+DWkQ4zZrOKEshCqR/jSuXAHA== + +"@types/keygrip@*": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@types/keygrip/-/keygrip-1.0.2.tgz#513abfd256d7ad0bf1ee1873606317b33b1b2a72" + integrity sha512-GJhpTepz2udxGexqos8wgaBx4I/zWIDPh/KOGEwAqtuGDkOUJu5eFvwmdBX4AmB8Odsr+9pHCQqiAqDL/yKMKw== + +"@types/koa-compose@*": + version "3.2.5" + resolved "https://registry.yarnpkg.com/@types/koa-compose/-/koa-compose-3.2.5.tgz#85eb2e80ac50be95f37ccf8c407c09bbe3468e9d" + integrity sha512-B8nG/OoE1ORZqCkBVsup/AKcvjdgoHnfi4pZMn5UwAPCbhk/96xyv284eBYW8JlQbQ7zDmnpFr68I/40mFoIBQ== + dependencies: + "@types/koa" "*" + +"@types/koa@*": + version "2.13.1" + resolved "https://registry.yarnpkg.com/@types/koa/-/koa-2.13.1.tgz#e29877a6b5ad3744ab1024f6ec75b8cbf6ec45db" + integrity sha512-Qbno7FWom9nNqu0yHZ6A0+RWt4mrYBhw3wpBAQ3+IuzGcLlfeYkzZrnMq5wsxulN2np8M4KKeUpTodsOsSad5Q== + dependencies: + "@types/accepts" "*" + "@types/content-disposition" "*" + "@types/cookies" "*" + "@types/http-assert" "*" + "@types/http-errors" "*" + "@types/keygrip" "*" + "@types/koa-compose" "*" + "@types/node" "*" + +"@types/long@^4.0.0": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9" + integrity sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w== + "@types/mdast@^3.0.0": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.3.tgz#2d7d671b1cd1ea3deb306ea75036c2a0407d2deb" @@ -2026,6 +2246,11 @@ dependencies: "@types/unist" "*" +"@types/mime@^1": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" + integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== + "@types/minimatch@*": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" @@ -2036,11 +2261,29 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.0.tgz#69a23a3ad29caf0097f06eda59b361ee2f0639f6" integrity sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY= +"@types/node-fetch@2.5.7": + version "2.5.7" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.7.tgz#20a2afffa882ab04d44ca786449a276f9f6bbf3c" + integrity sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw== + dependencies: + "@types/node" "*" + form-data "^3.0.0" + "@types/node@*", "@types/node@>= 8": version "14.10.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.10.2.tgz#9b47a2c8e4dabd4db73b57e750b24af689600514" integrity sha512-IzMhbDYCpv26pC2wboJ4MMOa9GKtjplXfcAqrMeNJpUUwpM/2ATt2w1JPUXwS6spu856TvKZL2AOmeU2rAxskw== +"@types/node@>=6": + version "14.14.31" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.31.tgz#72286bd33d137aa0d152d47ec7c1762563d34055" + integrity sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g== + +"@types/node@^10.1.0": + version "10.17.54" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.54.tgz#a737488631aca3ec7bd9f6229d77f1079e444793" + integrity sha512-c8Lm7+hXdSPmWH4B9z/P/xIXhFK3mCQin4yCYMd2p1qpMG5AfgyJuYZ+3q2dT7qLiMMMGMd5dnkFpdqJARlvtQ== + "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" @@ -2056,6 +2299,16 @@ resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.4.tgz#15925414e0ad2cd765bfef58842f7e26a7accb24" integrity sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug== +"@types/qs@*": + version "6.9.5" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.5.tgz#434711bdd49eb5ee69d90c1d67c354a9a8ecb18b" + integrity sha512-/JHkVHtx/REVG0VVToGRGH2+23hsYLHdyG+GrvoUGlGAd0ErauXDyvHtRI/7H7mzLm+tBCKA7pfcpkQ1lf58iQ== + +"@types/range-parser@*": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c" + integrity sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA== + "@types/resolve@1.17.1": version "1.17.1" resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" @@ -2063,11 +2316,26 @@ dependencies: "@types/node" "*" +"@types/serve-static@*": + version "1.13.9" + resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.9.tgz#aacf28a85a05ee29a11fb7c3ead935ac56f33e4e" + integrity sha512-ZFqF6qa48XsPdjXV5Gsz0Zqmux2PerNd3a/ktL45mHpa19cuMi/cL8tcxdAx497yRh+QtYPuofjT9oWw9P7nkA== + dependencies: + "@types/mime" "^1" + "@types/node" "*" + "@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.3": version "2.0.3" resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e" integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ== +"@types/ws@^7.0.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.0.tgz#499690ea08736e05a8186113dac37769ab251a0e" + integrity sha512-Y29uQ3Uy+58bZrFLhX36hcI3Np37nqWE7ky5tjiDoy1GDZnIwVxS0CgF+s+1bXMzjKBFy+fqaRfb708iNzdinw== + dependencies: + "@types/node" "*" + "@types/yauzl@^2.9.1": version "2.9.1" resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.9.1.tgz#d10f69f9f522eef3cf98e30afb684a1e1ec923af" @@ -2075,11 +2343,31 @@ dependencies: "@types/node" "*" +"@types/zen-observable@^0.8.0": + version "0.8.2" + resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.2.tgz#808c9fa7e4517274ed555fa158f2de4b4f468e71" + integrity sha512-HrCIVMLjE1MOozVoD86622S7aunluLb2PJdPfb3nYiEtohm8mIB/vyv0Fd37AdeMFrTUQXEunw78YloMA3Qilg== + "@webcomponents/webcomponentsjs@^2.3.0", "@webcomponents/webcomponentsjs@^2.4.4": version "2.4.4" resolved "https://registry.yarnpkg.com/@webcomponents/webcomponentsjs/-/webcomponentsjs-2.4.4.tgz#14b7e78da47f8f0071ff96c35335b871534179bc" integrity sha512-UWXZYbaDLLfhm+xONXTiDciyhOSwKRrZieGQHFMSMGSxY4mbjZ5uYzOKgnuX0luYFvjJw32G3r0sCwQZPJIR4Q== +"@wry/context@^0.4.0": + version "0.4.4" + resolved "https://registry.yarnpkg.com/@wry/context/-/context-0.4.4.tgz#e50f5fa1d6cfaabf2977d1fda5ae91717f8815f8" + integrity sha512-LrKVLove/zw6h2Md/KZyWxIkFM6AoyKp71OqpH9Hiip1csjPVoD3tPxlbQUNxEnHENks3UGgNpSBCAfq9KWuag== + dependencies: + "@types/node" ">=6" + tslib "^1.9.3" + +"@wry/equality@^0.1.2": + version "0.1.11" + resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.1.11.tgz#35cb156e4a96695aa81a9ecc4d03787bc17f1790" + integrity sha512-mwEVBDUVODlsQQ5dfuLUS5/Tf7jqUKyhKYHmVi4fPB6bDMOfWvUPJmKgS1Z7Za/sOI3vzWt4+O7yCiL/70MogA== + dependencies: + tslib "^1.9.3" + "@zkochan/cmd-shim@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz#2ab8ed81f5bb5452a85f25758eb9b8681982fd2e" @@ -2107,7 +2395,7 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -accepts@^1.3.5: +accepts@^1.3.5, accepts@~1.3.7: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== @@ -2276,6 +2564,228 @@ anymatch@~3.1.1: normalize-path "^3.0.0" picomatch "^2.0.4" +apollo-cache-control@^0.11.6: + version "0.11.6" + resolved "https://registry.yarnpkg.com/apollo-cache-control/-/apollo-cache-control-0.11.6.tgz#f7bdf924272af47ac474cf3f3f35cfc038cc9485" + integrity sha512-YZ+uuIG+fPy+mkpBS2qKF0v1qlzZ3PW6xZVaDukeK3ed3iAs4L/2YnkTqau3OmoF/VPzX2FmSkocX/OVd59YSw== + dependencies: + apollo-server-env "^3.0.0" + apollo-server-plugin-base "^0.10.4" + +apollo-cache-inmemory@^1.6.3: + version "1.6.6" + resolved "https://registry.yarnpkg.com/apollo-cache-inmemory/-/apollo-cache-inmemory-1.6.6.tgz#56d1f2a463a6b9db32e9fa990af16d2a008206fd" + integrity sha512-L8pToTW/+Xru2FFAhkZ1OA9q4V4nuvfoPecBM34DecAugUZEBhI2Hmpgnzq2hTKZ60LAMrlqiASm0aqAY6F8/A== + dependencies: + apollo-cache "^1.3.5" + apollo-utilities "^1.3.4" + optimism "^0.10.0" + ts-invariant "^0.4.0" + tslib "^1.10.0" + +apollo-cache@1.3.5, apollo-cache@^1.3.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/apollo-cache/-/apollo-cache-1.3.5.tgz#9dbebfc8dbe8fe7f97ba568a224bca2c5d81f461" + integrity sha512-1XoDy8kJnyWY/i/+gLTEbYLnoiVtS8y7ikBr/IfmML4Qb+CM7dEEbIUOjnY716WqmZ/UpXIxTfJsY7rMcqiCXA== + dependencies: + apollo-utilities "^1.3.4" + tslib "^1.10.0" + +apollo-client@^2.6.4: + version "2.6.10" + resolved "https://registry.yarnpkg.com/apollo-client/-/apollo-client-2.6.10.tgz#86637047b51d940c8eaa771a4ce1b02df16bea6a" + integrity sha512-jiPlMTN6/5CjZpJOkGeUV0mb4zxx33uXWdj/xQCfAMkuNAC3HN7CvYDyMHHEzmcQ5GV12LszWoQ/VlxET24CtA== + dependencies: + "@types/zen-observable" "^0.8.0" + apollo-cache "1.3.5" + apollo-link "^1.0.0" + apollo-utilities "1.3.4" + symbol-observable "^1.0.2" + ts-invariant "^0.4.0" + tslib "^1.10.0" + zen-observable "^0.8.0" + +apollo-datasource@^0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/apollo-datasource/-/apollo-datasource-0.7.3.tgz#c824eb1457bdee5a3173ced0e35e594547e687a0" + integrity sha512-PE0ucdZYjHjUyXrFWRwT02yLcx2DACsZ0jm1Mp/0m/I9nZu/fEkvJxfsryXB6JndpmQO77gQHixf/xGCN976kA== + dependencies: + apollo-server-caching "^0.5.3" + apollo-server-env "^3.0.0" + +apollo-env@^0.6.6: + version "0.6.6" + resolved "https://registry.yarnpkg.com/apollo-env/-/apollo-env-0.6.6.tgz#d7880805c4e96ee3d4142900a405176a04779438" + integrity sha512-hXI9PjJtzmD34XviBU+4sPMOxnifYrHVmxpjykqI/dUD2G3yTiuRaiQqwRwB2RCdwC1Ug/jBfoQ/NHDTnnjndQ== + dependencies: + "@types/node-fetch" "2.5.7" + core-js "^3.0.1" + node-fetch "^2.2.0" + sha.js "^2.4.11" + +apollo-graphql@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/apollo-graphql/-/apollo-graphql-0.6.1.tgz#d0bf0aff76f445de3da10e08f6974f1bf65f5753" + integrity sha512-ZRXAV+k+hboCVS+FW86FW/QgnDR7gm/xMUwJPGXEbV53OLGuQQdIT0NCYK7AzzVkCfsbb7NJ3mmEclkZY9uuxQ== + dependencies: + apollo-env "^0.6.6" + lodash.sortby "^4.7.0" + +apollo-link-http-common@^0.2.16: + version "0.2.16" + resolved "https://registry.yarnpkg.com/apollo-link-http-common/-/apollo-link-http-common-0.2.16.tgz#756749dafc732792c8ca0923f9a40564b7c59ecc" + integrity sha512-2tIhOIrnaF4UbQHf7kjeQA/EmSorB7+HyJIIrUjJOKBgnXwuexi8aMecRlqTIDWcyVXCeqLhUnztMa6bOH/jTg== + dependencies: + apollo-link "^1.2.14" + ts-invariant "^0.4.0" + tslib "^1.9.3" + +apollo-link-http@^1.5.16: + version "1.5.17" + resolved "https://registry.yarnpkg.com/apollo-link-http/-/apollo-link-http-1.5.17.tgz#499e9f1711bf694497f02c51af12d82de5d8d8ba" + integrity sha512-uWcqAotbwDEU/9+Dm9e1/clO7hTB2kQ/94JYcGouBVLjoKmTeJTUPQKcJGpPwUjZcSqgYicbFqQSoJIW0yrFvg== + dependencies: + apollo-link "^1.2.14" + apollo-link-http-common "^0.2.16" + tslib "^1.9.3" + +apollo-link@^1.0.0, apollo-link@^1.2.14: + version "1.2.14" + resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.14.tgz#3feda4b47f9ebba7f4160bef8b977ba725b684d9" + integrity sha512-p67CMEFP7kOG1JZ0ZkYZwRDa369w5PIjtMjvrQd/HnIV8FRsHRqLqK+oAZQnFa1DDdZtOtHTi+aMIW6EatC2jg== + dependencies: + apollo-utilities "^1.3.0" + ts-invariant "^0.4.0" + tslib "^1.9.3" + zen-observable-ts "^0.8.21" + +apollo-reporting-protobuf@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/apollo-reporting-protobuf/-/apollo-reporting-protobuf-0.6.2.tgz#5572866be9b77f133916532b10e15fbaa4158304" + integrity sha512-WJTJxLM+MRHNUxt1RTl4zD0HrLdH44F2mDzMweBj1yHL0kSt8I1WwoiF/wiGVSpnG48LZrBegCaOJeuVbJTbtw== + dependencies: + "@apollo/protobufjs" "^1.0.3" + +apollo-server-caching@^0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/apollo-server-caching/-/apollo-server-caching-0.5.3.tgz#cf42a77ad09a46290a246810075eaa029b5305e1" + integrity sha512-iMi3087iphDAI0U2iSBE9qtx9kQoMMEWr6w+LwXruBD95ek9DWyj7OeC2U/ngLjRsXM43DoBDXlu7R+uMjahrQ== + dependencies: + lru-cache "^6.0.0" + +apollo-server-core@^2.21.0: + version "2.21.0" + resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-2.21.0.tgz#12ee11aee61fa124f11b1d73cae2e068112a3a53" + integrity sha512-GtIiq2F0dVDLzzIuO5+dK/pGq/sGxYlKCqAuQQqzYg0fvZ7fukyluXtcTe0tMI+FJZjU0j0WnKgiLsboCoAlPQ== + dependencies: + "@apollographql/apollo-tools" "^0.4.3" + "@apollographql/graphql-playground-html" "1.6.26" + "@apollographql/graphql-upload-8-fork" "^8.1.3" + "@types/ws" "^7.0.0" + apollo-cache-control "^0.11.6" + apollo-datasource "^0.7.3" + apollo-graphql "^0.6.0" + apollo-reporting-protobuf "^0.6.2" + apollo-server-caching "^0.5.3" + apollo-server-env "^3.0.0" + apollo-server-errors "^2.4.2" + apollo-server-plugin-base "^0.10.4" + apollo-server-types "^0.6.3" + apollo-tracing "^0.12.2" + async-retry "^1.2.1" + fast-json-stable-stringify "^2.0.0" + graphql-extensions "^0.12.8" + graphql-tag "^2.11.0" + graphql-tools "^4.0.8" + loglevel "^1.6.7" + lru-cache "^6.0.0" + sha.js "^2.4.11" + subscriptions-transport-ws "^0.9.11" + uuid "^8.0.0" + ws "^6.0.0" + +apollo-server-env@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/apollo-server-env/-/apollo-server-env-3.0.0.tgz#0157c51f52b63aee39af190760acf789ffc744d9" + integrity sha512-tPSN+VttnPsoQAl/SBVUpGbLA97MXG990XIwq6YUnJyAixrrsjW1xYG7RlaOqetxm80y5mBZKLrRDiiSsW/vog== + dependencies: + node-fetch "^2.1.2" + util.promisify "^1.0.0" + +apollo-server-errors@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/apollo-server-errors/-/apollo-server-errors-2.4.2.tgz#1128738a1d14da989f58420896d70524784eabe5" + integrity sha512-FeGxW3Batn6sUtX3OVVUm7o56EgjxDlmgpTLNyWcLb0j6P8mw9oLNyAm3B+deHA4KNdNHO5BmHS2g1SJYjqPCQ== + +apollo-server-express@^2.21.0: + version "2.21.0" + resolved "https://registry.yarnpkg.com/apollo-server-express/-/apollo-server-express-2.21.0.tgz#29bd4ec728e1992da240c5956c3ce6d95c1d252e" + integrity sha512-zbOSNGuxUjlOFZnRrbMpga3pKDEroitF4NAqoVxgBivx7v2hGsE7rljct3PucTx2cMN90AyYe3cU4oA8jBxZIQ== + dependencies: + "@apollographql/graphql-playground-html" "1.6.26" + "@types/accepts" "^1.3.5" + "@types/body-parser" "1.19.0" + "@types/cors" "2.8.8" + "@types/express" "4.17.7" + "@types/express-serve-static-core" "4.17.18" + accepts "^1.3.5" + apollo-server-core "^2.21.0" + apollo-server-types "^0.6.3" + body-parser "^1.18.3" + cors "^2.8.4" + express "^4.17.1" + graphql-subscriptions "^1.0.0" + graphql-tools "^4.0.8" + parseurl "^1.3.2" + subscriptions-transport-ws "^0.9.16" + type-is "^1.6.16" + +apollo-server-plugin-base@^0.10.4: + version "0.10.4" + resolved "https://registry.yarnpkg.com/apollo-server-plugin-base/-/apollo-server-plugin-base-0.10.4.tgz#fbf73f64f95537ca9f9639dd7c535eb5eeb95dcd" + integrity sha512-HRhbyHgHFTLP0ImubQObYhSgpmVH4Rk1BinnceZmwudIVLKrqayIVOELdyext/QnSmmzg5W7vF3NLGBcVGMqDg== + dependencies: + apollo-server-types "^0.6.3" + +apollo-server-types@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/apollo-server-types/-/apollo-server-types-0.6.3.tgz#f7aa25ff7157863264d01a77d7934aa6e13399e8" + integrity sha512-aVR7SlSGGY41E1f11YYz5bvwA89uGmkVUtzMiklDhZ7IgRJhysT5Dflt5IuwDxp+NdQkIhVCErUXakopocFLAg== + dependencies: + apollo-reporting-protobuf "^0.6.2" + apollo-server-caching "^0.5.3" + apollo-server-env "^3.0.0" + +apollo-server@^2.21.0: + version "2.21.0" + resolved "https://registry.yarnpkg.com/apollo-server/-/apollo-server-2.21.0.tgz#4e62131885b4a8a26bb8b5e77177bd0d4d210852" + integrity sha512-OqngjOSB0MEH6VKGWHcrqt4y39HlhYh9CrMvn4PhadTt53IPYRmBglk5qSRA8xMorGqy60iKrOReqj5YfCjTOg== + dependencies: + apollo-server-core "^2.21.0" + apollo-server-express "^2.21.0" + express "^4.0.0" + graphql-subscriptions "^1.0.0" + graphql-tools "^4.0.8" + stoppable "^1.1.0" + +apollo-tracing@^0.12.2: + version "0.12.2" + resolved "https://registry.yarnpkg.com/apollo-tracing/-/apollo-tracing-0.12.2.tgz#a261c3970bb421b6dadf50cd85d75b2567a7e52c" + integrity sha512-SYN4o0C0wR1fyS3+P0FthyvsQVHFopdmN3IU64IaspR/RZScPxZ3Ae8uu++fTvkQflAkglnFM0aX6DkZERBp6w== + dependencies: + apollo-server-env "^3.0.0" + apollo-server-plugin-base "^0.10.4" + +apollo-utilities@1.3.4, apollo-utilities@^1.0.1, apollo-utilities@^1.3.0, apollo-utilities@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.3.4.tgz#6129e438e8be201b6c55b0f13ce49d2c7175c9cf" + integrity sha512-pk2hiWrCXMAy2fRPwEyhvka+mqwzeP60Jr1tRYi5xru+3ko94HI9o6lK0CT33/w4RDlxWchmdhDCrvdr+pHCig== + dependencies: + "@wry/equality" "^0.1.2" + fast-json-stable-stringify "^2.0.0" + ts-invariant "^0.4.0" + tslib "^1.10.0" + append-transform@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-1.0.0.tgz#046a52ae582a228bd72f58acfbe2967c678759ab" @@ -2343,6 +2853,11 @@ array-find-index@^1.0.1: resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= + array-ify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" @@ -2407,6 +2922,13 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== +async-retry@^1.2.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.1.tgz#139f31f8ddce50c0870b0ba558a6079684aaed55" + integrity sha512-aiieFW/7h3hY0Bq5d+ktDBejxuwR78vRu9hDUdR8rNhSaQ29VzPL4AoIRG7D/c7tdenwOcKvgPM6tIxB3cB6HA== + dependencies: + retry "0.12.0" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -2483,6 +3005,11 @@ babel-plugin-polyfill-regenerator@^0.1.2: dependencies: "@babel/helper-define-polyfill-provider" "^0.1.4" +backo2@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" + integrity sha1-MasayLEpNjRj41s+u2n038+6eUc= + bail@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.5.tgz#b6fa133404a392cbc1f8c4bf63f5953351e7a776" @@ -2547,6 +3074,22 @@ bluebird@^3.5.1, bluebird@^3.5.3, bluebird@^3.5.5: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== +body-parser@1.19.0, body-parser@^1.18.3: + version "1.19.0" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" + integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== + dependencies: + bytes "3.1.0" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.2" + http-errors "1.7.2" + iconv-lite "0.4.24" + on-finished "~2.3.0" + qs "6.7.0" + raw-body "2.4.0" + type-is "~1.6.17" + boolbase@^1.0.0, boolbase@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" @@ -2647,6 +3190,13 @@ builtins@^1.0.3: resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" integrity sha1-y5T662HIaWRR2zZTThQi+U8K7og= +busboy@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/busboy/-/busboy-0.3.1.tgz#170899274c5bf38aae27d5c62b71268cd585fd1b" + integrity sha512-y7tTxhGKXcyBxRKAni+awqx8uqaJKrSFSNFSeRG5CsWNdmy2BIK+6VGWEW7TZnIO/533mtMEA4rOevQV815YJw== + dependencies: + dicer "0.3.0" + byline@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" @@ -2657,6 +3207,11 @@ byte-size@^5.0.1: resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-5.0.1.tgz#4b651039a5ecd96767e71a3d7ed380e48bed4191" integrity sha512-/XuKeqWocKsYa/cBY1YbSJSWWqTi4cFgr9S6OyM7PBaPbr9zvNGwWP33vt0uqGhwDdN+y3yhbXVILEUpnwEWGw== +bytes@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" + integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== + cacache@^12.0.0, cacache@^12.0.3: version "12.0.4" resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.4.tgz#668bcbd105aeb5f1d92fe25570ec9525c8faa40c" @@ -2711,6 +3266,14 @@ caching-transform@^3.0.2: package-hash "^3.0.0" write-file-atomic "^2.4.2" +call-bind@^1.0.0, call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + call-me-maybe@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" @@ -3072,7 +3635,7 @@ columnify@^1.5.4: strip-ansi "^3.0.0" wcwidth "^1.0.0" -combined-stream@^1.0.6, combined-stream@~1.0.6: +combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -3084,7 +3647,7 @@ comma-separated-tokens@^1.0.0: resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea" integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== -commander@^2.20.0: +commander@^2.20.0, commander@^2.20.3: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -3152,14 +3715,14 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= -content-disposition@~0.5.2: +content-disposition@0.5.3, content-disposition@~0.5.2: version "0.5.3" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== dependencies: safe-buffer "5.1.2" -content-type@^1.0.4: +content-type@^1.0.4, content-type@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== @@ -3254,6 +3817,16 @@ convert-source-map@^1.6.0, convert-source-map@^1.7.0: dependencies: safe-buffer "~5.1.1" +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= + +cookie@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" + integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== + cookies@~0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/cookies/-/cookies-0.8.0.tgz#1293ce4b391740a8406e3c9870e828c4b54f3f90" @@ -3287,6 +3860,11 @@ core-js-compat@^3.8.1, core-js-compat@^3.9.0: browserslist "^4.16.3" semver "7.0.0" +core-js@^3.0.1: + version "3.9.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.9.1.tgz#cec8de593db8eb2a85ffb0dbdeb312cb6e5460ae" + integrity sha512-gSjRvzkxQc1zjM/5paAmL4idJBFzuJoo+jDjF1tStYFMV2ERfD02HhahhCGXUyHxQRG4yFKVSdO6g62eoRMcDg== + core-js@^3.1.3: version "3.6.5" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.5.tgz#7395dc273af37fb2e50e9bd3d9fe841285231d1a" @@ -3302,6 +3880,14 @@ core-util-is@1.0.2, core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= +cors@^2.8.4: + version "2.8.5" + resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" + integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== + dependencies: + object-assign "^4" + vary "^1" + cosmiconfig@^5.0.0, cosmiconfig@^5.1.0: version "5.2.1" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" @@ -3448,6 +4034,11 @@ cssesc@^3.0.0: resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== +cssfilter@0.0.10: + version "0.0.10" + resolved "https://registry.yarnpkg.com/cssfilter/-/cssfilter-0.0.10.tgz#c6d2672632a2e5c83e013e6864a42ce8defd20ae" + integrity sha1-xtJnJjKi5cg+AT5oZKQs6N79IK4= + cssnano-preset-default@^4.0.7: version "4.0.7" resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-4.0.7.tgz#51ec662ccfca0f88b396dcd9679cdb931be17f76" @@ -3575,6 +4166,13 @@ dateformat@^3.0.0: resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== +debug@2.6.9, debug@^2.2.0, debug@^2.3.3: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + debug@3.1.0, debug@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" @@ -3596,13 +4194,6 @@ debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: dependencies: ms "^2.1.1" -debug@^2.2.0, debug@^2.3.3: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" @@ -3721,12 +4312,17 @@ depd@~2.0.0: resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== +deprecated-decorator@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/deprecated-decorator/-/deprecated-decorator-0.1.6.tgz#00966317b7a12fe92f3cc831f7583af329b86c37" + integrity sha1-AJZjF7ehL+kvPMgx91g68ym4bDc= + deprecation@^2.0.0, deprecation@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== -destroy@^1.0.4: +destroy@^1.0.4, destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= @@ -3754,6 +4350,13 @@ diacritics-map@^0.1.0: resolved "https://registry.yarnpkg.com/diacritics-map/-/diacritics-map-0.1.0.tgz#6dfc0ff9d01000a2edf2865371cac316e94977af" integrity sha1-bfwP+dAQAKLt8oZTccrDFulJd68= +dicer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/dicer/-/dicer-0.3.0.tgz#eacd98b3bfbf92e8ab5c2fdb71aaac44bb06b872" + integrity sha512-MdceRRWqltEG2dZqO769g27N/3PXfcKl04VhYnBlo2YhH7zPi88VebsjTKclaOyiuMaGU72hTfw3VkUitGcVCA== + dependencies: + streamsearch "0.1.2" + diff@3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" @@ -3878,7 +4481,7 @@ emojis-list@^3.0.0: resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== -encodeurl@^1.0.2: +encodeurl@^1.0.2, encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= @@ -3959,6 +4562,28 @@ es-abstract@^1.18.0-next.0: string.prototype.trimend "^1.0.1" string.prototype.trimstart "^1.0.1" +es-abstract@^1.18.0-next.2: + version "1.18.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0.tgz#ab80b359eecb7ede4c298000390bc5ac3ec7b5a4" + integrity sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw== + dependencies: + call-bind "^1.0.2" + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + get-intrinsic "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.2" + is-callable "^1.2.3" + is-negative-zero "^2.0.1" + is-regex "^1.1.2" + is-string "^1.0.5" + object-inspect "^1.9.0" + object-keys "^1.1.1" + object.assign "^4.1.2" + string.prototype.trimend "^1.0.4" + string.prototype.trimstart "^1.0.4" + unbox-primitive "^1.0.0" + es-module-shims@^0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/es-module-shims/-/es-module-shims-0.5.2.tgz#9bea003e84a11bdc052b9f52464671176509f520" @@ -4000,7 +4625,7 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -escape-html@^1.0.3: +escape-html@^1.0.3, escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= @@ -4148,6 +4773,11 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= + eventemitter3@^3.1.0: version "3.1.2" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" @@ -4191,6 +4821,42 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" +express@^4.0.0, express@^4.17.1: + version "4.17.1" + resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" + integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== + dependencies: + accepts "~1.3.7" + array-flatten "1.1.1" + body-parser "1.19.0" + content-disposition "0.5.3" + content-type "~1.0.4" + cookie "0.4.0" + cookie-signature "1.0.6" + debug "2.6.9" + depd "~1.1.2" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "~1.1.2" + fresh "0.5.2" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "~2.3.0" + parseurl "~1.3.3" + path-to-regexp "0.1.7" + proxy-addr "~2.0.5" + qs "6.7.0" + range-parser "~1.2.1" + safe-buffer "5.1.2" + send "0.17.1" + serve-static "1.14.1" + setprototypeof "1.1.1" + statuses "~1.5.0" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" @@ -4374,6 +5040,19 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +finalhandler@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" + integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.3" + statuses "~1.5.0" + unpipe "~1.0.0" + find-cache-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" @@ -4447,6 +5126,13 @@ flush-write-stream@^1.0.0: inherits "^2.0.3" readable-stream "^2.3.6" +for-each@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" + for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -4465,6 +5151,15 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= +form-data@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" + integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -4479,6 +5174,11 @@ format@^0.2.0: resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b" integrity sha1-1hcBB+nv3E7TDJ3DkBbflCtctYs= +forwarded@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" + integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= + fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" @@ -4486,7 +5186,7 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" -fresh@~0.5.2: +fresh@0.5.2, fresh@~0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= @@ -4506,6 +5206,11 @@ front-matter@^4.0.2: dependencies: js-yaml "^3.13.1" +fs-capacitor@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/fs-capacitor/-/fs-capacitor-2.0.4.tgz#5a22e72d40ae5078b4fe64fe4d08c0d3fc88ad3c" + integrity sha512-8S4f4WsCryNw2mJJchi46YgB6CR5Ze+4L1h8ewl9tEpL4SJ3ZO+c/bS4BWhB8bK+O3TMqhuZarTitd0S0eh2pA== + fs-constants@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" @@ -4598,6 +5303,15 @@ get-func-name@^2.0.0: resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" + integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + get-pkg-repo@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz#c73b489c06d80cc5536c2c853f9e05232056972d" @@ -4790,6 +5504,45 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6 resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== +graphql-extensions@^0.12.8: + version "0.12.8" + resolved "https://registry.yarnpkg.com/graphql-extensions/-/graphql-extensions-0.12.8.tgz#9cdc2c43d8fe5e0f6c3177a004ac011da2a8aa0f" + integrity sha512-xjsSaB6yKt9jarFNNdivl2VOx52WySYhxPgf8Y16g6GKZyAzBoIFiwyGw5PJDlOSUa6cpmzn6o7z8fVMbSAbkg== + dependencies: + "@apollographql/apollo-tools" "^0.4.3" + apollo-server-env "^3.0.0" + apollo-server-types "^0.6.3" + +graphql-subscriptions@^1.0.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/graphql-subscriptions/-/graphql-subscriptions-1.2.1.tgz#2142b2d729661ddf967b7388f7cf1dd4cf2e061d" + integrity sha512-95yD/tKi24q8xYa7Q9rhQN16AYj5wPbrb8tmHGM3WRc9EBmWrG/0kkMl+tQG8wcEuE9ibR4zyOM31p5Sdr2v4g== + dependencies: + iterall "^1.3.0" + +graphql-tag@^2.10.1, graphql-tag@^2.11.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.11.0.tgz#1deb53a01c46a7eb401d6cb59dec86fa1cccbffd" + integrity sha512-VmsD5pJqWJnQZMUeRwrDhfgoyqcfwEkvtpANqcoUG8/tOLkwNgU9mzub/Mc78OJMhHjx7gfAMTxzdG43VGg3bA== + +graphql-tools@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/graphql-tools/-/graphql-tools-4.0.8.tgz#e7fb9f0d43408fb0878ba66b522ce871bafe9d30" + integrity sha512-MW+ioleBrwhRjalKjYaLQbr+920pHBgy9vM/n47sswtns8+96sRn5M/G+J1eu7IMeKWiN/9p6tmwCHU7552VJg== + dependencies: + apollo-link "^1.2.14" + apollo-utilities "^1.0.1" + deprecated-decorator "^0.1.6" + iterall "^1.1.3" + uuid "^3.1.0" + +graphql@^14.5.8: + version "14.7.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.7.0.tgz#7fa79a80a69be4a31c27dda824dc04dac2035a72" + integrity sha512-l0xWZpoPKpppFzMfvVyFmp9vLN7w/ZZJPefUicMCepfJeQ8sMcztloGYY9DfjVPo6tIUDzU5Hw3MUbIjj9AVVA== + dependencies: + iterall "^1.2.2" + gray-matter@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/gray-matter/-/gray-matter-2.1.1.tgz#3042d9adec2a1ded6a7707a9ed2380f8a17a430e" @@ -4852,6 +5605,11 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" +has-bigints@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" + integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== + has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" @@ -4872,6 +5630,11 @@ has-symbols@^1.0.0, has-symbols@^1.0.1: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== +has-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" + integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== + has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -5086,7 +5849,18 @@ http-cache-semantics@^3.8.1: resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" integrity sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w== -http-errors@^1.6.3: +http-errors@1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" + integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-errors@^1.6.3, http-errors@^1.7.3: version "1.8.0" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.0.tgz#75d1bbe497e1044f51e4ee9e704a62f28d336507" integrity sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A== @@ -5286,6 +6060,11 @@ inherits@2, inherits@2.0.4, inherits@^2.0.0, inherits@^2.0.1, inherits@^2.0.3, i resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + ini@^1.3.2, ini@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" @@ -5353,6 +6132,11 @@ ip@1.1.5: resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + is-absolute-url@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6" @@ -5395,6 +6179,11 @@ is-arrayish@^0.3.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== +is-bigint@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.1.tgz#6923051dfcbc764278540b9ce0e6b3213aa5ebc2" + integrity sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg== + is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" @@ -5402,6 +6191,13 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" +is-boolean-object@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.0.tgz#e2aaad3a3a8fca34c28f6eee135b156ed2587ff0" + integrity sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA== + dependencies: + call-bind "^1.0.0" + is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" @@ -5412,6 +6208,11 @@ is-buffer@^2.0.0, is-buffer@~2.0.3: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.4.tgz#3e572f23c8411a5cfd9557c849e3665e0b290623" integrity sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A== +is-callable@^1.1.3, is-callable@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" + integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== + is-callable@^1.1.4, is-callable@^1.2.0: version "1.2.1" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.1.tgz#4d1e21a4f437509d25ce55f8184350771421c96d" @@ -5563,6 +6364,16 @@ is-negative-zero@^2.0.0: resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.0.tgz#9553b121b0fac28869da9ed459e20c7543788461" integrity sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE= +is-negative-zero@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" + integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== + +is-number-object@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197" + integrity sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw== + is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" @@ -5633,6 +6444,14 @@ is-regex@^1.1.0, is-regex@^1.1.1: dependencies: has-symbols "^1.0.1" +is-regex@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.2.tgz#81c8ebde4db142f2cf1c53fc86d6a45788266251" + integrity sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg== + dependencies: + call-bind "^1.0.2" + has-symbols "^1.0.1" + is-resolvable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" @@ -5650,6 +6469,11 @@ is-stream@^1.0.1, is-stream@^1.1.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= +is-string@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" + integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== + is-svg@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-3.0.0.tgz#9321dbd29c212e5ca99c4fa9794c714bcafa2f75" @@ -5657,7 +6481,7 @@ is-svg@^3.0.0: dependencies: html-comment-regex "^1.1.0" -is-symbol@^1.0.2: +is-symbol@^1.0.2, is-symbol@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== @@ -5775,6 +6599,11 @@ istanbul-reports@^2.2.4: dependencies: html-escaper "^2.0.0" +iterall@^1.1.3, iterall@^1.2.1, iterall@^1.2.2, iterall@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.3.0.tgz#afcb08492e2915cbd8a0884eb93a8c94d0d72fea" + integrity sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg== + jest-worker@^26.2.1: version "26.3.0" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.3.0.tgz#7c8a97e4f4364b4f05ed8bca8ca0c24de091871f" @@ -6230,6 +7059,16 @@ log-symbols@2.2.0: dependencies: chalk "^2.0.1" +loglevel@^1.6.7: + version "1.7.1" + resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197" + integrity sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw== + +long@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" + integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== + loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -6260,6 +7099,13 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + macos-release@^2.2.0: version "2.4.1" resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.4.1.tgz#64033d0ec6a5e6375155a74b1a1eba8e509820ac" @@ -6467,6 +7313,11 @@ meow@^7.0.0: type-fest "^0.13.1" yargs-parser "^18.1.3" +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= + merge-source-map@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.1.0.tgz#2fdde7e6020939f70906a68f2d7ae685e4c8c646" @@ -6484,6 +7335,11 @@ merge2@^1.2.3, merge2@^1.3.0: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= + micromatch@^3.1.10: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -6523,6 +7379,11 @@ mime-types@^2.1.12, mime-types@^2.1.18, mime-types@~2.1.19, mime-types@~2.1.24: dependencies: mime-db "1.44.0" +mime@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + mime@^2.0.3: version "2.4.6" resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.6.tgz#e5b407c90db442f2beb5b162373d07b69affa4d1" @@ -6791,7 +7652,7 @@ node-fetch-npm@^2.0.2: json-parse-better-errors "^1.0.0" safe-buffer "^5.1.1" -node-fetch@^2.5.0, node-fetch@^2.6.1: +node-fetch@^2.1.2, node-fetch@^2.2.0, node-fetch@^2.5.0, node-fetch@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== @@ -6992,7 +7853,7 @@ oauth-sign@~0.9.0: resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== -object-assign@^4.0.1, object-assign@^4.1.0: +object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= @@ -7011,11 +7872,21 @@ object-inspect@^1.7.0, object-inspect@^1.8.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.8.0.tgz#df807e5ecf53a609cc6bfe93eac3cc7be5b3a9d0" integrity sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA== +object-inspect@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.9.0.tgz#c90521d74e1127b67266ded3394ad6116986533a" + integrity sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw== + object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== +object-path@^0.11.4: + version "0.11.5" + resolved "https://registry.yarnpkg.com/object-path/-/object-path-0.11.5.tgz#d4e3cf19601a5140a55a16ad712019a9c50b577a" + integrity sha512-jgSbThcoR/s+XumvGMTMf81QVBmah+/Q7K7YduKeKVWL7N111unR2d6pZZarSk6kY/caeNxUDyxOvMWyzoU2eg== + object-visit@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" @@ -7043,6 +7914,16 @@ object.assign@^4.1.0: has-symbols "^1.0.1" object-keys "^1.1.1" +object.assign@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" + integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + has-symbols "^1.0.1" + object-keys "^1.1.1" + object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649" @@ -7051,6 +7932,15 @@ object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.0 define-properties "^1.1.3" es-abstract "^1.17.0-next.1" +object.getownpropertydescriptors@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz#1bd63aeacf0d5d2d2f31b5e393b03a7c601a23f7" + integrity sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.2" + object.pick@^1.2.0, object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" @@ -7073,7 +7963,7 @@ octokit-pagination-methods@^1.1.0: resolved "https://registry.yarnpkg.com/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz#cf472edc9d551055f9ef73f6e42b4dbb4c80bea4" integrity sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ== -on-finished@^2.3.0: +on-finished@^2.3.0, on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= @@ -7106,6 +7996,13 @@ only@~0.0.2: resolved "https://registry.yarnpkg.com/only/-/only-0.0.2.tgz#2afde84d03e50b9a8edc444e30610a70295edfb4" integrity sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q= +optimism@^0.10.0: + version "0.10.3" + resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.10.3.tgz#163268fdc741dea2fb50f300bedda80356445fd7" + integrity sha512-9A5pqGoQk49H6Vhjb9kPgAeeECfUDF6aIICbMDL23kDLStBn1MWk3YvcZ4xWF9CsSf6XEgvRLkXy4xof/56vVw== + dependencies: + "@wry/context" "^0.4.0" + optionator@^0.8.1, optionator@^0.8.3: version "0.8.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" @@ -7346,7 +8243,7 @@ parse5@^6.0.0: resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== -parseurl@^1.3.2: +parseurl@^1.3.2, parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== @@ -7393,6 +8290,11 @@ path-parse@^1.0.6: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= + path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" @@ -8234,6 +9136,14 @@ protoduck@^5.0.1: dependencies: genfun "^5.0.0" +proxy-addr@~2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" + integrity sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw== + dependencies: + forwarded "~0.1.2" + ipaddr.js "1.9.1" + proxy-from-env@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" @@ -8307,6 +9217,11 @@ q@^1.1.2, q@^1.5.1: resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= +qs@6.7.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" + integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== + qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" @@ -8338,6 +9253,21 @@ randombytes@^2.1.0: dependencies: safe-buffer "^5.1.0" +range-parser@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" + integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== + +raw-body@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" + integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== + dependencies: + bytes "3.1.0" + http-errors "1.7.2" + iconv-lite "0.4.24" + unpipe "1.0.0" + read-cache@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/read-cache/-/read-cache-1.0.0.tgz#e664ef31161166c9751cdbe8dbcf86b5fb58f774" @@ -8820,6 +9750,11 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== +retry@0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" + integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= + retry@^0.10.0: version "0.10.1" resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" @@ -8998,6 +9933,25 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +send@0.17.1: + version "0.17.1" + resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" + integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== + dependencies: + debug "2.6.9" + depd "~1.1.2" + destroy "~1.0.4" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "~1.7.2" + mime "1.6.0" + ms "2.1.1" + on-finished "~2.3.0" + range-parser "~1.2.1" + statuses "~1.5.0" + serialize-javascript@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" @@ -9005,6 +9959,16 @@ serialize-javascript@^4.0.0: dependencies: randombytes "^2.1.0" +serve-static@1.14.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" + integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.17.1" + set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -9037,6 +10001,14 @@ setprototypeof@1.2.0: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== +sha.js@^2.4.11: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + shallow-clone@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" @@ -9298,7 +10270,7 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -"statuses@>= 1.5.0 < 2", statuses@^1.5.0: +"statuses@>= 1.5.0 < 2", statuses@^1.5.0, statuses@~1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= @@ -9308,6 +10280,11 @@ stealthy-require@^1.1.1: resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= +stoppable@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/stoppable/-/stoppable-1.1.0.tgz#32da568e83ea488b08e4d7ea2c3bcc9d75015d5b" + integrity sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw== + stream-each@^1.1.0: version "1.2.3" resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" @@ -9321,6 +10298,11 @@ stream-shift@^1.0.0: resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== +streamsearch@0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-0.1.2.tgz#808b9d0e56fc273d809ba57338e929919a1a9f1a" + integrity sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo= + string-hash@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/string-hash/-/string-hash-1.1.3.tgz#e8aafc0ac1855b4666929ed7dd1275df5d6c811b" @@ -9369,6 +10351,14 @@ string.prototype.trimend@^1.0.1: define-properties "^1.1.3" es-abstract "^1.17.5" +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" + integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + string.prototype.trimstart@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz#14af6d9f34b053f7cfc89b72f8f2ee14b9039a54" @@ -9377,6 +10367,14 @@ string.prototype.trimstart@^1.0.1: define-properties "^1.1.3" es-abstract "^1.17.5" +string.prototype.trimstart@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" + integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" @@ -9511,6 +10509,17 @@ stylehacks@^4.0.0: postcss "^7.0.0" postcss-selector-parser "^3.0.0" +subscriptions-transport-ws@^0.9.11, subscriptions-transport-ws@^0.9.16: + version "0.9.18" + resolved "https://registry.yarnpkg.com/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.18.tgz#bcf02320c911fbadb054f7f928e51c6041a37b97" + integrity sha512-tztzcBTNoEbuErsVQpTN2xUNN/efAZXyCyL5m3x4t6SKrEiTL2N8SaKWBFWM4u56pL79ULif3zjyeq+oV+nOaA== + dependencies: + backo2 "^1.0.2" + eventemitter3 "^3.1.0" + iterall "^1.2.1" + symbol-observable "^1.0.4" + ws "^5.2.0" + supports-color@6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" @@ -9570,7 +10579,7 @@ svgo@^1.0.0: unquote "~1.1.1" util.promisify "~1.0.0" -symbol-observable@^1.2.0: +symbol-observable@^1.0.2, symbol-observable@^1.0.4, symbol-observable@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== @@ -9819,6 +10828,18 @@ trough@^1.0.0: resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.5.tgz#b8b639cefad7d0bb2abd37d433ff8293efa5f406" integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA== +ts-invariant@^0.4.0: + version "0.4.4" + resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.4.4.tgz#97a523518688f93aafad01b0e80eb803eb2abd86" + integrity sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA== + dependencies: + tslib "^1.9.3" + +tslib@^1.10.0, tslib@^1.9.3: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + tslib@^1.9.0: version "1.13.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043" @@ -9878,7 +10899,7 @@ type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -type-is@^1.6.16: +type-is@^1.6.16, type-is@~1.6.17, type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== @@ -9906,6 +10927,16 @@ umask@^1.1.0: resolved "https://registry.yarnpkg.com/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d" integrity sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0= +unbox-primitive@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.0.tgz#eeacbc4affa28e9b3d36b5eaeccc50b3251b1d3f" + integrity sha512-P/51NX+JXyxK/aigg1/ZgyccdAxm5K1+n8+tvqSntjOivPt19gvm1VC49RWYetsiub8WViUchdxl/KWHHB0kzA== + dependencies: + function-bind "^1.1.1" + has-bigints "^1.0.0" + has-symbols "^1.0.0" + which-boxed-primitive "^1.0.1" + unbzip2-stream@^1.3.3: version "1.4.3" resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz#b0da04c4371311df771cdc215e87f2130991ace7" @@ -10059,6 +11090,11 @@ universalify@^0.1.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + unquote@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/unquote/-/unquote-1.1.1.tgz#8fded7324ec6e88a0ff8b905e7c098cdc086d544" @@ -10106,6 +11142,17 @@ util-promisify@^2.1.0: dependencies: object.getownpropertydescriptors "^2.0.3" +util.promisify@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.1.1.tgz#77832f57ced2c9478174149cae9b96e9918cd54b" + integrity sha512-/s3UsZUrIfa6xDhr7zZhnE9SLQ5RIXyYfiVnMMyMDzOc8WhWN4Nbh36H842OyurKbCDAesZOJaVyvmSl6fhGQw== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + for-each "^0.3.3" + has-symbols "^1.0.1" + object.getownpropertydescriptors "^2.1.1" + util.promisify@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.1.tgz#6baf7774b80eeb0f7520d8b81d07982a59abbaee" @@ -10116,11 +11163,21 @@ util.promisify@~1.0.0: has-symbols "^1.0.1" object.getownpropertydescriptors "^2.1.0" -uuid@^3.0.1, uuid@^3.3.2: +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + +uuid@^3.0.1, uuid@^3.1.0, uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== +uuid@^8.0.0: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + v8-compile-cache@^2.0.3: version "2.1.1" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz#54bc3cdd43317bca91e35dcaf305b1a7237de745" @@ -10141,7 +11198,7 @@ validate-npm-package-name@^3.0.0: dependencies: builtins "^1.0.3" -vary@^1.1.2: +vary@^1, vary@^1.1.2, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= @@ -10243,6 +11300,17 @@ whatwg-url@^7.0.0: tr46 "^1.0.1" webidl-conversions "^4.0.2" +which-boxed-primitive@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" @@ -10341,7 +11409,14 @@ write@1.0.3: dependencies: mkdirp "^0.5.1" -ws@^6.1.2, ws@^6.2.1: +ws@^5.2.0: + version "5.2.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" + integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== + dependencies: + async-limiter "~1.0.0" + +ws@^6.0.0, ws@^6.1.2, ws@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb" integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA== @@ -10363,6 +11438,14 @@ xmlchars@^2.1.1: resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== +xss@^1.0.6: + version "1.0.8" + resolved "https://registry.yarnpkg.com/xss/-/xss-1.0.8.tgz#32feb87feb74b3dcd3d404b7a68ababf10700535" + integrity sha512-3MgPdaXV8rfQ/pNn16Eio6VXYPTkqwa0vc7GkiymmY/DqR1SE/7VPAAVZz1GJsJFrllMYO3RHfEaiUGjab6TNw== + dependencies: + commander "^2.20.3" + cssfilter "0.0.10" + xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" @@ -10383,6 +11466,11 @@ yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + yargs-parser@13.1.2, yargs-parser@^13.0.0, yargs-parser@^13.1.2: version "13.1.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" @@ -10462,6 +11550,19 @@ ylru@^1.2.0: resolved "https://registry.yarnpkg.com/ylru/-/ylru-1.2.1.tgz#f576b63341547989c1de7ba288760923b27fe84f" integrity sha512-faQrqNMzcPCHGVC2aaOINk13K+aaBDUPjGWl0teOXywElLjyVAB6Oe2jj62jHYtwsU49jXhScYbvPENK+6zAvQ== +zen-observable-ts@^0.8.21: + version "0.8.21" + resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-0.8.21.tgz#85d0031fbbde1eba3cd07d3ba90da241215f421d" + integrity sha512-Yj3yXweRc8LdRMrCC8nIc4kkjWecPAUVh0TI0OUrWXx6aX790vLcDlWca6I4vsyCGH3LpWxq0dJRcMOFoVqmeg== + dependencies: + tslib "^1.9.3" + zen-observable "^0.8.0" + +zen-observable@^0.8.0: + version "0.8.15" + resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15" + integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ== + zwitch@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" From 059b8906e3787dcd552cf0410e90b6f395c03713 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sat, 6 Mar 2021 11:34:18 -0500 Subject: [PATCH 02/29] WIP client side implementation --- greenwood.config.js | 2 + .../plugins/resource/plugin-node-modules.js | 6 +- .../src/plugins/server/plugin-livereload.js | 7 +- packages/plugin-graphql/src/core/client.js | 22 ++--- packages/plugin-graphql/src/index.js | 81 ++++++++++++++++++- www/components/header/header.js | 20 ++++- 6 files changed, 117 insertions(+), 21 deletions(-) diff --git a/greenwood.config.js b/greenwood.config.js index 1629f2a4b..a611bbd4e 100644 --- a/greenwood.config.js +++ b/greenwood.config.js @@ -1,4 +1,5 @@ const path = require('path'); +const pluginImportCommonjs = require('./packages/plugin-import-commonjs/src/index'); const pluginGoogleAnalytics = require('./packages/plugin-google-analytics/src/index'); const pluginGraphQL = require('./packages/plugin-graphql/src/index'); const pluginImportCss = require('./packages/plugin-import-css/src/index'); @@ -24,6 +25,7 @@ module.exports = { { name: 'google-site-verification', content: '4rYd8k5aFD0jDnN0CCFgUXNe4eakLP4NnA18mNnK5P0' } ], plugins: [ + ...pluginImportCommonjs(), pluginGoogleAnalytics({ analyticsId: 'UA-147204327-1' }), diff --git a/packages/cli/src/plugins/resource/plugin-node-modules.js b/packages/cli/src/plugins/resource/plugin-node-modules.js index cb5557249..1c340827d 100644 --- a/packages/cli/src/plugins/resource/plugin-node-modules.js +++ b/packages/cli/src/plugins/resource/plugin-node-modules.js @@ -179,7 +179,11 @@ class NodeModulesResource extends ResourceInterface { async serve(url) { return new Promise(async(resolve, reject) => { try { - const fullUrl = path.extname(url) === '' ? `${url}.js` : url; + const fullUrl = path.extname(url) === '' + ? fs.existsSync(`${url}.mjs`) // test for .mjs first + ? `${url}.mjs` + : `${url}.js` + : url; const body = await fs.promises.readFile(fullUrl); resolve({ diff --git a/packages/cli/src/plugins/server/plugin-livereload.js b/packages/cli/src/plugins/server/plugin-livereload.js index 4c8f9051d..75da0eb94 100644 --- a/packages/cli/src/plugins/server/plugin-livereload.js +++ b/packages/cli/src/plugins/server/plugin-livereload.js @@ -1,5 +1,4 @@ const livereload = require('livereload'); -const path = require('path'); const { ResourceInterface } = require('../../lib/resource-interface'); const { ServerInterface } = require('../../lib/server-interface'); @@ -25,8 +24,10 @@ class LiveReloadServer extends ServerInterface { class LiveReloadResource extends ResourceInterface { - async shouldIntercept(url) { - return Promise.resolve(path.extname(url) === '' && process.env.__GWD_COMMAND__ === 'develop'); // eslint-disable-line no-underscore-dangle + async shouldIntercept(url, body, headers) { + const { accept } = headers.request; + + return Promise.resolve(accept && accept.indexOf('text/html') >= 0 && process.env.__GWD_COMMAND__ === 'develop'); // eslint-disable-line no-underscore-dangle } async intercept(url, body) { diff --git a/packages/plugin-graphql/src/core/client.js b/packages/plugin-graphql/src/core/client.js index f562b3399..3a1edc6fe 100644 --- a/packages/plugin-graphql/src/core/client.js +++ b/packages/plugin-graphql/src/core/client.js @@ -1,7 +1,7 @@ import { ApolloClient } from 'apollo-client'; import { InMemoryCache } from 'apollo-cache-inmemory'; import { HttpLink } from 'apollo-link-http'; -import { getQueryHash } from '@greenwood/cli/data/common'; +// import { getQueryHash } from '@greenwood/cli/data/common'; const APOLLO_STATE = window.__APOLLO_STATE__; // eslint-disable-line no-underscore-dangle const client = new ApolloClient({ @@ -15,17 +15,17 @@ const backupQuery = client.query; client.query = (params) => { if (APOLLO_STATE) { // __APOLLO_STATE__ defined, in production mode - const queryHash = getQueryHash(params.query, params.variables); - const cachePath = `/${queryHash}-cache.json`; + // const queryHash = getQueryHash(params.query, params.variables); + // const cachePath = `/${queryHash}-cache.json`; - return fetch(cachePath) - .then(response => response.json()) - .then((response) => { - // mock client.query response - return { - data: new InMemoryCache().restore(response).readQuery(params) - }; - }); + // return fetch(cachePath) + // .then(response => response.json()) + // .then((response) => { + // // mock client.query response + // return { + // data: new InMemoryCache().restore(response).readQuery(params) + // }; + // }); } else { // __APOLLO_STATE__ NOT defined, in development mode return backupQuery(params); diff --git a/packages/plugin-graphql/src/index.js b/packages/plugin-graphql/src/index.js index 17a27b0e1..a86b3dd71 100644 --- a/packages/plugin-graphql/src/index.js +++ b/packages/plugin-graphql/src/index.js @@ -1,6 +1,79 @@ +const fs = require('fs'); +const gql = require('graphql-tag'); +const { ResourceInterface } = require('@greenwood/cli/src/lib/resource-interface'); const { ServerInterface } = require('@greenwood/cli/src/lib/server-interface'); const graphqlServer = require('./core/server'); +class GraphQLResource extends ResourceInterface { + constructor(compilation, options = {}) { + super(compilation, options); + this.extensions = ['.gql']; + this.contentType = ['text/javascript']; + } + + async serve(url) { + return new Promise(async (resolve, reject) => { + try { + const js = await fs.promises.readFile(url, 'utf-8'); + const gqlJs = gql`${js}`; + const body = ` + export default ${JSON.stringify(gqlJs)}; + `; + + resolve({ + body, + contentType: this.contentType + }); + } catch (e) { + reject(e); + } + }); + } + + async shouldIntercept(url, body, headers) { + return Promise.resolve(headers.request.accept && headers.request.accept.indexOf('text/html') >= 0); + } + + // graphql/language/printer + async intercept(url, body) { + return new Promise(async (resolve, reject) => { + try { + const shimmedBody = body.replace('"imports": {', ` + "imports": { + "apollo-client": "/node_modules/apollo-client/bundle.esm.js", + "apollo-cache-inmemory": "/node_modules/apollo-cache-inmemory/lib/bundle.esm.js", + "apollo-link-http": "/node_modules/apollo-link-http/lib/bundle.esm.js", + "apollo-utilities": "/node_modules/apollo-utilities/lib/bundle.esm.js", + "apollo-link": "/node_modules/apollo-link/lib/bundle.esm.js", + "apollo-cache": "/node_modules/apollo-cache/lib/bundle.esm.js", + "apollo-link-http-common": "/node_modules/apollo-link-http-common/lib/bundle.esm.js", + "optimism": "/node_modules/optimism/lib/bundle.esm.js", + "tslib": "/node_modules/tslib/tslib.es6.js", + "symbol-observable": "/node_modules/symbol-observable/es/index.js", + "ts-invariant": "/node_modules/ts-invariant/lib/invariant.esm.js", + "@wry/context": "/node_modules/@wry/context/lib/context.esm.js", + "@wry/equality": "/node_modules/@wry/equality/lib/equality.esm.js", + "graphql/jsutils/inspect": "/node_modules/graphql/jsutils/inspect.mjs", + "graphql/language/visitor": "/node_modules/graphql/language/visitor.mjs", + "graphql/language/parser": "/node_modules/graphql/language/parser.mjs", + "graphql/language/printer": "/node_modules/graphql/language/printer.mjs", + "zen-observable": "/node_modules/zen-observable/esm.js", + "zen-observable-ts": "/node_modules/zen-observable-ts/lib/bundle.esm.js", + "fast-json-stable-stringify": "/node_modules/fast-json-stable-stringify/index.js", + "graphql-tag": "/node_modules/graphql-tag/src/index.js", + "@greenwood/plugin-graphql/core/client.js": "/node_modules/@greenwood/plugin-graphql/src/core/client.js", + "@greenwood/plugin-graphql/queries/menu.gql": "/node_modules/@greenwood/plugin-graphql/src/queries/menu.gql", + "@greenwood/plugin-graphql/queries/config.gql": "/node_modules/@greenwood/plugin-graphql/src/queries/config.gql", + `); + + resolve({ body: shimmedBody }); + } catch (e) { + reject(e); + } + }); + } +} + class GraphQLServer extends ServerInterface { constructor(compilation, options = {}) { super(compilation, options); @@ -18,9 +91,9 @@ module.exports = (options = {}) => { type: 'server', name: 'plugin-graphql:server', provider: (compilation) => new GraphQLServer(compilation, options) - // }, { - // type: 'resource', - // name: 'plugin-live-reload:resource', - // provider: (compilation) => new LiveReloadResource(compilation, options) + }, { + type: 'resource', + name: 'plugin-graphql:resource', + provider: (compilation) => new GraphQLResource(compilation, options) }]; }; \ No newline at end of file diff --git a/www/components/header/header.js b/www/components/header/header.js index 58d66db9b..c5c3869b8 100644 --- a/www/components/header/header.js +++ b/www/components/header/header.js @@ -1,11 +1,18 @@ import { css, html, LitElement, unsafeCSS } from 'lit-element'; -// import client from '@greenwood/cli/data/client'; -// import MenuQuery from '@greenwood/cli/data/queries/menu'; +import client from '@greenwood/plugin-graphql/core/client.js'; +import MenuQuery from '@greenwood/plugin-graphql/queries/menu.gql'; +import ConfigQuery from '@greenwood/plugin-graphql/queries/config.gql'; +// import gql from 'graphql-tag'; import '@evergreen-wc/eve-container'; import headerCss from './header.css'; // TODO import evergreenLogo from '../../assets/evergreen.svg'; import '../social-icons/social-icons.js'; +console.debug('MenuQuery', MenuQuery); +console.debug('ConfigQuery', ConfigQuery); +console.debug('client', client); +// console.debug('gql', gql); + class HeaderComponent extends LitElement { static get properties() { @@ -30,6 +37,15 @@ class HeaderComponent extends LitElement { async connectedCallback() { super.connectedCallback(); + // const response = await client.query({ + // query: MenuQuery, + // variables: { + // name: 'navigation', + // order: 'index_asc' + // } + // }); + // console.debug(response); + fetch('/graph.json') .then(res => res.json()) .then(data => { From 21d66477e485096f65d17c53d38d94b009942ebe Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sat, 6 Mar 2021 12:27:26 -0500 Subject: [PATCH 03/29] output message when processing a commonjs file --- packages/plugin-import-commonjs/src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/plugin-import-commonjs/src/index.js b/packages/plugin-import-commonjs/src/index.js index 4fd2c45cc..5751740e8 100644 --- a/packages/plugin-import-commonjs/src/index.js +++ b/packages/plugin-import-commonjs/src/index.js @@ -45,7 +45,7 @@ class ImportCommonJsResource extends ResourceInterface { return new Promise(async (resolve, reject) => { try { const isCommonJs = await testForCjsModule(url); - + return resolve(isCommonJs); } catch (e) { console.error(e); @@ -69,6 +69,7 @@ class ImportCommonJsResource extends ResourceInterface { stream.on('data', (data) => (bundle += data)); stream.on('end', () => { + console.info(`proccessed module "${url}" as a CommonJS module type.`); resolve({ body: bundle }); From 2b39aa18a1ca034eaf3c6e863c79e2c00885aa33 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sat, 6 Mar 2021 18:00:42 -0500 Subject: [PATCH 04/29] debug statement --- packages/plugin-import-commonjs/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-import-commonjs/src/index.js b/packages/plugin-import-commonjs/src/index.js index 5751740e8..67c555d9a 100644 --- a/packages/plugin-import-commonjs/src/index.js +++ b/packages/plugin-import-commonjs/src/index.js @@ -69,7 +69,7 @@ class ImportCommonJsResource extends ResourceInterface { stream.on('data', (data) => (bundle += data)); stream.on('end', () => { - console.info(`proccessed module "${url}" as a CommonJS module type.`); + console.debug(`proccessed module "${url}" as a CommonJS module type.`); resolve({ body: bundle }); From fb86d6a39df5be3510e25dd416a99d80bffa870d Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sat, 6 Mar 2021 18:15:20 -0500 Subject: [PATCH 05/29] custom graphql client --- greenwood.config.js | 4 +- .../plugins/resource/plugin-node-modules.js | 9 ++- packages/plugin-graphql/src/core/client.js | 80 ++++++++++++------- packages/plugin-graphql/src/index.js | 52 ++++++------ www/components/header/header.js | 27 ++----- 5 files changed, 89 insertions(+), 83 deletions(-) diff --git a/greenwood.config.js b/greenwood.config.js index a611bbd4e..d9eb4f88c 100644 --- a/greenwood.config.js +++ b/greenwood.config.js @@ -1,5 +1,5 @@ const path = require('path'); -const pluginImportCommonjs = require('./packages/plugin-import-commonjs/src/index'); +// const pluginImportCommonjs = require('./packages/plugin-import-commonjs/src/index'); const pluginGoogleAnalytics = require('./packages/plugin-google-analytics/src/index'); const pluginGraphQL = require('./packages/plugin-graphql/src/index'); const pluginImportCss = require('./packages/plugin-import-css/src/index'); @@ -25,7 +25,7 @@ module.exports = { { name: 'google-site-verification', content: '4rYd8k5aFD0jDnN0CCFgUXNe4eakLP4NnA18mNnK5P0' } ], plugins: [ - ...pluginImportCommonjs(), + // ...pluginImportCommonjs(), pluginGoogleAnalytics({ analyticsId: 'UA-147204327-1' }), diff --git a/packages/cli/src/plugins/resource/plugin-node-modules.js b/packages/cli/src/plugins/resource/plugin-node-modules.js index 1c340827d..836a25bea 100644 --- a/packages/cli/src/plugins/resource/plugin-node-modules.js +++ b/packages/cli/src/plugins/resource/plugin-node-modules.js @@ -180,10 +180,13 @@ class NodeModulesResource extends ResourceInterface { return new Promise(async(resolve, reject) => { try { const fullUrl = path.extname(url) === '' - ? fs.existsSync(`${url}.mjs`) // test for .mjs first - ? `${url}.mjs` - : `${url}.js` + ? `${url}.js` : url; + // const fullUrl = path.extname(url) === '' + // ? fs.existsSync(`${url}.mjs`) // test for .mjs first + // ? `${url}.mjs` + // : `${url}.js` + // : url; const body = await fs.promises.readFile(fullUrl); resolve({ diff --git a/packages/plugin-graphql/src/core/client.js b/packages/plugin-graphql/src/core/client.js index 3a1edc6fe..327dd785d 100644 --- a/packages/plugin-graphql/src/core/client.js +++ b/packages/plugin-graphql/src/core/client.js @@ -1,35 +1,53 @@ -import { ApolloClient } from 'apollo-client'; -import { InMemoryCache } from 'apollo-cache-inmemory'; -import { HttpLink } from 'apollo-link-http'; -// import { getQueryHash } from '@greenwood/cli/data/common'; +const client = { + query: (query, variables = {}) => { + return fetch('http://localhost:4000/graphql', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }, + body: JSON.stringify({ + query, + variables + }) + }).then((response) => response.json()); + } +}; + +export default client; -const APOLLO_STATE = window.__APOLLO_STATE__; // eslint-disable-line no-underscore-dangle -const client = new ApolloClient({ - cache: new InMemoryCache(), - link: new HttpLink({ - uri: 'http://localhost:4000' - }) -}); -const backupQuery = client.query; +// import { ApolloClient } from 'apollo-client'; +// import { InMemoryCache } from 'apollo-cache-inmemory'; +// import { HttpLink } from 'apollo-link-http'; +// // import { getQueryHash } from '@greenwood/cli/data/common'; -client.query = (params) => { - if (APOLLO_STATE) { - // __APOLLO_STATE__ defined, in production mode - // const queryHash = getQueryHash(params.query, params.variables); - // const cachePath = `/${queryHash}-cache.json`; +// const APOLLO_STATE = window.__APOLLO_STATE__; // eslint-disable-line no-underscore-dangle +// const client = new ApolloClient({ +// cache: new InMemoryCache(), +// link: new HttpLink({ +// uri: 'http://localhost:4000' +// }) +// }); +// const backupQuery = client.query; + +// client.query = (params) => { +// if (APOLLO_STATE) { +// // __APOLLO_STATE__ defined, in production mode +// // const queryHash = getQueryHash(params.query, params.variables); +// // const cachePath = `/${queryHash}-cache.json`; - // return fetch(cachePath) - // .then(response => response.json()) - // .then((response) => { - // // mock client.query response - // return { - // data: new InMemoryCache().restore(response).readQuery(params) - // }; - // }); - } else { - // __APOLLO_STATE__ NOT defined, in development mode - return backupQuery(params); - } -}; +// // return fetch(cachePath) +// // .then(response => response.json()) +// // .then((response) => { +// // // mock client.query response +// // return { +// // data: new InMemoryCache().restore(response).readQuery(params) +// // }; +// // }); +// } else { +// // __APOLLO_STATE__ NOT defined, in development mode +// return backupQuery(params); +// } +// }; -export default client; \ No newline at end of file +// export default client; \ No newline at end of file diff --git a/packages/plugin-graphql/src/index.js b/packages/plugin-graphql/src/index.js index a86b3dd71..feeb554ba 100644 --- a/packages/plugin-graphql/src/index.js +++ b/packages/plugin-graphql/src/index.js @@ -1,5 +1,5 @@ const fs = require('fs'); -const gql = require('graphql-tag'); +// const gql = require('graphql-tag'); const { ResourceInterface } = require('@greenwood/cli/src/lib/resource-interface'); const { ServerInterface } = require('@greenwood/cli/src/lib/server-interface'); const graphqlServer = require('./core/server'); @@ -15,9 +15,12 @@ class GraphQLResource extends ResourceInterface { return new Promise(async (resolve, reject) => { try { const js = await fs.promises.readFile(url, 'utf-8'); - const gqlJs = gql`${js}`; + // const gqlJs = gql`${js}`; + // const body = ` + // export default ${JSON.stringify(gqlJs)}; + // `; const body = ` - export default ${JSON.stringify(gqlJs)}; + export default \`${js}\`; `; resolve({ @@ -34,33 +37,32 @@ class GraphQLResource extends ResourceInterface { return Promise.resolve(headers.request.accept && headers.request.accept.indexOf('text/html') >= 0); } - // graphql/language/printer + // "apollo-client": "/node_modules/apollo-client/bundle.esm.js", + // "apollo-cache-inmemory": "/node_modules/apollo-cache-inmemory/lib/bundle.esm.js", + // "apollo-link-http": "/node_modules/apollo-link-http/lib/bundle.esm.js", + // "apollo-utilities": "/node_modules/apollo-utilities/lib/bundle.esm.js", + // "apollo-link": "/node_modules/apollo-link/lib/bundle.esm.js", + // "apollo-cache": "/node_modules/apollo-cache/lib/bundle.esm.js", + // "apollo-link-http-common": "/node_modules/apollo-link-http-common/lib/bundle.esm.js", + // "optimism": "/node_modules/optimism/lib/bundle.esm.js", + // "tslib": "/node_modules/tslib/tslib.es6.js", + // "symbol-observable": "/node_modules/symbol-observable/es/index.js", + // "ts-invariant": "/node_modules/ts-invariant/lib/invariant.esm.js", + // "@wry/context": "/node_modules/@wry/context/lib/context.esm.js", + // "@wry/equality": "/node_modules/@wry/equality/lib/equality.esm.js", + // "graphql/jsutils/inspect": "/node_modules/graphql/jsutils/inspect.mjs", + // "graphql/language/visitor": "/node_modules/graphql/language/visitor.mjs", + // "graphql/language/parser": "/node_modules/graphql/language/parser.mjs", + // "graphql/language/printer": "/node_modules/graphql/language/printer.mjs", + // "zen-observable": "/node_modules/zen-observable/esm.js", + // "zen-observable-ts": "/node_modules/zen-observable-ts/lib/bundle.esm.js", + // "fast-json-stable-stringify": "/node_modules/fast-json-stable-stringify/index.js", + // "graphql-tag": "/node_modules/graphql-tag/src/index.js", async intercept(url, body) { return new Promise(async (resolve, reject) => { try { const shimmedBody = body.replace('"imports": {', ` "imports": { - "apollo-client": "/node_modules/apollo-client/bundle.esm.js", - "apollo-cache-inmemory": "/node_modules/apollo-cache-inmemory/lib/bundle.esm.js", - "apollo-link-http": "/node_modules/apollo-link-http/lib/bundle.esm.js", - "apollo-utilities": "/node_modules/apollo-utilities/lib/bundle.esm.js", - "apollo-link": "/node_modules/apollo-link/lib/bundle.esm.js", - "apollo-cache": "/node_modules/apollo-cache/lib/bundle.esm.js", - "apollo-link-http-common": "/node_modules/apollo-link-http-common/lib/bundle.esm.js", - "optimism": "/node_modules/optimism/lib/bundle.esm.js", - "tslib": "/node_modules/tslib/tslib.es6.js", - "symbol-observable": "/node_modules/symbol-observable/es/index.js", - "ts-invariant": "/node_modules/ts-invariant/lib/invariant.esm.js", - "@wry/context": "/node_modules/@wry/context/lib/context.esm.js", - "@wry/equality": "/node_modules/@wry/equality/lib/equality.esm.js", - "graphql/jsutils/inspect": "/node_modules/graphql/jsutils/inspect.mjs", - "graphql/language/visitor": "/node_modules/graphql/language/visitor.mjs", - "graphql/language/parser": "/node_modules/graphql/language/parser.mjs", - "graphql/language/printer": "/node_modules/graphql/language/printer.mjs", - "zen-observable": "/node_modules/zen-observable/esm.js", - "zen-observable-ts": "/node_modules/zen-observable-ts/lib/bundle.esm.js", - "fast-json-stable-stringify": "/node_modules/fast-json-stable-stringify/index.js", - "graphql-tag": "/node_modules/graphql-tag/src/index.js", "@greenwood/plugin-graphql/core/client.js": "/node_modules/@greenwood/plugin-graphql/src/core/client.js", "@greenwood/plugin-graphql/queries/menu.gql": "/node_modules/@greenwood/plugin-graphql/src/queries/menu.gql", "@greenwood/plugin-graphql/queries/config.gql": "/node_modules/@greenwood/plugin-graphql/src/queries/config.gql", diff --git a/www/components/header/header.js b/www/components/header/header.js index c5c3869b8..d9dc90f0a 100644 --- a/www/components/header/header.js +++ b/www/components/header/header.js @@ -11,7 +11,6 @@ import '../social-icons/social-icons.js'; console.debug('MenuQuery', MenuQuery); console.debug('ConfigQuery', ConfigQuery); console.debug('client', client); -// console.debug('gql', gql); class HeaderComponent extends LitElement { @@ -37,28 +36,12 @@ class HeaderComponent extends LitElement { async connectedCallback() { super.connectedCallback(); - // const response = await client.query({ - // query: MenuQuery, - // variables: { - // name: 'navigation', - // order: 'index_asc' - // } - // }); - // console.debug(response); + const response = await client.query(MenuQuery, { + name: 'navigation', + order: 'index_asc' + }); - fetch('/graph.json') - .then(res => res.json()) - .then(data => { - this.navigation = data.filter(page => { - if (page.data.menu === 'navigation') { - page.label = `${page.label.charAt(0).toUpperCase()}${page.label.slice(1)}`.replace('-', ' '); - - return page; - } - }).sort((a, b) => { - return a.data.index < b.data.index ? -1 : 1; - }); - }); + this.navigation = response.data.menu.children.map(item => item.item); } /* eslint-disable indent */ From 7ca8651d6f5a9edcded412524770e214a542cf55 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sun, 7 Mar 2021 12:24:33 -0500 Subject: [PATCH 06/29] restore graphQL to shelf --- packages/plugin-graphql/src/index.js | 6 +-- packages/plugin-graphql/src/schema/graph.js | 8 ++-- www/components/header/header.js | 9 ++-- www/components/shelf/shelf.js | 52 ++++++--------------- 4 files changed, 23 insertions(+), 52 deletions(-) diff --git a/packages/plugin-graphql/src/index.js b/packages/plugin-graphql/src/index.js index feeb554ba..ad8425a7d 100644 --- a/packages/plugin-graphql/src/index.js +++ b/packages/plugin-graphql/src/index.js @@ -63,9 +63,9 @@ class GraphQLResource extends ResourceInterface { try { const shimmedBody = body.replace('"imports": {', ` "imports": { - "@greenwood/plugin-graphql/core/client.js": "/node_modules/@greenwood/plugin-graphql/src/core/client.js", - "@greenwood/plugin-graphql/queries/menu.gql": "/node_modules/@greenwood/plugin-graphql/src/queries/menu.gql", - "@greenwood/plugin-graphql/queries/config.gql": "/node_modules/@greenwood/plugin-graphql/src/queries/config.gql", + "@greenwood/plugin-graphql/core/client": "/node_modules/@greenwood/plugin-graphql/src/core/client.js", + "@greenwood/plugin-graphql/queries/menu": "/node_modules/@greenwood/plugin-graphql/src/queries/menu.gql", + "@greenwood/plugin-graphql/queries/config": "/node_modules/@greenwood/plugin-graphql/src/queries/config.gql", `); resolve({ body: shimmedBody }); diff --git a/packages/plugin-graphql/src/schema/graph.js b/packages/plugin-graphql/src/schema/graph.js index 4f8e0afdf..d376a193d 100644 --- a/packages/plugin-graphql/src/schema/graph.js +++ b/packages/plugin-graphql/src/schema/graph.js @@ -20,17 +20,17 @@ const getMenuFromGraph = async (root, { name, pathname, orderBy }, context) => { } if (route.includes(baseRoute)) { - items.push({ item: { link: route, label: title, index }, children }); + items.push({ item: { route, label: title, index }, children }); } } else { - items.push({ item: { link: route, label: title, index }, children }); + items.push({ item: { route, label: title, index }, children }); } } }); if (orderBy !== '') { items = sortMenuItems(items, orderBy); } - return { item: { label: name, link: 'na' }, children: items }; + return { item: { label: name }, children: items }; }; const sortMenuItems = (menuItems, order) => { @@ -70,7 +70,7 @@ const getParsedHeadingsFromPage = (tableOfContents, headingLevel) => { tableOfContents.forEach(({ content, slug, lvl }) => { // make sure we only add heading elements of the same level (h1, h2, h3) if (lvl === headingLevel) { - children.push({ item: { label: content, link: '#' + slug }, children: [] }); + children.push({ item: { label: content, route: '#' + slug }, children: [] }); } }); } diff --git a/www/components/header/header.js b/www/components/header/header.js index d9dc90f0a..e26838ad4 100644 --- a/www/components/header/header.js +++ b/www/components/header/header.js @@ -1,16 +1,13 @@ import { css, html, LitElement, unsafeCSS } from 'lit-element'; -import client from '@greenwood/plugin-graphql/core/client.js'; -import MenuQuery from '@greenwood/plugin-graphql/queries/menu.gql'; -import ConfigQuery from '@greenwood/plugin-graphql/queries/config.gql'; -// import gql from 'graphql-tag'; +import client from '@greenwood/plugin-graphql/core/client'; +import MenuQuery from '@greenwood/plugin-graphql/queries/menu'; +import ConfigQuery from '@greenwood/plugin-graphql/queries/config'; import '@evergreen-wc/eve-container'; import headerCss from './header.css'; // TODO import evergreenLogo from '../../assets/evergreen.svg'; import '../social-icons/social-icons.js'; -console.debug('MenuQuery', MenuQuery); console.debug('ConfigQuery', ConfigQuery); -console.debug('client', client); class HeaderComponent extends LitElement { diff --git a/www/components/shelf/shelf.js b/www/components/shelf/shelf.js index 97d38f363..6686494bb 100644 --- a/www/components/shelf/shelf.js +++ b/www/components/shelf/shelf.js @@ -1,6 +1,6 @@ import { css, html, LitElement, unsafeCSS } from 'lit-element'; -// import client from '@greenwood/cli/data/client'; -// import MenuQuery from '@greenwood/cli/data/queries/menu'; +import client from '@greenwood/plugin-graphql/core/client'; +import MenuQuery from '@greenwood/plugin-graphql/queries/menu'; import shelfCss from './shelf.css'; import chevronRt from '../icons/chevron-right.js'; import chevronDwn from '../icons/chevron-down.js'; @@ -88,44 +88,18 @@ class Shelf extends LitElement { } async fetchShelfData() { - return fetch('/graph.json') - .then(res => res.json()) - .then(data => { - return data.filter(page => { - if (page.data.menu && page.data.menu === 'side' && page.route.indexOf(`/${this.page}`) === 0) { - page.label = `${page.label.charAt(0).toUpperCase()}${page.label.slice(1)}`.replace('-', ' '); - page.children = []; - - page.data.tableOfContents.forEach(({ content, slug }) => { - page.children.push({ - label: content, - route: `#${slug}` - }); - }); - - return page; - } - }).sort((a, b) => { - return a.data.index < b.data.index ? -1 : 1; - }); - }); - // return await client.query({ - // query: MenuQuery, - // variables: { - // name: 'side', - // route: `/${this.page}/`, - // order: 'index_asc' - // } - // }); + return await client.query(MenuQuery, { + name: 'side', + route: `/${this.page}/`, + order: 'index_asc' + }); } async updated(changedProperties) { if (changedProperties.has('page') && this.page !== '' && this.page !== '/') { - // const response = await this.fetchShelfData(); - // this.shelfList = response.data.menu.children; - this.shelfList = await this.fetchShelfData(); - // console.debug('this.shelfList', this.shelfList); - + const response = await this.fetchShelfData(); + + this.shelfList = response.data.menu.children; this.expandRoute(window.location.pathname); this.requestUpdate(); } @@ -151,7 +125,7 @@ class Shelf extends LitElement { ${list.map((item) => { return html`
  • - this.handleSubItemSelect(mainRoute, item.route)}>${item.label} + this.handleSubItemSelect(mainRoute, item.item.route)}>${item.item.label}
  • `; })} @@ -172,13 +146,13 @@ class Shelf extends LitElement { return html`

  • - ${renderListItems(item.route, item.children, item.selected)} + ${renderListItems(item.item.route, item.children, item.selected)}
  • `; }); From d639daa96839a2c81f7f0c5e560a0fa2f63d7842 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sun, 7 Mar 2021 12:32:02 -0500 Subject: [PATCH 07/29] refactor shelf --- www/components/shelf/shelf.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/www/components/shelf/shelf.js b/www/components/shelf/shelf.js index 6686494bb..ea97e24ea 100644 --- a/www/components/shelf/shelf.js +++ b/www/components/shelf/shelf.js @@ -99,7 +99,12 @@ class Shelf extends LitElement { if (changedProperties.has('page') && this.page !== '' && this.page !== '/') { const response = await this.fetchShelfData(); - this.shelfList = response.data.menu.children; + this.shelfList = response.data.menu.children.map((item) => { + return { + ...item.item, + children: item.children + }; + }); this.expandRoute(window.location.pathname); this.requestUpdate(); } @@ -116,16 +121,16 @@ class Shelf extends LitElement { renderList() { /* eslint-disable indent */ - const renderListItems = (mainRoute, list, selected) => { + const renderListItems = (mainRoute, children, selected) => { let listItems = ''; - if (list && list.length > 0) { + if (children && children.length > 0) { listItems = html`
      - ${list.map((item) => { + ${children.map((child) => { return html`
    • - this.handleSubItemSelect(mainRoute, item.item.route)}>${item.item.label} + this.handleSubItemSelect(mainRoute, child.item.route)}>${child.item.label}
    • `; })} @@ -146,13 +151,13 @@ class Shelf extends LitElement { return html`

    • - ${renderListItems(item.item.route, item.children, item.selected)} + ${renderListItems(item.route, item.children, item.selected)}
    • `; }); From faf7bba34307a6e3fed7cb4af790ad469ccf793a Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sun, 7 Mar 2021 13:51:17 -0500 Subject: [PATCH 08/29] rollup bundling working --- packages/cli/src/config/rollup.config.js | 17 +++--- packages/plugin-graphql/package.json | 1 + packages/plugin-graphql/src/core/cache.js | 12 ++-- packages/plugin-graphql/src/core/client.js | 57 ++++++++++++++----- .../plugin-graphql/src/core/common.client.js | 46 +++++++++++++++ .../src/core/{common.js => common.server.js} | 0 packages/plugin-graphql/src/core/server.js | 9 +-- packages/plugin-graphql/src/index.js | 42 +++++++++++++- www/components/header/header.js | 9 ++- www/components/shelf/shelf.js | 11 ++-- yarn.lock | 12 ++++ 11 files changed, 175 insertions(+), 41 deletions(-) create mode 100644 packages/plugin-graphql/src/core/common.client.js rename packages/plugin-graphql/src/core/{common.js => common.server.js} (100%) diff --git a/packages/cli/src/config/rollup.config.js b/packages/cli/src/config/rollup.config.js index a2110f7db..43e2d7df4 100644 --- a/packages/cli/src/config/rollup.config.js +++ b/packages/cli/src/config/rollup.config.js @@ -116,16 +116,17 @@ function greenwoodHtmlPlugin(compilation) { case '.html': return Promise.resolve(''); default: - customResources.filter((resource) => { - const shouldServe = Promise.resolve(resource.shouldServe(id)); + const resourceHandler = (await Promise.all(customResources.map(async (resource) => { + const shouldServe = await resource.shouldServe(id); - if (shouldServe) { - return resource; - } - }); + return shouldServe + ? resource + : null; + }))).filter(resource => resource); - if (customResources.length) { - const response = await customResources[0].serve(id); + // TODO should reduce here instead + if (resourceHandler.length) { + const response = await resourceHandler[0].serve(id); return Promise.resolve(response.body); } diff --git a/packages/plugin-graphql/package.json b/packages/plugin-graphql/package.json index 8697adbd7..2ade3bbba 100644 --- a/packages/plugin-graphql/package.json +++ b/packages/plugin-graphql/package.json @@ -22,6 +22,7 @@ "@greenwood/cli": "^0.4.0" }, "dependencies": { + "@rollup/plugin-alias": "^3.1.2", "apollo-cache-inmemory": "^1.6.3", "apollo-client": "^2.6.4", "apollo-link-http": "^1.5.16", diff --git a/packages/plugin-graphql/src/core/cache.js b/packages/plugin-graphql/src/core/cache.js index 1db2e25d3..a9190b048 100644 --- a/packages/plugin-graphql/src/core/cache.js +++ b/packages/plugin-graphql/src/core/cache.js @@ -5,7 +5,7 @@ const fs = require('fs'); const { gql } = require('apollo-server'); const InMemoryCache = require('apollo-cache-inmemory').InMemoryCache; const path = require('path'); -const { getQueryHash } = require('./common'); +const { getQueryHash } = require('./common.server'); /* Extract cache server-side */ module.exports = async (req, context) => { @@ -30,17 +30,19 @@ module.exports = async (req, context) => { }); if (data) { + const { outputDir } = context; + const cache = JSON.stringify(client.extract()); const queryHash = getQueryHash(queryObj, variables); const hashFilename = `${queryHash}-cache.json`; - const cachePath = `${context.publicDir}/${queryHash}-cache.json`; + const cachePath = `${outputDir}/${queryHash}-cache.json`; - if (!fs.existsSync(context.publicDir)) { - fs.mkdirSync(context.publicDir); + if (!fs.existsSync(outputDir)) { + fs.mkdirSync(outputDir); } if (!fs.existsSync(cachePath)) { - fs.writeFileSync(path.join(context.publicDir, hashFilename), cache, 'utf8'); + fs.writeFileSync(path.join(outputDir, hashFilename), cache, 'utf8'); } } resolve(); diff --git a/packages/plugin-graphql/src/core/client.js b/packages/plugin-graphql/src/core/client.js index 327dd785d..a356f6a5a 100644 --- a/packages/plugin-graphql/src/core/client.js +++ b/packages/plugin-graphql/src/core/client.js @@ -1,17 +1,44 @@ +import { getQueryHash } from '@greenwood/plugin-graphql/core/common'; + const client = { - query: (query, variables = {}) => { + query: (params) => { + const { query, variables = {} } = params; + return fetch('http://localhost:4000/graphql', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' }, - body: JSON.stringify({ + body: JSON.stringify({ query, variables }) }).then((response) => response.json()); - } + } +}; + +const APOLLO_STATE = window.__APOLLO_STATE__; // eslint-disable-line no-underscore-dangle +const backupQuery = client.query; + +client.query = (params) => { + if (APOLLO_STATE) { + // __APOLLO_STATE__ defined, in production mode + const queryHash = getQueryHash(params.query, params.variables); + const cachePath = `/${queryHash}-cache.json`; + + return fetch(cachePath) + .then(response => response.json()) + .then((response) => { + // mock client.query response + return { + data: response // new InMemoryCache().restore(response).readQuery(params) + }; + }); + } else { + // __APOLLO_STATE__ NOT defined, in development mode + return backupQuery(params); + } }; export default client; @@ -19,7 +46,7 @@ export default client; // import { ApolloClient } from 'apollo-client'; // import { InMemoryCache } from 'apollo-cache-inmemory'; // import { HttpLink } from 'apollo-link-http'; -// // import { getQueryHash } from '@greenwood/cli/data/common'; +// import { getQueryHash } from '@greenwood/cli/data/common'; // const APOLLO_STATE = window.__APOLLO_STATE__; // eslint-disable-line no-underscore-dangle // const client = new ApolloClient({ @@ -32,18 +59,18 @@ export default client; // client.query = (params) => { // if (APOLLO_STATE) { -// // __APOLLO_STATE__ defined, in production mode -// // const queryHash = getQueryHash(params.query, params.variables); -// // const cachePath = `/${queryHash}-cache.json`; +// __APOLLO_STATE__ defined, in production mode +// const queryHash = getQueryHash(params.query, params.variables); +// const cachePath = `/${queryHash}-cache.json`; -// // return fetch(cachePath) -// // .then(response => response.json()) -// // .then((response) => { -// // // mock client.query response -// // return { -// // data: new InMemoryCache().restore(response).readQuery(params) -// // }; -// // }); +// return fetch(cachePath) +// .then(response => response.json()) +// .then((response) => { +// // mock client.query response +// return { +// data: new InMemoryCache().restore(response).readQuery(params) +// }; +// }); // } else { // // __APOLLO_STATE__ NOT defined, in development mode // return backupQuery(params); diff --git a/packages/plugin-graphql/src/core/common.client.js b/packages/plugin-graphql/src/core/common.client.js new file mode 100644 index 000000000..e2d88d5f6 --- /dev/null +++ b/packages/plugin-graphql/src/core/common.client.js @@ -0,0 +1,46 @@ +// https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0#gistcomment-2775538 +function hashString(queryKeysString) { + let h = 0; + + for (let i = 0; i < queryKeysString.length; i += 1) { + h = Math.imul(31, h) + queryKeysString.charCodeAt(i) | 0; // eslint-disable-line no-bitwise + } + + return Math.abs(h).toString(); +} + +function getQueryKeysFromSelectionSet(selectionSet) { + let queryKeys = ''; + + for (let key in selectionSet) { + + if (key === 'selections') { + queryKeys += selectionSet[key] + .filter(selection => selection.name.value !== '__typename') // __typename is added by server.js + .map(selection => selection.name.value).join(''); + } + } + + if (selectionSet.kind === 'SelectionSet') { + selectionSet.selections.forEach(selection => { + if (selection.selectionSet) { + queryKeys += getQueryKeysFromSelectionSet(selection.selectionSet); + } + }); + } + + return queryKeys; +} + +function getQueryHash(query, variables = {}) { + const queryKeys = getQueryKeysFromSelectionSet(query.definitions[0].selectionSet); + const variableValues = Object.keys(variables).length > 0 + ? `_${Object.values(variables).join('').replace(/\//g, '')}` // handle / which will translate to filepaths + : ''; + + return hashString(`${queryKeys}${variableValues}`); +} + +export { + getQueryHash +}; \ No newline at end of file diff --git a/packages/plugin-graphql/src/core/common.js b/packages/plugin-graphql/src/core/common.server.js similarity index 100% rename from packages/plugin-graphql/src/core/common.js rename to packages/plugin-graphql/src/core/common.server.js diff --git a/packages/plugin-graphql/src/core/server.js b/packages/plugin-graphql/src/core/server.js index b31e7dd56..5a9db7452 100644 --- a/packages/plugin-graphql/src/core/server.js +++ b/packages/plugin-graphql/src/core/server.js @@ -14,10 +14,11 @@ module.exports = (compilation) => { } }, context: async (integrationContext) => { - // const { req } = integrationContext; - // if (req.query.q !== 'internal') { - // await createCache(req, context); - // } + const { req } = integrationContext; + + if (req.query.q !== 'internal') { + await createCache(req, context); + } return { config, diff --git a/packages/plugin-graphql/src/index.js b/packages/plugin-graphql/src/index.js index ad8425a7d..93585d025 100644 --- a/packages/plugin-graphql/src/index.js +++ b/packages/plugin-graphql/src/index.js @@ -1,8 +1,10 @@ const fs = require('fs'); +const graphqlServer = require('./core/server'); // const gql = require('graphql-tag'); +const path = require('path'); const { ResourceInterface } = require('@greenwood/cli/src/lib/resource-interface'); const { ServerInterface } = require('@greenwood/cli/src/lib/server-interface'); -const graphqlServer = require('./core/server'); +const rollupPluginAlias = require('@rollup/plugin-alias'); class GraphQLResource extends ResourceInterface { constructor(compilation, options = {}) { @@ -13,7 +15,7 @@ class GraphQLResource extends ResourceInterface { async serve(url) { return new Promise(async (resolve, reject) => { - try { + try { const js = await fs.promises.readFile(url, 'utf-8'); // const gqlJs = gql`${js}`; // const body = ` @@ -64,6 +66,7 @@ class GraphQLResource extends ResourceInterface { const shimmedBody = body.replace('"imports": {', ` "imports": { "@greenwood/plugin-graphql/core/client": "/node_modules/@greenwood/plugin-graphql/src/core/client.js", + "@greenwood/plugin-graphql/core/common": "/node_modules/@greenwood/plugin-graphql/src/core/common.client.js", "@greenwood/plugin-graphql/queries/menu": "/node_modules/@greenwood/plugin-graphql/src/queries/menu.gql", "@greenwood/plugin-graphql/queries/config": "/node_modules/@greenwood/plugin-graphql/src/queries/config.gql", `); @@ -74,6 +77,28 @@ class GraphQLResource extends ResourceInterface { } }); } + + async shouldOptimize(url) { + return Promise.resolve(path.extname(url) === '.html'); + } + + async optimize(url, body) { + return new Promise((resolve, reject) => { + try { + // TODO const apolloScript = isStrictOptimization (no apollo-state) + body = body.replace(' + - + + + + + + + \ No newline at end of file From d7b98bb99e75ab9acdfb6c04c7ac84d47295799c Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sat, 13 Mar 2021 14:18:30 -0500 Subject: [PATCH 15/29] tests for menu query for navigation --- .../test/cases/query-menu/greenwood.config.js | 10 ++ .../test/cases/query-menu/package.json | 6 + .../test/cases/query-menu/query-menu.spec.js | 161 ++++++++++++++++++ .../cases/query-menu/src/components/header.js | 58 +++++++ .../test/cases/query-menu/src/pages/about.md | 7 + .../cases/query-menu/src/pages/contact.md | 7 + .../test/cases/query-menu/src/pages/index.md | 3 + .../cases/query-menu/src/templates/page.html | 12 ++ 8 files changed, 264 insertions(+) create mode 100644 packages/plugin-graphql/test/cases/query-menu/greenwood.config.js create mode 100644 packages/plugin-graphql/test/cases/query-menu/package.json create mode 100644 packages/plugin-graphql/test/cases/query-menu/query-menu.spec.js create mode 100644 packages/plugin-graphql/test/cases/query-menu/src/components/header.js create mode 100644 packages/plugin-graphql/test/cases/query-menu/src/pages/about.md create mode 100644 packages/plugin-graphql/test/cases/query-menu/src/pages/contact.md create mode 100644 packages/plugin-graphql/test/cases/query-menu/src/pages/index.md create mode 100644 packages/plugin-graphql/test/cases/query-menu/src/templates/page.html diff --git a/packages/plugin-graphql/test/cases/query-menu/greenwood.config.js b/packages/plugin-graphql/test/cases/query-menu/greenwood.config.js new file mode 100644 index 000000000..edb1b78c3 --- /dev/null +++ b/packages/plugin-graphql/test/cases/query-menu/greenwood.config.js @@ -0,0 +1,10 @@ +const pluginGraphQL = require('../../../src/index'); + +module.exports = { + title: 'GraphQL ConfigQuery Spec', + + plugins: [ + ...pluginGraphQL() + ] + +}; \ No newline at end of file diff --git a/packages/plugin-graphql/test/cases/query-menu/package.json b/packages/plugin-graphql/test/cases/query-menu/package.json new file mode 100644 index 000000000..eeef8448b --- /dev/null +++ b/packages/plugin-graphql/test/cases/query-menu/package.json @@ -0,0 +1,6 @@ +{ + "name": "plugin-graphql-test-menu-query", + "dependencies": { + "lit-element": "^2.4.0" + } +} \ No newline at end of file diff --git a/packages/plugin-graphql/test/cases/query-menu/query-menu.spec.js b/packages/plugin-graphql/test/cases/query-menu/query-menu.spec.js new file mode 100644 index 000000000..6d872f90c --- /dev/null +++ b/packages/plugin-graphql/test/cases/query-menu/query-menu.spec.js @@ -0,0 +1,161 @@ +/* + * Use Case + * Run Greenwood build command with GraphQL calls to get data about the projects graph using MenuQuery, simluting + * a site navigation based on top level page routes. Also uses LitElement. + * + * User Result + * Should generate a Greenwood build that dynamically serializes data from the graph from the header. + * + * User Command + * greenwood build + * + * Default Config (+ plugin-graphql) + * + * Custom Workspace + * src/ + * components/ + * header.js + * pages/ + * about.md + * contact.md + * index.md + * templates/ + * page.html + */ +const expect = require('chai').expect; +const fs = require('fs'); +const glob = require('glob-promise'); +const { JSDOM } = require('jsdom'); +const path = require('path'); +const TestBed = require('../../../../../test/test-bed'); + +describe('Build Greenwood With: ', function() { + const LABEL = 'MenuQuery from GraphQL'; + const apolloStateRegex = /window.__APOLLO_STATE__ = true/; + let setup; + + before(async function() { + setup = new TestBed(); + + const greenwoodGraphqlCoreLibs = (await glob(`${process.cwd()}/packages/plugin-graphql/src/core/*.js`)).map((lib) => { + return { + dir: 'node_modules/@greenwood/plugin-graphql/src/core/', + name: path.basename(lib) + }; + }); + const greenwoodGraphqlQueryLibs = (await glob(`${process.cwd()}/packages/plugin-graphql/src/queries/*.gql`)).map((lib) => { + return { + dir: 'node_modules/@greenwood/plugin-graphql/src/queries/', + name: path.basename(lib) + }; + }); + const litElementLibs = (await glob(`${process.cwd()}/node_modules/lit-element/lib/*.js`)).map((lib) => { + return { + dir: 'node_modules/lit-element/lib/', + name: path.basename(lib) + }; + }); + const litHtmlLibs = (await glob(`${process.cwd()}/node_modules/lit-html/lib/*.js`)).map((lib) => { + return { + dir: 'node_modules/lit-html/lib/', + name: path.basename(lib) + }; + }); + + this.context = await setup.setupTestBed(__dirname, [ + ...greenwoodGraphqlCoreLibs, + ...greenwoodGraphqlQueryLibs, + { + // lit-element (+ lit-html) + dir: 'node_modules/lit-element/', + name: 'lit-element.js' + }, { + dir: 'node_modules/lit-element/', + name: 'package.json' + }, + + ...litElementLibs, + + { + dir: 'node_modules/lit-html/', + name: 'lit-html.js' + }, { + dir: 'node_modules/lit-html/', + name: 'package.json' + }, + + ...litHtmlLibs + ]); + }); + + describe(LABEL, function() { + + before(async function() { + await setup.runGreenwoodCommand('build'); + }); + + describe('Home (Page Template) navigation w/ MenuQuery', function() { + + beforeEach(async function() { + dom = await JSDOM.fromFile(path.resolve(this.context.publicDir, 'index.html')); + }); + + it('should output an index.html file (home page)', function() { + expect(fs.existsSync(path.join(this.context.publicDir, './index.html'))).to.be.true; + }); + + it('should have one window.__APOLLO_STATE__ + + + + + + + \ No newline at end of file From 7b9b5f7bf02986dc931e358e46a1f6453ef75624 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sat, 13 Mar 2021 14:18:53 -0500 Subject: [PATCH 16/29] clean up --- .../test/cases/query-config/query-config.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/plugin-graphql/test/cases/query-config/query-config.spec.js b/packages/plugin-graphql/test/cases/query-config/query-config.spec.js index 101e6987d..b8f195d19 100644 --- a/packages/plugin-graphql/test/cases/query-config/query-config.spec.js +++ b/packages/plugin-graphql/test/cases/query-config/query-config.spec.js @@ -8,7 +8,7 @@ * User Command * greenwood build * - * Default Config + * Default Config (+ plugin-graphql) * * Custom Workspace * greenwood.config.js @@ -27,12 +27,12 @@ const path = require('path'); const TestBed = require('../../../../../test/test-bed'); describe('Build Greenwood With: ', function() { - const LABEL = 'Config from GraphQL'; + const LABEL = 'ConfigQuery from GraphQL'; const apolloStateRegex = /window.__APOLLO_STATE__ = true/; let setup; before(async function() { - setup = new TestBed(true); + setup = new TestBed(); const greenwoodGraphqlCoreLibs = (await glob(`${process.cwd()}/packages/plugin-graphql/src/core/*.js`)).map((lib) => { return { From 021135b08ee20de2f1ccde019f7c2172a0c35738 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sat, 13 Mar 2021 14:45:05 -0500 Subject: [PATCH 17/29] add support for children query aliasing --- packages/plugin-graphql/src/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/plugin-graphql/src/index.js b/packages/plugin-graphql/src/index.js index 0c2c8e76e..56a7ee0b1 100644 --- a/packages/plugin-graphql/src/index.js +++ b/packages/plugin-graphql/src/index.js @@ -71,8 +71,9 @@ class GraphQLResource extends ResourceInterface { "imports": { "@greenwood/plugin-graphql/core/client": "/node_modules/@greenwood/plugin-graphql/src/core/client.js", "@greenwood/plugin-graphql/core/common": "/node_modules/@greenwood/plugin-graphql/src/core/common.client.js", - "@greenwood/plugin-graphql/queries/menu": "/node_modules/@greenwood/plugin-graphql/src/queries/menu.gql", - "@greenwood/plugin-graphql/queries/config": "/node_modules/@greenwood/plugin-graphql/src/queries/config.gql"${danglingComma} + "@greenwood/plugin-graphql/queries/children": "/node_modules/@greenwood/plugin-graphql/src/queries/children.gql", + "@greenwood/plugin-graphql/queries/config": "/node_modules/@greenwood/plugin-graphql/src/queries/config.gql", + "@greenwood/plugin-graphql/queries/menu": "/node_modules/@greenwood/plugin-graphql/src/queries/menu.gql"${danglingComma} `); resolve({ body: shimmedBody }); @@ -135,7 +136,8 @@ module.exports = (options = {}) => { { find: '@greenwood/plugin-graphql/core/client', replacement: '@greenwood/plugin-graphql/src/core/client.js' }, { find: '@greenwood/plugin-graphql/core/common', replacement: '@greenwood/plugin-graphql/src/core/common.client.js' }, { find: '@greenwood/plugin-graphql/queries/menu', replacement: '@greenwood/plugin-graphql/src/queries/menu.gql' }, - { find: '@greenwood/plugin-graphql/queries/config', replacement: '@greenwood/plugin-graphql/src/queries/config.gql' } + { find: '@greenwood/plugin-graphql/queries/config', replacement: '@greenwood/plugin-graphql/src/queries/config.gql' }, + { find: '@greenwood/plugin-graphql/queries/children', replacement: '@greenwood/plugin-graphql/src/queries/children.gql' } ] }) ] From b50f544cb39e41309070526b2a29a8071f509b72 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sat, 13 Mar 2021 14:45:21 -0500 Subject: [PATCH 18/29] children query specs --- .../cases/query-children/greenwood.config.js | 10 ++ .../test/cases/query-children/package.json | 6 + .../query-children/query-children.spec.js | 163 ++++++++++++++++++ .../src/components/posts-list.js | 55 ++++++ .../src/pages/blog/first-post/index.md | 9 + .../src/pages/blog/second-post/index.md | 9 + .../cases/query-children/src/pages/index.html | 12 ++ 7 files changed, 264 insertions(+) create mode 100644 packages/plugin-graphql/test/cases/query-children/greenwood.config.js create mode 100644 packages/plugin-graphql/test/cases/query-children/package.json create mode 100644 packages/plugin-graphql/test/cases/query-children/query-children.spec.js create mode 100644 packages/plugin-graphql/test/cases/query-children/src/components/posts-list.js create mode 100644 packages/plugin-graphql/test/cases/query-children/src/pages/blog/first-post/index.md create mode 100644 packages/plugin-graphql/test/cases/query-children/src/pages/blog/second-post/index.md create mode 100644 packages/plugin-graphql/test/cases/query-children/src/pages/index.html diff --git a/packages/plugin-graphql/test/cases/query-children/greenwood.config.js b/packages/plugin-graphql/test/cases/query-children/greenwood.config.js new file mode 100644 index 000000000..edb1b78c3 --- /dev/null +++ b/packages/plugin-graphql/test/cases/query-children/greenwood.config.js @@ -0,0 +1,10 @@ +const pluginGraphQL = require('../../../src/index'); + +module.exports = { + title: 'GraphQL ConfigQuery Spec', + + plugins: [ + ...pluginGraphQL() + ] + +}; \ No newline at end of file diff --git a/packages/plugin-graphql/test/cases/query-children/package.json b/packages/plugin-graphql/test/cases/query-children/package.json new file mode 100644 index 000000000..75d12a9b7 --- /dev/null +++ b/packages/plugin-graphql/test/cases/query-children/package.json @@ -0,0 +1,6 @@ +{ + "name": "plugin-graphql-test-children-query", + "dependencies": { + "lit-element": "^2.4.0" + } +} \ No newline at end of file diff --git a/packages/plugin-graphql/test/cases/query-children/query-children.spec.js b/packages/plugin-graphql/test/cases/query-children/query-children.spec.js new file mode 100644 index 000000000..c1afd7265 --- /dev/null +++ b/packages/plugin-graphql/test/cases/query-children/query-children.spec.js @@ -0,0 +1,163 @@ +/* + * Use Case + * Run Greenwood build command with GraphQL calls to get data about the projects graph using MenuQuery, simulating + * a link of blog posts derivered from a pages/blog directory. Also uses LitElement. + * + * User Result + * Should generate a Greenwood build that dynamically serializes data from the graph in the body + * of the home page as a list of blog post links. + * + * User Command + * greenwood build + * + * Default Config (+ plugin-graphql) + * + * Custom Workspace + * src/ + * components/ + * post-list.js + * pages/ + * blog/ + * first-post/ + * index.md + * second-post/ + * index.md + * index.html + */ +const expect = require('chai').expect; +const fs = require('fs'); +const glob = require('glob-promise'); +const { JSDOM } = require('jsdom'); +const path = require('path'); +const TestBed = require('../../../../../test/test-bed'); + +describe('Build Greenwood With: ', function() { + const LABEL = 'ChildrenQuery from GraphQL'; + const apolloStateRegex = /window.__APOLLO_STATE__ = true/; + let setup; + + before(async function() { + setup = new TestBed(); + + const greenwoodGraphqlCoreLibs = (await glob(`${process.cwd()}/packages/plugin-graphql/src/core/*.js`)).map((lib) => { + return { + dir: 'node_modules/@greenwood/plugin-graphql/src/core/', + name: path.basename(lib) + }; + }); + const greenwoodGraphqlQueryLibs = (await glob(`${process.cwd()}/packages/plugin-graphql/src/queries/*.gql`)).map((lib) => { + return { + dir: 'node_modules/@greenwood/plugin-graphql/src/queries/', + name: path.basename(lib) + }; + }); + const litElementLibs = (await glob(`${process.cwd()}/node_modules/lit-element/lib/*.js`)).map((lib) => { + return { + dir: 'node_modules/lit-element/lib/', + name: path.basename(lib) + }; + }); + const litHtmlLibs = (await glob(`${process.cwd()}/node_modules/lit-html/lib/*.js`)).map((lib) => { + return { + dir: 'node_modules/lit-html/lib/', + name: path.basename(lib) + }; + }); + + this.context = await setup.setupTestBed(__dirname, [ + ...greenwoodGraphqlCoreLibs, + ...greenwoodGraphqlQueryLibs, + { + // lit-element (+ lit-html) + dir: 'node_modules/lit-element/', + name: 'lit-element.js' + }, { + dir: 'node_modules/lit-element/', + name: 'package.json' + }, + + ...litElementLibs, + + { + dir: 'node_modules/lit-html/', + name: 'lit-html.js' + }, { + dir: 'node_modules/lit-html/', + name: 'package.json' + }, + + ...litHtmlLibs + ]); + }); + + describe(LABEL, function() { + + before(async function() { + await setup.runGreenwoodCommand('build'); + }); + + describe('Home (Page Template) w/ ChildrenQuery', function() { + + beforeEach(async function() { + dom = await JSDOM.fromFile(path.resolve(this.context.publicDir, 'index.html')); + }); + + it('should output an index.html file (home page)', function() { + expect(fs.existsSync(path.join(this.context.publicDir, './index.html'))).to.be.true; + }); + + it('should have one window.__APOLLO_STATE__ + + + + + + + \ No newline at end of file From fa099269b67e49921dbccff3e45c7e031b9467df Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sat, 13 Mar 2021 14:45:36 -0500 Subject: [PATCH 19/29] cleanup --- .../test/cases/query-config/src/components/footer.js | 12 ++---------- .../test/cases/query-menu/src/components/header.js | 1 - 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/plugin-graphql/test/cases/query-config/src/components/footer.js b/packages/plugin-graphql/test/cases/query-config/src/components/footer.js index d26929d06..cddb2ca57 100644 --- a/packages/plugin-graphql/test/cases/query-config/src/components/footer.js +++ b/packages/plugin-graphql/test/cases/query-config/src/components/footer.js @@ -4,15 +4,11 @@ import ConfigQuery from '@greenwood/plugin-graphql/queries/config'; class FooterComponent extends HTMLElement { constructor() { super(); - console.debug('FooterComponent hello!!!'); - + this.root = this.attachShadow({ mode: 'open' }); } - async connectedCallback() { - console.debug(client); - console.debug(ConfigQuery); - + async connectedCallback() { await client.query({ query: ConfigQuery }).then((response) => { @@ -20,10 +16,6 @@ class FooterComponent extends HTMLElement {
      ${response.data.config.title}
      `; }); - // this.root.innerHTML = ` - //
      © ${response.data.config.title}
      - // `; - // }); } } diff --git a/packages/plugin-graphql/test/cases/query-menu/src/components/header.js b/packages/plugin-graphql/test/cases/query-menu/src/components/header.js index aa6c56e90..e7d516445 100644 --- a/packages/plugin-graphql/test/cases/query-menu/src/components/header.js +++ b/packages/plugin-graphql/test/cases/query-menu/src/components/header.js @@ -27,7 +27,6 @@ class HeaderComponent extends LitElement { } }); - // this.navigation = response.data.menu.children; this.navigation = response.data.menu.children.map(item => item.item); } From 15bb49b597e6faedc7584d8598b3a609a50effd5 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sat, 13 Mar 2021 15:13:39 -0500 Subject: [PATCH 20/29] graph query test cases and support --- packages/plugin-graphql/src/index.js | 4 +- .../cases/query-graph/greenwood.config.js | 10 ++ .../test/cases/query-graph/package.json | 6 + .../cases/query-graph/query-graph.spec.js | 152 ++++++++++++++++++ .../src/components/debug-output.js | 48 ++++++ .../query-graph/src/pages/blog/first-post.md | 10 ++ .../query-graph/src/pages/blog/second-post.md | 10 ++ .../cases/query-graph/src/pages/index.html | 13 ++ 8 files changed, 252 insertions(+), 1 deletion(-) create mode 100644 packages/plugin-graphql/test/cases/query-graph/greenwood.config.js create mode 100644 packages/plugin-graphql/test/cases/query-graph/package.json create mode 100644 packages/plugin-graphql/test/cases/query-graph/query-graph.spec.js create mode 100644 packages/plugin-graphql/test/cases/query-graph/src/components/debug-output.js create mode 100644 packages/plugin-graphql/test/cases/query-graph/src/pages/blog/first-post.md create mode 100644 packages/plugin-graphql/test/cases/query-graph/src/pages/blog/second-post.md create mode 100644 packages/plugin-graphql/test/cases/query-graph/src/pages/index.html diff --git a/packages/plugin-graphql/src/index.js b/packages/plugin-graphql/src/index.js index 56a7ee0b1..f74982cf4 100644 --- a/packages/plugin-graphql/src/index.js +++ b/packages/plugin-graphql/src/index.js @@ -73,6 +73,7 @@ class GraphQLResource extends ResourceInterface { "@greenwood/plugin-graphql/core/common": "/node_modules/@greenwood/plugin-graphql/src/core/common.client.js", "@greenwood/plugin-graphql/queries/children": "/node_modules/@greenwood/plugin-graphql/src/queries/children.gql", "@greenwood/plugin-graphql/queries/config": "/node_modules/@greenwood/plugin-graphql/src/queries/config.gql", + "@greenwood/plugin-graphql/queries/graph": "/node_modules/@greenwood/plugin-graphql/src/queries/graph.gql", "@greenwood/plugin-graphql/queries/menu": "/node_modules/@greenwood/plugin-graphql/src/queries/menu.gql"${danglingComma} `); @@ -137,7 +138,8 @@ module.exports = (options = {}) => { { find: '@greenwood/plugin-graphql/core/common', replacement: '@greenwood/plugin-graphql/src/core/common.client.js' }, { find: '@greenwood/plugin-graphql/queries/menu', replacement: '@greenwood/plugin-graphql/src/queries/menu.gql' }, { find: '@greenwood/plugin-graphql/queries/config', replacement: '@greenwood/plugin-graphql/src/queries/config.gql' }, - { find: '@greenwood/plugin-graphql/queries/children', replacement: '@greenwood/plugin-graphql/src/queries/children.gql' } + { find: '@greenwood/plugin-graphql/queries/children', replacement: '@greenwood/plugin-graphql/src/queries/children.gql' }, + { find: '@greenwood/plugin-graphql/queries/graph', replacement: '@greenwood/plugin-graphql/src/queries/graph.gql' } ] }) ] diff --git a/packages/plugin-graphql/test/cases/query-graph/greenwood.config.js b/packages/plugin-graphql/test/cases/query-graph/greenwood.config.js new file mode 100644 index 000000000..edb1b78c3 --- /dev/null +++ b/packages/plugin-graphql/test/cases/query-graph/greenwood.config.js @@ -0,0 +1,10 @@ +const pluginGraphQL = require('../../../src/index'); + +module.exports = { + title: 'GraphQL ConfigQuery Spec', + + plugins: [ + ...pluginGraphQL() + ] + +}; \ No newline at end of file diff --git a/packages/plugin-graphql/test/cases/query-graph/package.json b/packages/plugin-graphql/test/cases/query-graph/package.json new file mode 100644 index 000000000..0acf9dd07 --- /dev/null +++ b/packages/plugin-graphql/test/cases/query-graph/package.json @@ -0,0 +1,6 @@ +{ + "name": "plugin-graphql-test-graph-query", + "dependencies": { + "lit-element": "^2.4.0" + } +} \ No newline at end of file diff --git a/packages/plugin-graphql/test/cases/query-graph/query-graph.spec.js b/packages/plugin-graphql/test/cases/query-graph/query-graph.spec.js new file mode 100644 index 000000000..5bc4d0f7f --- /dev/null +++ b/packages/plugin-graphql/test/cases/query-graph/query-graph.spec.js @@ -0,0 +1,152 @@ +/* + * Use Case + * Run Greenwood build command with GraphQL calls to get data about the projects graph using GraphQuaery. + * + * User Result + * Should generate a Greenwood build that tests basic output from the GraphQuery. + * + * User Command + * greenwood build + * + * Default Config + * + * Custom Workspace + * src/ + * components/ + * debug-output.js + * pages/ + * blog/ + * first-post.md + * second-post.md + * index.html + */ +const expect = require('chai').expect; +const fs = require('fs'); +const glob = require('glob-promise'); +const { JSDOM } = require('jsdom'); +const path = require('path'); +const TestBed = require('../../../../../test/test-bed'); + +describe('Build Greenwood With: ', function() { + const LABEL = 'Graph from GraphQL'; + const apolloStateRegex = /window.__APOLLO_STATE__ = true/; + let setup; + + before(async function() { + setup = new TestBed(true); + + const greenwoodGraphqlCoreLibs = (await glob(`${process.cwd()}/packages/plugin-graphql/src/core/*.js`)).map((lib) => { + return { + dir: 'node_modules/@greenwood/plugin-graphql/src/core/', + name: path.basename(lib) + }; + }); + const greenwoodGraphqlQueryLibs = (await glob(`${process.cwd()}/packages/plugin-graphql/src/queries/*.gql`)).map((lib) => { + return { + dir: 'node_modules/@greenwood/plugin-graphql/src/queries/', + name: path.basename(lib) + }; + }); + const litElementLibs = (await glob(`${process.cwd()}/node_modules/lit-element/lib/*.js`)).map((lib) => { + return { + dir: 'node_modules/lit-element/lib/', + name: path.basename(lib) + }; + }); + const litHtmlLibs = (await glob(`${process.cwd()}/node_modules/lit-html/lib/*.js`)).map((lib) => { + return { + dir: 'node_modules/lit-html/lib/', + name: path.basename(lib) + }; + }); + + this.context = await setup.setupTestBed(__dirname, [ + ...greenwoodGraphqlCoreLibs, + ...greenwoodGraphqlQueryLibs, + { + // lit-element (+ lit-html) + dir: 'node_modules/lit-element/', + name: 'lit-element.js' + }, { + dir: 'node_modules/lit-element/', + name: 'package.json' + }, + + ...litElementLibs, + + { + dir: 'node_modules/lit-html/', + name: 'lit-html.js' + }, { + dir: 'node_modules/lit-html/', + name: 'package.json' + }, + + ...litHtmlLibs + ]); + }); + + describe(LABEL, function() { + + before(async function() { + await setup.runGreenwoodCommand('build'); + }); + + describe('Home (Page Template) output w/ GraphQuery', function() { + + beforeEach(async function() { + dom = await JSDOM.fromFile(path.resolve(this.context.publicDir, 'index.html')); + }); + + it('should output an index.html file (home page)', function() { + expect(fs.existsSync(path.join(this.context.publicDir, './index.html'))).to.be.true; + }); + + it('should have one window.__APOLLO_STATE__ + + + +

      Home Page

      + + + + \ No newline at end of file From 8adc39f0eabe198ecc38ad7d275f1cd38f0a80db Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sat, 13 Mar 2021 15:13:54 -0500 Subject: [PATCH 21/29] delete old cases --- ...uild.data.graph-custom-frontmatter.spec.js | 145 --------- .../src/pages/blog/first-post.md | 10 - .../src/pages/blog/second-post.md | 10 - .../src/pages/index.md | 7 - .../src/templates/blog-template.js | 78 ----- .../build.data.graph/build.data.graph.spec.js | 294 ------------------ .../build.data.graph/src/components/header.js | 57 ---- .../src/pages/blog/first-post/index.md | 11 - .../build.data.graph/src/pages/blog/index.md | 5 - .../src/pages/blog/second-post/index.md | 11 - .../cases/build.data.graph/src/pages/index.md | 7 - .../src/templates/blog-template.js | 62 ---- .../src/templates/page-template.js | 21 -- .../src/templates/post-template.js | 67 ---- 14 files changed, 785 deletions(-) delete mode 100644 packages/cli/test/cases/build.data.graph-custom-frontmatter/build.data.graph-custom-frontmatter.spec.js delete mode 100644 packages/cli/test/cases/build.data.graph-custom-frontmatter/src/pages/blog/first-post.md delete mode 100644 packages/cli/test/cases/build.data.graph-custom-frontmatter/src/pages/blog/second-post.md delete mode 100644 packages/cli/test/cases/build.data.graph-custom-frontmatter/src/pages/index.md delete mode 100644 packages/cli/test/cases/build.data.graph-custom-frontmatter/src/templates/blog-template.js delete mode 100644 packages/cli/test/cases/build.data.graph/build.data.graph.spec.js delete mode 100644 packages/cli/test/cases/build.data.graph/src/components/header.js delete mode 100644 packages/cli/test/cases/build.data.graph/src/pages/blog/first-post/index.md delete mode 100644 packages/cli/test/cases/build.data.graph/src/pages/blog/index.md delete mode 100644 packages/cli/test/cases/build.data.graph/src/pages/blog/second-post/index.md delete mode 100644 packages/cli/test/cases/build.data.graph/src/pages/index.md delete mode 100644 packages/cli/test/cases/build.data.graph/src/templates/blog-template.js delete mode 100644 packages/cli/test/cases/build.data.graph/src/templates/page-template.js delete mode 100644 packages/cli/test/cases/build.data.graph/src/templates/post-template.js diff --git a/packages/cli/test/cases/build.data.graph-custom-frontmatter/build.data.graph-custom-frontmatter.spec.js b/packages/cli/test/cases/build.data.graph-custom-frontmatter/build.data.graph-custom-frontmatter.spec.js deleted file mode 100644 index 1290dc20d..000000000 --- a/packages/cli/test/cases/build.data.graph-custom-frontmatter/build.data.graph-custom-frontmatter.spec.js +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Use Case - * Run Greenwood build command with GraphQL calls to get data about the projects graph. - * - * User Result - * Should generate a Greenwood build that specifically tests for custom frontmatter set by individual pages. - * - * User Command - * greenwood build - * - * Default Config - * - * Custom Workspace - * src/ - * pages/ - * blog/ - * first-post.md - * second-post.md - * index.md - * templates/ - * blog-template.js - */ -const expect = require('chai').expect; -const fs = require('fs'); -const glob = require('glob-promise'); -const { JSDOM } = require('jsdom'); -const path = require('path'); -const TestBed = require('../../../../../test/test-bed'); - -const mainBundleScriptRegex = /index.*.bundle\.js/; - -xdescribe('Build Greenwood With: ', function() { - const LABEL = 'Data from GraphQL and using Custom Frontmatter Data'; - const apolloStateRegex = /window.__APOLLO_STATE__ = true/; - let setup; - - before(async function() { - setup = new TestBed(); - this.context = await setup.setupTestBed(__dirname); - }); - - describe(LABEL, function() { - - before(async function() { - await setup.runGreenwoodCommand('build'); - }); - - runSmokeTest(['public', 'not-found'], LABEL); - - describe('Blog Page (Template) w/ custom date', function() { - beforeEach(async function() { - dom = await JSDOM.fromFile(path.resolve(this.context.publicDir, 'blog', 'first-post', 'index.html')); - }); - - it('should output an index.html file (first post page)', function() { - expect(fs.existsSync(path.join(this.context.publicDir, 'blog', 'first-post', 'index.html'))).to.be.true; - }); - - it('should output a (partial) *-cache.json file, one per each query made', async function() { - expect(await glob.promise(path.join(this.context.publicDir, './*-cache.json'))).to.have.lengthOf(3); - }); - - it('should output a (partial) *-cache.json files, one per each query made, that are all defined', async function() { - const cacheFiles = await glob.promise(path.join(this.context.publicDir, './*-cache.json')); - - cacheFiles.forEach(file => { - const cache = require(file); - - expect(cache).to.not.be.undefined; - }); - }); - - it('should have one + + + + + + + \ No newline at end of file diff --git a/packages/plugin-graphql/test/cases/query-graph/query-graph.spec.js b/packages/plugin-graphql/test/cases/query-graph/query-graph.spec.js index 791c81a47..20aec9cbc 100644 --- a/packages/plugin-graphql/test/cases/query-graph/query-graph.spec.js +++ b/packages/plugin-graphql/test/cases/query-graph/query-graph.spec.js @@ -92,7 +92,7 @@ describe('Build Greenwood With: ', function() { await setup.runGreenwoodCommand('build'); }); - describe('Home (Page Template) output w/ GraphQuery', function() { + describe('Home Page output w/ GraphQuery', function() { beforeEach(async function() { dom = await JSDOM.fromFile(path.resolve(this.context.publicDir, 'index.html')); diff --git a/packages/plugin-graphql/test/cases/query-menu/query-menu.spec.js b/packages/plugin-graphql/test/cases/query-menu/query-menu.spec.js index d2cda496a..a8077a54a 100644 --- a/packages/plugin-graphql/test/cases/query-menu/query-menu.spec.js +++ b/packages/plugin-graphql/test/cases/query-menu/query-menu.spec.js @@ -94,7 +94,7 @@ describe('Build Greenwood With: ', function() { await setup.runGreenwoodCommand('build'); }); - describe('Home (Page Template) navigation w/ MenuQuery', function() { + describe('Home Page navigation w/ MenuQuery', function() { beforeEach(async function() { dom = await JSDOM.fromFile(path.resolve(this.context.publicDir, 'index.html')); From efbb1c929d8ef12b852315c2b1a99152aad011c5 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sun, 14 Mar 2021 12:35:19 -0400 Subject: [PATCH 27/29] restore docs --- packages/plugin-graphql/README.md | 53 ++++++++- packages/plugin-graphql/package.json | 3 +- www/pages/docs/data.md | 164 +++++++++++++++++---------- www/pages/docs/front-matter.md | 4 +- www/pages/docs/menus.md | 39 +++---- 5 files changed, 172 insertions(+), 91 deletions(-) diff --git a/packages/plugin-graphql/README.md b/packages/plugin-graphql/README.md index f693e87b9..4c245d3e1 100644 --- a/packages/plugin-graphql/README.md +++ b/packages/plugin-graphql/README.md @@ -1,7 +1,7 @@ # @greenwood/plugin-graphl ## Overview -A plugin for Greenwood for using GraphQL to query your content within your application. +A plugin for Greenwood to support using [GraphQL](https://graphql.org/) to query your content graph. It runs [**apollo-server**](https://www.apollographql.com/docs/apollo-server/) on the backend and provides an [**@apollo/client** like](https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.readQuery) interface for the frontend. > This package assumes you already have `@greenwood/cli` installed. @@ -32,6 +32,53 @@ module.exports = { } ``` -This will then allow you to use a query your content using GraphQL. +## Example +This will then allow you to use GraphQL to query your content. -TODO \ No newline at end of file +```js +import client from '@greenwood/plugin-graphql/core/client'; +import MenuQuery from '@greenwood/plugin-graphql/queries/menu'; + +class HeaderComponent extends HTMLElement { + constructor() { + super(); + + this.root = this.attachShadow({ mode: 'open' }); + } + + connectedCallback() { + const response = await client.query({ + query: MenuQuery, + variables: { + name: 'navigation', + order: 'index_asc' + } + }); + + this.navigation = response.data.menu.children.map(item => item.item); + this.root.innerHTML = this.getTemplate(navigation); + } + + getTemplate(navigation) { + const navigationList = navigation.map((menuItem) => { + return ` +
    • + ${menuItem.label} +
    • + `; + }).join(); + + return ` +
      + +
      + `; + } +} +``` + +> _For more information on using GraphQL with Greenwood, [please review our docs](https://www.greenwoodjs.io/docs/data)._ \ No newline at end of file diff --git a/packages/plugin-graphql/package.json b/packages/plugin-graphql/package.json index 66dbc26e7..bf03e278c 100644 --- a/packages/plugin-graphql/package.json +++ b/packages/plugin-graphql/package.json @@ -9,7 +9,8 @@ "Greenwood", "GraphQL", "Static Site Generator", - "NodeJS" + "NodeJS", + "Apollo" ], "main": "src/index.js", "files": [ diff --git a/www/pages/docs/data.md b/www/pages/docs/data.md index a05bb55b0..501346c3c 100644 --- a/www/pages/docs/data.md +++ b/www/pages/docs/data.md @@ -9,14 +9,11 @@ linkheadings: 3 ## Data Sources -> ⛔ [_**Coming Soon!**_](https://github.com/ProjectEvergreen/greenwood/issues/278) - - \ No newline at end of file +Coming [soon](https://github.com/ProjectEvergreen/greenwood/issues/21)! \ No newline at end of file diff --git a/www/pages/docs/front-matter.md b/www/pages/docs/front-matter.md index 91bcec3b7..2ca026b6d 100644 --- a/www/pages/docs/front-matter.md +++ b/www/pages/docs/front-matter.md @@ -84,7 +84,7 @@ In this example, the `` tag will be the `title`. ### Custom Data -You can also pass custom data from your markdown file and extract that through the GraphQL server. +You can also pass custom data from your markdown file and extract that from Greenwood's [_graph.json_ via `fetch` or our GraphQL server](/docs/data/). #### Example @@ -107,4 +107,4 @@ query { } ``` -> See [our docs](https://deploy-preview-284--elastic-blackwell-3aef44.netlify.com/docs/data#internal-sources) on using GraphQL w/Greenwood for more information on querying for data. \ No newline at end of file +> See [our docs](/docs/data#internal-sources) on using GraphQL w/Greenwood for more information on querying for data. \ No newline at end of file diff --git a/www/pages/docs/menus.md b/www/pages/docs/menus.md index 045d222a7..8e0a6d79c 100644 --- a/www/pages/docs/menus.md +++ b/www/pages/docs/menus.md @@ -8,10 +8,7 @@ linkheadings: 3 ## Menus -> ⛔ [_**Coming Soon!**_](https://github.com/ProjectEvergreen/greenwood/issues/278) - -<!-- -In this section we'll touch on the menu related feature of Greenwood which utilizes [data sources](/docs/data) within a component to query for [front matter](/docs/front-matter) declared menus. +In this section we'll touch on the menu related feature of Greenwood which utilizes [data sources](/docs/data/) within a component to query for [front matter](/docs/front-matter/) declared menus. ### Declare Menu @@ -78,14 +75,14 @@ linkheadings: 3 ### Retrieve Menu -Now in order to use our navigation menu within a component we need to query it via GraphQL, see [data sources](/docs/data) for more information. +Now in order to use our navigation menu within a component we need to query it via GraphQL. `navigation.js` ```js import { LitElement, html } from 'lit-element'; -import client from '@greenwood/cli/data/client'; -import MenuQuery from '@greenwood/cli/data/queries/menu'; +import client from '@greenwood/plugin-graphql/core/client'; +import MenuQuery from '@greenwood/plugin-graphql/queries/menu'; class HeaderComponent extends LitElement { @@ -104,7 +101,7 @@ class HeaderComponent extends LitElement { } }); - this.navigation = response.data.menu.children; + this.navigation = response.data.menu.children.map(item => item.item); } render() { @@ -115,7 +112,7 @@ class HeaderComponent extends LitElement { <ul> ${navigation.map(({ item }) => { return html` - <li><a href='${item.link}' title='Click to visit the ${item.label} page'>${item.label}</a></li> + <li><a href='${item.route}' title='Click to visit the ${item.label} page'>${item.label}</a></li> `; })} </ul> @@ -123,7 +120,7 @@ class HeaderComponent extends LitElement { `; } } -customElements.define('eve-header', HeaderComponent); +customElements.define('app-header', HeaderComponent); ``` ### Query Result @@ -134,22 +131,22 @@ menu: { children:[ { children: [ - { item: {label: "Online", link: "#online"}}, - { item: {label: "Offline", link: "#offline"}}, - { item: {label: "Locations", link: "#locations"}}, + { item: {label: "Online", route: "#online"}}, + { item: {label: "Offline", route: "#offline"}}, + { item: {label: "Locations", route: "#locations"}}, ], - item: {label: "Contact", link: "/mydirectory/contact"} + item: {label: "Contact", route: "/mydirectory/contact"} }, { children: [] - item: {label: "Docs", link: "/mydirectory/docs"} + item: {label: "Docs", route: "/mydirectory/docs"} }, { children: [] - item: {label: "About", link: "/mydirectory/"} + item: {label: "About", route: "/mydirectory/"} } ], - item: {label: "navigation", link: "na"} + item: {label: "navigation", route: "na"} ] ``` @@ -264,11 +261,11 @@ The object result for `/docs` is: "menu":{ "item": {"label": "shelf", "link": "na"}, "children":[{ - "item":{"label":"Components","link":"/docs/components"}, + "item":{"label":"Components","route":"/docs/components"}, "children":[] }, { - "item":{"label":"Docs","link":"/docs/""}, + "item":{"label":"Docs","route":"/docs/"}, "children":[] } ] @@ -290,6 +287,4 @@ The object result for `/about` is: } ] } -``` - ---> \ No newline at end of file +``` \ No newline at end of file From 74b657a7df1e49cb126e6ce0b4918aa747be81a3 Mon Sep 17 00:00:00 2001 From: Owen Buckley <owenbuckley13@gmail.com> Date: Sun, 14 Mar 2021 18:38:28 -0400 Subject: [PATCH 28/29] remove example config query --- www/components/header/header.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/www/components/header/header.js b/www/components/header/header.js index 9d6b3a596..c069ad7cd 100644 --- a/www/components/header/header.js +++ b/www/components/header/header.js @@ -1,14 +1,11 @@ import { css, html, LitElement, unsafeCSS } from 'lit-element'; import client from '@greenwood/plugin-graphql/core/client'; import MenuQuery from '@greenwood/plugin-graphql/queries/menu'; -import ConfigQuery from '@greenwood/plugin-graphql/queries/config'; import '@evergreen-wc/eve-container'; import headerCss from './header.css'; // TODO import evergreenLogo from '../../assets/evergreen.svg'; import '../social-icons/social-icons.js'; -console.debug('ConfigQuery', ConfigQuery); - class HeaderComponent extends LitElement { static get properties() { From 6164d82ec2a787541299becea35944c4d192c7e8 Mon Sep 17 00:00:00 2001 From: Owen Buckley <owenbuckley13@gmail.com> Date: Thu, 18 Mar 2021 20:09:42 -0400 Subject: [PATCH 29/29] delete commented out code --- packages/plugin-graphql/src/core/cache.js | 4 -- packages/plugin-graphql/src/core/client.js | 38 +------------------ .../plugin-graphql/src/core/common.client.js | 25 +----------- .../plugin-graphql/src/core/common.server.js | 25 +----------- packages/plugin-graphql/src/index.js | 26 ------------- 5 files changed, 3 insertions(+), 115 deletions(-) diff --git a/packages/plugin-graphql/src/core/cache.js b/packages/plugin-graphql/src/core/cache.js index f2ca13ee2..029a99c74 100644 --- a/packages/plugin-graphql/src/core/cache.js +++ b/packages/plugin-graphql/src/core/cache.js @@ -19,8 +19,6 @@ module.exports = async (req, context) => { /* Take the same query from request, and repeat the query for our server side cache */ const { query, variables } = req.body; - // const queryObj = gql`${query}`; - const { data } = await client.query({ query: gql`${query}`, variables @@ -28,8 +26,6 @@ module.exports = async (req, context) => { if (data) { const { outputDir } = context; - - // const cache = JSON.stringify(client.extract()); const cache = JSON.stringify(data); const queryHash = getQueryHash(query, variables); const hashFilename = `${queryHash}-cache.json`; diff --git a/packages/plugin-graphql/src/core/client.js b/packages/plugin-graphql/src/core/client.js index 787ed9cef..b968ce87d 100644 --- a/packages/plugin-graphql/src/core/client.js +++ b/packages/plugin-graphql/src/core/client.js @@ -40,40 +40,4 @@ client.query = (params) => { } }; -export default client; - -// import { ApolloClient } from 'apollo-client'; -// import { InMemoryCache } from 'apollo-cache-inmemory'; -// import { HttpLink } from 'apollo-link-http'; -// import { getQueryHash } from '@greenwood/cli/data/common'; - -// const APOLLO_STATE = window.__APOLLO_STATE__; // eslint-disable-line no-underscore-dangle -// const client = new ApolloClient({ -// cache: new InMemoryCache(), -// link: new HttpLink({ -// uri: 'http://localhost:4000' -// }) -// }); -// const backupQuery = client.query; - -// client.query = (params) => { -// if (APOLLO_STATE) { -// __APOLLO_STATE__ defined, in production mode -// const queryHash = getQueryHash(params.query, params.variables); -// const cachePath = `/${queryHash}-cache.json`; - -// return fetch(cachePath) -// .then(response => response.json()) -// .then((response) => { -// // mock client.query response -// return { -// data: new InMemoryCache().restore(response).readQuery(params) -// }; -// }); -// } else { -// // __APOLLO_STATE__ NOT defined, in development mode -// return backupQuery(params); -// } -// }; - -// export default client; \ No newline at end of file +export default client; \ No newline at end of file diff --git a/packages/plugin-graphql/src/core/common.client.js b/packages/plugin-graphql/src/core/common.client.js index bc3d95f44..aa46cb316 100644 --- a/packages/plugin-graphql/src/core/common.client.js +++ b/packages/plugin-graphql/src/core/common.client.js @@ -9,31 +9,8 @@ function hashString(queryKeysString) { return Math.abs(h).toString(); } -// function getQueryKeysFromSelectionSet(selectionSet) { -// let queryKeys = ''; - -// for (let key in selectionSet) { - -// if (key === 'selections') { -// queryKeys += selectionSet[key] -// .filter(selection => selection.name.value !== '__typename') // __typename is added by server.js -// .map(selection => selection.name.value).join(''); -// } -// } - -// if (selectionSet.kind === 'SelectionSet') { -// selectionSet.selections.forEach(selection => { -// if (selection.selectionSet) { -// queryKeys += getQueryKeysFromSelectionSet(selection.selectionSet); -// } -// }); -// } - -// return queryKeys; -// } - function getQueryHash(query, variables = {}) { - const queryKeys = query; // getQueryKeysFromSelectionSet(query.definitions[0].selectionSet); + const queryKeys = query; const variableValues = Object.keys(variables).length > 0 ? `_${Object.values(variables).join('').replace(/\//g, '')}` // handle / which will translate to filepaths : ''; diff --git a/packages/plugin-graphql/src/core/common.server.js b/packages/plugin-graphql/src/core/common.server.js index 565f01162..85026762e 100644 --- a/packages/plugin-graphql/src/core/common.server.js +++ b/packages/plugin-graphql/src/core/common.server.js @@ -9,31 +9,8 @@ function hashString(queryKeysString) { return Math.abs(h).toString(); } -// function getQueryKeysFromSelectionSet(selectionSet) { -// let queryKeys = ''; - -// for (let key in selectionSet) { - -// if (key === 'selections') { -// queryKeys += selectionSet[key] -// .filter(selection => selection.name.value !== '__typename') // __typename is added by server.js -// .map(selection => selection.name.value).join(''); -// } -// } - -// if (selectionSet.kind === 'SelectionSet') { -// selectionSet.selections.forEach(selection => { -// if (selection.selectionSet) { -// queryKeys += getQueryKeysFromSelectionSet(selection.selectionSet); -// } -// }); -// } - -// return queryKeys; -// } - function getQueryHash(query, variables = {}) { - const queryKeys = query; // getQueryKeysFromSelectionSet(query.definitions[0].selectionSet); + const queryKeys = query; const variableValues = Object.keys(variables).length > 0 ? `_${Object.values(variables).join('').replace(/\//g, '')}` // handle / which will translate to filepaths : ''; diff --git a/packages/plugin-graphql/src/index.js b/packages/plugin-graphql/src/index.js index f74982cf4..fd93d0955 100644 --- a/packages/plugin-graphql/src/index.js +++ b/packages/plugin-graphql/src/index.js @@ -1,6 +1,5 @@ const fs = require('fs'); const graphqlServer = require('./core/server'); -// const gql = require('graphql-tag'); const path = require('path'); const { ResourceInterface } = require('@greenwood/cli/src/lib/resource-interface'); const { ServerInterface } = require('@greenwood/cli/src/lib/server-interface'); @@ -17,10 +16,6 @@ class GraphQLResource extends ResourceInterface { return new Promise(async (resolve, reject) => { try { const js = await fs.promises.readFile(url, 'utf-8'); - // const gqlJs = gql`${js}`; - // const body = ` - // export default ${JSON.stringify(gqlJs)}; - // `; const body = ` export default \`${js}\`; `; @@ -39,27 +34,6 @@ class GraphQLResource extends ResourceInterface { return Promise.resolve(headers.request.accept && headers.request.accept.indexOf('text/html') >= 0); } - // "apollo-client": "/node_modules/apollo-client/bundle.esm.js", - // "apollo-cache-inmemory": "/node_modules/apollo-cache-inmemory/lib/bundle.esm.js", - // "apollo-link-http": "/node_modules/apollo-link-http/lib/bundle.esm.js", - // "apollo-utilities": "/node_modules/apollo-utilities/lib/bundle.esm.js", - // "apollo-link": "/node_modules/apollo-link/lib/bundle.esm.js", - // "apollo-cache": "/node_modules/apollo-cache/lib/bundle.esm.js", - // "apollo-link-http-common": "/node_modules/apollo-link-http-common/lib/bundle.esm.js", - // "optimism": "/node_modules/optimism/lib/bundle.esm.js", - // "tslib": "/node_modules/tslib/tslib.es6.js", - // "symbol-observable": "/node_modules/symbol-observable/es/index.js", - // "ts-invariant": "/node_modules/ts-invariant/lib/invariant.esm.js", - // "@wry/context": "/node_modules/@wry/context/lib/context.esm.js", - // "@wry/equality": "/node_modules/@wry/equality/lib/equality.esm.js", - // "graphql/jsutils/inspect": "/node_modules/graphql/jsutils/inspect.mjs", - // "graphql/language/visitor": "/node_modules/graphql/language/visitor.mjs", - // "graphql/language/parser": "/node_modules/graphql/language/parser.mjs", - // "graphql/language/printer": "/node_modules/graphql/language/printer.mjs", - // "zen-observable": "/node_modules/zen-observable/esm.js", - // "zen-observable-ts": "/node_modules/zen-observable-ts/lib/bundle.esm.js", - // "fast-json-stable-stringify": "/node_modules/fast-json-stable-stringify/index.js", - // "graphql-tag": "/node_modules/graphql-tag/src/index.js", async intercept(url, body) { return new Promise(async (resolve, reject) => { try {