Skip to content

fix(types): migrate declarations to Rolldown and TypeScript 7 - #225

Merged
ghiscoding merged 1 commit into
mainfrom
bugfix/ts7-dts
Oct 5, 2026
Merged

ghiscoding merged 1 commit into
mainfrom
bugfix/ts7-dts

Conversation

@ghiscoding

Copy link
Copy Markdown
Owner

Summary

Replace dts-bundle-generator with Rolldown and upgrade the workspace to TypeScript 7.0.2. The new build still emits one declaration file per package and fixes the type incompatibility between excel-builder-vanilla and @excel-builder-vanilla/types.

Why

The previous declaration generator did not handle private class members reliably: it included them in the DTS files, making equivalent classes from the library and companion package incompatible. It also prevented upgrading the project to TypeScript 7.

The replacement uses Rolldown’s native tsgo declaration generator. Private and underscore-prefixed class members are omitted from published declarations, so both packages expose compatible types.

Changes

  • Remove dts-bundle-generator and add Rolldown 1.2.12 with rolldown-plugin-dts 0.28.6.
  • Upgrade the shared workspace TypeScript version to 7.0.2.
  • Add a declaration build script that typechecks the library, generates one dist/index.d.ts, preserves the previous generator’s 11 implicit type exports, and omits private implementation members.
  • Declare all 25 underscore-prefixed class members private, including the ten Chart methods documented with @private.
  • Synchronize the companion package’s declarations and add tests for cross-package compatibility, exports, and private-member omission.
  • Update documentation, contributor instructions, agent guidance, dependencies, and the lockfile.

In the earlier like-for-like generator comparison, the filtered DTS sizes were 54,116 bytes for dts-bundle-generator, 54,311 for Rolldown, and 59,001 for Rollup. The final native TypeScript 7 build, with underscore-prefixed members private, is smaller still:

Artifact Filtered original-generator baseline Final build Change
DTS file 54,116 B 51,220 B -2,896 B
Library tarball 127,512 B 127,381 B -131 B
Types tarball 16,639 B 16,093 B -546 B

The final package sizes include source maps, manifests, and README changes. Runtime JavaScript is byte-identical; source maps grow by 604 bytes because they include the modified source.

Validation

  • Full root build passed, including library and demo typechecking and builds.
  • 332 unit tests passed: 100% statement, function, and line coverage; 93.77% branch coverage.
  • 25 Chromium browser tests passed.
  • Strict TypeScript 7 checks passed for bidirectional library/companion assignments, legacy type aliases, and private-member omission.
  • Verified all 25 underscore-prefixed class members are private, all 67 top-level exports remain, package declarations match, and package archives contain the measured output.
  • Biome lint and formatting checks and git diff --check passed.

Comments

Consumers who accessed underscore-prefixed class members in TypeScript must use public configuration and export methods, such as setHeader(), setFooter(), and setRowInstructions(). Runtime member names and implementations are retained. Underscore keys in Worksheet.exportData() remain part of the transfer format.

The plugin labels its native tsgo integration experimental; the build and compatibility tests exercise this path. Two unused legacy runtime helpers are retained with narrowly scoped unused-member diagnostic suppressions.

AI / LLM assistance

  • AI / LLM assistance used:
    • No
    • Yes
  • If Yes:
    • which tool/model: Codex (GPT-6 Sol).
    • how was it used: Compared declaration generators and package sizes, implemented the migration and regression tests, updated documentation, and ran validation.

Checklist

  • The changes are limited to one scope; the workspace and both packages change together for declaration compatibility.
  • Tests were added or updated where appropriate.
  • Documentation was updated where appropriate.

@codecov

codecov Bot commented Oct 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (96a30dc) to head (cce9d19).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #225   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files          27       27           
  Lines        1877     1877           
  Branches      409      409           
=======================================
  Hits         1877     1877           

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ghiscoding
ghiscoding merged commit 2976cf2 into main Oct 5, 2026
7 checks passed
@ghiscoding
ghiscoding deleted the bugfix/ts7-dts branch October 5, 2026 23:21
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

🎉 This pull request is included in version 5.3.1 📦
🔗 The release notes are available at: GitHub Release 🚀

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