@prisma/composer 0.38.0 → 0.39.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{app-config-lMqqcFA1-DacpRpC4.d.mts → app-config-_XNdvjus-DcCvJysR.d.mts} +76 -24
- package/dist/app-config-_XNdvjus-DcCvJysR.d.mts.map +1 -0
- package/dist/{app-configuration-file-CeJvBAti-D3uDlheX.mjs → app-configuration-file-Cw9autUL-DebaEvDz.mjs} +20 -25
- package/dist/app-configuration-file-Cw9autUL-DebaEvDz.mjs.map +1 -0
- package/dist/arktype.d.mts +1 -1
- package/dist/arktype.mjs +1 -1
- package/dist/arktype.mjs.map +1 -1
- package/dist/config-Czql2X9e.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-C_PZEjcg.mjs} +18 -29
- package/dist/deploy-C_PZEjcg.mjs.map +1 -0
- package/dist/deploy-aDxtc_ck.d.mts +2 -0
- package/dist/deploy.d.mts +4 -4
- package/dist/deploy.mjs +3 -3
- package/dist/{deployment-summary-BiBkPWlB-CyC2pudN.mjs → deployment-summary-B6rYxEZe-E4IIcngK.mjs} +11 -5
- package/dist/deployment-summary-B6rYxEZe-E4IIcngK.mjs.map +1 -0
- package/dist/{deployment-summary-p88NV5m5-Bqd0Uf4H.d.mts → deployment-summary-p88NV5m5-k9oQRopA.d.mts} +3 -3
- package/dist/{deployment-summary-p88NV5m5-Bqd0Uf4H.d.mts.map → deployment-summary-p88NV5m5-k9oQRopA.d.mts.map} +1 -1
- package/dist/{describe-kind-Cpm_euxo-CkhlGJUL.mjs → describe-kind-Cpm_euxo-D9WDxl5C.mjs} +3 -3
- package/dist/describe-kind-Cpm_euxo-D9WDxl5C.mjs.map +1 -0
- package/dist/{dev-current-D-Qb6Yem-Cvy2dWhe.mjs → dev-current-D8GwJQex-BqMILWv-.mjs} +5 -5
- package/dist/{dev-current-D-Qb6Yem-Cvy2dWhe.mjs.map → dev-current-D8GwJQex-BqMILWv-.mjs.map} +1 -1
- package/dist/{dev-environment-name-6eEr5PW8-BwusWVKi.mjs → dev-environment-name-6eEr5PW8-6sPgQZG3.mjs} +2 -2
- package/dist/{dev-environment-name-6eEr5PW8-BwusWVKi.mjs.map → dev-environment-name-6eEr5PW8-6sPgQZG3.mjs.map} +1 -1
- package/dist/{dist-NyTyCEnG.mjs → dist-BN9EXWWX.mjs} +4 -26
- package/dist/dist-BN9EXWWX.mjs.map +1 -0
- package/dist/errors-0e8IVwzi.mjs.map +1 -1
- package/dist/{execute-deploy-destroy-C6EsdmLz-BO5xEJsJ.mjs → execute-deploy-destroy-1SIH5uAu-lMyvQ0el.mjs} +27 -16
- package/dist/execute-deploy-destroy-1SIH5uAu-lMyvQ0el.mjs.map +1 -0
- package/dist/{execute-dev-current-tBKmDAjV-0LnPjGGi.mjs → execute-dev-current-DsAsDBB1-DhnVrBHM.mjs} +6 -6
- package/dist/{execute-dev-current-tBKmDAjV-0LnPjGGi.mjs.map → execute-dev-current-DsAsDBB1-DhnVrBHM.mjs.map} +1 -1
- package/dist/{execute-dev-gjIKYybU-BMpgGLtS.mjs → execute-dev-xPaS5SAl-BTzRomlR.mjs} +88 -20
- package/dist/execute-dev-xPaS5SAl-BTzRomlR.mjs.map +1 -0
- package/dist/{execute-log-c0_dL_Bv-Dq1glmTO.mjs → execute-log-Be9DYRI6-CCRtbIwA.mjs} +6 -6
- package/dist/{execute-log-c0_dL_Bv-Dq1glmTO.mjs.map → execute-log-Be9DYRI6-CCRtbIwA.mjs.map} +1 -1
- package/dist/{graph-D1zpgcLm-YlrEdzUB.d.mts → graph-DU0omY5O-BHO71z0F.d.mts} +3 -3
- package/dist/graph-DU0omY5O-BHO71z0F.d.mts.map +1 -0
- package/dist/{graph-CBt9CRBT-yMupsISb.mjs → graph-K7VOpCAj-D6UHSltu.mjs} +141 -101
- package/dist/graph-K7VOpCAj-D6UHSltu.mjs.map +1 -0
- package/dist/{graph-types-BiFZrE06-D6vaGxXz.d.mts → graph-types-Bzj1fahC-C8rOVj0c.d.mts} +96 -89
- package/dist/graph-types-Bzj1fahC-C8rOVj0c.d.mts.map +1 -0
- package/dist/http.d.mts +2 -2
- package/dist/http.mjs +2 -2
- package/dist/{index-CMklpG87.d.mts → index-B8s0bLZY.d.mts} +3 -3
- package/dist/{index-CMklpG87.d.mts.map → index-B8s0bLZY.d.mts.map} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +4 -4
- package/dist/internal-app-configuration-file.d.mts +8 -7
- package/dist/internal-app-configuration-file.d.mts.map +1 -1
- package/dist/internal-app-configuration-file.mjs +1 -1
- package/dist/{local-target-Dd8FJEb5.mjs → local-target-COdS1iNs.mjs} +3 -3
- package/dist/{local-target-Dd8FJEb5.mjs.map → local-target-COdS1iNs.mjs.map} +1 -1
- package/dist/local-target.d.mts +3 -3
- package/dist/local-target.d.mts.map +1 -1
- package/dist/local-target.mjs +1 -1
- package/dist/{nextjs-DLyeRR7M-RqgYxqhI.d.mts → nextjs-DLyeRR7M-Z_xX74Cp.d.mts} +3 -3
- package/dist/{nextjs-DLyeRR7M-RqgYxqhI.d.mts.map → nextjs-DLyeRR7M-Z_xX74Cp.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/{pointer-CyQZZugO-D7k3vibs.d.mts → pointer-DclJZFQi-DJa4t8Wa.d.mts} +3 -3
- package/dist/{pointer-CyQZZugO-D7k3vibs.d.mts.map → pointer-DclJZFQi-DJa4t8Wa.d.mts.map} +1 -1
- package/dist/preflight-transport-DJjTWvyH-CEJ9WlaN.mjs +125 -0
- package/dist/preflight-transport-DJjTWvyH-CEJ9WlaN.mjs.map +1 -0
- package/dist/{redaction-HnbkSFrK-BXRZ3B33.mjs → redaction-C-NnlVUh-B1nJc6rb.mjs} +26 -5
- package/dist/redaction-C-NnlVUh-B1nJc6rb.mjs.map +1 -0
- package/dist/{redaction-Bf8FvTFH-pjMN5nIB.d.mts → redaction-CqdeMBKw-BAOFeUYp.d.mts} +15 -8
- package/dist/{redaction-Bf8FvTFH-pjMN5nIB.d.mts.map → redaction-CqdeMBKw-BAOFeUYp.d.mts.map} +1 -1
- 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-CyciV8i0-BxPAyrch.mjs} +3 -3
- package/dist/{run-alchemy-OS_ix5g0-DCvUYZ7T.mjs.map → run-alchemy-CyciV8i0-BxPAyrch.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-DyW59rJ7-DTFBmAno.mjs} +16 -7
- package/dist/validate-environment-DyW59rJ7-DTFBmAno.mjs.map +1 -0
- package/dist/zod.d.mts +1 -1
- package/dist/zod.mjs +1 -1
- package/dist/zod.mjs.map +1 -1
- package/package.json +13 -13
- package/skills/prisma-composer-core-concepts/SKILL.md +44 -50
- package/dist/app-config-lMqqcFA1-DacpRpC4.d.mts.map +0 -1
- package/dist/app-configuration-file-CeJvBAti-D3uDlheX.mjs.map +0 -1
- package/dist/config-BFuriECI.mjs +0 -39
- package/dist/config-BFuriECI.mjs.map +0 -1
- package/dist/config-Bpbj7Riz.d.mts +0 -1
- package/dist/container-transport-HcvNOGZL-twPi2TIv.mjs +0 -49
- package/dist/container-transport-HcvNOGZL-twPi2TIv.mjs.map +0 -1
- package/dist/deploy-DergV8De.mjs.map +0 -1
- package/dist/deploy-Dh_I6YLS.d.mts +0 -2
- package/dist/deployment-summary-BiBkPWlB-CyC2pudN.mjs.map +0 -1
- package/dist/describe-kind-Cpm_euxo-CkhlGJUL.mjs.map +0 -1
- package/dist/dist-NyTyCEnG.mjs.map +0 -1
- package/dist/execute-deploy-destroy-C6EsdmLz-BO5xEJsJ.mjs.map +0 -1
- package/dist/execute-dev-gjIKYybU-BMpgGLtS.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/graph-types-BiFZrE06-D6vaGxXz.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-Bzj1fahC-C8rOVj0c.mjs";
|
|
2
|
+
import "./graph-DU0omY5O-BHO71z0F.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-_XNdvjus.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,34 @@ 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, or a resource no service reads. */
|
|
103
|
+
type PlatformVariableReader = {
|
|
104
|
+
readonly kind: 'field';
|
|
105
|
+
readonly service: string;
|
|
106
|
+
readonly path: string;
|
|
107
|
+
} | {
|
|
108
|
+
readonly kind: 'unread';
|
|
109
|
+
readonly node: string;
|
|
110
|
+
};
|
|
111
|
+
/** A platform variable with no value that nothing requires, with its readers and the commands that set it. */
|
|
112
|
+
interface UnsetPlatformVariable {
|
|
113
|
+
readonly name: string;
|
|
114
|
+
readonly readers: readonly PlatformVariableReader[];
|
|
115
|
+
/** Shell commands that each set it, in the order to offer them. */
|
|
116
|
+
readonly commands: readonly string[];
|
|
117
|
+
}
|
|
118
|
+
/** What a deploy preflight found that does not stop the deploy. Names and readers only, never a value. */
|
|
119
|
+
interface PreflightFindings {
|
|
120
|
+
readonly unset: readonly UnsetPlatformVariable[];
|
|
121
|
+
}
|
|
122
|
+
/** One reader as the deploy prints it, for example `read by service "shop.email", field "apiKey"`. */
|
|
123
|
+
declare function platformVariableReaderText(reader: PlatformVariableReader): string;
|
|
124
|
+
/** 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. */
|
|
125
|
+
declare const PREFLIGHT_FINDINGS_ENV_VAR = "PRISMA_COMPOSER_PREFLIGHT_FINDINGS";
|
|
126
|
+
/** 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. */
|
|
127
|
+
declare function preflightFindingsEnv(findings: PreflightFindings): Record<string, string>;
|
|
128
|
+
/** 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. */
|
|
129
|
+
declare function readPreflightFindings(env: Readonly<Record<string, string | undefined>>): PreflightFindings;
|
|
102
130
|
//#endregion
|
|
103
131
|
//#region src/control/deploy.d.ts
|
|
104
132
|
/** The Layer shape every Alchemy state store must satisfy — what `LowerOptions.state` and `PrismaAppConfig.state` both traffic in. */
|
|
@@ -263,13 +291,15 @@ interface DeployedNode {
|
|
|
263
291
|
interface DeploymentResult {
|
|
264
292
|
readonly app: string;
|
|
265
293
|
readonly nodes: readonly DeployedNode[];
|
|
294
|
+
/** What every extension's deploy preflight found that did not stop the deploy. */
|
|
295
|
+
readonly findings: PreflightFindings;
|
|
266
296
|
}
|
|
267
297
|
interface LowerOptions {
|
|
268
298
|
/** Stack + root node id. */
|
|
269
299
|
readonly name: string;
|
|
270
300
|
/** The environment being deployed, as `--environment` gave it. Required by any value over `environment.name`; the generated stack files always pass it. */
|
|
271
301
|
readonly environment?: string;
|
|
272
|
-
/** What the first process's Load read from the app configuration (ADR-0062), from the app configuration file. Load takes the root's input
|
|
302
|
+
/** What the first process's Load read from the app configuration (ADR-0062), from the app configuration file. Load takes the root's input from it. The generated stack files pass it. */
|
|
273
303
|
readonly appConfigurationRead?: AppConfigurationRead;
|
|
274
304
|
/** The node addresses of the graph the first process built. When given, lowering refuses a graph whose addresses differ. The generated stack files pass them. */
|
|
275
305
|
readonly firstProcessNodeAddresses?: readonly string[];
|
|
@@ -378,6 +408,11 @@ declare function joinDeployment(graph: Graph, entries: readonly {
|
|
|
378
408
|
address: string;
|
|
379
409
|
entities: readonly DeployedEntity[];
|
|
380
410
|
}[]): readonly DeployedNode[];
|
|
411
|
+
/** The deploy report: every deployed node joined with its graph node, and the findings the CLI carried from the deploy preflight. */
|
|
412
|
+
declare function deploymentResult(app: string, graph: Graph, entries: readonly {
|
|
413
|
+
address: string;
|
|
414
|
+
entities: readonly DeployedEntity[];
|
|
415
|
+
}[], findings: PreflightFindings): DeploymentResult;
|
|
381
416
|
/**
|
|
382
417
|
* The state-layer precedence a deploy resolves to: an explicit opts.state
|
|
383
418
|
* always wins; failing that, the config's own (required) state descriptor,
|
|
@@ -402,9 +437,7 @@ declare function lowering(root: ModuleNode | AppRootNode, config: PrismaAppConfi
|
|
|
402
437
|
* extension registries → an Alchemy Stack (the default export the alchemy
|
|
403
438
|
* CLI consumes).
|
|
404
439
|
*/
|
|
405
|
-
declare function lower(root: ModuleNode | AppRootNode, config: PrismaAppConfig, opts: LowerOptions):
|
|
406
|
-
readonly stackName: string;
|
|
407
|
-
} & Alchemy.StackProps<never>;
|
|
440
|
+
declare function lower(root: ModuleNode | AppRootNode, config: PrismaAppConfig, opts: LowerOptions): Alchemy.ConfiguredStack<undefined, never>;
|
|
408
441
|
//#endregion
|
|
409
442
|
//#region src/control/app-config.d.ts
|
|
410
443
|
/**
|
|
@@ -423,19 +456,22 @@ interface ExtensionDescriptor {
|
|
|
423
456
|
readonly application?: ApplicationDescriptor;
|
|
424
457
|
/** The extension's Alchemy providers — merged across all configured extensions (config order). */
|
|
425
458
|
readonly providers?: () => Layer.Layer<never>;
|
|
459
|
+
/** 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. */
|
|
460
|
+
readonly checkGraph?: (graph: Graph) => void;
|
|
426
461
|
/**
|
|
427
462
|
* Deploy-time prerequisite check — the CLI runs it once, after the app's
|
|
428
463
|
* Project/Branch are resolved and BEFORE any stack file is written or Alchemy
|
|
429
464
|
* runs. A target uses it to verify platform prerequisites (e.g. that every
|
|
430
|
-
*
|
|
431
|
-
*
|
|
465
|
+
* platform variable a service needs has a value) and throws to abort the
|
|
466
|
+
* deploy. Async: it talks to the platform (ADR-0064).
|
|
432
467
|
*
|
|
433
468
|
* What it returns is carried to the alchemy process for this same extension
|
|
434
469
|
* to read back there (preflight-transport.ts) — preflight runs in the CLI
|
|
435
470
|
* parent, and the alchemy child re-imports the config from scratch, so
|
|
436
471
|
* anything the lowering needs from it must ride that transport. The payload
|
|
437
472
|
* is the extension's own opaque string; the framework never reads it, and a
|
|
438
|
-
* secret value must never go in it.
|
|
473
|
+
* secret value must never go in it. What it hands `input.report` reaches the
|
|
474
|
+
* deploy report through the framework's own transport, not this payload.
|
|
439
475
|
*
|
|
440
476
|
* METHOD SYNTAX REQUIRED, for the same reason ContainerDescriptor's members
|
|
441
477
|
* need it: the framework hands over the erased `PreflightInput<unknown>`,
|
|
@@ -498,17 +534,21 @@ interface PreflightInput<C = unknown> {
|
|
|
498
534
|
readonly container: ContainerInstance | undefined;
|
|
499
535
|
/** The environment name. */
|
|
500
536
|
readonly environment: string;
|
|
501
|
-
/** The app configuration the command read for this environment.
|
|
537
|
+
/** The app configuration the command read for this environment. */
|
|
502
538
|
readonly configuration: AppConfiguration;
|
|
503
|
-
/** The app secrets the command read for this environment.
|
|
539
|
+
/** The app secrets the command read for this environment. */
|
|
504
540
|
readonly secrets: AppSecrets;
|
|
505
541
|
/** What the caller has already authenticated, for the platform calls preflight makes. Absent means the extension falls back to its own credential protocol. */
|
|
506
542
|
readonly credentials?: ContainerCredentials<C> | undefined;
|
|
507
|
-
/** Hands the deploy
|
|
508
|
-
readonly report?: ((
|
|
543
|
+
/** Hands the deploy how many platform variables the check read and which have no value. */
|
|
544
|
+
readonly report?: ((check: PlatformVariableCheck) => void) | undefined;
|
|
509
545
|
/** Shows the user a warning that does not stop the run. Only `prisma dev` passes it and shows the warnings; deploy passes none. */
|
|
510
546
|
readonly warn?: ((message: string) => void) | undefined;
|
|
511
547
|
}
|
|
548
|
+
/** What a deploy preflight's check of platform variables found: how many it read, and the ones with no value that nothing requires. */
|
|
549
|
+
interface PlatformVariableCheck extends PreflightFindings {
|
|
550
|
+
readonly checked: number;
|
|
551
|
+
}
|
|
512
552
|
/** The resolved destroy context handed to an extension's `teardown` hook. */
|
|
513
553
|
interface TeardownInput {
|
|
514
554
|
/** The calling extension's own resolved container; `undefined` when it declares no container descriptor. Narrow with the extension's guard. */
|
|
@@ -611,8 +651,8 @@ interface LocalTargetDescriptor {
|
|
|
611
651
|
providers(input: LocalTargetProvidersInput): Layer.Layer<never>;
|
|
612
652
|
/** A stable local identity — resolved without any platform call. */
|
|
613
653
|
readonly container: ContainerDescriptor;
|
|
614
|
-
/**
|
|
615
|
-
preflight?(input: PreflightInput): Promise<
|
|
654
|
+
/** Works out the platform variables' values, where deploy's preflight runs. Its payload reaches the alchemy process the same way deploy's preflight payload does. */
|
|
655
|
+
preflight?(input: PreflightInput): Promise<DevPreflightResult>;
|
|
616
656
|
/** Ensure the emulator daemons this topology's node kinds need are running, plus any per-node emulator state that must exist before converge (idempotent; daemons persist across sessions). */
|
|
617
657
|
emulators?(input: LocalTargetEmulatorsInput): Promise<void>;
|
|
618
658
|
/** The dev session's view of the running app. Core renders it and never learns an emulator's API. */
|
|
@@ -627,6 +667,12 @@ interface LocalTargetDescriptor {
|
|
|
627
667
|
*/
|
|
628
668
|
current?(input: LocalTargetCurrentInput): Promise<LocalTargetCurrentApp | undefined>;
|
|
629
669
|
}
|
|
670
|
+
/** What a local target's preflight found. */
|
|
671
|
+
interface DevPreflightResult {
|
|
672
|
+
readonly payload: PreflightPayload;
|
|
673
|
+
/** The text of each plain platform variable a service reads, by name. Never a secret. */
|
|
674
|
+
readonly plainVariableText: Readonly<Record<string, string>>;
|
|
675
|
+
}
|
|
630
676
|
interface LocalTargetCurrentInput {
|
|
631
677
|
/** Absolute path of the environment's dev state directory (`devEnvironmentDir`, under the cwd). */
|
|
632
678
|
readonly devDir: string;
|
|
@@ -679,9 +725,9 @@ interface LocalTargetProvidersInput {
|
|
|
679
725
|
readonly container: ContainerInstance | undefined;
|
|
680
726
|
/** Absolute path of the environment's dev state directory (`devEnvironmentDir`, under the cwd). */
|
|
681
727
|
readonly devDir: string;
|
|
682
|
-
/** The text of each
|
|
683
|
-
readonly
|
|
684
|
-
/** The app secrets the graph's
|
|
728
|
+
/** The text of each plain platform variable a service reads, by name. Never a secret. */
|
|
729
|
+
readonly plainVariableText: Readonly<Record<string, string>>;
|
|
730
|
+
/** The app secrets the graph's platform secrets name, which the first process handed the second. A local deployment takes the text its secret `$platform` markers name from it. */
|
|
685
731
|
readonly namedSecrets: NamedSecrets;
|
|
686
732
|
}
|
|
687
733
|
interface LocalTargetEmulatorsInput {
|
|
@@ -731,6 +777,12 @@ interface LocalTargetAttachment {
|
|
|
731
777
|
}>;
|
|
732
778
|
/** Stop everything the target runs for the app, so nothing of it keeps running after the session (emulators and data persist). */
|
|
733
779
|
stopApp(): Promise<void>;
|
|
780
|
+
/**
|
|
781
|
+
* Does what `stopApp()` does and returns only once it is done, without the event loop: for a
|
|
782
|
+
* process that is exiting and cannot await. Optional: without it, an exit that interrupts
|
|
783
|
+
* `stopApp()` leaves the app running.
|
|
784
|
+
*/
|
|
785
|
+
stopAppBeforeExit?(): void;
|
|
734
786
|
}
|
|
735
787
|
/** `<cwd>/.prisma-composer/dev` — local dev's state directory (ADR-0041, ADR-0004's tool-state rule), holding one folder per environment. */
|
|
736
788
|
declare const DEV_DIR = ".prisma-composer/dev";
|
|
@@ -784,11 +836,11 @@ interface ConfigAdapterInput {
|
|
|
784
836
|
type ConfigValues = Readonly<Record<string, unknown>>;
|
|
785
837
|
/** A function in the `config` or `secrets` list of the `composer` section (ADR-0062): it receives the environment and returns that environment's values. Only the command's first process calls it; the second process reads what the first read from the app configuration file. */
|
|
786
838
|
type ConfigAdapter = (input: ConfigAdapterInput) => ConfigValues | Promise<ConfigValues>;
|
|
787
|
-
/** 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
|
|
839
|
+
/** 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 under `prisma dev` it also holds the text of each plain platform variable. */
|
|
788
840
|
type AppConfiguration = Readonly<Record<string, unknown>>;
|
|
789
|
-
/** The app secrets (ADR-0062): what the `secrets` adapters return, merged the same way. Every value is text.
|
|
841
|
+
/** 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. */
|
|
790
842
|
type AppSecrets = Readonly<Record<string, string>>;
|
|
791
|
-
/** The app secrets
|
|
843
|
+
/** 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`. */
|
|
792
844
|
type NamedSecrets = Readonly<Record<string, string>>;
|
|
793
845
|
/**
|
|
794
846
|
* The config file's default export. `extensions` lists every extension the
|
|
@@ -809,5 +861,5 @@ interface PrismaAppConfig {
|
|
|
809
861
|
/** Typed identity — exists so the `composer` section of `prisma.config.ts` gets checked against PrismaAppConfig where it is written. */
|
|
810
862
|
declare function defineConfig(config: PrismaAppConfig): PrismaAppConfig;
|
|
811
863
|
//#endregion
|
|
812
|
-
export {
|
|
813
|
-
//# sourceMappingURL=app-config-
|
|
864
|
+
export { ReporterDescriptor as $, LocalTargetEmulatorsInput as A, Outputs as B, LocalNodeLocation as C, preflightFindingsEnv as Ct, LocalTargetCurrentApp as D, LocalTargetAttachment as E, resolveStateLayer as Et, LowerOptions as F, PreflightFindings as G, PackageInput as H, LoweredResult as I, PrismaAppConfig as J, PreflightInput as K, Lowering as L, LocateContainerInput as M, LowerContext as N, LocalTargetCurrentInput as O, LowerError as P, ReportBeginInput as Q, NamedSecrets as R, LocalNodeCondition as S, preflightEnvVarName as St, LocalTargetAttachInput as T, readPreflightPayload as Tt, PlatformVariableCheck as U, PREFLIGHT_FINDINGS_ENV_VAR as V, PlatformVariableReader as W, ProvisionerDescriptor as X, ProvisionEdge as Y, ReportAttachInput as Z, DeployedNode as _, lower as _t, Artifact as a, TeardownInput as at, DevServer as b, platformVariableReaderText as bt, ConfigAdapter as c, connectionInputs as ct, ContainerCredentials as d, defineConfig as dt, RunOutcome as et, ContainerDescriptor as f, deploymentResult as ft, DeployedEntity as g, joinDeployment as gt, DEV_ENVIRONMENT_NAME_FILE as h, isBuildOnlyExtension as ht, ApplicationDescriptor as i, StateDescriptor as it, LocalTargetProvidersInput as j, LocalTargetDescriptor as k, ConfigAdapterInput as l, containerEnv as lt, DEV_DIR as m, devEnvironmentDir as mt, AppConfiguration as n, ServeInput as nt, AssembleInput as o, UnsetPlatformVariable as ot, ContainerInstance as p, deserializeContainers as pt, PreflightPayload as q, AppSecrets as r, ServiceLowering as rt, Bundle as s, buildConfig as st, AlchemyStateLayer as t, RunReporter as tt, ConfigValues as u, containerEnvVarName as ut, DeploymentResult as v, lowering as vt, LocalNodeStopped as w, readPreflightFindings as wt, ExtensionDescriptor as x, preflightEnv as xt, DevPreflightResult as y, mergedProviders as yt, NodeDescriptor as z };
|
|
865
|
+
//# sourceMappingURL=app-config-_XNdvjus-DcCvJysR.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-config-_XNdvjus-DcCvJysR.d.mts","names":[],"sources":["../../../0-framework/1-core/core/dist/app-config-_XNdvjus.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;WACA;WACA;;WAEA;WACA;;;UAGD;WACC;WACA,kBAAkB;;WAElB;;;UAGD;WACC,gBAAgB;;;iBAGV,2BAA2B,QAAQ;;cAEtC;;iBAEG,qBAA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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"}
|
|
@@ -2,7 +2,7 @@ import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
|
|
|
2
2
|
import { t as DEV_DIR } from "./app-config-CErnR6NK-D9NgSBH4.mjs";
|
|
3
3
|
import * as path$1 from "node:path";
|
|
4
4
|
import * as fs$1 from "node:fs";
|
|
5
|
-
//#region ../../0-framework/3-tooling/cli/dist/app-configuration-file-
|
|
5
|
+
//#region ../../0-framework/3-tooling/cli/dist/app-configuration-file-Cw9autUL.mjs
|
|
6
6
|
/** Names the app configuration file the first process wrote for this run (ADR-0062). */
|
|
7
7
|
const APP_CONFIGURATION_FILE_ENV = "PRISMA_COMPOSER_APP_CONFIGURATION_FILE";
|
|
8
8
|
/** `prisma dev` only: the named secrets, as a JSON object. */
|
|
@@ -72,35 +72,32 @@ function textIn(value, at) {
|
|
|
72
72
|
* compared as its text (`KnownSecrets.nameIn`). The message names where and the secrets key,
|
|
73
73
|
* never the value.
|
|
74
74
|
*/
|
|
75
|
-
function refuseSecretsIn(read, knownSecrets) {
|
|
76
|
-
const
|
|
75
|
+
function refuseSecretsIn(read, plainVariableText, knownSecrets) {
|
|
76
|
+
const readPlaces = read.rootInput.flatMap((field) => textIn(field.value, field.path).map(({ at, text }) => ({
|
|
77
77
|
where: `Root input field input.${at.join(".")}`,
|
|
78
78
|
text
|
|
79
|
-
})))
|
|
80
|
-
|
|
81
|
-
text
|
|
82
|
-
}))];
|
|
83
|
-
for (const { where, text } of places) {
|
|
79
|
+
})));
|
|
80
|
+
for (const { where, text } of readPlaces) {
|
|
84
81
|
const name = knownSecrets.nameIn(text);
|
|
85
82
|
if (name === void 0) continue;
|
|
86
|
-
throw new CliStructuredError("CONFIG.SECRET_AS_PLAIN_VALUE", `${where} holds the value of the secret "${name}", which
|
|
83
|
+
throw new CliStructuredError("CONFIG.SECRET_AS_PLAIN_VALUE", `${where} holds the value of the secret "${name}", which a platform secret in the graph reads. Composer hands the second process every plain value Load read, in a file, and never writes a secret to a file.`, { fix: `Pass the value of the platform secret "${name}" to where this value is used, or give this plain value text that does not contain the value of "${name}".` });
|
|
84
|
+
}
|
|
85
|
+
for (const [variable, text] of Object.entries(plainVariableText)) {
|
|
86
|
+
const name = knownSecrets.nameIn(text);
|
|
87
|
+
if (name === void 0) continue;
|
|
88
|
+
throw new CliStructuredError("CONFIG.SECRET_AS_PLAIN_VALUE", `The platform variable "${variable}", which prisma dev read from the \`config\` adapters, holds the value of the secret "${name}". Composer hands the second process every plain value in a file, and never writes a secret to a file.`, { fix: `Keep the value of "${name}" out of the platform variable "${variable}", or give "${variable}" a different value.` });
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
91
|
/**
|
|
90
|
-
* First process: the
|
|
91
|
-
*
|
|
92
|
-
* `prisma dev` passes, the environment also carries the named secrets: the app secrets under
|
|
93
|
-
* the graph's secrets keys, each with text. Refuses when the file would hold any of
|
|
94
|
-
* `knownSecrets`. Every other input is plain data from the graph, such as
|
|
95
|
-
* `graph.appConfigurationRead`, `nodeAddresses(graph)` and `secretsKeys(graph)`, so a caller with
|
|
96
|
-
* its own copy of Composer's core can pass them. The exception is `knownSecrets`, a
|
|
97
|
-
* `KnownSecrets`, which such a caller builds from the testing entry.
|
|
92
|
+
* First process: the app configuration file and the environment the second process starts with (ADR-0062).
|
|
93
|
+
* Refuses a file that would hold any of `knownSecrets`.
|
|
98
94
|
*/
|
|
99
95
|
function prepareSecondProcess(input) {
|
|
100
96
|
const { file, appSecrets } = input;
|
|
101
|
-
refuseSecretsIn(input.appConfigurationRead, input.knownSecrets);
|
|
97
|
+
refuseSecretsIn(input.appConfigurationRead, input.plainVariableText, input.knownSecrets);
|
|
102
98
|
const contents = {
|
|
103
99
|
appConfigurationRead: input.appConfigurationRead,
|
|
100
|
+
plainVariableText: input.plainVariableText,
|
|
104
101
|
nodeAddresses: input.nodeAddresses
|
|
105
102
|
};
|
|
106
103
|
const env = { [APP_CONFIGURATION_FILE_ENV]: file };
|
|
@@ -187,15 +184,13 @@ function readAppConfigurationFile(env) {
|
|
|
187
184
|
if (!isRecord(read)) throw notComposers("appConfigurationRead is not an object");
|
|
188
185
|
const rootInput = rootFieldsOf(read["rootInput"]);
|
|
189
186
|
if (rootInput === void 0) throw notComposers("rootInput is not a list of fields");
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
187
|
+
const plainVariableText = textByKeyOf(parsed["plainVariableText"]);
|
|
188
|
+
if (plainVariableText === void 0) throw notComposers("plainVariableText is not an object of text");
|
|
192
189
|
const addresses = parsed["nodeAddresses"];
|
|
193
190
|
if (!isTextList(addresses)) throw notComposers("nodeAddresses is not a list of node addresses");
|
|
194
191
|
return {
|
|
195
|
-
appConfigurationRead: {
|
|
196
|
-
|
|
197
|
-
configurationKeyText
|
|
198
|
-
},
|
|
192
|
+
appConfigurationRead: { rootInput },
|
|
193
|
+
plainVariableText,
|
|
199
194
|
nodeAddresses: addresses
|
|
200
195
|
};
|
|
201
196
|
}
|
|
@@ -218,4 +213,4 @@ function namedSecretsFromEnvironment(env) {
|
|
|
218
213
|
//#endregion
|
|
219
214
|
export { readAppConfigurationFile as a, prepareSecondProcess as i, devAppConfigurationFile as n, removeLeftoverAppConfigurationFiles as o, namedSecretsFromEnvironment as r, deployAppConfigurationFile as t };
|
|
220
215
|
|
|
221
|
-
//# sourceMappingURL=app-configuration-file-
|
|
216
|
+
//# sourceMappingURL=app-configuration-file-Cw9autUL-DebaEvDz.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-configuration-file-Cw9autUL-DebaEvDz.mjs","names":["path","fs"],"sources":["../../../0-framework/3-tooling/cli/dist/app-configuration-file-Cw9autUL.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { DEV_DIR } from \"@internal/core/config\";\n//#region src/app-configuration-file.ts\n/** Names the app configuration file the first process wrote for this run (ADR-0062). */\nconst APP_CONFIGURATION_FILE_ENV = \"PRISMA_COMPOSER_APP_CONFIGURATION_FILE\";\n/** `prisma dev` only: the named secrets, as a JSON object. */\nconst NAMED_SECRETS_ENV = \"PRISMA_COMPOSER_NAMED_SECRETS\";\nconst FILE_NAME = /^app-configuration-(\\d+)(-[^/]*)?\\.json$/;\n/** The app configuration file a deploy or destroy run writes: unique per run, so concurrent runs from one checkout never share one. */\nfunction deployAppConfigurationFile(cwd, runId) {\n\treturn path.join(cwd, \".prisma-composer\", `app-configuration-${String(process.pid)}-${runId}.json`);\n}\n/** The app configuration file `prisma dev` writes in an environment's folder. */\nfunction devAppConfigurationFile(devDir) {\n\treturn path.join(devDir, `app-configuration-${String(process.pid)}.json`);\n}\nfunction isRunning(pid) {\n\ttry {\n\t\tprocess.kill(pid, 0);\n\t\treturn true;\n\t} catch (error) {\n\t\treturn error instanceof Error && \"code\" in error && error.code === \"EPERM\";\n\t}\n}\n/**\n* Deletes the app configuration files that earlier runs left in `.prisma-composer/` and in\n* each dev environment's folder: a run killed before its exit handler ran leaves its file. A\n* file is deleted only when its process is not running and it is older than\n* `LEFTOVER_APP_CONFIGURATION_FILE_AGE_MS`. Never throws.\n*/\nfunction removeLeftoverAppConfigurationFiles(cwd) {\n\tconst devRoot = path.join(cwd, DEV_DIR);\n\tconst dirs = [path.join(cwd, \".prisma-composer\")];\n\ttry {\n\t\tfor (const entry of fs.readdirSync(devRoot, { withFileTypes: true })) if (entry.isDirectory()) dirs.push(path.join(devRoot, entry.name));\n\t} catch {}\n\tfor (const dir of dirs) {\n\t\tlet names;\n\t\ttry {\n\t\t\tnames = fs.readdirSync(dir);\n\t\t} catch {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const name of names) {\n\t\t\tconst pid = Number(FILE_NAME.exec(name)?.[1]);\n\t\t\tif (Number.isNaN(pid) || pid === process.pid || isRunning(pid)) continue;\n\t\t\tconst file = path.join(dir, name);\n\t\t\ttry {\n\t\t\t\tif (Date.now() - fs.statSync(file).mtimeMs < 6e5) continue;\n\t\t\t\tfs.rmSync(file, { force: true });\n\t\t\t} catch {}\n\t\t}\n\t}\n}\nfunction textIn(value, at) {\n\tif (typeof value === \"string\") return [{\n\t\tat,\n\t\ttext: value\n\t}];\n\tif (typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"bigint\") return [{\n\t\tat,\n\t\ttext: String(value)\n\t}];\n\tif (Array.isArray(value)) return value.flatMap((member, index) => textIn(member, [...at, String(index)]));\n\tif (typeof value === \"object\" && value !== null) return Object.entries(value).flatMap(([key, member]) => textIn(member, [...at, key]));\n\treturn [];\n}\n/**\n* Refuses when the file would hold a known secret in a plain value, a number or a boolean\n* compared as its text (`KnownSecrets.nameIn`). The message names where and the secrets key,\n* never the value.\n*/\nfunction refuseSecretsIn(read, plainVariableText, knownSecrets) {\n\tconst readPlaces = read.rootInput.flatMap((field) => textIn(field.value, field.path).map(({ at, text }) => ({\n\t\twhere: `Root input field input.${at.join(\".\")}`,\n\t\ttext\n\t})));\n\tfor (const { where, text } of readPlaces) {\n\t\tconst name = knownSecrets.nameIn(text);\n\t\tif (name === void 0) continue;\n\t\tthrow new CliStructuredError(\"CONFIG.SECRET_AS_PLAIN_VALUE\", `${where} holds the value of the secret \"${name}\", which a platform secret in the graph reads. Composer hands the second process every plain value Load read, in a file, and never writes a secret to a file.`, { fix: `Pass the value of the platform secret \"${name}\" to where this value is used, or give this plain value text that does not contain the value of \"${name}\".` });\n\t}\n\tfor (const [variable, text] of Object.entries(plainVariableText)) {\n\t\tconst name = knownSecrets.nameIn(text);\n\t\tif (name === void 0) continue;\n\t\tthrow new CliStructuredError(\"CONFIG.SECRET_AS_PLAIN_VALUE\", `The platform variable \"${variable}\", which prisma dev read from the \\`config\\` adapters, holds the value of the secret \"${name}\". Composer hands the second process every plain value in a file, and never writes a secret to a file.`, { fix: `Keep the value of \"${name}\" out of the platform variable \"${variable}\", or give \"${variable}\" a different value.` });\n\t}\n}\n/**\n* First process: the app configuration file and the environment the second process starts with (ADR-0062).\n* Refuses a file that would hold any of `knownSecrets`.\n*/\nfunction prepareSecondProcess(input) {\n\tconst { file, appSecrets } = input;\n\trefuseSecretsIn(input.appConfigurationRead, input.plainVariableText, input.knownSecrets);\n\tconst contents = {\n\t\tappConfigurationRead: input.appConfigurationRead,\n\t\tplainVariableText: input.plainVariableText,\n\t\tnodeAddresses: input.nodeAddresses\n\t};\n\tconst env = { [APP_CONFIGURATION_FILE_ENV]: file };\n\tif (appSecrets !== void 0) {\n\t\tconst named = {};\n\t\tfor (const key of input.secretsKeys) {\n\t\t\tconst text = appSecrets[key];\n\t\t\tif (text !== void 0 && text !== \"\") named[key] = text;\n\t\t}\n\t\tenv[NAMED_SECRETS_ENV] = JSON.stringify(named);\n\t}\n\tconst remove = () => {\n\t\ttry {\n\t\t\tfs.rmSync(file, { force: true });\n\t\t} catch {}\n\t};\n\treturn {\n\t\tenv,\n\t\twriteFile() {\n\t\t\tfs.rmSync(file, { force: true });\n\t\t\tfs.writeFileSync(file, JSON.stringify(contents), {\n\t\t\t\tmode: 384,\n\t\t\t\tflag: \"wx\"\n\t\t\t});\n\t\t\tprocess.off(\"exit\", remove);\n\t\t\tprocess.on(\"exit\", remove);\n\t\t},\n\t\tremoveFile() {\n\t\t\tprocess.off(\"exit\", remove);\n\t\t\tremove();\n\t\t}\n\t};\n}\nfunction missingVariable(name, what) {\n\treturn `${name} is not set. This stack file runs as the second process of a Composer deploy, destroy or prisma dev, which ${what}.`;\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction isTextList(value) {\n\treturn Array.isArray(value) && value.every((member) => typeof member === \"string\");\n}\nfunction rootFieldsOf(value) {\n\tif (!Array.isArray(value)) return void 0;\n\tconst fields = [];\n\tfor (const member of value) {\n\t\tif (!isRecord(member) || !isTextList(member[\"path\"])) return void 0;\n\t\tfields.push(\"value\" in member ? {\n\t\t\tpath: member[\"path\"],\n\t\t\tvalue: member[\"value\"]\n\t\t} : { path: member[\"path\"] });\n\t}\n\treturn fields;\n}\nfunction textByKeyOf(value) {\n\tif (!isRecord(value)) return void 0;\n\tconst byKey = {};\n\tfor (const [key, member] of Object.entries(value)) {\n\t\tif (typeof member !== \"string\") return void 0;\n\t\tbyKey[key] = member;\n\t}\n\treturn byKey;\n}\n/** Second process: the app configuration file the first process named in its environment. */\nfunction readAppConfigurationFile(env) {\n\tconst file = env[APP_CONFIGURATION_FILE_ENV];\n\tif (file === void 0 || file === \"\") throw new Error(missingVariable(APP_CONFIGURATION_FILE_ENV, \"names the app configuration file it wrote there\"));\n\tlet text;\n\ttry {\n\t\ttext = fs.readFileSync(file, \"utf8\");\n\t} catch (cause) {\n\t\tconst message = cause instanceof Error ? cause.message : String(cause);\n\t\tthrow new Error(`Could not read the app configuration file ${file}: ${message}. Composer deletes it when the run ends, so a stack file run by hand after that cannot read it; run the command again.`, { cause });\n\t}\n\tconst notComposers = (what) => /* @__PURE__ */ new Error(`The app configuration file ${file} is not one Composer wrote: ${what}.`);\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(text);\n\t} catch {\n\t\tthrow notComposers(\"it is not JSON\");\n\t}\n\tif (!isRecord(parsed)) throw notComposers(\"it is not JSON\");\n\tconst read = parsed[\"appConfigurationRead\"];\n\tif (!isRecord(read)) throw notComposers(\"appConfigurationRead is not an object\");\n\tconst rootInput = rootFieldsOf(read[\"rootInput\"]);\n\tif (rootInput === void 0) throw notComposers(\"rootInput is not a list of fields\");\n\tconst plainVariableText = textByKeyOf(parsed[\"plainVariableText\"]);\n\tif (plainVariableText === void 0) throw notComposers(\"plainVariableText is not an object of text\");\n\tconst addresses = parsed[\"nodeAddresses\"];\n\tif (!isTextList(addresses)) throw notComposers(\"nodeAddresses is not a list of node addresses\");\n\treturn {\n\t\tappConfigurationRead: { rootInput },\n\t\tplainVariableText,\n\t\tnodeAddresses: addresses\n\t};\n}\n/** Second process, under `prisma dev`: the named secrets the first process handed it. */\nfunction namedSecretsFromEnvironment(env) {\n\tconst text = env[NAMED_SECRETS_ENV];\n\tif (text === void 0 || text === \"\") throw new Error(missingVariable(NAMED_SECRETS_ENV, \"hands the secrets the local services need there\"));\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(text);\n\t} catch {\n\t\tparsed = void 0;\n\t}\n\tconst byKey = textByKeyOf(parsed);\n\tif (byKey === void 0) throw new Error(`${NAMED_SECRETS_ENV} is not a JSON object of text.`);\n\tconst secrets = Object.create(null);\n\tObject.assign(secrets, byKey);\n\treturn Object.freeze(secrets);\n}\n//#endregion\nexport { readAppConfigurationFile as a, prepareSecondProcess as i, devAppConfigurationFile as n, removeLeftoverAppConfigurationFiles as o, namedSecretsFromEnvironment as r, deployAppConfigurationFile as t };\n\n//# sourceMappingURL=app-configuration-file-Cw9autUL.mjs.map"],"mappings":";;;;;;AAMA,MAAM,6BAA6B;;AAEnC,MAAM,oBAAoB;AAC1B,MAAM,YAAY;;AAElB,SAAS,2BAA2B,KAAK,OAAO;CAC/C,OAAOA,OAAK,KAAK,KAAK,oBAAoB,qBAAqB,OAAO,QAAQ,GAAG,EAAE,GAAG,MAAM,MAAM;AACnG;;AAEA,SAAS,wBAAwB,QAAQ;CACxC,OAAOA,OAAK,KAAK,QAAQ,qBAAqB,OAAO,QAAQ,GAAG,EAAE,MAAM;AACzE;AACA,SAAS,UAAU,KAAK;CACvB,IAAI;EACH,QAAQ,KAAK,KAAK,CAAC;EACnB,OAAO;CACR,SAAS,OAAO;EACf,OAAO,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AAM,gBAAgB,mBAAmB,iDAAiD,CAAC;CACzI,IAAI;CACJ,IAAI;EACH,SAAS,KAAK,MAAM,IAAI;CACzB,QAAQ;EACP,SAAS,KAAK;CACf;CACA,MAAM,QAAQ,YAAY,MAAM;CAChC,IAAI,UAAU,KAAK,GAAG,MAAM,IAAI,MAAM,GAAG,kBAAkB,+BAA+B;CAC1F,MAAM,UAAU,OAAO,OAAO,IAAI;CAClC,OAAO,OAAO,SAAS,KAAK;CAC5B,OAAO,OAAO,OAAO,OAAO;AAC7B"}
|
package/dist/arktype.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SecretString, t as Pointer } from "./pointer-
|
|
1
|
+
import { a as SecretString, t as Pointer } from "./pointer-DclJZFQi-DJa4t8Wa.mjs";
|
|
2
2
|
import { Type } from "arktype";
|
|
3
3
|
//#region ../../0-framework/0-foundation/foundation/dist/arktype.d.mts
|
|
4
4
|
//#region src/arktype.d.ts
|
package/dist/arktype.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
|
|
2
|
-
import { a as isPlainPointer, o as isSecretPointer, r as isSecretString, t as describeKind } from "./describe-kind-Cpm_euxo-
|
|
2
|
+
import { a as isPlainPointer, o as isSecretPointer, r as isSecretString, t as describeKind } from "./describe-kind-Cpm_euxo-D9WDxl5C.mjs";
|
|
3
3
|
import { type } from "arktype";
|
|
4
4
|
//#region ../../0-framework/0-foundation/foundation/dist/arktype.mjs
|
|
5
5
|
/**
|
package/dist/arktype.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arktype.mjs","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/arktype.mjs"],"sourcesContent":["import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as describeKind } from \"./describe-kind-Cpm_euxo.mjs\";\nimport { n as isSecretString } from \"./secret-DoWGmN7m.mjs\";\nimport { n as isPlainPointer, r as isSecretPointer } from \"./pointer-
|
|
1
|
+
{"version":3,"file":"arktype.mjs","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/arktype.mjs"],"sourcesContent":["import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as describeKind } from \"./describe-kind-Cpm_euxo.mjs\";\nimport { n as isSecretString } from \"./secret-DoWGmN7m.mjs\";\nimport { n as isPlainPointer, r as isSecretPointer } from \"./pointer-BLedpQgL.mjs\";\nimport { type } from \"arktype\";\n//#region src/arktype.ts\n/**\n* ArkType spellings of the framework's schema leaves. Opt-in: the framework\n* accepts any Standard Schema library (ADR-0042) and nothing outside this\n* module imports arktype, so an app that uses Zod never loads it.\n*/\n/**\n* A schema leaf that accepts only a redacting `SecretString` box or a secret\n* pointer, so `input().<field>.expose()` type-checks and binding a plain\n* literal there fails the deploy (ADR-0042). Its error names the refused\n* value's kind, never the value.\n*\n* ```ts\n* input: type({ signingKey: secretString() })\n* ```\n*/\nconst secretString = () => type(\"unknown\").narrow((value, ctx) => isSecretString(value) || isSecretPointer(value) || ctx.reject({\n\texpected: \"a SecretString box — bind this field to a secret\",\n\tactual: isPlainPointer(value) ? \"a value known only at boot that is not a secret\" : describeKind(value)\n}));\n/** `error`'s message as if it were reported at `parent` joined with its own path. */\nfunction messageAt(parent, error) {\n\treturn error.transform(({ relativePath, prefixPath, ...input }) => ({\n\t\t...input,\n\t\tpath: [...parent, ...error.path]\n\t})).message;\n}\n/**\n* The error `inner` reports for the wrapped field's value: what a wrapped field\n* reports for a value that is not a pointer. When both branches are objects,\n* ArkType reports a union error, whose message is its problem alone, so each\n* inner error carries its full path from the field's parent.\n*/\nfunction innerProblem(inner, field) {\n\tconst errors = inner(field.data);\n\tif (!(errors instanceof type.errors)) return `must be ${inner.description} (was ${describeKind(field.data)})`;\n\treturn errors.map((error) => field.hasCode(\"union\") ? messageAt(field.path, error) : error.problem).join(\"; \");\n}\n/**\n* Wraps the schema of one leaf field so the field also accepts a plain\n* pointer, which stands for a value known only at boot. The field's input type\n* is `In | Pointer<In>` and its output type `Out | Pointer<In>`, where `In` and\n* `Out` are `inner`'s. A value that is not a pointer gets `inner`'s error.\n* Wrap a leaf, never an object schema; put a default outside the wrapper.\n*\n* ```ts\n* input: type({ from: field(type('string')), port: field(type('string.integer.parse')) })\n* ```\n*/\nfunction field(inner) {\n\tconst checked = blindCast(inner);\n\tconst pointer = type(\"object\").narrow((value) => isPlainPointer(value));\n\treturn blindCast(checked.or(pointer).configure({ problem: (error) => innerProblem(checked, error) }));\n}\n//#endregion\nexport { field, secretString };\n\n//# sourceMappingURL=arktype.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,MAAM,qBAAqB,KAAK,SAAS,CAAC,CAAC,QAAQ,OAAO,QAAQ,eAAe,KAAK,KAAK,gBAAgB,KAAK,KAAK,IAAI,OAAO;CAC/H,UAAU;CACV,QAAQ,eAAe,KAAK,IAAI,oDAAoD,aAAa,KAAK;AACvG,CAAC,CAAC;;AAEF,SAAS,UAAU,QAAQ,OAAO;CACjC,OAAO,MAAM,WAAW,EAAE,cAAc,YAAY,GAAG,aAAa;EACnE,GAAG;EACH,MAAM,CAAC,GAAG,QAAQ,GAAG,MAAM,IAAI;CAChC,EAAE,CAAC,CAAC;AACL;;;;;;;AAOA,SAAS,aAAa,OAAO,OAAO;CACnC,MAAM,SAAS,MAAM,MAAM,IAAI;CAC/B,IAAI,EAAE,kBAAkB,KAAK,SAAS,OAAO,WAAW,MAAM,YAAY,QAAQ,aAAa,MAAM,IAAI,EAAE;CAC3G,OAAO,OAAO,KAAK,UAAU,MAAM,QAAQ,OAAO,IAAI,UAAU,MAAM,MAAM,KAAK,IAAI,MAAM,OAAO,CAAC,CAAC,KAAK,IAAI;AAC9G;;;;;;;;;;;;AAYA,SAAS,MAAM,OAAO;CACrB,MAAM,UAAU,UAAU,KAAK;CAC/B,MAAM,UAAU,KAAK,QAAQ,CAAC,CAAC,QAAQ,UAAU,eAAe,KAAK,CAAC;CACtE,OAAO,UAAU,QAAQ,GAAG,OAAO,CAAC,CAAC,UAAU,EAAE,UAAU,UAAU,aAAa,SAAS,KAAK,EAAE,CAAC,CAAC;AACrG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./app-config-_XNdvjus-DcCvJysR.mjs";
|
package/dist/config.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import "./config-
|
|
1
|
+
import { $ as ReporterDescriptor, A as LocalTargetEmulatorsInput, C as LocalNodeLocation, Ct as preflightFindingsEnv, D as LocalTargetCurrentApp, E as LocalTargetAttachment, G as PreflightFindings, J as PrismaAppConfig, K as PreflightInput, M as LocateContainerInput, O as LocalTargetCurrentInput, Q as ReportBeginInput, R as NamedSecrets, S as LocalNodeCondition, St as preflightEnvVarName, T as LocalTargetAttachInput, Tt as readPreflightPayload, U as PlatformVariableCheck, V as PREFLIGHT_FINDINGS_ENV_VAR, W as PlatformVariableReader, Z as ReportAttachInput, at as TeardownInput, bt as platformVariableReaderText, c as ConfigAdapter, d as ContainerCredentials, dt as defineConfig, et as RunOutcome, f as ContainerDescriptor, g as DeployedEntity, h as DEV_ENVIRONMENT_NAME_FILE, ht as isBuildOnlyExtension, it as StateDescriptor, j as LocalTargetProvidersInput, k as LocalTargetDescriptor, l as ConfigAdapterInput, lt as containerEnv, m as DEV_DIR, mt as devEnvironmentDir, n as AppConfiguration, ot as UnsetPlatformVariable, p as ContainerInstance, pt as deserializeContainers, q as PreflightPayload, r as AppSecrets, tt as RunReporter, u as ConfigValues, ut as containerEnvVarName, w as LocalNodeStopped, wt as readPreflightFindings, x as ExtensionDescriptor, xt as preflightEnv, y as DevPreflightResult, z as NodeDescriptor } from "./app-config-_XNdvjus-DcCvJysR.mjs";
|
|
2
|
+
import "./config-Czql2X9e.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, DevPreflightResult, 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-DJjTWvyH-CEJ9WlaN.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 { Rt as CliStructuredError } from "./graph-types-Bzj1fahC-C8rOVj0c.mjs";
|
|
2
|
+
import { G as PreflightFindings, W as PlatformVariableReader, ot as UnsetPlatformVariable } from "./app-config-_XNdvjus-DcCvJysR.mjs";
|
|
3
|
+
import "./config-Czql2X9e.mjs";
|
|
4
|
+
import { n as DeploymentSummary, t as DeployedNodeSummary } from "./deployment-summary-p88NV5m5-k9oQRopA.mjs";
|
|
5
|
+
import "./index-B8s0bLZY.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-CqdeMBKw-BAOFeUYp.mjs";
|
|
7
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-current-BuX95QnN.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-BuX95QnN.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-D8GwJQex-BqMILWv-.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-1SIH5uAu-lMyvQ0el.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-Be9DYRI6-CCRtbIwA.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-D8GwJQex.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-1SIH5uAu.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-Be9DYRI6.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"}
|