Skip to content

Commit 4881622

Browse files
committed
chore: bump version, fix lint
1 parent 7ac4f4a commit 4881622

File tree

19 files changed

+58
-25
lines changed

19 files changed

+58
-25
lines changed

.vscode/tasks.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@
2828
"id": "server-process"
2929
}
3030
},
31+
{
32+
"label": "Lint all",
33+
"command": "pnpm lint",
34+
"type": "shell",
35+
"icon": {
36+
"color": "terminal.ansiYellow",
37+
"id": "server-process"
38+
},
39+
"problemMatcher": []
40+
},
3141
{
3242
"label": "Test all",
3343
"command": "pnpm test",

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,16 +280,20 @@ You can use a plugin to achieve the following goals:
280280
281281
#### 1. ORM query interception
282282
283-
ORM query interception allows you to intercept the high-level ORM API calls.
283+
ORM query interception allows you to intercept the high-level ORM API calls. The interceptor's configuration is compatible with Prisma's [query client extension](https://www.prisma.io/docs/orm/prisma-client/client-extensions/query).
284284
285285
```ts
286286
client.$use({
287287
id: 'cost-logger',
288-
async onQuery({ model, operation, proceed, queryArgs }) {
289-
const start = Date.now();
290-
const result = await proceed(queryArgs);
291-
console.log(`[cost] ${model} ${operation} took ${Date.now() - start}ms`);
292-
return result;
288+
onQuery: {
289+
$allModels: {
290+
$allOperations: async ({ model, operation, args, query }) => {
291+
const start = Date.now();
292+
const result = await query(args);
293+
console.log(`[cost] ${model} ${operation} took ${Date.now() - start}ms`);
294+
return result;
295+
},
296+
},
293297
},
294298
});
295299
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zenstack-v3",
3-
"version": "3.0.0-alpha.4",
3+
"version": "3.0.0-alpha.5",
44
"description": "ZenStack",
55
"packageManager": "[email protected]",
66
"scripts": {

packages/cli/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 CLI",
55
"description": "FullStack database toolkit with built-in access control and automatic API generation.",
6-
"version": "3.0.0-alpha.4",
6+
"version": "3.0.0-alpha.5",
77
"type": "module",
88
"author": {
99
"name": "ZenStack Team"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import config from '@zenstackhq/eslint-config/base.js';
2+
3+
/** @type {import("eslint").Linter.Config} */
4+
export default config;

packages/common-helpers/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenstackhq/common-helpers",
3-
"version": "3.0.0-alpha.4",
3+
"version": "3.0.0-alpha.5",
44
"description": "ZenStack Common Helpers",
55
"type": "module",
66
"scripts": {
@@ -26,5 +26,9 @@
2626
"default": "./dist/index.cjs"
2727
}
2828
}
29+
},
30+
"devDependencies": {
31+
"@zenstackhq/typescript-config": "workspace:*",
32+
"@zenstackhq/eslint-config": "workspace:*"
2933
}
3034
}

packages/common-helpers/src/tiny-invariant.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
const isProduction = process.env.NODE_ENV === 'production';
1+
const isProduction = process.env['NODE_ENV'] === 'production';
22
const prefix = 'Invariant failed';
33

4-
export function invariant(
5-
condition: unknown,
6-
message?: string,
7-
): asserts condition {
4+
export function invariant(condition: unknown, message?: string): asserts condition {
85
if (condition) {
96
return;
107
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "@zenstackhq/typescript-config/base.json",
3+
"compilerOptions": {
4+
"outDir": "dist"
5+
},
6+
"include": ["src/**/*.ts"]
7+
}

packages/create-zenstack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-zenstack",
3-
"version": "3.0.0-alpha.4",
3+
"version": "3.0.0-alpha.5",
44
"description": "Create a new ZenStack project",
55
"type": "module",
66
"scripts": {

packages/eslint-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenstackhq/eslint-config",
3-
"version": "3.0.0-alpha.4",
3+
"version": "3.0.0-alpha.5",
44
"type": "module",
55
"private": true,
66
"license": "MIT"

0 commit comments

Comments
 (0)