Repository navigation
fix(tsdown-plugin): install typescript so the lib preset's declarations build - #283
Merged
Merged
Conversation
The lib preset's `dts: true` needs `typescript` installed, and tsdown only takes it as an optional peer, so `rr pack` failed with "TypeScript is not installed" in a project without the ts plugin. install() now adds `typescript` (^6.0.0, the ts and astro plugins' pin) on every path, unless the package already has it in dependencies or devDependencies. uninstall() keeps it, since the project or another plugin may use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZVC7xzzsEmByszmfff4u2
🦋 Changeset detectedLatest commit: 8ae3af4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Contributor
Preview releaseLatest commit: Some packages have been released:
Note Use the PR number as tag to install any package. For instance: |
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.
Summary
@rrlab/tsdown-config's defaultlibpreset setsdts: true. tsdown takestypescriptonly as an optional peer, andrr plugins add tsdowndidn't install it, sorr packfailed in any project without the ts or astro plugin.install(ctx) // @rrlab/tsdown-plugin devDependencies tsdown ^0.22.0 + typescript ^6.0.0 // unless dependencies/devDependencies already have it @rrlab/tsdown-config uninstall(ctx) remove tsdown, @rrlab/tsdown-config // typescript stays: the host or ts/astro may use it^6.0.0is the same pin as the ts and astro plugins, so the order ofrr plugins add tsandrr plugins add tsdowndoesn't matter.pnpm addwould otherwise rewrite it. A peer-only declaration doesn't count, because it isn't installed.typescript >=5.0.0: thebinpreset builds without it.Evidence
Non-TTY e2e in a temp project, with the worktree's packed
@rrlab/cliand@rrlab/tsdown-plugin(viapnpm.overrides) andrr plugins add oxc, so the ts plugin isn't installed:rr plugins add tsdown </dev/nulladds no typescript.rr packexits 1 withError: TypeScript is not installed. You should install typescript package.After: typescript
^6.0.3is added.rr packexits 0 and writesdist/index.d.mts, andrr checkpasses.typescript ~5.9: left as~5.9.3. Host with typescript only as a peer: installed. ts then tsdown, and tsdown then ts, both end with one typescript and greenrr pack/rr tsc.rr plugins remove tsdown --yesleaves typescript.install.test.ts: with theindex.tsfix reverted, 5 tests fail, covering the create, skip, decline, user-skip and peer-only paths. With the fix, 25/25 pass.Merge Danger
Door: two-way
Blast Radius: small
Only
rr plugins add tsdownchanges: it adds one dev dependency when it's missing. Existing projects aren't touched until they re-run the add.🤖 Generated with Claude Code
https://claude.ai/code/session_01EZVC7xzzsEmByszmfff4u2