diff --git a/.eslintrc.js b/.eslintrc.js index 4d02198e7..e2554d3d4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,4 +2,11 @@ module.exports = { extends: [ `@yarnpkg`, ], + rules: { + // eslint-disable-next-line @typescript-eslint/naming-convention + 'no-restricted-globals': [`error`, { + name: `fetch`, + message: `Use fetch from sources/httpUtils.ts`, + }], + }, }; diff --git a/.vscode/settings.json b/.vscode/settings.json index e840f5983..090a46fd4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,6 +7,6 @@ "eslint.nodePath": ".yarn/sdks", "typescript.enablePromptUseWorkspaceTsdk": true, "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" } } diff --git a/package.json b/package.json index 4a17d211d..416a2120d 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "@types/debug": "^4.1.5", "@types/jest": "^29.0.0", "@types/node": "^20.4.6", + "@types/proxy-from-env": "^1", "@types/semver": "^7.1.0", "@types/tar": "^6.0.0", "@types/which": "^3.0.0", @@ -40,13 +41,13 @@ "eslint": "^8.0.0", "eslint-plugin-arca": "^0.16.0", "jest": "^29.0.0", - "nock": "^13.0.4", - "proxy-agent": "^6.2.2", + "proxy-from-env": "^1.1.0", "semver": "^7.5.2", "supports-color": "^9.0.0", "tar": "^6.0.1", "ts-node": "^10.0.0", "typescript": "^5.0.4", + "undici": "^6.4.0", "v8-compile-cache": "^2.3.0", "which": "^4.0.0" }, @@ -94,8 +95,5 @@ "./shims/yarnpkg", "./shims/yarnpkg.ps1" ] - }, - "resolutions": { - "vm2": "portal:./vm2" } } diff --git a/sources/httpUtils.ts b/sources/httpUtils.ts index dc73b96c3..f88f752a2 100644 --- a/sources/httpUtils.ts +++ b/sources/httpUtils.ts @@ -1,21 +1,17 @@ -import {UsageError} from 'clipanion'; -import {once} from 'events'; -import type {RequestOptions} from 'https'; -import type {IncomingMessage, ClientRequest} from 'http'; -import {stderr, stdin} from 'process'; +import assert from 'assert'; +import {UsageError} from 'clipanion'; +import {once} from 'events'; +import {stderr, stdin} from 'process'; +import {Readable} from 'stream'; -export async function fetchUrlStream(url: string, options: RequestOptions = {}) { +export async function fetch(input: string | URL, init?: RequestInit) { if (process.env.COREPACK_ENABLE_NETWORK === `0`) - throw new UsageError(`Network access disabled by the environment; can't reach ${url}`); + throw new UsageError(`Network access disabled by the environment; can't reach ${input}`); - const {default: https} = await import(`https`); - - const {ProxyAgent} = await import(`proxy-agent`); - - const proxyAgent = new ProxyAgent(); + const agent = await getProxyAgent(input); if (process.env.COREPACK_ENABLE_DOWNLOAD_PROMPT === `1`) { - console.error(`Corepack is about to download ${url}.`); + console.error(`Corepack is about to download ${input}.`); if (stdin.isTTY && !process.env.CI) { stderr.write(`\nDo you want to continue? [Y/n] `); stdin.resume(); @@ -30,60 +26,55 @@ export async function fetchUrlStream(url: string, options: RequestOptions = {}) } } - return new Promise((resolve, reject) => { - const createRequest = (url: string) => { - const request: ClientRequest = https.get(url, {...options, agent: proxyAgent}, response => { - const statusCode = response.statusCode; - - if ([301, 302, 307, 308].includes(statusCode as number) && response.headers.location) - return createRequest(response.headers.location as string); - - if (statusCode != null && statusCode >= 200 && statusCode < 300) - return resolve(response); - - return reject(new Error(`Server answered with HTTP ${statusCode} when performing the request to ${url}; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting`)); - }); + let response; + try { + response = await globalThis.fetch(input, { + ...init, + dispatcher: agent, + }); + } catch (error) { + throw new Error( + `Error when performing the request to ${input}; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting`, + {cause: error}, + ); + } - request.on(`error`, err => { - reject(new Error(`Error when performing the request to ${url}; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting`)); - }); - }; + if (!response.ok) { + await response.arrayBuffer(); + throw new Error( + `Server answered with HTTP ${response.status} when performing the request to ${input}; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting`, + ); + } - createRequest(url); - }); + return response; } -export async function fetchAsBuffer(url: string, options?: RequestOptions) { - const response = await fetchUrlStream(url, options); - - return new Promise((resolve, reject) => { - const chunks: Array = []; +export async function fetchAsJson(input: string | URL, init?: RequestInit) { + const response = await fetch(input, init); + return response.json() as Promise; +} - response.on(`data`, chunk => { - chunks.push(chunk); - }); +export async function fetchUrlStream(input: string | URL, init?: RequestInit) { + const response = await fetch(input, init); + const webStream = response.body; + assert(webStream, `Expected stream to be set`); + const stream = Readable.fromWeb(webStream); + return stream; +} - response.on(`error`, error => { - reject(error); - }); +async function getProxyAgent(input: string | URL) { + const {getProxyForUrl} = await import(`proxy-from-env`); - response.on(`end`, () => { - resolve(Buffer.concat(chunks)); - }); - }); -} + // @ts-expect-error - The internal implementation is compatible with a WHATWG URL instance + const proxy = getProxyForUrl(input); -export async function fetchAsJson(url: string, options?: RequestOptions) { - const buffer = await fetchAsBuffer(url, options); - const asText = buffer.toString(); + if (!proxy) return undefined; - try { - return JSON.parse(asText); - } catch (error) { - const truncated = asText.length > 30 - ? `${asText.slice(0, 30)}...` - : asText; + // Doing a deep import here since undici isn't tree-shakeable + const {default: ProxyAgent} = (await import( + // @ts-expect-error No types for this specific file + `undici/lib/proxy-agent.js` + )) as { default: typeof import('undici').ProxyAgent }; - throw new Error(`Couldn't parse JSON data: ${JSON.stringify(truncated)}`); - } + return new ProxyAgent(proxy); } diff --git a/sources/npmRegistryUtils.ts b/sources/npmRegistryUtils.ts index 7ccdd1f88..a35167760 100644 --- a/sources/npmRegistryUtils.ts +++ b/sources/npmRegistryUtils.ts @@ -1,11 +1,10 @@ -import {UsageError} from 'clipanion'; -import {OutgoingHttpHeaders} from 'http2'; +import {UsageError} from 'clipanion'; -import * as httpUtils from './httpUtils'; +import * as httpUtils from './httpUtils'; // load abbreviated metadata as that's all we need for these calls // see: https://github.com/npm/registry/blob/cfe04736f34db9274a780184d1cdb2fb3e4ead2a/docs/responses/package-metadata.md -export const DEFAULT_HEADERS: OutgoingHttpHeaders = { +export const DEFAULT_HEADERS: Record = { [`Accept`]: `application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8`, }; export const DEFAULT_NPM_REGISTRY_URL = `https://registry.npmjs.org`; diff --git a/tests/httpUtils.test.ts b/tests/httpUtils.test.ts deleted file mode 100644 index 4676be3cf..000000000 --- a/tests/httpUtils.test.ts +++ /dev/null @@ -1,95 +0,0 @@ -import {jest, describe, beforeEach, beforeAll, it, expect} from '@jest/globals'; - -import {fetchUrlStream} from '../sources/httpUtils'; - - -describe(`http utils fetchUrlStream`, () => { - const getUrl = (statusCode: number | string, redirectCode?: number | string) => - `https://registry.example.org/answered/${statusCode}${redirectCode ? `?redirectCode=${redirectCode}` : ``}`; - - const httpsGetFn = jest.fn((url: string, _, callback: (response: any) => void) => { - const parsedURL = new URL(url); - const statusCode = parsedURL.pathname.slice(parsedURL.pathname.lastIndexOf(`/`) + 1); - const response = {url, statusCode: +statusCode}; - const errorCallbacks: Array<(err: string) => void> = []; - - if ([301, 302, 307, 308].includes(+statusCode)) { - const redirectCode = parsedURL.searchParams.get(`redirectCode`)!; - // mock response.headers.location - if (redirectCode) { - Reflect.set(response, `headers`, {location: getUrl(redirectCode)}); - } - } - - // handle request.on('error', err => ...) - if (statusCode === `error`) - process.nextTick(() => errorCallbacks.forEach(cb => cb(`Test internal error`))); - else - callback(response); - - return { - on: (type: string, callback: (err: string) => void) => { - if (type === `error`) { - errorCallbacks.push(callback); - } - }, - }; - }); - - beforeAll(() => { - jest.doMock(`https`, () => ({ - get: httpsGetFn, - Agent: class Agent {}, - })); - }); - - beforeEach(() => { - httpsGetFn.mockClear(); - }); - - it(`correct response answered statusCode should be >= 200 and < 300`, async () => { - await expect(fetchUrlStream(getUrl(200))).resolves.toMatchObject({ - statusCode: 200, - }); - - await expect(fetchUrlStream(getUrl(299))).resolves.toMatchObject({ - statusCode: 299, - }); - - expect(httpsGetFn).toHaveBeenCalledTimes(2); - }); - - it(`bad response`, async () => { - await expect(fetchUrlStream(getUrl(300))).rejects.toThrowError(); - await expect(fetchUrlStream(getUrl(199))).rejects.toThrowError(); - }); - - it(`redirection with correct response`, async () => { - await expect(fetchUrlStream(getUrl(301, 200))).resolves.toMatchObject({ - statusCode: 200, - }); - - expect(httpsGetFn).toHaveBeenCalledTimes(2); - - await expect(fetchUrlStream(getUrl(308, 299))).resolves.toMatchObject({ - statusCode: 299, - }); - - expect(httpsGetFn).toHaveBeenCalledTimes(4); - }); - - it(`redirection with bad response`, async () => { - await expect(fetchUrlStream(getUrl(301, 300))).rejects.toThrowError(); - await expect(fetchUrlStream(getUrl(308, 199))).rejects.toThrowError(); - await expect(fetchUrlStream(getUrl(301, 302))).rejects.toThrowError(); - await expect(fetchUrlStream(getUrl(307))).rejects.toThrowError(); - }); - - it(`rejects with error`, async () => { - await expect(fetchUrlStream(getUrl(`error`))).rejects.toThrowError(); - }); - - it(`rejects when redirection with error`, async () => { - await expect(fetchUrlStream(getUrl(307, `error`))).rejects.toThrowError(); - }); -}); diff --git a/tests/nock/-l5BE69qTzfRBqwr4cxqSQ-1.dat b/tests/nock/-l5BE69qTzfRBqwr4cxqSQ-1.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/-l5BE69qTzfRBqwr4cxqSQ-1.dat and /dev/null differ diff --git a/tests/nock/0mijz-lZ_5pF8f6tlAdbKg-1.dat b/tests/nock/0mijz-lZ_5pF8f6tlAdbKg-1.dat index 3728f6a82..f78c6e80b 100644 Binary files a/tests/nock/0mijz-lZ_5pF8f6tlAdbKg-1.dat and b/tests/nock/0mijz-lZ_5pF8f6tlAdbKg-1.dat differ diff --git a/tests/nock/2Vuch5EnmzPEVel1DWYfPQ-1.dat b/tests/nock/2Vuch5EnmzPEVel1DWYfPQ-1.dat index 7a9750708..0ba71aaca 100644 Binary files a/tests/nock/2Vuch5EnmzPEVel1DWYfPQ-1.dat and b/tests/nock/2Vuch5EnmzPEVel1DWYfPQ-1.dat differ diff --git a/tests/nock/2bh2z3MgoMIcnxHAMev5uQ-1.dat b/tests/nock/2bh2z3MgoMIcnxHAMev5uQ-1.dat index e090a6232..da795e7c2 100644 Binary files a/tests/nock/2bh2z3MgoMIcnxHAMev5uQ-1.dat and b/tests/nock/2bh2z3MgoMIcnxHAMev5uQ-1.dat differ diff --git a/tests/nock/2ituqIIXsQUU5l2SZSMRDQ-1.dat b/tests/nock/2ituqIIXsQUU5l2SZSMRDQ-1.dat index e090a6232..da795e7c2 100644 Binary files a/tests/nock/2ituqIIXsQUU5l2SZSMRDQ-1.dat and b/tests/nock/2ituqIIXsQUU5l2SZSMRDQ-1.dat differ diff --git a/tests/nock/3cCMRJMrFyNpV7MlFGUXYw-1.dat b/tests/nock/3cCMRJMrFyNpV7MlFGUXYw-1.dat index e090a6232..da795e7c2 100644 Binary files a/tests/nock/3cCMRJMrFyNpV7MlFGUXYw-1.dat and b/tests/nock/3cCMRJMrFyNpV7MlFGUXYw-1.dat differ diff --git a/tests/nock/3cCMRJMrFyNpV7MlFGUXYw-2.dat b/tests/nock/3cCMRJMrFyNpV7MlFGUXYw-2.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/3cCMRJMrFyNpV7MlFGUXYw-2.dat and /dev/null differ diff --git a/tests/nock/4IfgwoxNR5JV5bBojS26Kg-1.dat b/tests/nock/4IfgwoxNR5JV5bBojS26Kg-1.dat index 6dc8f7378..14751ca11 100644 Binary files a/tests/nock/4IfgwoxNR5JV5bBojS26Kg-1.dat and b/tests/nock/4IfgwoxNR5JV5bBojS26Kg-1.dat differ diff --git a/tests/nock/4IfgwoxNR5JV5bBojS26Kg-2.dat b/tests/nock/4IfgwoxNR5JV5bBojS26Kg-2.dat index 490811361..93c911029 100644 Binary files a/tests/nock/4IfgwoxNR5JV5bBojS26Kg-2.dat and b/tests/nock/4IfgwoxNR5JV5bBojS26Kg-2.dat differ diff --git a/tests/nock/4IfgwoxNR5JV5bBojS26Kg-3.dat b/tests/nock/4IfgwoxNR5JV5bBojS26Kg-3.dat index adcf4fa0e..ec517005f 100644 Binary files a/tests/nock/4IfgwoxNR5JV5bBojS26Kg-3.dat and b/tests/nock/4IfgwoxNR5JV5bBojS26Kg-3.dat differ diff --git a/tests/nock/4ppY93mauKPrkN4oe1GUkA-1.dat b/tests/nock/4ppY93mauKPrkN4oe1GUkA-1.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/4ppY93mauKPrkN4oe1GUkA-1.dat and /dev/null differ diff --git a/tests/nock/5nSlJQX7yNaNrh8eY7ovMQ-1.dat b/tests/nock/5nSlJQX7yNaNrh8eY7ovMQ-1.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/5nSlJQX7yNaNrh8eY7ovMQ-1.dat and /dev/null differ diff --git a/tests/nock/6BSdMkNfyZxTnw4r9rK5ig-1.dat b/tests/nock/6BSdMkNfyZxTnw4r9rK5ig-1.dat index 7a9750708..0ba71aaca 100644 Binary files a/tests/nock/6BSdMkNfyZxTnw4r9rK5ig-1.dat and b/tests/nock/6BSdMkNfyZxTnw4r9rK5ig-1.dat differ diff --git a/tests/nock/6YlkCvzyrFlW9WizGIO9AA-1.dat b/tests/nock/6YlkCvzyrFlW9WizGIO9AA-1.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/6YlkCvzyrFlW9WizGIO9AA-1.dat and /dev/null differ diff --git a/tests/nock/6zkNeK1b_EJchZZ1iQz7GQ-1.dat b/tests/nock/6zkNeK1b_EJchZZ1iQz7GQ-1.dat index 27c1259c6..7c80d1e7c 100644 Binary files a/tests/nock/6zkNeK1b_EJchZZ1iQz7GQ-1.dat and b/tests/nock/6zkNeK1b_EJchZZ1iQz7GQ-1.dat differ diff --git a/tests/nock/7_ZKSRHG7OfkRvPJHYpxbQ-1.dat b/tests/nock/7_ZKSRHG7OfkRvPJHYpxbQ-1.dat index ff2377b03..fa556b304 100644 Binary files a/tests/nock/7_ZKSRHG7OfkRvPJHYpxbQ-1.dat and b/tests/nock/7_ZKSRHG7OfkRvPJHYpxbQ-1.dat differ diff --git a/tests/nock/8LXMft4IyEWeaqoiynS5FA-1.dat b/tests/nock/8LXMft4IyEWeaqoiynS5FA-1.dat index b972abaee..101f15f44 100644 Binary files a/tests/nock/8LXMft4IyEWeaqoiynS5FA-1.dat and b/tests/nock/8LXMft4IyEWeaqoiynS5FA-1.dat differ diff --git a/tests/nock/8LXMft4IyEWeaqoiynS5FA-2.dat b/tests/nock/8LXMft4IyEWeaqoiynS5FA-2.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/8LXMft4IyEWeaqoiynS5FA-2.dat and /dev/null differ diff --git a/tests/nock/AL__3okpCdfjA6kGuG2rFQ-1.dat b/tests/nock/AL__3okpCdfjA6kGuG2rFQ-1.dat index c7c99414f..ba34d2e97 100644 Binary files a/tests/nock/AL__3okpCdfjA6kGuG2rFQ-1.dat and b/tests/nock/AL__3okpCdfjA6kGuG2rFQ-1.dat differ diff --git a/tests/nock/AL__3okpCdfjA6kGuG2rFQ-2.dat b/tests/nock/AL__3okpCdfjA6kGuG2rFQ-2.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/AL__3okpCdfjA6kGuG2rFQ-2.dat and /dev/null differ diff --git a/tests/nock/AlEOMVd5-ReDQnk_MrNP_A-1.dat b/tests/nock/AlEOMVd5-ReDQnk_MrNP_A-1.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/AlEOMVd5-ReDQnk_MrNP_A-1.dat and /dev/null differ diff --git a/tests/nock/ClrKWNyvjynLF4vcKkUjqQ-1.dat b/tests/nock/ClrKWNyvjynLF4vcKkUjqQ-1.dat index ff2377b03..fa556b304 100644 Binary files a/tests/nock/ClrKWNyvjynLF4vcKkUjqQ-1.dat and b/tests/nock/ClrKWNyvjynLF4vcKkUjqQ-1.dat differ diff --git a/tests/nock/D4fdrCUUCl7i1D6eeg49zQ-1.dat b/tests/nock/D4fdrCUUCl7i1D6eeg49zQ-1.dat index 9b690dabb..79520bd97 100644 Binary files a/tests/nock/D4fdrCUUCl7i1D6eeg49zQ-1.dat and b/tests/nock/D4fdrCUUCl7i1D6eeg49zQ-1.dat differ diff --git a/tests/nock/GSh7RCQN4e8flEL6h2lnwQ-1.dat b/tests/nock/GSh7RCQN4e8flEL6h2lnwQ-1.dat index ff2377b03..fa556b304 100644 Binary files a/tests/nock/GSh7RCQN4e8flEL6h2lnwQ-1.dat and b/tests/nock/GSh7RCQN4e8flEL6h2lnwQ-1.dat differ diff --git a/tests/nock/K26guRbYG9vZYQwgFU5lHg-1.dat b/tests/nock/K26guRbYG9vZYQwgFU5lHg-1.dat index 9b690dabb..79520bd97 100644 Binary files a/tests/nock/K26guRbYG9vZYQwgFU5lHg-1.dat and b/tests/nock/K26guRbYG9vZYQwgFU5lHg-1.dat differ diff --git a/tests/nock/LU_vfrNkPzIhLrr405IpzQ-1.dat b/tests/nock/LU_vfrNkPzIhLrr405IpzQ-1.dat index 9b690dabb..79520bd97 100644 Binary files a/tests/nock/LU_vfrNkPzIhLrr405IpzQ-1.dat and b/tests/nock/LU_vfrNkPzIhLrr405IpzQ-1.dat differ diff --git a/tests/nock/M82EVNBXM8yFkn6tOCflMA-1.dat b/tests/nock/M82EVNBXM8yFkn6tOCflMA-1.dat index 6dc8f7378..14751ca11 100644 Binary files a/tests/nock/M82EVNBXM8yFkn6tOCflMA-1.dat and b/tests/nock/M82EVNBXM8yFkn6tOCflMA-1.dat differ diff --git a/tests/nock/MVR-DPxEL7jQE9aetA791Q-1.dat b/tests/nock/MVR-DPxEL7jQE9aetA791Q-1.dat index 3728f6a82..f78c6e80b 100644 Binary files a/tests/nock/MVR-DPxEL7jQE9aetA791Q-1.dat and b/tests/nock/MVR-DPxEL7jQE9aetA791Q-1.dat differ diff --git a/tests/nock/MuEAzZXT77khPx8FpLSF2A-1.dat b/tests/nock/MuEAzZXT77khPx8FpLSF2A-1.dat index 348d2efab..cb10d2c6c 100644 Binary files a/tests/nock/MuEAzZXT77khPx8FpLSF2A-1.dat and b/tests/nock/MuEAzZXT77khPx8FpLSF2A-1.dat differ diff --git a/tests/nock/MvOS7l1EAcH1GZOIKWmDuw-1.dat b/tests/nock/MvOS7l1EAcH1GZOIKWmDuw-1.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/MvOS7l1EAcH1GZOIKWmDuw-1.dat and /dev/null differ diff --git a/tests/nock/S9h20CvrT1ljP2zwMQUMFw-1.dat b/tests/nock/S9h20CvrT1ljP2zwMQUMFw-1.dat index e090a6232..da795e7c2 100644 Binary files a/tests/nock/S9h20CvrT1ljP2zwMQUMFw-1.dat and b/tests/nock/S9h20CvrT1ljP2zwMQUMFw-1.dat differ diff --git a/tests/nock/S9h20CvrT1ljP2zwMQUMFw-2.dat b/tests/nock/S9h20CvrT1ljP2zwMQUMFw-2.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/S9h20CvrT1ljP2zwMQUMFw-2.dat and /dev/null differ diff --git a/tests/nock/TnyRFo6IK894n_HQkACElA-1.dat b/tests/nock/TnyRFo6IK894n_HQkACElA-1.dat index 27c1259c6..7c80d1e7c 100644 Binary files a/tests/nock/TnyRFo6IK894n_HQkACElA-1.dat and b/tests/nock/TnyRFo6IK894n_HQkACElA-1.dat differ diff --git a/tests/nock/Vp5BnbFIGGY7ZeZMncmwMw-1.dat b/tests/nock/Vp5BnbFIGGY7ZeZMncmwMw-1.dat index e090a6232..da795e7c2 100644 Binary files a/tests/nock/Vp5BnbFIGGY7ZeZMncmwMw-1.dat and b/tests/nock/Vp5BnbFIGGY7ZeZMncmwMw-1.dat differ diff --git a/tests/nock/VtMTrMazyfrMmIBBLfdGzA-1.dat b/tests/nock/VtMTrMazyfrMmIBBLfdGzA-1.dat index d2857c000..7b6122626 100644 Binary files a/tests/nock/VtMTrMazyfrMmIBBLfdGzA-1.dat and b/tests/nock/VtMTrMazyfrMmIBBLfdGzA-1.dat differ diff --git a/tests/nock/VurwVdvlR5Rs7xQVs9UCVw-1.dat b/tests/nock/VurwVdvlR5Rs7xQVs9UCVw-1.dat index 22cb76973..0607f658c 100644 Binary files a/tests/nock/VurwVdvlR5Rs7xQVs9UCVw-1.dat and b/tests/nock/VurwVdvlR5Rs7xQVs9UCVw-1.dat differ diff --git a/tests/nock/VurwVdvlR5Rs7xQVs9UCVw-2.dat b/tests/nock/VurwVdvlR5Rs7xQVs9UCVw-2.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/VurwVdvlR5Rs7xQVs9UCVw-2.dat and /dev/null differ diff --git a/tests/nock/VurwVdvlR5Rs7xQVs9UCVw-3.dat b/tests/nock/VurwVdvlR5Rs7xQVs9UCVw-3.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/VurwVdvlR5Rs7xQVs9UCVw-3.dat and /dev/null differ diff --git a/tests/nock/VurwVdvlR5Rs7xQVs9UCVw-4.dat b/tests/nock/VurwVdvlR5Rs7xQVs9UCVw-4.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/VurwVdvlR5Rs7xQVs9UCVw-4.dat and /dev/null differ diff --git a/tests/nock/WAsCdU-KCdvkg9dJ46zkWQ-1.dat b/tests/nock/WAsCdU-KCdvkg9dJ46zkWQ-1.dat index ff2377b03..fa556b304 100644 Binary files a/tests/nock/WAsCdU-KCdvkg9dJ46zkWQ-1.dat and b/tests/nock/WAsCdU-KCdvkg9dJ46zkWQ-1.dat differ diff --git a/tests/nock/WaR3LFsnTKCCsgSkSI54NA-1.dat b/tests/nock/WaR3LFsnTKCCsgSkSI54NA-1.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/WaR3LFsnTKCCsgSkSI54NA-1.dat and /dev/null differ diff --git a/tests/nock/WyEcK5FmdvhvOqnb2mHi5A-1.dat b/tests/nock/WyEcK5FmdvhvOqnb2mHi5A-1.dat index e090a6232..da795e7c2 100644 Binary files a/tests/nock/WyEcK5FmdvhvOqnb2mHi5A-1.dat and b/tests/nock/WyEcK5FmdvhvOqnb2mHi5A-1.dat differ diff --git a/tests/nock/WyEcK5FmdvhvOqnb2mHi5A-2.dat b/tests/nock/WyEcK5FmdvhvOqnb2mHi5A-2.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/WyEcK5FmdvhvOqnb2mHi5A-2.dat and /dev/null differ diff --git a/tests/nock/WyEcK5FmdvhvOqnb2mHi5A-3.dat b/tests/nock/WyEcK5FmdvhvOqnb2mHi5A-3.dat index b7dbe0ac0..a51202dfa 100644 Binary files a/tests/nock/WyEcK5FmdvhvOqnb2mHi5A-3.dat and b/tests/nock/WyEcK5FmdvhvOqnb2mHi5A-3.dat differ diff --git a/tests/nock/WyEcK5FmdvhvOqnb2mHi5A-4.dat b/tests/nock/WyEcK5FmdvhvOqnb2mHi5A-4.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/WyEcK5FmdvhvOqnb2mHi5A-4.dat and /dev/null differ diff --git a/tests/nock/XXSLFDrOgganu9sf0bbP2A-1.dat b/tests/nock/XXSLFDrOgganu9sf0bbP2A-1.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/XXSLFDrOgganu9sf0bbP2A-1.dat and /dev/null differ diff --git a/tests/nock/XtnC4qVqg7VJUOAoKyxAbA-1.dat b/tests/nock/XtnC4qVqg7VJUOAoKyxAbA-1.dat index b7dbe0ac0..a51202dfa 100644 Binary files a/tests/nock/XtnC4qVqg7VJUOAoKyxAbA-1.dat and b/tests/nock/XtnC4qVqg7VJUOAoKyxAbA-1.dat differ diff --git a/tests/nock/XtnC4qVqg7VJUOAoKyxAbA-2.dat b/tests/nock/XtnC4qVqg7VJUOAoKyxAbA-2.dat index b7dbe0ac0..a51202dfa 100644 Binary files a/tests/nock/XtnC4qVqg7VJUOAoKyxAbA-2.dat and b/tests/nock/XtnC4qVqg7VJUOAoKyxAbA-2.dat differ diff --git a/tests/nock/XtnC4qVqg7VJUOAoKyxAbA-3.dat b/tests/nock/XtnC4qVqg7VJUOAoKyxAbA-3.dat index b7dbe0ac0..a51202dfa 100644 Binary files a/tests/nock/XtnC4qVqg7VJUOAoKyxAbA-3.dat and b/tests/nock/XtnC4qVqg7VJUOAoKyxAbA-3.dat differ diff --git a/tests/nock/_2yNDOq6UlHEKY9lwBEOig-1.dat b/tests/nock/_2yNDOq6UlHEKY9lwBEOig-1.dat index b7dbe0ac0..a51202dfa 100644 Binary files a/tests/nock/_2yNDOq6UlHEKY9lwBEOig-1.dat and b/tests/nock/_2yNDOq6UlHEKY9lwBEOig-1.dat differ diff --git a/tests/nock/_2yNDOq6UlHEKY9lwBEOig-2.dat b/tests/nock/_2yNDOq6UlHEKY9lwBEOig-2.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/_2yNDOq6UlHEKY9lwBEOig-2.dat and /dev/null differ diff --git a/tests/nock/_2yNDOq6UlHEKY9lwBEOig-3.dat b/tests/nock/_2yNDOq6UlHEKY9lwBEOig-3.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/_2yNDOq6UlHEKY9lwBEOig-3.dat and /dev/null differ diff --git a/tests/nock/_ssVB5fpNumqL8RMl4TqHw-1.dat b/tests/nock/_ssVB5fpNumqL8RMl4TqHw-1.dat index e090a6232..da795e7c2 100644 Binary files a/tests/nock/_ssVB5fpNumqL8RMl4TqHw-1.dat and b/tests/nock/_ssVB5fpNumqL8RMl4TqHw-1.dat differ diff --git a/tests/nock/_ssVB5fpNumqL8RMl4TqHw-2.dat b/tests/nock/_ssVB5fpNumqL8RMl4TqHw-2.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/_ssVB5fpNumqL8RMl4TqHw-2.dat and /dev/null differ diff --git a/tests/nock/_ssVB5fpNumqL8RMl4TqHw-3.dat b/tests/nock/_ssVB5fpNumqL8RMl4TqHw-3.dat index b7dbe0ac0..a51202dfa 100644 Binary files a/tests/nock/_ssVB5fpNumqL8RMl4TqHw-3.dat and b/tests/nock/_ssVB5fpNumqL8RMl4TqHw-3.dat differ diff --git a/tests/nock/_ssVB5fpNumqL8RMl4TqHw-4.dat b/tests/nock/_ssVB5fpNumqL8RMl4TqHw-4.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/_ssVB5fpNumqL8RMl4TqHw-4.dat and /dev/null differ diff --git a/tests/nock/bNE0FYc3WlnFGzjHaIdf5A-1.dat b/tests/nock/bNE0FYc3WlnFGzjHaIdf5A-1.dat index 3d988086e..fa2e06f3f 100644 Binary files a/tests/nock/bNE0FYc3WlnFGzjHaIdf5A-1.dat and b/tests/nock/bNE0FYc3WlnFGzjHaIdf5A-1.dat differ diff --git a/tests/nock/bNE0FYc3WlnFGzjHaIdf5A-2.dat b/tests/nock/bNE0FYc3WlnFGzjHaIdf5A-2.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/bNE0FYc3WlnFGzjHaIdf5A-2.dat and /dev/null differ diff --git a/tests/nock/cRq-o3WTbH0_0MVIM498_Q-1.dat b/tests/nock/cRq-o3WTbH0_0MVIM498_Q-1.dat index 7a9750708..0ba71aaca 100644 Binary files a/tests/nock/cRq-o3WTbH0_0MVIM498_Q-1.dat and b/tests/nock/cRq-o3WTbH0_0MVIM498_Q-1.dat differ diff --git a/tests/nock/dUbkD1ZPHtOFgMWH_AW6wQ-1.dat b/tests/nock/dUbkD1ZPHtOFgMWH_AW6wQ-1.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/dUbkD1ZPHtOFgMWH_AW6wQ-1.dat and /dev/null differ diff --git a/tests/nock/fskWDnBnd-E_LlkU7xvjwQ-1.dat b/tests/nock/fskWDnBnd-E_LlkU7xvjwQ-1.dat index bc05b63a1..0eff89640 100644 Binary files a/tests/nock/fskWDnBnd-E_LlkU7xvjwQ-1.dat and b/tests/nock/fskWDnBnd-E_LlkU7xvjwQ-1.dat differ diff --git a/tests/nock/fskWDnBnd-E_LlkU7xvjwQ-2.dat b/tests/nock/fskWDnBnd-E_LlkU7xvjwQ-2.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/fskWDnBnd-E_LlkU7xvjwQ-2.dat and /dev/null differ diff --git a/tests/nock/gD354-khxZHN8IJPre6iqw-1.dat b/tests/nock/gD354-khxZHN8IJPre6iqw-1.dat index 81e842f39..6b6b6ed44 100644 Binary files a/tests/nock/gD354-khxZHN8IJPre6iqw-1.dat and b/tests/nock/gD354-khxZHN8IJPre6iqw-1.dat differ diff --git a/tests/nock/gD354-khxZHN8IJPre6iqw-2.dat b/tests/nock/gD354-khxZHN8IJPre6iqw-2.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/gD354-khxZHN8IJPre6iqw-2.dat and /dev/null differ diff --git a/tests/nock/gD354-khxZHN8IJPre6iqw-3.dat b/tests/nock/gD354-khxZHN8IJPre6iqw-3.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/gD354-khxZHN8IJPre6iqw-3.dat and /dev/null differ diff --git a/tests/nock/gD354-khxZHN8IJPre6iqw-4.dat b/tests/nock/gD354-khxZHN8IJPre6iqw-4.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/gD354-khxZHN8IJPre6iqw-4.dat and /dev/null differ diff --git a/tests/nock/h9H6jL9ro_imv61YP24nGg-1.dat b/tests/nock/h9H6jL9ro_imv61YP24nGg-1.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/h9H6jL9ro_imv61YP24nGg-1.dat and /dev/null differ diff --git a/tests/nock/h9H6jL9ro_imv61YP24nGg-2.dat b/tests/nock/h9H6jL9ro_imv61YP24nGg-2.dat index bc05b63a1..0eff89640 100644 Binary files a/tests/nock/h9H6jL9ro_imv61YP24nGg-2.dat and b/tests/nock/h9H6jL9ro_imv61YP24nGg-2.dat differ diff --git a/tests/nock/h9H6jL9ro_imv61YP24nGg-3.dat b/tests/nock/h9H6jL9ro_imv61YP24nGg-3.dat index 490811361..93c911029 100644 Binary files a/tests/nock/h9H6jL9ro_imv61YP24nGg-3.dat and b/tests/nock/h9H6jL9ro_imv61YP24nGg-3.dat differ diff --git a/tests/nock/hww7xMUJ57Ly5tkvOyiIeg-1.dat b/tests/nock/hww7xMUJ57Ly5tkvOyiIeg-1.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/hww7xMUJ57Ly5tkvOyiIeg-1.dat and /dev/null differ diff --git a/tests/nock/lU3UuMuorez9QziSUhGg8g-1.dat b/tests/nock/lU3UuMuorez9QziSUhGg8g-1.dat index b7dbe0ac0..a51202dfa 100644 Binary files a/tests/nock/lU3UuMuorez9QziSUhGg8g-1.dat and b/tests/nock/lU3UuMuorez9QziSUhGg8g-1.dat differ diff --git a/tests/nock/lU3UuMuorez9QziSUhGg8g-2.dat b/tests/nock/lU3UuMuorez9QziSUhGg8g-2.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/lU3UuMuorez9QziSUhGg8g-2.dat and /dev/null differ diff --git a/tests/nock/oza0_71_8jb3typs-3gduw-1.dat b/tests/nock/oza0_71_8jb3typs-3gduw-1.dat index ff2377b03..fa556b304 100644 Binary files a/tests/nock/oza0_71_8jb3typs-3gduw-1.dat and b/tests/nock/oza0_71_8jb3typs-3gduw-1.dat differ diff --git a/tests/nock/pBMzygfekzLgFHBxfUwMyg-1.dat b/tests/nock/pBMzygfekzLgFHBxfUwMyg-1.dat index e090a6232..da795e7c2 100644 Binary files a/tests/nock/pBMzygfekzLgFHBxfUwMyg-1.dat and b/tests/nock/pBMzygfekzLgFHBxfUwMyg-1.dat differ diff --git a/tests/nock/sogVBiC-f6IO6vTAaPDx5w-1.dat b/tests/nock/sogVBiC-f6IO6vTAaPDx5w-1.dat index 3728f6a82..f78c6e80b 100644 Binary files a/tests/nock/sogVBiC-f6IO6vTAaPDx5w-1.dat and b/tests/nock/sogVBiC-f6IO6vTAaPDx5w-1.dat differ diff --git a/tests/nock/urO1i4GpxQt29UQLMf23wA-1.dat b/tests/nock/urO1i4GpxQt29UQLMf23wA-1.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/urO1i4GpxQt29UQLMf23wA-1.dat and /dev/null differ diff --git a/tests/nock/vA1ZjUdN7-YPy8p6BF8_RQ-1.dat b/tests/nock/vA1ZjUdN7-YPy8p6BF8_RQ-1.dat index bc05b63a1..0eff89640 100644 Binary files a/tests/nock/vA1ZjUdN7-YPy8p6BF8_RQ-1.dat and b/tests/nock/vA1ZjUdN7-YPy8p6BF8_RQ-1.dat differ diff --git a/tests/nock/vA1ZjUdN7-YPy8p6BF8_RQ-2.dat b/tests/nock/vA1ZjUdN7-YPy8p6BF8_RQ-2.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/vA1ZjUdN7-YPy8p6BF8_RQ-2.dat and /dev/null differ diff --git a/tests/nock/xMfDvY4klJ8hOhDDO0NK5A-1.dat b/tests/nock/xMfDvY4klJ8hOhDDO0NK5A-1.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/xMfDvY4klJ8hOhDDO0NK5A-1.dat and /dev/null differ diff --git a/tests/nock/xMfDvY4klJ8hOhDDO0NK5A-2.dat b/tests/nock/xMfDvY4klJ8hOhDDO0NK5A-2.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/xMfDvY4klJ8hOhDDO0NK5A-2.dat and /dev/null differ diff --git a/tests/nock/xMfDvY4klJ8hOhDDO0NK5A-3.dat b/tests/nock/xMfDvY4klJ8hOhDDO0NK5A-3.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/xMfDvY4klJ8hOhDDO0NK5A-3.dat and /dev/null differ diff --git a/tests/nock/yitq9mPS6MdVMMD6EzGtlw-1.dat b/tests/nock/yitq9mPS6MdVMMD6EzGtlw-1.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/yitq9mPS6MdVMMD6EzGtlw-1.dat and /dev/null differ diff --git a/tests/nock/ypWhs6_VxInVlmWLHRm3FA-1.dat b/tests/nock/ypWhs6_VxInVlmWLHRm3FA-1.dat index 6dc8f7378..14751ca11 100644 Binary files a/tests/nock/ypWhs6_VxInVlmWLHRm3FA-1.dat and b/tests/nock/ypWhs6_VxInVlmWLHRm3FA-1.dat differ diff --git a/tests/nock/ypWhs6_VxInVlmWLHRm3FA-2.dat b/tests/nock/ypWhs6_VxInVlmWLHRm3FA-2.dat index 490811361..93c911029 100644 Binary files a/tests/nock/ypWhs6_VxInVlmWLHRm3FA-2.dat and b/tests/nock/ypWhs6_VxInVlmWLHRm3FA-2.dat differ diff --git a/tests/nock/zIqNSOkKydlbZyC4vpFlug-1.dat b/tests/nock/zIqNSOkKydlbZyC4vpFlug-1.dat index 27c1259c6..7c80d1e7c 100644 Binary files a/tests/nock/zIqNSOkKydlbZyC4vpFlug-1.dat and b/tests/nock/zIqNSOkKydlbZyC4vpFlug-1.dat differ diff --git a/tests/nock/zvUek_ksfEFwWRnAJUuOFw-1.dat b/tests/nock/zvUek_ksfEFwWRnAJUuOFw-1.dat index b7dbe0ac0..a51202dfa 100644 Binary files a/tests/nock/zvUek_ksfEFwWRnAJUuOFw-1.dat and b/tests/nock/zvUek_ksfEFwWRnAJUuOFw-1.dat differ diff --git a/tests/nock/zvUek_ksfEFwWRnAJUuOFw-2.dat b/tests/nock/zvUek_ksfEFwWRnAJUuOFw-2.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/zvUek_ksfEFwWRnAJUuOFw-2.dat and /dev/null differ diff --git a/tests/nock/zvUek_ksfEFwWRnAJUuOFw-3.dat b/tests/nock/zvUek_ksfEFwWRnAJUuOFw-3.dat deleted file mode 100644 index b03652e61..000000000 Binary files a/tests/nock/zvUek_ksfEFwWRnAJUuOFw-3.dat and /dev/null differ diff --git a/tests/recordRequests.js b/tests/recordRequests.js index ca4fac506..6279a3586 100644 --- a/tests/recordRequests.js +++ b/tests/recordRequests.js @@ -3,7 +3,10 @@ const fs = require(`node:fs`); const path = require(`node:path`); const v8 = require(`node:v8`); -const nock = require(`nock`); +/** + * @type {Map}> | undefined} + */ +let mocks; const getNockFile = () => path.join( @@ -11,45 +14,85 @@ const getNockFile = () => `nock`, `${process.env.NOCK_FILE_NAME}-${process.env.RUN_CLI_ID}.dat`, ); -const ACCEPTED_HEADERS = new Set([`Content-Type`, `Content-Length`]); -function filterHeaders(headers) { - if (!Array.isArray(headers)) return headers; - const filtered = []; - for (let t = 0; t < headers.length; t += 2) - if (ACCEPTED_HEADERS.has(headers[t].toLowerCase())) - filtered.push(headers[t], headers[t + 1]); +if (process.env.NOCK_ENV === `record`) { + const realFetch = globalThis.fetch; + globalThis.fetch = async (input, init) => { + const response = await realFetch(input, init); + const data = await response.arrayBuffer(); - return filtered; -} + const minimalHeaders = new Headers(); + for (const headerName of [`content-type`, `content-length`]) { + const headerValue = response.headers.get(headerName); + if (headerValue != null) { + minimalHeaders.set(headerName, headerValue); + } + } + + mocks ??= new Map(); + mocks.set(input.toString(), { + /* + Due to a bug *somewhere* `v8.deserialize` fails to deserialize + a `v8.serialize` Buffer if body is a Buffer, Uint8Array, + ArrayBuffer, or latin1 string on the Windows GitHub Actions + runner with the following error: + Unable to deserialize cloned data + + base64 strings works so that's what we'll use for now. + + Tested with Node.js 18.19.0, 20.11.0, and 21.6.1. -switch (process.env.NOCK_ENV || ``) { - case `record`: - nock.recorder.rec({ - // eslint-disable-next-line @typescript-eslint/naming-convention - dont_print: true, - // eslint-disable-next-line @typescript-eslint/naming-convention - output_objects: true, + Runner Information: + Current runner version: '2.312.0' + Operating System + Microsoft Windows Server 2022 + 10.0.20348 + Datacenter + Runner Image + Image: windows-2022 + Version: 20240204.1.0 + Included Software: https://github.com/actions/runner-images/blob/win22/20240204.1/images/windows/Windows2022-Readme.md + Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20240204.1 + Runner Image Provisioner + 2.0.341.1 + */ + body: Buffer.from(data).toString(`base64`), + status: response.status, + headers: Object.fromEntries(minimalHeaders), }); - process.on(`exit`, () => { - const nockCallObjects = nock.recorder.play(); - for (const req of nockCallObjects) - if (typeof req !== `string`) - req.rawHeaders = filterHeaders(req.rawHeaders); + return new Response(data, { + status: response.status, + headers: minimalHeaders, + }); + }; - const serialized = v8.serialize(nockCallObjects); + process.once(`exit`, () => { + if (mocks) { fs.mkdirSync(path.dirname(getNockFile()), {recursive: true}); - fs.writeFileSync(getNockFile(), serialized); - }); - break; + fs.writeFileSync(getNockFile(), v8.serialize(mocks)); + } + }); +} else if (process.env.NOCK_ENV === `replay`) { + globalThis.fetch = async (input, init) => { + try { + mocks ??= v8.deserialize(fs.readFileSync(getNockFile())); + } catch (error) { + if (error.code === `ENOENT`) { + throw new Error( + `No nock file found for this test run; run the tests with NOCK_ENV=record to generate one`, + {cause: error}, + ); + } + throw error; + } - case `replay`: { - const data = fs.readFileSync(getNockFile()); - const nockCallObjects = v8.deserialize(data); - nock.define(nockCallObjects); - break; - } + const mock = mocks.get(input.toString()); + if (!mock) throw new Error(`No mock found for ${input}; run the tests with NOCK_ENV=record to generate one`); - default: + return new Response(Buffer.from(mock.body, `base64`), { + status: mock.status, + headers: mock.headers, + }); + }; } diff --git a/vm2/README.md b/vm2/README.md deleted file mode 100644 index cffea1443..000000000 --- a/vm2/README.md +++ /dev/null @@ -1,2 +0,0 @@ -We don't use `vm2`, this is just a mock to avoid security warnings associated -with the actual `vm2` package. diff --git a/vm2/index.js b/vm2/index.js deleted file mode 100644 index fa01e7a27..000000000 --- a/vm2/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -module.exports = { - VM() {}, - VMScript() {}, -}; diff --git a/vm2/package.json b/vm2/package.json deleted file mode 100644 index 0967ef424..000000000 --- a/vm2/package.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/yarn.lock b/yarn.lock index bba984e59..cd609bd74 100644 --- a/yarn.lock +++ b/yarn.lock @@ -730,6 +730,13 @@ __metadata: languageName: node linkType: hard +"@fastify/busboy@npm:^2.0.0": + version: 2.1.0 + resolution: "@fastify/busboy@npm:2.1.0" + checksum: 7bb641080aac7cf01d88749ad331af10ba9ec3713ec07cabbe833908c75df21bd56249bb6173bdec07f5a41896b21e3689316f86684c06635da45f91ff4565a2 + languageName: node + linkType: hard + "@humanwhocodes/config-array@npm:^0.11.13": version: 0.11.13 resolution: "@humanwhocodes/config-array@npm:0.11.13" @@ -1159,13 +1166,6 @@ __metadata: languageName: node linkType: hard -"@tootallnate/quickjs-emscripten@npm:^0.23.0": - version: 0.23.0 - resolution: "@tootallnate/quickjs-emscripten@npm:0.23.0" - checksum: 2a939b781826fb5fd3edd0f2ec3b321d259d760464cf20611c9877205aaca3ccc0b7304dea68416baa0d568e82cd86b17d29548d1e5139fa3155a4a86a2b4b49 - languageName: node - linkType: hard - "@tsconfig/node10@npm:^1.0.7": version: 1.0.9 resolution: "@tsconfig/node10@npm:1.0.9" @@ -1311,6 +1311,15 @@ __metadata: languageName: node linkType: hard +"@types/proxy-from-env@npm:^1": + version: 1.0.4 + resolution: "@types/proxy-from-env@npm:1.0.4" + dependencies: + "@types/node": "npm:*" + checksum: ff2baedf8b5513ebf76bbe1b80079be45cc84c603951080656d2df64fcea2d3206489f22ec76f64cc3123b1c2a6836f97ed131a7456c769e22059dbca5904c35 + languageName: node + linkType: hard + "@types/semver@npm:^7.1.0, @types/semver@npm:^7.5.0": version: 7.5.6 resolution: "@types/semver@npm:7.5.6" @@ -1760,15 +1769,6 @@ __metadata: languageName: node linkType: hard -"ast-types@npm:^0.13.4": - version: 0.13.4 - resolution: "ast-types@npm:0.13.4" - dependencies: - tslib: "npm:^2.0.1" - checksum: 3a1a409764faa1471601a0ad01b3aa699292991aa9c8a30c7717002cabdf5d98008e7b53ae61f6e058f757fc6ba965e147967a93c13e62692c907d79cfb245f8 - languageName: node - linkType: hard - "asynciterator.prototype@npm:^1.0.0": version: 1.0.0 resolution: "asynciterator.prototype@npm:1.0.0" @@ -1877,13 +1877,6 @@ __metadata: languageName: node linkType: hard -"basic-ftp@npm:^5.0.2": - version: 5.0.4 - resolution: "basic-ftp@npm:5.0.4" - checksum: 0bd580652a4f75d5ea8e442e27921ff7089c91764f9eab975235d0b177bb7631339cbf50fb8f4cd5c94087ac6c003a8c80e33076228fd94e23e99d42531e3ac0 - languageName: node - linkType: hard - "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -2157,6 +2150,7 @@ __metadata: "@types/debug": "npm:^4.1.5" "@types/jest": "npm:^29.0.0" "@types/node": "npm:^20.4.6" + "@types/proxy-from-env": "npm:^1" "@types/semver": "npm:^7.1.0" "@types/tar": "npm:^6.0.0" "@types/which": "npm:^3.0.0" @@ -2172,13 +2166,13 @@ __metadata: eslint: "npm:^8.0.0" eslint-plugin-arca: "npm:^0.16.0" jest: "npm:^29.0.0" - nock: "npm:^13.0.4" - proxy-agent: "npm:^6.2.2" + proxy-from-env: "npm:^1.1.0" semver: "npm:^7.5.2" supports-color: "npm:^9.0.0" tar: "npm:^6.0.1" ts-node: "npm:^10.0.0" typescript: "npm:^5.0.4" + undici: "npm:^6.4.0" v8-compile-cache: "npm:^2.3.0" which: "npm:^4.0.0" languageName: unknown @@ -2219,13 +2213,6 @@ __metadata: languageName: node linkType: hard -"data-uri-to-buffer@npm:^6.0.0": - version: 6.0.1 - resolution: "data-uri-to-buffer@npm:6.0.1" - checksum: d8631b4be9c3dcac748023c0708e86abb272d346ed85979d0f5171d461f5426c013ef1313933e2ce3aa6dbdf8b53461e657f2243b14fb2483744dbb3cc4ed331 - languageName: node - linkType: hard - "debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" @@ -2286,17 +2273,6 @@ __metadata: languageName: node linkType: hard -"degenerator@npm:^5.0.0": - version: 5.0.1 - resolution: "degenerator@npm:5.0.1" - dependencies: - ast-types: "npm:^0.13.4" - escodegen: "npm:^2.1.0" - esprima: "npm:^4.0.1" - checksum: e48d8a651edeb512a648711a09afec269aac6de97d442a4bb9cf121a66877e0eec11b9727100a10252335c0666ae1c84a8bc1e3a3f47788742c975064d2c7b1c - languageName: node - linkType: hard - "detect-newline@npm:^3.0.0": version: 3.1.0 resolution: "detect-newline@npm:3.1.0" @@ -2617,24 +2593,6 @@ __metadata: languageName: node linkType: hard -"escodegen@npm:^2.1.0": - version: 2.1.0 - resolution: "escodegen@npm:2.1.0" - dependencies: - esprima: "npm:^4.0.1" - estraverse: "npm:^5.2.0" - esutils: "npm:^2.0.2" - source-map: "npm:~0.6.1" - dependenciesMeta: - source-map: - optional: true - bin: - escodegen: bin/escodegen.js - esgenerate: bin/esgenerate.js - checksum: e1450a1f75f67d35c061bf0d60888b15f62ab63aef9df1901cffc81cffbbb9e8b3de237c5502cf8613a017c1df3a3003881307c78835a1ab54d8c8d2206e01d3 - languageName: node - linkType: hard - "eslint-plugin-arca@npm:^0.16.0": version: 0.16.0 resolution: "eslint-plugin-arca@npm:0.16.0" @@ -2744,7 +2702,7 @@ __metadata: languageName: node linkType: hard -"esprima@npm:^4.0.0, esprima@npm:^4.0.1": +"esprima@npm:^4.0.0": version: 4.0.1 resolution: "esprima@npm:4.0.1" bin: @@ -2957,17 +2915,6 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^8.1.0": - version: 8.1.0 - resolution: "fs-extra@npm:8.1.0" - dependencies: - graceful-fs: "npm:^4.2.0" - jsonfile: "npm:^4.0.0" - universalify: "npm:^0.1.0" - checksum: 259f7b814d9e50d686899550c4f9ded85c46c643f7fe19be69504888e007fcbc08f306fae8ec495b8b998635e997c9e3e175ff2eeed230524ef1c1684cc96423 - languageName: node - linkType: hard - "fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -3088,18 +3035,6 @@ __metadata: languageName: node linkType: hard -"get-uri@npm:^6.0.1": - version: 6.0.2 - resolution: "get-uri@npm:6.0.2" - dependencies: - basic-ftp: "npm:^5.0.2" - data-uri-to-buffer: "npm:^6.0.0" - debug: "npm:^4.3.4" - fs-extra: "npm:^8.1.0" - checksum: 50ef3e0b76d202c41f4878e5d9f44ff125ce4ccc7a9f6a54d51bc633bf643e5e044cacdf5944a2554cdd2e10b7e92628e694b35ff2b943271afd37cde9570d5d - languageName: node - linkType: hard - "glob-parent@npm:^5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" @@ -3195,7 +3130,7 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.10, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": +"graceful-fs@npm:^4.2.10, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" checksum: 386d011a553e02bc594ac2ca0bd6d9e4c22d7fa8cfbfc448a6d148c59ea881b092db9dbe3547ae4b88e55f1b01f7c4a2ecc53b310c042793e63aa44cf6c257f2 @@ -3295,7 +3230,7 @@ __metadata: languageName: node linkType: hard -"https-proxy-agent@npm:^7.0.1, https-proxy-agent@npm:^7.0.2": +"https-proxy-agent@npm:^7.0.1": version: 7.0.2 resolution: "https-proxy-agent@npm:7.0.2" dependencies: @@ -3392,13 +3327,6 @@ __metadata: languageName: node linkType: hard -"ip@npm:^1.1.8": - version: 1.1.8 - resolution: "ip@npm:1.1.8" - checksum: ab32a5ecfa678d4c158c1381c4c6744fce89a1d793e1b6635ba79d0753c069030b672d765887b6fff55670c711dfa47475895e5d6013efbbcf04687c51cb8db9 - languageName: node - linkType: hard - "ip@npm:^2.0.0": version: 2.0.0 resolution: "ip@npm:2.0.0" @@ -4280,13 +4208,6 @@ __metadata: languageName: node linkType: hard -"json-stringify-safe@npm:^5.0.1": - version: 5.0.1 - resolution: "json-stringify-safe@npm:5.0.1" - checksum: 7dbf35cd0411d1d648dceb6d59ce5857ec939e52e4afc37601aa3da611f0987d5cee5b38d58329ceddf3ed48bd7215229c8d52059ab01f2444a338bf24ed0f37 - languageName: node - linkType: hard - "json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" @@ -4296,18 +4217,6 @@ __metadata: languageName: node linkType: hard -"jsonfile@npm:^4.0.0": - version: 4.0.0 - resolution: "jsonfile@npm:4.0.0" - dependencies: - graceful-fs: "npm:^4.1.6" - dependenciesMeta: - graceful-fs: - optional: true - checksum: 7dc94b628d57a66b71fb1b79510d460d662eb975b5f876d723f81549c2e9cd316d58a2ddf742b2b93a4fa6b17b2accaf1a738a0e2ea114bdfb13a32e5377e480 - languageName: node - linkType: hard - "jsx-ast-utils@npm:^2.4.1 || ^3.0.0": version: 3.3.5 resolution: "jsx-ast-utils@npm:3.3.5" @@ -4421,13 +4330,6 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^7.14.1": - version: 7.18.3 - resolution: "lru-cache@npm:7.18.3" - checksum: b3a452b491433db885beed95041eb104c157ef7794b9c9b4d647be503be91769d11206bb573849a16b4cc0d03cbd15ffd22df7960997788b74c1d399ac7a4fed - languageName: node - linkType: hard - "make-dir@npm:^4.0.0": version: 4.0.0 resolution: "make-dir@npm:4.0.0" @@ -4642,24 +4544,6 @@ __metadata: languageName: node linkType: hard -"netmask@npm:^2.0.2": - version: 2.0.2 - resolution: "netmask@npm:2.0.2" - checksum: cafd28388e698e1138ace947929f842944d0f1c0b87d3fa2601a61b38dc89397d33c0ce2c8e7b99e968584b91d15f6810b91bef3f3826adf71b1833b61d4bf4f - languageName: node - linkType: hard - -"nock@npm:^13.0.4": - version: 13.4.0 - resolution: "nock@npm:13.4.0" - dependencies: - debug: "npm:^4.1.0" - json-stringify-safe: "npm:^5.0.1" - propagate: "npm:^2.0.0" - checksum: b2e4407e71b6e9c42bc74bf631c008b79fa06b17e885d270b8f3ac7081d029dd966cd09024acb96ae5dd77a4737cc86951340715ffabece6893a62dc71ce5b08 - languageName: node - linkType: hard - "node-gyp@npm:latest": version: 10.0.1 resolution: "node-gyp@npm:10.0.1" @@ -4881,33 +4765,6 @@ __metadata: languageName: node linkType: hard -"pac-proxy-agent@npm:^7.0.1": - version: 7.0.1 - resolution: "pac-proxy-agent@npm:7.0.1" - dependencies: - "@tootallnate/quickjs-emscripten": "npm:^0.23.0" - agent-base: "npm:^7.0.2" - debug: "npm:^4.3.4" - get-uri: "npm:^6.0.1" - http-proxy-agent: "npm:^7.0.0" - https-proxy-agent: "npm:^7.0.2" - pac-resolver: "npm:^7.0.0" - socks-proxy-agent: "npm:^8.0.2" - checksum: 95b07e2a409511262d6e29be3d50f2e18ac387ef99664687ab4e92741d1d20fae97309722c37841583b024d1cde1790dd263a9b915d5241751b77f1e8003c418 - languageName: node - linkType: hard - -"pac-resolver@npm:^7.0.0": - version: 7.0.0 - resolution: "pac-resolver@npm:7.0.0" - dependencies: - degenerator: "npm:^5.0.0" - ip: "npm:^1.1.8" - netmask: "npm:^2.0.2" - checksum: a5ac1bf1f33f667a1c85fd61744672d9364534a1bb68a676ef920091b735ed8a10fc2b57385909e34822a2147b10a898dd79139b07dae0dbd568561d5c40a81b - languageName: node - linkType: hard - "parent-module@npm:^1.0.0": version: 1.0.1 resolution: "parent-module@npm:1.0.1" @@ -5060,29 +4917,6 @@ __metadata: languageName: node linkType: hard -"propagate@npm:^2.0.0": - version: 2.0.1 - resolution: "propagate@npm:2.0.1" - checksum: 01e1023b60ae4050d1a2783f976d7db702022dbdb70dba797cceedad8cfc01b3939c41e77032f8c32aa9d93192fe937ebba1345e8604e5ce61fd3b62ee3003b8 - languageName: node - linkType: hard - -"proxy-agent@npm:^6.2.2": - version: 6.3.1 - resolution: "proxy-agent@npm:6.3.1" - dependencies: - agent-base: "npm:^7.0.2" - debug: "npm:^4.3.4" - http-proxy-agent: "npm:^7.0.0" - https-proxy-agent: "npm:^7.0.2" - lru-cache: "npm:^7.14.1" - pac-proxy-agent: "npm:^7.0.1" - proxy-from-env: "npm:^1.1.0" - socks-proxy-agent: "npm:^8.0.2" - checksum: 72532eeae5f038873232905e17272eaecae5e5891b06f0f40cce139a84a4b19f482ab3ce586050fd2c64ca9171c7828ef183eb49c615f0faa359f1213063498a - languageName: node - linkType: hard - "proxy-from-env@npm:^1.1.0": version: 1.1.0 resolution: "proxy-from-env@npm:1.1.0" @@ -5408,7 +5242,7 @@ __metadata: languageName: node linkType: hard -"socks-proxy-agent@npm:^8.0.1, socks-proxy-agent@npm:^8.0.2": +"socks-proxy-agent@npm:^8.0.1": version: 8.0.2 resolution: "socks-proxy-agent@npm:8.0.2" dependencies: @@ -5439,7 +5273,7 @@ __metadata: languageName: node linkType: hard -"source-map@npm:^0.6.0, source-map@npm:^0.6.1, source-map@npm:~0.6.1": +"source-map@npm:^0.6.0, source-map@npm:^0.6.1": version: 0.6.1 resolution: "source-map@npm:0.6.1" checksum: ab55398007c5e5532957cb0beee2368529618ac0ab372d789806f5718123cc4367d57de3904b4e6a4170eb5a0b0f41373066d02ca0735a0c4d75c7d328d3e011 @@ -5735,7 +5569,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.0.1, tslib@npm:^2.4.0": +"tslib@npm:^2.4.0": version: 2.6.2 resolution: "tslib@npm:2.6.2" checksum: e03a8a4271152c8b26604ed45535954c0a45296e32445b4b87f8a5abdb2421f40b59b4ca437c4346af0f28179780d604094eb64546bee2019d903d01c6c19bdb @@ -5865,6 +5699,15 @@ __metadata: languageName: node linkType: hard +"undici@npm:^6.4.0": + version: 6.4.0 + resolution: "undici@npm:6.4.0" + dependencies: + "@fastify/busboy": "npm:^2.0.0" + checksum: d6b19daaa05ffa1ef9af0cd6c22867386f9caab16a807898ca8a321916ddab0c1a027c1346638b1a917abff1f7624967eb7e93111c45a8feafa0df36d9ca5b2b + languageName: node + linkType: hard + "unique-filename@npm:^3.0.0": version: 3.0.0 resolution: "unique-filename@npm:3.0.0" @@ -5883,13 +5726,6 @@ __metadata: languageName: node linkType: hard -"universalify@npm:^0.1.0": - version: 0.1.2 - resolution: "universalify@npm:0.1.2" - checksum: e70e0339f6b36f34c9816f6bf9662372bd241714dc77508d231d08386d94f2c4aa1ba1318614f92015f40d45aae1b9075cd30bd490efbe39387b60a76ca3f045 - languageName: node - linkType: hard - "update-browserslist-db@npm:^1.0.13": version: 1.0.13 resolution: "update-browserslist-db@npm:1.0.13"