@prisma/cli-engine 0.0.9 → 0.1.1

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/testing.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { F as PackageManagerRunner, G as SpawnChild, H as ChildResult, M as PackageManagerId, O as Runtime, St as TokenStorage, bt as ManagementApiClient, ct as EngineEvent, ft as ActiveCredential, ht as CredentialManager, i as MountedTree, j as RunSummary, k as TelemetryPayload, n as CommandFamily, pt as Credential, q as SpawnRequest, t as TelemetryDeclaration, tt as PresentedResult, ut as StreamEvent, vt as Session, xt as ManagementApiClientConfig, yt as StoredSessions } from "./report-Bh6-ntIa.js";
1
+ import { Ct as TokenStorage, F as TelemetryPayload, K as PackageManagerId, L as RunSummary, O as Host, P as Runtime, R as ChildResult, St as ManagementApiClientConfig, U as SpawnRequest, V as SpawnChild, Y as PackageManagerRunner, bt as StoredSessions, dt as StreamEvent, gt as CredentialManager, i as MountedTree, lt as EngineEvent, mt as Credential, n as CommandFamily, nt as PresentedResult, pt as ActiveCredential, t as TelemetryDeclaration, xt as ManagementApiClient, yt as Session } from "./report-DID_e0si.js";
2
2
 
3
3
  //#region src/in-memory-credential-manager.d.ts
4
4
  /** A stored session with its credential material — what the manager
@@ -137,7 +137,8 @@ interface TestCli {
137
137
  };
138
138
  readonly env?: Readonly<Record<string, string | undefined>>;
139
139
  /** Overrides the CLI-level seed, so one harness can assert both
140
- * sides of the CI branch. */
140
+ * sides of the CI branch. Absent leaves the engine to detect CI
141
+ * from `env`, which is how a test asserts detection itself. */
141
142
  readonly isCI?: boolean;
142
143
  }): Promise<{
143
144
  readonly exitCode: number;
@@ -200,6 +201,9 @@ declare function createTestCli(spec: {
200
201
  /** Overrides detection, the same way a host's Runtime does; absent
201
202
  * means the engine detects from the run's cwd. */
202
203
  readonly packageManager?: PackageManagerId;
204
+ /** What the run reports itself as running on; defaults to a fixed
205
+ * host so a bug-report payload asserts the same on every machine. */
206
+ readonly host?: Host;
203
207
  /** The scripted stand-in for the shipped bin's spawner: assert the
204
208
  * composed file/args/cwd, script exit codes and stderr, drive
205
209
  * onOutput. Absent means this host has no runner, which is the
@@ -229,7 +233,9 @@ declare function createTestCli(spec: {
229
233
  * the run result either way; pass a spy to assert ordering, a
230
234
  * thrower to exercise failure isolation, or `null` to model a host
231
235
  * that wires no seam at all. */
232
- readonly telemetrySpawner?: ((payload: TelemetryPayload) => void) | null; /** Seeds Runtime.isCI for every run; `run({ isCI })` overrides it. */
236
+ readonly telemetrySpawner?: ((payload: TelemetryPayload) => void) | null;
237
+ /** Forces the CI answer for every run; `run({ isCI })` overrides it.
238
+ * Absent leaves the engine to detect CI from the run's `env`. */
233
239
  readonly isCI?: boolean;
234
240
  }): TestCli;
235
241
  //#endregion
package/dist/testing.js CHANGED
@@ -1,4 +1,4 @@
1
- import { g as noSessionForWorkspaceError, i as buildEngine, m as credentialsRequiredError, n as claimedIdentity, p as credentialWorkspaceMismatchError, r as credentialWorkspaceId, t as claimedExpiresAt } from "./token-claims-CGQ-5m9N.js";
1
+ import { _ as noSessionForWorkspaceError, h as credentialsRequiredError, i as buildEngine, m as credentialWorkspaceMismatchError, n as claimedIdentity, r as credentialWorkspaceId, t as claimedExpiresAt } from "./token-claims-B-rQgBjv.js";
2
2
  import { Buffer } from "node:buffer";
3
3
  //#region src/in-memory-credential-manager.ts
4
4
  /**
@@ -420,7 +420,7 @@ function createTestCli(spec) {
420
420
  stdout: opts?.isTty?.stdout ?? false,
421
421
  stderr: opts?.isTty?.stderr ?? false
422
422
  },
423
- isCI: opts?.isCI ?? spec.isCI ?? false,
423
+ isCIOverride: opts?.isCI ?? spec.isCI,
424
424
  exit: (code) => {
425
425
  throw new Error(`@prisma/cli-engine: runtime.exit(${code}) reached the test harness`);
426
426
  },
@@ -441,7 +441,15 @@ function createTestCli(spec) {
441
441
  openUrl,
442
442
  managementApi: { baseUrl: managementApiBaseUrl },
443
443
  packageManager: spec.packageManager,
444
- runPackageManager: spec.packageManagerRunner
444
+ runPackageManager: spec.packageManagerRunner,
445
+ host: spec.host ?? {
446
+ runtime: {
447
+ name: "node",
448
+ version: "v22.12.0"
449
+ },
450
+ platform: "linux",
451
+ arch: "x64"
452
+ }
445
453
  };
446
454
  const running = engine.execute(argv, runtime, {
447
455
  onEvent: (event) => {