fix(cli): build asks before scaffolding a config - #27
Merged
Conversation
… silently `lectio build` no longer writes a docs.config.ts on its own when none exists — it prompts when interactive and errors in CI, so a build never mutates the repo by surprise. `lectio dev` still auto-scaffolds, as the try-it-out on-ramp. Refines the still-unpublished lectio dev feature (updates its changeset). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the lectio CLI so that build no longer silently scaffolds docs.config.ts when missing, making CI/non-interactive builds deterministic while preserving dev as a zero-config on-ramp. Also updates the 0.2.0 changeset text to match the refined behavior.
Changes:
- Make
lectio devcontinue to auto-scaffolddocs.config.tswhen missing. - Make
lectio buildprompt before scaffolding in interactive sessions and error in non-TTY/CI. - Update the changeset description to reflect the new
buildbehavior.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/site-builder/bin/lectio.mjs | Adds interactive prompting/error behavior for missing config in build, while keeping dev auto-scaffolding. |
| .changeset/lectio-dev.md | Updates release notes to accurately describe the refined scaffolding behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
lectio buildno longer writes adocs.config.tson its own when none exists:Create a starter docs.config.ts? [y/N]lectio devstill auto-scaffolds — it's the try-it-out on-ramp.Why
A
build(often in CI) silently writing a config and building**/*.mdacrossthe whole tree is surprising and can produce a wrong site. Consent-first keeps
builddeterministic.Note
This refines the still-unpublished
lectio devfeature (#25, releasing as 0.2.0via the pending version PR #26) and updates its changeset text — so 0.2.0 ships
with the corrected behavior and an accurate changelog.
Verified
buildno config, non-TTY → errors, writes nothingbuildwith config → unchangeddevno config → auto-scaffolds + serves