feat(codegen): add docs generation for ORM, React Query, and multi-target support#728
Merged
pyramation merged 5 commits intomainfrom Feb 19, 2026
Merged
Conversation
- Add cli config option (CliConfig | boolean) to GraphQLSDKConfigTarget - Add komoji dependency for toKebabCase casing - Create CLI generator orchestrator (cli/index.ts) - Create arg-mapper: converts CleanTypeRef to inquirerer Question[] - Create infra-generator: context + auth commands via Babel AST - Create executor-generator: ORM client init with appstash credentials - Create table-command-generator: per-table CRUD using ORM methods - Create custom-command-generator: per-operation using ORM methods - Create command-map-generator: command registry (Record<string, Function>) - Wire CLI generation into generate.ts alongside ORM/React Query - Update root barrel to include CLI exports Architecture: CLI -> ORM -> GraphQL (not CLI -> raw GraphQL) CLI commands: prompt for args -> call ORM method -> print JSON result Uses appstash@0.4.0 config-store for context/credential management
- Add cli-generator.test.ts with 13 tests covering all generated files - Snapshot executor, context, auth, table commands, custom commands, command map - Verify ORM method calls in table and custom commands - Verify appstash config-store usage in executor - Fix: runOrm now includes runCli so ORM is auto-enabled when CLI is enabled
- Add docs-generator.ts that produces README.md (overview, setup, commands) and COMMANDS.md (man-page style reference with synopsis, options, examples) - Wire into CLI orchestrator so docs are always generated alongside commands - Update snapshot tests: 15 tests, 10 snapshots covering all generated files
…CP, Skills)
- Add DocsConfig interface: { readme, agents, mcp, skills } with boolean flags
- Defaults: readme + agents on, mcp + skills opt-in. docs: true enables all.
- generateAgentsDocs(): structured AGENTS.md for LLM consumption with TOOL
sections, INPUT/OUTPUT schemas, WORKFLOWS, and ERROR HANDLING
- generateMcpConfig(): mcp.json with typed inputSchema per command (JSON Schema)
- generateSkills(): per-command .md skill files for agent systems
- Wire into cli/index.ts orchestrator with config-driven conditional generation
- 22 tests, 17 snapshots covering all formats and config combinations
…rget support - Move docs config to top-level GraphQLSDKConfigTarget (removed from CliConfig) - Create shared docs-utils.ts with common utilities - Add ORM docs generator (README, AGENTS.md, MCP tools, skills) - Add React Query hooks docs generator (README, AGENTS.md, MCP tools, skills) - Add per-target README and combined MCP config generators - Add root-root README for multi-target configs - Add generateMulti() to core for multi-target orchestration - Update CLI entry point to use core generateMulti() - Wire all docs generation into generate.ts - 32 tests, 31 snapshots covering all doc formats
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:
|
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): extend docs generation to ORM and React Query generators
Summary
Extends the docs generation system (previously CLI-only from PR #725) to also cover ORM and React Query generators. Adds multi-target orchestration (
generateMulti()) to core so the CLI entry point delegates looping rather than owning it.New files:
docs-utils.ts— shared utilities extracted from the CLI docs generator (resolveDocsConfig,fieldTypeToTs,McpTooltype)orm/docs-generator.ts— README, AGENTS.md, MCP tools, and skills for the ORM layer (~525 lines)hooks-docs-generator.ts— README, AGENTS.md, MCP tools, and skills for React Query hooks (~595 lines)target-docs-generator.ts— per-target root README, combinedmcp.json, root-root README for multi-target configsModified files:
types/config.ts—docs: DocsConfig | booleanmoved to top-levelGraphQLSDKConfigTarget(removed fromCliConfig)core/generate.ts— wires docs generation for all enabled generators after code generation; addsgenerateMulti()for multi-target configscli/index.ts(entry point) — usesgenerateMulti()instead of its own loopcli/docs-generator.ts— refactored to import shared utils fromdocs-utils.tscli/index.ts(codegen) — removed docs generation fromgenerateCli(); docs are now handled centrally ingenerate()3-level README hierarchy:
Review & Testing Checklist for Human
generateMulti()file writing approach — the root-root README is written via a dynamicimport('./output')andwriteGeneratedFiles()call to.(outside the normalfilesToWritearray flow). Verify this doesn't cause issues with pruning, path resolution, or concurrent writes in real multi-target configs.pnpm-lock.yamlhas thousands of lines changed including@types/nodeversion shifts (22 → 20) andts-nodeentry removals. Verify this was intentional or if the lockfile was regenerated in a different environment. May want to regenerate withpnpm installin a clean state.mcp.jsonat each target root includes tools from all enabled generatorsNotes
readme+agentsalways on,mcp+skillsopt-indocs: trueenables all 4 formatsdocs: falsedisables all docsLink to Devin run: https://app.devin.ai/sessions/e9c668834d394cdc8ebcb371b6ebf430
Requested by: @pyramation