Skip to content

feat(config): add defaults to configKeys entries - #30

Merged
kboshold merged 6 commits into
mainfrom
feat/config-key-defaults
Oct 20, 2026
Merged

kboshold merged 6 commits into
mainfrom
feat/config-key-defaults

Conversation

@kboshold

Copy link
Copy Markdown
Member

What

  • A configKeys entry can now carry a default next to its type:

    "configKeys": {
      "features.prisma": { "type": "boolean", "default": true },
      "ci.lint": "boolean"
    }

    When the consumer config leaves the path unset, the default is used in directive conditions, enabledBy and placeholders. A value the config sets wins, including false, "" and [].

  • The default has to match type, and object keys 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, init and upgrade (including --dry-run) apply the defaults. upgrade takes them from the payload it installs.

  • pnpm-lock.yaml now 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.prisma would 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.

@kboshold
kboshold merged commit bf6abad into main Oct 20, 2026
8 checks passed
@kboshold
kboshold deleted the feat/config-key-defaults branch October 20, 2026 08:55
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.

1 participant