Skip to content

Migrate to typescript 6 and tsdown#22

Merged
Robin-w151 merged 10 commits intomainfrom
ts6-tsdown
Apr 6, 2026
Merged

Migrate to typescript 6 and tsdown#22
Robin-w151 merged 10 commits intomainfrom
ts6-tsdown

Conversation

@Robin-w151
Copy link
Copy Markdown
Owner

@Robin-w151 Robin-w151 commented Feb 3, 2026

Typescript + tsdown migration

Requirements

  • Typescript 6 is released

Summary by CodeRabbit

  • New Features

    • Pre-release version 0.4.0-next.3 now available with TypeScript 6 support
  • Updates

    • Migrated to new build tooling for improved module bundling
    • Updated package export paths for enhanced compatibility
  • Chores

    • Updated development dependencies including TypeScript, ESLint, and testing tools

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 3, 2026

🦋 Changeset detected

Latest commit: c209bb1

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

A release preparation update that migrates the build tooling from tsup to tsdown, adds four changeset entries documenting different release aspects, bumps the package version to 0.4.0-next.3, updates TypeScript to version 6.0.2, adjusts package export paths to use .mjs and .d.mts extensions, and updates the CHANGELOG with new unreleased version entries.

Changes

Cohort / File(s) Summary
Release Management
.changeset/brave-yaks-argue.md, .changeset/cozy-swans-add.md, .changeset/ready-hoops-ring.md, .changeset/real-turtles-attack.md, .changeset/pre.json
Four changeset entries added documenting patch and minor version bumps covering package updates, TypeScript migration to v6 and tsdown, and export path changes. Pre-release configuration file added specifying next tag with initial version 0.3.1 and four changeset IDs.
Changelog
CHANGELOG.md
Extended with unreleased entries for versions 0.4.0-next.3 through 0.4.0-next.0 documenting minor and patch changes corresponding to the new changesets.
Package Configuration
package.json
Version bumped to 0.4.0-next.3, module entry changed from .js to .mjs and types from .d.ts to .d.mts, build script switched from tsup to tsdown, and dev dependencies updated including TypeScript (5.9.3 → 6.0.2), eslint, vitest, and related tooling packages.
Build Configuration
tsdown.config.ts
Build tool migrated from tsup to tsdown, added target: false configuration option.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A hop through versions, files aligned,
From tsup to tsdown, a tool redesigned,
TypeScript Six now joins the fold,
ESM exports, a story retold,
Release next.3, our bunny heart's gold! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main changes: migration to TypeScript 6 and tsdown are the primary focus of the changeset, reflected in dependency updates, build tool changes, and configuration modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ts6-tsdown

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 6, 2026

@Robin-w151 Robin-w151 marked this pull request as ready for review April 6, 2026 13:29
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
package.json (1)

13-20: Consider adding CJS type declaration path for dual-package consumers.

The main field points to ./dist/index.cjs but the top-level types field only references .d.mts. Since tsdown is configured to generate both .d.mts (ESM) and .d.cts (CJS) declaration files, using conditional types in exports would ensure older tooling and explicit require() consumers correctly resolve the appropriate type definitions.

Consider restructuring exports to use conditional types:

💡 Suggested enhancement
   "exports": {
     ".": {
-      "types": "./dist/index.d.mts",
       "require": "./dist/index.cjs",
-      "import": "./dist/index.mjs"
+      "import": {
+        "types": "./dist/index.d.mts",
+        "default": "./dist/index.mjs"
+      },
+      "require": {
+        "types": "./dist/index.d.cts",
+        "default": "./dist/index.cjs"
+      }
     },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 13 - 20, The package currently exposes "main":
"./dist/index.cjs" and a top-level "types": "./dist/index.d.mts" but lacks
conditional type paths for CJS consumers; update package.json exports/types so
require() consumers get the CJS declaration and ESM importers get the MTS
declaration: keep "main" and "module" as-is, change the top-level "types" to
point to the CJS declaration (e.g., "./dist/index.d.cts") and add a conditional
"types" mapping inside "exports" for "." with "require": "./dist/index.d.cts"
and "import": "./dist/index.d.mts" (matching the existing "require"/"import" JS
entries) so tooling and require() consumers resolve proper .d.cts vs .d.mts
files.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@package.json`:
- Around line 13-20: The package currently exposes "main": "./dist/index.cjs"
and a top-level "types": "./dist/index.d.mts" but lacks conditional type paths
for CJS consumers; update package.json exports/types so require() consumers get
the CJS declaration and ESM importers get the MTS declaration: keep "main" and
"module" as-is, change the top-level "types" to point to the CJS declaration
(e.g., "./dist/index.d.cts") and add a conditional "types" mapping inside
"exports" for "." with "require": "./dist/index.d.cts" and "import":
"./dist/index.d.mts" (matching the existing "require"/"import" JS entries) so
tooling and require() consumers resolve proper .d.cts vs .d.mts files.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 961eec20-671b-492c-88f5-c389fb5663f2

📥 Commits

Reviewing files that changed from the base of the PR and between a18a53f and c209bb1.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • .changeset/brave-yaks-argue.md
  • .changeset/cozy-swans-add.md
  • .changeset/pre.json
  • .changeset/ready-hoops-ring.md
  • .changeset/real-turtles-attack.md
  • CHANGELOG.md
  • package.json
  • tsdown.config.ts

@Robin-w151 Robin-w151 merged commit f9192d2 into main Apr 6, 2026
4 checks passed
@Robin-w151 Robin-w151 deleted the ts6-tsdown branch April 6, 2026 14:03
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