Repository navigation
feat(config): add defaults to configKeys entries - #30
Merged
Merged
Conversation
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
A
configKeysentry can now carry a default next to its type:When the consumer config leaves the path unset, the default is used in directive conditions,
enabledByand placeholders. A value the config sets wins, includingfalse,""and[].The default has to match
type, andobjectkeys take none. A child preset can override a parent's default, or remove it by redeclaring the key with the bare type.Defaults need manifest
schemaVersion: 5. CLI 0.5.0 rejects the object form when it loads the preset, so a payload using defaults fails loudly on an older CLI instead of rendering without them.sync,check,status,initandupgrade(including--dry-run) apply the defaults.upgradetakes them from the payload it installs.pnpm-lock.yamlnow records the directives test fixture added in 0.5.0.Why
A missing config value counts as false. A payload that wraps content every repo has today, say a Prisma step, in
# streamctl:if features.prismawould drop that content in every repo that doesn't set the key yet.Setting the default in the payload's config wrapper doesn't cover
upgrade. The config is evaluated before the install, with the wrapper that was installed before, and reloading it after the install still gets the old module because Node caches ESM imports for the rest of the process. Defaults in the manifest are read from the installed payload, so the upgrade run already sees them.