Skip to content

feat(css)!: move all CSS support to @tsdown/css package#809

Merged
sxzz merged 12 commits intomainfrom
sxzz/remove-builtin-css
Mar 7, 2026
Merged

feat(css)!: move all CSS support to @tsdown/css package#809
sxzz merged 12 commits intomainfrom
sxzz/remove-builtin-css

Conversation

@sxzz
Copy link
Member

@sxzz sxzz commented Mar 7, 2026

Summary

  • Breaking: Remove all built-in CSS support from the main tsdown package — all CSS processing now requires @tsdown/css
  • Move CSS types, options resolution, post-plugin, pure-chunk removal, and utilities to @tsdown/css
  • Add tsdown/internal subpath export for shared utilities (toArray, resolveComma, importWithError, fsExists, fsRemove, Logger)
  • Add a guard plugin (tsdown:css-guard) with transform.order = 'post' that throws a clear error when CSS files are encountered without @tsdown/css
  • Remove ./css export from main package
  • Replace MinimalLogger with Logger from tsdown/internal in both @tsdown/css and @tsdown/exe
  • Update all documentation (docs, skills, README, CLAUDE.md)

Breaking Changes

  • @tsdown/css is now required for any CSS processing (previously basic CSS extraction worked without it)
  • CSS types are no longer exported from tsdown — import them from @tsdown/css instead
  • The ./css subpath export has been removed from the main package

Test plan

  • pnpm build succeeds
  • pnpm test run — 354 tests pass (including 7 new resolveCssOptions tests)
  • pnpm typecheck passes
  • CSS features work correctly with @tsdown/css installed
  • Unit tests for resolveCssOptions (defaults, target inheritance, target override, comma-separated, array, false, custom options)

🤖 Generated with Claude Code

BREAKING CHANGE: Basic CSS support has been removed from the core tsdown
package. All CSS processing now requires @tsdown/css to be installed.

- Moved CSS types, config resolution, and processing utilities to @tsdown/css
- Removed tsdown/css public export path
- Added guard plugin (transform.order=post) that errors when CSS files are
  encountered without @tsdown/css installed
- Projects without CSS files are unaffected
@netlify
Copy link

netlify bot commented Mar 7, 2026

Deploy Preview for tsdown-main ready!

Name Link
🔨 Latest commit 3c4d567
🔍 Latest deploy log https://app.netlify.com/projects/tsdown-main/deploys/69ac72cd1c4f780008376044
😎 Deploy Preview https://deploy-preview-809--tsdown-main.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 7, 2026

Open in StackBlitz

tsdown

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

create-tsdown

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

@tsdown/css

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

@tsdown/exe

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

tsdown-migrate

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

commit: a808818

@sxzz sxzz changed the title feat!: move all CSS support to @tsdown/css package feat(css)!: move all CSS support to @tsdown/css package Mar 7, 2026
sxzz and others added 10 commits March 8, 2026 02:29
All CSS support now requires @tsdown/css - remove "requires @tsdown/css"
per-option notes, update architecture descriptions, and fix references
to removed src/features/css/ directory.
Replace relative path imports in @tsdown/css with tsdown/internal
subpath export for utility functions (toArray, resolveComma,
importWithError) and types (MarkPartial, Overwrite).
- Export fsExists, fsRemove, Logger from tsdown/internal
- Replace MinimalLogger with Logger from tsdown/internal
- Delete packages/css/src/types.ts (MinimalLogger no longer needed)
- Update @tsdown/exe to use tsdown/internal for fs utils and Logger
@sxzz sxzz merged commit 1b1a172 into main Mar 7, 2026
15 checks passed
@sxzz sxzz deleted the sxzz/remove-builtin-css branch March 7, 2026 18:49
@sxzz sxzz mentioned this pull request Mar 7, 2026
16 tasks
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.

1 participant