Skip to content
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

feat(mdk)!: mdk_typescript #739

Merged
merged 8 commits into from
Jun 10, 2024
Merged

feat(mdk)!: mdk_typescript #739

merged 8 commits into from
Jun 10, 2024

Conversation

Yohe-Am
Copy link
Contributor

@Yohe-Am Yohe-Am commented May 30, 2024

  • Implements the mdk_typescript code generator for typescript type inference on Deno runtime external modules.
  • Ports the very simple generator already present in meta-cli.
  • Removes old codegen from cli and sdk.

Migration notes

  • Metagen section of metatype.yaml has changed. Targets are now lists instead of maps, items no sporting generator field instead of key acting as ref to generator.
  • (sdk) WasmRuntime's fromExport method has been renamed to export to make it more uniform to handler.
  • (sdk) WasmRuntime export and handler method's now expect handler/func name under name instead of func.
  • (sdk) codegen flag has been removed from ArtifactsConfig object.
  • (cli) gen mod/mdk has been simplified to just gen as the previous mod option is no longer avail.

  • The change comes with new or modified tests
  • Hard-to-understand functions have explanatory comments
  • End-user documentation is updated to reflect the change

Copy link

linear bot commented May 30, 2024

MET-492 (mdk) typescript

@Yohe-Am Yohe-Am mentioned this pull request Jun 3, 2024
3 tasks
@Yohe-Am Yohe-Am marked this pull request as ready for review June 3, 2024 07:23
Copy link
Contributor Author

@Yohe-Am Yohe-Am left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for another large PR ya'll. Didn't know how I could break this down.

typegate/tests/metagen/metagen_test.ts Show resolved Hide resolved
Copy link

codecov bot commented Jun 3, 2024

Codecov Report

Attention: Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.

Project coverage is 73.10%. Comparing base (f2b7d82) to head (a4c32ad).

Files Patch % Lines
typegate/src/engine/typecheck/result.ts 77.77% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #739      +/-   ##
==========================================
+ Coverage   72.99%   73.10%   +0.11%     
==========================================
  Files         117      116       -1     
  Lines       14181    14137      -44     
  Branches     1414     1417       +3     
==========================================
- Hits        10351    10335      -16     
+ Misses       3803     3775      -28     
  Partials       27       27              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@zifeo zifeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, should the swc dependencies also be removed and also the post processing inside the typegate?

@Yohe-Am
Copy link
Contributor Author

Yohe-Am commented Jun 3, 2024

Another usecase was unfortunately discovered for the typescript crates here. To compile user provided typescript modules to javascript. (Deno also makes use of swc).

Note, these crates are no longer built by the thin cli.

@zifeo
Copy link
Member

zifeo commented Jun 3, 2024

Yeah, that what I meant by the post processing on the type gate side, I believe there is no usage anymore:

import { transformTypescript, typescript_format_code } from "native";

Copy link
Contributor

@michael-0acf4 michael-0acf4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff 👍

@Yohe-Am Yohe-Am merged commit c03acfb into main Jun 10, 2024
12 checks passed
@Yohe-Am Yohe-Am deleted the met-492-mdk-typescript branch June 10, 2024 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants