refactor: tsup outExtension migration compatibility#950
Merged
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: |
outExtension 迁移兼容与 IIFE 命名差异
Contributor
There was a problem hiding this comment.
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
outExtensionat runtime: warn, map tooutExtensions, and throw on conflict. - Extend
tsdown-migrateto renameoutExtension→outExtensionsfor both property and method shorthand syntax. - Update docs/skills to document the rename and IIFE/UMD filename differences (
.iife.jsvs.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 outExtension → outExtensions 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 on lines
+316
to
+317
| const configUserConfig = { ...userConfig } | ||
| delete configUserConfig.outExtension |
outExtension migration compatibility
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
outExtensioncompatibility as an alias foroutExtensions, with runtime mapping and a conflict error when both options are configured.tsdown-migrate, bundled skills, migration docs, and output format docs for theoutExtension->outExtensionsrename and the IIFE/UMD filename behavior.outputOptions.entryFileNamesas the way to preserve custom full filename patterns.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 --runpnpm test tests/e2e.test.ts --runpnpm typecheckpnpm lintcloses #949