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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion mobile/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
check-program = $(foreach exec,$(1),$(if $(shell PATH="$(PATH)" which $(exec)),,$(error "Missing deps: no '$(exec)' in PATH")))
check-file = $(foreach file,$(1),$(if $(wildcard $(file)),,$(error "Missing file: $(file)")))

node_modules: package.json package-lock.json
ts_check:
npm run ts:check

node_modules: ts_check package.json package-lock.json
$(call check-program, npm)
(npm install && touch $@) || true
.PHONY: node_modules
Expand Down
4 changes: 4 additions & 0 deletions mobile/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ import { NotificationProvider } from "@gno/provider/notification-provider";
import { ReduxProvider } from "redux/redux-provider";

const gnoDefaultConfig = {
// @ts-ignore
remote: process.env.EXPO_PUBLIC_GNO_REMOTE!,
// @ts-ignore
chain_id: process.env.EXPO_PUBLIC_GNO_CHAIN_ID!,
};

const indexerDefaultConfig = {
// @ts-ignore
remote: process.env.EXPO_PUBLIC_INDEXER_REMOTE!,
};

const notificationDefaultConfig = {
// @ts-ignore
remote: process.env.EXPO_PUBLIC_NOTIFICATION_REMOTE!,
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Icons from '@gno/components/icons';
import Text from '@gno/components/text';
import { colors } from '@gno/styles/colors';
import { NetworkMetainfo } from '@gnolang/gnonative/build/hooks/types';
import { NetworkMetainfo } from "@gno/types";
import styled from 'styled-components/native';

export interface Props {
Expand Down
2 changes: 1 addition & 1 deletion mobile/components/change-network/network-list/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import NetworkListItem from "../network-list-item";
import styled from "styled-components/native";
import Text from "components/text";
import { NetworkMetainfo } from "@gnolang/gnonative/build/hooks/types";
import { NetworkMetainfo } from "@gno/types";

interface Props {
currentChainId: string | undefined;
Expand Down
2 changes: 1 addition & 1 deletion mobile/components/feed/post-row.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { Image, Pressable, StyleSheet, View } from "react-native";
import { Post } from "../../types";
import { Post } from "@gno/types";
import Text from "@gno/components/text";
import RepliesLabel from "./replies-label";
import TimeStampLabel from "./timestamp-label";
Expand Down
2 changes: 1 addition & 1 deletion mobile/components/feed/repost-row.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { Image, Pressable, StyleSheet, View } from "react-native";
import { Post } from "../../types";
import { Post } from "@gno/types";
import Text from "@gno/components/text";
import RepliesLabel from "./replies-label";
import TimeStampLabel from "./timestamp-label";
Expand Down
3 changes: 2 additions & 1 deletion mobile/components/list/account/account-item.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Button from "@gno/components/button";
import Spacer from "@gno/components/spacer";
import { GnoAccount } from "@gnolang/gnonative/build/hooks/types";
import { GnoAccount } from "@gno/types";


interface SideMenuAccountItemProps {
account: GnoAccount;
Expand Down
1 change: 1 addition & 0 deletions mobile/redux/features/signupSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ const sendCoins = async (address: string) => {
reactNative: { textStreaming: true },
};

// @ts-ignore
const faucetRemote = process.env.EXPO_PUBLIC_FAUCET_REMOTE;
if (!faucetRemote) {
throw new Error("faucet remote address is undefined");
Expand Down
4 changes: 3 additions & 1 deletion mobile/src/grpc/transport_web.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// @ts-ignore
import { polyfill as polyfillReadableStream } from "react-native-polyfill-globals/src/readable-stream";
polyfillReadableStream();
// @ts-ignore
import { fetch as fetchPolyfill, Headers as HeadersPolyfill } from "react-native-fetch-api";

import type { AnyMessage, MethodInfo, PartialMessage, ServiceType } from "@bufbuild/protobuf";
Expand Down Expand Up @@ -241,7 +243,7 @@ export function createXHRGrpcWebTransport(options: GrpcWebTransportOptions): Tra
throw endStream.error;
}

endStream.metadata.forEach((value, key) => trailerTarget.set(key, value));
endStream.metadata.forEach((value:any, key:any) => trailerTarget.set(key, value));
continue;
}

Expand Down
18 changes: 18 additions & 0 deletions mobile/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,21 @@ export interface GetJsonFollowingResult {
following: Following[];
n_following: number;
}

export type GnoConfig = {
Remote: string;
ChainID: string;
KeyName: string;
Password: string;
GasFee: string;
GasWanted: bigint;
Mnemonic: string;
};

export type NetworkMetainfo = {
chainId: string;
chainName: string;
gnoAddress: string;
};

export type GnoAccount = KeyInfo;