feat(cli): add init, the compute config formalizer#108
Open
AmanVarshney01 wants to merge 2 commits into
Open
Conversation
init writes a committed prisma.compute.ts for the app in the invocation directory: it detects the framework with the same registry deploy uses, previews every value with its source, and pins the app's identity (name, framework, httpPort, entry for entrypoint frameworks, region only when passed). It never writes a build block, never overwrites an existing config anywhere up to the repo root (INIT_CONFIG_EXISTS), and never scaffolds code; create-prisma owns scaffolding. Writing the config needs no auth. The optional link step reuses the project link flow (interactive question, --link/--no-link/--project), and link failures after the write downgrade to warnings so the config stands. Detection failure prompts interactively and fails with INIT_DETECTION_FAILED plus the framework list in JSON mode. app deploy success output now hints "Config prisma-cli init" when the deploy ran on inferred settings without a config file.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
👮 Files not reviewed due to content moderation or server errors (6)
Warning Walkthrough skippedFile diffs could not be summarized. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
init's next steps, link hints, error recovery commands, and the deploy Config hint now render through the project's detected package runner (pnpm dlx / bunx / yarn dlx / npx -y with @prisma/cli@latest), matching the agent group's convention, instead of hardcoding the prisma-cli bin name. Descriptor examples switch to the runner-aware form.
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-cli initwrites a committedprisma.compute.tsfor the app in the current directory. Deploy stays zero-config; init pins what deploy would infer so the setup is reviewable and stable for teammates and CI. It never overwrites an existing config, never scaffolds code (that's create-prisma's job), and needs no auth except for the optional link step.More examples:
Design notes
name,framework,httpPort,entryfor entrypoint frameworks,regiononly when passed). Nobuildblock, so build-command inference stays live until a user opts into owning it.--framework customappends a commentedbuildstub since custom artifacts require it.INIT_CONFIG_EXISTSwhen any config exists up to the repo root (nested configs refused, steering monorepos to one root config);INIT_DETECTION_FAILEDwith the framework list in--json, an interactive picker otherwise.app deploysuccess output now hintsConfig prisma-cli initwhen the deploy ran on inferred settings.Testing: 10 new integration tests (572 total green), lint/typecheck/build clean, plus a live run shown above.