@prisma/composer 0.36.0-dev.3 → 0.36.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{app-config-8nfo_ECP-DngN6Z3i.d.mts → app-config-BvxeTt2h-CcVmwsq6.d.mts} +44 -6
- package/dist/app-config-BvxeTt2h-CcVmwsq6.d.mts.map +1 -0
- package/dist/arktype.d.mts +20 -6
- package/dist/arktype.d.mts.map +1 -1
- package/dist/arktype.mjs +46 -6
- package/dist/arktype.mjs.map +1 -1
- package/dist/config-Cn9vjklJ.d.mts +1 -0
- package/dist/config-adapters-BA_IeiX0-BiE51GeB.mjs +84 -0
- package/dist/config-adapters-BA_IeiX0-BiE51GeB.mjs.map +1 -0
- package/dist/config-pools-DiYw7wMu-DzeWrJdm.mjs +63 -0
- package/dist/config-pools-DiYw7wMu-DzeWrJdm.mjs.map +1 -0
- package/dist/config.d.mts +18 -3
- package/dist/config.d.mts.map +1 -0
- package/dist/config.mjs +2 -1
- package/dist/control.d.mts +11 -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-Cn9vjklJ.d.mts +1 -0
- package/dist/deploy.d.mts +2 -2
- package/dist/deploy.mjs +3 -2
- package/dist/deploy.mjs.map +1 -1
- package/dist/{deployment-summary-p88NV5m5-BZ4RWg1k.d.mts → deployment-summary-Cm4lN6w9-Dc69sCgo.d.mts} +5 -4
- package/dist/deployment-summary-Cm4lN6w9-Dc69sCgo.d.mts.map +1 -0
- package/dist/{deployment-summary-CDHdLtnO-DrE7GsHq.mjs → deployment-summary-QkZexVIS-DqL4znd4.mjs} +35 -11
- package/dist/deployment-summary-QkZexVIS-DqL4znd4.mjs.map +1 -0
- package/dist/describe-kind-Cpm_euxo-JFh8ejof.mjs +14 -0
- package/dist/describe-kind-Cpm_euxo-JFh8ejof.mjs.map +1 -0
- package/dist/{dev-current-BNoPkDRU-qQ5hObmB.mjs → dev-current-BurA9uhA-C7E-BpRH.mjs} +5 -5
- package/dist/{dev-current-BNoPkDRU-qQ5hObmB.mjs.map → dev-current-BurA9uhA-C7E-BpRH.mjs.map} +1 -1
- package/dist/{dev-environment-name-6eEr5PW8-CGk1ijP7.mjs → dev-environment-name-6eEr5PW8-BbNUVxlS.mjs} +2 -2
- package/dist/{dev-environment-name-6eEr5PW8-CGk1ijP7.mjs.map → dev-environment-name-6eEr5PW8-BbNUVxlS.mjs.map} +1 -1
- package/dist/{dist-CQVqb52E.mjs → dist-0Iux8Khv.mjs} +11 -3
- package/dist/dist-0Iux8Khv.mjs.map +1 -0
- package/dist/errors-0e8IVwzi.mjs.map +1 -1
- package/dist/{execute-deploy-destroy-BIqwt1RF-B83XdRmn.mjs → execute-deploy-destroy-Cww6zOSC-CIPx-m4I.mjs} +14 -7
- package/dist/execute-deploy-destroy-Cww6zOSC-CIPx-m4I.mjs.map +1 -0
- package/dist/{execute-dev-DIEyloWn-L5AXbxEF.mjs → execute-dev-4KYkqSMh-BP9S193k.mjs} +36 -16
- package/dist/execute-dev-4KYkqSMh-BP9S193k.mjs.map +1 -0
- package/dist/{execute-dev-current-CeKI-tiC-BMAsygzx.mjs → execute-dev-current-Cd4YEUZk-C6bs4ONa.mjs} +6 -6
- package/dist/{execute-dev-current-CeKI-tiC-BMAsygzx.mjs.map → execute-dev-current-Cd4YEUZk-C6bs4ONa.mjs.map} +1 -1
- package/dist/{execute-log-DA5AAQAA-CBNrz-1p.mjs → execute-log-BC5o35wQ-C8QWELlP.mjs} +6 -6
- package/dist/{execute-log-DA5AAQAA-CBNrz-1p.mjs.map → execute-log-BC5o35wQ-C8QWELlP.mjs.map} +1 -1
- package/dist/{graph-Dahnws6W-yKmoqSdc.d.mts → graph-CN8VuVZN-Ck2y98XZ.d.mts} +3 -3
- package/dist/graph-CN8VuVZN-Ck2y98XZ.d.mts.map +1 -0
- package/dist/{graph-KEuXGBfJ-BfR6EMoN.mjs → graph-gE31_ToO-BouKBfIS.mjs} +424 -334
- package/dist/graph-gE31_ToO-BouKBfIS.mjs.map +1 -0
- package/dist/{graph-types-Bn3tSF4x-BuHwUsq4.d.mts → graph-types-R38xjBnN-cDTIX_rZ.d.mts} +106 -82
- package/dist/graph-types-R38xjBnN-cDTIX_rZ.d.mts.map +1 -0
- package/dist/http.d.mts +2 -2
- package/dist/http.mjs +2 -2
- package/dist/{index-Ba2dpziF.d.mts → index-BHdm4Q39.d.mts} +3 -3
- package/dist/index-BHdm4Q39.d.mts.map +1 -0
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +4 -4
- package/dist/internal-pools.d.mts +18 -0
- package/dist/internal-pools.d.mts.map +1 -0
- package/dist/internal-pools.mjs +2 -0
- package/dist/{local-target-DySKw61w.mjs → local-target-zSdLvLyy.mjs} +4 -3
- package/dist/{local-target-DySKw61w.mjs.map → local-target-zSdLvLyy.mjs.map} +1 -1
- package/dist/local-target.d.mts +2 -2
- package/dist/local-target.d.mts.map +1 -1
- package/dist/local-target.mjs +1 -1
- package/dist/{nextjs-DLyeRR7M-CNdHQRgH.d.mts → nextjs-DLyeRR7M-CuGngjU4.d.mts} +3 -3
- package/dist/{nextjs-DLyeRR7M-CNdHQRgH.d.mts.map → nextjs-DLyeRR7M-CuGngjU4.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 +42 -0
- package/dist/pointer-CyQZZugO-D7k3vibs.d.mts.map +1 -0
- package/dist/report.d.mts +3 -3
- package/dist/report.mjs +1 -1
- package/dist/report.mjs.map +1 -1
- package/dist/{run-alchemy-Dl_MWw4g-BZaLckHp.mjs → run-alchemy-B-Z6i3cD-C30mHT0u.mjs} +6 -5
- package/dist/run-alchemy-B-Z6i3cD-C30mHT0u.mjs.map +1 -0
- package/dist/{secret-DoWGmN7m-DO5Brq1Y.mjs → secret-DoWGmN7m-CI5Yrldp.mjs} +18 -2
- package/dist/secret-DoWGmN7m-CI5Yrldp.mjs.map +1 -0
- package/dist/service-rpc.d.mts +2 -2
- package/dist/service-rpc.mjs +2 -2
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.mts.map +1 -1
- package/dist/{validate-environment-CEhUSEg2-D3vECWQz.mjs → validate-environment-BNZC6W46-B0ESzFBn.mjs} +49 -12
- package/dist/validate-environment-BNZC6W46-B0ESzFBn.mjs.map +1 -0
- package/dist/zod.d.mts +30 -0
- package/dist/zod.d.mts.map +1 -0
- package/dist/zod.mjs +40 -0
- package/dist/zod.mjs.map +1 -0
- package/package.json +31 -18
- package/skills/prisma-composer-core-concepts/SKILL.md +37 -24
- package/src/exports/config.ts +1 -0
- package/src/exports/internal-pools.ts +1 -0
- package/src/exports/zod.ts +1 -0
- package/dist/app-config-8nfo_ECP-DngN6Z3i.d.mts.map +0 -1
- package/dist/config-cJwLd_Uj.d.mts +0 -1
- package/dist/deploy-cJwLd_Uj.d.mts +0 -1
- package/dist/deployment-summary-CDHdLtnO-DrE7GsHq.mjs.map +0 -1
- package/dist/deployment-summary-p88NV5m5-BZ4RWg1k.d.mts.map +0 -1
- package/dist/dist-CQVqb52E.mjs.map +0 -1
- package/dist/execute-deploy-destroy-BIqwt1RF-B83XdRmn.mjs.map +0 -1
- package/dist/execute-dev-DIEyloWn-L5AXbxEF.mjs.map +0 -1
- package/dist/graph-Dahnws6W-yKmoqSdc.d.mts.map +0 -1
- package/dist/graph-KEuXGBfJ-BfR6EMoN.mjs.map +0 -1
- package/dist/graph-types-Bn3tSF4x-BuHwUsq4.d.mts.map +0 -1
- package/dist/index-Ba2dpziF.d.mts.map +0 -1
- package/dist/run-alchemy-Dl_MWw4g-BZaLckHp.mjs.map +0 -1
- package/dist/secret-CHOw4LBU-C8yXoC9N.d.mts +0 -25
- package/dist/secret-CHOw4LBU-C8yXoC9N.d.mts.map +0 -1
- package/dist/secret-DoWGmN7m-DO5Brq1Y.mjs.map +0 -1
- package/dist/validate-environment-CEhUSEg2-D3vECWQz.mjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./graph-
|
|
1
|
+
import { H as ProvisionNeed, P as NodeId, g as Graph, i as Config, j as ModuleNode, nt as ServiceNode, q as ResourceNode, r as BuildAdapter } from "./graph-types-R38xjBnN-cDTIX_rZ.mjs";
|
|
2
|
+
import "./graph-CN8VuVZN-Ck2y98XZ.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-BvxeTt2h.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
|
|
@@ -269,6 +269,8 @@ interface LowerOptions {
|
|
|
269
269
|
readonly name: string;
|
|
270
270
|
/** The environment being deployed, as `--environment` gave it. Required by any value over `environment.name`; the generated stack files always pass it. */
|
|
271
271
|
readonly environment?: string;
|
|
272
|
+
/** The config pool Load reads a source's pool key and the root's input from, and the Prisma Cloud serializer reads a service's envParam() leaves from. The generated stack files pass what readConfigPool() returns. */
|
|
273
|
+
readonly configPool?: Readonly<Record<string, unknown>>;
|
|
272
274
|
readonly bundles: Record<string, Bundle>;
|
|
273
275
|
/** Alchemy state store for the stack. Defaults to the config's own state layer. */
|
|
274
276
|
readonly state?: AlchemyStateLayer;
|
|
@@ -494,6 +496,8 @@ interface PreflightInput<C = unknown> {
|
|
|
494
496
|
readonly container: ContainerInstance | undefined;
|
|
495
497
|
/** The environment name. */
|
|
496
498
|
readonly environment: string;
|
|
499
|
+
/** The pools the command read for this environment. Preflight fills a missing `envSecret()` platform variable from `pools.secrets` and an `envParam()` param's from `pools.config`. */
|
|
500
|
+
readonly pools: ConfigPools;
|
|
497
501
|
/** What the caller has already authenticated, for the platform calls preflight makes. Absent means the extension falls back to its own credential protocol. */
|
|
498
502
|
readonly credentials?: ContainerCredentials<C> | undefined;
|
|
499
503
|
/** Hands the deploy's progress output what the check covered, as counts (e.g. `{ checked: 53, filled: 0, missing: 0 }`). Counts only: never a name or a value. */
|
|
@@ -671,6 +675,8 @@ interface LocalTargetProvidersInput {
|
|
|
671
675
|
readonly container: ContainerInstance | undefined;
|
|
672
676
|
/** Absolute path of the environment's dev state directory (`devEnvironmentDir`, under the cwd). */
|
|
673
677
|
readonly devDir: string;
|
|
678
|
+
/** The pools the command read for this environment. A local deployment takes the values its rows point at from them. */
|
|
679
|
+
readonly pools: ConfigPools;
|
|
674
680
|
}
|
|
675
681
|
interface LocalTargetEmulatorsInput {
|
|
676
682
|
/** The loaded application graph — inspected for which node kinds need an emulator. */
|
|
@@ -710,6 +716,8 @@ interface LocalTargetAttachment {
|
|
|
710
716
|
readonly address: string;
|
|
711
717
|
readonly node: ServiceNode;
|
|
712
718
|
readonly server: DevServer;
|
|
719
|
+
/** The pools the command read for this environment. The command takes the values the service's rows point at from them. */
|
|
720
|
+
readonly pools: ConfigPools;
|
|
713
721
|
}): Promise<{
|
|
714
722
|
readonly restarted: boolean;
|
|
715
723
|
}>;
|
|
@@ -757,19 +765,49 @@ type NodeDescriptor = ({
|
|
|
757
765
|
*/
|
|
758
766
|
serve?(input: ServeInput): Promise<DevServer | undefined>;
|
|
759
767
|
};
|
|
768
|
+
/** What a config adapter receives (ADR-0062). */
|
|
769
|
+
interface ConfigAdapterInput {
|
|
770
|
+
/** The environment's name, as `--environment` gave it. */
|
|
771
|
+
readonly environment: string;
|
|
772
|
+
/** The absolute directory of the prisma.config.ts that declares the `composer` section. A file adapter reads its files relative to it (ADR-0004). */
|
|
773
|
+
readonly configDirectory: string;
|
|
774
|
+
}
|
|
775
|
+
/** The values one adapter returns, by name. */
|
|
776
|
+
type ConfigValues = Readonly<Record<string, unknown>>;
|
|
777
|
+
/**
|
|
778
|
+
* A function in the `config` or `secrets` list of the `composer` section (ADR-0062):
|
|
779
|
+
* it receives the environment and returns that environment's values. Composer calls it
|
|
780
|
+
* in the CLI and again in the deploy engine's process, so it must return the same
|
|
781
|
+
* values for the same environment both times.
|
|
782
|
+
*/
|
|
783
|
+
type ConfigAdapter = (input: ConfigAdapterInput) => ConfigValues | Promise<ConfigValues>;
|
|
784
|
+
/** What the `config` adapters return, merged by top-level key, a later adapter winning: the root's input, and what `envParam()` reads. */
|
|
785
|
+
type ConfigPool = Readonly<Record<string, unknown>>;
|
|
786
|
+
/** What the `secrets` adapters return, merged the same way. Every value is text. Only preflight and local dev read it; it is never logged, reported or written anywhere but the platform variable it fills. */
|
|
787
|
+
type SecretsPool = Readonly<Record<string, string>>;
|
|
788
|
+
/** The two pools one command read for one environment. */
|
|
789
|
+
interface ConfigPools {
|
|
790
|
+
readonly config: ConfigPool;
|
|
791
|
+
readonly secrets: SecretsPool;
|
|
792
|
+
}
|
|
760
793
|
/**
|
|
761
794
|
* The config file's default export. `extensions` lists every extension the
|
|
762
795
|
* app deploys through; `state` is the ONE state store per deploy — explicit,
|
|
763
|
-
* platform-agnostic, never defaulted by an extension.
|
|
796
|
+
* platform-agnostic, never defaulted by an extension. `config` and `secrets`
|
|
797
|
+
* list the adapters the two pools come from.
|
|
764
798
|
*/
|
|
765
799
|
interface PrismaAppConfig {
|
|
766
800
|
/** The module whose default export is the app root, relative to `prisma.config.ts`. `--entry` overrides it. */
|
|
767
801
|
readonly entry?: string;
|
|
768
802
|
readonly extensions: ExtensionDescriptor[];
|
|
769
803
|
readonly state: StateDescriptor;
|
|
804
|
+
/** Where the config pool comes from. Defaults to `[environmentVariables()]`; a list given here replaces the default. */
|
|
805
|
+
readonly config?: readonly ConfigAdapter[];
|
|
806
|
+
/** Where the secrets pool comes from. Defaults to `[environmentVariables()]`; a list given here replaces the default. */
|
|
807
|
+
readonly secrets?: readonly ConfigAdapter[];
|
|
770
808
|
}
|
|
771
809
|
/** Typed identity — exists so the `composer` section of `prisma.config.ts` gets checked against PrismaAppConfig where it is written. */
|
|
772
810
|
declare function defineConfig(config: PrismaAppConfig): PrismaAppConfig;
|
|
773
811
|
//#endregion
|
|
774
|
-
export {
|
|
775
|
-
//# sourceMappingURL=app-config-
|
|
812
|
+
export { StateDescriptor as $, LocalTargetProvidersInput as A, PreflightInput as B, LocalNodeStopped as C, LocalTargetCurrentInput as D, LocalTargetCurrentApp as E, LoweredResult as F, ReportAttachInput as G, PrismaAppConfig as H, Lowering as I, RunOutcome as J, ReportBeginInput as K, NodeDescriptor as L, LowerContext as M, LowerError as N, LocalTargetDescriptor as O, LowerOptions as P, ServiceLowering as Q, Outputs as R, LocalNodeLocation as S, LocalTargetAttachment as T, ProvisionEdge as U, PreflightPayload as V, ProvisionerDescriptor as W, SecretsPool as X, RunReporter as Y, ServeInput as Z, DeployedNode as _, Bundle as a, defineConfig as at, ExtensionDescriptor as b, ConfigPool as c, isBuildOnlyExtension as ct, ContainerCredentials as d, lowering as dt, TeardownInput as et, ContainerDescriptor as f, mergedProviders as ft, DeployedEntity as g, resolveStateLayer as gt, DEV_ENVIRONMENT_NAME_FILE as h, readPreflightPayload as ht, AssembleInput as i, containerEnvVarName as it, LocateContainerInput as j, LocalTargetEmulatorsInput as k, ConfigPools as l, joinDeployment as lt, DEV_DIR as m, preflightEnvVarName as mt, ApplicationDescriptor as n, connectionInputs as nt, ConfigAdapter as o, deserializeContainers as ot, ContainerInstance as p, preflightEnv as pt, ReporterDescriptor as q, Artifact as r, containerEnv as rt, ConfigAdapterInput as s, devEnvironmentDir as st, AlchemyStateLayer as t, buildConfig as tt, ConfigValues as u, lower as ut, DeploymentResult as v, LocalTargetAttachInput as w, LocalNodeCondition as x, DevServer as y, PackageInput as z };
|
|
813
|
+
//# sourceMappingURL=app-config-BvxeTt2h-CcVmwsq6.d.mts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QAAQ;;EAEjC,QAAQ,iBAAiB;;;KAGtB;WACM;WACA;WACA;;WAEA;;WAEA;WACA,WAAW;;WAEX;;WAEA;;WAEA;WACA;;WAEA;;;;;;;;KAQN;UACK;WACC;WACA;;UAED;;WAEC,WAAW;;WAEX;;WAEA,OAAO;;UAER;;WAEC,OAAO;WACP,WAAW;;WAEX;;UAED;WACC,WAAW;;WAEX;;UAED;;EAER,iBAAiB;;EAEjB,aAAa;aACF;aACA;;;EAGX,KAAK,QAAQ,aAAa;aACf;aACA;MACP;aACO;aACA;;;;;;;;EAQX,OAAO;aACI;aACA,MAAM;aACN,QAAQ;;aAER,OAAO;MACd;aACO;;;EAGX,WAAW;;;cAGC;;;;;;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;;;;;;;KAOxB,iBAAiB,OAAO,uBAAuB,eAAe,QAAQ;;KAEtE,aAAa,SAAS;;KAEtB,cAAc,SAAS;;UAElB;WACC,QAAQ;WACR,SAAS;;;;;;;;UAQV;;WAEC;WACA,YAAY;WACZ,OAAO;;WAEP,kBAAkB;;WAElB,mBAAmB;;;iBAGb,aAAa,QAAQ,kBAAkB"}
|
package/dist/arktype.d.mts
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as SecretString, t as Pointer } from "./pointer-CyQZZugO-D7k3vibs.mjs";
|
|
2
|
+
import { Type } from "arktype";
|
|
2
3
|
//#region ../../0-framework/0-foundation/foundation/dist/arktype.d.mts
|
|
3
4
|
//#region src/arktype.d.ts
|
|
4
5
|
/**
|
|
5
|
-
* A schema leaf that accepts only a redacting `SecretString` box
|
|
6
|
-
* `input().<field>.expose()` type-checks and binding a plain
|
|
7
|
-
* fails the deploy (ADR-0042).
|
|
6
|
+
* A schema leaf that accepts only a redacting `SecretString` box or a secret
|
|
7
|
+
* pointer, so `input().<field>.expose()` type-checks and binding a plain
|
|
8
|
+
* literal there fails the deploy (ADR-0042). Its error names the refused
|
|
9
|
+
* value's kind, never the value.
|
|
8
10
|
*
|
|
9
11
|
* ```ts
|
|
10
12
|
* input: type({ signingKey: secretString() })
|
|
11
13
|
* ```
|
|
12
14
|
*/
|
|
13
|
-
declare const secretString: () => import("arktype/internal/variants/object.ts").ObjectType<SecretString
|
|
15
|
+
declare const secretString: () => import("arktype/internal/variants/object.ts").ObjectType<SecretString | Pointer<SecretString>, {}>;
|
|
16
|
+
/**
|
|
17
|
+
* Wraps the schema of one leaf field so the field also accepts a plain
|
|
18
|
+
* pointer, which stands for a value known only at boot. The field's input type
|
|
19
|
+
* is `In | Pointer<In>` and its output type `Out | Pointer<In>`, where `In` and
|
|
20
|
+
* `Out` are `inner`'s. A value that is not a pointer gets `inner`'s error.
|
|
21
|
+
* Wrap a leaf, never an object schema; put a default outside the wrapper.
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* input: type({ from: field(type('string')), port: field(type('string.integer.parse')) })
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare function field<t, $>(inner: Type<t, $>): Type<t | Pointer<Type<t, $>['inferIn']>, $>;
|
|
14
28
|
//#endregion
|
|
15
|
-
export { secretString };
|
|
29
|
+
export { field, secretString };
|
|
16
30
|
//# sourceMappingURL=arktype.d.mts.map
|
package/dist/arktype.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arktype.d.mts","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/arktype.d.mts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"arktype.d.mts","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/arktype.d.mts"],"mappings":";;;;;;;;;;;;;;cAcc,kEAAkE,WAAW,eAAe,QAAQ;;;;;;;;;;;;iBAYjG,MAAM,GAAG,GAAG,OAAO,KAAK,GAAG,KAAK,KAAK,IAAI,QAAQ,KAAK,GAAG,gBAAgB"}
|
package/dist/arktype.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
|
|
2
|
+
import { a as isSecretPointer, i as isPlainPointer, n as isSecretString } from "./secret-DoWGmN7m-CI5Yrldp.mjs";
|
|
3
|
+
import { t as describeKind } from "./describe-kind-Cpm_euxo-JFh8ejof.mjs";
|
|
2
4
|
import { type } from "arktype";
|
|
3
5
|
//#region ../../0-framework/0-foundation/foundation/dist/arktype.mjs
|
|
4
6
|
/**
|
|
@@ -7,16 +9,54 @@ import { type } from "arktype";
|
|
|
7
9
|
* module imports arktype, so an app that uses Zod never loads it.
|
|
8
10
|
*/
|
|
9
11
|
/**
|
|
10
|
-
* A schema leaf that accepts only a redacting `SecretString` box
|
|
11
|
-
* `input().<field>.expose()` type-checks and binding a plain
|
|
12
|
-
* fails the deploy (ADR-0042).
|
|
12
|
+
* A schema leaf that accepts only a redacting `SecretString` box or a secret
|
|
13
|
+
* pointer, so `input().<field>.expose()` type-checks and binding a plain
|
|
14
|
+
* literal there fails the deploy (ADR-0042). Its error names the refused
|
|
15
|
+
* value's kind, never the value.
|
|
13
16
|
*
|
|
14
17
|
* ```ts
|
|
15
18
|
* input: type({ signingKey: secretString() })
|
|
16
19
|
* ```
|
|
17
20
|
*/
|
|
18
|
-
const secretString = () => type("unknown").narrow((value, ctx) => isSecretString(value) || ctx.
|
|
21
|
+
const secretString = () => type("unknown").narrow((value, ctx) => isSecretString(value) || isSecretPointer(value) || ctx.reject({
|
|
22
|
+
expected: "a SecretString box — bind this field to a secret",
|
|
23
|
+
actual: isPlainPointer(value) ? "a value known only at boot that is not a secret" : describeKind(value)
|
|
24
|
+
}));
|
|
25
|
+
/** `error`'s message as if it were reported at `parent` joined with its own path. */
|
|
26
|
+
function messageAt(parent, error) {
|
|
27
|
+
return error.transform(({ relativePath, prefixPath, ...input }) => ({
|
|
28
|
+
...input,
|
|
29
|
+
path: [...parent, ...error.path]
|
|
30
|
+
})).message;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The error `inner` reports for the wrapped field's value: what a wrapped field
|
|
34
|
+
* reports for a value that is not a pointer. When both branches are objects,
|
|
35
|
+
* ArkType reports a union error, whose message is its problem alone, so each
|
|
36
|
+
* inner error carries its full path from the field's parent.
|
|
37
|
+
*/
|
|
38
|
+
function innerProblem(inner, field) {
|
|
39
|
+
const errors = inner(field.data);
|
|
40
|
+
if (!(errors instanceof type.errors)) return `must be ${inner.description} (was ${describeKind(field.data)})`;
|
|
41
|
+
return errors.map((error) => field.hasCode("union") ? messageAt(field.path, error) : error.problem).join("; ");
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Wraps the schema of one leaf field so the field also accepts a plain
|
|
45
|
+
* pointer, which stands for a value known only at boot. The field's input type
|
|
46
|
+
* is `In | Pointer<In>` and its output type `Out | Pointer<In>`, where `In` and
|
|
47
|
+
* `Out` are `inner`'s. A value that is not a pointer gets `inner`'s error.
|
|
48
|
+
* Wrap a leaf, never an object schema; put a default outside the wrapper.
|
|
49
|
+
*
|
|
50
|
+
* ```ts
|
|
51
|
+
* input: type({ from: field(type('string')), port: field(type('string.integer.parse')) })
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
function field(inner) {
|
|
55
|
+
const checked = blindCast(inner);
|
|
56
|
+
const pointer = type("object").narrow((value) => isPlainPointer(value));
|
|
57
|
+
return blindCast(checked.or(pointer).configure({ problem: (error) => innerProblem(checked, error) }));
|
|
58
|
+
}
|
|
19
59
|
//#endregion
|
|
20
|
-
export { secretString };
|
|
60
|
+
export { field, secretString };
|
|
21
61
|
|
|
22
62
|
//# sourceMappingURL=arktype.mjs.map
|
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 { n as isSecretString } from \"./secret-DoWGmN7m.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
|
|
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-Cw3E-nrh.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-BvxeTt2h-CcVmwsq6.mjs";
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as fs$1 from "node:fs";
|
|
2
|
+
import * as path$1 from "node:path";
|
|
3
|
+
import { parse } from "dotenv";
|
|
4
|
+
//#region ../../0-framework/3-tooling/cli/dist/config-adapters-BA_IeiX0.mjs
|
|
5
|
+
/** The prefix of the variables Composer sets for itself, such as the ones it passes its own child processes. */
|
|
6
|
+
const COMPOSER_PREFIX = "PRISMA_COMPOSER_";
|
|
7
|
+
/**
|
|
8
|
+
* Set on a child Composer starts. It maps each variable without Composer's prefix
|
|
9
|
+
* that Composer set or changed for the child to the parent's own value, or to null
|
|
10
|
+
* where the parent had none, so the child's environmentVariables() returns what the
|
|
11
|
+
* parent's did.
|
|
12
|
+
*/
|
|
13
|
+
const PARENT_VALUES_ENV = `${COMPOSER_PREFIX}PARENT_VALUES`;
|
|
14
|
+
/**
|
|
15
|
+
* Reads the process environment when called: every variable whose value is a string,
|
|
16
|
+
* except Composer's own `PRISMA_COMPOSER_` variables. The default for both `config` and `secrets`.
|
|
17
|
+
*/
|
|
18
|
+
function environmentVariables() {
|
|
19
|
+
return () => {
|
|
20
|
+
const values = {};
|
|
21
|
+
for (const [name, value] of Object.entries(process.env)) if (typeof value === "string" && !name.startsWith(COMPOSER_PREFIX)) values[name] = value;
|
|
22
|
+
for (const [name, parentValue] of parentValues()) if (parentValue === null) delete values[name];
|
|
23
|
+
else values[name] = parentValue;
|
|
24
|
+
return values;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function parentValues() {
|
|
28
|
+
const text = process.env[PARENT_VALUES_ENV];
|
|
29
|
+
if (text === void 0) return [];
|
|
30
|
+
const parsed = JSON.parse(text);
|
|
31
|
+
if (typeof parsed !== "object" || parsed === null) return [];
|
|
32
|
+
return Object.entries(parsed).filter((entry) => entry[1] === null || typeof entry[1] === "string");
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The variables Composer adds to a child's environment, plus the record of the parent's
|
|
36
|
+
* own value for each one it sets or changes outside its prefix.
|
|
37
|
+
*/
|
|
38
|
+
function childEnvironment(additions, parent = process.env) {
|
|
39
|
+
const changed = {};
|
|
40
|
+
for (const [name, value] of Object.entries(additions)) {
|
|
41
|
+
if (name.startsWith(COMPOSER_PREFIX) || value === void 0 || parent[name] === value) continue;
|
|
42
|
+
changed[name] = parent[name] ?? null;
|
|
43
|
+
}
|
|
44
|
+
return Object.keys(changed).length === 0 ? { ...additions } : {
|
|
45
|
+
...additions,
|
|
46
|
+
[PARENT_VALUES_ENV]: JSON.stringify(changed)
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function readEnvFile(file) {
|
|
50
|
+
let text;
|
|
51
|
+
try {
|
|
52
|
+
text = fs$1.readFileSync(file, "utf8");
|
|
53
|
+
} catch (error) {
|
|
54
|
+
if (isMissingFile(error)) return {};
|
|
55
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
56
|
+
throw new Error(`dotenv() could not read ${file}: ${message}`, { cause: error });
|
|
57
|
+
}
|
|
58
|
+
return parse(text);
|
|
59
|
+
}
|
|
60
|
+
function isMissingFile(error) {
|
|
61
|
+
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Reads `.env`, `.env.local`, `.env.<environment>` and `.env.<environment>.local` from the
|
|
65
|
+
* directory of prisma.config.ts, a later file winning. A missing file is skipped. It does
|
|
66
|
+
* not read the process environment.
|
|
67
|
+
*/
|
|
68
|
+
function dotenv() {
|
|
69
|
+
return ({ environment, configDirectory }) => {
|
|
70
|
+
const encoded = encodeURIComponent(environment);
|
|
71
|
+
const values = {};
|
|
72
|
+
for (const name of [
|
|
73
|
+
".env",
|
|
74
|
+
".env.local",
|
|
75
|
+
`.env.${encoded}`,
|
|
76
|
+
`.env.${encoded}.local`
|
|
77
|
+
]) Object.assign(values, readEnvFile(path$1.join(configDirectory, name)));
|
|
78
|
+
return values;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
export { dotenv as n, environmentVariables as r, childEnvironment as t };
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=config-adapters-BA_IeiX0-BiE51GeB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-adapters-BA_IeiX0-BiE51GeB.mjs","names":["fs","path"],"sources":["../../../0-framework/3-tooling/cli/dist/config-adapters-BA_IeiX0.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { parse } from \"dotenv\";\n//#region src/config-adapters.ts\n/** The prefix of the variables Composer sets for itself, such as the ones it passes its own child processes. */\nconst COMPOSER_PREFIX = \"PRISMA_COMPOSER_\";\n/**\n* Set on a child Composer starts. It maps each variable without Composer's prefix\n* that Composer set or changed for the child to the parent's own value, or to null\n* where the parent had none, so the child's environmentVariables() returns what the\n* parent's did.\n*/\nconst PARENT_VALUES_ENV = `${COMPOSER_PREFIX}PARENT_VALUES`;\n/**\n* Reads the process environment when called: every variable whose value is a string,\n* except Composer's own `PRISMA_COMPOSER_` variables. The default for both `config` and `secrets`.\n*/\nfunction environmentVariables() {\n\treturn () => {\n\t\tconst values = {};\n\t\tfor (const [name, value] of Object.entries(process.env)) if (typeof value === \"string\" && !name.startsWith(COMPOSER_PREFIX)) values[name] = value;\n\t\tfor (const [name, parentValue] of parentValues()) if (parentValue === null) delete values[name];\n\t\telse values[name] = parentValue;\n\t\treturn values;\n\t};\n}\nfunction parentValues() {\n\tconst text = process.env[PARENT_VALUES_ENV];\n\tif (text === void 0) return [];\n\tconst parsed = JSON.parse(text);\n\tif (typeof parsed !== \"object\" || parsed === null) return [];\n\treturn Object.entries(parsed).filter((entry) => entry[1] === null || typeof entry[1] === \"string\");\n}\n/**\n* The variables Composer adds to a child's environment, plus the record of the parent's\n* own value for each one it sets or changes outside its prefix.\n*/\nfunction childEnvironment(additions, parent = process.env) {\n\tconst changed = {};\n\tfor (const [name, value] of Object.entries(additions)) {\n\t\tif (name.startsWith(COMPOSER_PREFIX) || value === void 0 || parent[name] === value) continue;\n\t\tchanged[name] = parent[name] ?? null;\n\t}\n\treturn Object.keys(changed).length === 0 ? { ...additions } : {\n\t\t...additions,\n\t\t[PARENT_VALUES_ENV]: JSON.stringify(changed)\n\t};\n}\nfunction readEnvFile(file) {\n\tlet text;\n\ttry {\n\t\ttext = fs.readFileSync(file, \"utf8\");\n\t} catch (error) {\n\t\tif (isMissingFile(error)) return {};\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tthrow new Error(`dotenv() could not read ${file}: ${message}`, { cause: error });\n\t}\n\treturn parse(text);\n}\nfunction isMissingFile(error) {\n\treturn error instanceof Error && \"code\" in error && error.code === \"ENOENT\";\n}\n/**\n* Reads `.env`, `.env.local`, `.env.<environment>` and `.env.<environment>.local` from the\n* directory of prisma.config.ts, a later file winning. A missing file is skipped. It does\n* not read the process environment.\n*/\nfunction dotenv() {\n\treturn ({ environment, configDirectory }) => {\n\t\tconst encoded = encodeURIComponent(environment);\n\t\tconst values = {};\n\t\tfor (const name of [\n\t\t\t\".env\",\n\t\t\t\".env.local\",\n\t\t\t`.env.${encoded}`,\n\t\t\t`.env.${encoded}.local`\n\t\t]) Object.assign(values, readEnvFile(path.join(configDirectory, name)));\n\t\treturn values;\n\t};\n}\n//#endregion\nexport { dotenv as n, environmentVariables as r, childEnvironment as t };\n\n//# sourceMappingURL=config-adapters-BA_IeiX0.mjs.map"],"mappings":";;;;;AAKA,MAAM,kBAAkB;;;;;;;AAOxB,MAAM,oBAAoB,GAAG,gBAAgB;;;;;AAK7C,SAAS,uBAAuB;CAC/B,aAAa;EACZ,MAAM,SAAS,CAAC;EAChB,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,QAAQ,GAAG,GAAG,IAAI,OAAO,UAAU,YAAY,CAAC,KAAK,WAAW,eAAe,GAAG,OAAO,QAAQ;EAC5I,KAAK,MAAM,CAAC,MAAM,gBAAgB,aAAa,GAAG,IAAI,gBAAgB,MAAM,OAAO,OAAO;OACrF,OAAO,QAAQ;EACpB,OAAO;CACR;AACD;AACA,SAAS,eAAe;CACvB,MAAM,OAAO,QAAQ,IAAI;CACzB,IAAI,SAAS,KAAK,GAAG,OAAO,CAAC;CAC7B,MAAM,SAAS,KAAK,MAAM,IAAI;CAC9B,IAAI,OAAO,WAAW,YAAY,WAAW,MAAM,OAAO,CAAC;CAC3D,OAAO,OAAO,QAAQ,MAAM,CAAC,CAAC,QAAQ,UAAU,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,QAAQ;AAClG;;;;;AAKA,SAAS,iBAAiB,WAAW,SAAS,QAAQ,KAAK;CAC1D,MAAM,UAAU,CAAC;CACjB,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,SAAS,GAAG;EACtD,IAAI,KAAK,WAAW,eAAe,KAAK,UAAU,KAAK,KAAK,OAAO,UAAU,OAAO;EACpF,QAAQ,QAAQ,OAAO,SAAS;CACjC;CACA,OAAO,OAAO,KAAK,OAAO,CAAC,CAAC,WAAW,IAAI,EAAE,GAAG,UAAU,IAAI;EAC7D,GAAG;GACF,oBAAoB,KAAK,UAAU,OAAO;CAC5C;AACD;AACA,SAAS,YAAY,MAAM;CAC1B,IAAI;CACJ,IAAI;EACH,OAAOA,KAAG,aAAa,MAAM,MAAM;CACpC,SAAS,OAAO;EACf,IAAI,cAAc,KAAK,GAAG,OAAO,CAAC;EAClC,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EACrE,MAAM,IAAI,MAAM,2BAA2B,KAAK,IAAI,WAAW,EAAE,OAAO,MAAM,CAAC;CAChF;CACA,OAAO,MAAM,IAAI;AAClB;AACA,SAAS,cAAc,OAAO;CAC7B,OAAO,iBAAiB,SAAS,UAAU,SAAS,MAAM,SAAS;AACpE;;;;;;AAMA,SAAS,SAAS;CACjB,QAAQ,EAAE,aAAa,sBAAsB;EAC5C,MAAM,UAAU,mBAAmB,WAAW;EAC9C,MAAM,SAAS,CAAC;EAChB,KAAK,MAAM,QAAQ;GAClB;GACA;GACA,QAAQ;GACR,QAAQ,QAAQ;EACjB,GAAG,OAAO,OAAO,QAAQ,YAAYC,OAAK,KAAK,iBAAiB,IAAI,CAAC,CAAC;EACtE,OAAO;CACR;AACD"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { t as describeKind } from "./describe-kind-Cpm_euxo-JFh8ejof.mjs";
|
|
2
|
+
import { t as InternalError } from "./internal-error-Dfur7Zqt-D96dWHZK.mjs";
|
|
3
|
+
import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
|
|
4
|
+
import { r as environmentVariables } from "./config-adapters-BA_IeiX0-BiE51GeB.mjs";
|
|
5
|
+
import * as path$1 from "node:path";
|
|
6
|
+
//#region ../../0-framework/3-tooling/cli/dist/config-pools-DiYw7wMu.mjs
|
|
7
|
+
function adapterInvalid(list, index, input, summary, fix) {
|
|
8
|
+
return new CliStructuredError("CONFIG.ADAPTER_INVALID", summary, {
|
|
9
|
+
fix,
|
|
10
|
+
where: { path: input.configFile },
|
|
11
|
+
meta: { field: `${list}[${index}]` }
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function isValues(value) {
|
|
15
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
16
|
+
}
|
|
17
|
+
function isText(pool) {
|
|
18
|
+
return Object.values(pool).every((value) => typeof value === "string");
|
|
19
|
+
}
|
|
20
|
+
async function readPool(list, adapters, input) {
|
|
21
|
+
const adapterInput = Object.freeze({
|
|
22
|
+
environment: input.environment,
|
|
23
|
+
configDirectory: path$1.dirname(input.configFile)
|
|
24
|
+
});
|
|
25
|
+
const pool = Object.create(null);
|
|
26
|
+
for (const [index, adapter] of adapters.entries()) {
|
|
27
|
+
const field = `composer.${list}[${index}]`;
|
|
28
|
+
let values;
|
|
29
|
+
try {
|
|
30
|
+
values = await adapter(adapterInput);
|
|
31
|
+
} catch (thrown) {
|
|
32
|
+
throw new CliStructuredError("CONFIG.ADAPTER_FAILED", `\`${field}\` failed to read the values for the environment "${input.environment}".`, {
|
|
33
|
+
why: `It threw: ${thrown instanceof Error ? thrown.message : String(thrown)}`,
|
|
34
|
+
fix: `Fix the adapter, or remove it from \`composer.${list}\` in prisma.config.ts.`,
|
|
35
|
+
where: { path: input.configFile },
|
|
36
|
+
meta: { field: `${list}[${index}]` },
|
|
37
|
+
cause: thrown
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
if (typeof values === "function") throw adapterInvalid(list, index, input, `\`${field}\` returned a function, not an object of values.`, "An adapter factory was put in the list instead of the adapter it makes: write `dotenv()`, not `dotenv`.");
|
|
41
|
+
if (!isValues(values)) throw adapterInvalid(list, index, input, `\`${field}\` returned ${describeKind(values)}, not an object of values.`, "Return an object whose keys are the names of the values, e.g. `{ EMAIL_FROM: 'shop@example.com' }`.");
|
|
42
|
+
for (const [key, value] of Object.entries(values)) {
|
|
43
|
+
if (value === void 0) continue;
|
|
44
|
+
if (list === "secrets" && typeof value !== "string") throw adapterInvalid(list, index, input, `\`${field}\` returned ${describeKind(value)} for "${key}", but a secret is text.`, "Return the secret as a string. A platform variable holds text.");
|
|
45
|
+
pool[key] = value;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return Object.freeze(pool);
|
|
49
|
+
}
|
|
50
|
+
/** Calls the section's `config` adapters (default `[environmentVariables()]`) and merges what they return: the config pool. */
|
|
51
|
+
function readConfigPool(section, input) {
|
|
52
|
+
return readPool("config", section.config ?? [environmentVariables()], input);
|
|
53
|
+
}
|
|
54
|
+
/** Calls the section's `secrets` adapters (default `[environmentVariables()]`) and merges what they return: the secrets pool. Every value must be text. */
|
|
55
|
+
async function readSecretsPool(section, input) {
|
|
56
|
+
const pool = await readPool("secrets", section.secrets ?? [environmentVariables()], input);
|
|
57
|
+
if (!isText(pool)) throw new InternalError("readPool admitted a secret that is not text");
|
|
58
|
+
return pool;
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { readSecretsPool as n, readConfigPool as t };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=config-pools-DiYw7wMu-DzeWrJdm.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-pools-DiYw7wMu-DzeWrJdm.mjs","names":["path"],"sources":["../../../0-framework/3-tooling/cli/dist/config-pools-DiYw7wMu.mjs"],"sourcesContent":["import { r as environmentVariables } from \"./config-adapters-BA_IeiX0.mjs\";\nimport * as path from \"node:path\";\nimport { CliStructuredError, InternalError, describeKind } from \"@internal/foundation/errors\";\n//#region src/config-pools.ts\nfunction adapterInvalid(list, index, input, summary, fix) {\n\treturn new CliStructuredError(\"CONFIG.ADAPTER_INVALID\", summary, {\n\t\tfix,\n\t\twhere: { path: input.configFile },\n\t\tmeta: { field: `${list}[${index}]` }\n\t});\n}\nfunction isValues(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction isText(pool) {\n\treturn Object.values(pool).every((value) => typeof value === \"string\");\n}\nasync function readPool(list, adapters, input) {\n\tconst adapterInput = Object.freeze({\n\t\tenvironment: input.environment,\n\t\tconfigDirectory: path.dirname(input.configFile)\n\t});\n\tconst pool = Object.create(null);\n\tfor (const [index, adapter] of adapters.entries()) {\n\t\tconst field = `composer.${list}[${index}]`;\n\t\tlet values;\n\t\ttry {\n\t\t\tvalues = await adapter(adapterInput);\n\t\t} catch (thrown) {\n\t\t\tthrow new CliStructuredError(\"CONFIG.ADAPTER_FAILED\", `\\`${field}\\` failed to read the values for the environment \"${input.environment}\".`, {\n\t\t\t\twhy: `It threw: ${thrown instanceof Error ? thrown.message : String(thrown)}`,\n\t\t\t\tfix: `Fix the adapter, or remove it from \\`composer.${list}\\` in prisma.config.ts.`,\n\t\t\t\twhere: { path: input.configFile },\n\t\t\t\tmeta: { field: `${list}[${index}]` },\n\t\t\t\tcause: thrown\n\t\t\t});\n\t\t}\n\t\tif (typeof values === \"function\") throw adapterInvalid(list, index, input, `\\`${field}\\` returned a function, not an object of values.`, \"An adapter factory was put in the list instead of the adapter it makes: write `dotenv()`, not `dotenv`.\");\n\t\tif (!isValues(values)) throw adapterInvalid(list, index, input, `\\`${field}\\` returned ${describeKind(values)}, not an object of values.`, \"Return an object whose keys are the names of the values, e.g. `{ EMAIL_FROM: 'shop@example.com' }`.\");\n\t\tfor (const [key, value] of Object.entries(values)) {\n\t\t\tif (value === void 0) continue;\n\t\t\tif (list === \"secrets\" && typeof value !== \"string\") throw adapterInvalid(list, index, input, `\\`${field}\\` returned ${describeKind(value)} for \"${key}\", but a secret is text.`, \"Return the secret as a string. A platform variable holds text.\");\n\t\t\tpool[key] = value;\n\t\t}\n\t}\n\treturn Object.freeze(pool);\n}\n/** Calls the section's `config` adapters (default `[environmentVariables()]`) and merges what they return: the config pool. */\nfunction readConfigPool(section, input) {\n\treturn readPool(\"config\", section.config ?? [environmentVariables()], input);\n}\n/** Calls the section's `secrets` adapters (default `[environmentVariables()]`) and merges what they return: the secrets pool. Every value must be text. */\nasync function readSecretsPool(section, input) {\n\tconst pool = await readPool(\"secrets\", section.secrets ?? [environmentVariables()], input);\n\tif (!isText(pool)) throw new InternalError(\"readPool admitted a secret that is not text\");\n\treturn pool;\n}\n//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AM,GAAG,MAAM,eAAe,MAAM,OAAO,OAAO,KAAK,MAAM,cAAc,aAAa,MAAM,EAAE,6BAA6B,qGAAqG;EAChP,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,GAAG;GAClD,IAAI,UAAU,KAAK,GAAG;GACtB,IAAI,SAAS,aAAa,OAAO,UAAU,UAAU,MAAM,eAAe,MAAM,OAAO,OAAO,KAAK,MAAM,cAAc,aAAa,KAAK,EAAE,QAAQ,IAAI,2BAA2B,gEAAgE;GAClP,KAAK,OAAO;EACb;CACD;CACA,OAAO,OAAO,OAAO,IAAI;AAC1B;;AAEA,SAAS,eAAe,SAAS,OAAO;CACvC,OAAO,SAAS,UAAU,QAAQ,UAAU,CAAC,qBAAqB,CAAC,GAAG,KAAK;AAC5E;;AAEA,eAAe,gBAAgB,SAAS,OAAO;CAC9C,MAAM,OAAO,MAAM,SAAS,WAAW,QAAQ,WAAW,CAAC,qBAAqB,CAAC,GAAG,KAAK;CACzF,IAAI,CAAC,OAAO,IAAI,GAAG,MAAM,IAAI,cAAc,6CAA6C;CACxF,OAAO;AACR"}
|
package/dist/config.d.mts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import "./config-
|
|
3
|
-
|
|
1
|
+
import { $ as StateDescriptor, A as LocalTargetProvidersInput, B as PreflightInput, C as LocalNodeStopped, D as LocalTargetCurrentInput, E as LocalTargetCurrentApp, G as ReportAttachInput, H as PrismaAppConfig, J as RunOutcome, K as ReportBeginInput, L as NodeDescriptor, O as LocalTargetDescriptor, S as LocalNodeLocation, T as LocalTargetAttachment, V as PreflightPayload, X as SecretsPool, Y as RunReporter, at as defineConfig, b as ExtensionDescriptor, c as ConfigPool, ct as isBuildOnlyExtension, d as ContainerCredentials, et as TeardownInput, f as ContainerDescriptor, g as DeployedEntity, h as DEV_ENVIRONMENT_NAME_FILE, ht as readPreflightPayload, it as containerEnvVarName, j as LocateContainerInput, k as LocalTargetEmulatorsInput, l as ConfigPools, m as DEV_DIR, mt as preflightEnvVarName, o as ConfigAdapter, ot as deserializeContainers, p as ContainerInstance, pt as preflightEnv, q as ReporterDescriptor, rt as containerEnv, s as ConfigAdapterInput, st as devEnvironmentDir, u as ConfigValues, w as LocalTargetAttachInput, x as LocalNodeCondition } from "./app-config-BvxeTt2h-CcVmwsq6.mjs";
|
|
2
|
+
import "./config-Cn9vjklJ.mjs";
|
|
3
|
+
//#region ../../0-framework/3-tooling/cli/dist/config.d.mts
|
|
4
|
+
//#region src/config-adapters.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Reads the process environment when called: every variable whose value is a string,
|
|
7
|
+
* except Composer's own `PRISMA_COMPOSER_` variables. The default for both `config` and `secrets`.
|
|
8
|
+
*/
|
|
9
|
+
declare function environmentVariables(): ConfigAdapter;
|
|
10
|
+
/**
|
|
11
|
+
* Reads `.env`, `.env.local`, `.env.<environment>` and `.env.<environment>.local` from the
|
|
12
|
+
* directory of prisma.config.ts, a later file winning. A missing file is skipped. It does
|
|
13
|
+
* not read the process environment.
|
|
14
|
+
*/
|
|
15
|
+
declare function dotenv(): ConfigAdapter;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { ConfigAdapter, ConfigAdapterInput, ConfigPool, ConfigPools, 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, NodeDescriptor, PreflightInput, type PreflightPayload, PrismaAppConfig, ReportAttachInput, ReportBeginInput, ReporterDescriptor, RunOutcome, RunReporter, SecretsPool, StateDescriptor, TeardownInput, containerEnv, containerEnvVarName, defineConfig, deserializeContainers, devEnvironmentDir, dotenv, environmentVariables, isBuildOnlyExtension, preflightEnv, preflightEnvVarName, readPreflightPayload };
|
|
18
|
+
//# sourceMappingURL=config.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/config.d.mts"],"mappings":";;;;;;;;iBAMiB,wBAAwB;;;;;;iBAMxB,UAAU"}
|
package/dist/config.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { n as dotenv, r as environmentVariables } from "./config-adapters-BA_IeiX0-BiE51GeB.mjs";
|
|
1
2
|
import { n as containerEnvVarName, r as deserializeContainers, t as containerEnv } from "./container-transport-HcvNOGZL-twPi2TIv.mjs";
|
|
2
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";
|
|
3
4
|
import { n as preflightEnvVarName, r as readPreflightPayload, t as preflightEnv } from "./config-BFuriECI.mjs";
|
|
4
|
-
export { DEV_DIR, DEV_ENVIRONMENT_NAME_FILE, containerEnv, containerEnvVarName, defineConfig, deserializeContainers, devEnvironmentDir, isBuildOnlyExtension, preflightEnv, preflightEnvVarName, readPreflightPayload };
|
|
5
|
+
export { DEV_DIR, DEV_ENVIRONMENT_NAME_FILE, containerEnv, containerEnvVarName, defineConfig, deserializeContainers, devEnvironmentDir, dotenv, environmentVariables, isBuildOnlyExtension, preflightEnv, preflightEnvVarName, readPreflightPayload };
|
package/dist/control.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "./config-
|
|
4
|
-
import "./index-
|
|
5
|
-
import "./deploy-
|
|
6
|
-
import { n as DeploymentSummary, t as DeployedNodeSummary } from "./deployment-summary-
|
|
1
|
+
import { Ot as CliStructuredError } from "./graph-types-R38xjBnN-cDTIX_rZ.mjs";
|
|
2
|
+
import { H as PrismaAppConfig } from "./app-config-BvxeTt2h-CcVmwsq6.mjs";
|
|
3
|
+
import "./config-Cn9vjklJ.mjs";
|
|
4
|
+
import "./index-BHdm4Q39.mjs";
|
|
5
|
+
import "./deploy-Cn9vjklJ.mjs";
|
|
6
|
+
import { n as DeploymentSummary, t as DeployedNodeSummary } from "./deployment-summary-Cm4lN6w9-Dc69sCgo.mjs";
|
|
7
7
|
//#region ../../0-framework/3-tooling/cli/dist/composer-config-BJrPWlDx.d.mts
|
|
8
8
|
//#region src/composer-config.d.ts
|
|
9
9
|
/** Composer's configuration and the `prisma.config.ts` that declares it. */
|
|
@@ -42,7 +42,7 @@ interface NotOk<F> {
|
|
|
42
42
|
*/
|
|
43
43
|
type Result<T, F> = Ok<T> | NotOk<F>;
|
|
44
44
|
//#endregion
|
|
45
|
-
//#region ../../0-framework/3-tooling/cli/dist/dev-current-
|
|
45
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-current-3VmwctUt.d.mts
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region src/operations/shared.d.ts
|
|
48
48
|
/** A running service's dotted address plus its local URL — what `dev` reports
|
|
@@ -165,6 +165,10 @@ type DevEvent =
|
|
|
165
165
|
readonly kind: 'config-changed';
|
|
166
166
|
readonly file: string;
|
|
167
167
|
} |
|
|
168
|
+
/** What the `config` or `secrets` adapters return changed since the session started. The session keeps the values it started with and stops rebuilding until it is restarted. */
|
|
169
|
+
{
|
|
170
|
+
readonly kind: 'values-changed';
|
|
171
|
+
} |
|
|
168
172
|
/** The app keeps running, still watching. */
|
|
169
173
|
{
|
|
170
174
|
readonly kind: 'converge-failed';
|
package/dist/control.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/composer-config-BJrPWlDx.d.mts","../../../0-framework/0-foundation/foundation/dist/result.d.mts","../../../0-framework/3-tooling/cli/dist/dev-current-
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/composer-config-BJrPWlDx.d.mts","../../../0-framework/0-foundation/foundation/dist/result.d.mts","../../../0-framework/3-tooling/cli/dist/dev-current-3VmwctUt.d.mts","../../../0-framework/3-tooling/cli/dist/control.d.mts"],"mappings":";;;;;;;;;UAGU;;WAEC,OAAO;;WAEP;;;;;;;;UCHD,GAAG;WACF;WACA,OAAO;EAChB,YAAY;EACZ;;;;;UAKQ,MAAM;WACL;WACA,SAAS;EAClB;EACA,eAAe;;;;;;;;KAQZ,OAAO,GAAG,KAAK,GAAG,KAAK,MAAM;;;;;;;UCwDxB;WACC;WACA;;WAEA;;;;;;;;;;UA0CD;;;WAGC;;;;WAIA;WACA;WACA;WACA;;;;;;iBAMM,qBAAqB,GAAG,qBAAqB;;;;KAIzD;WACM;;WAEA;WACA;;KAEN;WACM;WACA,MAAM;;WAEN;WACA,MAAM;WACN;WACA;;WAEA,OAAO,SAAS;;UAIjB;;;;WAIC,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;;;;;;WAOA;;;;;;;WAOA;;WAEA,YAAY,OAAO;;UAEpB;;;WAGC,SAAS;;WAET;;iBAEM,OAAO,OAAO,cAAc,QAAQ,OAAO,eAAe;;;KAOtE;;;WAGM;WACA,oBAAoB;;WAEpB;WACA;;;;WAIA;WACA;;WAEA;WACA;;;;WAIA;WACA;;;;WAIA;WACA;;;;WAIA;;;;WAIA;WACA;WACA;WACA;;;;WAIA;WACA;WACA;WACA;;;;WAIA;WACA;WACA;;;;WAIA;WACA;WACA;;WAEA;;;;WAIA;WACA;;WAEA;;UAED;;;;WAIC,QAAQ;;WAER;WACA;;WAEA;;WAEA;;;;;;WAMA;WACA;WACA,YAAY,OAAO;;;;;UAKpB;;WAEC,oBAAoB;;;EAG7B,QAAQ;;WAEC,QAAQ;;iBAEF,IAAI,OAAO,WAAW,QAAQ,OAAO,YAAY;;;UAOxD;;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;;;;KCnWrE;;;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-BurA9uhA-C7E-BpRH.mjs";
|
|
3
3
|
import { n as RUN_REPORT_VERSION, t as RUN_REPORT_FILE_ENV } from "./run-report-CmBz2-xc-S50d4g5V.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-Cww6zOSC-CIPx-m4I.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-BC5o35wQ-C8QWELlP.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-BurA9uhA.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-Cww6zOSC.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-BC5o35wQ.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"log\", error));\n\t}\n\treturn executor.executeLog(input, deps, cwd);\n}\n//#endregion\nexport { RUN_REPORT_FILE_ENV, RUN_REPORT_VERSION, deploy, destroy, dev, devStop, devUrl, executionDiagnostics, log };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;AAaA,eAAe,QAAQ,OAAO;CAC7B,OAAO,gBAAgB,OAAO,CAAC,CAAC;AACjC;;;;AAIA,eAAe,gBAAgB,OAAO,MAAM;CAC3C,IAAI,OAAO,MAAM,gBAAgB,YAAY,MAAM,YAAY,WAAW,GAAG,OAAO,MAAM,oBAAoB,CAAC;CAC/G,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,WAAW,KAAK,CAAC;CACnD;CACA,OAAO,SAAS,eAAe,OAAO,MAAM,GAAG;AAChD;AACA,SAAS,sBAAsB;CAC9B,OAAO,IAAI,mBAAmB,+BAA+B,yDAAyD;EACrH,KAAK;EACL,KAAK;CACN,CAAC;AACF;AAGA,eAAe,IAAI,OAAO;CACzB,OAAO,YAAY,OAAO,CAAC,CAAC;AAC7B;;;;AAIA,eAAe,YAAY,OAAO,MAAM;CACvC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,OAAO,KAAK,CAAC;CAC/C;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./app-config-BvxeTt2h-CcVmwsq6.mjs";
|
package/dist/deploy.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./deploy-
|
|
1
|
+
import { F as LoweredResult, I as Lowering, M as LowerContext, N as LowerError, P as LowerOptions, Q as ServiceLowering, R as Outputs, U as ProvisionEdge, W as ProvisionerDescriptor, Z as ServeInput, _ as DeployedNode, a as Bundle, dt as lowering, ft as mergedProviders, g as DeployedEntity, gt as resolveStateLayer, i as AssembleInput, lt as joinDeployment, n as ApplicationDescriptor, nt as connectionInputs, r as Artifact, t as AlchemyStateLayer, tt as buildConfig, ut as lower, v as DeploymentResult, y as DevServer, z as PackageInput } from "./app-config-BvxeTt2h-CcVmwsq6.mjs";
|
|
2
|
+
import "./deploy-Cn9vjklJ.mjs";
|
|
3
3
|
export { AlchemyStateLayer, ApplicationDescriptor, Artifact, AssembleInput, Bundle, DeployedEntity, DeployedNode, DeploymentResult, DevServer, LowerContext, LowerError, LowerOptions, LoweredResult, Lowering, Outputs, PackageInput, ProvisionEdge, ProvisionerDescriptor, ServeInput, ServiceLowering, buildConfig, connectionInputs, joinDeployment, lower, lowering, mergedProviders, resolveStateLayer };
|
package/dist/deploy.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as slotsOf, l as isParamSource, t as Load } from "./graph-gE31_ToO-BouKBfIS.mjs";
|
|
2
2
|
import { r as deserializeContainers } from "./container-transport-HcvNOGZL-twPi2TIv.mjs";
|
|
3
3
|
import * as Alchemy from "alchemy";
|
|
4
4
|
import * as Effect from "effect/Effect";
|
|
@@ -208,7 +208,8 @@ function lowering(root, config, opts) {
|
|
|
208
208
|
return Effect.gen(function* () {
|
|
209
209
|
const graph = Load(root, {
|
|
210
210
|
id: opts.name,
|
|
211
|
-
...opts.environment !== void 0 ? { environment: { name: opts.environment } } : {}
|
|
211
|
+
...opts.environment !== void 0 ? { environment: { name: opts.environment } } : {},
|
|
212
|
+
...opts.configPool !== void 0 ? { configPool: opts.configPool } : {}
|
|
212
213
|
});
|
|
213
214
|
const extensions = yield* extensionsById(config);
|
|
214
215
|
const containers = deserializeContainers(config.extensions, process.env);
|