@zuplo/cli 6.70.3 → 6.70.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/cli.js +4 -0
  2. package/dist/cli.js.map +1 -1
  3. package/dist/common/analytics/cli-invocation.d.ts +15 -0
  4. package/dist/common/analytics/cli-invocation.d.ts.map +1 -0
  5. package/dist/common/analytics/cli-invocation.js +39 -0
  6. package/dist/common/analytics/cli-invocation.js.map +1 -0
  7. package/dist/common/analytics/cli-invocation.test.d.ts +2 -0
  8. package/dist/common/analytics/cli-invocation.test.d.ts.map +1 -0
  9. package/dist/common/analytics/cli-invocation.test.js +51 -0
  10. package/dist/common/analytics/cli-invocation.test.js.map +1 -0
  11. package/dist/common/analytics/lib.d.ts.map +1 -1
  12. package/dist/common/analytics/lib.js +5 -1
  13. package/dist/common/analytics/lib.js.map +1 -1
  14. package/dist/common/analytics/package-manager.d.ts +43 -0
  15. package/dist/common/analytics/package-manager.d.ts.map +1 -0
  16. package/dist/common/analytics/package-manager.js +155 -0
  17. package/dist/common/analytics/package-manager.js.map +1 -0
  18. package/dist/common/analytics/package-manager.test.d.ts +2 -0
  19. package/dist/common/analytics/package-manager.test.d.ts.map +1 -0
  20. package/dist/common/analytics/package-manager.test.js +163 -0
  21. package/dist/common/analytics/package-manager.test.js.map +1 -0
  22. package/dist/tsconfig.tsbuildinfo +1 -1
  23. package/node_modules/@zuplo/core/package.json +1 -1
  24. package/node_modules/@zuplo/graphql/package.json +1 -1
  25. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  26. package/node_modules/@zuplo/otel/package.json +1 -1
  27. package/node_modules/@zuplo/runtime/package.json +1 -1
  28. package/package.json +6 -6
package/dist/cli.js CHANGED
@@ -32,6 +32,7 @@ import test from "./cmds/test.js";
32
32
  import tunnel from "./cmds/tunnel/index.js";
33
33
  import variable from "./cmds/variable/index.js";
34
34
  import whoami from "./cmds/whoami.js";
35
+ import { captureCliInvocationEvent } from "./common/analytics/cli-invocation.js";
35
36
  import { shutdownAnalytics } from "./common/analytics/lib.js";
36
37
  import { ApiError } from "./common/api/client.js";
37
38
  import { MAX_WAIT_PENDING_TIME_MS, SENTRY_DSN } from "./common/constants.js";
@@ -88,6 +89,9 @@ if (gte(process.versions.node, MIN_NODE_VERSION)) {
88
89
  .middleware(setBlocking)
89
90
  .middleware(logLevel)
90
91
  .middleware(checkPnpmLifecycle)
92
+ .middleware((argv) => {
93
+ void captureCliInvocationEvent(argv, cliVersion);
94
+ })
91
95
  .command(compile)
92
96
  .command(customDomain)
93
97
  .command(deleteZup)
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAG7B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,IAAI,MAAM,gBAAgB,CAA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AC;SACf,OAAO,CAAC;QACP,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,KAAK,CAAC,0DAA0D,CAAC,CAAC;QAC1E,CAAC;KACF,CAAC;SACD,aAAa,EAAE;SACf,cAAc,EAAE;SAChB,OAAO,CAAC,UAAU,CAAC;SACnB,IAAI,CAAC,KAAK,CAAC;SACX,IAAI,EAAE,CAAC;IAEV,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,CAAC;QACH,MAAM,GAAG,CAAC,IAAI,CAAC;QAGf,KAAK,qBAAqB,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,QAAQ,GAAG,CAAC,CAAC;QACb,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;YACzB,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC;QACD,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;QAG9B,CAAC;aAAM,CAAC;YACN,6BAA6B,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC;YAClD,GAAG,CAAC,QAAQ,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,iBAAiB,EAAE,CAAC;QAC1B,MAAM,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC7C,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;AACH,CAAC;KAAM,CAAC;IACN,MAAM,oCAAoC,CACxC,4CAA4C,gBAAgB,oBAAoB,OAAO,CAAC,QAAQ,CAAC,IAAI;;oFAErB,CACjF,CAAC;AACJ,CAAC","sourcesContent":["import * as dotenv from \"dotenv\";\n\ndotenv.config();\n\nimport { readFileSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nimport { confirm } from \"@inquirer/prompts\";\nimport * as Sentry from \"@sentry/node\";\nimport { gte } from \"semver\";\n// Undici must be imported first to set the global dispatcher\n// If fetch is used before undici, the process will crash\nimport undici from \"undici\";\nimport { hideBin } from \"yargs/helpers\";\nimport yargs from \"yargs/yargs\";\nimport bucket from \"./cmds/bucket/index.js\";\nimport build from \"./cmds/build.js\";\nimport compile from \"./cmds/compile.js\";\nimport customDomain from \"./cmds/custom-domain/index.js\";\nimport deleteZup from \"./cmds/delete.js\";\nimport deploy from \"./cmds/deploy.js\";\nimport dev from \"./cmds/dev.js\";\nimport docs from \"./cmds/docs.js\";\nimport editor from \"./cmds/editor.js\";\nimport info from \"./cmds/info.js\";\nimport init from \"./cmds/init.js\";\nimport link from \"./cmds/link.js\";\nimport list from \"./cmds/list.js\";\nimport login from \"./cmds/login.js\";\nimport logout from \"./cmds/logout.js\";\nimport mtlsCertificates from \"./cmds/mtls-certificates/index.js\";\nimport oas from \"./cmds/open-api/index.js\";\nimport project from \"./cmds/project/index.js\";\nimport proxies from \"./cmds/proxies/index.js\";\nimport source from \"./cmds/source/index.js\";\nimport test from \"./cmds/test.js\";\nimport tunnel from \"./cmds/tunnel/index.js\";\nimport variable from \"./cmds/variable/index.js\";\nimport whoami from \"./cmds/whoami.js\";\nimport { shutdownAnalytics } from \"./common/analytics/lib.js\";\nimport { ApiError } from \"./common/api/client.js\";\nimport { MAX_WAIT_PENDING_TIME_MS, SENTRY_DSN } from \"./common/constants.js\";\nimport { logger } from \"./common/logger.js\";\nimport { checkPnpmLifecycle } from \"./common/middleware/check-pnpm-lifecycle.js\";\nimport { logLevel } from \"./common/middleware/logging.js\";\nimport { warnIfOutdatedVersion, warnNodeVersion } from \"./common/outdated.js\";\nimport setBlocking, {\n printCriticalFailureToConsole,\n printCriticalFailureToConsoleAndExit,\n} from \"./common/output.js\";\n\n// This allows us to stop the CLI from executing so we can connect the profiler\n\n// biome-ignore lint/style/noProcessEnv: Migrated from ESLint\nif (process.env.ZUPLO_CLI_PROFILING) {\n await confirm({ message: \"Continue executing CLI?\", default: true });\n}\n\n// Note: We cannot set this to be higher than 18.0.0 because of the way\n// our documentation works -- we tell them to use npx @zuplo/cli@latest (even in CI/CD jobs)\n// If we set this to be higher than 18.0.0, then we will break them.\n// Instead we set the value in package.json to be engine.node >= 20.0.0, so it will warn\nconst MIN_NODE_VERSION = \"18.0.0\";\nconst RECOMMENDED_NODE_VERSION = \"20.0.0\";\n\nif (gte(process.versions.node, MIN_NODE_VERSION)) {\n let cliVersion: string;\n try {\n const packageJson = JSON.parse(\n readFileSync(\n fileURLToPath(new URL(\"../package.json\", import.meta.url)),\n \"utf-8\"\n )\n );\n cliVersion = packageJson.version;\n } catch (e) {\n cliVersion = \"0.0.0\";\n logger.error(e);\n await printCriticalFailureToConsoleAndExit(\n `Unable to load @zuplo/cli. The package.json is missing or malformed.`\n );\n }\n\n await warnNodeVersion(cliVersion, RECOMMENDED_NODE_VERSION);\n\n undici.setGlobalDispatcher(\n undici.getGlobalDispatcher().compose((dispatch) => {\n return (opts, handler) => {\n opts.headers = {\n ...opts.headers,\n \"user-agent\": `ZuploCLI/${cliVersion}`,\n\n // biome-ignore lint/style/noProcessEnv: Migrated from ESLint\n ...(process.env.ZUPLO_CANARY ? { \"zp-canary\": \"true\" } : {}),\n };\n return dispatch(opts, handler);\n };\n })\n );\n\n Sentry.init({\n dsn: SENTRY_DSN,\n release: cliVersion,\n });\n\n const cli = yargs(hideBin(process.argv))\n // This means that all env vars will have to be prefixed with ZUPLO_\n .env(\"ZUPLO\")\n .option(\"prompt\", {\n type: \"boolean\",\n describe: \"Bypass confirmation prompts\",\n default: true,\n hidden: true,\n })\n .option(\"verbose\", {\n alias: \"v\",\n type: \"count\",\n describe: \"Increase verbosity level (-v, -vv, -vvv)\",\n default: 0,\n })\n // setBlocking forces synchronous TTY writes so error messages flush before\n // process.exit. Runs first so subsequent middleware (including the\n // preflight, which can exit) benefit from it.\n .middleware(setBlocking)\n .middleware(logLevel)\n .middleware(checkPnpmLifecycle)\n .command(compile)\n .command(customDomain)\n .command(deleteZup) // delete is a reserved keyword in JavaScript, so we call this function deleteZup\n .command(deploy)\n .command(dev)\n .command(docs)\n .command(editor)\n .command(info)\n .command(init)\n .command(list)\n .command(link)\n .command(login)\n .command(logout)\n .command(test)\n .command(oas)\n .command(mtlsCertificates)\n .command(project)\n .command(source)\n .command(tunnel)\n .command(variable)\n .command(build)\n .command(bucket)\n .command(proxies)\n .command(whoami)\n .command({\n command: \"hello\",\n handler: async () => {\n await fetch(\"https://393b4699ced44cc2ae87e4ad86184a29.api.mockbin.io/\");\n },\n })\n .demandCommand()\n .strictCommands()\n .version(cliVersion)\n .fail(false)\n .help();\n\n let exitCode = 0;\n try {\n await cli.argv;\n\n // Don't block\n void warnIfOutdatedVersion(cliVersion);\n } catch (err) {\n exitCode = 1;\n if (err instanceof Error) {\n Sentry.captureException(err);\n }\n if (err instanceof ApiError) {\n // The API client has already logged the structured error and printed\n // a user-facing diagnostic. Nothing more to display here.\n } else {\n printCriticalFailureToConsole(err.message ?? err);\n cli.showHelp();\n }\n } finally {\n await shutdownAnalytics();\n await Sentry.close(MAX_WAIT_PENDING_TIME_MS);\n process.exit(exitCode);\n }\n} else {\n await printCriticalFailureToConsoleAndExit(\n `The Zuplo CLI requires at least node.js v${MIN_NODE_VERSION}. You are using v${process.versions.node}. Please update your version of node.js.\n\n Consider using a Node.js version manager such as https://github.com/nvm-sh/nvm.`\n );\n}\n"]}
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;A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,CAAC;YACN,6BAA6B,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC;YAClD,GAAG,CAAC,QAAQ,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,iBAAiB,EAAE,CAAC;QAC1B,MAAM,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC7C,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;AACH,CAAC;KAAM,CAAC;IACN,MAAM,oCAAoC,CACxC,4CAA4C,gBAAgB,oBAAoB,OAAO,CAAC,QAAQ,CAAC,IAAI;;oFAErB,CACjF,CAAC;AACJ,CAAC","sourcesContent":["import * as dotenv from \"dotenv\";\n\ndotenv.config();\n\nimport { readFileSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nimport { confirm } from \"@inquirer/prompts\";\nimport * as Sentry from \"@sentry/node\";\nimport { gte } from \"semver\";\n// Undici must be imported first to set the global dispatcher\n// If fetch is used before undici, the process will crash\nimport undici from \"undici\";\nimport { hideBin } from \"yargs/helpers\";\nimport yargs from \"yargs/yargs\";\nimport bucket from \"./cmds/bucket/index.js\";\nimport build from \"./cmds/build.js\";\nimport compile from \"./cmds/compile.js\";\nimport customDomain from \"./cmds/custom-domain/index.js\";\nimport deleteZup from \"./cmds/delete.js\";\nimport deploy from \"./cmds/deploy.js\";\nimport dev from \"./cmds/dev.js\";\nimport docs from \"./cmds/docs.js\";\nimport editor from \"./cmds/editor.js\";\nimport info from \"./cmds/info.js\";\nimport init from \"./cmds/init.js\";\nimport link from \"./cmds/link.js\";\nimport list from \"./cmds/list.js\";\nimport login from \"./cmds/login.js\";\nimport logout from \"./cmds/logout.js\";\nimport mtlsCertificates from \"./cmds/mtls-certificates/index.js\";\nimport oas from \"./cmds/open-api/index.js\";\nimport project from \"./cmds/project/index.js\";\nimport proxies from \"./cmds/proxies/index.js\";\nimport source from \"./cmds/source/index.js\";\nimport test from \"./cmds/test.js\";\nimport tunnel from \"./cmds/tunnel/index.js\";\nimport variable from \"./cmds/variable/index.js\";\nimport whoami from \"./cmds/whoami.js\";\nimport { captureCliInvocationEvent } from \"./common/analytics/cli-invocation.js\";\nimport { shutdownAnalytics } from \"./common/analytics/lib.js\";\nimport { ApiError } from \"./common/api/client.js\";\nimport { MAX_WAIT_PENDING_TIME_MS, SENTRY_DSN } from \"./common/constants.js\";\nimport { logger } from \"./common/logger.js\";\nimport { checkPnpmLifecycle } from \"./common/middleware/check-pnpm-lifecycle.js\";\nimport { logLevel } from \"./common/middleware/logging.js\";\nimport { warnIfOutdatedVersion, warnNodeVersion } from \"./common/outdated.js\";\nimport setBlocking, {\n printCriticalFailureToConsole,\n printCriticalFailureToConsoleAndExit,\n} from \"./common/output.js\";\n\n// This allows us to stop the CLI from executing so we can connect the profiler\n\n// biome-ignore lint/style/noProcessEnv: Migrated from ESLint\nif (process.env.ZUPLO_CLI_PROFILING) {\n await confirm({ message: \"Continue executing CLI?\", default: true });\n}\n\n// Note: We cannot set this to be higher than 18.0.0 because of the way\n// our documentation works -- we tell them to use npx @zuplo/cli@latest (even in CI/CD jobs)\n// If we set this to be higher than 18.0.0, then we will break them.\n// Instead we set the value in package.json to be engine.node >= 20.0.0, so it will warn\nconst MIN_NODE_VERSION = \"18.0.0\";\nconst RECOMMENDED_NODE_VERSION = \"20.0.0\";\n\nif (gte(process.versions.node, MIN_NODE_VERSION)) {\n let cliVersion: string;\n try {\n const packageJson = JSON.parse(\n readFileSync(\n fileURLToPath(new URL(\"../package.json\", import.meta.url)),\n \"utf-8\"\n )\n );\n cliVersion = packageJson.version;\n } catch (e) {\n cliVersion = \"0.0.0\";\n logger.error(e);\n await printCriticalFailureToConsoleAndExit(\n `Unable to load @zuplo/cli. The package.json is missing or malformed.`\n );\n }\n\n await warnNodeVersion(cliVersion, RECOMMENDED_NODE_VERSION);\n\n undici.setGlobalDispatcher(\n undici.getGlobalDispatcher().compose((dispatch) => {\n return (opts, handler) => {\n opts.headers = {\n ...opts.headers,\n \"user-agent\": `ZuploCLI/${cliVersion}`,\n\n // biome-ignore lint/style/noProcessEnv: Migrated from ESLint\n ...(process.env.ZUPLO_CANARY ? { \"zp-canary\": \"true\" } : {}),\n };\n return dispatch(opts, handler);\n };\n })\n );\n\n Sentry.init({\n dsn: SENTRY_DSN,\n release: cliVersion,\n });\n\n const cli = yargs(hideBin(process.argv))\n // This means that all env vars will have to be prefixed with ZUPLO_\n .env(\"ZUPLO\")\n .option(\"prompt\", {\n type: \"boolean\",\n describe: \"Bypass confirmation prompts\",\n default: true,\n hidden: true,\n })\n .option(\"verbose\", {\n alias: \"v\",\n type: \"count\",\n describe: \"Increase verbosity level (-v, -vv, -vvv)\",\n default: 0,\n })\n // setBlocking forces synchronous TTY writes so error messages flush before\n // process.exit. Runs first so subsequent middleware (including the\n // preflight, which can exit) benefit from it.\n .middleware(setBlocking)\n .middleware(logLevel)\n .middleware(checkPnpmLifecycle)\n .middleware((argv) => {\n void captureCliInvocationEvent(argv, cliVersion);\n })\n .command(compile)\n .command(customDomain)\n .command(deleteZup) // delete is a reserved keyword in JavaScript, so we call this function deleteZup\n .command(deploy)\n .command(dev)\n .command(docs)\n .command(editor)\n .command(info)\n .command(init)\n .command(list)\n .command(link)\n .command(login)\n .command(logout)\n .command(test)\n .command(oas)\n .command(mtlsCertificates)\n .command(project)\n .command(source)\n .command(tunnel)\n .command(variable)\n .command(build)\n .command(bucket)\n .command(proxies)\n .command(whoami)\n .command({\n command: \"hello\",\n handler: async () => {\n await fetch(\"https://393b4699ced44cc2ae87e4ad86184a29.api.mockbin.io/\");\n },\n })\n .demandCommand()\n .strictCommands()\n .version(cliVersion)\n .fail(false)\n .help();\n\n let exitCode = 0;\n try {\n await cli.argv;\n\n // Don't block\n void warnIfOutdatedVersion(cliVersion);\n } catch (err) {\n exitCode = 1;\n if (err instanceof Error) {\n Sentry.captureException(err);\n }\n if (err instanceof ApiError) {\n // The API client has already logged the structured error and printed\n // a user-facing diagnostic. Nothing more to display here.\n } else {\n printCriticalFailureToConsole(err.message ?? err);\n cli.showHelp();\n }\n } finally {\n await shutdownAnalytics();\n await Sentry.close(MAX_WAIT_PENDING_TIME_MS);\n process.exit(exitCode);\n }\n} else {\n await printCriticalFailureToConsoleAndExit(\n `The Zuplo CLI requires at least node.js v${MIN_NODE_VERSION}. You are using v${process.versions.node}. Please update your version of node.js.\n\n Consider using a Node.js version manager such as https://github.com/nvm-sh/nvm.`\n );\n}\n"]}
@@ -0,0 +1,15 @@
1
+ import { captureEvent } from "./lib.js";
2
+ export interface CliInvocationProperties {
3
+ version: string;
4
+ cliCommand: string;
5
+ }
6
+ export declare function getCliInvocationProperties(
7
+ argv: unknown,
8
+ version: string
9
+ ): CliInvocationProperties;
10
+ export declare function captureCliInvocationEvent(
11
+ argv: unknown,
12
+ version: string,
13
+ capture?: typeof captureEvent
14
+ ): Promise<void>;
15
+ //# sourceMappingURL=cli-invocation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-invocation.d.ts","sourceRoot":"","sources":["../../../src/common/analytics/cli-invocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AA2BD,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,GACd,uBAAuB,CAKzB;AAED,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,OAAO,YAA2B,GAC1C,OAAO,CAAC,IAAI,CAAC,CAef"}
@@ -0,0 +1,39 @@
1
+ import { captureEvent } from "./lib.js";
2
+ const CLI_COMMAND_ALIASES = new Map([
3
+ ["oas", "openapi"],
4
+ ["open-api", "openapi"],
5
+ ]);
6
+ let hasCapturedCliInvocation = false;
7
+ function getCommandToken(argv) {
8
+ if (!argv || typeof argv !== "object") {
9
+ return undefined;
10
+ }
11
+ const tokens = argv._;
12
+ const command = tokens?.[0];
13
+ if (typeof command !== "string") {
14
+ return undefined;
15
+ }
16
+ return CLI_COMMAND_ALIASES.get(command) ?? command;
17
+ }
18
+ export function getCliInvocationProperties(argv, version) {
19
+ return {
20
+ version,
21
+ cliCommand: getCommandToken(argv) ?? "unknown",
22
+ };
23
+ }
24
+ export async function captureCliInvocationEvent(argv, version, capture = captureEvent) {
25
+ if (hasCapturedCliInvocation) {
26
+ return;
27
+ }
28
+ hasCapturedCliInvocation = true;
29
+ try {
30
+ await capture({
31
+ argv,
32
+ event: "zuplo cli invoked",
33
+ properties: getCliInvocationProperties(argv, version),
34
+ });
35
+ }
36
+ catch {
37
+ }
38
+ }
39
+ //# sourceMappingURL=cli-invocation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-invocation.js","sourceRoot":"","sources":["../../../src/common/analytics/cli-invocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAWxC,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAClC,CAAC,KAAK,EAAE,SAAS,CAAC;IAClB,CAAC,UAAU,EAAE,SAAS,CAAC;CACxB,CAAC,CAAC;AAEH,IAAI,wBAAwB,GAAG,KAAK,CAAC;AAErC,SAAS,eAAe,CAAC,IAAa;IACpC,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,MAAM,GAAI,IAA0B,CAAC,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,IAAa,EACb,OAAe;IAEf,OAAO;QACL,OAAO;QACP,UAAU,EAAE,eAAe,CAAC,IAAI,CAAC,IAAI,SAAS;KAC/C,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,IAAa,EACb,OAAe,EACf,UAA+B,YAAY;IAE3C,IAAI,wBAAwB,EAAE,CAAC;QAC7B,OAAO;IACT,CAAC;IACD,wBAAwB,GAAG,IAAI,CAAC;IAEhC,IAAI,CAAC;QACH,MAAM,OAAO,CAAC;YACZ,IAAI;YACJ,KAAK,EAAE,mBAAmB;YAC1B,UAAU,EAAE,0BAA0B,CAAC,IAAI,EAAE,OAAO,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;IAET,CAAC;AACH,CAAC","sourcesContent":["import { captureEvent } from \"./lib.js\";\n\nexport interface CliInvocationProperties {\n version: string;\n cliCommand: string;\n}\n\ninterface CliInvocationArgv {\n _: unknown[];\n}\n\nconst CLI_COMMAND_ALIASES = new Map([\n [\"oas\", \"openapi\"],\n [\"open-api\", \"openapi\"],\n]);\n\nlet hasCapturedCliInvocation = false;\n\nfunction getCommandToken(argv: unknown): string | undefined {\n if (!argv || typeof argv !== \"object\") {\n return undefined;\n }\n\n const tokens = (argv as CliInvocationArgv)._;\n const command = tokens?.[0];\n if (typeof command !== \"string\") {\n return undefined;\n }\n\n return CLI_COMMAND_ALIASES.get(command) ?? command;\n}\n\nexport function getCliInvocationProperties(\n argv: unknown,\n version: string\n): CliInvocationProperties {\n return {\n version,\n cliCommand: getCommandToken(argv) ?? \"unknown\",\n };\n}\n\nexport async function captureCliInvocationEvent(\n argv: unknown,\n version: string,\n capture: typeof captureEvent = captureEvent\n): Promise<void> {\n if (hasCapturedCliInvocation) {\n return;\n }\n hasCapturedCliInvocation = true;\n\n try {\n await capture({\n argv,\n event: \"zuplo cli invoked\",\n properties: getCliInvocationProperties(argv, version),\n });\n } catch {\n // Analytics must never change CLI behavior.\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cli-invocation.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-invocation.test.d.ts","sourceRoot":"","sources":["../../../src/common/analytics/cli-invocation.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,51 @@
1
+ import assert from "node:assert";
2
+ import { describe, it } from "node:test";
3
+ import { captureCliInvocationEvent, getCliInvocationProperties, } from "./cli-invocation.js";
4
+ describe("getCliInvocationProperties", () => {
5
+ it("captures the top-level CLI command token", () => {
6
+ assert.deepEqual(getCliInvocationProperties({ _: ["deploy"] }, "1.2.3"), {
7
+ version: "1.2.3",
8
+ cliCommand: "deploy",
9
+ });
10
+ assert.deepEqual(getCliInvocationProperties({ _: ["bucket"] }, "1.2.3"), {
11
+ version: "1.2.3",
12
+ cliCommand: "bucket",
13
+ });
14
+ assert.deepEqual(getCliInvocationProperties({ _: ["logout"] }, "1.2.3"), {
15
+ version: "1.2.3",
16
+ cliCommand: "logout",
17
+ });
18
+ assert.deepEqual(getCliInvocationProperties({ _: ["hello"] }, "1.2.3"), {
19
+ version: "1.2.3",
20
+ cliCommand: "hello",
21
+ });
22
+ });
23
+ it("canonicalizes OpenAPI command aliases", () => {
24
+ assert.deepEqual(getCliInvocationProperties({ _: ["oas"] }, "1.2.3"), {
25
+ version: "1.2.3",
26
+ cliCommand: "openapi",
27
+ });
28
+ assert.deepEqual(getCliInvocationProperties({ _: ["open-api"] }, "1.2.3"), {
29
+ version: "1.2.3",
30
+ cliCommand: "openapi",
31
+ });
32
+ });
33
+ it("does not include positional values after the command token", () => {
34
+ assert.deepEqual(getCliInvocationProperties({ _: ["deploy", "customer-project-name"] }, "1.2.3"), {
35
+ version: "1.2.3",
36
+ cliCommand: "deploy",
37
+ });
38
+ });
39
+ it("reports unknown when no command token is present", () => {
40
+ assert.deepEqual(getCliInvocationProperties({ _: [] }, "1.2.3"), {
41
+ version: "1.2.3",
42
+ cliCommand: "unknown",
43
+ });
44
+ });
45
+ it("does not fail the CLI when analytics capture fails", async () => {
46
+ await assert.doesNotReject(captureCliInvocationEvent({ _: ["deploy"] }, "1.2.3", async () => {
47
+ throw new Error("analytics failed");
48
+ }));
49
+ });
50
+ });
51
+ //# sourceMappingURL=cli-invocation.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-invocation.test.js","sourceRoot":"","sources":["../../../src/common/analytics/cli-invocation.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,CAAC,SAAS,CAAC,0BAA0B,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE;YACvE,OAAO,EAAE,OAAO;YAChB,UAAU,EAAE,QAAQ;SACrB,CAAC,CAAC;QACH,MAAM,CAAC,SAAS,CAAC,0BAA0B,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE;YACvE,OAAO,EAAE,OAAO;YAChB,UAAU,EAAE,QAAQ;SACrB,CAAC,CAAC;QACH,MAAM,CAAC,SAAS,CAAC,0BAA0B,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE;YACvE,OAAO,EAAE,OAAO;YAChB,UAAU,EAAE,QAAQ;SACrB,CAAC,CAAC;QACH,MAAM,CAAC,SAAS,CAAC,0BAA0B,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,OAA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AkB,CAAC,CAAC;QACtC,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import assert from \"node:assert\";\nimport { describe, it } from \"node:test\";\nimport {\n captureCliInvocationEvent,\n getCliInvocationProperties,\n} from \"./cli-invocation.js\";\n\ndescribe(\"getCliInvocationProperties\", () => {\n it(\"captures the top-level CLI command token\", () => {\n assert.deepEqual(getCliInvocationProperties({ _: [\"deploy\"] }, \"1.2.3\"), {\n version: \"1.2.3\",\n cliCommand: \"deploy\",\n });\n assert.deepEqual(getCliInvocationProperties({ _: [\"bucket\"] }, \"1.2.3\"), {\n version: \"1.2.3\",\n cliCommand: \"bucket\",\n });\n assert.deepEqual(getCliInvocationProperties({ _: [\"logout\"] }, \"1.2.3\"), {\n version: \"1.2.3\",\n cliCommand: \"logout\",\n });\n assert.deepEqual(getCliInvocationProperties({ _: [\"hello\"] }, \"1.2.3\"), {\n version: \"1.2.3\",\n cliCommand: \"hello\",\n });\n });\n\n it(\"canonicalizes OpenAPI command aliases\", () => {\n assert.deepEqual(getCliInvocationProperties({ _: [\"oas\"] }, \"1.2.3\"), {\n version: \"1.2.3\",\n cliCommand: \"openapi\",\n });\n assert.deepEqual(getCliInvocationProperties({ _: [\"open-api\"] }, \"1.2.3\"), {\n version: \"1.2.3\",\n cliCommand: \"openapi\",\n });\n });\n\n it(\"does not include positional values after the command token\", () => {\n assert.deepEqual(\n getCliInvocationProperties(\n { _: [\"deploy\", \"customer-project-name\"] },\n \"1.2.3\"\n ),\n {\n version: \"1.2.3\",\n cliCommand: \"deploy\",\n }\n );\n });\n\n it(\"reports unknown when no command token is present\", () => {\n assert.deepEqual(getCliInvocationProperties({ _: [] }, \"1.2.3\"), {\n version: \"1.2.3\",\n cliCommand: \"unknown\",\n });\n });\n\n it(\"does not fail the CLI when analytics capture fails\", async () => {\n await assert.doesNotReject(\n captureCliInvocationEvent({ _: [\"deploy\"] }, \"1.2.3\", async () => {\n throw new Error(\"analytics failed\");\n })\n );\n });\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../src/common/analytics/lib.ts"],"names":[],"mappings":"AAIA,UAAU,iBAAiB;IACzB,UAAU,EAAE,MAAM,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,UAAU,cAAe,SAAQ,iBAAiB;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IACzC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,UAAU,iBAAkB,SAAQ,IAAI,CAAC,cAAc,EAAE,YAAY,CAAC;IAEpE,IAAI,EAAE,GAAG,CAAC;CACX;AAoBD,wBAAsB,YAAY,CAAC,EACjC,IAAI,EACJ,KAAK,EACL,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,SAAS,EACT,YAAY,GACb,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwCnC;AAED,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAEvD"}
1
+ {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../src/common/analytics/lib.ts"],"names":[],"mappings":"AAKA,UAAU,iBAAiB;IACzB,UAAU,EAAE,MAAM,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,UAAU,cAAe,SAAQ,iBAAiB;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IACzC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,UAAU,iBAAkB,SAAQ,IAAI,CAAC,cAAc,EAAE,YAAY,CAAC;IAEpE,IAAI,EAAE,GAAG,CAAC;CACX;AAoBD,wBAAsB,YAAY,CAAC,EACjC,IAAI,EACJ,KAAK,EACL,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,SAAS,EACT,YAAY,GACb,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2CnC;AAED,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAEvD"}
@@ -1,6 +1,7 @@
1
1
  import { PostHog } from "posthog-node";
2
2
  import { POST_HOG_CAPTURE_KEY, ZUPLO_USER_ID_ARGV_KEY } from "../constants.js";
3
3
  import { machineId } from "../machine-id/lib.js";
4
+ import { getPackageManagerUsageProperties } from "./package-manager.js";
4
5
  let _postHog;
5
6
  function init() {
6
7
  if (process.env.ZUPLO_DO_NOT_TRACK) {
@@ -18,7 +19,10 @@ export async function captureEvent({ argv, event, properties, groups, sendFeatur
18
19
  init();
19
20
  }
20
21
  if (_postHog) {
21
- properties = properties ?? {};
22
+ properties = {
23
+ ...getPackageManagerUsageProperties(),
24
+ ...(properties ?? {}),
25
+ };
22
26
  properties.$set_once = properties.$set_once ?? {};
23
27
  if (argv[ZUPLO_USER_ID_ARGV_KEY] &&
24
28
  typeof argv[ZUPLO_USER_ID_ARGV_KEY] === "string") {
@@ -1 +1 @@
1
- {"version":3,"file":"lib.js","sourceRoot":"","sources":["../../../src/common/analytics/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAqBjD,IAAI,QAA6B,CAAC;AA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;YAEnB,UAAU,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACpC,CAAC;QAED,QAAQ,EAAE,OAAO,CAAC;YAChB,UAAU,EAAG,IAAI,CAAC,sBAAsB,CAAY,IAAI,SAAS,EAAE;YACnE,KAAK;YACL,UAAU;YACV,MAAM;YACN,gBAAgB;YAChB,SAAS;YACT,YAAY;SACb,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,OAAO,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["import { PostHog } from \"posthog-node\";\nimport { POST_HOG_CAPTURE_KEY, ZUPLO_USER_ID_ARGV_KEY } from \"../constants.js\";\nimport { machineId } from \"../machine-id/lib.js\";\n\ninterface IdentifyMessageV1 {\n distinctId: string;\n // biome-ignore lint/suspicious/noExplicitAny: Migrated from ESLint\n properties?: Record<string | number, any>;\n disableGeoip?: boolean;\n}\n\ninterface EventMessageV1 extends IdentifyMessageV1 {\n event: string;\n groups?: Record<string, string | number>;\n sendFeatureFlags?: boolean;\n timestamp?: Date;\n}\n\ninterface ZuploEventMessage extends Omit<EventMessageV1, \"distinctId\"> {\n // biome-ignore lint/suspicious/noExplicitAny: Migrated from ESLint\n argv: any;\n}\n\nlet _postHog: PostHog | undefined;\n\nfunction init(): PostHog | undefined {\n // biome-ignore lint/style/noProcessEnv: Migrated from ESLint\n if (process.env.ZUPLO_DO_NOT_TRACK) {\n return undefined;\n }\n\n _postHog = new PostHog(POST_HOG_CAPTURE_KEY, {\n host: \"https://app.posthog.com\",\n flushAt: 1,\n flushInterval: 1,\n });\n\n return _postHog;\n}\n\n// A convenience wrapper so that callers do not have to inject the distincId for each call to capture\nexport async function captureEvent({\n argv,\n event,\n properties,\n groups,\n sendFeatureFlags,\n timestamp,\n disableGeoip,\n}: ZuploEventMessage): Promise<void> {\n if (_postHog === undefined) {\n init();\n }\n\n if (_postHog) {\n properties = properties ?? {};\n properties.$set_once = properties.$set_once ?? {};\n\n // Set information about the user\n if (\n argv[ZUPLO_USER_ID_ARGV_KEY] &&\n typeof argv[ZUPLO_USER_ID_ARGV_KEY] === \"string\"\n ) {\n properties.$set_once[\"user-id\"] = argv[ZUPLO_USER_ID_ARGV_KEY];\n }\n if (argv.account && typeof argv.account === \"string\") {\n properties.$set_once[\"account\"] = argv[\"account\"];\n }\n if (argv.project && typeof argv.project === \"string\") {\n properties.$set_once[\"project\"] = argv[\"project\"];\n }\n\n // Nice to have: set information if this is in CI\n // biome-ignore lint/style/noProcessEnv: Migrated from ESLint\n if (process.env.CI) {\n // biome-ignore lint/style/noProcessEnv: Migrated from ESLint\n properties[\"ci\"] = process.env.CI;\n }\n\n _postHog?.capture({\n distinctId: (argv[ZUPLO_USER_ID_ARGV_KEY] as string) || machineId(),\n event,\n properties,\n groups,\n sendFeatureFlags,\n timestamp,\n disableGeoip,\n });\n }\n}\n\nexport async function shutdownAnalytics(): Promise<void> {\n return _postHog?.shutdown();\n}\n"]}
1
+ {"version":3,"file":"lib.js","sourceRoot":"","sources":["../../../src/common/analytics/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAqBxE,IAAI,QAA6B,CAAC;AAElC,SAAS,IAAI;IAEX,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;QACnC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,QAAQ,GAAG,IAAI,OAAO,CAAC,oBAAoB,EAAE;QAC3C,IAAI,EAAE,yBAAyB;QAC/B,OAAO,EAAE,CAAC;QACV,aAAa,EAAE,CAAC;KACjB,CAAC,CAAC;IAE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ACV,MAAM;YACN,gBAAgB;YAChB,SAAS;YACT,YAAY;SACb,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,OAAO,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["import { PostHog } from \"posthog-node\";\nimport { POST_HOG_CAPTURE_KEY, ZUPLO_USER_ID_ARGV_KEY } from \"../constants.js\";\nimport { machineId } from \"../machine-id/lib.js\";\nimport { getPackageManagerUsageProperties } from \"./package-manager.js\";\n\ninterface IdentifyMessageV1 {\n distinctId: string;\n // biome-ignore lint/suspicious/noExplicitAny: Migrated from ESLint\n properties?: Record<string | number, any>;\n disableGeoip?: boolean;\n}\n\ninterface EventMessageV1 extends IdentifyMessageV1 {\n event: string;\n groups?: Record<string, string | number>;\n sendFeatureFlags?: boolean;\n timestamp?: Date;\n}\n\ninterface ZuploEventMessage extends Omit<EventMessageV1, \"distinctId\"> {\n // biome-ignore lint/suspicious/noExplicitAny: Migrated from ESLint\n argv: any;\n}\n\nlet _postHog: PostHog | undefined;\n\nfunction init(): PostHog | undefined {\n // biome-ignore lint/style/noProcessEnv: Migrated from ESLint\n if (process.env.ZUPLO_DO_NOT_TRACK) {\n return undefined;\n }\n\n _postHog = new PostHog(POST_HOG_CAPTURE_KEY, {\n host: \"https://app.posthog.com\",\n flushAt: 1,\n flushInterval: 1,\n });\n\n return _postHog;\n}\n\n// A convenience wrapper so that callers do not have to inject the distincId for each call to capture\nexport async function captureEvent({\n argv,\n event,\n properties,\n groups,\n sendFeatureFlags,\n timestamp,\n disableGeoip,\n}: ZuploEventMessage): Promise<void> {\n if (_postHog === undefined) {\n init();\n }\n\n if (_postHog) {\n properties = {\n ...getPackageManagerUsageProperties(),\n ...(properties ?? {}),\n };\n properties.$set_once = properties.$set_once ?? {};\n\n // Set information about the user\n if (\n argv[ZUPLO_USER_ID_ARGV_KEY] &&\n typeof argv[ZUPLO_USER_ID_ARGV_KEY] === \"string\"\n ) {\n properties.$set_once[\"user-id\"] = argv[ZUPLO_USER_ID_ARGV_KEY];\n }\n if (argv.account && typeof argv.account === \"string\") {\n properties.$set_once[\"account\"] = argv[\"account\"];\n }\n if (argv.project && typeof argv.project === \"string\") {\n properties.$set_once[\"project\"] = argv[\"project\"];\n }\n\n // Nice to have: set information if this is in CI\n // biome-ignore lint/style/noProcessEnv: Migrated from ESLint\n if (process.env.CI) {\n // biome-ignore lint/style/noProcessEnv: Migrated from ESLint\n properties[\"ci\"] = process.env.CI;\n }\n\n _postHog?.capture({\n distinctId: (argv[ZUPLO_USER_ID_ARGV_KEY] as string) || machineId(),\n event,\n properties,\n groups,\n sendFeatureFlags,\n timestamp,\n disableGeoip,\n });\n }\n}\n\nexport async function shutdownAnalytics(): Promise<void> {\n return _postHog?.shutdown();\n}\n"]}
@@ -0,0 +1,43 @@
1
+ export type PackageManager = "npm" | "pnpm" | "yarn" | "bun" | "unknown";
2
+ export type PackageManagerRunner =
3
+ | "npm"
4
+ | "npm-create"
5
+ | "npm-exec"
6
+ | "npx"
7
+ | "pnpm"
8
+ | "pnpm-create"
9
+ | "pnpm-dlx"
10
+ | "pnpm-exec"
11
+ | "pnpx"
12
+ | "yarn"
13
+ | "yarn-create"
14
+ | "yarn-dlx"
15
+ | "bun"
16
+ | "bun-create"
17
+ | "bunx"
18
+ | "unknown";
19
+ export type InstallSource =
20
+ | "corepack"
21
+ | "volta"
22
+ | "nvm"
23
+ | "asdf"
24
+ | "fnm"
25
+ | "homebrew"
26
+ | "system"
27
+ | "project-local"
28
+ | "unknown";
29
+ export interface PackageManagerUsageProperties {
30
+ packageManager: PackageManager;
31
+ packageManagerVersion?: string;
32
+ runner: PackageManagerRunner;
33
+ installSource: InstallSource;
34
+ nodeVersion: string;
35
+ platform: NodeJS.Platform;
36
+ arch: string;
37
+ }
38
+ interface UsageEnvironment extends Record<string, string | undefined> {}
39
+ export declare function getPackageManagerUsageProperties(
40
+ env?: UsageEnvironment
41
+ ): PackageManagerUsageProperties;
42
+ export {};
43
+ //# sourceMappingURL=package-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../../src/common/analytics/package-manager.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;AAEzE,MAAM,MAAM,oBAAoB,GAC5B,KAAK,GACL,YAAY,GACZ,UAAU,GACV,KAAK,GACL,MAAM,GACN,aAAa,GACb,UAAU,GACV,WAAW,GACX,MAAM,GACN,MAAM,GACN,aAAa,GACb,UAAU,GACV,KAAK,GACL,YAAY,GACZ,MAAM,GACN,SAAS,CAAC;AAEd,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,OAAO,GACP,KAAK,GACL,MAAM,GACN,KAAK,GACL,UAAU,GACV,QAAQ,GACR,eAAe,GACf,SAAS,CAAC;AAEd,MAAM,WAAW,6BAA6B;IAC5C,cAAc,EAAE,cAAc,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,gBAAiB,SAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAAG;AAyKxE,wBAAgB,gCAAgC,CAE9C,GAAG,GAAE,gBAA8B,GAClC,6BAA6B,CA4B/B"}
@@ -0,0 +1,155 @@
1
+ import path from "node:path";
2
+ function basename(value) {
3
+ if (!value) {
4
+ return undefined;
5
+ }
6
+ return path.basename(value).toLowerCase();
7
+ }
8
+ function parseUserAgent(userAgent) {
9
+ const match = userAgent?.match(/^([^/\s]+)\/([^\s]+)/);
10
+ const name = match?.[1]?.toLowerCase();
11
+ switch (name) {
12
+ case "npm":
13
+ case "pnpm":
14
+ case "yarn":
15
+ case "bun":
16
+ return { family: name, version: match?.[2] };
17
+ default:
18
+ return { family: "unknown" };
19
+ }
20
+ }
21
+ function inferFamilyFromExecutable(executable) {
22
+ if (executable === "npm" ||
23
+ executable === "npm-cli.js" ||
24
+ executable === "npx" ||
25
+ executable === "npx-cli.js") {
26
+ return "npm";
27
+ }
28
+ if (executable === "pnpm" ||
29
+ executable === "pnpm.cjs" ||
30
+ executable === "pnpx") {
31
+ return "pnpm";
32
+ }
33
+ if (executable === "yarn" || executable === "yarn.js") {
34
+ return "yarn";
35
+ }
36
+ if (executable === "bun" || executable === "bunx") {
37
+ return "bun";
38
+ }
39
+ return undefined;
40
+ }
41
+ function inferRunner({ family, command, execPathBasename, runnerBasename, }) {
42
+ if (family === "npm") {
43
+ if (execPathBasename === "npx-cli.js" || runnerBasename === "npx") {
44
+ return "npx";
45
+ }
46
+ if (command === "init" || command === "create") {
47
+ return "npm-create";
48
+ }
49
+ if (command === "exec") {
50
+ return "npm-exec";
51
+ }
52
+ return "npm";
53
+ }
54
+ if (family === "pnpm") {
55
+ if (runnerBasename === "pnpx" || execPathBasename === "pnpx") {
56
+ return "pnpx";
57
+ }
58
+ if (command === "create" || command === "init") {
59
+ return "pnpm-create";
60
+ }
61
+ if (command === "dlx") {
62
+ return "pnpm-dlx";
63
+ }
64
+ if (command === "exec") {
65
+ return "pnpm-exec";
66
+ }
67
+ return "pnpm";
68
+ }
69
+ if (family === "yarn") {
70
+ if (command === "create") {
71
+ return "yarn-create";
72
+ }
73
+ if (command === "dlx") {
74
+ return "yarn-dlx";
75
+ }
76
+ return "yarn";
77
+ }
78
+ if (family === "bun") {
79
+ if (runnerBasename === "bunx") {
80
+ return "bunx";
81
+ }
82
+ if (command === "create") {
83
+ return "bun-create";
84
+ }
85
+ return "bun";
86
+ }
87
+ return "unknown";
88
+ }
89
+ function inferInstallSource(execPath) {
90
+ if (!execPath) {
91
+ return "unknown";
92
+ }
93
+ const normalized = execPath.toLowerCase().replace(/\\/g, "/");
94
+ if (normalized.includes("/node_modules/.bin/")) {
95
+ return "project-local";
96
+ }
97
+ if (normalized.includes("/corepack/")) {
98
+ return "corepack";
99
+ }
100
+ if (normalized.includes("/.volta/") || normalized.includes("/volta/")) {
101
+ return "volta";
102
+ }
103
+ if (normalized.includes("/.nvm/")) {
104
+ return "nvm";
105
+ }
106
+ if (normalized.includes("/.asdf/")) {
107
+ return "asdf";
108
+ }
109
+ if (normalized.includes("/.fnm/") ||
110
+ normalized.includes("/fnm_multishells/")) {
111
+ return "fnm";
112
+ }
113
+ if (normalized.includes("/homebrew/") ||
114
+ normalized.includes("/cellar/") ||
115
+ normalized.startsWith("/opt/homebrew/")) {
116
+ return "homebrew";
117
+ }
118
+ if (normalized.startsWith("/usr/bin/") ||
119
+ normalized.startsWith("/usr/local/bin/") ||
120
+ normalized.startsWith("/usr/local/lib/") ||
121
+ normalized.startsWith("/bin/") ||
122
+ normalized.startsWith("c:/program files/") ||
123
+ normalized.startsWith("c:/programdata/")) {
124
+ return "system";
125
+ }
126
+ return "unknown";
127
+ }
128
+ export function getPackageManagerUsageProperties(env = process.env) {
129
+ const userAgent = env["npm_config_user_agent"] || undefined;
130
+ const command = env["npm_command"]?.toLowerCase();
131
+ const execPath = env["npm_execpath"];
132
+ const execPathBasename = basename(execPath);
133
+ const runnerBasename = basename(env["_"]);
134
+ const parsedUserAgent = parseUserAgent(userAgent);
135
+ const packageManager = parsedUserAgent.family !== "unknown"
136
+ ? parsedUserAgent.family
137
+ : (inferFamilyFromExecutable(runnerBasename) ??
138
+ inferFamilyFromExecutable(execPathBasename) ??
139
+ "unknown");
140
+ return {
141
+ packageManager,
142
+ packageManagerVersion: parsedUserAgent.version,
143
+ runner: inferRunner({
144
+ family: packageManager,
145
+ command,
146
+ execPathBasename,
147
+ runnerBasename,
148
+ }),
149
+ installSource: inferInstallSource(execPath),
150
+ nodeVersion: process.versions.node,
151
+ platform: process.platform,
152
+ arch: process.arch,
153
+ };
154
+ }
155
+ //# sourceMappingURL=package-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-manager.js","sourceRoot":"","sources":["../../../src/common/analytics/package-manager.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AA6C7B,SAAS,QAAQ,CAAC,KAAyB;IACzC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AAC5C,CAAC;AAED,SAAS,cAAc,CAAC,SAA6B;IAInD,MAAM,KAAK,GAAG,SAAS,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACvD,MAAM,IAAI,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;IAEvC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,KAAK,CAAC;QACX,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM,CAAC;QACZ,KAAK,KAAK;YACR,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/C;YACE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IACjC,CAAC;AACH,CAAC;AAED,SAAS,yBAAyB,CAChC,UAA8B;IAE9B,IACE,UAAU,KAAK,KAAK;QACpB,UAAU,KAAK,YAAY;QAC3B,UAAU,KAAK,KAAK;QACpB,UAAU,KAAK,YAAY,EAC3B,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IACE,UAAU,KAAK,MAAM;QACrB,UAAU,KAAK,UAAU;QACzB,UAAU,KAAK,MAAM,EACrB,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,UAAU,KAAK,MAAM,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QACtD,O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EAAE,cAAc;YACtB,OAAO;YACP,gBAAgB;YAChB,cAAc;SACf,CAAC;QACF,aAAa,EAAE,kBAAkB,CAAC,QAAQ,CAAC;QAC3C,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;QAClC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;KACnB,CAAC;AACJ,CAAC","sourcesContent":["import path from \"node:path\";\n\nexport type PackageManager = \"npm\" | \"pnpm\" | \"yarn\" | \"bun\" | \"unknown\";\n\nexport type PackageManagerRunner =\n | \"npm\"\n | \"npm-create\"\n | \"npm-exec\"\n | \"npx\"\n | \"pnpm\"\n | \"pnpm-create\"\n | \"pnpm-dlx\"\n | \"pnpm-exec\"\n | \"pnpx\"\n | \"yarn\"\n | \"yarn-create\"\n | \"yarn-dlx\"\n | \"bun\"\n | \"bun-create\"\n | \"bunx\"\n | \"unknown\";\n\nexport type InstallSource =\n | \"corepack\"\n | \"volta\"\n | \"nvm\"\n | \"asdf\"\n | \"fnm\"\n | \"homebrew\"\n | \"system\"\n | \"project-local\"\n | \"unknown\";\n\nexport interface PackageManagerUsageProperties {\n packageManager: PackageManager;\n packageManagerVersion?: string;\n runner: PackageManagerRunner;\n installSource: InstallSource;\n nodeVersion: string;\n platform: NodeJS.Platform;\n arch: string;\n}\n\ninterface UsageEnvironment extends Record<string, string | undefined> {}\n\nfunction basename(value: string | undefined): string | undefined {\n if (!value) {\n return undefined;\n }\n return path.basename(value).toLowerCase();\n}\n\nfunction parseUserAgent(userAgent: string | undefined): {\n family: PackageManager;\n version?: string;\n} {\n const match = userAgent?.match(/^([^/\\s]+)\\/([^\\s]+)/);\n const name = match?.[1]?.toLowerCase();\n\n switch (name) {\n case \"npm\":\n case \"pnpm\":\n case \"yarn\":\n case \"bun\":\n return { family: name, version: match?.[2] };\n default:\n return { family: \"unknown\" };\n }\n}\n\nfunction inferFamilyFromExecutable(\n executable: string | undefined\n): PackageManager | undefined {\n if (\n executable === \"npm\" ||\n executable === \"npm-cli.js\" ||\n executable === \"npx\" ||\n executable === \"npx-cli.js\"\n ) {\n return \"npm\";\n }\n\n if (\n executable === \"pnpm\" ||\n executable === \"pnpm.cjs\" ||\n executable === \"pnpx\"\n ) {\n return \"pnpm\";\n }\n\n if (executable === \"yarn\" || executable === \"yarn.js\") {\n return \"yarn\";\n }\n\n if (executable === \"bun\" || executable === \"bunx\") {\n return \"bun\";\n }\n\n return undefined;\n}\n\nfunction inferRunner({\n family,\n command,\n execPathBasename,\n runnerBasename,\n}: {\n family: PackageManager;\n command?: string;\n execPathBasename?: string;\n runnerBasename?: string;\n}): PackageManagerRunner {\n if (family === \"npm\") {\n if (execPathBasename === \"npx-cli.js\" || runnerBasename === \"npx\") {\n return \"npx\";\n }\n if (command === \"init\" || command === \"create\") {\n return \"npm-create\";\n }\n if (command === \"exec\") {\n return \"npm-exec\";\n }\n return \"npm\";\n }\n\n if (family === \"pnpm\") {\n if (runnerBasename === \"pnpx\" || execPathBasename === \"pnpx\") {\n return \"pnpx\";\n }\n if (command === \"create\" || command === \"init\") {\n return \"pnpm-create\";\n }\n if (command === \"dlx\") {\n return \"pnpm-dlx\";\n }\n if (command === \"exec\") {\n return \"pnpm-exec\";\n }\n return \"pnpm\";\n }\n\n if (family === \"yarn\") {\n if (command === \"create\") {\n return \"yarn-create\";\n }\n if (command === \"dlx\") {\n return \"yarn-dlx\";\n }\n return \"yarn\";\n }\n\n if (family === \"bun\") {\n if (runnerBasename === \"bunx\") {\n return \"bunx\";\n }\n if (command === \"create\") {\n return \"bun-create\";\n }\n return \"bun\";\n }\n\n return \"unknown\";\n}\n\nfunction inferInstallSource(execPath: string | undefined): InstallSource {\n if (!execPath) {\n return \"unknown\";\n }\n const normalized = execPath.toLowerCase().replace(/\\\\/g, \"/\");\n\n if (normalized.includes(\"/node_modules/.bin/\")) {\n return \"project-local\";\n }\n if (normalized.includes(\"/corepack/\")) {\n return \"corepack\";\n }\n if (normalized.includes(\"/.volta/\") || normalized.includes(\"/volta/\")) {\n return \"volta\";\n }\n if (normalized.includes(\"/.nvm/\")) {\n return \"nvm\";\n }\n if (normalized.includes(\"/.asdf/\")) {\n return \"asdf\";\n }\n if (\n normalized.includes(\"/.fnm/\") ||\n normalized.includes(\"/fnm_multishells/\")\n ) {\n return \"fnm\";\n }\n if (\n normalized.includes(\"/homebrew/\") ||\n normalized.includes(\"/cellar/\") ||\n normalized.startsWith(\"/opt/homebrew/\")\n ) {\n return \"homebrew\";\n }\n if (\n normalized.startsWith(\"/usr/bin/\") ||\n normalized.startsWith(\"/usr/local/bin/\") ||\n normalized.startsWith(\"/usr/local/lib/\") ||\n normalized.startsWith(\"/bin/\") ||\n normalized.startsWith(\"c:/program files/\") ||\n normalized.startsWith(\"c:/programdata/\")\n ) {\n return \"system\";\n }\n\n return \"unknown\";\n}\n\nexport function getPackageManagerUsageProperties(\n // biome-ignore lint/style/noProcessEnv: npm/pnpm expose invocation metadata through environment variables.\n env: UsageEnvironment = process.env\n): PackageManagerUsageProperties {\n const userAgent = env[\"npm_config_user_agent\"] || undefined;\n const command = env[\"npm_command\"]?.toLowerCase();\n const execPath = env[\"npm_execpath\"];\n const execPathBasename = basename(execPath);\n const runnerBasename = basename(env[\"_\"]);\n const parsedUserAgent = parseUserAgent(userAgent);\n const packageManager: PackageManager =\n parsedUserAgent.family !== \"unknown\"\n ? parsedUserAgent.family\n : (inferFamilyFromExecutable(runnerBasename) ??\n inferFamilyFromExecutable(execPathBasename) ??\n \"unknown\");\n\n return {\n packageManager,\n packageManagerVersion: parsedUserAgent.version,\n runner: inferRunner({\n family: packageManager,\n command,\n execPathBasename,\n runnerBasename,\n }),\n installSource: inferInstallSource(execPath),\n nodeVersion: process.versions.node,\n platform: process.platform,\n arch: process.arch,\n };\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=package-manager.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-manager.test.d.ts","sourceRoot":"","sources":["../../../src/common/analytics/package-manager.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,163 @@
1
+ import assert from "node:assert";
2
+ import { describe, it } from "node:test";
3
+ import { getPackageManagerUsageProperties } from "./package-manager.js";
4
+ describe("getPackageManagerUsageProperties", () => {
5
+ it("buckets npm create under npm", () => {
6
+ const info = getPackageManagerUsageProperties({
7
+ npm_config_user_agent: "npm/10.9.0 node/v22.14.0 darwin arm64 workspaces/false",
8
+ npm_command: "init",
9
+ npm_execpath: "/usr/local/lib/node_modules/npm/bin/npm-cli.js",
10
+ _: "/usr/local/bin/npm",
11
+ });
12
+ assert.strictEqual(info.packageManager, "npm");
13
+ assert.strictEqual(info.runner, "npm-create");
14
+ assert.strictEqual(info.packageManagerVersion, "10.9.0");
15
+ assert.strictEqual(info.installSource, "system");
16
+ });
17
+ it("buckets npx under npm when npm exposes the npx runner", () => {
18
+ const info = getPackageManagerUsageProperties({
19
+ npm_config_user_agent: "npm/10.9.0 node/v22.14.0 darwin arm64 workspaces/false",
20
+ npm_command: "exec",
21
+ npm_execpath: "/usr/local/lib/node_modules/npm/bin/npx-cli.js",
22
+ _: "/usr/local/bin/npx",
23
+ });
24
+ assert.strictEqual(info.packageManager, "npm");
25
+ assert.strictEqual(info.runner, "npx");
26
+ });
27
+ it("buckets pnpm create under pnpm", () => {
28
+ const info = getPackageManagerUsageProperties({
29
+ npm_config_user_agent: "pnpm/10.7.0 npm/? node/v22.14.0 darwin arm64",
30
+ npm_command: "create",
31
+ npm_execpath: "/Users/me/Library/pnpm/pnpm.cjs",
32
+ _: "/Users/me/Library/pnpm/pnpm",
33
+ });
34
+ assert.strictEqual(info.packageManager, "pnpm");
35
+ assert.strictEqual(info.runner, "pnpm-create");
36
+ assert.strictEqual(info.packageManagerVersion, "10.7.0");
37
+ });
38
+ it("buckets pnpx under pnpm", () => {
39
+ const info = getPackageManagerUsageProperties({
40
+ npm_config_user_agent: "pnpm/10.7.0 npm/? node/v22.14.0 darwin arm64",
41
+ npm_command: "exec",
42
+ npm_execpath: "/Users/me/Library/pnpm/pnpm.cjs",
43
+ _: "/Users/me/Library/pnpm/pnpx",
44
+ });
45
+ assert.strictEqual(info.packageManager, "pnpm");
46
+ assert.strictEqual(info.runner, "pnpx");
47
+ });
48
+ it("buckets yarn create under yarn", () => {
49
+ const info = getPackageManagerUsageProperties({
50
+ npm_config_user_agent: "yarn/4.5.1 npm/? node/v22.14.0 darwin arm64",
51
+ npm_command: "create",
52
+ npm_execpath: "/usr/local/bin/yarn.js",
53
+ _: "/usr/local/bin/yarn",
54
+ });
55
+ assert.strictEqual(info.packageManager, "yarn");
56
+ assert.strictEqual(info.runner, "yarn-create");
57
+ assert.strictEqual(info.packageManagerVersion, "4.5.1");
58
+ });
59
+ it("buckets yarn dlx under yarn", () => {
60
+ const info = getPackageManagerUsageProperties({
61
+ npm_config_user_agent: "yarn/4.5.1 npm/? node/v22.14.0 darwin arm64",
62
+ npm_command: "dlx",
63
+ npm_execpath: "/usr/local/bin/yarn.js",
64
+ _: "/usr/local/bin/yarn",
65
+ });
66
+ assert.strictEqual(info.packageManager, "yarn");
67
+ assert.strictEqual(info.runner, "yarn-dlx");
68
+ });
69
+ it("buckets bun create under bun", () => {
70
+ const info = getPackageManagerUsageProperties({
71
+ npm_config_user_agent: "bun/1.2.0 npm/? node/v22.14.0 darwin arm64",
72
+ npm_command: "create",
73
+ npm_execpath: "/usr/local/bin/bun",
74
+ _: "/usr/local/bin/bun",
75
+ });
76
+ assert.strictEqual(info.packageManager, "bun");
77
+ assert.strictEqual(info.runner, "bun-create");
78
+ assert.strictEqual(info.packageManagerVersion, "1.2.0");
79
+ });
80
+ it("buckets bunx under bun", () => {
81
+ const info = getPackageManagerUsageProperties({
82
+ npm_config_user_agent: "bun/1.2.0 npm/? node/v22.14.0 darwin arm64",
83
+ npm_command: "x",
84
+ npm_execpath: "/usr/local/bin/bun",
85
+ _: "/usr/local/bin/bunx",
86
+ });
87
+ assert.strictEqual(info.packageManager, "bun");
88
+ assert.strictEqual(info.runner, "bunx");
89
+ });
90
+ it("reports unknown for missing environment", () => {
91
+ const info = getPackageManagerUsageProperties({});
92
+ assert.strictEqual(info.packageManager, "unknown");
93
+ assert.strictEqual(info.runner, "unknown");
94
+ assert.strictEqual(info.installSource, "unknown");
95
+ });
96
+ });
97
+ describe("installSource detection", () => {
98
+ it("detects project-local node_modules/.bin", () => {
99
+ const info = getPackageManagerUsageProperties({
100
+ npm_config_user_agent: "npm/10.9.0 node/v22.14.0 darwin arm64",
101
+ npm_execpath: "/Users/me/work/proj/node_modules/.bin/npm",
102
+ _: "/Users/me/work/proj/node_modules/.bin/npm",
103
+ });
104
+ assert.strictEqual(info.installSource, "project-local");
105
+ });
106
+ it("detects corepack", () => {
107
+ const info = getPackageManagerUsageProperties({
108
+ npm_config_user_agent: "pnpm/10.7.0 npm/? node/v22.14.0 darwin arm64",
109
+ npm_execpath: "/Users/me/.nvm/versions/node/v22.14.0/lib/node_modules/corepack/dist/pnpm.js",
110
+ _: "/Users/me/.nvm/versions/node/v22.14.0/bin/pnpm",
111
+ });
112
+ assert.strictEqual(info.installSource, "corepack");
113
+ });
114
+ it("detects volta", () => {
115
+ const info = getPackageManagerUsageProperties({
116
+ npm_config_user_agent: "npm/10.9.0 node/v22.14.0 darwin arm64",
117
+ npm_execpath: "/Users/me/.volta/tools/image/npm/10.9.0/bin/npm-cli.js",
118
+ _: "/Users/me/.volta/bin/npm",
119
+ });
120
+ assert.strictEqual(info.installSource, "volta");
121
+ });
122
+ it("detects nvm", () => {
123
+ const info = getPackageManagerUsageProperties({
124
+ npm_config_user_agent: "npm/10.9.0 node/v22.14.0 darwin arm64",
125
+ npm_execpath: "/Users/me/.nvm/versions/node/v22.14.0/lib/node_modules/npm/bin/npm-cli.js",
126
+ _: "/Users/me/.nvm/versions/node/v22.14.0/bin/npm",
127
+ });
128
+ assert.strictEqual(info.installSource, "nvm");
129
+ });
130
+ it("detects asdf", () => {
131
+ const info = getPackageManagerUsageProperties({
132
+ npm_config_user_agent: "npm/10.9.0 node/v22.14.0 linux x64",
133
+ npm_execpath: "/Users/me/.asdf/installs/nodejs/22.14.0/lib/node_modules/npm/bin/npm-cli.js",
134
+ _: "/Users/me/.asdf/shims/npm",
135
+ });
136
+ assert.strictEqual(info.installSource, "asdf");
137
+ });
138
+ it("detects fnm", () => {
139
+ const info = getPackageManagerUsageProperties({
140
+ npm_config_user_agent: "npm/10.9.0 node/v22.14.0 darwin arm64",
141
+ npm_execpath: "/var/folders/xx/fnm_multishells/12345_0000000000000/lib/node_modules/npm/bin/npm-cli.js",
142
+ _: "/Users/me/.fnm/aliases/default/bin/npm",
143
+ });
144
+ assert.strictEqual(info.installSource, "fnm");
145
+ });
146
+ it("detects homebrew (apple silicon path)", () => {
147
+ const info = getPackageManagerUsageProperties({
148
+ npm_config_user_agent: "npm/10.9.0 node/v22.14.0 darwin arm64",
149
+ npm_execpath: "/opt/homebrew/Cellar/node/22.14.0/lib/node_modules/npm/bin/npm-cli.js",
150
+ _: "/opt/homebrew/bin/npm",
151
+ });
152
+ assert.strictEqual(info.installSource, "homebrew");
153
+ });
154
+ it("detects system install", () => {
155
+ const info = getPackageManagerUsageProperties({
156
+ npm_config_user_agent: "npm/10.9.0 node/v22.14.0 linux x64",
157
+ npm_execpath: "/usr/local/lib/node_modules/npm/bin/npm-cli.js",
158
+ _: "/usr/local/bin/npm",
159
+ });
160
+ assert.strictEqual(info.installSource, "system");
161
+ });
162
+ });
163
+ //# sourceMappingURL=package-manager.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-manager.test.js","sourceRoot":"","sources":["../../../src/common/analytics/package-manager.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAExE,QAAQ,CAAC,kCAAkC,EAAE,GAAG,EA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perties } from \"./package-manager.js\";\n\ndescribe(\"getPackageManagerUsageProperties\", () => {\n it(\"buckets npm create under npm\", () => {\n const info = getPackageManagerUsageProperties({\n npm_config_user_agent:\n \"npm/10.9.0 node/v22.14.0 darwin arm64 workspaces/false\",\n npm_command: \"init\",\n npm_execpath: \"/usr/local/lib/node_modules/npm/bin/npm-cli.js\",\n _: \"/usr/local/bin/npm\",\n });\n\n assert.strictEqual(info.packageManager, \"npm\");\n assert.strictEqual(info.runner, \"npm-create\");\n assert.strictEqual(info.packageManagerVersion, \"10.9.0\");\n assert.strictEqual(info.installSource, \"system\");\n });\n\n it(\"buckets npx under npm when npm exposes the npx runner\", () => {\n const info = getPackageManagerUsageProperties({\n npm_config_user_agent:\n \"npm/10.9.0 node/v22.14.0 darwin arm64 workspaces/false\",\n npm_command: \"exec\",\n npm_execpath: \"/usr/local/lib/node_modules/npm/bin/npx-cli.js\",\n _: \"/usr/local/bin/npx\",\n });\n\n assert.strictEqual(info.packageManager, \"npm\");\n assert.strictEqual(info.runner, \"npx\");\n });\n\n it(\"buckets pnpm create under pnpm\", () => {\n const info = getPackageManagerUsageProperties({\n npm_config_user_agent: \"pnpm/10.7.0 npm/? node/v22.14.0 darwin arm64\",\n npm_command: \"create\",\n npm_execpath: \"/Users/me/Library/pnpm/pnpm.cjs\",\n _: \"/Users/me/Library/pnpm/pnpm\",\n });\n\n assert.strictEqual(info.packageManager, \"pnpm\");\n assert.strictEqual(info.runner, \"pnpm-create\");\n assert.strictEqual(info.packageManagerVersion, \"10.7.0\");\n });\n\n it(\"buckets pnpx under pnpm\", () => {\n const info = getPackageManagerUsageProperties({\n npm_config_user_agent: \"pnpm/10.7.0 npm/? node/v22.14.0 darwin arm64\",\n npm_command: \"exec\",\n npm_execpath: \"/Users/me/Library/pnpm/pnpm.cjs\",\n _: \"/Users/me/Library/pnpm/pnpx\",\n });\n\n assert.strictEqual(info.packageManager, \"pnpm\");\n assert.strictEqual(info.runner, \"pnpx\");\n });\n\n it(\"buckets yarn create under yarn\", () => {\n const info = getPackageManagerUsageProperties({\n npm_config_user_agent: \"yarn/4.5.1 npm/? node/v22.14.0 darwin arm64\",\n npm_command: \"create\",\n npm_execpath: \"/usr/local/bin/yarn.js\",\n _: \"/usr/local/bin/yarn\",\n });\n\n assert.strictEqual(info.packageManager, \"yarn\");\n assert.strictEqual(info.runner, \"yarn-create\");\n assert.strictEqual(info.packageManagerVersion, \"4.5.1\");\n });\n\n it(\"buckets yarn dlx under yarn\", () => {\n const info = getPackageManagerUsageProperties({\n npm_config_user_agent: \"yarn/4.5.1 npm/? node/v22.14.0 darwin arm64\",\n npm_command: \"dlx\",\n npm_execpath: \"/usr/local/bin/yarn.js\",\n _: \"/usr/local/bin/yarn\",\n });\n\n assert.strictEqual(info.packageManager, \"yarn\");\n assert.strictEqual(info.runner, \"yarn-dlx\");\n });\n\n it(\"buckets bun create under bun\", () => {\n const info = getPackageManagerUsageProperties({\n npm_config_user_agent: \"bun/1.2.0 npm/? node/v22.14.0 darwin arm64\",\n npm_command: \"create\",\n npm_execpath: \"/usr/local/bin/bun\",\n _: \"/usr/local/bin/bun\",\n });\n\n assert.strictEqual(info.packageManager, \"bun\");\n assert.strictEqual(info.runner, \"bun-create\");\n assert.strictEqual(info.packageManagerVersion, \"1.2.0\");\n });\n\n it(\"buckets bunx under bun\", () => {\n const info = getPackageManagerUsageProperties({\n npm_config_user_agent: \"bun/1.2.0 npm/? node/v22.14.0 darwin arm64\",\n npm_command: \"x\",\n npm_execpath: \"/usr/local/bin/bun\",\n _: \"/usr/local/bin/bunx\",\n });\n\n assert.strictEqual(info.packageManager, \"bun\");\n assert.strictEqual(info.runner, \"bunx\");\n });\n\n it(\"reports unknown for missing environment\", () => {\n const info = getPackageManagerUsageProperties({});\n\n assert.strictEqual(info.packageManager, \"unknown\");\n assert.strictEqual(info.runner, \"unknown\");\n assert.strictEqual(info.installSource, \"unknown\");\n });\n});\n\ndescribe(\"installSource detection\", () => {\n it(\"detects project-local node_modules/.bin\", () => {\n const info = getPackageManagerUsageProperties({\n npm_config_user_agent: \"npm/10.9.0 node/v22.14.0 darwin arm64\",\n npm_execpath: \"/Users/me/work/proj/node_modules/.bin/npm\",\n _: \"/Users/me/work/proj/node_modules/.bin/npm\",\n });\n assert.strictEqual(info.installSource, \"project-local\");\n });\n\n it(\"detects corepack\", () => {\n const info = getPackageManagerUsageProperties({\n npm_config_user_agent: \"pnpm/10.7.0 npm/? node/v22.14.0 darwin arm64\",\n npm_execpath:\n \"/Users/me/.nvm/versions/node/v22.14.0/lib/node_modules/corepack/dist/pnpm.js\",\n _: \"/Users/me/.nvm/versions/node/v22.14.0/bin/pnpm\",\n });\n assert.strictEqual(info.installSource, \"corepack\");\n });\n\n it(\"detects volta\", () => {\n const info = getPackageManagerUsageProperties({\n npm_config_user_agent: \"npm/10.9.0 node/v22.14.0 darwin arm64\",\n npm_execpath: \"/Users/me/.volta/tools/image/npm/10.9.0/bin/npm-cli.js\",\n _: \"/Users/me/.volta/bin/npm\",\n });\n assert.strictEqual(info.installSource, \"volta\");\n });\n\n it(\"detects nvm\", () => {\n const info = getPackageManagerUsageProperties({\n npm_config_user_agent: \"npm/10.9.0 node/v22.14.0 darwin arm64\",\n npm_execpath:\n \"/Users/me/.nvm/versions/node/v22.14.0/lib/node_modules/npm/bin/npm-cli.js\",\n _: \"/Users/me/.nvm/versions/node/v22.14.0/bin/npm\",\n });\n assert.strictEqual(info.installSource, \"nvm\");\n });\n\n it(\"detects asdf\", () => {\n const info = getPackageManagerUsageProperties({\n npm_config_user_agent: \"npm/10.9.0 node/v22.14.0 linux x64\",\n npm_execpath:\n \"/Users/me/.asdf/installs/nodejs/22.14.0/lib/node_modules/npm/bin/npm-cli.js\",\n _: \"/Users/me/.asdf/shims/npm\",\n });\n assert.strictEqual(info.installSource, \"asdf\");\n });\n\n it(\"detects fnm\", () => {\n const info = getPackageManagerUsageProperties({\n npm_config_user_agent: \"npm/10.9.0 node/v22.14.0 darwin arm64\",\n npm_execpath:\n \"/var/folders/xx/fnm_multishells/12345_0000000000000/lib/node_modules/npm/bin/npm-cli.js\",\n _: \"/Users/me/.fnm/aliases/default/bin/npm\",\n });\n assert.strictEqual(info.installSource, \"fnm\");\n });\n\n it(\"detects homebrew (apple silicon path)\", () => {\n const info = getPackageManagerUsageProperties({\n npm_config_user_agent: \"npm/10.9.0 node/v22.14.0 darwin arm64\",\n npm_execpath:\n \"/opt/homebrew/Cellar/node/22.14.0/lib/node_modules/npm/bin/npm-cli.js\",\n _: \"/opt/homebrew/bin/npm\",\n });\n assert.strictEqual(info.installSource, \"homebrew\");\n });\n\n it(\"detects system install\", () => {\n const info = getPackageManagerUsageProperties({\n npm_config_user_agent: \"npm/10.9.0 node/v22.14.0 linux x64\",\n npm_execpath: \"/usr/local/lib/node_modules/npm/bin/npm-cli.js\",\n _: \"/usr/local/bin/npm\",\n });\n assert.strictEqual(info.installSource, \"system\");\n });\n});\n"]}
@@ -1 +1 @@
1
- {"root":["../src/cli.ts","../src/internal.ts","../src/types.d.ts","../src/__tests__/archive-utils.test.ts","../src/__tests__/import-openapi.test.ts","../src/__tests__/outdated.test.ts","../src/__tests__/populate.test.ts","../src/__tests__/tsconfig-upgrader.test.ts","../src/__tests__/integration/confirm-linked-config.integration.test.ts","../src/__tests__/integration/confirm-production-deploy.integration.test.ts","../src/__tests__/integration/custom-domain.integration.test.ts","../src/__tests__/integration/delete.integration.test.ts","../src/__tests__/integration/deploy.integration.test.ts","../src/__tests__/integration/get-project-param.integration.test.ts","../src/__tests__/integration/info.integration.test.ts","../src/__tests__/integration/jest-mocks-setup.ts","../src/__tests__/integration/jest-setup.ts","../src/__tests__/integration/link.integration.test.ts","../src/__tests__/integration/linked-config-cascade.integration.test.ts","../src/__tests__/integration/list.integration.test.ts","../src/__tests__/integration/test-utils.ts","../src/__tests__/integration/tunnel.integration.test.ts","../src/__tests__/integration/variable.integration.test.ts","../src/__tests__/integration/whoami.integration.test.ts","../src/bucket/models.ts","../src/bucket/list/handler.ts","../src/build/handler.ts","../src/cmds/build.ts","../src/cmds/compile.ts","../src/cmds/delete.ts","../src/cmds/deploy.ts","../src/cmds/dev.ts","../src/cmds/docs.ts","../src/cmds/editor.ts","../src/cmds/info.ts","../src/cmds/init.ts","../src/cmds/link.ts","../src/cmds/list.ts","../src/cmds/login.ts","../src/cmds/logout.ts","../src/cmds/test.ts","../src/cmds/whoami.ts","../src/cmds/bucket/index.ts","../src/cmds/bucket/list.ts","../src/cmds/custom-domain/create.ts","../src/cmds/custom-domain/delete.ts","../src/cmds/custom-domain/index.ts","../src/cmds/custom-domain/list.ts","../src/cmds/custom-domain/update.ts","../src/cmds/mtls-certificates/create.ts","../src/cmds/mtls-certificates/delete.ts","../src/cmds/mtls-certificates/describe.ts","../src/cmds/mtls-certificates/disable.ts","../src/cmds/mtls-certificates/index.ts","../src/cmds/mtls-certificates/list.ts","../src/cmds/mtls-certificates/update.ts","../src/cmds/open-api/convert.ts","../src/cmds/open-api/index.ts","../src/cmds/open-api/merge.ts","../src/cmds/open-api/overlay.ts","../src/cmds/project/create.ts","../src/cmds/project/index.ts","../src/cmds/project/info.ts","../src/cmds/proxies/create.ts","../src/cmds/proxies/delete.ts","../src/cmds/proxies/describe.ts","../src/cmds/proxies/index.ts","../src/cmds/proxies/update.ts","../src/cmds/source/import-openapi.ts","../src/cmds/source/index.ts","../src/cmds/source/migrate.ts","../src/cmds/source/upgrade.ts","../src/cmds/tunnel/create.ts","../src/cmds/tunnel/delete.ts","../src/cmds/tunnel/describe.ts","../src/cmds/tunnel/index.ts","../src/cmds/tunnel/list.ts","../src/cmds/tunnel/rotate-token.ts","../src/cmds/tunnel/services/describe.ts","../src/cmds/tunnel/services/index.ts","../src/cmds/tunnel/services/update.ts","../src/cmds/variable/create.ts","../src/cmds/variable/index.ts","../src/cmds/variable/update.ts","../src/common/alias.ts","../src/common/args.ts","../src/common/constants.ts","../src/common/handler.ts","../src/common/logger.ts","../src/common/models.ts","../src/common/outdated.ts","../src/common/output.ts","../src/common/populate.ts","../src/common/read-linked-config.test.ts","../src/common/read-linked-config.ts","../src/common/runner.ts","../src/common/settings.ts","../src/common/terminal.test.ts","../src/common/terminal.ts","../src/common/worker-output.ts","../src/common/analytics/lib.ts","../src/common/api/client.ts","../src/common/api/lib.ts","../src/common/machine-id/lib.ts","../src/common/middleware/authentication.ts","../src/common/middleware/check-pnpm-lifecycle.test.ts","../src/common/middleware/check-pnpm-lifecycle.ts","../src/common/middleware/confirm-linked-config.ts","../src/common/middleware/confirm-production-deploy.ts","../src/common/middleware/get-account-param.ts","../src/common/middleware/get-environment-param.test.ts","../src/common/middleware/get-environment-param.ts","../src/common/middleware/get-project-param.ts","../src/common/middleware/logging.ts","../src/common/middleware/user-configuration.ts","../src/common/middleware/user-identification.ts","../src/common/middleware/validate-fleet.ts","../src/common/upgraders/lib.ts","../src/common/upgraders/package-json-upgrader.ts","../src/common/upgraders/tsconfig-upgrader.ts","../src/common/upgraders/vscode-settings-json-upgrader.ts","../src/common/utils/box.ts","../src/common/utils/branch.ts","../src/common/utils/build-environment-prompt-choices.test.ts","../src/common/utils/build-environment-prompt-choices.ts","../src/common/utils/format-environment-type.test.ts","../src/common/utils/format-environment-type.ts","../src/common/utils/pnpm-lifecycle.test.ts","../src/common/utils/pnpm-lifecycle.ts","../src/common/utils/ports.ts","../src/common/utils/prefixed-output.ts","../src/common/utils/pretty-print-environment-prompt.test.ts","../src/common/utils/pretty-print-environment-prompt.ts","../src/common/utils/sort-environments-for-prompt.test.ts","../src/common/utils/sort-environments-for-prompt.ts","../src/common/utils/stringify-config.test.ts","../src/common/utils/stringify-config.ts","../src/common/utils/types.ts","../src/common/utils/urls.ts","../src/common/validators/argument-validators.spec.ts","../src/common/validators/argument-validators.ts","../src/common/validators/file-system-validator.ts","../src/common/validators/lib.ts","../src/common/validators/project-name-validator.ts","../src/common/xdg/lib.ts","../src/compile/handler.ts","../src/custom-domain/models.ts","../src/custom-domain/create/handler.ts","../src/custom-domain/delete/handler.ts","../src/custom-domain/list/handler.ts","../src/custom-domain/update/handler.ts","../src/delete/handler.ts","../src/delete/poll-deployment.ts","../src/deploy/archive.local-registry.test.ts","../src/deploy/archive.test.ts","../src/deploy/archive.ts","../src/deploy/environments.ts","../src/deploy/file-upload.ts","../src/deploy/handler.ts","../src/deploy/poll-deployment.ts","../src/dev/handler.ts","../src/docs/handler.ts","../src/editor/handler.ts","../src/editor/e2e/editor.spec.ts","../src/init/handler.ts","../src/link/handler.ts","../src/list/handler.ts","../src/login/login.ts","../src/login/logout.ts","../src/login/tokens.ts","../src/mtls-certificates/models.ts","../src/mtls-certificates/create/handler.ts","../src/mtls-certificates/delete/handler.ts","../src/mtls-certificates/describe/handler.ts","../src/mtls-certificates/disable/handler.ts","../src/mtls-certificates/list/handler.ts","../src/mtls-certificates/update/handler.ts","../src/open-api/convert/handler.spec.ts","../src/open-api/convert/handler.ts","../src/open-api/merge/handler.spec.ts","../src/open-api/merge/handler.ts","../src/open-api/overlay/handler.spec.ts","../src/open-api/overlay/handler.ts","../src/project/create/handler.ts","../src/project/info/handler.ts","../src/proxies/models.ts","../src/proxies/create/handler.ts","../src/proxies/delete/handler.ts","../src/proxies/describe/handler.ts","../src/proxies/update/handler.ts","../src/source/migrate/dev-portal/handler.ts","../src/source/migrate/dev-portal/types.ts","../src/source/update/handler.ts","../src/test/esbuild-config.ts","../src/test/handler.ts","../src/test/invoke-test.ts","../src/test/test-files.test.ts","../src/test/test-files.ts","../src/test/esbuild-plugins/node-test-prep-plugin.ts","../src/tunnel/models.ts","../src/tunnel/create/handler.ts","../src/tunnel/delete/handler.ts","../src/tunnel/delete/poll-teardown-operation.ts","../src/tunnel/describe/handler.ts","../src/tunnel/list/handler.ts","../src/tunnel/rotate-token/handler.ts","../src/tunnel/services/describe/handler.ts","../src/tunnel/services/update/handler.ts","../src/tunnel/services/update/poll-provisioning-operations.ts","../src/variable/models.ts","../src/variable/create/handler.ts","../src/variable/update/handler.ts","../src/whoami/handler.ts"],"version":"5.8.2"}
1
+ {"root":["../src/cli.ts","../src/internal.ts","../src/types.d.ts","../src/__tests__/archive-utils.test.ts","../src/__tests__/import-openapi.test.ts","../src/__tests__/outdated.test.ts","../src/__tests__/populate.test.ts","../src/__tests__/tsconfig-upgrader.test.ts","../src/__tests__/integration/confirm-linked-config.integration.test.ts","../src/__tests__/integration/confirm-production-deploy.integration.test.ts","../src/__tests__/integration/custom-domain.integration.test.ts","../src/__tests__/integration/delete.integration.test.ts","../src/__tests__/integration/deploy.integration.test.ts","../src/__tests__/integration/get-project-param.integration.test.ts","../src/__tests__/integration/info.integration.test.ts","../src/__tests__/integration/jest-mocks-setup.ts","../src/__tests__/integration/jest-setup.ts","../src/__tests__/integration/link.integration.test.ts","../src/__tests__/integration/linked-config-cascade.integration.test.ts","../src/__tests__/integration/list.integration.test.ts","../src/__tests__/integration/test-utils.ts","../src/__tests__/integration/tunnel.integration.test.ts","../src/__tests__/integration/variable.integration.test.ts","../src/__tests__/integration/whoami.integration.test.ts","../src/bucket/models.ts","../src/bucket/list/handler.ts","../src/build/handler.ts","../src/cmds/build.ts","../src/cmds/compile.ts","../src/cmds/delete.ts","../src/cmds/deploy.ts","../src/cmds/dev.ts","../src/cmds/docs.ts","../src/cmds/editor.ts","../src/cmds/info.ts","../src/cmds/init.ts","../src/cmds/link.ts","../src/cmds/list.ts","../src/cmds/login.ts","../src/cmds/logout.ts","../src/cmds/test.ts","../src/cmds/whoami.ts","../src/cmds/bucket/index.ts","../src/cmds/bucket/list.ts","../src/cmds/custom-domain/create.ts","../src/cmds/custom-domain/delete.ts","../src/cmds/custom-domain/index.ts","../src/cmds/custom-domain/list.ts","../src/cmds/custom-domain/update.ts","../src/cmds/mtls-certificates/create.ts","../src/cmds/mtls-certificates/delete.ts","../src/cmds/mtls-certificates/describe.ts","../src/cmds/mtls-certificates/disable.ts","../src/cmds/mtls-certificates/index.ts","../src/cmds/mtls-certificates/list.ts","../src/cmds/mtls-certificates/update.ts","../src/cmds/open-api/convert.ts","../src/cmds/open-api/index.ts","../src/cmds/open-api/merge.ts","../src/cmds/open-api/overlay.ts","../src/cmds/project/create.ts","../src/cmds/project/index.ts","../src/cmds/project/info.ts","../src/cmds/proxies/create.ts","../src/cmds/proxies/delete.ts","../src/cmds/proxies/describe.ts","../src/cmds/proxies/index.ts","../src/cmds/proxies/update.ts","../src/cmds/source/import-openapi.ts","../src/cmds/source/index.ts","../src/cmds/source/migrate.ts","../src/cmds/source/upgrade.ts","../src/cmds/tunnel/create.ts","../src/cmds/tunnel/delete.ts","../src/cmds/tunnel/describe.ts","../src/cmds/tunnel/index.ts","../src/cmds/tunnel/list.ts","../src/cmds/tunnel/rotate-token.ts","../src/cmds/tunnel/services/describe.ts","../src/cmds/tunnel/services/index.ts","../src/cmds/tunnel/services/update.ts","../src/cmds/variable/create.ts","../src/cmds/variable/index.ts","../src/cmds/variable/update.ts","../src/common/alias.ts","../src/common/args.ts","../src/common/constants.ts","../src/common/handler.ts","../src/common/logger.ts","../src/common/models.ts","../src/common/outdated.ts","../src/common/output.ts","../src/common/populate.ts","../src/common/read-linked-config.test.ts","../src/common/read-linked-config.ts","../src/common/runner.ts","../src/common/settings.ts","../src/common/terminal.test.ts","../src/common/terminal.ts","../src/common/worker-output.ts","../src/common/analytics/cli-invocation.test.ts","../src/common/analytics/cli-invocation.ts","../src/common/analytics/lib.ts","../src/common/analytics/package-manager.test.ts","../src/common/analytics/package-manager.ts","../src/common/api/client.ts","../src/common/api/lib.ts","../src/common/machine-id/lib.ts","../src/common/middleware/authentication.ts","../src/common/middleware/check-pnpm-lifecycle.test.ts","../src/common/middleware/check-pnpm-lifecycle.ts","../src/common/middleware/confirm-linked-config.ts","../src/common/middleware/confirm-production-deploy.ts","../src/common/middleware/get-account-param.ts","../src/common/middleware/get-environment-param.test.ts","../src/common/middleware/get-environment-param.ts","../src/common/middleware/get-project-param.ts","../src/common/middleware/logging.ts","../src/common/middleware/user-configuration.ts","../src/common/middleware/user-identification.ts","../src/common/middleware/validate-fleet.ts","../src/common/upgraders/lib.ts","../src/common/upgraders/package-json-upgrader.ts","../src/common/upgraders/tsconfig-upgrader.ts","../src/common/upgraders/vscode-settings-json-upgrader.ts","../src/common/utils/box.ts","../src/common/utils/branch.ts","../src/common/utils/build-environment-prompt-choices.test.ts","../src/common/utils/build-environment-prompt-choices.ts","../src/common/utils/format-environment-type.test.ts","../src/common/utils/format-environment-type.ts","../src/common/utils/pnpm-lifecycle.test.ts","../src/common/utils/pnpm-lifecycle.ts","../src/common/utils/ports.ts","../src/common/utils/prefixed-output.ts","../src/common/utils/pretty-print-environment-prompt.test.ts","../src/common/utils/pretty-print-environment-prompt.ts","../src/common/utils/sort-environments-for-prompt.test.ts","../src/common/utils/sort-environments-for-prompt.ts","../src/common/utils/stringify-config.test.ts","../src/common/utils/stringify-config.ts","../src/common/utils/types.ts","../src/common/utils/urls.ts","../src/common/validators/argument-validators.spec.ts","../src/common/validators/argument-validators.ts","../src/common/validators/file-system-validator.ts","../src/common/validators/lib.ts","../src/common/validators/project-name-validator.ts","../src/common/xdg/lib.ts","../src/compile/handler.ts","../src/custom-domain/models.ts","../src/custom-domain/create/handler.ts","../src/custom-domain/delete/handler.ts","../src/custom-domain/list/handler.ts","../src/custom-domain/update/handler.ts","../src/delete/handler.ts","../src/delete/poll-deployment.ts","../src/deploy/archive.local-registry.test.ts","../src/deploy/archive.test.ts","../src/deploy/archive.ts","../src/deploy/environments.ts","../src/deploy/file-upload.ts","../src/deploy/handler.ts","../src/deploy/poll-deployment.ts","../src/dev/handler.ts","../src/docs/handler.ts","../src/editor/handler.ts","../src/editor/e2e/editor.spec.ts","../src/init/handler.ts","../src/link/handler.ts","../src/list/handler.ts","../src/login/login.ts","../src/login/logout.ts","../src/login/tokens.ts","../src/mtls-certificates/models.ts","../src/mtls-certificates/create/handler.ts","../src/mtls-certificates/delete/handler.ts","../src/mtls-certificates/describe/handler.ts","../src/mtls-certificates/disable/handler.ts","../src/mtls-certificates/list/handler.ts","../src/mtls-certificates/update/handler.ts","../src/open-api/convert/handler.spec.ts","../src/open-api/convert/handler.ts","../src/open-api/merge/handler.spec.ts","../src/open-api/merge/handler.ts","../src/open-api/overlay/handler.spec.ts","../src/open-api/overlay/handler.ts","../src/project/create/handler.ts","../src/project/info/handler.ts","../src/proxies/models.ts","../src/proxies/create/handler.ts","../src/proxies/delete/handler.ts","../src/proxies/describe/handler.ts","../src/proxies/update/handler.ts","../src/source/migrate/dev-portal/handler.ts","../src/source/migrate/dev-portal/types.ts","../src/source/update/handler.ts","../src/test/esbuild-config.ts","../src/test/handler.ts","../src/test/invoke-test.ts","../src/test/test-files.test.ts","../src/test/test-files.ts","../src/test/esbuild-plugins/node-test-prep-plugin.ts","../src/tunnel/models.ts","../src/tunnel/create/handler.ts","../src/tunnel/delete/handler.ts","../src/tunnel/delete/poll-teardown-operation.ts","../src/tunnel/describe/handler.ts","../src/tunnel/list/handler.ts","../src/tunnel/rotate-token/handler.ts","../src/tunnel/services/describe/handler.ts","../src/tunnel/services/update/handler.ts","../src/tunnel/services/update/poll-provisioning-operations.ts","../src/variable/models.ts","../src/variable/create/handler.ts","../src/variable/update/handler.ts","../src/whoami/handler.ts"],"version":"5.8.2"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/core",
3
- "version": "6.70.3",
3
+ "version": "6.70.5",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "type": "module",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/graphql",
3
3
  "type": "module",
4
- "version": "6.70.3",
4
+ "version": "6.70.5",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
@@ -2,7 +2,7 @@
2
2
  "name": "@zuplo/openapi-tools",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "6.70.3",
5
+ "version": "6.70.5",
6
6
  "description": "Tooling for OpenAPI files",
7
7
  "repository": {
8
8
  "type": "git",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/otel",
3
3
  "type": "module",
4
- "version": "6.70.3",
4
+ "version": "6.70.5",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "6.70.3",
4
+ "version": "6.70.5",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "6.70.3",
3
+ "version": "6.70.5",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "type": "module",
@@ -29,10 +29,10 @@
29
29
  "@opentelemetry/api": "1.9.0",
30
30
  "@sentry/node": "9.22.0",
31
31
  "@swc/core": "1.10.18",
32
- "@zuplo/core": "6.70.3",
32
+ "@zuplo/core": "6.70.5",
33
33
  "@zuplo/editor": "1.0.20821740935",
34
- "@zuplo/openapi-tools": "6.70.3",
35
- "@zuplo/runtime": "6.70.3",
34
+ "@zuplo/openapi-tools": "6.70.5",
35
+ "@zuplo/runtime": "6.70.5",
36
36
  "chalk": "5.4.1",
37
37
  "chokidar": "3.5.3",
38
38
  "cookie": "1.0.2",
@@ -66,8 +66,8 @@
66
66
  "workerd": "1.20241230.0",
67
67
  "yargs": "17.7.2",
68
68
  "zod": "3.25.76",
69
- "@zuplo/graphql": "6.70.3",
70
- "@zuplo/otel": "6.70.3"
69
+ "@zuplo/graphql": "6.70.5",
70
+ "@zuplo/otel": "6.70.5"
71
71
  },
72
72
  "bundleDependencies": [
73
73
  "@fastify/cors",