-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Add ts types generation to static checks #25167
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
8936ad3 to
83574fa
Compare
bbovenzi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking great!
|
I merged my PR. Want to rebase and update the PR title and description? |
83574fa to
aa4147e
Compare
|
The PR has been updated, we should be good |
|
One small comment - it woudl be - I think - much better to merge this one with |
|
Those are triggered by different source files - but I think overall it would be more efficient. |
|
The |
|
Right.... Forgot about it 🤦 But the "lint" one does not :). This what Is actually better "typescript compile lint" sems like good idea |
|
On the other hand. isolation is better in this case rather than optimisation. |
|
Following your suggestions, here is another option that merges the Let me know what version is preferable :) |
73f9a51 to
cef8af9
Compare
.pre-commit-config.yaml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change the description too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I didn't change it cause we are limited in length :(, trying to find something better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generate and lint UI Javascript files ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went for TS types generation and ESLint against current UI files (that is bellow < 70char) I wanted to remove the reference to Javascript as it is not really accurate anymore
|
I think this one is better. In VAST majority of cases running 'generate-api-types' will produce the same file. Unfortunately - unlike in Python, pre-commit does not reuse node environments, so the less of them, the better for time/cache restore and creation etc: |
|
Ok great thanks for the details :) |
|
BTW. Is it possible @pierrejeambrun - you also remove all the node versions 18.6.0 in all node pre-commits and only update the version in the "top-level" default_language_version? I just realized that we have it by looking at those cached envs. |
cef8af9 to
26dc02e
Compare
|
Done, using the default node version and updated it to |
|
Closed/reopened to rebuild as there was temp dockerhub failure. |
Thanks, I didn't know that trick, I'm used to amending and repushing 😂 |
That's what I do with my changes too :) |
Following #25123, allowing us to auto-generate typescript types for the api, here is a pre-commit hook to ensure that these types stay in sync with the OpenAPI spec.
Modifying the
openapi/v1.yamlwill trigger the type generation. (then could eventually break ESlint hook when attempting again to commit, in case of incompatible changes)