@prisma/cli 8.0.0-rc.19 → 8.0.0-rc.19-dev.138

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 (2) hide show
  1. package/dist/cli.js +33 -44
  2. package/package.json +7 -7
package/dist/cli.js CHANGED
@@ -62,8 +62,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
62
62
  * unified binary's name.
63
63
  */
64
64
  const CLI_NAME = "prisma";
65
- /** The unified CLI's docs section (also the update-check fallback
66
- * instruction URL). */
65
+ /** The unified CLI's docs section. */
67
66
  const CLI_DOCS_URL = "https://www.prisma.io/docs/cli";
68
67
  /**
69
68
  * Base URL for structured-error documentation links. The engine composes
@@ -1221,7 +1220,10 @@ async function readPastedCallbackUrl(rl, options) {
1221
1220
  try {
1222
1221
  answer = await rl.question("Paste the callback URL here: ", { signal: options.signal });
1223
1222
  } catch (error) {
1224
- if (error?.name === "AbortError") return null;
1223
+ if (error?.name === "AbortError") {
1224
+ if (options.signal.aborted) return null;
1225
+ throw new CliStructuredError("CLI.PROMPT_CANCELLED", "Sign-in was cancelled before it completed.");
1226
+ }
1225
1227
  throw error;
1226
1228
  }
1227
1229
  const trimmed = answer.trim().replace(/^["']|["']$/g, "");
@@ -3518,34 +3520,18 @@ const SIGN_IN$1 = {
3518
3520
  };
3519
3521
  function presentationsFor$1(result, environmentInForce) {
3520
3522
  const summary = result.endedCount === 0 ? "No workspace sessions to end." : `Ended ${result.endedCount} workspace ${result.endedCount === 1 ? "session" : "sessions"}.`;
3521
- const rows = [{
3522
- label: "ended",
3523
- value: String(result.endedCount)
3524
- }];
3525
3523
  return {
3526
3524
  json: () => result,
3527
- human: () => [
3528
- {
3529
- kind: "summary",
3530
- status: "info",
3531
- text: "Clearing your stored workspace sessions."
3532
- },
3533
- {
3534
- kind: "fields",
3535
- rows
3536
- },
3537
- {
3538
- kind: "summary",
3539
- status: "ok",
3540
- text: summary
3541
- },
3542
- ...environmentInForce ? [{
3543
- kind: "summary",
3544
- status: "info",
3545
- text: ENVIRONMENT_CREDENTIAL_NOTICE
3546
- }] : []
3547
- ],
3548
- stdout: () => rows.map((row) => `${row.label}: ${row.value}`),
3525
+ human: () => [{
3526
+ kind: "summary",
3527
+ status: "ok",
3528
+ text: summary
3529
+ }, ...environmentInForce ? [{
3530
+ kind: "summary",
3531
+ status: "info",
3532
+ text: ENVIRONMENT_CREDENTIAL_NOTICE
3533
+ }] : []],
3534
+ stdout: () => [],
3549
3535
  next: () => [SIGN_IN$1]
3550
3536
  };
3551
3537
  }
@@ -14930,9 +14916,10 @@ function configPathFromArgv(argv) {
14930
14916
  //#endregion
14931
14917
  //#region src/update-check.ts
14932
14918
  const UPDATE_CHECK_FILE_NAME = "update-check.json";
14933
- const FALLBACK_INSTALL_DOCS_URL = CLI_DOCS_URL;
14919
+ const PACKAGE_NAME = "prisma";
14920
+ const FALLBACK_INSTALL_DOCS_URL = "https://www.prisma.io/docs/orm/release-status#what-you-get-when-you-install-today";
14934
14921
  const NOTIFICATION_INTERVAL_MS = 1440 * 60 * 1e3;
14935
- const REGISTRY_URL = "https://registry.npmjs.org/@prisma%2fcli";
14922
+ const REGISTRY_URL = "https://registry.npmjs.org/prisma";
14936
14923
  const REGISTRY_TIMEOUT_MS = 3e3;
14937
14924
  var UpdateCheckStore = class {
14938
14925
  filePath;
@@ -14960,13 +14947,14 @@ async function maybeWriteCachedUpdateNotification(runtime) {
14960
14947
  try {
14961
14948
  const cacheDir = resolveUpdateCheckCacheDir(runtime);
14962
14949
  const store = new UpdateCheckStore(cacheDir);
14963
- const state = await store.read();
14950
+ const cached = await store.read();
14951
+ const state = cached?.packageName === PACKAGE_NAME ? cached : null;
14964
14952
  const latestVersion = state?.latestVersion;
14965
14953
  if (latestVersion && isInstalledVersionStale(getCliVersion(), latestVersion) && shouldNotify(state)) {
14966
14954
  runtime.stderr.write(renderUpdateNotification(latestVersion, selectUpdateInstruction(runtime.env)));
14967
14955
  await store.write({
14968
14956
  ...state,
14969
- packageName: "@prisma/cli",
14957
+ packageName: PACKAGE_NAME,
14970
14958
  installedVersion: getCliVersion(),
14971
14959
  notifiedAt: (/* @__PURE__ */ new Date()).toISOString()
14972
14960
  });
@@ -14981,10 +14969,11 @@ async function runUpdateDiscovery(options) {
14981
14969
  const latestVersion = await fetchLatestVersion(options.registryUrl ?? REGISTRY_URL, options.fetchImpl ?? fetch);
14982
14970
  if (!latestVersion) return;
14983
14971
  const store = new UpdateCheckStore(options.cacheDir);
14984
- const previousState = await store.read();
14972
+ const cached = await store.read();
14973
+ const previousState = cached?.packageName === PACKAGE_NAME ? cached : null;
14985
14974
  await store.write({
14986
14975
  ...previousState,
14987
- packageName: "@prisma/cli",
14976
+ packageName: PACKAGE_NAME,
14988
14977
  installedVersion: options.installedVersion,
14989
14978
  latestVersion,
14990
14979
  checkedAt: (options.now ?? /* @__PURE__ */ new Date()).toISOString()
@@ -15024,7 +15013,7 @@ async function scheduleRemoteDiscovery(runtime, store, state, cacheDir) {
15024
15013
  const checkedAt = (/* @__PURE__ */ new Date()).toISOString();
15025
15014
  await store.write({
15026
15015
  ...state,
15027
- packageName: "@prisma/cli",
15016
+ packageName: PACKAGE_NAME,
15028
15017
  installedVersion: getCliVersion(),
15029
15018
  checkedAt
15030
15019
  });
@@ -15047,12 +15036,12 @@ function selectUpdateInstruction(env, processArgv = process.argv) {
15047
15036
  const entrypoint = (processArgv[1] ?? "").replace(/\\/g, "/").toLowerCase();
15048
15037
  const userAgent = env.npm_config_user_agent?.toLowerCase() ?? "";
15049
15038
  if (isEphemeralInvocation(entrypoint, env.npm_lifecycle_event?.toLowerCase() ?? "")) return docsInstruction();
15050
- if (entrypoint.includes("/node_modules/.bin/")) {
15051
- if (userAgent.startsWith("pnpm")) return commandInstruction("pnpm add -D @prisma/cli@latest");
15052
- if (userAgent.startsWith("bun")) return commandInstruction("bun add -d @prisma/cli@latest");
15053
- if (userAgent.startsWith("npm")) return commandInstruction("npm install --save-dev @prisma/cli@latest");
15039
+ if (env.npm_config_global === "true" || isLikelyGlobalNpmEntrypoint(entrypoint)) return commandInstruction("npm install --global prisma@latest");
15040
+ if (entrypoint.includes("/node_modules/")) {
15041
+ if (userAgent.startsWith("pnpm")) return commandInstruction("pnpm add -D prisma@latest");
15042
+ if (userAgent.startsWith("bun")) return commandInstruction("bun add -d prisma@latest");
15043
+ if (userAgent.startsWith("npm")) return commandInstruction("npm install --save-dev prisma@latest");
15054
15044
  }
15055
- if (env.npm_config_global === "true" || isLikelyGlobalNpmEntrypoint(entrypoint)) return commandInstruction("npm install --global @prisma/cli@latest");
15056
15045
  return docsInstruction();
15057
15046
  }
15058
15047
  function renderUpdateNotification(latestVersion, instruction) {
@@ -15064,13 +15053,13 @@ function renderUpdateNotification(latestVersion, instruction) {
15064
15053
  }
15065
15054
  function renderUpdateInstruction(instruction) {
15066
15055
  if (instruction.type === "command") return `Run ${instruction.value} to update.`;
15067
- return `See ${instruction.value} for update instructions.`;
15056
+ return `See ${instruction.value} for installation commands.`;
15068
15057
  }
15069
15058
  function isEphemeralInvocation(entrypoint, lifecycle) {
15070
- return lifecycle === "npx" || lifecycle === "pnpx" || entrypoint.includes("/_npx/") || entrypoint.includes("/.bun/");
15059
+ return lifecycle === "npx" || lifecycle === "pnpx" || entrypoint.includes("/_npx/") || entrypoint.includes("/.bun/install/cache/");
15071
15060
  }
15072
15061
  function isLikelyGlobalNpmEntrypoint(entrypoint) {
15073
- return /\/npm\/prisma-cli(\.cmd|\.exe)?$/.test(entrypoint) || /\/npm-global\/bin\/prisma-cli$/.test(entrypoint);
15062
+ return /\/npm\/prisma(\.cmd|\.exe)?$/.test(entrypoint) || /\/npm-global\/bin\/prisma$/.test(entrypoint);
15074
15063
  }
15075
15064
  function commandInstruction(value) {
15076
15065
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/cli",
3
- "version": "8.0.0-rc.19",
3
+ "version": "8.0.0-rc.19-dev.138",
4
4
  "description": "Command-line interface for the Prisma Developer Platform.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -41,10 +41,10 @@
41
41
  "dependencies": {
42
42
  "@manypkg/tools": "^2.1.2",
43
43
  "@prisma/cli-engine": "0.6.2",
44
- "@prisma/composer-cli": "0.25.0",
44
+ "@prisma/composer-cli": "0.25.0-dev.5",
45
45
  "@prisma/compute-sdk": "0.43.0",
46
46
  "@prisma/management-api-sdk": "1.80.0",
47
- "@prisma/orm-toolchain": "8.0.0-rc.13",
47
+ "@prisma/orm-toolchain": "8.0.0-rc.14-dev.20",
48
48
  "@vercel/detect-agent": "^1.2.3",
49
49
  "better-result": "^2.9.2",
50
50
  "cross-spawn": "^7.0.6",
@@ -53,11 +53,11 @@
53
53
  "open": "^11.0.0"
54
54
  },
55
55
  "devDependencies": {
56
- "@prisma/composer": "0.25.0",
56
+ "@prisma/composer": "0.25.0-dev.5",
57
57
  "@prisma/credentials-store": "^7.8.0",
58
- "@repo/cli-conformance": "8.0.0-rc.19",
59
- "@repo/cli-telemetry": "8.0.0-rc.19",
60
- "@repo/tsconfig": "8.0.0-rc.19",
58
+ "@repo/cli-conformance": "8.0.0-rc.19-dev.138",
59
+ "@repo/cli-telemetry": "8.0.0-rc.19-dev.138",
60
+ "@repo/tsconfig": "8.0.0-rc.19-dev.138",
61
61
  "@types/node": "^22.19.19",
62
62
  "@types/cross-spawn": "^6.0.6",
63
63
  "tsdown": "^0.21.10",