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

Update local type generation scripts #2968

Merged
merged 34 commits into from
Oct 29, 2024
Merged

Update local type generation scripts #2968

merged 34 commits into from
Oct 29, 2024

Conversation

pLabarta
Copy link
Contributor

@pLabarta pLabarta commented Sep 23, 2024

What does it do?

Bump @polkadot/api versions and update scripts for updating the TypeScript Api from a local build. Also modified /test to use the local package instead of the published one using pnpm workspaces.

Usage:

  • Run the Moonwall script called "update-local-types.ts"
  • Script will update TS API for Moonbeam, Moonriver and Moonbase

There were some changes to tests to fix errors that appeared when upgrading deps.

What important points reviewers should know?

Is there something left for follow-up PRs?

Yes, following PRs should address:

  • Using new scripts for updating types in CI

  • Import types from moonbeam-types-bundle

  • Review and update types in the bundle

  • Automate type generation for PRs

What alternative implementations were considered?

Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?

What value does it bring to the blockchain users?

@pLabarta pLabarta changed the title Pablo/ts api overhaul Update local type generation scripts Sep 23, 2024
@pLabarta pLabarta added B0-silent Changes should not be mentioned in any release notes D2-notlive PR doesn't change runtime code (so can't be audited) labels Sep 23, 2024
Copy link
Contributor

github-actions bot commented Sep 23, 2024

WASM runtime size check:

Compared to target branch

Moonbase runtime: 2260 KB (no changes) ✅

Moonbeam runtime: 2228 KB (no changes) ✅

Moonriver runtime: 2232 KB (no changes) ✅

Compared to latest release (runtime-3300)

Moonbase runtime: 2260 KB (+232 KB compared to latest release) ⚠️

Moonbeam runtime: 2228 KB (+232 KB compared to latest release) ⚠️

Moonriver runtime: 2232 KB (+240 KB compared to latest release) ⚠️

Copy link
Contributor

github-actions bot commented Oct 7, 2024

Coverage Report

@@                    Coverage Diff                    @@
##           master   pablo/ts-api-overhaul      +/-   ##
=========================================================
- Coverage   79.01%                  78.96%   -0.05%     
  Files         305                     305              
  Lines       88446                   88446              
=========================================================
- Hits        69878                   69834      -44     
+ Misses      18568                   18612      +44     
Files Changed Coverage
/client/rpc/finality/src/lib.rs 12.50% (-68.75%) 🔽

Coverage generated Mon Oct 28 12:16:19 UTC 2024

@pLabarta pLabarta marked this pull request as ready for review October 8, 2024 11:43
@pLabarta pLabarta requested review from a team as code owners October 8, 2024 11:43
RomarQ
RomarQ previously requested changes Oct 15, 2024
Copy link
Contributor

@RomarQ RomarQ left a comment

Choose a reason for hiding this comment

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

It seems that we are overriding Moonbase and Moonbeam types with Moonriver ones.

@pLabarta
Copy link
Contributor Author

It seems that we are overriding Moonbase and Moonbeam types with Moonriver ones.

Took my some time to figure out what was going on. Seemed like the nodes did not shut down and because they used the same ports got the wrong metadata. Should be fixed now!

@pLabarta pLabarta requested a review from RomarQ October 28, 2024 14:20
@noandrea noandrea dismissed RomarQ’s stale review October 29, 2024 12:06

the changes were applied

@noandrea noandrea merged commit 07306c4 into master Oct 29, 2024
41 of 42 checks passed
@noandrea noandrea deleted the pablo/ts-api-overhaul branch October 29, 2024 12:07
@crystalin
Copy link
Collaborator

@pLabarta
I see that the package informations were moved to the root folder. We initially tried to avoid that so that js/ts would not appear in the core (rust) part of moonbeam. I don't think it is a big deal but was curious if we could have achieve it better without move those files to root ?

@pLabarta
Copy link
Contributor Author

Pnpm requires the workspace configs at the root, an alternative approach would be isolating the TS packages in a 'ts' folder or similar, but I don't quite like it either. I'm open to options if we want to maintain the root focused on Rust configs

@crystalin
Copy link
Collaborator

I see. I think it is fine if we keep it limited to those files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B0-silent Changes should not be mentioned in any release notes D2-notlive PR doesn't change runtime code (so can't be audited)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants