Skip to content

chore(ci): enable turborepo remote caching#110

Merged
halvaradop merged 12 commits intomasterfrom
chore/add-deno-bun-runtimes
Mar 3, 2026
Merged

chore(ci): enable turborepo remote caching#110
halvaradop merged 12 commits intomasterfrom
chore/add-deno-bun-runtimes

Conversation

@halvaradop
Copy link
Member

@halvaradop halvaradop commented Mar 2, 2026

Description

This pull request introduces Turborepo remote caching using Vercel and GitHub Actions to optimize build performance across the repository. The new configuration reduces build times both locally and in CI by caching build artifacts and reusing them when possible.

The update includes modifications to turbo.json to properly declare all package build outputs and enable the remoteCache option. Additionally, the TURBO_TEAM and TURBO_TOKEN environment variables were configured in GitHub Actions to activate remote caching during CI workflows.

This improvement significantly decreases job execution time in GitHub Actions and accelerates local development builds by leveraging shared cache artifacts.

Resources

@vercel
Copy link

vercel bot commented Mar 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
auth Ready Ready Preview, Comment Mar 3, 2026 3:29pm
auth-nextjs-demo Ready Ready Preview, Comment Mar 3, 2026 3:29pm

@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Consolidates CI into a single Node.js workflow, standardizes auth exports with explicit AuthInstance type annotations across many apps, updates import paths and build/format configs, adjusts Next.js server header forwarding, tweaks Nuxt/Vite targets, and formats generated route strings.

Changes

Cohort / File(s) Summary
CI Workflow
​.github/workflows/ci.yaml
Replaces multiple CI jobs with a single Node.js job, adds triggers, concurrency, permissions, env secrets, timeout, and updates node/pnpm setup and consolidated steps (install, build:prod, type-check, test).
Auth exports (typed destructure)
apps/.../src/auth.ts (many apps: apps/astro/src/auth.ts, apps/bun/src/auth.ts, apps/cloudflare/src/auth.ts, apps/deno/src/auth.ts, apps/elysia/src/auth.ts, apps/express/src/auth.ts, apps/hono/src/auth.ts, apps/nextjs/app-router/src/auth.ts, apps/nextjs/pages-router/src/auth.ts, apps/nuxt/shared/auth.ts, apps/oak/src/auth.ts, apps/react-router/app/auth.ts, apps/supabase/functions/_shared/auth.ts, apps/tanstack-start/src/auth.ts, apps/vercel/api/_auth.ts)
Adds type AuthInstance imports and replaces runtime as AuthInstance assertions with explicit : AuthInstance annotations on destructured { handlers, jose } exports, standardizing typings only.
Next.js server utilities
apps/nextjs/app-router/src/lib/server.ts
Adds toHeaders helper to forward current request headers, adds "use server" to getSession, propagates headers in CSRF/session/signOut calls, and adds try/catch error handling.
Next.js auth route
apps/nextjs/app-router/src/app/auth/[...aura]/route.ts
Now imports/destructures handlers directly and re-exports GET/POST from handlers instead of auth.handlers.
Import path updates (tanstack-start)
apps/tanstack-start/src/components/header.tsx, apps/tanstack-start/src/contexts/auth.tsx, apps/tanstack-start/src/routes/users/profile.tsx
Fixed module paths (auth.clientauth-client, auth.serverauth-server).
Generated routes formatting
apps/tanstack-start/src/routeTree.gen.ts
Switches single to double quotes in route literals, adjusts indentation, and expands module augmentation to include additional route entries.
Build / formatting configs
package.json, apps/tanstack-start/package.json, turbo.json, apps/vercel/package.json
Adds package filter to root build script, enables Prettier cache flags in tanstack-start, expands Turbo outputs and remoteCache config, and adds a type-check script to Vercel app.
Nuxt / Vite / Nitro targets
apps/nuxt/nuxt.config.ts
Sets ES2022 target for Vite esbuild and Nitro esbuild; disables sourcemaps.
Vite config change (tanstack-start)
apps/tanstack-start/vite.config.ts
Comments out Nitro plugin import and invocation (disables Nitro integration).
OAuth providers minor formatting
packages/core/src/oauth/index.ts
Adds trailing comma to builtInOAuthProviders entry (formatting).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

enhancement

🐰 Type annotations bloom like clover so bright,
Handlers and jose now typed left and right,
CI hops together, imports tidy and neat,
Build targets set, route strings accept their new beat,
A tiny rabbit cheers — this commit is a treat! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title states 'enable turborepo remote caching' but the primary changes are adding type annotations and restructuring auth exports across multiple frameworks. Update the title to reflect the actual main changes, such as 'refactor: standardize auth export signatures with AuthInstance type annotations' or 'chore: restructure auth handlers and jose exports with explicit typing'.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/add-deno-bun-runtimes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@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

🧹 Nitpick comments (1)
.github/workflows/ci.yaml (1)

39-40: Remove or apply WORKING_DIR to avoid config drift.

WORKING_DIR is defined but unused in the job steps.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yaml around lines 39 - 40, The CI job defines an unused
environment variable WORKING_DIR in the job env block; either remove the
WORKING_DIR env entry or use it in the job steps (e.g., reference it in run
commands or actions via ${{ env.WORKING_DIR }} or inputs that accept a
working-directory) so the config does not drift—update the env block or replace
direct working-directory strings in steps to reference the WORKING_DIR variable
accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yaml:
- Around line 7-13: The CI path filters under the "paths:" arrays in
.github/workflows/ci.yaml currently list ".github/workflows/**", "configs/**",
"packages/**", "pnpm-lock.yaml", "bun.lock", and "deno.lock" but omit the apps
tree; update both occurrences of the paths array (the one shown and the second
similar block) to include "apps/**" so PRs that only change files under apps are
picked up by this workflow.

---

Nitpick comments:
In @.github/workflows/ci.yaml:
- Around line 39-40: The CI job defines an unused environment variable
WORKING_DIR in the job env block; either remove the WORKING_DIR env entry or use
it in the job steps (e.g., reference it in run commands or actions via ${{
env.WORKING_DIR }} or inputs that accept a working-directory) so the config does
not drift—update the env block or replace direct working-directory strings in
steps to reference the WORKING_DIR variable accordingly.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0f90ae9 and a9e62a2.

📒 Files selected for processing (3)
  • .github/workflows/ci.yaml
  • apps/tanstack-start/src/routeTree.gen.ts
  • packages/core/src/oauth/index.ts

Copy link

@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.

♻️ Duplicate comments (1)
.github/workflows/ci.yaml (1)

7-13: ⚠️ Potential issue | 🟠 Major

Add apps/** to both path filters.

Line 7 and Line 17 filter sets still miss app-only changes, so CI can be bypassed for PRs touching only apps/**.

🔧 Proposed fix
   push:
     branches:
       - master
     paths:
       - ".github/workflows/**"
       - "configs/**"
+      - "apps/**"
       - "packages/**"
       - "pnpm-lock.yaml"
       - "bun.lock"
       - "deno.lock"
   pull_request:
     branches:
       - master
     paths:
       - ".github/workflows/**"
       - "configs/**"
+      - "apps/**"
       - "packages/**"
       - "pnpm-lock.yaml"
       - "bun.lock"
       - "deno.lock"

Also applies to: 17-23

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yaml around lines 7 - 13, CI path filters in the
workflows omit app-only changes; update the "paths" arrays in the
.github/workflows/ci.yaml workflow so both path-filter lists include "apps/**"
(i.e., add the glob "apps/**" alongside ".github/workflows/**", "configs/**",
"packages/**", etc.) for both filter blocks referenced under the workflow's
paths key to ensure PRs touching only apps trigger CI.
🧹 Nitpick comments (1)
.github/workflows/ci.yaml (1)

43-44: Pin exact runtime versions to ensure reproducible builds.

Using 24.x, v2.x, and latest allow silent runtime drift between CI runs, potentially causing flaky builds. Replace with exact versions or committed version files:

  • Line 43 (Node.js): Use node-version: "24.17.0" (or a committed .nvmrc/.node-version file)
  • Line 73 (Deno): Use deno-version: "2.0.0" (or a committed .dvmrc/.tool-versions file)
  • Line 94 (Bun): Use bun-version: "1.3.3" (or a committed .bun-version/.tool-versions file)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yaml around lines 43 - 44, The workflow currently uses
floating runtime specifiers (node-version: "24.x", deno-version: "v2.x",
bun-version: "latest") which can cause nondeterministic CI; update those keys in
the CI job to pin exact versions (e.g., node-version: "24.17.0", deno-version:
"2.0.0", bun-version: "1.3.3") or reference committed version files
(.nvmrc/.node-version, .dvmrc/.tool-versions, .bun-version) so the node-version,
deno-version, and bun-version entries are deterministic and reproducible across
runs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/ci.yaml:
- Around line 7-13: CI path filters in the workflows omit app-only changes;
update the "paths" arrays in the .github/workflows/ci.yaml workflow so both
path-filter lists include "apps/**" (i.e., add the glob "apps/**" alongside
".github/workflows/**", "configs/**", "packages/**", etc.) for both filter
blocks referenced under the workflow's paths key to ensure PRs touching only
apps trigger CI.

---

Nitpick comments:
In @.github/workflows/ci.yaml:
- Around line 43-44: The workflow currently uses floating runtime specifiers
(node-version: "24.x", deno-version: "v2.x", bun-version: "latest") which can
cause nondeterministic CI; update those keys in the CI job to pin exact versions
(e.g., node-version: "24.17.0", deno-version: "2.0.0", bun-version: "1.3.3") or
reference committed version files (.nvmrc/.node-version, .dvmrc/.tool-versions,
.bun-version) so the node-version, deno-version, and bun-version entries are
deterministic and reproducible across runs.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a9e62a2 and bf95420.

📒 Files selected for processing (1)
  • .github/workflows/ci.yaml

Copy link

@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: 4

Caution

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

⚠️ Outside diff range comments (1)
apps/tanstack-start/vite.config.ts (1)

9-19: ⚠️ Potential issue | 🟠 Major

Nitro is not fully de-scoped: remove from dependencies and configuration, or re-enable in Vite config.

Nitro is disabled in vite.config.ts (lines 9, 19) but remains listed in package.json as a dependency ("nitro": "^3.0.1-alpha.2") and in .cta.json as a chosen add-on. Either restore Nitro in the Vite config or remove it entirely from package.json and .cta.json configuration.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/tanstack-start/vite.config.ts` around lines 9 - 19, The repo currently
has Nitro half-disabled: the nitro() plugin import/comment in the Vite setup
(the commented import of "nitro/vite" and the commented nitro() entry in the
plugins array) is inconsistent with Nitro still being listed as a dependency in
package.json and as an add-on in .cta.json; either fully re-enable Nitro by
uncommenting and restoring the import (import { nitro } from "nitro/vite") and
the nitro() entry in the defineConfig plugins array (so Nitro is actually
loaded), or fully remove Nitro by deleting the commented import and nitro()
placeholder and removing "nitro" from package.json and the .cta.json add-ons
list; update whichever side you change so imports, plugin usage, package.json,
and .cta.json remain consistent.
♻️ Duplicate comments (1)
.github/workflows/ci.yaml (1)

7-23: ⚠️ Potential issue | 🟠 Major

Expand paths filters to prevent CI bypass on app/root-config changes.

apps/** is still omitted, and key root files that affect builds/tasks are also missing from filters. That can skip CI on impactful changes.

🔧 Proposed fix
 on:
   push:
     branches:
       - master
     paths:
       - ".github/workflows/**"
       - "configs/**"
+      - "apps/**"
       - "packages/**"
+      - "package.json"
+      - "pnpm-workspace.yaml"
+      - "turbo.json"
+      - "deno.json"
       - "pnpm-lock.yaml"
       - "bun.lock"
       - "deno.lock"
   pull_request:
     branches:
       - master
     paths:
       - ".github/workflows/**"
       - "configs/**"
+      - "apps/**"
       - "packages/**"
+      - "package.json"
+      - "pnpm-workspace.yaml"
+      - "turbo.json"
+      - "deno.json"
       - "pnpm-lock.yaml"
       - "bun.lock"
       - "deno.lock"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yaml around lines 7 - 23, Update the CI filter arrays
under the top-level paths and pull_request.paths keys so changes to app packages
and build/config files always trigger CI: add "apps/**" plus root
workspace/build/config files such as "package.json", "pnpm-workspace.yaml" or
"workspace.json", "tsconfig.json", any build or scripts directories (e.g.
"build/**" or "scripts/**"), and common lock/env files to both paths and
pull_request.paths; ensure the same expanded list is mirrored in both keys so
edits to root configs or apps cannot bypass CI.
🧹 Nitpick comments (3)
apps/nextjs/app-router/src/app/page.tsx (1)

1-1: Remove the top-level "use server" directive from app/page.tsx.

Server Components are the default in Next.js App Router, so this directive is redundant. The "use server" directive is meant for marking Server Functions that are callable from the client—your signInAction already has its own inline "use server" at line 16, which is the correct approach for actions used within a Server Component.

♻️ Proposed refactor
-"use server"
 import { Fingerprint, LayoutDashboard } from "lucide-react"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/nextjs/app-router/src/app/page.tsx` at line 1, Remove the top-level "use
server" directive from the module (app/page.tsx) because App Router defaults to
Server Components; keep the inline "use server" inside the signInAction function
(the existing signInAction declaration) which is the correct way to mark server
actions callable from the client, and then run a quick build/TS check to ensure
no other client-callable functions rely on the global directive.
apps/nextjs/app-router/src/auth.ts (1)

1-1: Avoid asserting createAuth with as AuthInstance.

Line 9 forces the type instead of validating it, which can hide type drift between createAuth and AuthInstance. Prefer a typed assignment so the compiler checks compatibility.

♻️ Suggested change
-export const auth = createAuth({
+export const auth: AuthInstance = createAuth({
     oauth,
     trustedOrigins: ["http://localhost:3000", "https://*.vercel.app"],
-}) as AuthInstance
+})

Also applies to: 9-9

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/nextjs/app-router/src/auth.ts` at line 1, Replace the forced cast of
createAuth to AuthInstance with a typed declaration so the compiler verifies
compatibility: instead of using "createAuth(...) as AuthInstance", declare the
variable with an explicit type (e.g., const auth: AuthInstance =
createAuth(...)) so the compiler checks that createAuth's return type matches
AuthInstance; update the variable name where needed (auth) and remove the "as
AuthInstance" assertion to prevent hiding type drift between createAuth and
AuthInstance.
apps/nuxt/nuxt.config.ts (1)

9-10: Narrow the TypeScript suppression scope.

Line 9 uses @ts-ignore, which suppresses all errors on Line 10 and can mask future config typing regressions. Prefer @ts-expect-error (with reason) or a local typed cast.

💡 Suggested minimal change
-        // `@ts-ignore`
+        // `@ts-expect-error` Nuxt/Vite plugin typing mismatch for `@tailwindcss/vite`
         plugins: [tailwindcss()],
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/nuxt/nuxt.config.ts` around lines 9 - 10, Replace the blanket `@ts-ignore`
above the plugins array with a narrow suppression: either annotate the specific
expression (plugins: [tailwindcss()]) using `@ts-expect-error` with a short reason
comment, or remove the comment and perform a local cast on the tailwindcss()
result to the expected Nuxt plugin type; target the plugins array and the
tailwindcss() call in nuxt.config.ts (instead of suppressing the whole line) so
TypeScript errors remain visible for other parts of the file.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/nextjs/app-router/src/lib/server.ts`:
- Around line 70-73: The CSRF header currently can be overridden because you're
spreading inbound headers after setting "X-CSRF-Token"; change the order so
incoming headers from toHeaders(await headers()) are spread first and then set
"X-CSRF-Token": csrfToken last (i.e., replace the headers object with {
...toHeaders(await headers()), "X-CSRF-Token": csrfToken }) so the
server-generated CSRF token always takes precedence; keep references to
toHeaders, headers(), and the "X-CSRF-Token" key when making the change.
- Around line 8-10: The toHeaders function currently converts and forwards all
inbound headers (via toHeaders), which risks leaking spoofable/hop-by-hop
headers; change toHeaders to only copy an explicit allowlist (at minimum
"cookie" and any other auth-required headers) by reading headers.get for each
allowed name and returning an object with only those keys, ensuring header names
are normalized (lowercase) and undefined values are omitted; update any callers
of toHeaders to expect this restricted header shape (e.g., when calling auth
endpoints) and add a short comment referencing the allowlist behavior in
toHeaders.
- Around line 6-10: Remove the internal Next.js type import and update toHeaders
to use the public API: drop the ReadonlyHeaders import from "next/dist/..." and
instead import headers from "next/headers" and type the parameter as
ReturnType<typeof headers> (or omit the explicit internal type), keeping the
function name toHeaders and its Object.fromEntries(headers.entries())
implementation unchanged.

In `@apps/tanstack-start/src/auth.ts`:
- Around line 6-9: The oauth providers were incorrectly limited to ["github"];
revert to using the full oauth provider list used across the repo when calling
createAuth so other providers continue to work. Update the createAuth call (the
export of handlers and jose) to accept the complete oauth configuration instead
of the hard-coded ["github"] value (preserve the existing trustedProxyHeaders:
true and the AuthInstance cast).

---

Outside diff comments:
In `@apps/tanstack-start/vite.config.ts`:
- Around line 9-19: The repo currently has Nitro half-disabled: the nitro()
plugin import/comment in the Vite setup (the commented import of "nitro/vite"
and the commented nitro() entry in the plugins array) is inconsistent with Nitro
still being listed as a dependency in package.json and as an add-on in
.cta.json; either fully re-enable Nitro by uncommenting and restoring the import
(import { nitro } from "nitro/vite") and the nitro() entry in the defineConfig
plugins array (so Nitro is actually loaded), or fully remove Nitro by deleting
the commented import and nitro() placeholder and removing "nitro" from
package.json and the .cta.json add-ons list; update whichever side you change so
imports, plugin usage, package.json, and .cta.json remain consistent.

---

Duplicate comments:
In @.github/workflows/ci.yaml:
- Around line 7-23: Update the CI filter arrays under the top-level paths and
pull_request.paths keys so changes to app packages and build/config files always
trigger CI: add "apps/**" plus root workspace/build/config files such as
"package.json", "pnpm-workspace.yaml" or "workspace.json", "tsconfig.json", any
build or scripts directories (e.g. "build/**" or "scripts/**"), and common
lock/env files to both paths and pull_request.paths; ensure the same expanded
list is mirrored in both keys so edits to root configs or apps cannot bypass CI.

---

Nitpick comments:
In `@apps/nextjs/app-router/src/app/page.tsx`:
- Line 1: Remove the top-level "use server" directive from the module
(app/page.tsx) because App Router defaults to Server Components; keep the inline
"use server" inside the signInAction function (the existing signInAction
declaration) which is the correct way to mark server actions callable from the
client, and then run a quick build/TS check to ensure no other client-callable
functions rely on the global directive.

In `@apps/nextjs/app-router/src/auth.ts`:
- Line 1: Replace the forced cast of createAuth to AuthInstance with a typed
declaration so the compiler verifies compatibility: instead of using
"createAuth(...) as AuthInstance", declare the variable with an explicit type
(e.g., const auth: AuthInstance = createAuth(...)) so the compiler checks that
createAuth's return type matches AuthInstance; update the variable name where
needed (auth) and remove the "as AuthInstance" assertion to prevent hiding type
drift between createAuth and AuthInstance.

In `@apps/nuxt/nuxt.config.ts`:
- Around line 9-10: Replace the blanket `@ts-ignore` above the plugins array with
a narrow suppression: either annotate the specific expression (plugins:
[tailwindcss()]) using `@ts-expect-error` with a short reason comment, or remove
the comment and perform a local cast on the tailwindcss() result to the expected
Nuxt plugin type; target the plugins array and the tailwindcss() call in
nuxt.config.ts (instead of suppressing the whole line) so TypeScript errors
remain visible for other parts of the file.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bf95420 and b6b1bb6.

⛔ Files ignored due to path filters (3)
  • bun.lock is excluded by !**/*.lock
  • deno.lock is excluded by !**/*.lock
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (23)
  • .github/workflows/ci.yaml
  • apps/astro/package.json
  • apps/astro/src/auth.ts
  • apps/nextjs/app-router/src/app/page.tsx
  • apps/nextjs/app-router/src/auth.ts
  • apps/nextjs/app-router/src/lib/server.ts
  • apps/nextjs/pages-router/src/auth.ts
  • apps/nuxt/nuxt.config.ts
  • apps/nuxt/package.json
  • apps/nuxt/shared/auth.ts
  • apps/react-router/app/auth.ts
  • apps/tanstack-start/package.json
  • apps/tanstack-start/src/auth.ts
  • apps/tanstack-start/src/components/header.tsx
  • apps/tanstack-start/src/contexts/auth.tsx
  • apps/tanstack-start/src/lib/auth-client.ts
  • apps/tanstack-start/src/lib/auth-server.ts
  • apps/tanstack-start/src/routes/users/profile.tsx
  • apps/tanstack-start/vite.config.ts
  • deno.json
  • package.json
  • pnpm-workspace.yaml
  • turbo.json

Copy link

@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: 2

Caution

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

⚠️ Outside diff range comments (1)
apps/react-router/app/auth.ts (1)

1-9: ⚠️ Potential issue | 🟡 Minor

Unused type import — inconsistent with other auth modules.

AuthInstance is imported but not applied to the destructured export. All other auth modules in this PR use the pattern export const { handlers, jose }: AuthInstance = createAuth(...). This file should match for consistency.

Proposed fix
-export const { handlers } = createAuth({
+export const { handlers }: AuthInstance = createAuth({
     oauth,
     trustedProxyHeaders: true,
 })
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/react-router/app/auth.ts` around lines 1 - 9, The file imports
AuthInstance but doesn't apply its type to the destructured result from
createAuth; change the export to annotate the destructured result with
AuthInstance so it matches other modules. Specifically, update the createAuth
call usage so that the destructured export includes both handlers and jose and
is typed as AuthInstance (reference the AuthInstance type, the createAuth(...)
call, and the exported symbols handlers and jose) to restore consistency.
♻️ Duplicate comments (1)
apps/nextjs/app-router/src/lib/server.ts (1)

7-9: ⚠️ Potential issue | 🟠 Major

Restrict forwarded headers to an explicit allowlist

toHeaders currently forwards all inbound headers. This still crosses a trust boundary and can propagate spoofable/hop-by-hop headers. Please allowlist only auth-required headers (e.g., cookie, optionally user-agent).
Downstream impact: Line 25, Line 40, and Line 70.

🔒 Proposed fix
 const toHeaders = (incoming: Awaited<ReturnType<typeof headers>>) => {
-    return Object.fromEntries(incoming.entries())
+    const forwarded: Record<string, string> = {}
+
+    const cookie = incoming.get("cookie")
+    if (cookie) forwarded.cookie = cookie
+
+    const userAgent = incoming.get("user-agent")
+    if (userAgent) forwarded["user-agent"] = userAgent
+
+    return forwarded
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/nextjs/app-router/src/lib/server.ts` around lines 7 - 9, toHeaders
currently forwards all incoming headers across a trust boundary; restrict it to
an explicit allowlist (at minimum "cookie", and optionally "user-agent") and
normalize header names case-insensitively before copying so spoofable or
hop-by-hop headers are not propagated. Update the toHeaders function to build a
new headers object by iterating incoming.entries(), only copying entries whose
lowercased name is in the allowlist, and ensure downstream callers of toHeaders
(the places referenced in this diff: uses on/around lines where toHeaders is
called) receive the filtered headers; keep the function name toHeaders unchanged
so callers continue to resolve correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yaml:
- Around line 38-63: The CI workflow only defines a "node" job so Bun and Deno
are not executed; add separate jobs (e.g., "bun" and "deno") similar to the
existing node job that run on ubuntu-latest, set up the appropriate runtime (use
actions/setup-node for Node if needed, use the official Bun setup or install Bun
in the "bun" job, and use denoland/setup-deno for the "deno" job), and include
equivalent steps to install deps, build, type-check (or the Deno/Bun
equivalents), and run tests; ensure the new jobs reference the same steps as
"node" (checkout, install, build, test) and that the workflow's path triggers
referencing bun.lock and deno.lock now correspond to these new "bun" and "deno"
jobs.

In `@apps/nextjs/app-router/src/lib/server.ts`:
- Around line 11-14: Replace the TODO comment in server.ts that reads "@todo:
fix bug related to rendered statically" with a concrete tracked issue link (or
create one) and an owner; update the comment to include the issue URL or number
and a short status line (e.g., "@issue: <URL_or_#>, `@owner`: `@username`, `@status`:
open") so the known dynamic-rendering bug referenced by the existing comment now
has a persistent tracker and owner; keep the existing `@see` reference to the
Next.js docs as context.

---

Outside diff comments:
In `@apps/react-router/app/auth.ts`:
- Around line 1-9: The file imports AuthInstance but doesn't apply its type to
the destructured result from createAuth; change the export to annotate the
destructured result with AuthInstance so it matches other modules. Specifically,
update the createAuth call usage so that the destructured export includes both
handlers and jose and is typed as AuthInstance (reference the AuthInstance type,
the createAuth(...) call, and the exported symbols handlers and jose) to restore
consistency.

---

Duplicate comments:
In `@apps/nextjs/app-router/src/lib/server.ts`:
- Around line 7-9: toHeaders currently forwards all incoming headers across a
trust boundary; restrict it to an explicit allowlist (at minimum "cookie", and
optionally "user-agent") and normalize header names case-insensitively before
copying so spoofable or hop-by-hop headers are not propagated. Update the
toHeaders function to build a new headers object by iterating
incoming.entries(), only copying entries whose lowercased name is in the
allowlist, and ensure downstream callers of toHeaders (the places referenced in
this diff: uses on/around lines where toHeaders is called) receive the filtered
headers; keep the function name toHeaders unchanged so callers continue to
resolve correctly.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b6b1bb6 and f63372e.

📒 Files selected for processing (22)
  • .github/workflows/ci.yaml
  • apps/astro/src/auth.ts
  • apps/bun/src/auth.ts
  • apps/cloudflare/src/auth.ts
  • apps/deno/src/auth.ts
  • apps/elysia/src/auth.ts
  • apps/express/src/auth.ts
  • apps/hono/src/auth.ts
  • apps/nextjs/app-router/src/app/auth/[...aura]/route.ts
  • apps/nextjs/app-router/src/auth.ts
  • apps/nextjs/app-router/src/lib/server.ts
  • apps/nextjs/pages-router/src/auth.ts
  • apps/nuxt/nuxt.config.ts
  • apps/nuxt/shared/auth.ts
  • apps/oak/src/auth.ts
  • apps/react-router/app/auth.ts
  • apps/supabase/functions/_shared/auth.ts
  • apps/tanstack-start/package.json
  • apps/tanstack-start/src/auth.ts
  • apps/vercel/api/_auth.ts
  • apps/vercel/package.json
  • package.json
🚧 Files skipped from review as they are similar to previous changes (6)
  • apps/tanstack-start/src/auth.ts
  • package.json
  • apps/nuxt/shared/auth.ts
  • apps/astro/src/auth.ts
  • apps/nextjs/pages-router/src/auth.ts
  • apps/nuxt/nuxt.config.ts

Copy link

@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.

♻️ Duplicate comments (2)
.github/workflows/ci.yaml (2)

34-59: ⚠️ Potential issue | 🟠 Major

PR objective is still not met: only Node.js runs in CI.

The workflow defines only jobs.node; there are no Bun/Deno jobs, so runtime coverage promised by this PR is missing.

🔧 Proposed direction
 jobs:
   node:
     name: Node.js
     runs-on: ubuntu-latest
     timeout-minutes: 25
     steps:
       # existing node steps...
+
+  bun:
+    name: Bun
+    runs-on: ubuntu-latest
+    timeout-minutes: 25
+    steps:
+      - uses: actions/checkout@v4
+      - uses: oven-sh/setup-bun@v2
+      - name: Install dependencies
+        run: bun install --frozen-lockfile
+      - name: Build packages
+        run: bun run build:prod
+      - name: Run type checks
+        run: bun run type-check
+      - name: Run tests
+        run: bun test
+
+  deno:
+    name: Deno
+    runs-on: ubuntu-latest
+    timeout-minutes: 25
+    steps:
+      - uses: actions/checkout@v4
+      - uses: denoland/setup-deno@v2
+        with:
+          deno-version: v2.x
+      - name: Run checks
+        run: deno task check
+      - name: Run tests
+        run: deno task test
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yaml around lines 34 - 59, The CI currently only
defines the job "node" (jobs.node) so Bun and Deno runtimes are missing; add
separate jobs (e.g., jobs.bun and jobs.deno) that mirror the Node job steps but
use appropriate setup actions/steps for Bun and Deno (replace actions/setup-node
with the Bun and Deno setup actions or installation commands, ensure
environment-specific node-version step is removed/adjusted), keep
install/build/type-check/test steps consistent (pnpm
install/build/type-check/test) and ensure they run in parallel with jobs.node by
placing them at the top-level of the jobs map.

7-11: ⚠️ Potential issue | 🟠 Major

Path filters still allow relevant changes to bypass CI.

apps/**, bun.lock, and deno.lock are missing from both path filters, so app-only changes or Bun/Deno lockfile updates won’t trigger this workflow.

🔧 Proposed fix
 on:
   push:
     branches:
       - master
     paths:
       - ".github/workflows/**"
       - "configs/**"
+      - "apps/**"
       - "packages/**"
       - "pnpm-lock.yaml"
+      - "bun.lock"
+      - "deno.lock"
   pull_request:
     branches:
       - master
     paths:
       - ".github/workflows/**"
       - "configs/**"
+      - "apps/**"
       - "packages/**"
       - "pnpm-lock.yaml"
+      - "bun.lock"
+      - "deno.lock"

Also applies to: 15-19

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yaml around lines 7 - 11, The CI path filters are
incomplete: update the workflow's paths blocks (the "paths:" entries) to include
the missing project patterns so relevant changes trigger CI; add "apps/**",
"bun.lock", and "deno.lock" to the existing list (and replicate the same
additions in the other paths block referenced by the comment) so app-only
changes and Bun/Deno lockfile updates won't bypass this workflow.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/ci.yaml:
- Around line 34-59: The CI currently only defines the job "node" (jobs.node) so
Bun and Deno runtimes are missing; add separate jobs (e.g., jobs.bun and
jobs.deno) that mirror the Node job steps but use appropriate setup
actions/steps for Bun and Deno (replace actions/setup-node with the Bun and Deno
setup actions or installation commands, ensure environment-specific node-version
step is removed/adjusted), keep install/build/type-check/test steps consistent
(pnpm install/build/type-check/test) and ensure they run in parallel with
jobs.node by placing them at the top-level of the jobs map.
- Around line 7-11: The CI path filters are incomplete: update the workflow's
paths blocks (the "paths:" entries) to include the missing project patterns so
relevant changes trigger CI; add "apps/**", "bun.lock", and "deno.lock" to the
existing list (and replicate the same additions in the other paths block
referenced by the comment) so app-only changes and Bun/Deno lockfile updates
won't bypass this workflow.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f63372e and 59b85a5.

📒 Files selected for processing (2)
  • .github/workflows/ci.yaml
  • turbo.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • turbo.json

@halvaradop halvaradop changed the title chore(ci): add Deno and Bun to CI workflow chore(ci): enable turborepo remote caching with vercel and github actions Mar 3, 2026
@halvaradop halvaradop changed the title chore(ci): enable turborepo remote caching with vercel and github actions chore(ci): enable turborepo remote caching Mar 3, 2026
@halvaradop halvaradop merged commit 8e25aef into master Mar 3, 2026
8 checks passed
@halvaradop halvaradop deleted the chore/add-deno-bun-runtimes branch March 3, 2026 15:34
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