Skip to content

Conversation

@ali-behjati
Copy link
Collaborator

This change adds type generation to the build path to have them in the resulting library and also fixes the issues around type exports by updating the typescript and using export type *. The problem was that the normal export * adds a similar export to the produced js file but there is no module to be exported from in our case.

@vercel
Copy link

vercel bot commented Jun 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
xc-admin-frontend ⬜️ Ignored (Inspect) Visit Preview Jun 17, 2024 7:26am

This change adds type generation to the build path to have them in the
resulting library and also fixes the issues around type exports by
updating the typescript and using `export type *`. The problem was that
the normal `export *` adds a similar export to the produced js file but
there is no module to be exported from in our case.
Copy link
Collaborator

@cprussin cprussin left a comment

Choose a reason for hiding this comment

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

LGTM but @cctdaniel and I spoke and I think it's very unwise to be 1) generating type declarations into a src dir and 2) re-exporting generated types. It's really not how typescript packaging is intended to work and I think we're very likely going to run into weird limitations because we're kind of abusing typescript here.

I think it would be wise to eventually do one of two things:

  1. Move the generated types to a separate package
  2. Move the generated types to a separate export using subpath exports

I don't think we need to do either for this PR, but I'm noting this because I think we should resist copying this pattern to another package when the opportunity comes

@cprussin
Copy link
Collaborator

Note the eslint error in CI Parsing error: DeprecationError: 'originalKeywordKind' has been deprecated since v5.0.0 and can no longer be used. Use 'identifierToKeywordKind(identifier)' instead is happening because you upgraded typescript but didn't upgrade the @typescript-eslint/parser. The 5.x range of the @typescript-eslint/* packages are compatible with typescript 4.x.

@ali-behjati
Copy link
Collaborator Author

@cprussin I totally hear you on this. Please feel free to modify the structure here. This PR just solves the bugs that exists which prevented me to run contract manager scripts totally irrelevant to this change.

@ali-behjati ali-behjati merged commit 9a1cca0 into main Jun 17, 2024
@ali-behjati ali-behjati deleted the fix-fuel-sdk-js branch June 17, 2024 07:42
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