Skip to content

refactor: replace deprecated tsconfck with get-tsconfig#4367

Merged
pi0 merged 11 commits into
mainfrom
refactor/tsconf
Jun 21, 2026
Merged

refactor: replace deprecated tsconfck with get-tsconfig#4367
pi0 merged 11 commits into
mainfrom
refactor/tsconf

Conversation

@pi0

@pi0 pi0 commented Jun 21, 2026

Copy link
Copy Markdown
Member

@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
nitro.build Ready Ready Preview, Comment Jun 21, 2026 9:57am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 633e84ee-4f7a-4780-9787-f1ef61e044ef

📥 Commits

Reviewing files that changed from the base of the PR and between 0228481 and cf47769.

📒 Files selected for processing (2)
  • docs/4.examples/vite-ssr-tss-react.md
  • examples/vite-ssr-tss-react/README.md

📝 Walkthrough

Walkthrough

Replaces the tsconfck devDependency with get-tsconfig in package.json. In src/config/resolvers/tsconfig.ts, loadTsconfig is rewritten to use parseTsconfig from get-tsconfig synchronously with a Map-backed cache, and resolveTsconfig drops its await. Vite example project and documentation are updated to remove the vite-tsconfig-paths plugin and use Vite's built-in resolve.tsconfigPaths.

Changes

tsconfig resolver dependency swap and example updates

Layer / File(s) Summary
Dependency swap and synchronous tsconfig resolver
package.json, src/config/resolvers/tsconfig.ts
tsconfck is removed from devDependencies and replaced with get-tsconfig. loadTsconfig is rewritten to call parseTsconfig synchronously, using a Map for caching and try/catch for failure handling. resolveTsconfig drops the await. baseUrl defaulting switches from the parser-provided tsconfigFile to resolve(tsConfigPath, "..").
Vite example and documentation updates
docs/4.examples/vite-ssr-tss-react.md, examples/vite-ssr-tss-react/package.json, examples/vite-ssr-tss-react/vite.config.mjs, examples/vite-ssr-tss-react/README.md
Removes vite-tsconfig-paths plugin from example and documentation. Enables resolve.tsconfigPaths: true in Vite config and adds tailwindcss() to the plugins array, simplifying the configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • nitrojs/nitro#3943: Both PRs modify the same example project dependencies, with this PR removing the vite-tsconfig-paths devDependency that the related PR previously versioned.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commits format with 'refactor:' prefix and clearly describes the main change: replacing deprecated tsconfck with get-tsconfig.
Description check ✅ Passed The description provides a GitHub issue link related to the changes, which is relevant to understanding the motivation for this refactoring.
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 refactor/tsconf

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.

@socket-security

socket-security Bot commented Jun 21, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedget-tsconfig@​4.14.01001009988100

View full report

@pkg-pr-new

pkg-pr-new Bot commented Jun 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/nitro@4367

commit: 0228481

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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)
src/config/resolvers/tsconfig.ts (1)

6-11: 💤 Low value

Consider removing async since function no longer awaits anything.

resolveTsconfig is marked async but performs no asynchronous operations after the refactor. Since loadTsconfig is now synchronous, the async keyword is unnecessary. The callers that await this function will still work correctly with a sync function.

♻️ Suggested cleanup
-export async function resolveTsconfig(options: NitroOptions) {
+export function resolveTsconfig(options: NitroOptions) {
   const root = resolve(options.rootDir || ".") + "/";
   if (!options.typescript.tsConfig) {
     options.typescript.tsConfig = loadTsconfig(root);
   }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/config/resolvers/tsconfig.ts` around lines 6 - 11, Remove the `async`
keyword from the `resolveTsconfig` function declaration since it no longer
contains any await statements after the refactor and `loadTsconfig` is now
synchronous. Change the function signature from `export async function
resolveTsconfig(options: NitroOptions)` to `export function
resolveTsconfig(options: NitroOptions)`. Callers that currently await this
function will continue to work correctly with a synchronous function.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/config/resolvers/tsconfig.ts`:
- Around line 19-20: Modify the empty catch block in the tsconfig.ts file to
distinguish between different error types instead of silently handling all
errors with an empty return. Check if the caught error is a "file not found"
error (ENOENT) - if so, silently return the empty object as acceptable fallback.
For other errors like parse errors or permission issues, log a warning message
that includes the error details before returning the empty object. This way,
actual configuration issues are surfaced to the user while gracefully handling
the expected case of a missing tsconfig.json file.

---

Nitpick comments:
In `@src/config/resolvers/tsconfig.ts`:
- Around line 6-11: Remove the `async` keyword from the `resolveTsconfig`
function declaration since it no longer contains any await statements after the
refactor and `loadTsconfig` is now synchronous. Change the function signature
from `export async function resolveTsconfig(options: NitroOptions)` to `export
function resolveTsconfig(options: NitroOptions)`. Callers that currently await
this function will continue to work correctly with a synchronous function.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bd648025-7bfc-4288-b7a5-705f6b65fad5

📥 Commits

Reviewing files that changed from the base of the PR and between 57ad8fe and 746f824.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • src/config/resolvers/tsconfig.ts

Comment thread src/config/resolvers/tsconfig.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/vite-ssr-tss-react/package.json`:
- Line 26: The vite-tsconfig-paths dependency has been removed from package.json
but the vite.config.mjs file still contains references to it. In the
vite.config.mjs file, remove the import statement for viteTsConfigPaths at the
top of the file and also remove the viteTsConfigPaths plugin call (with the
projects configuration) from the plugins array in the Vite configuration object
to prevent runtime errors when the module cannot be found.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: da5b30f0-6c3e-4790-bda9-a097ac185ec9

📥 Commits

Reviewing files that changed from the base of the PR and between 746f824 and 0228481.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • docs/4.examples/vite-ssr-tss-react.md
  • examples/vite-ssr-tss-react/package.json
  • examples/vite-ssr-tss-react/vite.config.mjs
  • src/config/resolvers/tsconfig.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/config/resolvers/tsconfig.ts

Comment thread examples/vite-ssr-tss-react/package.json
@pi0 pi0 merged commit 8a9a6d1 into main Jun 21, 2026
8 of 10 checks passed
@pi0 pi0 deleted the refactor/tsconf branch June 21, 2026 09:56
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