You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): ratify ./hook-body and ./package.json as public subpath exports of @objectstack/cli (#15611)
* wip(cli): pin, README and changeset for the ./hook-body subpath ratification
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* feat(cli): ratify ./hook-body and ./package.json as public subpath exports
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* test(cli): the subpath pin declares every child's env via childEnv()
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* test(cli): the subpath pin asserts the ts-morph borrow before making it
The pin symlinks `ts-morph` in from the workspace so the packed extractor can
be EXECUTED and not merely resolved. That borrow was unconditional: had the
entry left `dependencies` (it is `^28.0.0` there today), an installed copy of
the tarball would fail the free-identifiers path with ERR_MODULE_NOT_FOUND
while this pin — handing itself a copy no consumer receives — stayed green.
A pin asserting a public surface works when it does not.
`beforeAll` now asserts `MANIFEST.dependencies['ts-morph']` before symlinking,
with a failure message naming what the borrow hides and what a real consumer
would hit instead.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
---------
Co-authored-by: Claude <noreply@anthropic.com>
Ratify `./hook-body` as a public subpath export — `extractHookBody`, `HookBodyExtractionError`, `HookBodyRefusalKind` and `ExtractedBody` were reachable as a deep `dist/utils/extract-hook-body.js` import until #13123 sealed the surface, and an app's hook-body fidelity harness (hotcrm's `test/helpers/action-sandbox.ts`) consumes them to run the SAME body-only lowering `os build` ships through the real QuickJS runner, so a test executes what production executes rather than a lookalike. The #13123 body names exactly this remedy for an out-of-repo consumer — ratify the subpath as public surface rather than read `dist/` paths — and 17.3.0 applied it to `./console` for cloud's `objectos-runtime`; this applies it to the second consumer (#15325). `@objectstack/cli/hook-body` is a dedicated entry that re-exports those four names and nothing else; the deep `dist/` path stays sealed. Also admits `./package.json`, so the ordinary tooling idiom of reading a dependency's own manifest resolves again.
6
+
7
+
`minor`, not `patch`: a new subpath on a published package's `exports` map is a purely additive widening of its public surface — a new accepted key — which takes at least `minor` under the maintainer's 2026-09-04 rule (decision batch #35, on #15294) in the Check Changeset step's "WHICH LEVEL" prose; the commit type never lowers it.
Copy file name to clipboardExpand all lines: packages/cli/README.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -314,6 +314,52 @@ os environments bind <id> --artifact dist/objectstack.json # 8. Bind to a Cloud
314
314
└── package.json # oclif config under "oclif" key
315
315
```
316
316
317
+
## Public subpath exports
318
+
319
+
`@objectstack/cli` is a command-line tool first, and its `exports` map is
320
+
deliberately sealed: a deep `dist/` path is not a supported import and an
321
+
internal refactor may move it without notice. What an out-of-repo consumer may
322
+
resolve is exactly this map — a subpath is added here on purpose, with a
323
+
`minor` changeset, never discovered by reaching into `dist/`:
324
+
325
+
| Subpath | What it is for |
326
+
|:---|:---|
327
+
|`@objectstack/cli`| The command classes `bin/run.js` loads — the oclif entry. |
328
+
|`@objectstack/cli/console`| Console SPA resolution helpers (`resolveConsolePath`, `hasConsoleDist`, `createConsoleStaticPlugin` and the drift guards), consumed by cloud's `objectos-runtime` node server to mount the Console. |
329
+
|`@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). |
330
+
|`@objectstack/cli/package.json`| The manifest itself, for the ordinary tooling idiom of reading a dependency's own version. |
0 commit comments