Skip to content

Commit

Permalink
merge dev to main (v1.12.1) (#1217)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymc9 authored Apr 8, 2024
2 parents dfa6cb4 + e3fb73a commit 4ef45ff
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/update-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
'zenstackhq/sample-todo-nextjs-tanstack',
'zenstackhq/sample-todo-trpc',
'zenstackhq/sample-todo-sveltekit',
'zenstackhq/sample-todo-nuxt',
]

steps:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zenstack-monorepo",
"version": "1.12.0",
"version": "1.12.1",
"description": "",
"scripts": {
"build": "pnpm -r build",
Expand Down
2 changes: 1 addition & 1 deletion packages/ide/jetbrains/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = "dev.zenstack"
version = "1.12.0"
version = "1.12.1"

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion packages/ide/jetbrains/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jetbrains",
"version": "1.12.0",
"version": "1.12.1",
"displayName": "ZenStack JetBrains IDE Plugin",
"description": "ZenStack JetBrains IDE plugin",
"homepage": "https://zenstack.dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/language/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zenstackhq/language",
"version": "1.12.0",
"version": "1.12.1",
"displayName": "ZenStack modeling language compiler",
"description": "ZenStack modeling language compiler",
"homepage": "https://zenstack.dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/misc/redwood/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/redwood",
"displayName": "ZenStack RedwoodJS Integration",
"version": "1.12.0",
"version": "1.12.1",
"description": "CLI and runtime for integrating ZenStack with RedwoodJS projects.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/openapi/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/openapi",
"displayName": "ZenStack Plugin and Runtime for OpenAPI",
"version": "1.12.0",
"version": "1.12.1",
"description": "ZenStack plugin and runtime supporting OpenAPI",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/swr/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/swr",
"displayName": "ZenStack plugin for generating SWR hooks",
"version": "1.12.0",
"version": "1.12.1",
"description": "ZenStack plugin for generating SWR hooks",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/tanstack-query/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/tanstack-query",
"displayName": "ZenStack plugin for generating tanstack-query hooks",
"version": "1.12.0",
"version": "1.12.1",
"description": "ZenStack plugin for generating tanstack-query hooks",
"main": "index.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/trpc/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/trpc",
"displayName": "ZenStack plugin for tRPC",
"version": "1.12.0",
"version": "1.12.1",
"description": "ZenStack plugin for tRPC",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/runtime",
"displayName": "ZenStack Runtime Library",
"version": "1.12.0",
"version": "1.12.1",
"description": "Runtime of ZenStack for both client-side and server-side environments.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publisher": "zenstack",
"displayName": "ZenStack Language Tools",
"description": "Build scalable web apps with minimum code by defining authorization and validation rules inside the data schema that closer to the database",
"version": "1.12.0",
"version": "1.12.1",
"author": {
"name": "ZenStack Team"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/schema/src/plugins/zod/utils/schema-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ export function makeFieldSchema(field: DataModelField, respectDefault = false) {
schema += `.toUpperCase()`;
break;
}
case '@db.Uuid': {
schema += `.uuid()`;
break;
}
case '@datetime': {
schema += `.datetime({ offset: true${message ? ', message: ' + JSON.stringify(message) : ''} })`;
break;
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zenstackhq/sdk",
"version": "1.12.0",
"version": "1.12.1",
"description": "ZenStack plugin development SDK",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zenstackhq/server",
"version": "1.12.0",
"version": "1.12.1",
"displayName": "ZenStack Server-side Adapters",
"description": "ZenStack server-side adapters",
"homepage": "https://zenstack.dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/testtools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zenstackhq/testtools",
"version": "1.12.0",
"version": "1.12.1",
"description": "ZenStack Test Tools",
"main": "index.js",
"private": true,
Expand Down
5 changes: 5 additions & 0 deletions tests/integration/tests/plugins/zod.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/// <reference types="@types/jest" />

import { loadSchema } from '@zenstackhq/testtools';
import { randomUUID } from 'crypto';
import fs from 'fs';
import path from 'path';

Expand Down Expand Up @@ -235,6 +236,7 @@ describe('Zod plugin tests', () => {
o Int? @lt(1, 'must be less than 1')
p Int? @lte(1, 'must be less than or equal to 1')
q Int[]
r String? @db.Uuid
}
`;

Expand Down Expand Up @@ -295,6 +297,9 @@ describe('Zod plugin tests', () => {

expect(schema.safeParse({ q: [1] }).success).toBeTruthy();
expect(schema.safeParse({ q: ['abc'] }).success).toBeFalsy();

expect(schema.safeParse({ r: 'abc' }).success).toBeFalsy();
expect(schema.safeParse({ r: randomUUID() }).success).toBeTruthy();
});

it('refinement scalar fields', async () => {
Expand Down

0 comments on commit 4ef45ff

Please sign in to comment.