Merged
Conversation
commit: |
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that a root TypeScript project with references is built (using the solution builder) before generating declaration output, and adds a fallback for existing .d.ts files.
- Introduce a new
tsconfigpath option and propagate it through TscOptions. - Add
buildSolutionto runtsc --buildon composite project references. - Update the
maptype toSourceMapInputand handle fallback when only declaration files exist.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/utils/tsc.ts | Added tsconfig field, buildSolution logic, enhanced debug output, .d.ts fallback path, and map type update |
| src/generate.ts | Imported and propagated tsconfig, updated SourceMapInput usage in plugin code |
Comments suppressed due to low confidence (2)
src/utils/tsc.ts:202
- This fallback branch for declaration files isn’t covered by existing tests. Add a test to verify that when
isDeclarationFileis true and no emit occurs, the source text is returned.
if (!dtsCode && file.isDeclarationFile) {
src/utils/tsc.ts:39
- [nitpick] The property name
tsconfigmay be ambiguous between a config object and a file path. Consider renaming it totsconfigPathfor clarity.
tsconfig: string | undefined
sxzz
reviewed
Jun 1, 2025
sxzz
approved these changes
Jun 1, 2025
Owner
sxzz
left a comment
There was a problem hiding this comment.
LGTM, if there's one more unit test :P
763e707 to
6ad7987
Compare
Collaborator
Author
|
@sxzz I've added a test. I also rearranged all commits so that we can ensure that the test can fail without the patch. |
sxzz
approved these changes
Jun 4, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Build the project and its dependencies/references. This addresses issue rolldown/tsdown#286
Linked Issues
rolldown/tsdown#286
Additional context
N/A