-
Notifications
You must be signed in to change notification settings - Fork 8
fix(typesync | publish): tsup and package.json updates for publishing #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
eb33cf2
3d0940d
93f0ad8
e3ea4cc
0915726
4cd6942
9899815
efcd12e
07a8359
53c7803
6b01afd
4b14c79
6d592db
2c37ad2
94c5430
9fa854a
63569cc
93c5d17
1888f32
023cc6f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,4 +68,7 @@ typings/ | |
| *.tsbuildinfo | ||
| next-env.d.ts | ||
|
|
||
| .DS_Store | ||
| .DS_Store | ||
|
|
||
| # tanstack router output | ||
| .tanstack | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,4 +5,5 @@ export default defineConfig(() => ({ | |
| format: ['esm'], | ||
| clean: true, | ||
| sourcemap: true, | ||
| external: ['../prisma/generated/client'], | ||
|
||
| })); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| { | ||
| "name": "@graphprotocol/typesync-cli", | ||
| "version": "0.0.0-alpha", | ||
| "version": "0.0.0-alpha.6", | ||
| "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": { | ||
|
|
@@ -15,25 +15,25 @@ | |
| "linkDirectory": false | ||
| }, | ||
| "bin": { | ||
| "typesync": "./dist/bin.cjs" | ||
| "typesync": "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": "rm -rf ./client/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:client": "vite --force", | ||
| "clean": "rimraf dist/*", | ||
| "start": "node ./dist/bin.cjs", | ||
| "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-db-migrations": "cp ./src/migrations/_schema.sql ./dist/migrations/_schema.sql", | ||
| "copy-client-dist": "tsx scripts/copy-client-dist.ts", | ||
| "copy-all": "pnpm run copy-package-json && pnpm run copy-db-migrations && pnpm run copy-client-dist", | ||
| "typesync": "pnpx tsx ./src/bin.ts studio" | ||
| }, | ||
|
|
@@ -46,18 +46,19 @@ | |
| "@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", | ||
| "@graphprotocol/grc-20": "^0.18.0", | ||
|
||
| "@graphql-codegen/cli": "^5.0.7", | ||
| "@graphql-codegen/client-preset": "^4.8.2", | ||
| "@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.10", | ||
| "@types/node": "^24.0.1", | ||
| "@types/react": "^19.1.8", | ||
| "@types/react-dom": "^19.1.6", | ||
| "@vitejs/plugin-react": "^4.5.2", | ||
| "glob": "^11.0.3", | ||
| "tsup": "^8.5.0", | ||
| "tsx": "^4.19.4", | ||
| "tsx": "^4.20.3", | ||
| "vite": "^6.3.5" | ||
| }, | ||
| "dependencies": { | ||
|
|
@@ -66,12 +67,12 @@ | |
| "@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", | ||
| "@tailwindcss/vite": "^4.1.10", | ||
| "@tanstack/react-form": "^1.12.3", | ||
| "@tanstack/react-query": "^5.80.7", | ||
| "@tanstack/react-query-devtools": "^5.80.7", | ||
| "@tanstack/react-router": "^1.121.2", | ||
| "@tanstack/react-router-devtools": "1.121.8", | ||
| "better-sqlite3": "^11.10.0", | ||
| "date-fns": "^4.1.0", | ||
| "effect": "latest", | ||
|
|
@@ -81,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.6.0", | ||
| "tailwindcss": "^4.1.10" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { cp, mkdir } from 'node:fs/promises'; | ||
| import { resolve } from 'node:path'; | ||
|
|
||
| (async () => { | ||
| try { | ||
| const src = resolve(process.cwd(), 'client', 'dist'); | ||
| const dest = resolve(process.cwd(), 'dist', 'client', 'dist'); | ||
|
|
||
| await mkdir(dest, { recursive: true }); | ||
| // Node >=16.7 has cp with recursive | ||
| await cp(src, dest, { recursive: true }); | ||
|
|
||
| console.info('[Build] Copied client/dist to dist/client/dist'); | ||
| } catch (err) { | ||
| console.error('[Build] Failed to copy client/dist', err); | ||
| process.exitCode = 1; | ||
| } | ||
| })(); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,29 @@ | ||
| import { globSync } from 'glob'; | ||
| import { defineConfig } from 'tsup'; | ||
|
|
||
| export default defineConfig({ | ||
| entry: ['src/bin.ts'], | ||
| entry: { | ||
| bin: './src/bin.ts', | ||
| ...Object.fromEntries( | ||
| globSync('./src/migrations/*.ts').map((file) => [ | ||
| `migrations/${file.split('/').pop()?.replace('.ts', '')}`, | ||
| file, | ||
| ]), | ||
| ), | ||
| }, | ||
| clean: true, | ||
| publicDir: true, | ||
| treeshake: 'smallest', | ||
| external: ['@parcel/watcher'], | ||
| target: 'node22', | ||
| platform: 'node', | ||
| format: 'esm', | ||
| splitting: false, | ||
| outDir: 'dist', | ||
| // this fixes an issue with dynamic require in the esm output | ||
| banner() { | ||
| return { | ||
| js: `import { createRequire } from 'module'; const require = createRequire(import.meta.url);`, | ||
| }; | ||
| }, | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these changes necessary? according to https://geo-browser.slack.com/archives/C069PB8PCPN/p1750368390845489?thread_ts=1746676932.512389&cid=C069PB8PCPN the server is working fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cmwhited can you revert this change? The dockerfile works and only want to make changes where necessary