-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Automate Generation of d.ts for Ace Editor Modes #5518
Conversation
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
1 similar comment
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5518 +/- ##
=======================================
Coverage 86.60% 86.60%
=======================================
Files 590 590
Lines 42705 42705
Branches 7096 7096
=======================================
Hits 36985 36985
Misses 5720 5720
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
declare module "ace-code/src/mode/swift_highlight_rules" { | ||
export const SwiftHighlightRules: new () => import(".").Ace.HighlightRules; | ||
export const HighlightRules: new () => import(".").Ace.HighlightRules; |
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.
Now that I added SwiftHighlightRules
in #5516, which one should we export here?
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.
Currently, the script adds both types of exports. It collects all exports and generates declarations based on them. I don’t see this as a problem, especially considering that it accurately reflects the current codebase. However, if desired, I could add an exclusion list for exports we prefer not to include.
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.
Oh I see, I've just merged the change after this PR is created and couldn't see it reflected. Will it be included in the next time we run this script?
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 merged new changes and run script again -> now there are two exports
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
Hey mkslanc, |
Hey! I think it makes sense, but I am not sure, if I have permission to create/modify github actions in this repo. |
@mkslanc github action is just a yaml file in .github/workflows, you don't need extra access level for it I think. See #5506 for example of adding an action. For pre-commit hook I think we might use I think it would be best if the generation could be run both manually an in pre-commit hook, with our contribution guide mentioning this script as well. |
659a877
to
d3fde97
Compare
51a88d7
to
ff4b0de
Compare
dd44e9a
to
3923d41
Compare
3923d41
to
de1301d
Compare
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
I have added a ci script to check that types are updated. I think we should leave husky as a follow-up pull request, because the situation with updating types is same us the situation with |
Issue #, if available: #5511
Description of changes:
This PR introduces an automated process for generating TypeScript declaration files for the ACE Editor modes located within our
src/mode
directory. By analyzing our JavaScript codebase using the TypeScript Compiler API, we can now dynamically create a singleace-modes.d.ts
file that accurately represents the types and exports of our editor modes.This can serve as a short- to mid-term solution until the modes are converted to ES6 and properly checked with TypeScript.
Discussion Points:
Next Steps:
I invite all ACE team members to review the proposed changes and participate in a discussion about integrating this script into workflow. Your insights are invaluable to ensuring the effectiveness and efficiency of this solution.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Pull Request Checklist:
ace.d.ts
) and its references: