diff --git a/apps/events/package.json b/apps/events/package.json index 779de254..8820f98a 100644 --- a/apps/events/package.json +++ b/apps/events/package.json @@ -31,7 +31,7 @@ "clsx": "^2.1.1", "effect": "^3.10.19", "ethers": "^6.13.3", - "graph-framework": "workspace:*", + "@graphprotocol/graph-framework": "workspace:*", "lucide-react": "^0.441.0", "react": "^18.3.1", "react-dom": "^18.3.1", diff --git a/apps/events/src/components/debug-invitations.tsx b/apps/events/src/components/debug-invitations.tsx index 8b262315..2118f441 100644 --- a/apps/events/src/components/debug-invitations.tsx +++ b/apps/events/src/components/debug-invitations.tsx @@ -1,4 +1,5 @@ -import type { Invitation } from 'graph-framework'; +import type { Invitation } from '@graphprotocol/graph-framework'; + import { Button } from './ui/button'; type Props = { diff --git a/apps/events/src/components/debug-space-events.tsx b/apps/events/src/components/debug-space-events.tsx index 6be09304..edf5dd77 100644 --- a/apps/events/src/components/debug-space-events.tsx +++ b/apps/events/src/components/debug-space-events.tsx @@ -1,4 +1,4 @@ -import type { SpaceEvent } from 'graph-framework'; +import type { SpaceEvent } from '@graphprotocol/graph-framework'; export function DebugSpaceEvents({ events }: { events: SpaceEvent[] }) { return ( diff --git a/apps/events/src/components/debug-space-state.tsx b/apps/events/src/components/debug-space-state.tsx index 9a62c213..89366ab7 100644 --- a/apps/events/src/components/debug-space-state.tsx +++ b/apps/events/src/components/debug-space-state.tsx @@ -1,4 +1,4 @@ -import type { SpaceState } from 'graph-framework'; +import type { SpaceState } from '@graphprotocol/graph-framework'; export function DebugSpaceState(props: { state: SpaceState | undefined }) { return ( diff --git a/apps/events/src/routes/index.tsx b/apps/events/src/routes/index.tsx index 1c0a2968..7113a5d5 100644 --- a/apps/events/src/routes/index.tsx +++ b/apps/events/src/routes/index.tsx @@ -1,6 +1,8 @@ -import { Button } from '@/components/ui/button'; import { createFileRoute, useNavigate } from '@tanstack/react-router'; -import { repo } from 'graph-framework'; + +import { repo } from '@graphprotocol/graph-framework'; + +import { Button } from '@/components/ui/button'; export const Route = createFileRoute('/')({ component: Index, diff --git a/apps/events/src/routes/playground.tsx b/apps/events/src/routes/playground.tsx index 08da39d5..06e119de 100644 --- a/apps/events/src/routes/playground.tsx +++ b/apps/events/src/routes/playground.tsx @@ -1,13 +1,10 @@ -import { DebugInvitations } from '@/components/debug-invitations'; -import { DebugSpaceEvents } from '@/components/debug-space-events'; -import { DebugSpaceState } from '@/components/debug-space-state'; -import { Button } from '@/components/ui/button'; -import { assertExhaustive } from '@/lib/assertExhaustive'; import { uuid } from '@automerge/automerge'; import { bytesToHex, hexToBytes } from '@noble/hashes/utils'; import { createFileRoute } from '@tanstack/react-router'; import { Effect, Exit } from 'effect'; import * as Schema from 'effect/Schema'; +import { useEffect, useState } from 'react'; + import type { Invitation, RequestAcceptInvitationEvent, @@ -19,7 +16,7 @@ import type { RequestSubscribeToSpace, SpaceEvent, SpaceState, -} from 'graph-framework'; +} from '@graphprotocol/graph-framework'; import { ResponseMessage, acceptInvitation, @@ -34,8 +31,13 @@ import { encryptMessage, generateId, serialize, -} from 'graph-framework'; -import { useEffect, useState } from 'react'; +} from '@graphprotocol/graph-framework'; + +import { DebugInvitations } from '@/components/debug-invitations'; +import { DebugSpaceEvents } from '@/components/debug-space-events'; +import { DebugSpaceState } from '@/components/debug-space-state'; +import { Button } from '@/components/ui/button'; +import { assertExhaustive } from '@/lib/assertExhaustive'; const availableAccounts = [ { diff --git a/apps/events/src/schema.ts b/apps/events/src/schema.ts index d5eb35b2..bc3f25f9 100644 --- a/apps/events/src/schema.ts +++ b/apps/events/src/schema.ts @@ -1,4 +1,4 @@ -import { createFunctions, type } from 'graph-framework'; +import { createFunctions, type } from '@graphprotocol/graph-framework'; export const schema = { types: { diff --git a/apps/events/src/types.ts b/apps/events/src/types.ts index a1b5ac89..db18247a 100644 --- a/apps/events/src/types.ts +++ b/apps/events/src/types.ts @@ -1,4 +1,4 @@ -import type { SpaceEvent, SpaceState } from 'graph-framework'; +import type { SpaceEvent, SpaceState } from '@graphprotocol/graph-framework'; export type SpaceStorageEntry = { id: string; diff --git a/apps/events/tsconfig.app.json b/apps/events/tsconfig.app.json index cb995f23..0e41434b 100644 --- a/apps/events/tsconfig.app.json +++ b/apps/events/tsconfig.app.json @@ -31,20 +31,20 @@ "baseUrl": ".", "paths": { "@/*": ["./src/*"], - "graph-framework": ["../../packages/graph-framework/src/index.js"], - "graph-framework/*": ["../../packages/graph-framework/src/*.js"], - "graph-framework-space-events": ["../../packages/graph-framework-space-events/src/index.js"], - "graph-framework-space-events/*": ["../../packages/graph-framework-space-events/src/*.js"], - "graph-framework-messages": ["../../packages/graph-framework-messages/src/index.js"], - "graph-framework-messages/*": ["../../packages/graph-framework-messages/src/*.js"], - "graph-framework-identity": ["../../packages/graph-framework-identity/src/index.js"], - "graph-framework-identity/*": ["../../packages/graph-framework-identity/src/*.js"], - "graph-framework-key": ["../../packages/graph-framework-key/src/index.js"], - "graph-framework-key/*": ["../../packages/graph-framework-key/src/*.js"], - "graph-framework-schema": ["../../packages/graph-framework-schema/src/index.js"], - "graph-framework-schema/*": ["../../packages/graph-framework-schema/src/*.js"], - "graph-framework-utils": ["../../packages/graph-framework-utils/src/index.js"], - "graph-framework-utils/*": ["../../packages/graph-framework-utils/src/*.js"] + "@graphprotocol/graph-framework": ["../../packages/graph-framework/src/index.js"], + "@graphprotocol/graph-framework/*": ["../../packages/graph-framework/src/*.js"], + "@graph-framework/space-events": ["../../packages/graph-framework-space-events/src/index.js"], + "@graph-framework/space-events/*": ["../../packages/graph-framework-space-events/src/*.js"], + "@graph-framework/messages": ["../../packages/graph-framework-messages/src/index.js"], + "@graph-framework/messages/*": ["../../packages/graph-framework-messages/src/*.js"], + "@graph-framework/identity": ["../../packages/graph-framework-identity/src/index.js"], + "@graph-framework/identity/*": ["../../packages/graph-framework-identity/src/*.js"], + "@graph-framework/key": ["../../packages/graph-framework-key/src/index.js"], + "@graph-framework/key/*": ["../../packages/graph-framework-key/src/*.js"], + "@graph-framework/schema": ["../../packages/graph-framework-schema/src/index.js"], + "@graph-framework/schema/*": ["../../packages/graph-framework-schema/src/*.js"], + "@graph-framework/utils": ["../../packages/graph-framework-utils/src/index.js"], + "@graph-framework/utils/*": ["../../packages/graph-framework-utils/src/*.js"] } }, "include": ["src"] diff --git a/apps/events/tsconfig.json b/apps/events/tsconfig.json index 8fe9f04f..ff72fa2d 100644 --- a/apps/events/tsconfig.json +++ b/apps/events/tsconfig.json @@ -6,20 +6,20 @@ "baseUrl": ".", "paths": { "@/*": ["./src/*"], - "graph-framework": ["../../packages/graph-framework/src/index.js"], - "graph-framework/*": ["../../packages/graph-framework/src/*.js"], - "graph-framework-space-events": ["../../packages/graph-framework-space-events/src/index.js"], - "graph-framework-space-events/*": ["../../packages/graph-framework-space-events/src/*.js"], - "graph-framework-messages": ["../../packages/graph-framework-messages/src/index.js"], - "graph-framework-messages/*": ["../../packages/graph-framework-messages/src/*.js"], - "graph-framework-identity": ["../../packages/graph-framework-identity/src/index.js"], - "graph-framework-identity/*": ["../../packages/graph-framework-identity/src/*.js"], - "graph-framework-key": ["../../packages/graph-framework-key/src/index.js"], - "graph-framework-key/*": ["../../packages/graph-framework-key/src/*.js"], - "graph-framework-schema": ["../../packages/graph-framework-schema/src/index.js"], - "graph-framework-schema/*": ["../../packages/graph-framework-schema/src/*.js"], - "graph-framework-utils": ["../../packages/graph-framework-utils/src/index.js"], - "graph-framework-utils/*": ["../../packages/graph-framework-utils/src/*.js"] + "@graphprotocol/graph-framework": ["../../packages/graph-framework/src/index.js"], + "@graphprotocol/graph-framework/*": ["../../packages/graph-framework/src/*.js"], + "@graph-framework/space-events": ["../../packages/graph-framework-space-events/src/index.js"], + "@graph-framework/space-events/*": ["../../packages/graph-framework-space-events/src/*.js"], + "@graph-framework/messages": ["../../packages/graph-framework-messages/src/index.js"], + "@graph-framework/messages/*": ["../../packages/graph-framework-messages/src/*.js"], + "@graph-framework/identity": ["../../packages/graph-framework-identity/src/index.js"], + "@graph-framework/identity/*": ["../../packages/graph-framework-identity/src/*.js"], + "@graph-framework/key": ["../../packages/graph-framework-key/src/index.js"], + "@graph-framework/key/*": ["../../packages/graph-framework-key/src/*.js"], + "@graph-framework/schema": ["../../packages/graph-framework-schema/src/index.js"], + "@graph-framework/schema/*": ["../../packages/graph-framework-schema/src/*.js"], + "@graph-framework/utils": ["../../packages/graph-framework-utils/src/index.js"], + "@graph-framework/utils/*": ["../../packages/graph-framework-utils/src/*.js"] } } } diff --git a/apps/events/vite.config.ts b/apps/events/vite.config.ts index 1e76acae..639006a5 100644 --- a/apps/events/vite.config.ts +++ b/apps/events/vite.config.ts @@ -1,6 +1,6 @@ +import path from 'node:path'; import { TanStackRouterVite } from '@tanstack/router-plugin/vite'; import react from '@vitejs/plugin-react'; -import path from 'node:path'; import { defineConfig } from 'vite'; import { nodePolyfills } from 'vite-plugin-node-polyfills'; import topLevelAwait from 'vite-plugin-top-level-await'; @@ -23,13 +23,13 @@ export default defineConfig({ resolve: { alias: { '@': path.resolve(__dirname, './src'), - 'graph-framework': path.resolve(__dirname, '../../packages/graph-framework/src'), - 'graph-framework-space-events': path.resolve(__dirname, '../../packages/graph-framework-space-events/src'), - 'graph-framework-utils': path.resolve(__dirname, '../../packages/graph-framework-utils/src'), - 'graph-framework-schema': path.resolve(__dirname, '../../packages/graph-framework-schema/src'), - 'graph-framework-identity': path.resolve(__dirname, '../../packages/graph-framework-identity/src'), - 'graph-framework-key': path.resolve(__dirname, '../../packages/graph-framework-key/src'), - 'graph-framework-messages': path.resolve(__dirname, '../../packages/graph-framework-messages/src'), + '@graphprotocol/graph-framework': path.resolve(__dirname, '../../packages/graph-framework/src'), + '@graph-framework/space-events': path.resolve(__dirname, '../../packages/graph-framework-space-events/src'), + '@graph-framework/utils': path.resolve(__dirname, '../../packages/graph-framework-utils/src'), + '@graph-framework/schema': path.resolve(__dirname, '../../packages/graph-framework-schema/src'), + '@graph-framework/identity': path.resolve(__dirname, '../../packages/graph-framework-identity/src'), + '@graph-framework/key': path.resolve(__dirname, '../../packages/graph-framework-key/src'), + '@graph-framework/messages': path.resolve(__dirname, '../../packages/graph-framework-messages/src'), }, }, }); diff --git a/apps/server/package.json b/apps/server/package.json index 364c670c..2ec1c760 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -23,8 +23,8 @@ "dotenv": "^16.4.5", "effect": "^3.10.19", "express": "^5.0.1", - "graph-framework-space-events": "workspace:*", - "graph-framework-messages": "workspace:*", + "@graph-framework/space-events": "workspace:*", + "@graph-framework/messages": "workspace:*", "ws": "^8.17.1" }, "devDependencies": { diff --git a/apps/server/src/handlers/applySpaceEvent.ts b/apps/server/src/handlers/applySpaceEvent.ts index ee466ef0..8453102e 100644 --- a/apps/server/src/handlers/applySpaceEvent.ts +++ b/apps/server/src/handlers/applySpaceEvent.ts @@ -1,7 +1,9 @@ import { Effect, Exit } from 'effect'; -import type { KeyBoxWithKeyId } from 'graph-framework-messages'; -import type { SpaceEvent } from 'graph-framework-space-events'; -import { applyEvent } from 'graph-framework-space-events'; + +import type { KeyBoxWithKeyId } from '@graph-framework/messages'; +import type { SpaceEvent } from '@graph-framework/space-events'; +import { applyEvent } from '@graph-framework/space-events'; + import { prisma } from '../prisma.js'; type Params = { diff --git a/apps/server/src/handlers/createSpace.ts b/apps/server/src/handlers/createSpace.ts index 41d88c2a..6dd9acfa 100644 --- a/apps/server/src/handlers/createSpace.ts +++ b/apps/server/src/handlers/createSpace.ts @@ -1,6 +1,8 @@ import { Effect, Exit } from 'effect'; -import type { KeyBox } from 'graph-framework-messages'; -import { type CreateSpaceEvent, applyEvent } from 'graph-framework-space-events'; + +import type { KeyBox } from '@graph-framework/messages'; +import { type CreateSpaceEvent, applyEvent } from '@graph-framework/space-events'; + import { prisma } from '../prisma.js'; type Params = { diff --git a/apps/server/src/handlers/listInvitations.ts b/apps/server/src/handlers/listInvitations.ts index b4a65fb1..3781b8d5 100644 --- a/apps/server/src/handlers/listInvitations.ts +++ b/apps/server/src/handlers/listInvitations.ts @@ -1,5 +1,7 @@ import { Schema } from 'effect'; -import { SpaceState } from 'graph-framework-space-events'; + +import { SpaceState } from '@graph-framework/space-events'; + import { prisma } from '../prisma.js'; type Params = { diff --git a/apps/server/src/index.ts b/apps/server/src/index.ts index 00b09ba9..fc42488d 100755 --- a/apps/server/src/index.ts +++ b/apps/server/src/index.ts @@ -1,8 +1,6 @@ import cors from 'cors'; import 'dotenv/config'; import { parse } from 'node:url'; -import { Effect, Exit, Schema } from 'effect'; -import express from 'express'; import type { ResponseListInvitations, ResponseListSpaces, @@ -11,10 +9,12 @@ import type { ResponseUpdateConfirmed, ResponseUpdatesNotification, Updates, -} from 'graph-framework-messages'; -import { RequestMessage, deserialize, serialize } from 'graph-framework-messages'; -import type { SpaceEvent } from 'graph-framework-space-events'; -import { applyEvent } from 'graph-framework-space-events'; +} from '@graph-framework/messages'; +import { RequestMessage, deserialize, serialize } from '@graph-framework/messages'; +import type { SpaceEvent } from '@graph-framework/space-events'; +import { applyEvent } from '@graph-framework/space-events'; +import { Effect, Exit, Schema } from 'effect'; +import express from 'express'; import WebSocket, { WebSocketServer } from 'ws'; import { applySpaceEvent } from './handlers/applySpaceEvent.js'; import { createSpace } from './handlers/createSpace.js'; diff --git a/docs/framework.md b/docs/framework.md index 24b80d21..1f75cb6b 100644 --- a/docs/framework.md +++ b/docs/framework.md @@ -168,7 +168,7 @@ import { acceptInvite, createSpace, listSpaces, -} from "graph-framework"; +} from "@graphprotocol/graph-framework"; export const { SpaceProvider, diff --git a/package.json b/package.json index ee0b9522..dd918f96 100644 --- a/package.json +++ b/package.json @@ -20,5 +20,9 @@ "lint": "pnpm -r lint", "format": "pnpm -r format", "check": "pnpm -r check" + }, + "packageManager": "pnpm@9.14.4", + "engines": { + "node": ">=22" } } diff --git a/packages/graph-framework-identity/package.json b/packages/graph-framework-identity/package.json index e856a6c7..123d7d63 100644 --- a/packages/graph-framework-identity/package.json +++ b/packages/graph-framework-identity/package.json @@ -1,5 +1,5 @@ { - "name": "graph-framework-identity", + "name": "@graph-framework/identity", "version": "0.0.1", "description": "Contains utils and tools for creating identities for graph-framework dapp users. As well as handling authentication for dapps built ontop of the graph-framework.", "repository": { @@ -35,6 +35,6 @@ }, "dependencies": { "uuid": "^11.0.3", - "graph-framework-utils": "workspace:*" + "@graph-framework/utils": "workspace:*" } } diff --git a/packages/graph-framework-key/package.json b/packages/graph-framework-key/package.json index e58ac6b2..a9e794ad 100644 --- a/packages/graph-framework-key/package.json +++ b/packages/graph-framework-key/package.json @@ -1,5 +1,5 @@ { - "name": "graph-framework-key", + "name": "@graph-framework/key", "version": "0.0.1", "description": "Utilities for Space Keys and Key boxes", "repository": { diff --git a/packages/graph-framework-messages/package.json b/packages/graph-framework-messages/package.json index 73140cb7..d7d7424e 100644 --- a/packages/graph-framework-messages/package.json +++ b/packages/graph-framework-messages/package.json @@ -1,5 +1,5 @@ { - "name": "graph-framework-messages", + "name": "@graph-framework/messages", "version": "0.0.1", "description": "Provides types related to messages for the Graph Framework", "repository": { @@ -31,6 +31,6 @@ "@noble/ciphers": "^1.0.0", "@noble/curves": "^1.6.0", "effect": "^3.10.19", - "graph-framework-space-events": "workspace:*" + "@graph-framework/space-events": "workspace:*" } } diff --git a/packages/graph-framework-messages/src/types.ts b/packages/graph-framework-messages/src/types.ts index 2baf26db..8468aabf 100644 --- a/packages/graph-framework-messages/src/types.ts +++ b/packages/graph-framework-messages/src/types.ts @@ -1,10 +1,11 @@ import * as Schema from 'effect/Schema'; + import { AcceptInvitationEvent, CreateInvitationEvent, CreateSpaceEvent, SpaceEvent, -} from 'graph-framework-space-events'; +} from '@graph-framework/space-events'; export const Updates = Schema.Struct({ updates: Schema.Array(Schema.Uint8Array), diff --git a/packages/graph-framework-schema/package.json b/packages/graph-framework-schema/package.json index 34882b0a..b2e4667e 100644 --- a/packages/graph-framework-schema/package.json +++ b/packages/graph-framework-schema/package.json @@ -1,5 +1,5 @@ { - "name": "graph-framework-schema", + "name": "@graph-framework/schema", "version": "0.0.1", "description": "Generates a strongly-typed schema representation of a Space and exposes functionality for creating a provider, and react hooks to interact with that schema.", "repository": { @@ -48,6 +48,6 @@ }, "dependencies": { "fast-deep-equal": "^3.1.3", - "graph-framework-utils": "workspace:*" + "@graph-framework/utils": "workspace:*" } } diff --git a/packages/graph-framework-space-events/package.json b/packages/graph-framework-space-events/package.json index 811934d4..cc220422 100644 --- a/packages/graph-framework-space-events/package.json +++ b/packages/graph-framework-space-events/package.json @@ -1,5 +1,5 @@ { - "name": "graph-framework-space-events", + "name": "@graph-framework/space-events", "version": "0.0.1", "description": "Exposes functionality for events, and applying them, to a space.", "repository": { @@ -36,7 +36,7 @@ "dependencies": { "@noble/curves": "^1.6.0", "@noble/hashes": "^1.5.0", - "graph-framework-utils": "workspace:*", + "@graph-framework/utils": "workspace:*", "uuid": "^11.0.3" } } diff --git a/packages/graph-framework-space-events/src/accept-invitation.ts b/packages/graph-framework-space-events/src/accept-invitation.ts index 49d80758..d7dc1a93 100644 --- a/packages/graph-framework-space-events/src/accept-invitation.ts +++ b/packages/graph-framework-space-events/src/accept-invitation.ts @@ -1,6 +1,6 @@ +import { canonicalize, generateId, stringToUint8Array } from '@graph-framework/utils'; import { secp256k1 } from '@noble/curves/secp256k1'; import { Effect } from 'effect'; -import { canonicalize, generateId, stringToUint8Array } from 'graph-framework-utils'; import type { AcceptInvitationEvent, Author } from './types.js'; type Params = { diff --git a/packages/graph-framework-space-events/src/apply-event.ts b/packages/graph-framework-space-events/src/apply-event.ts index 9dd1b7e2..a8320e70 100644 --- a/packages/graph-framework-space-events/src/apply-event.ts +++ b/packages/graph-framework-space-events/src/apply-event.ts @@ -1,7 +1,7 @@ +import { canonicalize, stringToUint8Array } from '@graph-framework/utils'; import { secp256k1 } from '@noble/curves/secp256k1'; import { Effect, Schema } from 'effect'; import type { ParseError } from 'effect/ParseResult'; -import { canonicalize, stringToUint8Array } from 'graph-framework-utils'; import { hashEvent } from './hash-event.js'; import { InvalidEventError, diff --git a/packages/graph-framework-space-events/src/create-invitation.ts b/packages/graph-framework-space-events/src/create-invitation.ts index 60b36499..1cfc9d84 100644 --- a/packages/graph-framework-space-events/src/create-invitation.ts +++ b/packages/graph-framework-space-events/src/create-invitation.ts @@ -1,6 +1,8 @@ import { secp256k1 } from '@noble/curves/secp256k1'; import { Effect } from 'effect'; -import { canonicalize, generateId, stringToUint8Array } from 'graph-framework-utils'; + +import { canonicalize, generateId, stringToUint8Array } from '@graph-framework/utils'; + import type { Author, CreateInvitationEvent } from './types.js'; type Params = { diff --git a/packages/graph-framework-space-events/src/create-space.ts b/packages/graph-framework-space-events/src/create-space.ts index 1089ad92..94a56a57 100644 --- a/packages/graph-framework-space-events/src/create-space.ts +++ b/packages/graph-framework-space-events/src/create-space.ts @@ -1,7 +1,7 @@ import { secp256k1 } from '@noble/curves/secp256k1'; import { Effect } from 'effect'; -import { canonicalize, generateId, stringToUint8Array } from 'graph-framework-utils'; +import { canonicalize, generateId, stringToUint8Array } from '@graph-framework/utils'; import type { Author, CreateSpaceEvent } from './types.js'; diff --git a/packages/graph-framework-space-events/src/delete-space.ts b/packages/graph-framework-space-events/src/delete-space.ts index 3ed3935b..bb238593 100644 --- a/packages/graph-framework-space-events/src/delete-space.ts +++ b/packages/graph-framework-space-events/src/delete-space.ts @@ -1,6 +1,8 @@ import { secp256k1 } from '@noble/curves/secp256k1'; import { Effect } from 'effect'; -import { canonicalize, stringToUint8Array } from 'graph-framework-utils'; + +import { canonicalize, stringToUint8Array } from '@graph-framework/utils'; + import type { Author, DeleteSpaceEvent, SpaceEvent } from './types.js'; type Params = { diff --git a/packages/graph-framework-space-events/src/hash-event.ts b/packages/graph-framework-space-events/src/hash-event.ts index 30a630ef..8bb9bbd5 100644 --- a/packages/graph-framework-space-events/src/hash-event.ts +++ b/packages/graph-framework-space-events/src/hash-event.ts @@ -1,6 +1,8 @@ import { blake3 } from '@noble/hashes/blake3'; import { bytesToHex } from '@noble/hashes/utils'; -import { canonicalize } from 'graph-framework-utils'; + +import { canonicalize } from '@graph-framework/utils'; + import type { SpaceEvent } from './types.js'; export const hashEvent = (event: SpaceEvent): string => { diff --git a/packages/graph-framework-space-events/test/apply-event.test.ts b/packages/graph-framework-space-events/test/apply-event.test.ts index 69319ce7..0af38af4 100644 --- a/packages/graph-framework-space-events/test/apply-event.test.ts +++ b/packages/graph-framework-space-events/test/apply-event.test.ts @@ -2,7 +2,7 @@ import { secp256k1 } from '@noble/curves/secp256k1'; import { Cause, Effect, Exit } from 'effect'; import { expect, it } from 'vitest'; -import { canonicalize, stringToUint8Array } from 'graph-framework-utils'; +import { canonicalize, stringToUint8Array } from '@graph-framework/utils'; import { applyEvent } from '../src/apply-event.js'; import { createInvitation } from '../src/create-invitation.js'; diff --git a/packages/graph-framework-utils/README.md b/packages/graph-framework-utils/README.md index 58d8f5fe..e28ba91c 100644 --- a/packages/graph-framework-utils/README.md +++ b/packages/graph-framework-utils/README.md @@ -9,7 +9,7 @@ _All utilities must be runnable on: Browser, NodeJS server, ReactNative._ - `generateId()` - generates a base58 encoded ID from a generated v4 UUID. ```ts -import { generateId } from "graph-framework-utils"; +import { generateId } from "@graph-framework/utils"; const id = generateId(); console.log(id); // Gw9uTVTnJdhtczyuzBkL3X @@ -21,7 +21,7 @@ console.log(id); // Gw9uTVTnJdhtczyuzBkL3X ```ts import { v4 } from "uuid"; -import { encodeBase58 } from "graph-framework-utils/base58"; +import { encodeBase58 } from "@graph-framework/utils"; const uuid = v4(); // 92539817-7989-4083-ab80-e9c2b2b66669 const stripped = uuid.replaceAll(/-/g, ""); // 9253981779894083ab80e9c2b2b66669 @@ -33,7 +33,7 @@ console.log(encoded); // K51CbDqxW35osbjPo5ZF77 ```ts import { v4 } from "uuid"; -import { decodeBase58ToUUID, encodeBase58 } from "graph-framework-utils/base58"; +import { decodeBase58ToUUID, encodeBase58 } from "@graph-framework/utils"; const uuid = v4(); // 92539817-7989-4083-ab80-e9c2b2b66669 const stripped = uuid.replaceAll(/-/g, ""); // 9253981779894083ab80e9c2b2b66669 @@ -49,7 +49,7 @@ expect(decoded).toEqual(uuid); - `canonicalize` - JSON canonicalize function. Creates crypto safe predictable canocalization of JSON as defined by RFC8785. ```ts -import { canonicalize } from 'graph-framework-utils' +import { canonicalize } from '@graph-framework/utils' console.log(canonicalize(null)) // 'null' console.log(canonicalize(1)) // '1' diff --git a/packages/graph-framework-utils/package.json b/packages/graph-framework-utils/package.json index 1309feea..598ff258 100644 --- a/packages/graph-framework-utils/package.json +++ b/packages/graph-framework-utils/package.json @@ -1,5 +1,5 @@ { - "name": "graph-framework-utils", + "name": "@graph-framework/utils", "version": "0.0.1", "description": "Provides common utilities for the Graph Framework", "repository": { diff --git a/packages/graph-framework-utils/src/generateId.ts b/packages/graph-framework-utils/src/generateId.ts index dba4ca7b..9bb5bda6 100644 --- a/packages/graph-framework-utils/src/generateId.ts +++ b/packages/graph-framework-utils/src/generateId.ts @@ -9,7 +9,7 @@ import { encodeBase58 } from './base58.js'; * * @example * ``` - * import { generateId } from 'graph-framework-utils' + * import { generateId } from '@graph-framework/utils' * * const id = generateId() * console.log(id) // Gw9uTVTnJdhtczyuzBkL3X diff --git a/packages/graph-framework-utils/src/jsc.ts b/packages/graph-framework-utils/src/jsc.ts index 4d552bc6..0886eb2f 100644 --- a/packages/graph-framework-utils/src/jsc.ts +++ b/packages/graph-framework-utils/src/jsc.ts @@ -18,7 +18,7 @@ export class InfinityNotAllowedError extends Error { * * @example Primitive values * ```ts - * import { canonicalize } from 'graph-framework-utils' + * import { canonicalize } from '@graph-framework/utils' * * console.log(canonicalize(null)) // 'null' * console.log(canonicalize(1)) // '1' @@ -28,7 +28,7 @@ export class InfinityNotAllowedError extends Error { * * @example Objects * ``` - * import { canonicalize } from 'graph-framework-utils' + * import { canonicalize } from '@graph-framework/utils' * * const json = { * from_account: '543 232 625-3', @@ -41,7 +41,7 @@ export class InfinityNotAllowedError extends Error { * * @example Arrays * ```ts - * import { canonicalize } from 'graph-framework-utils' + * import { canonicalize } from '@graph-framework/utils' * * console.log(canonicalize([1, 'text', null, true, false])) // '[1,"text",null,true,false]' * ``` diff --git a/packages/graph-framework/package.json b/packages/graph-framework/package.json index d99ab213..ce4975cb 100644 --- a/packages/graph-framework/package.json +++ b/packages/graph-framework/package.json @@ -1,5 +1,5 @@ { - "name": "graph-framework", + "name": "@graphprotocol/graph-framework", "version": "0.0.1", "description": "SDK for building performant, type-safe, local-first dapps on top of The Graph ecosystem knowledge graphs.", "repository": { @@ -69,11 +69,11 @@ "jsdom": "^25.0.1" }, "dependencies": { - "graph-framework-utils": "workspace:*", - "graph-framework-space-events": "workspace:*", - "graph-framework-identity": "workspace:*", - "graph-framework-schema": "workspace:*", - "graph-framework-messages": "workspace:*", - "graph-framework-key": "workspace:*" + "@graph-framework/utils": "workspace:*", + "@graph-framework/space-events": "workspace:*", + "@graph-framework/identity": "workspace:*", + "@graph-framework/schema": "workspace:*", + "@graph-framework/messages": "workspace:*", + "@graph-framework/key": "workspace:*" } } diff --git a/packages/graph-framework/src/exports/identity.ts b/packages/graph-framework/src/exports/identity.ts index 6fe02302..2ec72d43 100644 --- a/packages/graph-framework/src/exports/identity.ts +++ b/packages/graph-framework/src/exports/identity.ts @@ -1 +1 @@ -export * from 'graph-framework-identity'; +export * from '@graph-framework/identity'; diff --git a/packages/graph-framework/src/exports/key.ts b/packages/graph-framework/src/exports/key.ts index e6fca0aa..7d1e0fd8 100644 --- a/packages/graph-framework/src/exports/key.ts +++ b/packages/graph-framework/src/exports/key.ts @@ -1 +1 @@ -export * from 'graph-framework-key'; +export * from '@graph-framework/key'; diff --git a/packages/graph-framework/src/exports/messages.ts b/packages/graph-framework/src/exports/messages.ts index 4498a4b2..56a04f0f 100644 --- a/packages/graph-framework/src/exports/messages.ts +++ b/packages/graph-framework/src/exports/messages.ts @@ -1 +1 @@ -export * from 'graph-framework-messages'; +export * from '@graph-framework/messages'; diff --git a/packages/graph-framework/src/exports/schema.tsx b/packages/graph-framework/src/exports/schema.tsx index 816f9f65..72582b03 100644 --- a/packages/graph-framework/src/exports/schema.tsx +++ b/packages/graph-framework/src/exports/schema.tsx @@ -1 +1 @@ -export * from 'graph-framework-schema'; +export * from '@graph-framework/schema'; diff --git a/packages/graph-framework/src/exports/space-events.ts b/packages/graph-framework/src/exports/space-events.ts index e3087c9c..2f415074 100644 --- a/packages/graph-framework/src/exports/space-events.ts +++ b/packages/graph-framework/src/exports/space-events.ts @@ -1 +1 @@ -export * from 'graph-framework-space-events'; +export * from '@graph-framework/space-events'; diff --git a/packages/graph-framework/src/exports/utils.ts b/packages/graph-framework/src/exports/utils.ts index e4a14e52..bfb6a563 100644 --- a/packages/graph-framework/src/exports/utils.ts +++ b/packages/graph-framework/src/exports/utils.ts @@ -1 +1 @@ -export * from 'graph-framework-utils'; +export * from '@graph-framework/utils'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 23273ad0..3c8e6cae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,6 +38,9 @@ importers: '@automerge/automerge-repo-react-hooks': specifier: ^1.2.1 version: 1.2.1(@swc/core@1.7.26(@swc/helpers@0.5.13))(@types/node@22.9.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3) + '@graphprotocol/graph-framework': + specifier: workspace:* + version: link:../../packages/graph-framework '@noble/hashes': specifier: ^1.5.0 version: 1.5.0 @@ -74,9 +77,6 @@ importers: ethers: specifier: ^6.13.3 version: 6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10) - graph-framework: - specifier: workspace:* - version: link:../../packages/graph-framework lucide-react: specifier: ^0.441.0 version: 0.441.0(react@18.3.1) @@ -144,6 +144,12 @@ importers: apps/server: dependencies: + '@graph-framework/messages': + specifier: workspace:* + version: link:../../packages/graph-framework-messages + '@graph-framework/space-events': + specifier: workspace:* + version: link:../../packages/graph-framework-space-events '@prisma/client': specifier: 5.22.0 version: 5.22.0(prisma@5.22.0) @@ -159,12 +165,6 @@ importers: express: specifier: ^5.0.1 version: 5.0.1 - graph-framework-messages: - specifier: workspace:* - version: link:../../packages/graph-framework-messages - graph-framework-space-events: - specifier: workspace:* - version: link:../../packages/graph-framework-space-events ws: specifier: ^8.17.1 version: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -199,22 +199,22 @@ importers: packages/graph-framework: dependencies: - graph-framework-identity: + '@graph-framework/identity': specifier: workspace:* version: link:../graph-framework-identity - graph-framework-key: + '@graph-framework/key': specifier: workspace:* version: link:../graph-framework-key - graph-framework-messages: + '@graph-framework/messages': specifier: workspace:* version: link:../graph-framework-messages - graph-framework-schema: + '@graph-framework/schema': specifier: workspace:* version: link:../graph-framework-schema - graph-framework-space-events: + '@graph-framework/space-events': specifier: workspace:* version: link:../graph-framework-space-events - graph-framework-utils: + '@graph-framework/utils': specifier: workspace:* version: link:../graph-framework-utils react: @@ -251,7 +251,7 @@ importers: packages/graph-framework-identity: dependencies: - graph-framework-utils: + '@graph-framework/utils': specifier: workspace:* version: link:../graph-framework-utils uuid: @@ -279,6 +279,9 @@ importers: packages/graph-framework-messages: dependencies: + '@graph-framework/space-events': + specifier: workspace:* + version: link:../graph-framework-space-events '@noble/ciphers': specifier: ^1.0.0 version: 1.0.0 @@ -288,18 +291,15 @@ importers: effect: specifier: ^3.10.19 version: 3.10.19 - graph-framework-space-events: - specifier: workspace:* - version: link:../graph-framework-space-events packages/graph-framework-schema: dependencies: + '@graph-framework/utils': + specifier: workspace:* + version: link:../graph-framework-utils fast-deep-equal: specifier: ^3.1.3 version: 3.1.3 - graph-framework-utils: - specifier: workspace:* - version: link:../graph-framework-utils react: specifier: ^18 version: 18.3.1 @@ -337,15 +337,15 @@ importers: packages/graph-framework-space-events: dependencies: + '@graph-framework/utils': + specifier: workspace:* + version: link:../graph-framework-utils '@noble/curves': specifier: ^1.6.0 version: 1.6.0 '@noble/hashes': specifier: ^1.5.0 version: 1.5.0 - graph-framework-utils: - specifier: workspace:* - version: link:../graph-framework-utils uuid: specifier: ^11.0.3 version: 11.0.3 diff --git a/tsconfig.base.json b/tsconfig.base.json index 2039fa7b..6f102736 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -39,20 +39,20 @@ "jsx": "react-jsx", "paths": { - "graph-framework": ["./packages/graph-framework/src/index.js"], - "graph-framework/*": ["./packages/graph-framework/src/*.js"], - "graph-framework-utils": ["./packages/graph-framework-utils/src/index.js"], - "graph-framework-utils/*": ["./packages/graph-framework-utils/src/*.js"], - "graph-framework-space-events": ["./packages/graph-framework-space-events/src/index.js"], - "graph-framework-space-events/*": ["./packages/graph-framework-space-events/src/*.js"], - "graph-framework-messages": ["./packages/graph-framework-messages/src/index.js"], - "graph-framework-messages/*": ["./packages/graph-framework-messages/src/*.js"], - "graph-framework-key": ["./packages/graph-framework-key/src/index.js"], - "graph-framework-key/*": ["./packages/graph-framework-key/src/*.js"], - "graph-framework-schema": ["./packages/graph-framework-schema/src/index.js"], - "graph-framework-schema/*": ["./packages/graph-framework-schema/src/*.js"], - "graph-framework-identity": ["./packages/graph-framework-identity/src/index.js"], - "graph-framework-identity/*": ["./packages/graph-framework-identity/src/*.js"] + "@graphprotocol/graph-framework": ["./packages/graph-framework/src/index.js"], + "@graphprotocol/graph-framework/*": ["./packages/graph-framework/src/*.js"], + "@graph-framework/utils": ["./packages/graph-framework-utils/src/index.js"], + "@graph-framework/utils/*": ["./packages/graph-framework-utils/src/*.js"], + "@graph-framework/space-events": ["./packages/graph-framework-space-events/src/index.js"], + "@graph-framework/space-events/*": ["./packages/graph-framework-space-events/src/*.js"], + "@graph-framework/messages": ["./packages/graph-framework-messages/src/index.js"], + "@graph-framework/messages/*": ["./packages/graph-framework-messages/src/*.js"], + "@graph-framework/key": ["./packages/graph-framework-key/src/index.js"], + "@graph-framework/key/*": ["./packages/graph-framework-key/src/*.js"], + "@graph-framework/schema": ["./packages/graph-framework-schema/src/index.js"], + "@graph-framework/schema/*": ["./packages/graph-framework-schema/src/*.js"], + "@graph-framework/identity": ["./packages/graph-framework-identity/src/index.js"], + "@graph-framework/identity/*": ["./packages/graph-framework-identity/src/*.js"] } } } diff --git a/vitest.shared.ts b/vitest.shared.ts index 65a7c178..acde6c85 100644 --- a/vitest.shared.ts +++ b/vitest.shared.ts @@ -2,9 +2,11 @@ import * as path from 'node:path'; import type { ViteUserConfig } from 'vitest/config'; const alias = (pkg: string, dir = pkg) => { + const name = pkg === 'graph-framework' ? '@graphprotocol/graph-framework' : `@graph-framework/${pkg}`; + return { - [`${pkg}/test`]: path.join(__dirname, 'packages', dir, 'test'), - [`${pkg}`]: path.join(__dirname, 'packages', dir, 'src'), + [`${name}/test`]: path.join(__dirname, 'packages', dir, 'test'), + [`${name}`]: path.join(__dirname, 'packages', dir, 'src'), }; };