-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support generating TypeScript/JavaScript clients using ccd-js-gen #140
Conversation
- Also adds a command for getting the version of the ccd-js-gen executable - ccd-js-gen is not used as a library because it is an ES module, which - VS Code does not support yet. VS Code uses Electron v25, and support - for ES modules is added in v28.
Refactors a number of helper functions for making well-typed executable wrappers into the file `executable-wrapper-helpers.ts`. Adds tests for the ccd-js-gen settings and refactors the tests a bit by creating a `prepareTest()` function.
When the wasm module couldn't be found.
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, but I do not understand how the ccd-gen-js is embedded as a binary.
Also, what runtime will the ccd-js-gen run with?
The executable comes from adding the package to the project in
which uses the node as runtime. |
e9e8b67
to
2bdda6b
Compare
7b31b9d
to
ba4f015
Compare
VSCode uses the CommandPrompt shell by default, so we must use the .cmd file. I also changed it, so the version command also uses the CommandPrompt.
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, with only some minor comments.
Purpose
Integrates our ccd-js-gen tool in our VS Code extension, so that js/ts clients can be generated from smart contract modules.
Closes #138.
As discussed in standup, I could not use ccd-js-gen as a library because it is an ES module, which VS Code does not support. ES modules are supported in Electron 28+ (electron/electron#37535), but VS Code is still on v25.
We tested the new commands on Windows, and the generator command did not work. After some debugging, we found out that it is because of a badly generated
ps1
/cmd
file that is used as the executable.Should be fixed by Concordium/concordium-node-sdk-js#315, but I have not tested the complete fix on Windows.
Changes
tasks.ts
as they are needed for both ccd-js-gen and cargo concordiumexecutable-wrapper-helpers.ts
Checklist
hard-to-understand areas.