Skip to content

fix: set engines to the Node.js version the package needs at runtime - #176

Merged
Shinrai merged 2 commits into
nextfrom
fix/runtime-engines-floor
Nov 2, 2026
Merged

Shinrai merged 2 commits into
nextfrom
fix/runtime-engines-floor

Conversation

@cldmv-bot

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

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

No new features

🐛 Bug Fixes

📦 Dependencies

No dependency updates

🔧 Other Changes

👥 Contributors

engines.node now states what consumers need at runtime instead of the dev
toolchain's floor. Constraints found:

- [email protected] (runtime dependency): engines ">= 4"
- shipped code: global fetch (remote https config extends) needs Node.js 18.0;
  AbortSignal.timeout (17.3), Error cause (16.9), Array.prototype.at (16.6)
  are all below that
- smoke-tested the built dist/ and bin/ on Node.js 16.20.2, 18.0.0, 18.20.8
  and 20.0.0: CLI dry run, API dry run and a write run give the same output
  as on Node.js 26; only fetch is missing on 16
- last release before the toolchain bump (v2.2.2) declared >=22.12.0, which
  came from the test toolchain, not the code

Result: engines.node ">=18.0.0", tsup target node18. require() of the CJS
entry still needs require(esm), so its message now says ^20.19.0 or
>=22.13.0. The dev toolchain floor (vitest 5, tsup 9: Node.js 22.22.0) moved
to devEngines, and the CI matrix minimum stays there.
@cldmv-bot cldmv-bot Bot added ! fix → next v4 flow: fix contributor PR targeting the next integration branch 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 type: documentation Relates to docs, README updates, guides, or inline code comments labels Nov 2, 2026
@Shinrai
Shinrai merged commit c6978b9 into next Nov 2, 2026
28 checks passed
@cldmv-bot
cldmv-bot Bot deleted the fix/runtime-engines-floor branch November 2, 2026 01:27
cldmv-bot Bot added a commit that referenced this pull request Nov 2, 2026
# `@cldmv/fix-headers` v2.2.6 Changelog

**Release Date**: November 2026
**Release Type**: Patch
**Branch**: `release/2.2.6`

---

## Overview

Version 2.2.6 sets `engines.node` back to the Node.js version the package needs at runtime, `>=18.0.0`, instead of the 22.22.0 development toolchain floor that v2.2.5 put there. The 22.22.0 floor moves to npm's `devEngines`, which only applies when you work on this repository.

Header handling, the `fixHeaders` API and the CLI behave exactly as in v2.2.5. Installs on Node.js 18 through 22.21 no longer get an `EBADENGINE` warning.

---

## 🐛 Bug Fixes

### `engines.node` is the runtime floor again ([#176](#176))

v2.2.5 raised `engines.node` to `>=22.22.0` because the development toolchain (tsup 9 needs 22.18 or later) no longer runs on older Node.js. The published package doesn't need any of that toolchain, so the floor was stricter than the code. `engines.node` is now `>=18.0.0`, and the bundles are built for `node18` (tsup `target`, was `node22`).

The package is an ES module and loads with `import` on Node.js 18 and later. `require("@cldmv/fix-headers")` loads the ES module build synchronously, which needs `require(esm)`: Node.js ^20.19.0 or >=22.13.0. On a Node.js without it, the CommonJS entry now says exactly that (`require() needs Node.js ^20.19.0 or >=22.13.0`, code `ERR_REQUIRE_ESM`) and points to `import()`; v2.2.5's message asked for 22.22.0.

## 📦 Requirements

- **Runtime:** Node.js 18.0.0 or later (`engines.node` is `>=18.0.0`, was `>=22.22.0`). `require()` needs Node.js ^20.19.0 or >=22.13.0; use `import()` on older versions.
- **Development:** working on this repository needs Node.js 22.22.0 or later, declared in `devEngines.runtime` with `onFail: "error"`. This doesn't affect anyone installing the package.

## 🔧 CI & tooling

- The CI and publish workflows keep `min_node_version` at 22.22.0; its description and a comment now say it's the dev toolchain floor and should match `devEngines`, not `engines` ([#176](#176)).

## 📚 Documentation

- **NEW:** [docs/changelog/v2/v2.2.6.md](./v2.2.6.md): this changelog.
- README: the requirements list the runtime floor, the `require()` range and the development floor separately ([#176](#176)).
- The v2.2.5 changelog now lists its Node.js floor under Requirements instead of Breaking Changes ([#175](#175)).
- README What's New promoted to v2.2.6.

---

## Upgrade notes

- No breaking changes; drop-in for v2.2.5. Apart from the CommonJS entry's error message and the `node18` build target, no library code changed, and header output is identical.
- If you held back from v2.2.5 because of its 22.22.0 floor, v2.2.6 installs cleanly on Node.js 18 and later again.



<details>
<summary>👥 Contributors</summary>

- @Shinrai

</details>

---

<!-- coverage-start -->

![coverage](https://img.shields.io/badge/coverage-99.6%25-brightgreen?style=for-the-badge&logo=vitest&logoColor=white)

| Metric | Coverage |
|--------|----------|
| Statements | 99.9% |
| Branches   | 98.8% |
| Functions  | 100.0% |
| Lines      | 99.9% |

*Avg: **99.6%** · `40ed317` · Node lts/**

<!-- coverage-end -->

<!-- co-authors -->

Co-authored-by: Shinrai <[email protected]>
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 ! fix → next v4 flow: fix contributor PR targeting the next integration branch 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant