Skip to content

Commit eb33cf2

Browse files
committed
fix(typesync | publish): tsup and package.json updates for publishing
1 parent ec0fb5c commit eb33cf2

4 files changed

Lines changed: 1156 additions & 823 deletions

File tree

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,7 @@ typings/
6868
*.tsbuildinfo
6969
next-env.d.ts
7070

71-
.DS_Store
71+
.DS_Store
72+
73+
# tanstack router output
74+
.tanstack

apps/typesync/package.json

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "@graphprotocol/typesync-cli",
3-
"version": "0.0.0-alpha",
3+
"version": "0.0.0-alpha.6",
44
"type": "module",
55
"license": "MIT",
66
"description": "CLI toolchain to view existing types, select, pick, extend to create schemas and generate a @graphprotocol/hypergraph schema.",
77
"repository": {
88
"type": "git",
9-
"url": "https://github.com/graphprotocol/hypergraph.git",
9+
"url": "git+https://github.com/graphprotocol/hypergraph.git",
1010
"directory": "apps/typesync"
1111
},
1212
"publishConfig": {
@@ -15,24 +15,24 @@
1515
"linkDirectory": false
1616
},
1717
"bin": {
18-
"typesync": "./dist/bin.cjs"
18+
"typesync": "dist/bin.js"
1919
},
2020
"files": ["README.md", "dist"],
2121
"scripts": {
2222
"codegen:gql": "graphql-codegen --config ./graphql.codegen.ts",
2323
"build:client": "vite build",
24-
"build": "rm -rf dist && pnpm run build:client && tsup && pnpm run copy-all",
24+
"build": "rm -rf ./client/dist && pnpm run build:client && tsup && pnpm run copy-all",
2525
"build:ts": "tsup",
2626
"dev": "vite build && pnpx tsx ./src/bin.ts",
2727
"dev:cli": "pnpx tsx ./src/bin.ts studio",
2828
"dev:client": "vite --force",
2929
"clean": "rimraf dist/*",
30-
"start": "node ./dist/bin.cjs",
30+
"start": "node ./dist/bin.js",
3131
"check": "tsc --noEmit",
3232
"test": "vitest run",
3333
"coverage": "vitest run --coverage",
3434
"copy-package-json": "tsx scripts/copy-package-json.ts",
35-
"copy-db-migrations": "cp -rp ./src/migrations ./dist/migrations",
35+
"copy-db-migrations": "cp ./src/migrations/_schema.sql ./dist/migrations/_schema.sql",
3636
"copy-client-dist": "mkdir -p ./dist/client && cp -rp ./client/dist ./dist/client/dist",
3737
"copy-all": "pnpm run copy-package-json && pnpm run copy-db-migrations && pnpm run copy-client-dist",
3838
"typesync": "pnpx tsx ./src/bin.ts studio"
@@ -46,18 +46,19 @@
4646
"@effect/sql": "latest",
4747
"@effect/sql-sqlite-node": "latest",
4848
"@effect/vitest": "latest",
49-
"@graphprotocol/grc-20": "^0.17.0",
50-
"@graphql-codegen/cli": "^5.0.6",
51-
"@graphql-codegen/client-preset": "^4.8.1",
49+
"@graphprotocol/grc-20": "^0.18.0",
50+
"@graphql-codegen/cli": "^5.0.7",
51+
"@graphql-codegen/client-preset": "^4.8.2",
5252
"@graphql-codegen/typescript": "^4.1.6",
5353
"@graphql-codegen/typescript-operations": "^4.6.1",
54-
"@tanstack/router-plugin": "^1.120.13",
55-
"@types/node": "^22.15.29",
56-
"@types/react": "^19.1.6",
57-
"@types/react-dom": "^19.1.5",
58-
"@vitejs/plugin-react": "^4.5.0",
54+
"@tanstack/router-plugin": "^1.121.10",
55+
"@types/node": "^24.0.1",
56+
"@types/react": "^19.1.8",
57+
"@types/react-dom": "^19.1.6",
58+
"@vitejs/plugin-react": "^4.5.2",
59+
"glob": "^11.0.3",
5960
"tsup": "^8.5.0",
60-
"tsx": "^4.19.4",
61+
"tsx": "^4.20.3",
6162
"vite": "^6.3.5"
6263
},
6364
"dependencies": {
@@ -66,12 +67,12 @@
6667
"@heroicons/react": "^2.2.0",
6768
"@phosphor-icons/react": "^2.1.10",
6869
"@radix-ui/react-tabs": "^1.1.12",
69-
"@tailwindcss/vite": "^4.1.8",
70-
"@tanstack/react-form": "^1.12.1",
71-
"@tanstack/react-query": "^5.79.2",
72-
"@tanstack/react-query-devtools": "^5.79.2",
73-
"@tanstack/react-router": "^1.120.15",
74-
"@tanstack/react-router-devtools": "1.120.15",
70+
"@tailwindcss/vite": "^4.1.10",
71+
"@tanstack/react-form": "^1.12.3",
72+
"@tanstack/react-query": "^5.80.7",
73+
"@tanstack/react-query-devtools": "^5.80.7",
74+
"@tanstack/react-router": "^1.121.2",
75+
"@tanstack/react-router-devtools": "1.121.8",
7576
"better-sqlite3": "^11.10.0",
7677
"date-fns": "^4.1.0",
7778
"effect": "latest",
@@ -81,7 +82,7 @@
8182
"open": "^10.1.2",
8283
"react": "^19.1.0",
8384
"react-dom": "^19.1.0",
84-
"shiki": "^3.4.2",
85-
"tailwindcss": "^4.1.8"
85+
"shiki": "^3.6.0",
86+
"tailwindcss": "^4.1.10"
8687
}
8788
}

apps/typesync/tsup.config.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
1+
import { globSync } from 'glob';
12
import { defineConfig } from 'tsup';
23

34
export default defineConfig({
4-
entry: ['src/bin.ts'],
5+
entry: {
6+
bin: './src/bin.ts',
7+
...Object.fromEntries(
8+
globSync('./src/migrations/*.ts').map((file) => [
9+
`migrations/${file.split('/').pop()?.replace('.ts', '')}`,
10+
file,
11+
]),
12+
),
13+
},
514
clean: true,
615
publicDir: true,
716
treeshake: 'smallest',
817
external: ['@parcel/watcher'],
18+
target: 'node22',
19+
platform: 'node',
20+
format: 'esm',
21+
splitting: false,
22+
outDir: 'dist',
23+
// this fixes an issue with dynamic require in the esm output
24+
banner() {
25+
return {
26+
js: `import { createRequire } from 'module'; const require = createRequire(import.meta.url);`,
27+
};
28+
},
929
});

0 commit comments

Comments
 (0)