TS rewrite + Migrate build tooling from Vite to tsdown#46
Merged
bartveneman merged 8 commits intomainfrom Mar 8, 2026
Merged
Conversation
- Swap vite + vite-plugin-dts for tsdown (with publint peer dep) - Add tsdown.config.js: ESM format, neutral platform (isomorphic), dts generation, publint enabled, deps.neverBundle for external dep, outExtension preserving .js file extensions - Remove vite.config.js - Update build script to `tsdown` - Remove lint-package CI job (publint now runs as part of the build) https://claude.ai/code/session_01VzmRVmcLD7znsBCH2V5Hg7
tsdown automatically excludes package.json dependencies from bundling, so explicitly listing @projectwallace/css-analyzer is unnecessary. https://claude.ai/code/session_01VzmRVmcLD7znsBCH2V5Hg7
Source files: - Convert all src/*.js → src/*.ts with proper TypeScript types - Add src/types.ts with shared Analysis, GuardResult, and Guard types - Annotate all guard functions with Analysis parameter type - Replace JSDoc @param annotations with TypeScript types - Remove @ts-expect-error in complexity.ts (use 'as Specificity' cast instead) - Keep @ts-expect-error in index.ts for overloaded analyze() return type mismatch Test files: - Convert all src/*.test.js → src/*.test.ts - Replace uvu (suite/assert) with vitest (describe/it/expect) - Remove uvu .run() calls; wrap tests in describe() blocks Config: - package.json: replace uvu with vitest, update test script to vitest run - tsconfig.json: remove allowJs/checkJs (pure TypeScript now), update include to .ts - tsdown.config.js: update entry points to .ts https://claude.ai/code/session_01VzmRVmcLD7znsBCH2V5Hg7
Replace 'latest' with installed semver ranges for publint, tsdown, and vitest to ensure reproducible installs. https://claude.ai/code/session_01VzmRVmcLD7znsBCH2V5Hg7
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
Closed
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
This PR replaces the Vite build system with tsdown, a more lightweight and specialized tool for building TypeScript/JavaScript libraries. The migration simplifies the build configuration and removes unnecessary build-related CI steps.
Key Changes
vite.config.jswhich defined library build settings, entry points, and external dependenciestsdown.config.jswith equivalent build settings including ESM format, TypeScript definitions generation, and publint validationpackage.jsonbuild command fromvite buildtotsdownnpm run buildfollowed bypublint, as tsdown now handles publint validation internallyviteandvite-plugin-dtsdev dependencies, addedtsdownandpublintas direct dev dependenciesNotable Details
@projectwallace/css-analyzer) is preserved in the new configurationdtsoptionhttps://claude.ai/code/session_01VzmRVmcLD7znsBCH2V5Hg7