Repository navigation
release: v1.5.3 - fail clearly on Node without require(esm) - #70
Merged
Merged
Conversation
src/cjs-shim.cjs loaded dist/index.mjs via createRequire(__filename),
but a .cjs file already has a plain require() available — createRequire
is unnecessary and breaks static-require detection in bundlers like
esbuild/webpack. Switched to a plain require("./index.mjs").
On Node.js versions without require(esm) (before 20.19 / 22.12), that
plain require() would fail with a bare, confusing ERR_REQUIRE_ESM.
Check process.features.require_module up front and throw a clear
message pointing at import() instead.
tests/cjs: node:test checks run by npm test/coverage after Vitest:
require() returns the same named exports as import, and the version
check fires when require(esm) is off.
Contributor
Author
🔒 Dependency Review
|
Contributor
Author
|
| File | Raw | Δ Raw | Gzipped | Δ Gzipped |
|---|---|---|---|---|
| bin/vitest-runner.mjs | 31.6 kB | — | 11.0 kB | — |
| dist/index.cjs | 1.9 kB | +614 B (+44.9%) |
1.1 kB | +314 B |
| dist/index.mjs | 25.7 kB | — | 9.1 kB | — |
| Total | 59.2 kB | +614 B | 21.1 kB | +314 B |
📊 Generated by bundle-size. Brotli sizes also measured but omitted from the table for brevity.
These releases shipped without a per-version changelog file. Each file is written from the diff against the previous release, notes that v1.3.0–v1.3.3 never reached npm (their changes first shipped in v1.4.2), and records the behaviour changes in minor releases: v1.1.0 stopped --log-file from enabling coverage, and v1.2.0 raised engines.node to >=20.19.0. The v1.5.2 notes record that its chalk 6 dependency declares Node.js >=22 while engines.node still reads >=20.19.0.
Adds docs/changelog/v1/v1.5.3.md for the pending release (#69: the CommonJS entry uses a plain require() and fails clearly on Node.js without require(esm)) and promotes v1.5.3 to the README What's New Latest block. The README follows the CLDMV layout: intro and tagline, badges, What's New, Key Features, Installation with Node.js requirements, Quick Start, then the existing CLI, API, coverage and layout reference, followed by Documentation, Contributing, Links and License. Install commands and code examples now use the scoped @cldmv/vitest-runner name, the Node.js requirement matches engines.node instead of claiming Node.js 18, and the source layout describes dist/index.cjs as the thin shim it is.
Replace the MIT license with the Apache License 2.0 in LICENSE, package.json, the README and the v1.5.3 changelog.
The runtime dependency chalk 6 declares node >=22, the current vitest peer (5.x) needs ^22.12.0 || ^24 || >=26, and CI tests from 22.12.0, so the declared >=20.19.0 floor was never true: Node.js 20 installs warned with EBADENGINE and failed under engine-strict. Fixes #72
…d Apache-2.0 relicense (#71)
Shinrai
approved these changes
Oct 4, 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.
vitest-runner v1.5.3 Changelog
Release Date: October 2026
Release Type: Patch
Branch:
release/1.5.3Overview
This release changes how
dist/index.cjsloads the ES module build. The CommonJS entry no longer goes throughcreateRequire, which kept bundlers from seeing the dependency, and it now fails with a clear, actionable error on a Node.js version that cannotrequire()an ES module. Newnode:testchecks run the built CommonJS entry point on every test and coverage run.The ES module build, the CLI and the
run()API are unchanged, and on Node.js versions withrequire(esm)(20.19+ and 22.12+),require("@cldmv/vitest-runner")returns the same named exports as before.It also raises
engines.nodeto>=22.12.0(#73). The old>=20.19.0floor was never true: the runtime dependencychalk6 needs Node.js 22, the currentvitest5 peer needs^22.12.0, and CI only ever tested 22.12 and later.💥 Breaking Changes
Node.js 20 is no longer supported (#73, fixes #72)
engines.nodemoves from>=20.19.0to>=22.12.0, despite this being a patch release. In practice Node.js 20 already stopped working cleanly in v1.5.2:chalk6.0.1 declares Node.js 22 or later, so Node.js 20 installs printed anEBADENGINEwarning and failed outright underengine-strict, andvitest5 does not install on Node.js 20 at all. The floor now says what the package actually needs.🐛 Bug Fixes
The CommonJS entry uses a plain
require()(#69)src/cjs-shim.cjs, which the build copies verbatim todist/index.cjs, loaded./index.mjsthroughcreateRequire(__filename). A.cjsfile already hasrequire, socreateRequireadded nothing, and it hid the dependency from bundlers such as esbuild and webpack, which detect dependencies from staticrequire("…")calls. The shim now callsrequire("./index.mjs")directly and exports its result.require()fails clearly on Node.js withoutrequire(esm)(#69)On a Node.js version without synchronous
require(esm)(before 20.19 on the 20.x line, or before 22.12), the shim'srequire()threw a genericERR_REQUIRE_ESMthat pointed at the package's internals. The shim now checksprocess.features.require_modulefirst and, when it is missing, throws an error with the sameERR_REQUIRE_ESMcode and a message naming the package, the required versions and the running version:Code that catches
ERR_REQUIRE_ESMbycodekeeps working.🧪 Tests
tests/cjs/entry.test.cjs, run withnode --testby a newtest:cjsscript after a freshnpm run build. It checks thatrequire()of the built package returns the same named exports asimport, and that the version check throws the new error whenrequire(esm)is unavailable.npm test,npm run test:coverageandnpm run ci:coveragenow runtest:cjsafter Vitest, so CI exercises the published CommonJS entry point.📄 License
LICENSEnow carries the Apache License 2.0 text andpackage.jsondeclares"license": "Apache-2.0".📚 Documentation
@cldmv/vitest-runner, and the Node.js requirement matchesengines.node.🔧 Dependencies
No dependency updates.
Upgrade notes
chalk6), or upgrade Node.js. Everyone already on Node.js 22.12+ gets a drop-in update from v1.5.2.require(esm),require()now fails with a clearer message and the sameERR_REQUIRE_ESMcode.👥 Contributors
Avg: 99.5% ·
79b31f7· Node lts/*Co-authored-by: Shinrai Shinrai@users.noreply.github.com