Repository navigation
Run prisma dev converges in the prisma process - #411
Draft
wmadden-electric wants to merge 3 commits into
Draft
wmadden-electric wants to merge 3 commits into
wmadden-electric wants to merge 3 commits into
Conversation
…ocess prisma dev, and the dev operation, now lower the app against the local target and run Alchemy's plan and apply in the prisma process, for the first converge and every rebuild. No .prisma-composer/dev/<env>/alchemy.run.ts is written and no Alchemy child is spawned. destroy keeps the child. - The app's @prisma/composer/internal/converge also exports localTargetProviders and devState; CONVERGE_CONTRACT is 2. - Each converge has its own scope, so the state lease is held only while it runs. Rebuilds stay one at a time and coalesce. - Converge progress reaches the user as converge-resource and converge-message dev events; prisma dev renders them as steps and messages, with console stdout sent to stderr for the session. - A failed first converge is DEV.CONVERGE_FAILED with the reasons; a failed rebuild is a converge-failed event with the cause, keeping the app. No stack file path or reproduce command. - DevInput.signal interrupts a running converge: the first one fails with DEV.INTERRUPTED (prisma dev exits 130); stop() interrupts a rebuild's converge and waits for it before stopping services. - The app is imported once per process, so an edit to the entry module or a service's authoring module is reported (definition-changed) and rebuilds pause until dev restarts. - Deleted generate-dev-stack.ts, family/dev-converge-child.ts, the orphaned fake-child fixture, and renderDevStackFile from the testing entry. DEV.STACK_WRITE_FAILED becomes DEV.STATE_WRITE_FAILED. - ADR-0064 extended to dev; deploy-cli.md, local-dev.md, guides, the skill and the amended ADRs updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…steps, dev codes - dev records every app file (outside node_modules) the entry import loaded: under Node through the existing resolve hook (observe only), under Bun from the modules require.cache gained, which includes ES modules. A Bun.plugin onResolve sees only dynamic imports, so it is not used. These app definition files, plus each authoring module, are hashed and watched; an edit to any of them is definition-changed. - One step tracker and one converge-event mapper for deploy and dev. Each dev converge is a step (dev.converge, dev.rebuild.<n>) with its resources inside it, and every step it opened is closed when it ends. - A refused dev converge is DEV.CONVERGE_RUNNING or DEV.WORKER_THREAD, on the first converge and in a rebuild's converge-failed event. - DEV.STATE_WRITE_FAILED is DEV.ENVIRONMENT_WRITE_FAILED. - stop() waits only for a running converge; a rebuild still in its pipeline returns before converging. - CONVERGE_CONTRACT stays 1: contract 1 was never published. - The store integration test edits a sub-module's module.ts while dev runs and checks for the restart notice and that nothing converges. - Docs use "app definition files" throughout; running-locally.md no longer overstates or understates what is detected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
|
⏸️ Gizmo skipped the automatic review of 721d18a because this pull request is a draft. It will review automatically once the PR is marked ready for review.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
CodeRabbit Verify
|
commit: |
…ev-in-process Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
prisma devnow runs every converge (the first one and each rebuild) inside theprismaprocess through the app's converge from #405, with Composer's local target providers. It no longer writes.prisma-composer/dev/<env>/alchemy.run.tsor spawns the Alchemy CLI.Stacked on #405. Draft: do not merge before #404 and #405.
What changes for users
node_modules. The old child imported the app fresh on every rebuild; inside theprismaprocess, Node and Bun cache those modules and cannot drop them. Dev now records every file the entry import loaded, and when one changes it pauses rebuilds and asks for a restart. Edits to service code (build output) still apply live. This amends ADR-0056. Pending Will's decision between this and a Node-only live reload.dev.converge, thendev.rebuild.<n>) with its resources inside, in human and--jsonoutput. Deploy and dev share one mapper.DEV.INTERRUPTED) and releases the lease. Ctrl-C during a rebuild waits only for a running converge.DEV.INTERRUPTED,DEV.CONVERGE_RUNNING,DEV.WORKER_THREAD.DEV.STACK_WRITE_FAILEDis replaced byDEV.ENVIRONMENT_WRITE_FAILED.How app definition files are recorded
entry-resolution.tsalso records each resolvedfile:URL outsidenode_moduleswhile the entry loads. It only observes.Bun.pluginonResolvedoes not see static imports, so dev comparesrequire.cachebefore and after the entry import. Bun keeps ES modules there too.Removed
dev/generate-dev-stack.ts,family/dev-converge-child.ts, thefake-childfixture, andrenderDevStackFilefrom@prisma/composer-cli/testing. Destroy keepsgenerate-stack.tsandrun-alchemy.ts.Alternatives considered
tsconfigpaths.Agent: maat-73
🤖 Generated with Claude Code