Conversation
✅ Deploy Preview for tsdown-main ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
tsdown
create-tsdown
@tsdown/css
@tsdown/exe
tsdown-migrate
commit: |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Release v0.22 updates focused on Node.js engine requirements and expanding config-loading capabilities (notably adding tsx), while adjusting related packaging metadata and docs.
Changes:
- Bump Node.js engine requirement across packages to
>=22.18.0and refresh related docs. - Add
tsxas a config loader option and handletsx/unrunas optional peer dependencies. - Change default
exports.binbehavior to implicitly auto-detect shebang entry chunks, with updated tests/docs.
Reviewed changes
Copilot reviewed 20 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/general.ts | Removes an eslint disable comment around typeAssert signature. |
| src/run.ts | Removes Node.js deprecation warning banner. |
| src/features/pkg/exports.ts | Updates exports.bin docs + changes default auto-detection behavior and error/warn handling. |
| src/features/pkg/exports.test.ts | Adds coverage for implicit bin auto-detection cases. |
| src/config/types.ts | Adds tsx to the configLoader union type. |
| src/config/options.ts | Infers dts from tsconfig declaration setting when present. |
| src/config/file.ts | Adds tsx loader implementation and switches optional loaders to importWithError. |
| src/cli.ts | Updates CLI help text to include tsx. |
| skills/tsdown/references/option-config-file.md | Documents tsx loader and optional peer dependency installs; updates Node requirement text. |
| skills/tsdown/references/guide-migrate-from-tsup.md | Updates Node requirement text. |
| skills/tsdown/references/guide-getting-started.md | Updates Node requirement text. |
| pnpm-workspace.yaml | Adds tsx catalog entry, moves unrun, and updates build allowlist. |
| packages/migrate/package.json | Bumps Node engine requirement. |
| packages/exe/package.json | Bumps Node engine requirement. |
| packages/css/package.json | Bumps Node engine requirement. |
| packages/create-tsdown/package.json | Bumps Node engine requirement. |
| package.json | Bumps Node engine requirement; makes tsx/unrun optional peers and removes unrun from deps. |
| docs/zh-CN/options/config-file.md | Documents tsx loader and optional peer dependency installs; updates Node requirement text. |
| docs/zh-CN/guide/getting-started.md | Updates Node requirement text and removes deprecation warning block. |
| docs/options/config-file.md | Documents tsx loader and optional peer dependency installs; updates Node requirement text. |
| docs/guide/getting-started.md | Updates Node requirement text and removes deprecation warning block. |
| snapshots/tsnapi/index.snapshot.d.ts | Updates generated types snapshot for configLoader union. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aa6b8b5 to
f502c04
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 23 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/features/pkg/exports.ts:520
- With the new default behavior (
binunset), this branch throws wheneverpkg.nameis missing, even if no shebang entry is detected and we would otherwise skipbingeneration. That’s a behavior change fromif (!bin) returnand can break builds for unnamed/private packages. Consider deferring thepkg.namerequirement until after a shebang has been detected (or only enforcing it forbin: true/ string form), and update the error message accordingly.
if (bin === true || bin === undefined || typeof bin === 'string') {
if (!pkg.name)
throw new Error(
'Package name is required when using string form for `bin`',
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…onfig loader - Bump engines to `>=22.18.0` across all packages - Move `unrun` from dependencies to optional peerDependencies - Add `tsx` as a new config loader option via tsImport API - Add `tsx` as optional peerDependency - Update docs and references accordingly
Description
v0.22 release. Bundles three breaking changes and one new feature.
Changelog
💥 Breaking Changes
engines.nodebumped to>=22.18.0across all packages. The previous deprecation warning has been removed.unrunis now an optional peer dependency (was a hard dependency). It is no longer installed automatically — users on theautoconfig loader who needunrun(i.e. running on Node without native TypeScript support) must install it manually.dtsauto-enables whencompilerOptions.declarationistrueintsconfig.json(feat(dts)!: auto-enable dts when tsconfig declaration is true #872). Previously, dts was only auto-enabled based onpackage.jsonfields (types,typings, or exports with types). Tsdown now also reads the tsconfig as a fallback signal.exports.binauto-detects by default whenexportsis configured (feat(exports): auto-enable bin detection by default #873). Previously, you had to opt in withbin: true. Now leavingbinunset triggers shebang scanning with soft semantics.✨ Features
tsxconfig loader. Set--config-loader tsx(orconfigLoader: 'tsx') to load TypeScript configs via tsx'stsImportAPI. Likeunrun,tsxis an optional peer dependency — install it manually if you want to use it.Migration Guide
Node.js version
Upgrade to Node.js 22.18.0 or later. Bun and Deno remain supported (experimental).
unrunis no longer bundledIf your environment relies on the
unrunconfig loader (i.e. you're on a Node version without native TypeScript support and use the defaultautoloader), install it manually:npm i -D unrun # or, alternatively, the new tsx loader: npm i -D tsxIf you use Node.js 22.18.0+ with native TypeScript support, no change is needed — the
autoloader will picknative.dtsauto-enabled from tsconfigIf your
tsconfig.jsonhascompilerOptions.declaration: truebut you do not want tsdown to emit.d.tsfiles, opt out explicitly:exports.binauto-detectionAny entry chunk containing a shebang (e.g.
#!/usr/bin/env node) now causes tsdown to write abinfield inpackage.jsonautomatically. The semantics differ slightly from explicitbin: true:truefalseTo opt out entirely:
Linked Issues
Includes #872, #873.
Additional context
PR body updated with full changelog and migration notes (was previously empty).