Skip to content

Commit 50e5dbc

Browse files
committed
Merge remote-tracking branch 'origin/dev' into v2
2 parents 76bbe95 + 9e840ea commit 50e5dbc

File tree

24 files changed

+282
-98
lines changed

24 files changed

+282
-98
lines changed

.github/workflows/build-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
java-version: 17
8383

8484
- name: Setup Gradle
85-
uses: gradle/gradle-build-action@v2
85+
uses: gradle/gradle-build-action@v2.4.2
8686
with:
8787
gradle-home-cache-cleanup: true
8888

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,30 @@ ZenStack incrementally extends Prisma's power with the following four layers:
3737

3838
ZenStack introduces a data modeling language called "ZModel" - a superset of Prisma schema language. It extended Prisma schema with custom attributes and functions and, based on that, implemented a flexible access control layer around Prisma.
3939

40-
```prisma
41-
// schema.zmodel
42-
43-
model Post {
40+
```ts
41+
// base.zmodel
42+
abstract model Base {
4443
id String @id
45-
title String
46-
published Boolean @default(false)
4744
author User @relation(fields: [authorId], references: [id])
4845
authorId String
4946

50-
// 🔐 allow logged-in users to read published posts
51-
@@allow('read', auth() != null && published)
52-
5347
// 🔐 allow full CRUD by author
5448
@@allow('all', author == auth())
5549
}
5650
```
5751

52+
```ts
53+
// schema.zmodel
54+
import "base"
55+
model Post extends Base {
56+
title String
57+
published Boolean @default(false)
58+
59+
// 🔐 allow logged-in users to read published posts
60+
@@allow('read', auth() != null && published)
61+
}
62+
```
63+
5864
The `zenstack` CLI transpiles the ZModel into a standard Prisma schema, which you can use with the regular Prisma workflows.
5965

6066
### 2. Runtime enhancements to Prisma client
@@ -183,6 +189,7 @@ Check out the [Multi-tenant Todo App](https://zenstack-todo.vercel.app/) for a r
183189
- [Next.js 13 + NextAuth + tRPC](https://github.com/zenstackhq/sample-todo-trpc)
184190
- [Nuxt V3 + TanStack Query](https://github.com/zenstackhq/sample-todo-nuxt)
185191
- [SvelteKit + TanStack Query](https://github.com/zenstackhq/sample-todo-sveltekit)
192+
- [RedwoodJS](https://github.com/zenstackhq/sample-todo-redwood)
186193

187194
### Blog App
188195

packages/ide/jetbrains/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group = "dev.zenstack"
8-
version = "1.6.0"
8+
version = "1.6.1"
99

1010
repositories {
1111
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": "1.6.0",
3+
"version": "1.6.1",
44
"displayName": "ZenStack JetBrains IDE Plugin",
55
"description": "ZenStack JetBrains IDE plugin",
66
"homepage": "https://zenstack.dev",

packages/misc/redwood/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"name": "@zenstackhq/redwood",
33
"displayName": "ZenStack RedwoodJS Integration",
4-
"version": "1.6.0",
4+
"version": "1.6.1",
55
"description": "CLI and runtime for integrating ZenStack with RedwoodJS projects.",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/zenstackhq/zenstack"
99
},
1010
"scripts": {
1111
"clean": "rimraf dist",
12-
"build": "pnpm lint --max-warnings=0 && pnpm clean && tsc",
12+
"build": "pnpm lint --max-warnings=0 && pnpm clean && tsc && pnpm pack dist --pack-destination '../../../.build'",
1313
"watch": "tsc --watch",
1414
"lint": "eslint src --ext ts",
1515
"prepublishOnly": "pnpm build"

packages/plugins/openapi/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
"change-case": "^4.1.2",
3333
"lower-case-first": "^2.0.2",
3434
"openapi-types": "^12.1.0",
35-
"semver": "^7.3.8",
35+
"semver": "^7.5.2",
3636
"tiny-invariant": "^1.3.1",
3737
"ts-pattern": "^4.3.0",
3838
"upper-case-first": "^2.0.2",
39-
"yaml": "^2.2.1",
39+
"yaml": "^2.2.2",
4040
"zod": "^3.22.4",
4141
"zod-validation-error": "^1.5.0"
4242
},

packages/plugins/swr/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"cross-fetch": "^4.0.0",
4646
"decimal.js": "^10.4.2",
4747
"lower-case-first": "^2.0.2",
48-
"semver": "^7.3.8",
48+
"semver": "^7.5.2",
4949
"ts-morph": "^16.0.0",
5050
"upper-case-first": "^2.0.2"
5151
},

packages/plugins/tanstack-query/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"cross-fetch": "^4.0.0",
8888
"decimal.js": "^10.4.2",
8989
"lower-case-first": "^2.0.2",
90-
"semver": "^7.3.8",
90+
"semver": "^7.5.2",
9191
"superjson": "^1.11.0",
9292
"ts-morph": "^16.0.0",
9393
"upper-case-first": "^2.0.2"

packages/runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"deepcopy": "^2.1.0",
6363
"lower-case-first": "^2.0.2",
6464
"pluralize": "^8.0.0",
65-
"semver": "^7.3.8",
65+
"semver": "^7.5.2",
6666
"superjson": "^1.11.0",
6767
"tiny-invariant": "^1.3.1",
6868
"tslib": "^2.4.1",

packages/schema/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"pluralize": "^8.0.0",
9696
"pretty-repl": "^4.0.0",
9797
"promisify": "^0.0.3",
98-
"semver": "^7.3.8",
98+
"semver": "^7.5.2",
9999
"sleep-promise": "^9.1.0",
100100
"strip-color": "^0.1.0",
101101
"tiny-invariant": "^1.3.1",

0 commit comments

Comments
 (0)