@prisma/cli 8.0.0-rc.19-dev.135 → 8.0.0-rc.19-dev.136

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 +29 -43
  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
@@ -3518,34 +3517,18 @@ const SIGN_IN$1 = {
3518
3517
  };
3519
3518
  function presentationsFor$1(result, environmentInForce) {
3520
3519
  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
3520
  return {
3526
3521
  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}`),
3522
+ human: () => [{
3523
+ kind: "summary",
3524
+ status: "ok",
3525
+ text: summary
3526
+ }, ...environmentInForce ? [{
3527
+ kind: "summary",
3528
+ status: "info",
3529
+ text: ENVIRONMENT_CREDENTIAL_NOTICE
3530
+ }] : []],
3531
+ stdout: () => [],
3549
3532
  next: () => [SIGN_IN$1]
3550
3533
  };
3551
3534
  }
@@ -14930,9 +14913,10 @@ function configPathFromArgv(argv) {
14930
14913
  //#endregion
14931
14914
  //#region src/update-check.ts
14932
14915
  const UPDATE_CHECK_FILE_NAME = "update-check.json";
14933
- const FALLBACK_INSTALL_DOCS_URL = CLI_DOCS_URL;
14916
+ const PACKAGE_NAME = "prisma";
14917
+ const FALLBACK_INSTALL_DOCS_URL = "https://www.prisma.io/docs/orm/release-status#what-you-get-when-you-install-today";
14934
14918
  const NOTIFICATION_INTERVAL_MS = 1440 * 60 * 1e3;
14935
- const REGISTRY_URL = "https://registry.npmjs.org/@prisma%2fcli";
14919
+ const REGISTRY_URL = "https://registry.npmjs.org/prisma";
14936
14920
  const REGISTRY_TIMEOUT_MS = 3e3;
14937
14921
  var UpdateCheckStore = class {
14938
14922
  filePath;
@@ -14960,13 +14944,14 @@ async function maybeWriteCachedUpdateNotification(runtime) {
14960
14944
  try {
14961
14945
  const cacheDir = resolveUpdateCheckCacheDir(runtime);
14962
14946
  const store = new UpdateCheckStore(cacheDir);
14963
- const state = await store.read();
14947
+ const cached = await store.read();
14948
+ const state = cached?.packageName === PACKAGE_NAME ? cached : null;
14964
14949
  const latestVersion = state?.latestVersion;
14965
14950
  if (latestVersion && isInstalledVersionStale(getCliVersion(), latestVersion) && shouldNotify(state)) {
14966
14951
  runtime.stderr.write(renderUpdateNotification(latestVersion, selectUpdateInstruction(runtime.env)));
14967
14952
  await store.write({
14968
14953
  ...state,
14969
- packageName: "@prisma/cli",
14954
+ packageName: PACKAGE_NAME,
14970
14955
  installedVersion: getCliVersion(),
14971
14956
  notifiedAt: (/* @__PURE__ */ new Date()).toISOString()
14972
14957
  });
@@ -14981,10 +14966,11 @@ async function runUpdateDiscovery(options) {
14981
14966
  const latestVersion = await fetchLatestVersion(options.registryUrl ?? REGISTRY_URL, options.fetchImpl ?? fetch);
14982
14967
  if (!latestVersion) return;
14983
14968
  const store = new UpdateCheckStore(options.cacheDir);
14984
- const previousState = await store.read();
14969
+ const cached = await store.read();
14970
+ const previousState = cached?.packageName === PACKAGE_NAME ? cached : null;
14985
14971
  await store.write({
14986
14972
  ...previousState,
14987
- packageName: "@prisma/cli",
14973
+ packageName: PACKAGE_NAME,
14988
14974
  installedVersion: options.installedVersion,
14989
14975
  latestVersion,
14990
14976
  checkedAt: (options.now ?? /* @__PURE__ */ new Date()).toISOString()
@@ -15024,7 +15010,7 @@ async function scheduleRemoteDiscovery(runtime, store, state, cacheDir) {
15024
15010
  const checkedAt = (/* @__PURE__ */ new Date()).toISOString();
15025
15011
  await store.write({
15026
15012
  ...state,
15027
- packageName: "@prisma/cli",
15013
+ packageName: PACKAGE_NAME,
15028
15014
  installedVersion: getCliVersion(),
15029
15015
  checkedAt
15030
15016
  });
@@ -15047,12 +15033,12 @@ function selectUpdateInstruction(env, processArgv = process.argv) {
15047
15033
  const entrypoint = (processArgv[1] ?? "").replace(/\\/g, "/").toLowerCase();
15048
15034
  const userAgent = env.npm_config_user_agent?.toLowerCase() ?? "";
15049
15035
  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");
15036
+ if (env.npm_config_global === "true" || isLikelyGlobalNpmEntrypoint(entrypoint)) return commandInstruction("npm install --global prisma@latest");
15037
+ if (entrypoint.includes("/node_modules/")) {
15038
+ if (userAgent.startsWith("pnpm")) return commandInstruction("pnpm add -D prisma@latest");
15039
+ if (userAgent.startsWith("bun")) return commandInstruction("bun add -d prisma@latest");
15040
+ if (userAgent.startsWith("npm")) return commandInstruction("npm install --save-dev prisma@latest");
15054
15041
  }
15055
- if (env.npm_config_global === "true" || isLikelyGlobalNpmEntrypoint(entrypoint)) return commandInstruction("npm install --global @prisma/cli@latest");
15056
15042
  return docsInstruction();
15057
15043
  }
15058
15044
  function renderUpdateNotification(latestVersion, instruction) {
@@ -15064,13 +15050,13 @@ function renderUpdateNotification(latestVersion, instruction) {
15064
15050
  }
15065
15051
  function renderUpdateInstruction(instruction) {
15066
15052
  if (instruction.type === "command") return `Run ${instruction.value} to update.`;
15067
- return `See ${instruction.value} for update instructions.`;
15053
+ return `See ${instruction.value} for installation commands.`;
15068
15054
  }
15069
15055
  function isEphemeralInvocation(entrypoint, lifecycle) {
15070
- return lifecycle === "npx" || lifecycle === "pnpx" || entrypoint.includes("/_npx/") || entrypoint.includes("/.bun/");
15056
+ return lifecycle === "npx" || lifecycle === "pnpx" || entrypoint.includes("/_npx/") || entrypoint.includes("/.bun/install/cache/");
15071
15057
  }
15072
15058
  function isLikelyGlobalNpmEntrypoint(entrypoint) {
15073
- return /\/npm\/prisma-cli(\.cmd|\.exe)?$/.test(entrypoint) || /\/npm-global\/bin\/prisma-cli$/.test(entrypoint);
15059
+ return /\/npm\/prisma(\.cmd|\.exe)?$/.test(entrypoint) || /\/npm-global\/bin\/prisma$/.test(entrypoint);
15074
15060
  }
15075
15061
  function commandInstruction(value) {
15076
15062
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/cli",
3
- "version": "8.0.0-rc.19-dev.135",
3
+ "version": "8.0.0-rc.19-dev.136",
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-dev.1",
44
+ "@prisma/composer-cli": "0.25.0-dev.2",
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-dev.3",
47
+ "@prisma/orm-toolchain": "8.0.0-rc.13-dev.7",
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-dev.1",
56
+ "@prisma/composer": "0.25.0-dev.2",
57
57
  "@prisma/credentials-store": "^7.8.0",
58
- "@repo/cli-conformance": "8.0.0-rc.19-dev.135",
59
- "@repo/cli-telemetry": "8.0.0-rc.19-dev.135",
60
- "@repo/tsconfig": "8.0.0-rc.19-dev.135",
58
+ "@repo/cli-conformance": "8.0.0-rc.19-dev.136",
59
+ "@repo/cli-telemetry": "8.0.0-rc.19-dev.136",
60
+ "@repo/tsconfig": "8.0.0-rc.19-dev.136",
61
61
  "@types/node": "^22.19.19",
62
62
  "@types/cross-spawn": "^6.0.6",
63
63
  "tsdown": "^0.21.10",