chore(examples): PRISMA_DEPLOY_ENV override for the deploy creds file#68
Open
wmadden-electric wants to merge 11 commits into
Open
chore(examples): PRISMA_DEPLOY_ENV override for the deploy creds file#68wmadden-electric wants to merge 11 commits into
wmadden-electric wants to merge 11 commits into
Conversation
…utside the repo
The example deploy/destroy scripts hardcoded `. ../../.env` (repo-root
relative), so in an ephemeral worktree — where that file doesn't exist — the
deploy fails, and the creds can't be shared across worktrees/sessions without
copying a gitignored file into each one.
Source `${PRISMA_DEPLOY_ENV:-../../.env}` instead: unchanged by default (still
the repo-root .env), but `PRISMA_DEPLOY_ENV=~/.config/prisma-compose/deploy.env`
points every example's deploy at one creds file that lives outside every repo
(uncommittable, stable across worktrees).
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
commit: |
…t do bundling
The first real out-of-repo deploy (datahub) failed three times in the deploy
path, all from one root cause: the framework guessing facts (emitted filenames,
monorepo depth, tree shape) instead of honoring the recorded principle that
users build and the framework only assembles (ADR-0005).
Record the settled design so it can never be relitigated or missed:
- ADR-0029: the user's build hands deploy a finished flat bundle; the
framework only wraps it in its bootstrap. No path-string arithmetic, no
layout inference, no absolute paths in artifacts; uniqueness comes from the
node's graph address; a symlink in a bundle is a hard error, never a job.
- 01-principles gains the named principle ('We don't bundle — users build,
the framework wraps') — it lived only in ADR-0005 and domain docs, which is
how it got violated.
- .agents/rules/no-bundling.mdc (alwaysApply): the enforcement surface every
agent session loads, with the five concrete prohibitions.
- AGENTS.md (+ CLAUDE.md symlink): any new agent reads the guiding principles
before working; principles are binding, not advisory.
- .drive bugs write-up: the live-deploy evidence behind the decision.
The code fixes implementing ADR-0029 follow in their own slice.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
ADR-0029 restated a decision ADR-0005 already carried — it wasn't a new decision, it was code (three deploy-path bugs) ignoring an existing one. Worse, the one genuinely new call — the framework stops self-containerizing the tree (no copying node_modules, no dereferencing symlinks) — directly narrows ADR-0005's original 'assembly normalizes the tree' clause, so it belongs inside ADR-0005, not in a separate ADR pretending the two agree. Amend ADR-0005 in place: the user's build produces a finished flat bundle; assembly only validates it and adds the boot wrapper (main.mjs, dictated). No path arithmetic, no layout inference, no absolute paths in artifacts; a symlink in a bundle is a hard error. Delete ADR-0029; repoint 01-principles, the no-bundling rule, AGENTS.md, and the .drive write-up at ADR-0005. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…ddress
The node adapter discovered the wrapper's output filename via readdir+regex
on "service.*", which breaks for any build.module not named service.ts (the
cron scheduler's is scheduler-service.mjs). Staging also lived beside the
user's built entry, not deploy-owned.
Per ADR-0005: AssembleInput now carries address + cwd, threaded through
assembleServices/RunAssembler from the CLI's cwd and each node's graph id.
The node adapter uses a tsdown object entry ({ main: serviceModule }) so
tsdown emits main.mjs directly, and stages under
<cwd>/.prisma-compose/artifacts/<address>/ instead of dirname(entry)/bundle.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
The artifact working dir now separates our envelope from the user tree: main.mjs at the root, the user output under bundle/, and the wrapper loads ./bundle/<entry>. Nothing collides and we never write into their output. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…tion The adapter guessed the standalone location as exactly four dirs above the app (the examples layout) and completed the tree itself (copying static/public and hoisting node_modules). Both violate ADR-0005. Now the user supplies the finished flat standalone root via `standalone` and the bootable server via `entry`; assemble copies that tree into bundle/ and adds the wrapper. The `../../../..` arithmetic and the static/public/node_modules copies are gone; bunfig (the Compute auto-install disable) moves to the artifact root. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
walkFiles treated a symlink as a regular file (Dirent.isDirectory() is false for links), so readFileSync hit EISDIR on the dir-symlinks a bun/pnpm Next standalone tree is full of. Per ADR-0005 the framework does not launder trees: a symlink is a hard error naming the path and the fix, never dereferenced. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…tandalone-path API The framework no longer completes the Next tree (ADR-0005), so the storefront build now copies .next/static into the standalone (scripts/flatten-standalone.mjs) and its nextjs() call names the standalone root + the server entry directly instead of the framework deriving them. Verified end-to-end: the real tree assembles to the bundle/ layout and packages with no symlink error. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
wmadden
requested changes
Jul 13, 2026
…(review)
Addresses the PR review: the assembly was over-built. Changes:
- One build adapter, no node/nextjs split. node({ module, entry, dir? }): dir is
the compiled-output root shipped under bundle/, defaulting to the entrys own
directory. Existing node() callers are unchanged; a Next app passes its
standalone root as dir. BuildAdapter gains an optional dir. The nextjs adapter
package and its public /nextjs (+ /nextjs/control) subpaths are deleted.
- Drop the reserved-main check — user output lives under bundle/, the wrapper at
the working-dir root, so they cannot collide.
- bunfig.toml (disable bun auto-install) moves from the adapter to the Compute
packager: it is a universal Compute default, not build-adapter logic.
- Ship the Next flatten as a framework utility, not a hand-maintained app script:
`prisma-compose next-standalone` copies .next/static + public/ into the
standalone app dir (found by locating server.js). storefront calls it in one
line and drops its bespoke flatten script.
- storefront-auth uses the unified node() adapter; its integration test resolves
the entry the same module-relative way.
- Rewrite the incomprehensible AssembleInput address/cwd doc comments.
import.meta.url stays: the wrapper is the service module bundled (core-model.md).
Verified: full typecheck + tests green; storefront builds via the new utility and
assembles+packages end-to-end (main.mjs + bundle/, bunfig injected).
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
…umented copy Reverses the over-correction in aa5cb03 (which deleted the nextjs adapter and collapsed everything into node()). Two adapters again: - node({ module, entry }) — plain service; ships the built entry under bundle/. Drops the dir param it briefly grew. - nextjs({ module, appDir }) — Next app. assemble() performs the documented Next standalone deploy: ships .next/standalone and copies in the client assets Next omits (.next/static, public/), locating the app dir by finding server.js (no ../../../.. guess). The app build is just `next build` — no cp script, no CLI subcommand, no deep path in service.ts. node_modules ships as next build produced it: a symlinked (non-hoisted) install is the packager hard error, which is also what crashes the standalone server at boot, so it must be flat (the repo sets node-linker=hoisted). bunfig.toml stays a Compute-packager default; import.meta.url stays (the wrapper is the service module bundled). Verified: full typecheck + tests; the real storefront tree assembles + packages, and the assembled server.js boots and serves a static chunk (HTTP 200). Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…ride Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> # Conflicts: # packages/0-framework/2-authoring/node/src/control.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The example
deploy/destroyscripts hardcoded. ../../.env, which breaks in ephemeral worktrees (no repo-root.env) and forces copying a gitignored creds file into each worktree.They now source
${PRISMA_DEPLOY_ENV:-../../.env}— default behaviour unchanged, butPRISMA_DEPLOY_ENV=<path>lets one creds file outside every repo (e.g.~/.config/prisma-compose/deploy.env) drive every example's deploy.🤖 Generated with Claude Code