Skip to content

Commit ed5450b

Browse files
authored
Merge branch 'dev' into feat/tanstack-start
2 parents eb56d63 + edfd557 commit ed5450b

File tree

128 files changed

+5607
-2587
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+5607
-2587
lines changed

.changeset/README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

.changeset/config.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/build-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Install pnpm
4747
uses: pnpm/action-setup@v2
4848
with:
49-
version: 9.4.0
49+
version: 9.15.9
5050

5151
- name: Use Node.js ${{ matrix.node-version }}
5252
uses: buildjet/setup-node@v3

.github/workflows/integration-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Install pnpm
4747
uses: pnpm/action-setup@v2
4848
with:
49-
version: 9.4.0
49+
version: 9.15.9
5050

5151
- name: Use Node.js ${{ matrix.node-version }}
5252
uses: buildjet/setup-node@v3

.github/workflows/regression-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Install pnpm
4747
uses: pnpm/action-setup@v2
4848
with:
49-
version: 9.4.0
49+
version: 9.15.9
5050

5151
- name: Use Node.js ${{ matrix.node-version }}
5252
uses: buildjet/setup-node@v3

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ I want to think you first for considering contributing to ZenStack 🙏🏻. It'
55
## Prerequisites
66

77
- [Node.js](https://nodejs.org/): v20 or above
8-
- [pnpm](https://pnpm.io/): v9.4.0
8+
- [pnpm](https://pnpm.io/): v9.15.9
99

1010
If you want to run the tests, you should be aware that some of the integration tests run against postgres. These tests will attempt to set up and subsequently their own database, so you'll need to provide a connection details for a postgres user with at least those permissions. To provide connection details, you can configure the following environment variables or provide them when executing `pnpm test` commands.
1111

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 ZenStack
3+
Copyright (c) 2022-2025 ZenStack
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<img src="https://img.shields.io/npm/v/zenstack">
1111
</a>
1212
<a href="https://www.npmjs.com/package/zenstack">
13-
<img src="https://img.shields.io/npm/dm/zenstack">
13+
<img src="https://img.shields.io/npm/dm/@zenstackhq/runtime">
1414
</a>
1515
<img src="https://github.com/zenstackhq/zenstack/actions/workflows/build-test.yml/badge.svg">
1616
<a href="https://twitter.com/zenstackhq">
@@ -90,18 +90,26 @@ async function getPosts(userId: string) {
9090
Server adapter packages help you wrap an access-control-enabled Prisma client into backend CRUD APIs that can be safely called from the frontend. Here's an example for Next.js:
9191

9292
```ts
93-
// pages/api/model/[...path].ts
93+
// /src/app/api/model/[...path]/route.ts
9494

95-
import { requestHandler } from '@zenstackhq/next';
95+
import { NextRequestHandler } from '@zenstackhq/server/next';
96+
import type { NextRequest } from 'next/server';
9697
import { enhance } from '@zenstackhq/runtime';
9798
import { getSessionUser } from '@lib/auth';
9899
import { prisma } from '@lib/db';
99100

100101
// Mount Prisma-style APIs: "/api/model/post/findMany", "/api/model/post/create", etc.
101102
// Can be configured to provide standard RESTful APIs (using JSON:API) instead.
102-
export default requestHandler({
103-
getPrisma: (req, res) => enhance(prisma, { user: getSessionUser(req, res) }),
104-
});
103+
104+
function getPrisma(req: NextRequest) {
105+
// getSessionUser extracts the current session user from the request, its
106+
// implementation depends on your auth solution
107+
return enhance(prisma, { user: getSessionUser(req) });
108+
}
109+
110+
const handler = NextRequestHandler({ getPrisma, useAppDir: true });
111+
112+
export { handler as GET, handler as POST, handler as PUT, handler as PATCH, handler as DELETE };
105113
```
106114

107115
### 4. Generated client libraries (hooks) for data access

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zenstack-monorepo",
3-
"version": "2.16.2",
3+
"version": "2.19.2",
44
"description": "",
55
"scripts": {
66
"build": "pnpm -r --filter=\"!./packages/ide/*\" build",
@@ -22,11 +22,10 @@
2222
"keywords": [],
2323
"author": "",
2424
"license": "MIT",
25-
"packageManager": "pnpm@9.4.0+sha256.b6fd0bfda555e7e584ad7e56b30c68b01d5a04f9ee93989f4b93ca8473c49c74",
25+
"packageManager": "pnpm@9.15.9",
2626
"devDependencies": {
27-
"@changesets/cli": "^2.26.0",
2827
"@types/jest": "^29.5.10",
29-
"@types/node": "^20.10.2",
28+
"@types/node": "^20.14.9",
3029
"@typescript-eslint/eslint-plugin": "^7.6.0",
3130
"@typescript-eslint/parser": "^7.6.0",
3231
"concurrently": "^7.4.0",
@@ -38,6 +37,6 @@
3837
"ts-jest": "^29.1.1",
3938
"tsup": "^8.0.1",
4039
"tsx": "^4.7.1",
41-
"typescript": "^5.4.4"
40+
"typescript": "catalog:"
4241
}
4342
}

packages/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 ZenStack
3+
Copyright (c) 2022-2025 ZenStack
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)