-
Notifications
You must be signed in to change notification settings - Fork 32
Feat/meta ast gen #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Feat/meta ast gen #160
Conversation
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
- 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]>
8cdc710 to
0ee2cf4
Compare
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.
No description provided.