Skip to content

release: v2.6.0 - adopt the generic CJS shim - #217

Merged
cldmv-bot[bot] merged 12 commits into
masterfrom
next
Nov 27, 2026
Merged

cldmv-bot[bot] merged 12 commits into
masterfrom
next

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

@cldmv/fix-headers v2.6.0 Changelog

Release Date: November 2026
Release Type: Minor
Branch: release/2.6.0


Overview

A declaration tsc emitted without a header now takes its source file's header dates and author, found through the tsconfig the declarations were built with. src/index.cjs is 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 the fixHeaders function, and the only new option is tsconfig.


✨ Features

Headerless declarations take their source's header (#214)

tsc copies a source's header into its declaration only when no import lines 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 inside declarationDir (else outDir), under rootDir (else the tsconfig's folder), with the first matching source extension, following extends. The declaration's header then takes @Date, @Author, @Last modified by and @Last modified time from the source's header, so rebuilding the declarations no longer changes them. @Filename and @Project still name the declaration that ships, such as types/src/x.d.mts.

The tsconfig is the new tsconfig option (CLI --tsconfig <path>), relative to cwd, defaulting to .configs/tsconfig.json and then tsconfig.json. A default that is missing or can't be read is ignored. With no tsconfig, no source, a source without a header, or rewriteDeclarationCopies: false, the declaration is stamped like any new file, as before.

Fixes #214.

Generic CommonJS shim (#212)

src/index.cjs, copied verbatim to dist/index.cjs, is the drop-in shim from the CLDMV package-layout convention instead of a hand-written .default unwrap. 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), so require() returns that function as before.

Fixes #209.

🔧 CI & tooling

Declarations are generated, not committed (#215)

types/ is gitignored. npm run types:build runs tsc and then stamps headers on its output with the package's own CLI, so each declaration names the file it ships as. build:ci and prepack both run it, so a published package always carries freshly built declarations. The package's types entry points at the generated types/src/index.d.mts; the hand-written types/index.d.mts re-export and the leftover types/devcheck.d.mts are gone. The repo's fix-headers config no longer sets rewriteDeclarationCopies: false.

Fixes #211.

Superseded CI runs cancel outside the release branch (#213)

ci.yml takes 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 on next, hotfixes and feature branches.

Fixes #210.

📚 Documentation

🔧 Dependencies

No dependency updates.


Upgrade notes

  • require() and import return what they did in 2.5.1. The one new option is tsconfig (--tsconfig); without it, fix-headers looks for .configs/tsconfig.json and then tsconfig.json.
  • TypeScript consumers resolve the declarations through exports as before; only the file's path inside the package changed, from types/index.d.mts to types/src/index.d.mts.
👥 Contributors

coverage

Metric Coverage
Statements 99.9%
Branches 98.9%
Functions 100.0%
Lines 99.9%

Avg: 99.6% · a76b236 · Node lts/*

Co-authored-by: Shinrai [email protected]

Shinrai and others added 7 commits November 27, 2026 12:17
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
@cldmv-bot cldmv-bot Bot added ! release → master v4 flow: persistent next → master release PR (carries the next feature release) release Marks a pull request as a pending release — merge to publish a new version semver: minor This release adds new functionality in a backwards-compatible way type: feature Implements new functionality — a PR or issue that adds a feature area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure type: ci Changes to CI workflows, actions, or build pipelines type: config Changes to repository or project configuration files type: dependencies Relates to dependency updates, version bumps, or package management labels Nov 27, 2026
@cldmv-bot

cldmv-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

🔒 Dependency Review

  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ✅ 0 package(s) with unknown licenses
  • ✅ 0 denied package(s)
  • ✅ 0 package(s) with OpenSSF Scorecard score < 3

Full job summary

@cldmv-bot

cldmv-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

⚠️ Bundle size increased

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.

Shinrai and others added 5 commits November 27, 2026 12:49
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
#215)

types/ is gitignored and built by types:build (tsc, then the headers are
stamped) in build:ci and prepack. "types" points at the generated
types/src/index.d.mts, and the config drops rewriteDeclarationCopies:
false.

Resolves #211
A declaration tsc emitted without a header takes its source's @Date,
@author and @last modified values, found through the tsconfig the
declarations were built with (new tsconfig option / --tsconfig).
@filename still names the declaration.

Resolves #214
v2.6.0 changelog and README What's New.
@cldmv-bot cldmv-bot Bot added the type: documentation Relates to docs, README updates, guides, or inline code comments label Nov 27, 2026
@cldmv-bot
cldmv-bot Bot merged commit 85c72d2 into master Nov 27, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure ! release → master v4 flow: persistent next → master release PR (carries the next feature release) release Marks a pull request as a pending release — merge to publish a new version semver: minor This release adds new functionality in a backwards-compatible way type: ci Changes to CI workflows, actions, or build pipelines type: config Changes to repository or project configuration files type: dependencies Relates to dependency updates, version bumps, or package management type: documentation Relates to docs, README updates, guides, or inline code comments type: feature Implements new functionality — a PR or issue that adds a feature

Projects

None yet

1 participant