Repository navigation
release: v2.6.0 - adopt the generic CJS shim - #217
Merged
Merged
Conversation
src/index.cjs is now the generic CLDMV drop-in shim from docs/conventions/package-layout.md (CLDMV/.github v4.46.0) instead of a hand-written .default unwrap. fix-headers exports one value, so require() still returns the fixHeaders function. Resolves #209
Adopt the CLDMV/.github v4.46.0 concurrency block: only the release base branch keeps a unique per-run group, so superseded runs on next, hotfixes and feature branches cancel. Resolves #210
src/index.cjs becomes the generic CLDMV shim (CLDMV/.github v4.46.0). fix-headers exports one value, so require() still returns the fixHeaders function. Resolves #209
ci.yml takes the v4.46.0 concurrency block: only the release base branch keeps a per-run group, so superseded runs on next, hotfixes and feature branches cancel. Resolves #210
types/ is gitignored and the 40 tracked declarations are removed. types:build runs tsc and then stamps the declarations' headers with the package's own CLI, and prepack runs types:build before the build. "types" points at the generated types/src/index.d.mts (the hand-written types/index.d.mts re-export and the stale devcheck.d.mts are gone), and the config drops rewriteDeclarationCopies: false. The integration test checks a types entry against the source tsc emits it from. Resolves #211
Contributor
Author
🔒 Dependency Review
|
Contributor
Author
|
| File | Raw | Δ Raw | Gzipped | Δ Gzipped |
|---|---|---|---|---|
| dist/cli.mjs | 10.9 kB | +196 B (+1.8%) | 3.9 kB | +63 B |
| dist/config/load.mjs | 3.0 kB | — | 1.4 kB | — |
| dist/constants.mjs | 652 B | — | 443 B | — |
| dist/core/declaration-sources.mjs | 2.6 kB | +2.6 kB (+100.0%) |
1.2 kB | +1.2 kB |
| dist/core/file-discovery.mjs | 3.4 kB | — | 1.6 kB | — |
| dist/core/fix-headers.mjs | 7.9 kB | +347 B (+4.5%) | 3.2 kB | +134 B |
| dist/core/ignore-rules.mjs | 2.6 kB | — | 1.3 kB | — |
| dist/detect/project.mjs | 2.2 kB | — | 1020 B | — |
| dist/detectors/c.mjs | 1.4 kB | — | 850 B | — |
| dist/detectors/css.mjs | 525 B | — | 382 B | — |
| dist/detectors/go.mjs | 818 B | — | 527 B | — |
| dist/detectors/html.mjs | 453 B | — | 335 B | — |
| dist/detectors/index.mjs | 4.1 kB | — | 1.5 kB | — |
| dist/detectors/json.mjs | 467 B | — | 343 B | — |
| dist/detectors/markdown.mjs | 661 B | — | 441 B | — |
| dist/detectors/node.mjs | 1.3 kB | — | 754 B | — |
| dist/detectors/php.mjs | 687 B | — | 478 B | — |
| dist/detectors/python.mjs | 529 B | — | 402 B | — |
| dist/detectors/rust.mjs | 539 B | — | 394 B | — |
| dist/detectors/top-lines.mjs | 1.3 kB | — | 762 B | — |
| dist/detectors/yaml.mjs | 497 B | — | 364 B | — |
| dist/drivers/go.mjs | 484 B | — | 360 B | — |
| dist/drivers/index.mjs | 1.7 kB | — | 929 B | — |
| dist/drivers/node.mjs | 682 B | — | 447 B | — |
| dist/drivers/php.mjs | 355 B | — | 268 B | — |
| dist/drivers/python.mjs | 1.1 kB | — | 574 B | — |
| dist/drivers/rust.mjs | 329 B | — | 248 B | — |
| dist/drivers/shared.mjs | 2.2 kB | — | 1.1 kB | — |
| dist/header/dates.mjs | 3.1 kB | — | 1.3 kB | — |
| dist/header/fields.mjs | 1.8 kB | — | 894 B | — |
| dist/header/parser.mjs | 7.0 kB | — | 3.1 kB | — |
| dist/header/syntax.mjs | 1.0 kB | — | 611 B | — |
| dist/header/template.mjs | 1016 B | — | 568 B | — |
| dist/index.cjs | 1.6 kB | −99 B (-5.6%) ✅ | 966 B | −30 B |
| dist/index.mjs | 256 B | — | 214 B | — |
| dist/utils/diff.mjs | 1.4 kB | — | 805 B | — |
| dist/utils/fs.mjs | 1.3 kB | — | 729 B | — |
| dist/utils/git.mjs | 3.2 kB | — | 1.4 kB | — |
| dist/utils/text.mjs | 431 B | — | 298 B | — |
| dist/utils/time.mjs | 2.5 kB | — | 1.2 kB | — |
| Total | 78.1 kB | +3.0 kB | 37.3 kB | +1.4 kB |
📊 Generated by bundle-size. Brotli sizes also measured but omitted from the table for brevity.
tsc drops a source's header from its declaration when imports follow the header, so those declarations were stamped as new with the build time on every build. fix-headers now reads rootDir, outDir and declarationDir from the tsconfig the declarations were built with (following extends), finds the source file, and takes the declaration's @Date, @author and @last modified values from the source's header. @filename and @project still name the declaration. The tsconfig is the new tsconfig option (--tsconfig), defaulting to .configs/tsconfig.json and then tsconfig.json. Resolves #214
v2.6.0 changelog and README What's New.
Shinrai
approved these changes
Nov 27, 2026
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.
@cldmv/fix-headersv2.6.0 ChangelogRelease Date: November 2026
Release Type: Minor
Branch:
release/2.6.0Overview
A declaration
tscemitted without a header now takes its source file's header dates and author, found through the tsconfig the declarations were built with.src/index.cjsis now the generic CLDMV CommonJS shim, and this package's own TypeScript declarations are generated at build and pack time instead of being committed.require("@cldmv/fix-headers")still returns thefixHeadersfunction, and the only new option istsconfig.✨ Features
Headerless declarations take their source's header (#214)
tsccopies a source's header into its declaration only when noimportlines follow the header; otherwise it drops it. Those declarations were stamped as new files on every build, with the build time as@Last modified time. fix-headers now finds the declaration's source through the tsconfig the declarations were built with: the declaration's path insidedeclarationDir(elseoutDir), underrootDir(else the tsconfig's folder), with the first matching source extension, followingextends. The declaration's header then takes@Date,@Author,@Last modified byand@Last modified timefrom the source's header, so rebuilding the declarations no longer changes them.@Filenameand@Projectstill name the declaration that ships, such astypes/src/x.d.mts.The tsconfig is the new
tsconfigoption (CLI--tsconfig <path>), relative tocwd, defaulting to.configs/tsconfig.jsonand thentsconfig.json. A default that is missing or can't be read is ignored. With no tsconfig, no source, a source without a header, orrewriteDeclarationCopies: false, the declaration is stamped like any new file, as before.Fixes #214.
Generic CommonJS shim (#212)
src/index.cjs, copied verbatim todist/index.cjs, is the drop-in shim from the CLDMV package-layout convention instead of a hand-written.defaultunwrap. It returns the single distinct value the ESM entry exports, or the module object when there is more than one. fix-headers exports one function (fixHeaders, which is also the default export), sorequire()returns that function as before.Fixes #209.
🔧 CI & tooling
Declarations are generated, not committed (#215)
types/is gitignored.npm run types:buildrunstscand then stamps headers on its output with the package's own CLI, so each declaration names the file it ships as.build:ciandprepackboth run it, so a published package always carries freshly built declarations. The package'stypesentry points at the generatedtypes/src/index.d.mts; the hand-writtentypes/index.d.mtsre-export and the leftovertypes/devcheck.d.mtsare gone. The repo's fix-headers config no longer setsrewriteDeclarationCopies: false.Fixes #211.
Superseded CI runs cancel outside the release branch (#213)
ci.ymltakes the CLDMV/.github v4.46.0 concurrency block: only the release base branch keeps a unique group per run, so a newer push cancels the older run onnext,hotfixesand feature branches.Fixes #210.
📚 Documentation
tsconfigoption and--tsconfigflag, and the rule for declarationstscemitted without a header (Declarations tsc emits without the header get build-time dates #214).🔧 Dependencies
No dependency updates.
Upgrade notes
require()andimportreturn what they did in 2.5.1. The one new option istsconfig(--tsconfig); without it, fix-headers looks for.configs/tsconfig.jsonand thentsconfig.json.exportsas before; only the file's path inside the package changed, fromtypes/index.d.mtstotypes/src/index.d.mts.👥 Contributors
Avg: 99.6% ·
a76b236· Node lts/*Co-authored-by: Shinrai [email protected]