Skip to content

Commit 5ea4aae

Browse files
authored
consolidate packages & rename to hypergraph (#89)
* consolidate packages * fix tests
1 parent 7556d4b commit 5ea4aae

File tree

154 files changed

+569
-1577
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+569
-1577
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ pnpm prisma migrate dev # this will also generate the Prisma client
3434

3535
```sh
3636
pnpm up --interactive --latest -r
37-
```
37+
```

apps/events/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@
2020
"@automerge/automerge": "^v2.2.9-alpha.3",
2121
"@automerge/automerge-repo": "^2.0.0-alpha.14",
2222
"@automerge/automerge-repo-react-hooks": "^2.0.0-alpha.14",
23-
"@graphprotocol/graph-framework": "workspace:*",
23+
"@graphprotocol/hypergraph": "workspace:*",
2424
"@noble/hashes": "^1.5.0",
2525
"@privy-io/react-auth": "^1.88.4",
2626
"@radix-ui/react-avatar": "^1.1.1",
2727
"@radix-ui/react-icons": "^1.3.0",
2828
"@radix-ui/react-slot": "^1.1.0",
2929
"@tanstack/react-router": "^1.62.1",
30-
"@xmtp/react-sdk": "^9.0.0",
31-
"@xmtp/xmtp-js": "^13.0.0",
3230
"class-variance-authority": "^0.7.0",
3331
"clsx": "^2.1.1",
3432
"effect": "^3.12.2",

apps/events/src/components/auth.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { GraphLogin, useGraphLogin } from '@graph-framework/identity';
2-
import type { Signer } from '@graph-framework/identity/types';
1+
import { Identity } from '@graphprotocol/hypergraph';
32
import { PrivyProvider, usePrivy, useWallets } from '@privy-io/react-auth';
43
import { useRouter } from '@tanstack/react-router';
54
import { useEffect, useState } from 'react';
65

76
function DoGraphLogin() {
8-
const { login } = useGraphLogin();
7+
const { login } = Identity.useGraphLogin();
98
useEffect(() => {
109
console.log('Logging in to The Graph');
1110
login();
@@ -16,7 +15,7 @@ function DoGraphLogin() {
1615
function Auth({ children }: { children: React.ReactNode }) {
1716
const { signMessage, authenticated } = usePrivy();
1817
const { wallets } = useWallets();
19-
const [signer, setSigner] = useState<Signer | null>(null);
18+
const [signer, setSigner] = useState<Identity.Signer | null>(null);
2019

2120
useEffect(() => {
2221
const getSigner = async () => {
@@ -43,10 +42,10 @@ function Auth({ children }: { children: React.ReactNode }) {
4342
return (
4443
<>
4544
{signer && authenticated ? (
46-
<GraphLogin storage={localStorage} signer={signer}>
45+
<Identity.GraphLogin storage={localStorage} signer={signer}>
4746
<DoGraphLogin />
4847
{children}
49-
</GraphLogin>
48+
</Identity.GraphLogin>
5049
) : (
5150
children
5251
)}
@@ -79,7 +78,7 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
7978

8079
export function RequireAuth({ children }: { children: React.ReactNode }) {
8180
const { authenticated } = usePrivy();
82-
const { authenticated: graphAuthenticated } = useGraphLogin();
81+
const { authenticated: graphAuthenticated } = Identity.useGraphLogin();
8382
const router = useRouter();
8483
if (!authenticated || !graphAuthenticated) {
8584
router.navigate({

apps/events/src/components/debug-invitations.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { Invitation } from '@graphprotocol/graph-framework';
1+
import type { Messages } from '@graphprotocol/hypergraph';
22

33
import { Button } from './ui/button';
44

55
type Props = {
6-
invitations: Invitation[];
6+
invitations: Messages.Invitation[];
77
accept: (params: {
8-
invitation: Invitation;
8+
invitation: Messages.Invitation;
99
}) => Promise<unknown>;
1010
};
1111

apps/events/src/components/debug-space-events.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { SpaceEvent } from '@graphprotocol/graph-framework';
1+
import type { SpaceEvents } from '@graphprotocol/hypergraph';
22

3-
export function DebugSpaceEvents({ events }: { events: SpaceEvent[] }) {
3+
export function DebugSpaceEvents({ events }: { events: SpaceEvents.SpaceEvent[] }) {
44
return (
55
<ul className="text-xs">
66
{events.map((event) => {

apps/events/src/components/debug-space-state.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { SpaceState } from '@graphprotocol/graph-framework';
1+
import type { SpaceEvents } from '@graphprotocol/hypergraph';
22

3-
export function DebugSpaceState(props: { state: SpaceState | undefined }) {
3+
export function DebugSpaceState(props: { state: SpaceEvents.SpaceState | undefined }) {
44
return (
55
<div className="text-xs">
66
<pre>{JSON.stringify(props, null, 2)}</pre>

apps/events/src/components/logout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { useGraphLogin } from '@graph-framework/identity';
1+
import { Identity } from '@graphprotocol/hypergraph';
22
import { usePrivy } from '@privy-io/react-auth';
33
import { useRouter } from '@tanstack/react-router';
44
import { Button } from './ui/button';
55

66
export function Logout() {
7-
const { logout: graphLogout } = useGraphLogin();
7+
const { logout: graphLogout } = Identity.useGraphLogin();
88
const { logout: privyLogout } = usePrivy();
99
const router = useRouter();
1010
const disconnectWallet = () => {

apps/events/src/components/todos-app.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { useState } from 'react';
22

3-
import { useCreateEntity, useDeleteEntity, useQuery, useUpdateEntity } from '@graph-framework/schema';
3+
import { Schema } from '@graphprotocol/hypergraph';
44

55
import { Todo } from '../schema';
66
import { Button } from './ui/button';
77
import { Input } from './ui/input';
88

99
export const TodosApp = () => {
10-
const todos = useQuery(Todo);
11-
const createEntity = useCreateEntity(Todo);
12-
const updateEntity = useUpdateEntity(Todo);
13-
const deleteEntity = useDeleteEntity();
10+
const todos = Schema.useQuery(Todo);
11+
const createEntity = Schema.useCreateEntity(Todo);
12+
const updateEntity = Schema.useUpdateEntity(Todo);
13+
const deleteEntity = Schema.useDeleteEntity();
1414
const [newTodoTitle, setNewTodoTitle] = useState('');
1515

1616
return (

apps/events/src/main.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from 'vitest';
22

33
test('hello', () => {
4-
expect('Hello from graph-framework').toBe('Hello from graph-framework');
4+
expect('Hello from hypergraph').toBe('Hello from hypergraph');
55
});

apps/events/src/routes/__root.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { Logout } from '@/components/logout';
2-
import { useGraphLogin } from '@graph-framework/identity';
2+
import { Identity } from '@graphprotocol/hypergraph';
33
import { Link, Outlet, createRootRoute } from '@tanstack/react-router';
44
import { TanStackRouterDevtools } from '@tanstack/router-devtools';
55
import { CalendarDays } from 'lucide-react';
66

77
export const Route = createRootRoute({
88
component: () => {
9-
const { authenticated } = useGraphLogin();
9+
const { authenticated } = Identity.useGraphLogin();
1010
return (
1111
<>
1212
<div className="flex flex-col min-h-screen">

0 commit comments

Comments
 (0)