Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
685b3e5
chore(deps): bump kysely from ~0.28.8 to ~0.28.15
ymc9 Apr 3, 2026
3dc922d
[CI] Bump version 3.6.0 (#2571)
github-actions[bot] Apr 12, 2026
f654b84
chore: merge dev branch and resolve pnpm-lock.yaml conflict
Copilot Apr 12, 2026
dc26257
feat(server): add OpenAPI spec generation for RPC API (#2574)
ymc9 Apr 12, 2026
d6b860d
chore(better-auth): add kysely devDependency to fix duplicate @better…
ymc9 Apr 12, 2026
85da913
chore(deps): bump kysely from ~0.28.8 to ~0.28.15 (#2548)
ymc9 Apr 12, 2026
3393e4c
`@computed` fields from mixin types (`with`) cause `column does not e…
lsmith77 Apr 13, 2026
ffa9a80
chore: bump pnpm to 10.33.0
ymc9 Apr 14, 2026
ad8d5fb
chore: bump pnpm to 10.33.0 (#2577)
ymc9 Apr 14, 2026
b8209d7
chore: migrate from tsup to tsdown (#2580)
ymc9 Apr 15, 2026
44a6f9e
feat(zod): enforce literal true for select/include/omit options + exc…
marcsigmund Apr 15, 2026
36da18a
perf(orm): use EXISTS instead of COUNT subquery for to-one relation f…
evgenovalov Apr 15, 2026
4dd4951
Add missing AllWriteOperations export in ORM (#2582)
17 Apr 17, 2026
c9b5c53
chore: never proactively commit or push without explicit request (#2584)
ymc9 Apr 17, 2026
c858bbd
feat(language): allow relation fields in type declarations for mixin …
ymc9 Apr 17, 2026
2b88b52
docs: add @zenstackhq/schema to manual install command in README (#2586)
ymc9 Apr 17, 2026
09b96e4
fix(orm): make JsonArray mutable to fix Zod schema type incompatibili…
ymc9 Apr 17, 2026
4e35bc1
fix(orm): resolve delegate-inherited fields in cursor pagination (#2591)
genu Apr 18, 2026
cce978f
chore: add build script to tsdown config (#2592)
ymc9 Apr 19, 2026
3398c87
fix(orm): return @db.Time fields as Date instead of raw string (#2589…
erwan-joly Apr 19, 2026
064ce4a
fix(orm,server): fix procedure slicing in toJSONSchema and RPC OpenAP…
ymc9 Apr 20, 2026
e784b67
chore(server): regenerate rpc OpenAPI baseline
ymc9 Apr 20, 2026
31f4c49
fix(orm,server): fix procedure slicing in toJSONSchema and RPC OpenAP…
ymc9 Apr 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"configurations": [
{
"name": "Debug CLI",
"program": "${workspaceFolder}/packages/cli/dist/index.js",
"program": "${workspaceFolder}/packages/cli/dist/index.mjs",
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"type": "node",
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"vitest.maximumConfigs": 20
"vitest.maximumConfigs": 20,
"js/ts.tsdk.path": "node_modules/typescript/lib"
}
1 change: 1 addition & 0 deletions BREAKINGCHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
1. non-optional to-one relation doesn't automatically filter parent read when evaluating access policies
1. `@omit` and `@password` attributes have been removed
1. SWR plugin is removed
1. `makeModelSchema()` no longer includes relation fields by default — use `include` or `select` options to opt in, mirroring ORM behaviour
4 changes: 4 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

- Always target the `dev` branch (not `main`) when creating PRs

## Git Workflow

- Never commit or push changes unless explicitly asked to do so

## Development Notes

- Always run `zenstack generate` after modifying ZModel schemas
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Alternatively, you can set it up manually:

```bash
npm install -D @zenstackhq/cli
npm install @zenstackhq/orm
npm install @zenstackhq/schema @zenstackhq/orm
```

Then create a `zenstack` folder and a `schema.zmodel` file in it.
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "zenstack-v3",
"displayName": "ZenStack",
"description": "ZenStack",
"version": "3.5.6",
"version": "3.6.0",
"type": "module",
"author": {
"name": "ZenStack Team",
Expand All @@ -14,7 +14,7 @@
"url": "https://github.com/zenstackhq/zenstack"
},
"license": "MIT",
"packageManager": "pnpm@10.23.0",
"packageManager": "pnpm@10.33.0",
Comment thread
ymc9 marked this conversation as resolved.
"scripts": {
"build": "turbo run build",
"watch": "turbo run watch build",
Expand Down Expand Up @@ -45,7 +45,7 @@
"npm-run-all": "^4.1.5",
"prettier": "^3.5.3",
"prisma": "catalog:",
"tsup": "^8.5.0",
"tsdown": "^0.21.8",
"tsx": "^4.20.3",
"turbo": "^2.5.4",
"typescript": "catalog:",
Expand Down
16 changes: 9 additions & 7 deletions packages/auth-adapters/better-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@zenstackhq/better-auth",
"displayName": "ZenStack Better Auth Adapter",
"description": "ZenStack Better Auth Adapter. This adapter is modified from better-auth's Prisma adapter.",
"version": "3.5.6",
"version": "3.6.0",
"type": "module",
"author": {
"name": "ZenStack Team",
Expand All @@ -15,8 +15,8 @@
},
"license": "MIT",
"scripts": {
"build": "tsc --noEmit && tsup-node",
"watch": "tsup-node --watch",
"build": "tsc --noEmit && tsdown",
"watch": "tsdown --watch",
"lint": "eslint src --ext ts",
"test": "vitest run",
"pack": "pnpm pack"
Expand All @@ -31,8 +31,8 @@
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
Expand All @@ -55,14 +55,16 @@
"better-auth": "^1.3.0"
},
"devDependencies": {
"@better-auth/core": "1.4.19",
"better-auth": "1.4.19",
"@better-auth/cli": "1.4.19",
"@better-auth/core": "1.4.19",
"@types/tmp": "catalog:",
"@zenstackhq/cli": "workspace:*",
"@zenstackhq/eslint-config": "workspace:*",
"@zenstackhq/tsdown-config": "workspace:*",
"@zenstackhq/typescript-config": "workspace:*",
"@zenstackhq/vitest-config": "workspace:*",
"better-auth": "1.4.19",
"kysely": "catalog:",
"tmp": "catalog:"
},
"funding": "https://github.com/sponsors/zenstackhq"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function generateSchema(configFile: string): string {
* Helper function to verify schema with zenstack check
*/
function verifySchema(schemaPath: string) {
const cliPath = path.join(__dirname, '../../../cli/dist/index.js');
const cliPath = path.join(__dirname, '../../../cli/dist/index.mjs');
const workDir = path.dirname(schemaPath);

expect(fs.existsSync(schemaPath)).toBe(true);
Expand Down
3 changes: 3 additions & 0 deletions packages/auth-adapters/better-auth/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createConfig } from '@zenstackhq/tsdown-config';

export default createConfig({ entry: { index: 'src/index.ts' } });
13 changes: 0 additions & 13 deletions packages/auth-adapters/better-auth/tsup.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/cli/bin/cli
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env node

import '../dist/index.js';
import '../dist/index.mjs';
7 changes: 4 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@zenstackhq/cli",
"displayName": "ZenStack CLI",
"description": "FullStack database toolkit with built-in access control and automatic API generation.",
"version": "3.5.6",
"version": "3.6.0",
"type": "module",
"author": {
"name": "ZenStack Team",
Expand Down Expand Up @@ -30,8 +30,8 @@
"bin"
],
"scripts": {
"build": "tsc --noEmit && tsup-node",
"watch": "tsup-node --watch",
"build": "tsc --noEmit && tsdown",
"watch": "tsdown --watch",
"lint": "eslint src --ext ts",
"test": "vitest run",
"pack": "pnpm pack"
Expand Down Expand Up @@ -73,6 +73,7 @@
"@types/tmp": "catalog:",
"@zenstackhq/eslint-config": "workspace:*",
"@zenstackhq/testtools": "workspace:*",
"@zenstackhq/tsdown-config": "workspace:*",
"@zenstackhq/typescript-config": "workspace:*",
"@zenstackhq/vitest-config": "workspace:*",
"tmp": "catalog:"
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/scripts/post-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (!token) {
console.warn('TELEMETRY_TRACKING_TOKEN is not set.');
}

const filesToProcess = ['dist/index.js', 'dist/index.cjs'];
const filesToProcess = ['dist/index.mjs', 'dist/index.cjs'];
const _dirname = path.dirname(fileURLToPath(import.meta.url));

for (const file of filesToProcess) {
Expand Down
27 changes: 19 additions & 8 deletions packages/cli/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ export function getTestDbUrl(provider: 'sqlite' | 'postgresql' | 'mysql', dbName
}
}

export function getDefaultPrelude(options?: { provider?: 'sqlite' | 'postgresql' | 'mysql', datasourceFields?: Record<string, string | string[]> }) {
export function getDefaultPrelude(options?: {
provider?: 'sqlite' | 'postgresql' | 'mysql';
datasourceFields?: Record<string, string | string[]>;
}) {
const provider = (options?.provider || getTestDbProvider()) ?? 'sqlite';
const dbName = getTestDbName(provider);
let dbUrl: string;
Expand All @@ -78,33 +81,41 @@ export function getDefaultPrelude(options?: { provider?: 'sqlite' | 'postgresql'
['provider', `'${provider}'`],
['url', `'${dbUrl}'`],
...Object.entries(options?.datasourceFields || {}).map(([k, v]) => {
const value = Array.isArray(v) ? `[${v.map(item => `'${item}'`).join(', ')}]` : `'${v}'`;
const value = Array.isArray(v) ? `[${v.map((item) => `'${item}'`).join(', ')}]` : `'${v}'`;
return [k, value] as [string, string];
}),
];

const formattedFields = fields.map(([name, value]) => {
return ` ${name} = ${value}`;
}).join('\n');
const formattedFields = fields
.map(([name, value]) => {
return ` ${name} = ${value}`;
})
.join('\n');

const ZMODEL_PRELUDE = `datasource db {\n${formattedFields}\n}`;
return ZMODEL_PRELUDE;
}

export async function createProject(
zmodel: string,
options?: { customPrelude?: boolean; provider?: 'sqlite' | 'postgresql' | 'mysql'; datasourceFields?: Record<string, string | string[]> },
options?: {
customPrelude?: boolean;
provider?: 'sqlite' | 'postgresql' | 'mysql';
datasourceFields?: Record<string, string | string[]>;
},
) {
const workDir = createTestProject();
fs.mkdirSync(path.join(workDir, 'zenstack'), { recursive: true });
const schemaPath = path.join(workDir, 'zenstack/schema.zmodel');
const content = options?.customPrelude ? zmodel : `${getDefaultPrelude({ provider: options?.provider, datasourceFields: options?.datasourceFields })}\n\n${zmodel}`;
const content = options?.customPrelude
? zmodel
: `${getDefaultPrelude({ provider: options?.provider, datasourceFields: options?.datasourceFields })}\n\n${zmodel}`;
const schema = await formatDocument(content);
fs.writeFileSync(schemaPath, schema);
return { workDir, schema };
}

export function runCli(command: string, cwd: string) {
const cli = path.join(__dirname, '../dist/index.js');
const cli = path.join(__dirname, '../dist/index.mjs');
execSync(`node ${cli} ${command}`, { cwd });
}
3 changes: 3 additions & 0 deletions packages/cli/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createConfig } from '@zenstackhq/tsdown-config';

export default createConfig({ entry: { index: 'src/index.ts' } });
18 changes: 0 additions & 18 deletions packages/cli/tsup.config.ts

This file was deleted.

20 changes: 10 additions & 10 deletions packages/clients/client-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@zenstackhq/client-helpers",
"displayName": "ZenStack Client Helpers",
"description": "Helpers for implementing clients that consume ZenStack's CRUD service",
"version": "3.5.6",
"version": "3.6.0",
"type": "module",
"author": {
"name": "ZenStack Team",
Expand All @@ -15,8 +15,8 @@
},
"license": "MIT",
"scripts": {
"build": "tsc --noEmit && tsup-node && pnpm test:typecheck",
"watch": "tsup-node --watch",
"build": "tsc --noEmit && tsdown && pnpm test:typecheck",
"watch": "tsdown --watch",
"lint": "eslint src --ext ts",
"test": "vitest run",
"test:typecheck": "tsc --noEmit --project tsconfig.test.json",
Expand All @@ -27,25 +27,25 @@
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"./fetch": {
"types": "./dist/fetch.d.ts",
"default": "./dist/fetch.js"
"types": "./dist/fetch.d.mts",
"default": "./dist/fetch.mjs"
}
},
"dependencies": {
"@zenstackhq/common-helpers": "workspace:*",
"@zenstackhq/schema": "workspace:*",
"@zenstackhq/orm": "workspace:*",
"decimal.js": "catalog:",
"superjson": "^2.2.3"
},
"devDependencies": {
"@types/node": "catalog:",
"@zenstackhq/eslint-config": "workspace:*",
"@zenstackhq/language": "workspace:*",
"@zenstackhq/orm": "workspace:*",
"@zenstackhq/sdk": "workspace:*",
"@zenstackhq/tsdown-config": "workspace:*",
"@zenstackhq/typescript-config": "workspace:*",
"@zenstackhq/vitest-config": "workspace:*"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/clients/client-helpers/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "@zenstackhq/typescript-config/base.json",
"compilerOptions": {
"lib": ["ESNext", "DOM"]
},
"include": ["src/**/*.ts"]
}
3 changes: 2 additions & 1 deletion packages/clients/client-helpers/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "@zenstackhq/typescript-config/base.json",
"include": ["src/**/*.ts", "test/**/*.ts"],
"compilerOptions": {
"lib": ["ESNext"]
"lib": ["ESNext", "DOM"],
"types": ["node"]
}
}
9 changes: 9 additions & 0 deletions packages/clients/client-helpers/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { createConfig } from '@zenstackhq/tsdown-config';

export default createConfig({
entry: {
index: 'src/index.ts',
fetch: 'src/fetch.ts',
},
format: ['esm'],
});
14 changes: 0 additions & 14 deletions packages/clients/client-helpers/tsup.config.ts

This file was deleted.

Loading
Loading