@prisma/composer 0.38.0-dev.3 → 0.38.0-dev.5
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-Dx6rC9LR-CLWAM2dn.d.mts → app-config-UeKFBma7-CohaMmWp.d.mts} +62 -15
- package/dist/app-config-UeKFBma7-CohaMmWp.d.mts.map +1 -0
- package/dist/config-BeZEgGCg.d.mts +1 -0
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +2 -3
- package/dist/control.d.mts +13 -7
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +3 -3
- package/dist/control.mjs.map +1 -1
- package/dist/{deploy-DergV8De.mjs → deploy-3EXLVrtG.mjs} +14 -8
- package/dist/deploy-3EXLVrtG.mjs.map +1 -0
- package/dist/deploy-Xi4_JrtE.d.mts +2 -0
- package/dist/deploy.d.mts +4 -4
- package/dist/deploy.mjs +3 -3
- package/dist/{deployment-summary-BETZp_5k-C_KvpHWJ.mjs → deployment-summary-D74WrJX7-DQ3LDUuO.mjs} +3 -3
- package/dist/{deployment-summary-BETZp_5k-C_KvpHWJ.mjs.map → deployment-summary-D74WrJX7-DQ3LDUuO.mjs.map} +1 -1
- package/dist/{deployment-summary-p88NV5m5-D3I2I8u_.d.mts → deployment-summary-p88NV5m5-SgniM8TX.d.mts} +3 -3
- package/dist/{deployment-summary-p88NV5m5-D3I2I8u_.d.mts.map → deployment-summary-p88NV5m5-SgniM8TX.d.mts.map} +1 -1
- package/dist/{dev-current-BDGLPKn4-DL5xFsGj.mjs → dev-current-wD5YDLjA-CzyFYXni.mjs} +5 -5
- package/dist/{dev-current-BDGLPKn4-DL5xFsGj.mjs.map → dev-current-wD5YDLjA-CzyFYXni.mjs.map} +1 -1
- package/dist/{dist-NyTyCEnG.mjs → dist-ynqBR6y8.mjs} +2 -2
- package/dist/dist-ynqBR6y8.mjs.map +1 -0
- package/dist/{execute-deploy-destroy-400RP-8_-_t5f84i_.mjs → execute-deploy-destroy-DOzo2Psp-DmS5miT4.mjs} +25 -15
- package/dist/execute-deploy-destroy-DOzo2Psp-DmS5miT4.mjs.map +1 -0
- package/dist/{execute-dev-CXMMh98q-BTfYpD8S.mjs → execute-dev-BIyOI3Ys-BbDOLlV4.mjs} +10 -10
- package/dist/{execute-dev-CXMMh98q-BTfYpD8S.mjs.map → execute-dev-BIyOI3Ys-BbDOLlV4.mjs.map} +1 -1
- package/dist/{execute-dev-current-S4Dg9y1f-B7_cUq2x.mjs → execute-dev-current-CKOzjWuO-BPecs6Lf.mjs} +4 -4
- package/dist/{execute-dev-current-S4Dg9y1f-B7_cUq2x.mjs.map → execute-dev-current-CKOzjWuO-BPecs6Lf.mjs.map} +1 -1
- package/dist/{execute-log-BgfKiB_l-0LsRMIJ0.mjs → execute-log-BDdHor71-B2p8Zae2.mjs} +4 -4
- package/dist/{execute-log-BgfKiB_l-0LsRMIJ0.mjs.map → execute-log-BDdHor71-B2p8Zae2.mjs.map} +1 -1
- package/dist/{graph-CBt9CRBT-yMupsISb.mjs → graph-BzPLUUsB-D7EnB1F5.mjs} +9 -3
- package/dist/graph-BzPLUUsB-D7EnB1F5.mjs.map +1 -0
- package/dist/{graph-D1zpgcLm-YlrEdzUB.d.mts → graph-C7mdtisq-RnKiwVsx.d.mts} +3 -3
- package/dist/graph-C7mdtisq-RnKiwVsx.d.mts.map +1 -0
- package/dist/{graph-types-BiFZrE06-D6vaGxXz.d.mts → graph-types-s5V7pGj2-BxSqB1ZH.d.mts} +9 -3
- package/dist/{graph-types-BiFZrE06-D6vaGxXz.d.mts.map → graph-types-s5V7pGj2-BxSqB1ZH.d.mts.map} +1 -1
- package/dist/http.d.mts +2 -2
- package/dist/http.mjs +2 -2
- package/dist/{index-CMklpG87.d.mts → index-DyuwxTtd.d.mts} +3 -3
- package/dist/{index-CMklpG87.d.mts.map → index-DyuwxTtd.d.mts.map} +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +3 -3
- package/dist/internal-app-configuration-file.d.mts +5 -5
- package/dist/local-target.d.mts +1 -1
- package/dist/{nextjs-DLyeRR7M-RqgYxqhI.d.mts → nextjs-DLyeRR7M-0lw_cBIr.d.mts} +3 -3
- package/dist/{nextjs-DLyeRR7M-RqgYxqhI.d.mts.map → nextjs-DLyeRR7M-0lw_cBIr.d.mts.map} +1 -1
- package/dist/nextjs-control.d.mts +4 -4
- package/dist/nextjs.d.mts +1 -1
- package/dist/node-control.d.mts +3 -3
- package/dist/node.d.mts +2 -2
- package/dist/preflight-transport-DmmtoFPH-CnDWufmu.mjs +127 -0
- package/dist/preflight-transport-DmmtoFPH-CnDWufmu.mjs.map +1 -0
- package/dist/{redaction-Bf8FvTFH-Cm1IrwpT.d.mts → redaction-Bf8FvTFH-D_HvoMrf.d.mts} +7 -7
- package/dist/{redaction-Bf8FvTFH-Cm1IrwpT.d.mts.map → redaction-Bf8FvTFH-D_HvoMrf.d.mts.map} +1 -1
- package/dist/{redaction-HnbkSFrK-BXRZ3B33.mjs → redaction-DXung4ip-bBoNomi3.mjs} +32 -5
- package/dist/redaction-DXung4ip-bBoNomi3.mjs.map +1 -0
- package/dist/report.d.mts +3 -3
- package/dist/report.mjs +11 -1
- package/dist/report.mjs.map +1 -1
- package/dist/{run-alchemy-OS_ix5g0-DCvUYZ7T.mjs → run-alchemy-CRLAyOtt-CBUV28We.mjs} +3 -3
- package/dist/{run-alchemy-OS_ix5g0-DCvUYZ7T.mjs.map → run-alchemy-CRLAyOtt-CBUV28We.mjs.map} +1 -1
- package/dist/service-rpc.d.mts +2 -2
- package/dist/service-rpc.mjs +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/{validate-environment-CpQLC3CA-COmDdusV.mjs → validate-environment-D1BTCkTs-BQprjyNP.mjs} +15 -6
- package/dist/validate-environment-D1BTCkTs-BQprjyNP.mjs.map +1 -0
- package/package.json +11 -11
- package/skills/prisma-composer-core-concepts/SKILL.md +18 -16
- package/dist/app-config-Dx6rC9LR-CLWAM2dn.d.mts.map +0 -1
- package/dist/config-BDfLyApQ.d.mts +0 -1
- package/dist/config-BFuriECI.mjs +0 -39
- package/dist/config-BFuriECI.mjs.map +0 -1
- package/dist/container-transport-HcvNOGZL-twPi2TIv.mjs +0 -49
- package/dist/container-transport-HcvNOGZL-twPi2TIv.mjs.map +0 -1
- package/dist/deploy-CM6sWxuj.d.mts +0 -2
- package/dist/deploy-DergV8De.mjs.map +0 -1
- package/dist/dist-NyTyCEnG.mjs.map +0 -1
- package/dist/execute-deploy-destroy-400RP-8_-_t5f84i_.mjs.map +0 -1
- package/dist/graph-CBt9CRBT-yMupsISb.mjs.map +0 -1
- package/dist/graph-D1zpgcLm-YlrEdzUB.d.mts.map +0 -1
- package/dist/redaction-HnbkSFrK-BXRZ3B33.mjs.map +0 -1
- package/dist/validate-environment-CpQLC3CA-COmDdusV.mjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./graph-
|
|
1
|
+
import { F as ModuleNode, K as ProvisionNeed, R as NodeId, Z as ResourceNode, o as BuildAdapter, r as AppRootNode, s as Config, st as ServiceNode, t as AppConfigurationRead, y as Graph } from "./graph-types-s5V7pGj2-BxSqB1ZH.mjs";
|
|
2
|
+
import "./graph-C7mdtisq-RnKiwVsx.mjs";
|
|
3
3
|
import * as Alchemy from "alchemy";
|
|
4
4
|
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-UeKFBma7.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
|
|
@@ -99,6 +99,39 @@ declare function preflightEnvVarName(extensionId: string): string;
|
|
|
99
99
|
declare function preflightEnv(payloads: ReadonlyMap<string, string>): Record<string, string>;
|
|
100
100
|
/** The alchemy-process side: the payload this extension's own preflight wrote, or `undefined` when it wrote none (or when nothing ran a preflight at all). */
|
|
101
101
|
declare function readPreflightPayload(extensionId: string, env: Readonly<Record<string, string | undefined>>): PreflightPayload;
|
|
102
|
+
/** Where a platform variable is named: a service's input field, a service's per-key param, or the input of a module or resource that passes it to no service. */
|
|
103
|
+
type PlatformVariableReader = {
|
|
104
|
+
readonly kind: 'field';
|
|
105
|
+
readonly service: string;
|
|
106
|
+
readonly path: string;
|
|
107
|
+
} | {
|
|
108
|
+
readonly kind: 'param';
|
|
109
|
+
readonly service: string;
|
|
110
|
+
readonly param: string;
|
|
111
|
+
} | {
|
|
112
|
+
readonly kind: 'unread';
|
|
113
|
+
readonly node: string;
|
|
114
|
+
readonly nodeKind: 'module' | 'resource';
|
|
115
|
+
};
|
|
116
|
+
/** A platform variable with no value that nothing requires, with its readers and the commands that set it. */
|
|
117
|
+
interface UnsetPlatformVariable {
|
|
118
|
+
readonly name: string;
|
|
119
|
+
readonly readers: readonly PlatformVariableReader[];
|
|
120
|
+
/** Shell commands that each set it, in the order to offer them. */
|
|
121
|
+
readonly commands: readonly string[];
|
|
122
|
+
}
|
|
123
|
+
/** What a deploy preflight found that does not stop the deploy. Names and readers only, never a value. */
|
|
124
|
+
interface PreflightFindings {
|
|
125
|
+
readonly unset: readonly UnsetPlatformVariable[];
|
|
126
|
+
}
|
|
127
|
+
/** One reader as the deploy prints it, for example `read by service "shop.email", field "apiKey"`. */
|
|
128
|
+
declare function platformVariableReaderText(reader: PlatformVariableReader): string;
|
|
129
|
+
/** The variable that carries every extension's deploy preflight findings from the first process to the second. No extension's preflight variable may take this name. */
|
|
130
|
+
declare const PREFLIGHT_FINDINGS_ENV_VAR = "PRISMA_COMPOSER_PREFLIGHT_FINDINGS";
|
|
131
|
+
/** The env entry the CLI sets on the second process. It is always set, and empty when nothing was found, so a stale value in the shell never reads as this run's. */
|
|
132
|
+
declare function preflightFindingsEnv(findings: PreflightFindings): Record<string, string>;
|
|
133
|
+
/** The second process's side: the findings the CLI carried, or none. Throws on a value that does not decode: that is a framework bug. */
|
|
134
|
+
declare function readPreflightFindings(env: Readonly<Record<string, string | undefined>>): PreflightFindings;
|
|
102
135
|
//#endregion
|
|
103
136
|
//#region src/control/deploy.d.ts
|
|
104
137
|
/** The Layer shape every Alchemy state store must satisfy — what `LowerOptions.state` and `PrismaAppConfig.state` both traffic in. */
|
|
@@ -263,6 +296,8 @@ interface DeployedNode {
|
|
|
263
296
|
interface DeploymentResult {
|
|
264
297
|
readonly app: string;
|
|
265
298
|
readonly nodes: readonly DeployedNode[];
|
|
299
|
+
/** What every extension's deploy preflight found that did not stop the deploy. */
|
|
300
|
+
readonly findings: PreflightFindings;
|
|
266
301
|
}
|
|
267
302
|
interface LowerOptions {
|
|
268
303
|
/** Stack + root node id. */
|
|
@@ -378,6 +413,11 @@ declare function joinDeployment(graph: Graph, entries: readonly {
|
|
|
378
413
|
address: string;
|
|
379
414
|
entities: readonly DeployedEntity[];
|
|
380
415
|
}[]): readonly DeployedNode[];
|
|
416
|
+
/** The deploy report: every deployed node joined with its graph node, and the findings the CLI carried from the deploy preflight. */
|
|
417
|
+
declare function deploymentResult(app: string, graph: Graph, entries: readonly {
|
|
418
|
+
address: string;
|
|
419
|
+
entities: readonly DeployedEntity[];
|
|
420
|
+
}[], findings: PreflightFindings): DeploymentResult;
|
|
381
421
|
/**
|
|
382
422
|
* The state-layer precedence a deploy resolves to: an explicit opts.state
|
|
383
423
|
* always wins; failing that, the config's own (required) state descriptor,
|
|
@@ -421,19 +461,22 @@ interface ExtensionDescriptor {
|
|
|
421
461
|
readonly application?: ApplicationDescriptor;
|
|
422
462
|
/** The extension's Alchemy providers — merged across all configured extensions (config order). */
|
|
423
463
|
readonly providers?: () => Layer.Layer<never>;
|
|
464
|
+
/** Refuses a loaded graph this extension cannot deploy by throwing `GraphCheckError`. The CLI calls it right after Load in every command that runs Load. Any other throw is a bug. */
|
|
465
|
+
readonly checkGraph?: (graph: Graph) => void;
|
|
424
466
|
/**
|
|
425
467
|
* Deploy-time prerequisite check — the CLI runs it once, after the app's
|
|
426
468
|
* Project/Branch are resolved and BEFORE any stack file is written or Alchemy
|
|
427
469
|
* runs. A target uses it to verify platform prerequisites (e.g. that every
|
|
428
|
-
*
|
|
429
|
-
*
|
|
470
|
+
* platform variable a service needs has a value) and throws to abort the
|
|
471
|
+
* deploy. Async: it talks to the platform (ADR-0064).
|
|
430
472
|
*
|
|
431
473
|
* What it returns is carried to the alchemy process for this same extension
|
|
432
474
|
* to read back there (preflight-transport.ts) — preflight runs in the CLI
|
|
433
475
|
* parent, and the alchemy child re-imports the config from scratch, so
|
|
434
476
|
* anything the lowering needs from it must ride that transport. The payload
|
|
435
477
|
* is the extension's own opaque string; the framework never reads it, and a
|
|
436
|
-
* secret value must never go in it.
|
|
478
|
+
* secret value must never go in it. What it hands `input.report` reaches the
|
|
479
|
+
* deploy report through the framework's own transport, not this payload.
|
|
437
480
|
*
|
|
438
481
|
* METHOD SYNTAX REQUIRED, for the same reason ContainerDescriptor's members
|
|
439
482
|
* need it: the framework hands over the erased `PreflightInput<unknown>`,
|
|
@@ -496,17 +539,21 @@ interface PreflightInput<C = unknown> {
|
|
|
496
539
|
readonly container: ContainerInstance | undefined;
|
|
497
540
|
/** The environment name. */
|
|
498
541
|
readonly environment: string;
|
|
499
|
-
/** The app configuration the command read for this environment.
|
|
542
|
+
/** The app configuration the command read for this environment. */
|
|
500
543
|
readonly configuration: AppConfiguration;
|
|
501
|
-
/** The app secrets the command read for this environment.
|
|
544
|
+
/** The app secrets the command read for this environment. */
|
|
502
545
|
readonly secrets: AppSecrets;
|
|
503
546
|
/** What the caller has already authenticated, for the platform calls preflight makes. Absent means the extension falls back to its own credential protocol. */
|
|
504
547
|
readonly credentials?: ContainerCredentials<C> | undefined;
|
|
505
|
-
/** Hands the deploy
|
|
506
|
-
readonly report?: ((
|
|
548
|
+
/** Hands the deploy how many platform variables the check read and which have no value. */
|
|
549
|
+
readonly report?: ((check: PlatformVariableCheck) => void) | undefined;
|
|
507
550
|
/** Shows the user a warning that does not stop the run. Only `prisma dev` passes it and shows the warnings; deploy passes none. */
|
|
508
551
|
readonly warn?: ((message: string) => void) | undefined;
|
|
509
552
|
}
|
|
553
|
+
/** What a deploy preflight's check of platform variables found: how many it read, and the ones with no value that nothing requires. */
|
|
554
|
+
interface PlatformVariableCheck extends PreflightFindings {
|
|
555
|
+
readonly checked: number;
|
|
556
|
+
}
|
|
510
557
|
/** The resolved destroy context handed to an extension's `teardown` hook. */
|
|
511
558
|
interface TeardownInput {
|
|
512
559
|
/** The calling extension's own resolved container; `undefined` when it declares no container descriptor. Narrow with the extension's guard. */
|
|
@@ -679,7 +726,7 @@ interface LocalTargetProvidersInput {
|
|
|
679
726
|
readonly devDir: string;
|
|
680
727
|
/** The text of each configuration key the graph reads, from the app configuration file. A local deployment takes the text its param rows point at from it. */
|
|
681
728
|
readonly configurationKeyText: Readonly<Record<string, string>>;
|
|
682
|
-
/** The app secrets the graph's `envSecret()`s name, which the first process handed the second. A local deployment takes the text its `$
|
|
729
|
+
/** The app secrets the graph's `envSecret()`s name, which the first process handed the second. A local deployment takes the text its `$platform` markers name from it. */
|
|
683
730
|
readonly namedSecrets: NamedSecrets;
|
|
684
731
|
}
|
|
685
732
|
interface LocalTargetEmulatorsInput {
|
|
@@ -790,9 +837,9 @@ type ConfigValues = Readonly<Record<string, unknown>>;
|
|
|
790
837
|
type ConfigAdapter = (input: ConfigAdapterInput) => ConfigValues | Promise<ConfigValues>;
|
|
791
838
|
/** The app configuration (ADR-0062): what the `config` adapters return, merged by top-level key, a later adapter winning. It is the root's input, and what `envParam()` reads. */
|
|
792
839
|
type AppConfiguration = Readonly<Record<string, unknown>>;
|
|
793
|
-
/** The app secrets (ADR-0062): what the `secrets` adapters return, merged the same way. Every value is text.
|
|
840
|
+
/** The app secrets (ADR-0062): what the `secrets` adapters return, merged the same way. Every value is text. Nothing fills a platform variable from them. `prisma dev` hands its second process the values under the secrets keys of the graph's secret sources, and Composer redacts those values wherever it prints. */
|
|
794
841
|
type AppSecrets = Readonly<Record<string, string>>;
|
|
795
|
-
/** The app secrets
|
|
842
|
+
/** The app secrets under the secrets keys of the graph's secret sources, each with text. `prisma dev`'s first process hands them to its second process in `PRISMA_COMPOSER_NAMED_SECRETS`. */
|
|
796
843
|
type NamedSecrets = Readonly<Record<string, string>>;
|
|
797
844
|
/**
|
|
798
845
|
* The config file's default export. `extensions` lists every extension the
|
|
@@ -813,5 +860,5 @@ interface PrismaAppConfig {
|
|
|
813
860
|
/** Typed identity — exists so the `composer` section of `prisma.config.ts` gets checked against PrismaAppConfig where it is written. */
|
|
814
861
|
declare function defineConfig(config: PrismaAppConfig): PrismaAppConfig;
|
|
815
862
|
//#endregion
|
|
816
|
-
export {
|
|
817
|
-
//# sourceMappingURL=app-config-
|
|
863
|
+
export { RunOutcome as $, LocalTargetProvidersInput as A, PREFLIGHT_FINDINGS_ENV_VAR as B, LocalNodeStopped as C, readPreflightFindings as Ct, LocalTargetCurrentInput as D, LocalTargetCurrentApp as E, LoweredResult as F, PreflightInput as G, PlatformVariableCheck as H, Lowering as I, ProvisionEdge as J, PreflightPayload as K, NamedSecrets as L, LowerContext as M, LowerError as N, LocalTargetDescriptor as O, LowerOptions as P, ReporterDescriptor as Q, NodeDescriptor as R, LocalNodeLocation as S, preflightFindingsEnv as St, LocalTargetAttachment as T, resolveStateLayer as Tt, PlatformVariableReader as U, PackageInput as V, PreflightFindings as W, ReportAttachInput as X, ProvisionerDescriptor as Y, ReportBeginInput as Z, DeployedNode as _, lowering as _t, Artifact as a, UnsetPlatformVariable as at, ExtensionDescriptor as b, preflightEnv as bt, ConfigAdapter as c, containerEnv as ct, ContainerCredentials as d, deploymentResult as dt, RunReporter as et, ContainerDescriptor as f, deserializeContainers as ft, DeployedEntity as g, lower as gt, DEV_ENVIRONMENT_NAME_FILE as h, joinDeployment as ht, ApplicationDescriptor as i, TeardownInput as it, LocateContainerInput as j, LocalTargetEmulatorsInput as k, ConfigAdapterInput as l, containerEnvVarName as lt, DEV_DIR as m, isBuildOnlyExtension as mt, AppConfiguration as n, ServiceLowering as nt, AssembleInput as o, buildConfig as ot, ContainerInstance as p, devEnvironmentDir as pt, PrismaAppConfig as q, AppSecrets as r, StateDescriptor as rt, Bundle as s, connectionInputs as st, AlchemyStateLayer as t, ServeInput as tt, ConfigValues as u, defineConfig as ut, DeploymentResult as v, mergedProviders as vt, LocalTargetAttachInput as w, readPreflightPayload as wt, LocalNodeCondition as x, preflightEnvVarName as xt, DevServer as y, platformVariableReaderText as yt, Outputs as z };
|
|
864
|
+
//# sourceMappingURL=app-config-UeKFBma7-CohaMmWp.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-config-UeKFBma7-CohaMmWp.d.mts","names":[],"sources":["../../../0-framework/1-core/core/dist/app-config-UeKFBma7.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;UAmBU;;WAEC;;WAEA;;;;;;;UAOD;WACC,OAAO;;WAEP;;EAET;;;;;;;;;;;;;;;UAeQ,qBAAqB;;WAEpB;;WAEA,SAAS;;;;;;;;;;;;UAYV,oBAAoB,UAAU,oBAAoB,mBAAmB;;EAE7E,OAAO,OAAO,sBAAsB,cAAc,qBAAqB,KAAK,QAAQ;;EAEpF,OAAO,OAAO,sBAAsB,cAAc,qBAAqB,KAAK,QAAQ;;EAEpF,OAAO,UAAU,GAAG,cAAc,qBAAqB,KAAK;;EAE5D,YAAY,qBAAqB;;;iBAGlB,oBAAoB;;iBAEpB,aAAa,WAAW,oBAAoB,qBAAqB;;UAExE;WACC;WACA,YAAY;;;;;;iBAMN,sBAAsB,qBAAqB,+BAA+B,KAAK,SAAS,sCAAsC,oBAAoB;;;;KAI9J;;iBAEY,oBAAoB;;iBAEpB,aAAa,UAAU,8BAA8B;;iBAErD,qBAAqB,qBAAqB,KAAK,SAAS,sCAAsC;;KAE1G;WACM;W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EAGX,WAAW;;;;;;EAMX;;;cAGY;;;;;;iBAMG,kBAAkB;;;;;;cAMrB;;;;;;;;;iBASG,qBAAqB,WAAW;;;;;;KAM5C;WACM;IACP;WACO;IACP;WACO;EACT,SAAS,OAAO,gBAAgB,QAAQ;;;;;EAKxC,OAAO,OAAO,aAAa,QAAQ;;;UAG3B;;WAEC;;WAEA;;;KAGN,eAAe,SAAS;;KAExB,iBAAiB,OAAO,uBAAuB,eAAe,QAAQ;;KAEtE,mBAAmB,SAAS;;KAE5B,aAAa,SAAS;;KAEtB,eAAe,SAAS;;;;;;;UAOnB;;WAEC;WACA,YAAY;WACZ,OAAO;;WAEP,kBAAkB;;WAElB,mBAAmB;;;iBAGb,aAAa,QAAQ,kBAAkB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./app-config-UeKFBma7-CohaMmWp.mjs";
|
package/dist/config.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import "./config-
|
|
1
|
+
import { $ as RunOutcome, A as LocalTargetProvidersInput, B as PREFLIGHT_FINDINGS_ENV_VAR, C as LocalNodeStopped, Ct as readPreflightFindings, D as LocalTargetCurrentInput, E as LocalTargetCurrentApp, G as PreflightInput, H as PlatformVariableCheck, K as PreflightPayload, L as NamedSecrets, O as LocalTargetDescriptor, Q as ReporterDescriptor, R as NodeDescriptor, S as LocalNodeLocation, St as preflightFindingsEnv, T as LocalTargetAttachment, U as PlatformVariableReader, W as PreflightFindings, X as ReportAttachInput, Z as ReportBeginInput, at as UnsetPlatformVariable, b as ExtensionDescriptor, bt as preflightEnv, c as ConfigAdapter, ct as containerEnv, d as ContainerCredentials, et as RunReporter, f as ContainerDescriptor, ft as deserializeContainers, g as DeployedEntity, h as DEV_ENVIRONMENT_NAME_FILE, it as TeardownInput, j as LocateContainerInput, k as LocalTargetEmulatorsInput, l as ConfigAdapterInput, lt as containerEnvVarName, m as DEV_DIR, mt as isBuildOnlyExtension, n as AppConfiguration, p as ContainerInstance, pt as devEnvironmentDir, q as PrismaAppConfig, r as AppSecrets, rt as StateDescriptor, u as ConfigValues, ut as defineConfig, w as LocalTargetAttachInput, wt as readPreflightPayload, x as LocalNodeCondition, xt as preflightEnvVarName, yt as platformVariableReaderText } from "./app-config-UeKFBma7-CohaMmWp.mjs";
|
|
2
|
+
import "./config-BeZEgGCg.mjs";
|
|
3
3
|
//#region ../../0-framework/3-tooling/cli/dist/config.d.mts
|
|
4
4
|
//#region src/config-adapters.d.ts
|
|
5
5
|
/** Reads the process environment when called: every variable whose value is a string. The default for both `config` and `secrets`. */
|
|
@@ -12,5 +12,5 @@ declare function environmentVariables(): ConfigAdapter;
|
|
|
12
12
|
*/
|
|
13
13
|
declare function dotenv(): ConfigAdapter;
|
|
14
14
|
//#endregion
|
|
15
|
-
export { AppConfiguration, AppSecrets, ConfigAdapter, ConfigAdapterInput, ConfigValues, type ContainerCredentials, type ContainerDescriptor, type ContainerInstance, DEV_DIR, DEV_ENVIRONMENT_NAME_FILE, type DeployedEntity, ExtensionDescriptor, LocalNodeCondition, LocalNodeLocation, LocalNodeStopped, LocalTargetAttachInput, LocalTargetAttachment, LocalTargetCurrentApp, LocalTargetCurrentInput, LocalTargetDescriptor, LocalTargetEmulatorsInput, LocalTargetProvidersInput, type LocateContainerInput, NamedSecrets, NodeDescriptor, PreflightInput, type PreflightPayload, PrismaAppConfig, ReportAttachInput, ReportBeginInput, ReporterDescriptor, RunOutcome, RunReporter, StateDescriptor, TeardownInput, containerEnv, containerEnvVarName, defineConfig, deserializeContainers, devEnvironmentDir, dotenv, environmentVariables, isBuildOnlyExtension, preflightEnv, preflightEnvVarName, readPreflightPayload };
|
|
15
|
+
export { AppConfiguration, AppSecrets, ConfigAdapter, ConfigAdapterInput, ConfigValues, type ContainerCredentials, type ContainerDescriptor, type ContainerInstance, DEV_DIR, DEV_ENVIRONMENT_NAME_FILE, type DeployedEntity, ExtensionDescriptor, LocalNodeCondition, LocalNodeLocation, LocalNodeStopped, LocalTargetAttachInput, LocalTargetAttachment, LocalTargetCurrentApp, LocalTargetCurrentInput, LocalTargetDescriptor, LocalTargetEmulatorsInput, LocalTargetProvidersInput, type LocateContainerInput, NamedSecrets, NodeDescriptor, PREFLIGHT_FINDINGS_ENV_VAR, PlatformVariableCheck, type PlatformVariableReader, type PreflightFindings, PreflightInput, type PreflightPayload, PrismaAppConfig, ReportAttachInput, ReportBeginInput, ReporterDescriptor, RunOutcome, RunReporter, StateDescriptor, TeardownInput, type UnsetPlatformVariable, containerEnv, containerEnvVarName, defineConfig, deserializeContainers, devEnvironmentDir, dotenv, environmentVariables, isBuildOnlyExtension, platformVariableReaderText, preflightEnv, preflightEnvVarName, preflightFindingsEnv, readPreflightFindings, readPreflightPayload };
|
|
16
16
|
//# sourceMappingURL=config.d.mts.map
|
package/dist/config.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { n as environmentVariables, t as dotenv } from "./config-adapters-DG-uhGfv-Bt1M9f8b.mjs";
|
|
2
|
-
import { n as
|
|
2
|
+
import { a as platformVariableReaderText, c as preflightFindingsEnv, i as deserializeContainers, l as readPreflightFindings, n as containerEnv, o as preflightEnv, r as containerEnvVarName, s as preflightEnvVarName, t as PREFLIGHT_FINDINGS_ENV_VAR, u as readPreflightPayload } from "./preflight-transport-DmmtoFPH-CnDWufmu.mjs";
|
|
3
3
|
import { a as isBuildOnlyExtension, i as devEnvironmentDir, n as DEV_ENVIRONMENT_NAME_FILE, r as defineConfig, t as DEV_DIR } from "./app-config-CErnR6NK-D9NgSBH4.mjs";
|
|
4
|
-
|
|
5
|
-
export { DEV_DIR, DEV_ENVIRONMENT_NAME_FILE, containerEnv, containerEnvVarName, defineConfig, deserializeContainers, devEnvironmentDir, dotenv, environmentVariables, isBuildOnlyExtension, preflightEnv, preflightEnvVarName, readPreflightPayload };
|
|
4
|
+
export { DEV_DIR, DEV_ENVIRONMENT_NAME_FILE, PREFLIGHT_FINDINGS_ENV_VAR, containerEnv, containerEnvVarName, defineConfig, deserializeContainers, devEnvironmentDir, dotenv, environmentVariables, isBuildOnlyExtension, platformVariableReaderText, preflightEnv, preflightEnvVarName, preflightFindingsEnv, readPreflightFindings, readPreflightPayload };
|
package/dist/control.d.mts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./config-
|
|
3
|
-
import
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { Pt as CliStructuredError } from "./graph-types-s5V7pGj2-BxSqB1ZH.mjs";
|
|
2
|
+
import { U as PlatformVariableReader, W as PreflightFindings, at as UnsetPlatformVariable } from "./app-config-UeKFBma7-CohaMmWp.mjs";
|
|
3
|
+
import "./config-BeZEgGCg.mjs";
|
|
4
|
+
import { n as DeploymentSummary, t as DeployedNodeSummary } from "./deployment-summary-p88NV5m5-SgniM8TX.mjs";
|
|
5
|
+
import "./index-DyuwxTtd.mjs";
|
|
6
|
+
import { a as ExecutionDiagnostics, c as executionDiagnostics, d as Result, i as DevSession, l as NotOk, n as DevEvent, o as ServiceEndpoint, r as DevInput, s as dev, t as ComposerConfigSource, u as Ok } from "./redaction-Bf8FvTFH-D_HvoMrf.mjs";
|
|
7
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-current-CrayKe7S.d.mts
|
|
7
8
|
//#region src/operations/deploy.d.ts
|
|
8
9
|
/** A deploy step. `assemble-service` steps run inside `assemble`, one per service. */
|
|
9
10
|
type DeployStep = {
|
|
@@ -22,6 +23,11 @@ type DeployEvent = {
|
|
|
22
23
|
readonly durationMs: number;
|
|
23
24
|
/** What the step measured, as its build adapter or deploy target reported it. The fields vary by adapter and target. */
|
|
24
25
|
readonly data?: Readonly<Record<string, string | number>> | undefined;
|
|
26
|
+
} |
|
|
27
|
+
/** Right after the preflight step, when it found platform variables with no value that no service needs. */
|
|
28
|
+
{
|
|
29
|
+
readonly kind: 'preflight-findings';
|
|
30
|
+
readonly findings: PreflightFindings;
|
|
25
31
|
};
|
|
26
32
|
interface DeployInput {
|
|
27
33
|
/**
|
|
@@ -208,5 +214,5 @@ interface RunReport {
|
|
|
208
214
|
readonly failure: RunReportFailure | null;
|
|
209
215
|
}
|
|
210
216
|
//#endregion
|
|
211
|
-
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 };
|
|
217
|
+
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, type PlatformVariableReader, type PreflightFindings, RUN_REPORT_FILE_ENV, RUN_REPORT_VERSION, type Result, type RunReport, type RunReportFailure, type ServiceEndpoint, type UnsetPlatformVariable, deploy, destroy, dev, devStop, devUrl, executionDiagnostics, log };
|
|
212
218
|
//# 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/dev-current-
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/dev-current-CrayKe7S.d.mts","../../../0-framework/3-tooling/cli/dist/control.d.mts"],"mappings":";;;;;;;;;KAOK;WACM;;WAEA;WACA;;KAEN;WACM;WACA,MAAM;;WAEN;WACA,MAAM;WACN;WACA;;WAEA,OAAO,SAAS;;;;WAIhB;WACA,UAAU;;UAIX;;;;WAIC,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;;;;;;WAOA;;;;;;;WAOA;;WAEA,YAAY,OAAO;;UAEpB;;;WAGC,SAAS;;WAET;;iBAEM,OAAO,OAAO,cAAc,QAAQ,OAAO,eAAe;;;UAOjE;;WAEC,QAAQ;;WAER;;WAEA;;WAEA;;UAED;WACC;;WAEA;;WAEA;;WAEA;;WAEA;;UAED;WACC,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;UAED;;WAEC;;WAEA;;WAEA;aACE;aACA;;;;iBAII,OAAO,OAAO,cAAc,QAAQ,OAAO,QAAQ;;iBAEnD,QAAQ,OAAO,eAAe,QAAQ,OAAO,YAAY;;;;KCjHrE;;;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;;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,5 +1,5 @@
|
|
|
1
1
|
import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
|
|
2
|
-
import { a as executionDiagnostics, i as devUrl, l as notOk, n as dev, o as executorLoadFailure, r as devStop, t as deploy } from "./dev-current-
|
|
2
|
+
import { a as executionDiagnostics, i as devUrl, l as notOk, n as dev, o as executorLoadFailure, r as devStop, t as deploy } from "./dev-current-wD5YDLjA-CzyFYXni.mjs";
|
|
3
3
|
import { n as RUN_REPORT_VERSION, t as RUN_REPORT_FILE_ENV } from "./run-report-CmBz2-xc-Cc8rV1CX.mjs";
|
|
4
4
|
//#region ../../0-framework/3-tooling/cli/dist/control.mjs
|
|
5
5
|
/**
|
|
@@ -21,7 +21,7 @@ async function destroyWithDeps(input, deps) {
|
|
|
21
21
|
const cwd = input.cwd ?? process.cwd();
|
|
22
22
|
let executor;
|
|
23
23
|
try {
|
|
24
|
-
executor = await import("./execute-deploy-destroy-
|
|
24
|
+
executor = await import("./execute-deploy-destroy-DOzo2Psp-DmS5miT4.mjs");
|
|
25
25
|
} catch (error) {
|
|
26
26
|
return notOk(executorLoadFailure("destroy", error));
|
|
27
27
|
}
|
|
@@ -43,7 +43,7 @@ async function logWithDeps(input, deps) {
|
|
|
43
43
|
const cwd = input.cwd ?? process.cwd();
|
|
44
44
|
let executor;
|
|
45
45
|
try {
|
|
46
|
-
executor = await import("./execute-log-
|
|
46
|
+
executor = await import("./execute-log-BDdHor71-B2p8Zae2.mjs");
|
|
47
47
|
} catch (error) {
|
|
48
48
|
return notOk(executorLoadFailure("log", error));
|
|
49
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 { c as executionDiagnostics, l as executorLoadFailure, n as devUrl, o as deploy, r as dev, t as devStop } from \"./dev-current-
|
|
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-wD5YDLjA.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-DOzo2Psp.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-BDdHor71.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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { d as isParamSource, g as nodeAddresses, n as Load, w as slotsOf } from "./graph-BzPLUUsB-D7EnB1F5.mjs";
|
|
3
|
+
import { i as deserializeContainers, l as readPreflightFindings } from "./preflight-transport-DmmtoFPH-CnDWufmu.mjs";
|
|
4
4
|
import * as Alchemy from "alchemy";
|
|
5
5
|
import * as Effect from "effect/Effect";
|
|
6
6
|
import * as Layer from "effect/Layer";
|
|
@@ -130,6 +130,14 @@ function joinDeployment(graph, entries) {
|
|
|
130
130
|
}
|
|
131
131
|
return nodes;
|
|
132
132
|
}
|
|
133
|
+
/** The deploy report: every deployed node joined with its graph node, and the findings the CLI carried from the deploy preflight. */
|
|
134
|
+
function deploymentResult(app, graph, entries, findings) {
|
|
135
|
+
return {
|
|
136
|
+
app,
|
|
137
|
+
nodes: joinDeployment(graph, entries),
|
|
138
|
+
findings
|
|
139
|
+
};
|
|
140
|
+
}
|
|
133
141
|
function missingBundleError(id) {
|
|
134
142
|
return new LowerError(`No bundle provided for service "${id}" (opts.bundles["${id}"] is required).`);
|
|
135
143
|
}
|
|
@@ -223,6 +231,7 @@ function lowering(root, config, opts) {
|
|
|
223
231
|
if (opts.firstProcessNodeAddresses !== void 0) assertSameNodeAddresses(nodeAddresses(graph), opts.firstProcessNodeAddresses);
|
|
224
232
|
const extensions = yield* extensionsById(config);
|
|
225
233
|
const containers = deserializeContainers(config.extensions, process.env);
|
|
234
|
+
const findings = readPreflightFindings(process.env);
|
|
226
235
|
const lowered = /* @__PURE__ */ new Map();
|
|
227
236
|
const entries = [];
|
|
228
237
|
const provisioned = /* @__PURE__ */ new Map();
|
|
@@ -344,10 +353,7 @@ function lowering(root, config, opts) {
|
|
|
344
353
|
if (opts.report !== void 0) {
|
|
345
354
|
const report = opts.report;
|
|
346
355
|
yield* Alchemy.Action("composer-deployment-report", (input) => Effect.sync(() => {
|
|
347
|
-
report(
|
|
348
|
-
app: opts.name,
|
|
349
|
-
nodes: joinDeployment(graph, input.entries)
|
|
350
|
-
});
|
|
356
|
+
report(deploymentResult(opts.name, graph, input.entries, findings));
|
|
351
357
|
}))({
|
|
352
358
|
nonce: Date.now(),
|
|
353
359
|
entries
|
|
@@ -370,6 +376,6 @@ function lower(root, config, opts) {
|
|
|
370
376
|
}, stackEffect);
|
|
371
377
|
}
|
|
372
378
|
//#endregion
|
|
373
|
-
export {
|
|
379
|
+
export { joinDeployment as a, mergedProviders as c, deploymentResult as i, resolveStateLayer as l, buildConfig as n, lower as o, connectionInputs as r, lowering as s, LowerError as t };
|
|
374
380
|
|
|
375
|
-
//# sourceMappingURL=deploy-
|
|
381
|
+
//# sourceMappingURL=deploy-3EXLVrtG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-3EXLVrtG.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/deploy.mjs"],"sourcesContent":["import { i as secretsKeys, r as nodeAddresses, t as Load, u as isParamSource, y as slotsOf } from \"./graph-BzPLUUsB.mjs\";\nimport { o as readPreflightFindings, u as deserializeContainers } from \"./preflight-transport-DmmtoFPH.mjs\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport * as Alchemy from \"alchemy\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\n//#region src/control/deploy.ts\n/** Routes each graph node to its extension descriptor (by node.extension/type) and runs provision → serialize → package → deploy in dependency order. */\nvar LowerError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"LowerError\";\n\t}\n};\nfunction assertSameNodeAddresses(built, firstProcess) {\n\tconst onlyBuilt = built.filter((address) => !firstProcess.includes(address));\n\tconst onlyFirst = firstProcess.filter((address) => !built.includes(address));\n\tif (onlyBuilt.length === 0 && onlyFirst.length === 0) return;\n\tconst list = (addresses) => addresses.length === 0 ? \"none\" : addresses.map((address) => `\"${address}\"`).join(\", \");\n\tthrow new LowerError(`The deploy's second process built a different graph from the one Composer checked in its first process. Only in the second process: ${list(onlyBuilt)}. Only in the first process: ${list(onlyFirst)}. A module body must build the same graph every time; one that reads the process environment, a file or the clock can build a different one.`);\n}\n/**\n* Resolves one SERVICE-OWN param to its config value. The full resolution\n* order across both value channels:\n*\n* 1. A param claiming BOTH a provision-time binding and a `provision` need\n* (ADR-0031) is a loud error — two sources for one value.\n* 2. A provision-time binding (a schema-validated literal, or an opaque\n* `ParamSource` the target resolves at boot per ADR-0019) beats the\n* declared `default`.\n* 3. A framework-minted `provision` need is resolved per dependency EDGE\n* against the consumer extension's registry — that path fills CONNECTION\n* params in `buildConfig`'s inputs loop, never this function. A\n* service-own param has no edge to mint against, so an unbound need here\n* falls through like any unbound param.\n* 4. The `default`, else absent (only legal when `optional`), else a loud\n* error naming the param, the service, and the fix.\n*/\nfunction resolveParam(node, serviceId, name, param, bound) {\n\tif (bound !== void 0) {\n\t\tif (param.provision !== void 0) throw new LowerError(`Param \"${name}\" of \"${serviceId}\" (service \"${node.name}\") has two sources claiming one value: a provision-time binding (${isParamSource(bound) ? \"a param source\" : \"a literal value\"}) AND a framework provision need (\"${String(param.provision.brand)}\") on its declaration — remove the binding or drop the \\`provision\\` facet.`);\n\t\tif (isParamSource(bound)) return bound;\n\t\tconst result = param.schema[\"~standard\"].validate(bound);\n\t\tif (result instanceof Promise) throw new LowerError(`Param \"${name}\" of \"${serviceId}\" (service \"${node.name}\") uses an async Standard Schema — a provision-time literal value requires a synchronous validator.`);\n\t\tif (result.issues !== void 0) {\n\t\t\tconst messages = result.issues.map((issue) => issue.message).join(\"; \");\n\t\t\tthrow new LowerError(`Param \"${name}\" of \"${serviceId}\" (service \"${node.name}\") received an invalid provision-time value: ${messages}`);\n\t\t}\n\t\treturn result.value;\n\t}\n\tif (param.default !== void 0) return param.default;\n\tif (param.optional === true) return void 0;\n\tthrow new LowerError(`Param \"${name}\" of \"${serviceId}\" (service \"${node.name}\") has no default, is not optional, and was not bound at provision — bind it with a literal value or a param source (e.g. envParam('NAME')) on its provision() call, or give it a default.`);\n}\n/**\n* Assembles a service's typed Config. Connection params come from the\n* dependency edge's lowered outputs — or, for a param carrying a `provision`\n* need (ADR-0031), from `provisioned` (keyed by edge id): the framework mints\n* it, the producer hands nothing over. The service's own params resolve via\n* `resolveParam` (provision-time binding, then default, then loud\n* unbound-required failure).\n*\n* This is also where the connection contract is enforced: a producer that fails to\n* supply a required param its consumer's connection declares fails the deploy\n* here, naming the edge, rather than reaching the consumer as `undefined`.\n*/\nfunction buildConfig(node, id, graph, lowered, provisioned) {\n\tconst inputs = slotConnectionParams(node, id, graph, lowered, provisioned);\n\tconst boundParams = new Map(graph.params.filter((binding) => binding.serviceAddress === id).map((b) => [b.slot, b.binding]));\n\tconst service = {};\n\tfor (const [name, param] of Object.entries(node.params)) {\n\t\tconst value = resolveParam(node, id, name, param, boundParams.get(name));\n\t\tif (value !== void 0) service[name] = value;\n\t}\n\treturn {\n\t\tservice,\n\t\tinputs\n\t};\n}\n/**\n* The connection params of each of a service's or resource's dependency\n* slots, resolved against the producer's lowered outputs or the minted\n* `provisioned` value, with the connection contract enforced (see `buildConfig`).\n*/\nfunction connectionInputs(ctx) {\n\treturn slotConnectionParams(ctx.node, ctx.id, ctx.graph, ctx.lowered, ctx.provisioned);\n}\nfunction slotConnectionParams(node, id, graph, lowered, provisioned) {\n\tconst inputs = {};\n\tfor (const [inputName, inputNode] of Object.entries(node.inputs)) {\n\t\tconst edge = graph.edges.find((e) => e.to === id && e.input === inputName && e.kind === \"dependency\");\n\t\tconst producedOutputs = edge !== void 0 ? lowered.get(edge.from) ?? {} : {};\n\t\tconst values = {};\n\t\tfor (const [name, param] of Object.entries(inputNode.connection.params)) {\n\t\t\tif (param.provision !== void 0) {\n\t\t\t\tvalues[name] = provisioned.get(`${id}.${inputName}`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst value = producedOutputs[name];\n\t\t\tif (value === void 0 && param.optional !== true && edge !== void 0) throw new LowerError(`Connection input \"${id}.${inputName}\" declares param \"${name}\", but its producer \"${edge.from}\" did not supply it — the producer's outputs carry [${Object.keys(producedOutputs).join(\", \") || \"nothing\"}]. Add \"${name}\" to the outputs the producer returns from its lowering, or declare the param optional on the connection.`);\n\t\t\tvalues[name] = value;\n\t\t}\n\t\tinputs[inputName] = values;\n\t}\n\treturn inputs;\n}\n/**\n* Joins resolved report entries back to their graph nodes — the last step of a\n* deploy report, run inside the Action with apply's resolved values.\n*\n* The entries cross Alchemy's action-input boundary, so they carry addresses\n* and plain entities only; the graph is held by closure on this side. That\n* split is why this join exists at all, and it is what keeps functions and\n* Standard Schemas (which a node carries, and which the plan's input hash\n* would have to serialize) out of the input.\n*\n* Skips an address the graph no longer holds: entries are data, the graph is\n* truth.\n*/\nfunction joinDeployment(graph, entries) {\n\tconst nodes = [];\n\tfor (const entry of entries) {\n\t\tconst node = graph.nodes.find((n) => n.id === entry.address)?.node;\n\t\tif (node === void 0 || node.kind !== \"service\" && node.kind !== \"resource\") continue;\n\t\tnodes.push({\n\t\t\taddress: entry.address,\n\t\t\tnode,\n\t\t\tentities: entry.entities\n\t\t});\n\t}\n\treturn nodes;\n}\n/** The deploy report: every deployed node joined with its graph node, and the findings the CLI carried from the deploy preflight. */\nfunction deploymentResult(app, graph, entries, findings) {\n\treturn {\n\t\tapp,\n\t\tnodes: joinDeployment(graph, entries),\n\t\tfindings\n\t};\n}\nfunction missingBundleError(id) {\n\treturn new LowerError(`No bundle provided for service \"${id}\" (opts.bundles[\"${id}\"] is required).`);\n}\n/** The message `prisma dev` structures as `DEV.DEV_SERVER_UNSUPPORTED` (ADR-0056). */\nfunction noReserveError(id, extension, type) {\n\treturn new LowerError(`service \"${id}\" runs a dev server but its descriptor (${extension}/${type}) has no \\`reserve\\` step`);\n}\nfunction unassembledWithBundleError(address) {\n\treturn new LowerError(`\"${address}\" is listed in opts.unassembled and also has a bundle in opts.bundles — a service is either assembled or not.`);\n}\nfunction unassembledNotServiceError(address) {\n\treturn new LowerError(`\"${address}\" is listed in opts.unassembled but is not a service in the graph.`);\n}\nfunction duplicateExtensionError(id) {\n\treturn new LowerError(`Extension \"${id}\" is listed more than once in \\`extensions\\` — each extension id must be unique.`);\n}\n/** Registries as extension id → descriptor. Fails on a duplicate id — the CLI validates config, but lowering() is the programmatic escape hatch that doesn't. */\nfunction extensionsById(config) {\n\tconst map = /* @__PURE__ */ new Map();\n\tfor (const extension of config.extensions) {\n\t\tif (map.has(extension.id)) return Effect.fail(duplicateExtensionError(extension.id));\n\t\tmap.set(extension.id, extension);\n\t}\n\treturn Effect.succeed(map);\n}\nfunction unknownExtensionError(extension, id) {\n\treturn new LowerError(`No extension \"${extension}\" is configured (needed by node \"${id}\") — add it to \\`extensions\\` in the \\`composer\\` section of prisma.config.ts (import its /control entry and list its descriptor).`);\n}\nfunction unknownNodeTypeError(extension, type) {\n\treturn new LowerError(`Extension \"${extension.id}\" has no descriptor for node type \"${type}\" (known: ${Object.keys(extension.nodes).join(\", \")}).`);\n}\n/** A provisioned param's need brand isn't registered by the consumer's extension (ADR-0031). */\nfunction unknownProvisionerError(extension, brand, edgeId) {\n\tconst known = extension.provisions !== void 0 && extension.provisions.size > 0 ? Array.from(extension.provisions.keys(), String).join(\", \") : \"(none registered)\";\n\treturn new LowerError(`Extension \"${extension.id}\" has no provisioner for need \"${String(brand)}\" (needed by edge \"${edgeId}\") (known: ${known}).`);\n}\n/** A provisioned edge whose consumer and provider nodes belong to different extensions (ADR-0031). */\nfunction crossExtensionProvisionError(edgeId) {\n\treturn new LowerError(`Provisioned edge \"${edgeId}\" spans two extensions — cross-extension provisioned edges aren't supported yet.`);\n}\n/**\n* More than one provisioned param on one connection (ADR-0031). One edge mints\n* ONE value, keyed by edge id, so a second need on the same connection would\n* silently receive the first's value under the first's brand.\n*/\nfunction multipleProvisionedParamsError(edgeId, names) {\n\treturn new LowerError(`Connection input \"${edgeId}\" declares more than one provisioned param (${names.join(\", \")}) — only one provisioned param per connection is supported.`);\n}\nfunction wrongKindError(extension, type, expected, got) {\n\treturn new LowerError(`Extension \"${extension}\"'s descriptor for node type \"${type}\" is a \"${got}\" descriptor — this node needs a \"${expected}\" descriptor.`);\n}\n/** Looks up one node's descriptor: extension by `node.extension`, then descriptor by `node.type`, then the kind check. */\nfunction descriptorFor(extensions, node, id) {\n\tconst extension = extensions.get(node.extension);\n\tif (extension === void 0) return Effect.fail(unknownExtensionError(node.extension, id));\n\tconst descriptor = extension.nodes[node.type];\n\tif (descriptor === void 0) return Effect.fail(unknownNodeTypeError(extension, node.type));\n\tif (descriptor.kind !== node.kind) return Effect.fail(wrongKindError(node.extension, node.type, node.kind, descriptor.kind));\n\treturn Effect.succeed(descriptor);\n}\n/**\n* The state-layer precedence a deploy resolves to: an explicit opts.state\n* always wins; failing that, the config's own (required) state descriptor,\n* created with its owning extension's resolved container (`undefined` when\n* that extension declared none). A pure function so the precedence is\n* testable without booting Alchemy.\n*/\nfunction resolveStateLayer(opts, config, containers) {\n\treturn opts.state ?? config.state.create(containers.get(config.state.extension));\n}\n/**\n* All configured extensions' providers merged, config array order — an\n* extension without `providers` is skipped; no used-extensions-only\n* filtering (ADR-0017's pinned providers rule).\n*/\nfunction mergedProviders(config) {\n\tconst [first, ...rest] = config.extensions.flatMap((extension) => extension.providers !== void 0 ? [extension.providers()] : []);\n\treturn first === void 0 ? Layer.empty : Layer.mergeAll(first, ...rest);\n}\n/**\n* Composable form for mixed stacks: hand-wired Alchemy resources alongside Prisma App nodes in one stack effect.\n* Fails with LowerError or whatever an extension's lowering raises — the error type is open.\n*/\nfunction lowering(root, config, opts) {\n\treturn blindCast(Effect.gen(function* () {\n\t\tconst graph = Load(root, {\n\t\t\tid: opts.name,\n\t\t\t...opts.environment !== void 0 ? { environment: { name: opts.environment } } : {},\n\t\t\t...opts.appConfigurationRead !== void 0 ? { appConfigurationRead: opts.appConfigurationRead } : {}\n\t\t});\n\t\tif (opts.firstProcessNodeAddresses !== void 0) assertSameNodeAddresses(nodeAddresses(graph), opts.firstProcessNodeAddresses);\n\t\tconst extensions = yield* extensionsById(config);\n\t\tconst containers = deserializeContainers(config.extensions, process.env);\n\t\tconst findings = readPreflightFindings(process.env);\n\t\tconst lowered = /* @__PURE__ */ new Map();\n\t\tconst entries = [];\n\t\tconst provisioned = /* @__PURE__ */ new Map();\n\t\tconst applications = /* @__PURE__ */ new Map();\n\t\tfor (const descriptor of config.extensions) {\n\t\t\tif (descriptor.application === void 0) continue;\n\t\t\tconst appCtx = {\n\t\t\t\tid: graph.root.id,\n\t\t\t\taddress: \"\",\n\t\t\t\tnode: graph.root.node,\n\t\t\t\tgraph,\n\t\t\t\topts,\n\t\t\t\tapplication: void 0,\n\t\t\t\tcontainer: containers.get(descriptor.id),\n\t\t\t\tlowered,\n\t\t\t\tprovisioned\n\t\t\t};\n\t\t\tapplications.set(descriptor.id, yield* descriptor.application.provision(appCtx));\n\t\t}\n\t\tfor (const edge of graph.edges) {\n\t\t\tif (edge.kind !== \"dependency\") continue;\n\t\t\tconst consumer = graph.nodes.find((n) => n.id === edge.to)?.node;\n\t\t\tif (consumer === void 0 || consumer.kind !== \"service\" && consumer.kind !== \"resource\") continue;\n\t\t\tconst slot = slotsOf(consumer)[edge.input];\n\t\t\tif (slot === void 0) continue;\n\t\t\tconst provisionedParams = Object.entries(slot.connection.params).filter(([, param]) => param.provision !== void 0);\n\t\t\tif (provisionedParams.length === 0) continue;\n\t\t\tconst edgeId = `${edge.to}.${edge.input}`;\n\t\t\tif (provisionedParams.length > 1) return yield* Effect.fail(multipleProvisionedParamsError(edgeId, provisionedParams.map(([name]) => name)));\n\t\t\tconst need = provisionedParams[0]?.[1].provision;\n\t\t\tif (need === void 0) continue;\n\t\t\tconst provider = graph.nodes.find((n) => n.id === edge.from)?.node;\n\t\t\tif (provider === void 0 || provider.kind !== \"service\" && provider.kind !== \"resource\") continue;\n\t\t\tif (consumer.extension !== provider.extension) return yield* Effect.fail(crossExtensionProvisionError(edgeId));\n\t\t\tconst extension = extensions.get(consumer.extension);\n\t\t\tif (extension === void 0) return yield* Effect.fail(unknownExtensionError(consumer.extension, edge.to));\n\t\t\tconst provisioner = extension.provisions?.get(need.brand);\n\t\t\tif (provisioner === void 0) return yield* Effect.fail(unknownProvisionerError(extension, need.brand, edgeId));\n\t\t\tconst ref = yield* provisioner.provision({\n\t\t\t\tapp: graph.root.id,\n\t\t\t\tedgeId,\n\t\t\t\tconsumerAddress: edge.to,\n\t\t\t\tproviderAddress: edge.from,\n\t\t\t\tinput: edge.input,\n\t\t\t\tneed\n\t\t\t});\n\t\t\tprovisioned.set(edgeId, ref);\n\t\t}\n\t\tconst unassembled = new Set(opts.unassembled ?? []);\n\t\tfor (const address of unassembled) {\n\t\t\tif (address in opts.bundles) return yield* Effect.fail(unassembledWithBundleError(address));\n\t\t\tconst found = graph.nodes.find((n) => n.id === address);\n\t\t\tif (found === void 0 || found.node.kind !== \"service\") return yield* Effect.fail(unassembledNotServiceError(address));\n\t\t}\n\t\tconst services = /* @__PURE__ */ new Map();\n\t\tconst ctxFor = (id, node) => ({\n\t\t\tid,\n\t\t\taddress: id,\n\t\t\tnode,\n\t\t\tgraph,\n\t\t\topts,\n\t\t\tapplication: applications.get(node.extension),\n\t\t\tcontainer: containers.get(node.extension),\n\t\t\tlowered,\n\t\t\tprovisioned,\n\t\t\tservices\n\t\t});\n\t\tfor (const { id, node } of graph.nodes) {\n\t\t\tif (node.kind !== \"service\") continue;\n\t\t\tconst descriptor = yield* descriptorFor(extensions, node, id);\n\t\t\tif (descriptor.kind !== \"service\") continue;\n\t\t\tservices.set(id, yield* descriptor.provision(ctxFor(id, node)));\n\t\t}\n\t\tfor (const { id, node } of graph.nodes) {\n\t\t\tif (node.kind === \"module\") continue;\n\t\t\tif (node.kind === \"dependency\") continue;\n\t\t\tconst ctx = ctxFor(id, node);\n\t\t\tconst descriptor = yield* descriptorFor(extensions, node, id);\n\t\t\tif (descriptor.kind === \"resource\") {\n\t\t\t\tconst result = yield* descriptor(ctx);\n\t\t\t\tlowered.set(id, result.outputs);\n\t\t\t\tentries.push({\n\t\t\t\t\taddress: id,\n\t\t\t\t\tentities: result.entities\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (descriptor.kind !== \"service\") return yield* Effect.fail(wrongKindError(node.extension, node.type, node.kind, descriptor.kind));\n\t\t\tconst service = node;\n\t\t\tconst provisionedNode = services.get(id);\n\t\t\tconst typedConfig = buildConfig(service, id, graph, lowered, provisioned);\n\t\t\tconst serialized = yield* descriptor.serialize(ctx, provisionedNode, typedConfig);\n\t\t\tif (unassembled.has(id)) {\n\t\t\t\tif (descriptor.reserve === void 0) return yield* Effect.fail(noReserveError(id, node.extension, node.type));\n\t\t\t\tconst result = yield* descriptor.reserve(ctx, provisionedNode, serialized);\n\t\t\t\tlowered.set(id, result.outputs);\n\t\t\t\tentries.push({\n\t\t\t\t\taddress: id,\n\t\t\t\t\tentities: result.entities\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst bundle = opts.bundles[id];\n\t\t\tif (bundle === void 0) return yield* Effect.fail(missingBundleError(id));\n\t\t\tconst artifact = yield* descriptor.package(ctx, {\n\t\t\t\tassembled: {\n\t\t\t\t\tdir: bundle.dir,\n\t\t\t\t\tentry: bundle.entry\n\t\t\t\t},\n\t\t\t\taddress: id\n\t\t\t});\n\t\t\tconst result = yield* descriptor.deploy(ctx, provisionedNode, artifact, serialized);\n\t\t\tlowered.set(id, result.outputs);\n\t\t\tentries.push({\n\t\t\t\taddress: id,\n\t\t\t\tentities: result.entities\n\t\t\t});\n\t\t}\n\t\tif (opts.report !== void 0) {\n\t\t\tconst report = opts.report;\n\t\t\tyield* Alchemy.Action(\"composer-deployment-report\", (input) => Effect.sync(() => {\n\t\t\t\treport(deploymentResult(opts.name, graph, input.entries, findings));\n\t\t\t}))({\n\t\t\t\tnonce: Date.now(),\n\t\t\t\tentries\n\t\t\t});\n\t\t}\n\t}));\n}\n/**\n* The whole-stack wrapper: Load → route each node through the config's\n* extension registries → an Alchemy Stack (the default export the alchemy\n* CLI consumes).\n*/\nfunction lower(root, config, opts) {\n\tconst stackEffect = blindCast(Effect.orDie(lowering(root, config, opts)));\n\tconst containers = deserializeContainers(config.extensions, process.env);\n\tconst providers = opts.providers ?? mergedProviders(config);\n\treturn Alchemy.Stack(opts.name, {\n\t\tproviders,\n\t\tstate: resolveStateLayer(opts, config, containers)\n\t}, stackEffect);\n}\n//#endregion\nexport { LowerError, buildConfig, connectionInputs, deploymentResult, joinDeployment, lower, lowering, mergedPro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AAW,KAAK,GAAG,OAAO,OAAO,OAAO,KAAK,mBAAmB,EAAE,CAAC;GACvE,MAAM,WAAW,OAAO,WAAW,QAAQ,KAAK;IAC/C,WAAW;KACV,KAAK,OAAO;KACZ,OAAO,OAAO;IACf;IACA,SAAS;GACV,CAAC;GACD,MAAM,SAAS,OAAO,WAAW,OAAO,KAAK,iBAAiB,UAAU,UAAU;GAClF,QAAQ,IAAI,IAAI,OAAO,OAAO;GAC9B,QAAQ,KAAK;IACZ,SAAS;IACT,UAAU,OAAO;GAClB,CAAC;EACF;EACA,IAAI,KAAK,WAAW,KAAK,GAAG;GAC3B,MAAM,SAAS,KAAK;GACpB,OAAO,QAAQ,OAAO,+BAA+B,UAAU,OAAO,WAAW;IAChF,OAAO,iBAAiB,KAAK,MAAM,OAAO,MAAM,SAAS,QAAQ,CAAC;GACnE,CAAC,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,IAAI;IAChB;GACD,CAAC;EACF;CACD,CAAC,CAAC;AACH;;;;;;AAMA,SAAS,MAAM,MAAM,QAAQ,MAAM;CAClC,MAAM,cAAc,UAAU,OAAO,MAAM,SAAS,MAAM,QAAQ,IAAI,CAAC,CAAC;CACxE,MAAM,aAAa,sBAAsB,OAAO,YAAY,QAAQ,GAAG;CACvE,MAAM,YAAY,KAAK,aAAa,gBAAgB,MAAM;CAC1D,OAAO,QAAQ,MAAM,KAAK,MAAM;EAC/B;EACA,OAAO,kBAAkB,MAAM,QAAQ,UAAU;CAClD,GAAG,WAAW;AACf"}
|
package/dist/deploy.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as secretsKeys, r as nodeAddresses } from "./graph-
|
|
2
|
-
import {
|
|
3
|
-
import "./deploy-
|
|
4
|
-
export { AlchemyStateLayer, ApplicationDescriptor, Artifact, AssembleInput, Bundle, DeployedEntity, DeployedNode, DeploymentResult, DevServer, LowerContext, LowerError, LowerOptions, LoweredResult, Lowering, Outputs, PackageInput, ProvisionEdge, ProvisionerDescriptor, ServeInput, ServiceLowering, buildConfig, connectionInputs, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys };
|
|
1
|
+
import { i as secretsKeys, r as nodeAddresses } from "./graph-C7mdtisq-RnKiwVsx.mjs";
|
|
2
|
+
import { F as LoweredResult, I as Lowering, J as ProvisionEdge, M as LowerContext, N as LowerError, P as LowerOptions, Tt as resolveStateLayer, V as PackageInput, Y as ProvisionerDescriptor, _ as DeployedNode, _t as lowering, a as Artifact, dt as deploymentResult, g as DeployedEntity, gt as lower, ht as joinDeployment, i as ApplicationDescriptor, nt as ServiceLowering, o as AssembleInput, ot as buildConfig, s as Bundle, st as connectionInputs, t as AlchemyStateLayer, tt as ServeInput, v as DeploymentResult, vt as mergedProviders, y as DevServer, z as Outputs } from "./app-config-UeKFBma7-CohaMmWp.mjs";
|
|
3
|
+
import "./deploy-Xi4_JrtE.mjs";
|
|
4
|
+
export { AlchemyStateLayer, ApplicationDescriptor, Artifact, AssembleInput, Bundle, DeployedEntity, DeployedNode, DeploymentResult, DevServer, LowerContext, LowerError, LowerOptions, LoweredResult, Lowering, Outputs, PackageInput, ProvisionEdge, ProvisionerDescriptor, ServeInput, ServiceLowering, buildConfig, connectionInputs, deploymentResult, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys };
|
package/dist/deploy.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
export { LowerError, buildConfig, connectionInputs, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys };
|
|
1
|
+
import { S as secretsKeys, g as nodeAddresses } from "./graph-BzPLUUsB-D7EnB1F5.mjs";
|
|
2
|
+
import { a as joinDeployment, c as mergedProviders, i as deploymentResult, l as resolveStateLayer, n as buildConfig, o as lower, r as connectionInputs, s as lowering, t as LowerError } from "./deploy-3EXLVrtG.mjs";
|
|
3
|
+
export { LowerError, buildConfig, connectionInputs, deploymentResult, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys };
|
package/dist/{deployment-summary-BETZp_5k-C_KvpHWJ.mjs → deployment-summary-D74WrJX7-DQ3LDUuO.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
|
|
2
|
-
import { i as redactCredentialLooking } from "./redaction-
|
|
2
|
+
import { i as redactCredentialLooking } from "./redaction-DXung4ip-bBoNomi3.mjs";
|
|
3
3
|
import * as fs$1 from "node:fs";
|
|
4
4
|
import { format, stripVTControlCharacters } from "node:util";
|
|
5
|
-
//#region ../../0-framework/3-tooling/cli/dist/deployment-summary-
|
|
5
|
+
//#region ../../0-framework/3-tooling/cli/dist/deployment-summary-D74WrJX7.mjs
|
|
6
6
|
/**
|
|
7
7
|
* The deploy result's cross-process protocol, whole in one place: the
|
|
8
8
|
* serializable shape, the env var that names the carrier file, the writer the
|
|
@@ -178,4 +178,4 @@ function engineFailureCause(output, env) {
|
|
|
178
178
|
//#endregion
|
|
179
179
|
export { readEngineFailureCause as a, readDeploymentSummary as i, captureEngineFailure as n, writeDeploymentSummaryFile as o, engineFailureFilePath as r, DEPLOYMENT_RESULT_FILE_ENV as t };
|
|
180
180
|
|
|
181
|
-
//# sourceMappingURL=deployment-summary-
|
|
181
|
+
//# sourceMappingURL=deployment-summary-D74WrJX7-DQ3LDUuO.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment-summary-BETZp_5k-C_KvpHWJ.mjs","names":["fs"],"sources":["../../../0-framework/3-tooling/cli/dist/deployment-summary-BETZp_5k.mjs"],"sourcesContent":["import { a as redactCredentialLooking } from \"./redaction-HnbkSFrK.mjs\";\nimport * as fs from \"node:fs\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { format, stripVTControlCharacters } from \"node:util\";\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`. So is the\n* failure cause the child leaves beside it when it exits non-zero.\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/** The child's failure cause rides beside the result file, so the one env var names both and the parent's cleanup removes both. */\nfunction engineFailureFilePath(resultFilePath) {\n\treturn `${resultFilePath}.failure.txt`;\n}\n/** Fits the platform's 5000-character build `errorMessage` with room for the exit-status prefix. */\nconst ENGINE_FAILURE_CAUSE_LIMIT = 1e3;\n/** Alchemy's advice to rerun its own CLI with `--adopt` or to import a resource with adoption, which a Composer user has no way to do. */\nconst ALCHEMY_ADOPT_ADVICE = [\n\t[/Re-run with `--adopt` \\(or wrap the effect in `adopt\\(true\\)`\\) to take it over\\./g, \"Something other than this app holds it. Remove that resource, then deploy again.\"],\n\t[/Re-run with `--adopt` \\(or wrap the effect in `adopt\\(true\\)`\\) to replace it anyway\\./g, \"Remove that resource, then deploy again.\"],\n\t[/\\(re-deploy with --adopt to take ownership, then destroy\\)/g, \"(remove it by hand)\"],\n\t[/Import it with explicit adoption (?:instead of silently taking it over|or choose a different [\\w ]+ name)\\./g, \"Something other than this app holds it. Remove that resource, then deploy again.\"],\n\t[/; rerun with adoption enabled if it is the intended [\\w ]+\\./g, \". Remove that resource, then deploy again.\"]\n];\n/** Replaces Alchemy CLI advice in engine output with steps that work from Composer. */\nfunction withComposerAdvice(text) {\n\treturn ALCHEMY_ADOPT_ADVICE.reduce((current, [advice, replacement]) => current.replace(advice, replacement), text);\n}\nconst STDOUT_CONSOLE_METHODS = /* @__PURE__ */ new Set([\n\t\"log\",\n\t\"info\",\n\t\"debug\"\n]);\n/**\n* Child half of the failure protocol, called by the generated stack file.\n* Keeps a bounded tail of everything this process logs through `console`,\n* passing every call through except Alchemy's CLI advice (see\n* {@link withComposerAdvice}), and on a non-zero exit writes the\n* redacted cause beside the result file. `console`, not the output streams:\n* alchemy's logger and its error reporting both go through it, and under Bun\n* `console` does not reach `process.stdout.write`.\n*\n* When stdout is not a terminal it carries the parent's data lines, so\n* everything this process prints goes to stderr instead.\n*/\nfunction captureEngineFailure() {\n\tconst resultFile = process.env[DEPLOYMENT_RESULT_FILE_ENV];\n\tif (resultFile === void 0 || resultFile.length === 0) return;\n\tconst stdoutToStderr = process.stdout.isTTY !== true;\n\tif (stdoutToStderr) process.stdout.write = process.stderr.write.bind(process.stderr);\n\tlet tail = \"\";\n\tfor (const method of [\n\t\t\"log\",\n\t\t\"info\",\n\t\t\"warn\",\n\t\t\"error\",\n\t\t\"debug\"\n\t]) {\n\t\tconst original = stdoutToStderr && STDOUT_CONSOLE_METHODS.has(method) ? console.error : console[method];\n\t\tconsole[method] = (...args) => {\n\t\t\tconst text = format(...args);\n\t\t\tconst shown = withComposerAdvice(text);\n\t\t\ttail = `${tail}${redactCredentialLooking(shown, process.env)}\\n`.slice(-65536);\n\t\t\tif (shown === text) original.apply(console, args);\n\t\t\telse original.call(console, shown);\n\t\t};\n\t}\n\tprocess.once(\"exit\", (code) => {\n\t\tif (code === 0) return;\n\t\tconst cause = engineFailureCause(tail, process.env);\n\t\tif (cause === void 0) return;\n\t\ttry {\n\t\t\tfs.writeFileSync(engineFailureFilePath(resultFile), cause);\n\t\t} catch {}\n\t});\n}\n/** Parent half: the cause the child recorded, passed through `redact`, or undefined when it recorded none. The child redacts only what its own environment names as a credential; the parent also knows the known secrets. */\nfunction readEngineFailureCause(resultFilePath, redact) {\n\tlet cause;\n\ttry {\n\t\tcause = fs.readFileSync(engineFailureFilePath(resultFilePath), \"utf8\");\n\t} catch {\n\t\treturn;\n\t}\n\treturn cause.length > 0 ? redact(cause) : void 0;\n}\n/** Effect's pretty log prefix, e.g. `[10:29:16.556] INFO (#53): `. */\nconst LOG_PREFIX = /^\\[[\\d:.]+\\] ([A-Z]+) \\(#\\d+\\): ?/;\n/** Alchemy's per-resource failure row, e.g. `[web] fail — UnknownError: …`. */\nconst RESOURCE_FAIL_ROW = /^\\[[^\\]]+\\] fail\\b/;\nconst STACK_FRAME = /^\\s*at /;\n/**\n* The failure the output describes: every line from the first failure line\n* (a failed resource row, an ERROR log, or an `error:` line) to the end, minus\n* blank lines, stack frames and info logs; the last five lines when there is no\n* failure line. Redacted, then capped.\n*/\nfunction engineFailureCause(output, env) {\n\tconst lines = [];\n\tfor (const raw of stripVTControlCharacters(output).split(/\\r\\n|\\r|\\n/)) {\n\t\tconst clean = raw.replace(/(?![\\t])\\p{Cc}/gu, \"\").trimEnd();\n\t\tconst prefix = LOG_PREFIX.exec(clean);\n\t\tconst text = (prefix === null ? clean : clean.slice(prefix[0].length)).trim();\n\t\tif (text.length === 0 || text === \"{\" || text === \"}\" || STACK_FRAME.test(text)) continue;\n\t\tconst level = prefix?.[1];\n\t\tconst failure = level === \"ERROR\" || level === \"FATAL\" || RESOURCE_FAIL_ROW.test(text) || /^\\W*error:/i.test(text);\n\t\tlines.push({\n\t\t\ttext,\n\t\t\tfailure,\n\t\t\tinfo: !failure && level !== void 0\n\t\t});\n\t}\n\tconst start = lines.findIndex((line) => line.failure);\n\tconst kept = start === -1 ? lines.slice(-5) : lines.slice(start).filter((line) => !line.info);\n\tif (kept.length === 0) return void 0;\n\tconst cause = redactCredentialLooking(kept.map((line) => line.text).join(\"\\n\"), env);\n\treturn cause.length <= ENGINE_FAILURE_CAUSE_LIMIT ? cause : `${cause.slice(0, ENGINE_FAILURE_CAUSE_LIMIT - 1)}…`;\n}\n//#endregion\nexport { readEngineFailureCause as a, readDeploymentSummary as i, captureEngineFailure as n, writeDeploymentSummaryFile as o, engineFailureFilePath as r, DEPLOYMENT_RESULT_FILE_ENV as t };\n\n//# sourceMappingURL=deployment-summary-BETZp_5k.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAM,6BAA6B;;AAEnC,SAAS,oBAAoB,QAAQ;CACpC,OAAO;EACN,KAAK,OAAO;EACZ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D;;AAEA,MAAM,aAAa;;AAEnB,MAAM,oBAAoB;AAC1B,MAAM,cAAc;;;;;;;AAOpB,SAAS,mBAAmB,QAAQ,KAAK;CACxC,MAAM,QAAQ,CAAC;CACf,KAAK,MAAM,OAAO,yBAAyB,MAAM,CAAC,CAAC,MAAM,YAAY,GAAG;EACvE,MAAM,QAAQ,IAAI,QAAQ,oBAAoB,EAAE,CAAC,CAAC,QAAQ;EAC1D,MAAM,SAAS,WAAW,KAAK,KAAK;EACpC,MAAM,QAAQ,WAAW,OAAO,QAAQ,MAAM,MAAM,OAAO,EAAE,CAAC,MAAM,EAAA,CAAG,KAAK;EAC5E,IAAI,KAAK,WAAW,KAAK,SAAS,OAAO,SAAS,OAAO,YAAY,KAAK,IAAI,GAAG;EACjF,MAAM,QAAQ,SAAS;EACvB,MAAM,UAAU,UAAU,WAAW,UAAU,WAAW,kBAAkB,KAAK,IAAI,KAAK,cAAc,KAAK,IAAI;EACjH,MAAM,KAAK;GACV;GACA;GACA,MAAM,CAAC,WAAW,UAAU,KAAK;EAClC,CAAC;CACF;CACA,MAAM,QAAQ,MAAM,WAAW,SAAS,KAAK,OAAO;CACpD,MAAM,OAAO,UAAU,KAAK,MAAM,MAAM,EAAE,IAAI,MAAM,MAAM,KAAK,CAAC,CAAC,QAAQ,SAAS,CAAC,KAAK,IAAI;CAC5F,IAAI,KAAK,WAAW,GAAG,OAAO,KAAK;CACnC,MAAM,QAAQ,wBAAwB,KAAK,KAAK,SAAS,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,GAAG,GAAG;CACnF,OAAO,MAAM,UAAU,6BAA6B,QAAQ,GAAG,MAAM,MAAM,GAAG,6BAA6B,CAAC,EAAE;AAC/G"}
|
|
1
|
+
{"version":3,"file":"deployment-summary-D74WrJX7-DQ3LDUuO.mjs","names":["fs"],"sources":["../../../0-framework/3-tooling/cli/dist/deployment-summary-D74WrJX7.mjs"],"sourcesContent":["import { a as redactCredentialLooking } from \"./redaction-DXung4ip.mjs\";\nimport * as fs from \"node:fs\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { format, stripVTControlCharacters } from \"node:util\";\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`. So is the\n* failure cause the child leaves beside it when it exits non-zero.\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/** The child's failure cause rides beside the result file, so the one env var names both and the parent's cleanup removes both. */\nfunction engineFailureFilePath(resultFilePath) {\n\treturn `${resultFilePath}.failure.txt`;\n}\n/** Fits the platform's 5000-character build `errorMessage` with room for the exit-status prefix. */\nconst ENGINE_FAILURE_CAUSE_LIMIT = 1e3;\n/** Alchemy's advice to rerun its own CLI with `--adopt` or to import a resource with adoption, which a Composer user has no way to do. */\nconst ALCHEMY_ADOPT_ADVICE = [\n\t[/Re-run with `--adopt` \\(or wrap the effect in `adopt\\(true\\)`\\) to take it over\\./g, \"Something other than this app holds it. Remove that resource, then deploy again.\"],\n\t[/Re-run with `--adopt` \\(or wrap the effect in `adopt\\(true\\)`\\) to replace it anyway\\./g, \"Remove that resource, then deploy again.\"],\n\t[/\\(re-deploy with --adopt to take ownership, then destroy\\)/g, \"(remove it by hand)\"],\n\t[/Import it with explicit adoption (?:instead of silently taking it over|or choose a different [\\w ]+ name)\\./g, \"Something other than this app holds it. Remove that resource, then deploy again.\"],\n\t[/; rerun with adoption enabled if it is the intended [\\w ]+\\./g, \". Remove that resource, then deploy again.\"]\n];\n/** Replaces Alchemy CLI advice in engine output with steps that work from Composer. */\nfunction withComposerAdvice(text) {\n\treturn ALCHEMY_ADOPT_ADVICE.reduce((current, [advice, replacement]) => current.replace(advice, replacement), text);\n}\nconst STDOUT_CONSOLE_METHODS = /* @__PURE__ */ new Set([\n\t\"log\",\n\t\"info\",\n\t\"debug\"\n]);\n/**\n* Child half of the failure protocol, called by the generated stack file.\n* Keeps a bounded tail of everything this process logs through `console`,\n* passing every call through except Alchemy's CLI advice (see\n* {@link withComposerAdvice}), and on a non-zero exit writes the\n* redacted cause beside the result file. `console`, not the output streams:\n* alchemy's logger and its error reporting both go through it, and under Bun\n* `console` does not reach `process.stdout.write`.\n*\n* When stdout is not a terminal it carries the parent's data lines, so\n* everything this process prints goes to stderr instead.\n*/\nfunction captureEngineFailure() {\n\tconst resultFile = process.env[DEPLOYMENT_RESULT_FILE_ENV];\n\tif (resultFile === void 0 || resultFile.length === 0) return;\n\tconst stdoutToStderr = process.stdout.isTTY !== true;\n\tif (stdoutToStderr) process.stdout.write = process.stderr.write.bind(process.stderr);\n\tlet tail = \"\";\n\tfor (const method of [\n\t\t\"log\",\n\t\t\"info\",\n\t\t\"warn\",\n\t\t\"error\",\n\t\t\"debug\"\n\t]) {\n\t\tconst original = stdoutToStderr && STDOUT_CONSOLE_METHODS.has(method) ? console.error : console[method];\n\t\tconsole[method] = (...args) => {\n\t\t\tconst text = format(...args);\n\t\t\tconst shown = withComposerAdvice(text);\n\t\t\ttail = `${tail}${redactCredentialLooking(shown, process.env)}\\n`.slice(-65536);\n\t\t\tif (shown === text) original.apply(console, args);\n\t\t\telse original.call(console, shown);\n\t\t};\n\t}\n\tprocess.once(\"exit\", (code) => {\n\t\tif (code === 0) return;\n\t\tconst cause = engineFailureCause(tail, process.env);\n\t\tif (cause === void 0) return;\n\t\ttry {\n\t\t\tfs.writeFileSync(engineFailureFilePath(resultFile), cause);\n\t\t} catch {}\n\t});\n}\n/** Parent half: the cause the child recorded, passed through `redact`, or undefined when it recorded none. The child redacts only what its own environment names as a credential; the parent also knows the known secrets. */\nfunction readEngineFailureCause(resultFilePath, redact) {\n\tlet cause;\n\ttry {\n\t\tcause = fs.readFileSync(engineFailureFilePath(resultFilePath), \"utf8\");\n\t} catch {\n\t\treturn;\n\t}\n\treturn cause.length > 0 ? redact(cause) : void 0;\n}\n/** Effect's pretty log prefix, e.g. `[10:29:16.556] INFO (#53): `. */\nconst LOG_PREFIX = /^\\[[\\d:.]+\\] ([A-Z]+) \\(#\\d+\\): ?/;\n/** Alchemy's per-resource failure row, e.g. `[web] fail — UnknownError: …`. */\nconst RESOURCE_FAIL_ROW = /^\\[[^\\]]+\\] fail\\b/;\nconst STACK_FRAME = /^\\s*at /;\n/**\n* The failure the output describes: every line from the first failure line\n* (a failed resource row, an ERROR log, or an `error:` line) to the end, minus\n* blank lines, stack frames and info logs; the last five lines when there is no\n* failure line. Redacted, then capped.\n*/\nfunction engineFailureCause(output, env) {\n\tconst lines = [];\n\tfor (const raw of stripVTControlCharacters(output).split(/\\r\\n|\\r|\\n/)) {\n\t\tconst clean = raw.replace(/(?![\\t])\\p{Cc}/gu, \"\").trimEnd();\n\t\tconst prefix = LOG_PREFIX.exec(clean);\n\t\tconst text = (prefix === null ? clean : clean.slice(prefix[0].length)).trim();\n\t\tif (text.length === 0 || text === \"{\" || text === \"}\" || STACK_FRAME.test(text)) continue;\n\t\tconst level = prefix?.[1];\n\t\tconst failure = level === \"ERROR\" || level === \"FATAL\" || RESOURCE_FAIL_ROW.test(text) || /^\\W*error:/i.test(text);\n\t\tlines.push({\n\t\t\ttext,\n\t\t\tfailure,\n\t\t\tinfo: !failure && level !== void 0\n\t\t});\n\t}\n\tconst start = lines.findIndex((line) => line.failure);\n\tconst kept = start === -1 ? lines.slice(-5) : lines.slice(start).filter((line) => !line.info);\n\tif (kept.length === 0) return void 0;\n\tconst cause = redactCredentialLooking(kept.map((line) => line.text).join(\"\\n\"), env);\n\treturn cause.length <= ENGINE_FAILURE_CAUSE_LIMIT ? cause : `${cause.slice(0, ENGINE_FAILURE_CAUSE_LIMIT - 1)}…`;\n}\n//#endregion\nexport { readEngineFailureCause as a, readDeploymentSummary as i, captureEngineFailure as n, writeDeploymentSummaryFile as o, engineFailureFilePath as r, DEPLOYMENT_RESULT_FILE_ENV as t };\n\n//# sourceMappingURL=deployment-summary-D74WrJX7.mjs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from "./app-config-
|
|
2
|
-
import "./deploy-
|
|
1
|
+
import { g as DeployedEntity } from "./app-config-UeKFBma7-CohaMmWp.mjs";
|
|
2
|
+
import "./deploy-Xi4_JrtE.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-SgniM8TX.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment-summary-p88NV5m5-
|
|
1
|
+
{"version":3,"file":"deployment-summary-p88NV5m5-SgniM8TX.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"}
|