Repository navigation
chore: fix example deployment - #6904
Conversation
|
π Deployed to the trpc-pr-6904 environment in trpc-sse-and-websockets
|
WalkthroughReplaces workspace/typecheck scripts with tsc-check/tsc-watch and a turbo tsc task; CI typecheck job now runs pnpm tsc-check. Per-package scripts unify to a single tsc command. Example Next apps set eslint.ignoreDuringBuilds to true; one adds typescript.ignoreBuildErrors: true. New example-level typecheck scripts added. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer/CI
participant GH as GitHub Actions
participant WF as typecheck job
participant PNPM as pnpm
participant Turbo as turbo (tsc)
participant Pkg as Packages (tsc)
Dev->>GH: push / PR
GH->>WF: run typecheck job
WF->>PNPM: pnpm tsc-check
PNPM->>Turbo: turbo tsc -- --noEmit ...
Turbo->>Pkg: invoke package `tsc` scripts
Pkg-->>Turbo: diagnostics
Turbo-->>WF: aggregated result
WF-->>GH: job success/failure
sequenceDiagram
autonumber
actor Dev as Developer
participant Next as Next.js build (examples)
note over Next: Pre-build checks
rect rgb(240,248,255)
Next-->>Next: eslint.ignoreDuringBuilds = true (skip ESLint at build)
end
rect rgb(245,245,245)
alt example with ignoreBuildErrors
Next-->>Next: typescript.ignoreBuildErrors = true (ignore TS errors)
else default
Next-->>Next: run project TypeScript checks as configured
end
end
Next-->>Dev: build output
Estimated code review effortπ― 3 (Moderate) | β±οΈ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Tip π Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. β¨ Finishing Touchesπ§ͺ Generate unit tests
πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
@trpc/client
@trpc/next
@trpc/react-query
@trpc/server
@trpc/tanstack-react-query
@trpc/upgrade
commit: |
This reverts commit e8cecdf.
There was a problem hiding this comment.
Actionable comments posted: 1
π§Ή Nitpick comments (6)
examples/next-prisma-starter/next.config.ts (1)
19-21: Confirm intent: ESLint is now always skipped during builds (not only in CI).If the goal is to skip ESLint only on CI (per the comment on Line 18), gate it on CI instead of hardcoding true.
Apply this diff to align behavior with the comment:
- eslint: { - ignoreDuringBuilds: true, - }, + eslint: { + ignoreDuringBuilds: !!process.env.CI, + },If you do intend to skip ESLint locally as well, keep the code and update the comment on Line 18 in a follow-up to avoid confusion.
packages/tests/package.json (1)
8-8: OK to expose tsc in tests packageProviding a plain "tsc" script here is fine and keeps tests aligned with the repo-wide task wiring. Nothing else needed.
If the workspace intends to use TS project references (build mode), consider switching to
tsc -blater; otherwise the current setup is fine.examples/next-prisma-starter/package.json (1)
23-24: Approve explicittypecheckscript integrationThe new
typecheckscript is correctly wired up in both the exampleβs package.json and its CI workflow; there are no remaining references to an old script name.β’ examples/next-prisma-starter/package.json (line 24) defines
"typecheck": "tsc --noEmit"
β’ examples/next-prisma-starter/.github/workflows/main.yml (job name on line 64) reflects βUnit tests + typecheckβ and contains no legacytype-checkortsc --watchentriesOptional refinements to improve developer ergonomics:
- "typecheck": "tsc --noEmit" + "typecheck": "tsc --noEmit --pretty false"β’ Adding
--pretty falsewill reduce CI log noise
β’ You may also add atypecheck:watchscript for faster local iterationexamples/next-prisma-todomvc/next.config.js (2)
15-16: Avoid unconditionally ignoring ESLint during builds; gate it via env for example deploys only.This can mask regressions locally. Keep the relaxed behavior for deployments while preserving signal in dev.
Apply env-gated ignore:
eslint: { - ignoreDuringBuilds: true, + // Ignore in CI and/or explicit example deploys + ignoreDuringBuilds: !!process.env.CI || process.env.EXAMPLE_DEPLOY === '1', },
17-19: Typescript ignoreBuildErrors will hide real issues; scope it narrowly.Acceptable for demo deploys, but risky otherwise. Gate it similarly so local/dev builds still fail on type errors.
Use an env flag to relax only for the example deployment:
- typescript: { - ignoreBuildErrors: true, - }, + typescript: { + ignoreBuildErrors: process.env.EXAMPLE_DEPLOY === '1', + },The comment above still reads βWe run eslint as a separate task in CIβ while the behavior is broader. Consider updating it to reflect the env-gated logic.
package.json (1)
20-21: Deduplicate flags and use a consistent Turbo invocation.Two small nits:
- --pretty is repeated.
- --noEmit is repeated in watch.
- Use "turbo run tsc" for consistency with the watch script (and to avoid relying on CLI alias behavior).
Apply:
- "tsc-check": "turbo tsc -- --noEmit --pretty --pretty", - "tsc-watch": "turbo run tsc -- --noEmit --preserveWatchOutput --pretty --noEmit --watch", + "tsc-check": "turbo run tsc -- --noEmit --pretty", + "tsc-watch": "turbo run tsc -- --noEmit --preserveWatchOutput --pretty --watch",
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π‘ Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
π Files selected for processing (13)
.github/workflows/main.yml(1 hunks)examples/next-prisma-starter/next.config.ts(1 hunks)examples/next-prisma-starter/package.json(1 hunks)examples/next-prisma-todomvc/next.config.js(1 hunks)examples/next-prisma-todomvc/package.json(1 hunks)package.json(1 hunks)packages/client/package.json(1 hunks)packages/next/package.json(1 hunks)packages/react-query/package.json(1 hunks)packages/server/package.json(1 hunks)packages/tanstack-react-query/package.json(1 hunks)packages/tests/package.json(1 hunks)turbo.json(2 hunks)
π§° Additional context used
π§ Learnings (1)
π Learning: 2025-06-09T14:01:20.033Z
Learnt from: juliusmarminge
PR: trpc/trpc#6789
File: packages/tanstack-react-query/tsdown.config.ts:1-24
Timestamp: 2025-06-09T14:01:20.033Z
Learning: In the tRPC monorepo, packages/tests and packages/upgrade don't need main/module/types fields in their package.json because tests is not distributed and upgrade just exposes a binary.
Applied to files:
packages/react-query/package.jsonpackages/tanstack-react-query/package.jsonpackages/tests/package.json
π Additional comments (8)
packages/tanstack-react-query/package.json (1)
21-21: Standardizing on a single tsc script is good.This enables turbo tsc to discover the task consistently across the workspace.
examples/next-prisma-todomvc/package.json (1)
21-21: Adding scripts.typecheck enables the E2E step to run build typecheck.This matches the workflowβs use of turbo β¦ build typecheck for examples.
packages/server/package.json (1)
23-23: LGTM on adding tsc.Keeps packages consistent with the new root tsc-check flow.
packages/react-query/package.json (1)
23-23: Approve consolidation of tsc script in react-query/package.jsonVerified that there are no remaining references to the removed
typecheckorts-watchscripts within thepackages/react-query/directoryβno matches found via the provided ripgrep check. This change cleanly consolidates to the root-managedtscinvocation.packages/next/package.json (1)
30-30: No accidental βtypecheckβ or βts-watchβ script references foundI ran a ripgrep search across
packages/nextfor any lingering"typecheck"or"ts-watch"script entries and confirmed there are none, so the added"tsc": "tsc"script is self-contained and safe to merge.packages/client/package.json (1)
29-29: tsc script addition verifiedAll packages under
packages/have removed anytypecheckorts-watchscripts and now include a"tsc": "tsc"entry (includingpackages/client/package.json).
GitHub Actions workflows reference the new roottsc-checktask (and examples intentionally continue to usetypecheck).Approving these changes.
turbo.json (2)
24-27: Verify tsc script coverage across workspacesThe audit shows that a significant number of workspaces do not define a
scripts.tscentry, which meansturbo run tscwill silently skip them. If these packages should participate in your typeβchecking pipeline, they need explicittscscripts; otherwise, you should exclude them from thetsctask inturbo.json.Key locations missing
scripts.tsc:β’ All example projects under
examples/(e.g.examples-bun,examples-cloudflare-workers, β¦)
β’ Rootpackage.json(name:root)
β’@trpc/upgradeinpackages/upgrade
β’@www/og-imageandwwwinwww/Next steps:
- Audit each missing entry and decide whether it needs typeβchecking.
- If yes, add a
"tsc": "tsc --build"(or equivalent) script to itspackage.json.- If no, explicitly exclude it from the
tscpipeline in yourturbo.json(e.g., viaβfilteror workspace glob patterns).Once updated, rerun the provided script to confirm no unintended skips remain.
58-58: Please verify CI and local scripts still run codegen-tests where neededI confirmed that in
turbo.jsonyouβve changed- "dependsOn": ["codegen-tests"], + "dependsOn": ["^build"],for the
typechecktask. That means:
turbo run typecheck(andpnpm turbo build typecheckin the examples matrix) will no longer executecodegen-tests.- There are no references to
typecheckin our Markdown docs.- The only invocations of
typecheckare:
β’ Thetypecheckjob in.github/workflows/main.yml
β’ Matrix steps in that same workflow runningpnpm turbo --filter ./examples/${{ matrix.dir }} build typecheckIf any part of your CI or local workflows still needs generated fixtures (via
codegen-tests), youβll need to either:
- Update the CI job to invoke
tsc-check(which still depends oncodegen-tests), or- Explicitly add
codegen-testsback into thetypecheckdependency chain, or- Adjust documentation/scripts to call
turbo codegen-testsbeforetypecheck.Otherwise, dropping
codegen-testsfromtypecheckis safe.
| - uses: ./.github/setup | ||
|
|
||
| - run: pnpm typecheck | ||
| - run: pnpm tsc-check |
There was a problem hiding this comment.
π‘ Verification agent
π§© Analysis chain
Switch to pnpm tsc-check looks good; verify wiring across the repo.
This aligns CI with the new Turbo-driven tsc task. Please verify:
- Root package.json exposes scripts.tsc-check (and optionally tsc-watch).
- turbo.json declares a pipeline task named tsc.
- Every example in the E2E matrix has a scripts.typecheck (since E2E still runs turbo β¦ build typecheck).
Run this script from the repo root to validate the setup:
π Script executed:
#!/bin/bash
set -euo pipefail
echo "1) Root scripts"
jq -e '.scripts["tsc-check"]' package.json >/dev/null && echo "OK: root scripts.tsc-check"
jq -e '.scripts["tsc-watch"]' package.json >/dev/null && echo "OK: root scripts.tsc-watch" || echo "WARN: root scripts.tsc-watch missing (watch may be optional)"
echo
echo "2) turbo.json has pipeline.tsc"
jq -e '.pipeline.tsc' turbo.json >/dev/null && echo "OK: turbo.json pipeline.tsc" || echo "WARN: turbo.json missing pipeline.tsc (tsc-check expects it)"
echo
echo "3) packages/* must have scripts.tsc and no legacy typecheck/ts-watch"
fail=0
while IFS= read -r f; do
name=$(jq -r '.name' "$f")
jq -e '.scripts.tsc' "$f" >/dev/null || { echo "FAIL: $name ($f) missing scripts.tsc"; fail=1; }
jq -e '.scripts.typecheck' "$f" >/dev/null && { echo "FAIL: $name ($f) still has scripts.typecheck"; fail=1; }
jq -e '.scripts["ts-watch"]' "$f" >/dev/null && { echo "FAIL: $name ($f) still has scripts.ts-watch"; fail=1; }
done < <(fd -t f package.json packages -x echo {})
(( fail == 0 )) && echo "OK: packages scripts look consistent" || true
echo
echo "4) Examples in E2E matrix must expose scripts.typecheck"
declare -a e2e=(
".experimental/next-app-dir"
".test/diagnostics-big-router"
".test/internal-types-export"
".test/ssg"
"cloudflare-workers"
"express-minimal"
"express-server"
"fastify-server"
"minimal-react"
"next-formdata"
"next-minimal-starter"
"next-prisma-starter"
"next-prisma-todomvc"
"next-prisma-websockets-starter"
"soa"
"standalone-server"
"tanstack-start"
"vercel-edge-runtime"
"nuxt"
"bun"
)
missing=0
for d in "${e2e[@]}"; do
f="examples/$d/package.json"
if [[ -f "$f" ]]; then
jq -e '.scripts.typecheck' "$f" >/dev/null || { echo "FAIL: $f missing scripts.typecheck"; missing=1; }
else
echo "WARN: $f not found"
fi
done
if (( fail == 0 && missing == 0 )); then
echo "OK: tsc-check + E2E typecheck wiring passes."
else
echo "FAIL: See issues above."
exit 1
fiLength of output: 839
π Script executed:
#!/bin/bash
set -euo pipefail
echo "1) Root scripts"
jq -e '.scripts["tsc-check"]' package.json >/dev/null && echo "OK: root scripts.tsc-check"
jq -e '.scripts["tsc-watch"]' package.json >/dev/null && echo "OK: root scripts.tsc-watch" || echo "WARN: root scripts.tsc-watch missing (watch may be optional)"
echo
echo "2) turbo.json has pipeline.tsc"
if jq -e '.pipeline.tsc' turbo.json >/dev/null; then
echo "OK: turbo.json pipeline.tsc"
else
echo "WARN: turbo.json missing pipeline.tsc (tsc-check expects it)"
fi
echo
echo "3) packages/* must have scripts.tsc and no legacy typecheck/ts-watch"
fail=0
# Avoid process-substitution on /dev/fd β use a pipe instead
fd -t f package.json packages | while IFS= read -r f; do
name=$(jq -r '.name // "<unknown>"' "$f")
if ! jq -e '.scripts.tsc' "$f" >/dev/null; then
echo "FAIL: $name ($f) missing scripts.tsc"
fail=1
fi
if jq -e '.scripts.typecheck' "$f" >/dev/null; then
echo "FAIL: $name ($f) still has scripts.typecheck"
fail=1
fi
if jq -e '.scripts["ts-watch"]' "$f" >/dev/null; then
echo "FAIL: $name ($f) still has scripts.ts-watch"
fail=1
fi
done
(( fail == 0 )) && echo "OK: packages scripts look consistent"
echo
echo "4) Examples in E2E matrix must expose scripts.typecheck"
declare -a e2e=(
".experimental/next-app-dir"
".test/diagnostics-big-router"
".test/internal-types-export"
".test/ssg"
"cloudflare-workers"
"express-minimal"
"express-server"
"fastify-server"
"minimal-react"
"next-formdata"
"next-minimal-starter"
"next-prisma-starter"
"next-prisma-todomvc"
"next-prisma-websockets-starter"
"soa"
"standalone-server"
"tanstack-start"
"vercel-edge-runtime"
"nuxt"
"bun"
)
missing=0
for d in "${e2e[@]}"; do
f="examples/$d/package.json"
if [[ -f "$f" ]]; then
if ! jq -e '.scripts.typecheck' "$f" >/dev/null; then
echo "FAIL: $f missing scripts.typecheck"
missing=1
fi
else
echo "WARN: $f not found"
fi
done
(( missing == 0 )) && echo "OK: all E2E examples expose scripts.typecheck"Length of output: 7217
Action Required: Add pipeline.tsc to turbo.json and scripts.typecheck to E2E examples
The CI wiring isnβt fully in placeβwhile root scripts and package sub-directories are correctly configured, weβre missing:
-
turbo.json
β Currently reports: βWARN: turbo.json missing pipeline.tsc (tsc-check expects it)β
β You need to declare atscpipeline entry so thatpnpm tsc-checkcan invoke it. For example:{ "pipeline": { "tsc": { "dependsOn": ["^tsc"], "outputs": [] }, // β¦ other tasks } } -
E2E example projects
Every example in our CI matrix must expose ascripts.typecheckentry in itspackage.json. The verification run flagged missingscripts.typecheckin the following examples (add the sametypecheckscript you use elsewhere, e.g."typecheck": "turbo run tsc"):β’ examples/.experimental/next-app-dir/package.json
β’ examples/.test/diagnostics-big-router/package.json
β’ examples/.test/internal-types-export/package.json
β’ examples/.test/ssg/package.json
β’ examples/cloudflare-workers/package.json
β’ examples/express-minimal/package.json
β’ examples/minimal-react/package.json
β’ examples/next-formdata/package.json
β’ examples/next-minimal-starter/package.json
β’ examples/next-prisma-starter/package.json
β’ examples/next-prisma-websockets-starter/package.json
β’ examples/soa/package.json
β’ examples/tanstack-start/package.json
β’ examples/vercel-edge-runtime/package.json
β’ examples/nuxt/package.json
Please update turbo.json and each of the above example package.json files accordingly so that pnpm tsc-check and the E2E matrix type-check step will pass.
π€ Prompt for AI Agents
.github/workflows/main.yml around line 47: the CI step calls `pnpm tsc-check`
but turbo.json lacks a `tsc` pipeline and many example package.json files lack
`scripts.typecheck`; update turbo.json to add a `pipeline.tsc` entry (dependsOn:
["^tsc"], outputs: []) and add a `typecheck` script to each listed example
package.json (set to the project convention, e.g. "typecheck": "turbo run tsc")
so the `pnpm tsc-check` and E2E matrix type-check step can run successfully.
There was a problem hiding this comment.
Actionable comments posted: 1
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π‘ Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
π Files selected for processing (1)
examples/next-big-router/package.json(1 hunks)
π§° Additional context used
π§ Learnings (1)
π Learning: 2025-06-09T14:01:20.033Z
Learnt from: juliusmarminge
PR: trpc/trpc#6789
File: packages/tanstack-react-query/tsdown.config.ts:1-24
Timestamp: 2025-06-09T14:01:20.033Z
Learning: In the tRPC monorepo, packages/tests and packages/upgrade don't need main/module/types fields in their package.json because tests is not distributed and upgrade just exposes a binary.
Applied to files:
examples/next-big-router/package.json
β° Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
- GitHub Check: E2E-tests (next-prisma-websockets-starter)
- GitHub Check: E2E-tests (express-server)
- GitHub Check: E2E-tests (tanstack-start)
- GitHub Check: E2E-tests (next-prisma-starter)
- GitHub Check: E2E-tests (next-prisma-todomvc)
- GitHub Check: E2E-tests (.test/internal-types-export)
- GitHub Check: E2E-tests (.test/diagnostics-big-router)
- GitHub Check: Release using pkg.pr.new
- GitHub Check: Test a monorepo using built declaration files
- GitHub Check: e2e-legacy-node (next-prisma-todomvc, 18.x)
- GitHub Check: e2e-legacy-node (next-prisma-starter, 18.x)
- GitHub Check: e2e-legacy-node (next-prisma-starter, 20.x)
- GitHub Check: e2e-legacy-node (next-prisma-websockets-starter, 18.x)
- GitHub Check: e2e-legacy-node (next-prisma-websockets-starter, 20.x)
- GitHub Check: E2E-tests (Deno) (deno-deploy)
- GitHub Check: E2E-tests (Bun) (bun, ubuntu-latest)
- GitHub Check: typecheck
- GitHub Check: Lint and auto-fix
- GitHub Check: test
| "typecheck": "tsc --noEmit" | ||
| }, |
There was a problem hiding this comment.
π‘ Verification agent
π§© Analysis chain
Align with repo-wide βtscβ task; replace local βtypecheckβ script
The PR standardizes on running Turboβs βtscβ pipeline via βpnpm tsc-checkβ, which expects each package to expose a βtscβ script. Defining βtypecheckβ here wonβt be picked up by Turbo and can cause this example to be skipped or fail when βturbo run tscβ executes.
Apply this diff to align with the rest of the repo:
"postinstall": "tsx scripts/codegen",
- "typecheck": "tsc --noEmit"
+ "tsc": "tsc"Run this quick check to ensure all examples expose a βtscβ script (and optionally no lingering βtypecheckβ scripts):
π Script executed:
#!/bin/bash
set -euo pipefail
echo "Scanning examples/*/package.json for scripts..."
fd -a package.json examples | while read -r f; do
has_tsc=$(jq -r 'has("scripts") and (.scripts | has("tsc"))' "$f")
has_typecheck=$(jq -r 'has("scripts") and (.scripts | has("typecheck"))' "$f")
echo "== $f =="
if [[ "$has_tsc" != "true" ]]; then
echo "MISSING: scripts.tsc"
else
echo "OK: scripts.tsc -> $(jq -r '.scripts.tsc' "$f")"
fi
if [[ "$has_typecheck" == "true" ]]; then
echo "NOTE: scripts.typecheck present -> $(jq -r '.scripts.typecheck' "$f")"
fi
doneLength of output: 16464
Standardize tsc script across all example packages
The monorepoβs CI relies on running turbo run tsc, which only picks up packages that expose a scripts.tsc entry. In their current state, the following example packages define a typecheck script but lack a tsc script, causing them to be skipped:
- examples/bun/package.json (scripts.typecheck β βtsc --noEmitβ)
- examples/express-minimal/package.json (scripts.typecheck β βtscβ)
- examples/express-server/package.json (scripts.typecheck β βtscβ)
- examples/fastify-server/package.json (scripts.typecheck β βtscβ)
- examples/lambda-api-gateway/package.json (scripts.typecheck β βtscβ)
- examples/lambda-url/package.json (scripts.typecheck β βtscβ)
- examples/next-big-router/package.json (scripts.typecheck β βtsc --noEmitβ)
- examples/next-prisma-starter/package.json (scripts.typecheck β βtsc --noEmitβ)
- examples/next-prisma-todomvc/package.json (scripts.typecheck β βtsc --noEmitβ)
- examples/standalone-server/package.json (scripts.typecheck β βtscβ)
Please replace each typecheck script with a tsc script. For example, in examples/next-big-router/package.json:
"postinstall": "tsx scripts/codegen",
- "typecheck": "tsc --noEmit"
+ "tsc": "tsc"This change ensures Turboβs tsc task will include all example packages in its typeβchecking pipeline.
π Committable suggestion
βΌοΈ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "typecheck": "tsc --noEmit" | |
| }, | |
| "postinstall": "tsx scripts/codegen", | |
| "tsc": "tsc" | |
| }, |
π€ Prompt for AI Agents
In examples/next-big-router/package.json around lines 10 to 11, the package
defines "typecheck": "tsc --noEmit" which prevents turbo from picking it up;
rename the script key from "typecheck" to "tsc" preserving the exact command
(i.e., "tsc --noEmit") so the package exposes scripts.tsc and will be included
by turbo run tsc; ensure the package.json remains valid JSON after the edit.
|
This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you. |
Summary by CodeRabbit
Chores
Examples