Skip to content

fix: support current app deploy frameworks#48

Merged
AmanVarshney01 merged 6 commits into
mainfrom
aman/fix-tanstack-start-detection
May 29, 2026
Merged

fix: support current app deploy frameworks#48
AmanVarshney01 merged 6 commits into
mainfrom
aman/fix-tanstack-start-detection

Conversation

@AmanVarshney01
Copy link
Copy Markdown
Member

Summary

  • detect current TanStack Start packages and next.config.mts
  • support vanilla Bun deploys through --framework bun or --entry
  • make official Hono scaffolds deploy without needing --entry by defaulting to src/index.ts
  • remove the hidden deploy --build-type path so deploy uses --framework

Checked

  • pnpm --filter @prisma/cli test
  • pnpm --filter @prisma/cli build
  • official create-next-app deploy returned HTTP 200 with Hello world!
  • official Hono, TanStack Start, and Bun local Compute builds passed

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d561537a-1d2a-4189-9de9-66c6cbaffc24

📥 Commits

Reviewing files that changed from the base of the PR and between 4181761 and 41042f8.

📒 Files selected for processing (3)
  • docs/product/command-spec.md
  • packages/cli/src/controllers/app.ts
  • packages/cli/tests/app-controller.test.ts

Summary by CodeRabbit

  • New Features

    • Added Bun support for prisma-cli app deploy via --framework bun
    • --entry can explicitly set a deploy entrypoint; providing --entry without --framework infers Bun
  • Improvements

    • Replaced legacy --build-type with --framework and simplified deploy options
    • Better auto-detection for Hono, TanStack Start, and Next.js; clearer validation and error messages
  • Documentation

    • Updated CLI docs, examples, and README to show Bun and entrypoint usage

Walkthrough

This PR migrates the prisma-cli app deploy command from a legacy --build-type flag to a framework-driven --framework flag, adds Bun framework support, and implements intelligent entrypoint resolution for Hono applications using Bun package metadata inspection.

Changes

App Deploy Framework Migration and Bun Support

Layer / File(s) Summary
CLI Command Flag Migration
packages/cli/src/commands/app/index.ts, packages/cli/src/shell/command-meta.ts, examples/next-smoke/README.md
Update app deploy to add bun to --framework choices, remove the legacy --build-type option, stop parsing buildType from CLI inputs, add a Bun example in command metadata, and update README examples to use --framework.
Controller Options Type and Framework Definitions
packages/cli/src/controllers/app.ts
Add Bun package helper import, include "bun" in DeployFramework/DEPLOY_FRAMEWORKS, add TANSTACK_START_PACKAGES, and update runAppDeploy options signature to remove buildType and accept framework/entrypoint.
Framework Detection Improvements
packages/cli/src/controllers/app.ts
Add hasAnyPackageDependency helper; update TanStack Start multi-package detection; include next.config.mts in Next.js detection; extend frameworkFromUserFacingValue parsing to accept bun and TanStack variant identifiers; update detection messages to mention Bun.
Framework Resolution and Entrypoint Logic
packages/cli/src/controllers/app.ts
Refactor resolveDeployFramework to accept an entrypoint hint and resolve to Bun when --entry is provided without --framework; add resolveDeployEntrypoint implementing Bun/Hono entrypoint inference; validate requested framework + entrypoint and pass the resolved entrypoint to provider.deployApp.
Deployment Customization and Entrypoint Tracking
packages/cli/src/controllers/app.ts
Treat entrypoint as an explicit gating input for maybeCustomizeDeploySettings to skip interactive customization when --entry is provided; adjust production-domain local-pin skipping to consider options.projectRef.
Error Handling, Validation, and User Messaging
packages/cli/src/controllers/app.ts
Update framework supported text and error messages to include Bun; update assertSupportedEntrypoint to recommend --framework <framework> for --entry mismatches and document Bun usage patterns.
Tests: detection, validation, and CLI parsing
packages/cli/tests/*
Extend package.json fixture to include module; add parameterized it.each covering Next.js, Hono, Bun, and TanStack Start detection and expected deployApp args; add domain add test for explicit --project; update usage-error and CLI parsing tests to use --framework.
Documentation and Command Examples
docs/product/command-spec.md, examples/next-smoke/README.md
Document bun as a supported --framework value; add Hono entrypoint behavior and Bun deploy rules; include Bun-specific deployment examples and update example invocations.

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: support current app deploy frameworks' accurately summarizes the main changes: adding support for Bun, TanStack Start, Hono, and next.config.mts detection while consolidating framework detection under --framework.
Description check ✅ Passed The description clearly outlines the key changes (TanStack Start detection, Bun support, Hono defaults, --build-type removal) and includes validation steps performed by the author.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aman/fix-tanstack-start-detection
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch aman/fix-tanstack-start-detection

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

@AmanVarshney01 AmanVarshney01 marked this pull request as ready for review May 28, 2026 15:07
@AmanVarshney01 AmanVarshney01 requested a review from luanvdw May 28, 2026 15:08
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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 `@packages/cli/tests/app-controller.test.ts`:
- Around line 1197-1201: Add a new test case to the existing test matrix in
packages/cli/tests/app-controller.test.ts that exercises framework-only Bun
inference (i.e., a case where framework: "bun" is provided but no entrypoint
property is set). Copy the existing object structure used for the entries (the
objects that include name, framework, entrypoint, expectedBuildType) and add a
variant with name: "Bun from --framework bun (no entry)", framework: "bun", omit
the entrypoint field entirely, and expectedBuildType: "bun" so the test asserts
the CLI infers Bun without an explicit entry.
🪄 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: 4464c840-ecf3-4e16-ae7a-a5af575d4a3c

📥 Commits

Reviewing files that changed from the base of the PR and between de5e017 and 5c2c9a5.

📒 Files selected for processing (6)
  • docs/product/command-spec.md
  • packages/cli/src/commands/app/index.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/app-env-vars.test.ts

Comment thread packages/cli/tests/app-controller.test.ts Outdated
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

luanvdw
luanvdw previously approved these changes May 29, 2026
Copy link
Copy Markdown
Member

@luanvdw luanvdw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AmanVarshney01 thanks for pushing this through. I pulled the branch locally and the implementation checks out: pnpm --filter @prisma/cli test and pnpm --filter @prisma/cli build both pass for me.

Two small things before we merge:

  • Could you rebase against current main to resolve the current conflicts (let me know if I can help you with any of these) I think these conflicts are from the changes I made to explicit project setup. So I'm also happy to resolve these, if helpful. Just let me know
  • small nit: examples/next-smoke/README.md still documents app deploy --build-type nextjs, but deploy now rejects --build-type. Can you switch that example and the related bullet to --framework nextjs?

Approving so long, so you're unblocked from merging afterwards

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/cli/src/controllers/app.ts (1)

1207-1213: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Honor explicit --project precedence in app domain resolution.

With a stale .prisma/local.json, app domain ... --project <id-or-name> can fail before explicit project resolution, because local-pin validation is only skipped for PRISMA_PROJECT_ID. Explicit --project should bypass stale-pin reads here too.

Suggested fix
-  const skipLocalPin = Boolean(envProjectId);
+  const skipLocalPin = Boolean(envProjectId || options?.projectRef);
🤖 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/src/controllers/app.ts` around lines 1207 - 1213, The code only
skips local-pin validation when envProjectId is present, causing explicit CLI
--project to be ignored; update the skip logic so skipLocalPin is true when
either envProjectId OR the explicit CLI project flag is provided (check the
variable that holds the --project input, e.g., context.flags.project or the
existing CLI input variable your controller uses), then keep the rest (localPin
read/validation and throwing localResolutionPinStaleError) unchanged so
providing --project bypasses reading/validating .prisma/local.json.
🤖 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 `@packages/cli/tests/app-controller.test.ts`:
- Around line 1204-1209: The test case for "Bun from --framework bun with
package.json module" is missing the expectedEntrypoint check: update the test
object to set expectedEntrypoint to "index.ts" so resolveDeployEntrypoint will
be asserted to read packageJson.module and the controller will pass entrypoint:
"index.ts" into deployApp; ensure the assertion comparing deployApp's call uses
the expectedEntrypoint value (entrypoint) so the test validates
resolveDeployEntrypoint, deployApp, expectedEntrypoint behavior.

---

Outside diff comments:
In `@packages/cli/src/controllers/app.ts`:
- Around line 1207-1213: The code only skips local-pin validation when
envProjectId is present, causing explicit CLI --project to be ignored; update
the skip logic so skipLocalPin is true when either envProjectId OR the explicit
CLI project flag is provided (check the variable that holds the --project input,
e.g., context.flags.project or the existing CLI input variable your controller
uses), then keep the rest (localPin read/validation and throwing
localResolutionPinStaleError) unchanged so providing --project bypasses
reading/validating .prisma/local.json.
🪄 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: 2173b112-2ade-4c45-bd89-b72ad00f716b

📥 Commits

Reviewing files that changed from the base of the PR and between 7a87637 and 4181761.

📒 Files selected for processing (7)
  • docs/product/command-spec.md
  • examples/next-smoke/README.md
  • packages/cli/src/commands/app/index.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/app-env-vars.test.ts

Comment thread packages/cli/tests/app-controller.test.ts
@AmanVarshney01 AmanVarshney01 merged commit 6865caa into main May 29, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants