refactor: pass publish overrides to resolveConfig without re-listing (#50) - #52
Open
jkas2016 wants to merge 1 commit into
Open
refactor: pass publish overrides to resolveConfig without re-listing (#50)#52jkas2016 wants to merge 1 commit into
jkas2016 wants to merge 1 commit into
Conversation
…50) runPublish hand-listed every Overrides field when building the object it passed to resolveConfig. Each new Overrides field had to be added there too, and forgetting silently dropped it in publish only — exactly the footgun that hid the `--mode` bug fixed in #48. Redefine PublishArgs as `{ path; slug?; title?; force?; dryRun?; profile? } & Overrides` and pass `args` straight to resolveConfig (which reads only the Overrides keys), matching how open/rm/list already thread overrides. Single source of truth, no second sync point. Add command-level threading coverage (publish/open/rm/list) so a dropped override field is caught at the command layer, not just in resolveConfig unit tests. Closes #50
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
Removes the manual override re-listing in
runPublishthat caused the--modefootgun caught pre-release in #48, and adds command-level threading coverage.Every command except
publishalready passes itsargs/flagsstraight toresolveConfig(which reads onlyOverrideskeys and ignores extras).runPublishalone hand-listed each field, so a newOverridesfield had to be added in a second place — forgetting it silently drops the field inpublishonly.Changes
src/commands/publish.ts—PublishArgsredefined as{ path; slug?; title?; force?; dryRun?; profile? } & Overrides;runPublishpassesargsdirectly toresolveConfig. Net −11 lines, single source of truth.resolveConfig-unit-only):test/publish.test.ts—--bucketoverride reaches the URLtest/open.test.ts— bucket/region overrides reach the URLtest/list.test.ts— region override reaches row URLstest/rm.test.ts— domain/distribution overrides derive cloudfront (invalidation fires)Verification
npm run typecheckcleannpx vitest run— all pass except the pre-existingskill.test.tspreflight case that is environment-dependent (fails identically onmain; it asserts "No AWS credentials", which is false on a machine that has AWS creds — CI has none so it passes there)publish --dry-run --bucket override-b --region eu-west-1→http://override-b.s3-website-eu-west-1.amazonaws.com/...;--mode s3-websiteover a cloudfront env still forces s3-website.Non-goals
resolveConfigderivation/warning logic.Closes #50
🤖 Generated with Claude Code