chore: migrate build to tsdown and tests to Vitest#49
chore: migrate build to tsdown and tests to Vitest#49sriramveeraghanta wants to merge 9 commits into
Conversation
…esh docs - gitignore coverage/ (generated test output, not committed) - oxfmt: ignore coverage/ and docs/ - tests/unit/README.md + conditional-tests.ts: Jest -> Vitest references - CLAUDE.md: correct pnpm version (11.5.0)
|
Warning Review limit reached
More reviews will be available in 53 minutes and 17 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis pull request implements a complete migration of the ChangesJest-to-Vitest and tsc-to-tsdown Migration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
package.json (1)
12-12:typesfallback matches emitted declarations; nodist/index.d.tsexists
tsdownoutput indist/contains onlyindex.d.mtsandindex.d.cts(plus.mapfiles), notdist/index.d.ts. With that output, the currentpackage.jsontop-level"types": "./dist/index.d.cts"is consistent, and theexportsmap already points to./dist/index.d.mtsforimportand./dist/index.d.ctsforrequire.The tsdown migration design/plan docs’
./dist/index.d.tsguidance applies only when tsdown emits a singleindex.d.ts; if you want a format-agnostic legacy fallback for older tooling, you’ll need to emit/providedist/index.d.tsinstead of referencing one format.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package.json` at line 12, The package.json currently lists "types" but tsdown only emits index.d.mts and index.d.cts, so either set the top-level "types" field explicitly to "./dist/index.d.cts" (to match emitted declarations and the existing exports map referencing ./dist/index.d.mts for import and ./dist/index.d.cts for require), or add a build step to generate a format-agnostic ./dist/index.d.ts (and then point "types" at it) if you need legacy tooling fallback; update the "types" field or the build pipeline accordingly and ensure consistency with the "exports" map and emitted files (index.d.mts, index.d.cts).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@package.json`:
- Line 12: The package.json currently lists "types" but tsdown only emits
index.d.mts and index.d.cts, so either set the top-level "types" field
explicitly to "./dist/index.d.cts" (to match emitted declarations and the
existing exports map referencing ./dist/index.d.mts for import and
./dist/index.d.cts for require), or add a build step to generate a
format-agnostic ./dist/index.d.ts (and then point "types" at it) if you need
legacy tooling fallback; update the "types" field or the build pipeline
accordingly and ensure consistency with the "exports" map and emitted files
(index.d.mts, index.d.cts).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e8fb5baf-d094-4ec4-ae2b-63e513f74c21
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (14)
.github/workflows/build-test.yaml.gitignore.oxfmtrc.jsonAGENTS.MDCLAUDE.mddocs/superpowers/plans/2026-05-30-tsdown-vitest-migration.mddocs/superpowers/specs/2026-05-30-tsdown-vitest-migration-design.mdjest.config.jspackage.jsontests/helpers/conditional-tests.tstests/unit/README.mdtsconfig.vitest.jsontsdown.config.tsvitest.config.ts
💤 Files with no reviewable changes (2)
- AGENTS.MD
- jest.config.js
Summary
Replaces the build pipeline (
tsc+dts-bundle-generator) with tsdown, and the test runner (Jest + ts-jest) with Vitest.dist/index.mjs) + CJS (dist/index.cjs) bundles plus per-format type declarations (.d.mts/.d.cts), exposed via a properexportsmap inpackage.json(main/module/typesretained as legacy fallbacks). Dropsdts-bundle-generatorand the unusedtypes.bundle.d.ts.vitest.config.tswithglobals: true(the 30 test files use baredescribe/it/expect— left untouched),fileParallelism: false(mirrors the oldmaxWorkers: 1to avoid API rate limits), and v8 coverage.tsconfig.jest.json→tsconfig.vitest.json(now covers all oftests/**). All npm script names are unchanged, so CI needs no script edits.build-test.yamlto Node 22 (tsdown requires^22.18 || >=24);publish-node-sdk.ymlalready uses Node 24. The published SDK still supports Node >=20 at runtime (tsdown is build-time only).CLAUDE.md; removed the staleAGENTS.MD; gitignoredcoverage/; excludedcoverage/anddocs/from the formatter; refreshed the test README/JSDoc Jest→Vitest references.jest,ts-jest(was mis-placed underdependencies),@types/jest,dts-bundle-generator. Added dev:tsdown,vitest,@vitest/coverage-v8.docs/superpowers/.Test Plan
build-testpasses on Node 22 (lint, format, build,test:e2ewith credentials)pnpm build→ cleandist/with.cjs/.mjs+.d.cts/.d.mts; bothrequire()andimportresolvePlaneClientpnpm test:unit→ 29 files, 0 failures, globals resolve (suites skip without credentials)pnpm test:coverage→ v8 coverage report producedpnpm check:lint(0 errors) andpnpm check:formatpassnpm pack --dry-runships onlydist/**(both formats + declarations) +README.mdSummary by CodeRabbit
Chores
Documentation