Skip to content

Migrate build system from Vite to tsdown#546

Merged
bartveneman merged 5 commits intomainfrom
claude/migrate-vite-to-tsdown-ByUbl
Mar 17, 2026
Merged

Migrate build system from Vite to tsdown#546
bartveneman merged 5 commits intomainfrom
claude/migrate-vite-to-tsdown-ByUbl

Conversation

@bartveneman
Copy link
Member

Summary

This PR migrates the project's build system from Vite to tsdown, a more lightweight and specialized tool for building TypeScript libraries.

Key Changes

  • Removed Vite configuration: Deleted vite.config.js which used Vite with the dts plugin for building and type generation
  • Added tsdown configuration: Created tsdown.config.ts with tsdown as the new build tool, configured with:
    • Entry point: src/index.ts
    • Platform: neutral (for universal compatibility)
    • Built-in publint validation enabled
    • Codecov rollup plugin for bundle analysis
  • Updated build tooling dependencies:
    • Replaced @codecov/vite-plugin with @codecov/rollup-plugin
    • Removed vite and vite-plugin-dts dependencies
    • Removed c8 (coverage tool)
    • Added tsdown as the new build tool
  • Updated package.json exports:
    • Changed main entry point from ./dist/css-analyzer.js to ./dist/index.js
    • Updated default export path to match
  • Updated build script: Changed build command from vite build to tsdown

Notable Details

  • tsdown provides a simpler, more opinionated build configuration suitable for TypeScript library development
  • The new setup maintains the same external dependency handling (@projectwallace/css-parser)
  • Type definitions generation is now handled automatically by tsdown
  • Publint validation is now integrated into the build configuration for package quality checks

https://claude.ai/code/session_012Hndn7eo63B8aQnnqcg8ir

claude added 4 commits March 17, 2026 08:12
- Replace vite build with tsdown, enabling publint validation
- Add @codecov/rollup-plugin (replacing @codecov/vite-plugin)
- Remove unused devDependencies: vite, vite-plugin-dts, @codecov/vite-plugin, c8
- Update package.json exports to match tsdown output (dist/index.js)
- Add tsdown.config.ts based on format-css example

https://claude.ai/code/session_012Hndn7eo63B8aQnnqcg8ir
publint now runs as part of the tsdown build (publint: true), so
the separate lint-package job is redundant.

https://claude.ai/code/session_012Hndn7eo63B8aQnnqcg8ir
publint now runs automatically as part of tsdown (publint: true),
so the separate lint-package step is no longer needed.

https://claude.ai/code/session_012Hndn7eo63B8aQnnqcg8ir
- Add --coverage flag to vitest npm script
- Add @vitest/coverage-v8 devDependency
- Simplify code-coverage CI step to use npm test directly

https://claude.ai/code/session_012Hndn7eo63B8aQnnqcg8ir
@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.36%. Comparing base (40a1e8d) to head (0b19d0e).

Additional details and impacted files
@@            Coverage Diff            @@
##           main     #546       +/-   ##
=========================================
+ Coverage      0   95.36%   +95.36%     
=========================================
  Files         0       18       +18     
  Lines         0      970      +970     
  Branches      0      308      +308     
=========================================
+ Hits          0      925      +925     
- Misses        0       36       +36     
- Partials      0        9        +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Remove redundant entry pattern (src/index.ts auto-discovered)
- Ignore @vitest/coverage-v8 (used implicitly via --coverage flag)

https://claude.ai/code/session_012Hndn7eo63B8aQnnqcg8ir
@bartveneman bartveneman marked this pull request as ready for review March 17, 2026 08:24
@bartveneman bartveneman merged commit 68e7414 into main Mar 17, 2026
5 checks passed
@bartveneman bartveneman deleted the claude/migrate-vite-to-tsdown-ByUbl branch March 17, 2026 08:24
@codecov-commenter
Copy link

Bundle Report

Changes will decrease total bundle size by 23.56kB (-25.98%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
analyzeCss-esm 67.11kB -23.56kB (-25.98%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: analyzeCss-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.js (New) 50.83kB 50.83kB 100.0% 🚀
index.d.ts (New) 16.28kB 16.28kB 100.0% 🚀
css-*.js (Deleted) -90.67kB 0 bytes -100.0% 🗑️

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.

3 participants