Skip to content

Commit 2265dce

Browse files
authored
Ng/improvements (#269)
1 parent 6d3915b commit 2265dce

File tree

10 files changed

+24
-17
lines changed

10 files changed

+24
-17
lines changed

apps/connect/.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ VITE_HYPERGRAPH_SYNC_SERVER_ORIGIN="http://localhost:3030"
22
VITE_HYPERGRAPH_CHAIN="geo-testnet"
33
VITE_HYPERGRAPH_API_URL="https://hypergraph-v2-testnet.up.railway.app/graphql"
44
VITE_HYPERGRAPH_RPC_URL="https://rpc-geo-test-zc16z3tcvf.t.conduit.xyz"
5+
VITE_PRIVY_APP_ID="cmbhnmo1x000bla0mxudtd8z9"
56
# VITE_HYPERGRAPH_CHAIN="geogenesis"
67
# VITE_HYPERGRAPH_API_URL="https://hypergraph-v2.up.railway.app/graphql"
78
# VITE_HYPERGRAPH_RPC_URL="https://rpc-geo-genesis-h0q2s21xx8.t.conduit.xyz"

apps/connect/.env.production

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
VITE_HYPERGRAPH_SYNC_SERVER_ORIGIN="https://syncserver.hypergraph.thegraph.com"
2-
VITE_HYPERGRAPH_CHAIN="geogenesis"
3-
VITE_HYPERGRAPH_API_URL="https://hypergraph-v2.up.railway.app/graphql"
4-
VITE_HYPERGRAPH_RPC_URL="https://rpc-geo-genesis-h0q2s21xx8.t.conduit.xyz"
2+
VITE_HYPERGRAPH_CHAIN="geo-testnet"
3+
VITE_HYPERGRAPH_API_URL="https://hypergraph-v2-testnet.up.railway.app/graphql"
4+
VITE_HYPERGRAPH_RPC_URL="https://rpc-geo-test-zc16z3tcvf.t.conduit.xyz"
5+
VITE_PRIVY_APP_ID="cmcccikza007bjy0niawgutl0"

apps/connect/src/Boot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function Boot() {
4747
return (
4848
<QueryClientProvider client={queryClient}>
4949
<PrivyProvider
50-
appId="cmbhnmo1x000bla0mxudtd8z9"
50+
appId={import.meta.env.VITE_PRIVY_APP_ID}
5151
config={{
5252
loginMethods: ['email', 'google'],
5353
appearance: {

apps/connect/vercel.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"rewrites": [{ "source": "/(.*)", "destination": "/" }]
3+
}

apps/events/src/Boot.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@ declare module '@tanstack/react-router' {
1515

1616
export function Boot() {
1717
return (
18-
<HypergraphAppProvider
19-
storage={localStorage}
20-
syncServerUri="http://localhost:3030"
21-
mapping={mapping}
22-
chainId={19411}
23-
>
18+
<HypergraphAppProvider syncServerUri="http://localhost:3030" mapping={mapping}>
2419
<RouterProvider router={router} />
2520
</HypergraphAppProvider>
2621
);

apps/events/src/routes/authenticate-success.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import { Connect } from '@graphprotocol/hypergraph';
21
import { useHypergraphApp } from '@graphprotocol/hypergraph-react';
32
import { createFileRoute, useNavigate } from '@tanstack/react-router';
4-
import * as Effect from 'effect/Effect';
53
import { useEffect } from 'react';
64

75
export const Route = createFileRoute('/authenticate-success')({

apps/next-example/src/components/providers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function Providers({ children }: { children: React.ReactNode }) {
77
const storage = typeof window !== 'undefined' ? window.localStorage : (undefined as unknown as Storage);
88

99
return (
10-
<HypergraphAppProvider storage={storage} syncServerUri="http://localhost:3030" mapping={{}}>
10+
<HypergraphAppProvider syncServerUri="http://localhost:3030" mapping={{}}>
1111
{children}
1212
</HypergraphAppProvider>
1313
);

packages/hypergraph-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphprotocol/hypergraph-react",
3-
"version": "0.0.3",
3+
"version": "0.0.5",
44
"description": "React implementation and additional functionality, components, and hooks for the hypergraph SDK framework",
55
"keywords": ["Web3", "Local-First", "Knowledge Graph", "Graph Protocol", "react"],
66
"publishConfig": {

packages/hypergraph-react/src/HypergraphAppContext.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,19 +215,28 @@ export function useHypergraphAuth() {
215215
}
216216

217217
export type HypergraphAppProviderProps = Readonly<{
218-
storage: Identity.Storage;
218+
storage?: Identity.Storage;
219219
syncServerUri?: string;
220220
chainId?: number;
221221
children: ReactNode;
222222
mapping: Mapping;
223223
}>;
224+
225+
const mockStorage = {
226+
getItem(_key: string) {
227+
return null;
228+
},
229+
setItem(_key: string, _value: string) {},
230+
removeItem(_key: string) {},
231+
};
232+
224233
// 1) a) Get session token from local storage, or
225234
// b) Auth with the sync server
226235
// 2) a)Try to get identity from the sync server, or
227236
// b) If identity is not found, create a new identity
228237
// (and store it in the sync server)
229238
export function HypergraphAppProvider({
230-
storage,
239+
storage = typeof window !== 'undefined' ? localStorage : mockStorage,
231240
syncServerUri = 'https://syncserver.hypergraph.thegraph.com',
232241
chainId = Connect.GEO_TESTNET.id,
233242
children,

packages/hypergraph/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphprotocol/hypergraph",
3-
"version": "0.0.3",
3+
"version": "0.0.5",
44
"description": "SDK for building performant, type-safe, local-first dapps on top of The Graph ecosystem knowledge graphs.",
55
"publishConfig": {
66
"access": "public",

0 commit comments

Comments
 (0)