Repository navigation
chore(deps): replace tsup with tsdown 0.23.1 - #1527
Merged
Merged
Conversation
tsup is no longer actively maintained and recommends tsdown. @linaria/atomic, @linaria/core and @linaria/react now build dist/ with tsdown 0.23.1; the tsdown options in each manifest keep the entries, the source maps, the .js and .mjs extensions, the named CommonJS exports and the declarations from tsc. The lockfile drops tsup 7.2.0 with esbuild 0.18.20 and @swc/core 1.3.20 and adds tsdown 0.23.1, which reuses the locked rolldown 1.2.14.
…S markers tsup ran with `splitting: false`, which tsdown does not have, so one build of all entries moved the atomize helper of @linaria/atomic and the CommonJS interop runtime of @linaria/react into shared chunks with hashed names. Each manifest now lists one tsdown config per entry with `root: "src"`, so every entry is bundled on its own as before and dist/ has the same files. `outputOptions.esModule: true` keeps `__esModule` on the CommonJS entries that have no default export, and `outputOptions.strict: true` keeps the "use strict" directive at the top of every CommonJS file, as tsup wrote them.
🦋 Changeset detectedLatest commit: a296be1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
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 |
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
The tsup README says it is no longer actively maintained and recommends tsdown.
@linaria/atomic,@linaria/coreand@linaria/reactnow builddist/with tsdown 0.23.1; the published files keep their paths, export names and module specifiers.Why each option (the tsdown defaults differ from the tsup config):
root: "src": tsdown has nosplitting: false. One config for all entries emitted shared chunks (atomize-*in atomic,rolldown-runtime-*in react), which added published files and changed a testkit snapshot.rootkeepsdist/processors/*.fixedExtension: false: without a"type"field tsdown writes.cjs, butmain,exportsand the hand-writtenprocessors/*.jsuse.jsand.mjs.cjsDefault: false: processors only have a default export, which tsdown would turn intomodule.exports = ...; the wrappers read.default.dts: false: tsdown enables declarations when a manifest hastypes;tscalready writestypes/.sourcemap: true,clean: true: as before; source maps are off by default.outputOptions.esModuleandstrict: rolldown sets__esModuleonly for entries with a default export and"use strict"only if the source has it; tsup always did both.^0.23.1a regenerated lockfile would take 0.23.2 (2026-10-23, under a week old).Lockfile
Evidence
npm pack --dry-run --jsonin the nine published packages, after a clean forced build with tsup 7.2.0 and with tsdown: 149 files, same paths. Two clean builds of each side hash identically. The six packages that are not bundled are byte-identical.distfiles, 3package.json; the manifests only inbuild:distand the config key). Indist: rolldown's formatting and regenerated source maps with fewer sources; CommonJS exports are plain data properties instead of getters, with aSymbol.toStringTagofModule; comments such as the JSDoc ofcxare kept; another interop helper.__esModuleandtypeof defaultof every entry and wrapper, and the module specifiers of all 14distfiles are identical; the 7 CommonJS files still start with"use strict"; all 14 parse as ES2022.dist/processors/styled.mjsof atomic and react cannot be imported natively in Node, before and after (resolvehas no named exportsync).pnpm check:all32 tasks plus eslint and syncpack.build:dist --watchin core rebuildsdist/index.jsafter an edit and after the revert, keepingdist/processors/*.Node floor
tsdown 0.23.1 needs Node
^22.18.0 || ^24.11.0 || >=26.0.0, narrower thanengines.node>=22.12.0, which stays. The CI matrix (22.x,24.x) is inside it; Node 22.12 to 22.17 only gets an install warning. The output language level now followsengines.nodeinstead of thees2022tsconfig target.Changeset
.changeset/build-with-tsdown.md,patchfor the three packages:Left out
engines.node; pinning the outputtarget.tscpackages; declarations stay withtsc.Not verified
pnpm-lock.yaml, which would need the lockfile regenerated.