refactor(queries): Split schema.ts for maintainability #27258
+3,104
−2,886
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.
Problem
schema.ts
has been growing without bounds as a monolith, liketypes.ts
has for even longer. This has been necessary, asts-json-schema-generator
didn't supportexport * from ...
, so we couldn't split the file. Untilts-json-schema-generator
2.2.0, which has added support for wildcard export. Now we have the technology to split the schema into sensible chunks.Changes
Proposing we split
schema.ts
into:schema/schema-assistant-messages.ts
– AI assistant messagesschema/schema-assistant-queries.ts
– AI assistant-tuned queriesschema/schema-general.ts
– basically all the regular queries and their building blocksschema/type-utils.ts
- common util types that don't need to be rendered into Python as their own typesschema/index.ts
-export *
s of the above for Python translation, except utilsHow did you test this code?
All existing tests should continue to pass.