Repository navigation
feat: set meta.configKey in every module - #259
Conversation
Each module owns a top-level key of stars.config (api, broker, cache, gateway, i18n, logger, scheduledTasks, sharder, subcommandsAdvanced), typed through a StarsConfig augmentation, so options no longer have to go through the [specifier, options] tuple, which still works and wins over the key. Requires @wolfstar/kit ^0.2.0, the first version that reads configKey, and adds @wolfstar/schema as an optional peer for the augmentation. Refs #258
Architecture Inside the changed components — 1 viewComponent view — Module registrations Every plugin module now sets meta.configKey and augments StarsConfig in @wolfstar/schema. Data flow Tip Add 🪧 More tips
Thanks for using PR Lens! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out on X, Bluesky, Mastodon, Reddit or LinkedIn |
🤖 REVIEW PAUSED
This pull request is from an outside contributor. Add the
Only Wolfstar's click starts work. It adds the |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the full diff of the single commit adding meta.configKey to every module.
meta.configKeyper module: all ninesrc/module.tsfiles set a unique key and augmentStarsConfigfrom@wolfstar/schema;cache,gateway,sharderandsubcommandsAdvancedreserve their key with an empty-object type.- Dependency ranges:
@wolfstar/kitmoves to^0.2.0and@wolfstar/schema^0.9.0is added as an optional peer and devDependency in each package, plus root devDependencies for the new test. - Tests:
tests/module-config-keys.test.tsruns each module through kit'ssetupModules(key uniqueness, not built-in, options under the key reachsetup, the tuple wins, non-object key is rejected);tests/module-entries.test.tsasserts the new peer. - Docs and changeset: READMEs, JSDoc and
AGENTS.mdshow the key form first, and one minor changeset covers all nine packages and calls out the kit 0.2 requirement.
Locally, the three affected test files pass (61 tests) and pnpm lint reports no errors. pnpm typecheck only fails on unbuilt workspace dependencies (@wolfstar/plugin-cache not resolvable without a prior build), with no errors in any module.ts.
claude-sonnet-5-5 | 𝕏
@wolfstar/plugin-api
@wolfstar/plugin-broker
@wolfstar/plugin-cache
@wolfstar/plugin-gateway
@wolfstar/plugin-i18next
@wolfstar/plugin-logger
@wolfstar/plugin-scheduled-tasks
@wolfstar/plugin-sharder
@wolfstar/plugin-subcommands-advanced
commit: |

🔗 Linked issue
Refs #258
🧭 Context
A module's options currently go through the
[specifier, options]tuple inmodules, so the list that installs modules also carries their configuration.@wolfstar/kit0.2 can read a module's options from its own top-levelstars.configkey (meta.configKey), but none of the modules here set one.The two shared packages named in the issue (
shared-http-pieces,shared-influx-pieces) live instars-componentsand get a separate PR there, so this one does not close the issue.📚 Description
Every module in
packages/now setsmeta.configKeyand types it indefineConfigby augmentingStarsConfigfrom@wolfstar/schema. Options written under the key are merged over the module's defaults, and the tuple, which still works, is merged over the key and wins.plugin-apiapiplugin-brokerbrokerplugin-cachecacheplugin-gatewaygatewayplugin-i18nexti18nplugin-loggerloggerplugin-scheduled-tasksscheduledTasksplugin-shardersharderplugin-subcommands-advancedsubcommandsAdvancedcache,gateway,sharderandsubcommandsAdvancedtake no options yet, so their key only reserves the name and is typed as an empty object. I included them to keep the convention uniform. What sits under a key still ends up in the built entry, so it has to be JSON. Forbrokerthat excludesredis, which stays inClientOptions.broker.Departures from the Pullfrog plan:
@wolfstar/schema(^0.9.0) is added as an optional peer and devDependency of each package, because thedeclare module "@wolfstar/schema"augmentation does not resolve from the package otherwise. The plan did not mention it.^0.2.0, the first version that readsconfigKey. A project on kit 0.1 has to update it, which the changeset calls out.@wolfstar/kitand@wolfstar/schemaas root devDependencies.Key changes
meta.configKeyand theStarsConfigaugmentation in eachsrc/module.ts.@wolfstar/kitto^0.2.0and@wolfstar/schemaas an optional peer in the nine packages.tests/module-config-keys.test.tsruns every module through kit'ssetupModules: keys are unique and not built-in, options under a key reachsetup, and the tuple wins.AGENTS.mdlists the keys and the kit requirement.Type of Change
Pre-flight Checklist
pnpm changeset(orpnpm changeset add --emptyif no release is needed). See .changeset/README.md.