Skip to content

Conversation

@mjfaga
Copy link

@mjfaga mjfaga commented Jun 10, 2025

Overview

This PR introduces a new pattern for code generation using the combination of "language mappers" and "code generators" to ensure all languages support the same interfaces while allowing for the flexibility of language specific implementation details.

The original goal of this PR was to eliminate the introduction of the zod dependency directly into react/node codebases in order to support a strongly typed interface. While accomplishing that, this PR also:

  1. Provides explicit file naming for each language variation
  2. Introduces mapping functions to ensure all languages implement the same Zod mapping support
  3. Exposes language-specific generator implementations for language flexibility and customization per language without passing language identifiers throughout the CLI architecture.
  4. Ensure generated typescript is full valid and compiles
  5. Adds union support to json schema inference
  6. Add support for array types in property navigation when mustache functions are involved.
  7. Ensures safe navigation into nested properties when using with Mustache templates
  8. Simplifies method generation through use of lodash.camelCase vs. complex custom logic
  9. Removes need for optionalRequiredAccess implementation
  10. Fixes issues with key mapping generation encoding of special characters (i.e. "234nas6234^&#$__///WHY_OH_WHY" vs. "234nas6234^&#$__///WHY_OH_WHY")
  11. Fixes issues with mustache function generation in more complex scenarios where function characters end up being url encoded
  12. Removes typing issues/usage of any with explicit type definitions
  13. Exposes types into Prefab specific namespace for explicit overriding and consumption via the Node/React prefab libraries\

@mjfaga mjfaga force-pushed the mfaga-remove-react-zod-dependency branch 4 times, most recently from d027fe0 to 2ec0857 Compare June 10, 2025 18:35
@mjfaga mjfaga requested a review from jdwyah June 10, 2025 18:35
@mjfaga mjfaga changed the title chore: update yarn version feat: implement new typescript code generators Jun 10, 2025
@mjfaga mjfaga force-pushed the mfaga-remove-react-zod-dependency branch 6 times, most recently from ae468f4 to 854e19f Compare June 13, 2025 14:31
@mjfaga mjfaga force-pushed the mfaga-remove-react-zod-dependency branch 8 times, most recently from 49a2192 to c596fc8 Compare June 16, 2025 01:58
@mjfaga mjfaga marked this pull request as ready for review June 16, 2025 02:21
@mjfaga mjfaga force-pushed the mfaga-remove-react-zod-dependency branch 2 times, most recently from af04999 to 0171ed4 Compare June 16, 2025 12:38
@mjfaga mjfaga force-pushed the mfaga-remove-react-zod-dependency branch from 0171ed4 to 15c9b1e Compare June 17, 2025 01:09
@mjfaga mjfaga merged commit 6ef338b into typesafe-improvements Jun 17, 2025
0 of 6 checks passed
@mjfaga mjfaga deleted the mfaga-remove-react-zod-dependency branch June 17, 2025 01:09
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.

4 participants