Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@tanstack/react-router-devtools": "^1.122.0",
"@xstate/store": "^3.5.1",
"clsx": "^2.1.1",
"effect": "^3.17.1",
"effect": "^3.17.3",
"graphql-request": "^7.2.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
Expand Down
4 changes: 2 additions & 2 deletions apps/create-hypergraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
"homepage": "https://github.com/graphprotocol/hypergraph/tree/main/apps/create-hypergraph-app#readme",
"devDependencies": {
"@effect/cli": "^0.69.0",
"@effect/language-service": "^0.28.3",
"@effect/language-service": "^0.31.2",
"@effect/platform": "^0.90.0",
"@effect/platform-node": "^0.94.0",
"@effect/printer-ansi": "^0.45.0",
"@effect/vitest": "^0.25.0",
"@types/node": "^24.1.0",
"effect": "^3.17.1",
"effect": "^3.17.3",
"execa": "^9.6.0",
"tsdown": "^0.13.0",
"tsx": "^4.20.3"
Expand Down
2 changes: 1 addition & 1 deletion apps/create-hypergraph/template-vite-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@tanstack/react-router": "^1.129.2",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"effect": "^3.17.1",
"effect": "^3.17.3",
"lucide-react": "^0.525.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
Expand Down
5 changes: 3 additions & 2 deletions apps/events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"type": "module",
"scripts": {
"dev": "vite --force",
"preview": "vite preview"
"preview": "vite preview",
"typesync": "hypergraph typesync"
},
"dependencies": {
"@graphprotocol/grc-20": "^0.21.6",
Expand All @@ -22,7 +23,7 @@
"@xstate/store": "^3.5.1",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"effect": "^3.17.1",
"effect": "^3.17.3",
"framer-motion": "^12.10.1",
"graphql-request": "^7.1.2",
"isomorphic-ws": "^5.0.0",
Expand Down
4 changes: 1 addition & 3 deletions apps/events/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
"@graphprotocol/hypergraph": ["../../packages/hypergraph/src/index.js"],
"@graphprotocol/hypergraph/*": ["../../packages/hypergraph/src/*.js"],
"@graphprotocol/hypergraph-react": ["../../packages/hypergraph-react/src/index.js"],
"@graphprotocol/hypergraph-react/*": ["../../packages/hypergraph-react/src/*.js"],
"@graphprotocol/typesync": ["../../packages/typesync/src/index.js"],
"@graphprotocol/typesync/*": ["../../packages/typesync/src/*.js"]
"@graphprotocol/hypergraph-react/*": ["../../packages/hypergraph-react/src/*.js"]
}
}
}
2 changes: 1 addition & 1 deletion apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@privy-io/server-auth": "^1.26.0",
"body-parser": "^2.2.0",
"cors": "^2.8.5",
"effect": "^3.17.1",
"effect": "^3.17.3",
"express": "^5.1.0",
"prisma": "^6.7.0",
"siwe": "^3.0.0",
Expand Down
6 changes: 3 additions & 3 deletions apps/typesync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
},
"devDependencies": {
"@effect/cli": "^0.69.0",
"@effect/experimental": "^0.54.0",
"@effect/language-service": "^0.28.3",
"@effect/experimental": "^0.54.2",
"@effect/language-service": "^0.31.2",
"@effect/platform": "^0.90.0",
"@effect/platform-node": "^0.94.0",
"@effect/printer": "^0.45.0",
Expand Down Expand Up @@ -81,7 +81,7 @@
"@tanstack/react-router-devtools": "^1.129.5",
"better-sqlite3": "^12.2.0",
"date-fns": "^4.1.0",
"effect": "^3.17.1",
"effect": "^3.17.3",
"graphql": "^16.11.0",
"graphql-request": "^7.2.0",
"jotai": "^2.12.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/hypergraph-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@graphprotocol/grc-20": "^0.21.6",
"@noble/hashes": "^1.8.0",
"@tanstack/react-query": "^5.75.5",
"effect": "^3.17.1",
"effect": "^3.17.3",
"graphql-request": "^7.1.2",
"siwe": "^3.0.0",
"uuid": "^11.1.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/hypergraph-react/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "./tsconfig.src.json",
"references": [
{ "path": "../hypergraph/tsconfig.build.json" },
{ "path": "../typesync/tsconfig.build.json" }
{ "path": "../hypergraph/tsconfig.build.json" }
],
"compilerOptions": {
"tsBuildInfoFile": ".tsbuildinfo/build.tsbuildinfo",
Expand Down
3 changes: 1 addition & 2 deletions packages/hypergraph-react/tsconfig.src.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"extends": "../../tsconfig.base.json",
"include": ["src"],
"references": [
{ "path": "../hypergraph/tsconfig.src.json" },
{ "path": "../typesync/tsconfig.src.json" }
{ "path": "../hypergraph/tsconfig.src.json" }
],
"compilerOptions": {
"tsBuildInfoFile": ".tsbuildinfo/src.tsbuildinfo",
Expand Down
1 change: 0 additions & 1 deletion packages/hypergraph-react/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"references": [
{ "path": "./tsconfig.src.json" },
{ "path": "../hypergraph/tsconfig.src.json" },
{ "path": "../typesync/tsconfig.src.json" }
],
"compilerOptions": {
"tsBuildInfoFile": ".tsbuildinfo/test.tsbuildinfo",
Expand Down
23 changes: 20 additions & 3 deletions packages/hypergraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"version": "0.3.0",
"description": "SDK for building performant, type-safe, local-first dapps on top of The Graph ecosystem knowledge graphs.",
"publishConfig": {
"bin": {
"hypergraph": "./dist/cli/bin.js",
"hg": "./dist/cli/bin.js"
},
"access": "public",
"directory": "publish",
"provenance": false
Expand Down Expand Up @@ -37,10 +41,23 @@
"sideEffects": [],
"scripts": {
"build": "tsc -b --force tsconfig.build.json && babel dist --plugins annotate-pure-calls --out-dir dist --source-maps && node ../../scripts/package.mjs",
"test": "vitest"
"test": "vitest",
"hypergraph": "pnpm tsx ./src/cli/bun.ts"
},
"bin": {
"hypergraph": "./src/cli/bun.ts",
"hg": "./src/cli/bun.ts"
},
"devDependencies": {
"@types/uuid": "^10.0.0"
"@effect/cli": "^0.69.0",
"@effect/platform": "^0.90.0",
"@effect/platform-node": "^0.94.0",
"@effect/printer-ansi": "^0.45.0",
"@effect/vitest": "^0.25.0",
"@types/node": "^24.1.0",
"@types/uuid": "^10.0.0",
"jiti": "^2.5.1",
"typescript": "^5.8.3"
},
"dependencies": {
"@automerge/automerge": "^2.2.9",
Expand All @@ -55,7 +72,7 @@
"@serenity-kit/noble-sodium": "^0.2.1",
"@xstate/store": "^3.5.1",
"bs58check": "^4.0.0",
"effect": "^3.17.1",
"effect": "^3.17.3",
"permissionless": "^0.2.47",
"siwe": "^3.0.0",
"uuid": "^11.1.0",
Expand Down
15 changes: 15 additions & 0 deletions packages/hypergraph/src/cli/Cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as Command from '@effect/cli/Command';

import { typesync } from './subcommands/typesync.js';

const hypergraph = Command.make('hypergraph').pipe(
Command.withDescription(
'Hypergraph command line interface for building and interacting with @graphprotocol/hypergraph schemas',
),
Command.withSubcommands([typesync]),
);

export const run = Command.run(hypergraph, {
name: 'hypergraph',
version: '0.3.0',
});
20 changes: 20 additions & 0 deletions packages/hypergraph/src/cli/Logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as Ansi from '@effect/printer-ansi/Ansi';
import * as AnsiDoc from '@effect/printer-ansi/AnsiDoc';
import * as EffectArray from 'effect/Array';
import * as Logger from 'effect/Logger';

export const AnsiDocLogger = Logger.make(({ message }) => {
const messageArr = EffectArray.ensure(message);
for (let i = 0; i < messageArr.length; i++) {
const currentMessage = messageArr[i];
if (AnsiDoc.isDoc(currentMessage)) {
const prefix = AnsiDoc.text('hypergraph-cli').pipe(
AnsiDoc.annotate(Ansi.cyan),
AnsiDoc.squareBracketed,
AnsiDoc.cat(AnsiDoc.colon),
);
const document = AnsiDoc.catWithSpace(prefix, currentMessage as AnsiDoc.AnsiDoc);
globalThis.console.log(AnsiDoc.render(document, { style: 'pretty' }));
}
}
});
33 changes: 33 additions & 0 deletions packages/hypergraph/src/cli/bin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env node

import { NodeContext, NodeFileSystem, NodeRuntime } from '@effect/platform-node';
import * as Ansi from '@effect/printer-ansi/Ansi';
import * as AnsiDoc from '@effect/printer-ansi/AnsiDoc';
import * as Effect from 'effect/Effect';
import * as Logger from 'effect/Logger';
import * as LogLevel from 'effect/LogLevel';

import { run } from './Cli.js';
import { AnsiDocLogger } from './Logger.js';

const runnable = Effect.suspend(() => run(process.argv)).pipe(
Effect.provide(NodeFileSystem.layer),
Effect.provide(NodeContext.layer),
);

runnable.pipe(
Effect.catchAllDefect((defect) =>
Effect.gen(function* () {
if (defect && typeof defect === 'object' && 'name' in defect && defect.name === 'QuitException') {
return yield* Effect.logError(
AnsiDoc.cat(AnsiDoc.hardLine, AnsiDoc.text('Exiting...').pipe(AnsiDoc.annotate(Ansi.red))),
);
}
return Effect.die(defect);
}),
),
Effect.provide(Logger.replace(Logger.defaultLogger, AnsiDocLogger)),
Logger.withMinimumLogLevel(LogLevel.Debug),
Effect.orDie,
NodeRuntime.runMain({ disableErrorReporting: process.env.NODE_ENV === 'prod', disablePrettyLogger: true }),
);
3 changes: 3 additions & 0 deletions packages/hypergraph/src/cli/bun.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bun

import './bin.js';
Loading
Loading