Repository navigation
fix(tsdown-config): export the UserConfig its helpers return - #310
Merged
Merged
Conversation
Under TypeScript 7, rolldown-plugin-dts emits declarations with tsgo for every file of a package's tsconfig.json, `tsdown.config.ts` included. A plain `export default defineLibConfig()` then failed with TS2883: its inferred type, tsdown's `UserConfig`, could only be named through `.pnpm/tsdown@…/node_modules/tsdown`. Re-exporting the type lets TypeScript name it through `@rrlab/tsdown-config`. The package gets its first test. It builds and packs the package, lays the tarball out as pnpm does, and runs TypeScript 7's tsc with the dts plugin's tsgo arguments on a `tsdown.config.ts` that exports each helper as is. Without the re-export both fail with TS2883. tsdown moves from an auto-installed peer to a catalog devDependency, beside typescript, vitest and @types/node. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No configured credential can serve this run. Your Grok subscription has hit its usage limit. Re-trigger after it resets, or add an API key for this provider, which Pullfrog falls back to automatically. The providers' responses
|
🦋 Changeset detectedLatest commit: d05279f 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 |
Merged
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
Under TypeScript 7, rolldown-plugin-dts emits declarations with tsgo for every file of a package's
tsconfig.json,tsdown.config.tsincluded. A consumer's plainexport default defineLibConfig()infers tsdown'sUserConfig, which TypeScript could only name through.pnpm/tsdown@…/node_modules/tsdown, so the build failed with TS2883. Re-exporting the type gives it a portable name:// src/index.ts import { defineConfig, type UserConfig } from "tsdown"; + +export type { UserConfig } from "tsdown";The package had no tests. It gets a suite (
"test": "vitest run",vitest.config.ts, and catalog devDependencies@types/node,tsdown,typescript,vitest;tsdownwas only an auto-installed peer before) with one test,test/integration/declaration-emit.test.ts:It builds before packing so it also runs alone against the current source. Under
pnpm test, turbo has already built.Evidence
Before (re-export removed): both helpers fail.
After:
Tests 2 passed (2), on Node 24 and on the 22.18.0 floor.A consumer package (pnpm, TypeScript 7.0.2,
tsdown.config.tscovered by itstsconfig.json,@rrlab/tsdown-configinstalled from a packed tarball,pnpm exec tsdown):@rrlab/tsdown-configtsdownpnpm buildpasses for every package, including the plugins whosetsdown.config.tscall the helpers.pnpm rr checkpasses too.Merge Danger
Door: two-way
It adds one type export and changes no runtime code.
Blast Radius: consumers
UserConfigfrom@rrlab/tsdown-config. It is tsdown's own type, so it follows the consumer's tsdown version.const config: UserConfig = defineLibConfig(…)) keeps working, and can drop the annotation.🤖 Generated with Claude Code