Pulled ALL skills from 15 source repositories: - anthropics/skills: 16 (docs, design, MCP, testing) - obra/superpowers: 14 (TDD, debugging, agents, planning) - coreyhaines31/marketingskills: 25 (marketing, CRO, SEO, growth) - better-auth/skills: 5 (auth patterns) - vercel-labs/agent-skills: 5 (React, design, Vercel) - antfu/skills: 16 (Vue, Vite, Vitest, pnpm, Turborepo) - Plus 13 individual skills from various repos Mosaic Stack is not limited to coding — the Orchestrator and subagents serve coding, business, design, marketing, writing, logistics, analysis, and more. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4.2 KiB
4.2 KiB
Migrate from tsup
Migration guide for switching from tsup to tsdown.
Overview
tsdown is built on Rolldown (Rust-based) vs tsup's esbuild, providing faster and more powerful bundling while maintaining compatibility.
Automatic Migration
Single Package
npx tsdown-migrate
Monorepo
# Using glob patterns
npx tsdown-migrate packages/*
# Multiple directories
npx tsdown-migrate packages/foo packages/bar
Migration Options
[...dirs]- Directories to migrate (supports globs)--dry-runor-d- Preview changes without modifying files
Important: Commit your changes before running migration.
Key Differences
Default Values
| Option | tsup | tsdown |
|---|---|---|
format |
['cjs'] |
['esm'] |
clean |
false |
true |
dts |
false |
Auto-enabled if types/typings in package.json |
target |
Manual | Auto-read from engines.node in package.json |
New Features in tsdown
Node Protocol Control
export default defineConfig({
nodeProtocol: true, // Add node: prefix (fs → node:fs)
nodeProtocol: 'strip', // Remove node: prefix (node:fs → fs)
nodeProtocol: false, // Keep as-is (default)
})
Better Workspace Support
export default defineConfig({
workspace: 'packages/*', // Build all packages
})
Migration Checklist
- Backup your code - Commit all changes
- Run migration tool -
npx tsdown-migrate - Review changes - Check modified config files
- Update scripts - Change
tsuptotsdownin package.json - Test build - Run
pnpm buildto verify - Adjust config - Fine-tune based on your needs
Common Migration Patterns
Basic Library
Before (tsup):
export default defineConfig({
entry: ['src/index.ts'],
format: ['cjs', 'esm'],
dts: true,
})
After (tsdown):
export default defineConfig({
entry: ['src/index.ts'],
format: ['esm', 'cjs'], // ESM now default
dts: true,
clean: true, // Now enabled by default
})
With Custom Target
Before (tsup):
export default defineConfig({
entry: ['src/index.ts'],
target: 'es2020',
})
After (tsdown):
export default defineConfig({
entry: ['src/index.ts'],
// target auto-reads from package.json engines.node
// Or override explicitly:
target: 'es2020',
})
CLI Scripts
Before (package.json):
{
"scripts": {
"build": "tsup",
"dev": "tsup --watch"
}
}
After (package.json):
{
"scripts": {
"build": "tsdown",
"dev": "tsdown --watch"
}
}
Feature Compatibility
Supported tsup Features
Most tsup features are supported:
- ✅ Multiple entry points
- ✅ Multiple formats (ESM, CJS, IIFE, UMD)
- ✅ TypeScript declarations
- ✅ Source maps
- ✅ Minification
- ✅ Watch mode
- ✅ External dependencies
- ✅ Tree shaking
- ✅ Shims
- ✅ Plugins (Rollup compatible)
Missing Features
Some tsup features are not yet available. Check GitHub issues for status and request features.
Troubleshooting
Build Fails After Migration
- Check Node.js version - Requires Node.js 20.19+
- Install TypeScript - Required for DTS generation
- Review config changes - Ensure format and options are correct
- Check dependencies - Verify all dependencies are installed
Different Output
- Format order - tsdown defaults to ESM first
- Clean behavior - tsdown cleans outDir by default
- Target - tsdown auto-detects from package.json
Performance Issues
tsdown should be faster than tsup. If not:
- Enable
isolatedDeclarationsfor faster DTS generation - Check for large dependencies being bundled
- Use
skipNodeModulesBundleif needed
Getting Help
- GitHub Issues - Report bugs or request features
- Documentation - Full documentation
- Migration Tool - Source code
Acknowledgements
tsdown is heavily inspired by tsup and incorporates parts of its codebase. Thanks to @egoist and the tsup community.