feat(cli): support custom compute build config#98
Conversation
|
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 (3)
Summary by CodeRabbit
WalkthroughThe PR bumps 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/cli/tests/compute-config.test.ts (1)
201-233: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winKeep a positive test for the newly accepted framework-owned build blocks.
After removing the old
nuxt/astrorejection case, this test only proves thatcustomnormalizes correctly. Please keep at least one positive assertion for a framework that used to be rejected, otherwise the contract change to “framework-owned strategies may now carrybuildsettings” is untested.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/cli/tests/compute-config.test.ts` around lines 201 - 233, The compute-config test now only verifies the custom framework path, so the new contract for framework-owned build blocks is not covered. Update the test around compute configuration assertions to include at least one positive case for a framework that was previously rejected, using the existing compute-config test setup and config.targets assertions to verify that a framework-owned target can now carry build settings and normalize them correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/product/command-spec.md`:
- Line 1068: The `framework: "custom"` bullet is too strict and should match the
earlier contract for prebuilt artifacts. Update the documentation near the
`framework: "custom"` requirement so it no longer requires a build command, and
instead states that `build.outputDirectory` and `build.entrypoint` are
sufficient when deploying prebuilt framework output. Use the existing
`framework: "custom"` and `build.entrypoint` references to keep the wording
aligned with the rest of the spec.
In `@packages/cli/src/controllers/app.ts`:
- Around line 849-850: Add controller/integration coverage for the new build
entrypoint flow in runSingleAppDeploy and maybeRenderDeployBuildSettings: add a
test that verifies buildSettingsResolution.settings.entrypoint is used when no
source --entry is provided, and another assertion that the deploy summary
renders the Entrypoint row from that same resolved value. Use the existing app
controller test setup around runSingleAppDeploy/maybeRenderDeployBuildSettings
so the behavior is validated end-to-end, not just through config normalization.
---
Outside diff comments:
In `@packages/cli/tests/compute-config.test.ts`:
- Around line 201-233: The compute-config test now only verifies the custom
framework path, so the new contract for framework-owned build blocks is not
covered. Update the test around compute configuration assertions to include at
least one positive case for a framework that was previously rejected, using the
existing compute-config test setup and config.targets assertions to verify that
a framework-owned target can now carry build settings and normalize them
correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: af3cbb94-011a-4319-bd4a-04d2e6fef7af
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (10)
docs/product/command-spec.mddocs/product/error-conventions.mddocs/product/resource-model.mdpackages/cli/package.jsonpackages/cli/src/controllers/app.tspackages/cli/src/lib/app/build-settings.tspackages/cli/src/lib/app/build.tspackages/cli/src/types/app.tspackages/cli/tests/compute-config.test.tspnpm-workspace.yaml
Summary
Adds Prisma CLI support for custom Compute build config. This lets users describe how an app should be built and staged in
prisma.compute.tswhen the app does not fit one of the first-class framework strategies yet.Companion PRs:
The SDK support has been released, so this PR depends on
@prisma/compute-sdk@^0.29.0and includes the lockfile update.What changed
app build --build-typechoices instead of duplicating the list in the CLI.customto CLI build result typing.prisma.compute.tsbuild.entrypointinto configured build settings.--entryis used.custom, framework-owned build blocks, andbuild.entrypointnormalization.build.entrypoint,framework: "custom", and custom artifact builds.User-facing behavior
A custom artifact can be deployed through
prisma.compute.tsby providing:framework: "custom"build.outputDirectorybuild.entrypointbuild.commandis optional. Omit it when the artifact is already built, or set it when the CLI should run a build before staging the artifact.Example single-app config:
Users can then run:
Example prebuilt artifact config:
Example monorepo config:
Validation
pnpm --filter @prisma/cli testpnpm --recursive exec tsc --noEmitpnpm lintpnpm lintexits 0 with existing warnings.