Skip to content

Conversation

@pyramation
Copy link
Collaborator

No description provided.

- Add generateTsAstCodeFromPgAstWithSchema function that uses runtime schema to determine node wrapping
- Implement field-based node type detection for complex AST structures
- Add comprehensive tests for wrapped vs unwrapped node generation
- Support correct builder paths: t.ast.*() for unwrapped nodes, t.nodes.*() for wrapped nodes
- Maintain backward compatibility with existing generateTsAstCodeFromPgAst function

Co-Authored-By: Dan Lynch <[email protected]>
- Fixed multi-field object processing in traverse() to check parent field specs
- WithClause now correctly generates t.ast.withClause instead of t.nodes.withClause
- Updated snapshot test to reflect correct expected output
- All 42 tests passing

Co-Authored-By: Dan Lynch <[email protected]>
…a system

- Remove isNode field from FieldSpec interface in runtime-schema/types.ts
- Update runtime schema generator to not include isNode in FieldSpec objects
- Remove isNode field from NodeSpec interface in both types.ts and store.ts
- Update generateRuntimeSchemaTypeScript method to match new interface
- Fix logic in generateTsAstCodeFromPgAstWithSchema to determine node wrapping by checking field type directly
- Update README documentation to reflect schema changes
- All tests now pass with the simplified schema structure

Co-Authored-By: Dan Lynch <[email protected]>
- Update 7 test snapshots in __fixtures__/output/runtime-schema/
- Remove isNode fields from all generated runtime schema outputs
- All runtime-schema tests now pass with the updated schema structure

Co-Authored-By: Dan Lynch <[email protected]>
- Include the main snapshot file that was missed in previous commit
- Complete the snapshot updates for isNode field removal

Co-Authored-By: Dan Lynch <[email protected]>
…ed from FieldSpec

- Add isNode field back to NodeSpec interface while keeping it removed from FieldSpec
- Update runtime schema generator to include isNode in NodeSpec objects
- Update TypeScript generation to reflect correct interface structure
- Regenerate all runtime schema files and test snapshots
- Maintain enhanced AST generation functionality with corrected schema

Co-Authored-By: Dan Lynch <[email protected]>
… interface and objects

- Add isNode: boolean field to NodeSpec interface in test utility file
- Add isNode: true to all NodeSpec objects to match corrected interface structure
- Resolves TypeScript compilation error in CI meta tests
- Meta tests now pass locally with updated schema structure

Co-Authored-By: Dan Lynch <[email protected]>
- Enhanced ensureCorrectExtension() method to be more robust:
  - Handle edge cases with null/empty inputs
  - Ensure expectedExt starts with dot
  - Better handling of multiple extensions (e.g., .d.ts, .spec.ts)
- Standardized all file writing methods to use ensureCorrectExtension():
  - writeTypes(), writeEnums(), writeUtilsEnums()
  - writeAstHelpers(), writeWrappedAstHelpers()
  - writeCodeToFile(), writeEnumMaps(), writeRuntimeSchema()
- Consistent extension handling for both TypeScript (.ts) and JSON (.json) files
- Updated test snapshots to reflect corrected file extension behavior
- Prevents double extension bugs (e.g., .ts.ts) across all file generation

Co-Authored-By: Dan Lynch <[email protected]>
- Remove implementation of generateTsAstCodeFromPgAst (old function without schema)
- Rename generateTsAstCodeFromPgAstWithSchema to generateTsAstCodeFromPgAst
- Update all test imports and function calls to use renamed function
- Update README documentation to reflect schema requirement
- All tests passing with updated snapshots

The function now always uses runtime schema for proper node wrapping decisions.

Co-Authored-By: Dan Lynch <[email protected]>
- Update snapshots to reflect t.nodes.* output instead of ast.* output
- Snapshots now match the schema-based function behavior

Co-Authored-By: Dan Lynch <[email protected]>
@pyramation pyramation merged commit 9c23c13 into main Jun 24, 2025
1 check passed
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.

2 participants