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

fix: add lookupTypes to typegen imports #5769

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Muhammad-Altabba
Copy link

@Muhammad-Altabba Muhammad-Altabba commented Dec 10, 2023

Description

Fixes: #5765

The lookupTypes are missed from the list used to extract imports for the generated types.
This PR will add it back.

@Muhammad-Altabba
Copy link
Author

The MR also resolves: polkadot-js/docs#252

Copy link
Member

@jacogr jacogr left a comment

Choose a reason for hiding this comment

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

The build fails because of this. On the top-level imports it now tries to include the lookup types from @polkadot/types since it was added to the top-level definition.

https://github.com/polkadot-js/api/actions/runs/7158255406/job/19733755190?pr=5769

It has these dupes since in the next section we explicitly import from lookup on line 52.

@Muhammad-Altabba
Copy link
Author

Muhammad-Altabba commented Dec 18, 2023

The build fails because of this. On the top-level imports it now tries to include the lookup types from @polkadot/types since it was added to the top-level definition.

https://github.com/polkadot-js/api/actions/runs/7158255406/job/19733755190?pr=5769

It has these dupes since in the next section we explicitly import from lookup on line 52.

So what is your suggestion to fix the issue?

And did you try to generate the files locally and saw that there are missed imports for lookups? Or were you able to generate with no issues?

Thanks,

@jacogr
Copy link
Member

jacogr commented Dec 19, 2023

CI generates code for - Substrate, Kusama and Polkadot on each build and outputs it here - https://github.com/polkadot-js/api/tree/master/packages/api-augment/src.

So it gets used each time there is a PR and each time there is a build - it literally runs as part of the API build process. (It changes as the metadata is updated, i.e. here is an example of a PR in which the base Substrate metadata was bumped - https://github.com/polkadot-js/api/pull/5770/files)

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.

polkadot-types-from-chain removes imports which are used later in the same file
2 participants