feat(targets): pluggable codegen target API#134
Merged
Conversation
Defines data-driven assertion tables for all 11 stress schemas to verify pipeline fidelity (introspection types, component mapping, constraints) and generated JSX correctness (nested paths, imports, structural patterns). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Detailed task-by-task plan for expanding stress.spec.ts with assertion tables for all 11 schemas, covering introspection fidelity, component mapping, and generated JSX structure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pipeline becomes Introspect (universal) -> Target (owns mapping + output). CodegenTarget interface lets kelex target any framework/format. Ships with react-tanstack (default, wraps existing templates) and composite (JSON). CLI gains --target flag and `kelex targets` subcommand. Generator accepts target + targetOptions while preserving backwards-compatible code/primitives fields on GenerateResult. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
registerTarget() now throws if target name already exists unless
{ force: true } is passed. Added unregisterTarget() for cleanup.
Registry tests use afterEach to remove custom targets.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove intermediate variables and restating comments. Use satisfies for type-safe inline option construction. Move interface declaration before first usage in CLI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CLI now validates that target-produced filenames resolve within the output directory. unregisterTarget() throws when called on built-in targets (react-tanstack, composite). Renamed internal map from builtinTargets to targets for clarity. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove index signature from TargetOptions (enables excess property checking on all option subtypes) - Non-empty tuple for TargetResult.files (compile-time guarantee) - Template literal for defaultExtension (catches missing dot) - Per-file write error context in CLI - Fix stale JSDoc on deriveOutputPath, code, and primitives fields - Add tests for targetOptions passthrough and backwards-compat shims Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace single-assertion module check with per-module export verification covering codegen, introspection, mapping, schema-writer, and target functions/built-in targets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Expand index.test.ts to verify every public function and built-in target is exported. Add biome override to skip a11y rules and formatting on test fixtures (generated code, not hand-authored). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Primary output file uses the user-specified -o path; auxiliary files (primitives) use target-generated names in the same directory. Add CLI spec tests for `kelex targets` listing and --target unknown error. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace button+role="checkbox" with native <input type="checkbox">. Replace button+role="radio" with native <input type="radio">. Use <span> for Field label (form lib handles association). Add aria-hidden to decorative SVGs. Revert biome override -- fix the code, not the rules. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Migrate from @ezmode-games/kelex to @rafters-studio/kelex. Update package name, repository URL, homepage, README references, and changeset. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts: # .changeset/initial-release.md # package.json
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.
Summary
CodegenTargetinterface so kelex can target any framework/formatreact-tanstack(default, wraps existing templates) andcomposite(FormDescriptor -> JSON)--targetflag andkelex targetssubcommandcode/primitivesfields onGenerateResultTest plan
pnpm typecheckcleanpnpm lintclean (only pre-existing a11y issues in test fixtures)kelex generate schema.ts --target react-tanstacksame output as beforekelex generate schema.ts --target compositeproduces valid JSONkelex targetslists available targets🤖 Generated with Claude Code