Skip to content

chore(tsconfig): add per-integration TypeScript configuration files#113

Open
halvaradop wants to merge 2 commits intomasterfrom
chore/add-per-integration-tsconfig
Open

chore(tsconfig): add per-integration TypeScript configuration files#113
halvaradop wants to merge 2 commits intomasterfrom
chore/add-per-integration-tsconfig

Conversation

@halvaradop
Copy link
Member

@halvaradop halvaradop commented Mar 6, 2026

Description

// @ignore-error

Summary by CodeRabbit

  • Chores
    • Centralized TypeScript configuration across multiple applications through new shared presets.
    • Reorganized workspace dependencies, moving @aura-stack/auth from dev to production dependencies in applicable apps.
    • Updated authentication configuration with improved type safety via runtime type assertions.
    • Enhanced base TypeScript compiler options for stricter control flow checks.

@vercel
Copy link

vercel bot commented Mar 6, 2026

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

Project Deployment Actions Updated (UTC)
auth Ready Ready Preview, Comment Mar 6, 2026 3:15am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
auth-nextjs-demo Skipped Skipped Mar 6, 2026 3:15am

@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

📝 Walkthrough

Walkthrough

This PR consolidates TypeScript configurations by creating shared presets in configs/tsconfig/ and updating apps to extend these configs instead of duplicating compiler options inline. The @aura-stack/tsconfig workspace package is added as a dependency. Auth export type annotation in apps/bun is also refactored to use satisfies assertion.

Changes

Cohort / File(s) Summary
Shared TypeScript Config Presets
configs/tsconfig/bun.json, configs/tsconfig/next.json, configs/tsconfig/react-router.json, configs/tsconfig/tanstack.json, configs/tsconfig/worker.json
Five new TypeScript configuration files created to provide runtime-specific and framework-specific compiler options, enabling centralized configuration management across the monorepo.
Base TypeScript Config Enhancement
configs/tsconfig/tsconfig.base.json
Added noFallthroughCasesInSwitch: true to enforce stricter control flow checks across all configurations inheriting from the base config.
Bun App Package & Config Updates
apps/bun/package.json, apps/bun/tsconfig.json
Added @aura-stack/tsconfig workspace dependency; updated tsconfig to extend @aura-stack/tsconfig/bun.json, removing 27 lines of explicit compiler options.
Cloudflare App Config Updates
apps/cloudflare/package.json, apps/cloudflare/tsconfig.json
Added @aura-stack/tsconfig workspace dependency; updated tsconfig to extend @aura-stack/tsconfig/worker.json, reducing compiler option declarations.
Elysia & Hono App Config Updates
apps/elysia/tsconfig.json, apps/hono/tsconfig.json
Updated both tscconfigs to extend @aura-stack/tsconfig/bun.json; hono also removed explicit strict and jsx options now provided by base config.
Next.js App-Router Updates
apps/nextjs/app-router/package.json, apps/nextjs/app-router/tsconfig.json
Moved @aura-stack/auth from devDependencies to dependencies; added @aura-stack/tsconfig to devDependencies; updated tsconfig to extend @aura-stack/tsconfig/next.json.
Next.js Pages-Router Updates
apps/nextjs/pages-router/package.json, apps/nextjs/pages-router/tsconfig.json
Moved @aura-stack/auth from devDependencies to dependencies; replaced devDependency with @aura-stack/tsconfig; updated tsconfig to extend @aura-stack/tsconfig/next.json.
React-Router App Updates
apps/react-router/package.json, apps/react-router/tsconfig.json
Added @aura-stack/auth to dependencies; replaced devDependency with @aura-stack/tsconfig; updated tsconfig to extend @aura-stack/tsconfig/react-router.json with simplified include paths.
TanStack Start App Updates
apps/tanstack-start/package.json, apps/tanstack-start/tsconfig.json
Added @aura-stack/auth to dependencies; replaced devDependency with @aura-stack/tsconfig; updated tsconfig to extend @aura-stack/tsconfig/tanstack.json, removing 19 lines of compiler options.
Bun Auth Export Type Change
apps/bun/src/auth.ts
Removed explicit : AuthInstance type annotation from destructured export; added satisfies AuthInstance assertion at expression end; included @todo documentation comment for future type refinement.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

refactor

Poem

🐰 Configurations consolidated, no more duplication!
Shared presets guide each app's compilation,
Bun and Next.js, React and workers too,
All extend from base configs now, shiny and new.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objective of the PR: adding per-integration TypeScript configuration files across multiple apps and configs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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-per-integration-tsconfig

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.

@vercel vercel bot temporarily deployed to Preview – auth March 6, 2026 03:15 Inactive
@vercel vercel bot temporarily deployed to Preview – auth-nextjs-demo March 6, 2026 03:15 Inactive
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/nextjs/app-router/tsconfig.json (1)

13-22: ⚠️ Potential issue | 🟡 Minor

Remove duplicate include entries.

Lines 20 and 21 contain identical entries (.next\\dev/types/**/*.ts). This appears to be a copy-paste mistake and should be deduplicated.

🔧 Proposed fix
   "include": [
     "next-env.d.ts",
     "**/*.ts",
     "**/*.tsx",
     ".next/types/**/*.ts",
     ".next/dev/types/**/*.ts",
-    "**/*.mts",
-    ".next\\dev/types/**/*.ts",
-    ".next\\dev/types/**/*.ts"
+    "**/*.mts"
   ],
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/nextjs/app-router/tsconfig.json` around lines 13 - 22, The "include"
array in tsconfig currently contains a duplicated entry
".next\\dev/types/**/*.ts"; remove the duplicate so only one
".next\\dev/types/**/*.ts" remains in the "include" array (or replace both with
a single normalized path like ".next/dev/types/**/*.ts" if you prefer forward
slashes), editing the "include" array entry in
apps/nextjs/app-router/tsconfig.json to dedupe the repeated value.
🧹 Nitpick comments (3)
configs/tsconfig/bun.json (1)

1-15: Configuration looks good; minor redundancy noted.

The Bun-specific configuration is well-suited for the runtime. One minor observation: noFallthroughCasesInSwitch is already enabled in tsconfig.base.json (which this extends), making line 11 redundant. Consider removing it to keep the preset minimal.

♻️ Optional cleanup
     "verbatimModuleSyntax": true,
     "noEmit": true,
-    "noFallthroughCasesInSwitch": true,
     "noUncheckedIndexedAccess": true,
     "noImplicitOverride": true
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@configs/tsconfig/bun.json` around lines 1 - 15, Remove the redundant compiler
option by deleting "noFallthroughCasesInSwitch" from the bun-specific tsconfig
(it is already enabled in tsconfig.base.json), leaving the rest of the
"compilerOptions" intact in the bun configuration so it inherits the base
setting.
apps/tanstack-start/tsconfig.json (1)

4-4: Let the shared preset own module.

configs/tsconfig/tanstack.json:1-12 already sets "module": "ESNext", so Line 4 reintroduces duplication that this preset split is meant to remove.

Suggested cleanup
   "compilerOptions": {
-    "module": "ESNext",
     "types": ["vite/client"],
     "baseUrl": ".",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/tanstack-start/tsconfig.json` at line 4, Remove the duplicated "module":
"ESNext" entry from the local tsconfig (apps/tanstack-start/tsconfig.json) so
the shared preset (configs/tsconfig/tanstack.json) owns that setting; locate the
"module" key in the tsconfig used by the tanstack-start project and delete that
line so the project inherits the value from the shared tanstack preset.
apps/cloudflare/tsconfig.json (1)

4-4: Remove the local declaration file from types.

worker-configuration.d.ts is already included at Line 7. compilerOptions.types is documented as a whitelist of type packages added to the global scope, so keeping a project file path here is unnecessary and makes the config harder to read. Leave the local .d.ts in include/files and keep only package names in types. (typescriptlang.org)

Suggested cleanup
   "compilerOptions": {
-    "types": ["./worker-configuration.d.ts", "node"]
+    "types": ["node"]
   },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/cloudflare/tsconfig.json` at line 4, Remove the local declaration file
from the compilerOptions.types array: delete "worker-configuration.d.ts" from
the "types" list and leave only package names (e.g., "node"), while keeping the
local worker-configuration.d.ts referenced via "include" or "files"; this
ensures compilerOptions.types is used as a whitelist of global type packages and
the local .d.ts remains available through the include/files settings.
🤖 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/bun/package.json`:
- Around line 13-15: The package.json currently lists "@aura-stack/tsconfig"
under dependencies; move "@aura-stack/tsconfig" from the dependencies section
into devDependencies so it is treated as a build-time-only dependency; update
the dependencies and devDependencies objects accordingly, ensuring
"@aura-stack/auth" remains in dependencies and "@aura-stack/tsconfig" appears
under devDependencies.

In `@apps/cloudflare/package.json`:
- Around line 16-19: The package.json currently lists "@aura-stack/tsconfig"
under "dependencies"; move that package into "devDependencies" instead so it's
treated as a build-time/dev-only dependency (leave "@aura-stack/auth" in
"dependencies"). Update the JSON keys in apps/cloudflare's package.json by
removing the "@aura-stack/tsconfig" entry from "dependencies" and adding the
same name and version ("workspace:*") under "devDependencies" to match apps/bun
and the rest of the repo.

In `@configs/tsconfig/react-router.json`:
- Around line 1-10: This config is missing an "extends" clause so it doesn't
inherit the strict compiler settings from the base; update
configs/tsconfig/react-router.json to add an "extends": "./tsconfig.base.json"
top-level property so the base's strict flags (strict, strictNullChecks,
noImplicitAny, noFallthroughCasesInSwitch, etc.) are inherited, and keep only
overrides inside "compilerOptions" (do not re-declare strict-related flags in
compilerOptions unless intentionally overriding them).

In `@configs/tsconfig/worker.json`:
- Around line 1-10: Add an "extends" clause so this tsconfig inherits strict
settings from the base config: update the root object in the config (the one
containing "compilerOptions") to include "extends": "./tsconfig.base.json" while
keeping the existing "compilerOptions" entries; this ensures settings like
strictFunctionTypes and noFallthroughCasesInSwitch from the base are applied to
the worker preset.

---

Outside diff comments:
In `@apps/nextjs/app-router/tsconfig.json`:
- Around line 13-22: The "include" array in tsconfig currently contains a
duplicated entry ".next\\dev/types/**/*.ts"; remove the duplicate so only one
".next\\dev/types/**/*.ts" remains in the "include" array (or replace both with
a single normalized path like ".next/dev/types/**/*.ts" if you prefer forward
slashes), editing the "include" array entry in
apps/nextjs/app-router/tsconfig.json to dedupe the repeated value.

---

Nitpick comments:
In `@apps/cloudflare/tsconfig.json`:
- Line 4: Remove the local declaration file from the compilerOptions.types
array: delete "worker-configuration.d.ts" from the "types" list and leave only
package names (e.g., "node"), while keeping the local worker-configuration.d.ts
referenced via "include" or "files"; this ensures compilerOptions.types is used
as a whitelist of global type packages and the local .d.ts remains available
through the include/files settings.

In `@apps/tanstack-start/tsconfig.json`:
- Line 4: Remove the duplicated "module": "ESNext" entry from the local tsconfig
(apps/tanstack-start/tsconfig.json) so the shared preset
(configs/tsconfig/tanstack.json) owns that setting; locate the "module" key in
the tsconfig used by the tanstack-start project and delete that line so the
project inherits the value from the shared tanstack preset.

In `@configs/tsconfig/bun.json`:
- Around line 1-15: Remove the redundant compiler option by deleting
"noFallthroughCasesInSwitch" from the bun-specific tsconfig (it is already
enabled in tsconfig.base.json), leaving the rest of the "compilerOptions" intact
in the bun configuration so it inherits the base setting.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 50021d46-d655-4dea-920b-84908cb63fcc

📥 Commits

Reviewing files that changed from the base of the PR and between 200be9e and e3bdb0f.

⛔ Files ignored due to path filters (2)
  • bun.lock is excluded by !**/*.lock
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • apps/bun/package.json
  • apps/bun/src/auth.ts
  • apps/bun/tsconfig.json
  • apps/cloudflare/package.json
  • apps/cloudflare/tsconfig.json
  • apps/elysia/tsconfig.json
  • apps/hono/tsconfig.json
  • apps/nextjs/app-router/package.json
  • apps/nextjs/app-router/tsconfig.json
  • apps/nextjs/pages-router/package.json
  • apps/nextjs/pages-router/tsconfig.json
  • apps/react-router/package.json
  • apps/react-router/tsconfig.json
  • apps/tanstack-start/package.json
  • apps/tanstack-start/tsconfig.json
  • configs/tsconfig/bun.json
  • configs/tsconfig/next.json
  • configs/tsconfig/react-router.json
  • configs/tsconfig/tanstack.json
  • configs/tsconfig/tsconfig.base.json
  • configs/tsconfig/worker.json

Comment on lines +13 to 15
"@aura-stack/auth": "workspace:*",
"@aura-stack/tsconfig": "workspace:*"
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Move @aura-stack/tsconfig to devDependencies.

@aura-stack/tsconfig is a build-time TypeScript configuration package that should be in devDependencies, not dependencies. Other apps in this PR (react-router, tanstack-start) correctly place it in devDependencies.

🔧 Proposed fix
   "dependencies": {
-    "@aura-stack/auth": "workspace:*",
-    "@aura-stack/tsconfig": "workspace:*"
+    "@aura-stack/auth": "workspace:*"
   },
   "devDependencies": {
+    "@aura-stack/tsconfig": "workspace:*",
     "@types/bun": "^1.3.9"
   },
📝 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.

Suggested change
"@aura-stack/auth": "workspace:*",
"@aura-stack/tsconfig": "workspace:*"
},
"dependencies": {
"@aura-stack/auth": "workspace:*"
},
"devDependencies": {
"@aura-stack/tsconfig": "workspace:*",
"@types/bun": "^1.3.9"
},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/bun/package.json` around lines 13 - 15, The package.json currently lists
"@aura-stack/tsconfig" under dependencies; move "@aura-stack/tsconfig" from the
dependencies section into devDependencies so it is treated as a build-time-only
dependency; update the dependencies and devDependencies objects accordingly,
ensuring "@aura-stack/auth" remains in dependencies and "@aura-stack/tsconfig"
appears under devDependencies.

Comment on lines 16 to 19
"dependencies": {
"@aura-stack/auth": "workspace:*"
"@aura-stack/auth": "workspace:*",
"@aura-stack/tsconfig": "workspace:*"
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Move @aura-stack/tsconfig to devDependencies.

Same issue as apps/bun/package.json — the tsconfig package is a build-time dependency and should be in devDependencies for consistency with other apps.

🔧 Proposed fix
   "dependencies": {
-    "@aura-stack/auth": "workspace:*",
-    "@aura-stack/tsconfig": "workspace:*"
+    "@aura-stack/auth": "workspace:*"
   },
   "devDependencies": {
+    "@aura-stack/tsconfig": "workspace:*",
     "@cloudflare/vitest-pool-workers": "^0.12.4",
📝 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.

Suggested change
"dependencies": {
"@aura-stack/auth": "workspace:*"
"@aura-stack/auth": "workspace:*",
"@aura-stack/tsconfig": "workspace:*"
},
"dependencies": {
"@aura-stack/auth": "workspace:*"
},
"devDependencies": {
"@aura-stack/tsconfig": "workspace:*",
"@cloudflare/vitest-pool-workers": "^0.12.4",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/cloudflare/package.json` around lines 16 - 19, The package.json
currently lists "@aura-stack/tsconfig" under "dependencies"; move that package
into "devDependencies" instead so it's treated as a build-time/dev-only
dependency (leave "@aura-stack/auth" in "dependencies"). Update the JSON keys in
apps/cloudflare's package.json by removing the "@aura-stack/tsconfig" entry from
"dependencies" and adding the same name and version ("workspace:*") under
"devDependencies" to match apps/bun and the rest of the repo.

Comment on lines +1 to +10
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "bundler",
"jsx": "react-jsx",
"verbatimModuleSyntax": true,
"noEmit": true
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Missing extends clause results in loss of strict type-checking.

Unlike next.json which extends ./tsconfig.base.json, this config is standalone. Apps using this preset will lose critical strict-mode settings (strict, strictNullChecks, noImplicitAny, noFallthroughCasesInSwitch, etc.) that are defined in the base config.

🔧 Proposed fix to extend the base config
 {
+  "extends": "./tsconfig.base.json",
   "compilerOptions": {
     "target": "ES2022",
     "module": "ES2022",
     "moduleResolution": "bundler",
     "jsx": "react-jsx",
     "verbatimModuleSyntax": true,
     "noEmit": true
   }
 }
📝 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.

Suggested change
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "bundler",
"jsx": "react-jsx",
"verbatimModuleSyntax": true,
"noEmit": true
}
}
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "bundler",
"jsx": "react-jsx",
"verbatimModuleSyntax": true,
"noEmit": true
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@configs/tsconfig/react-router.json` around lines 1 - 10, This config is
missing an "extends" clause so it doesn't inherit the strict compiler settings
from the base; update configs/tsconfig/react-router.json to add an "extends":
"./tsconfig.base.json" top-level property so the base's strict flags (strict,
strictNullChecks, noImplicitAny, noFallthroughCasesInSwitch, etc.) are
inherited, and keep only overrides inside "compilerOptions" (do not re-declare
strict-related flags in compilerOptions unless intentionally overriding them).

Comment on lines +1 to +10
{
"compilerOptions": {
"target": "ES2024",
"lib": ["ES2024", "WebWorker"],
"jsx": "react-jsx",
"module": "ES2022",
"moduleResolution": "bundler",
"noEmit": true
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Missing extends clause loses strict type-checking settings.

This config does not extend ./tsconfig.base.json. As noted in the context snippet, the base config defines strictFunctionTypes: true, noFallthroughCasesInSwitch: true, and other strict settings. Apps using this worker preset (e.g., apps/cloudflare) will lose these guarantees.

🔧 Proposed fix to extend the base config
 {
+  "extends": "./tsconfig.base.json",
   "compilerOptions": {
     "target": "ES2024",
     "lib": ["ES2024", "WebWorker"],
     "jsx": "react-jsx",
     "module": "ES2022",
     "moduleResolution": "bundler",
     "noEmit": true
   }
 }
📝 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.

Suggested change
{
"compilerOptions": {
"target": "ES2024",
"lib": ["ES2024", "WebWorker"],
"jsx": "react-jsx",
"module": "ES2022",
"moduleResolution": "bundler",
"noEmit": true
}
}
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"target": "ES2024",
"lib": ["ES2024", "WebWorker"],
"jsx": "react-jsx",
"module": "ES2022",
"moduleResolution": "bundler",
"noEmit": true
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@configs/tsconfig/worker.json` around lines 1 - 10, Add an "extends" clause so
this tsconfig inherits strict settings from the base config: update the root
object in the config (the one containing "compilerOptions") to include
"extends": "./tsconfig.base.json" while keeping the existing "compilerOptions"
entries; this ensures settings like strictFunctionTypes and
noFallthroughCasesInSwitch from the base are applied to the worker preset.

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