Skip to content

refactor: tsup outExtension migration compatibility#950

Merged
sxzz merged 3 commits into
mainfrom
codex/issue-949
May 15, 2026
Merged

refactor: tsup outExtension migration compatibility#950
sxzz merged 3 commits into
mainfrom
codex/issue-949

Conversation

@sxzz
Copy link
Copy Markdown
Member

@sxzz sxzz commented May 15, 2026

Summary

  • Add deprecated outExtension compatibility as an alias for outExtensions, with runtime mapping and a conflict error when both options are configured.
  • Update tsdown-migrate, bundled skills, migration docs, and output format docs for the outExtension -> outExtensions rename and the IIFE/UMD filename behavior.
  • Document outputOptions.entryFileNames as the way to preserve custom full filename patterns.
  • Add runtime and migration tests for warning, conflict, and output naming behavior.

My recommendation remains that modern libraries should prefer ESM-only output. IIFE/CJS and similar legacy formats are compatibility paths in tsdown, not first-class targets for new library design.

Testing

  • pnpm test packages/migrate/src/helpers/tsup-config.test.ts --run
  • pnpm test tests/e2e.test.ts --run
  • pnpm typecheck
  • pnpm lint

closes #949

Copilot AI review requested due to automatic review settings May 15, 2026 13:17
@netlify
Copy link
Copy Markdown

netlify Bot commented May 15, 2026

Deploy Preview for tsdown-main ready!

Name Link
🔨 Latest commit e45a242
🔍 Latest deploy log https://app.netlify.com/projects/tsdown-main/deploys/6a071ebd9e14cf00082715d2
😎 Deploy Preview https://deploy-preview-950--tsdown-main.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 15, 2026

Open in StackBlitz

tsdown

pnpm add https://pkg.pr.new/tsdown@950 -D
npm i https://pkg.pr.new/tsdown@950 -D
yarn add https://pkg.pr.new/tsdown@950.tgz -D

create-tsdown

pnpm add https://pkg.pr.new/create-tsdown@950 -D
npm i https://pkg.pr.new/create-tsdown@950 -D
yarn add https://pkg.pr.new/create-tsdown@950.tgz -D

@tsdown/css

pnpm add https://pkg.pr.new/@tsdown/css@950 -D
npm i https://pkg.pr.new/@tsdown/css@950 -D
yarn add https://pkg.pr.new/@tsdown/css@950.tgz -D

@tsdown/exe

pnpm add https://pkg.pr.new/@tsdown/exe@950 -D
npm i https://pkg.pr.new/@tsdown/exe@950 -D
yarn add https://pkg.pr.new/@tsdown/exe@950.tgz -D

tsdown-migrate

pnpm add https://pkg.pr.new/tsdown-migrate@950 -D
npm i https://pkg.pr.new/tsdown-migrate@950 -D
yarn add https://pkg.pr.new/tsdown-migrate@950.tgz -D

commit: e45a242

@sxzz sxzz changed the title 修复 tsup outExtension 迁移兼容与 IIFE 命名差异 Fix tsup outExtension migration compatibility and IIFE naming docs May 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds backward-compatible support for the deprecated outExtension option (alias of outExtensions), with conflict detection, migration tooling updates, and documentation clarifying IIFE/UMD filename differences vs. tsup.

Changes:

  • Accept outExtension at runtime: warn, map to outExtensions, and throw on conflict.
  • Extend tsdown-migrate to rename outExtensionoutExtensions for both property and method shorthand syntax.
  • Update docs/skills to document the rename and IIFE/UMD filename differences (.iife.js vs .global.js).

Reviewed changes

Copilot reviewed 17 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/config/options.ts Resolve outExtension alias, warn, error on conflict, strip from resolved config.
src/config/types.ts Add deprecated outExtension field and exclude it from ResolvedConfig.
packages/migrate/src/helpers/tsup-config.ts Match both pair-key and method-definition identifiers for renames.
packages/migrate/src/helpers/tsup-config.test.ts Tests for outExtensionoutExtensions rename (property + method forms).
packages/migrate/src/helpers/snapshots/tsup-config.test.ts.snap Snapshots for new rename tests.
tests/e2e.test.ts E2E tests for deprecation warning and conflict error.
tests/snapshots/deprecated-custom-extension.snap.md Snapshot for deprecated extension output.
docs/options/output-format.md, docs/zh-CN/options/output-format.md Note IIFE/UMD default filename and entryFileNames override.
docs/guide/migrate-from-tsup.md, docs/zh-CN/guide/migrate-from-tsup.md Document outExtension rename and filename differences.
skills/tsdown/references/option-output-format.md Correct IIFE example output and add filename note.
skills/tsdown/references/option-output-directory.md Update IIFE filename table and clarification.
skills/tsdown/references/guide-migrate-from-tsup.md Add rename table and IIFE filename note.
skills/tsdown-migrate/references/guide-option-mappings.md Add outExtension rename entry.
skills/tsdown-migrate/references/guide-differences-detailed.md Add rename row and filename differences section.
skills/tsdown-migrate/SKILL.md Add outExtension to renames table and migration checklist.
snapshots/tsnapi/index.snapshot.d.ts, snapshots/tsnapi/config.snapshot.d.ts Public type snapshots reflecting new outExtension field and omission.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/config/options.ts
Comment thread src/config/options.ts Outdated
Comment on lines +316 to +317
const configUserConfig = { ...userConfig }
delete configUserConfig.outExtension
@sxzz sxzz changed the title Fix tsup outExtension migration compatibility and IIFE naming docs refactor: tsup outExtension migration compatibility May 15, 2026
@sxzz sxzz merged commit 5d6b054 into main May 15, 2026
17 checks passed
@sxzz sxzz deleted the codex/issue-949 branch May 15, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

outExtensions and migrating from tsup

2 participants