Skip to content

Commit e2129cb

Browse files
docs(cli): say the three code subpaths are ESM (#26352)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9Lx3to7qftVwKKnKpjVXPLv)_ Part of #26206 Clause-②: no Metadata-protocol: none ## What changes This is the follow-up #26321 named. `packages/cli/README.md`'s "Public subpath exports" section gains one paragraph saying the three code subpaths (`.`, `./console`, `./hook-body`) are ESM. Load them with `import`. A CommonJS caller reaches them through `import()`, or through `require()` only on a Node that loads ES modules synchronously (22.12 and later). That is the written declaration for the three attw `CJSResolvesToESM` items #26321 left in place on purpose. Their export maps stay `{ types, default }`: on Node 22.22.0, `require()` of all three loads today through `require(esm)`, and an ESM-only map change would break those callers. No export map, code or build changes. There is one `patch` changeset for `@objectstack/cli`, because the README ships in its tarball. The card's remaining half, retiring `@objectstack/driver-memory`'s default export, is not touched here. It is Blocked-by #26324, so #26206 stays open for it. ## Acceptance notes - At `c8ee4e79`, after a full `turbo run build --filter='./packages/**'` (75/75): all 55 `dispatch-gates --commands` families exit 0, each exit captured before any pipe. `--ran` reconciliation: 55 derived, 55 run, 0 NOT-MEASURED (a derived zero). - `check-published-readme-exports` exit 0. `check-published-readme-links` exit 0 (552 links, 234/234 relative targets found). - `check-adr-0087-registration --base origin/main` and `check-changeset-no-major --base origin/main`: both exit 0, as part of the family run. - No tests: the diff is one README paragraph and a changeset. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WTCPNVkuDk7DNaZSdM3DZv --- _Generated by [Claude Code](https://claude.ai/code/session_01WTCPNVkuDk7DNaZSdM3DZv)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent b0376ed commit e2129cb

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/cli': patch
3+
---
4+
5+
docs(cli): the README says the three code subpaths are ESM
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`@objectstack/cli`'s README now states that `.`, `./console` and `./hook-body` are ES modules: load them with `import`, and from CommonJS with `import()`, or with `require()` only on a Node that loads ES modules synchronously (22.12 and later). No export map or code changes.

‎packages/cli/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,8 @@ resolve is exactly this map — a subpath is added here on purpose, with a
377377
| `@objectstack/cli/hook-body` | The hook-body extractor `os build` and `os lint` apply, for an app harness that must run the **same** body-only lowering the build ships (below). |
378378
| `@objectstack/cli/package.json` | The manifest itself, for the ordinary tooling idiom of reading a dependency's own version. |
379379

380+
The three code subpaths (`.`, `./console`, `./hook-body`) are **ESM**: the package is `"type": "module"` and each maps to an ES module. Load them with `import`. A CommonJS caller reaches them through `import()`, or through `require()` only on a Node that loads ES modules synchronously (22.12 and later).
381+
380382
### `@objectstack/cli/hook-body`
381383

382384
```typescript

0 commit comments

Comments
 (0)