Phase — Generate
Status: shipped (foundations). User docs: commands/generate, behavior / JSON.
This file is development-only (see repo .gitignore for docs/phases/).
Note: “Missing keys in source” is i18nprune missing — see commands/missing — not a generate flag.
1. Foundations — done
| Goal | Implementation |
|---|---|
--json + no prompts | Non-interactive runs require --target; throws USAGE with a clear message (packages/cli/src/commands/generate/run.ts). |
| Meta defaults | --target present → catalog-backed englishName, nativeName; direction from --direction or default ltr (mergeGenerateOptionsFromEnv + prompts when interactive). |
| Direction | --direction rtl | ltr supported; aligned with meta sidecar writes. |
Acceptance: covered by command behaviour + commands/generate.
2. Shared missing-key helper — moved
computeMissingLiteralKeys lives in packages/cli/src/core/validate/missingLiterals.ts and is used by validate and missing — not part of generate.
Optional follow-ups (implemented)
- RTL vs
--direction(warn-only): heuristic list inpackages/cli/src/core/languages/rtlHint.ts—generatewarns when a typical RTL code usesltr, or a typical LTR code uses--direction rtl(human mode only; suppressed in--json). - Reports:
generatecallspushReportEntry+finalizeReportFileon success and when skipping because the target already covers the source (aligned withfill/sync).
Planning — per-target progress summary in the final envelope
Status: Backlog (design + implementation). Today’s generate --json already returns aggregate fields (leavesProcessed, dynamicKeySites, targetResults[] with status, paths, counts). This plan tightens observability so each target has an explicit progress / outcome summary suitable for CI and agents — especially when multiple --target values are passed or when --yes forces a re-generate (no parity skip).
Goals
| Goal | Description |
|---|---|
| Per-target summary | For each entry in targetResults[] (or equivalent), include a progress summary block that reflects work done for that target only: e.g. leaves touched, preserved, skipped-with-reason, parity skip vs forced rewrite, timing (startedAt / durationMs optional), and any warning-level issues scoped to that target. |
| Multi-target runs | If --target a,b,c, the single stdout CliJsonEnvelope remains one document; data.targetResults (or nested structure) carries one summary object per target, in stable order (same as argv / catalog order), so integrators can slice by target without scraping logs. |
Forced re-generate (--yes) | When --yes causes a full pass (no parity short-circuit), each affected target’s row must still expose progress-style fields (not only “written”) — e.g. confirm re-generation was applied and record the same counters as a cold write, so automation can distinguish skip vs rewrite vs error. |
| Human vs JSON | Human mode may keep or extend the existing banner + logger story; --json must encode the same per-target facts in data (see JSON output, json-long). |
Non-goals (this planning slice)
- Per-leaf translation traces in the envelope (still report/report-file territory unless explicitly added later).
- Changing
oksemantics: envelope-level success remains overall command success; per-target failures should betargetResults[].status/issues[]with stable codes, consistent with currentgeneratebehavior.
Schema direction (illustrative)
Exact field names belong in packages/cli/src/types/command/generate/json.ts (or equivalent). Conceptually each targetResults[i] may grow:
progress:{ leavesWritten?, leavesPreserved?, paritySkipped?, forcedRegenerate?, durationMs?, ... }— align names withfill/syncwhere concepts overlap.issues(optional): target-scoped warnings, or continue to fold into top-levelissues[]withtarget/localemetadata — pick one approach and document it in commands/generate.
Acceptance (when implementing)
- Fixture or integration test:
--targetwith ≥2 locales shows distinct per-target summary fields indata. -
--yespath: when parity would have skipped but--yesforces work,targetResultsreflects forced run with non-zero progress counts where applicable. - Docs: commands/generate, json README row for
generate, and this file — no drift between example JSON and runtime.
See also
- CLI roadmap handoff —
fillmust get the sametargetResults/ progress / identity-streak behavior asgenerate - phases README
- missing.md
- validate.md