Repository navigation
Commit 5803f41
fix(cli): Console-dist warning names the remedy for where it runs; README states the Console step and command costs (#22224)
Fixes #22155
Fixes #22164
Clause-②: no
One PR for the two-card bundle that edits the same README section.
#22156 is serial after this PR and is not addressed here: its README
items (the first `curl`, the pnpm floors) and `CONTRIBUTING.md` are
untouched.
## What changes
### README, "Hack on the framework"
This covers #22164 and the README half of #22155.
- The command block gains `pnpm objectui:build` as the Console step,
between `pnpm build` and `pnpm dev`.
- A paragraph under the block says what the step does:
- it builds objectui at the commit pinned in `.objectui-sha` into the
gitignored `packages/console/dist`;
- it builds from a `../objectui` checkout when one exists, otherwise
from a shallow clone into `.cache/`;
- it installs objectui's dependencies either way, so it needs network;
- without it, `pnpm dev` still serves the REST API, but no Console;
- rerun it when `.objectui-sha` moves.
This matches `content/docs/getting-started/examples.mdx` and
`scripts/build-console.sh`, both read on `origin/main` `c6fe02d7ac`.
- A table gives each command's measured cost, quoted as the cards
measured it on a fresh clone (4-vCPU container, Node 22.22, pnpm 10.31):
| Command | Time |
|:---|---:|
| `pnpm install` | 16 s |
| `pnpm build` | 6 m 54 s (72 turbo tasks) |
| `pnpm objectui:build` | 10 m 36 s |
| `pnpm test` | 54 m 03 s (135 turbo tasks) |
These were not re-measured here.
- For a contributor's own change, the section now points to `pnpm turbo
run test --affected` and `pnpm --filter @objectstack/PKG test`. A note
says that `--affected` compares the branch with the local `main`.
- The `pnpm install` line's text is unchanged; only its comment column
moved.
### CLI boot warning
This is the warning half of #22155, cross-lane to `domain:cli` as
declared on the claim.
`packages/cli/src/commands/serve.ts` used to print the same remedy
wherever it ran: `install @object-ui/console (already built) or run pnpm
--filter @object-ui/console build in the objectui workspace`. It now
calls `formatConsoleDistMissingWarning(consolePath)`, which is new in
`packages/cli/src/utils/console.ts` beside the drift formatters. The
function picks the remedy from one signal: whether the nearest
`package.json` above the resolved console package declares an
`objectui:build` script.
- **Framework repo** (the root manifest declares the script). The
warning reads `Console dist not found at packages/console/dist`, says
`pnpm build` does not produce it, and says to build it with `pnpm
objectui:build` in the root directory, which it names. The directory
matters because `pnpm dev` runs in `examples/app-showcase`, where the
root script does not resolve.
- **Anywhere else**. The warning gives the dist path and says the
Console ships prebuilt in `@objectstack/console`, a dependency of
`@objectstack/cli`, to reinstall at the CLI's version. A scaffolded
project depends on `@objectstack/cli`
(`packages/create-objectstack/src/templates/blank/package.json`), and
the CLI depends on `@objectstack/console` (`packages/cli/package.json`).
The resolver reads `@objectstack/console` only. An installed
`@object-ui/console` is never consulted.
Why this signal (Zone 2, item 3):
- The script's presence is exactly the claim the message makes, so the
command is named only where it exists.
- The `.objectui-sha` pin that the drift guard keys on would also match
another repository that carries a pin without the script.
- A layout check such as `packages/console` or
`scripts/build-console.sh` couples the CLI to this repo's file tree.
- The walk stops at the nearest manifest. A project created inside a
framework checkout therefore gets the install remedy for the console it
actually resolved. The pnpm store layout's intermediate directories
carry no manifest, so the walk reaches the project's own.
Only the text changes; mount and refuse decisions are untouched. There
is a patch changeset for `@objectstack/cli`.
The new export is internal. `test/published-subpath-console.pin.test.ts`
partitions every export of `utils/console.ts` into public and not-public
lists, and it went red until the name was recorded there as
`INTERNAL_SINCE_RETIREMENT`. The two "exactly three names" checks still
hold it off the published `./console` subpath. The helper's build-root
walk is not exported.
### Not done here
- **The bare-404 HTTP half of #22155**, which belongs to `domain:cli`.
`GET /_console/` on a composition with no Console still answers `404`;
this boot measured it at `404`.
## Verification
All runs below were on `0ef75bd7d9` unless noted.
- **Unit test, both branches with controls**
(`packages/cli/test/console-resolve.test.ts`, four new cases):
- framework layout: names `pnpm objectui:build` and the root;
- control: the same layout without the script gets the install remedy;
- installed CLI, hoisted and pnpm-store layouts: names
`@objectstack/console`;
- a project inside a framework checkout gets the install remedy. Its
control removes the project's manifest, and the walk then reaches the
outer one and names the build.
Every case asserts that `@object-ui/console` is absent.
- **Ablations**, each landed on disk via `scripts/ablation-replace.mjs`
and restored with blob equal to HEAD and an empty `git diff HEAD`:
- the signal forced to `null`: 2 of 4 red (the framework case and the
stop-rule control);
- the walk made to keep climbing past the nearest manifest: 1 of 4 red
(the stop-rule case).
- **Live boot, framework context**: `pnpm dev -- --fresh -p 38592` from
this worktree, with no `packages/console/dist` and no `../objectui`
beside it. The boot printed:
```text
⚠ Console dist not found at packages/console/dist — `pnpm build` does
not produce it. Build it with `pnpm objectui:build` in
/home/user/objectstack-issue-22155 (uses a ../objectui checkout if
present, else clones objectui at the pinned commit — needs network).
```
`/api/v1/health` answered 200 and `/_console/` answered 404. The
non-framework branch was verified by the unit test only; no scaffolded
project was booted.
- **`--affected`**, verified with `pnpm turbo run test --affected
--dry-run=json` (turbo 2.11.5):
- `TURBO_SCM_BASE=origin/main` before the change: 0 packages;
- after the change: 8 packages, namely `//`, `@objectstack/cli` and its
six dependents `dogfood`, `downstream-contract` and
`example-{crm,multi-package,showcase,todo}`;
- against this checkout's stale local `main` (`9cc2c7954a`, 108 commits
behind): 81 packages. That is why the README says a stale `main` widens
the set.
- **`@objectstack/cli`**:
- `build`: exit 0;
- `typecheck`, including `check:test-typecheck`: exit 0;
- `vitest run --project unit`: 263 files and 3878 tests passed;
- `--project integration`, run locally because `serve.ts` is on the boot
path: 93 files, 897 tests passed and 2 skipped.
- **Gates**: `node scripts/pm/dispatch-gates.mjs --commands` over this
diff derived 68 commands. That is the dispatch's 53 plus 15 that the
changeset and test files bring in. All 68 exited 0. `--ran`
reconciliation: 68 derived, 68 run, 0 NOT-MEASURED, 0 UNRUN.
- **Lint**, a proven narrowing: eslint `--no-inline-config --format
json` on the 4 changed TS files reported 4 files, 0 errors and 0
warnings. `--print-config` shows each file is in the config's
population. `eslint.config.mjs` enables no type-aware linting (no
`parserOptions.project` or `projectService`), so this diff cannot move a
verdict on an untouched file. The repo-wide `pnpm lint` is left to CI.
## Acceptance notes
- `os serve --help` still describes `--[no-]ui` as `Enable the bundled
Console portal at /_console/ when @object-ui/console is installed`. That
is the same wrong package name, at `serve.ts:1198` and mirrored in
`packages/cli/README.md:244`. It is outside this claim's file surface,
so it is reported to the PM rather than changed here.
- `packages/spec/scripts/publish-smoke-boot-failure.test.ts` and a
comment in `scripts/publish-smoke.sh` quote the old warning line. Those
quotes are verbatim records of past CI runs, kept unchanged on purpose.
The smoke's boot-failure predicate does not key on this line, and
neither does the new wording.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01VF48aw8RPG6wzDnMgp6rtw)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 15cd10f commit 5803f41
6 files changed
Lines changed: 238 additions & 9 deletions
File tree
- .changeset
- packages/cli
- src
- commands
- utils
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
231 | 259 | | |
232 | 260 | | |
233 | 261 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| |||
5066 | 5067 | | |
5067 | 5068 | | |
5068 | 5069 | | |
5069 | | - | |
| 5070 | + | |
5070 | 5071 | | |
5071 | 5072 | | |
5072 | 5073 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
297 | 366 | | |
298 | 367 | | |
299 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
171 | 180 | | |
172 | 181 | | |
173 | 182 | | |
| |||
682 | 691 | | |
683 | 692 | | |
684 | 693 | | |
685 | | - | |
686 | | - | |
687 | | - | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
688 | 697 | | |
689 | 698 | | |
690 | 699 | | |
691 | 700 | | |
692 | 701 | | |
693 | 702 | | |
694 | | - | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
695 | 706 | | |
696 | 707 | | |
697 | 708 | | |
| |||
0 commit comments