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

chore: Resolve ts:check errors, put in Makefile #132

Merged
merged 5 commits into from
Sep 24, 2024

Conversation

jefft0
Copy link
Contributor

@jefft0 jefft0 commented Sep 24, 2024

We want to use npm run ts:check in the Makefile, but first we must resolve the errors. This PR has five commits:

  1. The process.env object is created dynamically, so ignore errors for undefined values such as EXPO_PUBLIC_GNO_REMOTE.
  2. In types.ts, add NetworkMetainfo and GnoAccount. Correct the import to use @gno/types.
  3. In transport_web, it complains that "Could not find a declaration file" for imported packages react-native-polyfill-globals and react-native-fetch-api. We can't change the imported packages, so ignore these errors.
  4. In transport_web, add the "any" declaration to forEach((value:any, key:any).
  5. Now that the errors are fixed, we can update the Makefile. Add a target ts_check to do npm run ts:check. Add this as a dependency to the node_modules target, which is used by all the others.

@jefft0 jefft0 requested a review from iuricmp September 24, 2024 11:02
Copy link
Contributor

@iuricmp iuricmp left a comment

Choose a reason for hiding this comment

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

🚀

@jefft0 jefft0 merged commit 33cdfc4 into gnoverse:main Sep 24, 2024
1 check passed
@jefft0 jefft0 deleted the chore/resolve-ts-check-errors branch September 24, 2024 11:10
jefft0 added a commit to gnolang/gnonative that referenced this pull request Sep 30, 2024
Similar to dSocial PR gnoverse/dsocial#132, we
want to use `npm run ts:check` in the Makefile for gnoboard, but first
we must resolve the errors. This PR has five commits:

1. Add ts:check to package.json
2. A [previous
commit](b586114)
changes gnoboard to use `KeyInfo` instead of the alias `GnoAccount` . It
seems that this was missed in one file, so we make the same change.
3. In the catch clause, we call `GRPCError` which expects `ConnectError`
or null. But the error in the catch can be any type. So add an explicit
check for `instanceof ConnectError` .
4. The definition of `NetworkList` includes `onNetworkChange`, but
ChangeNetwork.stories doesn't have it. However, `onNetworkChange` isn't
used by the storybook, so we put a noop function.
5. Now that the errors are fixed, we can update the gnoboard Makefile.
Add a target ts_check to do `npm run ts:check`. Add this as a dependency
to the node_modules target, which is used by all the others.

---------

Signed-off-by: Jeff Thompson <[email protected]>
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.

2 participants