Skip to content

refactor(cjs): sync the CJS shim with the package-layout template - #21

Merged
Shinrai merged 2 commits into
nextfrom
fix/cjs-shim-names
Nov 29, 2026
Merged

Shinrai merged 2 commits into
nextfrom
fix/cjs-shim-names

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

No new features

🐛 Bug Fixes

No bug fixes

📦 Dependencies

No dependency updates

🔧 Other Changes

  • refactor(cjs): sync the CJS shim with the package-layout template (c50a4a6)
  • test(cjs): assert require() returns the ESM module object (4714061)
👥 Contributors

@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 labels Nov 29, 2026
@Shinrai
Shinrai merged commit 19fadbe into next Nov 29, 2026
37 checks passed
@cldmv-bot
cldmv-bot Bot deleted the fix/cjs-shim-names branch November 29, 2026 04:47
Shinrai added a commit that referenced this pull request Nov 29, 2026
## 🚀 What's Changed

### 💥 Breaking Changes
_No breaking changes_

### ✨ Features
_No new features_

### 🐛 Bug Fixes
_No bug fixes_

### 📦 Dependencies
_No dependency updates_

### 🔧 Other Changes
- docs: cover #20 and #21 in the v0.1.2 changelog (3960bc0)
- docs: add the v0.1.2 changelog and promote What's New (f99974f)



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

- @Shinrai

</details>
cldmv-bot Bot added a commit that referenced this pull request Nov 30, 2026
# `@cldmv/lib-process` v0.1.2 Changelog

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

---

## Overview

`dist/` is now built one file per module instead of as a single bundle. The published code, exports and `require()` / `import` shapes are the same as in v0.1.1; only how the files in `dist/` are produced changed. No runtime behavior changed.

---

## 🔧 Build

### `dist/` mirrors `src/`, one minified file per module ([#18](#18), fixes [#10](#10))

The tsup bundle is replaced by `scripts/build.mjs`, which runs esbuild over every `src/**/*.mjs` file with `bundle: false`. Each module is minified on its own (names kept, so `LibProcessError.name` and stack traces read the same) and written to `dist/` at the same relative path, with a source map next to it. `src/index.cjs` is still copied verbatim to `dist/index.cjs`, and the target is `node16`. Nothing is merged into one file, so each module exists once and the modules import each other by their plain relative paths.

The package's `exports`, entry points and the shape of `require()` and `import` are unchanged. The tarball now contains one `.mjs` file per source module instead of a single `index.mjs`, and the `.map` files are still left out by `files`.

### `src/index.cjs` is synced with the package-layout template ([#21](#21))

The CommonJS shim is replaced by the corrected generic one from CLDMV/.github. After the Node.js version guard it returns the module object, `{ alive, Holder, lock, Lock, safeKill, CODES, LibProcessError }`, when the ESM entry exports several distinct values, and the single exported value, with `.default` and every export name attached to it, when there is only one. lib-process exports several values, so `require("@cldmv/lib-process")` returns the same module object as before and nothing changes for callers; the CJS test now also checks that no export is decorated with a `.default` property.

## 🔧 CI & tooling

- `ci.yml` and `bundle-size.yml` comments describe the per-module build instead of tsup ([#18](#18)).

## 📚 Documentation

- **NEW:** [docs/changelog/v0/v0.1.2.md](https://github.com/CLDMV/lib-process/blob/v0.1.2/docs/changelog/v0/v0.1.2.md), this changelog.
- README What's New promoted to v0.1.2.

## 🔧 Dependencies

Development dependencies only; lib-process still has no runtime dependencies.

- **CLDMV dev tools** ([#20](#20), [#23](#23)): `@cldmv/vitest-runner` 1.11.3 → 1.11.5, `@cldmv/configs` 1.4.0 → 1.5.1 and `@cldmv/fix-headers` 2.2.7 → 2.6.2, with `@cldmv/jsonv` and `@cldmv/prettier-plugin-jsonv` 1.2.2 → 1.2.4 and `@cldmv/eslint-plugin-jsonv` 1.1.2 → 2.0.0. `fix-headers` restamped the file headers, which now write `@Filename` without a leading slash, and the workflows and `dependabot.yml` were updated to match. Development only; nothing changes for consumers.
- `esbuild` ^0.28.2 added and `tsup` removed ([#18](#18)). The lockfile drops about 900 lines of tsup's dependency tree.

---

## Upgrade notes

- No breaking changes. Drop-in for v0.1.1; no runtime code changed.



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

- @Shinrai

</details>

---

<!-- coverage-start -->

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

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

*Avg: **100.0%** · `e535595` · 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant