@prisma/composer 0.39.0-dev.7 → 0.39.0-dev.8
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-DmCj4luV-BC36-MeB.d.mts → app-config-DriAu5RU-C8hYpR38.d.mts} +17 -15
- package/dist/app-config-DriAu5RU-C8hYpR38.d.mts.map +1 -0
- package/dist/{app-configuration-file-Bbfq5PR3-D4DUNKUM.mjs → app-configuration-file-D0rB5g65-CdMrjkCc.mjs} +10 -40
- package/dist/app-configuration-file-D0rB5g65-CdMrjkCc.mjs.map +1 -0
- package/dist/app-converge-CVlo9uw2-B-fdr0nr.mjs +88 -0
- package/dist/app-converge-CVlo9uw2-B-fdr0nr.mjs.map +1 -0
- package/dist/config-Bpi8QVLB.d.mts +1 -0
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +1 -1
- package/dist/control.d.mts +8 -23
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +4 -4
- package/dist/control.mjs.map +1 -1
- package/dist/{converge-in-process-BBBeood8-BCIPOG8X.d.mts → converge-in-process-CTomEXaD-BnDylZP8.d.mts} +5 -5
- package/dist/{converge-in-process-BBBeood8-BCIPOG8X.d.mts.map → converge-in-process-CTomEXaD-BnDylZP8.d.mts.map} +1 -1
- package/dist/converge-in-process-x89zb2MF-Dvj-J8xo.mjs +258 -0
- package/dist/converge-in-process-x89zb2MF-Dvj-J8xo.mjs.map +1 -0
- package/dist/{deploy-B2kxaH5E.mjs → deploy-CSU0kr4j.mjs} +65 -5
- package/dist/{deploy-B2kxaH5E.mjs.map → deploy-CSU0kr4j.mjs.map} +1 -1
- package/dist/deploy-DHgEJDpg.d.mts +32 -0
- package/dist/deploy-DHgEJDpg.d.mts.map +1 -0
- package/dist/deploy.d.mts +4 -4
- package/dist/deploy.mjs +3 -3
- package/dist/{deployment-summary-6LgQDUuu-Dp8kwMs_.d.mts → deployment-summary-6LgQDUuu-Cu_6UNhc.d.mts} +4 -4
- package/dist/{deployment-summary-6LgQDUuu-Dp8kwMs_.d.mts.map → deployment-summary-6LgQDUuu-Cu_6UNhc.d.mts.map} +1 -1
- package/dist/{deployment-summary-YP7eMPJI-CQsj7BHh.mjs → deployment-summary-CVJZn2v0-Dz-gX1rp.mjs} +3 -3
- package/dist/{deployment-summary-YP7eMPJI-CQsj7BHh.mjs.map → deployment-summary-CVJZn2v0-Dz-gX1rp.mjs.map} +1 -1
- package/dist/dev-converge-messages-DML4rTz7-C_EAB5M_.mjs +165 -0
- package/dist/dev-converge-messages-DML4rTz7-C_EAB5M_.mjs.map +1 -0
- package/dist/dev-converge-worker.d.mts +1 -0
- package/dist/dev-converge-worker.mjs +142 -0
- package/dist/dev-converge-worker.mjs.map +1 -0
- package/dist/{dev-current-gQnmjB4V-BaNhcGpK.mjs → dev-current-ByY2RrbK-DbU6y3PF.mjs} +11 -7
- package/dist/dev-current-ByY2RrbK-DbU6y3PF.mjs.map +1 -0
- package/dist/{dev-environment-name-6eEr5PW8-6sPgQZG3.mjs → dev-environment-name-6eEr5PW8-7ntm9Xhs.mjs} +3 -3
- package/dist/{dev-environment-name-6eEr5PW8-6sPgQZG3.mjs.map → dev-environment-name-6eEr5PW8-7ntm9Xhs.mjs.map} +1 -1
- package/dist/{dist-CyrEbDx6.mjs → dist-Cf_mZHaH.mjs} +2 -2
- package/dist/{dist-CyrEbDx6.mjs.map → dist-Cf_mZHaH.mjs.map} +1 -1
- package/dist/{emulator-retry-CV8rl69G-BgUzkxc-.mjs → emulator-retry-CV8rl69G-scQ105wk.mjs} +2 -2
- package/dist/{emulator-retry-CV8rl69G-BgUzkxc-.mjs.map → emulator-retry-CV8rl69G-scQ105wk.mjs.map} +1 -1
- package/dist/{errors-0e8IVwzi.mjs → errors-DI3TBXE-.mjs} +7 -2
- package/dist/{errors-0e8IVwzi.mjs.map → errors-DI3TBXE-.mjs.map} +1 -1
- package/dist/{execute-deploy-destroy-DKbsBkqK-BWXh0zXQ.mjs → execute-deploy-destroy-D1jnaYqU-RAlTx-NX.mjs} +246 -193
- package/dist/execute-deploy-destroy-D1jnaYqU-RAlTx-NX.mjs.map +1 -0
- package/dist/{execute-dev-DVCWURmI-Cp3i7Hrp.mjs → execute-dev-BP0Shlpd-BNFvs2LF.mjs} +434 -261
- package/dist/execute-dev-BP0Shlpd-BNFvs2LF.mjs.map +1 -0
- package/dist/{execute-dev-current-Dt_9srY2-COEgQ9h4.mjs → execute-dev-current-B792f_1m-BYJ-Rl8m.mjs} +7 -7
- package/dist/{execute-dev-current-Dt_9srY2-COEgQ9h4.mjs.map → execute-dev-current-B792f_1m-BYJ-Rl8m.mjs.map} +1 -1
- package/dist/{execute-log-B34AeU97-CkJiGdIc.mjs → execute-log-BiRHQq6Q-BkQk0Kvo.mjs} +8 -8
- package/dist/{execute-log-B34AeU97-CkJiGdIc.mjs.map → execute-log-BiRHQq6Q-BkQk0Kvo.mjs.map} +1 -1
- package/dist/{graph-1ILOBl8O-DBaUZL2D.d.mts → graph-CUYXjK8S-BzL-mhjq.d.mts} +3 -3
- package/dist/graph-CUYXjK8S-BzL-mhjq.d.mts.map +1 -0
- package/dist/{graph-C6Fqe2gn-qJQBxs_C.mjs → graph-D2WMLL43-CeiC5wdy.mjs} +18 -9
- package/dist/graph-D2WMLL43-CeiC5wdy.mjs.map +1 -0
- package/dist/{graph-types-CaH3flhT-DgrCdRA3.d.mts → graph-types-D4PrtP-l-B0uuchTl.d.mts} +13 -11
- package/dist/{graph-types-CaH3flhT-DgrCdRA3.d.mts.map → graph-types-D4PrtP-l-B0uuchTl.d.mts.map} +1 -1
- package/dist/http.d.mts +2 -2
- package/dist/http.mjs +2 -2
- package/dist/{index-Cnbf_d0q.d.mts → index-D8chHe55.d.mts} +3 -3
- package/dist/{index-Cnbf_d0q.d.mts.map → index-D8chHe55.d.mts.map} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/internal-app-configuration-file.d.mts +5 -9
- package/dist/internal-app-configuration-file.d.mts.map +1 -1
- package/dist/internal-app-configuration-file.mjs +2 -2
- package/dist/internal-converge-contract.d.mts +6 -4
- package/dist/internal-converge-contract.d.mts.map +1 -1
- package/dist/internal-converge-contract.mjs +7 -5
- package/dist/internal-converge-contract.mjs.map +1 -1
- package/dist/internal-converge.d.mts +5 -4
- package/dist/internal-converge.mjs +4 -228
- package/dist/load-entry-CEoVBdMj-CHOz7jKf.mjs +527 -0
- package/dist/load-entry-CEoVBdMj-CHOz7jKf.mjs.map +1 -0
- package/dist/local-target-7KRsLMDO.d.mts +31 -0
- package/dist/local-target-7KRsLMDO.d.mts.map +1 -0
- package/dist/{local-target-COdS1iNs.mjs → local-target-DhU1vaxd.mjs} +6 -6
- package/dist/{local-target-COdS1iNs.mjs.map → local-target-DhU1vaxd.mjs.map} +1 -1
- package/dist/local-target.d.mts +3 -31
- package/dist/local-target.mjs +1 -1
- package/dist/{nextjs-DLyeRR7M-CSKy5tFv.d.mts → nextjs-DLyeRR7M-CzUbvPaJ.d.mts} +3 -3
- package/dist/{nextjs-DLyeRR7M-CSKy5tFv.d.mts.map → nextjs-DLyeRR7M-CzUbvPaJ.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-C7_3abXW-Bza_hn9G.mjs → preflight-transport-2d6iIchu-B-v7Di6I.mjs} +5 -4
- package/dist/preflight-transport-2d6iIchu-B-v7Di6I.mjs.map +1 -0
- package/dist/{redaction-CjMYXtGp-CEQ5z1PK.mjs → redaction-DY6eDC12-W-FzW7_r.mjs} +16 -4
- package/dist/{redaction-CjMYXtGp-CEQ5z1PK.mjs.map → redaction-DY6eDC12-W-FzW7_r.mjs.map} +1 -1
- package/dist/{redaction-CIaE4m9U-DyJoGPRw.d.mts → redaction-Dn7BRdaP-BcLSPhLV.d.mts} +58 -17
- package/dist/redaction-Dn7BRdaP-BcLSPhLV.d.mts.map +1 -0
- package/dist/report.d.mts +3 -3
- package/dist/report.mjs +2 -2
- package/dist/report.mjs.map +1 -1
- package/dist/service-rpc.d.mts +2 -2
- package/dist/service-rpc.mjs +2 -2
- package/dist/steps-BZXNqW6U-C_ME2VLd.mjs +112 -0
- package/dist/steps-BZXNqW6U-C_ME2VLd.mjs.map +1 -0
- package/dist/testing.d.mts +1 -1
- package/dist/validate-environment-DCZiNSlR-C7lv0cH1.mjs +344 -0
- package/dist/validate-environment-DCZiNSlR-C7lv0cH1.mjs.map +1 -0
- package/package.json +11 -11
- package/skills/prisma-composer-core-concepts/SKILL.md +8 -8
- package/src/exports/dev-converge-worker.ts +2 -0
- package/dist/app-config-DmCj4luV-BC36-MeB.d.mts.map +0 -1
- package/dist/app-configuration-file-Bbfq5PR3-D4DUNKUM.mjs.map +0 -1
- package/dist/config-vv8LBErH.d.mts +0 -1
- package/dist/deploy-w-BcRS8b.d.mts +0 -12
- package/dist/deploy-w-BcRS8b.d.mts.map +0 -1
- package/dist/dev-current-gQnmjB4V-BaNhcGpK.mjs.map +0 -1
- package/dist/execute-deploy-destroy-DKbsBkqK-BWXh0zXQ.mjs.map +0 -1
- package/dist/execute-dev-DVCWURmI-Cp3i7Hrp.mjs.map +0 -1
- package/dist/graph-1ILOBl8O-DBaUZL2D.d.mts.map +0 -1
- package/dist/graph-C6Fqe2gn-qJQBxs_C.mjs.map +0 -1
- package/dist/internal-converge.mjs.map +0 -1
- package/dist/local-target.d.mts.map +0 -1
- package/dist/preflight-transport-C7_3abXW-Bza_hn9G.mjs.map +0 -1
- package/dist/redaction-CIaE4m9U-DyJoGPRw.d.mts.map +0 -1
- package/dist/run-alchemy-BlYyc4Oh-mIzYC4lq.mjs +0 -236
- package/dist/run-alchemy-BlYyc4Oh-mIzYC4lq.mjs.map +0 -1
- package/dist/validate-environment-XwVDifWN-D14WhSH0.mjs +0 -739
- package/dist/validate-environment-XwVDifWN-D14WhSH0.mjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
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-
|
|
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-D4PrtP-l-B0uuchTl.mjs";
|
|
2
|
+
import "./graph-CUYXjK8S-BzL-mhjq.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-DriAu5RU.d.mts
|
|
9
9
|
//#region src/caller-credentials.d.ts
|
|
10
10
|
/**
|
|
11
11
|
* What the caller has already authenticated, handed unchanged to every
|
|
@@ -277,7 +277,7 @@ interface DeploymentResult {
|
|
|
277
277
|
interface LowerOptions {
|
|
278
278
|
/** Stack + root node id. */
|
|
279
279
|
readonly name: string;
|
|
280
|
-
/** The environment being deployed, as `--environment` gave it. Required by any value over `environment.name`;
|
|
280
|
+
/** The environment being deployed, as `--environment` gave it. Required by any value over `environment.name`; every caller passes it. */
|
|
281
281
|
readonly environment?: string;
|
|
282
282
|
/** What the caller's Load read from the app configuration (ADR-0062). Load takes the root's input from it. */
|
|
283
283
|
readonly appConfigurationRead?: AppConfigurationRead;
|
|
@@ -286,7 +286,7 @@ interface LowerOptions {
|
|
|
286
286
|
readonly bundles: Record<string, Bundle>;
|
|
287
287
|
/** Alchemy state store for the stack. Defaults to the config's own state layer. */
|
|
288
288
|
readonly state?: AlchemyStateLayer;
|
|
289
|
-
/** Explicit provider set for the stack. Defaults to the config's own merged `providers()` (`mergedProviders`) — the same override precedence as `state`.
|
|
289
|
+
/** Explicit provider set for the stack. Defaults to the config's own merged `providers()` (`mergedProviders`) — the same override precedence as `state`. `prisma dev` passes `localTargetProviders(...)` here (ADR-0041); `lower()` itself learns nothing about the local target. */
|
|
290
290
|
readonly providers?: Layer.Layer<never>;
|
|
291
291
|
/**
|
|
292
292
|
* Invoked once per deploy, during apply, with the Deploy operation's result
|
|
@@ -296,7 +296,7 @@ interface LowerOptions {
|
|
|
296
296
|
* declared at all.
|
|
297
297
|
*/
|
|
298
298
|
readonly report?: (result: DeploymentResult) => void;
|
|
299
|
-
/** Addresses lowered without an artifact: `package` and `deploy` are skipped and `reserve` runs instead (ADR-0056). Only
|
|
299
|
+
/** Addresses lowered without an artifact: `package` and `deploy` are skipped and `reserve` runs instead (ADR-0056). Only `prisma dev` sets it. */
|
|
300
300
|
readonly unassembled?: readonly string[];
|
|
301
301
|
/** Each extension's resolved container, by extension id. Pass both `containers` and `preflightPayloads`, or neither. When both are absent, `lower()` reads both from the environment transports through `transportedLowerInputs(config)`. When exactly one is passed, `lower()` throws. */
|
|
302
302
|
readonly containers?: ReadonlyMap<string, ContainerInstance> | undefined;
|
|
@@ -360,6 +360,8 @@ interface Artifact {
|
|
|
360
360
|
declare class LowerError extends Error {
|
|
361
361
|
constructor(message: string);
|
|
362
362
|
}
|
|
363
|
+
/** The `name` of the error `lower()` fails with when it builds a graph whose node addresses differ from `firstProcessNodeAddresses`. */
|
|
364
|
+
declare const GRAPH_CHANGED_ERROR = "GraphChangedError";
|
|
363
365
|
/**
|
|
364
366
|
* Assembles a service's typed Config. Connection params come from the
|
|
365
367
|
* dependency edge's lowered outputs — or, for a param carrying a `provision`
|
|
@@ -462,10 +464,10 @@ interface ExtensionDescriptor {
|
|
|
462
464
|
* platform variable a service needs has a value) and throws to abort the
|
|
463
465
|
* deploy. Async: it talks to the platform (ADR-0064).
|
|
464
466
|
*
|
|
465
|
-
* What it returns
|
|
466
|
-
*
|
|
467
|
-
*
|
|
468
|
-
*
|
|
467
|
+
* What it returns reaches this same extension's lowering as
|
|
468
|
+
* `LowerContext.preflight`: as a value under `deploy` and `prisma dev`, and
|
|
469
|
+
* through the environment (preflight-transport.ts) for `destroy`'s alchemy
|
|
470
|
+
* child, which re-imports the config from scratch. The payload
|
|
469
471
|
* is the extension's own opaque string; the framework never reads it, and a
|
|
470
472
|
* secret value must never go in it. What it hands `input.report` reaches the
|
|
471
473
|
* deploy report through the framework's own transport, not this payload.
|
|
@@ -729,7 +731,7 @@ interface LocalTargetProvidersInput {
|
|
|
729
731
|
readonly devDir: string;
|
|
730
732
|
/** The text of each plain platform variable a service reads, by name. Never a secret. */
|
|
731
733
|
readonly plainVariableText: Readonly<Record<string, string>>;
|
|
732
|
-
/** The app secrets the graph's platform secrets name, which
|
|
734
|
+
/** The app secrets the graph's platform secrets name, which `prisma dev` hands its converge worker thread in memory. A local deployment takes the text its secret `$platform` markers name from it. */
|
|
733
735
|
readonly namedSecrets: NamedSecrets;
|
|
734
736
|
}
|
|
735
737
|
interface LocalTargetEmulatorsInput {
|
|
@@ -840,9 +842,9 @@ type ConfigValues = Readonly<Record<string, unknown>>;
|
|
|
840
842
|
type ConfigAdapter = (input: ConfigAdapterInput) => ConfigValues | Promise<ConfigValues>;
|
|
841
843
|
/** 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. */
|
|
842
844
|
type AppConfiguration = Readonly<Record<string, unknown>>;
|
|
843
|
-
/** 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
|
|
845
|
+
/** 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 the local target's providers the values under the secrets keys of the graph's secret sources, and Composer redacts those values wherever it prints. */
|
|
844
846
|
type AppSecrets = Readonly<Record<string, string>>;
|
|
845
|
-
/** The app secrets under the secrets keys of the graph's secret sources, each with text. `prisma dev`
|
|
847
|
+
/** The app secrets under the secrets keys of the graph's secret sources, each with text. `prisma dev` hands them to the local target's providers, in memory. */
|
|
846
848
|
type NamedSecrets = Readonly<Record<string, string>>;
|
|
847
849
|
/**
|
|
848
850
|
* The config file's default export. `extensions` lists every extension the
|
|
@@ -863,5 +865,5 @@ interface PrismaAppConfig {
|
|
|
863
865
|
/** Typed identity — exists so the `composer` section of `prisma.config.ts` gets checked against PrismaAppConfig where it is written. */
|
|
864
866
|
declare function defineConfig(config: PrismaAppConfig): PrismaAppConfig;
|
|
865
867
|
//#endregion
|
|
866
|
-
export {
|
|
867
|
-
//# sourceMappingURL=app-config-
|
|
868
|
+
export { ReportBeginInput as $, LocalTargetDescriptor as A, NodeDescriptor as B, LocalNodeCondition as C, preflightEnvVarName as Ct, LocalTargetAttachment as D, LocalTargetAttachInput as E, transportedLowerInputs as Et, LowerError as F, PreflightFindings as G, PackageInput as H, LowerOptions as I, PrismaAppConfig as J, PreflightInput as K, LoweredResult as L, LocalTargetProvidersInput as M, LocateContainerInput as N, LocalTargetCurrentApp as O, LowerContext as P, ReportAttachInput as Q, Lowering as R, GRAPH_CHANGED_ERROR as S, preflightEnv as St, LocalNodeStopped as T, resolveStateLayer as Tt, PlatformVariableCheck as U, Outputs as V, PlatformVariableReader as W, ProvisionEdge as X, ProvidersInput as Y, ProvisionerDescriptor as Z, DeployedNode as _, joinDeployment as _t, Artifact as a, StateDescriptor as at, DevServer as b, mergedProviders as bt, CallerCredentials as c, buildConfig as ct, ConfigValues as d, containerEnvVarName as dt, ReporterDescriptor as et, ContainerDescriptor as f, defineConfig as ft, DeployedEntity as g, isBuildOnlyExtension as gt, DEV_ENVIRONMENT_NAME_FILE as h, devEnvironmentDir as ht, ApplicationDescriptor as i, ServiceLowering as it, LocalTargetEmulatorsInput as j, LocalTargetCurrentInput as k, ConfigAdapter as l, connectionInputs as lt, DEV_DIR as m, deserializeContainers as mt, AppConfiguration as n, RunReporter as nt, AssembleInput as o, TeardownInput as ot, ContainerInstance as p, deploymentResult as pt, PreflightPayload as q, AppSecrets as r, ServeInput as rt, Bundle as s, UnsetPlatformVariable as st, AlchemyStateLayer as t, RunOutcome as tt, ConfigAdapterInput as u, containerEnv as ut, DeploymentResult as v, lower as vt, LocalNodeLocation as w, readPreflightPayload as wt, ExtensionDescriptor as x, platformVariableReaderText as xt, DevPreflightResult as y, lowering as yt, NamedSecrets as z };
|
|
869
|
+
//# sourceMappingURL=app-config-DriAu5RU-C8hYpR38.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-config-DriAu5RU-C8hYpR38.d.mts","names":[],"sources":["../../../0-framework/1-core/core/dist/app-config-DriAu5RU.d.mts"],"mappings":";;;;;;;;;;;;;;UAaU,kBAAkB;;WAEjB;;WAEA,SAAS;;;;;UAKV;;WAEC;;WAEA;;;;;;;UAOD;WACC,OAAO;;WAEP;;EAET;;;;;;;;;;;;UAYQ,oBAAoB,UAAU,oBAAoB,mBAAmB;;EAE7E,OAAO,OAAO,sBAAsB,cAAc,kBAAkB,KAAK,QAAQ;;EAEjF,OAAO,OAAO,sBAAsB,cAAc,kBAAkB,KAAK,QAAQ;;EAEjF,OAAO,UAAU,GAAG,cAAc,kBAAkB,KAAK;;EAEzD,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;;;;KAI/C,oBAAoB,MA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QX,OAAO;aACI;aACA,MAAM;aACN,QAAQ;;aAER,eAAe;;aAEf,SAAS;MAChB;aACO;;;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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as CliStructuredError } from "./errors-
|
|
1
|
+
import { t as CliStructuredError } from "./errors-DI3TBXE-.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-D0rB5g65.mjs
|
|
6
6
|
function textIn(value, at) {
|
|
7
7
|
if (typeof value === "string") return [{
|
|
8
8
|
at,
|
|
@@ -29,26 +29,20 @@ function refuseSecretsInRootInput(read, knownSecrets, consequence) {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
/** Throws `CONFIG.SECRET_AS_PLAIN_VALUE` when a plain platform variable's text holds a known secret. */
|
|
32
|
-
function refuseSecretsInPlainVariables(plainVariableText, knownSecrets) {
|
|
32
|
+
function refuseSecretsInPlainVariables(plainVariableText, knownSecrets, consequence) {
|
|
33
33
|
for (const [variable, text] of Object.entries(plainVariableText)) {
|
|
34
34
|
const name = knownSecrets.nameIn(text);
|
|
35
35
|
if (name === void 0) continue;
|
|
36
|
-
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 platform secret "${name}".
|
|
36
|
+
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 platform secret "${name}". ${consequence}`, { fix: `Keep the value of "${name}" out of the platform variable "${variable}", or give "${variable}" a different value.` });
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
/** Names the app configuration file the first process wrote for this run (ADR-0062). */
|
|
40
40
|
const APP_CONFIGURATION_FILE_ENV = "PRISMA_COMPOSER_APP_CONFIGURATION_FILE";
|
|
41
|
-
/** `prisma dev` only: the named secrets, as a JSON object. */
|
|
42
|
-
const NAMED_SECRETS_ENV = "PRISMA_COMPOSER_NAMED_SECRETS";
|
|
43
41
|
const FILE_NAME = /^app-configuration-(\d+)(-[^/]*)?\.json$/;
|
|
44
|
-
/** The app configuration file a
|
|
42
|
+
/** The app configuration file a destroy run writes: unique per run, so concurrent runs from one checkout never share one. */
|
|
45
43
|
function deployAppConfigurationFile(cwd, runId) {
|
|
46
44
|
return path$1.join(cwd, ".prisma-composer", `app-configuration-${String(process.pid)}-${runId}.json`);
|
|
47
45
|
}
|
|
48
|
-
/** The app configuration file `prisma dev` writes in an environment's folder. */
|
|
49
|
-
function devAppConfigurationFile(devDir) {
|
|
50
|
-
return path$1.join(devDir, `app-configuration-${String(process.pid)}.json`);
|
|
51
|
-
}
|
|
52
46
|
function isRunning(pid) {
|
|
53
47
|
try {
|
|
54
48
|
process.kill(pid, 0);
|
|
@@ -92,23 +86,15 @@ function removeLeftoverAppConfigurationFiles(cwd) {
|
|
|
92
86
|
* Refuses a file that would hold any of `knownSecrets`.
|
|
93
87
|
*/
|
|
94
88
|
function prepareSecondProcess(input) {
|
|
95
|
-
const { file
|
|
89
|
+
const { file } = input;
|
|
96
90
|
refuseSecretsInRootInput(input.appConfigurationRead, input.knownSecrets, "Composer hands the second process every plain value Load read, in a file, and never writes a secret to a file.");
|
|
97
|
-
refuseSecretsInPlainVariables(input.plainVariableText, input.knownSecrets);
|
|
91
|
+
refuseSecretsInPlainVariables(input.plainVariableText, input.knownSecrets, "Composer hands the second process every plain value in a file, and never writes a secret to a file.");
|
|
98
92
|
const contents = {
|
|
99
93
|
appConfigurationRead: input.appConfigurationRead,
|
|
100
94
|
plainVariableText: input.plainVariableText,
|
|
101
95
|
nodeAddresses: input.nodeAddresses
|
|
102
96
|
};
|
|
103
97
|
const env = { [APP_CONFIGURATION_FILE_ENV]: file };
|
|
104
|
-
if (appSecrets !== void 0) {
|
|
105
|
-
const named = {};
|
|
106
|
-
for (const key of input.secretsKeys) {
|
|
107
|
-
const text = appSecrets[key];
|
|
108
|
-
if (text !== void 0 && text !== "") named[key] = text;
|
|
109
|
-
}
|
|
110
|
-
env[NAMED_SECRETS_ENV] = JSON.stringify(named);
|
|
111
|
-
}
|
|
112
98
|
const remove = () => {
|
|
113
99
|
try {
|
|
114
100
|
fs$1.rmSync(file, { force: true });
|
|
@@ -132,7 +118,7 @@ function prepareSecondProcess(input) {
|
|
|
132
118
|
};
|
|
133
119
|
}
|
|
134
120
|
function missingVariable(name, what) {
|
|
135
|
-
return `${name} is not set. This stack file runs as the second process of a Composer destroy
|
|
121
|
+
return `${name} is not set. This stack file runs as the second process of a Composer destroy, which ${what}.`;
|
|
136
122
|
}
|
|
137
123
|
function isRecord(value) {
|
|
138
124
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -194,23 +180,7 @@ function readAppConfigurationFile(env) {
|
|
|
194
180
|
nodeAddresses: addresses
|
|
195
181
|
};
|
|
196
182
|
}
|
|
197
|
-
/** Second process, under `prisma dev`: the named secrets the first process handed it. */
|
|
198
|
-
function namedSecretsFromEnvironment(env) {
|
|
199
|
-
const text = env[NAMED_SECRETS_ENV];
|
|
200
|
-
if (text === void 0 || text === "") throw new Error(missingVariable(NAMED_SECRETS_ENV, "hands the secrets the local services need there"));
|
|
201
|
-
let parsed;
|
|
202
|
-
try {
|
|
203
|
-
parsed = JSON.parse(text);
|
|
204
|
-
} catch {
|
|
205
|
-
parsed = void 0;
|
|
206
|
-
}
|
|
207
|
-
const byKey = textByKeyOf(parsed);
|
|
208
|
-
if (byKey === void 0) throw new Error(`${NAMED_SECRETS_ENV} is not a JSON object of text.`);
|
|
209
|
-
const secrets = Object.create(null);
|
|
210
|
-
Object.assign(secrets, byKey);
|
|
211
|
-
return Object.freeze(secrets);
|
|
212
|
-
}
|
|
213
183
|
//#endregion
|
|
214
|
-
export {
|
|
184
|
+
export { refuseSecretsInRootInput as a, refuseSecretsInPlainVariables as i, prepareSecondProcess as n, removeLeftoverAppConfigurationFiles as o, readAppConfigurationFile as r, deployAppConfigurationFile as t };
|
|
215
185
|
|
|
216
|
-
//# sourceMappingURL=app-configuration-file-
|
|
186
|
+
//# sourceMappingURL=app-configuration-file-D0rB5g65-CdMrjkCc.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-configuration-file-D0rB5g65-CdMrjkCc.mjs","names":["path","fs"],"sources":["../../../0-framework/3-tooling/cli/dist/app-configuration-file-D0rB5g65.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/secret-as-plain-value.ts\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/** Throws `CONFIG.SECRET_AS_PLAIN_VALUE` when a root input field Load read holds a known secret. */\nfunction refuseSecretsInRootInput(read, knownSecrets, consequence) {\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 platform secret \"${name}\". ${consequence}`, { 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}\n/** Throws `CONFIG.SECRET_AS_PLAIN_VALUE` when a plain platform variable's text holds a known secret. */\nfunction refuseSecretsInPlainVariables(plainVariableText, knownSecrets, consequence) {\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 platform secret \"${name}\". ${consequence}`, { fix: `Keep the value of \"${name}\" out of the platform variable \"${variable}\", or give \"${variable}\" a different value.` });\n\t}\n}\n//#endregion\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\";\nconst FILE_NAME = /^app-configuration-(\\d+)(-[^/]*)?\\.json$/;\n/** The app configuration file a 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}\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}\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 } = input;\n\trefuseSecretsInRootInput(input.appConfigurationRead, input.knownSecrets, \"Composer hands the second process every plain value Load read, in a file, and never writes a secret to a file.\");\n\trefuseSecretsInPlainVariables(input.plainVariableText, input.knownSecrets, \"Composer hands the second process every plain value in a file, and never writes a secret to a file.\");\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\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 destroy, 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 in the shape this version of Composer reads: ${what}. The usual cause is a \\`prisma\\` CLI and an app on different Composer versions. Put the \\`prisma\\` CLI and the app's \\`@prisma/composer\\` on the same version.`);\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//#endregion\nexport { refuseSecretsInPlainVariables as a, removeLeftoverAppConfigurationFiles as i, prepareSecondProcess as n, refuseSecretsInRootInput as o, readAppConfigurationFile as r, deployAppConfigurationFile as t };\n\n//# sourceMappingURL=app-configuration-file-D0rB5g65.mjs.map"],"mappings":";;;;;AAKA,SAAS,OAAO,OAAO,IAAI;CAC1B,IAAI,OAAO,UAAU,UAAU,OAAO,CAAC;EACtC;EACA,MAAM;CACP,CAAC;CACD,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,aAAa,OAAO,UAAU,UAAU,OAAO,CAAC;EACjG;EACA,MAAM,OAAO,KAAK;CACnB,CAAC;CACD,IAAI,MAAM,QA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AAM,OAAO;CACd;CACA,OAAO;AACR;;AAEA,SAAS,yBAAyB,KAAK;CACtC,MAAM,OAAO,IAAI;CACjB,IAAI,SAAS,KAAK,KAAK,SAAS,IAAI,MAAM,IAAI,MAAM,gBAAgB,4BAA4B,iDAAiD,CAAC;CAClJ,IAAI;CACJ,IAAI;EACH,OAAOA,KAAG,aAAa,MAAM,MAAM;CACpC,SAAS,OAAO;EACf,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EACrE,MAAM,IAAI,MAAM,6CAA6C,KAAK,IAAI,QAAQ,yHAAyH,EAAE,MAAM,CAAC;CACjN;CACA,MAAM,gBAAgB,yBAAyB,IAAI,MAAM,8BAA8B,KAAK,uDAAuD,KAAK,gKAAgK;CACxT,IAAI;CACJ,IAAI;EACH,SAAS,KAAK,MAAM,IAAI;CACzB,QAAQ;EACP,MAAM,aAAa,gBAAgB;CACpC;CACA,IAAI,CAAC,SAAS,MAAM,GAAG,MAAM,aAAa,gBAAgB;CAC1D,MAAM,OAAO,OAAO;CACpB,IAAI,CAAC,SAAS,IAAI,GAAG,MAAM,aAAa,uCAAuC;CAC/E,MAAM,YAAY,aAAa,KAAK,YAAY;CAChD,IAAI,cAAc,KAAK,GAAG,MAAM,aAAa,mCAAmC;CAChF,MAAM,oBAAoB,YAAY,OAAO,oBAAoB;CACjE,IAAI,sBAAsB,KAAK,GAAG,MAAM,aAAa,4CAA4C;CACjG,MAAM,YAAY,OAAO;CACzB,IAAI,CAAC,WAAW,SAAS,GAAG,MAAM,aAAa,+CAA+C;CAC9F,OAAO;EACN,sBAAsB,EAAE,UAAU;EAClC;EACA,eAAe;CAChB;AACD"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
|
|
2
|
+
import { t as CliStructuredError } from "./errors-DI3TBXE-.mjs";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import * as path$1 from "node:path";
|
|
5
|
+
import * as fs$1 from "node:fs";
|
|
6
|
+
import { pathToFileURL } from "node:url";
|
|
7
|
+
//#region ../../0-framework/3-tooling/cli/dist/app-converge-CVlo9uw2.mjs
|
|
8
|
+
var version = "0.39.0-dev.8";
|
|
9
|
+
const ENTRY = "@prisma/composer/internal/converge";
|
|
10
|
+
const CONTRACT_ENTRY = "@prisma/composer/internal/converge-contract";
|
|
11
|
+
const ENTRY_FUNCTIONS = [
|
|
12
|
+
"lower",
|
|
13
|
+
"convergeInProcess",
|
|
14
|
+
"localTargetProviders",
|
|
15
|
+
"devState"
|
|
16
|
+
];
|
|
17
|
+
/** The Composer version this host runs; every Composer package carries the same one. */
|
|
18
|
+
const HOST_COMPOSER_VERSION = version;
|
|
19
|
+
function unresolvable(appDir, detail, cause) {
|
|
20
|
+
return new CliStructuredError("DEPS.CONVERGE_UNRESOLVABLE", `Could not load the converge from the app's @prisma/composer in "${appDir}": ${detail}`, {
|
|
21
|
+
why: "`prisma deploy` and `prisma dev` run the lowering and Alchemy from the app's own install of @prisma/composer, so the app, its extensions and Alchemy share one copy of alchemy.",
|
|
22
|
+
fix: "Install @prisma/composer in the app, at the same version as the Composer the `prisma` CLI runs.",
|
|
23
|
+
...cause === void 0 ? {} : { cause }
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function installedVersion(require) {
|
|
27
|
+
try {
|
|
28
|
+
const parsed = JSON.parse(fs$1.readFileSync(require.resolve("@prisma/composer/package.json"), "utf8"));
|
|
29
|
+
return typeof parsed === "object" && parsed !== null && "version" in parsed && typeof parsed.version === "string" ? parsed.version : void 0;
|
|
30
|
+
} catch {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async function importFile(appDir, file) {
|
|
35
|
+
try {
|
|
36
|
+
return await import(pathToFileURL(file).href);
|
|
37
|
+
} catch (error) {
|
|
38
|
+
throw unresolvable(appDir, `${file} failed to load: ${error instanceof Error ? error.message : String(error)}`, error);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function contractMismatch(host, app) {
|
|
42
|
+
const appVersion = app.version ?? "an unknown version";
|
|
43
|
+
const update = app.contract < host.contract ? `Upgrade the app's @prisma/composer to a release that speaks converge contract ${host.contract}, such as ${host.version}.` : `Upgrade the \`prisma\` CLI to one that runs a Composer speaking converge contract ${app.contract}, such as ${appVersion}.`;
|
|
44
|
+
return new CliStructuredError("DEPS.CONVERGE_CONTRACT_MISMATCH", `The app's @prisma/composer ${appVersion} speaks converge contract ${app.contract}, and the \`prisma\` CLI's Composer ${host.version} speaks contract ${host.contract}.`, {
|
|
45
|
+
why: "Deploy and dev call the app's @prisma/composer from the CLI's Composer, and the two read each other's data only when they speak the same converge contract.",
|
|
46
|
+
fix: update
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The app's `lower`, converge and local target functions, from the install `appDir` resolves. Reads the app's
|
|
51
|
+
* converge contract before loading anything else. Raises
|
|
52
|
+
* DEPS.CONVERGE_UNRESOLVABLE when the install is missing or predates the
|
|
53
|
+
* in-process converge, and DEPS.CONVERGE_CONTRACT_MISMATCH when it speaks
|
|
54
|
+
* another contract than `host`.
|
|
55
|
+
*/
|
|
56
|
+
async function loadAppConvergeEntry(appDir, host = {
|
|
57
|
+
contract: 2,
|
|
58
|
+
version: HOST_COMPOSER_VERSION
|
|
59
|
+
}) {
|
|
60
|
+
const require = createRequire(path$1.join(appDir, "package.json"));
|
|
61
|
+
let contractFile;
|
|
62
|
+
let file;
|
|
63
|
+
try {
|
|
64
|
+
contractFile = require.resolve(CONTRACT_ENTRY);
|
|
65
|
+
file = require.resolve(ENTRY);
|
|
66
|
+
} catch (error) {
|
|
67
|
+
throw unresolvable(appDir, `${CONTRACT_ENTRY} or ${ENTRY} does not resolve.`, error);
|
|
68
|
+
}
|
|
69
|
+
const { CONVERGE_CONTRACT: appContract } = await importFile(appDir, contractFile);
|
|
70
|
+
if (typeof appContract !== "number") throw unresolvable(appDir, `${contractFile} exports no CONVERGE_CONTRACT.`);
|
|
71
|
+
if (appContract !== host.contract) throw contractMismatch(host, {
|
|
72
|
+
contract: appContract,
|
|
73
|
+
version: installedVersion(require)
|
|
74
|
+
});
|
|
75
|
+
const entry = await importFile(appDir, file);
|
|
76
|
+
const missing = ENTRY_FUNCTIONS.filter((name) => typeof entry[name] !== "function");
|
|
77
|
+
if (missing.length > 0) throw unresolvable(appDir, `${file} exports no ${missing.join(", ")}.`);
|
|
78
|
+
return blindCast({
|
|
79
|
+
lower: entry["lower"],
|
|
80
|
+
converge: entry["convergeInProcess"],
|
|
81
|
+
localTargetProviders: entry["localTargetProviders"],
|
|
82
|
+
devState: entry["devState"]
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
export { loadAppConvergeEntry as t };
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=app-converge-CVlo9uw2-B-fdr0nr.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-converge-CVlo9uw2-B-fdr0nr.mjs","names":["fs","path"],"sources":["../../../0-framework/3-tooling/cli/dist/app-converge-CVlo9uw2.mjs"],"sourcesContent":["import \"./converge-contract-DrO0Jt9l.mjs\";\nimport { createRequire } from \"node:module\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { pathToFileURL } from \"node:url\";\nimport { blindCast } from \"@internal/foundation/casts\";\n//#region package.json\nvar version = \"0.39.0-dev.8\";\n//#endregion\n//#region src/app-converge.ts\nconst ENTRY = \"@prisma/composer/internal/converge\";\nconst CONTRACT_ENTRY = \"@prisma/composer/internal/converge-contract\";\nconst ENTRY_FUNCTIONS = [\n\t\"lower\",\n\t\"convergeInProcess\",\n\t\"localTargetProviders\",\n\t\"devState\"\n];\n/** The Composer version this host runs; every Composer package carries the same one. */\nconst HOST_COMPOSER_VERSION = version;\nfunction unresolvable(appDir, detail, cause) {\n\treturn new CliStructuredError(\"DEPS.CONVERGE_UNRESOLVABLE\", `Could not load the converge from the app's @prisma/composer in \"${appDir}\": ${detail}`, {\n\t\twhy: \"`prisma deploy` and `prisma dev` run the lowering and Alchemy from the app's own install of @prisma/composer, so the app, its extensions and Alchemy share one copy of alchemy.\",\n\t\tfix: \"Install @prisma/composer in the app, at the same version as the Composer the `prisma` CLI runs.\",\n\t\t...cause === void 0 ? {} : { cause }\n\t});\n}\nfunction installedVersion(require) {\n\ttry {\n\t\tconst parsed = JSON.parse(fs.readFileSync(require.resolve(\"@prisma/composer/package.json\"), \"utf8\"));\n\t\treturn typeof parsed === \"object\" && parsed !== null && \"version\" in parsed && typeof parsed.version === \"string\" ? parsed.version : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\nasync function importFile(appDir, file) {\n\ttry {\n\t\treturn await import(pathToFileURL(file).href);\n\t} catch (error) {\n\t\tthrow unresolvable(appDir, `${file} failed to load: ${error instanceof Error ? error.message : String(error)}`, error);\n\t}\n}\nfunction contractMismatch(host, app) {\n\tconst appVersion = app.version ?? \"an unknown version\";\n\tconst update = app.contract < host.contract ? `Upgrade the app's @prisma/composer to a release that speaks converge contract ${host.contract}, such as ${host.version}.` : `Upgrade the \\`prisma\\` CLI to one that runs a Composer speaking converge contract ${app.contract}, such as ${appVersion}.`;\n\treturn new CliStructuredError(\"DEPS.CONVERGE_CONTRACT_MISMATCH\", `The app's @prisma/composer ${appVersion} speaks converge contract ${app.contract}, and the \\`prisma\\` CLI's Composer ${host.version} speaks contract ${host.contract}.`, {\n\t\twhy: \"Deploy and dev call the app's @prisma/composer from the CLI's Composer, and the two read each other's data only when they speak the same converge contract.\",\n\t\tfix: update\n\t});\n}\n/**\n* The app's `lower`, converge and local target functions, from the install `appDir` resolves. Reads the app's\n* converge contract before loading anything else. Raises\n* DEPS.CONVERGE_UNRESOLVABLE when the install is missing or predates the\n* in-process converge, and DEPS.CONVERGE_CONTRACT_MISMATCH when it speaks\n* another contract than `host`.\n*/\nasync function loadAppConvergeEntry(appDir, host = {\n\tcontract: 2,\n\tversion: HOST_COMPOSER_VERSION\n}) {\n\tconst require = createRequire(path.join(appDir, \"package.json\"));\n\tlet contractFile;\n\tlet file;\n\ttry {\n\t\tcontractFile = require.resolve(CONTRACT_ENTRY);\n\t\tfile = require.resolve(ENTRY);\n\t} catch (error) {\n\t\tthrow unresolvable(appDir, `${CONTRACT_ENTRY} or ${ENTRY} does not resolve.`, error);\n\t}\n\tconst { CONVERGE_CONTRACT: appContract } = await importFile(appDir, contractFile);\n\tif (typeof appContract !== \"number\") throw unresolvable(appDir, `${contractFile} exports no CONVERGE_CONTRACT.`);\n\tif (appContract !== host.contract) throw contractMismatch(host, {\n\t\tcontract: appContract,\n\t\tversion: installedVersion(require)\n\t});\n\tconst entry = await importFile(appDir, file);\n\tconst missing = ENTRY_FUNCTIONS.filter((name) => typeof entry[name] !== \"function\");\n\tif (missing.length > 0) throw unresolvable(appDir, `${file} exports no ${missing.join(\", \")}.`);\n\treturn blindCast({\n\t\tlower: entry[\"lower\"],\n\t\tconverge: entry[\"convergeInProcess\"],\n\t\tlocalTargetProviders: entry[\"localTargetProviders\"],\n\t\tdevState: entry[\"devState\"]\n\t});\n}\n//#endregion\nexport { loadAppConvergeEntry as t };\n\n//# sourceMappingURL=app-converge-CVlo9uw2.mjs.map"],"mappings":";;;;;;;AAQA,IAAI,UAAU;AAGd,MAAM,QAAQ;AACd,MAAM,iBAAiB;AACvB,MAAM,kBAAkB;CACvB;CACA;CACA;CACA;AACD;;AAEA,MAAM,wBAAwB;AAC9B,SAAS,aAAa,QAAQ,QAAQ,OAAO;CAC5C,OAAO,IAAI,mBAAmB,8BAA8B,mEAAmE,OAAO,KAAK,UAAU;EACpJ,KAAK;EACL,KAAK;EACL,GAAG,UAAU,KAAK,IAAI,CAAC,IAAI,EAAE,MAAM;CACpC,CAAC;AACF;AACA,SAAS,iBAAiB,SAAS;CAClC,IAAI;EACH,MAAM,SAAS,KAAK,MAAMA,KAAG,aA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AC/D,UAAU;EACV,SAAS,iBAAiB,OAAO;CAClC,CAAC;CACD,MAAM,QAAQ,MAAM,WAAW,QAAQ,IAAI;CAC3C,MAAM,UAAU,gBAAgB,QAAQ,SAAS,OAAO,MAAM,UAAU,UAAU;CAClF,IAAI,QAAQ,SAAS,GAAG,MAAM,aAAa,QAAQ,GAAG,KAAK,cAAc,QAAQ,KAAK,IAAI,EAAE,EAAE;CAC9F,OAAO,UAAU;EAChB,OAAO,MAAM;EACb,UAAU,MAAM;EAChB,sBAAsB,MAAM;EAC5B,UAAU,MAAM;CACjB,CAAC;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./app-config-DriAu5RU-C8hYpR38.mjs";
|
package/dist/config.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import "./config-
|
|
1
|
+
import { $ as ReportBeginInput, A as LocalTargetDescriptor, B as NodeDescriptor, C as LocalNodeCondition, Ct as preflightEnvVarName, D as LocalTargetAttachment, E as LocalTargetAttachInput, G as PreflightFindings, J as PrismaAppConfig, K as PreflightInput, M as LocalTargetProvidersInput, N as LocateContainerInput, O as LocalTargetCurrentApp, Q as ReportAttachInput, St as preflightEnv, T as LocalNodeStopped, U as PlatformVariableCheck, W as PlatformVariableReader, Y as ProvidersInput, at as StateDescriptor, c as CallerCredentials, d as ConfigValues, dt as containerEnvVarName, et as ReporterDescriptor, f as ContainerDescriptor, ft as defineConfig, g as DeployedEntity, gt as isBuildOnlyExtension, h as DEV_ENVIRONMENT_NAME_FILE, ht as devEnvironmentDir, j as LocalTargetEmulatorsInput, k as LocalTargetCurrentInput, l as ConfigAdapter, m as DEV_DIR, mt as deserializeContainers, n as AppConfiguration, nt as RunReporter, ot as TeardownInput, p as ContainerInstance, q as PreflightPayload, r as AppSecrets, st as UnsetPlatformVariable, tt as RunOutcome, u as ConfigAdapterInput, ut as containerEnv, w as LocalNodeLocation, wt as readPreflightPayload, x as ExtensionDescriptor, xt as platformVariableReaderText, y as DevPreflightResult, z as NamedSecrets } from "./app-config-DriAu5RU-C8hYpR38.mjs";
|
|
2
|
+
import "./config-Bpi8QVLB.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`. */
|
package/dist/config.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { n as environmentVariables, t as dotenv } from "./config-adapters-DG-uhGfv-Bt1M9f8b.mjs";
|
|
2
|
-
import { a as preflightEnv, i as platformVariableReaderText, n as containerEnvVarName, o as preflightEnvVarName, r as deserializeContainers, s as readPreflightPayload, t as containerEnv } from "./preflight-transport-
|
|
2
|
+
import { a as preflightEnv, i as platformVariableReaderText, n as containerEnvVarName, o as preflightEnvVarName, r as deserializeContainers, s as readPreflightPayload, t as containerEnv } from "./preflight-transport-2d6iIchu-B-v7Di6I.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
4
|
export { DEV_DIR, DEV_ENVIRONMENT_NAME_FILE, containerEnv, containerEnvVarName, defineConfig, deserializeContainers, devEnvironmentDir, dotenv, environmentVariables, isBuildOnlyExtension, platformVariableReaderText, preflightEnv, preflightEnvVarName, readPreflightPayload };
|
package/dist/control.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Rt as CliStructuredError } from "./graph-types-
|
|
2
|
-
import {
|
|
3
|
-
import "./config-
|
|
4
|
-
import { n as DeploymentSummary, t as DeployedNodeSummary } from "./deployment-summary-6LgQDUuu-
|
|
5
|
-
import "./index-
|
|
6
|
-
import { a as ExecutionDiagnostics, c as
|
|
7
|
-
//#region ../../0-framework/3-tooling/cli/dist/dev-current-
|
|
1
|
+
import { Rt as CliStructuredError } from "./graph-types-D4PrtP-l-B0uuchTl.mjs";
|
|
2
|
+
import { G as PreflightFindings, W as PlatformVariableReader, st as UnsetPlatformVariable } from "./app-config-DriAu5RU-C8hYpR38.mjs";
|
|
3
|
+
import "./config-Bpi8QVLB.mjs";
|
|
4
|
+
import { n as DeploymentSummary, t as DeployedNodeSummary } from "./deployment-summary-6LgQDUuu-Cu_6UNhc.mjs";
|
|
5
|
+
import "./index-D8chHe55.mjs";
|
|
6
|
+
import { a as ExecutionDiagnostics, c as dev, d as Ok, f as Result, i as DevSession, l as executionDiagnostics, n as DevEvent, o as ServiceEndpoint, r as DevInput, s as StepEvent, t as ComposerConfigSource, u as NotOk } from "./redaction-Dn7BRdaP-BcLSPhLV.mjs";
|
|
7
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-current-BiJzvHNz.d.mts
|
|
8
8
|
//#region src/operations/deploy.d.ts
|
|
9
9
|
/** A deploy step. `assemble-service` steps run inside `assemble`, one per service, and `apply-resource` steps inside `apply`, one per resource Alchemy touches. */
|
|
10
10
|
type DeployStep = {
|
|
@@ -20,22 +20,7 @@ type DeployStep = {
|
|
|
20
20
|
/** Alchemy's word for what is happening to the resource, such as `creating` or `created`, for people to read. It changes between a step's start and finish, and its values are Alchemy's, so do not branch on it. */
|
|
21
21
|
readonly status: string;
|
|
22
22
|
};
|
|
23
|
-
type DeployEvent =
|
|
24
|
-
readonly kind: 'step-started';
|
|
25
|
-
readonly step: DeployStep;
|
|
26
|
-
} | {
|
|
27
|
-
readonly kind: 'message';
|
|
28
|
-
readonly severity: 'info' | 'warn' | 'verbose';
|
|
29
|
-
/** A line Alchemy logged while it planned or applied. */
|
|
30
|
-
readonly text: string;
|
|
31
|
-
} | {
|
|
32
|
-
readonly kind: 'step-finished';
|
|
33
|
-
readonly step: DeployStep;
|
|
34
|
-
readonly outcome: 'ok' | 'failed';
|
|
35
|
-
readonly durationMs: number;
|
|
36
|
-
/** What the step measured, as its build adapter or deploy target reported it. The fields vary by adapter and target. */
|
|
37
|
-
readonly data?: Readonly<Record<string, string | number>> | undefined;
|
|
38
|
-
} |
|
|
23
|
+
type DeployEvent = StepEvent<DeployStep> |
|
|
39
24
|
/** Right after the preflight step, when it found platform variables with no value that no service needs. */
|
|
40
25
|
{
|
|
41
26
|
readonly kind: 'preflight-findings';
|
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-BiJzvHNz.d.mts","../../../0-framework/3-tooling/cli/dist/control.d.mts"],"mappings":";;;;;;;;;KAOK;WACM;;WAEA;WACA;;WAEA;;WAEA;WACA;;WAEA;;KAEN,cAAc,UAAU;;;WAGlB;WACA,UAAU;;UAIX;;;;WAIC,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;;;;;;WAOA;;;;;;;WAOA;;WAEA,YAAY,OAAO;;WAEnB,SAAS;;UAEV;;WAEC,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;;;;KC/GrE;;;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
|
-
import { t as CliStructuredError } from "./errors-
|
|
2
|
-
import { a as
|
|
1
|
+
import { t as CliStructuredError } from "./errors-DI3TBXE-.mjs";
|
|
2
|
+
import { a as devUrl, i as devStop, n as deploy, o as executionDiagnostics, r as dev, s as executorLoadFailure, u as notOk } from "./dev-current-ByY2RrbK-DbU6y3PF.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-D1jnaYqU-RAlTx-NX.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-BiRHQq6Q-BkQk0Kvo.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 {
|
|
1
|
+
{"version":3,"file":"control.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/control.mjs"],"sourcesContent":["import { l as executionDiagnostics, n as devUrl, o as deploy, r as dev, t as devStop, u as executorLoadFailure } from \"./dev-current-ByY2RrbK.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-D1jnaYqU.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-BiRHQq6Q.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,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./deploy-
|
|
1
|
+
import { vt as lower } from "./app-config-DriAu5RU-C8hYpR38.mjs";
|
|
2
|
+
import "./deploy-DHgEJDpg.mjs";
|
|
3
3
|
import "alchemy/Alchemist";
|
|
4
4
|
import "effect/Cause";
|
|
5
|
-
//#region ../../0-framework/3-tooling/cli/dist/converge-in-process-
|
|
5
|
+
//#region ../../0-framework/3-tooling/cli/dist/converge-in-process-CTomEXaD.d.mts
|
|
6
6
|
//#region src/converge-in-process.d.ts
|
|
7
7
|
/** What `lower()` returns: the stack value `Alchemist.plan` takes. */
|
|
8
8
|
type LoweredStack = ReturnType<typeof lower>;
|
|
@@ -56,7 +56,7 @@ type ConvergeOutcome = {
|
|
|
56
56
|
type Converge = (request: ConvergeRequest) => Promise<ConvergeOutcome>;
|
|
57
57
|
/**
|
|
58
58
|
* Plans and applies `stack` in this process, as `alchemy deploy --yes` would.
|
|
59
|
-
* The plan's scope, and the state-store lease it holds, closes before this
|
|
59
|
+
* The plan's scope, and the state-store lease it holds when the store has one, closes before this
|
|
60
60
|
* returns, including when `signal` interrupts it. One converge runs at a time
|
|
61
61
|
* per process, across every install of this module: a second call while one
|
|
62
62
|
* runs is refused.
|
|
@@ -64,4 +64,4 @@ type Converge = (request: ConvergeRequest) => Promise<ConvergeOutcome>;
|
|
|
64
64
|
declare const convergeInProcess: Converge;
|
|
65
65
|
//#endregion
|
|
66
66
|
export { ConvergeRequest as a, ConvergeOutcome as i, ConvergeEvent as n, LoweredStack as o, ConvergeFailureReason as r, convergeInProcess as s, Converge as t };
|
|
67
|
-
//# sourceMappingURL=converge-in-process-
|
|
67
|
+
//# sourceMappingURL=converge-in-process-CTomEXaD-BnDylZP8.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converge-in-process-
|
|
1
|
+
{"version":3,"file":"converge-in-process-CTomEXaD-BnDylZP8.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/converge-in-process-CTomEXaD.d.mts"],"mappings":";;;;;;;KAKK,eAAe,kBAAkB;;KAEjC;KACA;WACM;WACA;WACA;;WAEA;WACA,OAAO;WACP;;WAEA;WACA;WACA;;UAED;WACC;WACA,OAAO;WACP;;WAEA;;WAEA,KAAK,SAAS;WACd,SAAS;WACT,YAAY,OAAO;;WAEnB,WAAW;;;UAGZ;WACC;WACA;;KAEN;WACM;;WAEA;;WAEA;WACA,kBAAkB;;;;WAIlB;WACA;;;KAGN,YAAY,SAAS,oBAAoB,QAAQ;;;;;;;;cAQxC,mBAAmB"}
|