From d9ecff14177991d4775de8814428a672098bc90f Mon Sep 17 00:00:00 2001 From: Josh Wooding <12938082+joshwooding@users.noreply.github.com> Date: Thu, 7 Nov 2024 17:51:10 +0000 Subject: [PATCH] Re-add support for snapshots --- packages/loaders/src/LoadPageError.ts | 7 + packages/loaders/src/index.ts | 71 ++----- packages/loaders/src/loadActiveContent.ts | 60 ++++++ .../loaders/src/loadSnapshotFileContent.ts | 74 ++++++++ packages/site-components/package.json | 1 - packages/site-preset-styles/package.json | 1 + packages/site/package.json | 1 + yarn.lock | 173 +----------------- 8 files changed, 160 insertions(+), 228 deletions(-) create mode 100644 packages/loaders/src/LoadPageError.ts create mode 100644 packages/loaders/src/loadActiveContent.ts create mode 100644 packages/loaders/src/loadSnapshotFileContent.ts diff --git a/packages/loaders/src/LoadPageError.ts b/packages/loaders/src/LoadPageError.ts new file mode 100644 index 00000000..b1d9f36c --- /dev/null +++ b/packages/loaders/src/LoadPageError.ts @@ -0,0 +1,7 @@ +export class LoadPageError extends Error { + statusCode: number; + constructor({ message, statusCode }: { message: string; statusCode: number }) { + super(message); + this.statusCode = statusCode; + } +} diff --git a/packages/loaders/src/index.ts b/packages/loaders/src/index.ts index 2cad8542..8f206550 100644 --- a/packages/loaders/src/index.ts +++ b/packages/loaders/src/index.ts @@ -1,54 +1,22 @@ import path from 'path'; -import matter from 'gray-matter'; -import type { SafeParseError } from 'zod'; -import { activeEnvSchema } from '@jpmorganchase/mosaic-schemas'; import type { SharedConfig } from '@jpmorganchase/mosaic-store'; +import type { MosaicMode } from '@jpmorganchase/mosaic-types'; import type { LoaderPage } from './types/index.js'; +import { loadActiveContent, loadActiveMosaicData } from './loadActiveContent'; +import { loadSnapshotFileContent, loadSnapshotFileMosaicData } from './loadSnapshotFileContent'; +export { LoadPageError } from './LoadPageError'; export * from './types/index.js'; -const normalizePageUrl = (url: string): string => (/\/index$/.test(url) ? `${url}.mdx` : url); - -type ActiveModeUrlEnv = { - MOSAIC_ACTIVE_MODE_URL: string; -}; - -export class LoadPageError extends Error { - statusCode: number; - constructor({ message, statusCode }: { message: string; statusCode: number }) { - super(message); - this.statusCode = statusCode; - } -} - -const getFSRootUrl = (): string => { - const env = activeEnvSchema.safeParse(process.env); - if (!env.success) { - const { error } = env as SafeParseError; - error.issues.forEach(issue => { - console.error( - `Missing process.env.${issue.path.join()} environment variable required to load pages` - ); - }); - throw new LoadPageError({ - message: `Environment variables missing to load pages`, - statusCode: 500 - }); - } - return env.data.MOSAIC_ACTIVE_MODE_URL; -}; - export const loadMosaicData = async (url: string): Promise => { - const fsRootUrl = getFSRootUrl(); - const dataUrl = new URL(url, fsRootUrl); - const response = await fetch(dataUrl); + const mode: MosaicMode = (process.env.MOSAIC_MODE || 'active') as MosaicMode; - if (!response.ok) { - // This will activate the closest `error.js` Error Boundary - throw new Error(`Failed to fetch mosaic data @ ${dataUrl}`); + if (mode === 'snapshot-file') { + return loadSnapshotFileMosaicData(url); } - return response.json(); + + return loadActiveMosaicData(url); }; export const loadSharedConfig = async (route: string): Promise => { @@ -58,20 +26,11 @@ export const loadSharedConfig = async (route: string): Promise => { - const fsRootUrl = getFSRootUrl(); - const pageUrl = normalizePageUrl(`${fsRootUrl}${route}`); - const response = await fetch(pageUrl); - if (response.status === 302) { - const { redirect } = await response.json(); - return loadPage(redirect); - } - if (response.ok) { - const source = await response.text(); - const { content, data } = matter(source); - return { source: content, data }; + const mode: MosaicMode = (process.env.MOSAIC_MODE || 'active') as MosaicMode; + + if (mode === 'snapshot-file') { + return loadSnapshotFileContent(route); } - throw new LoadPageError({ - message: `Could not load page : ${pageUrl} ${response.status}/${response.statusText}`, - statusCode: 404 - }); + + return loadActiveContent(route); }; diff --git a/packages/loaders/src/loadActiveContent.ts b/packages/loaders/src/loadActiveContent.ts new file mode 100644 index 00000000..f30490dc --- /dev/null +++ b/packages/loaders/src/loadActiveContent.ts @@ -0,0 +1,60 @@ +import matter from 'gray-matter'; +import type { SafeParseError } from 'zod'; +import { activeEnvSchema } from '@jpmorganchase/mosaic-schemas'; + +import { LoadPageError } from './LoadPageError'; +import type { LoaderPage } from './types/index.js'; + +const normalizePageUrl = (url: string): string => (/\/index$/.test(url) ? `${url}.mdx` : url); + +type ActiveModeUrlEnv = { + MOSAIC_ACTIVE_MODE_URL: string; +}; + +const getFSRootUrl = (): string => { + const env = activeEnvSchema.safeParse(process.env); + if (!env.success) { + const { error } = env as SafeParseError; + error.issues.forEach(issue => { + console.error( + `Missing process.env.${issue.path.join()} environment variable required to load pages` + ); + }); + throw new LoadPageError({ + message: `Environment variables missing to load pages`, + statusCode: 500 + }); + } + return env.data.MOSAIC_ACTIVE_MODE_URL; +}; + +export const loadActiveMosaicData = async (url: string): Promise => { + const fsRootUrl = getFSRootUrl(); + const dataUrl = new URL(url, fsRootUrl); + const response = await fetch(dataUrl); + + if (!response.ok) { + // This will activate the closest `error.js` Error Boundary + throw new Error(`Failed to fetch mosaic data @ ${dataUrl}`); + } + return response.json(); +}; + +export const loadActiveContent = async (route: string): Promise => { + const fsRootUrl = getFSRootUrl(); + const pageUrl = normalizePageUrl(`${fsRootUrl}${route}`); + const response = await fetch(pageUrl); + if (response.status === 302) { + const { redirect } = await response.json(); + return loadActiveContent(redirect); + } + if (response.ok) { + const source = await response.text(); + const { content, data } = matter(source); + return { source: content, data }; + } + throw new LoadPageError({ + message: `Could not load page : ${pageUrl} ${response.status}/${response.statusText}`, + statusCode: 404 + }); +}; diff --git a/packages/loaders/src/loadSnapshotFileContent.ts b/packages/loaders/src/loadSnapshotFileContent.ts new file mode 100644 index 00000000..26b1897b --- /dev/null +++ b/packages/loaders/src/loadSnapshotFileContent.ts @@ -0,0 +1,74 @@ +import path from 'path'; +import fs from 'node:fs/promises'; +import matter from 'gray-matter'; +import { snapshotFileEnvSchema } from '@jpmorganchase/mosaic-schemas'; + +import { LoadPageError } from './LoadPageError'; +import type { LoaderPage } from './types/index.js'; + +const normalizePageUrl = (url: string): string => (/\/index$/.test(url) ? `${url}.mdx` : url); + +const getFSRootUrl = (): string => { + const env = snapshotFileEnvSchema.safeParse(process.env); + if (!env.success) { + env.error.issues.forEach(issue => { + console.error( + `Missing process.env.${issue.path.join()} environment variable required to load pages` + ); + }); + throw new LoadPageError({ + message: `Environment variables missing to load pages`, + statusCode: 500 + }); + } + return env.data.MOSAIC_SNAPSHOT_DIR; +}; + +export const loadSnapshotFileMosaicData = async (url: string): Promise => { + const matches = url.match(/(.*)[!/]/); + const urlPath = matches?.length ? matches[1] : ''; + + const fsRootUrl = getFSRootUrl(); + const filePath = path.join(process.cwd(), fsRootUrl, urlPath); + + let fileExists = false; + try { + await fs.stat(filePath); + fileExists = true; + } catch {} + if (fileExists) { + let localPath = filePath; + if ((await fs.stat(filePath)).isDirectory()) { + localPath = path.posix.join(localPath, 'index'); + } + const realPath = await fs.realpath(localPath); + console.log(localPath, realPath); + const source = await fs.readFile(realPath, 'utf-8'); + return JSON.parse(source); + } + throw new Error(`Failed to fetch mosaic data @ ${url}`); +}; + +export const loadSnapshotFileContent = async (route: string): Promise => { + const fsRootUrl = getFSRootUrl(); + const pageUrl = normalizePageUrl(route); + const filePath = path.posix.join(process.cwd(), fsRootUrl, pageUrl); + try { + let localPath = filePath; + if ((await fs.stat(filePath)).isDirectory()) { + localPath = path.posix.join(localPath, 'index'); + } + const realPath = await fs.realpath(localPath); + const source = await fs.readFile(realPath, 'utf-8'); + const { content, data } = matter(source); + return { source: content, data }; + } catch (error) { + if (error instanceof Error) { + console.error(error.message); + } + throw new LoadPageError({ + message: `Could not read local file '${filePath}' for '${route}'`, + statusCode: 404 + }); + } +}; diff --git a/packages/site-components/package.json b/packages/site-components/package.json index 642ffc76..6d3afbbc 100644 --- a/packages/site-components/package.json +++ b/packages/site-components/package.json @@ -44,7 +44,6 @@ "@jpmorganchase/mosaic-content-editor-plugin": "^0.1.0-beta.89", "@jpmorganchase/mosaic-labs-components": "^0.1.0-beta.89", "@jpmorganchase/mosaic-open-api-component": "^0.1.0-beta.89", - "@jpmorganchase/mosaic-site-middleware": "^0.1.0-beta.89", "@jpmorganchase/mosaic-store": "^0.1.0-beta.89", "@jpmorganchase/mosaic-theme": "^0.1.0-beta.89", "@salt-ds/core": "^1.33.0", diff --git a/packages/site-preset-styles/package.json b/packages/site-preset-styles/package.json index 72891e7d..7166e657 100644 --- a/packages/site-preset-styles/package.json +++ b/packages/site-preset-styles/package.json @@ -39,6 +39,7 @@ "@jpmorganchase/mosaic-site-components": "0.1.0-beta.89", "@jpmorganchase/mosaic-layouts": "0.1.0-beta.89", "@jpmorganchase/mosaic-theme": "0.1.0-beta.89", + "@jpmorganchase/mosaic-mdx-components": "0.1.0-beta.89", "prismjs": "^1.23.0" }, "peerDependencies": {} diff --git a/packages/site/package.json b/packages/site/package.json index 785a9e36..5c91558d 100644 --- a/packages/site/package.json +++ b/packages/site/package.json @@ -35,6 +35,7 @@ "@jpmorganchase/mosaic-layouts": "^0.1.0-beta.89", "@jpmorganchase/mosaic-loaders": "^0.1.0-beta.89", "@jpmorganchase/mosaic-site-components": "^0.1.0-beta.89", + "@jpmorganchase/mosaic-site-components-next": "^0.1.0-beta.89", "@jpmorganchase/mosaic-site-preset-styles": "^0.1.0-beta.89", "@jpmorganchase/mosaic-sitemap-component": "^0.1.0-beta.89", "@jpmorganchase/mosaic-source-git-repo": "^0.1.0-beta.89", diff --git a/yarn.lock b/yarn.lock index ff7706e1..e22cb24d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2237,48 +2237,6 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-5.3.0.tgz#0ec9264cf54a527671d990eb874e030b55b70dcc" integrity sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw== -"@sinonjs/commons@^1.7.0": - version "1.8.3" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" - integrity sha1-OALd0hpQqUm2ch3dcto25n5/Gy0= - dependencies: - type-detect "4.0.8" - -"@sinonjs/commons@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-2.0.0.tgz#fd4ca5b063554307e8327b4564bd56d3b73924a3" - integrity sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg== - dependencies: - type-detect "4.0.8" - -"@sinonjs/fake-timers@^10.0.2": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz#d10549ed1f423d80639c528b6c7f5a1017747d0c" - integrity sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw== - dependencies: - "@sinonjs/commons" "^2.0.0" - -"@sinonjs/fake-timers@^9.1.2": - version "9.1.2" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz#4eaab737fab77332ab132d396a3c0d364bd0ea8c" - integrity sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw== - dependencies: - "@sinonjs/commons" "^1.7.0" - -"@sinonjs/samsam@^7.0.1": - version "7.0.1" - resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-7.0.1.tgz#5b5fa31c554636f78308439d220986b9523fc51f" - integrity sha512-zsAk2Jkiq89mhZovB2LLOdTCxJF4hqqTToGP0ASWlhp4I1hqOjcfmZGafXntCN7MDC6yySH0mFHrYtHceOeLmw== - dependencies: - "@sinonjs/commons" "^2.0.0" - lodash.get "^4.4.2" - type-detect "^4.0.8" - -"@sinonjs/text-encoding@^0.7.1": - version "0.7.2" - resolved "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz#5981a8db18b56ba38ef0efb7d995b12aa7b51918" - integrity sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ== - "@smithy/abort-controller@^3.1.1": version "3.1.1" resolved "https://registry.yarnpkg.com/@smithy/abort-controller/-/abort-controller-3.1.1.tgz#291210611ff6afecfc198d0ca72d5771d8461d16" @@ -3380,18 +3338,6 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e" integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ== -"@types/sinon@^10.0.10": - version "10.0.13" - resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-10.0.13.tgz#60a7a87a70d9372d0b7b38cc03e825f46981fb83" - integrity sha512-UVjDqJblVNQYvVNUsj0PuYYw0ELRmgt1Nt5Vk0pT5f16ROGfcKJY8o1HVuMOJOpD727RrGB9EGvoaTQE5tgxZQ== - dependencies: - "@types/sinonjs__fake-timers" "*" - -"@types/sinonjs__fake-timers@*": - version "8.1.2" - resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.2.tgz#bf2e02a3dbd4aecaf95942ecd99b7402e03fad5e" - integrity sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA== - "@types/statuses@^2.0.4": version "2.0.5" resolved "https://registry.yarnpkg.com/@types/statuses/-/statuses-2.0.5.tgz#f61ab46d5352fd73c863a1ea4e1cef3b0b51ae63" @@ -4197,15 +4143,6 @@ avvio@^8.2.1: debug "^4.0.0" fastq "^1.6.1" -aws-sdk-client-mock@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/aws-sdk-client-mock/-/aws-sdk-client-mock-2.0.1.tgz#c37ec569fa88688d8d88d7a7f028af26d6d2086e" - integrity sha512-Ib/AnI8ZdoIxOBbKSs28TUwJb7FI/AYVYn48PcXx6guk5fBs4GZJJEc+Ci9aImRtVmgO6jHN/6Etz17fr6j3qw== - dependencies: - "@types/sinon" "^10.0.10" - sinon "^14.0.2" - tslib "^2.1.0" - axe-core@^4.10.0: version "4.10.0" resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.10.0.tgz#d9e56ab0147278272739a000880196cdfe113b59" @@ -4856,13 +4793,6 @@ cross-fetch@^3.1.5: dependencies: node-fetch "2.6.7" -cross-fetch@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-4.0.0.tgz#f037aef1580bb3a1a35164ea2a848ba81b445983" - integrity sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g== - dependencies: - node-fetch "^2.6.12" - cross-spawn@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -5476,11 +5406,6 @@ devlop@^1.0.0, devlop@^1.1.0: dependencies: dequal "^2.0.0" -diff@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" - integrity sha1-vFLSmMXqjfkZSAAiREXtQ//IfkA= - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -6303,13 +6228,6 @@ estree-util-to-js@^2.0.0: astring "^1.8.0" source-map "^0.7.0" -estree-util-value-to-estree@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/estree-util-value-to-estree/-/estree-util-value-to-estree-3.1.2.tgz#d2f0e5d350a6c181673eb7299743325b86a9bf5c" - integrity sha512-S0gW2+XZkmsx00tU2uJ4L9hUT7IFabbml9pHh2WQqFmAbxit++YGZne0sKJbNwkj9Wvg9E4uqWl4nCIFQMmfag== - dependencies: - "@types/estree" "^1.0.0" - estree-util-visit@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/estree-util-visit/-/estree-util-visit-2.0.0.tgz#13a9a9f40ff50ed0c022f831ddf4b58d05446feb" @@ -7160,20 +7078,6 @@ hast-util-parse-selector@^4.0.0: dependencies: "@types/hast" "^3.0.0" -hast-util-properties-to-mdx-jsx-attributes@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/hast-util-properties-to-mdx-jsx-attributes/-/hast-util-properties-to-mdx-jsx-attributes-1.0.0.tgz#c40f9f07b74f9b323c1cf8dc14beb17d4d79d12c" - integrity sha512-MZEdAYiXC8wDBfntAc7syyWHbcg/X1h03DQ7IQ6MKagMttpYhnKqOZR/nia0657Dt2v2vuXB8YuKNExw0Fljew== - dependencies: - "@types/estree" "^1.0.0" - "@types/hast" "^3.0.0" - comma-separated-tokens "^2.0.0" - estree-util-value-to-estree "^3.0.0" - mdast-util-mdx-jsx "^3.0.0" - property-information "^6.0.0" - space-separated-tokens "^2.0.0" - style-to-js "^1.0.0" - hast-util-to-estree@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/hast-util-to-estree/-/hast-util-to-estree-3.1.0.tgz#f2afe5e869ddf0cf690c75f9fc699f3180b51b19" @@ -7974,11 +7878,6 @@ is-wsl@^2.1.1: dependencies: is-docker "^2.0.0" -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== - isarray@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" @@ -8203,11 +8102,6 @@ jsx-ast-utils@^3.3.5: object.assign "^4.1.4" object.values "^1.1.6" -just-extend@^4.0.2: - version "4.2.1" - resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-4.2.1.tgz#ef5e589afb61e5d66b24eca749409a8939a8c744" - integrity sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg== - jwt-decode@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/jwt-decode/-/jwt-decode-3.1.2.tgz#3fb319f3675a2df0c2895c8f5e9fa4b67b04ed59" @@ -9359,7 +9253,7 @@ mlly@^1.4.2, mlly@^1.7.2: pkg-types "^1.2.0" ufo "^1.5.4" -mock-fs@^5.0.0, mock-fs@^5.2.0: +mock-fs@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-5.2.0.tgz#3502a9499c84c0a1218ee4bf92ae5bf2ea9b2b5e" integrity sha512-2dF2R6YMSZbpip1V1WHKGLNjr/k48uQClqMVb5H3MOvwc9qhYis3/IWbj02qIg/Y8MDXKFF4c5v0rxx2o6xTZw== @@ -9520,17 +9414,6 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -nise@^5.1.2: - version "5.1.4" - resolved "https://registry.yarnpkg.com/nise/-/nise-5.1.4.tgz#491ce7e7307d4ec546f5a659b2efe94a18b4bbc0" - integrity sha512-8+Ib8rRJ4L0o3kfmyVCL7gzrohyDe0cMFTBa2d364yIrEGMEoetznKJx899YxjybU6bL9SQkYPSBBs1gyYs8Xg== - dependencies: - "@sinonjs/commons" "^2.0.0" - "@sinonjs/fake-timers" "^10.0.2" - "@sinonjs/text-encoding" "^0.7.1" - just-extend "^4.0.2" - path-to-regexp "^1.7.0" - no-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" @@ -9572,13 +9455,6 @@ node-fetch@2.6.7: dependencies: whatwg-url "^5.0.0" -node-fetch@^2.6.12: - version "2.7.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" - integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== - dependencies: - whatwg-url "^5.0.0" - node-fetch@^2.6.2: version "2.6.8" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.8.tgz#a68d30b162bc1d8fd71a367e81b997e1f4d4937e" @@ -10158,13 +10034,6 @@ path-scurry@^1.10.1, path-scurry@^1.11.1: lru-cache "^10.2.0" minipass "^5.0.0 || ^6.0.2 || ^7.0.0" -path-to-regexp@^1.7.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a" - integrity sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA== - dependencies: - isarray "0.0.1" - path-to-regexp@^6.1.0, path-to-regexp@^6.2.0: version "6.2.1" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.2.1.tgz#d54934d6798eb9e5ef14e7af7962c945906918e5" @@ -11638,18 +11507,6 @@ simple-get@^4.0.0: once "^1.3.1" simple-concat "^1.0.0" -sinon@^14.0.2: - version "14.0.2" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-14.0.2.tgz#585a81a3c7b22cf950762ac4e7c28eb8b151c46f" - integrity sha512-PDpV0ZI3ZCS3pEqx0vpNp6kzPhHrLx72wA0G+ZLaaJjLIYeE0n8INlgaohKuGy7hP0as5tbUd23QWu5U233t+w== - dependencies: - "@sinonjs/commons" "^2.0.0" - "@sinonjs/fake-timers" "^9.1.2" - "@sinonjs/samsam" "^7.0.1" - diff "^5.0.0" - nise "^5.1.2" - supports-color "^7.2.0" - slash@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" @@ -12033,20 +11890,6 @@ strnum@^1.0.5: resolved "https://registry.yarnpkg.com/strnum/-/strnum-1.0.5.tgz#5c4e829fe15ad4ff0d20c3db5ac97b73c9b072db" integrity sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA== -style-to-js@^1.0.0: - version "1.1.13" - resolved "https://registry.yarnpkg.com/style-to-js/-/style-to-js-1.1.13.tgz#8d17f2560a9cc9515b94834aaeb2305887d7ced5" - integrity sha512-+43kvxwjrW9n5gFR40Rv98A0/Mcjew7Lt+p5Nnw1KGR9SZf/ZaKqmMwl9Enj9EnYNcJ5VzuCjejC5KZzvH2lOA== - dependencies: - style-to-object "1.0.6" - -style-to-object@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-1.0.6.tgz#0c28aed8be1813d166c60d962719b2907c26547b" - integrity sha512-khxq+Qm3xEyZfKd/y9L3oIWQimxuc4STrQKtQn8aSDRHb8mFgpukgX1hdzfrMEW6JCjyJ8p89x+IUMVnCBI1PA== - dependencies: - inline-style-parser "0.2.3" - style-to-object@^0.4.0: version "0.4.4" resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.4.4.tgz#266e3dfd56391a7eefb7770423612d043c3f33ec" @@ -12098,7 +11941,7 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -supports-color@^7.1.0, supports-color@^7.2.0: +supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" integrity sha1-G33NyzK4E4gBs+R4umpRyqiWSNo= @@ -12591,11 +12434,6 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -type-detect@4.0.8, type-detect@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha1-dkb7XxiHHPu3dJ5pvTmmOI63RQw= - type-fest@^0.13.1: version "0.13.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.13.1.tgz#0172cb5bce80b0bd542ea348db50c7e21834d934" @@ -13079,13 +12917,6 @@ vite@^5.0.0, vite@^5.0.11: optionalDependencies: fsevents "~2.3.3" -vitest-fetch-mock@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/vitest-fetch-mock/-/vitest-fetch-mock-0.3.0.tgz#a519293b61be1ce43377d720500bbfa89861e509" - integrity sha512-g6upWcL8/32fXL43/5f4VHcocuwQIi9Fj5othcK9gPO8XqSEGtnIZdenr2IaipDr61ReRFt+vaOEgo8jiUUX5w== - dependencies: - cross-fetch "^4.0.0" - vitest@^2.0.0: version "2.1.4" resolved "https://registry.yarnpkg.com/vitest/-/vitest-2.1.4.tgz#ba8f4589fb639cf5a9e6af54781667312b3e8230"