Skip to content

chore: setup logger facade#7928

Merged
y-lakhdar merged 32 commits into
mainfrom
logger-facade
Jul 8, 2026
Merged

chore: setup logger facade#7928
y-lakhdar merged 32 commits into
mainfrom
logger-facade

Conversation

@y-lakhdar

@y-lakhdar y-lakhdar commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Log facade over @clack/prompts

New log.ts wraps clack's output helpers (info/step/success/warn/error/note). Business logic imports log, never @clack/prompts directly.

ADR 003 §3 draws the line at solicit vs. emit: clack's styled output is fair game everywhere, but prompts stay confined to prompt.ts. An oxlint no-restricted-imports rule guards this. Only log.ts and prompt.ts may import the toolkit.

Bonus

Also extracts resolveInputs and resolveTemplate from main. This makes the ADR 003 two-phase boundary a named, visible seam in the code: resolveInputs returns a fully resolved ScaffoldOptions object (the interactive phase), then scaffold consumes it (execution phase). Keeps the boundary harder to accidentally erode as the code grows.

y-lakhdar added 29 commits June 26, 2026 12:07
Adds interactive template + project-name selection when args are omitted, graceful Ctrl-C handling, a gated end-to-end test (scaffold -> install -> build), the README, and the release changeset.
@y-lakhdar y-lakhdar marked this pull request as ready for review July 6, 2026 16:05
@pkg-pr-new

pkg-pr-new Bot commented Jul 6, 2026

Copy link
Copy Markdown
@coveo/atomic

npm i https://pkg.pr.new/@coveo/atomic@7928

@coveo/atomic-hosted-page

npm i https://pkg.pr.new/@coveo/atomic-hosted-page@7928

@coveo/atomic-legacy

npm i https://pkg.pr.new/@coveo/atomic-legacy@7928

@coveo/atomic-react

npm i https://pkg.pr.new/@coveo/atomic-react@7928

@coveo/auth

npm i https://pkg.pr.new/@coveo/auth@7928

@coveo/bueno

npm i https://pkg.pr.new/@coveo/bueno@7928

@coveo/create-atomic

npm i https://pkg.pr.new/@coveo/create-atomic@7928

@coveo/create-atomic-component

npm i https://pkg.pr.new/@coveo/create-atomic-component@7928

@coveo/create-atomic-component-project

npm i https://pkg.pr.new/@coveo/create-atomic-component-project@7928

@coveo/create-atomic-result-component

npm i https://pkg.pr.new/@coveo/create-atomic-result-component@7928

@coveo/create-atomic-rollup-plugin

npm i https://pkg.pr.new/@coveo/create-atomic-rollup-plugin@7928

@coveo/headless

npm i https://pkg.pr.new/@coveo/headless@7928

@coveo/headless-react

npm i https://pkg.pr.new/@coveo/headless-react@7928

@coveo/shopify

npm i https://pkg.pr.new/@coveo/shopify@7928

commit: b71444d

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🔗 Scratch Orgs ready to test this PR:

alexprudhomme
alexprudhomme previously approved these changes Jul 6, 2026
Base automatically changed from feat/create-ui-3-cli to main July 6, 2026 17:14
@y-lakhdar y-lakhdar dismissed alexprudhomme’s stale review July 6, 2026 17:14

The base branch was changed.

Copilot AI review requested due to automatic review settings July 6, 2026 18:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a logging facade for the @coveo/create-ui CLI so “business logic” emits output via a local log wrapper instead of importing @clack/prompts directly, and refactors main into an explicit “resolve inputs” phase followed by the execution phase.

Changes:

  • Added packages/create-ui/src/log.ts as a facade over @clack/prompts output helpers and removed the ad-hoc log from utils.ts.
  • Refactored main to use resolveTemplate + resolveInputs, and changed scaffold to accept a ScaffoldOptions object.
  • Added an oxlint no-restricted-imports override to prevent @clack/prompts imports outside log.ts and prompt.ts, and updated tests to capture stdout writes.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/create-ui/src/utils.ts Removes the legacy console-based log helper.
packages/create-ui/src/log.ts Adds the log facade that delegates to @clack/prompts output helpers.
packages/create-ui/src/index.ts Uses the new log facade and introduces a two-phase resolveInputsscaffold flow.
packages/create-ui/src/index.test.ts Updates tests to capture CLI output via process.stdout.write.
.oxlintrc.json Adds restricted-imports rules to enforce the “prompt vs emit” boundary.

Comment thread .oxlintrc.json
@y-lakhdar y-lakhdar added this pull request to the merge queue Jul 8, 2026
Merged via the queue into main with commit 9af94f3 Jul 8, 2026
80 checks passed
@y-lakhdar y-lakhdar deleted the logger-facade branch July 8, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants