@prisma/composer 0.28.0-dev.2 → 0.28.0-dev.3

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/node.d.mts CHANGED
@@ -6,9 +6,19 @@ import "./index-DeocL1di.mjs";
6
6
  interface NodeBuildAdapter extends BuildAdapter {
7
7
  readonly type: 'node';
8
8
  readonly dir?: string;
9
+ /** Whether the build inlined its packages (`'bundled'`, the default) or left them for deploy to stage from `node_modules` (`'external'`). */
10
+ readonly dependencies?: NodeDependencies;
9
11
  }
12
+ /**
13
+ * How the build treats installed packages, in bundler terms (esbuild's and
14
+ * Rollup's `external`, Vite's `ssr.external`). `'bundled'`: the build inlined
15
+ * them, so deploy copies exactly what was built. `'external'`: the build left
16
+ * them as imports, so deploy traces `entry` and stages the installed packages
17
+ * it imports.
18
+ */
19
+ type NodeDependencies = 'bundled' | 'external';
10
20
  /** The two forms an author may write. `dir?: never` on the single-file branch is what makes them exclusive: with `dir`, `entry` is required and names a file inside it. */
11
- type NodeBuildOptions = {
21
+ type NodeBuildOptions = ({
12
22
  module: string;
13
23
  entry: string;
14
24
  dir?: never;
@@ -16,6 +26,9 @@ type NodeBuildOptions = {
16
26
  module: string;
17
27
  dir: string;
18
28
  entry: string;
29
+ }) & {
30
+ /** `'bundled'` (default) ships exactly what was built. `'external'` also stages the installed packages `entry` imports. */
31
+ dependencies?: NodeDependencies;
19
32
  };
20
33
  declare const nodeBuild: (opts: NodeBuildOptions) => NodeBuildAdapter;
21
34
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.mts","names":[],"sources":["../../../0-framework/2-authoring/node/dist/index.d.mts"],"mappings":";;;;;UAGU,yBAAyB;WACxB;WACA;;;KAGN;EACH;EACA;EACA;;EAEA;EACA;EACA;;cAEY,YAAY,MAAM,qBAAqB"}
1
+ {"version":3,"file":"node.d.mts","names":[],"sources":["../../../0-framework/2-authoring/node/dist/index.d.mts"],"mappings":";;;;;UAGU,yBAAyB;WACxB;WACA;;WAEA,eAAe;;;;;;;;;KASrB;;KAEA;EACH;EACA;EACA;;EAEA;EACA;EACA;;;EAGA,eAAe;;cAEH,YAAY,MAAM,qBAAqB"}
package/dist/node.mjs CHANGED
@@ -4,7 +4,8 @@ const nodeBuild = (opts) => ({
4
4
  type: "node",
5
5
  module: opts.module,
6
6
  entry: opts.entry,
7
- ...opts.dir === void 0 ? {} : { dir: opts.dir }
7
+ ...opts.dir === void 0 ? {} : { dir: opts.dir },
8
+ ...opts.dependencies === void 0 ? {} : { dependencies: opts.dependencies }
8
9
  });
9
10
  //#endregion
10
11
  export { nodeBuild as default };
package/dist/node.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.mjs","names":[],"sources":["../../../0-framework/2-authoring/node/dist/index.mjs"],"sourcesContent":["//#region src/node.ts\nconst nodeBuild = (opts) => ({\n\textension: \"@prisma/composer/node\",\n\ttype: \"node\",\n\tmodule: opts.module,\n\tentry: opts.entry,\n\t...opts.dir === void 0 ? {} : { dir: opts.dir }\n});\n//#endregion\nexport { nodeBuild as default };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";AACA,MAAM,aAAa,UAAU;CAC5B,WAAW;CACX,MAAM;CACN,QAAQ,KAAK;CACb,OAAO,KAAK;CACZ,GAAG,KAAK,QAAQ,KAAK,IAAI,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI;AAC/C"}
1
+ {"version":3,"file":"node.mjs","names":[],"sources":["../../../0-framework/2-authoring/node/dist/index.mjs"],"sourcesContent":["//#region src/node.ts\nconst nodeBuild = (opts) => ({\n\textension: \"@prisma/composer/node\",\n\ttype: \"node\",\n\tmodule: opts.module,\n\tentry: opts.entry,\n\t...opts.dir === void 0 ? {} : { dir: opts.dir },\n\t...opts.dependencies === void 0 ? {} : { dependencies: opts.dependencies }\n});\n//#endregion\nexport { nodeBuild as default };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";AACA,MAAM,aAAa,UAAU;CAC5B,WAAW;CACX,MAAM;CACN,QAAQ,KAAK;CACb,OAAO,KAAK;CACZ,GAAG,KAAK,QAAQ,KAAK,IAAI,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI;CAC9C,GAAG,KAAK,iBAAiB,KAAK,IAAI,CAAC,IAAI,EAAE,cAAc,KAAK,aAAa;AAC1E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/composer",
3
- "version": "0.28.0-dev.2",
3
+ "version": "0.28.0-dev.3",
4
4
  "type": "module",
5
5
  "description": "Prisma Composer — build a Prisma App by composing Modules. Core authoring, deploy pipeline, and the service-rpc/node/nextjs authoring surfaces. The command family the `prisma` CLI mounts lives in @prisma/composer-cli.",
6
6
  "exports": {
@@ -39,15 +39,15 @@
39
39
  "@prisma/management-api-sdk": "^1.80.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@internal/assemble": "0.28.0-dev.2",
43
- "@internal/cli": "0.28.0-dev.2",
44
- "@internal/core": "0.28.0-dev.2",
45
- "@internal/foundation": "0.28.0-dev.2",
46
- "@internal/lowering": "0.28.0-dev.2",
47
- "@internal/nextjs": "0.28.0-dev.2",
48
- "@internal/node": "0.28.0-dev.2",
49
- "@internal/service-rpc": "0.28.0-dev.2",
50
- "@internal/tsdown-config": "0.28.0-dev.2",
42
+ "@internal/assemble": "0.28.0-dev.3",
43
+ "@internal/cli": "0.28.0-dev.3",
44
+ "@internal/core": "0.28.0-dev.3",
45
+ "@internal/foundation": "0.28.0-dev.3",
46
+ "@internal/lowering": "0.28.0-dev.3",
47
+ "@internal/nextjs": "0.28.0-dev.3",
48
+ "@internal/node": "0.28.0-dev.3",
49
+ "@internal/service-rpc": "0.28.0-dev.3",
50
+ "@internal/tsdown-config": "0.28.0-dev.3",
51
51
  "@types/node": "^26.0.1",
52
52
  "tsdown": "^0.22.7",
53
53
  "typescript": "^6.0.3"
@@ -2,7 +2,7 @@
2
2
  name: prisma-composer-core-concepts
3
3
  metadata:
4
4
  library: "@prisma/composer"
5
- library_version: "0.28.0-dev.2"
5
+ library_version: "0.28.0-dev.3"
6
6
  version: 2026.9.1
7
7
  description: >-
8
8
  Use when deploying or managing an app that uses Prisma Composer
@@ -195,11 +195,12 @@ be reimplemented:
195
195
 
196
196
  ## Builds are yours
197
197
 
198
- You build, the framework assembles. For a plain server process, `entry` must
199
- point at a single self-contained ESM file: everything inlined except runtime
200
- built-ins (`bun`, `bun:*`, `node:*`). Deploy copies that one file and never
201
- ships `node_modules`, so anything left un-inlined fails at boot, not at
202
- deploy. Rules that bite:
198
+ You build, the framework assembles. For a plain server process, `entry`
199
+ points at the ESM file your build produced. By default
200
+ (`dependencies: 'bundled'`) deploy copies exactly that and never ships
201
+ `node_modules`, so everything except runtime built-ins (`bun`, `bun:*`,
202
+ `node:*`) must be inlined, or it fails at boot, not at deploy. Rules that
203
+ bite:
203
204
 
204
205
  1. **Two services in one package means two separate builds**, one per entry.
205
206
  A single multi-entry build splits shared code into a chunk neither output
@@ -209,12 +210,19 @@ deploy. Rules that bite:
209
210
  copied verbatim, so the server must resolve siblings against
210
211
  `import.meta.url`, not the working directory. The tree must contain no
211
212
  symlinks: the packager rejects them, names the link, and assembly fails.
212
- 3. **Next.js**: `next build` with `output: 'standalone'` is the whole build;
213
+ 3. **A build that leaves packages external sets `dependencies: 'external'`**
214
+ (either form). Deploy then traces `entry` and stages the installed
215
+ packages it imports, which can take minutes on a large build. Astro's Node
216
+ adapter, SvelteKit's `adapter-node` and React Router's server build leave
217
+ packages external by default. The default, `'bundled'`, copies exactly
218
+ what was built. A service that fails to start with
219
+ `Cannot find package 'x'` needs `x` bundled, or `dependencies: 'external'`.
220
+ 4. **Next.js**: `next build` with `output: 'standalone'` is the whole build;
213
221
  `nextjs({ module, appDir })` names the app root. Any page or action that
214
222
  calls `load()` needs `export const dynamic = 'force-dynamic'`, because
215
223
  the runtime environment doesn't exist at build time and Next ignores
216
224
  runtime env for prerendered routes.
217
- 4. **Always build before `deploy` or `dev`.** Neither builds for you.
225
+ 5. **Always build before `deploy` or `dev`.** Neither builds for you.
218
226
 
219
227
  Deploy configuration is the `composer` section of `prisma.config.ts`, and
220
228
  nothing else. It registers extensions (`prismaCloud()`, `nodeBuild()`,
@@ -310,9 +318,9 @@ its duration (`✔ assemble web (3m 42s)`), and ends with the real total
310
318
  (`Deployed <app> to <stage> in 5m 25s.`). Steps: load config and app, one
311
319
  assemble per service, connect to project and branch, check environment
312
320
  variables, plan and apply (one step: alchemy does both in one process), record
313
- result. A slow assemble is usually a Node service with `dir` set, whose
314
- runtime dependencies are being traced. In json mode (`--json`, or stdout not
315
- a terminal) each step is a `step-started`/`step-finished` line whose `data`
321
+ result. A slow assemble is usually a Node service with
322
+ `dependencies: 'external'`, whose runtime dependencies are being traced. In json mode (`--json`, or stdout not a
323
+ terminal) each step is a `step-started`/`step-finished` line whose `data`
316
324
  holds `durationMs` plus whatever the build adapter or deploy target reported;
317
325
  those extra fields vary, so don't parse them as a stable format. The
318
326
  `deploy` operation's `onEvent` receives the same steps, and its result's