@prisma/composer 0.6.0-dev.21 → 0.6.0-dev.23
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-aIrriqVU-Dpj1RqnY.d.mts → app-config-BinBcpPf-1akTl5h4.d.mts} +90 -3
- package/dist/{app-config-aIrriqVU-Dpj1RqnY.d.mts.map → app-config-BinBcpPf-1akTl5h4.d.mts.map} +1 -1
- package/dist/config-647Wkm51.d.mts +1 -0
- package/dist/config.d.mts +3 -3
- package/dist/control.d.mts +46 -5
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +8 -7
- package/dist/control.mjs.map +1 -1
- package/dist/deploy-647Wkm51.d.mts +1 -0
- package/dist/deploy.d.mts +2 -2
- package/dist/{deployment-summary-DswOl_9E-C03NJ98H.mjs → deployment-summary-DswOl_9E-B9MhYYDt.mjs} +4 -4
- package/dist/deployment-summary-DswOl_9E-B9MhYYDt.mjs.map +1 -0
- package/dist/dist-CVk7Pk4B.mjs +42 -0
- package/dist/dist-CVk7Pk4B.mjs.map +1 -0
- package/dist/{execute-deploy-destroy-DfVJUICu-Dbgn1GR_.mjs → execute-deploy-destroy-DRl6Tfg9-B8LE2Lh5.mjs} +153 -23
- package/dist/execute-deploy-destroy-DRl6Tfg9-B8LE2Lh5.mjs.map +1 -0
- package/dist/{execute-dev-BMTFWfFc-CGDFqR4w.mjs → execute-dev-BMTFWfFc-7MifQgpp.mjs} +34 -34
- package/dist/execute-dev-BMTFWfFc-7MifQgpp.mjs.map +1 -0
- package/dist/{execute-log-Cay9hlKW-ChlIv192.mjs → execute-log-Cay9hlKW-BcvKPOW1.mjs} +5 -5
- package/dist/execute-log-Cay9hlKW-BcvKPOW1.mjs.map +1 -0
- package/dist/local-target.d.mts +1 -1
- package/dist/nextjs-control.d.mts +3 -3
- package/dist/nextjs-control.mjs +138 -34
- package/dist/nextjs-control.mjs.map +1 -1
- package/dist/node-control.d.mts +3 -3
- package/dist/node-control.mjs +21814 -55
- package/dist/node-control.mjs.map +1 -1
- package/dist/{pipeline-AoW8zq4I-CUon5KZH.mjs → pipeline-AoW8zq4I-Dg8xQ7nC.mjs} +18 -18
- package/dist/pipeline-AoW8zq4I-Dg8xQ7nC.mjs.map +1 -0
- package/dist/report.d.mts +2 -2
- package/dist/report.mjs +1 -1
- package/dist/{result-CY_TB7bn.mjs → result-D95kAAek.mjs} +13 -13
- package/dist/result-D95kAAek.mjs.map +1 -0
- package/dist/{run-alchemy-D44OZlyB-gVq_0gf4.mjs → run-alchemy-D44OZlyB-Cw5CVbUQ.mjs} +6 -6
- package/dist/run-alchemy-D44OZlyB-Cw5CVbUQ.mjs.map +1 -0
- package/dist/run-report-C2o98uD--AX8kpz4Q.mjs +60 -0
- package/dist/run-report-C2o98uD--AX8kpz4Q.mjs.map +1 -0
- package/package.json +11 -11
- package/dist/config-BeBRB-6m.d.mts +0 -1
- package/dist/deploy-BeBRB-6m.d.mts +0 -1
- package/dist/deployment-summary-DswOl_9E-C03NJ98H.mjs.map +0 -1
- package/dist/execute-deploy-destroy-DfVJUICu-Dbgn1GR_.mjs.map +0 -1
- package/dist/execute-dev-BMTFWfFc-CGDFqR4w.mjs.map +0 -1
- package/dist/execute-log-Cay9hlKW-ChlIv192.mjs.map +0 -1
- package/dist/pipeline-AoW8zq4I-CUon5KZH.mjs.map +0 -1
- package/dist/result-CY_TB7bn.mjs.map +0 -1
- package/dist/run-alchemy-D44OZlyB-gVq_0gf4.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-BinBcpPf.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
|
|
@@ -391,6 +391,12 @@ interface ExtensionDescriptor {
|
|
|
391
391
|
* in container-transport.ts.
|
|
392
392
|
*/
|
|
393
393
|
readonly container?: ContainerDescriptor;
|
|
394
|
+
/**
|
|
395
|
+
* Deploy-run reporting. The CLI begins a session after the graph is loaded
|
|
396
|
+
* and before containers are resolved, and finishes it on every exit path.
|
|
397
|
+
* An extension without one reports nothing, which is the default.
|
|
398
|
+
*/
|
|
399
|
+
readonly reporter?: ReporterDescriptor;
|
|
394
400
|
/**
|
|
395
401
|
* The extension's LOCAL TARGET counterpart (ADR-0041; naming, operator
|
|
396
402
|
* 2026-07-23 — "dev" names the user-facing feature only, the seam takes
|
|
@@ -433,6 +439,87 @@ interface TeardownInput {
|
|
|
433
439
|
/** The stage name (`--stage`), or `undefined` for the default stage — for diagnostics/scope. */
|
|
434
440
|
readonly stage: string | undefined;
|
|
435
441
|
}
|
|
442
|
+
/** The deploy context handed to `ReporterDescriptor.begin`. `C` erases to `unknown` at the framework boundary, exactly as on `PreflightInput`. */
|
|
443
|
+
interface ReportBeginInput<C = unknown> {
|
|
444
|
+
/** The resolved application name. */
|
|
445
|
+
readonly appName: string;
|
|
446
|
+
/** The stage name (`--stage`), or `undefined` for the default stage. */
|
|
447
|
+
readonly stage: string | undefined;
|
|
448
|
+
/** The directory the deploy command was run from — where a reporter reads repository metadata. */
|
|
449
|
+
readonly cwd: string;
|
|
450
|
+
/**
|
|
451
|
+
* An existing report record this deploy is one part of, when whatever
|
|
452
|
+
* invoked Composer created one first — a CI job that opens the record, runs
|
|
453
|
+
* several steps against it, and closes it afterwards. Opaque to core: only
|
|
454
|
+
* the reporter knows what record the id names, and a reporter that receives
|
|
455
|
+
* one joins it instead of creating its own.
|
|
456
|
+
*
|
|
457
|
+
* Takes precedence over any equivalent the reporter reads from the
|
|
458
|
+
* environment, because it was passed deliberately.
|
|
459
|
+
*/
|
|
460
|
+
readonly reportId: string | undefined;
|
|
461
|
+
/** What the caller has already authenticated, exactly as `preflight` and the container lifecycle receive it. Present means the reporter must not build a client from the environment. */
|
|
462
|
+
readonly credentials?: ContainerCredentials<C> | undefined;
|
|
463
|
+
}
|
|
464
|
+
/** The deploy context handed to `RunReporter.attach`, once containers exist. */
|
|
465
|
+
interface ReportAttachInput {
|
|
466
|
+
/** The calling extension's own resolved container; `undefined` when it declares no container descriptor. Narrow with the extension's guard. */
|
|
467
|
+
readonly container: ContainerInstance | undefined;
|
|
468
|
+
}
|
|
469
|
+
/** How a run ended, as a reporter sees it. */
|
|
470
|
+
interface RunOutcome {
|
|
471
|
+
readonly ok: boolean;
|
|
472
|
+
/** The run was interrupted (the engine settled a Ctrl-C or a termination signal) — a kind of not-ok that is not a failure. Only meaningful when `ok` is false. */
|
|
473
|
+
readonly cancelled: boolean;
|
|
474
|
+
/** The failing step's name — the deploy's own error code. `undefined` when the run succeeded. */
|
|
475
|
+
readonly failingStep: string | undefined;
|
|
476
|
+
/** Human-readable detail. `undefined` when the run succeeded. */
|
|
477
|
+
readonly errorMessage: string | undefined;
|
|
478
|
+
/**
|
|
479
|
+
* Everything the run's nodes became on the deployment target, flattened.
|
|
480
|
+
* Core does not interpret a `kind` and neither should the CLI — a reporter
|
|
481
|
+
* reads the kinds its own extension emits and ignores the rest. Empty when
|
|
482
|
+
* the run failed before producing a report.
|
|
483
|
+
*/
|
|
484
|
+
readonly entities: readonly DeployedEntity[];
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* One run's reporting session. Every method is best-effort by contract:
|
|
488
|
+
* reporting is observability, never a step of the deploy, so an
|
|
489
|
+
* implementation logs its own failures and resolves rather than rejecting.
|
|
490
|
+
* The CLI does not catch, and will not fail a deploy over a report.
|
|
491
|
+
*/
|
|
492
|
+
interface RunReporter {
|
|
493
|
+
/**
|
|
494
|
+
* Extra environment for the alchemy child, so reporting that happens
|
|
495
|
+
* inside the apply can find the run this session belongs to. Read once,
|
|
496
|
+
* after `attach`, and merged into the child's environment.
|
|
497
|
+
*/
|
|
498
|
+
childEnv(): Readonly<Record<string, string>>;
|
|
499
|
+
/** Called once the extension's own container is resolved, before any stack file is written — the moment the run's project and branch first exist to be referenced. */
|
|
500
|
+
attach(input: ReportAttachInput): Promise<void>;
|
|
501
|
+
/** Called exactly once, on every exit path including a thrown error. */
|
|
502
|
+
finish(outcome: RunOutcome): Promise<void>;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Deploy-run reporting — how an extension records that a deploy happened,
|
|
506
|
+
* how far it got, and how it ended. The CLI begins a session after the app's
|
|
507
|
+
* graph is loaded and before its containers are resolved, so a failure while
|
|
508
|
+
* creating them is still reported, and finishes it on every exit path.
|
|
509
|
+
*
|
|
510
|
+
* Deploy only: `destroy` has no reportable shape on the Prisma Cloud side
|
|
511
|
+
* (its build phases name a deploy), so the CLI does not run this hook there.
|
|
512
|
+
*/
|
|
513
|
+
interface ReporterDescriptor {
|
|
514
|
+
/**
|
|
515
|
+
* Start a session, or return `undefined` when there is nothing to report
|
|
516
|
+
* against (no credentials, no repository). Never throws. METHOD SYNTAX
|
|
517
|
+
* REQUIRED, like `preflight`: the framework hands over the erased
|
|
518
|
+
* `ReportBeginInput<unknown>`, and a reporter that types the input against
|
|
519
|
+
* its own client type only assigns here through method bivariance.
|
|
520
|
+
*/
|
|
521
|
+
begin(input: ReportBeginInput): Promise<RunReporter | undefined>;
|
|
522
|
+
}
|
|
436
523
|
/** The extension's LOCAL TARGET counterpart (ADR-0041) — the local-target variant OF ExtensionDescriptor, hence the full qualifier. An extension without one is not local-target-capable (cannot back the "dev" feature). */
|
|
437
524
|
interface LocalTargetDescriptor {
|
|
438
525
|
/** Local providers for the SAME resource types this extension's lowering emits. Receives the app identity — unlike deploy's env-arg-free `providers()`, local providers are emulator clients and must know which app they provision for. */
|
|
@@ -519,5 +606,5 @@ interface PrismaAppConfig {
|
|
|
519
606
|
/** Typed identity — exists so `prisma-composer.config.ts` gets checked against PrismaAppConfig where it is written. */
|
|
520
607
|
declare function defineConfig(config: PrismaAppConfig): PrismaAppConfig;
|
|
521
608
|
//#endregion
|
|
522
|
-
export { ProvisionEdge as A,
|
|
523
|
-
//# sourceMappingURL=app-config-
|
|
609
|
+
export { ProvisionEdge as A, buildConfig as B, LoweredResult as C, PackageInput as D, Outputs as E, RunOutcome as F, isBuildOnlyExtension as G, containerEnvVarName as H, RunReporter as I, lowering as J, joinDeployment as K, ServiceLowering as L, ReportAttachInput as M, ReportBeginInput as N, PreflightInput as O, ReporterDescriptor as P, StateDescriptor as R, LowerOptions as S, NodeDescriptor as T, defineConfig as U, containerEnv as V, deserializeContainers as W, resolveStateLayer as X, mergedProviders as Y, LocalTargetEmulatorsInput as _, Bundle as a, LowerContext as b, ContainerInstance as c, DeployedNode as d, DeploymentResult as f, LocalTargetDescriptor as g, LocalTargetAttachment as h, AssembleInput as i, ProvisionerDescriptor as j, PrismaAppConfig as k, DEV_DIR as l, LocalTargetAttachInput as m, ApplicationDescriptor as n, ContainerCredentials as o, ExtensionDescriptor as p, lower as q, Artifact as r, ContainerDescriptor as s, AlchemyStateLayer as t, DeployedEntity as u, LocalTargetProvidersInput as v, Lowering as w, LowerError as x, LocateContainerInput as y, TeardownInput as z };
|
|
610
|
+
//# sourceMappingURL=app-config-BinBcpPf-1akTl5h4.d.mts.map
|
package/dist/{app-config-aIrriqVU-Dpj1RqnY.d.mts.map → app-config-BinBcpPf-1akTl5h4.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-config-
|
|
1
|
+
{"version":3,"file":"app-config-BinBcpPf-1akTl5h4.d.mts","names":[],"sources":["../../../0-framework/1-core/core/dist/app-config-BinBcpPf.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;UAmBU;;WAEC;;WAEA;;;;;;;UAOD;WACC,OAAO;;WAEP;;EAET;;;;;;;;;;;;;;;UAeQ,qBAAqB;;WAEpB;;WAEA,SAAS;;;;;;;;;;;;UAYV,oBAAoB,UAAU,oBAAo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,YAAY,SAAS;;EAErB,OAAO,OAAO,oBAAoB;;EAElC,OAAO,SAAS,aAAa;;;;;;;;;;;UAWrB;;;;;;;;EAQR,MAAM,OAAO,mBAAmB,QAAQ;;;UAGhC;;EAER,UAAU,OAAO,4BAA4B,MAAM;;WAE1C,WAAW;;EAEpB,WAAW,OAAO,iBAAiB;;EAEnC,WAAW,OAAO,4BAA4B;;EAE9C,OAAO,OAAO,yBAAyB,QAAQ;;EAE/C,UAAU,OAAO,gBAAgB;;UAEzB;;WAEC,WAAW;;WAEX;;UAED;;WAEC,OAAO;WACP,WAAW;;WAEX;;UAED;WACC,WAAW;WACX;;UAED;;EAER,iBAAiB;;EAEjB,aAAa;aACF;aACA;;;EAGX,KAAK,QAAQ,aAAa;aACf;MACP;aACO;aACA;;;EAGX,gBAAgB;;;cAGJ;;;;;;;;;iBASG,qBAAqB,WAAW;;;;;;KAM5C;WACM;IACP;WACO;IACP;WACO;EACT,SAAS,OAAO,gBAAgB,QAAQ;;;;;;;UAOhC;WACC,YAAY;WACZ,OAAO;;;iBAGD,aAAa,QAAQ,kBAAkB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./app-config-BinBcpPf-1akTl5h4.mjs";
|
package/dist/config.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./config-
|
|
3
|
-
export { type ContainerCredentials, type ContainerDescriptor, type ContainerInstance, DEV_DIR, ExtensionDescriptor, LocalTargetAttachInput, LocalTargetAttachment, LocalTargetDescriptor, LocalTargetEmulatorsInput, LocalTargetProvidersInput, type LocateContainerInput, NodeDescriptor, PreflightInput, PrismaAppConfig, StateDescriptor, TeardownInput, containerEnv, containerEnvVarName, defineConfig, deserializeContainers, isBuildOnlyExtension };
|
|
1
|
+
import { F as RunOutcome, G as isBuildOnlyExtension, H as containerEnvVarName, I as RunReporter, M as ReportAttachInput, N as ReportBeginInput, O as PreflightInput, P as ReporterDescriptor, R as StateDescriptor, T as NodeDescriptor, U as defineConfig, V as containerEnv, W as deserializeContainers, _ as LocalTargetEmulatorsInput, c as ContainerInstance, g as LocalTargetDescriptor, h as LocalTargetAttachment, k as PrismaAppConfig, l as DEV_DIR, m as LocalTargetAttachInput, o as ContainerCredentials, p as ExtensionDescriptor, s as ContainerDescriptor, u as DeployedEntity, v as LocalTargetProvidersInput, y as LocateContainerInput, z as TeardownInput } from "./app-config-BinBcpPf-1akTl5h4.mjs";
|
|
2
|
+
import "./config-647Wkm51.mjs";
|
|
3
|
+
export { type ContainerCredentials, type ContainerDescriptor, type ContainerInstance, DEV_DIR, type DeployedEntity, ExtensionDescriptor, LocalTargetAttachInput, LocalTargetAttachment, LocalTargetDescriptor, LocalTargetEmulatorsInput, LocalTargetProvidersInput, type LocateContainerInput, NodeDescriptor, PreflightInput, PrismaAppConfig, ReportAttachInput, ReportBeginInput, ReporterDescriptor, RunOutcome, RunReporter, StateDescriptor, TeardownInput, containerEnv, containerEnvVarName, defineConfig, deserializeContainers, isBuildOnlyExtension };
|
package/dist/control.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { dt as CliStructuredError } from "./graph-types-N6brq1zY-1VMNwtkJ.mjs";
|
|
2
|
-
import { u as DeployedEntity } from "./app-config-
|
|
3
|
-
import "./config-
|
|
2
|
+
import { u as DeployedEntity } from "./app-config-BinBcpPf-1akTl5h4.mjs";
|
|
3
|
+
import "./config-647Wkm51.mjs";
|
|
4
4
|
import "./index-DryPyF9U.mjs";
|
|
5
|
-
import "./deploy-
|
|
5
|
+
import "./deploy-647Wkm51.mjs";
|
|
6
6
|
//#region ../../0-framework/0-foundation/foundation/dist/result.d.mts
|
|
7
7
|
//#region src/result.d.ts
|
|
8
8
|
/**
|
|
@@ -31,7 +31,7 @@ interface NotOk<F> {
|
|
|
31
31
|
*/
|
|
32
32
|
type Result<T, F> = Ok<T> | NotOk<F>;
|
|
33
33
|
//#endregion
|
|
34
|
-
//#region ../../0-framework/3-tooling/cli/dist/log-
|
|
34
|
+
//#region ../../0-framework/3-tooling/cli/dist/log-DDGcAU7S.d.mts
|
|
35
35
|
//#region src/deployment-summary.d.ts
|
|
36
36
|
/** The serializable projection of DeploymentResult — what CAN cross the process
|
|
37
37
|
* boundary. Writer (report hook) and reader (deploy operation) share this shape. */
|
|
@@ -87,6 +87,20 @@ interface DeployInput {
|
|
|
87
87
|
readonly stage?: string | undefined;
|
|
88
88
|
/** Defaults to process.cwd(); the directory `.prisma-composer/` and `.alchemy` state live under. */
|
|
89
89
|
readonly cwd?: string | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Where to write the run report — the deploy's outcome as JSON, for a tool
|
|
92
|
+
* that consumes a deploy rather than watches one. Relative paths resolve
|
|
93
|
+
* against `cwd`. Absent falls back to `PRISMA_COMPOSER_REPORT_FILE`, and
|
|
94
|
+
* absent from both writes no report.
|
|
95
|
+
*/
|
|
96
|
+
readonly reportPath?: string | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* An existing report record this deploy belongs to — the `--build-id` flag's
|
|
99
|
+
* slot. A CI job that opens the record before invoking Composer passes the
|
|
100
|
+
* id here, and the target's reporter joins that record instead of creating
|
|
101
|
+
* one. Absent falls back to whatever the target reads from the environment.
|
|
102
|
+
*/
|
|
103
|
+
readonly reportId?: string | undefined;
|
|
90
104
|
}
|
|
91
105
|
interface DeploySuccess {
|
|
92
106
|
/** Parsed from the alchemy child's result file. Undefined when the child
|
|
@@ -215,5 +229,32 @@ interface LogAttached {
|
|
|
215
229
|
}
|
|
216
230
|
declare function log(input: LogInput): Promise<Result<LogAttached, CliStructuredError>>;
|
|
217
231
|
//#endregion
|
|
218
|
-
|
|
232
|
+
//#region ../../0-framework/3-tooling/cli/dist/control.d.mts
|
|
233
|
+
//#region src/run-report.d.ts
|
|
234
|
+
/** Bump when a change would break a consumer that reads the current shape. */
|
|
235
|
+
declare const RUN_REPORT_VERSION = 1;
|
|
236
|
+
/** Names the file to write the run report to, when `--report` is not passed. */
|
|
237
|
+
declare const RUN_REPORT_FILE_ENV = "PRISMA_COMPOSER_REPORT_FILE";
|
|
238
|
+
interface RunReportFailure {
|
|
239
|
+
/** The deploy's own error code, e.g. `DEPLOY.PREFLIGHT_FAILED`. */
|
|
240
|
+
readonly code: string;
|
|
241
|
+
readonly message: string;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Every field is always present, and absent scalars are `null` rather than
|
|
245
|
+
* omitted — a consumer can read `report.failure` without first testing
|
|
246
|
+
* whether the key exists.
|
|
247
|
+
*/
|
|
248
|
+
interface RunReport {
|
|
249
|
+
readonly version: number;
|
|
250
|
+
readonly outcome: 'succeeded' | 'failed';
|
|
251
|
+
/** Null when the run failed before it produced a deployment summary. */
|
|
252
|
+
readonly app: string | null;
|
|
253
|
+
/** Null for the default stage. */
|
|
254
|
+
readonly stage: string | null;
|
|
255
|
+
readonly nodes: readonly DeployedNodeSummary[];
|
|
256
|
+
readonly failure: RunReportFailure | null;
|
|
257
|
+
}
|
|
258
|
+
//#endregion
|
|
259
|
+
export { type CliStructuredError, type DeployInput, type DeploySuccess, type DeployedNodeSummary, type DeploymentSummary, type DestroyEvent, type DestroyInput, type DestroyTarget, type DevEvent, type DevInput, type DevSession, 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, executionDiagnostics, log };
|
|
219
260
|
//# 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/0-foundation/foundation/dist/result.d.mts","../../../0-framework/3-tooling/cli/dist/log-
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/result.d.mts","../../../0-framework/3-tooling/cli/dist/log-DDGcAU7S.d.mts","../../../0-framework/3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control.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { a as executionDiagnostics, o as executorLoadFailure, t as notOk } from "./result-
|
|
2
|
-
|
|
1
|
+
import { a as executionDiagnostics, o as executorLoadFailure, t as notOk } from "./result-D95kAAek.mjs";
|
|
2
|
+
import { n as RUN_REPORT_VERSION, t as RUN_REPORT_FILE_ENV } from "./run-report-C2o98uD--AX8kpz4Q.mjs";
|
|
3
|
+
//#region ../../0-framework/3-tooling/cli/dist/log-B1EJJGSl.mjs
|
|
3
4
|
async function deploy(input) {
|
|
4
5
|
return deployWithDeps(input, {});
|
|
5
6
|
}
|
|
@@ -10,7 +11,7 @@ async function deployWithDeps(input, deps) {
|
|
|
10
11
|
const cwd = input.cwd ?? process.cwd();
|
|
11
12
|
let executor;
|
|
12
13
|
try {
|
|
13
|
-
executor = await import("./execute-deploy-destroy-
|
|
14
|
+
executor = await import("./execute-deploy-destroy-DRl6Tfg9-B8LE2Lh5.mjs");
|
|
14
15
|
} catch (error) {
|
|
15
16
|
return notOk(executorLoadFailure("deploy", error, cwd));
|
|
16
17
|
}
|
|
@@ -26,7 +27,7 @@ async function destroyWithDeps(input, deps) {
|
|
|
26
27
|
const cwd = input.cwd ?? process.cwd();
|
|
27
28
|
let executor;
|
|
28
29
|
try {
|
|
29
|
-
executor = await import("./execute-deploy-destroy-
|
|
30
|
+
executor = await import("./execute-deploy-destroy-DRl6Tfg9-B8LE2Lh5.mjs");
|
|
30
31
|
} catch (error) {
|
|
31
32
|
return notOk(executorLoadFailure("destroy", error, cwd));
|
|
32
33
|
}
|
|
@@ -42,7 +43,7 @@ async function devWithDeps(input, deps) {
|
|
|
42
43
|
const cwd = input.cwd ?? process.cwd();
|
|
43
44
|
let executor;
|
|
44
45
|
try {
|
|
45
|
-
executor = await import("./execute-dev-BMTFWfFc-
|
|
46
|
+
executor = await import("./execute-dev-BMTFWfFc-7MifQgpp.mjs");
|
|
46
47
|
} catch (error) {
|
|
47
48
|
return notOk(executorLoadFailure("dev", error, cwd));
|
|
48
49
|
}
|
|
@@ -58,13 +59,13 @@ async function logWithDeps(input, deps) {
|
|
|
58
59
|
const cwd = input.cwd ?? process.cwd();
|
|
59
60
|
let executor;
|
|
60
61
|
try {
|
|
61
|
-
executor = await import("./execute-log-Cay9hlKW-
|
|
62
|
+
executor = await import("./execute-log-Cay9hlKW-BcvKPOW1.mjs");
|
|
62
63
|
} catch (error) {
|
|
63
64
|
return notOk(executorLoadFailure("log", error, cwd));
|
|
64
65
|
}
|
|
65
66
|
return executor.executeLog(input, deps, cwd);
|
|
66
67
|
}
|
|
67
68
|
//#endregion
|
|
68
|
-
export { deploy, destroy, dev, executionDiagnostics, log };
|
|
69
|
+
export { RUN_REPORT_FILE_ENV, RUN_REPORT_VERSION, deploy, destroy, dev, executionDiagnostics, log };
|
|
69
70
|
|
|
70
71
|
//# sourceMappingURL=control.mjs.map
|
package/dist/control.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/log-
|
|
1
|
+
{"version":3,"file":"control.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/log-B1EJJGSl.mjs"],"sourcesContent":["import { n as executorLoadFailure } from \"./shared-BTnATsqm.mjs\";\nimport { notOk } from \"@internal/foundation/result\";\n//#region src/operations/deploy.ts\nasync function deploy(input) {\n\treturn deployWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). 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 cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-DRl6Tfg9.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"deploy\", error, cwd));\n\t}\n\treturn executor.executeDeploy(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/destroy.ts\nasync function destroy(input) {\n\treturn destroyWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). 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\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-DRl6Tfg9.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"destroy\", error, cwd));\n\t}\n\treturn executor.executeDestroy(input, deps, cwd);\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 (the CLI's RunDeps, unit\n* tests). 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-BMTFWfFc.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"dev\", error, cwd));\n\t}\n\treturn executor.executeDev(input, deps, cwd);\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 (the CLI's LogRunDeps,\n* unit tests). 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-Cay9hlKW.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"log\", error, cwd));\n\t}\n\treturn executor.executeLog(input, deps, cwd);\n}\n//#endregion\nexport { destroy as a, deployWithDeps as c, devWithDeps as i, logWithDeps as n, destroyWithDeps as o, dev as r, deploy as s, log as t };\n\n//# sourceMappingURL=log-B1EJJGSl.mjs.map"],"mappings":";;;AAGA,eAAe,OAAO,OAAO;CAC5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|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./app-config-BinBcpPf-1akTl5h4.mjs";
|
package/dist/deploy.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as ProvisionEdge, C as LoweredResult, D as PackageInput, E as Outputs,
|
|
2
|
-
import "./deploy-
|
|
1
|
+
import { A as ProvisionEdge, B as buildConfig, C as LoweredResult, D as PackageInput, E as Outputs, J as lowering, K as joinDeployment, L as ServiceLowering, S as LowerOptions, X as resolveStateLayer, Y as mergedProviders, a as Bundle, b as LowerContext, d as DeployedNode, f as DeploymentResult, i as AssembleInput, j as ProvisionerDescriptor, n as ApplicationDescriptor, q as lower, r as Artifact, t as AlchemyStateLayer, u as DeployedEntity, w as Lowering, x as LowerError } from "./app-config-BinBcpPf-1akTl5h4.mjs";
|
|
2
|
+
import "./deploy-647Wkm51.mjs";
|
|
3
3
|
export { AlchemyStateLayer, ApplicationDescriptor, Artifact, AssembleInput, Bundle, DeployedEntity, DeployedNode, DeploymentResult, LowerContext, LowerError, LowerOptions, LoweredResult, Lowering, Outputs, PackageInput, ProvisionEdge, ProvisionerDescriptor, ServiceLowering, buildConfig, joinDeployment, lower, lowering, mergedProviders, resolveStateLayer };
|
package/dist/{deployment-summary-DswOl_9E-C03NJ98H.mjs → deployment-summary-DswOl_9E-B9MhYYDt.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
|
|
2
|
-
import * as fs from "node:fs";
|
|
2
|
+
import * as fs$1 from "node:fs";
|
|
3
3
|
//#region ../../0-framework/3-tooling/cli/dist/deployment-summary-DswOl_9E.mjs
|
|
4
4
|
/**
|
|
5
5
|
* The deploy result's cross-process protocol, whole in one place: the
|
|
@@ -34,7 +34,7 @@ function writeDeploymentSummaryFile(result) {
|
|
|
34
34
|
const file = process.env[DEPLOYMENT_RESULT_FILE_ENV];
|
|
35
35
|
if (file === void 0 || file.length === 0) return;
|
|
36
36
|
try {
|
|
37
|
-
fs.writeFileSync(file, JSON.stringify(toDeploymentSummary(result)));
|
|
37
|
+
fs$1.writeFileSync(file, JSON.stringify(toDeploymentSummary(result)));
|
|
38
38
|
} catch {}
|
|
39
39
|
}
|
|
40
40
|
function isRecord(value) {
|
|
@@ -47,7 +47,7 @@ function isRecord(value) {
|
|
|
47
47
|
function readDeploymentSummary(resultFilePath) {
|
|
48
48
|
let raw;
|
|
49
49
|
try {
|
|
50
|
-
raw = fs.readFileSync(resultFilePath, "utf8");
|
|
50
|
+
raw = fs$1.readFileSync(resultFilePath, "utf8");
|
|
51
51
|
} catch {
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
@@ -67,4 +67,4 @@ function readDeploymentSummary(resultFilePath) {
|
|
|
67
67
|
//#endregion
|
|
68
68
|
export { readDeploymentSummary as n, writeDeploymentSummaryFile as r, DEPLOYMENT_RESULT_FILE_ENV as t };
|
|
69
69
|
|
|
70
|
-
//# sourceMappingURL=deployment-summary-DswOl_9E-
|
|
70
|
+
//# sourceMappingURL=deployment-summary-DswOl_9E-B9MhYYDt.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-summary-DswOl_9E-B9MhYYDt.mjs","names":["fs"],"sources":["../../../0-framework/3-tooling/cli/dist/deployment-summary-DswOl_9E.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport { blindCast } from \"@internal/foundation/casts\";\n//#region src/deployment-summary.ts\n/**\n* The deploy result's cross-process protocol, whole in one place: the\n* serializable shape, the env var that names the carrier file, the writer the\n* report hook calls from inside the alchemy child, and the reader the deploy\n* operation runs after the child exits. `DeploymentResult` itself cannot\n* cross the boundary — its `DeployedNode` entries hold live graph-node\n* references (ADR-0033) — so the writer projects it down to what CAN.\n*\n* The summary is best-effort by contract: the writer never fails the child\n* over it, and the reader maps absent or malformed to `undefined`.\n*/\n/** Env var the deploy operation sets on the alchemy child: when present,\n* the report hook also writes the JSON DeploymentSummary there. */\nconst DEPLOYMENT_RESULT_FILE_ENV = \"PRISMA_COMPOSER_DEPLOYMENT_RESULT_FILE\";\n/** Pure projection: keeps app + each node's address/entities, drops the in-process `node`. */\nfunction toDeploymentSummary(result) {\n\treturn {\n\t\tapp: result.app,\n\t\tnodes: result.nodes.map((node) => ({\n\t\t\taddress: node.address,\n\t\t\tentities: node.entities\n\t\t}))\n\t};\n}\n/**\n* Writer half, called by the report hook inside the alchemy child: when the\n* env var names a file, write the summary there. Best-effort — a write\n* failure must not fail a deploy that already converged, so it is swallowed.\n*/\nfunction writeDeploymentSummaryFile(result) {\n\tconst file = process.env[DEPLOYMENT_RESULT_FILE_ENV];\n\tif (file === void 0 || file.length === 0) return;\n\ttry {\n\t\tfs.writeFileSync(file, JSON.stringify(toDeploymentSummary(result)));\n\t} catch {}\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n/**\n* Reader half, run by the deploy operation after the child exits. Absent or\n* malformed → undefined — the summary is best-effort, never a deploy failure.\n*/\nfunction readDeploymentSummary(resultFilePath) {\n\tlet raw;\n\ttry {\n\t\traw = fs.readFileSync(resultFilePath, \"utf8\");\n\t} catch {\n\t\treturn;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\treturn;\n\t}\n\tif (!isRecord(parsed) || typeof parsed[\"app\"] !== \"string\" || !Array.isArray(parsed[\"nodes\"])) return;\n\tfor (const node of parsed[\"nodes\"]) {\n\t\tif (!isRecord(node) || typeof node[\"address\"] !== \"string\" || !Array.isArray(node[\"entities\"])) return;\n\t\tfor (const entity of node[\"entities\"]) if (!isRecord(entity) || typeof entity[\"kind\"] !== \"string\" || typeof entity[\"id\"] !== \"string\") return;\n\t}\n\treturn blindCast(parsed);\n}\n//#endregion\nexport { readDeploymentSummary as n, writeDeploymentSummaryFile as r, DEPLOYMENT_RESULT_FILE_ENV as t };\n\n//# sourceMappingURL=deployment-summary-DswOl_9E.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,6BAA6B;;AAEnC,SAAS,oBAAoB,QAAQ;CACpC,OAAO;EACN,KAAK,OAAO;EACZ,OAAO,OAAO,MAAM,KAAK,UAAU;GAClC,SAAS,KAAK;GACd,UAAU,KAAK;EAChB,EAAE;CACH;AACD;;;;;;AAMA,SAAS,2BAA2B,QAAQ;CAC3C,MAAM,OAAO,QAAQ,IAAI;CACzB,IAAI,SAAS,KAAK,KAAK,KAAK,WAAW,GAAG;CAC1C,IAAI;EACH,KAAG,cAAc,MAAM,KAAK,UAAU,oBAAoB,MAAM,CAAC,CAAC;CACnE,QAAQ,CAAC;AACV;AACA,SAAS,SAAS,OAAO;CACxB,OAAO,OAAO,UAAU,YAAY,UAAU;AAC/C;;;;;AAKA,SAAS,sBAAsB,gBAAgB;CAC9C,IAAI;CACJ,IAAI;EACH,MAAMA,KAAG,aAAa,gBAAgB,MAAM;CAC7C,QAAQ;EACP;CACD;CACA,IAAI;CACJ,IAAI;EACH,SAAS,KAAK,MAAM,GAAG;CACxB,QAAQ;EACP;CACD;CACA,IAAI,CAAC,SAAS,MAAM,KAAK,OAAO,OAAO,WAAW,YAAY,CAAC,MAAM,QAAQ,OAAO,QAAQ,GAAG;CAC/F,KAAK,MAAM,QAAQ,OAAO,UAAU;EACnC,IAAI,CAAC,SAAS,IAAI,KAAK,OAAO,KAAK,eAAe,YAAY,CAAC,MAAM,QAAQ,KAAK,WAAW,GAAG;EAChG,KAAK,MAAM,UAAU,KAAK,aAAa,IAAI,CAAC,SAAS,MAAM,KAAK,OAAO,OAAO,YAAY,YAAY,OAAO,OAAO,UAAU,UAAU;CACzI;CACA,OAAO,UAAU,MAAM;AACxB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
//#region ../../0-framework/2-authoring/bundle-paths/dist/index.mjs
|
|
4
|
+
/**
|
|
5
|
+
* The path-containment predicate and bundle-link validation shared by every
|
|
6
|
+
* assembly and packaging seam (node/nextjs adapters, the compute artifact
|
|
7
|
+
* writer, the local extractor). This predicate is the enforcement point of
|
|
8
|
+
* ADR-0047's boundary — a symlink may be preserved only while its target
|
|
9
|
+
* stays inside the assembled bundle — so it exists exactly once.
|
|
10
|
+
*/
|
|
11
|
+
/** Lexical containment: `candidate` is `root` itself or below it. Both paths
|
|
12
|
+
* must already be absolute or share a resolution base; no filesystem access. */
|
|
13
|
+
function isWithin(root, candidate) {
|
|
14
|
+
const relative = path.relative(root, candidate);
|
|
15
|
+
return relative === "" || !relative.startsWith(`..${path.sep}`) && relative !== ".." && !path.isAbsolute(relative);
|
|
16
|
+
}
|
|
17
|
+
/** Walks the assembled bundle and rejects a dangling symlink or one whose
|
|
18
|
+
* resolved target escapes the bundle root. Symlinked directories are not
|
|
19
|
+
* descended: their targets are validated, and their contents belong to the
|
|
20
|
+
* target's own location. */
|
|
21
|
+
async function assertBundleSymlinksStayInside(bundleDir) {
|
|
22
|
+
const realRoot = await fs.promises.realpath(bundleDir);
|
|
23
|
+
const walk = async (directory) => {
|
|
24
|
+
for (const entry of await fs.promises.readdir(directory, { withFileTypes: true })) {
|
|
25
|
+
const full = path.join(directory, entry.name);
|
|
26
|
+
if (entry.isSymbolicLink()) {
|
|
27
|
+
let realTarget;
|
|
28
|
+
try {
|
|
29
|
+
realTarget = await fs.promises.realpath(full);
|
|
30
|
+
} catch {
|
|
31
|
+
throw new Error(`the assembled bundle contains a dangling symlink: ${full}`);
|
|
32
|
+
}
|
|
33
|
+
if (!isWithin(realRoot, realTarget)) throw new Error(`the assembled bundle contains a symlink whose target escapes the bundle: ${full} -> ${await fs.promises.readlink(full)}`);
|
|
34
|
+
} else if (entry.isDirectory()) await walk(full);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
await walk(bundleDir);
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { isWithin as n, assertBundleSymlinksStayInside as t };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=dist-CVk7Pk4B.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dist-CVk7Pk4B.mjs","names":[],"sources":["../../../0-framework/2-authoring/bundle-paths/dist/index.mjs"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\n//#region src/bundle-paths.ts\n/**\n* The path-containment predicate and bundle-link validation shared by every\n* assembly and packaging seam (node/nextjs adapters, the compute artifact\n* writer, the local extractor). This predicate is the enforcement point of\n* ADR-0047's boundary — a symlink may be preserved only while its target\n* stays inside the assembled bundle — so it exists exactly once.\n*/\n/** Lexical containment: `candidate` is `root` itself or below it. Both paths\n* must already be absolute or share a resolution base; no filesystem access. */\nfunction isWithin(root, candidate) {\n\tconst relative = path.relative(root, candidate);\n\treturn relative === \"\" || !relative.startsWith(`..${path.sep}`) && relative !== \"..\" && !path.isAbsolute(relative);\n}\n/** Walks the assembled bundle and rejects a dangling symlink or one whose\n* resolved target escapes the bundle root. Symlinked directories are not\n* descended: their targets are validated, and their contents belong to the\n* target's own location. */\nasync function assertBundleSymlinksStayInside(bundleDir) {\n\tconst realRoot = await fs.promises.realpath(bundleDir);\n\tconst walk = async (directory) => {\n\t\tfor (const entry of await fs.promises.readdir(directory, { withFileTypes: true })) {\n\t\t\tconst full = path.join(directory, entry.name);\n\t\t\tif (entry.isSymbolicLink()) {\n\t\t\t\tlet realTarget;\n\t\t\t\ttry {\n\t\t\t\t\trealTarget = await fs.promises.realpath(full);\n\t\t\t\t} catch {\n\t\t\t\t\tthrow new Error(`the assembled bundle contains a dangling symlink: ${full}`);\n\t\t\t\t}\n\t\t\t\tif (!isWithin(realRoot, realTarget)) throw new Error(`the assembled bundle contains a symlink whose target escapes the bundle: ${full} -> ${await fs.promises.readlink(full)}`);\n\t\t\t} else if (entry.isDirectory()) await walk(full);\n\t\t}\n\t};\n\tawait walk(bundleDir);\n}\n//#endregion\nexport { assertBundleSymlinksStayInside, isWithin };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,SAAS,MAAM,WAAW;CAClC,MAAM,WAAW,KAAK,SAAS,MAAM,SAAS;CAC9C,OAAO,aAAa,MAAM,CAAC,SAAS,WAAW,KAAK,KAAK,KAAK,KAAK,aAAa,QAAQ,CAAC,KAAK,WAAW,QAAQ;AAClH;;;;;AAKA,eAAe,+BAA+B,WAAW;CACxD,MAAM,WAAW,MAAM,GAAG,SAAS,SAAS,SAAS;CACrD,MAAM,OAAO,OAAO,cAAc;EACjC,KAAK,MAAM,SAAS,MAAM,GAAG,SAAS,QAAQ,WAAW,EAAE,eAAe,KAAK,CAAC,GAAG;GAClF,MAAM,OAAO,KAAK,KAAK,WAAW,MAAM,IAAI;GAC5C,IAAI,MAAM,eAAe,GAAG;IAC3B,IAAI;IACJ,IAAI;KACH,aAAa,MAAM,GAAG,SAAS,SAAS,IAAI;IAC7C,QAAQ;KACP,MAAM,IAAI,MAAM,qDAAqD,MAAM;IAC5E;IACA,IAAI,CAAC,SAAS,UAAU,UAAU,GAAG,MAAM,IAAI,MAAM,4EAA4E,KAAK,MAAM,MAAM,GAAG,SAAS,SAAS,IAAI,GAAG;GAC/K,OAAO,IAAI,MAAM,YAAY,GAAG,MAAM,KAAK,IAAI;EAChD;CACD;CACA,MAAM,KAAK,SAAS;AACrB"}
|