release: v1.1.4 - make require() a synchronous wrapper around the ESM… - #81
Merged
Merged
Conversation
The Required PR Check mirror job was skipped on the `pull_request` run of an in-repo feature PR, with a conditional name keeping the skipped check off `✅ Required PR Check`. GitHub never evaluates a skipped job's `name:`, so every in-repo PR showed the raw expression as a check name. The job now uses `if: always()` and never skips, so its name is always evaluated. On the in-repo PR path it lands on `⏭️ Required PR Check (reported by the push run)` and passes as a no-op; the push run still posts `✅ Required PR Check`. Every path that posts the required name keeps `needs: ci`, so that check still only exists once the full test matrix for the SHA has finished. Synced from CLDMV/.github#351 (CLDMV/.github#350).
Bumps the minor group with 2 updates in the / directory: [@cldmv/vitest-runner](https://github.com/CLDMV/vitest-runner) and [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint). Updates `@cldmv/vitest-runner` from 1.4.3 to 1.5.1 - [Release notes](https://github.com/CLDMV/vitest-runner/releases) - [Commits](CLDMV/vitest-runner@v1.4.3...v1.5.1) Updates `typescript-eslint` from 8.70.1 to 8.71.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.71.0/packages/typescript-eslint) --- updated-dependencies: - dependency-name: "@cldmv/vitest-runner" dependency-version: 1.5.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor - dependency-name: typescript-eslint dependency-version: 8.71.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor ... Signed-off-by: dependabot[bot] <support@github.com>
The CommonJS entry went through a generated loader.cjs that did
`module.exports = (async () => await import("../index.mjs"))()`, so
require("@cldmv/jsonv") - and every require("@cldmv/jsonv/<year>") -
returned a Promise of the ESM namespace instead of the API.
- scripts/build-cjs.mjs: every generated .cjs file is now a thin wrapper,
`module.exports = require("<esm file>")`, loaded through Node's
synchronous require(esm). require() returns the same exports as import.
The async loader.cjs is no longer generated, dist/cjs is rebuilt from
scratch, and dist/years/year-resolver.mjs now gets a CJS wrapper too
(the "./*" export already pointed require at one that did not exist).
- Where Node.js has no require(esm) (before 20.19 / 22.12) the wrappers
throw ERR_REQUIRE_ESM with a message pointing to import() instead of a
bare loader error. engines is unchanged.
- tests/cjs: node:test checks against the built dist/, run by `npm test`
and `npm run coverage` after Vitest: require() of the entry and of a
year module returns the same exports as import, and the version check
fires when require(esm) is off.
- docs: note that require() is synchronous and its Node.js requirement.
Existing `await require("@cldmv/jsonv")` code keeps working, since
awaiting a non-promise returns it unchanged; only code that chained
.then() on the require() result changes.
Contributor
Author
🔒 Dependency Review
|
Contributor
Author
|
| File | Raw | Δ Raw | Gzipped | Δ Gzipped |
|---|---|---|---|---|
| dist/api-types.mjs | 56 B | — | 76 B | — |
| dist/ast-types.mjs | 551 B | — | 377 B | — |
| dist/cjs/index.cjs | 667 B | +551 B (+475.0%) |
433 B | +312 B |
| dist/cjs/loader.cjs | 0 B | −174 B (-100.0%) ✅ | 0 B | −161 B |
| dist/cjs/years/2011.cjs | 680 B | +503 B (+284.2%) |
442 B | +280 B |
| dist/cjs/years/2012.cjs | 680 B | +503 B (+284.2%) |
442 B | +280 B |
| dist/cjs/years/2013.cjs | 680 B | +503 B (+284.2%) |
443 B | +280 B |
| dist/cjs/years/2014.cjs | 680 B | +503 B (+284.2%) |
443 B | +280 B |
| dist/cjs/years/2015.cjs | 680 B | +503 B (+284.2%) |
443 B | +280 B |
| dist/cjs/years/2016.cjs | 680 B | +503 B (+284.2%) |
443 B | +280 B |
| dist/cjs/years/2017.cjs | 680 B | +503 B (+284.2%) |
443 B | +280 B |
| dist/cjs/years/2018.cjs | 680 B | +503 B (+284.2%) |
443 B | +280 B |
| dist/cjs/years/2019.cjs | 680 B | +503 B (+284.2%) |
442 B | +279 B |
| dist/cjs/years/2020.cjs | 680 B | +503 B (+284.2%) |
442 B | +280 B |
| dist/cjs/years/2021.cjs | 680 B | +503 B (+284.2%) |
442 B | +280 B |
| dist/cjs/years/2022.cjs | 680 B | +503 B (+284.2%) |
441 B | +279 B |
| dist/cjs/years/2023.cjs | 680 B | +503 B (+284.2%) |
442 B | +280 B |
| dist/cjs/years/2024.cjs | 680 B | +503 B (+284.2%) |
443 B | +280 B |
| dist/cjs/years/2025.cjs | 680 B | +503 B (+284.2%) |
443 B | +280 B |
| dist/cjs/years/2026.cjs | 680 B | +503 B (+284.2%) |
443 B | +280 B |
| dist/cjs/years/2027.cjs | 680 B | +503 B (+284.2%) |
443 B | +280 B |
| dist/cjs/years/2028.cjs | 680 B | +503 B (+284.2%) |
442 B | +279 B |
| dist/cjs/years/2029.cjs | 680 B | +503 B (+284.2%) |
442 B | +279 B |
| dist/cjs/years/2030.cjs | 680 B | +503 B (+284.2%) |
442 B | +280 B |
| dist/cjs/years/2031.cjs | 680 B | +503 B (+284.2%) |
443 B | +280 B |
| dist/cjs/years/loader.cjs | 684 B | +503 B (+277.9%) |
441 B | +281 B |
| dist/cjs/years/year-resolver.cjs | 698 B | +698 B (+100.0%) |
446 B | +446 B |
| dist/diagnose.mjs | 8.3 kB | — | 2.0 kB | — |
| dist/errors.mjs | 7.3 kB | — | 2.2 kB | — |
| dist/index.mjs | 4.2 kB | — | 1.2 kB | — |
| dist/lexer/lexer-types.mjs | 4.8 kB | — | 1.9 kB | — |
| dist/lexer/lexer.mjs | 54.9 kB | — | 10.5 kB | — |
| dist/parser.mjs | 53.8 kB | — | 13.7 kB | — |
| dist/stringify.mjs | 10.9 kB | — | 2.6 kB | — |
| dist/types/api-types.d.mts | 6.5 kB | — | 2.1 kB | — |
| dist/types/api-types.d.mts.map | 2.9 kB | — | 608 B | — |
| dist/types/ast-types.d.mts | 8.0 kB | — | 2.9 kB | — |
| dist/types/ast-types.d.mts.map | 2.7 kB | — | 736 B | — |
| dist/types/cjs/index.d.cts | 86 B | — | 74 B | — |
| dist/types/cjs/years/2011.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2012.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2013.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2014.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2015.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2016.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2017.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2018.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2019.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2020.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2021.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2022.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2023.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2024.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2025.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2026.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2027.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2028.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2029.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2030.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/2031.d.cts | 102 B | — | 82 B | — |
| dist/types/cjs/years/loader.d.cts | 40 B | — | 60 B | — |
| dist/types/cjs/years/year-resolver.d.cts | 47 B | +47 B (+100.0%) |
63 B | +63 B |
| dist/types/diagnose.d.mts | 653 B | — | 344 B | — |
| dist/types/diagnose.d.mts.map | 319 B | — | 208 B | — |
| dist/types/errors.d.mts | 6.8 kB | — | 2.1 kB | — |
| dist/types/errors.d.mts.map | 1.1 kB | — | 345 B | — |
| dist/types/index.d.mts | 4.8 kB | — | 1.5 kB | — |
| dist/types/index.d.mts.map | 1.8 kB | — | 557 B | — |
| dist/types/lexer/lexer-types.d.mts | 6.3 kB | — | 2.5 kB | — |
| dist/types/lexer/lexer-types.d.mts.map | 2.1 kB | — | 717 B | — |
| dist/types/lexer/lexer.d.mts | 9.9 kB | — | 3.3 kB | — |
| dist/types/lexer/lexer.d.mts.map | 2.2 kB | — | 636 B | — |
| dist/types/parser.d.mts | 15.5 kB | — | 5.2 kB | — |
| dist/types/parser.d.mts.map | 3.1 kB | — | 907 B | — |
| dist/types/stringify.d.mts | 1.5 kB | — | 618 B | — |
| dist/types/stringify.d.mts.map | 691 B | — | 304 B | — |
| dist/types/years/2011.d.mts | 2.1 kB | — | 882 B | — |
| dist/types/years/2011.d.mts.map | 1.2 kB | — | 409 B | — |
| dist/types/years/2015.d.mts | 1.8 kB | — | 784 B | — |
| dist/types/years/2015.d.mts.map | 1.2 kB | — | 409 B | — |
| dist/types/years/2020.d.mts | 1.8 kB | — | 743 B | — |
| dist/types/years/2020.d.mts.map | 1.2 kB | — | 408 B | — |
| dist/types/years/2021.d.mts | 1.8 kB | — | 779 B | — |
| dist/types/years/2021.d.mts.map | 1.2 kB | — | 409 B | — |
| dist/types/years/loader.d.mts | 1.9 kB | — | 782 B | — |
| dist/types/years/loader.d.mts.map | 485 B | — | 243 B | — |
| dist/types/years/year-resolver.d.mts | 1.4 kB | — | 600 B | — |
| dist/types/years/year-resolver.d.mts.map | 503 B | — | 250 B | — |
| dist/years/2011.mjs | 2.5 kB | — | 943 B | — |
| dist/years/2012.mjs | 105 B | — | 95 B | — |
| dist/years/2013.mjs | 105 B | — | 95 B | — |
| dist/years/2014.mjs | 105 B | — | 95 B | — |
| dist/years/2015.mjs | 2.3 kB | — | 841 B | — |
| dist/years/2016.mjs | 105 B | — | 95 B | — |
| dist/years/2017.mjs | 105 B | — | 95 B | — |
| dist/years/2018.mjs | 105 B | — | 95 B | — |
| dist/years/2019.mjs | 105 B | — | 95 B | — |
| dist/years/2020.mjs | 2.2 kB | — | 812 B | — |
| dist/years/2021.mjs | 2.3 kB | — | 852 B | — |
| dist/years/2022.mjs | 105 B | — | 95 B | — |
| dist/years/2023.mjs | 105 B | — | 95 B | — |
| dist/years/2024.mjs | 105 B | — | 95 B | — |
| dist/years/2025.mjs | 105 B | — | 95 B | — |
| dist/years/2026.mjs | 105 B | — | 95 B | — |
| dist/years/2027.mjs | 105 B | — | 95 B | — |
| dist/years/2028.mjs | 105 B | — | 95 B | — |
| dist/years/2029.mjs | 105 B | — | 95 B | — |
| dist/years/2030.mjs | 105 B | — | 96 B | — |
| dist/years/2031.mjs | 105 B | — | 96 B | — |
| dist/years/loader.mjs | 2.8 kB | — | 1.0 kB | — |
| dist/years/year-resolver.mjs | 1.8 kB | — | 713 B | — |
| Total | 272.2 kB | +11.9 kB | 85.5 kB | +6.7 kB |
📊 Generated by bundle-size. Brotli sizes also measured but omitted from the table for brevity.
Adds a per-version changelog under docs/changelog/v1/ for every shipped release that had none (v1.0.0-v1.0.10, v1.1.0, v1.1.2, v1.1.3), written from each release's diff against the previous one. v1.0.3-v1.0.6 were released on GitHub only and never published to npm; v1.0.4 has no tag.
Adds docs/changelog/v1/v1.1.4.md for the pending release (#80: require() returns the API synchronously; #77 dev dependency bumps) and reorganizes the README to the CLDMV layout: intro, badges incl. coverage, What's New (v1.1.4 Latest plus four recent releases linking their changelog files), key features, installation with Node.js requirements, quick start, the existing API/errors/AST/reference sections, a documentation index, contributing, links and license. The quick-start example now escapes its inner template literal, and the build-step list no longer names the plugin step that build stopped running in v1.0.2.
Bumps @cldmv/fix-headers to 2.1.4 (JSON/Markdown/extension-less files never get a JS comment; dependency folders never walked). Ran fix:headers: 0 files restamped.
Restamping the file headers under 2.2.0 changed no headers (0 files restamped).
Shared fix-headers config 1.2.4 no longer forces author updates. Restamping the file headers changed no headers (0 files restamped).
Shinrai
approved these changes
Oct 5, 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/jsonv v1.1.4 Changelog
Release Date: October 2026
Release Type: Patch
Branch:
release/1.1.4Overview
Version 1.1.4 fixes the CommonJS entry points. Until now
require("@cldmv/jsonv"), and everyrequire("@cldmv/jsonv/<year>"), returned a Promise of the ESM module rather than the API, so CommonJS code had toawaitit.require()now returns the same exports asimport, synchronously, loaded through Node'srequire(esm).Existing
await require("@cldmv/jsonv")code keeps working unchanged. Two cases do change and are covered in the upgrade notes below: code that chained.then()on therequire()result, and CommonJS code on Node.js versions withoutrequire(esm). The ESM API is untouched. The dev toolchain is also refreshed (@cldmv/fix-headers2.2.0,@cldmv/configs1.2.4,@cldmv/vitest-runner1.5.1,typescript-eslint8.71.0); none of it ships in the package.🐛 Bug Fixes
require()is a synchronous wrapper around the ESM build (#80)The CommonJS build went through a generated
loader.cjsthat didmodule.exports = (async () => await import("../index.mjs"))(), sorequire()handed back a Promise. Every generated.cjsfile is now a thin wrapper,module.exports = require("<esm file>"), sorequire()returns the same module namespace object asimport:The rest of the CommonJS build was tidied along the way:
loader.cjsis no longer generated, anddist/cjsis rebuilt from scratch on every build so a removed wrapper can't linger.@cldmv/jsonv/year-resolvernow has a CommonJS wrapper. The"./*"export already pointedrequireatdist/cjs/years/year-resolver.cjs, but that file was never built, sorequire("@cldmv/jsonv/year-resolver")failed outright.@cldmv/jsonv/loaderand the year modules are wrapped the same way.require(esm)(before 20.19.0, or 22.0–22.11), the wrappers throw anERR_REQUIRE_ESMerror whose message names the required Node.js versions and points toimport(), instead of failing with a bare loader error.🔧 CI & tooling
tests/cjs/entry.test.cjs(node:test), run bynpm testandnpm run coverageafter Vitest through a newtest:cjsscript. It checks against the builtdist/thatrequire()of the entry and of a year module returns the same exports asimport, and that the Node.js version check fires whenrequire(esm)is unavailable.📚 Documentation
require()is synchronous and states its Node.js requirement.docs/changelog/v1/.🔧 Dependencies
All development-only:
@cldmv/vitest-runner1.4.3 → 1.5.1 (#77)typescript-eslint8.70.1 → 8.71.0 (#77)@cldmv/fix-headers^2.1.1→^2.2.0, resolved to 2.2.0. The range was first raised to^2.1.4(#83) and then to^2.2.0(#85). Version 2.1.4 no longer writes a JavaScript comment into JSON or Markdown files, processes every repeated--input, and never walks dependency folders such asnode_modules. Version 2.2.0 changes@Last modified byonly when a file's content was edited, so header-only rewrites keep the recorded editor.@cldmv/configs^1.2.0→^1.2.4, resolved to 1.2.4. The shared fix-headers config now setsforceAuthorUpdateandforceLastModifiedAuthorUpdateto false (#85).package.jsonand the lockfile.Upgrade notes
await require(...)keeps working. Awaiting a non-Promise returns it unchanged, so CommonJS code written against the old Promise-returning entry needs no change..then()on therequire()result no longer works.require("@cldmv/jsonv").then((jsonv) => ...)now throwsTypeError: ... .then is not a function, because the result is the module itself. Use the result directly (const jsonv = require("@cldmv/jsonv")), orawaitit.await require("@cldmv/jsonv")used to resolve through the async loader,require()now throwsERR_REQUIRE_ESMwith a message pointing toimport(). Load the package withawait import("@cldmv/jsonv")there. Theenginesfield (>=18.0.0) and ESMimportsupport are unchanged.👥 Contributors
Avg: 98.7% ·
640792e· Node lts/*Co-authored-by: Shinrai Shinrai@users.noreply.github.com