From de10cebe4f57f197e853fd40b4dab910c608a91f Mon Sep 17 00:00:00 2001 From: Alex Ni <12097569+nialexsan@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:23:59 -0400 Subject: [PATCH] update packages and migrate code --- package-lock.json | 639 +++++++++--------- package.json | 12 +- src/api/apollo/client.ts | 27 +- src/api/apollo/resolvers.ts | 10 +- src/components/AccountAvatars.tsx | 2 +- .../CadenceEditor/ControlPanel/index.tsx | 7 +- .../Editor/FileExplorer/MenuList.tsx | 1 - src/providers/Project/index.tsx | 20 +- src/providers/Project/projectHooks.ts | 25 +- src/providers/Project/projectMutator.ts | 56 +- src/types.ts | 1 - 11 files changed, 414 insertions(+), 386 deletions(-) diff --git a/package-lock.json b/package-lock.json index fb85748f..87b45001 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,8 @@ "": { "name": "flow-playground", "dependencies": { - "@apollo/react-hooks": "^3.1.5", + "@apollo/client": "^3.11.8", + "@apollo/react-hooks": "^4.0.0", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@headlessui/react": "^1.7.3", @@ -19,13 +20,8 @@ "@sentry/react": "^7.44.0", "@sentry/tracing": "^7.44.0", "allotment": "^1.17.0", - "apollo-cache-inmemory": "^1.6.6", - "apollo-client": "^2.6.10", - "apollo-link": "^1.2.14", - "apollo-link-debounce": "^2.1.0", - "apollo-link-error": "^1.1.13", - "apollo-link-http": "^1.5.17", - "apollo-link-serialize": "^2.1.0", + "apollo-link-debounce": "^3.0.0", + "apollo-link-serialize": "^4.0.0", "cross-fetch": "^3.1.5", "date-fns": "^2.29.3", "detect-browser": "^5.3.0", @@ -125,24 +121,130 @@ "node": ">=6.0.0" } }, - "node_modules/@apollo/react-common": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@apollo/react-common/-/react-common-3.1.4.tgz", - "integrity": "sha512-X5Kyro73bthWSCBJUC5XYQqMnG0dLWuDZmVkzog9dynovhfiVCV4kPSdgSIkqnb++cwCzOVuQ4rDKVwo2XRzQA==", + "node_modules/@apollo/client": { + "version": "3.11.8", + "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.11.8.tgz", + "integrity": "sha512-CgG1wbtMjsV2pRGe/eYITmV5B8lXUCYljB2gB/6jWTFQcrvirUVvKg7qtFdjYkQSFbIffU1IDyxgeaN81eTjbA==", + "dependencies": { + "@graphql-typed-document-node/core": "^3.1.1", + "@wry/caches": "^1.0.0", + "@wry/equality": "^0.5.6", + "@wry/trie": "^0.5.0", + "graphql-tag": "^2.12.6", + "hoist-non-react-statics": "^3.3.2", + "optimism": "^0.18.0", + "prop-types": "^15.7.2", + "rehackt": "^0.1.0", + "response-iterator": "^0.2.6", + "symbol-observable": "^4.0.0", + "ts-invariant": "^0.10.3", + "tslib": "^2.3.0", + "zen-observable-ts": "^1.2.5" + }, + "peerDependencies": { + "graphql": "^15.0.0 || ^16.0.0", + "graphql-ws": "^5.5.5", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0", + "subscriptions-transport-ws": "^0.9.0 || ^0.11.0" + }, + "peerDependenciesMeta": { + "graphql-ws": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + }, + "subscriptions-transport-ws": { + "optional": true + } + } + }, + "node_modules/@apollo/client/node_modules/@wry/context": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.7.4.tgz", + "integrity": "sha512-jmT7Sb4ZQWI5iyu3lobQxICu2nC/vbUhP0vIdd6tHC9PTfenmRmuIFqktc6GH9cgi+ZHnsLWPvfSvc4DrYmKiQ==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@apollo/client/node_modules/@wry/equality": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.5.7.tgz", + "integrity": "sha512-BRFORjsTuQv5gxcXsuDXx6oGRhuVsEGwZy6LOzRRfgu+eSfxbhUQ9L9YtSEIuIjY/o7g3iWFjrc5eSY1GXP2Dw==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@apollo/client/node_modules/optimism": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.18.0.tgz", + "integrity": "sha512-tGn8+REwLRNFnb9WmcY5IfpOqeX2kpaYJ1s6Ae3mn12AeydLkR3j+jSCmVQFoXqU8D41PAJ1RG1rCRNWmNZVmQ==", "dependencies": { - "ts-invariant": "^0.4.4", - "tslib": "^1.10.0" + "@wry/caches": "^1.0.0", + "@wry/context": "^0.7.0", + "@wry/trie": "^0.4.3", + "tslib": "^2.3.0" + } + }, + "node_modules/@apollo/client/node_modules/optimism/node_modules/@wry/trie": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.4.3.tgz", + "integrity": "sha512-I6bHwH0fSf6RqQcnnXLJKhkSXG45MFral3GxPaY4uAl0LYDZM+YDVDAiU9bYwjTuysy1S0IeecWtmq1SZA3M1w==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@apollo/client/node_modules/symbol-observable": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", + "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/@apollo/client/node_modules/ts-invariant": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz", + "integrity": "sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==", + "dependencies": { + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@apollo/client/node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + }, + "node_modules/@apollo/client/node_modules/zen-observable-ts": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz", + "integrity": "sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==", + "dependencies": { + "zen-observable": "0.8.15" } }, "node_modules/@apollo/react-hooks": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@apollo/react-hooks/-/react-hooks-3.1.5.tgz", - "integrity": "sha512-y0CJ393DLxIIkksRup4nt+vSjxalbZBXnnXxYbviq/woj+zKa431zy0yT4LqyRKpFy9ahMIwxBnBwfwIoupqLQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@apollo/react-hooks/-/react-hooks-4.0.0.tgz", + "integrity": "sha512-fCu0cbne3gbUl0QbA8X4L33iuuFVQbC5Jo2MIKRK8CyawR6PoxDpFdFA1kc6033ODZuZZ9Eo4RdeJFlFIIYcLA==", "dependencies": { - "@apollo/react-common": "^3.1.4", - "@wry/equality": "^0.1.9", - "ts-invariant": "^0.4.4", - "tslib": "^1.10.0" + "@apollo/client": "latest" } }, "node_modules/@ardatan/aggregate-error": { @@ -3998,7 +4100,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", - "dev": true, "peerDependencies": { "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } @@ -5675,7 +5776,8 @@ "node_modules/@types/node": { "version": "16.18.46", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", - "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==", + "dev": true }, "node_modules/@types/parse-json": { "version": "4.0.0", @@ -5865,11 +5967,6 @@ "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", "dev": true }, - "node_modules/@types/zen-observable": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.1.tgz", - "integrity": "sha512-wmk0xQI6Yy7Fs/il4EpOcflG4uonUpYGqvZARESLc2oy4u69fkatFLbJOeW4Q6awO15P4rduAe6xkwHevpXcUQ==" - }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "5.38.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.38.0.tgz", @@ -6357,23 +6454,38 @@ "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", "dev": true }, - "node_modules/@wry/context": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.4.4.tgz", - "integrity": "sha512-LrKVLove/zw6h2Md/KZyWxIkFM6AoyKp71OqpH9Hiip1csjPVoD3tPxlbQUNxEnHENks3UGgNpSBCAfq9KWuag==", + "node_modules/@wry/caches": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@wry/caches/-/caches-1.0.1.tgz", + "integrity": "sha512-bXuaUNLVVkD20wcGBWRyo7j9N3TxePEWFZj2Y+r9OoUzfqmavM84+mFykRicNsBqatba5JLay1t48wxaXaWnlA==", "dependencies": { - "@types/node": ">=6", - "tslib": "^1.9.3" + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/@wry/equality": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.1.11.tgz", - "integrity": "sha512-mwEVBDUVODlsQQ5dfuLUS5/Tf7jqUKyhKYHmVi4fPB6bDMOfWvUPJmKgS1Z7Za/sOI3vzWt4+O7yCiL/70MogA==", + "node_modules/@wry/caches/node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + }, + "node_modules/@wry/trie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.5.0.tgz", + "integrity": "sha512-FNoYzHawTMk/6KMQoEG5O4PuioX19UbwdQKF44yw0nLfOypfQdjtfZzo/UIJWAJ23sNIFbD1Ug9lbaDGMwbqQA==", "dependencies": { - "tslib": "^1.9.3" + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" } }, + "node_modules/@wry/trie/node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -6608,112 +6720,23 @@ "node": ">= 8" } }, - "node_modules/apollo-cache": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/apollo-cache/-/apollo-cache-1.3.5.tgz", - "integrity": "sha512-1XoDy8kJnyWY/i/+gLTEbYLnoiVtS8y7ikBr/IfmML4Qb+CM7dEEbIUOjnY716WqmZ/UpXIxTfJsY7rMcqiCXA==", - "dependencies": { - "apollo-utilities": "^1.3.4", - "tslib": "^1.10.0" - } - }, - "node_modules/apollo-cache-inmemory": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/apollo-cache-inmemory/-/apollo-cache-inmemory-1.6.6.tgz", - "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" - } - }, - "node_modules/apollo-client": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/apollo-client/-/apollo-client-2.6.10.tgz", - "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" - } - }, - "node_modules/apollo-link": { - "version": "1.2.14", - "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.2.14.tgz", - "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" - } - }, "node_modules/apollo-link-debounce": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/apollo-link-debounce/-/apollo-link-debounce-2.1.0.tgz", - "integrity": "sha512-tpAb3558SoZVKL8Y5N1pyrw4ko9eYWGpveKCp1fjfDz8bA4977fyfR4OZdrxwBtTjhYf5wNq2N9YTtKaq3OZIg==", - "dependencies": { - "apollo-link": "^1.2.2", - "zen-observable-ts": "^0.8.9" - } - }, - "node_modules/apollo-link-error": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/apollo-link-error/-/apollo-link-error-1.1.13.tgz", - "integrity": "sha512-jAZOOahJU6bwSqb2ZyskEK1XdgUY9nkmeclCrW7Gddh1uasHVqmoYc4CKdb0/H0Y1J9lvaXKle2Wsw/Zx1AyUg==", - "dependencies": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - } - }, - "node_modules/apollo-link-http": { - "version": "1.5.17", - "resolved": "https://registry.npmjs.org/apollo-link-http/-/apollo-link-http-1.5.17.tgz", - "integrity": "sha512-uWcqAotbwDEU/9+Dm9e1/clO7hTB2kQ/94JYcGouBVLjoKmTeJTUPQKcJGpPwUjZcSqgYicbFqQSoJIW0yrFvg==", - "dependencies": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - } - }, - "node_modules/apollo-link-http-common": { - "version": "0.2.16", - "resolved": "https://registry.npmjs.org/apollo-link-http-common/-/apollo-link-http-common-0.2.16.tgz", - "integrity": "sha512-2tIhOIrnaF4UbQHf7kjeQA/EmSorB7+HyJIIrUjJOKBgnXwuexi8aMecRlqTIDWcyVXCeqLhUnztMa6bOH/jTg==", - "dependencies": { - "apollo-link": "^1.2.14", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/apollo-link-debounce/-/apollo-link-debounce-3.0.0.tgz", + "integrity": "sha512-Ytig2Ml41T2bovBIoKkStPKoIh0r/kTK1dSM9Gpvo5W3BAPxt1WguAkeaPLJqeuvrNJIjQ/Pl38/14VVA0hdYg==", + "peerDependencies": { + "@apollo/client": "^3.0.0" } }, "node_modules/apollo-link-serialize": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/apollo-link-serialize/-/apollo-link-serialize-2.1.0.tgz", - "integrity": "sha512-JkTs63KdQe+8ttBInv6G+vI/Nv3CwW1gsbv6hLkf6Cb+I0s+P+upOze0mUWJeMCrbxXhHw99s7tG+jqbRSLdCw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/apollo-link-serialize/-/apollo-link-serialize-4.0.0.tgz", + "integrity": "sha512-GQJkwj1Fm/OQyte5+y64GsWBIL89AaALlJGc4plMzTttfMxMREXIttXdaP4BzU5xvC/PwVP0khKS/5CbEX8pjw==", "dependencies": { - "apollo-link": "^1.2.4", + "@apollo/client": "^3.3.20", "zen-observable-ts": "^0.8.11" } }, - "node_modules/apollo-utilities": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.3.4.tgz", - "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" - } - }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -9818,7 +9841,8 @@ "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, "node_modules/fast-levenshtein": { "version": "2.0.6", @@ -10497,7 +10521,7 @@ "version": "5.12.1", "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.12.1.tgz", "integrity": "sha512-umt4f5NnMK46ChM2coO36PTFhHouBrK9stWWBczERguwYrGnPNxJ9dimU6IyOBfOkC6Izhkg4H8+F51W/8CYDg==", - "dev": true, + "devOptional": true, "engines": { "node": ">=10" }, @@ -14443,14 +14467,6 @@ "opener": "bin/opener-bin.js" } }, - "node_modules/optimism": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.10.3.tgz", - "integrity": "sha512-9A5pqGoQk49H6Vhjb9kPgAeeECfUDF6aIICbMDL23kDLStBn1MWk3YvcZ4xWF9CsSf6XEgvRLkXy4xof/56vVw==", - "dependencies": { - "@wry/context": "^0.4.0" - } - }, "node_modules/ora": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", @@ -15464,6 +15480,23 @@ "jsesc": "bin/jsesc" } }, + "node_modules/rehackt": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/rehackt/-/rehackt-0.1.0.tgz", + "integrity": "sha512-7kRDOuLHB87D/JESKxQoRwv4DzbIdwkAGQ7p6QKGdVlY1IZheUnVhlk/4UZlNUVxdAXpyxikE3URsG067ybVzw==", + "peerDependencies": { + "@types/react": "*", + "react": "*" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "react": { + "optional": true + } + } + }, "node_modules/relateurl": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", @@ -15599,6 +15632,14 @@ "node": ">=10" } }, + "node_modules/response-iterator": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/response-iterator/-/response-iterator-0.2.6.tgz", + "integrity": "sha512-pVzEEzrsg23Sh053rmDUvLSkGXluZio0qu8VT6ukrYuvtjVfCbDZH9d6PGXb8HZfzdNZt8feXv/jvUzlhRgLnw==", + "engines": { + "node": ">=0.8" + } + }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -16589,14 +16630,6 @@ "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", "dev": true }, - "node_modules/symbol-observable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", - "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -16851,14 +16884,6 @@ "tree-kill": "cli.js" } }, - "node_modules/ts-invariant": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.4.4.tgz", - "integrity": "sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA==", - "dependencies": { - "tslib": "^1.9.3" - } - }, "node_modules/ts-loader": { "version": "9.4.1", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.1.tgz", @@ -18340,24 +18365,98 @@ "@jridgewell/trace-mapping": "^0.3.9" } }, - "@apollo/react-common": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@apollo/react-common/-/react-common-3.1.4.tgz", - "integrity": "sha512-X5Kyro73bthWSCBJUC5XYQqMnG0dLWuDZmVkzog9dynovhfiVCV4kPSdgSIkqnb++cwCzOVuQ4rDKVwo2XRzQA==", + "@apollo/client": { + "version": "3.11.8", + "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.11.8.tgz", + "integrity": "sha512-CgG1wbtMjsV2pRGe/eYITmV5B8lXUCYljB2gB/6jWTFQcrvirUVvKg7qtFdjYkQSFbIffU1IDyxgeaN81eTjbA==", "requires": { - "ts-invariant": "^0.4.4", - "tslib": "^1.10.0" + "@graphql-typed-document-node/core": "^3.1.1", + "@wry/caches": "^1.0.0", + "@wry/equality": "^0.5.6", + "@wry/trie": "^0.5.0", + "graphql-tag": "^2.12.6", + "hoist-non-react-statics": "^3.3.2", + "optimism": "^0.18.0", + "prop-types": "^15.7.2", + "rehackt": "^0.1.0", + "response-iterator": "^0.2.6", + "symbol-observable": "^4.0.0", + "ts-invariant": "^0.10.3", + "tslib": "^2.3.0", + "zen-observable-ts": "^1.2.5" + }, + "dependencies": { + "@wry/context": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.7.4.tgz", + "integrity": "sha512-jmT7Sb4ZQWI5iyu3lobQxICu2nC/vbUhP0vIdd6tHC9PTfenmRmuIFqktc6GH9cgi+ZHnsLWPvfSvc4DrYmKiQ==", + "requires": { + "tslib": "^2.3.0" + } + }, + "@wry/equality": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.5.7.tgz", + "integrity": "sha512-BRFORjsTuQv5gxcXsuDXx6oGRhuVsEGwZy6LOzRRfgu+eSfxbhUQ9L9YtSEIuIjY/o7g3iWFjrc5eSY1GXP2Dw==", + "requires": { + "tslib": "^2.3.0" + } + }, + "optimism": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.18.0.tgz", + "integrity": "sha512-tGn8+REwLRNFnb9WmcY5IfpOqeX2kpaYJ1s6Ae3mn12AeydLkR3j+jSCmVQFoXqU8D41PAJ1RG1rCRNWmNZVmQ==", + "requires": { + "@wry/caches": "^1.0.0", + "@wry/context": "^0.7.0", + "@wry/trie": "^0.4.3", + "tslib": "^2.3.0" + }, + "dependencies": { + "@wry/trie": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.4.3.tgz", + "integrity": "sha512-I6bHwH0fSf6RqQcnnXLJKhkSXG45MFral3GxPaY4uAl0LYDZM+YDVDAiU9bYwjTuysy1S0IeecWtmq1SZA3M1w==", + "requires": { + "tslib": "^2.3.0" + } + } + } + }, + "symbol-observable": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", + "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==" + }, + "ts-invariant": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz", + "integrity": "sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==", + "requires": { + "tslib": "^2.1.0" + } + }, + "tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + }, + "zen-observable-ts": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz", + "integrity": "sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==", + "requires": { + "zen-observable": "0.8.15" + } + } } }, "@apollo/react-hooks": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@apollo/react-hooks/-/react-hooks-3.1.5.tgz", - "integrity": "sha512-y0CJ393DLxIIkksRup4nt+vSjxalbZBXnnXxYbviq/woj+zKa431zy0yT4LqyRKpFy9ahMIwxBnBwfwIoupqLQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@apollo/react-hooks/-/react-hooks-4.0.0.tgz", + "integrity": "sha512-fCu0cbne3gbUl0QbA8X4L33iuuFVQbC5Jo2MIKRK8CyawR6PoxDpFdFA1kc6033ODZuZZ9Eo4RdeJFlFIIYcLA==", "requires": { - "@apollo/react-common": "^3.1.4", - "@wry/equality": "^0.1.9", - "ts-invariant": "^0.4.4", - "tslib": "^1.10.0" + "@apollo/client": "latest" } }, "@ardatan/aggregate-error": { @@ -21328,7 +21427,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", - "dev": true, "requires": {} }, "@headlessui/react": { @@ -22744,7 +22842,8 @@ "@types/node": { "version": "16.18.46", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", - "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==", + "dev": true }, "@types/parse-json": { "version": "4.0.0", @@ -22934,11 +23033,6 @@ "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", "dev": true }, - "@types/zen-observable": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.1.tgz", - "integrity": "sha512-wmk0xQI6Yy7Fs/il4EpOcflG4uonUpYGqvZARESLc2oy4u69fkatFLbJOeW4Q6awO15P4rduAe6xkwHevpXcUQ==" - }, "@typescript-eslint/eslint-plugin": { "version": "5.38.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.38.0.tgz", @@ -23300,21 +23394,34 @@ } } }, - "@wry/context": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.4.4.tgz", - "integrity": "sha512-LrKVLove/zw6h2Md/KZyWxIkFM6AoyKp71OqpH9Hiip1csjPVoD3tPxlbQUNxEnHENks3UGgNpSBCAfq9KWuag==", + "@wry/caches": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@wry/caches/-/caches-1.0.1.tgz", + "integrity": "sha512-bXuaUNLVVkD20wcGBWRyo7j9N3TxePEWFZj2Y+r9OoUzfqmavM84+mFykRicNsBqatba5JLay1t48wxaXaWnlA==", "requires": { - "@types/node": ">=6", - "tslib": "^1.9.3" + "tslib": "^2.3.0" + }, + "dependencies": { + "tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + } } }, - "@wry/equality": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.1.11.tgz", - "integrity": "sha512-mwEVBDUVODlsQQ5dfuLUS5/Tf7jqUKyhKYHmVi4fPB6bDMOfWvUPJmKgS1Z7Za/sOI3vzWt4+O7yCiL/70MogA==", + "@wry/trie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.5.0.tgz", + "integrity": "sha512-FNoYzHawTMk/6KMQoEG5O4PuioX19UbwdQKF44yw0nLfOypfQdjtfZzo/UIJWAJ23sNIFbD1Ug9lbaDGMwbqQA==", "requires": { - "tslib": "^1.9.3" + "tslib": "^2.3.0" + }, + "dependencies": { + "tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + } } }, "@xtuc/ieee754": { @@ -23494,112 +23601,21 @@ "picomatch": "^2.0.4" } }, - "apollo-cache": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/apollo-cache/-/apollo-cache-1.3.5.tgz", - "integrity": "sha512-1XoDy8kJnyWY/i/+gLTEbYLnoiVtS8y7ikBr/IfmML4Qb+CM7dEEbIUOjnY716WqmZ/UpXIxTfJsY7rMcqiCXA==", - "requires": { - "apollo-utilities": "^1.3.4", - "tslib": "^1.10.0" - } - }, - "apollo-cache-inmemory": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/apollo-cache-inmemory/-/apollo-cache-inmemory-1.6.6.tgz", - "integrity": "sha512-L8pToTW/+Xru2FFAhkZ1OA9q4V4nuvfoPecBM34DecAugUZEBhI2Hmpgnzq2hTKZ60LAMrlqiASm0aqAY6F8/A==", - "requires": { - "apollo-cache": "^1.3.5", - "apollo-utilities": "^1.3.4", - "optimism": "^0.10.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - } - }, - "apollo-client": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/apollo-client/-/apollo-client-2.6.10.tgz", - "integrity": "sha512-jiPlMTN6/5CjZpJOkGeUV0mb4zxx33uXWdj/xQCfAMkuNAC3HN7CvYDyMHHEzmcQ5GV12LszWoQ/VlxET24CtA==", - "requires": { - "@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-link": { - "version": "1.2.14", - "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.2.14.tgz", - "integrity": "sha512-p67CMEFP7kOG1JZ0ZkYZwRDa369w5PIjtMjvrQd/HnIV8FRsHRqLqK+oAZQnFa1DDdZtOtHTi+aMIW6EatC2jg==", - "requires": { - "apollo-utilities": "^1.3.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3", - "zen-observable-ts": "^0.8.21" - } - }, "apollo-link-debounce": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/apollo-link-debounce/-/apollo-link-debounce-2.1.0.tgz", - "integrity": "sha512-tpAb3558SoZVKL8Y5N1pyrw4ko9eYWGpveKCp1fjfDz8bA4977fyfR4OZdrxwBtTjhYf5wNq2N9YTtKaq3OZIg==", - "requires": { - "apollo-link": "^1.2.2", - "zen-observable-ts": "^0.8.9" - } - }, - "apollo-link-error": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/apollo-link-error/-/apollo-link-error-1.1.13.tgz", - "integrity": "sha512-jAZOOahJU6bwSqb2ZyskEK1XdgUY9nkmeclCrW7Gddh1uasHVqmoYc4CKdb0/H0Y1J9lvaXKle2Wsw/Zx1AyUg==", - "requires": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - } - }, - "apollo-link-http": { - "version": "1.5.17", - "resolved": "https://registry.npmjs.org/apollo-link-http/-/apollo-link-http-1.5.17.tgz", - "integrity": "sha512-uWcqAotbwDEU/9+Dm9e1/clO7hTB2kQ/94JYcGouBVLjoKmTeJTUPQKcJGpPwUjZcSqgYicbFqQSoJIW0yrFvg==", - "requires": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - } - }, - "apollo-link-http-common": { - "version": "0.2.16", - "resolved": "https://registry.npmjs.org/apollo-link-http-common/-/apollo-link-http-common-0.2.16.tgz", - "integrity": "sha512-2tIhOIrnaF4UbQHf7kjeQA/EmSorB7+HyJIIrUjJOKBgnXwuexi8aMecRlqTIDWcyVXCeqLhUnztMa6bOH/jTg==", - "requires": { - "apollo-link": "^1.2.14", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/apollo-link-debounce/-/apollo-link-debounce-3.0.0.tgz", + "integrity": "sha512-Ytig2Ml41T2bovBIoKkStPKoIh0r/kTK1dSM9Gpvo5W3BAPxt1WguAkeaPLJqeuvrNJIjQ/Pl38/14VVA0hdYg==", + "requires": {} }, "apollo-link-serialize": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/apollo-link-serialize/-/apollo-link-serialize-2.1.0.tgz", - "integrity": "sha512-JkTs63KdQe+8ttBInv6G+vI/Nv3CwW1gsbv6hLkf6Cb+I0s+P+upOze0mUWJeMCrbxXhHw99s7tG+jqbRSLdCw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/apollo-link-serialize/-/apollo-link-serialize-4.0.0.tgz", + "integrity": "sha512-GQJkwj1Fm/OQyte5+y64GsWBIL89AaALlJGc4plMzTttfMxMREXIttXdaP4BzU5xvC/PwVP0khKS/5CbEX8pjw==", "requires": { - "apollo-link": "^1.2.4", + "@apollo/client": "^3.3.20", "zen-observable-ts": "^0.8.11" } }, - "apollo-utilities": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.3.4.tgz", - "integrity": "sha512-pk2hiWrCXMAy2fRPwEyhvka+mqwzeP60Jr1tRYi5xru+3ko94HI9o6lK0CT33/w4RDlxWchmdhDCrvdr+pHCig==", - "requires": { - "@wry/equality": "^0.1.2", - "fast-json-stable-stringify": "^2.0.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - } - }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -25980,7 +25996,8 @@ "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, "fast-levenshtein": { "version": "2.0.6", @@ -26512,7 +26529,7 @@ "version": "5.12.1", "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.12.1.tgz", "integrity": "sha512-umt4f5NnMK46ChM2coO36PTFhHouBrK9stWWBczERguwYrGnPNxJ9dimU6IyOBfOkC6Izhkg4H8+F51W/8CYDg==", - "dev": true, + "devOptional": true, "requires": {} }, "gud": { @@ -29405,14 +29422,6 @@ "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", "dev": true }, - "optimism": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.10.3.tgz", - "integrity": "sha512-9A5pqGoQk49H6Vhjb9kPgAeeECfUDF6aIICbMDL23kDLStBn1MWk3YvcZ4xWF9CsSf6XEgvRLkXy4xof/56vVw==", - "requires": { - "@wry/context": "^0.4.0" - } - }, "ora": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", @@ -30208,6 +30217,12 @@ } } }, + "rehackt": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/rehackt/-/rehackt-0.1.0.tgz", + "integrity": "sha512-7kRDOuLHB87D/JESKxQoRwv4DzbIdwkAGQ7p6QKGdVlY1IZheUnVhlk/4UZlNUVxdAXpyxikE3URsG067ybVzw==", + "requires": {} + }, "relateurl": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", @@ -30316,6 +30331,11 @@ "integrity": "sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==", "dev": true }, + "response-iterator": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/response-iterator/-/response-iterator-0.2.6.tgz", + "integrity": "sha512-pVzEEzrsg23Sh053rmDUvLSkGXluZio0qu8VT6ukrYuvtjVfCbDZH9d6PGXb8HZfzdNZt8feXv/jvUzlhRgLnw==" + }, "restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -31146,11 +31166,6 @@ } } }, - "symbol-observable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", - "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" - }, "tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -31336,14 +31351,6 @@ "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", "dev": true }, - "ts-invariant": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.4.4.tgz", - "integrity": "sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA==", - "requires": { - "tslib": "^1.9.3" - } - }, "ts-loader": { "version": "9.4.1", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.1.tgz", diff --git a/package.json b/package.json index 35fd60e4..d2316694 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "ci:check": "npm run format:check:app && npm run lint && npm run types" }, "dependencies": { - "@apollo/react-hooks": "^3.1.5", + "@apollo/client": "^3.11.8", + "@apollo/react-hooks": "^4.0.0", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@headlessui/react": "^1.7.3", @@ -31,13 +32,8 @@ "@sentry/react": "^7.44.0", "@sentry/tracing": "^7.44.0", "allotment": "^1.17.0", - "apollo-cache-inmemory": "^1.6.6", - "apollo-client": "^2.6.10", - "apollo-link": "^1.2.14", - "apollo-link-debounce": "^2.1.0", - "apollo-link-error": "^1.1.13", - "apollo-link-http": "^1.5.17", - "apollo-link-serialize": "^2.1.0", + "apollo-link-debounce": "^3.0.0", + "apollo-link-serialize": "^4.0.0", "cross-fetch": "^3.1.5", "date-fns": "^2.29.3", "detect-browser": "^5.3.0", diff --git a/src/api/apollo/client.ts b/src/api/apollo/client.ts index 2e960a32..a1296a25 100644 --- a/src/api/apollo/client.ts +++ b/src/api/apollo/client.ts @@ -1,16 +1,13 @@ -import { InMemoryCache } from 'apollo-cache-inmemory'; -import { ApolloClient } from 'apollo-client'; -import { ApolloLink } from 'apollo-link'; +import { ApolloClient, InMemoryCache, ApolloLink, HttpLink, gql } from '@apollo/client'; import DebounceLink from 'apollo-link-debounce'; -import { HttpLink } from 'apollo-link-http'; import SerializingLink from 'apollo-link-serialize'; import fetch from 'cross-fetch'; import { ResultType } from './generated/graphql'; import localResolvers from './resolvers'; -import { onError } from 'apollo-link-error'; +import { onError } from '@apollo/client/link/error'; import { GET_APPLICATION_ERRORS } from './queries'; import * as Sentry from '@sentry/react'; -import { GraphQLError, GraphQLErrorExtensions } from 'graphql'; +import { GraphQLErrorExtensions, GraphQLFormattedError } from 'graphql'; const PLAYGROUND_API = process.env.PLAYGROUND_API; const DEFAULT_DEBOUNCE_TIMEOUT = 1200; // Debounce time in ms const { detect } = require('detect-browser'); @@ -23,7 +20,7 @@ const client = new ApolloClient({ onError(({ graphQLErrors, networkError }) => { let errorMessage: string, extensions: GraphQLErrorExtensions = { code: '' }, - gqlError: GraphQLError; + gqlError: GraphQLFormattedError; if (graphQLErrors) { gqlError = graphQLErrors[0]; @@ -84,7 +81,21 @@ const client = new ApolloClient({ resolvers: localResolvers, }); -cache.writeData({ +cache.writeQuery({ + query: gql` + query InitValues { + localProject + activeProjectId + activeProject + errorMessage + cachedExecutionResults { + id + ${ResultType.Transaction} + ${ResultType.Script} + ${ResultType.Contract} + } + } + `, data: { localProject: null, activeProjectId: null, diff --git a/src/api/apollo/resolvers.ts b/src/api/apollo/resolvers.ts index 70a224ba..e2657ec8 100644 --- a/src/api/apollo/resolvers.ts +++ b/src/api/apollo/resolvers.ts @@ -1,5 +1,4 @@ -import { InMemoryCache } from 'apollo-cache-inmemory'; -import gql from 'graphql-tag'; +import { InMemoryCache, gql } from '@apollo/client'; import { normalizeInteractionResponse } from 'util/normalize-interaction-response'; import { ClearExecutionResultsMutationVariables, @@ -152,7 +151,12 @@ const localResolvers = { { id }: any, { cache }: { cache: InMemoryCache }, ): any => { - cache.writeData({ + cache.writeQuery({ + query: gql` + query GetActiveProject { + activeProjectId + } + `, data: { activeProjectId: id, }, diff --git a/src/components/AccountAvatars.tsx b/src/components/AccountAvatars.tsx index 2bb0d6e7..a6288ffc 100644 --- a/src/components/AccountAvatars.tsx +++ b/src/components/AccountAvatars.tsx @@ -55,7 +55,7 @@ export const AvatarList = ({ children }: ChildProps) => { flex: '1 1 auto', alignItems: 'center', justifyContent: 'space-between', - overflowX: 'scroll', + overflowX: 'auto', }} > {children} diff --git a/src/components/Editor/CadenceEditor/ControlPanel/index.tsx b/src/components/Editor/CadenceEditor/ControlPanel/index.tsx index 83cb8fbe..d8012a37 100644 --- a/src/components/Editor/CadenceEditor/ControlPanel/index.tsx +++ b/src/components/Editor/CadenceEditor/ControlPanel/index.tsx @@ -54,12 +54,12 @@ import { StatusMessage, } from './Arguments/styles'; import { SignersPanel } from 'components/Editor/CadenceEditor/ControlPanel/SignersPanel'; -import { Template } from 'src/types'; import DismissiblePopup from 'components/DismissiblePopup'; import { userModalKeys } from 'util/localstorage'; import { addressToAccount } from 'util/accounts'; import { Argument } from './Arguments/types'; import { useThemeUI } from 'theme-ui'; +import { getContractName } from 'util/generator'; const ButtonActionLabels = { [String(EntityType.TransactionTemplate)]: 'Send', @@ -252,7 +252,8 @@ const ControlPanel: React.FC = (props) => { const user = selectedAccounts[0]; const acct = accounts[user]; const template = project.contractTemplates[activeIndex]; - const templateContract = (template as Template)?.name; + console.log(template) + const templateContract = getContractName(template.script); return (acct?.deployedContracts || []).includes(templateContract); }; @@ -283,7 +284,7 @@ const ControlPanel: React.FC = (props) => { // determine if other contracts will need to be redeployed and prompt user const template = project.contractTemplates[active.index]; - const contractName = (template as Template)?.name; + const contractName = getContractName(template.script); if (!contractName) return send(true); const deployment = project.contractDeployments.find( diff --git a/src/components/Editor/FileExplorer/MenuList.tsx b/src/components/Editor/FileExplorer/MenuList.tsx index 05c142b9..28d03fdd 100644 --- a/src/components/Editor/FileExplorer/MenuList.tsx +++ b/src/components/Editor/FileExplorer/MenuList.tsx @@ -168,7 +168,6 @@ const MenuList: React.FC = ({ let _editing = [...editing]; _editing.splice(_editing.indexOf(i), 1); setEditing(_editing); - items[i].title = newTitle; onUpdate(items[i].id, items[i].script, newTitle); return; } diff --git a/src/providers/Project/index.tsx b/src/providers/Project/index.tsx index a32900ec..09f1e643 100644 --- a/src/providers/Project/index.tsx +++ b/src/providers/Project/index.tsx @@ -5,7 +5,7 @@ import { Project, } from 'api/apollo/generated/graphql'; import React, { createContext, useEffect, useState } from 'react'; -import { ChildProps, Template } from 'src/types'; +import { ChildProps } from 'src/types'; import { getHashLineNumber, getParams, LOCAL_PROJECT_ID } from 'util/url'; import ProjectMutator from './projectMutator'; import { storageMapByAddress } from 'util/accounts'; @@ -334,9 +334,6 @@ export const ProjectProvider: React.FC = ({ title, active.index, ); - template.script = script; - template.title = title; - (template as Template).name = getContractName(script); } catch (e) { console.error(e); checkAppErrors(); @@ -358,8 +355,6 @@ export const ProjectProvider: React.FC = ({ contractTemplate.title, active.index, ); - contractTemplate.script = script; - (contractTemplate as Template).name = getContractName(script); } catch (e) { console.error(e); checkAppErrors(); @@ -379,9 +374,6 @@ export const ProjectProvider: React.FC = ({ let res; try { res = await mutator.updateScriptTemplate(templateId, script, title); - const template = project.scriptTemplates.find((t) => t.id === templateId); - template.script = script; - template.title = title; } catch (e) { console.error(e); checkAppErrors(); @@ -411,11 +403,6 @@ export const ProjectProvider: React.FC = ({ let res; try { res = await mutator.updateTransactionTemplate(templateId, script, title); - const template = project.transactionTemplates.find( - (t) => t.id === templateId, - ); - template.script = script; - template.title = title; } catch (e) { console.error(e); checkAppErrors(); @@ -429,8 +416,6 @@ export const ProjectProvider: React.FC = ({ const updateActiveScriptTemplate = async (script: string) => { setIsSaving(true); let res; - const template = project.scriptTemplates[active.index]; - template.script = script; try { res = await mutator.updateScriptTemplate( project.scriptTemplates[active.index].id, @@ -450,8 +435,6 @@ export const ProjectProvider: React.FC = ({ const updateActiveTransactionTemplate = async (script: string) => { setIsSaving(true); let res; - const template = project.transactionTemplates[active.index]; - template.script = script; try { res = await mutator.updateTransactionTemplate( project.transactionTemplates[active.index].id, @@ -815,7 +798,6 @@ export const ProjectProvider: React.FC = ({ }); const template = project.contractTemplates[templateIndex]; const templateId = template.id; - (template as Template).name = getContractName(template.script); return ( ) { const defaultProject = createDefaultProject(); - client.writeData({ + client.writeQuery({ + query: gql` + query InitValues { + activeProject + localProject + } + `, data: { activeProject: true, localProject: defaultProject, @@ -29,7 +36,7 @@ function writeDefaultProject(client: any) { }); } -function cloneProject(client: any, project: Project) { +function cloneProject(client: ApolloClient, project: Project) { const localProject = createLocalProject( project.id, project.seed, @@ -53,7 +60,13 @@ function cloneProject(client: any, project: Project) { title: tpl.title, })), ); - client.writeData({ + client.writeQuery({ + query: gql` + query InitValues { + activeProject + localProject + } + `, data: { activeProject: true, localProject: localProject, @@ -62,7 +75,7 @@ function cloneProject(client: any, project: Project) { } export default function useGetProject( - client: any, + client: ApolloClient, projectId: string | null, isActiveProject: boolean, ): { @@ -136,7 +149,7 @@ export function useProject(): ProjectContextValue { return useContext(ProjectContext); } -function readLocalProject(client: any): any { +function readLocalProject(client: ApolloClient): any { const { project } = client.readQuery({ query: GET_LOCAL_PROJECT }); return project; } diff --git a/src/providers/Project/projectMutator.ts b/src/providers/Project/projectMutator.ts index c75e8ba7..30e84de5 100644 --- a/src/providers/Project/projectMutator.ts +++ b/src/providers/Project/projectMutator.ts @@ -1,4 +1,4 @@ -import ApolloClient from 'apollo-client'; +import { ApolloClient, gql } from '@apollo/client'; import { navigate } from '@reach/router'; import { @@ -41,6 +41,7 @@ import { import { createDefaultProject, DEFAULT_ACCOUNT_STATE } from './projectDefault'; import { UrlRewritter, FILE_TYPE_NAME } from 'util/urlRewritter'; import { Template } from 'src/types'; +import { getContractName } from 'util/generator'; // TODO: Switch to directives for serialization keys after upgrading to the newest Apollo/apollo-link-serialize export const PROJECT_SERIALIZATION_KEY = 'PROJECT_SERIALIZATION_KEY'; @@ -222,22 +223,16 @@ export default class ProjectMutator { description: string, readme: string, ) { - const project = this.client.readQuery({ - query: GET_LOCAL_PROJECT, - }).project; - - project.title = title || project.title; - project.description = description || project.description; - project.readme = readme || project.readme; - project.updatedAt = null; - project.contractDeployments = []; - - this.client.writeQuery({ - query: GET_PROJECT, - variables: { - projectId: project.id, - }, - data: { project }, + this.client.writeFragment({ + id: `Project:${this.projectId}`, + fragment: gql` + fragment ProjectFields on Project { + title + description + readme + } + `, + data: { title, description, readme }, }); } @@ -250,8 +245,16 @@ export default class ProjectMutator { const key = ['SAVE_PROJECT', this.projectId]; - this.client.writeData({ + this.client.writeFragment({ id: `Project:${this.projectId}`, + fragment: gql` + fragment ProjectFields on Project { + title + description + readme + persist + } + `, data: { title, description, @@ -352,8 +355,14 @@ export default class ProjectMutator { script: string, title: string, ) { - this.client.writeData({ + this.client.writeFragment({ id: `TransactionTemplate:${templateId}`, + fragment: gql` + fragment TransactionTemplateFields on TransactionTemplate { + script + title + } + `, data: { script, title, @@ -480,8 +489,14 @@ export default class ProjectMutator { script: string, title: string, ) { - this.client.writeData({ + this.client.writeFragment({ id: `ScriptTemplate:${templateId}`, + fragment: gql` + fragment ScriptTemplateFields on ScriptTemplate { + script + title + } + `, data: { script: script, title: title, @@ -754,6 +769,7 @@ export default class ProjectMutator { script: script, index, projectId: this.projectId, + name: getContractName(script), }, refetchQueries: [ { diff --git a/src/types.ts b/src/types.ts index b6d7f435..5f35c6da 100644 --- a/src/types.ts +++ b/src/types.ts @@ -30,7 +30,6 @@ export type Template = { script: string; title: string; index: number; - name?: string; }; export interface ThemedComponentProps {