-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Automatically generate roo-code.d.ts (including type generation via zod-to-ts)
#2024
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
Conversation
🦋 Changeset detectedLatest commit: 47f1e60 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The pull request is quite large, with 30 files changed, 2173 lines added, and 1231 lines removed. It includes various changes such as adding new scripts for type generation, updating pre-commit hooks, refactoring import paths, and adding new type definitions using zod. To improve the review process, it might be beneficial to split this pull request into smaller, more focused ones. Here are some suggestions on how to split the changes:
By splitting the pull request into these categories, it will be easier to review and ensure that each set of changes is thoroughly examined. Please consider this suggestion if the changes are not tightly interdependent. |
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
roo-code.d.ts (including type generation via zod-to-ts)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
|
cool |
Context
I realized that automatically generating the types we need for our external declaration file cleans up a bunch of stuff, including:
Given that, I decided to derive and generate the
roo-code.d.tstypes from our extension code instead of the other way around. This lets us actually infer types from zod schemas (when it's appropriate).Here's how it works:
roo-code.d.tsthen you simply add aTypeDefinitionentry toschemas/index.ts.exports/types.ts.exports/types.tscan be safely imported byroo-code.ts..d.tsfile is automatically transpiled bytsup(this always should have been automatically generated withtscor some other build tool).There are no logic changes in this PR; it's all typing and build tooling.
Implementation
Screenshots
How to Test
Get in Touch
Important
Automates generation of
roo-code.d.tsfrom Zod schemas, streamlining type management and reducing boilerplate.roo-code.d.tsusingzod-to-ts.generate-types.mtsscript to generate types from Zod schemas inschemas/index.ts.package.jsonwithgenerate-typesscript.schemas/index.tsand updates imports across multiple files.globalState.tsand other files.schemas/__tests__/index.test.tsto testGLOBAL_STATE_KEYS..husky/pre-committo ensureroo-code.d.tsis up-to-date.timeoutinwaitForfunction inutils.tsfrom 30,000 to 60,000.This description was created by
for 47f1e60. It will automatically update as commits are pushed.