@prisma/composer 0.35.0-dev.1 → 0.35.0-dev.2
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/{app-config-B_gQYj3K-DpMi9a4K.d.mts → app-config-DR7ku-WW-Dun53zka.d.mts} +16 -16
- package/dist/{app-config-B_gQYj3K-DpMi9a4K.d.mts.map → app-config-DR7ku-WW-Dun53zka.d.mts.map} +1 -1
- package/dist/config-5sq9lPhi.d.mts +1 -0
- package/dist/config.d.mts +2 -2
- package/dist/control.d.mts +13 -20
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +20 -4
- package/dist/control.mjs.map +1 -1
- package/dist/deploy-5sq9lPhi.d.mts +1 -0
- package/dist/deploy.d.mts +2 -2
- package/dist/{deployment-summary-p88NV5m5-DTkPLzTp.d.mts → deployment-summary-p88NV5m5-Btf0R5T3.d.mts} +3 -3
- package/dist/{deployment-summary-p88NV5m5-DTkPLzTp.d.mts.map → deployment-summary-p88NV5m5-Btf0R5T3.d.mts.map} +1 -1
- package/dist/{dev-current-BB02pfSh-D-dYHs1q.mjs → dev-current-8HfFCN7C-C8Ste3qf.mjs} +5 -5
- package/dist/dev-current-8HfFCN7C-C8Ste3qf.mjs.map +1 -0
- package/dist/{execute-deploy-destroy-DwcoZIks-Cl-tWvo0.mjs → execute-deploy-destroy-DerNHILD-BStnE2yG.mjs} +52 -29
- package/dist/execute-deploy-destroy-DerNHILD-BStnE2yG.mjs.map +1 -0
- package/dist/{execute-dev-BHRWoEnd-D-YNpuEN.mjs → execute-dev-D_JvTKjS-BjlfRv3L.mjs} +6 -6
- package/dist/{execute-dev-BHRWoEnd-D-YNpuEN.mjs.map → execute-dev-D_JvTKjS-BjlfRv3L.mjs.map} +1 -1
- package/dist/{execute-dev-current-D4RkOtPA-CDBtbQUq.mjs → execute-dev-current-BRJkR4Y1-KETGQ-7f.mjs} +3 -3
- package/dist/{execute-dev-current-D4RkOtPA-CDBtbQUq.mjs.map → execute-dev-current-BRJkR4Y1-KETGQ-7f.mjs.map} +1 -1
- package/dist/{execute-log-DxjUaSwN-nVFDjZqy.mjs → execute-log-kq4gyrh9-DjAlYz6O.mjs} +4 -4
- package/dist/{execute-log-DxjUaSwN-nVFDjZqy.mjs.map → execute-log-kq4gyrh9-DjAlYz6O.mjs.map} +1 -1
- package/dist/local-target.d.mts +1 -1
- package/dist/nextjs-control.d.mts +3 -3
- package/dist/node-control.d.mts +3 -3
- package/dist/report.d.mts +3 -3
- package/dist/{run-report-C2o98uD--AX8kpz4Q.mjs → run-report-CmBz2-xc-S50d4g5V.mjs} +5 -5
- package/dist/run-report-CmBz2-xc-S50d4g5V.mjs.map +1 -0
- package/package.json +11 -11
- package/skills/prisma-composer-core-concepts/SKILL.md +49 -33
- package/dist/config-Bq3JlQ9_.d.mts +0 -1
- package/dist/deploy-Bq3JlQ9_.d.mts +0 -1
- package/dist/dev-current-BB02pfSh-D-dYHs1q.mjs.map +0 -1
- package/dist/execute-deploy-destroy-DwcoZIks-Cl-tWvo0.mjs.map +0 -1
- package/dist/run-report-C2o98uD--AX8kpz4Q.mjs.map +0 -1
|
@@ -5,7 +5,7 @@ import { Input, StackServices } from "alchemy";
|
|
|
5
5
|
import * as Effect from "effect/Effect";
|
|
6
6
|
import * as Layer from "effect/Layer";
|
|
7
7
|
import { State } from "alchemy/State/State";
|
|
8
|
-
//#region ../../0-framework/1-core/core/dist/app-config-
|
|
8
|
+
//#region ../../0-framework/1-core/core/dist/app-config-DR7ku-WW.d.mts
|
|
9
9
|
//#region src/container-transport.d.ts
|
|
10
10
|
/**
|
|
11
11
|
* Carries resolved containers from the CLI process into the alchemy process
|
|
@@ -17,12 +17,12 @@ import { State } from "alchemy/State/State";
|
|
|
17
17
|
* `deserializeContainers` reads each var back through the same extension's
|
|
18
18
|
* descriptor. The framework owns the vars; it never reads their contents.
|
|
19
19
|
*/
|
|
20
|
-
/** The key an extension resolves a container from: which app, which
|
|
20
|
+
/** The key an extension resolves a container from: which app, which environment. */
|
|
21
21
|
interface LocateContainerInput {
|
|
22
22
|
/** The application name (root node's name, or `--name`). */
|
|
23
23
|
readonly appName: string;
|
|
24
|
-
/** The
|
|
25
|
-
readonly
|
|
24
|
+
/** The environment name, git-ref validated. Core never interprets it; the extension maps it onto its platform. */
|
|
25
|
+
readonly environment: string;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* One resolved container. The framework sees only this interface; the
|
|
@@ -31,7 +31,7 @@ interface LocateContainerInput {
|
|
|
31
31
|
*/
|
|
32
32
|
interface ContainerInstance {
|
|
33
33
|
readonly input: LocateContainerInput;
|
|
34
|
-
/** The exact string the CLI hands `alchemy` as its stage — the deploy-state scope. Distinct from `input.
|
|
34
|
+
/** The exact string the CLI hands `alchemy` as its stage — the deploy-state scope. Distinct from `input.environment`: for Prisma Cloud this is the resolved Branch id (stable across renames, machine-independent). Framework-visible like `input` — NOT part of the `serialize()` payload, which stays extension-owned. */
|
|
35
35
|
readonly alchemyStage?: string | undefined;
|
|
36
36
|
/** Serialize to a non-empty string for the process transport above. The format is the extension's own; only its `deserialize` reads it. */
|
|
37
37
|
serialize(): string;
|
|
@@ -66,9 +66,9 @@ interface ContainerCredentials<C = unknown> {
|
|
|
66
66
|
* fails (same rule as ServiceLowering<P, S> — ADR-0033).
|
|
67
67
|
*/
|
|
68
68
|
interface ContainerDescriptor<I extends ContainerInstance = ContainerInstance, C = unknown> {
|
|
69
|
-
/** Resolve the container for (appName,
|
|
69
|
+
/** Resolve the container for (appName, environment), creating anything absent. Called by `deploy`. */
|
|
70
70
|
ensure(input: LocateContainerInput, credentials?: ContainerCredentials<C>): Promise<I>;
|
|
71
|
-
/** Find the container for (appName,
|
|
71
|
+
/** Find the container for (appName, environment); `undefined` when nothing exists. Called by `destroy` — never creates. */
|
|
72
72
|
locate(input: LocateContainerInput, credentials?: ContainerCredentials<C>): Promise<I | undefined>;
|
|
73
73
|
/** Remove the container after a successful destroy, after every extension's `teardown` has run. Failure policy is the extension's. */
|
|
74
74
|
remove(instance: I, credentials?: ContainerCredentials<C>): Promise<void>;
|
|
@@ -416,7 +416,7 @@ interface ExtensionDescriptor {
|
|
|
416
416
|
* Deploy-time prerequisite check — the CLI runs it once, after the app's
|
|
417
417
|
* Project/Branch are resolved and BEFORE any stack file is written or Alchemy
|
|
418
418
|
* runs. A target uses it to verify platform prerequisites (e.g. that every
|
|
419
|
-
* secret env var in the provision manifest exists for the resolved
|
|
419
|
+
* secret env var in the provision manifest exists for the resolved environment) and
|
|
420
420
|
* throws to abort the deploy. Async: it talks to the platform (ADR-0029).
|
|
421
421
|
*
|
|
422
422
|
* What it returns is carried to the alchemy process for this same extension
|
|
@@ -434,7 +434,7 @@ interface ExtensionDescriptor {
|
|
|
434
434
|
preflight?(input: PreflightInput): Promise<PreflightPayload>;
|
|
435
435
|
/**
|
|
436
436
|
* Destroy-time cleanup — the CLI runs it once, after `alchemy destroy`
|
|
437
|
-
* succeeds and BEFORE the
|
|
437
|
+
* succeeds and BEFORE the environment's containers are removed. A target uses
|
|
438
438
|
* it to remove infrastructure it owns outside the stack (e.g. the deploy
|
|
439
439
|
* state store, which the destroy above was still reading). Throwing aborts
|
|
440
440
|
* the destroy before the containers go; a target that would rather warn than
|
|
@@ -485,8 +485,8 @@ interface PreflightInput<C = unknown> {
|
|
|
485
485
|
readonly graph: Graph;
|
|
486
486
|
/** The calling extension's own resolved container; `undefined` when it declares no container descriptor. Narrow with the extension's guard. */
|
|
487
487
|
readonly container: ContainerInstance | undefined;
|
|
488
|
-
/** The
|
|
489
|
-
readonly
|
|
488
|
+
/** The environment name. */
|
|
489
|
+
readonly environment: string;
|
|
490
490
|
/** What the caller has already authenticated, for the platform calls preflight makes. Absent means the extension falls back to its own credential protocol. */
|
|
491
491
|
readonly credentials?: ContainerCredentials<C> | undefined;
|
|
492
492
|
/** Hands the deploy's progress output what the check covered, as counts (e.g. `{ checked: 53, filled: 0, missing: 0 }`). Counts only: never a name or a value. */
|
|
@@ -496,8 +496,8 @@ interface PreflightInput<C = unknown> {
|
|
|
496
496
|
interface TeardownInput {
|
|
497
497
|
/** The calling extension's own resolved container; `undefined` when it declares no container descriptor. Narrow with the extension's guard. */
|
|
498
498
|
readonly container: ContainerInstance | undefined;
|
|
499
|
-
/** The
|
|
500
|
-
readonly
|
|
499
|
+
/** The environment name. */
|
|
500
|
+
readonly environment: string;
|
|
501
501
|
}
|
|
502
502
|
/** The deploy context handed to `ReporterDescriptor.begin`. `C` erases to `unknown` at the framework boundary, exactly as on `PreflightInput`. */
|
|
503
503
|
interface ReportBeginInput<C = unknown> {
|
|
@@ -511,8 +511,8 @@ interface ReportBeginInput<C = unknown> {
|
|
|
511
511
|
* loaded (a breaking addition to this published type).
|
|
512
512
|
*/
|
|
513
513
|
readonly graph: Graph;
|
|
514
|
-
/** The
|
|
515
|
-
readonly
|
|
514
|
+
/** The environment name. */
|
|
515
|
+
readonly environment: string;
|
|
516
516
|
/** The directory the deploy command was run from — where a reporter reads repository metadata. */
|
|
517
517
|
readonly cwd: string;
|
|
518
518
|
/**
|
|
@@ -748,4 +748,4 @@ interface PrismaAppConfig {
|
|
|
748
748
|
declare function defineConfig(config: PrismaAppConfig): PrismaAppConfig;
|
|
749
749
|
//#endregion
|
|
750
750
|
export { isBuildOnlyExtension as $, Lowering as A, ReportBeginInput as B, LocalTargetEmulatorsInput as C, LowerError as D, LowerContext as E, PreflightPayload as F, ServiceLowering as G, RunOutcome as H, PrismaAppConfig as I, buildConfig as J, StateDescriptor as K, ProvisionEdge as L, Outputs as M, PackageInput as N, LowerOptions as O, PreflightInput as P, deserializeContainers as Q, ProvisionerDescriptor as R, LocalTargetDescriptor as S, LocateContainerInput as T, RunReporter as U, ReporterDescriptor as V, ServeInput as W, containerEnvVarName as X, containerEnv as Y, defineConfig as Z, LocalNodeStopped as _, Bundle as a, preflightEnvVarName as at, LocalTargetCurrentApp as b, ContainerInstance as c, DeployedNode as d, joinDeployment as et, DeploymentResult as f, LocalNodeLocation as g, LocalNodeCondition as h, AssembleInput as i, preflightEnv as it, NodeDescriptor as j, LoweredResult as k, DEV_DIR as l, ExtensionDescriptor as m, ApplicationDescriptor as n, lowering as nt, ContainerCredentials as o, readPreflightPayload as ot, DevServer as p, TeardownInput as q, Artifact as r, mergedProviders as rt, ContainerDescriptor as s, resolveStateLayer as st, AlchemyStateLayer as t, lower as tt, DeployedEntity as u, LocalTargetAttachInput as v, LocalTargetProvidersInput as w, LocalTargetCurrentInput as x, LocalTargetAttachment as y, ReportAttachInput as z };
|
|
751
|
-
//# sourceMappingURL=app-config-
|
|
751
|
+
//# sourceMappingURL=app-config-DR7ku-WW-Dun53zka.d.mts.map
|
package/dist/{app-config-B_gQYj3K-DpMi9a4K.d.mts.map → app-config-DR7ku-WW-Dun53zka.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-config-
|
|
1
|
+
{"version":3,"file":"app-config-DR7ku-WW-Dun53zka.d.mts","names":[],"sources":["../../../0-framework/1-core/core/dist/app-config-DR7ku-WW.d.mts"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./app-config-DR7ku-WW-Dun53zka.mjs";
|
package/dist/config.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as isBuildOnlyExtension, B as ReportBeginInput, C as LocalTargetEmulatorsInput, F as PreflightPayload, H as RunOutcome, I as PrismaAppConfig, K as StateDescriptor, P as PreflightInput, Q as deserializeContainers, S as LocalTargetDescriptor, T as LocateContainerInput, U as RunReporter, V as ReporterDescriptor, X as containerEnvVarName, Y as containerEnv, Z as defineConfig, _ as LocalNodeStopped, at as preflightEnvVarName, b as LocalTargetCurrentApp, c as ContainerInstance, g as LocalNodeLocation, h as LocalNodeCondition, it as preflightEnv, j as NodeDescriptor, l as DEV_DIR, m as ExtensionDescriptor, o as ContainerCredentials, ot as readPreflightPayload, q as TeardownInput, s as ContainerDescriptor, u as DeployedEntity, v as LocalTargetAttachInput, w as LocalTargetProvidersInput, x as LocalTargetCurrentInput, y as LocalTargetAttachment, z as ReportAttachInput } from "./app-config-
|
|
2
|
-
import "./config-
|
|
1
|
+
import { $ as isBuildOnlyExtension, B as ReportBeginInput, C as LocalTargetEmulatorsInput, F as PreflightPayload, H as RunOutcome, I as PrismaAppConfig, K as StateDescriptor, P as PreflightInput, Q as deserializeContainers, S as LocalTargetDescriptor, T as LocateContainerInput, U as RunReporter, V as ReporterDescriptor, X as containerEnvVarName, Y as containerEnv, Z as defineConfig, _ as LocalNodeStopped, at as preflightEnvVarName, b as LocalTargetCurrentApp, c as ContainerInstance, g as LocalNodeLocation, h as LocalNodeCondition, it as preflightEnv, j as NodeDescriptor, l as DEV_DIR, m as ExtensionDescriptor, o as ContainerCredentials, ot as readPreflightPayload, q as TeardownInput, s as ContainerDescriptor, u as DeployedEntity, v as LocalTargetAttachInput, w as LocalTargetProvidersInput, x as LocalTargetCurrentInput, y as LocalTargetAttachment, z as ReportAttachInput } from "./app-config-DR7ku-WW-Dun53zka.mjs";
|
|
2
|
+
import "./config-5sq9lPhi.mjs";
|
|
3
3
|
export { type ContainerCredentials, type ContainerDescriptor, type ContainerInstance, DEV_DIR, type DeployedEntity, ExtensionDescriptor, LocalNodeCondition, LocalNodeLocation, LocalNodeStopped, LocalTargetAttachInput, LocalTargetAttachment, LocalTargetCurrentApp, LocalTargetCurrentInput, LocalTargetDescriptor, LocalTargetEmulatorsInput, LocalTargetProvidersInput, type LocateContainerInput, NodeDescriptor, PreflightInput, type PreflightPayload, PrismaAppConfig, ReportAttachInput, ReportBeginInput, ReporterDescriptor, RunOutcome, RunReporter, StateDescriptor, TeardownInput, containerEnv, containerEnvVarName, defineConfig, deserializeContainers, isBuildOnlyExtension, preflightEnv, preflightEnvVarName, readPreflightPayload };
|
package/dist/control.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { gt as CliStructuredError } from "./graph-types-Cegbwb_X-BU-H2pnt.mjs";
|
|
2
|
-
import { I as PrismaAppConfig } from "./app-config-
|
|
3
|
-
import "./config-
|
|
2
|
+
import { I as PrismaAppConfig } from "./app-config-DR7ku-WW-Dun53zka.mjs";
|
|
3
|
+
import "./config-5sq9lPhi.mjs";
|
|
4
4
|
import "./index-B-9Dc0J7.mjs";
|
|
5
|
-
import "./deploy-
|
|
6
|
-
import { n as DeploymentSummary, t as DeployedNodeSummary } from "./deployment-summary-p88NV5m5-
|
|
5
|
+
import "./deploy-5sq9lPhi.mjs";
|
|
6
|
+
import { n as DeploymentSummary, t as DeployedNodeSummary } from "./deployment-summary-p88NV5m5-Btf0R5T3.mjs";
|
|
7
7
|
//#region ../../0-framework/3-tooling/cli/dist/composer-config-BJrPWlDx.d.mts
|
|
8
8
|
//#region src/composer-config.d.ts
|
|
9
9
|
/** Composer's configuration and the `prisma.config.ts` that declares it. */
|
|
@@ -42,7 +42,7 @@ interface NotOk<F> {
|
|
|
42
42
|
*/
|
|
43
43
|
type Result<T, F> = Ok<T> | NotOk<F>;
|
|
44
44
|
//#endregion
|
|
45
|
-
//#region ../../0-framework/3-tooling/cli/dist/dev-current-
|
|
45
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-current-BApQuViv.d.mts
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region src/operations/shared.d.ts
|
|
48
48
|
/** A running service's dotted address plus its local URL — what `dev` reports
|
|
@@ -107,8 +107,8 @@ interface DeployInput {
|
|
|
107
107
|
readonly entry?: string | undefined;
|
|
108
108
|
/** Override the root node's name (the `--name` flag's slot). */
|
|
109
109
|
readonly name?: string | undefined;
|
|
110
|
-
/**
|
|
111
|
-
readonly
|
|
110
|
+
/** The environment to deploy to. Defaults to `production`. */
|
|
111
|
+
readonly environment?: string | undefined;
|
|
112
112
|
/** Defaults to process.cwd(); the directory `.prisma-composer/` and `.alchemy` state live under. */
|
|
113
113
|
readonly cwd?: string | undefined;
|
|
114
114
|
/**
|
|
@@ -122,7 +122,7 @@ interface DeployInput {
|
|
|
122
122
|
* An existing report record this deploy belongs to — the `--build-id` flag's
|
|
123
123
|
* slot. A CI job that opens the record before invoking Composer passes the
|
|
124
124
|
* id here, and the target's reporter joins that record instead of creating
|
|
125
|
-
* one. Absent falls back to whatever the target reads from
|
|
125
|
+
* one. Absent falls back to whatever the target reads from environment variables.
|
|
126
126
|
*/
|
|
127
127
|
readonly reportId?: string | undefined;
|
|
128
128
|
/** Each step as it starts and finishes, in real time. Rendering is the host's. */
|
|
@@ -268,13 +268,6 @@ declare function devStop(input: DevStopInput): Promise<Result<DevStopped, CliStr
|
|
|
268
268
|
//#endregion
|
|
269
269
|
//#region ../../0-framework/3-tooling/cli/dist/control.d.mts
|
|
270
270
|
//#region src/operations/destroy.d.ts
|
|
271
|
-
/** Destroy must name its target explicitly — no silent default to production. Encoded, not re-derived from flags. */
|
|
272
|
-
type DestroyTarget = {
|
|
273
|
-
readonly kind: 'production';
|
|
274
|
-
} | {
|
|
275
|
-
readonly kind: 'stage';
|
|
276
|
-
readonly stage: string;
|
|
277
|
-
};
|
|
278
271
|
type DestroyEvent =
|
|
279
272
|
/** Emitted before the pipeline when `<cwd>/.alchemy` is missing/empty. */
|
|
280
273
|
{
|
|
@@ -289,7 +282,8 @@ interface DestroyInput {
|
|
|
289
282
|
/** The entry module, resolved against `cwd`. Overrides the `entry` in `config`; without either the operation fails with `CONFIG.ENTRY_MISSING`. */
|
|
290
283
|
readonly entry?: string | undefined;
|
|
291
284
|
readonly name?: string | undefined;
|
|
292
|
-
|
|
285
|
+
/** The environment to destroy. Required: destroy never defaults to production. */
|
|
286
|
+
readonly environment: string;
|
|
293
287
|
readonly cwd?: string | undefined;
|
|
294
288
|
/** Mid-operation notifications, in real time. Rendering is the host's. */
|
|
295
289
|
readonly onEvent?: ((event: DestroyEvent) => void) | undefined;
|
|
@@ -344,7 +338,7 @@ declare function log(input: LogInput): Promise<Result<LogAttached, CliStructured
|
|
|
344
338
|
//#endregion
|
|
345
339
|
//#region src/run-report.d.ts
|
|
346
340
|
/** Bump when a change would break a consumer that reads the current shape. */
|
|
347
|
-
declare const RUN_REPORT_VERSION =
|
|
341
|
+
declare const RUN_REPORT_VERSION = 2;
|
|
348
342
|
/** Names the file to write the run report to, when `--report` is not passed. */
|
|
349
343
|
declare const RUN_REPORT_FILE_ENV = "PRISMA_COMPOSER_REPORT_FILE";
|
|
350
344
|
interface RunReportFailure {
|
|
@@ -362,11 +356,10 @@ interface RunReport {
|
|
|
362
356
|
readonly outcome: 'succeeded' | 'failed';
|
|
363
357
|
/** Null when the run failed before it produced a deployment summary. */
|
|
364
358
|
readonly app: string | null;
|
|
365
|
-
|
|
366
|
-
readonly stage: string | null;
|
|
359
|
+
readonly environment: string;
|
|
367
360
|
readonly nodes: readonly DeployedNodeSummary[];
|
|
368
361
|
readonly failure: RunReportFailure | null;
|
|
369
362
|
}
|
|
370
363
|
//#endregion
|
|
371
|
-
export { type CliStructuredError, type ComposerConfigSource, type DeployEvent, type DeployInput, type DeployStep, type DeploySuccess, type DeployedNodeSummary, type DeploymentSummary, type DestroyEvent, type DestroyInput, type
|
|
364
|
+
export { type CliStructuredError, type ComposerConfigSource, type DeployEvent, type DeployInput, type DeployStep, type DeploySuccess, type DeployedNodeSummary, type DeploymentSummary, type DestroyEvent, type DestroyInput, type DevEvent, type DevInput, type DevSession, type DevStopInput, type DevStopped, type DevUrl, type DevUrlInput, type ExecutionDiagnostics, type LogAttached, type LogEvent, type LogInput, type LogLine, type NotOk, type Ok, RUN_REPORT_FILE_ENV, RUN_REPORT_VERSION, type Result, type RunReport, type RunReportFailure, type ServiceEndpoint, deploy, destroy, dev, devStop, devUrl, executionDiagnostics, log };
|
|
372
365
|
//# sourceMappingURL=control.d.mts.map
|
package/dist/control.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/composer-config-BJrPWlDx.d.mts","../../../0-framework/0-foundation/foundation/dist/result.d.mts","../../../0-framework/3-tooling/cli/dist/dev-current-
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/composer-config-BJrPWlDx.d.mts","../../../0-framework/0-foundation/foundation/dist/result.d.mts","../../../0-framework/3-tooling/cli/dist/dev-current-BApQuViv.d.mts","../../../0-framework/3-tooling/cli/dist/control.d.mts"],"mappings":";;;;;;;;;UAGU;;WAEC,OAAO;;WAEP;;;;;;;;UCHD,GAAG;WACF;WACA,OAAO;EAChB,YAAY;EACZ;;;;;UAKQ,MAAM;WACL;WACA,SAAS;EAClB;EACA,eAAe;;;;;;;;KAQZ,OAAO,GAAG,KAAK,GAAG,KAAK,MAAM;;;;;;;UCwDxB;WACC;WACA;;WAEA;;;;;;;;;;UA0CD;;;WAGC;;;;WAIA;WACA;WACA;WACA;;;;;;iBAMM,qBAAqB,GAAG,qBAAqB;;;;KAIzD;WACM;;WAEA;WACA;;KAEN;WACM;WACA,MAAM;;WAEN;WACA,MAAM;WACN;WACA;;WAEA,OAAO,SAAS;;UAIjB;;;;WAIC,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;;;;;;WAOA;;;;;;;WAOA;;WAEA,YAAY,OAAO;;UAEpB;;;WAGC,SAAS;;WAET;;iBAEM,OAAO,OAAO,cAAc,QAAQ,OAAO,eAAe;;;KAOtE;;;WAGM;WACA,oBAAoB;;WAEpB;WACA;;WAEA;WACA;;;;WAIA;WACA;;;;WAIA;WACA;;;;WAIA;WACA;WACA;WACA;;;;WAIA;WACA;WACA;WACA;;;;WAIA;WACA;WACA;;;;WAIA;WACA;WACA;;WAEA;;;;WAIA;WACA;;WAEA;;UAED;;;;WAIC,QAAQ;;WAER;WACA;WACA;;;;;;WAMA;WACA;WACA,YAAY,OAAO;;;;;UAKpB;;WAEC,oBAAoB;;;EAG7B,QAAQ;;WAEC,QAAQ;;iBAEF,IAAI,OAAO,WAAW,QAAQ,OAAO,YAAY;;;UAOxD;;WAEC,QAAQ;;WAER;;WAEA;;UAED;WACC;;WAEA;;WAEA;;WAEA;;WAEA;;UAED;WACC,QAAQ;;WAER;;UAED;;WAEC;;WAEA;aACE;aACA;;;;iBAII,OAAO,OAAO,cAAc,QAAQ,OAAO,QAAQ;;iBAEnD,QAAQ,OAAO,eAAe,QAAQ,OAAO,YAAY;;;;KC7UrE;;;WAGM;WACA;;UAED;;;;WAIC,QAAQ;;WAER;WACA;;WAEA;WACA;;WAEA,YAAY,OAAO;;iBAEb,QAAQ,OAAO,eAAe,QAAQ,aAAe;;;UAG5D;WACC;WACA;;KAEN;;;WAGM;WACA;;;;;WAKA;WACA;;UAED;;;;;WAKC,QAAQ;;WAER;WACA;;WAEA;;WAEA;WACA;;WAEA,SAAS;WACT,YAAY,OAAO;;UAEpB;;WAEC;;;WAGA,mBAAmB;;WAEnB,OAAO,cAAc;;iBAEf,IAAI,OAAO,WAAW,QAAQ,OAAS,aAAa;;;;cAIvD;;cAEA;UACJ;;WAEC;WACA;;;;;;;UAOD;WACC;WACA;;WAEA;WACA;WACA,gBAAgB;WAChB,SAAS"}
|
package/dist/control.mjs
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
1
|
+
import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
|
|
2
|
+
import { a as executionDiagnostics, c as notOk, i as devUrl, n as dev, o as executorLoadFailure, r as devStop, t as deploy } from "./dev-current-8HfFCN7C-C8Ste3qf.mjs";
|
|
3
|
+
import { n as RUN_REPORT_VERSION, t as RUN_REPORT_FILE_ENV } from "./run-report-CmBz2-xc-S50d4g5V.mjs";
|
|
3
4
|
//#region ../../0-framework/3-tooling/cli/dist/control.mjs
|
|
5
|
+
/**
|
|
6
|
+
* The programmatic `destroy` operation (`@prisma/composer/control`): typed
|
|
7
|
+
* input, structured result, no argv, no console, no process.exit. No CLI
|
|
8
|
+
* command wraps it. The executor
|
|
9
|
+
* loads lazily, so importing this module executes nothing; an executor that
|
|
10
|
+
* fails to load comes back as a structured failure, never a throw out of
|
|
11
|
+
* the host.
|
|
12
|
+
*/
|
|
4
13
|
async function destroy(input) {
|
|
5
14
|
return destroyWithDeps(input, {});
|
|
6
15
|
}
|
|
@@ -8,15 +17,22 @@ async function destroy(input) {
|
|
|
8
17
|
* Deliberately NOT re-exported through `./control` — the seam mirrors
|
|
9
18
|
* internal types and is not part of the published surface. */
|
|
10
19
|
async function destroyWithDeps(input, deps) {
|
|
20
|
+
if (typeof input.environment !== "string" || input.environment.length === 0) return notOk(environmentRequired());
|
|
11
21
|
const cwd = input.cwd ?? process.cwd();
|
|
12
22
|
let executor;
|
|
13
23
|
try {
|
|
14
|
-
executor = await import("./execute-deploy-destroy-
|
|
24
|
+
executor = await import("./execute-deploy-destroy-DerNHILD-BStnE2yG.mjs");
|
|
15
25
|
} catch (error) {
|
|
16
26
|
return notOk(executorLoadFailure("destroy", error));
|
|
17
27
|
}
|
|
18
28
|
return executor.executeDestroy(input, deps, cwd);
|
|
19
29
|
}
|
|
30
|
+
function environmentRequired() {
|
|
31
|
+
return new CliStructuredError("DEPLOY.ENVIRONMENT_REQUIRED", "destroy needs the name of the environment to destroy.", {
|
|
32
|
+
why: "Destroy never defaults to production, so a call without a name has no target.",
|
|
33
|
+
fix: "Pass `environment`, for example `destroy({ environment: 'staging', config })`."
|
|
34
|
+
});
|
|
35
|
+
}
|
|
20
36
|
async function log(input) {
|
|
21
37
|
return logWithDeps(input, {});
|
|
22
38
|
}
|
|
@@ -27,7 +43,7 @@ async function logWithDeps(input, deps) {
|
|
|
27
43
|
const cwd = input.cwd ?? process.cwd();
|
|
28
44
|
let executor;
|
|
29
45
|
try {
|
|
30
|
-
executor = await import("./execute-log-
|
|
46
|
+
executor = await import("./execute-log-kq4gyrh9-DjAlYz6O.mjs");
|
|
31
47
|
} catch (error) {
|
|
32
48
|
return notOk(executorLoadFailure("log", error));
|
|
33
49
|
}
|
package/dist/control.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/control.mjs"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"control.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/control.mjs"],"sourcesContent":["import { c as executionDiagnostics, l as executorLoadFailure, n as devUrl, o as deploy, r as dev, t as devStop } from \"./dev-current-8HfFCN7C.mjs\";\nimport { n as RUN_REPORT_VERSION, t as RUN_REPORT_FILE_ENV } from \"./run-report-CmBz2-xc.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { notOk } from \"@internal/foundation/result\";\n//#region src/operations/destroy.ts\n/**\n* The programmatic `destroy` operation (`@prisma/composer/control`): typed\n* input, structured result, no argv, no console, no process.exit. No CLI\n* command wraps it. The executor\n* loads lazily, so importing this module executes nothing; an executor that\n* fails to load comes back as a structured failure, never a throw out of\n* the host.\n*/\nasync function destroy(input) {\n\treturn destroyWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, for the unit tests.\n* Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function destroyWithDeps(input, deps) {\n\tif (typeof input.environment !== \"string\" || input.environment.length === 0) return notOk(environmentRequired());\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-DerNHILD.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"destroy\", error));\n\t}\n\treturn executor.executeDestroy(input, deps, cwd);\n}\nfunction environmentRequired() {\n\treturn new CliStructuredError(\"DEPLOY.ENVIRONMENT_REQUIRED\", \"destroy needs the name of the environment to destroy.\", {\n\t\twhy: \"Destroy never defaults to production, so a call without a name has no target.\",\n\t\tfix: \"Pass `environment`, for example `destroy({ environment: 'staging', config })`.\"\n\t});\n}\n//#endregion\n//#region src/operations/log.ts\nasync function log(input) {\n\treturn logWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, for the unit tests.\n* Deliberately NOT re-exported through `./control` — the seam\n* mirrors internal types and is not part of the published surface. */\nasync function logWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-log-kq4gyrh9.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"log\", error));\n\t}\n\treturn executor.executeLog(input, deps, cwd);\n}\n//#endregion\nexport { RUN_REPORT_FILE_ENV, RUN_REPORT_VERSION, deploy, destroy, dev, devStop, devUrl, executionDiagnostics, log };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;AAaA,eAAe,QAAQ,OAAO;CAC7B,OAAO,gBAAgB,OAAO,CAAC,CAAC;AACjC;;;;AAIA,eAAe,gBAAgB,OAAO,MAAM;CAC3C,IAAI,OAAO,MAAM,gBAAgB,YAAY,MAAM,YAAY,WAAW,GAAG,OAAO,MAAM,oBAAoB,CAAC;CAC/G,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,WAAW,KAAK,CAAC;CACnD;CACA,OAAO,SAAS,eAAe,OAAO,MAAM,GAAG;AAChD;AACA,SAAS,sBAAsB;CAC9B,OAAO,IAAI,mBAAmB,+BAA+B,yDAAyD;EACrH,KAAK;EACL,KAAK;CACN,CAAC;AACF;AAGA,eAAe,IAAI,OAAO;CACzB,OAAO,YAAY,OAAO,CAAC,CAAC;AAC7B;;;;AAIA,eAAe,YAAY,OAAO,MAAM;CACvC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,OAAO,KAAK,CAAC;CAC/C;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./app-config-DR7ku-WW-Dun53zka.mjs";
|
package/dist/deploy.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as Lowering, D as LowerError, E as LowerContext, G as ServiceLowering, J as buildConfig, L as ProvisionEdge, M as Outputs, N as PackageInput, O as LowerOptions, R as ProvisionerDescriptor, W as ServeInput, a as Bundle, d as DeployedNode, et as joinDeployment, f as DeploymentResult, i as AssembleInput, k as LoweredResult, n as ApplicationDescriptor, nt as lowering, p as DevServer, r as Artifact, rt as mergedProviders, st as resolveStateLayer, t as AlchemyStateLayer, tt as lower, u as DeployedEntity } from "./app-config-
|
|
2
|
-
import "./deploy-
|
|
1
|
+
import { A as Lowering, D as LowerError, E as LowerContext, G as ServiceLowering, J as buildConfig, L as ProvisionEdge, M as Outputs, N as PackageInput, O as LowerOptions, R as ProvisionerDescriptor, W as ServeInput, a as Bundle, d as DeployedNode, et as joinDeployment, f as DeploymentResult, i as AssembleInput, k as LoweredResult, n as ApplicationDescriptor, nt as lowering, p as DevServer, r as Artifact, rt as mergedProviders, st as resolveStateLayer, t as AlchemyStateLayer, tt as lower, u as DeployedEntity } from "./app-config-DR7ku-WW-Dun53zka.mjs";
|
|
2
|
+
import "./deploy-5sq9lPhi.mjs";
|
|
3
3
|
export { AlchemyStateLayer, ApplicationDescriptor, Artifact, AssembleInput, Bundle, DeployedEntity, DeployedNode, DeploymentResult, DevServer, LowerContext, LowerError, LowerOptions, LoweredResult, Lowering, Outputs, PackageInput, ProvisionEdge, ProvisionerDescriptor, ServeInput, ServiceLowering, buildConfig, joinDeployment, lower, lowering, mergedProviders, resolveStateLayer };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u as DeployedEntity } from "./app-config-
|
|
2
|
-
import "./deploy-
|
|
1
|
+
import { u as DeployedEntity } from "./app-config-DR7ku-WW-Dun53zka.mjs";
|
|
2
|
+
import "./deploy-5sq9lPhi.mjs";
|
|
3
3
|
//#region ../../0-framework/3-tooling/cli/dist/deployment-summary-p88NV5m5.d.mts
|
|
4
4
|
//#region src/deployment-summary.d.ts
|
|
5
5
|
/** The serializable projection of DeploymentResult — what CAN cross the process
|
|
@@ -27,4 +27,4 @@ interface DeploymentSummary {
|
|
|
27
27
|
declare function captureEngineFailure(): void;
|
|
28
28
|
//#endregion
|
|
29
29
|
export { DeploymentSummary as n, captureEngineFailure as r, DeployedNodeSummary as t };
|
|
30
|
-
//# sourceMappingURL=deployment-summary-p88NV5m5-
|
|
30
|
+
//# sourceMappingURL=deployment-summary-p88NV5m5-Btf0R5T3.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment-summary-p88NV5m5-
|
|
1
|
+
{"version":3,"file":"deployment-summary-p88NV5m5-Btf0R5T3.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/deployment-summary-p88NV5m5.d.mts"],"mappings":";;;;;;UAIU;WACC;WACA,mBAAmB;;UAEpB;WACC;WACA,gBAAgB;;;;;;;;;;;;;;iBAcV"}
|
|
@@ -88,7 +88,7 @@ function okVoid() {
|
|
|
88
88
|
return OK_VOID;
|
|
89
89
|
}
|
|
90
90
|
//#endregion
|
|
91
|
-
//#region ../../0-framework/3-tooling/cli/dist/dev-current-
|
|
91
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-current-8HfFCN7C.mjs
|
|
92
92
|
/**
|
|
93
93
|
* Reads the execution diagnostics an engine-failure error carries in
|
|
94
94
|
* `meta.diagnostics`; undefined for every other failure.
|
|
@@ -127,7 +127,7 @@ async function deployWithDeps(input, deps) {
|
|
|
127
127
|
const cwd = input.cwd ?? process.cwd();
|
|
128
128
|
let executor;
|
|
129
129
|
try {
|
|
130
|
-
executor = await import("./execute-deploy-destroy-
|
|
130
|
+
executor = await import("./execute-deploy-destroy-DerNHILD-BStnE2yG.mjs");
|
|
131
131
|
} catch (error) {
|
|
132
132
|
return notOk(executorLoadFailure("deploy", error));
|
|
133
133
|
}
|
|
@@ -148,7 +148,7 @@ async function devWithDeps(input, deps) {
|
|
|
148
148
|
const cwd = input.cwd ?? process.cwd();
|
|
149
149
|
let executor;
|
|
150
150
|
try {
|
|
151
|
-
executor = await import("./execute-dev-
|
|
151
|
+
executor = await import("./execute-dev-D_JvTKjS-BjlfRv3L.mjs");
|
|
152
152
|
} catch (error) {
|
|
153
153
|
return notOk(executorLoadFailure("dev", error));
|
|
154
154
|
}
|
|
@@ -156,7 +156,7 @@ async function devWithDeps(input, deps) {
|
|
|
156
156
|
}
|
|
157
157
|
async function loadExecutor(operation) {
|
|
158
158
|
try {
|
|
159
|
-
return ok(await import("./execute-dev-current-
|
|
159
|
+
return ok(await import("./execute-dev-current-BRJkR4Y1-KETGQ-7f.mjs"));
|
|
160
160
|
} catch (error) {
|
|
161
161
|
return notOk(executorLoadFailure(operation, error));
|
|
162
162
|
}
|
|
@@ -176,4 +176,4 @@ async function devStop(input) {
|
|
|
176
176
|
//#endregion
|
|
177
177
|
export { executionDiagnostics as a, notOk as c, devUrl as i, ok as l, dev as n, executorLoadFailure as o, devStop as r, toStructured as s, deploy as t, okVoid as u };
|
|
178
178
|
|
|
179
|
-
//# sourceMappingURL=dev-current-
|
|
179
|
+
//# sourceMappingURL=dev-current-8HfFCN7C-C8Ste3qf.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-current-8HfFCN7C-C8Ste3qf.mjs","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/result.mjs","../../../0-framework/3-tooling/cli/dist/dev-current-8HfFCN7C.mjs"],"sourcesContent":["import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as InternalError } from \"./internal-error-Dfur7Zqt.mjs\";\n//#region src/result.ts\n/**\n* Generic Result type for representing success or failure outcomes.\n*\n* This is the standard way to return \"expected failures\" as values rather than\n* throwing exceptions. See docs/Error Handling.md for the full taxonomy.\n*\n* Naming rationale:\n* - `Ok<T>` / `NotOk<F>` mirror the `ok: true/false` discriminator\n* - `NotOk` avoids collision with domain types like \"Failure\" or \"Error\"\n* - `failure` property distinguishes from JS Error semantics\n*/\n/**\n* Result class that implements both Ok and NotOk variants.\n*/\nvar ResultImpl = class ResultImpl {\n\tok;\n\t_value;\n\t_failure;\n\tconstructor(ok, valueOrFailure) {\n\t\tthis.ok = ok;\n\t\tif (ok) this._value = blindCast(valueOrFailure);\n\t\telse this._failure = blindCast(valueOrFailure);\n\t\tObject.freeze(this);\n\t}\n\tget value() {\n\t\tif (!this.ok) throw new InternalError(\"Cannot access value on NotOk result\");\n\t\treturn this._value;\n\t}\n\tget failure() {\n\t\tif (this.ok) throw new InternalError(\"Cannot access failure on Ok result\");\n\t\treturn this._failure;\n\t}\n\t/**\n\t* Creates a successful result.\n\t*/\n\tstatic ok(value) {\n\t\treturn blindCast(new ResultImpl(true, value));\n\t}\n\t/**\n\t* Creates an unsuccessful result.\n\t*/\n\tstatic notOk(failure) {\n\t\treturn blindCast(new ResultImpl(false, failure));\n\t}\n\t/**\n\t* Asserts that this result is Ok and returns the value.\n\t* Throws if the result is NotOk.\n\t*/\n\tassertOk() {\n\t\tif (!this.ok) throw new InternalError(\"Expected Ok result but got NotOk\");\n\t\treturn this.value;\n\t}\n\t/**\n\t* Asserts that this result is NotOk and returns the failure.\n\t* Throws if the result is Ok.\n\t*/\n\tassertNotOk() {\n\t\tif (this.ok) throw new InternalError(\"Expected NotOk result but got Ok\");\n\t\treturn this.failure;\n\t}\n};\n/**\n* Creates a successful result.\n*/\nfunction ok(value) {\n\treturn ResultImpl.ok(value);\n}\n/**\n* Creates an unsuccessful result.\n*/\nfunction notOk(failure) {\n\treturn ResultImpl.notOk(failure);\n}\n/**\n* Singleton for void success results.\n* Use this for validation checks that don't produce a value.\n*/\nconst OK_VOID = ResultImpl.ok(void 0);\n/**\n* Returns a successful void result.\n* Use this for validation checks that don't produce a value.\n*/\nfunction okVoid() {\n\treturn OK_VOID;\n}\n//#endregion\nexport { notOk, ok, okVoid };\n\n//# sourceMappingURL=result.mjs.map","import { CliStructuredError } from \"@internal/foundation/errors\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { notOk, ok } from \"@internal/foundation/result\";\n//#region src/operations/shared.ts\n/**\n* Reads the execution diagnostics an engine-failure error carries in\n* `meta.diagnostics`; undefined for every other failure.\n*/\nfunction executionDiagnostics(f) {\n\tconst diagnostics = f.meta?.[\"diagnostics\"];\n\tif (typeof diagnostics !== \"object\" || diagnostics === null) return void 0;\n\tconst candidate = blindCast(diagnostics);\n\tif (candidate[\"exitCode\"] !== void 0 && typeof candidate[\"exitCode\"] !== \"number\" || candidate[\"signal\"] !== void 0 && typeof candidate[\"signal\"] !== \"string\" || typeof candidate[\"stackFilePath\"] !== \"string\" || typeof candidate[\"reproduceCommand\"] !== \"string\" || typeof candidate[\"cwd\"] !== \"string\") return;\n\treturn blindCast(diagnostics);\n}\n/**\n* Site-specific wrap for foreign extension/environment causes — passthrough\n* when already structured; never a boundary fallback (base-type rule 6(ii)).\n*/\nfunction toStructured(code, error) {\n\treturn CliStructuredError.is(error) ? error : new CliStructuredError(code, error instanceof Error ? error.message : String(error), { cause: error });\n}\n/** A failed executor import: an environmental failure of the consumer's\n* installed tree, not a bug here. The import error rides as the cause. */\nfunction executorLoadFailure(operation, error) {\n\treturn new CliStructuredError(\"DEPS.EXECUTOR_UNLOADABLE\", `Could not load the ${operation} executor: ${error instanceof Error ? error.message : String(error)}`, {\n\t\twhy: `The ${operation} operation's executor imports the deploy engine's provider tree from your app's installed dependencies, and that import failed.`,\n\t\tfix: \"Reinstall your dependencies, and check that `alchemy` is installed and loadable from your app.\",\n\t\tcause: error\n\t});\n}\n//#endregion\n//#region src/operations/deploy.ts\n/** The environment `deploy` targets when none is named. */\nconst DEFAULT_DEPLOY_ENVIRONMENT = \"production\";\nasync function deploy(input) {\n\treturn deployWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, which the family's\n* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function deployWithDeps(input, deps) {\n\tconst startedAt = performance.now();\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-DerNHILD.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"deploy\", error));\n\t}\n\tconst result = await executor.executeDeploy(input, deps, cwd);\n\tif (!result.ok) return result;\n\treturn ok({\n\t\t...result.value,\n\t\tdurationMs: Math.round(performance.now() - startedAt)\n\t});\n}\n//#endregion\n//#region src/operations/dev.ts\nasync function dev(input) {\n\treturn devWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, which the family's\n* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function devWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-dev-D_JvTKjS.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"dev\", error));\n\t}\n\treturn executor.executeDev(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/dev-current.ts\nasync function loadExecutor(operation) {\n\ttry {\n\t\treturn ok(await import(\"./execute-dev-current-BRJkR4Y1.mjs\"));\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(operation, error));\n\t}\n}\n/** Where the node at `input.address` of the directory's current app runs locally. */\nasync function devUrl(input) {\n\tconst executor = await loadExecutor(\"dev url\");\n\tif (!executor.ok) return executor;\n\treturn executor.value.executeDevUrl(input, input.cwd ?? process.cwd());\n}\n/** Stops the directory's current app: its service processes and database servers. Data and ports stay. */\nasync function devStop(input) {\n\tconst executor = await loadExecutor(\"dev stop\");\n\tif (!executor.ok) return executor;\n\treturn executor.value.executeDevStop(input, input.cwd ?? process.cwd());\n}\n//#endregion\nexport { DEFAULT_DEPLOY_ENVIRONMENT as a, executionDiagnostics as c, devWithDeps as i, executorLoadFailure as l, devUrl as n, deploy as o, dev as r, deployWithDeps as s, devStop as t, toStructured as u };\n\n//# sourceMappingURL=dev-current-8HfFCN7C.mjs.map"],"mappings":"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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
|
|
2
2
|
import { t as containerEnv } from "./container-transport-HcvNOGZL-twPi2TIv.mjs";
|
|
3
3
|
import { n as preflightEnvVarName, t as preflightEnv } from "./config-CdxvLFzg.mjs";
|
|
4
|
-
import { c as notOk, l as ok, s as toStructured, u as okVoid } from "./dev-current-
|
|
5
|
-
import { a as writeRunReport, i as toRunReport, r as resolveRunReportPath, t as RUN_REPORT_FILE_ENV } from "./run-report-
|
|
4
|
+
import { c as notOk, l as ok, s as toStructured, u as okVoid } from "./dev-current-8HfFCN7C-C8Ste3qf.mjs";
|
|
5
|
+
import { a as writeRunReport, i as toRunReport, r as resolveRunReportPath, t as RUN_REPORT_FILE_ENV } from "./run-report-CmBz2-xc-S50d4g5V.mjs";
|
|
6
6
|
import { a as readEngineFailureCause, i as readDeploymentSummary, r as engineFailureFilePath, t as DEPLOYMENT_RESULT_FILE_ENV } from "./deployment-summary-CDHdLtnO-DrE7GsHq.mjs";
|
|
7
7
|
import { i as noComposerExportMessage, r as runPipeline } from "./pipeline-BmWt-Nhb-D9Eg14Sx.mjs";
|
|
8
8
|
import { n as reproduceCommand, r as spawnAlchemy, t as alchemyInvocation } from "./run-alchemy-Dl_MWw4g-BZaLckHp.mjs";
|
|
@@ -10,15 +10,18 @@ import * as fs$1 from "node:fs";
|
|
|
10
10
|
import * as path$1 from "node:path";
|
|
11
11
|
import { spawnSync } from "node:child_process";
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
|
-
//#region ../../0-framework/3-tooling/cli/dist/validate-
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (
|
|
13
|
+
//#region ../../0-framework/3-tooling/cli/dist/validate-environment-Y3kuF-NC.mjs
|
|
14
|
+
/** Letters, digits, `-` and `_`, starting with a letter or digit: always a valid git ref, so no `git` is needed to check it. */
|
|
15
|
+
const PLAIN_ENVIRONMENT_NAME = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;
|
|
16
|
+
/** An environment name must be a valid git ref (deploy-cli.md) — checked via `git check-ref-format`, never silently normalized. Runs before anything platform-specific. */
|
|
17
|
+
function validateEnvironmentName(environment, spawn = spawnSync) {
|
|
18
|
+
if (PLAIN_ENVIRONMENT_NAME.test(environment)) return;
|
|
19
|
+
const result = spawn("git", ["check-ref-format", `refs/heads/${environment}`], { stdio: "ignore" });
|
|
20
|
+
if (result.error) throw new CliStructuredError("DEPLOY.ENVIRONMENT_UNVALIDATABLE", `git is required to validate --environment "${environment}" (git check-ref-format): ${result.error.message}.`, { cause: result.error });
|
|
21
|
+
if (result.status !== 0) throw new CliStructuredError("DEPLOY.ENVIRONMENT_INVALID", `Invalid --environment "${environment}": must be a valid git ref name (git check-ref-format rejected "refs/heads/${environment}").`);
|
|
19
22
|
}
|
|
20
23
|
//#endregion
|
|
21
|
-
//#region ../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-
|
|
24
|
+
//#region ../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-DerNHILD.mjs
|
|
22
25
|
/** Pipeline step 6: writes a regenerated-every-run, independently runnable stack module at `.prisma-composer/alchemy.run.ts`. */
|
|
23
26
|
const GENERATED_DIR = ".prisma-composer";
|
|
24
27
|
const GENERATED_FILE = "alchemy.run.ts";
|
|
@@ -149,7 +152,7 @@ async function executeDeploy(input, deps, cwd) {
|
|
|
149
152
|
entry: input.entry,
|
|
150
153
|
config: input.config,
|
|
151
154
|
name: input.name,
|
|
152
|
-
|
|
155
|
+
environment: input.environment ?? "production",
|
|
153
156
|
cwd,
|
|
154
157
|
onEvent: void 0,
|
|
155
158
|
deps,
|
|
@@ -165,7 +168,7 @@ async function executeDestroy(input, deps, cwd) {
|
|
|
165
168
|
entry: input.entry,
|
|
166
169
|
config: input.config,
|
|
167
170
|
name: input.name,
|
|
168
|
-
|
|
171
|
+
environment: input.environment,
|
|
169
172
|
cwd,
|
|
170
173
|
onEvent: input.onEvent,
|
|
171
174
|
deps,
|
|
@@ -252,6 +255,24 @@ async function finishReporters(reporters, outcome) {
|
|
|
252
255
|
}));
|
|
253
256
|
}
|
|
254
257
|
/**
|
|
258
|
+
* An extension older than this Composer stores the input it is given but
|
|
259
|
+
* resolves from a key without `environment`, so it may read every name as
|
|
260
|
+
* production. Its `deserialize` rebuilds only the fields it knows, so the
|
|
261
|
+
* container the Alchemy child rebuilds shows which environment it really
|
|
262
|
+
* resolved. Refusing here keeps a mismatched install from deploying into, or
|
|
263
|
+
* destroying, the wrong place.
|
|
264
|
+
*/
|
|
265
|
+
function requireContainerForEnvironment(action, extensionId, descriptor, instance, environment) {
|
|
266
|
+
let rebuiltEnvironment;
|
|
267
|
+
try {
|
|
268
|
+
rebuiltEnvironment = descriptor.deserialize(instance.serialize()).input.environment;
|
|
269
|
+
} catch {
|
|
270
|
+
rebuiltEnvironment = void 0;
|
|
271
|
+
}
|
|
272
|
+
if (rebuiltEnvironment === environment) return;
|
|
273
|
+
throw new CliStructuredError("DEPS.EXTENSION_INCOMPATIBLE", `The extension ${extensionId} is older than the Composer running this ${action}, so it would not resolve the environment ${environment}.`, { fix: `Install the same Composer version of ${extensionId} as the Composer that runs the ${action}.` });
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
255
276
|
* Owns the reporting sessions around the pipeline: the inner run opens them
|
|
256
277
|
* once it knows which extensions are configured, and this closes them on
|
|
257
278
|
* every exit path — a returned failure, a success, or a thrown defect — as
|
|
@@ -289,7 +310,7 @@ async function runStackPipeline(action, opts) {
|
|
|
289
310
|
});
|
|
290
311
|
if (opts.reportPath === void 0 || writeRunReport(opts.reportPath, toRunReport({
|
|
291
312
|
summary: outcome.ok ? outcome.value : void 0,
|
|
292
|
-
|
|
313
|
+
environment: opts.environment,
|
|
293
314
|
failure: outcome.ok ? void 0 : {
|
|
294
315
|
code: outcome.failure.code,
|
|
295
316
|
message: outcome.failure.message
|
|
@@ -302,10 +323,10 @@ async function runStackPipeline(action, opts) {
|
|
|
302
323
|
* write the stack file, run alchemy against it, then the destroy-only
|
|
303
324
|
* teardown/removal suffix. The value is only ever a summary for deploy. */
|
|
304
325
|
async function runStackPipelineInner(action, opts, reporters) {
|
|
305
|
-
const { entry, config: composerConfig, name,
|
|
326
|
+
const { entry, config: composerConfig, name, environment, cwd, onEvent, deps, steps } = opts;
|
|
306
327
|
steps.start({ name: "prepare" });
|
|
307
|
-
|
|
308
|
-
|
|
328
|
+
try {
|
|
329
|
+
validateEnvironmentName(environment);
|
|
309
330
|
} catch (error) {
|
|
310
331
|
if (CliStructuredError.is(error)) return notOk(error);
|
|
311
332
|
throw error;
|
|
@@ -354,7 +375,7 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
354
375
|
if (action === "deploy") reporters.push(...await beginReporters(config.extensions, {
|
|
355
376
|
appName: resolvedName,
|
|
356
377
|
graph,
|
|
357
|
-
|
|
378
|
+
environment,
|
|
358
379
|
cwd,
|
|
359
380
|
reportId: opts.reportId,
|
|
360
381
|
credentials: deps.credentials
|
|
@@ -363,16 +384,20 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
363
384
|
for (const extension of config.extensions) {
|
|
364
385
|
if (extension.container === void 0) continue;
|
|
365
386
|
try {
|
|
366
|
-
if (action === "deploy")
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
387
|
+
if (action === "deploy") {
|
|
388
|
+
const instance = await extension.container.ensure({
|
|
389
|
+
appName: resolvedName,
|
|
390
|
+
environment
|
|
391
|
+
}, deps.credentials);
|
|
392
|
+
requireContainerForEnvironment(action, extension.id, extension.container, instance, environment);
|
|
393
|
+
containers.set(extension.id, instance);
|
|
394
|
+
} else {
|
|
371
395
|
const instance = await extension.container.locate({
|
|
372
396
|
appName: resolvedName,
|
|
373
|
-
|
|
397
|
+
environment
|
|
374
398
|
}, deps.credentials);
|
|
375
|
-
if (instance === void 0) throw new CliStructuredError("DEPLOY.TARGET_NOT_FOUND", `Nothing deployed for ${resolvedName}
|
|
399
|
+
if (instance === void 0) throw new CliStructuredError("DEPLOY.TARGET_NOT_FOUND", `Nothing deployed for ${resolvedName} in the environment ${environment}.`, { fix: "Deploy it first." });
|
|
400
|
+
requireContainerForEnvironment(action, extension.id, extension.container, instance, environment);
|
|
376
401
|
containers.set(extension.id, instance);
|
|
377
402
|
}
|
|
378
403
|
} catch (error) {
|
|
@@ -380,9 +405,7 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
380
405
|
}
|
|
381
406
|
}
|
|
382
407
|
await attachReporters(reporters, containers);
|
|
383
|
-
|
|
384
|
-
if (pinnedStage === void 0) throw new CliStructuredError("DEPLOY.SCOPE_MISSING", "The configured deploy target supplied no deploy scope (its container defines no alchemyStage), so Alchemy has no stage to run under.", { fix: action === "deploy" ? "Pass --stage <name> to choose the deploy scope explicitly." : "Destroying production needs a target whose container supplies the production deploy scope." });
|
|
385
|
-
alchemyStage = pinnedStage;
|
|
408
|
+
alchemyStage = containers.get(config.state.extension)?.alchemyStage ?? environment;
|
|
386
409
|
steps.finish({ name: "connect" });
|
|
387
410
|
if (action === "deploy") {
|
|
388
411
|
steps.start({ name: "preflight" });
|
|
@@ -396,7 +419,7 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
396
419
|
const payload = await extension.preflight({
|
|
397
420
|
graph,
|
|
398
421
|
container: containers.get(extension.id),
|
|
399
|
-
|
|
422
|
+
environment,
|
|
400
423
|
credentials: deps.credentials,
|
|
401
424
|
report
|
|
402
425
|
});
|
|
@@ -493,7 +516,7 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
493
516
|
try {
|
|
494
517
|
await extension.teardown({
|
|
495
518
|
container: containers.get(extension.id),
|
|
496
|
-
|
|
519
|
+
environment
|
|
497
520
|
});
|
|
498
521
|
} catch (error) {
|
|
499
522
|
throw toStructured("DEPLOY.TEARDOWN_FAILED", error);
|
|
@@ -526,4 +549,4 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
526
549
|
//#endregion
|
|
527
550
|
export { executeDeploy, executeDestroy };
|
|
528
551
|
|
|
529
|
-
//# sourceMappingURL=execute-deploy-destroy-
|
|
552
|
+
//# sourceMappingURL=execute-deploy-destroy-DerNHILD-BStnE2yG.mjs.map
|