@prisma/composer 0.2.0 → 0.3.0-dev.10
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-DJdU4ubR-BwioNK8j.d.mts → app-config-bsTo57A8-BfG21wAI.d.mts} +89 -5
- package/dist/app-config-bsTo57A8-BfG21wAI.d.mts.map +1 -0
- package/dist/app-config-joXc-BKm-CdcXqNMD.mjs +22 -0
- package/dist/app-config-joXc-BKm-CdcXqNMD.mjs.map +1 -0
- package/dist/arktype.d.mts +16 -0
- package/dist/arktype.d.mts.map +1 -0
- package/dist/arktype.mjs +22 -0
- package/dist/arktype.mjs.map +1 -0
- package/dist/assertions.d.mts.map +1 -0
- package/dist/bin.mjs +2444 -206
- package/dist/bin.mjs.map +1 -1
- package/dist/{casts-Ci5rYYaR.mjs → casts-DpaahrlC-C5XMnP9S.mjs} +2 -2
- package/dist/casts-DpaahrlC-C5XMnP9S.mjs.map +1 -0
- package/dist/casts.d.mts.map +1 -0
- package/dist/casts.mjs +1 -1
- package/dist/config-DUzvB5cQ.d.mts +1 -0
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +2 -9
- package/dist/deploy-C4DxNkJ9-D73lmBqy.mjs +313 -0
- package/dist/deploy-C4DxNkJ9-D73lmBqy.mjs.map +1 -0
- package/dist/deploy-DUzvB5cQ.d.mts +1 -0
- package/dist/deploy.d.mts +2 -2
- package/dist/deploy.mjs +1 -311
- package/dist/{dist-B0axxnBf.mjs → dist-BdvFDCLV.mjs} +12 -76
- package/dist/dist-BdvFDCLV.mjs.map +1 -0
- package/dist/{graph-B7NcPiOr-aSUOCGTH.d.mts → graph-DDpXh7S8-b-93BcHn.d.mts} +3 -3
- package/dist/graph-DDpXh7S8-b-93BcHn.d.mts.map +1 -0
- package/dist/{graph-BmrUEdo9-6Oq1hSmS.mjs → graph-DgbALPDo-BEHF94BN.mjs} +75 -52
- package/dist/graph-DgbALPDo-BEHF94BN.mjs.map +1 -0
- package/dist/{graph-types-BgT9UEdm-Bz-_OcJH.d.mts → graph-types-C3FOaaXm-C6_rGzfn.d.mts} +87 -87
- package/dist/graph-types-C3FOaaXm-C6_rGzfn.d.mts.map +1 -0
- package/dist/index-BQVrMGfe.d.mts +22 -0
- package/dist/index-BQVrMGfe.d.mts.map +1 -0
- package/dist/index.d.mts +5 -4
- package/dist/index.mjs +4 -3
- package/dist/local-target.d.mts +29 -0
- package/dist/local-target.d.mts.map +1 -0
- package/dist/local-target.mjs +47 -0
- package/dist/local-target.mjs.map +1 -0
- package/dist/{nextjs-DLyeRR7M-B9ukbB2L.d.mts → nextjs-DLyeRR7M-D47aMmfr.d.mts} +3 -3
- package/dist/nextjs-DLyeRR7M-D47aMmfr.d.mts.map +1 -0
- package/dist/nextjs-control.d.mts +4 -4
- package/dist/nextjs-control.d.mts.map +1 -0
- package/dist/nextjs-control.mjs +2 -1
- package/dist/nextjs-control.mjs.map +1 -1
- package/dist/nextjs.d.mts +1 -1
- package/dist/node-control.d.mts +3 -3
- package/dist/node-control.d.mts.map +1 -0
- package/dist/node-control.mjs +44 -25
- package/dist/node-control.mjs.map +1 -1
- package/dist/node.d.mts +2 -2
- package/dist/node.d.mts.map +1 -0
- package/dist/report.d.mts +2 -2
- package/dist/report.d.mts.map +1 -0
- package/dist/report.mjs +4 -0
- package/dist/report.mjs.map +1 -1
- package/dist/secret-CHOw4LBU-C8yXoC9N.d.mts +25 -0
- package/dist/secret-CHOw4LBU-C8yXoC9N.d.mts.map +1 -0
- package/dist/secret-DoWGmN7m-DO5Brq1Y.mjs +55 -0
- package/dist/secret-DoWGmN7m-DO5Brq1Y.mjs.map +1 -0
- package/dist/service-rpc.d.mts +15 -5
- package/dist/service-rpc.d.mts.map +1 -0
- package/dist/service-rpc.mjs +6 -4
- package/dist/service-rpc.mjs.map +1 -1
- package/dist/testing.d.mts +17 -11
- package/dist/testing.d.mts.map +1 -0
- package/dist/testing.mjs +12 -20
- package/dist/testing.mjs.map +1 -1
- package/package.json +15 -12
- package/src/exports/arktype.ts +1 -0
- package/src/exports/assertions.ts +1 -0
- package/src/exports/casts.ts +1 -0
- package/src/exports/config.ts +1 -0
- package/src/exports/deploy.ts +1 -0
- package/src/exports/index.ts +1 -0
- package/src/exports/local-target.ts +1 -0
- package/src/exports/nextjs-control.ts +1 -0
- package/src/exports/nextjs.ts +2 -0
- package/src/exports/node-control.ts +1 -0
- package/src/exports/node.ts +2 -0
- package/src/exports/report.ts +1 -0
- package/src/exports/service-rpc.ts +1 -0
- package/src/exports/testing.ts +1 -0
- package/dist/casts-Ci5rYYaR.mjs.map +0 -1
- package/dist/config-ByZICgry.d.mts +0 -1
- package/dist/config.mjs.map +0 -1
- package/dist/deploy-ByZICgry.d.mts +0 -1
- package/dist/deploy.mjs.map +0 -1
- package/dist/dist-B0axxnBf.mjs.map +0 -1
- package/dist/graph-BmrUEdo9-6Oq1hSmS.mjs.map +0 -1
- package/dist/index-B2DJ5CN4.d.mts +0 -32
|
@@ -1,30 +1,5 @@
|
|
|
1
1
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
2
|
-
//#region ../../0-framework/
|
|
3
|
-
//#region src/secret.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* A value wrapper that redacts everywhere except the one explicit reader,
|
|
6
|
-
* `expose()`. Sensitivity is carried by the TYPE (`SecretBox<T>`), not a flag a
|
|
7
|
-
* sink must remember to check: `String(box)`, template interpolation,
|
|
8
|
-
* `JSON.stringify`, and `console.log`/`util.inspect` all print `[REDACTED]`, so
|
|
9
|
-
* a secret can't leak through an accidental log or serialization.
|
|
10
|
-
*
|
|
11
|
-
* Shape matches the platform's own `secrecy` type (pdp-control-plane). The class
|
|
12
|
-
* is nominal enough on its own — no phantom brand.
|
|
13
|
-
*/
|
|
14
|
-
declare class SecretBox<T> {
|
|
15
|
-
#private;
|
|
16
|
-
constructor(value: T);
|
|
17
|
-
/** The sole explicit door to the wrapped value. */
|
|
18
|
-
expose(): T;
|
|
19
|
-
toString(): string;
|
|
20
|
-
toJSON(): string;
|
|
21
|
-
valueOf(): string;
|
|
22
|
-
[Symbol.toPrimitive](): string;
|
|
23
|
-
}
|
|
24
|
-
/** The common case: a secret string. */
|
|
25
|
-
type SecretString = SecretBox<string>;
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region ../../0-framework/1-core/core/dist/graph-types-BgT9UEdm.d.mts
|
|
2
|
+
//#region ../../0-framework/1-core/core/dist/graph-types-C3FOaaXm.d.mts
|
|
28
3
|
//#region src/config.d.ts
|
|
29
4
|
/**
|
|
30
5
|
* A declared config param — pure data: a caller-owned Standard Schema
|
|
@@ -99,18 +74,18 @@ interface Config {
|
|
|
99
74
|
*/
|
|
100
75
|
declare function configOf(root: ServiceNode): readonly ConfigDeclaration[];
|
|
101
76
|
/**
|
|
102
|
-
* The app's
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
77
|
+
* The app's input manifest: every service input binding a `provision()` call
|
|
78
|
+
* supplied (ADR-0042). Pure graph introspection, TARGET-AGNOSTIC — a deploy
|
|
79
|
+
* target's recursive descent classifies the binding's leaves (its preflight
|
|
80
|
+
* verifies each `envSecret` leaf's platform var exists before deploy; the
|
|
81
|
+
* values are provisioned out-of-band).
|
|
107
82
|
*/
|
|
108
|
-
declare function
|
|
83
|
+
declare function inputManifest(graph: Graph): readonly ServiceInputBinding[];
|
|
109
84
|
/**
|
|
110
85
|
* The app's param-binding manifest: every param a `provision()` call bound —
|
|
111
86
|
* literal or an opaque, target-defined `ParamSource` — at the address that
|
|
112
87
|
* declared it. The param sibling of `provisionManifest`, for a deploy
|
|
113
|
-
* target's own preflight to consume
|
|
88
|
+
* target's own preflight to consume. Pure graph introspection,
|
|
114
89
|
* TARGET-AGNOSTIC; a param this manifest omits simply falls back to its own
|
|
115
90
|
* `default` at `buildConfig`.
|
|
116
91
|
*/
|
|
@@ -152,7 +127,7 @@ interface SecretNeed {
|
|
|
152
127
|
readonly [SECRET_NEED]: true;
|
|
153
128
|
readonly kind: 'secret';
|
|
154
129
|
}
|
|
155
|
-
/** A
|
|
130
|
+
/** A module's secret-forwarding slots: name → the need it declares. */
|
|
156
131
|
type Secrets = Record<string, SecretNeed>;
|
|
157
132
|
/** The wiring value bound to a secret slot: a target-defined payload core forwards but never inspects. A target (e.g. @prisma/composer-prisma-cloud's `envSecret`) builds one via `secretSource()`. */
|
|
158
133
|
interface SecretSource<T = unknown> {
|
|
@@ -160,10 +135,8 @@ interface SecretSource<T = unknown> {
|
|
|
160
135
|
/** Target-defined. Core never reads this; the target that authored the source reads it back. */
|
|
161
136
|
readonly payload: T;
|
|
162
137
|
}
|
|
163
|
-
/** What `provision(
|
|
138
|
+
/** What `provision(moduleChild, { secrets })` supplies: one source per declared secret slot. */
|
|
164
139
|
type SecretBindings<S extends Secrets> = { [K in keyof S]: SecretSource; };
|
|
165
|
-
/** What `secrets()` returns: one redacting SecretBox per declared slot. */
|
|
166
|
-
type SecretValues<S extends Secrets> = { readonly [K in keyof S]: SecretString; };
|
|
167
140
|
/** Declares a secret NEED. Nameless — the platform name is bound at the root via `envSecret`. */
|
|
168
141
|
declare function secret(): SecretNeed;
|
|
169
142
|
/** Builds an opaque secret source from a target-defined payload — the SPI a deploy target's own source constructor (e.g. `envSecret`) calls. Core forwards the source and never inspects the payload. */
|
|
@@ -208,6 +181,19 @@ declare function paramNeed(): ParamNeed;
|
|
|
208
181
|
type ParamBindings<P extends Params> = { readonly [K in keyof P]?: StandardSchemaV1.InferOutput<P[K]['schema']> | ParamSource; };
|
|
209
182
|
/** What `provision(moduleChild, { params })` accepts per declared `ParamNeed`: a `ParamSource` only — a need carries no schema to validate a literal against. */
|
|
210
183
|
type ParamNeedBindings<PN extends ParamNeeds> = { readonly [K in keyof PN]?: ParamSource; };
|
|
184
|
+
/**
|
|
185
|
+
* What `provision(service, { input })` accepts (ADR-0042): a plain object
|
|
186
|
+
* mirroring the service's input schema, whose leaves are literals,
|
|
187
|
+
* `envParam(...)` sources, or `envSecret(...)` sources. Deliberately a
|
|
188
|
+
* best-effort structural type: the framework never introspects a Standard
|
|
189
|
+
* Schema, so the binding's exact shape cannot be derived from it — deploy-time
|
|
190
|
+
* validation of the resolved binding is the real check.
|
|
191
|
+
*/
|
|
192
|
+
type InputBinding = string | number | boolean | null | ParamSource | SecretSource | readonly InputBinding[] | {
|
|
193
|
+
readonly [key: string]: InputBinding;
|
|
194
|
+
};
|
|
195
|
+
/** What `input()` returns: the schema's validated output type; `never` on a service that declares no input schema. */
|
|
196
|
+
type InputValueOf<I> = I extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<I> : never;
|
|
211
197
|
/** Opaque `Contract<any, any>` bound shared by every node/port type that doesn't care which contract. */
|
|
212
198
|
type AnyContract = Contract<any, any>;
|
|
213
199
|
/** How a service's app becomes a runnable artifact — the build descriptor's routing key (`extension`/`type`) plus paths resolved relative to the authoring module. */
|
|
@@ -242,7 +228,7 @@ interface ResourceNode<C extends AnyContract = AnyContract> {
|
|
|
242
228
|
* inert until run, and carries NO runtime behavior — an extension's factory
|
|
243
229
|
* wraps it into a runnable/loadable shape (see RunnableServiceNode).
|
|
244
230
|
*/
|
|
245
|
-
interface ServiceNode<D extends Deps = Deps, P extends Params = Params, E extends Expose = Expose,
|
|
231
|
+
interface ServiceNode<D extends Deps = Deps, P extends Params = Params, E extends Expose = Expose, I extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined> {
|
|
246
232
|
readonly [NODE]: true;
|
|
247
233
|
readonly kind: 'service';
|
|
248
234
|
/** Human-readable, given at authoring — logs/diagnostics only; identity remains the deploy address (ADR-0006). */
|
|
@@ -251,10 +237,10 @@ interface ServiceNode<D extends Deps = Deps, P extends Params = Params, E extend
|
|
|
251
237
|
readonly extension: string;
|
|
252
238
|
readonly type: string;
|
|
253
239
|
readonly inputs: D;
|
|
254
|
-
/**
|
|
240
|
+
/** Extension-reserved config declarations (e.g. compute's `port`) — never user-authored (ADR-0042). */
|
|
255
241
|
readonly params: P;
|
|
256
|
-
/**
|
|
257
|
-
readonly
|
|
242
|
+
/** The service's whole incoming configuration as ONE Standard Schema (authored as `input`, ADR-0042), or `undefined` when it takes none. The framework never introspects it — it only calls `~standard.validate`. Named `inputSchema` on the node so the data field does not collide with the `input()` accessor. */
|
|
243
|
+
readonly inputSchema: I;
|
|
258
244
|
/** How the app's entry is built + assembled. */
|
|
259
245
|
readonly build: BuildAdapter;
|
|
260
246
|
/** Named output ports this service exposes — the Contracts a consumer's `rpc(contract)` can require. `undefined` when the service exposes nothing. */
|
|
@@ -262,15 +248,14 @@ interface ServiceNode<D extends Deps = Deps, P extends Params = Params, E extend
|
|
|
262
248
|
}
|
|
263
249
|
/**
|
|
264
250
|
* The extension's runnable/loadable service node. `run` boots the app after
|
|
265
|
-
* deserializing its
|
|
266
|
-
*
|
|
251
|
+
* deserializing its environment; `load` reads the hydrated deps and `input`
|
|
252
|
+
* the validated, typed input object (ADR-0042).
|
|
267
253
|
*/
|
|
268
|
-
interface RunnableServiceNode<D extends Deps = Deps, P extends Params = Params, E extends Expose = Expose,
|
|
254
|
+
interface RunnableServiceNode<D extends Deps = Deps, P extends Params = Params, E extends Expose = Expose, I extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined> extends ServiceNode<D, P, E, I> {
|
|
269
255
|
run(address: string, boot: () => Promise<unknown>): Promise<unknown>;
|
|
270
256
|
load(): HydratedDeps<D>;
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
secrets(): SecretValues<S>;
|
|
257
|
+
/** The service's validated input — one typed object, secrets as redacting `SecretString` boxes (ADR-0042). */
|
|
258
|
+
input(): InputValueOf<I>;
|
|
274
259
|
}
|
|
275
260
|
/**
|
|
276
261
|
* A service's dependency slot. At Load the enclosing module wires a
|
|
@@ -349,19 +334,36 @@ type ReqOf<DE> = DE extends DependencyEnd<any, infer Req> ? Req : never;
|
|
|
349
334
|
*/
|
|
350
335
|
type DepBindings<D extends Deps> = { [K in keyof D]: NoInfer<ReqOf<D[K]>> | InputRef<D[K]>; };
|
|
351
336
|
/**
|
|
352
|
-
*
|
|
353
|
-
* `name`)
|
|
354
|
-
*
|
|
355
|
-
* `
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
337
|
+
* A SERVICE provision's trailing options: an explicit `id` (default: the
|
|
338
|
+
* node's own `name`); `deps` required exactly when the node declares
|
|
339
|
+
* dependency slots (`[keyof D] extends [never]` is the "no slots" test);
|
|
340
|
+
* `input` required exactly when the node declares an input schema (ADR-0042).
|
|
341
|
+
* `params` is always optional — it binds only extension-reserved params (e.g.
|
|
342
|
+
* compute's `port`), which fall back to their own defaults.
|
|
343
|
+
*/
|
|
344
|
+
type ServiceProvisionArgs<D extends Deps, I extends StandardSchemaV1 | undefined, PB> = [keyof D] extends [never] ? I extends undefined ? [opts?: {
|
|
345
|
+
id?: string;
|
|
346
|
+
params?: PB;
|
|
347
|
+
}] : [opts: {
|
|
348
|
+
id?: string;
|
|
349
|
+
input: InputBinding;
|
|
350
|
+
params?: PB;
|
|
351
|
+
}] : I extends undefined ? [opts: {
|
|
352
|
+
id?: string;
|
|
353
|
+
deps: DepBindings<D>;
|
|
354
|
+
params?: PB;
|
|
355
|
+
}] : [opts: {
|
|
356
|
+
id?: string;
|
|
357
|
+
deps: DepBindings<D>;
|
|
358
|
+
input: InputBinding;
|
|
359
|
+
params?: PB;
|
|
360
|
+
}];
|
|
361
|
+
/**
|
|
362
|
+
* A child-MODULE provision's trailing options: `deps`/`secrets` required
|
|
363
|
+
* exactly when the module declares the slots; a declared param-forwarding
|
|
364
|
+
* slot may be bound to a `ParamSource`.
|
|
363
365
|
*/
|
|
364
|
-
type
|
|
366
|
+
type ModuleProvisionArgs<D extends Deps, S extends Secrets, PB> = [keyof D] extends [never] ? [keyof S] extends [never] ? [opts?: {
|
|
365
367
|
id?: string;
|
|
366
368
|
params?: PB;
|
|
367
369
|
}] : [opts: {
|
|
@@ -385,22 +387,22 @@ interface ModuleBuilder {
|
|
|
385
387
|
}): {
|
|
386
388
|
readonly id: string;
|
|
387
389
|
} & RefPort<C>;
|
|
388
|
-
/** Registers an owned service; its id defaults to the node's `name`; `deps`/`
|
|
389
|
-
provision<D extends Deps, P extends Params, E extends Expose,
|
|
390
|
+
/** Registers an owned service; its id defaults to the node's `name`; `deps`/`input` are required iff it declares them; a reserved param may be bound (literal or `ParamSource`), overriding its default. */
|
|
391
|
+
provision<D extends Deps, P extends Params, E extends Expose, I extends StandardSchemaV1 | undefined>(service: ServiceNode<D, P, E, I>, ...args: ServiceProvisionArgs<D, I, ParamBindings<P>>): ProvisionedRef<E>;
|
|
390
392
|
/**
|
|
391
|
-
* The service call with `deps`/`
|
|
392
|
-
* cannot resolve while `D`/`
|
|
393
|
-
* wrapper like `cron()` provisioning a caller-supplied service — so
|
|
394
|
-
* site resolves to this concrete overload instead.
|
|
393
|
+
* The service call with `deps`/`input` spelled out. `ServiceProvisionArgs`
|
|
394
|
+
* above cannot resolve while `D`/`I` are still unbound type parameters — a
|
|
395
|
+
* generic wrapper like `cron()` provisioning a caller-supplied service — so
|
|
396
|
+
* that call site resolves to this concrete overload instead.
|
|
395
397
|
*/
|
|
396
|
-
provision<D extends Deps, P extends Params, E extends Expose,
|
|
398
|
+
provision<D extends Deps, P extends Params, E extends Expose, I extends StandardSchemaV1 | undefined>(service: ServiceNode<D, P, E, I>, opts: {
|
|
397
399
|
id?: string;
|
|
398
400
|
deps: DepBindings<D>;
|
|
399
|
-
|
|
401
|
+
input?: InputBinding;
|
|
400
402
|
params?: ParamBindings<P>;
|
|
401
403
|
}): ProvisionedRef<E>;
|
|
402
404
|
/** Registers an owned child module; its id defaults to the node's `name`; `deps`/`secrets` are required iff it declares them; a declared param-forwarding slot may be bound to a `ParamSource`. */
|
|
403
|
-
provision<D extends Deps, E extends Expose, S extends Secrets, PN extends ParamNeeds>(child: ModuleNode<D, E, S, PN>, ...args:
|
|
405
|
+
provision<D extends Deps, E extends Expose, S extends Secrets, PN extends ParamNeeds>(child: ModuleNode<D, E, S, PN>, ...args: ModuleProvisionArgs<D, S, ParamNeedBindings<PN>>): ProvisionedRef<E>;
|
|
404
406
|
/** The child-module call with `deps`/`secrets` spelled out — the same generic-wrapper escape as the service overload above. */
|
|
405
407
|
provision<D extends Deps, E extends Expose, S extends Secrets, PN extends ParamNeeds>(child: ModuleNode<D, E, S, PN>, opts: {
|
|
406
408
|
id?: string;
|
|
@@ -451,18 +453,19 @@ declare function resource<C extends AnyContract>(def: {
|
|
|
451
453
|
}): ResourceNode<C>;
|
|
452
454
|
/**
|
|
453
455
|
* Constructs a branded, frozen Service node — declarations only (inputs,
|
|
454
|
-
* params, build adapter, and the ports it exposes). Pure;
|
|
456
|
+
* params, the input schema, build adapter, and the ports it exposes). Pure;
|
|
457
|
+
* carries no runtime behavior.
|
|
455
458
|
*/
|
|
456
|
-
declare function service<D extends Deps, P extends Params, E extends Expose = Record<never, never>,
|
|
459
|
+
declare function service<D extends Deps, P extends Params, E extends Expose = Record<never, never>, I extends StandardSchemaV1 | undefined = undefined>(def: {
|
|
457
460
|
name: string;
|
|
458
461
|
extension: string;
|
|
459
462
|
type: string;
|
|
460
463
|
inputs: D;
|
|
461
464
|
params: P;
|
|
462
|
-
|
|
465
|
+
input?: I;
|
|
463
466
|
build: BuildAdapter;
|
|
464
467
|
expose?: E;
|
|
465
|
-
}): ServiceNode<D, P, E,
|
|
468
|
+
}): ServiceNode<D, P, E, I>;
|
|
466
469
|
/**
|
|
467
470
|
* Constructs a branded, frozen DependencyEnd. `required` (if given) is the
|
|
468
471
|
* contract Load compares a wired ref against via `satisfies()`; an unnamed
|
|
@@ -519,19 +522,16 @@ interface Edge {
|
|
|
519
522
|
readonly kind: 'input' | 'dependency';
|
|
520
523
|
}
|
|
521
524
|
/**
|
|
522
|
-
* A
|
|
523
|
-
*
|
|
524
|
-
* address
|
|
525
|
-
*
|
|
526
|
-
* preflight manifest aggregates the sources.
|
|
525
|
+
* A service's provision-time input binding (ADR-0042): the plain object a
|
|
526
|
+
* `provision(service, { input })` call supplied, recorded at that service's
|
|
527
|
+
* address. Core never walks it beyond usage tracking; the deploy target's
|
|
528
|
+
* recursive descent classifies its leaves (literals, `envParam`, `envSecret`).
|
|
527
529
|
*/
|
|
528
|
-
interface
|
|
529
|
-
/** The graph address of the service that declares the
|
|
530
|
+
interface ServiceInputBinding {
|
|
531
|
+
/** The graph address of the service that declares the input schema. */
|
|
530
532
|
readonly serviceAddress: NodeId;
|
|
531
|
-
/** The
|
|
532
|
-
readonly
|
|
533
|
-
/** The opaque source the root bound the slot to. Core never inspects it; the deploy target reads back its own payload. */
|
|
534
|
-
readonly source: SecretSource;
|
|
533
|
+
/** The binding object supplied at provision. */
|
|
534
|
+
readonly binding: InputBinding;
|
|
535
535
|
}
|
|
536
536
|
/**
|
|
537
537
|
* A resolved param binding: a `provision()` call bound a service's param
|
|
@@ -554,8 +554,8 @@ interface Graph {
|
|
|
554
554
|
/** Root + one per input, topo-ordered (deps first). */
|
|
555
555
|
readonly nodes: readonly GraphNode[];
|
|
556
556
|
readonly edges: readonly Edge[];
|
|
557
|
-
/** Every service
|
|
558
|
-
readonly
|
|
557
|
+
/** Every service input binding a `provision()` call supplied (ADR-0042). */
|
|
558
|
+
readonly inputBindings: readonly ServiceInputBinding[];
|
|
559
559
|
/** Every service param bound at provision — literal or source; unbound params are absent here and fall back to their `default` (see `buildConfig`). */
|
|
560
560
|
readonly params: readonly ParamBinding[];
|
|
561
561
|
}
|
|
@@ -564,5 +564,5 @@ declare class LoadError extends Error {
|
|
|
564
564
|
constructor(message: string);
|
|
565
565
|
}
|
|
566
566
|
//#endregion
|
|
567
|
-
export {
|
|
568
|
-
//# sourceMappingURL=graph-types-
|
|
567
|
+
export { module as $, ParamSource as A, SecretSource as B, NODE as C, ParamNeed as D, ParamBindings as E, ResourceNode as F, configOf as G, ServiceInputBinding as H, ResourceNodeBase as I, inputManifest as J, dependency as K, RunnableServiceNode as L, ProvisionNeed as M, ProvisionedRef as N, ParamNeedBindings as O, RefPort as P, isSecretSource as Q, SecretBindings as R, ModuleOutputs as S, ParamBinding as T, ServiceNode as U, Secrets as V, Values as W, isParamSource as X, isNode as Y, isProvisionNeed as Z, InputValueOf as _, Connection as a, provisionNeed as at, ModuleContext as b, Deps as c, secretSource as ct, Graph as d, number as et, GraphNode as f, InputRef as g, InputBinding as h, ConfigParam as i, paramSource as it, Params as j, ParamNeeds as k, Edge as l, service as lt, HydratedDeps as m, Config as n, paramManifest as nt, Contract as o, resource as ot, Hydrated as p, freezeNode as q, ConfigDeclaration as r, paramNeed as rt, DependencyEnd as s, secret as st, BuildAdapter as t, param as tt, Expose as u, string as ut, LoadError as v, NodeId as w, ModuleNode as x, ModuleBuilder as y, SecretNeed as z };
|
|
568
|
+
//# sourceMappingURL=graph-types-C3FOaaXm-C6_rGzfn.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-types-C3FOaaXm-C6_rGzfn.d.mts","names":[],"sources":["../../../0-framework/1-core/core/dist/graph-types-C3FOaaXm.d.mts"],"mappings":";;;;;;;;;;;UAUU,YAAY,UAAU,mBAAmB;WACxC,QAAQ;WACR;WACA,UAAU,iBAAiB,YAAY;;;;;;;WAOvC,YAAY;;KAElB,SAAS,eAAe;;KAExB,OAAO,UAAU,sBAAsB,WAAW,IAAI,EAAE,gDAAgD,EAAE,gBAAgB,iBAAiB,YAAY,EAAE,4BAA4B,iBAAiB,YAAY,EAAE,gBAAgB,iBAAiB,YAAY,EAAE;;;;;;;UAO9P,WAAW,UAAU,SAAS,QAAQ;WACrC,QAAQ;EACjB,QAAQ,QAAQ,OAAO,KAAK,IAAI,QAAQ;;;;;;;;;;UAUhC;WACC;aACE;;WAEF;WACA,QAAQ,SAAS;WACjB;WACA;;;;;;;;;;UAUD;WACC,SAAS,SAAS;WAClB,QAAQ,SAAS,eAAe,SAAS;;;;;;;;;;;iBAWnC,SAAS,MAAM,uBAAuB;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@ -0,0 +1,22 @@
|
|
|
1
|
+
import { U as ServiceNode, c as Deps, m as HydratedDeps, n as Config } from "./graph-types-C3FOaaXm-C6_rGzfn.mjs";
|
|
2
|
+
import "./graph-DDpXh7S8-b-93BcHn.mjs";
|
|
3
|
+
//#region ../../0-framework/1-core/core/dist/index.d.mts
|
|
4
|
+
//#region src/hydrate.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Given a service and a concrete typed Config, hydrate every input
|
|
7
|
+
* (connection.hydrate with its typed value slice). A resource dep and a
|
|
8
|
+
* connection dep hydrate through identical machinery — the loaded client is
|
|
9
|
+
* indistinguishable. The service's own params ride alongside in
|
|
10
|
+
* `config.service`; the node's `load()` merges the two.
|
|
11
|
+
*/
|
|
12
|
+
declare function hydrate(root: ServiceNode, config: Config): Promise<HydratedDeps<Deps>>;
|
|
13
|
+
/**
|
|
14
|
+
* Synchronous hydrate — what the node's `load()` uses so
|
|
15
|
+
* `const { db } = service.load()` reads without `await`. Requires every
|
|
16
|
+
* connection.hydrate to return synchronously; a Promise return is a loud error
|
|
17
|
+
* naming the input (an async client factory must use the async `hydrate` path).
|
|
18
|
+
*/
|
|
19
|
+
declare function hydrateSync(root: ServiceNode, config: Config): HydratedDeps<Deps>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { hydrateSync as n, hydrate as t };
|
|
22
|
+
//# sourceMappingURL=index-BQVrMGfe.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BQVrMGfe.d.mts","names":[],"sources":["../../../0-framework/1-core/core/dist/index.d.mts"],"mappings":";;;;;;;;;;;iBAWiB,QAAQ,MAAM,aAAa,QAAQ,SAAS,QAAQ,aAAa;;;;;;;iBAOjE,YAAY,MAAM,aAAa,QAAQ,SAAS,aAAa"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { n as SecretString, r as isSecretString, t as SecretBox } from "./secret-CHOw4LBU-C8yXoC9N.mjs";
|
|
2
|
+
import { $ as module, A as ParamSource, B as SecretSource, C as NODE, D as ParamNeed, E as ParamBindings, F as ResourceNode, G as configOf, H as ServiceInputBinding, I as ResourceNodeBase, J as inputManifest, K as dependency, L as RunnableServiceNode, M as ProvisionNeed, N as ProvisionedRef, O as ParamNeedBindings, P as RefPort, Q as isSecretSource, R as SecretBindings, S as ModuleOutputs, T as ParamBinding, U as ServiceNode, V as Secrets, W as Values, X as isParamSource, Y as isNode, Z as isProvisionNeed, _ as InputValueOf, a as Connection, at as provisionNeed, b as ModuleContext, c as Deps, ct as secretSource, d as Graph, et as number, f as GraphNode, g as InputRef, h as InputBinding, i as ConfigParam, it as paramSource, j as Params, k as ParamNeeds, l as Edge, lt as service, m as HydratedDeps, n as Config, nt as paramManifest, o as Contract, ot as resource, p as Hydrated, q as freezeNode, r as ConfigDeclaration, rt as paramNeed, s as DependencyEnd, st as secret, t as BuildAdapter, tt as param, u as Expose, ut as string, v as LoadError, w as NodeId, x as ModuleNode, y as ModuleBuilder, z as SecretNeed } from "./graph-types-C3FOaaXm-C6_rGzfn.mjs";
|
|
3
|
+
import { t as Load } from "./graph-DDpXh7S8-b-93BcHn.mjs";
|
|
4
|
+
import { n as hydrateSync, t as hydrate } from "./index-BQVrMGfe.mjs";
|
|
5
|
+
export { type BuildAdapter, type Config, type ConfigDeclaration, type ConfigParam, type Connection, type Contract, type DependencyEnd, type Deps, type Edge, type Expose, type Graph, type GraphNode, type Hydrated, type HydratedDeps, type InputBinding, type InputRef, type InputValueOf, Load, LoadError, type ModuleBuilder, type ModuleContext, type ModuleNode, type ModuleOutputs, type NODE, type NodeId, type ParamBinding, type ParamBindings, type ParamNeed, type ParamNeedBindings, type ParamNeeds, type ParamSource, type Params, type ProvisionNeed, type ProvisionedRef, type RefPort, type ResourceNode, ResourceNodeBase, type RunnableServiceNode, type SecretBindings, SecretBox, type SecretNeed, type SecretSource, type SecretString, type Secrets, type ServiceInputBinding, type ServiceNode, type Values, configOf, dependency, freezeNode, hydrate, hydrateSync, inputManifest, isNode, isParamSource, isProvisionNeed, isSecretSource, isSecretString, module, number, param, paramManifest, paramNeed, paramSource, provisionNeed, resource, secret, secretSource, service, string };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { _ as service, a as freezeNode, c as isProvisionNeed, d as paramNeed, f as paramSource, g as secretSource, h as secret, i as dependency, l as isSecretSource, m as resource, n as LoadError, o as isNode, p as provisionNeed, r as ResourceNodeBase, s as isParamSource, t as Load, u as module } from "./graph-
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { _ as service, a as freezeNode, c as isProvisionNeed, d as paramNeed, f as paramSource, g as secretSource, h as secret, i as dependency, l as isSecretSource, m as resource, n as LoadError, o as isNode, p as provisionNeed, r as ResourceNodeBase, s as isParamSource, t as Load, u as module } from "./graph-DgbALPDo-BEHF94BN.mjs";
|
|
2
|
+
import { n as isSecretString, t as SecretBox } from "./secret-DoWGmN7m-DO5Brq1Y.mjs";
|
|
3
|
+
import { a as number, c as string, i as inputManifest, n as hydrate, o as param, r as hydrateSync, s as paramManifest, t as configOf } from "./dist-BdvFDCLV.mjs";
|
|
4
|
+
export { Load, LoadError, ResourceNodeBase, SecretBox, configOf, dependency, freezeNode, hydrate, hydrateSync, inputManifest, isNode, isParamSource, isProvisionNeed, isSecretSource, isSecretString, module, number, param, paramManifest, paramNeed, paramSource, provisionNeed, resource, secret, secretSource, service, string };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { O as PrismaAppConfig, _ as LocalTargetProvidersInput, c as DEV_DIR, g as LocalTargetEmulatorsInput, h as LocalTargetDescriptor, m as LocalTargetAttachment, p as LocalTargetAttachInput, s as ContainerInstance } from "./app-config-bsTo57A8-BfG21wAI.mjs";
|
|
2
|
+
import * as Layer from "effect/Layer";
|
|
3
|
+
//#region ../../0-framework/1-core/core/dist/local-target.d.mts
|
|
4
|
+
//#region src/control/local-target.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Resolves every non-build-only configured extension's lazy `localTarget`
|
|
7
|
+
* thunk, once (ADR-0041's lazy local-target reference — operator directive:
|
|
8
|
+
* the production control entry carries only the thunk, never the
|
|
9
|
+
* descriptor, so resolving it is this module's job, not something a deploy
|
|
10
|
+
* path ever does). A build-only extension (`isBuildOnlyExtension`) owns no
|
|
11
|
+
* resources or services and is skipped entirely — never even checked for a
|
|
12
|
+
* `localTarget` thunk. Every other configured extension must be
|
|
13
|
+
* local-target-capable, or the dev command cannot bring the app up at all,
|
|
14
|
+
* so a missing thunk throws naming the extension. The generated dev stack
|
|
15
|
+
* module calls this once and threads the resolved map through every
|
|
16
|
+
* subsequent hook, including `localTargetProviders`.
|
|
17
|
+
*/
|
|
18
|
+
declare function resolveLocalTargets(config: PrismaAppConfig): Promise<ReadonlyMap<string, LocalTargetDescriptor>>;
|
|
19
|
+
/**
|
|
20
|
+
* All configured extensions' local-target providers merged, config array
|
|
21
|
+
* order (ADR-0041), from the ALREADY-RESOLVED descriptor map
|
|
22
|
+
* (`resolveLocalTargets`'s product — this function itself never touches a
|
|
23
|
+
* `localTarget` thunk). The generated dev stack module is this
|
|
24
|
+
* aggregator's one caller, passing the result as `LowerOptions.providers`.
|
|
25
|
+
*/
|
|
26
|
+
declare function localTargetProviders(resolved: ReadonlyMap<string, LocalTargetDescriptor>, containers: ReadonlyMap<string, ContainerInstance>, devDir: string): Layer.Layer<never>;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { DEV_DIR, type LocalTargetAttachInput, type LocalTargetAttachment, type LocalTargetDescriptor, type LocalTargetEmulatorsInput, type LocalTargetProvidersInput, localTargetProviders, resolveLocalTargets };
|
|
29
|
+
//# sourceMappingURL=local-target.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-target.d.mts","names":[],"sources":["../../../0-framework/1-core/core/dist/local-target.d.mts"],"mappings":";;;;;;;;;;;;;;;;;iBAgBiB,oBAAoB,QAAQ,kBAAkB,QAAQ,oBAAoB;;;;;;;;iBAQ1E,qBAAqB,UAAU,oBAAoB,wBAAwB,YAAY,oBAAoB,oBAAoB,iBAAiB,MAAM"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { r as isBuildOnlyExtension, t as DEV_DIR } from "./app-config-joXc-BKm-CdcXqNMD.mjs";
|
|
2
|
+
import { t as LowerError } from "./deploy-C4DxNkJ9-D73lmBqy.mjs";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
//#region ../../0-framework/1-core/core/dist/local-target.mjs
|
|
5
|
+
/** The local-target stack's own provider aggregation (ADR-0041; naming, operator 2026-07-23 — the seam is `localTarget`, "dev" names the user-facing feature only) — the local-target counterpart of `deploy.ts`'s `mergedProviders`, kept in its own module so `lower()` learns nothing about it (deploy.ts's REVISED — operator review of #162). */
|
|
6
|
+
function noLocalTargetSupportError(id) {
|
|
7
|
+
return new LowerError(`extension "${id}" has no dev support — it declares no \`localTarget\` descriptor (ADR-0041).`);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Resolves every non-build-only configured extension's lazy `localTarget`
|
|
11
|
+
* thunk, once (ADR-0041's lazy local-target reference — operator directive:
|
|
12
|
+
* the production control entry carries only the thunk, never the
|
|
13
|
+
* descriptor, so resolving it is this module's job, not something a deploy
|
|
14
|
+
* path ever does). A build-only extension (`isBuildOnlyExtension`) owns no
|
|
15
|
+
* resources or services and is skipped entirely — never even checked for a
|
|
16
|
+
* `localTarget` thunk. Every other configured extension must be
|
|
17
|
+
* local-target-capable, or the dev command cannot bring the app up at all,
|
|
18
|
+
* so a missing thunk throws naming the extension. The generated dev stack
|
|
19
|
+
* module calls this once and threads the resolved map through every
|
|
20
|
+
* subsequent hook, including `localTargetProviders`.
|
|
21
|
+
*/
|
|
22
|
+
async function resolveLocalTargets(config) {
|
|
23
|
+
const entries = await Promise.all(config.extensions.flatMap((extension) => {
|
|
24
|
+
if (isBuildOnlyExtension(extension)) return [];
|
|
25
|
+
if (extension.localTarget === void 0) throw noLocalTargetSupportError(extension.id);
|
|
26
|
+
return [extension.localTarget().then((descriptor) => [extension.id, descriptor])];
|
|
27
|
+
}));
|
|
28
|
+
return new Map(entries);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* All configured extensions' local-target providers merged, config array
|
|
32
|
+
* order (ADR-0041), from the ALREADY-RESOLVED descriptor map
|
|
33
|
+
* (`resolveLocalTargets`'s product — this function itself never touches a
|
|
34
|
+
* `localTarget` thunk). The generated dev stack module is this
|
|
35
|
+
* aggregator's one caller, passing the result as `LowerOptions.providers`.
|
|
36
|
+
*/
|
|
37
|
+
function localTargetProviders(resolved, containers, devDir) {
|
|
38
|
+
const [first, ...rest] = [...resolved.entries()].map(([id, descriptor]) => descriptor.providers({
|
|
39
|
+
container: containers.get(id),
|
|
40
|
+
devDir
|
|
41
|
+
}));
|
|
42
|
+
return first === void 0 ? Layer.empty : Layer.mergeAll(first, ...rest);
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { DEV_DIR, localTargetProviders, resolveLocalTargets };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=local-target.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-target.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/local-target.mjs"],"sourcesContent":["import { t as LowerError } from \"./deploy-C4DxNkJ9.mjs\";\nimport { r as isBuildOnlyExtension, t as DEV_DIR } from \"./app-config-joXc-BKm.mjs\";\nimport * as Layer from \"effect/Layer\";\n//#region src/control/local-target.ts\n/** The local-target stack's own provider aggregation (ADR-0041; naming, operator 2026-07-23 — the seam is `localTarget`, \"dev\" names the user-facing feature only) — the local-target counterpart of `deploy.ts`'s `mergedProviders`, kept in its own module so `lower()` learns nothing about it (deploy.ts's REVISED — operator review of #162). */\nfunction noLocalTargetSupportError(id) {\n\treturn new LowerError(`extension \"${id}\" has no dev support — it declares no \\`localTarget\\` descriptor (ADR-0041).`);\n}\n/**\n* Resolves every non-build-only configured extension's lazy `localTarget`\n* thunk, once (ADR-0041's lazy local-target reference — operator directive:\n* the production control entry carries only the thunk, never the\n* descriptor, so resolving it is this module's job, not something a deploy\n* path ever does). A build-only extension (`isBuildOnlyExtension`) owns no\n* resources or services and is skipped entirely — never even checked for a\n* `localTarget` thunk. Every other configured extension must be\n* local-target-capable, or the dev command cannot bring the app up at all,\n* so a missing thunk throws naming the extension. The generated dev stack\n* module calls this once and threads the resolved map through every\n* subsequent hook, including `localTargetProviders`.\n*/\nasync function resolveLocalTargets(config) {\n\tconst entries = await Promise.all(config.extensions.flatMap((extension) => {\n\t\tif (isBuildOnlyExtension(extension)) return [];\n\t\tif (extension.localTarget === void 0) throw noLocalTargetSupportError(extension.id);\n\t\treturn [extension.localTarget().then((descriptor) => [extension.id, descriptor])];\n\t}));\n\treturn new Map(entries);\n}\n/**\n* All configured extensions' local-target providers merged, config array\n* order (ADR-0041), from the ALREADY-RESOLVED descriptor map\n* (`resolveLocalTargets`'s product — this function itself never touches a\n* `localTarget` thunk). The generated dev stack module is this\n* aggregator's one caller, passing the result as `LowerOptions.providers`.\n*/\nfunction localTargetProviders(resolved, containers, devDir) {\n\tconst [first, ...rest] = [...resolved.entries()].map(([id, descriptor]) => descriptor.providers({\n\t\tcontainer: containers.get(id),\n\t\tdevDir\n\t}));\n\treturn first === void 0 ? Layer.empty : Layer.mergeAll(first, ...rest);\n}\n//#endregion\nexport { DEV_DIR, localTargetProviders, resolveLocalTargets };\n\n//# sourceMappingURL=local-target.mjs.map"],"mappings":";;;;;AAKA,SAAS,0BAA0B,IAAI;CACtC,OAAO,IAAI,WAAW,cAAc,GAAG,6EAA6E;AACrH;;;;;;;;;;;;;;AAcA,eAAe,oBAAoB,QAAQ;CAC1C,MAAM,UAAU,MAAM,QAAQ,IAAI,OAAO,WAAW,SAAS,cAAc;EAC1E,IAAI,qBAAqB,SAAS,GAAG,OAAO,CAAC;EAC7C,IAAI,UAAU,gBAAgB,KAAK,GAAG,MAAM,0BAA0B,UAAU,EAAE;EAClF,OAAO,CAAC,UAAU,YAAY,CAAC,CAAC,MAAM,eAAe,CAAC,UAAU,IAAI,UAAU,CAAC,CAAC;CACjF,CAAC,CAAC;CACF,OAAO,IAAI,IAAI,OAAO;AACvB;;;;;;;;AAQA,SAAS,qBAAqB,UAAU,YAAY,QAAQ;CAC3D,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC,GAAG,SAAS,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,gBAAgB,WAAW,UAAU;EAC/F,WAAW,WAAW,IAAI,EAAE;EAC5B;CACD,CAAC,CAAC;CACF,OAAO,UAAU,KAAK,IAAI,MAAM,QAAQ,MAAM,SAAS,OAAO,GAAG,IAAI;AACtE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as BuildAdapter } from "./graph-types-
|
|
2
|
-
import "./index-
|
|
1
|
+
import { t as BuildAdapter } from "./graph-types-C3FOaaXm-C6_rGzfn.mjs";
|
|
2
|
+
import "./index-BQVrMGfe.mjs";
|
|
3
3
|
//#region ../../0-framework/2-authoring/nextjs/dist/nextjs-DLyeRR7M.d.mts
|
|
4
4
|
//#region src/nextjs.d.ts
|
|
5
5
|
/** The nextjs build adapter's descriptor — `appDir` is this kind's own extra path input (the Next app root), beyond the shared `{ extension, type, module, entry }`. `entry` is a placeholder; the assembler locates `server.js` in the standalone tree. */
|
|
@@ -13,4 +13,4 @@ declare const nextjsBuild: (opts: {
|
|
|
13
13
|
}) => NextjsBuildAdapter;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { nextjsBuild as n, NextjsBuildAdapter as t };
|
|
16
|
-
//# sourceMappingURL=nextjs-DLyeRR7M-
|
|
16
|
+
//# sourceMappingURL=nextjs-DLyeRR7M-D47aMmfr.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextjs-DLyeRR7M-D47aMmfr.d.mts","names":[],"sources":["../../../0-framework/2-authoring/nextjs/dist/nextjs-DLyeRR7M.d.mts"],"mappings":";;;;;UAGU,2BAA2B;WAC1B;WACA;;cAEG,cAAc;EAC1B;EACA;MACI"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as Bundle,
|
|
2
|
-
import "./config-
|
|
3
|
-
import "./deploy-
|
|
4
|
-
import { t as NextjsBuildAdapter } from "./nextjs-DLyeRR7M-
|
|
1
|
+
import { a as Bundle, f as ExtensionDescriptor, i as AssembleInput } from "./app-config-bsTo57A8-BfG21wAI.mjs";
|
|
2
|
+
import "./config-DUzvB5cQ.mjs";
|
|
3
|
+
import "./deploy-DUzvB5cQ.mjs";
|
|
4
|
+
import { t as NextjsBuildAdapter } from "./nextjs-DLyeRR7M-D47aMmfr.mjs";
|
|
5
5
|
//#region ../../0-framework/2-authoring/nextjs/dist/control.d.mts
|
|
6
6
|
//#region src/control/build.d.ts
|
|
7
7
|
/** The built standalone server.js for a nextjs build — `appDir`'s standalone root plus the app subpath Next recorded. Single-sourced so `assemble()` (deploy) and the integration-test seam can't drift. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextjs-control.d.mts","names":[],"sources":["../../../0-framework/2-authoring/nextjs/dist/control.d.mts"],"mappings":";;;;;;;iBAKiB,qBAAqB,OAAO;iBAC5B,SAAS,OAAO,gBAAkB,QAAQ;;cAE7C,mBAAmB"}
|
package/dist/nextjs-control.mjs
CHANGED
|
@@ -88,7 +88,8 @@ async function assemble(input) {
|
|
|
88
88
|
if (!fs.existsSync(path.join(workDir, "main.mjs"))) throw new Error(`esbuild produced no main.mjs in ${workDir}`);
|
|
89
89
|
return {
|
|
90
90
|
dir: workDir,
|
|
91
|
-
entry: path.posix.join("bundle", appRel.split(path.sep).join("/"), "server.js")
|
|
91
|
+
entry: path.posix.join("bundle", appRel.split(path.sep).join("/"), "server.js"),
|
|
92
|
+
watch: [standaloneRoot]
|
|
92
93
|
};
|
|
93
94
|
}
|
|
94
95
|
/** The nextjs build extension descriptor — `prisma-composer.config.ts` lists it under `extensions`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nextjs-control.mjs","names":[],"sources":["../../../0-framework/2-authoring/nextjs/dist/control.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { build } from \"esbuild\";\n//#region src/control/build.ts\n/**\n* The extension's control entry (ADR-0017): `nextjsBuild()` returns the build\n* descriptor `prisma-composer.config.ts` lists. Deploy-only (ADR-0005): the user\n* runs `next build` (`output: \"standalone\"`); `assemble` then performs the\n* *documented* Next standalone deploy — it ships the standalone tree and copies\n* in the client assets Next deliberately omits (`.next/static`, `public/`) — and\n* adds the framework's boot wrapper. This is the canonical `cp` step from the\n* Next docs, run at deploy so no app needs a build-script for it.\n*\n* It does not guess: the app's location inside the standalone tree (deep, when\n* `outputFileTracingRoot` is the monorepo root) is *read from Next's own build\n* manifest* (`.next/required-server-files.json`'s `relativeAppDir`), never walked\n* for or computed from a hardcoded depth. It does not launder: node_modules is\n* shipped exactly as `next build` produced it, so a symlinked (non-hoisted)\n* node_modules is the packager's hard error — the same misconfiguration crashes\n* the standalone server at boot, so it must be a flat install (npm, or pnpm/bun\n* with a hoisted node-linker).\n*\n* Artifact layout: `<workDir>/main.mjs` (our wrapper) + `<workDir>/bundle/`\n* (the standalone tree, with static/public copied in). The packager adds\n* `bootstrap.js` + the manifest at the root; bootstrap imports main.mjs, whose\n* run() dynamically imports `./bundle/<relativeAppDir>/server.js`.\n*\n* Paths are file-relative (ADR-0004): `appDir` resolves against\n* `dirname(build.module)`.\n*/\n/** Narrows the shared BuildAdapter to this extension's own descriptor — the value-level mirror of the registry routing on (extension, type). */\nfunction isNextjsBuild(descriptor) {\n\treturn descriptor.type === \"nextjs\" && \"appDir\" in descriptor && typeof descriptor.appDir === \"string\";\n}\n/**\n* The app's own subpath within `.next/standalone`, as an OS-relative path. Next\n* mirrors the app's location under `outputFileTracingRoot` (deep, when that's the\n* monorepo root); rather than walk the tree for `server.js`, we read where Next\n* put it from `.next/required-server-files.json` — `relativeAppDir` is exactly\n* that subpath. Older Next lacks the field; fall back to computing it from the\n* same manifest's `config.outputFileTracingRoot`.\n*/\nfunction nextAppRel(appDir) {\n\tconst manifestPath = path.join(appDir, \".next\", \"required-server-files.json\");\n\tif (!fs.existsSync(manifestPath)) throw new Error(`no ${path.join(\".next\", \"required-server-files.json\")} under ${appDir} — run \\`next build\\` with output: \"standalone\" first.`);\n\tconst manifest = JSON.parse(fs.readFileSync(manifestPath, \"utf8\"));\n\tconst relativeAppDir = manifest?.relativeAppDir;\n\tconst tracingRoot = manifest?.config?.outputFileTracingRoot;\n\tconst posixRel = typeof relativeAppDir === \"string\" ? relativeAppDir : typeof tracingRoot === \"string\" ? path.relative(tracingRoot, appDir).split(path.sep).join(\"/\") : void 0;\n\tif (posixRel === void 0) throw new Error(`${manifestPath} records neither relativeAppDir nor config.outputFileTracingRoot — cannot locate the standalone server`);\n\treturn posixRel.split(\"/\").join(path.sep);\n}\n/** The built standalone server.js for a nextjs build — `appDir`'s standalone root plus the app subpath Next recorded. Single-sourced so `assemble()` (deploy) and the integration-test seam can't drift. */\nfunction standaloneServerPath(build) {\n\tconst appDir = path.resolve(path.dirname(fileURLToPath(build.module)), build.appDir);\n\treturn path.join(appDir, \".next\", \"standalone\", nextAppRel(appDir), \"server.js\");\n}\nasync function assemble(input) {\n\tif (!isNextjsBuild(input.build)) throw new Error(`@prisma/composer/nextjs/control: expected a \"nextjs\" build adapter (with appDir), got \"${input.build.type}\".`);\n\tconst buildDescriptor = input.build;\n\tconst appDir = path.resolve(path.dirname(fileURLToPath(buildDescriptor.module)), buildDescriptor.appDir);\n\tconst standaloneRoot = path.join(appDir, \".next\", \"standalone\");\n\tif (!fs.existsSync(standaloneRoot)) throw new Error(`no ${path.join(\".next\", \"standalone\")} under ${appDir} — run \\`next build\\` with output: \"standalone\" first.`);\n\tconst appRel = nextAppRel(appDir);\n\tconst workDir = path.join(input.cwd, \".prisma-composer\", \"artifacts\", input.address);\n\tawait fs.promises.rm(workDir, {\n\t\trecursive: true,\n\t\tforce: true\n\t});\n\tawait fs.promises.mkdir(workDir, { recursive: true });\n\tconst bundleDir = path.join(workDir, \"bundle\");\n\tawait fs.promises.cp(standaloneRoot, bundleDir, { recursive: true });\n\tconst appOut = path.join(bundleDir, appRel);\n\tconst staticSrc = path.join(appDir, \".next\", \"static\");\n\tif (fs.existsSync(staticSrc)) await fs.promises.cp(staticSrc, path.join(appOut, \".next\", \"static\"), { recursive: true });\n\tconst publicSrc = path.join(appDir, \"public\");\n\tif (fs.existsSync(publicSrc)) await fs.promises.cp(publicSrc, path.join(appOut, \"public\"), { recursive: true });\n\tawait build({\n\t\tentryPoints: { main: fileURLToPath(buildDescriptor.module) },\n\t\toutdir: workDir,\n\t\tbundle: true,\n\t\tformat: \"esm\",\n\t\tplatform: \"node\",\n\t\texternal: [\"bun\", \"bun:*\"],\n\t\toutExtension: { \".js\": \".mjs\" }\n\t});\n\tif (!fs.existsSync(path.join(workDir, \"main.mjs\"))) throw new Error(`esbuild produced no main.mjs in ${workDir}`);\n\treturn {\n\t\tdir: workDir,\n\t\tentry: path.posix.join(\"bundle\", appRel.split(path.sep).join(\"/\"), \"server.js\")\n\t};\n}\n/** The nextjs build extension descriptor — `prisma-composer.config.ts` lists it under `extensions`. */\nconst nextjsBuild = () => ({\n\tid: \"@prisma/composer/nextjs\",\n\tnodes: { nextjs: {\n\t\tkind: \"build\",\n\t\tassemble\n\t} }\n});\n//#endregion\nexport { assemble, nextjsBuild, standaloneServerPath };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAS,cAAc,YAAY;CAClC,OAAO,WAAW,SAAS,YAAY,YAAY,cAAc,OAAO,WAAW,WAAW;AAC/F;;;;;;;;;AASA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ChC,MAAM,UAAU,KAAK,KAAK,MAAM,KAAK,oBAAoB,aAAa,MAAM,OAAO;CACnF,MAAM,GAAG,SAAS,GAAG,SAAS;EAC7B,WAAW;EACX,OAAO;CACR,CAAC;CACD,MAAM,GAAG,SAAS,MAAM,SAAS,EAAE,WAAW,KAAK,CAAC;CACpD,MAAM,YAAY,KAAK,KAAK,SAAS,QAAQ;CAC7C,MAAM,GAAG,SAAS,GAAG,gBAAgB,WAAW,EAAE,WAAW,KAAK,CAAC;CACnE,MAAM,SAAS,KAAK,KAAK,WAAW,MAAM;CAC1C,MAAM,YAAY,KAAK,KAAK,QAAQ,SAAS,QAAQ;CACrD,IAAI,GAAG,WAAW,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,KAAK,KAAK,QAAQ,SAAS,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;CACvH,MAAM,YAAY,KAAK,KAAK,QAAQ,QAAQ;CAC5C,IAAI,GAAG,WAAW,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,KAAK,KAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;CAC9G,MAAM,MAAM;EACX,aAAa,EAAE,MAAM,cAAc,gBAAgB,MAAM,EAAE;EAC3D,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,UAAU;EACV,UAAU,CAAC,OAAO,OAAO;EACzB,cAAc,EAAE,OAAO,OAAO;CAC/B,CAAC;CACD,IAAI,CAAC,GAAG,WAAW,KAAK,KAAK,SAAS,UAAU,CAAC,GAAG,MAAM,IAAI,MAAM,mCAAmC,SAAS;CAChH,OAAO;EACN,KAAK;EACL,OAAO,KAAK,MAAM,KAAK,UAAU,OAAO,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG,GAAG,WAAW;
|
|
1
|
+
{"version":3,"file":"nextjs-control.mjs","names":[],"sources":["../../../0-framework/2-authoring/nextjs/dist/control.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { build } from \"esbuild\";\n//#region src/control/build.ts\n/**\n* The extension's control entry (ADR-0017): `nextjsBuild()` returns the build\n* descriptor `prisma-composer.config.ts` lists. Deploy-only (ADR-0005): the user\n* runs `next build` (`output: \"standalone\"`); `assemble` then performs the\n* *documented* Next standalone deploy — it ships the standalone tree and copies\n* in the client assets Next deliberately omits (`.next/static`, `public/`) — and\n* adds the framework's boot wrapper. This is the canonical `cp` step from the\n* Next docs, run at deploy so no app needs a build-script for it.\n*\n* It does not guess: the app's location inside the standalone tree (deep, when\n* `outputFileTracingRoot` is the monorepo root) is *read from Next's own build\n* manifest* (`.next/required-server-files.json`'s `relativeAppDir`), never walked\n* for or computed from a hardcoded depth. It does not launder: node_modules is\n* shipped exactly as `next build` produced it, so a symlinked (non-hoisted)\n* node_modules is the packager's hard error — the same misconfiguration crashes\n* the standalone server at boot, so it must be a flat install (npm, or pnpm/bun\n* with a hoisted node-linker).\n*\n* Artifact layout: `<workDir>/main.mjs` (our wrapper) + `<workDir>/bundle/`\n* (the standalone tree, with static/public copied in). The packager adds\n* `bootstrap.js` + the manifest at the root; bootstrap imports main.mjs, whose\n* run() dynamically imports `./bundle/<relativeAppDir>/server.js`.\n*\n* Paths are file-relative (ADR-0004): `appDir` resolves against\n* `dirname(build.module)`.\n*/\n/** Narrows the shared BuildAdapter to this extension's own descriptor — the value-level mirror of the registry routing on (extension, type). */\nfunction isNextjsBuild(descriptor) {\n\treturn descriptor.type === \"nextjs\" && \"appDir\" in descriptor && typeof descriptor.appDir === \"string\";\n}\n/**\n* The app's own subpath within `.next/standalone`, as an OS-relative path. Next\n* mirrors the app's location under `outputFileTracingRoot` (deep, when that's the\n* monorepo root); rather than walk the tree for `server.js`, we read where Next\n* put it from `.next/required-server-files.json` — `relativeAppDir` is exactly\n* that subpath. Older Next lacks the field; fall back to computing it from the\n* same manifest's `config.outputFileTracingRoot`.\n*/\nfunction nextAppRel(appDir) {\n\tconst manifestPath = path.join(appDir, \".next\", \"required-server-files.json\");\n\tif (!fs.existsSync(manifestPath)) throw new Error(`no ${path.join(\".next\", \"required-server-files.json\")} under ${appDir} — run \\`next build\\` with output: \"standalone\" first.`);\n\tconst manifest = JSON.parse(fs.readFileSync(manifestPath, \"utf8\"));\n\tconst relativeAppDir = manifest?.relativeAppDir;\n\tconst tracingRoot = manifest?.config?.outputFileTracingRoot;\n\tconst posixRel = typeof relativeAppDir === \"string\" ? relativeAppDir : typeof tracingRoot === \"string\" ? path.relative(tracingRoot, appDir).split(path.sep).join(\"/\") : void 0;\n\tif (posixRel === void 0) throw new Error(`${manifestPath} records neither relativeAppDir nor config.outputFileTracingRoot — cannot locate the standalone server`);\n\treturn posixRel.split(\"/\").join(path.sep);\n}\n/** The built standalone server.js for a nextjs build — `appDir`'s standalone root plus the app subpath Next recorded. Single-sourced so `assemble()` (deploy) and the integration-test seam can't drift. */\nfunction standaloneServerPath(build) {\n\tconst appDir = path.resolve(path.dirname(fileURLToPath(build.module)), build.appDir);\n\treturn path.join(appDir, \".next\", \"standalone\", nextAppRel(appDir), \"server.js\");\n}\nasync function assemble(input) {\n\tif (!isNextjsBuild(input.build)) throw new Error(`@prisma/composer/nextjs/control: expected a \"nextjs\" build adapter (with appDir), got \"${input.build.type}\".`);\n\tconst buildDescriptor = input.build;\n\tconst appDir = path.resolve(path.dirname(fileURLToPath(buildDescriptor.module)), buildDescriptor.appDir);\n\tconst standaloneRoot = path.join(appDir, \".next\", \"standalone\");\n\tif (!fs.existsSync(standaloneRoot)) throw new Error(`no ${path.join(\".next\", \"standalone\")} under ${appDir} — run \\`next build\\` with output: \"standalone\" first.`);\n\tconst appRel = nextAppRel(appDir);\n\tconst workDir = path.join(input.cwd, \".prisma-composer\", \"artifacts\", input.address);\n\tawait fs.promises.rm(workDir, {\n\t\trecursive: true,\n\t\tforce: true\n\t});\n\tawait fs.promises.mkdir(workDir, { recursive: true });\n\tconst bundleDir = path.join(workDir, \"bundle\");\n\tawait fs.promises.cp(standaloneRoot, bundleDir, { recursive: true });\n\tconst appOut = path.join(bundleDir, appRel);\n\tconst staticSrc = path.join(appDir, \".next\", \"static\");\n\tif (fs.existsSync(staticSrc)) await fs.promises.cp(staticSrc, path.join(appOut, \".next\", \"static\"), { recursive: true });\n\tconst publicSrc = path.join(appDir, \"public\");\n\tif (fs.existsSync(publicSrc)) await fs.promises.cp(publicSrc, path.join(appOut, \"public\"), { recursive: true });\n\tawait build({\n\t\tentryPoints: { main: fileURLToPath(buildDescriptor.module) },\n\t\toutdir: workDir,\n\t\tbundle: true,\n\t\tformat: \"esm\",\n\t\tplatform: \"node\",\n\t\texternal: [\"bun\", \"bun:*\"],\n\t\toutExtension: { \".js\": \".mjs\" }\n\t});\n\tif (!fs.existsSync(path.join(workDir, \"main.mjs\"))) throw new Error(`esbuild produced no main.mjs in ${workDir}`);\n\treturn {\n\t\tdir: workDir,\n\t\tentry: path.posix.join(\"bundle\", appRel.split(path.sep).join(\"/\"), \"server.js\"),\n\t\twatch: [standaloneRoot]\n\t};\n}\n/** The nextjs build extension descriptor — `prisma-composer.config.ts` lists it under `extensions`. */\nconst nextjsBuild = () => ({\n\tid: \"@prisma/composer/nextjs\",\n\tnodes: { nextjs: {\n\t\tkind: \"build\",\n\t\tassemble\n\t} }\n});\n//#endregion\nexport { assemble, nextjsBuild, standaloneServerPath };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAS,cAAc,YAAY;CAClC,OAAO,WAAW,SAAS,YAAY,YAAY,cAAc,OAAO,WAAW,WAAW;AAC/F;;;;;;;;;AASA,SAAS,WAAW,QAAQ;CAC3B,MAAM,eAAe,KAAK,KAAK,QAAQ,SAAS,4BAA4B;CAC5E,IAAI,CAAC,GAAG,WAAW,YAAY,GAAG,MAAM,IAAI,MAAM,MAAM,KAAK,KAAK,SAAS,4BAA4B,EAAE,SAAS,OAAO,uDAAuD;CAChL,MAAM,WAAW,KAAK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NextjsBuildAdapter, nextjsBuild as default };
|
package/dist/node-control.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as Bundle,
|
|
2
|
-
import "./config-
|
|
3
|
-
import "./deploy-
|
|
1
|
+
import { a as Bundle, f as ExtensionDescriptor, i as AssembleInput } from "./app-config-bsTo57A8-BfG21wAI.mjs";
|
|
2
|
+
import "./config-DUzvB5cQ.mjs";
|
|
3
|
+
import "./deploy-DUzvB5cQ.mjs";
|
|
4
4
|
//#region ../../0-framework/2-authoring/node/dist/control.d.mts
|
|
5
5
|
//#region src/control/build.d.ts
|
|
6
6
|
declare function assemble(input: AssembleInput): Promise<Bundle>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-control.d.mts","names":[],"sources":["../../../0-framework/2-authoring/node/dist/control.d.mts"],"mappings":";;;;;iBAGiB,SAAS,OAAO,gBAAkB,QAAQ;;cAE7C,iBAAiB"}
|