From c1ed3ef669c516399b3e70a5843281b0c970c547 Mon Sep 17 00:00:00 2001 From: Marcus Rein Date: Mon, 23 Jun 2025 11:21:01 -0400 Subject: [PATCH 1/3] rename typesync to hypergraph and update related commands in README and package.json --- apps/typesync/README.md | 30 ++++++++++++---------- apps/typesync/package.json | 5 ++-- apps/typesync/scripts/copy-package-json.ts | 5 +++- apps/typesync/src/Cli.ts | 8 +++--- 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/apps/typesync/README.md b/apps/typesync/README.md index 75b8a58e..5fde134f 100644 --- a/apps/typesync/README.md +++ b/apps/typesync/README.md @@ -1,38 +1,40 @@ -# @graphprotocol/typesync +# @graphprotocol/hypergraph-cli -CLI toolchain to view existing types, select, pick, extend to create schemas and generate a [@graphprotocol/hypergraph](https://github.com/graphprotocol/hypergraph/tree/main/packages/hypergraph) schema. +# Hypergraph command-line toolchain for scaffolding and working with Hypergraph applications. ## Installing ```bash # npm -npm i -g @graphprotocol/typesync-cli +npm i -g @graphprotocol/hypergraph-cli # yarn -yarn global add @graphprotocol/typesync-cli +yarn global add @graphprotocol/hypergraph-cli # pnpm -pnpm install -g @graphprotocol/typesync-cli +pnpm install -g @graphprotocol/hypergraph-cli ``` ## Running ```bash -typsync --help +hypergraph --help +hg --help # short alias -# opening typesync studio -typesync studio +# opening Hypergraph studio +hypergraph studio +hg studio -# opening typesync studio in firefox automatically -typesync studio --open --browser firefox +# opening Hypergraph studio in firefox automatically +hypergraph studio --open --browser firefox ``` ## Commands -- `studio` -> runs the `Typesync` api and client UI application for viewing created application schemas, browsing the Knowledge Graph, and creating new application schemas. - - running: `typesync studio` +- `studio` -> runs the Hypergraph API and client UI application for viewing created application schemas, browsing the Knowledge Graph, and creating new application schemas. + - running: `hypergraph studio` - args: - `port` [OPTIONAL, default = 3000] port to run the application on - - example: `typesync studio --port 3001` + - example: `hypergraph studio --port 3001` - `browser` [OPTION, default 'browser'] browser to open the app in, if the `--open` flag is passed - - example: `typesync studio --open --browser firefox` \ No newline at end of file + - example: `hypergraph studio --open --browser firefox` \ No newline at end of file diff --git a/apps/typesync/package.json b/apps/typesync/package.json index ae0e11e2..260cc3d5 100644 --- a/apps/typesync/package.json +++ b/apps/typesync/package.json @@ -15,7 +15,8 @@ "linkDirectory": false }, "bin": { - "typesync": "./dist/bin.cjs" + "hypergraph": "./dist/bin.cjs", + "hg": "./dist/bin.cjs" }, "files": ["README.md", "dist"], "scripts": { @@ -35,7 +36,7 @@ "copy-db-migrations": "cp -rp ./src/migrations ./dist/migrations", "copy-client-dist": "mkdir -p ./dist/client && cp -rp ./client/dist ./dist/client/dist", "copy-all": "pnpm run copy-package-json && pnpm run copy-db-migrations && pnpm run copy-client-dist", - "typesync": "pnpx tsx ./src/bin.ts studio" + "hypergraph": "pnpx tsx ./src/bin.ts studio" }, "devDependencies": { "@effect/cli": "latest", diff --git a/apps/typesync/scripts/copy-package-json.ts b/apps/typesync/scripts/copy-package-json.ts index 77d7a8ff..bc89f62e 100644 --- a/apps/typesync/scripts/copy-package-json.ts +++ b/apps/typesync/scripts/copy-package-json.ts @@ -13,7 +13,10 @@ const program = Effect.gen(function* () { type: json.type, description: json.description, main: 'bin.cjs', - bin: 'bin.cjs', + bin: { + hypergraph: 'bin.cjs', + hg: 'bin.cjs', + }, engines: json.engines, dependencies: json.dependencies, peerDependencies: json.peerDependencies, diff --git a/apps/typesync/src/Cli.ts b/apps/typesync/src/Cli.ts index 9caabdf8..3b146dee 100644 --- a/apps/typesync/src/Cli.ts +++ b/apps/typesync/src/Cli.ts @@ -2,14 +2,14 @@ import * as Command from '@effect/cli/Command'; import { studio } from './subcommands/studio.js'; -const typesync = Command.make('typesync').pipe( +const hypergraph = Command.make('hypergraph').pipe( Command.withDescription( - 'Typesync command line interface for building and interacting with @graphprotocol/hypergraph schemas', + 'Hypergraph command line interface for building and interacting with @graphprotocol/hypergraph schemas', ), Command.withSubcommands([studio]), ); -export const run = Command.run(typesync, { - name: 'typesync', +export const run = Command.run(hypergraph, { + name: 'hypergraph', version: '0.0.0-alpha', }); From e579ca57e34f780c9325e256bd6b9ef07a002793 Mon Sep 17 00:00:00 2001 From: Marcus Rein Date: Tue, 24 Jun 2025 15:37:13 -0400 Subject: [PATCH 2/3] rename studio command to typesync in CLI and update related scripts --- apps/typesync/package.json | 4 ++-- apps/typesync/src/Cli.ts | 4 ++-- apps/typesync/src/subcommands/studio.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/typesync/package.json b/apps/typesync/package.json index 260cc3d5..c4d4f941 100644 --- a/apps/typesync/package.json +++ b/apps/typesync/package.json @@ -25,7 +25,7 @@ "build": "rm -rf dist && pnpm run build:client && tsup && pnpm run copy-all", "build:ts": "tsup", "dev": "vite build && pnpx tsx ./src/bin.ts", - "dev:cli": "pnpx tsx ./src/bin.ts studio", + "dev:cli": "pnpx tsx ./src/bin.ts typesync", "dev:client": "vite --force", "clean": "rimraf dist/*", "start": "node ./dist/bin.cjs", @@ -36,7 +36,7 @@ "copy-db-migrations": "cp -rp ./src/migrations ./dist/migrations", "copy-client-dist": "mkdir -p ./dist/client && cp -rp ./client/dist ./dist/client/dist", "copy-all": "pnpm run copy-package-json && pnpm run copy-db-migrations && pnpm run copy-client-dist", - "hypergraph": "pnpx tsx ./src/bin.ts studio" + "hypergraph": "pnpx tsx ./src/bin.ts typesync" }, "devDependencies": { "@effect/cli": "latest", diff --git a/apps/typesync/src/Cli.ts b/apps/typesync/src/Cli.ts index 3b146dee..f1c50514 100644 --- a/apps/typesync/src/Cli.ts +++ b/apps/typesync/src/Cli.ts @@ -1,12 +1,12 @@ import * as Command from '@effect/cli/Command'; -import { studio } from './subcommands/studio.js'; +import { typesync } from './subcommands/studio.js'; const hypergraph = Command.make('hypergraph').pipe( Command.withDescription( 'Hypergraph command line interface for building and interacting with @graphprotocol/hypergraph schemas', ), - Command.withSubcommands([studio]), + Command.withSubcommands([typesync]), ); export const run = Command.run(hypergraph, { diff --git a/apps/typesync/src/subcommands/studio.ts b/apps/typesync/src/subcommands/studio.ts index 1464f014..d7190cc3 100644 --- a/apps/typesync/src/subcommands/studio.ts +++ b/apps/typesync/src/subcommands/studio.ts @@ -11,7 +11,7 @@ import open, { type AppName } from 'open'; import * as Server from '../Server.js'; -export const studio = Command.make('studio', { +export const typesync = Command.make('typesync', { args: { port: Options.integer('port').pipe( Options.withAlias('p'), From a921e5b9d2e0f0406def48b42ff9942596b860a0 Mon Sep 17 00:00:00 2001 From: Marcus Rein Date: Tue, 24 Jun 2025 15:39:49 -0400 Subject: [PATCH 3/3] update README to reflect renaming of 'studio' command to 'typesync' --- apps/typesync/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/typesync/README.md b/apps/typesync/README.md index 5fde134f..4a5abab9 100644 --- a/apps/typesync/README.md +++ b/apps/typesync/README.md @@ -21,20 +21,20 @@ pnpm install -g @graphprotocol/hypergraph-cli hypergraph --help hg --help # short alias -# opening Hypergraph studio -hypergraph studio -hg studio +# opening TypeSync +hypergraph typesync +hg typesync -# opening Hypergraph studio in firefox automatically -hypergraph studio --open --browser firefox +# opening TypeSync in firefox automatically +hypergraph typesync --open --browser firefox ``` ## Commands -- `studio` -> runs the Hypergraph API and client UI application for viewing created application schemas, browsing the Knowledge Graph, and creating new application schemas. - - running: `hypergraph studio` +- `typesync` -> runs the Hypergraph API and client UI application for viewing created application schemas, browsing the Knowledge Graph, and creating new application schemas. + - running: `hypergraph typesync` - args: - `port` [OPTIONAL, default = 3000] port to run the application on - - example: `hypergraph studio --port 3001` + - example: `hypergraph typesync --port 3001` - `browser` [OPTION, default 'browser'] browser to open the app in, if the `--open` flag is passed - - example: `hypergraph studio --open --browser firefox` \ No newline at end of file + - example: `hypergraph typesync --open --browser firefox` \ No newline at end of file