Skip to content

feat: enable Prisma Compute deploys for the NestJS template - #46

Merged
AmanVarshney01 merged 4 commits into
mainfrom
feat/nest-compute-deploy
Jun 18, 2026
Merged

feat: enable Prisma Compute deploys for the NestJS template#46
AmanVarshney01 merged 4 commits into
mainfrom
feat/nest-compute-deploy

Conversation

@AmanVarshney01

Copy link
Copy Markdown
Member

What

Enables nest as a Compute-deployable template, now that the SDK has a NestJS build strategy (project-compute #94, shipped in @prisma/compute-sdk@0.28.0 and the build-runner).

Changes

  • Add "nest" to COMPUTE_DEPLOYABLE_TEMPLATES (src/types.ts).
  • Add templates/create/nest/prisma.compute.ts.hbs with framework: "nestjs" — framework-detected (no entrypoint), and no httpPort because the SDK's NestJS default (3000) matches the template's listen port (process.env.PORT ?? 3000).

Everything else auto-wires off the existing deployable gate: the compute:deploy script, the compute render flag, and the README's {{#if compute}} Compute sections (already present in the nest README) all key off isComputeDeployableTemplate.

Verification

  • tsc --noEmit clean, oxfmt --check + oxlint --deny-warnings clean, build succeeds.
  • Scaffolded nest non-interactively end-to-end: it emits a correct prisma.compute.ts (framework: "nestjs", project name, env: ".env"), and compute:deploy appears only with --deploy (as expected).
  • The template's tsconfig already has emitDecoratorMetadata/experimentalDecorators and outDir: dist, so the build produces dist/main.js — exactly what the SDK's NestJS strategy resolves and traces.

Compute's SDK gained a NestJS build strategy (project-compute #94), so the
nest template can now deploy. Add it to COMPUTE_DEPLOYABLE_TEMPLATES and ship
a prisma.compute.ts with framework "nestjs" (detected, no entrypoint; the
default HTTP port 3000 matches the template's listen port).

The compute:deploy script and README Compute sections wire up automatically
off the deployable gate.
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

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: dbef0f17-6d3e-4aee-bbeb-d67d9f07b0ce

📥 Commits

Reviewing files that changed from the base of the PR and between 2bb6cc2 and c4b1711.

📒 Files selected for processing (3)
  • src/templates/shared.ts
  • src/utils/package-manager.ts
  • templates/create/nest/package.json.hbs

Summary by CodeRabbit

  • New Features
    • Added NestJS template support for Prisma Compute deployments.
    • Included a new Prisma Compute configuration template for NestJS to streamline setup.
    • Updated the generated NestJS project build behavior to emit TypeScript output during build when applicable.
  • Bug Fixes
    • Prisma Compute deployment now correctly recognizes the NestJS template, avoiding unsupported-template errors.
  • Documentation
    • Updated the README to list the nest template as supported for Prisma Compute deployment.

Walkthrough

The PR adds comprehensive NestJS support for Prisma Compute deployment. The "nest" template is registered as Compute-deployable by adding it to COMPUTE_DEPLOYABLE_TEMPLATES in src/types.ts, computeConfigTemplates in src/constants/dependencies.ts (enabling automatic @prisma/compute-sdk injection), and DEPLOY_OPTIONS_BY_TEMPLATE in src/tasks/deploy-to-compute.ts. The build system gains a new emit?: boolean option in RuntimeScriptOptions that allows templates to control TypeScript compilation behavior: when enabled, TypeScript emits compiled output to dist; when disabled, it performs type-checking only. The runtimeScript Handlebars helper and getRuntimeScriptCommand function are updated to support this flag. A new Handlebars template templates/create/nest/prisma.compute.ts.hbs generates the NestJS Prisma Compute configuration with the project name and framework details. The NestJS package template is updated to pass emit=true to the build script, enabling full TypeScript compilation. Documentation is updated to list NestJS as a supported template and eligible for Compute deployment.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main purpose of the changeset: enabling Prisma Compute deploys for the NestJS template.
Description check ✅ Passed The description clearly explains what the PR does, provides concrete context about why it was needed, lists specific changes made, and includes verification steps performed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 feat/nest-compute-deploy
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/nest-compute-deploy

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

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

PR preview published

  • Version: 0.6.0-pr.46.142.1
  • Tag: pr46
  • Run with Bun: bunx create-prisma@pr46
  • Run with npm: npx create-prisma@pr46
  • Run with Yarn: yarn dlx create-prisma@pr46
  • Run with pnpm: pnpm dlx create-prisma@pr46
  • Run with Deno: deno run -A npm:create-prisma@pr46
  • Workflow run: https://github.com/prisma/create-prisma/actions/runs/27763704764

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 17, 2026
Enabling nest needs three registries, not one. The first PR only added it to
COMPUTE_DEPLOYABLE_TEMPLATES (which gates the deploy prompt), so the prompt
showed but the deploy was skipped:

- DEPLOY_OPTIONS_BY_TEMPLATE gates the actual deploy. Without a nest entry,
  collectComputeDeployContext returned null after the user confirmed, so no
  deploy ran and no URL was printed.
- computeConfigTemplates adds @prisma/compute-sdk as a devDependency for the
  generated prisma.compute.ts types.

nest is a single-app template, so its deploy entry is {} (no configTarget).
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 18, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 18, 2026
The NestJS deploy strategy compiles and ships dist/, so its build script must
emit. The shared runtimeScript helper used `tsc --noEmit` for bun (and
`deno check` for deno) because those runtimes execute TypeScript directly —
fine for hono/elysia (the SDK bundles their source) but it left nest with no
dist/main.js, so deploys failed with "Build failed locally" under bun.

Add an `emit` option to runtimeScript; nest opts in so its build compiles to
dist on every node-style PM and bun. Deno keeps `deno check` — the Deno nest
variant uses Deno APIs and isn't built for the node-based Compute runtime.
@AmanVarshney01
AmanVarshney01 merged commit f01c247 into main Jun 18, 2026
6 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.

1 participant