|
| 1 | +# BASE/CLI — tracked follow-ups (2026-07-11) |
| 2 | + |
| 3 | +Surfaced by the BASE/CLI closing review. These are **not** blockers for closing |
| 4 | +the CRM task — the DONE criteria are met (see the review summary). They are the |
| 5 | +robustness/cleanup gaps we consciously deferred. Each is independently shippable |
| 6 | +as its own PR (do not bundle — separate concerns). |
| 7 | + |
| 8 | +The task-closing PR fixed only the two "truthful failure" defects: |
| 9 | +- CI `gen:versions --check` gate made real (wrong `--filter` name + step ordered |
| 10 | + after `pnpm build`, which regenerated the file before the check could see drift). |
| 11 | +- `press build` now surfaces the subprocess's real exit code (`SubprocessError` |
| 12 | + in `util/run.ts` + `bin/press.ts`), matching `dev.ts`. |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +## 1. End-to-end + orchestration tests |
| 17 | + |
| 18 | +**Gap.** The two most important commands — `devCommand` (`packages/web/src/commands/dev.ts`) |
| 19 | +and `buildCommand` (`build.ts`) — have **no direct tests**. Their primitives |
| 20 | +(`waitForReadyOrExit`, `watchSchema`, `materialize`, `run`) are well covered, but |
| 21 | +the orchestration itself (6-step boot sequence, `killAll`, SIGINT/SIGTERM |
| 22 | +handlers, the `cms.exit`/`web.exit` race, the `shuttingDown` flag) is validated |
| 23 | +only by manual `pnpm dev` dogfooding. Likewise, `@ogs-tech/create-press` has no |
| 24 | +test that runs the **published binary** (`bin/create-press.js` → `dist/cli.js` → |
| 25 | +real `pnpm install`); `scaffold()` is tested in isolation and only exercised from |
| 26 | +TS source via `scripts/create-playground.ts`. |
| 27 | + |
| 28 | +**Do.** |
| 29 | +- Unit-level orchestration tests for `dev.ts`/`build.ts` by injecting a spawn/`run` |
| 30 | + seam (mock children like `wait-for-ready-or-exit.test.ts`'s `FakeChild`): assert |
| 31 | + the boot order, that a cms crash aborts before booting web, that SIGINT exits 0, |
| 32 | + and that an unexpected child exit re-exits with its real code. |
| 33 | +- A Playwright/e2e smoke (already named as planned in the root README): scaffold a |
| 34 | + temp project via the built binary, `press dev`, assert `:1337` + `:3000` serve |
| 35 | + and `shared/types/generated.ts` is written. |
| 36 | + |
| 37 | +**Acceptance.** `dev.ts`/`build.ts` have coverage; a CI smoke boots a scaffolded |
| 38 | +project end-to-end. |
| 39 | + |
| 40 | +## 2. Documentation drift + dead code |
| 41 | + |
| 42 | +**Gap.** |
| 43 | +- **`press.config.ts` naming.** CLAUDE.md and the README describe build-time |
| 44 | + anchors as living in `press.config.ts` at the repo root, but the scaffold emits |
| 45 | + `packages/web/config.ts` (its header comment even says `// press.config.ts`). |
| 46 | + No generated file is literally named/located `press.config.ts`. There is also a |
| 47 | + stray `press.config.ts` at this monorepo's root with no functional link to the |
| 48 | + CLI. Harmless, but it misleads anyone auditing literally. |
| 49 | +- **`VERSIONS.pressCli` dead field.** Computed and tested in `compute-versions.ts` |
| 50 | + but never consumed by `scaffold.ts` (a scaffolded project never depends on |
| 51 | + `@ogs-tech/create-press`, by design). |
| 52 | +- **Stale `packages/cli/dist/`.** Contains artifacts from a prior architecture |
| 53 | + (`dist/commands/{dev,build,deploy}.js`, `dist/materialize.js`, …) with no `src/` |
| 54 | + counterpart. `dist/` is gitignored so publish is unaffected, but it confuses a |
| 55 | + manual `node bin/create-press.js` without a fresh rebuild. |
| 56 | + |
| 57 | +**Do.** Reconcile the docs to the real path (or rename the emitted file — decide |
| 58 | +which is canonical); drop `pressCli` from `ScaffoldVersions` (or wire it if a use |
| 59 | +appears); note that `dist/` must be rebuilt before manual bin inspection. |
| 60 | + |
| 61 | +**Acceptance.** Docs match the scaffold output; no computed-but-unused version field. |
| 62 | + |
| 63 | +## 3. Derive `NEXT_PIN` instead of hardcoding |
| 64 | + |
| 65 | +**Gap.** `compute-versions.ts:41` hardcodes `NEXT_PIN = '^15.1.0'` — the only |
| 66 | +scaffold pin not derived from a real manifest (react/strapi come from engine |
| 67 | +`devDependencies`; the follow-up is already noted in-code). `@ogs-tech/press-web` |
| 68 | +declares only an open `next: '>=15'` peer range, useless as a pin. |
| 69 | + |
| 70 | +**Do.** Add `next` to `@ogs-tech/press-web` `devDependencies` (the version the |
| 71 | +engine is actually tested against) and derive the pin via `requireDevDep`, exactly |
| 72 | +like react/strapi. Removes the last manual knob and closes the drift loop for Next. |
| 73 | + |
| 74 | +**Acceptance.** `computeVersions` derives `next` from a manifest; no `NEXT_PIN` |
| 75 | +constant. |
0 commit comments