Skip to content

Commit

Permalink
fix: issue with client typing generation in trpc plugin (#673)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymc9 authored Sep 5, 2023
1 parent dc106a9 commit 576c4f7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/plugins/openapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"build": "pnpm lint && pnpm clean && tsc && copyfiles ./package.json ./README.md ./LICENSE dist && copyfiles -u 1 ./src/plugin.zmodel dist && pnpm pack dist --pack-destination '../../../../.build'",
"watch": "tsc --watch",
"lint": "eslint src --ext ts",
"test": "jest",
"test": "ZENSTACK_TEST=1 jest",
"prepublishOnly": "pnpm build"
},
"keywords": [],
"keywords": ["openapi"],
"author": "ZenStack Team",
"license": "MIT",
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/plugins/trpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
"build": "pnpm lint && pnpm clean && tsc && copyfiles ./package.json ./README.md ./LICENSE 'res/**/*' dist && pnpm pack dist --pack-destination '../../../../.build'",
"watch": "tsc --watch",
"lint": "eslint src --ext ts",
"test": "ZENSTACK_TEST=1 jest",
"prepublishOnly": "pnpm build",
"publish-dev": "pnpm publish --tag dev"
},
"publishConfig": {
"directory": "dist",
"linkDirectory": true
},
"keywords": [],
"keywords": ["trpc"],
"author": "ZenStack Team",
"license": "MIT",
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/trpc/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ function getPrismaOperationTypes(model: string, operation: string) {

case 'count':
argsType = `Prisma.Subset<T, ${genericBase}>`;
resultType = `'select' extends keyof T'
resultType = `'select' extends keyof T
? T['select'] extends true
? number
: GetScalarType<T['select'], ${capModel}CountAggregateOutputType>
: Prisma.GetScalarType<T['select'], Prisma.${capModel}CountAggregateOutputType>
: number`;
break;

Expand Down
2 changes: 1 addition & 1 deletion packages/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"bundle": "pnpm clean && pnpm lint && node build/bundle.js --minify",
"watch": "tsc --watch",
"lint": "eslint src tests --ext ts",
"test": "jest",
"test": "ZENSTACK_TEST=1 jest",
"prepublishOnly": "pnpm build",
"publish-dev": "pnpm publish --registry http://localhost:4873",
"postinstall": "node bin/post-install.js"
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"linkDirectory": true
},
"keywords": [
"fastify"
"fastify", "express", "nextjs", "sveltekit", "nuxtjs"
],
"author": "",
"license": "MIT",
Expand Down

0 comments on commit 576c4f7

Please sign in to comment.