From cbbc85347619772b9fd9e644b0fe179d93284795 Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Tue, 22 Jul 2025 20:59:30 +0200 Subject: [PATCH 1/4] upgrade biome --- package.json | 2 +- pnpm-lock.yaml | 98 ++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 92 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index f6755eb9..bacaa966 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "devDependencies": { "@babel/cli": "^7.28.0", "@babel/core": "^7.28.0", - "@biomejs/biome": "1.9.4", + "@biomejs/biome": "2.0.6", "@changesets/cli": "^2.29.5", "@graphprotocol/grc-20": "^0.21.6", "babel-plugin-annotate-pure-calls": "^0.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 146fd3c2..6d208d5d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^7.28.0 version: 7.28.0 '@biomejs/biome': - specifier: 1.9.4 - version: 1.9.4 + specifier: 2.0.6 + version: 2.0.6 '@changesets/cli': specifier: ^2.29.5 version: 2.29.5 @@ -297,7 +297,7 @@ importers: version: 7.1.2(graphql@16.11.0) isomorphic-ws: specifier: ^5.0.0 - version: 5.0.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + version: 5.0.0(ws@8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)) lucide-react: specifier: ^0.508.0 version: 0.508.0(react@19.1.0) @@ -1836,54 +1836,107 @@ packages: engines: {node: '>=14.21.3'} hasBin: true + '@biomejs/biome@2.0.6': + resolution: {integrity: sha512-RRP+9cdh5qwe2t0gORwXaa27oTOiQRQvrFf49x2PA1tnpsyU7FIHX4ZOFMtBC4QNtyWsN7Dqkf5EDbg4X+9iqA==} + engines: {node: '>=14.21.3'} + hasBin: true + '@biomejs/cli-darwin-arm64@1.9.4': resolution: {integrity: sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [darwin] + '@biomejs/cli-darwin-arm64@2.0.6': + resolution: {integrity: sha512-AzdiNNjNzsE6LfqWyBvcL29uWoIuZUkndu+wwlXW13EKcBHbbKjNQEZIJKYDc6IL+p7bmWGx3v9ZtcRyIoIz5A==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [darwin] + '@biomejs/cli-darwin-x64@1.9.4': resolution: {integrity: sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [darwin] + '@biomejs/cli-darwin-x64@2.0.6': + resolution: {integrity: sha512-wJjjP4E7bO4WJmiQaLnsdXMa516dbtC6542qeRkyJg0MqMXP0fvs4gdsHhZ7p9XWTAmGIjZHFKXdsjBvKGIJJQ==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [darwin] + '@biomejs/cli-linux-arm64-musl@1.9.4': resolution: {integrity: sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] + '@biomejs/cli-linux-arm64-musl@2.0.6': + resolution: {integrity: sha512-CVPEMlin3bW49sBqLBg2x016Pws7eUXA27XYDFlEtponD0luYjg2zQaMJ2nOqlkKG9fqzzkamdYxHdMDc2gZFw==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + '@biomejs/cli-linux-arm64@1.9.4': resolution: {integrity: sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] + '@biomejs/cli-linux-arm64@2.0.6': + resolution: {integrity: sha512-ZSVf6TYo5rNMUHIW1tww+rs/krol7U5A1Is/yzWyHVZguuB0lBnIodqyFuwCNqG9aJGyk7xIMS8HG0qGUPz0SA==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + '@biomejs/cli-linux-x64-musl@1.9.4': resolution: {integrity: sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] + '@biomejs/cli-linux-x64-musl@2.0.6': + resolution: {integrity: sha512-mKHE/e954hR/hSnAcJSjkf4xGqZc/53Kh39HVW1EgO5iFi0JutTN07TSjEMg616julRtfSNJi0KNyxvc30Y4rQ==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + '@biomejs/cli-linux-x64@1.9.4': resolution: {integrity: sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] + '@biomejs/cli-linux-x64@2.0.6': + resolution: {integrity: sha512-geM1MkHTV1Kh2Cs/Xzot9BOF3WBacihw6bkEmxkz4nSga8B9/hWy5BDiOG3gHDGIBa8WxT0nzsJs2f/hPqQIQw==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + '@biomejs/cli-win32-arm64@1.9.4': resolution: {integrity: sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [win32] + '@biomejs/cli-win32-arm64@2.0.6': + resolution: {integrity: sha512-290V4oSFoKaprKE1zkYVsDfAdn0An5DowZ+GIABgjoq1ndhvNxkJcpxPsiYtT7slbVe3xmlT0ncdfOsN7KruzA==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [win32] + '@biomejs/cli-win32-x64@1.9.4': resolution: {integrity: sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==} engines: {node: '>=14.21.3'} cpu: [x64] os: [win32] + '@biomejs/cli-win32-x64@2.0.6': + resolution: {integrity: sha512-bfM1Bce0d69Ao7pjTjUS+AWSZ02+5UHdiAP85Th8e9yV5xzw6JrHXbL5YWlcEKQ84FIZMdDc7ncuti1wd2sdbw==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [win32] + '@bufbuild/protobuf@1.10.1': resolution: {integrity: sha512-wJ8ReQbHxsAfXhrf9ixl0aYbZorRuOWpBNzm8pL8ftmSxQx/wnJD5Eg861NwJU/czy2VXFIebCeZnZrI9rktIQ==} @@ -14050,30 +14103,65 @@ snapshots: '@biomejs/cli-win32-arm64': 1.9.4 '@biomejs/cli-win32-x64': 1.9.4 + '@biomejs/biome@2.0.6': + optionalDependencies: + '@biomejs/cli-darwin-arm64': 2.0.6 + '@biomejs/cli-darwin-x64': 2.0.6 + '@biomejs/cli-linux-arm64': 2.0.6 + '@biomejs/cli-linux-arm64-musl': 2.0.6 + '@biomejs/cli-linux-x64': 2.0.6 + '@biomejs/cli-linux-x64-musl': 2.0.6 + '@biomejs/cli-win32-arm64': 2.0.6 + '@biomejs/cli-win32-x64': 2.0.6 + '@biomejs/cli-darwin-arm64@1.9.4': optional: true + '@biomejs/cli-darwin-arm64@2.0.6': + optional: true + '@biomejs/cli-darwin-x64@1.9.4': optional: true + '@biomejs/cli-darwin-x64@2.0.6': + optional: true + '@biomejs/cli-linux-arm64-musl@1.9.4': optional: true + '@biomejs/cli-linux-arm64-musl@2.0.6': + optional: true + '@biomejs/cli-linux-arm64@1.9.4': optional: true + '@biomejs/cli-linux-arm64@2.0.6': + optional: true + '@biomejs/cli-linux-x64-musl@1.9.4': optional: true + '@biomejs/cli-linux-x64-musl@2.0.6': + optional: true + '@biomejs/cli-linux-x64@1.9.4': optional: true + '@biomejs/cli-linux-x64@2.0.6': + optional: true + '@biomejs/cli-win32-arm64@1.9.4': optional: true + '@biomejs/cli-win32-arm64@2.0.6': + optional: true + '@biomejs/cli-win32-x64@1.9.4': optional: true + '@biomejs/cli-win32-x64@2.0.6': + optional: true + '@bufbuild/protobuf@1.10.1': {} '@cbor-extract/cbor-extract-darwin-arm64@2.2.0': @@ -23209,10 +23297,6 @@ snapshots: dependencies: ws: 7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10) - isomorphic-ws@5.0.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)): - dependencies: - ws: 8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) - isomorphic-ws@5.0.0(ws@8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)): dependencies: ws: 8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) From 6527655fb510f67f98d584436a3e9ce236973e7f Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Tue, 22 Jul 2025 21:00:16 +0200 Subject: [PATCH 2/4] migrate to biome 2 --- biome.jsonc | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/biome.jsonc b/biome.jsonc index 74d8c711..378cbd6f 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "$schema": "https://biomejs.dev/schemas/2.0.6/schema.json", "vcs": { "enabled": true, "clientKind": "git", @@ -7,17 +7,18 @@ }, "files": { "ignoreUnknown": false, - "ignore": [ - "node_modules/", - "**/node_modules", - "**/dist", - "routeTree.gen.ts", - "tsconfig.json", - "tsconfig.*.json", - "**/variant-schema.ts", - "apps/typesync/client/src/generated", - "apps/create-hypergraph-app/template-*/**", - "*.css" + "includes": [ + "**", + "!**/node_modules/", + "!**/node_modules", + "!**/dist", + "!**/routeTree.gen.ts", + "!**/tsconfig.json", + "!**/tsconfig.*.json", + "!**/variant-schema.ts", + "!**/apps/typesync/client/src/generated", + "!**/apps/create-hypergraph-app/template-*/**", + "!**/*.css" ] }, "formatter": { @@ -26,13 +27,23 @@ "indentWidth": 2, "lineWidth": 120 }, - "organizeImports": { - "enabled": true - }, + "assist": { "actions": { "source": { "organizeImports": "on" } } }, "linter": { "enabled": true, "rules": { - "recommended": true + "recommended": true, + "style": { + "noParameterAssign": "error", + "useAsConstAssertion": "error", + "useDefaultParameterLast": "error", + "useEnumInitializers": "error", + "useSelfClosingElements": "error", + "useSingleVarDeclarator": "error", + "noUnusedTemplateLiteral": "error", + "useNumberNamespace": "error", + "noInferrableTypes": "error", + "noUselessElse": "error" + } } }, "javascript": { From 4fe37ecc14a46ccdd6407e69ec46f00f19eaa590 Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Tue, 22 Jul 2025 21:35:34 +0200 Subject: [PATCH 3/4] apply lint fixes --- apps/connect/src/Boot.tsx | 2 +- .../src/components/CreateSpaceCard.tsx | 4 +- apps/connect/src/components/LogoutButton.tsx | 2 +- apps/connect/src/components/SpacesCard.tsx | 2 +- apps/connect/src/components/ui/Loading.tsx | 2 +- apps/connect/src/hooks/use-private-spaces.ts | 2 +- apps/connect/src/routes/__root.tsx | 8 +- apps/connect/src/routes/authenticate.tsx | 12 +-- apps/connect/src/routes/index.tsx | 6 +- apps/connect/src/routes/login.lazy.tsx | 6 +- apps/create-hypergraph-app/package.json | 13 +++- apps/events/src/Boot.tsx | 2 +- apps/events/src/components/create-events.tsx | 5 +- .../create-properties-and-types-event.tsx | 5 +- .../create-properties-and-types-todos.tsx | 5 +- apps/events/src/components/spinner.tsx | 2 +- apps/events/src/components/todos2.tsx | 2 +- apps/events/src/components/ui/button.tsx | 2 +- apps/events/src/components/ui/modal.tsx | 1 + apps/events/src/routes/__root.tsx | 74 +++++++++---------- .../src/routes/account-inbox/$inboxId.tsx | 3 +- apps/events/src/routes/index.tsx | 8 +- apps/events/src/routes/login.lazy.tsx | 2 +- apps/events/src/routes/playground.lazy.tsx | 4 +- apps/events/src/routes/space/$spaceId.tsx | 2 +- .../events/src/routes/space/$spaceId/chat.tsx | 2 +- .../src/routes/space/$spaceId/events.tsx | 2 +- .../src/routes/space/$spaceId/index.tsx | 6 +- .../src/routes/space/$spaceId/playground.tsx | 2 +- .../space/$spaceId/public-integration.tsx | 4 +- .../src/routes/space/$spaceId/users.tsx | 4 +- apps/next-example/src/app/layout.tsx | 2 +- .../next-example/src/components/providers.tsx | 2 +- apps/server/src/handlers/applySpaceEvent.ts | 3 +- apps/server/src/handlers/create-space.ts | 4 +- apps/server/src/handlers/createUpdate.ts | 2 +- apps/server/src/handlers/listInvitations.ts | 3 +- apps/server/src/index.ts | 44 +++++++---- .../SchemaBuilder/TypeSelect.tsx | 2 +- .../Components/App/Schema/SchemaPreview.tsx | 2 +- apps/typesync/client/src/Providers.tsx | 2 +- apps/typesync/client/src/clients/router.tsx | 6 +- .../typesync/client/src/hooks/useAppQuery.tsx | 2 +- .../typesync/client/src/hooks/useCWDQuery.tsx | 2 +- .../src/hooks/useSchemaBrowserQuery.tsx | 8 +- apps/typesync/client/src/routes/__root.tsx | 2 +- .../client/src/routes/apps/$appId/details.tsx | 2 +- .../client/src/routes/apps/create.tsx | 6 +- apps/typesync/client/src/routes/index.tsx | 2 +- apps/typesync/client/src/schema.ts | 2 +- apps/typesync/domain/Domain.ts | 2 +- apps/typesync/package.json | 5 +- docs/package.json | 12 ++- docs/src/components/HomepageFeatures/index.js | 2 +- docs/src/pages/index.js | 3 +- packages/hypergraph-react/package.json | 8 +- .../src/HypergraphAppContext.tsx | 33 +++------ .../src/HypergraphSpaceContext.tsx | 2 +- .../components/publish-diff/entity-card.tsx | 2 + .../publish-diff/updated-entity-card.tsx | 26 +++---- .../src/create-wallet-client.ts | 2 +- .../src/hooks/useExternalSpaceInbox.ts | 8 +- packages/hypergraph-react/src/index.ts | 14 ++-- .../src/internal/generate-delete-ops.tsx | 2 +- .../src/internal/use-create-entity-public.ts | 5 +- .../src/internal/use-delete-entity-public.tsx | 2 +- .../src/internal/use-generate-update-ops.tsx | 1 + .../src/internal/use-query-public.tsx | 2 +- .../hypergraph-react/src/prepare-publish.ts | 2 +- packages/hypergraph-react/src/use-query.tsx | 4 +- .../test/HypergraphAppContext.test.tsx | 5 +- .../test/HypergraphSpaceContext.test.tsx | 7 +- packages/hypergraph-react/vitest.config.ts | 2 +- .../src/connect/identity-encryption.ts | 5 +- packages/hypergraph/src/connect/login.ts | 4 +- .../src/connect/parse-auth-params.ts | 2 +- .../hypergraph/src/connect/smart-account.ts | 24 +++--- packages/hypergraph/src/entity/findMany.ts | 4 +- packages/hypergraph/src/entity/update.ts | 2 +- .../src/identity/identity-encryption.ts | 2 +- packages/hypergraph/src/identity/index.ts | 2 +- .../src/identity/prove-ownership.ts | 5 +- packages/hypergraph/src/inboxes/index.ts | 2 +- packages/hypergraph/src/index.ts | 2 +- .../src/space-info/decrypt-space-info.ts | 8 +- packages/hypergraph/src/store-connect.ts | 2 +- packages/hypergraph/src/store.ts | 2 +- .../hypergraph/test/entity/entity.test.ts | 5 +- .../hypergraph/test/entity/findMany.test.ts | 5 +- .../hypergraph/test/identity/connect.test.ts | 3 +- .../hypergraph/test/inboxes/inboxes.test.ts | 4 +- .../test/space-events/apply-event.test.ts | 6 +- packages/hypergraph/test/utils/jsc.test.ts | 2 +- packages/hypergraph/vitest.config.ts | 2 +- packages/typesync/package.json | 6 +- packages/typesync/test/Mapping.test.ts | 4 +- packages/typesync/vitest.config.ts | 2 +- 97 files changed, 285 insertions(+), 265 deletions(-) diff --git a/apps/connect/src/Boot.tsx b/apps/connect/src/Boot.tsx index d5aeebec..8c36458d 100644 --- a/apps/connect/src/Boot.tsx +++ b/apps/connect/src/Boot.tsx @@ -1,7 +1,7 @@ import { Connect, StoreConnect } from '@graphprotocol/hypergraph'; import { PrivyProvider } from '@privy-io/react-auth'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import { RouterProvider, createRouter } from '@tanstack/react-router'; +import { createRouter, RouterProvider } from '@tanstack/react-router'; import { useLayoutEffect, useRef } from 'react'; import { getAddress } from 'viem'; import { routeTree } from './routeTree.gen'; diff --git a/apps/connect/src/components/CreateSpaceCard.tsx b/apps/connect/src/components/CreateSpaceCard.tsx index 94b2204b..3885a169 100644 --- a/apps/connect/src/components/CreateSpaceCard.tsx +++ b/apps/connect/src/components/CreateSpaceCard.tsx @@ -1,5 +1,3 @@ -import { Loading } from '@/components/ui/Loading'; -import { cn } from '@/lib/utils'; import { Graph } from '@graphprotocol/grc-20'; import { Key, type Messages, SpaceEvents, SpaceInfo, StoreConnect, Utils } from '@graphprotocol/hypergraph'; import { useIdentityToken } from '@privy-io/react-auth'; @@ -7,6 +5,8 @@ import { useQueryClient } from '@tanstack/react-query'; import { useSelector } from '@xstate/store/react'; import { Effect } from 'effect'; import { useState } from 'react'; +import { Loading } from '@/components/ui/Loading'; +import { cn } from '@/lib/utils'; interface CreateSpaceCardProps extends Omit, 'children'> {} diff --git a/apps/connect/src/components/LogoutButton.tsx b/apps/connect/src/components/LogoutButton.tsx index 6b525c18..69df529d 100644 --- a/apps/connect/src/components/LogoutButton.tsx +++ b/apps/connect/src/components/LogoutButton.tsx @@ -1,8 +1,8 @@ -import { Loading } from '@/components/ui/Loading'; import { Connect } from '@graphprotocol/hypergraph'; import { usePrivy } from '@privy-io/react-auth'; import { useRouter } from '@tanstack/react-router'; import { useState } from 'react'; +import { Loading } from '@/components/ui/Loading'; export function LogoutButton() { const { logout: privyLogout, ready, authenticated } = usePrivy(); diff --git a/apps/connect/src/components/SpacesCard.tsx b/apps/connect/src/components/SpacesCard.tsx index ff3d0b11..19abbd0e 100644 --- a/apps/connect/src/components/SpacesCard.tsx +++ b/apps/connect/src/components/SpacesCard.tsx @@ -1,8 +1,8 @@ +import { Popover } from '@base-ui-components/react/popover'; import { Loading } from '@/components/ui/Loading'; import type { PrivateSpaceData } from '@/hooks/use-private-spaces'; import type { PublicSpaceData } from '@/hooks/use-public-spaces'; import { cn } from '@/lib/utils'; -import { Popover } from '@base-ui-components/react/popover'; interface SpacesCardProps extends Omit, 'children'> { spaces: (PublicSpaceData | PrivateSpaceData)[]; diff --git a/apps/connect/src/components/ui/Loading.tsx b/apps/connect/src/components/ui/Loading.tsx index 0614380f..1a734054 100644 --- a/apps/connect/src/components/ui/Loading.tsx +++ b/apps/connect/src/components/ui/Loading.tsx @@ -1,7 +1,7 @@ 'use client'; -import { cn } from '@/lib/utils'; import { Loader2 } from 'lucide-react'; +import { cn } from '@/lib/utils'; interface LoadingProps extends React.HTMLAttributes { /** @default false */ diff --git a/apps/connect/src/hooks/use-private-spaces.ts b/apps/connect/src/hooks/use-private-spaces.ts index 2b0369b2..377bb212 100644 --- a/apps/connect/src/hooks/use-private-spaces.ts +++ b/apps/connect/src/hooks/use-private-spaces.ts @@ -1,7 +1,7 @@ -import { getAppInfoByIds } from '@/lib/get-app-info-by-ids'; import { Connect } from '@graphprotocol/hypergraph'; import { useIdentityToken } from '@privy-io/react-auth'; import { type UseQueryResult, useQuery } from '@tanstack/react-query'; +import { getAppInfoByIds } from '@/lib/get-app-info-by-ids'; export type PrivateSpaceData = { id: string; diff --git a/apps/connect/src/routes/__root.tsx b/apps/connect/src/routes/__root.tsx index 515ef051..4464d07b 100644 --- a/apps/connect/src/routes/__root.tsx +++ b/apps/connect/src/routes/__root.tsx @@ -1,11 +1,11 @@ -import GeoLogo from '@/assets/images/geo-logo-branded.svg?react'; -import { LogoutButton } from '@/components/LogoutButton'; -import { AppTitle } from '@/components/ui/AppTitle'; import { StoreConnect } from '@graphprotocol/hypergraph'; import { usePrivy } from '@privy-io/react-auth'; -import { Outlet, createRootRoute, useLayoutEffect, useRouter } from '@tanstack/react-router'; +import { createRootRoute, Outlet, useLayoutEffect, useRouter } from '@tanstack/react-router'; import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'; import { useSelector } from '@xstate/store/react'; +import GeoLogo from '@/assets/images/geo-logo-branded.svg?react'; +import { LogoutButton } from '@/components/LogoutButton'; +import { AppTitle } from '@/components/ui/AppTitle'; export const Route = createRootRoute({ component: () => { diff --git a/apps/connect/src/routes/authenticate.tsx b/apps/connect/src/routes/authenticate.tsx index 94202afe..b5c4de84 100644 --- a/apps/connect/src/routes/authenticate.tsx +++ b/apps/connect/src/routes/authenticate.tsx @@ -1,8 +1,3 @@ -import { CreateSpaceCard } from '@/components/CreateSpaceCard'; -import { SpacesCard } from '@/components/SpacesCard'; -import { Loading } from '@/components/ui/Loading'; -import { usePrivateSpaces } from '@/hooks/use-private-spaces'; -import { usePublicSpaces } from '@/hooks/use-public-spaces'; import { Graph } from '@graphprotocol/grc-20'; import { Connect, Identity, Key, type Messages, StoreConnect, Utils } from '@graphprotocol/hypergraph'; import { useIdentityToken, usePrivy, useWallets } from '@privy-io/react-auth'; @@ -14,6 +9,11 @@ import { TriangleAlert } from 'lucide-react'; import { useEffect, useState } from 'react'; import { createWalletClient, custom } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; +import { CreateSpaceCard } from '@/components/CreateSpaceCard'; +import { SpacesCard } from '@/components/SpacesCard'; +import { Loading } from '@/components/ui/Loading'; +import { usePrivateSpaces } from '@/hooks/use-private-spaces'; +import { usePublicSpaces } from '@/hooks/use-public-spaces'; const CHAIN = import.meta.env.VITE_HYPERGRAPH_CHAIN === 'geogenesis' ? Connect.GEOGENESIS : Connect.GEO_TESTNET; const API_URL = @@ -327,7 +327,7 @@ function AuthenticateComponent() { try { const privyProvider = await embeddedWallet.getEthereumProvider(); - const walletClient = createWalletClient({ + const _walletClient = createWalletClient({ account: embeddedWallet.address as `0x${string}`, chain: CHAIN, transport: custom(privyProvider), diff --git a/apps/connect/src/routes/index.tsx b/apps/connect/src/routes/index.tsx index 0b1d5c52..ce04933c 100644 --- a/apps/connect/src/routes/index.tsx +++ b/apps/connect/src/routes/index.tsx @@ -1,11 +1,11 @@ +import { Graph } from '@graphprotocol/grc-20'; +import { useIdentityToken } from '@privy-io/react-auth'; +import { createFileRoute } from '@tanstack/react-router'; import { CreateSpaceCard } from '@/components/CreateSpaceCard'; import { SpacesCard } from '@/components/SpacesCard'; import { Loading } from '@/components/ui/Loading'; import { usePrivateSpaces } from '@/hooks/use-private-spaces'; import { usePublicSpaces } from '@/hooks/use-public-spaces'; -import { Graph } from '@graphprotocol/grc-20'; -import { useIdentityToken } from '@privy-io/react-auth'; -import { createFileRoute } from '@tanstack/react-router'; export const Route = createFileRoute('/')({ component: Index, diff --git a/apps/connect/src/routes/login.lazy.tsx b/apps/connect/src/routes/login.lazy.tsx index f069d604..463e7c54 100644 --- a/apps/connect/src/routes/login.lazy.tsx +++ b/apps/connect/src/routes/login.lazy.tsx @@ -1,10 +1,10 @@ -import GeoLogo from '@/assets/images/geo-logo-branded.svg?react'; -import { AppTitle } from '@/components/ui/AppTitle'; import { Connect, type Identity } from '@graphprotocol/hypergraph'; import { type ConnectedWallet, useIdentityToken, usePrivy, useWallets } from '@privy-io/react-auth'; import { createLazyFileRoute, useRouter } from '@tanstack/react-router'; import { useCallback, useEffect, useState } from 'react'; -import { type WalletClient, createWalletClient, custom } from 'viem'; +import { createWalletClient, custom, type WalletClient } from 'viem'; +import GeoLogo from '@/assets/images/geo-logo-branded.svg?react'; +import { AppTitle } from '@/components/ui/AppTitle'; const CHAIN = import.meta.env.VITE_HYPERGRAPH_CHAIN === 'geogenesis' ? Connect.GEOGENESIS : Connect.GEO_TESTNET; const syncServerUri = import.meta.env.VITE_HYPERGRAPH_SYNC_SERVER_ORIGIN; diff --git a/apps/create-hypergraph-app/package.json b/apps/create-hypergraph-app/package.json index 43820100..cc02b18b 100644 --- a/apps/create-hypergraph-app/package.json +++ b/apps/create-hypergraph-app/package.json @@ -7,7 +7,10 @@ "create-hypergraph-app": "dist/bin.js", "cha": "dist/bin.js" }, - "files": ["dist", "template-*"], + "files": [ + "dist", + "template-*" + ], "repository": { "type": "git", "url": "git+https://github.com/graphprotocol/hypergraph.git", @@ -18,7 +21,13 @@ "directory": "dist", "linkDirectory": false }, - "keywords": ["The Graph", "Web3", "Knowledge Graph", "Hypergraph", "TypeSyncs"], + "keywords": [ + "The Graph", + "Web3", + "Knowledge Graph", + "Hypergraph", + "TypeSyncs" + ], "license": "MIT", "engines": { "node": ">=20" diff --git a/apps/events/src/Boot.tsx b/apps/events/src/Boot.tsx index 16f06508..91365ec8 100644 --- a/apps/events/src/Boot.tsx +++ b/apps/events/src/Boot.tsx @@ -1,5 +1,5 @@ import { HypergraphAppProvider } from '@graphprotocol/hypergraph-react'; -import { RouterProvider, createRouter } from '@tanstack/react-router'; +import { createRouter, RouterProvider } from '@tanstack/react-router'; import { mapping } from './mapping.js'; import { routeTree } from './routeTree.gen'; diff --git a/apps/events/src/components/create-events.tsx b/apps/events/src/components/create-events.tsx index d44730e8..f3d1fb87 100644 --- a/apps/events/src/components/create-events.tsx +++ b/apps/events/src/components/create-events.tsx @@ -7,7 +7,10 @@ import { Button } from './ui/button'; const createEvents = async ({ smartSessionClient, space, -}: { smartSessionClient: Connect.SmartSessionClient; space: string }) => { +}: { + smartSessionClient: Connect.SmartSessionClient; + space: string; +}) => { try { const ops: Array = []; diff --git a/apps/events/src/components/create-properties-and-types-event.tsx b/apps/events/src/components/create-properties-and-types-event.tsx index 2a38592b..5b770e8c 100644 --- a/apps/events/src/components/create-properties-and-types-event.tsx +++ b/apps/events/src/components/create-properties-and-types-event.tsx @@ -8,7 +8,10 @@ import { Card, CardContent } from './ui/card'; const createPropertiesAndTypesEvent = async ({ smartSessionClient, space, -}: { smartSessionClient: Connect.SmartSessionClient; space: string }) => { +}: { + smartSessionClient: Connect.SmartSessionClient; + space: string; +}) => { const ops: Array = []; const { id: salaryPropertyId, ops: createSalaryPropertyOps } = Graph.createProperty({ dataType: 'NUMBER', diff --git a/apps/events/src/components/create-properties-and-types-todos.tsx b/apps/events/src/components/create-properties-and-types-todos.tsx index 3d75f20e..ff0dc6f1 100644 --- a/apps/events/src/components/create-properties-and-types-todos.tsx +++ b/apps/events/src/components/create-properties-and-types-todos.tsx @@ -8,7 +8,10 @@ import { Card, CardContent } from './ui/card'; const createPropertiesAndTypesTodos = async ({ smartSessionClient, space, -}: { smartSessionClient: Connect.SmartSessionClient; space: string }) => { +}: { + smartSessionClient: Connect.SmartSessionClient; + space: string; +}) => { const ops: Array = []; const { id: checkedPropertyId, ops: createCheckedPropertyOps } = Graph.createProperty({ dataType: 'CHECKBOX', diff --git a/apps/events/src/components/spinner.tsx b/apps/events/src/components/spinner.tsx index d8484311..5c3247c8 100644 --- a/apps/events/src/components/spinner.tsx +++ b/apps/events/src/components/spinner.tsx @@ -1,7 +1,7 @@ 'use client'; -import { cn } from '@/lib/utils'; import { motion } from 'framer-motion'; +import { cn } from '@/lib/utils'; interface SpinnerProps { size?: 'sm' | 'md' | 'lg' | 'xl'; diff --git a/apps/events/src/components/todos2.tsx b/apps/events/src/components/todos2.tsx index 01d74eeb..83dedbd8 100644 --- a/apps/events/src/components/todos2.tsx +++ b/apps/events/src/components/todos2.tsx @@ -1,4 +1,3 @@ -import { cn } from '@/lib/utils'; import type { PublishDiffInfo } from '@graphprotocol/hypergraph-react'; import { PublishDiff, @@ -13,6 +12,7 @@ import { import { useQueryClient } from '@tanstack/react-query'; import { useEffect, useState } from 'react'; import Select from 'react-select'; +import { cn } from '@/lib/utils'; import { Todo2, User } from '../schema'; import { Spinner } from './spinner'; import { TodosLocal } from './todo/todos-local'; diff --git a/apps/events/src/components/ui/button.tsx b/apps/events/src/components/ui/button.tsx index 64c1083c..9498383f 100644 --- a/apps/events/src/components/ui/button.tsx +++ b/apps/events/src/components/ui/button.tsx @@ -1,5 +1,5 @@ import { Slot } from '@radix-ui/react-slot'; -import { type VariantProps, cva } from 'class-variance-authority'; +import { cva, type VariantProps } from 'class-variance-authority'; import * as React from 'react'; import { cn } from '@/lib/utils'; diff --git a/apps/events/src/components/ui/modal.tsx b/apps/events/src/components/ui/modal.tsx index 508b9daf..c3d3f37b 100644 --- a/apps/events/src/components/ui/modal.tsx +++ b/apps/events/src/components/ui/modal.tsx @@ -29,6 +29,7 @@ export function Modal({ isOpen, onOpenChange, children }: ModalProps) { return (
+ {/* biome-ignore lint/a11y/noStaticElementInteractions: Modal has keyboard support via Escape key */} {/* biome-ignore lint/a11y/useKeyWithClickEvents: Modal has keyboard support via Escape key */}
onOpenChange(false)} />
diff --git a/apps/events/src/routes/__root.tsx b/apps/events/src/routes/__root.tsx index 59679428..426949e4 100644 --- a/apps/events/src/routes/__root.tsx +++ b/apps/events/src/routes/__root.tsx @@ -1,7 +1,7 @@ -import { Logout } from '@/components/logout'; import { useHypergraphAuth } from '@graphprotocol/hypergraph-react'; -import { Link, Outlet, createRootRoute, useLayoutEffect, useRouter } from '@tanstack/react-router'; +import { createRootRoute, Link, Outlet, useLayoutEffect, useRouter } from '@tanstack/react-router'; import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'; +import { Logout } from '@/components/logout'; export const Route = createRootRoute({ component: () => { @@ -25,45 +25,43 @@ export const Route = createRootRoute({ }, [authenticated]); return ( - <> -
-
- - Home - - -
-
+
+
+ + Home + + +
+
- + - + -
-

© 2023 Acme Events. All rights reserved.

- -
-
- +
+

© 2023 Acme Events. All rights reserved.

+ +
+
); }, }); diff --git a/apps/events/src/routes/account-inbox/$inboxId.tsx b/apps/events/src/routes/account-inbox/$inboxId.tsx index 7e5cecb2..ae2720e3 100644 --- a/apps/events/src/routes/account-inbox/$inboxId.tsx +++ b/apps/events/src/routes/account-inbox/$inboxId.tsx @@ -8,14 +8,13 @@ export const Route = createFileRoute('/account-inbox/$inboxId')({ function RouteComponent() { const { inboxId } = Route.useParams(); const { identity } = useHypergraphAuth(); + const { messages, loading, error } = useOwnAccountInbox(inboxId); // Ensure we have an authenticated user if (!identity?.accountAddress) { return
Please login to view your inbox
; } - const { messages, loading, error } = useOwnAccountInbox(inboxId); - if (loading) { return
Loading inbox messages...
; } diff --git a/apps/events/src/routes/index.tsx b/apps/events/src/routes/index.tsx index d00a34bf..c504c645 100644 --- a/apps/events/src/routes/index.tsx +++ b/apps/events/src/routes/index.tsx @@ -1,11 +1,11 @@ -import { Button } from '@/components/ui/button'; -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; -import { Input } from '@/components/ui/input'; import { store } from '@graphprotocol/hypergraph'; import { useHypergraphApp, useSpaces } from '@graphprotocol/hypergraph-react'; -import { Link, createFileRoute } from '@tanstack/react-router'; +import { createFileRoute, Link } from '@tanstack/react-router'; import { useSelector } from '@xstate/store/react'; import { useEffect, useState } from 'react'; +import { Button } from '@/components/ui/button'; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; +import { Input } from '@/components/ui/input'; export const Route = createFileRoute('/')({ component: Index, diff --git a/apps/events/src/routes/login.lazy.tsx b/apps/events/src/routes/login.lazy.tsx index 589f77dc..b7e67e3f 100644 --- a/apps/events/src/routes/login.lazy.tsx +++ b/apps/events/src/routes/login.lazy.tsx @@ -1,6 +1,6 @@ -import { Button } from '@/components/ui/button'; import { useHypergraphApp } from '@graphprotocol/hypergraph-react'; import { createLazyFileRoute } from '@tanstack/react-router'; +import { Button } from '@/components/ui/button'; export const Route = createLazyFileRoute('/login')({ component: () => , diff --git a/apps/events/src/routes/playground.lazy.tsx b/apps/events/src/routes/playground.lazy.tsx index 0fc11845..14a4476e 100644 --- a/apps/events/src/routes/playground.lazy.tsx +++ b/apps/events/src/routes/playground.lazy.tsx @@ -1,8 +1,8 @@ +import { HypergraphSpaceProvider } from '@graphprotocol/hypergraph-react'; +import { createLazyFileRoute } from '@tanstack/react-router'; import { CreateEvents } from '@/components/create-events'; import { CreatePropertiesAndTypesEvent } from '@/components/create-properties-and-types-event'; import { Playground } from '@/components/playground'; -import { HypergraphSpaceProvider } from '@graphprotocol/hypergraph-react'; -import { createLazyFileRoute } from '@tanstack/react-router'; export const Route = createLazyFileRoute('/playground')({ component: RouteComponent, diff --git a/apps/events/src/routes/space/$spaceId.tsx b/apps/events/src/routes/space/$spaceId.tsx index 70f66e95..2234257f 100644 --- a/apps/events/src/routes/space/$spaceId.tsx +++ b/apps/events/src/routes/space/$spaceId.tsx @@ -1,4 +1,4 @@ -import { Link, Outlet, createFileRoute } from '@tanstack/react-router'; +import { createFileRoute, Link, Outlet } from '@tanstack/react-router'; export const Route = createFileRoute('/space/$spaceId')({ component: RouteComponent, diff --git a/apps/events/src/routes/space/$spaceId/chat.tsx b/apps/events/src/routes/space/$spaceId/chat.tsx index d91ca91a..023c1309 100644 --- a/apps/events/src/routes/space/$spaceId/chat.tsx +++ b/apps/events/src/routes/space/$spaceId/chat.tsx @@ -1,6 +1,6 @@ -import { SpaceChat } from '@/components/SpaceChat'; import { useHypergraphApp } from '@graphprotocol/hypergraph-react'; import { createFileRoute } from '@tanstack/react-router'; +import { SpaceChat } from '@/components/SpaceChat'; export const Route = createFileRoute('/space/$spaceId/chat')({ component: RouteComponent, diff --git a/apps/events/src/routes/space/$spaceId/events.tsx b/apps/events/src/routes/space/$spaceId/events.tsx index 7833832b..f7f01b5b 100644 --- a/apps/events/src/routes/space/$spaceId/events.tsx +++ b/apps/events/src/routes/space/$spaceId/events.tsx @@ -1,6 +1,6 @@ -import { Events } from '@/components/events/events'; import { HypergraphSpaceProvider, useHypergraphApp } from '@graphprotocol/hypergraph-react'; import { createFileRoute } from '@tanstack/react-router'; +import { Events } from '@/components/events/events'; export const Route = createFileRoute('/space/$spaceId/events')({ component: RouteComponent, }); diff --git a/apps/events/src/routes/space/$spaceId/index.tsx b/apps/events/src/routes/space/$spaceId/index.tsx index f7e9d7a3..dd0b1443 100644 --- a/apps/events/src/routes/space/$spaceId/index.tsx +++ b/apps/events/src/routes/space/$spaceId/index.tsx @@ -1,12 +1,12 @@ +import { HypergraphSpaceProvider, useHypergraphApp } from '@graphprotocol/hypergraph-react'; +import { createFileRoute } from '@tanstack/react-router'; +import { useState } from 'react'; import { DevTool } from '@/components/dev-tool'; import { Todos } from '@/components/todos'; import { TodosReadOnly } from '@/components/todos-read-only'; import { TodosReadOnlyFilter } from '@/components/todos-read-only-filter'; import { Button } from '@/components/ui/button'; import { Users } from '@/components/users'; -import { HypergraphSpaceProvider, useHypergraphApp } from '@graphprotocol/hypergraph-react'; -import { createFileRoute } from '@tanstack/react-router'; -import { useState } from 'react'; export const Route = createFileRoute('/space/$spaceId/')({ component: Space, diff --git a/apps/events/src/routes/space/$spaceId/playground.tsx b/apps/events/src/routes/space/$spaceId/playground.tsx index fc33e265..72956372 100644 --- a/apps/events/src/routes/space/$spaceId/playground.tsx +++ b/apps/events/src/routes/space/$spaceId/playground.tsx @@ -1,6 +1,6 @@ -import { TodosPublic } from '@/components/todo/todos-public'; import { HypergraphSpaceProvider, useHypergraphApp } from '@graphprotocol/hypergraph-react'; import { createFileRoute } from '@tanstack/react-router'; +import { TodosPublic } from '@/components/todo/todos-public'; export const Route = createFileRoute('/space/$spaceId/playground')({ component: PlaygroundRouteComponent, diff --git a/apps/events/src/routes/space/$spaceId/public-integration.tsx b/apps/events/src/routes/space/$spaceId/public-integration.tsx index 836d6688..d0fa9997 100644 --- a/apps/events/src/routes/space/$spaceId/public-integration.tsx +++ b/apps/events/src/routes/space/$spaceId/public-integration.tsx @@ -1,7 +1,7 @@ -import { CreatePropertiesAndTypesTodos } from '@/components/create-properties-and-types-todos'; -import { Todos2 } from '@/components/todos2'; import { HypergraphSpaceProvider, useHypergraphApp } from '@graphprotocol/hypergraph-react'; import { createFileRoute } from '@tanstack/react-router'; +import { CreatePropertiesAndTypesTodos } from '@/components/create-properties-and-types-todos'; +import { Todos2 } from '@/components/todos2'; export const Route = createFileRoute('/space/$spaceId/public-integration')({ component: PublicIntegration, diff --git a/apps/events/src/routes/space/$spaceId/users.tsx b/apps/events/src/routes/space/$spaceId/users.tsx index 00f20ba2..e8b80efe 100644 --- a/apps/events/src/routes/space/$spaceId/users.tsx +++ b/apps/events/src/routes/space/$spaceId/users.tsx @@ -1,7 +1,7 @@ -import { UsersMerged } from '@/components/users/users-merged'; -import { UsersPublic } from '@/components/users/users-public'; import { HypergraphSpaceProvider, useHypergraphApp } from '@graphprotocol/hypergraph-react'; import { createFileRoute } from '@tanstack/react-router'; +import { UsersMerged } from '@/components/users/users-merged'; +import { UsersPublic } from '@/components/users/users-public'; import { UsersLocal } from '../../../components/users/users-local'; export const Route = createFileRoute('/space/$spaceId/users')({ component: UsersRouteComponent, diff --git a/apps/next-example/src/app/layout.tsx b/apps/next-example/src/app/layout.tsx index f94a1c4d..4a65119c 100644 --- a/apps/next-example/src/app/layout.tsx +++ b/apps/next-example/src/app/layout.tsx @@ -1,6 +1,6 @@ -import Providers from '@/components/providers'; import type { Metadata } from 'next'; import { Geist, Geist_Mono } from 'next/font/google'; +import Providers from '@/components/providers'; import './globals.css'; const geistSans = Geist({ diff --git a/apps/next-example/src/components/providers.tsx b/apps/next-example/src/components/providers.tsx index d632d7d6..e4154ab5 100644 --- a/apps/next-example/src/components/providers.tsx +++ b/apps/next-example/src/components/providers.tsx @@ -4,7 +4,7 @@ import { HypergraphAppProvider } from '@graphprotocol/hypergraph-react'; // recommended by https://docs.privy.io/basics/troubleshooting/react-frameworks#next-js export default function Providers({ children }: { children: React.ReactNode }) { - const storage = typeof window !== 'undefined' ? window.localStorage : (undefined as unknown as Storage); + const _storage = typeof window !== 'undefined' ? window.localStorage : (undefined as unknown as Storage); return ( void) { +async function _verifyAuth(req: AuthenticatedRequest, res: Response, next: (err?: Error) => void) { const auth = req.headers.authorization; if (!auth) { res.status(401).send('Unauthorized'); @@ -59,7 +59,7 @@ async function verifyAuth(req: AuthenticatedRequest, res: Response, next: (err?: const { accountAddress } = await getAppIdentityBySessionToken({ sessionToken }); req.accountAddress = accountAddress; next(); - } catch (error) { + } catch (_error) { res.status(401).send('Unauthorized'); return; } @@ -371,7 +371,7 @@ app.get('/whoami', async (req, res) => { try { const { accountAddress } = await getAppIdentityBySessionToken({ sessionToken }); res.status(200).send(accountAddress); - } catch (error) { + } catch (_error) { res.status(401).send('Unauthorized'); } } catch (error) { @@ -397,7 +397,7 @@ app.get('/connect/identity', async (req, res) => { keyProof: identity.keyProof, }; res.status(200).send(outgoingMessage); - } catch (error) { + } catch (_error) { const outgoingMessage: Messages.ResponseIdentityNotFoundError = { accountAddress, }; @@ -430,7 +430,7 @@ app.get('/identity', async (req, res) => { appId: identity.appId ?? undefined, }; res.status(200).send(outgoingMessage); - } catch (error) { + } catch (_error) { const outgoingMessage: Messages.ResponseIdentityNotFoundError = { accountAddress, }; @@ -478,7 +478,7 @@ app.post('/spaces/:spaceId/inboxes/:inboxId/messages', async (req, res) => { let spaceInbox: Messages.SpaceInboxPublic; try { spaceInbox = await getSpaceInbox({ spaceId, inboxId }); - } catch (error) { + } catch (_error) { res.status(404).send({ error: 'Inbox not found' }); return; } @@ -522,7 +522,7 @@ app.post('/spaces/:spaceId/inboxes/:inboxId/messages', async (req, res) => { accountAddress: message.authorAccountAddress, signaturePublicKey: authorPublicKey, }); - } catch (error) { + } catch (_error) { res.status(403).send({ error: 'Not authorized to post to this inbox' }); return; } @@ -580,7 +580,7 @@ app.post('/accounts/:accountAddress/inboxes/:inboxId/messages', async (req, res) let accountInbox: Messages.AccountInboxPublic; try { accountInbox = await getAccountInbox({ accountAddress, inboxId }); - } catch (error) { + } catch (_error) { res.status(404).send({ error: 'Inbox not found' }); return; } @@ -623,7 +623,7 @@ app.post('/accounts/:accountAddress/inboxes/:inboxId/messages', async (req, res) accountAddress: message.authorAccountAddress, signaturePublicKey: authorPublicKey, }); - } catch (error) { + } catch (_error) { res.status(403).send({ error: 'Not authorized to post to this inbox' }); return; } @@ -649,7 +649,11 @@ function broadcastSpaceEvents({ spaceId, event, currentClient, -}: { spaceId: string; event: SpaceEvents.SpaceEvent; currentClient: CustomWebSocket }) { +}: { + spaceId: string; + event: SpaceEvents.SpaceEvent; + currentClient: CustomWebSocket; +}) { try { for (const client of webSocketServer.clients as Set) { if (currentClient === client) continue; @@ -672,7 +676,11 @@ function broadcastUpdates({ spaceId, updates, currentClient, -}: { spaceId: string; updates: Messages.Updates; currentClient: CustomWebSocket }) { +}: { + spaceId: string; + updates: Messages.Updates; + currentClient: CustomWebSocket; +}) { try { for (const client of webSocketServer.clients as Set) { if (currentClient === client) continue; @@ -695,7 +703,11 @@ function broadcastSpaceInboxMessage({ spaceId, inboxId, message, -}: { spaceId: string; inboxId: string; message: Messages.InboxMessage }) { +}: { + spaceId: string; + inboxId: string; + message: Messages.InboxMessage; +}) { try { const outgoingMessage: Messages.ResponseSpaceInboxMessage = { type: 'space-inbox-message', @@ -733,7 +745,11 @@ function broadcastAccountInboxMessage({ accountAddress, inboxId, message, -}: { accountAddress: string; inboxId: string; message: Messages.InboxMessage }) { +}: { + accountAddress: string; + inboxId: string; + message: Messages.InboxMessage; +}) { try { const outgoingMessage: Messages.ResponseAccountInboxMessage = { type: 'account-inbox-message', @@ -767,7 +783,7 @@ webSocketServer.on('connection', async (webSocket: CustomWebSocket, request: Req webSocket.accountAddress = result.accountAddress; appIdentityAddress = result.address; webSocket.appIdentityAddress = result.address; - } catch (error) { + } catch (_error) { console.log('Invalid token'); webSocket.close(); return; diff --git a/apps/typesync/client/src/Components/App/CreateAppForm/SchemaBuilder/TypeSelect.tsx b/apps/typesync/client/src/Components/App/CreateAppForm/SchemaBuilder/TypeSelect.tsx index 38bb29c2..e0f4885a 100644 --- a/apps/typesync/client/src/Components/App/CreateAppForm/SchemaBuilder/TypeSelect.tsx +++ b/apps/typesync/client/src/Components/App/CreateAppForm/SchemaBuilder/TypeSelect.tsx @@ -2,7 +2,7 @@ import { Label, Listbox, ListboxButton, ListboxOption, ListboxOptions, type ListboxProps } from '@headlessui/react'; import { CheckIcon, ChevronUpDownIcon } from '@heroicons/react/16/solid'; -import { Array as EffectArray, String as EffectString, Schema, pipe } from 'effect'; +import { Array as EffectArray, String as EffectString, pipe, Schema } from 'effect'; import { useFieldContext } from '../../../../context/form.js'; import { classnames } from '../../../../utils/classnames.js'; diff --git a/apps/typesync/client/src/Components/App/Schema/SchemaPreview.tsx b/apps/typesync/client/src/Components/App/Schema/SchemaPreview.tsx index 75816085..5eb3fd3b 100644 --- a/apps/typesync/client/src/Components/App/Schema/SchemaPreview.tsx +++ b/apps/typesync/client/src/Components/App/Schema/SchemaPreview.tsx @@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query'; import type { CSSProperties } from 'react'; -import { type ThemedToken, codeToTokens } from 'shiki'; +import { codeToTokens, type ThemedToken } from 'shiki'; import type { AppSchema } from '../../../schema.js'; import { classnames } from '../../../utils/classnames.js'; diff --git a/apps/typesync/client/src/Providers.tsx b/apps/typesync/client/src/Providers.tsx index 86206f7a..ce5f2460 100644 --- a/apps/typesync/client/src/Providers.tsx +++ b/apps/typesync/client/src/Providers.tsx @@ -3,7 +3,7 @@ import { RouterProvider } from '@tanstack/react-router'; import { Provider } from 'jotai'; -import { type TypeSyncAppRouter, createTypeSyncAppRouter } from './clients/router.js'; +import { createTypeSyncAppRouter, type TypeSyncAppRouter } from './clients/router.js'; const router = createTypeSyncAppRouter(); diff --git a/apps/typesync/client/src/clients/router.tsx b/apps/typesync/client/src/clients/router.tsx index e2040e03..b8626408 100644 --- a/apps/typesync/client/src/clients/router.tsx +++ b/apps/typesync/client/src/clients/router.tsx @@ -1,16 +1,16 @@ import { - QueryClient, - QueryClientProvider, defaultShouldDehydrateQuery, dehydrate, hydrate, + QueryClient, + QueryClientProvider, } from '@tanstack/react-query'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; import { createRouter } from '@tanstack/react-router'; import type { ReactNode } from 'react'; -import { routeTree } from '../routeTree.gen.js'; import type { RouterContext } from '../routes/__root.js'; +import { routeTree } from '../routeTree.gen.js'; import { graphqlClient } from './graphql.js'; export function createTypeSyncAppRouter() { diff --git a/apps/typesync/client/src/hooks/useAppQuery.tsx b/apps/typesync/client/src/hooks/useAppQuery.tsx index 6d5dce65..840a1343 100644 --- a/apps/typesync/client/src/hooks/useAppQuery.tsx +++ b/apps/typesync/client/src/hooks/useAppQuery.tsx @@ -1,13 +1,13 @@ 'use client'; import { + queryOptions, type UseMutationOptions, type UseMutationResult, type UseQueryOptions, type UseQueryResult, type UseSuspenseQueryOptions, type UseSuspenseQueryResult, - queryOptions, useMutation, useQuery, useSuspenseQuery, diff --git a/apps/typesync/client/src/hooks/useCWDQuery.tsx b/apps/typesync/client/src/hooks/useCWDQuery.tsx index fac9ea98..a8211659 100644 --- a/apps/typesync/client/src/hooks/useCWDQuery.tsx +++ b/apps/typesync/client/src/hooks/useCWDQuery.tsx @@ -1,9 +1,9 @@ 'use client'; import { + queryOptions, type UseQueryResult, type UseSuspenseQueryResult, - queryOptions, useQuery, useSuspenseQuery, } from '@tanstack/react-query'; diff --git a/apps/typesync/client/src/hooks/useSchemaBrowserQuery.tsx b/apps/typesync/client/src/hooks/useSchemaBrowserQuery.tsx index b20ed699..801a8817 100644 --- a/apps/typesync/client/src/hooks/useSchemaBrowserQuery.tsx +++ b/apps/typesync/client/src/hooks/useSchemaBrowserQuery.tsx @@ -1,7 +1,7 @@ 'use client'; -import { type UseQueryOptions, type UseQueryResult, queryOptions, useQuery } from '@tanstack/react-query'; -import { Array as EffectArray, Order, Schema, pipe } from 'effect'; +import { queryOptions, type UseQueryOptions, type UseQueryResult, useQuery } from '@tanstack/react-query'; +import { Array as EffectArray, Order, pipe, Schema } from 'effect'; import { graphqlClient } from '../clients/graphql.js'; import { graphql } from '../generated/gql.js'; @@ -35,7 +35,7 @@ const SchemaBrowser = graphql(` export async function fetchSchemaTypes(first = 100) { try { return await graphqlClient.request(SchemaBrowser, { first }); - } catch (err) { + } catch (_err) { console.error('failure fetching schema types'); return { __typename: 'Query', types: [] } as SchemaBrowserTypesQuery; } @@ -189,7 +189,7 @@ const PropertyBrowser = graphql(` export async function fetchProperties(first = 100) { try { return await graphqlClient.request(PropertyBrowser, { first }); - } catch (err) { + } catch (_err) { console.error('failure fetching schema types'); return { __typename: 'Query', properties: [] } as PropertiesQuery; } diff --git a/apps/typesync/client/src/routes/__root.tsx b/apps/typesync/client/src/routes/__root.tsx index a146a559..64d80a0e 100644 --- a/apps/typesync/client/src/routes/__root.tsx +++ b/apps/typesync/client/src/routes/__root.tsx @@ -4,7 +4,7 @@ import { RectangleGroupIcon } from '@heroicons/react/24/outline'; import { MagnifyingGlassIcon, PlusIcon } from '@heroicons/react/24/solid'; import { GithubLogoIcon } from '@phosphor-icons/react'; import type { QueryClient } from '@tanstack/react-query'; -import { Link, Outlet, createRootRouteWithContext } from '@tanstack/react-router'; +import { createRootRouteWithContext, Link, Outlet } from '@tanstack/react-router'; import type { GraphQLClient } from 'graphql-request'; import { useAtom } from 'jotai'; diff --git a/apps/typesync/client/src/routes/apps/$appId/details.tsx b/apps/typesync/client/src/routes/apps/$appId/details.tsx index f4dea83d..d3502ba3 100644 --- a/apps/typesync/client/src/routes/apps/$appId/details.tsx +++ b/apps/typesync/client/src/routes/apps/$appId/details.tsx @@ -10,7 +10,7 @@ import { PlusIcon, } from '@heroicons/react/24/solid'; import { useSuspenseQueries } from '@tanstack/react-query'; -import { Link, type NotFoundRouteProps, createFileRoute } from '@tanstack/react-router'; +import { createFileRoute, Link, type NotFoundRouteProps } from '@tanstack/react-router'; import { format } from 'date-fns/format'; import { formatDistanceToNow } from 'date-fns/formatDistanceToNow'; import * as Schema from 'effect/Schema'; diff --git a/apps/typesync/client/src/routes/apps/create.tsx b/apps/typesync/client/src/routes/apps/create.tsx index 4643fdc2..ff435082 100644 --- a/apps/typesync/client/src/routes/apps/create.tsx +++ b/apps/typesync/client/src/routes/apps/create.tsx @@ -11,8 +11,8 @@ import { import { TrashIcon } from '@heroicons/react/24/outline'; import * as TabsPrimitive from '@radix-ui/react-tabs'; import { useStore } from '@tanstack/react-form'; -import { Link, createFileRoute } from '@tanstack/react-router'; -import { Array as EffectArray, String as EffectString, Option, Schema, pipe } from 'effect'; +import { createFileRoute, Link } from '@tanstack/react-router'; +import { Array as EffectArray, String as EffectString, Option, pipe, Schema } from 'effect'; import { useState } from 'react'; import { InsertAppSchema } from '../../../../domain/Domain.js'; @@ -47,7 +47,7 @@ function isCreateAppFormTab(value: unknown): value is CreateAppFormTab { try { Schema.decodeUnknownSync(CreateAppFormTab)(value); return true; - } catch (err) { + } catch (_err) { return false; } } diff --git a/apps/typesync/client/src/routes/index.tsx b/apps/typesync/client/src/routes/index.tsx index e4b7311c..f0df851d 100644 --- a/apps/typesync/client/src/routes/index.tsx +++ b/apps/typesync/client/src/routes/index.tsx @@ -2,7 +2,7 @@ import { ClockIcon, FolderOpenIcon } from '@heroicons/react/24/outline'; import { ChevronRightIcon, PlusIcon } from '@heroicons/react/24/solid'; -import { Link, createFileRoute } from '@tanstack/react-router'; +import { createFileRoute, Link } from '@tanstack/react-router'; import { formatDistanceToNow } from 'date-fns/formatDistanceToNow'; import { AppStatusBadge } from '../Components/App/StatusBadge.js'; diff --git a/apps/typesync/client/src/schema.ts b/apps/typesync/client/src/schema.ts index f9f4fb95..4460f9c5 100644 --- a/apps/typesync/client/src/schema.ts +++ b/apps/typesync/client/src/schema.ts @@ -15,7 +15,7 @@ export class App extends Schema.Class('App')({ id: AppIdentifier, name: Schema.NonEmptyTrimmedString, description: Schema.NullOr(Schema.String), - directory: Schema.NullOr(Schema.String.pipe(Schema.pattern(/^(\.\/|~\/|\/|[a-zA-Z]:\/)[\w\-\.\s\/]*[\w\-\.]$/))), + directory: Schema.NullOr(Schema.String.pipe(Schema.pattern(/^(\.\/|~\/|\/|[a-zA-Z]:\/)[\w\-.\s/]*[\w\-.]$/))), status: Schema.Literal('draft', 'generated', 'published', 'change_detected'), created_at: Schema.NonEmptyTrimmedString, updated_at: Schema.NonEmptyTrimmedString, diff --git a/apps/typesync/domain/Domain.ts b/apps/typesync/domain/Domain.ts index 69180c3b..e1454c2f 100644 --- a/apps/typesync/domain/Domain.ts +++ b/apps/typesync/domain/Domain.ts @@ -8,7 +8,7 @@ import { Schema } from 'effect'; export const InsertAppSchema = Schema.Struct({ name: Schema.NonEmptyTrimmedString, description: Schema.NullOr(Schema.String), - directory: Schema.NullOr(Schema.String.pipe(Schema.pattern(/^(\.\/|~\/|\/|[a-zA-Z]:\/)[\w\-\.\s\/]*[\w\-\.]$/))), + directory: Schema.NullOr(Schema.String.pipe(Schema.pattern(/^(\.\/|~\/|\/|[a-zA-Z]:\/)[\w\-.\s/]*[\w\-.]$/))), template: Schema.Literal('vite_react'), types: Schema.Array(Mapping.SchemaType).pipe( Schema.minItems(1), diff --git a/apps/typesync/package.json b/apps/typesync/package.json index d637d272..dbb14134 100644 --- a/apps/typesync/package.json +++ b/apps/typesync/package.json @@ -18,7 +18,10 @@ "hypergraph": "./dist/bin.js", "hg": "./dist/bin.js" }, - "files": ["README.md", "dist"], + "files": [ + "README.md", + "dist" + ], "scripts": { "codegen:gql": "graphql-codegen --config ./graphql.codegen.ts", "build:client": "vite build", diff --git a/docs/package.json b/docs/package.json index a421a244..e2123002 100644 --- a/docs/package.json +++ b/docs/package.json @@ -27,8 +27,16 @@ "@docusaurus/types": "3.7.0" }, "browserslist": { - "production": [">0.5%", "not dead", "not op_mini all"], - "development": ["last 3 chrome version", "last 3 firefox version", "last 5 safari version"] + "production": [ + ">0.5%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 3 chrome version", + "last 3 firefox version", + "last 5 safari version" + ] }, "engines": { "node": ">=18.0" diff --git a/docs/src/components/HomepageFeatures/index.js b/docs/src/components/HomepageFeatures/index.js index 458ca976..b9ad1740 100644 --- a/docs/src/components/HomepageFeatures/index.js +++ b/docs/src/components/HomepageFeatures/index.js @@ -54,7 +54,7 @@ export default function HomepageFeatures() {
{FeatureList.map((props, idx) => ( - // biome-ignore lint/suspicious/noArrayIndexKey: + // biome-ignore lint/suspicious/noArrayIndexKey: fine for static list ))}
diff --git a/docs/src/pages/index.js b/docs/src/pages/index.js index cc299322..7528150f 100644 --- a/docs/src/pages/index.js +++ b/docs/src/pages/index.js @@ -1,10 +1,9 @@ import Link from '@docusaurus/Link'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import HomepageFeatures from '@site/src/components/HomepageFeatures'; +import Heading from '@theme/Heading'; import Layout from '@theme/Layout'; import clsx from 'clsx'; - -import Heading from '@theme/Heading'; import styles from './index.module.css'; function HomepageHeader() { diff --git a/packages/hypergraph-react/package.json b/packages/hypergraph-react/package.json index 6ee61536..68c3c171 100644 --- a/packages/hypergraph-react/package.json +++ b/packages/hypergraph-react/package.json @@ -2,7 +2,13 @@ "name": "@graphprotocol/hypergraph-react", "version": "0.0.14", "description": "React implementation and additional functionality, components, and hooks for the hypergraph SDK framework", - "keywords": ["Web3", "Local-First", "Knowledge Graph", "Graph Protocol", "react"], + "keywords": [ + "Web3", + "Local-First", + "Knowledge Graph", + "Graph Protocol", + "react" + ], "publishConfig": { "access": "public", "directory": "publish", diff --git a/packages/hypergraph-react/src/HypergraphAppContext.tsx b/packages/hypergraph-react/src/HypergraphAppContext.tsx index e84e5636..06ae3259 100644 --- a/packages/hypergraph-react/src/HypergraphAppContext.tsx +++ b/packages/hypergraph-react/src/HypergraphAppContext.tsx @@ -1,25 +1,25 @@ 'use client'; -import type { DocHandle } from '@automerge/automerge-repo'; -import { RepoContext } from '@automerge/automerge-repo-react-hooks'; -import { Repo } from '@automerge/automerge-repo/slim'; // @ts-expect-error not properly typed and exported in the automerge package import { automergeWasmBase64 } from '@automerge/automerge/automerge.wasm.base64.js'; import * as automerge from '@automerge/automerge/slim'; import { uuid } from '@automerge/automerge/slim'; +import type { DocHandle } from '@automerge/automerge-repo'; +import { Repo } from '@automerge/automerge-repo/slim'; +import { RepoContext } from '@automerge/automerge-repo-react-hooks'; import { Graph } from '@graphprotocol/grc-20'; import { Connect, type ConnectCallbackResult, Identity, - type InboxMessageStorageEntry, Inboxes, + type InboxMessageStorageEntry, Key, Messages, SpaceEvents, type SpaceStorageEntry, - Utils, store, + Utils, } from '@graphprotocol/hypergraph'; import type { Mapping } from '@graphprotocol/typesync/Mapping'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; @@ -27,8 +27,8 @@ import { useSelector as useSelectorStore } from '@xstate/store/react'; import { Effect, Exit } from 'effect'; import * as Schema from 'effect/Schema'; import { - type ReactNode, createContext, + type ReactNode, useCallback, useContext, useEffect, @@ -116,11 +116,7 @@ export type HypergraphAppCtx = { connectUrl: string; redirectFn: (url: URL) => void; }): void; - processConnectAuthSuccess(params: { - storage: Identity.Storage; - ciphertext: string; - nonce: string; - }): void; + processConnectAuthSuccess(params: { storage: Identity.Storage; ciphertext: string; nonce: string }): void; }; export const HypergraphAppContext = createContext({ @@ -193,7 +189,7 @@ export const HypergraphAppContext = createContext({ async ensureSpaceInbox() { throw new Error('ensureSpaceInbox is missing'); }, - redirectToConnect(params: { + redirectToConnect(_params: { storage: Identity.Storage; successUrl: string; appId: string; @@ -446,7 +442,7 @@ export function HypergraphAppProvider({ break; } case 'space': { - let state: SpaceEvents.SpaceState | undefined = undefined; + let state: SpaceEvents.SpaceState | undefined; for (const event of response.events) { // Not sure why but type inference doesn't work here @@ -798,7 +794,7 @@ export function HypergraphAppProvider({ ); let lastMessageClock = new Date(0); const messages = response.messages - .filter((message, index) => validSignatures[index]) + .filter((_message, index) => validSignatures[index]) .map((message) => { try { const decryptedMessage = Inboxes.decryptInboxMessage({ @@ -857,7 +853,7 @@ export function HypergraphAppProvider({ ), ); const messages = response.messages - .filter((message, index) => validSignatures[index]) + .filter((_message, index) => validSignatures[index]) .map((message) => { try { const decryptedMessage = Inboxes.decryptInboxMessage({ @@ -1414,12 +1410,7 @@ export function HypergraphAppProvider({ ); const redirectToConnectForContext = useCallback( - (params: { - storage: Identity.Storage; - successUrl: string; - connectUrl: string; - redirectFn: (url: URL) => void; - }) => { + (params: { storage: Identity.Storage; successUrl: string; connectUrl: string; redirectFn: (url: URL) => void }) => { const { storage, successUrl, redirectFn, connectUrl } = params; const { url, nonce, expiry, secretKey, publicKey } = Connect.createAuthUrl({ connectUrl: `${connectUrl}/authenticate`, diff --git a/packages/hypergraph-react/src/HypergraphSpaceContext.tsx b/packages/hypergraph-react/src/HypergraphSpaceContext.tsx index 3ed3776f..6c35a2f3 100644 --- a/packages/hypergraph-react/src/HypergraphSpaceContext.tsx +++ b/packages/hypergraph-react/src/HypergraphSpaceContext.tsx @@ -4,8 +4,8 @@ import { Entity, store } from '@graphprotocol/hypergraph'; import { useSelector } from '@xstate/store/react'; import * as Schema from 'effect/Schema'; import { - type ReactNode, createContext, + type ReactNode, useContext, useEffect, useLayoutEffect, diff --git a/packages/hypergraph-react/src/components/publish-diff/entity-card.tsx b/packages/hypergraph-react/src/components/publish-diff/entity-card.tsx index 647b1749..b8cc7c09 100644 --- a/packages/hypergraph-react/src/components/publish-diff/entity-card.tsx +++ b/packages/hypergraph-react/src/components/publish-diff/entity-card.tsx @@ -16,6 +16,8 @@ export const EntityCard = ({ entity, type }: EntityCardProps) => { return (
+ {/* biome-ignore lint/a11y/noStaticElementInteractions: EntityCard has keyboard support via Enter key */} + {/* biome-ignore lint/a11y/useKeyWithClickEvents: EntityCard has keyboard support via Enter key */}
setIsExpanded(!isExpanded)} diff --git a/packages/hypergraph-react/src/components/publish-diff/updated-entity-card.tsx b/packages/hypergraph-react/src/components/publish-diff/updated-entity-card.tsx index bdec4a4c..e394b936 100644 --- a/packages/hypergraph-react/src/components/publish-diff/updated-entity-card.tsx +++ b/packages/hypergraph-react/src/components/publish-diff/updated-entity-card.tsx @@ -21,6 +21,8 @@ export const UpdatedEntityCard = ({ entity }: UpdatedEntityCardProps) => { return (
+ {/* biome-ignore lint/a11y/noStaticElementInteractions: UpdatedEntityCard has keyboard support via Enter key */} + {/* biome-ignore lint/a11y/useKeyWithClickEvents: UpdatedEntityCard has keyboard support via Enter key */}
setIsExpanded(!isExpanded)} @@ -113,19 +115,17 @@ export const UpdatedEntityCard = ({ entity }: UpdatedEntityCardProps) => { {!hasChanged ? ( - <> - {Array.isArray(currentValue) ? ( -
    - {currentValue.map(({ id, name }) => ( -
  • - {name} - {id} -
  • - ))} -
- ) : ( - {String(currentValue)} - )} - + Array.isArray(currentValue) ? ( +
    + {currentValue.map(({ id, name }) => ( +
  • + {name} - {id} +
  • + ))} +
+ ) : ( + {String(currentValue)} + ) ) : Array.isArray(newValue) ? (
    {newValue.map(({ id, name }) => ( diff --git a/packages/hypergraph-react/src/create-wallet-client.ts b/packages/hypergraph-react/src/create-wallet-client.ts index af8b3eef..fea1a4d5 100644 --- a/packages/hypergraph-react/src/create-wallet-client.ts +++ b/packages/hypergraph-react/src/create-wallet-client.ts @@ -1,4 +1,4 @@ -import { http, type Account, type Chain, type WalletClient, createWalletClient as viemCreateWalletClient } from 'viem'; +import { type Account, type Chain, http, createWalletClient as viemCreateWalletClient, type WalletClient } from 'viem'; const DEFAULT_RPC_URL = 'https://rpc-geo-genesis-h0q2s21xx8.t.conduit.xyz'; diff --git a/packages/hypergraph-react/src/hooks/useExternalSpaceInbox.ts b/packages/hypergraph-react/src/hooks/useExternalSpaceInbox.ts index 2d1bad11..f5a4959d 100644 --- a/packages/hypergraph-react/src/hooks/useExternalSpaceInbox.ts +++ b/packages/hypergraph-react/src/hooks/useExternalSpaceInbox.ts @@ -6,13 +6,7 @@ import { useHypergraphApp, useHypergraphAuth } from '../HypergraphAppContext.js' * Hook for interacting with external space inboxes * Provides limited capabilities for sending messages to other spaces' inboxes */ -export function useExternalSpaceInbox({ - spaceId, - inboxId, -}: { - spaceId: string; - inboxId: string; -}) { +export function useExternalSpaceInbox({ spaceId, inboxId }: { spaceId: string; inboxId: string }) { const { sendSpaceInboxMessage, getSpaceInbox } = useHypergraphApp(); const { identity } = useHypergraphAuth(); diff --git a/packages/hypergraph-react/src/index.ts b/packages/hypergraph-react/src/index.ts index 61b861a5..e8485cd4 100644 --- a/packages/hypergraph-react/src/index.ts +++ b/packages/hypergraph-react/src/index.ts @@ -1,27 +1,27 @@ export { PublishDiff } from './components/publish-diff/publish-diff.js'; export { createWalletClient } from './create-wallet-client.js'; -export { useSpaces } from './hooks/use-spaces.js'; -export { useExternalAccountInbox } from './hooks/useExternalAccountInbox.js'; -export { useExternalSpaceInbox } from './hooks/useExternalSpaceInbox.js'; -export { useOwnAccountInbox } from './hooks/useOwnAccountInbox.js'; -export { useOwnSpaceInbox } from './hooks/useOwnSpaceInbox.js'; -export { usePublicAccountInboxes } from './hooks/usePublicAccountInboxes.js'; export { HypergraphAppProvider, useHypergraphApp, useHypergraphAuth, } from './HypergraphAppContext.js'; export { - useQueryLocal as _useQueryLocal, HypergraphSpaceProvider, useCreateEntity, useDeleteEntity, useHardDeleteEntity, useQueryEntity, + useQueryLocal as _useQueryLocal, useRemoveRelation, useSpace, useUpdateEntity, } from './HypergraphSpaceContext.js'; +export { useSpaces } from './hooks/use-spaces.js'; +export { useExternalAccountInbox } from './hooks/useExternalAccountInbox.js'; +export { useExternalSpaceInbox } from './hooks/useExternalSpaceInbox.js'; +export { useOwnAccountInbox } from './hooks/useOwnAccountInbox.js'; +export { useOwnSpaceInbox } from './hooks/useOwnSpaceInbox.js'; +export { usePublicAccountInboxes } from './hooks/usePublicAccountInboxes.js'; export { generateDeleteOps as _generateDeleteOps } from './internal/generate-delete-ops.js'; export { useCreateEntityPublic as _useCreateEntityPublic } from './internal/use-create-entity-public.js'; export { useDeleteEntityPublic as _useDeleteEntityPublic } from './internal/use-delete-entity-public.js'; diff --git a/packages/hypergraph-react/src/internal/generate-delete-ops.tsx b/packages/hypergraph-react/src/internal/generate-delete-ops.tsx index b5cbf72f..ed4b271c 100644 --- a/packages/hypergraph-react/src/internal/generate-delete-ops.tsx +++ b/packages/hypergraph-react/src/internal/generate-delete-ops.tsx @@ -43,7 +43,7 @@ type DeleteEntityResult = { } | null; }; -export const generateDeleteOps = async ({ id, space }: { id: string; space: string }) => { +export const generateDeleteOps = async ({ id }: { id: string; space: string }) => { const result = await request(`${Graph.TESTNET_API_ORIGIN}/graphql`, deleteEntityQueryDocument, { entityId: id, }); diff --git a/packages/hypergraph-react/src/internal/use-create-entity-public.ts b/packages/hypergraph-react/src/internal/use-create-entity-public.ts index 062ae47d..130ba57a 100644 --- a/packages/hypergraph-react/src/internal/use-create-entity-public.ts +++ b/packages/hypergraph-react/src/internal/use-create-entity-public.ts @@ -1,7 +1,6 @@ import { Graph, Id, type PropertiesParam, type RelationsParam } from '@graphprotocol/grc-20'; -import type { Connect } from '@graphprotocol/hypergraph'; -import type { Entity } from '@graphprotocol/hypergraph'; -import { Type, store } from '@graphprotocol/hypergraph'; +import type { Connect, Entity } from '@graphprotocol/hypergraph'; +import { store, Type } from '@graphprotocol/hypergraph'; import { useQueryClient } from '@tanstack/react-query'; import { useSelector } from '@xstate/store/react'; import type * as Schema from 'effect/Schema'; diff --git a/packages/hypergraph-react/src/internal/use-delete-entity-public.tsx b/packages/hypergraph-react/src/internal/use-delete-entity-public.tsx index 82fbce53..ab5d6b08 100644 --- a/packages/hypergraph-react/src/internal/use-delete-entity-public.tsx +++ b/packages/hypergraph-react/src/internal/use-delete-entity-public.tsx @@ -78,7 +78,7 @@ export const useDeleteEntityPublic = (type: S, { }); return { success: true, cid, txResult }; - } catch (error) { + } catch (_error) { return { success: false, error: 'Failed to delete entity' }; } }; diff --git a/packages/hypergraph-react/src/internal/use-generate-update-ops.tsx b/packages/hypergraph-react/src/internal/use-generate-update-ops.tsx index 459a43b8..2876a0a0 100644 --- a/packages/hypergraph-react/src/internal/use-generate-update-ops.tsx +++ b/packages/hypergraph-react/src/internal/use-generate-update-ops.tsx @@ -6,6 +6,7 @@ import type { DiffEntry } from '../types.js'; export function useGenerateUpdateOps(type: S, enabled = true) { const mapping = useSelector(store, (state) => state.context.mapping); + // biome-ignore lint/correctness/noUnusedFunctionParameters: temporary return ({ id, diff }: { id: string; diff: DiffEntry }) => { // @ts-expect-error TODO should use the actual type instead of the name in the mapping const typeName = type.name; diff --git a/packages/hypergraph-react/src/internal/use-query-public.tsx b/packages/hypergraph-react/src/internal/use-query-public.tsx index 7d96b2f4..460c7c1f 100644 --- a/packages/hypergraph-react/src/internal/use-query-public.tsx +++ b/packages/hypergraph-react/src/internal/use-query-public.tsx @@ -1,5 +1,5 @@ import { Graph } from '@graphprotocol/grc-20'; -import { type Entity, Type, store } from '@graphprotocol/hypergraph'; +import { type Entity, store, Type } from '@graphprotocol/hypergraph'; import type { Mapping, MappingEntry } from '@graphprotocol/typesync/Mapping'; import { useQuery as useQueryTanstack } from '@tanstack/react-query'; import { useSelector } from '@xstate/store/react'; diff --git a/packages/hypergraph-react/src/prepare-publish.ts b/packages/hypergraph-react/src/prepare-publish.ts index 8eb71217..dd742bfe 100644 --- a/packages/hypergraph-react/src/prepare-publish.ts +++ b/packages/hypergraph-react/src/prepare-publish.ts @@ -7,7 +7,7 @@ import { type RelationsParam, } from '@graphprotocol/grc-20'; import type { Entity } from '@graphprotocol/hypergraph'; -import { Type, store } from '@graphprotocol/hypergraph'; +import { store, Type } from '@graphprotocol/hypergraph'; import request, { gql } from 'graphql-request'; export type PreparePublishParams = { diff --git a/packages/hypergraph-react/src/use-query.tsx b/packages/hypergraph-react/src/use-query.tsx index f3c5663e..397a150f 100644 --- a/packages/hypergraph-react/src/use-query.tsx +++ b/packages/hypergraph-react/src/use-query.tsx @@ -14,7 +14,7 @@ type QueryParams = { }; // @ts-expect-error TODO: remove this function -const mergeEntities = ( +const _mergeEntities = ( publicEntities: Entity.Entity[], localEntities: Entity.Entity[], localDeletedEntities: Entity.Entity[], @@ -46,7 +46,7 @@ const mergeEntities = ( }; // @ts-expect-error TODO: remove this function -const getDiff = ( +const _getDiff = ( type: S, publicEntities: Entity.Entity[], localEntities: Entity.Entity[], diff --git a/packages/hypergraph-react/test/HypergraphAppContext.test.tsx b/packages/hypergraph-react/test/HypergraphAppContext.test.tsx index 1ae00c3f..804ce426 100644 --- a/packages/hypergraph-react/test/HypergraphAppContext.test.tsx +++ b/packages/hypergraph-react/test/HypergraphAppContext.test.tsx @@ -1,7 +1,6 @@ import '@testing-library/jest-dom/vitest'; import { cleanup, renderHook } from '@testing-library/react'; -// biome-ignore lint/style/useImportType: -import React from 'react'; +import type React from 'react'; import { afterEach, describe, expect, it } from 'vitest'; import { HypergraphAppProvider, useHypergraphAuth } from '../src/HypergraphAppContext.js'; @@ -26,7 +25,7 @@ const storageMock = { describe('HypergraphAppContext', () => { it('should render the HypergraphAppProvider and be initially unauthenticated', async () => { const wrapper = ({ children }: Readonly<{ children: React.ReactNode }>) => ( - + {children} ); diff --git a/packages/hypergraph-react/test/HypergraphSpaceContext.test.tsx b/packages/hypergraph-react/test/HypergraphSpaceContext.test.tsx index 5eb25a72..ce242c39 100644 --- a/packages/hypergraph-react/test/HypergraphSpaceContext.test.tsx +++ b/packages/hypergraph-react/test/HypergraphSpaceContext.test.tsx @@ -1,10 +1,9 @@ import { Repo } from '@automerge/automerge-repo'; import { RepoContext } from '@automerge/automerge-repo-react-hooks'; -import { Entity, Type, store } from '@graphprotocol/hypergraph'; +import { Entity, store, Type } from '@graphprotocol/hypergraph'; import '@testing-library/jest-dom/vitest'; import { act, cleanup, renderHook, waitFor } from '@testing-library/react'; -// biome-ignore lint/style/useImportType: -import React from 'react'; +import type React from 'react'; import { afterEach, beforeEach, describe, expect, it } from 'vitest'; import { HypergraphSpaceProvider, @@ -186,7 +185,7 @@ describe('HypergraphSpaceContext', () => { let deleted = false; act(() => { - // biome-ignore lint/style/noNonNullAssertion: + // biome-ignore lint/style/noNonNullAssertion: fine for testing deleted = deleteEntityResult.current(createdEntity!.id); }); diff --git a/packages/hypergraph-react/vitest.config.ts b/packages/hypergraph-react/vitest.config.ts index 9df977ef..fe67e65c 100644 --- a/packages/hypergraph-react/vitest.config.ts +++ b/packages/hypergraph-react/vitest.config.ts @@ -1,5 +1,5 @@ import react from '@vitejs/plugin-react'; -import { type UserConfigExport, mergeConfig } from 'vitest/config'; +import { mergeConfig, type UserConfigExport } from 'vitest/config'; import shared from '../../vitest.shared.js'; diff --git a/packages/hypergraph/src/connect/identity-encryption.ts b/packages/hypergraph/src/connect/identity-encryption.ts index 81240ddf..cc3b2988 100644 --- a/packages/hypergraph/src/connect/identity-encryption.ts +++ b/packages/hypergraph/src/connect/identity-encryption.ts @@ -2,10 +2,9 @@ import { gcm } from '@noble/ciphers/aes'; import { randomBytes } from '@noble/ciphers/webcrypto'; import { hkdf } from '@noble/hashes/hkdf'; import { sha256 } from '@noble/hashes/sha256'; +import { cryptoBoxSeal, cryptoBoxSealOpen } from '@serenity-kit/noble-sodium'; import type { Hex } from 'viem'; import { verifyMessage } from 'viem'; - -import { cryptoBoxSeal, cryptoBoxSealOpen } from '@serenity-kit/noble-sodium'; import { bytesToHex, canonicalize, hexToBytes } from '../utils/index.js'; import type { IdentityKeys, PrivateAppIdentity, Signer } from './types.js'; @@ -119,7 +118,7 @@ export const decryptIdentity = async (signer: Signer, ciphertext: string, nonce: let keysMsg: Uint8Array; try { keysMsg = await decrypt(ciphertext, secretKey); - } catch (e) { + } catch (_e) { // See https://github.com/xmtp/xmtp-js/blob/8d6e5a65813902926baac8150a648587acbaad92/sdks/js-sdk/src/keystore/providers/NetworkKeyManager.ts#L142-L146 if (secretKey.length !== 65) { throw new Error('Expected 65 bytes before trying a different recovery byte'); diff --git a/packages/hypergraph/src/connect/login.ts b/packages/hypergraph/src/connect/login.ts index c8213c27..62053991 100644 --- a/packages/hypergraph/src/connect/login.ts +++ b/packages/hypergraph/src/connect/login.ts @@ -9,10 +9,10 @@ import { loadAccountAddress, storeAccountAddress, storeKeys } from './auth-stora import { createIdentityKeys } from './create-identity-keys.js'; import { decryptIdentity, encryptIdentity } from './identity-encryption.js'; import { - type SmartAccountParams, addSmartAccountOwner, getSmartAccountWalletClient, isSmartAccountDeployed, + type SmartAccountParams, smartAccountNeedsUpdate, updateLegacySmartAccount, } from './smart-account.js'; @@ -27,7 +27,7 @@ export async function identityExists(accountAddress: string, syncServerUri: stri export async function signup( signer: Signer, - walletClient: WalletClient, + _walletClient: WalletClient, smartAccountClient: SmartAccountClient, accountAddress: Address, syncServerUri: string, diff --git a/packages/hypergraph/src/connect/parse-auth-params.ts b/packages/hypergraph/src/connect/parse-auth-params.ts index 23a7c416..8e7a9169 100644 --- a/packages/hypergraph/src/connect/parse-auth-params.ts +++ b/packages/hypergraph/src/connect/parse-auth-params.ts @@ -31,7 +31,7 @@ export const parseAuthParams = ( } return Effect.succeed({ payload: result.right, redirect, nonce }); - } catch (error) { + } catch (_error) { return Effect.fail(new FailedToParseConnectAuthUrl({ message: 'Failed to parse connect auth payload' })); } }; diff --git a/packages/hypergraph/src/connect/smart-account.ts b/packages/hypergraph/src/connect/smart-account.ts index 23e6b12e..3aa536ad 100644 --- a/packages/hypergraph/src/connect/smart-account.ts +++ b/packages/hypergraph/src/connect/smart-account.ts @@ -1,10 +1,6 @@ import { MAINNET, TESTNET } from '@graphprotocol/grc-20/contracts'; import { randomBytes } from '@noble/hashes/utils'; import { - OWNABLE_VALIDATOR_ADDRESS, - RHINESTONE_ATTESTER_ADDRESS, - type Session, - SmartSessionMode, encodeSmartSessionSignature, encodeValidationData, encodeValidatorNonce, @@ -20,37 +16,41 @@ import { getUniversalActionPolicy, getUsageLimitPolicy, getValueLimitPolicy, + OWNABLE_VALIDATOR_ADDRESS, + RHINESTONE_ATTESTER_ADDRESS, + type Session, + SmartSessionMode, } from '@rhinestone/module-sdk'; -import { type SmartAccountClient, createSmartAccountClient, encodeInstallModule } from 'permissionless'; +import { createSmartAccountClient, encodeInstallModule, type SmartAccountClient } from 'permissionless'; import { type ToSafeSmartAccountParameters, toSafeSmartAccount } from 'permissionless/accounts'; import { getAccountNonce } from 'permissionless/actions'; import { erc7579Actions } from 'permissionless/actions/erc7579'; import { createPimlicoClient } from 'permissionless/clients/pimlico'; import { - http, type AbiFunction, type Account, type Address, type Calls, type Chain, ContractFunctionExecutionError, + createPublicClient, + encodeFunctionData, + getAbiItem, type Hex, + http, type Narrow, type PrivateKeyAccount, type SignableMessage, - type WalletClient, - createPublicClient, - encodeFunctionData, - getAbiItem, toBytes, toFunctionSelector, toHex, + type WalletClient, } from 'viem'; import { - type UserOperation, - type WaitForUserOperationReceiptReturnType, entryPoint07Address, getUserOperationHash, + type UserOperation, + type WaitForUserOperationReceiptReturnType, } from 'viem/account-abstraction'; import { privateKeyToAccount } from 'viem/accounts'; import { bytesToHex } from '../utils/hexBytesAddressUtils.js'; diff --git a/packages/hypergraph/src/entity/findMany.ts b/packages/hypergraph/src/entity/findMany.ts index b7f7156e..3509dc1c 100644 --- a/packages/hypergraph/src/entity/findMany.ts +++ b/packages/hypergraph/src/entity/findMany.ts @@ -3,7 +3,7 @@ import * as Schema from 'effect/Schema'; import { deepMerge } from '../utils/internal/deep-merge.js'; import { isRelationField } from '../utils/isRelationField.js'; import { canonicalize } from '../utils/jsc.js'; -import { type DecodedEntitiesCacheEntry, type QueryEntry, decodedEntitiesCache } from './decodedEntitiesCache.js'; +import { type DecodedEntitiesCacheEntry, decodedEntitiesCache, type QueryEntry } from './decodedEntitiesCache.js'; import { entityRelationParentsMap } from './entityRelationParentsMap.js'; import { getEntityRelations } from './getEntityRelations.js'; import { hasValidTypesProperty } from './hasValidTypesProperty.js'; @@ -367,7 +367,7 @@ export function findMany( decoded.__schema = type; filtered.push(decoded); } - } catch (error) { + } catch (_error) { corruptEntityIds.push(id); } } diff --git a/packages/hypergraph/src/entity/update.ts b/packages/hypergraph/src/entity/update.ts index 9dd22bd5..f88762e1 100644 --- a/packages/hypergraph/src/entity/update.ts +++ b/packages/hypergraph/src/entity/update.ts @@ -19,7 +19,7 @@ export const update = (handle: DocHandle updates the existing entity to the repo entities document - let updated: Schema.Schema.Type | undefined = undefined; + let updated: Schema.Schema.Type | undefined; handle.change((doc) => { if (doc.entities === undefined) { return; diff --git a/packages/hypergraph/src/identity/identity-encryption.ts b/packages/hypergraph/src/identity/identity-encryption.ts index 8e389105..108ad217 100644 --- a/packages/hypergraph/src/identity/identity-encryption.ts +++ b/packages/hypergraph/src/identity/identity-encryption.ts @@ -119,7 +119,7 @@ export const decryptIdentity = async ( let keysMsg: Uint8Array; try { keysMsg = await decrypt(ciphertext, secretKey); - } catch (e) { + } catch (_e) { // See https://github.com/xmtp/xmtp-js/blob/8d6e5a65813902926baac8150a648587acbaad92/sdks/js-sdk/src/keystore/providers/NetworkKeyManager.ts#L142-L146 if (secretKey.length !== 65) { throw new Error('Expected 65 bytes before trying a different recovery byte'); diff --git a/packages/hypergraph/src/identity/index.ts b/packages/hypergraph/src/identity/index.ts index eef44451..8793973d 100644 --- a/packages/hypergraph/src/identity/index.ts +++ b/packages/hypergraph/src/identity/index.ts @@ -1,6 +1,6 @@ export * from './auth-storage.js'; export * from './get-verified-identity.js'; export * from './identity-encryption.js'; -export * from './prove-ownership.js'; export * from './logout.js'; +export * from './prove-ownership.js'; export * from './types.js'; diff --git a/packages/hypergraph/src/identity/prove-ownership.ts b/packages/hypergraph/src/identity/prove-ownership.ts index 5e971f00..8e4215ac 100644 --- a/packages/hypergraph/src/identity/prove-ownership.ts +++ b/packages/hypergraph/src/identity/prove-ownership.ts @@ -1,7 +1,6 @@ -import { http, type Chain, type Hex, createPublicClient, verifyMessage } from 'viem'; -import { privateKeyToAccount } from 'viem/accounts'; - import type { SmartAccountClient } from 'permissionless'; +import { type Chain, createPublicClient, type Hex, http, verifyMessage } from 'viem'; +import { privateKeyToAccount } from 'viem/accounts'; import { publicKeyToAddress } from '../utils/index.js'; import type { IdentityKeys } from './types.js'; diff --git a/packages/hypergraph/src/inboxes/index.ts b/packages/hypergraph/src/inboxes/index.ts index 3a770156..91062a57 100644 --- a/packages/hypergraph/src/inboxes/index.ts +++ b/packages/hypergraph/src/inboxes/index.ts @@ -1,10 +1,10 @@ export * from './create-inbox.js'; export * from './get-list-inboxes.js'; +export * from './merge-messages.js'; export * from './message-encryption.js'; export * from './message-validation.js'; export * from './prepare-message.js'; export * from './recover-inbox-creator.js'; export * from './recover-inbox-message-signer.js'; export * from './send-message.js'; -export * from './merge-messages.js'; export * from './types.js'; diff --git a/packages/hypergraph/src/index.ts b/packages/hypergraph/src/index.ts index 4a138325..6066e410 100644 --- a/packages/hypergraph/src/index.ts +++ b/packages/hypergraph/src/index.ts @@ -6,8 +6,8 @@ export * as Key from './key/index.js'; export * as Messages from './messages/index.js'; export * as SpaceEvents from './space-events/index.js'; export * as SpaceInfo from './space-info/index.js'; -export * as StoreConnect from './store-connect.js'; export * from './store.js'; +export * as StoreConnect from './store-connect.js'; export * as Type from './type/type.js'; export * from './types.js'; export * as Utils from './utils/index.js'; diff --git a/packages/hypergraph/src/space-info/decrypt-space-info.ts b/packages/hypergraph/src/space-info/decrypt-space-info.ts index a9154a4f..fda7e340 100644 --- a/packages/hypergraph/src/space-info/decrypt-space-info.ts +++ b/packages/hypergraph/src/space-info/decrypt-space-info.ts @@ -6,13 +6,7 @@ import { SpaceInfoContent } from './types.js'; const decodeSpaceInfoContent = Schema.decodeSync(SpaceInfoContent); -export const decryptSpaceInfo = ({ - spaceInfo, - secretKey, -}: { - spaceInfo: Uint8Array; - secretKey: string; -}) => { +export const decryptSpaceInfo = ({ spaceInfo, secretKey }: { spaceInfo: Uint8Array; secretKey: string }) => { const decrypted = decryptMessage({ nonceAndCiphertext: spaceInfo, secretKey: hexToBytes(secretKey), diff --git a/packages/hypergraph/src/store-connect.ts b/packages/hypergraph/src/store-connect.ts index 177ff250..a1009ca4 100644 --- a/packages/hypergraph/src/store-connect.ts +++ b/packages/hypergraph/src/store-connect.ts @@ -1,5 +1,5 @@ import type { AnyDocumentId, DocHandle, Repo } from '@automerge/automerge-repo'; -import { type Store, createStore } from '@xstate/store'; +import { createStore, type Store } from '@xstate/store'; import type { Address } from 'viem'; import { mergeMessages } from './inboxes/merge-messages.js'; import type { InboxSenderAuthPolicy } from './inboxes/types.js'; diff --git a/packages/hypergraph/src/store.ts b/packages/hypergraph/src/store.ts index aa5da70c..2b9bbd36 100644 --- a/packages/hypergraph/src/store.ts +++ b/packages/hypergraph/src/store.ts @@ -1,6 +1,6 @@ import type { AnyDocumentId, DocHandle, Repo } from '@automerge/automerge-repo'; import type { Mapping } from '@graphprotocol/typesync/Mapping'; -import { type Store, createStore } from '@xstate/store'; +import { createStore, type Store } from '@xstate/store'; import type { PrivateAppIdentity } from './connect/types.js'; import type { DocumentContent } from './entity/types.js'; import { mergeMessages } from './inboxes/merge-messages.js'; diff --git a/packages/hypergraph/test/entity/entity.test.ts b/packages/hypergraph/test/entity/entity.test.ts index 1c3edd75..7008d364 100644 --- a/packages/hypergraph/test/entity/entity.test.ts +++ b/packages/hypergraph/test/entity/entity.test.ts @@ -29,12 +29,11 @@ describe('Entity', () => { const automergeDocId = idToAutomergeId(spaceId); let repo: Repo; - // biome-ignore lint/suspicious/noExplicitAny: - let handle: DocHandle; + let handle: DocHandle; beforeEach(() => { repo = new Repo({}); // reset to new Repo instance to clear created entities in tests - const result = repo.findWithProgress(automergeDocId as AnyDocumentId); + const result = repo.findWithProgress(automergeDocId as AnyDocumentId); handle = result.handle; // set it to ready to interact with the document handle.doneLoading(); diff --git a/packages/hypergraph/test/entity/findMany.test.ts b/packages/hypergraph/test/entity/findMany.test.ts index cc0e79b3..f685aa54 100644 --- a/packages/hypergraph/test/entity/findMany.test.ts +++ b/packages/hypergraph/test/entity/findMany.test.ts @@ -24,12 +24,11 @@ describe('findMany with filters', () => { const automergeDocId = idToAutomergeId(spaceId); let repo: Repo; - // biome-ignore lint/suspicious/noExplicitAny: - let handle: DocHandle; + let handle: DocHandle; beforeEach(() => { repo = new Repo({}); // reset to new Repo instance to clear created entities in tests - const result = repo.findWithProgress(automergeDocId as AnyDocumentId); + const result = repo.findWithProgress(automergeDocId as AnyDocumentId); handle = result.handle; // set it to ready to interact with the document handle.doneLoading(); diff --git a/packages/hypergraph/test/identity/connect.test.ts b/packages/hypergraph/test/identity/connect.test.ts index 29519949..ef76722d 100644 --- a/packages/hypergraph/test/identity/connect.test.ts +++ b/packages/hypergraph/test/identity/connect.test.ts @@ -1,10 +1,9 @@ import { randomBytes } from '@noble/ciphers/webcrypto'; import { secp256k1 } from '@noble/curves/secp256k1'; +import type { Hex } from 'viem'; import { type PrivateKeyAccount, privateKeyToAccount } from 'viem/accounts'; import { describe, expect, it } from 'vitest'; -import type { Hex } from 'viem'; - import { createIdentityKeys } from '../../src/connect/create-identity-keys.js'; import { decryptIdentity, encryptIdentity } from '../../src/identity/identity-encryption.js'; // import { proveIdentityOwnership, verifyIdentityOwnership } from '../../src/identity/prove-ownership.js'; diff --git a/packages/hypergraph/test/inboxes/inboxes.test.ts b/packages/hypergraph/test/inboxes/inboxes.test.ts index 3e4f0c53..c550f0bf 100644 --- a/packages/hypergraph/test/inboxes/inboxes.test.ts +++ b/packages/hypergraph/test/inboxes/inboxes.test.ts @@ -755,7 +755,7 @@ describe('inboxes', () => { it('should reject unsigned messages for RequiresAuth inboxes', async () => { const accountAddress = '0x1234567890123456789012345678901234567890'; - const inboxId = generateId(); + const _inboxId = generateId(); const message = { ciphertext: '0x123', @@ -856,7 +856,7 @@ describe('inboxes', () => { it('should accept unsigned messages for Anonymous inboxes', async () => { const accountAddress = '0x1234567890123456789012345678901234567890'; - const inboxId = generateId(); + const _inboxId = generateId(); const message = { ciphertext: '0x123', diff --git a/packages/hypergraph/test/space-events/apply-event.test.ts b/packages/hypergraph/test/space-events/apply-event.test.ts index 39c788ce..9ec2107d 100644 --- a/packages/hypergraph/test/space-events/apply-event.test.ts +++ b/packages/hypergraph/test/space-events/apply-event.test.ts @@ -1,15 +1,13 @@ import { secp256k1 } from '@noble/curves/secp256k1'; import { Cause, Effect, Exit } from 'effect'; import { expect, it } from 'vitest'; - -import { canonicalize } from '../../src/utils/jsc.js'; -import { stringToUint8Array } from '../../src/utils/stringToUint8Array.js'; - import { InvalidIdentityError, type PublicIdentity } from '../../src/identity/types.js'; import { applyEvent } from '../../src/space-events/apply-event.js'; import { createInvitation } from '../../src/space-events/create-invitation.js'; import { createSpace } from '../../src/space-events/create-space.js'; import { InvalidEventError, VerifySignatureError } from '../../src/space-events/types.js'; +import { canonicalize } from '../../src/utils/jsc.js'; +import { stringToUint8Array } from '../../src/utils/stringToUint8Array.js'; const author = { accountAddress: '0x12345678', diff --git a/packages/hypergraph/test/utils/jsc.test.ts b/packages/hypergraph/test/utils/jsc.test.ts index 51215669..3dd94f78 100644 --- a/packages/hypergraph/test/utils/jsc.test.ts +++ b/packages/hypergraph/test/utils/jsc.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import { InfinityNotAllowedError, NaNNotAllowedError, canonicalize } from '../../src/utils/jsc.js'; +import { canonicalize, InfinityNotAllowedError, NaNNotAllowedError } from '../../src/utils/jsc.js'; describe('jsc', () => { describe('canonicalize', () => { diff --git a/packages/hypergraph/vitest.config.ts b/packages/hypergraph/vitest.config.ts index 1be24e98..33074888 100644 --- a/packages/hypergraph/vitest.config.ts +++ b/packages/hypergraph/vitest.config.ts @@ -1,4 +1,4 @@ -import { type UserConfigExport, mergeConfig } from 'vitest/config'; +import { mergeConfig, type UserConfigExport } from 'vitest/config'; import shared from '../../vitest.shared.js'; const config: UserConfigExport = {}; diff --git a/packages/typesync/package.json b/packages/typesync/package.json index 97013d4b..9d5b49b4 100644 --- a/packages/typesync/package.json +++ b/packages/typesync/package.json @@ -12,7 +12,11 @@ "url": "https://github.com/graphprotocol/hypergraph.git", "directory": "packages/typesync" }, - "keywords": ["The Graph", "GRC-20", "hypergraph"], + "keywords": [ + "The Graph", + "GRC-20", + "hypergraph" + ], "license": "MIT", "type": "module", "main": "./dist/index.js", diff --git a/packages/typesync/test/Mapping.test.ts b/packages/typesync/test/Mapping.test.ts index 19597961..2afdaccb 100644 --- a/packages/typesync/test/Mapping.test.ts +++ b/packages/typesync/test/Mapping.test.ts @@ -2,11 +2,11 @@ import { Id } from '@graphprotocol/grc-20'; import { describe, expect, it } from 'vitest'; import { - type Mapping, - type Schema, allRelationPropertyTypesExist, generateMapping, + type Mapping, mapSchemaDataTypeToGRC20PropDataType, + type Schema, } from '../src/Mapping.js'; describe('Mapping', () => { diff --git a/packages/typesync/vitest.config.ts b/packages/typesync/vitest.config.ts index 1be24e98..33074888 100644 --- a/packages/typesync/vitest.config.ts +++ b/packages/typesync/vitest.config.ts @@ -1,4 +1,4 @@ -import { type UserConfigExport, mergeConfig } from 'vitest/config'; +import { mergeConfig, type UserConfigExport } from 'vitest/config'; import shared from '../../vitest.shared.js'; const config: UserConfigExport = {}; From cda9ff429661ec720887c1ed75033187335a5a91 Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Tue, 22 Jul 2025 21:37:37 +0200 Subject: [PATCH 4/4] update lockfile --- pnpm-lock.yaml | 81 ++++---------------------------------------------- 1 file changed, 5 insertions(+), 76 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6d208d5d..17e69938 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -297,7 +297,7 @@ importers: version: 7.1.2(graphql@16.11.0) isomorphic-ws: specifier: ^5.0.0 - version: 5.0.0(ws@8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + version: 5.0.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)) lucide-react: specifier: ^0.508.0 version: 0.508.0(react@19.1.0) @@ -610,81 +610,6 @@ importers: version: 7.0.4(@types/node@24.0.15)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.39.1)(tsx@4.20.3)(yaml@2.7.0) publishDirectory: dist - apps/typesync/dist: - dependencies: - '@graphprotocol/grc-20': - specifier: ^0.21.6 - version: 0.21.6(bufferutil@4.0.9)(graphql@16.11.0)(ox@0.6.7(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) - '@graphprotocol/typesync': - specifier: workspace:* - version: link:../../../packages/typesync/publish - '@graphql-typed-document-node/core': - specifier: ^3.2.0 - version: 3.2.0(graphql@16.11.0) - '@headlessui/react': - specifier: ^2.2.4 - version: 2.2.4(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@heroicons/react': - specifier: ^2.2.0 - version: 2.2.0(react@19.1.0) - '@phosphor-icons/react': - specifier: ^2.1.10 - version: 2.1.10(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@radix-ui/react-tabs': - specifier: ^1.1.12 - version: 1.1.12(@types/react-dom@19.1.6(@types/react@19.1.8))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@tailwindcss/vite': - specifier: ^4.1.11 - version: 4.1.11(vite@7.0.5(@types/node@24.0.15)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.39.1)(tsx@4.20.3)(yaml@2.7.0)) - '@tanstack/react-form': - specifier: ^1.14.1 - version: 1.14.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@tanstack/react-query': - specifier: ^5.83.0 - version: 5.83.0(react@19.1.0) - '@tanstack/react-query-devtools': - specifier: ^5.83.0 - version: 5.83.0(@tanstack/react-query@5.83.0(react@19.1.0))(react@19.1.0) - '@tanstack/react-router': - specifier: ^1.128.0 - version: 1.129.2(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@tanstack/react-router-devtools': - specifier: ^1.128.0 - version: 1.129.2(@tanstack/react-router@1.129.2(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(@tanstack/router-core@1.129.2)(csstype@3.1.3)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(solid-js@1.9.5)(tiny-invariant@1.3.3) - better-sqlite3: - specifier: ^12.2.0 - version: 12.2.0 - date-fns: - specifier: ^4.1.0 - version: 4.1.0 - effect: - specifier: ^3.16.16 - version: 3.17.0 - graphql: - specifier: ^16.11.0 - version: 16.11.0 - graphql-request: - specifier: ^7.2.0 - version: 7.2.0(graphql@16.11.0) - jotai: - specifier: ^2.12.5 - version: 2.12.5(@types/react@19.1.8)(react@19.1.0) - open: - specifier: ^10.2.0 - version: 10.2.0 - react: - specifier: ^19.1.0 - version: 19.1.0 - react-dom: - specifier: ^19.1.0 - version: 19.1.0(react@19.1.0) - shiki: - specifier: ^3.8.0 - version: 3.8.0 - tailwindcss: - specifier: ^4.1.11 - version: 4.1.11 - docs: dependencies: '@docusaurus/core': @@ -23297,6 +23222,10 @@ snapshots: dependencies: ws: 7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10) + isomorphic-ws@5.0.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)): + dependencies: + ws: 8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + isomorphic-ws@5.0.0(ws@8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)): dependencies: ws: 8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)