@prisma/composer-cli 0.6.0-dev.21 → 0.6.0

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.
package/dist/family.mjs CHANGED
@@ -1,9 +1,13 @@
1
1
  import { a as DOCS_BASE, t as notOk$1 } from "./result-D4d-xy4I.mjs";
2
2
  import { n as executionDiagnostics, r as executorLoadFailure } from "./shared-BTnATsqm-CDCqKwCF.mjs";
3
3
  import { t as alchemyCommandLine } from "./run-alchemy-D44OZlyB-wmf8mHRE.mjs";
4
+ import "node:module";
4
5
  import { spawn } from "node:child_process";
5
6
  import { EnvironmentCredentialManager, createCli, defineCommand, defineCommandFamily, defineConfigSection, defineSessionCommand, exitWithChildStatus, flag, loadConfig, positional } from "@prisma/cli-engine";
6
7
  import { CliStructuredError, notOk, ok } from "@prisma/cli-engine/protocol";
8
+ //#region \0rolldown/runtime.js
9
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
10
+ //#endregion
7
11
  //#region ../../0-framework/3-tooling/cli/dist/log-DfT2hHqi.mjs
8
12
  /** In-package variant threading the injection seam (the CLI's RunDeps, unit
9
13
  * tests). Deliberately NOT re-exported through `./control` — the seam mirrors
@@ -58,7 +62,380 @@ async function logWithDeps(input, deps) {
58
62
  return executor.executeLog(input, deps, cwd);
59
63
  }
60
64
  //#endregion
61
- //#region ../../0-framework/3-tooling/cli/dist/engine-cli-BurDkrQe.mjs
65
+ //#region ../../../node_modules/ci-info/vendors.json
66
+ var require_vendors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
67
+ module.exports = [
68
+ {
69
+ "name": "Agola CI",
70
+ "constant": "AGOLA",
71
+ "env": "AGOLA_GIT_REF",
72
+ "pr": "AGOLA_PULL_REQUEST_ID"
73
+ },
74
+ {
75
+ "name": "Alpic",
76
+ "constant": "ALPIC",
77
+ "env": "ALPIC_HOST"
78
+ },
79
+ {
80
+ "name": "Appcircle",
81
+ "constant": "APPCIRCLE",
82
+ "env": "AC_APPCIRCLE",
83
+ "pr": {
84
+ "env": "AC_GIT_PR",
85
+ "ne": "false"
86
+ }
87
+ },
88
+ {
89
+ "name": "AppVeyor",
90
+ "constant": "APPVEYOR",
91
+ "env": "APPVEYOR",
92
+ "pr": "APPVEYOR_PULL_REQUEST_NUMBER"
93
+ },
94
+ {
95
+ "name": "AWS CodeBuild",
96
+ "constant": "CODEBUILD",
97
+ "env": "CODEBUILD_BUILD_ARN",
98
+ "pr": {
99
+ "env": "CODEBUILD_WEBHOOK_EVENT",
100
+ "any": [
101
+ "PULL_REQUEST_CREATED",
102
+ "PULL_REQUEST_UPDATED",
103
+ "PULL_REQUEST_REOPENED"
104
+ ]
105
+ }
106
+ },
107
+ {
108
+ "name": "Azure Pipelines",
109
+ "constant": "AZURE_PIPELINES",
110
+ "env": "TF_BUILD",
111
+ "pr": { "BUILD_REASON": "PullRequest" }
112
+ },
113
+ {
114
+ "name": "Bamboo",
115
+ "constant": "BAMBOO",
116
+ "env": "bamboo_planKey"
117
+ },
118
+ {
119
+ "name": "Bitbucket Pipelines",
120
+ "constant": "BITBUCKET",
121
+ "env": "BITBUCKET_COMMIT",
122
+ "pr": "BITBUCKET_PR_ID"
123
+ },
124
+ {
125
+ "name": "Bitrise",
126
+ "constant": "BITRISE",
127
+ "env": "BITRISE_IO",
128
+ "pr": "BITRISE_PULL_REQUEST"
129
+ },
130
+ {
131
+ "name": "Buddy",
132
+ "constant": "BUDDY",
133
+ "env": "BUDDY_WORKSPACE_ID",
134
+ "pr": "BUDDY_EXECUTION_PULL_REQUEST_ID"
135
+ },
136
+ {
137
+ "name": "Buildkite",
138
+ "constant": "BUILDKITE",
139
+ "env": "BUILDKITE",
140
+ "pr": {
141
+ "env": "BUILDKITE_PULL_REQUEST",
142
+ "ne": "false"
143
+ }
144
+ },
145
+ {
146
+ "name": "CircleCI",
147
+ "constant": "CIRCLE",
148
+ "env": "CIRCLECI",
149
+ "pr": "CIRCLE_PULL_REQUEST"
150
+ },
151
+ {
152
+ "name": "Cirrus CI",
153
+ "constant": "CIRRUS",
154
+ "env": "CIRRUS_CI",
155
+ "pr": "CIRRUS_PR"
156
+ },
157
+ {
158
+ "name": "Cloudflare Pages",
159
+ "constant": "CLOUDFLARE_PAGES",
160
+ "env": "CF_PAGES"
161
+ },
162
+ {
163
+ "name": "Cloudflare Workers",
164
+ "constant": "CLOUDFLARE_WORKERS",
165
+ "env": "WORKERS_CI"
166
+ },
167
+ {
168
+ "name": "Codefresh",
169
+ "constant": "CODEFRESH",
170
+ "env": "CF_BUILD_ID",
171
+ "pr": { "any": ["CF_PULL_REQUEST_NUMBER", "CF_PULL_REQUEST_ID"] }
172
+ },
173
+ {
174
+ "name": "Codemagic",
175
+ "constant": "CODEMAGIC",
176
+ "env": "CM_BUILD_ID",
177
+ "pr": "CM_PULL_REQUEST"
178
+ },
179
+ {
180
+ "name": "Codeship",
181
+ "constant": "CODESHIP",
182
+ "env": { "CI_NAME": "codeship" }
183
+ },
184
+ {
185
+ "name": "Drone",
186
+ "constant": "DRONE",
187
+ "env": "DRONE",
188
+ "pr": { "DRONE_BUILD_EVENT": "pull_request" }
189
+ },
190
+ {
191
+ "name": "dsari",
192
+ "constant": "DSARI",
193
+ "env": "DSARI"
194
+ },
195
+ {
196
+ "name": "Earthly",
197
+ "constant": "EARTHLY",
198
+ "env": "EARTHLY_CI"
199
+ },
200
+ {
201
+ "name": "Expo Application Services",
202
+ "constant": "EAS",
203
+ "env": "EAS_BUILD"
204
+ },
205
+ {
206
+ "name": "Gerrit",
207
+ "constant": "GERRIT",
208
+ "env": "GERRIT_PROJECT"
209
+ },
210
+ {
211
+ "name": "Gitea Actions",
212
+ "constant": "GITEA_ACTIONS",
213
+ "env": "GITEA_ACTIONS"
214
+ },
215
+ {
216
+ "name": "GitHub Actions",
217
+ "constant": "GITHUB_ACTIONS",
218
+ "env": "GITHUB_ACTIONS",
219
+ "pr": { "GITHUB_EVENT_NAME": "pull_request" }
220
+ },
221
+ {
222
+ "name": "GitLab CI",
223
+ "constant": "GITLAB",
224
+ "env": "GITLAB_CI",
225
+ "pr": "CI_MERGE_REQUEST_ID"
226
+ },
227
+ {
228
+ "name": "GoCD",
229
+ "constant": "GOCD",
230
+ "env": "GO_PIPELINE_LABEL"
231
+ },
232
+ {
233
+ "name": "Google Cloud Build",
234
+ "constant": "GOOGLE_CLOUD_BUILD",
235
+ "env": "BUILDER_OUTPUT"
236
+ },
237
+ {
238
+ "name": "Harness CI",
239
+ "constant": "HARNESS",
240
+ "env": "HARNESS_BUILD_ID"
241
+ },
242
+ {
243
+ "name": "Heroku",
244
+ "constant": "HEROKU",
245
+ "env": {
246
+ "env": "NODE",
247
+ "includes": "/app/.heroku/node/bin/node"
248
+ }
249
+ },
250
+ {
251
+ "name": "Hudson",
252
+ "constant": "HUDSON",
253
+ "env": "HUDSON_URL"
254
+ },
255
+ {
256
+ "name": "Jenkins",
257
+ "constant": "JENKINS",
258
+ "env": ["JENKINS_URL", "BUILD_ID"],
259
+ "pr": { "any": ["ghprbPullId", "CHANGE_ID"] }
260
+ },
261
+ {
262
+ "name": "LayerCI",
263
+ "constant": "LAYERCI",
264
+ "env": "LAYERCI",
265
+ "pr": "LAYERCI_PULL_REQUEST"
266
+ },
267
+ {
268
+ "name": "Magnum CI",
269
+ "constant": "MAGNUM",
270
+ "env": "MAGNUM"
271
+ },
272
+ {
273
+ "name": "Netlify CI",
274
+ "constant": "NETLIFY",
275
+ "env": "NETLIFY",
276
+ "pr": {
277
+ "env": "PULL_REQUEST",
278
+ "ne": "false"
279
+ }
280
+ },
281
+ {
282
+ "name": "Nevercode",
283
+ "constant": "NEVERCODE",
284
+ "env": "NEVERCODE",
285
+ "pr": {
286
+ "env": "NEVERCODE_PULL_REQUEST",
287
+ "ne": "false"
288
+ }
289
+ },
290
+ {
291
+ "name": "Prow",
292
+ "constant": "PROW",
293
+ "env": "PROW_JOB_ID"
294
+ },
295
+ {
296
+ "name": "ReleaseHub",
297
+ "constant": "RELEASEHUB",
298
+ "env": "RELEASE_BUILD_ID"
299
+ },
300
+ {
301
+ "name": "Render",
302
+ "constant": "RENDER",
303
+ "env": "RENDER",
304
+ "pr": { "IS_PULL_REQUEST": "true" }
305
+ },
306
+ {
307
+ "name": "Sail CI",
308
+ "constant": "SAIL",
309
+ "env": "SAILCI",
310
+ "pr": "SAIL_PULL_REQUEST_NUMBER"
311
+ },
312
+ {
313
+ "name": "Screwdriver",
314
+ "constant": "SCREWDRIVER",
315
+ "env": "SCREWDRIVER",
316
+ "pr": {
317
+ "env": "SD_PULL_REQUEST",
318
+ "ne": "false"
319
+ }
320
+ },
321
+ {
322
+ "name": "Semaphore",
323
+ "constant": "SEMAPHORE",
324
+ "env": "SEMAPHORE",
325
+ "pr": "PULL_REQUEST_NUMBER"
326
+ },
327
+ {
328
+ "name": "Sourcehut",
329
+ "constant": "SOURCEHUT",
330
+ "env": { "CI_NAME": "sourcehut" }
331
+ },
332
+ {
333
+ "name": "Strider CD",
334
+ "constant": "STRIDER",
335
+ "env": "STRIDER"
336
+ },
337
+ {
338
+ "name": "TaskCluster",
339
+ "constant": "TASKCLUSTER",
340
+ "env": ["TASK_ID", "RUN_ID"]
341
+ },
342
+ {
343
+ "name": "TeamCity",
344
+ "constant": "TEAMCITY",
345
+ "env": "TEAMCITY_VERSION"
346
+ },
347
+ {
348
+ "name": "Travis CI",
349
+ "constant": "TRAVIS",
350
+ "env": "TRAVIS",
351
+ "pr": {
352
+ "env": "TRAVIS_PULL_REQUEST",
353
+ "ne": "false"
354
+ }
355
+ },
356
+ {
357
+ "name": "Vela",
358
+ "constant": "VELA",
359
+ "env": "VELA",
360
+ "pr": { "VELA_PULL_REQUEST": "1" }
361
+ },
362
+ {
363
+ "name": "Vercel",
364
+ "constant": "VERCEL",
365
+ "env": { "any": ["NOW_BUILDER", "VERCEL"] },
366
+ "pr": "VERCEL_GIT_PULL_REQUEST_ID"
367
+ },
368
+ {
369
+ "name": "Visual Studio App Center",
370
+ "constant": "APPCENTER",
371
+ "env": "APPCENTER_BUILD_ID"
372
+ },
373
+ {
374
+ "name": "Woodpecker",
375
+ "constant": "WOODPECKER",
376
+ "env": { "CI": "woodpecker" },
377
+ "pr": { "CI_BUILD_EVENT": "pull_request" }
378
+ },
379
+ {
380
+ "name": "Xcode Cloud",
381
+ "constant": "XCODE_CLOUD",
382
+ "env": "CI_XCODE_PROJECT",
383
+ "pr": "CI_PULL_REQUEST_NUMBER"
384
+ },
385
+ {
386
+ "name": "Xcode Server",
387
+ "constant": "XCODE_SERVER",
388
+ "env": "XCS"
389
+ }
390
+ ];
391
+ }));
392
+ //#endregion
393
+ //#region ../../0-framework/3-tooling/cli/dist/engine-cli-BXXH4fM-.mjs
394
+ var import_ci_info = (/* @__PURE__ */ __commonJSMin(((exports) => {
395
+ const vendors = require_vendors();
396
+ const env = process.env;
397
+ Object.defineProperty(exports, "_vendors", { value: vendors.map(function(v) {
398
+ return v.constant;
399
+ }) });
400
+ exports.name = null;
401
+ exports.isPR = null;
402
+ exports.id = null;
403
+ if (env.CI !== "false") vendors.forEach(function(vendor) {
404
+ const isCI = (Array.isArray(vendor.env) ? vendor.env : [vendor.env]).every(function(obj) {
405
+ return checkEnv(obj);
406
+ });
407
+ exports[vendor.constant] = isCI;
408
+ if (!isCI) return;
409
+ exports.name = vendor.name;
410
+ exports.isPR = checkPR(vendor);
411
+ exports.id = vendor.constant;
412
+ });
413
+ exports.isCI = !!(env.CI !== "false" && (env.BUILD_ID || env.BUILD_NUMBER || env.CI || env.CI_APP_ID || env.CI_BUILD_ID || env.CI_BUILD_NUMBER || env.CI_NAME || env.CONTINUOUS_INTEGRATION || env.RUN_ID || exports.name || false));
414
+ function checkEnv(obj) {
415
+ if (typeof obj === "string") return !!env[obj];
416
+ if ("env" in obj) return env[obj.env] && env[obj.env].includes(obj.includes);
417
+ if ("any" in obj) return obj.any.some(function(k) {
418
+ return !!env[k];
419
+ });
420
+ return Object.keys(obj).every(function(k) {
421
+ return env[k] === obj[k];
422
+ });
423
+ }
424
+ function checkPR(vendor) {
425
+ switch (typeof vendor.pr) {
426
+ case "string": return !!env[vendor.pr];
427
+ case "object": if ("env" in vendor.pr) if ("any" in vendor.pr) return vendor.pr.any.some(function(key) {
428
+ return env[vendor.pr.env] === key;
429
+ });
430
+ else return vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne;
431
+ else if ("any" in vendor.pr) return vendor.pr.any.some(function(key) {
432
+ return !!env[key];
433
+ });
434
+ else return checkEnv(vendor.pr);
435
+ default: return null;
436
+ }
437
+ }
438
+ })))();
62
439
  /**
63
440
  * The family boundary's error translation.
64
441
  *
@@ -338,9 +715,7 @@ const createDeployCommand = (operations) => defineCommand({
338
715
  columns: ["Address", "Deployed"],
339
716
  rows: summary.nodes.map((node) => [node.address, node.entities.map((entity) => `${entity.kind} ${entity.id}`).join(", ")])
340
717
  }],
341
- stdout: () => [],
342
- json: () => ({ summary: summary ?? null }),
343
- next: () => []
718
+ json: () => ({ summary: summary ?? null })
344
719
  }));
345
720
  }
346
721
  });
@@ -419,16 +794,11 @@ const createDestroyCommand = (operations) => defineCommand({
419
794
  configPath: ctx.config.configPath,
420
795
  workspaceId: await workspaceIdOf(ctx),
421
796
  client: ctx.api
422
- })), ctx, () => ctx.present({ data: void 0 }, {
423
- human: () => [{
424
- kind: "summary",
425
- status: "ok",
426
- text: "Destroyed."
427
- }],
428
- stdout: () => [],
429
- json: () => void 0,
430
- next: () => []
431
- }));
797
+ })), ctx, () => ctx.present({ data: void 0 }, { human: () => [{
798
+ kind: "summary",
799
+ status: "ok",
800
+ text: "Destroyed."
801
+ }] }));
432
802
  }
433
803
  });
434
804
  const STOP_STEP = "Stopping the app's services — emulators and data stay up";
@@ -783,21 +1153,6 @@ function clientConfig(env, apiBaseUrl) {
783
1153
  };
784
1154
  }
785
1155
  /**
786
- * What this process runs on, for `ctx.host`. Bun and Deno both announce
787
- * themselves in `versions`; nothing else does, so an absent marker means Node.
788
- */
789
- function describeHost(host) {
790
- const name = ["bun", "deno"].find((candidate) => host.versions[candidate] !== void 0) ?? "node";
791
- return {
792
- runtime: {
793
- name,
794
- version: host.versions[name] ?? host.version
795
- },
796
- platform: host.platform,
797
- arch: host.arch
798
- };
799
- }
800
- /**
801
1156
  * Which package manager invoked us, read from the `npm_config_user_agent`
802
1157
  * every major manager sets (`pnpm/10.27.0 npm/? node/v24.16.0 darwin arm64`).
803
1158
  * `undefined` when the CLI was run directly rather than through a manager — a
@@ -824,11 +1179,13 @@ function detectPackageManager(env) {
824
1179
  * `--config` named. A host that loaded the file up front would read it for runs
825
1180
  * that never needed it, and would have nowhere to put `--config`.
826
1181
  *
827
- * Nothing here answers "is this CI": the engine detects it from `env` itself,
828
- * and `isCIOverride` exists only for hosts where that detection cannot be
829
- * right composer is not one.
1182
+ * `inCI` is the one thing here not derived from the host: `ci-info` answers it
1183
+ * from the real `process.env` at import, which is what the engine's `isCI` doc
1184
+ * asks a host to wire and what the `prisma` bin already does. Production passes
1185
+ * nothing. It is a parameter so a test can still drive CI state without
1186
+ * touching a process global.
830
1187
  */
831
- function createRuntime(host, loadConfig) {
1188
+ function createRuntime(host, loadConfig, inCI = import_ci_info.isCI) {
832
1189
  const env = host.env;
833
1190
  const apiBaseUrl = env["PRISMA_MANAGEMENT_API_URL"] ?? DEFAULT_MANAGEMENT_API_BASE_URL;
834
1191
  const packageManager = detectPackageManager(env);
@@ -864,7 +1221,7 @@ function createRuntime(host, loadConfig) {
864
1221
  spawn: spawnChild,
865
1222
  managementApi: { baseUrl: apiBaseUrl },
866
1223
  ...packageManager !== void 0 && { packageManager },
867
- host: describeHost(host)
1224
+ isCI: inCI
868
1225
  };
869
1226
  }
870
1227
  /**