Skip to content

deps: bump @cldmv/configs to 1.2.4 - #572

Merged
Shinrai merged 2 commits into
nextfrom
deps/fix-headers-2.2.0
Oct 5, 2026
Merged

Shinrai merged 2 commits into
nextfrom
deps/fix-headers-2.2.0

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

No new features

🐛 Bug Fixes

No bug fixes

📦 Dependencies

  • deps: bump @cldmv/configs to 1.2.4 (4c90ee0)
  • deps: bump @cldmv/fix-headers to 2.2.0 (8fe9217)

🔧 Other Changes

No other changes

👥 Contributors

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).
@cldmv-bot cldmv-bot Bot added ! deps → next v4 flow: deps contributor PR targeting the next integration branch type: dependencies Relates to dependency updates, version bumps, or package management labels Oct 5, 2026
@Shinrai
Shinrai enabled auto-merge October 5, 2026 02:30
@Shinrai
Shinrai merged commit a5256d7 into next Oct 5, 2026
31 checks passed
@cldmv-bot
cldmv-bot Bot deleted the deps/fix-headers-2.2.0 branch October 5, 2026 02:48
cldmv-bot Bot added a commit that referenced this pull request Oct 5, 2026
# Slothlet v3.22.1 Changelog

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

---

## Overview

Version 3.22.1 fixes how the package loads from CommonJS. `require("@cldmv/slothlet")` used to return a wrapper function that was not the function ESM consumers import, and its `defaults` property was attached a tick later, so reading `slothlet.defaults` in the same tick as the `require()` gave `undefined`. The CommonJS entry now loads the ES module build through Node's synchronous `require(esm)` and returns that build's own default export, so CommonJS and ESM consumers get the identical function with `defaults` and the named `slothlet` alias already set. A follow-up makes that identity independent of load order.

The rest of the release is tooling. Every file header in the repository was restamped by `@cldmv/fix-headers` 2.1 and the shared `@cldmv/configs` config, which touched more than a thousand files but changed comments only, and the dev dependencies moved forward (`@cldmv/fix-headers` 1.3.12 to 2.2.0, `@cldmv/configs` 1.2.4 added, the Vitest 5.0.3 patch group, and two patched transitive packages). No runtime dependency changed, and the public API, the hooks, the permissions system and the instance lifecycle are untouched.

---

## ⚠️ Behavior changes

### `@cldmv/slothlet/devcheck` is no longer published ([#568](#568))

`devcheck.mjs` is a guard that only acts inside a source checkout of this repository: it does nothing in an installed copy. It is removed from the `files` whitelist and from the `exports` map, so `import "@cldmv/slothlet/devcheck"` no longer resolves. `index.mjs` now imports it by relative path inside its existing `try`/`catch`, which is skipped in a browser and silently ignored when the file is absent, as it is in a published package. Nothing a consumer could rely on changed, but the subpath is gone.

### CommonJS needs `require(esm)` ([#568](#568))

`index.cjs` now requires `index.mjs` directly. On a Node.js version without `require(esm)` (before 20.19 on the 20.x line, or before 22.12) it throws an error with code `ERR_REQUIRE_ESM` and a message that names the running version and points at `import()`. The package already declares `engines.node` `>=22.15.0` since [v3.22.0](./v3.22.0.md), so a supported Node.js version always has `require(esm)`.

## 🐛 Bug Fixes

### `require()` returns the ESM entry's own function, synchronously ([#568](#568))

`index.cjs` wrapped `index.mjs` in its own `async function slothlet(options)` that ran a dynamic `import()` on every call, and attached `slothlet.defaults` from a separate `import()` that settled on the microtask queue. As a result `require("@cldmv/slothlet")` was a different function than the ESM default export, and `defaults` was undefined in the tick that called `require()`.

The entry is now a thin wrapper: it checks `process.features.require_module`, requires `./index.mjs`, and exports that module's default. `slothlet.defaults` is set when `require()` returns, and `const { slothlet } = require("@cldmv/slothlet")` reads the named alias off the same function.

`index.mjs` itself had to become loadable through `require(esm)`, which rejects any module graph that contains top-level `await`:

- **New `helpers/reserved-keys` module.** `slothlet.defaults` is built by `helpers/defaults`, which imported `ComponentBase` and `IMPL_METADATA_KEYS` from the wrapper classes, and those reach `helpers/platform` and its top-level `await`. The two reserved-key Sets (`WRAPPER_INTERNAL_KEYS`, served as `ComponentBase.INTERNAL_KEYS`, and `IMPL_METADATA_KEYS`) now live in `src/lib/helpers/reserved-keys.mjs`, a module with no imports. The classes serve the same Set objects from there, so `slothlet.defaults.reservedExports` and every filter built on the Sets behave as before. The module is marked internal.
- **No top-level `await` for the dev check.** The `devcheck` import runs inside an async function rather than at the top level of `index.mjs`.

### CommonJS and ESM consumers see an identical function ([#570](#570))

The first version of the fix still wrote `module.exports.slothlet = slothlet` onto the function ESM consumers import, so that function's own keys were `["defaults"]` for an ESM-only load and `["defaults", "slothlet"]` once anything had called `require()`. `index.mjs` now sets `slothlet.slothlet = slothlet` itself and `index.cjs` no longer writes to the shared function, so both module systems see exactly `defaults` and `slothlet` whichever loads first. The generated type declarations include the `slothlet` property.

## 🧪 Tests

- `tests/node/entrypoint-cjs.cjs` (run by `npm test` through `test:node`) now checks that `require()` returns the same function as the ESM default export, that `.defaults` is already set in the tick of the `require()`, that `.defaults.routines` is an array, that the named alias matches the ESM named export, and that CJS and ESM loads expose the same own keys in a fresh process. A child process started with `--no-experimental-require-module` checks that the entry fails with `ERR_REQUIRE_ESM`, the version requirement and the `import()` hint.
- The Vitest setup files no longer carry a commented-out `@cldmv/slothlet/devcheck` import.

## 🔧 CI & tooling

### File headers restamped, and the shared fix-headers config adopted ([#569](#569))

- **Framed header layout.** `@cldmv/fix-headers` 2.1 writes each header with an empty ` *` line inside the opener and before the closer. Running `npm run fix:headers` rewrote the header of about 1,150 source, test, tool and fixture files in that layout, refreshed `@Last modified time`, and corrected 89 `@Date` epochs that did not match their date text. Header comments are the only change in those files, and the `types/*.d.mts.map` files were regenerated for the shifted lines. No JSON or Markdown file was touched.
- **ISO dates.** The shared config turns on `normalizeDateFormat`, so every header date is written as `2026-10-03T20:02:20-07:00`. Before, `@Last modified time` used a space form (`2026-10-03 20:02:20 -07:00`) next to an ISO `@Date`, and 580 `@Date` values were still in the space form. Each date keeps its instant.
- **Shared config.** `tools/dev/fix-headers.mjs` no longer hard-codes house settings. It passes the new `.configs/fix-headers.json`, which extends `@cldmv/configs/fix-headers.json` and sets only the project name, and keeps the repository's own include lists. The shared settings restamped another 288 headers: `@Author` and `@Last modified by` use the signing-key name, four last-modified emails moved to the noreply address, and 16 `@Date` values moved back to the file's first commit. The wrapper passes `margin: 1`, because the default margin of 2 is collapsed to 1 by Prettier and the precommit `fix:headers` and `format` steps would otherwise rewrite every file back and forth.
- **`--diff` prints the diff.** `npm run fix:headers -- --diff` (and `--dry-run`, which implies it) now prints each changed file's header diff instead of only listing file names.
- **Header checks accept the framed layout.** The header and stacked-header checks in `tools/dev/analyze-errors.mjs` allow empty comment lines just inside the opener and before the closer, so the new layout is not reported as a missing header.
- **Later bumps changed nothing.** fix-headers 2.2.0 ([#572](#572)) and `@cldmv/configs` 1.2.4 ([#572](#572)) ran `fix:headers` and restamped 0 files. From 2.2.0 the `@Last modified by` tag follows content edits only, and 1.2.4 sets `forceAuthorUpdate` and `forceLastModifiedAuthorUpdate` to `false`, so `@Author` is never rewritten.

The comment-only edits to the build tools (`tools/build/build-subpackages.mjs`, `tools/build/build-typestubs.mjs`) just drop their mentions of `./devcheck`.

## 📚 Documentation

- **NEW:** [docs/changelog/v3/v3.22.1.md](./v3.22.1.md): this changelog.
- README What's New promoted to v3.22.1.

## 🔧 Dependencies

All dev-only. `dependencies`, `optionalDependencies` and `peerDependencies` are unchanged, and the only entries that moved in the lockfile are the ones below.

- **`@cldmv/fix-headers` `^1.3.10` → `^2.2.0`** (locked 1.3.12 to 2.2.0), in four steps: 2.1.0 ([#564](#564), Dependabot), 2.1.4 ([#569](#569), with the restamp above) and 2.2.0 ([#572](#572), no headers changed).
- **`@cldmv/configs` `^1.2.4`**, newly added as a dev dependency ([#569](#569) added it at `^1.2.2`, [#572](#572) raised it to 1.2.4). Provides the shared fix-headers config that `.configs/fix-headers.json` extends.
- **Vitest 5.0.2 → 5.0.3 patch group** ([#566](#566)): `vitest`, `@vitest/browser`, `@vitest/browser-playwright` and `@vitest/coverage-v8` 5.0.2 to 5.0.3, `@vitest/istanbul-lib-coverage` 1.0.1 to 1.0.2, `chalk` 6.0.0 to 6.0.1 and `ignore` 7.0.10 to 7.0.11. The `package.json` ranges already allowed these, so only the lockfile changed. The resolution also moves the transitive `why-is-node-running` from 3.2.2 to 3.2.1, the version `vitest` asks for.
- **Indirect dev dependencies from Dependabot's `npm_and_yarn` group**: `markdown-it` 14.2.0 to 14.3.2 ([#561](#561)) and `brace-expansion` 5.0.9 to 5.0.12 together with `markdown-it` ([#565](#565)). Lockfile only.

---

## Upgrade notes

- **Drop-in for [v3.22.0](./v3.22.0.md)** on every supported Node.js version (`>=22.15.0`). No API, option or behavior of an api instance changed.
- **CommonJS:** `require("@cldmv/slothlet")` now returns the same function as `import slothlet from "@cldmv/slothlet"`, and `.defaults` and the named `slothlet` alias are available immediately. Code that compared or monkey-patched the old wrapper function is the only thing that can notice.
- **ESM:** the default export gains an own `slothlet` property pointing at itself (the named alias), which now exists whichever way the package is loaded.
- **Anything importing `@cldmv/slothlet/devcheck`** must drop that import. It was a source-checkout guard and has no effect in an installed copy.



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

- @Shinrai

</details>

---

<!-- coverage-start -->

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

| Metric | Coverage |
|--------|----------|
| Statements | 99.6% |
| Branches   | 99.1% |
| Functions  | 99.7% |
| Lines      | 99.8% |

*Avg: **99.5%** · `edc99eb` · 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

! deps → next v4 flow: deps contributor PR targeting the next integration branch type: dependencies Relates to dependency updates, version bumps, or package management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant