Skip to content

Commit 7feb66b

Browse files
committed
feat: tanstack-query/react CRUD hooks implementation
1 parent 5c31cc1 commit 7feb66b

Some content is hidden

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

56 files changed

+3500
-301
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ Even without using advanced features, ZenStack offers the following benefits as
5151
5252
# Quick start
5353

54-
> You can also check the [blog sample](./samples/blog) for a complete example.
54+
- [ORM](./samples/orm): A simple example demonstrating ZenStack ORM usage.
55+
- [Next.js + TanStack Query](./samples/next.js): A full-stack sample demonstrating using TanStack Query to consume ZenStack's automatic CRUD services in a Next.js app.
5556

5657
## Installation
5758

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"typescript": "catalog:",
3232
"typescript-eslint": "^8.34.1",
3333
"vitest": "^3.2.4",
34-
"yaml": "^2.8.0"
34+
"yaml": "^2.8.0",
35+
"prisma": "catalog:"
3536
},
3637
"pnpm": {
3738
"onlyBuiltDependencies": [

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"prisma": "catalog:"
4646
},
4747
"devDependencies": {
48-
"@types/better-sqlite3": "^7.6.13",
48+
"@types/better-sqlite3": "catalog:",
4949
"@types/semver": "^7.7.0",
5050
"@types/tmp": "catalog:",
5151
"@zenstackhq/eslint-config": "workspace:*",

packages/tanstack-query/package.json renamed to packages/clients/tanstack-query/package.json

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
{
22
"name": "@zenstackhq/tanstack-query",
33
"version": "3.0.0-beta.15",
4-
"description": "",
4+
"description": "TanStack Query Client for consuming ZenStack v3's CRUD service",
55
"main": "index.js",
66
"type": "module",
77
"private": true,
88
"scripts": {
99
"build": "tsc --noEmit && tsup-node",
10-
"lint": "eslint src --ext ts"
10+
"watch": "tsup-node --watch",
11+
"lint": "eslint src --ext ts",
12+
"test": "vitest run",
13+
"pack": "pnpm pack"
1114
},
12-
"keywords": [],
13-
"author": "",
15+
"keywords": [
16+
"tanstack-query",
17+
"react-query",
18+
"zenstack",
19+
"orm",
20+
"fullstack"
21+
],
22+
"author": "ZenStack Team",
1423
"license": "MIT",
1524
"exports": {
1625
"./react": {
@@ -26,20 +35,28 @@
2635
},
2736
"dependencies": {
2837
"@zenstackhq/common-helpers": "workspace:*",
38+
"@zenstackhq/schema": "workspace:*",
2939
"@zenstackhq/orm": "workspace:*",
3040
"superjson": "^2.2.3",
3141
"decimal.js": "catalog:"
3242
},
3343
"devDependencies": {
3444
"@zenstackhq/eslint-config": "workspace:*",
35-
"@zenstackhq/typescript-config": "workspace:*"
45+
"@zenstackhq/typescript-config": "workspace:*",
46+
"react": "catalog:",
47+
"@types/react": "catalog:",
48+
"@tanstack/react-query": "catalog:"
3649
},
3750
"peerDependencies": {
38-
"@tanstack/react-query": "^5.0.0"
51+
"@tanstack/react-query": "^5.0.0",
52+
"react": "^18 || ^19"
3953
},
4054
"peerDependenciesMeta": {
4155
"@tanstack/react-query": {
4256
"optional": true
57+
},
58+
"react": {
59+
"optional": true
4360
}
4461
}
4562
}

0 commit comments

Comments
 (0)