refactor: move the bundle entry points to TypeScript - #702
Closed
mrholek wants to merge 1 commit into
Closed
Conversation
`js/src` is already fully TypeScript; `js/index.esm.js` and `js/index.umd.js` were the last JavaScript files in the library sources. Rolldown reads them by extension, so only its input path changes — the six built bundles (coreui, coreui.esm, coreui.bundle and the bootstrap counterparts) are byte-identical to v6-dev. The entries typecheck in their own project. They are rolldown inputs, not part of the published type surface (build/tsconfig.dts.json emits from js/src only), so the per-file declaration constraints that keep js/src emittable do not apply — and the UMD entry cannot satisfy them anyway: a default-exported object of component classes is not inferable under isolatedDeclarations, and the explicit-value workaround collides with object-shorthand. `js-typecheck` now runs both projects. Also fixes the UMD banner, which named the wrong file and repeated the licence phrase.
Coverage Report for CI Build 31030815885Coverage decreased (-0.007%) to 92.968%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats💛 - Coveralls |
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.
js/srchas been fully TypeScript for a while;js/index.esm.jsandjs/index.umd.jswere the last JavaScript left in the library sources. This converts both.Proof it changes nothing for consumers
Rolldown reads the entry by extension, so the only build change is its
inputpath. Built fromv6-devand from this branch, all six bundles are byte-identical:The UMD global keeps its exact shape, including the
OffCanvasspelling the UMD list uses (js/src/index.tsexports it asOffcanvas— untouched here, changing it would be breaking).Typechecking
The entries get their own project (
build/tsconfig.entries.json) that inherits the root config but dropsdeclaration/isolatedDeclarations, andjs-typechecknow runs both:Why the exemption: the entries are rolldown inputs, not part of the published type surface (
build/tsconfig.dts.jsonemits fromjs/srconly), and the UMD entry cannot satisfy those flags anyway — a default-exported object of 36 component classes is not inferable underisolatedDeclarations(TS9016), and the documented explicit-value workaround (Alert: Alert) both still fails (TS9013) and collides withobject-shorthand. The eslint TypeScript block now also covers the two entries.Also fixes the UMD banner, which named
index.esm.jsand repeated "Licensed under MIT (".Verification
js-typecheck(both projects) ·js-lint(0 errors) ·js-test-types·js-test-integration-bundle+-modularity·js-test-unit(2978 passing, coverage 95.38 / 88.52 / 93.92 / 95.43 — unchanged) · bundles diffed against av6-devbaseline as above.Still JavaScript, deliberately out of scope here: the 59 unit specs (they target the Jasmine shim),
build/*.mjs,eslint.config.mjs, andpackage.js(Meteor requires that name).