Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
30 changes: 16 additions & 14 deletions apps/typesync/README.md
Original file line number Diff line number Diff line change
@@ -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`
- example: `hypergraph studio --open --browser firefox`
5 changes: 3 additions & 2 deletions apps/typesync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"linkDirectory": false
},
"bin": {
"typesync": "./dist/bin.cjs"
"hypergraph": "./dist/bin.cjs",
"hg": "./dist/bin.cjs"
},
"files": ["README.md", "dist"],
"scripts": {
Expand All @@ -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",
Expand Down
5 changes: 4 additions & 1 deletion apps/typesync/scripts/copy-package-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions apps/typesync/src/Cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
Loading