Skip to content

refactor: switch the CJS entry to the generic shim - #137

Merged
Shinrai merged 1 commit into
nextfrom
refactor/generic-cjs-shim
Nov 28, 2026
Merged

Shinrai merged 1 commit into
nextfrom
refactor/generic-cjs-shim

Conversation

@cldmv-bot

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

Copy link
Copy Markdown
Contributor

src/index.cjs is now the generic CLDMV shim. require("@cldmv/jsonv") returns exactly what it did before: the module object with every ESM export. The CJS test now pins that shape. There's no open adopt-shim issue for this repo.

src/index.cjs is now the generic CLDMV shim. require() returns exactly what it did before: the module object with every ESM export.
@cldmv-bot cldmv-bot Bot added ! refactor → next v4 flow: refactor contributor PR targeting the next integration branch area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure labels Nov 28, 2026
@Shinrai
Shinrai merged commit c6a1de9 into next Nov 28, 2026
37 checks passed
@cldmv-bot
cldmv-bot Bot deleted the refactor/generic-cjs-shim branch November 28, 2026 07:44
cldmv-bot Bot added a commit that referenced this pull request Nov 28, 2026
# jsonv v1.2.3 Changelog

**Release Date**: November 2026
**Release Type**: Patch
**Branch**: `next` → `master`

---

## Overview

A packaging and tooling release with no parser changes. The CommonJS entry is now the generic shim shared by the CLDMV libraries, and `require("@cldmv/jsonv")` returns the same module object as before. The test suite now also runs against the built `dist/`, CI cancels superseded runs, and the dev toolchain is refreshed.

---

## 📦 Packaging

### The CommonJS entry is the generic shim ([#137](#137))

`src/index.cjs`, published as `dist/index.cjs`, is now the shim every CLDMV library ships: a Node.js version guard, then `require("./index.mjs")`. jsonv exports several values, so `require("@cldmv/jsonv")` returns the module object with every ESM export, exactly as before. The CJS test pins that shape.

---

## 🧪 Tests

### The suite runs against the build too ([#125](#125))

The tests now import the package by name instead of by `src/` path, so the new `test:dist` script builds the package and runs the whole suite against `dist/` with `--mode=dist`. A new resolve test checks that each mode loaded the tree it was meant to. `npm test` and `ci:coverage` run it.

---

## 🔧 CI & tooling

- `ci.yml` adopts the CLDMV/.github v4.46.0 concurrency block, so superseded runs on `next`, `hotfixes` and the release PR are cancelled and only release pushes always finish ([#138](#138), fixes [#136](#136)).
- `ci.yml` is synced with the v4.43.0 template ([#134](#134)).
- The `sync-release-notes.yml` companion workflow syncs release bodies from these changelog files and creates missing version tags ([#132](#132)).

## 📚 Documentation

- **NEW:** [docs/changelog/v1/v1.2.3.md](https://github.com/CLDMV/jsonv/blob/v1.2.3/docs/changelog/v1/v1.2.3.md), this changelog.
- README What's New promoted to v1.2.3.

## 🔧 Dependencies

All development dependencies; nothing the package depends on at runtime changed.

- `@cldmv/vitest-runner` 1.5.6 → 1.11.3, with the in-range toolchain updates: `eslint` 10.16.0, `prettier` 3.10.1, `typescript-eslint` 8.74.0 and `@cldmv/eslint-plugin-jsonv` 1.1.2, plus `@html-eslint/*` 0.67 → 0.69 ([#139](#139), fixes [#71](#71)).
- `vitest` and `@vitest/coverage-v8` 5.0.5 → 5.1.0 ([#127](#127)), then 5.1.2 through #139.
- `@cldmv/fix-headers` 2.2.4 → 2.2.6 ([#128](#128)), then 2.6.0 through #139.

---

## Upgrade notes

- No breaking changes: `require()` and `import` return the same things as in [v1.2.2](https://github.com/CLDMV/jsonv/blob/v1.2.3/docs/changelog/v1/v1.2.2.md), and the parser is unchanged.



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

- @Shinrai

</details>

---

<!-- coverage-start -->

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

| Metric | Coverage |
|--------|----------|
| Statements | 98.7% |
| Branches   | 97.3% |
| Functions  | 100.0% |
| Lines      | 98.8% |

*Avg: **98.7%** · `6bf54ae` · 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 ! refactor → next v4 flow: refactor contributor PR targeting the next integration branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant