Skip to content

feat: extend mode footgun warning to a shadowed region (#49) - #51

Open
jkas2016 wants to merge 1 commit into
mainfrom
fix/49-region-shadow-warning
Open

feat: extend mode footgun warning to a shadowed region (#49)#51
jkas2016 wants to merge 1 commit into
mainfrom
fix/49-region-shadow-warning

Conversation

@jkas2016

Copy link
Copy Markdown
Owner

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 checked bucket: if a user left bucket in the config file but supplied only HOSTDOC_REGION / --region at higher precedence than the file's domain, that region was equally ignored for mode selection yet no warning fired. This closes that asymmetry.

Changes

  • src/lib/config.ts — trigger the warning on bucketS.level < domainS.level OR regionS.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 pass
  • npm run typecheck clean
  • Real CLI path (dev mode): cloudfront file config + HOSTDOC_REGION env → warning on stderr; pure cloudfront (no higher-precedence override) → no warning.

Non-goals

  • No change to forced --mode behavior.
  • No domain/distributionId-direction detection (intentional override; single-direction < preserved).

Closes #49

🤖 Generated with Claude Code

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] mode footgun 경고를 region-only override까지 확장 (#39 후속)

1 participant