feat: fail loud on unresolvable preset in all three resolvers (#179)#196
Open
brandon-behring wants to merge 1 commit into
Open
feat: fail loud on unresolvable preset in all three resolvers (#179)#196brandon-behring wants to merge 1 commit into
brandon-behring wants to merge 1 commit into
Conversation
An unset preset silently became 'minimal': resolvePreset console.warn'd, defineBookConfig assumed it for an empty/preset-less style chain, and validate defaulted its whole check profile. A book whose .env never reached CI built the wrong profile — wrong schemas, wrong routes, no KaTeX — with zero signal, and validate's profile-gated checks silently didn't run. All three now throw/exit with the exact remediation and the valid-preset list, citing the old behavior. Same silent→loud conversion as the Theorem kind change (v4.14.3, #121). - types.ts resolvePreset: unset → BookConfigError (invalid already threw) - config.ts: empty chain and preset-less chain get distinct remediations - validate.mjs: exhausted resolution → exit 1 with remediation - the two bare defineBookSchemas() fixtures made explicit (they leaned on package.json script env); schemas-entry JSDoc example updated - validate-root tests: 16 preset-less spawns made explicit (--preset minimal — their prior effective profile); new unset→error test - new tests/resolve-preset.test.mjs (8 cases). Suite 524 -> 533 Generated with Claude Code Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RAZxPcnVjkwv7nhYMxgKQE
This was referenced Jul 2, 2026
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.
Fixes #179. Converts the silent
'minimal'fallback into a thrownBookConfigError(or validate exit 1) with exact remediation text, in all three resolution paths —resolvePreset(schemas),defineBookConfig's composed chain, andvalidate.mjs's inline resolver — so the change is coherent rather than one-path-deep.Blast radius audited before the change: every in-repo surface sets the preset explicitly (demo, all 6 fixtures — the two bare
defineBookSchemas()fixtures are made explicit in this PR); scaffolded consumers all have the create-book-written.env. The 16 validate tests that silently ran underminimalnow say so explicitly (--preset minimal), preserving their exact prior semantics; the two #20.env-source tests are untouched.Semver: minor with a CHANGELOG migration block at release (house precedent: #121/v4.14.3 shipped silent→loud as a patch). Suite 524 → 533; both loud errors observed on a deliberate unset-preset build.
Closes #179.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RAZxPcnVjkwv7nhYMxgKQE