feat(codegen): add config command, helpers.ts generation, and collision handling#802
Merged
pyramation merged 1 commit intomainfrom Mar 13, 2026
Conversation
…on handling Phase 2 of credential management and config system: - Add config to BuiltinNames interface with collision handling (renames to 'vars' if target named 'config') - Generate helpers.ts with typed per-target client factories using 3-tier credential resolution - Generate config command (get/set/list/delete) wired to appstash store.getVar/setVar/deleteVar/listVars - Update command map generator to include config built-in command - Update appstash dependency to ^0.6.0 - Add comprehensive tests for new functionality (59 tests passing) Builds on appstash@0.6.0 (published via constructive-io/dev-utils#70)
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
4 tasks
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.
feat(codegen): add config command, helpers.ts generation, and collision handling
Summary
Phase 2 of the credential management and config system (builds on appstash@0.6.0, published via constructive-io/dev-utils#70).
Adds three capabilities to the constructive codegen:
config get/set/list/deletecommands wired to appstash's per-context key-value storecreateAuthClient(),createMembersClient(), etc.) with 3-tier credential resolution (store → env vars → throw)BuiltinNamespattern to handleconfigcollisions (renames tovarsif a target is namedconfig)Key Files
config-command-generator.ts— Babel AST generator for config commandhelpers-generator.ts— Babel AST generator for helpers.ts with typed client factoriesindex.ts— wires new generators, updatesresolveBuiltinNames()for config collisioncommand-map-generator.ts— includes config in command map and usageconfig.ts(types) — addsconfig?: stringtoBuiltinNamesinterfacepackage.jsonfiles — appstash ^0.5.0 → ^0.6.0Review & Testing Checklist for Human
createConfigStore,ClientConfig,getClientConfigfromappstash. Double-check these exports exist in appstash@0.6.0 (published in dev-utils#70)constructive config set foo bar,constructive config get foo,constructive config list,constructive config delete fooagainst a real generated CLI to verify store integration workscreateAuthClient()from the generated helpers in a TS script and verify it creates a working client with proper credential resolution../../generated/{target}/orm. Verify this path matches your actual project structuregenerateMultiTargetCligenerates config/helpers. If single-target CLIs also need these, that's a gapNotes
pg-env,@pgpmjs/core, etc.) unrelated to these changesString.call(undefined, value)pattern in the set handler — this works but is an artifact of Babel AST generation and could be simplified toString(value)Link to Devin Session: https://app.devin.ai/sessions/6f16c8a57231488085f04a68be7d599b
Requested by: @pyramation