-
Notifications
You must be signed in to change notification settings - Fork 916
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
Autogenerate TS typedefs for Core #5429
Conversation
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.
Excellent stuff! Will be very helpful for the future or for any tooling using libGD.js directly.
The parser seems fairly concise which is helpful to avoid bringing big dependencies or complex stuff. We could probably adapt the flow generation code to be the same.
@D8H once merged, let's use this in other repos :)
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.
@arthuro555 if you can fix the requested changes, then we can merge this :)
Sorry for the delay, I had left on vacation without my laptop ✌️ |
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.
Looks good! The npm install on Travis is failing, any idea why?
Hmm git probably messed up package-lock.json when merging with upstream, I regenerated it, hopefully that fixes it. |
Looks like since the emsdk environement registers an old node/npm version, we needed a package-lock v1 for it to install properly |
Nice!
|
I suggest I convert the script back to "good old" require, so that this is "safe" with older Node.js version - whatever the system/CI/emscripten version. So we can then merge this and ensure it always work. |
Node supports esm since v14. v14, v16 in 5 days from today, and all versions below, all have reached end of life. Instead of doing additional work to convert this script back to cjs "just in case", we should rather use the energy to update CIs & the like from very outdated node versions to an actually supported version of node. |
For emscripten specifically, I just tried and GDevelop.js builds perfectly fine (albeit with a few C++17 deprecation warnings for using binary_function) under the latest version of emscripten, where emsdk's environment uses Node v16. |
If you're fine for this PR to land later, we can then take the time to upgrade Emscripten. |
So Travis CI failing because lock file is probably too old.
|
Finally merged! I almost think we could generate the Flow types like you did with a simple parser, rather than relying on the complicated |
Adds a script that parses the Bindings.idl to generate a TypeScript DTS file, as a first step for a potential migration of the IDE from Flow to TypeScript.