Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
eb33cf2
fix(typesync | publish): tsup and package.json updates for publishing
cmwhited Jun 14, 2025
3d0940d
fix(typesync | publish): bump version in cli
cmwhited Jun 14, 2025
93f0ad8
fix(typesync): package client UI in dist and store data in .typesync.db
marcusrein Jun 23, 2025
e3ea4cc
fix(typesync): resolve merge conflicts and update lockfile
marcusrein Jun 24, 2025
0915726
Merge branch 'main' into chris.whited/fix-published-pkg
marcusrein Jun 24, 2025
4cd6942
fix(Dockerfile): reorder build steps for clarity and maintainability
marcusrein Jun 24, 2025
9899815
fix(tsup.config): add external dependency for Prisma client
marcusrein Jun 24, 2025
efcd12e
fix(package.json): update @graphprotocol/grc-20 dependency to ^0.21.3
marcusrein Jun 24, 2025
07a8359
fix(prisma): update PrismaClient import path and remove external depe…
marcusrein Jun 24, 2025
53c7803
fix(prisma): update provider to prisma-client-js in schema.prisma
marcusrein Jun 24, 2025
6b01afd
fix(typesync | publish): rebase. approve-builds
cmwhited Jun 27, 2025
4b14c79
Merge branch 'main' of github.com:graphprotocol/hypergraph into chris…
cmwhited Jun 27, 2025
6d592db
fix(typesync | publish): bump deps. fix tanstack router plugin codegen.
cmwhited Jun 27, 2025
2c37ad2
fix(typesync | publish): more build improvements
cmwhited Jun 27, 2025
94c5430
fix(typesync | publish): get client dist to run in published package
cmwhited Jun 27, 2025
9fa854a
fix(typesync | publish): update root space id const. remove migration…
cmwhited Jun 27, 2025
63569cc
fix(typesync | publish): publish latest
cmwhited Jun 27, 2025
93c5d17
revert non-typesync changes
nikgraf Jun 29, 2025
1888f32
restore lock file
nikgraf Jun 29, 2025
023cc6f
restore working pnpm lock file
nikgraf Jun 29, 2025
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,7 @@ typings/
*.tsbuildinfo
next-env.d.ts

.DS_Store
.DS_Store

# tanstack router output
.tanstack
2 changes: 1 addition & 1 deletion apps/typesync/client/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const API_ROOT_URL = 'http://localhost:3000/api/v1';
export const ROOT_SPACE_ID = '8ef40bdd-cf69-4ad7-a9a1-f71c15653994';
export const ROOT_SPACE_ID = '64ed9ffa-e7b3-40f6-ae99-fbf6112d10f8';
161 changes: 61 additions & 100 deletions apps/typesync/client/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,127 +8,88 @@
// You should NOT make any changes in this file as it will be overwritten.
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.

// Import Routes
import { Route as rootRouteImport } from './routes/__root';
import { Route as IndexRouteImport } from './routes/index';
import { Route as AppsCreateRouteImport } from './routes/apps/create';
import { Route as AppsAppIdDetailsRouteImport } from './routes/apps/$appId/details';

import { Route as rootRoute } from './routes/__root'
import { Route as IndexImport } from './routes/index'
import { Route as AppsCreateImport } from './routes/apps/create'
import { Route as AppsAppIdDetailsImport } from './routes/apps/$appId/details'

// Create/Update Routes

const IndexRoute = IndexImport.update({
const IndexRoute = IndexRouteImport.update({
id: '/',
path: '/',
getParentRoute: () => rootRoute,
} as any)

const AppsCreateRoute = AppsCreateImport.update({
getParentRoute: () => rootRouteImport,
} as any);
const AppsCreateRoute = AppsCreateRouteImport.update({
id: '/apps/create',
path: '/apps/create',
getParentRoute: () => rootRoute,
} as any)

const AppsAppIdDetailsRoute = AppsAppIdDetailsImport.update({
getParentRoute: () => rootRouteImport,
} as any);
const AppsAppIdDetailsRoute = AppsAppIdDetailsRouteImport.update({
id: '/apps/$appId/details',
path: '/apps/$appId/details',
getParentRoute: () => rootRoute,
} as any)

// Populate the FileRoutesByPath interface

declare module '@tanstack/react-router' {
interface FileRoutesByPath {
'/': {
id: '/'
path: '/'
fullPath: '/'
preLoaderRoute: typeof IndexImport
parentRoute: typeof rootRoute
}
'/apps/create': {
id: '/apps/create'
path: '/apps/create'
fullPath: '/apps/create'
preLoaderRoute: typeof AppsCreateImport
parentRoute: typeof rootRoute
}
'/apps/$appId/details': {
id: '/apps/$appId/details'
path: '/apps/$appId/details'
fullPath: '/apps/$appId/details'
preLoaderRoute: typeof AppsAppIdDetailsImport
parentRoute: typeof rootRoute
}
}
}

// Create and export the route tree
getParentRoute: () => rootRouteImport,
} as any);

export interface FileRoutesByFullPath {
'/': typeof IndexRoute
'/apps/create': typeof AppsCreateRoute
'/apps/$appId/details': typeof AppsAppIdDetailsRoute
'/': typeof IndexRoute;
'/apps/create': typeof AppsCreateRoute;
'/apps/$appId/details': typeof AppsAppIdDetailsRoute;
}

export interface FileRoutesByTo {
'/': typeof IndexRoute
'/apps/create': typeof AppsCreateRoute
'/apps/$appId/details': typeof AppsAppIdDetailsRoute
'/': typeof IndexRoute;
'/apps/create': typeof AppsCreateRoute;
'/apps/$appId/details': typeof AppsAppIdDetailsRoute;
}

export interface FileRoutesById {
__root__: typeof rootRoute
'/': typeof IndexRoute
'/apps/create': typeof AppsCreateRoute
'/apps/$appId/details': typeof AppsAppIdDetailsRoute
__root__: typeof rootRouteImport;
'/': typeof IndexRoute;
'/apps/create': typeof AppsCreateRoute;
'/apps/$appId/details': typeof AppsAppIdDetailsRoute;
}

export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths: '/' | '/apps/create' | '/apps/$appId/details'
fileRoutesByTo: FileRoutesByTo
to: '/' | '/apps/create' | '/apps/$appId/details'
id: '__root__' | '/' | '/apps/create' | '/apps/$appId/details'
fileRoutesById: FileRoutesById
fileRoutesByFullPath: FileRoutesByFullPath;
fullPaths: '/' | '/apps/create' | '/apps/$appId/details';
fileRoutesByTo: FileRoutesByTo;
to: '/' | '/apps/create' | '/apps/$appId/details';
id: '__root__' | '/' | '/apps/create' | '/apps/$appId/details';
fileRoutesById: FileRoutesById;
}

export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
AppsCreateRoute: typeof AppsCreateRoute
AppsAppIdDetailsRoute: typeof AppsAppIdDetailsRoute
IndexRoute: typeof IndexRoute;
AppsCreateRoute: typeof AppsCreateRoute;
AppsAppIdDetailsRoute: typeof AppsAppIdDetailsRoute;
}

declare module '@tanstack/react-router' {
interface FileRoutesByPath {
'/': {
id: '/';
path: '/';
fullPath: '/';
preLoaderRoute: typeof IndexRouteImport;
parentRoute: typeof rootRouteImport;
};
'/apps/create': {
id: '/apps/create';
path: '/apps/create';
fullPath: '/apps/create';
preLoaderRoute: typeof AppsCreateRouteImport;
parentRoute: typeof rootRouteImport;
};
'/apps/$appId/details': {
id: '/apps/$appId/details';
path: '/apps/$appId/details';
fullPath: '/apps/$appId/details';
preLoaderRoute: typeof AppsAppIdDetailsRouteImport;
parentRoute: typeof rootRouteImport;
};
}
}

const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
AppsCreateRoute: AppsCreateRoute,
AppsAppIdDetailsRoute: AppsAppIdDetailsRoute,
}

export const routeTree = rootRoute
};
export const routeTree = rootRouteImport
._addFileChildren(rootRouteChildren)
._addFileTypes<FileRouteTypes>()

/* ROUTE_MANIFEST_START
{
"routes": {
"__root__": {
"filePath": "__root.tsx",
"children": [
"/",
"/apps/create",
"/apps/$appId/details"
]
},
"/": {
"filePath": "index.tsx"
},
"/apps/create": {
"filePath": "apps/create.tsx"
},
"/apps/$appId/details": {
"filePath": "apps/$appId/details.tsx"
}
}
}
ROUTE_MANIFEST_END */
._addFileTypes<FileRouteTypes>();
74 changes: 37 additions & 37 deletions apps/typesync/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@graphprotocol/typesync-cli",
"version": "0.0.0-alpha",
"name": "@graphprotocol/hypergraph-cli",
"version": "0.0.0-alpha.19",
"type": "module",
"license": "MIT",
"description": "CLI toolchain to view existing types, select, pick, extend to create schemas and generate a @graphprotocol/hypergraph schema.",
"repository": {
"type": "git",
"url": "https://github.com/graphprotocol/hypergraph.git",
"url": "git+https://github.com/graphprotocol/hypergraph.git",
"directory": "apps/typesync"
},
"publishConfig": {
Expand All @@ -15,50 +15,50 @@
"linkDirectory": false
},
"bin": {
"hypergraph": "./dist/bin.cjs",
"hg": "./dist/bin.cjs"
"hypergraph": "./dist/bin.js",
"hg": "./dist/bin.js"
},
"files": ["README.md", "dist"],
"scripts": {
"codegen:gql": "graphql-codegen --config ./graphql.codegen.ts",
"build:client": "vite build",
"build": "rm -rf dist && pnpm run build:client && tsup && pnpm run copy-all",
"build": "pnpm run clean && pnpm run build:client && tsup && pnpm run copy-all",
"build:ts": "tsup",
"dev": "vite build && pnpx tsx ./src/bin.ts",
"dev": "vite build && pnpx tsx ./src/bin.ts typesync",
"dev:cli": "pnpx tsx ./src/bin.ts typesync",
"dev:client": "vite --force",
"clean": "rimraf dist/*",
"start": "node ./dist/bin.cjs",
"clean": "rm -rf dist client/dist",
"start": "node ./dist/bin.js",
"check": "tsc --noEmit",
"test": "vitest run",
"coverage": "vitest run --coverage",
"copy-package-json": "tsx scripts/copy-package-json.ts",
"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",
"copy-client-dist": "tsx scripts/copy-client-dist.ts",
"copy-all": "pnpm run copy-package-json && pnpm run copy-client-dist",
"hypergraph": "pnpx tsx ./src/bin.ts typesync"
},
"devDependencies": {
"@effect/cli": "latest",
"@effect/cli": "^0.66.1",
"@effect/experimental": "^0.51.1",
"@effect/language-service": "latest",
"@effect/platform": "latest",
"@effect/platform-node": "latest",
"@effect/sql": "latest",
"@effect/sql-sqlite-node": "latest",
"@effect/vitest": "latest",
"@graphprotocol/grc-20": "^0.21.2",
"@graphql-codegen/cli": "^5.0.6",
"@graphql-codegen/client-preset": "^4.8.1",
"@effect/language-service": "^0.23.3",
"@effect/platform": "^0.87.1",
"@effect/platform-node": "^0.88.3",
"@effect/sql": "^0.40.1",
"@effect/sql-sqlite-node": "^0.41.1",
"@effect/vitest": "^0.23.10",
"@graphprotocol/grc-20": "^0.21.3",
"@graphql-codegen/cli": "^5.0.7",
"@graphql-codegen/client-preset": "^4.8.3",
"@graphql-codegen/typescript": "^4.1.6",
"@graphql-codegen/typescript-operations": "^4.6.1",
"@tanstack/router-plugin": "^1.120.13",
"@types/node": "^22.15.29",
"@types/react": "^19.1.6",
"@types/react-dom": "^19.1.5",
"@vitejs/plugin-react": "^4.5.0",
"@tanstack/router-plugin": "^1.121.41",
"@types/node": "^24.0.5",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@vitejs/plugin-react": "^4.6.0",
"glob": "^11.0.3",
"tsup": "^8.5.0",
"tsx": "^4.19.4",
"tsx": "^4.20.3",
"vite": "^6.3.5"
},
"dependencies": {
Expand All @@ -67,13 +67,13 @@
"@heroicons/react": "^2.2.0",
"@phosphor-icons/react": "^2.1.10",
"@radix-ui/react-tabs": "^1.1.12",
"@tailwindcss/vite": "^4.1.8",
"@tanstack/react-form": "^1.12.1",
"@tanstack/react-query": "^5.79.2",
"@tanstack/react-query-devtools": "^5.79.2",
"@tanstack/react-router": "^1.120.15",
"@tanstack/react-router-devtools": "1.120.15",
"better-sqlite3": "^11.10.0",
"@tailwindcss/vite": "^4.1.11",
"@tanstack/react-form": "^1.12.4",
"@tanstack/react-query": "^5.81.4",
"@tanstack/react-query-devtools": "^5.81.4",
"@tanstack/react-router": "^1.121.41",
"@tanstack/react-router-devtools": "1.121.41",
"better-sqlite3": "^12.1.1",
"date-fns": "^4.1.0",
"effect": "^3.16.10",
"graphql": "^16.11.0",
Expand All @@ -82,7 +82,7 @@
"open": "^10.1.2",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"shiki": "^3.4.2",
"tailwindcss": "^4.1.8"
"shiki": "^3.7.0",
"tailwindcss": "^4.1.11"
}
}
19 changes: 19 additions & 0 deletions apps/typesync/scripts/copy-client-dist.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { FileSystem, Path } from '@effect/platform';
import { NodeContext } from '@effect/platform-node';
import { Effect } from 'effect';

const program = Effect.gen(function* () {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;

const src = path.resolve('./', 'client', 'dist');
const dest = path.resolve('./', 'dist', 'client', 'dist');

yield* fs
.makeDirectory(dest, { recursive: true })
.pipe(Effect.andThen(() => fs.copy(src, dest, { overwrite: true })));

return yield* Effect.logInfo('[Build] Copied client/dist to dist/client/dist');
}).pipe(Effect.provide(NodeContext.layer));

Effect.runPromise(program).catch(console.error);
24 changes: 5 additions & 19 deletions apps/typesync/src/Database.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
import { fileURLToPath } from 'node:url';
import * as NodeContext from '@effect/platform-node/NodeContext';
import * as SqliteClient from '@effect/sql-sqlite-node/SqliteClient';
import * as Migrator from '@effect/sql-sqlite-node/SqliteMigrator';
import * as SqlClient from '@effect/sql/SqlClient';
import * as SqlError from '@effect/sql/SqlError';
import * as SqlResolver from '@effect/sql/SqlResolver';
import * as SqlSchema from '@effect/sql/SqlSchema';
import * as EffectArray from 'effect/Array';
import * as Chunk from 'effect/Chunk';
import * as Console from 'effect/Console';
import * as Effect from 'effect/Effect';
import * as Layer from 'effect/Layer';
import * as Option from 'effect/Option';
import * as Order from 'effect/Order';
import * as Schema from 'effect/Schema';
import * as Stream from 'effect/Stream';
import { NodeContext } from '@effect/platform-node';
import { SqlClient, SqlError, SqlResolver, SqlSchema } from '@effect/sql';
import { SqliteMigrator as Migrator, SqliteClient } from '@effect/sql-sqlite-node';
import { Chunk, Console, Effect, Array as EffectArray, Layer, Option, Order, Schema, Stream } from 'effect';

import * as TypesyncDomain from '../domain/Domain.js';
import * as Domain from './Domain.js';

const SqlLive = SqliteClient.layer({
filename: 'typesync.db',
filename: '.typesync.db',
});
const MigratorLive = Migrator.layer({
loader: Migrator.fromFileSystem(fileURLToPath(new URL('migrations', import.meta.url))),
// Where to put the `_schema.sql` file
schemaDirectory: 'src/migrations',
}).pipe(Layer.provide(SqlLive));

const DatabaseLive = Layer.mergeAll(SqlLive, MigratorLive).pipe(Layer.provide(NodeContext.layer));
Expand Down
Loading
Loading