From 45d1d1edd640f1dc9e2709c68256981a5de26680 Mon Sep 17 00:00:00 2001 From: Thomas Ankcorn Date: Thu, 9 Jan 2025 18:41:04 +0000 Subject: [PATCH] add dotenv support to wrangler secret bulk (#7674) * add dotenv support to wrangler secret bulk * remove x-versions arg * remove old --x-versions flag * PR feedback --------- Co-authored-by: Thomas Ankcorn --- .changeset/silver-plums-brake.md | 15 ++ fixtures/import-npm/package-lock.json | 185 +++++++++++++++ packages/wrangler/package.json | 2 +- .../src/__tests__/pages/secret.test.ts | 33 ++- .../wrangler/src/__tests__/secret.test.ts | 66 ++++-- .../__tests__/versions/secrets/bulk.test.ts | 37 ++- packages/wrangler/src/pages/secret/index.ts | 33 +-- packages/wrangler/src/secret/index.ts | 81 ++++--- .../wrangler/src/versions/secrets/bulk.ts | 38 +--- pnpm-lock.yaml | 214 ++++++++++++------ 10 files changed, 507 insertions(+), 197 deletions(-) create mode 100644 .changeset/silver-plums-brake.md create mode 100644 fixtures/import-npm/package-lock.json diff --git a/.changeset/silver-plums-brake.md b/.changeset/silver-plums-brake.md new file mode 100644 index 000000000000..97a3194ba3d1 --- /dev/null +++ b/.changeset/silver-plums-brake.md @@ -0,0 +1,15 @@ +--- +"wrangler": minor +--- + +Add support for env files to wrangler secret bulk i.e. `.dev.vars` + +Run `wrangler secret bulk .dev.vars` to add the env file + +```env +//.dev.vars +KEY=VALUE +KEY_2=VALUE +``` + +This will upload the secrets KEY and KEY_2 to your worker diff --git a/fixtures/import-npm/package-lock.json b/fixtures/import-npm/package-lock.json new file mode 100644 index 000000000000..9e43598b6605 --- /dev/null +++ b/fixtures/import-npm/package-lock.json @@ -0,0 +1,185 @@ +{ + "name": "import-npm", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "import-npm", + "workspaces": [ + "packages/*" + ] + }, + "../../packages/workers-tsconfig": { + "name": "@cloudflare/workers-tsconfig", + "version": "0.0.0", + "dev": true + }, + "../../packages/wrangler": { + "version": "3.99.0", + "dev": true, + "license": "MIT OR Apache-2.0", + "dependencies": { + "@cloudflare/kv-asset-handler": "workspace:*", + "@esbuild-plugins/node-globals-polyfill": "^0.2.3", + "@esbuild-plugins/node-modules-polyfill": "^0.2.2", + "blake3-wasm": "^2.1.5", + "chokidar": "^4.0.1", + "date-fns": "^4.1.0", + "esbuild": "0.17.19", + "itty-time": "^1.0.6", + "miniflare": "workspace:*", + "nanoid": "^3.3.3", + "path-to-regexp": "^6.3.0", + "resolve": "^1.22.8", + "selfsigned": "^2.0.1", + "source-map": "^0.6.1", + "unenv": "npm:unenv-nightly@2.0.0-20241218-183400-5d6aec3", + "workerd": "1.20241230.0", + "xxhash-wasm": "^1.0.1" + }, + "bin": { + "wrangler": "bin/wrangler.js", + "wrangler2": "bin/wrangler.js" + }, + "devDependencies": { + "@cloudflare/cli": "workspace:*", + "@cloudflare/eslint-config-worker": "workspace:*", + "@cloudflare/pages-shared": "workspace:^", + "@cloudflare/types": "6.18.4", + "@cloudflare/workers-shared": "workspace:*", + "@cloudflare/workers-tsconfig": "workspace:*", + "@cloudflare/workers-types": "^4.20241230.0", + "@cspotcode/source-map-support": "0.8.1", + "@iarna/toml": "^3.0.0", + "@microsoft/api-extractor": "^7.47.0", + "@sentry/node": "^7.86.0", + "@sentry/types": "^7.86.0", + "@sentry/utils": "^7.86.0", + "@types/body-parser": "^1.19.2", + "@types/command-exists": "^1.2.0", + "@types/express": "^4.17.13", + "@types/glob-to-regexp": "^0.4.1", + "@types/is-ci": "^3.0.0", + "@types/javascript-time-ago": "^2.0.3", + "@types/mime": "^3.0.4", + "@types/minimatch": "^5.1.2", + "@types/prompts": "^2.0.14", + "@types/resolve": "^1.20.6", + "@types/shell-quote": "^1.7.2", + "@types/signal-exit": "^3.0.1", + "@types/supports-color": "^8.1.1", + "@types/ws": "^8.5.7", + "@types/yargs": "^17.0.22", + "@vitest/ui": "catalog:default", + "@webcontainer/env": "^1.1.0", + "body-parser": "^1.20.0", + "chalk": "^5.2.0", + "cli-table3": "^0.6.3", + "cmd-shim": "^4.1.0", + "command-exists": "^1.2.9", + "concurrently": "^8.2.2", + "devtools-protocol": "^0.0.1182435", + "dotenv": "^16.3.1", + "execa": "^6.1.0", + "express": "^4.18.1", + "find-up": "^6.3.0", + "get-port": "^7.0.0", + "glob-to-regexp": "^0.4.1", + "http-terminator": "^3.2.0", + "https-proxy-agent": "7.0.2", + "ignore": "^5.2.0", + "is-ci": "^3.0.1", + "javascript-time-ago": "^2.5.4", + "md5-file": "5.0.0", + "mime": "^3.0.0", + "minimatch": "^5.1.0", + "mock-socket": "^9.3.1", + "msw": "2.4.3", + "open": "^8.4.0", + "p-queue": "^7.2.0", + "patch-console": "^1.0.0", + "pretty-bytes": "^6.0.0", + "prompts": "^2.4.2", + "semiver": "^1.1.0", + "shell-quote": "^1.8.1", + "signal-exit": "^3.0.7", + "strip-ansi": "^7.1.0", + "supports-color": "^9.2.2", + "timeago.js": "^4.0.2", + "ts-dedent": "^2.2.0", + "ts-json-schema-generator": "^1.5.0", + "undici": "catalog:default", + "update-check": "^1.5.4", + "vitest": "catalog:default", + "vitest-websocket-mock": "^0.4.0", + "ws": "^8.18.0", + "xdg-app-paths": "^8.3.0", + "yargs": "^17.7.2" + }, + "engines": { + "node": ">=16.17.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + }, + "peerDependencies": { + "@cloudflare/workers-types": "^4.20241230.0" + }, + "peerDependenciesMeta": { + "@cloudflare/workers-types": { + "optional": true + } + } + }, + "../import-wasm-static": {}, + "node_modules/@cloudflare/workers-tsconfig": { + "resolved": "../../packages/workers-tsconfig", + "link": true + }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/import-example": { + "resolved": "packages/import-example", + "link": true + }, + "node_modules/import-wasm-static": { + "resolved": "../import-wasm-static", + "link": true + }, + "node_modules/undici": { + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "node_modules/wrangler": { + "resolved": "../../packages/wrangler", + "link": true + }, + "packages/import-example": { + "dependencies": { + "import-wasm-static": "../../../../fixtures/import-wasm-static" + }, + "devDependencies": { + "@cloudflare/workers-tsconfig": "../../../../packages/workers-tsconfig", + "undici": "^5.28.4", + "wrangler": "../../../../packages/wrangler" + } + } + } +} diff --git a/packages/wrangler/package.json b/packages/wrangler/package.json index 59b00a16dcb9..bb67de36c35c 100644 --- a/packages/wrangler/package.json +++ b/packages/wrangler/package.json @@ -126,7 +126,7 @@ "command-exists": "^1.2.9", "concurrently": "^8.2.2", "devtools-protocol": "^0.0.1182435", - "dotenv": "^16.0.0", + "dotenv": "^16.3.1", "execa": "^6.1.0", "express": "^4.18.1", "find-up": "^6.3.0", diff --git a/packages/wrangler/src/__tests__/pages/secret.test.ts b/packages/wrangler/src/__tests__/pages/secret.test.ts index 642c830d0be4..e62bcd671295 100644 --- a/packages/wrangler/src/__tests__/pages/secret.test.ts +++ b/packages/wrangler/src/__tests__/pages/secret.test.ts @@ -513,7 +513,7 @@ describe("wrangler pages secret", () => { await expect( runWrangler(`pages secret bulk --project some-project-name`) ).rejects.toMatchInlineSnapshot( - `[Error: 🚨 Please provide a JSON file or valid JSON pipe]` + `[Error: 🚨 No content found in file or piped input.]` ); }); @@ -566,7 +566,6 @@ describe("wrangler pages secret", () => { text: "secret_text", }, ]); - await runWrangler( "pages secret bulk ./secret.json --project some-project-name" ); @@ -579,6 +578,36 @@ describe("wrangler pages secret", () => { expect(std.err).toMatchInlineSnapshot(`""`); }); + it("should create secret bulk w/ env file", async () => { + writeFileSync( + ".env", + `SECRET_1=secret-1\nSECRET_2=secret-2\nSECRET_3=secret-3` + ); + + mockProjectRequests([ + { + name: "SECRET_1", + text: "secret-1", + }, + { + name: "SECRET_2", + text: "secret-2", + }, + { + name: "SECRET_3", + text: "secret-3", + }, + ]); + await runWrangler("pages secret bulk .env --project some-project-name"); + + expect(std.out).toMatchInlineSnapshot(` + "🌀 Creating the secrets for the Pages project \\"some-project-name\\" (production) + Finished processing secrets JSON file: + ✨ 3 secrets successfully uploaded" + `); + expect(std.err).toMatchInlineSnapshot(`""`); + }); + it("should create secret bulk: preview", async () => { writeFileSync( "secret.json", diff --git a/packages/wrangler/src/__tests__/secret.test.ts b/packages/wrangler/src/__tests__/secret.test.ts index 757b7826cdba..656d2bc74721 100644 --- a/packages/wrangler/src/__tests__/secret.test.ts +++ b/packages/wrangler/src/__tests__/secret.test.ts @@ -762,10 +762,10 @@ describe("wrangler secret", () => { `"🌀 Creating the secrets for the Worker \\"script-name\\" "` ); expect(std.err).toMatchInlineSnapshot(` - "X [ERROR] 🚨 Please provide a JSON file or valid JSON pipe + "X [ERROR] 🚨 No content found in file, or piped input. - " - `); + " + `); expect(std.warn).toMatchInlineSnapshot(`""`); }); @@ -782,13 +782,13 @@ describe("wrangler secret", () => { await runWrangler(`secret bulk --name script-name`); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secrets for the Worker \\"script-name\\" - ✨ Successfully created secret for key: secret1 - ✨ Successfully created secret for key: password + "🌀 Creating the secrets for the Worker \\"script-name\\" + ✨ Successfully created secret for key: secret1 + ✨ Successfully created secret for key: password - Finished processing secrets JSON file: - ✨ 2 secrets successfully uploaded" - `); + Finished processing secrets file: + ✨ 2 secrets successfully uploaded" + `); expect(std.err).toMatchInlineSnapshot(`""`); expect(std.warn).toMatchInlineSnapshot(`""`); }); @@ -807,12 +807,34 @@ describe("wrangler secret", () => { await runWrangler("secret bulk ./secret.json --name script-name"); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secrets for the Worker \\"script-name\\" - ✨ Successfully created secret for key: secret-name-1 - ✨ Successfully created secret for key: secret-name-2 + "🌀 Creating the secrets for the Worker \\"script-name\\" + ✨ Successfully created secret for key: secret-name-1 + ✨ Successfully created secret for key: secret-name-2 - Finished processing secrets JSON file: - ✨ 2 secrets successfully uploaded" + Finished processing secrets file: + ✨ 2 secrets successfully uploaded" + `); + expect(std.err).toMatchInlineSnapshot(`""`); + expect(std.warn).toMatchInlineSnapshot(`""`); + }); + + it("should create secrets from a env file", async () => { + writeFileSync( + ".env", + `SECRET_NAME_1=secret_text\nSECRET_NAME_2=secret_text` + ); + + mockBulkRequest(); + + await runWrangler("secret bulk ./.env --name script-name"); + + expect(std.out).toMatchInlineSnapshot(` + "🌀 Creating the secrets for the Worker \\"script-name\\" + ✨ Successfully created secret for key: SECRET_NAME_1 + ✨ Successfully created secret for key: SECRET_NAME_2 + + Finished processing secrets file: + ✨ 2 secrets successfully uploaded" `); expect(std.err).toMatchInlineSnapshot(`""`); expect(std.warn).toMatchInlineSnapshot(`""`); @@ -989,13 +1011,13 @@ describe("wrangler secret", () => { await runWrangler("secret bulk ./secret.json --name script-name"); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secrets for the Worker \\"script-name\\" - ✨ Successfully created secret for key: secret-name-2 - ✨ Successfully created secret for key: secret-name-3 - ✨ Successfully created secret for key: secret-name-4 + "🌀 Creating the secrets for the Worker \\"script-name\\" + ✨ Successfully created secret for key: secret-name-2 + ✨ Successfully created secret for key: secret-name-3 + ✨ Successfully created secret for key: secret-name-4 - Finished processing secrets JSON file: - ✨ 3 secrets successfully uploaded" + Finished processing secrets file: + ✨ 3 secrets successfully uploaded" `); expect(std.err).toMatchInlineSnapshot(`""`); expect(std.warn).toMatchInlineSnapshot(`""`); @@ -1050,7 +1072,7 @@ describe("wrangler secret", () => { ✨ Successfully created secret for key: secret-name-1 ✨ Successfully created secret for key: secret-name-2 - Finished processing secrets JSON file: + Finished processing secrets file: ✨ 2 secrets successfully uploaded" `); }); @@ -1065,7 +1087,7 @@ describe("wrangler secret", () => { "wrangler secret:bulk [json] POSITIONALS - json The JSON file of key-value pairs to upload, in form {\\"key\\": value, ...} [string] + json The file of key-value pairs to upload, as JSON in form {\\"key\\": value, ...} or .dev.vars file in the form KEY=VALUE [string] GLOBAL FLAGS -c, --config Path to Wrangler configuration file [string] diff --git a/packages/wrangler/src/__tests__/versions/secrets/bulk.test.ts b/packages/wrangler/src/__tests__/versions/secrets/bulk.test.ts index 659268bdc4dc..78d62bb287cd 100644 --- a/packages/wrangler/src/__tests__/versions/secrets/bulk.test.ts +++ b/packages/wrangler/src/__tests__/versions/secrets/bulk.test.ts @@ -27,7 +27,7 @@ describe("versions secret bulk", () => { `"🌀 Creating the secrets for the Worker \\"script-name\\" "` ); expect(std.err).toMatchInlineSnapshot(` - "X [ERROR] Unable to parse JSON from the input, please ensure you're passing valid JSON + "X [ERROR] No content found in file or piped input. " `); @@ -73,6 +73,27 @@ describe("versions secret bulk", () => { expect(std.err).toMatchInlineSnapshot(`""`); }); + test("uploading secrets from env file", async () => { + await writeFile( + ".env", + "SECRET_1=secret-1\nSECRET_2=secret-2\nSECRET_3=secret-3" + ); + mockSetupApiCalls(); + mockPostVersion(); + await runWrangler(`versions secret bulk .env --name script-name`); + expect(std.out).toMatchInlineSnapshot( + ` + "🌀 Creating the secrets for the Worker \\"script-name\\" + ✨ Successfully created secret for key: SECRET_1 + ✨ Successfully created secret for key: SECRET_2 + ✨ Successfully created secret for key: SECRET_3 + ✨ Success! Created version id with 3 secrets. + ➡️ To deploy this version to production traffic use the command \\"wrangler versions deploy\\"." + ` + ); + expect(std.err).toMatchInlineSnapshot(`""`); + }); + test("no wrangler configuration warnings shown", async () => { await writeFile("secrets.json", JSON.stringify({ SECRET_1: "secret-1" })); await writeFile("wrangler.json", JSON.stringify({ invalid_field: true })); @@ -125,15 +146,11 @@ describe("versions secret bulk", () => { test("should error on invalid json file", async () => { await writeFile("secrets.json", "not valid json :(", { encoding: "utf8" }); - await runWrangler(`versions secret bulk secrets.json --name script-name`); - expect(std.out).toMatchInlineSnapshot( - `"🌀 Creating the secrets for the Worker \\"script-name\\" "` + await expect( + runWrangler(`versions secret bulk secrets.json --name script-name`) + ).rejects.toThrowError( + `The contents of "secrets.json" is not valid JSON: "ParseError: Unexpected token o"` ); - expect(std.err).toMatchInlineSnapshot(` - "X [ERROR] Unable to parse JSON file, please ensure the file passed is valid JSON. - - " - `); }); test("should error on invalid json stdin", async () => { @@ -162,7 +179,7 @@ describe("versions secret bulk", () => { `"🌀 Creating the secrets for the Worker \\"script-name\\" "` ); expect(std.err).toMatchInlineSnapshot(` - "X [ERROR] Unable to parse JSON from the input, please ensure you're passing valid JSON + "X [ERROR] No content found in file or piped input. " `); diff --git a/packages/wrangler/src/pages/secret/index.ts b/packages/wrangler/src/pages/secret/index.ts index fe12608945f6..c4dcc1f10c79 100644 --- a/packages/wrangler/src/pages/secret/index.ts +++ b/packages/wrangler/src/pages/secret/index.ts @@ -1,5 +1,3 @@ -import path from "node:path"; -import readline from "node:readline"; import chalk from "chalk"; import { fetchResult } from "../../cfetch"; import { configFileName, readPagesConfig } from "../../config"; @@ -11,7 +9,7 @@ import { printWranglerBanner } from "../../index"; import isInteractive from "../../is-interactive"; import { logger } from "../../logger"; import * as metrics from "../../metrics"; -import { parseJSON, readFileSync } from "../../parse"; +import { parseBulkInputToObject } from "../../secret"; import { requireAuth } from "../../user"; import { readFromStdin, trimTrailingWhitespace } from "../../utils/std"; import { PAGES_CONFIG_CACHE_FILENAME } from "../constants"; @@ -172,7 +170,7 @@ export const secret = (secretYargs: CommonYargsArgv, subHelp: SubHelp) => { (yargs) => { return yargs .positional("json", { - describe: `The JSON file of key-value pairs to upload, in form {"key": value, ...}`, + describe: `The file of key-value pairs to upload, as JSON in form {"key": value, ...} or .dev.vars file in the form KEY=VALUE`, type: "string", }) .option("project-name", { @@ -191,33 +189,10 @@ export const secret = (secretYargs: CommonYargsArgv, subHelp: SubHelp) => { logger.log( `🌀 Creating the secrets for the Pages project "${project.name}" (${env})` ); - - let content: Record; - if (args.json) { - const jsonFilePath = path.resolve(args.json); - content = parseJSON>( - readFileSync(jsonFilePath), - jsonFilePath - ); - } else { - try { - const rl = readline.createInterface({ input: process.stdin }); - let pipedInput = ""; - for await (const line of rl) { - pipedInput += line; - } - content = parseJSON>(pipedInput); - } catch { - throw new FatalError( - `🚨 Please provide a JSON file or valid JSON pipe` - ); - } - } + const content = await parseBulkInputToObject(args.json); if (!content) { - throw new FatalError( - `🚨 No content found in JSON file or piped input.` - ); + throw new FatalError(`🚨 No content found in file or piped input.`); } const upsertBindings = Object.fromEntries( diff --git a/packages/wrangler/src/secret/index.ts b/packages/wrangler/src/secret/index.ts index 5b6adf063139..da28a24ed5e6 100644 --- a/packages/wrangler/src/secret/index.ts +++ b/packages/wrangler/src/secret/index.ts @@ -1,5 +1,6 @@ import path from "node:path"; import readline from "node:readline"; +import { parse as dotenvParse } from "dotenv"; import { FormData } from "undici"; import { fetchResult } from "../cfetch"; import { configFileName, readConfig } from "../config"; @@ -377,7 +378,7 @@ export const secret = (secretYargs: CommonYargsArgv) => { export const secretBulkOptions = (yargs: CommonYargsArgv) => { return yargs .positional("json", { - describe: `The JSON file of key-value pairs to upload, in form {"key": value, ...}`, + describe: `The file of key-value pairs to upload, as JSON in form {"key": value, ...} or .dev.vars file in the form KEY=VALUE`, type: "string", }) .option("name", { @@ -424,35 +425,10 @@ export const secretBulkHandler = async (secretBulkArgs: SecretBulkArgs) => { }` ); - let content: Record; - if (secretBulkArgs.json) { - const jsonFilePath = path.resolve(secretBulkArgs.json); - try { - content = parseJSON>( - readFileSync(jsonFilePath), - jsonFilePath - ); - } catch (e) { - throw new FatalError( - `The contents of "${secretBulkArgs.json}" is not valid JSON: "${e}"` - ); - } - validateJSONFileSecrets(content, secretBulkArgs.json); - } else { - try { - const rl = readline.createInterface({ input: process.stdin }); - let pipedInput = ""; - for await (const line of rl) { - pipedInput += line; - } - content = parseJSON>(pipedInput); - } catch { - return logger.error(`🚨 Please provide a JSON file or valid JSON pipe`); - } - } + const content = await parseBulkInputToObject(secretBulkArgs.json); if (!content) { - return logger.error(`🚨 No content found in JSON file or piped input.`); + return logger.error(`🚨 No content found in file, or piped input.`); } function getSettings() { @@ -476,7 +452,6 @@ export const secretBulkHandler = async (secretBulkArgs: SecretBulkArgs) => { const data = new FormData(); data.set("settings", JSON.stringify({ bindings })); - return fetchResult(url, { method: "PATCH", body: data, @@ -535,7 +510,7 @@ export const secretBulkHandler = async (secretBulkArgs: SecretBulkArgs) => { ); } logger.log(""); - logger.log("Finished processing secrets JSON file:"); + logger.log("Finished processing secrets file:"); logger.log(`✨ ${upsertBindings.length} secrets successfully uploaded`); } catch (err) { logger.log(""); @@ -545,7 +520,7 @@ export const secretBulkHandler = async (secretBulkArgs: SecretBulkArgs) => { } }; -export function validateJSONFileSecrets( +export function validateFileSecrets( content: unknown, jsonFilePath: string ): asserts content is Record { @@ -563,3 +538,47 @@ export function validateJSONFileSecrets( } } } + +export async function parseBulkInputToObject(input?: string) { + let content: Record; + if (input) { + const jsonFilePath = path.resolve(input); + try { + const fileContent = readFileSync(jsonFilePath); + try { + content = parseJSON>(fileContent); + } catch (e) { + content = dotenvParse(fileContent); + // dotenvParse does not error unless fileContent is undefined, no keys === error + if (Object.keys(content).length === 0) { + throw e; + } + } + } catch (e) { + throw new FatalError( + `The contents of "${input}" is not valid JSON: "${e}"` + ); + } + validateFileSecrets(content, input); + } else { + try { + const rl = readline.createInterface({ input: process.stdin }); + let pipedInput = ""; + for await (const line of rl) { + pipedInput += line; + } + try { + content = parseJSON>(pipedInput); + } catch (e) { + content = dotenvParse(pipedInput); + // dotenvParse does not error unless fileContent is undefined, no keys === error + if (Object.keys(content).length === 0) { + throw e; + } + } + } catch { + return; + } + } + return content; +} diff --git a/packages/wrangler/src/versions/secrets/bulk.ts b/packages/wrangler/src/versions/secrets/bulk.ts index c8dbabc59721..3aa939c2ffcf 100644 --- a/packages/wrangler/src/versions/secrets/bulk.ts +++ b/packages/wrangler/src/versions/secrets/bulk.ts @@ -1,13 +1,10 @@ -import path from "node:path"; -import readline from "node:readline"; import { fetchResult } from "../../cfetch"; import { configFileName } from "../../config"; import { createCommand } from "../../core/create-command"; import { UserError } from "../../errors"; import { getLegacyScriptName } from "../../index"; import { logger } from "../../logger"; -import { parseJSON, readFileSync } from "../../parse"; -import { validateJSONFileSecrets } from "../../secret"; +import { parseBulkInputToObject } from "../../secret"; import { requireAuth } from "../../user"; import { copyWorkerVersionWithNewSecrets } from "./index"; import type { WorkerVersion } from "./index"; @@ -23,7 +20,7 @@ export const versionsSecretBulkCommand = createCommand({ }, args: { json: { - describe: `The JSON file of key-value pairs to upload, in form {"key": value, ...}`, + describe: `The file of key-value pairs to upload, as JSON in form {"key": value, ...} or .dev.vars file in the form KEY=VALUE`, type: "string", }, name: { @@ -57,37 +54,10 @@ export const versionsSecretBulkCommand = createCommand({ `🌀 Creating the secrets for the Worker "${scriptName}" ${args.env ? `(${args.env})` : ""}` ); - let content: Record; - if (args.json) { - const jsonFilePath = path.resolve(args.json); - try { - content = parseJSON>( - readFileSync(jsonFilePath), - jsonFilePath - ); - } catch (e) { - return logger.error( - "Unable to parse JSON file, please ensure the file passed is valid JSON." - ); - } - validateJSONFileSecrets(content, args.json); - } else { - try { - const rl = readline.createInterface({ input: process.stdin }); - let pipedInput = ""; - for await (const line of rl) { - pipedInput += line; - } - content = parseJSON>(pipedInput); - } catch { - return logger.error( - "Unable to parse JSON from the input, please ensure you're passing valid JSON" - ); - } - } + const content = await parseBulkInputToObject(args.json); if (!content) { - return logger.error(`No content found in JSON file or piped input.`); + return logger.error(`No content found in file or piped input.`); } const secrets = Object.entries(content).map(([key, value]) => ({ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5e07c15094d5..c6d952e76c39 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -120,7 +120,7 @@ importers: version: 5.0.12(@types/node@18.19.59) vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) fixtures/additional-modules: devDependencies: @@ -138,7 +138,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -156,7 +156,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -183,7 +183,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -204,7 +204,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -222,7 +222,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -243,7 +243,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -267,7 +267,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -291,7 +291,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) fixtures/isomorphic-random-example: {} @@ -316,7 +316,7 @@ importers: version: 5.6.3 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -328,7 +328,7 @@ importers: version: 7.0.0 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -353,7 +353,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -371,7 +371,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -398,7 +398,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -416,7 +416,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -437,7 +437,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -465,7 +465,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -483,7 +483,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -501,7 +501,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -522,7 +522,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -540,7 +540,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -577,7 +577,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -598,7 +598,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -634,7 +634,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -652,7 +652,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -670,7 +670,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -688,7 +688,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -706,7 +706,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -724,7 +724,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -742,7 +742,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -760,7 +760,7 @@ importers: version: 5.6.3 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -781,7 +781,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -821,7 +821,7 @@ importers: devDependencies: vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -863,7 +863,7 @@ importers: version: 5.6.3 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -890,7 +890,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -922,7 +922,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -943,7 +943,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -964,7 +964,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -982,7 +982,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -1000,7 +1000,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../../packages/wrangler @@ -1738,7 +1738,7 @@ importers: version: 5.28.4 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) packages/workers-editor-shared: dependencies: @@ -1945,7 +1945,7 @@ importers: version: 5.6.3 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) packages/workers-tsconfig: {} @@ -1968,7 +1968,7 @@ importers: version: 5.6.3 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: specifier: workspace:* version: link:../wrangler @@ -2011,7 +2011,7 @@ importers: version: 5.6.3 vitest: specifier: catalog:default - version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + version: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) packages/wrangler: dependencies: @@ -2186,7 +2186,7 @@ importers: specifier: ^0.0.1182435 version: 0.0.1182435 dotenv: - specifier: ^16.0.0 + specifier: ^16.3.1 version: 16.3.1 execa: specifier: ^6.1.0 @@ -9013,7 +9013,7 @@ packages: resolution: {integrity: sha512-c6sTQ2AFX8WT8Epd6icTxulC6Z/pzqIlEiywTvy5e5VJw8uKxJLs997I3v71nJ9XXs4B5HPxWayflhycaCJiaQ==} peerDependencies: fela: '>= 11.3.1' - react: '>= 16.3.0' + react: '>= 16.3.0 || 18' react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} @@ -11274,7 +11274,7 @@ snapshots: '@babel/traverse': 7.24.5 '@babel/types': 7.25.2 convert-source-map: 2.0.0 - debug: 4.3.7(supports-color@9.2.2) + debug: 4.3.7(supports-color@8.1.1) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -11294,7 +11294,7 @@ snapshots: '@babel/traverse': 7.25.9 '@babel/types': 7.25.9 convert-source-map: 2.0.0 - debug: 4.3.7(supports-color@9.2.2) + debug: 4.3.7(supports-color@8.1.1) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -11314,7 +11314,7 @@ snapshots: '@babel/traverse': 7.25.9 '@babel/types': 7.26.3 convert-source-map: 2.0.0 - debug: 4.3.7(supports-color@9.2.2) + debug: 4.3.7(supports-color@8.1.1) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -11525,7 +11525,7 @@ snapshots: '@babel/helper-split-export-declaration': 7.24.5 '@babel/parser': 7.25.3 '@babel/types': 7.25.2 - debug: 4.3.7(supports-color@9.2.2) + debug: 4.3.7(supports-color@8.1.1) globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -11537,7 +11537,7 @@ snapshots: '@babel/parser': 7.25.9 '@babel/template': 7.25.9 '@babel/types': 7.25.9 - debug: 4.3.7(supports-color@9.2.2) + debug: 4.3.7(supports-color@8.1.1) globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -12002,7 +12002,7 @@ snapshots: esbuild: 0.17.19 miniflare: 3.20241106.1 semver: 7.5.4 - vitest: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + vitest: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8) wrangler: 3.90.0(@cloudflare/workers-types@4.20241230.0) zod: 3.22.3 transitivePeerDependencies: @@ -12604,7 +12604,7 @@ snapshots: '@mapbox/node-pre-gyp@1.0.11(encoding@0.1.13)': dependencies: detect-libc: 2.0.2 - https-proxy-agent: 5.0.1(supports-color@9.2.2) + https-proxy-agent: 5.0.1 make-dir: 3.1.0 node-fetch: 2.6.11(encoding@0.1.13) nopt: 5.0.0 @@ -13860,7 +13860,7 @@ snapshots: '@typescript-eslint/types': 7.18.0 '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.6.3) '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.7(supports-color@9.2.2) + debug: 4.3.7(supports-color@8.1.1) eslint: 8.57.0 optionalDependencies: typescript: 5.6.3 @@ -13893,7 +13893,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.6.3) '@typescript-eslint/utils': 7.18.0(eslint@8.57.0)(typescript@5.6.3) - debug: 4.3.7(supports-color@9.2.2) + debug: 4.3.7(supports-color@8.1.1) eslint: 8.57.0 ts-api-utils: 1.4.3(typescript@5.6.3) optionalDependencies: @@ -13923,7 +13923,7 @@ snapshots: dependencies: '@typescript-eslint/types': 7.18.0 '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.7(supports-color@9.2.2) + debug: 4.3.7(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.5 @@ -14194,12 +14194,24 @@ snapshots: acorn@8.14.0: {} + agent-base@6.0.2: + dependencies: + debug: 4.3.7(supports-color@8.1.1) + transitivePeerDependencies: + - supports-color + agent-base@6.0.2(supports-color@9.2.2): dependencies: debug: 4.3.7(supports-color@9.2.2) transitivePeerDependencies: - supports-color + agent-base@7.1.0: + dependencies: + debug: 4.3.7(supports-color@8.1.1) + transitivePeerDependencies: + - supports-color + agent-base@7.1.0(supports-color@9.2.2): dependencies: debug: 4.3.7(supports-color@9.2.2) @@ -14714,7 +14726,7 @@ snapshots: capnp-ts@0.5.1: dependencies: - debug: 4.3.7(supports-color@9.2.2) + debug: 4.3.7(supports-color@8.1.1) format: 0.2.2 tslib: 2.5.3 utf8-encoding: 0.1.2 @@ -16392,7 +16404,7 @@ snapshots: dependencies: basic-ftp: 5.0.3 data-uri-to-buffer: 5.0.1 - debug: 4.3.7(supports-color@9.2.2) + debug: 4.3.7(supports-color@8.1.1) fs-extra: 8.1.0 transitivePeerDependencies: - supports-color @@ -16647,7 +16659,7 @@ snapshots: http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.3 - debug: 4.3.7(supports-color@9.2.2) + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -16663,6 +16675,13 @@ snapshots: quick-lru: 5.1.1 resolve-alpn: 1.2.1 + https-proxy-agent@5.0.1: + dependencies: + agent-base: 6.0.2 + debug: 4.3.7(supports-color@8.1.1) + transitivePeerDependencies: + - supports-color + https-proxy-agent@5.0.1(supports-color@9.2.2): dependencies: agent-base: 6.0.2(supports-color@9.2.2) @@ -16670,6 +16689,13 @@ snapshots: transitivePeerDependencies: - supports-color + https-proxy-agent@7.0.2: + dependencies: + agent-base: 7.1.0 + debug: 4.3.6(supports-color@9.2.2) + transitivePeerDependencies: + - supports-color + https-proxy-agent@7.0.2(supports-color@9.2.2): dependencies: agent-base: 7.1.0(supports-color@9.2.2) @@ -16680,7 +16706,7 @@ snapshots: https-proxy-agent@7.0.6: dependencies: agent-base: 7.1.3 - debug: 4.3.7(supports-color@9.2.2) + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -17936,11 +17962,11 @@ snapshots: pac-proxy-agent@7.0.1: dependencies: '@tootallnate/quickjs-emscripten': 0.23.0 - agent-base: 7.1.0(supports-color@9.2.2) - debug: 4.3.7(supports-color@9.2.2) + agent-base: 7.1.0 + debug: 4.3.7(supports-color@8.1.1) get-uri: 6.0.1 http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.2(supports-color@9.2.2) + https-proxy-agent: 7.0.2 pac-resolver: 7.0.0 socks-proxy-agent: 8.0.2 transitivePeerDependencies: @@ -18463,10 +18489,10 @@ snapshots: proxy-agent@6.3.1: dependencies: - agent-base: 7.1.0(supports-color@9.2.2) - debug: 4.3.7(supports-color@9.2.2) + agent-base: 7.1.0 + debug: 4.3.7(supports-color@8.1.1) http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.2(supports-color@9.2.2) + https-proxy-agent: 7.0.2 lru-cache: 7.18.3 pac-proxy-agent: 7.0.1 proxy-from-env: 1.1.0 @@ -19105,8 +19131,8 @@ snapshots: socks-proxy-agent@8.0.2: dependencies: - agent-base: 7.1.0(supports-color@9.2.2) - debug: 4.3.7(supports-color@9.2.2) + agent-base: 7.1.0 + debug: 4.3.7(supports-color@8.1.1) socks: 2.7.1 transitivePeerDependencies: - supports-color @@ -19921,6 +19947,23 @@ snapshots: vary@1.1.2: {} + vite-node@2.1.8(@types/node@18.19.59): + dependencies: + cac: 6.7.14 + debug: 4.3.7(supports-color@8.1.1) + es-module-lexer: 1.5.4 + pathe: 1.1.2 + vite: 5.0.12(@types/node@18.19.59) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + vite-node@2.1.8(@types/node@18.19.59)(supports-color@9.2.2): dependencies: cac: 6.7.14 @@ -20010,6 +20053,41 @@ snapshots: mock-socket: 9.3.1 vitest: 2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2) + vitest@2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8): + dependencies: + '@vitest/expect': 2.1.8 + '@vitest/mocker': 2.1.8(msw@2.4.3(typescript@5.6.3))(vite@5.0.12(@types/node@18.19.59)) + '@vitest/pretty-format': 2.1.8 + '@vitest/runner': 2.1.8 + '@vitest/snapshot': 2.1.8 + '@vitest/spy': 2.1.8 + '@vitest/utils': 2.1.8 + chai: 5.1.2 + debug: 4.3.7(supports-color@8.1.1) + expect-type: 1.1.0 + magic-string: 0.30.14 + pathe: 1.1.2 + std-env: 3.8.0 + tinybench: 2.9.0 + tinyexec: 0.3.1 + tinypool: 1.0.1 + tinyrainbow: 1.2.0 + vite: 5.0.12(@types/node@18.19.59) + vite-node: 2.1.8(@types/node@18.19.59) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 18.19.59 + '@vitest/ui': 2.1.8(vitest@2.1.8) + transitivePeerDependencies: + - less + - lightningcss + - msw + - sass + - stylus + - sugarss + - supports-color + - terser + vitest@2.1.8(@types/node@18.19.59)(@vitest/ui@2.1.8)(msw@2.4.3(typescript@5.6.3))(supports-color@9.2.2): dependencies: '@vitest/expect': 2.1.8