Skip to content

fix(vite-config): keep tsconfig path specifiers in internal declarations - #440

Merged
schiller-manuel merged 1 commit into
mainfrom
fix/vite-config-internal-paths
Nov 29, 2026
Merged

schiller-manuel merged 1 commit into
mainfrom
fix/vite-config-internal-paths

Conversation

@schiller-manuel

@schiller-manuel schiller-manuel commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #437 and #438. They merged minutes apart, so the dts() call that #437 added for internalDeclarations did not get the pathsToAliases: false that #438 gave the other two.

In 0.7.0 the dist/esm and dist/cjs declarations keep import specifiers as written, while dist/internal still has tsconfig paths imports rewritten into relative paths:

 // dist/internal/self.d.ts
-import { Match } from './index.ts';
+import { Match } from '@tanstack/integration-internal-declarations';

Changes

  • pathsToAliases: false on the third dts() call.
  • The internal-declarations fixture gets a tsconfig paths entry without a baseUrl and a file that imports through it. A new test asserts that all three declaration sets keep the package specifier. It fails on main for dist/internal.
  • Patch changeset.

Validation

  • integrations/internal-declarations: build and 6 tests pass.
  • integrations/internal-declarations-consumer: build and 3 tests pass.
  • oxfmt reports no changes.

The full test:ci target was not run locally.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • TypeScript declarations now preserve package import specifiers instead of rewriting them to relative paths.
  • New Features

    • Added the MatchId type for use in generated declarations.

The declarations written by `internalDeclarations` were still rewritten
from tsconfig `paths` into relative paths, because the third `dts()` call
did not get `pathsToAliases: false`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a1cb981

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tanstack/vite-config Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-29T14:59:08.927567Z a1cb981 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The internal declaration-generation configuration now disables path-to-alias rewriting. The integration fixture adds a tsconfig path mapping and checks that generated ESM, CJS, and internal declarations retain the package specifier.

Changes: Declaration import specifiers

Layer / File(s) Summary
Disable internal declaration alias rewriting
packages/vite-config/src/index.ts, .changeset/internal-declarations-import-specifiers.md
The internal declaration-generation configuration sets pathsToAliases: false. A patch changeset records the update.
Verify generated declaration specifiers
integrations/internal-declarations/tsconfig.json, integrations/internal-declarations/src/*, integrations/internal-declarations/snap/*/{self,extra}.*, integrations/internal-declarations/tests/build.test.ts
The integration fixture adds a package path mapping and a MatchId type. The build test checks that ESM, CJS, and internal declarations retain the package specifier.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • TanStack/config#437: Adds the internalDeclarations option and the third dts() call that this change configures.
  • TanStack/config#438: Sets pathsToAliases: false on the other two dts() calls to retain tsconfig path specifiers.

Suggested reviewers: kevinvandy, lachlancollins

Merge Risk: Minimal · up to a1cb9 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix and the affected area: tsconfig path specifiers are kept in internal declarations, which matches the change to pathsToAliases for the third dts() call. It is specific and accur…
Description check Passed The description follows the template's main sections. It gives a clear change summary with motivation and a diff, lists the changes, and reports local validation. The checklist items are not ticked, a…
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.
Full details: Title check

Explanation

The title names the fix and the affected area: tsconfig path specifiers are kept in internal declarations, which matches the change to pathsToAliases for the third dts() call. It is specific and accurate. The prefix follows the conventional-commit style.

Full details: Description check

Explanation

The description follows the template's main sections. It gives a clear change summary with motivation and a diff, lists the changes, and reports local validation. The checklist items are not ticked, and the release-impact choice is not marked. The description does not state whether a changeset was generated, though the Changes list says a patch changeset is included. The description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b0ca425d-4ff1-46de-810b-2359cceae2eb
Commits

Reviewing files that changed from the base of the PR and between a2e2749 and a1cb981.

Files ignored due to path filters: 2

  • integrations/internal-declarations/snap/cjs/extra.cjs.map is excluded by !**/*.map
  • integrations/internal-declarations/snap/esm/extra.js.map is excluded by !**/*.map
Files selected for processing: 12

  • .changeset/internal-declarations-import-specifiers.md
  • integrations/internal-declarations/snap/cjs/extra.d.cts
  • integrations/internal-declarations/snap/cjs/self.d.cts
  • integrations/internal-declarations/snap/esm/extra.d.ts
  • integrations/internal-declarations/snap/esm/self.d.ts
  • integrations/internal-declarations/snap/internal/extra.d.ts
  • integrations/internal-declarations/snap/internal/self.d.ts
  • integrations/internal-declarations/src/extra.ts
  • integrations/internal-declarations/src/self.ts
  • integrations/internal-declarations/tests/build.test.ts
  • integrations/internal-declarations/tsconfig.json
  • packages/vite-config/src/index.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

1 package(s) bumped directly, 0 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/vite-config 0.7.0 → 0.7.1 Changeset

@nx-cloud

nx-cloud Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit a1cb981

Command Status Duration Result
nx affected --targets=test:sherif,test:docs,tes... ✅ Succeeded 8s View ↗
nx run-many --target=build ✅ Succeeded 5s View ↗

💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-11-29 14:58:04 UTC

@pkg-pr-new

pkg-pr-new Bot commented Nov 29, 2026

Copy link
Copy Markdown
@tanstack/eslint-config

npm i https://pkg.pr.new/@tanstack/eslint-config@440

@tanstack/oxfmt-config

npm i https://pkg.pr.new/@tanstack/oxfmt-config@440

@tanstack/oxlint-config

npm i https://pkg.pr.new/@tanstack/oxlint-config@440

@tanstack/publish-config

npm i https://pkg.pr.new/@tanstack/publish-config@440

@tanstack/typedoc-config

npm i https://pkg.pr.new/@tanstack/typedoc-config@440

@tanstack/vite-config

npm i https://pkg.pr.new/@tanstack/vite-config@440

commit: a1cb981

@schiller-manuel
schiller-manuel merged commit 15ece4d into main Nov 29, 2026
10 checks passed
@schiller-manuel
schiller-manuel deleted the fix/vite-config-internal-paths branch November 29, 2026 15:07
@github-actions github-actions Bot mentioned this pull request Nov 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR has been released!

Thank you for your contribution!

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