Skip to content
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

refactor(queries): Split schema.ts for maintainability #27258

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Twixes
Copy link
Member

@Twixes Twixes commented Jan 3, 2025

Problem

schema.ts has been growing without bounds as a monolith, like types.ts has for even longer. This has been necessary, as ts-json-schema-generator didn't support export * from ..., so we couldn't split the file. Until ts-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 messages
schema/schema-assistant-queries.ts – AI assistant-tuned queries
schema/schema-general.ts – basically all the regular queries and their building blocks
schema/type-utils.ts - common util types that don't need to be rendered into Python as their own types
schema/index.ts - export *s of the above for Python translation, except utils

How did you test this code?

All existing tests should continue to pass.

@Twixes Twixes requested review from thmsobrmlr and skoob13 January 3, 2025 21:39
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.

1 participant