feat: extend mode footgun warning to a shadowed region (#49) - #51
Open
jkas2016 wants to merge 1 commit into
Open
feat: extend mode footgun warning to a shadowed region (#49)#51jkas2016 wants to merge 1 commit into
jkas2016 wants to merge 1 commit into
Conversation
The shadow detection in resolveConfig only checked `bucket`. If a user supplied only HOSTDOC_REGION / --region at higher precedence than a config-file `domain`, that region was equally ignored for mode selection yet no warning fired. Trigger the warning on a shadowed bucket OR region (single message even when both are shadowed), and generalize the wording to name both s3-website fields. Closes #49
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.
Summary
Extends the mode-derivation footgun warning (from #39/#48) to cover a shadowed region, not just a shadowed bucket.
resolveConfig's shadow detection only checkedbucket: if a user leftbucketin the config file but supplied onlyHOSTDOC_REGION/--regionat higher precedence than the file'sdomain, that region was equally ignored for mode selection yet no warning fired. This closes that asymmetry.Changes
src/lib/config.ts— trigger the warning onbucketS.level < domainS.levelORregionS.level < domainS.level. Single message even when both are shadowed. Wording generalized to name both s3-website fields.test/config.test.ts— region-only shadow → 1 warning; bucket+region both shadowed → still 1 warning (dedup); existing no-warning cases unchanged.Verification
npx vitest run test/config.test.ts→ 33/33 passnpm run typecheckcleanHOSTDOC_REGIONenv → warning on stderr; pure cloudfront (no higher-precedence override) → no warning.Non-goals
--modebehavior.domain/distributionId-direction detection (intentional override; single-direction<preserved).Closes #49
🤖 Generated with Claude Code