Skip to content

Commit f7f85ea

Browse files
authored
merge dev to main (v2.10.1) (#1913)
2 parents 7cc5f00 + 6d53c18 commit f7f85ea

File tree

22 files changed

+37
-29
lines changed

22 files changed

+37
-29
lines changed

.github/workflows/build-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
gradle-home-cache-cleanup: true
8787

8888
- name: Build
89-
run: DEFAULT_NPM_TAG=latest pnpm run build
89+
run: DEFAULT_NPM_TAG=latest pnpm run build-ci
9090

9191
- name: Lint
9292
run: pnpm lint

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"name": "zenstack-monorepo",
3-
"version": "2.10.0",
3+
"version": "2.10.1",
44
"description": "",
55
"scripts": {
6-
"build": "pnpm -r build",
6+
"build": "pnpm -r --filter=\"!./packages/ide/*\" build",
7+
"build-ci": "pnpm -r build",
78
"lint": "pnpm -r lint",
89
"test": "pnpm -r --parallel run test --silent --forceExit",
910
"test-ci": "pnpm -r --parallel run --filter=\"./packages/**\" test --silent --forceExit",

packages/ide/jetbrains/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
}
1010

1111
group = "dev.zenstack"
12-
version = "2.10.0"
12+
version = "2.10.1"
1313

1414
repositories {
1515
mavenCentral()

packages/ide/jetbrains/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jetbrains",
3-
"version": "2.10.0",
3+
"version": "2.10.1",
44
"displayName": "ZenStack JetBrains IDE Plugin",
55
"description": "ZenStack JetBrains IDE plugin",
66
"homepage": "https://zenstack.dev",

packages/language/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenstackhq/language",
3-
"version": "2.10.0",
3+
"version": "2.10.1",
44
"displayName": "ZenStack modeling language compiler",
55
"description": "ZenStack modeling language compiler",
66
"homepage": "https://zenstack.dev",

packages/misc/redwood/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/redwood",
33
"displayName": "ZenStack RedwoodJS Integration",
4-
"version": "2.10.0",
4+
"version": "2.10.1",
55
"description": "CLI and runtime for integrating ZenStack with RedwoodJS projects.",
66
"repository": {
77
"type": "git",

packages/plugins/openapi/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/openapi",
33
"displayName": "ZenStack Plugin and Runtime for OpenAPI",
4-
"version": "2.10.0",
4+
"version": "2.10.1",
55
"description": "ZenStack plugin and runtime supporting OpenAPI",
66
"main": "index.js",
77
"repository": {
@@ -36,7 +36,7 @@
3636
"ts-pattern": "^4.3.0",
3737
"upper-case-first": "^2.0.2",
3838
"yaml": "^2.2.2",
39-
"zod": "^3.22.4",
39+
"zod": "^3.22.4",
4040
"zod-validation-error": "^1.5.0"
4141
},
4242
"devDependencies": {

packages/plugins/swr/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/swr",
33
"displayName": "ZenStack plugin for generating SWR hooks",
4-
"version": "2.10.0",
4+
"version": "2.10.1",
55
"description": "ZenStack plugin for generating SWR hooks",
66
"main": "index.js",
77
"repository": {

packages/plugins/tanstack-query/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/tanstack-query",
33
"displayName": "ZenStack plugin for generating tanstack-query hooks",
4-
"version": "2.10.0",
4+
"version": "2.10.1",
55
"description": "ZenStack plugin for generating tanstack-query hooks",
66
"main": "index.js",
77
"exports": {

packages/plugins/trpc/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/trpc",
33
"displayName": "ZenStack plugin for tRPC",
4-
"version": "2.10.0",
4+
"version": "2.10.1",
55
"description": "ZenStack plugin for tRPC",
66
"main": "index.js",
77
"repository": {
@@ -31,8 +31,10 @@
3131
"lower-case-first": "^2.0.2",
3232
"ts-morph": "^16.0.0",
3333
"tslib": "^2.4.1",
34-
"upper-case-first": "^2.0.2",
35-
"zod": "^3.22.4"
34+
"upper-case-first": "^2.0.2"
35+
},
36+
"peerDependencies": {
37+
"zod": "^3.22.4"
3638
},
3739
"devDependencies": {
3840
"@trpc/next": "^10.32.0",

packages/plugins/trpc/tests/projects/nuxt-trpc-v10/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"trpc-nuxt": "^0.10.22",
1818
"vue": "latest",
1919
"vue-router": "latest",
20-
"zod": "^3.23.8"
20+
"zod": "^3.22.4"
2121
},
2222
"devDependencies": {
2323
"esbuild": "^0.24.0",

packages/plugins/trpc/tests/projects/nuxt-trpc-v11/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"trpc-nuxt": "^0.11.0-beta.1",
1818
"vue": "latest",
1919
"vue-router": "latest",
20-
"zod": "^3.23.8"
20+
"zod": "^3.22.4"
2121
},
2222
"devDependencies": {
2323
"esbuild": "^0.24.0",

packages/plugins/trpc/tests/projects/t3-trpc-v10/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"react": "18.2.0",
2525
"react-dom": "18.2.0",
2626
"superjson": "^2.2.1",
27-
"zod": "^3.22.4"
27+
"zod": "^3.22.4"
2828
},
2929
"devDependencies": {
3030
"@types/eslint": "^8.44.7",

packages/plugins/trpc/tests/projects/t3-trpc-v11/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"react-dom": "^18.3.1",
2929
"server-only": "^0.0.1",
3030
"superjson": "^2.2.1",
31-
"zod": "^3.23.3"
31+
"zod": "^3.22.4"
3232
},
3333
"devDependencies": {
3434
"@types/eslint": "^8.56.10",

packages/runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/runtime",
33
"displayName": "ZenStack Runtime Library",
4-
"version": "2.10.0",
4+
"version": "2.10.1",
55
"description": "Runtime of ZenStack for both client-side and server-side environments.",
66
"repository": {
77
"type": "git",

packages/runtime/src/zod-utils.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ import { z as Z } from 'zod';
99
* accidentally matching a less-ideal schema candidate.
1010
*
1111
* The helper uses a custom schema to find the candidate that results in the fewest unrecognized keys when parsing the data.
12+
*
13+
* The function uses `any` for parameter and return type to be compatible with various zod versions.
1214
*/
13-
export function smartUnion(z: typeof Z, candidates: Z.ZodSchema[]) {
15+
export function smartUnion(z: any, candidates: any[]): any {
1416
// strip `z.lazy`
15-
const processedCandidates = candidates.map((candidate) => unwrapLazy(z, candidate));
17+
const processedCandidates: Z.ZodSchema[] = candidates.map((candidate) => unwrapLazy(z, candidate));
1618

1719
if (processedCandidates.some((c) => !(c instanceof z.ZodObject || c instanceof z.ZodArray))) {
1820
// fall back to plain union if not all candidates are objects or arrays
@@ -22,11 +24,13 @@ export function smartUnion(z: typeof Z, candidates: Z.ZodSchema[]) {
2224
let resultData: any;
2325

2426
return z
25-
.custom((data) => {
27+
.custom((data: any) => {
2628
if (Array.isArray(data)) {
2729
const { data: result, success } = smartArrayUnion(
2830
z,
29-
processedCandidates.filter((c) => c instanceof z.ZodArray),
31+
processedCandidates.filter((c) => c instanceof z.ZodArray) as Array<
32+
Z.ZodArray<Z.ZodObject<Z.ZodRawShape>>
33+
>,
3034
data
3135
);
3236
if (success) {
@@ -36,7 +40,7 @@ export function smartUnion(z: typeof Z, candidates: Z.ZodSchema[]) {
3640
} else {
3741
const { data: result, success } = smartObjectUnion(
3842
z,
39-
processedCandidates.filter((c) => c instanceof z.ZodObject),
43+
processedCandidates.filter((c) => c instanceof z.ZodObject) as Z.ZodObject<Z.ZodRawShape>[],
4044
data
4145
);
4246
if (success) {

packages/schema/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publisher": "zenstack",
44
"displayName": "ZenStack Language Tools",
55
"description": "FullStack enhancement for Prisma ORM: seamless integration from database to UI",
6-
"version": "2.10.0",
6+
"version": "2.10.1",
77
"author": {
88
"name": "ZenStack Team"
99
},

packages/schema/src/plugins/enhancer/enhance/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ export function enhance(prisma: any, context?: EnhancementContext<${authTypePara
283283
output: logicalPrismaFile,
284284
overrideClientGenerationPath: prismaClientOutDir,
285285
mode: 'logical',
286+
customAttributesAsComments: true,
286287
});
287288

288289
// generate the prisma client

packages/sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenstackhq/sdk",
3-
"version": "2.10.0",
3+
"version": "2.10.1",
44
"description": "ZenStack plugin development SDK",
55
"main": "index.js",
66
"scripts": {

packages/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenstackhq/server",
3-
"version": "2.10.0",
3+
"version": "2.10.1",
44
"displayName": "ZenStack Server-side Adapters",
55
"description": "ZenStack server-side adapters",
66
"homepage": "https://zenstack.dev",

packages/testtools/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenstackhq/testtools",
3-
"version": "2.10.0",
3+
"version": "2.10.1",
44
"description": "ZenStack Test Tools",
55
"main": "index.js",
66
"private": true,

script/test-scaffold.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ function run(cmd: string) {
1919
}
2020

2121
run('npm init -y');
22-
run('npm i --no-audit --no-fund typescript [email protected] @prisma/[email protected] zod decimal.js @types/node');
22+
run('npm i --no-audit --no-fund typescript [email protected] @prisma/[email protected] zod@^3.22.4 decimal.js @types/node');
2323

2424
console.log('Test scaffold setup complete.');

0 commit comments

Comments
 (0)