docs: add CLI Interactivity ADR#7927
Conversation
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Pull request overview
Adds ADR 003 documenting the intended interactivity boundary for @coveo/create-ui, aiming to keep prompting strictly separated from execution logic to preserve scriptability and testability.
Changes:
- Introduces a new ADR describing a two-phase CLI model (resolve inputs first, then execute).
- Defines one-way flow constraints between prompting and business logic, including a “no wizard” litmus test.
- Documents how state-dependent decisions must be resolved before execution begins.
| ### 2. The interactive layer and business logic communicate one way only | ||
|
|
||
| Data and control flow in a single direction: | ||
|
|
||
| `flags / prompts → resolved options object → execution` | ||
|
|
||
| Business logic never calls back into the interactive layer. There is no point at which execution pauses to ask a question, and no prompt whose answer selects which execution step runs next. The rejected alternative is the wizard / flow-diagram model that hurt the previous CLI: |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@coveo/atomic
@coveo/atomic-hosted-page
@coveo/atomic-legacy
@coveo/atomic-react
@coveo/auth
@coveo/bueno
@coveo/create-atomic
@coveo/create-atomic-component
@coveo/create-atomic-component-project
@coveo/create-atomic-result-component
@coveo/create-atomic-rollup-plugin
@coveo/headless
@coveo/headless-react
@coveo/shopify
commit: |
|
|
||
| ## Context | ||
|
|
||
| `@coveo/create-ui` (`npm create @coveo/ui`) scaffolds a project from the official samples (see [ADR 001](./001-sample-consumption.md), [ADR 002](./002-sample-publishing.md)). Two inputs drive a run: the **template** and the **project name**. When both are supplied as flags/arguments the CLI runs unattended; when one is missing the CLI offers a small menu to pick it — the interactive selection [ADR 001](./001-sample-consumption.md) §7 left as "planned." |
| Data and control flow in a single direction: | ||
|
|
||
| `flags / prompts → resolved options object → execution` |
There was a problem hiding this comment.
👍 I'll add another "flow" to explain how we think about it architecturally:
feature/requirement -> executionCode -> executionOption -> flags/prompt
i.e. "a new requirement comes, we add the code path in the execution, if the feature is optional, we add the optionality on the entrypoint of the execution layer, and map a flag or prompt to the option"
This can be an interesting "thought model" to keep in mind for the addition of new functionnalities.
ADR 003 — CLI Interactivity
Records the interactivity boundary for
@coveo/create-ui:@clack/promptsconfined tolog.ts(output facade) andprompt.ts(input). An oxlintno-restricted-importsrule guards the boundary.Motivated by the previous Coveo CLI, where interleaved prompts tangled business logic and made testing painful.