You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: run vue and dts declarations on the builder's typescript - #868
when a module resolves typescript to TypeScript 7 (for example when it comes in from a peer) and has @typescript/typescript6 installed, the declaration build crashes instead of using it:
TypeError: ts.parseConfigFileTextToJson is not a function
No actionable comments were generated in the recent review.
Walkthrough
Declaration generation now uses the TypeScript API selected by loadTypescript() for Vue files and declaration-worker imports. The worker resolves TypeScript subpaths from the selected installation and uses its version in the cache key. Documentation and tests cover TypeScript selection, TypeScript 7 fixture scenarios, peer resolution, and a missing-package error.
Merge Risk: Minimal · up to ea3b7 · assessed changes only
Path filters excluded changed files. This rating applies only to the assessed changes.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: the vue and dts declaration builds now run on the builder's TypeScript instance instead of a resolved module copy. The changeset matches this. The src/tsdown/dts.ts wo…
Description check
The description is related to the changeset. It explains the failure, where a module resolves typescript to TypeScript 7 and the declaration build crashes with TypeError: ts.parseConfigFileTextToJson …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: the vue and dts declaration builds now run on the builder's TypeScript instance instead of a resolved module copy. The changeset matches this. The src/tsdown/dts.ts worker redirects typescript imports to the instance from loadTypescript(), src/transpile/vue.ts passes that instance to emitVueDeclarations, and the test file covers the TypeScript 7 peer case. The title follows the conventional 'fix:' form and is specific enough for a teammate to scan.
Full details: Description check
Explanation
The description is related to the changeset. It explains the failure, where a module resolves typescript to TypeScript 7 and the declaration build crashes with TypeError: ts.parseConfigFileTextToJson is not a function. It also states the fix, which passes a TypeScript instance to emitVueDeclarations and matches the src/transpile/vue.ts change. The linked issue section is an unfilled template placeholder, but that does not make the description off-topic.
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
Warning
Some tools did not complete. Review the errors below.
ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
src/diagnostics.ts
Parsing error: Unexpected token {
src/transpile/typescript.ts
Parsing error: Unexpected token interface
src/transpile/vue.ts
Parsing error: Unexpected token {
2 others
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 894b2354-ad49-4d1d-a833-fe48606eaec9
Commits
Reviewing files that changed from the base of the PR and between be7b1fc and ea3b74d.
Files ignored due to path filters: 1
pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 8
docs/4.configuration.md
package.json
pnpm-workspace.yaml
src/diagnostics.ts
src/transpile/typescript.ts
src/transpile/vue.ts
src/tsdown/dts.ts
test/engines.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
📚 Description
when a module resolves
typescriptto TypeScript 7 (for example when it comes in from a peer) and has@typescript/typescript6installed, the declaration build crashes instead of using it:this adopts nuxt-contrib/vue-sfc-transformer#376 to pass a typescript to
emitVueDeclarations