From 21b955a71a2a08a4b9c97314cab07fc4b0b68d8d Mon Sep 17 00:00:00 2001 From: ymc9 <104139426+ymc9@users.noreply.github.com> Date: Fri, 8 Mar 2024 20:51:13 -0800 Subject: [PATCH 1/2] fix(polymorphism): relation name disambiguation --- .../validator/datamodel-validator.ts | 2 +- .../src/plugins/enhancer/enhance/index.ts | 2 +- .../src/plugins/prisma/schema-generator.ts | 55 +++++++++++++++ packages/schema/src/utils/ast-utils.ts | 11 +-- .../with-delegate/issue-1100.test.ts | 69 +++++++++++++++++++ 5 files changed, 133 insertions(+), 6 deletions(-) create mode 100644 tests/integration/tests/enhancements/with-delegate/issue-1100.test.ts diff --git a/packages/schema/src/language-server/validator/datamodel-validator.ts b/packages/schema/src/language-server/validator/datamodel-validator.ts index 1d442f12b..4f9cd0039 100644 --- a/packages/schema/src/language-server/validator/datamodel-validator.ts +++ b/packages/schema/src/language-server/validator/datamodel-validator.ts @@ -241,7 +241,7 @@ export default class DataModelValidator implements AstValidator { const oppositeModel = field.type.reference!.ref! as DataModel; // Use name because the current document might be updated - let oppositeFields = getModelFieldsWithBases(oppositeModel).filter( + let oppositeFields = getModelFieldsWithBases(oppositeModel, false).filter( (f) => f.type.reference?.ref?.name === contextModel.name ); oppositeFields = oppositeFields.filter((f) => { diff --git a/packages/schema/src/plugins/enhancer/enhance/index.ts b/packages/schema/src/plugins/enhancer/enhance/index.ts index df14e0826..a379e5ad0 100644 --- a/packages/schema/src/plugins/enhancer/enhance/index.ts +++ b/packages/schema/src/plugins/enhancer/enhance/index.ts @@ -133,7 +133,7 @@ async function generateLogicalPrisma(model: Model, options: PluginOptions, outDi } catch { // noop } - throw new PluginError(name, `Failed to run "prisma generate"`); + throw new PluginError(name, `Failed to run "prisma generate" on logical schema: ${logicalPrismaFile}`); } // make a bunch of typing fixes to the generated prisma client diff --git a/packages/schema/src/plugins/prisma/schema-generator.ts b/packages/schema/src/plugins/prisma/schema-generator.ts index bc63d535a..bfcecc9ef 100644 --- a/packages/schema/src/plugins/prisma/schema-generator.ts +++ b/packages/schema/src/plugins/prisma/schema-generator.ts @@ -34,6 +34,7 @@ import { getIdFields } from '../../utils/ast-utils'; import { DELEGATE_AUX_RELATION_PREFIX, PRISMA_MINIMUM_VERSION } from '@zenstackhq/runtime'; import { getAttribute, + getAttributeArg, getForeignKeyFields, getLiteral, getPrismaVersion, @@ -299,6 +300,9 @@ export class PrismaSchemaGenerator { // expand relations on other models that reference delegated models to concrete models this.expandPolymorphicRelations(model, decl); + + // name relations inherited from delegate base models for disambiguation + this.nameRelationsInheritedFromDelegate(model, decl); } private generateDelegateRelationForBase(model: PrismaDataModel, decl: DataModel) { @@ -422,6 +426,8 @@ export class PrismaSchemaGenerator { ); const addedRel = new PrismaFieldAttribute('@relation', [ + // use field name as relation name for disambiguation + new PrismaAttributeArg(undefined, new AttributeArgValue('String', relationField.name)), new PrismaAttributeArg('fields', args), new PrismaAttributeArg('references', args), ]); @@ -440,11 +446,60 @@ export class PrismaSchemaGenerator { } else { relationField.attributes.push(this.makeFieldAttribute(relAttr as DataModelFieldAttribute)); } + } else { + relationField.attributes.push( + new PrismaFieldAttribute('@relation', [ + // use field name as relation name for disambiguation + new PrismaAttributeArg(undefined, new AttributeArgValue('String', relationField.name)), + ]) + ); } }); }); } + private nameRelationsInheritedFromDelegate(model: PrismaDataModel, decl: DataModel) { + if (this.mode !== 'logical') { + return; + } + + // the logical schema needs to name relations inherited from delegate base models for disambiguation + + decl.fields.forEach((f) => { + if (!f.$inheritedFrom || !isDelegateModel(f.$inheritedFrom) || !isDataModel(f.type.reference?.ref)) { + return; + } + + const prismaField = model.fields.find((field) => field.name === f.name); + if (!prismaField) { + return; + } + + const relAttr = getAttribute(f, '@relation'); + const relName = `${DELEGATE_AUX_RELATION_PREFIX}_${lowerCaseFirst(decl.name)}`; + + if (relAttr) { + const nameArg = getAttributeArg(relAttr, 'name'); + if (!nameArg) { + const prismaRelAttr = prismaField.attributes.find( + (attr) => (attr as PrismaFieldAttribute).name === '@relation' + ) as PrismaFieldAttribute; + if (prismaRelAttr) { + prismaRelAttr.args.unshift( + new PrismaAttributeArg(undefined, new AttributeArgValue('String', relName)) + ); + } + } + } else { + prismaField.attributes.push( + new PrismaFieldAttribute('@relation', [ + new PrismaAttributeArg(undefined, new AttributeArgValue('String', relName)), + ]) + ); + } + }); + } + private get supportNamedConstraints() { const ds = this.zmodel.declarations.find(isDataSource); if (!ds) { diff --git a/packages/schema/src/utils/ast-utils.ts b/packages/schema/src/utils/ast-utils.ts index 2688987a2..8dfe75b4b 100644 --- a/packages/schema/src/utils/ast-utils.ts +++ b/packages/schema/src/utils/ast-utils.ts @@ -16,7 +16,7 @@ import { ModelImport, ReferenceExpr, } from '@zenstackhq/language/ast'; -import { isFromStdlib } from '@zenstackhq/sdk'; +import { isDelegateModel, isFromStdlib } from '@zenstackhq/sdk'; import { AstNode, copyAstNode, @@ -207,19 +207,22 @@ export function getContainingDataModel(node: Expression): DataModel | undefined return undefined; } -export function getModelFieldsWithBases(model: DataModel) { +export function getModelFieldsWithBases(model: DataModel, includeDelegate = true) { if (model.$baseMerged) { return model.fields; } else { - return [...model.fields, ...getRecursiveBases(model).flatMap((base) => base.fields)]; + return [...model.fields, ...getRecursiveBases(model, includeDelegate).flatMap((base) => base.fields)]; } } -export function getRecursiveBases(dataModel: DataModel): DataModel[] { +export function getRecursiveBases(dataModel: DataModel, includeDelegate = true): DataModel[] { const result: DataModel[] = []; dataModel.superTypes.forEach((superType) => { const baseDecl = superType.ref; if (baseDecl) { + if (!includeDelegate && isDelegateModel(baseDecl)) { + return; + } result.push(baseDecl); result.push(...getRecursiveBases(baseDecl)); } diff --git a/tests/integration/tests/enhancements/with-delegate/issue-1100.test.ts b/tests/integration/tests/enhancements/with-delegate/issue-1100.test.ts new file mode 100644 index 000000000..8b1945b8d --- /dev/null +++ b/tests/integration/tests/enhancements/with-delegate/issue-1100.test.ts @@ -0,0 +1,69 @@ +import { loadModelWithError, loadSchema } from '@zenstackhq/testtools'; + +describe('Regression for issue 1100', () => { + it('missing opposite relation', async () => { + const schema = ` + model User { + id String @id @default(cuid()) + name String? + content Content[] + post Post[] + } + + model Content { + id String @id @default(cuid()) + published Boolean @default(false) + contentType String + @@delegate(contentType) + + user User @relation(fields: [userId], references: [id]) + userId String + } + + model Post extends Content { + title String + } + + model Image extends Content { + url String + } + `; + + await expect(loadModelWithError(schema)).resolves.toContain( + 'The relation field "post" on model "User" is missing an opposite relation field on model "Post"' + ); + }); + + it('success', async () => { + const schema = ` + model User { + id String @id @default(cuid()) + name String? + content Content[] + post Post[] + } + + model Content { + id String @id @default(cuid()) + published Boolean @default(false) + contentType String + @@delegate(contentType) + + user User @relation(fields: [userId], references: [id]) + userId String + } + + model Post extends Content { + title String + author User @relation(fields: [authorId], references: [id]) + authorId String + } + + model Image extends Content { + url String + } + `; + + await expect(loadSchema(schema)).toResolveTruthy(); + }); +}); From 99b606aa824c2aac883da8c74b64aff0cd219b80 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 Mar 2024 04:51:44 +0000 Subject: [PATCH 2/2] chore: release fix/issue-1100 --- .github/release/.release-manifest.json | 24 ++++++++-------- CHANGELOG.md | 29 +++++++++++++++++--- package.json | 2 +- packages/ide/jetbrains/CHANGELOG.md | 8 ++++++ packages/ide/jetbrains/package.json | 2 +- packages/language/CHANGELOG.md | 8 ++++++ packages/language/package.json | 4 +-- packages/misc/redwood/CHANGELOG.md | 8 ++++++ packages/misc/redwood/package.json | 2 +- packages/plugins/openapi/CHANGELOG.md | 9 ++++++ packages/plugins/openapi/package.json | 2 +- packages/plugins/swr/CHANGELOG.md | 9 ++++++ packages/plugins/swr/package.json | 2 +- packages/plugins/tanstack-query/CHANGELOG.md | 9 ++++++ packages/plugins/tanstack-query/package.json | 2 +- packages/plugins/trpc/CHANGELOG.md | 9 ++++++ packages/plugins/trpc/package.json | 2 +- packages/runtime/CHANGELOG.md | 12 ++++++++ packages/runtime/package.json | 2 +- packages/sdk/CHANGELOG.md | 10 +++++++ packages/sdk/package.json | 2 +- packages/server/CHANGELOG.md | 8 ++++++ packages/server/package.json | 2 +- packages/testtools/CHANGELOG.md | 10 +++++++ packages/testtools/package.json | 2 +- 25 files changed, 150 insertions(+), 29 deletions(-) diff --git a/.github/release/.release-manifest.json b/.github/release/.release-manifest.json index 1857a084d..388e76056 100644 --- a/.github/release/.release-manifest.json +++ b/.github/release/.release-manifest.json @@ -1,14 +1,14 @@ { - ".": "2.0.0-alpha.1", - "packages/ide/jetbrains": "2.0.0-alpha.2", - "packages/language": "2.0.0-alpha.2", - "packages/misc/redwood": "2.0.0-alpha.2", - "packages/plugins/openapi": "2.0.0-alpha.2", - "packages/plugins/swr": "2.0.0-alpha.2", - "packages/plugins/tanstack-query": "2.0.0-alpha.2", - "packages/plugins/trpc": "2.0.0-alpha.2", - "packages/runtime": "2.0.0-alpha.2", - "packages/sdk": "2.0.0-alpha.2", - "packages/server": "2.0.0-alpha.2", - "packages/testtools": "2.0.0-alpha.2" + ".": "2.0.0-alpha.2", + "packages/ide/jetbrains": "2.0.0-alpha.3", + "packages/language": "2.0.0-alpha.3", + "packages/misc/redwood": "2.0.0-alpha.3", + "packages/plugins/openapi": "2.0.0-alpha.3", + "packages/plugins/swr": "2.0.0-alpha.3", + "packages/plugins/tanstack-query": "2.0.0-alpha.3", + "packages/plugins/trpc": "2.0.0-alpha.3", + "packages/runtime": "2.0.0-alpha.3", + "packages/sdk": "2.0.0-alpha.3", + "packages/server": "2.0.0-alpha.3", + "packages/testtools": "2.0.0-alpha.3" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 14a85cdea..7bb8163c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,25 @@ -# 0.5.0 (2022-12-15) +# Changelog + +## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-03-09) + + +### Bug Fixes + +* clean up generation of logical prisma client ([#1082](https://github.com/zenstackhq/zenstack/issues/1082)) ([6e7993a](https://github.com/zenstackhq/zenstack/commit/6e7993afa8dde03ae12c44f198bcca04724dbc92)) +* default auth without user context ([#1015](https://github.com/zenstackhq/zenstack/issues/1015)) ([e5b5a0f](https://github.com/zenstackhq/zenstack/commit/e5b5a0fee34e46bee5557229f6f5894629c6ad96)) +* foreign key constraint ambiguity in generated delegate prisma schema ([#1060](https://github.com/zenstackhq/zenstack/issues/1060)) ([ca2a314](https://github.com/zenstackhq/zenstack/commit/ca2a314a927053703e4dbc76542499159b8bf6a8)) +* more robust calculation of default location for code generation ([#1095](https://github.com/zenstackhq/zenstack/issues/1095)) ([d11d4ba](https://github.com/zenstackhq/zenstack/commit/d11d4bade318d5a17d1a5e3860292352e25cc813)) +* **polymorphism:** relation name disambiguation ([21b955a](https://github.com/zenstackhq/zenstack/commit/21b955a71a2a08a4b9c97314cab07fc4b0b68d8d)) +* **polymorphism:** support `orderBy` with base fields ([#1086](https://github.com/zenstackhq/zenstack/issues/1086)) ([2e81a08](https://github.com/zenstackhq/zenstack/commit/2e81a089a1b57ebf61d25fc49300fa22f0cda06b)) +* prisma.d.ts is not properly saved ([#1090](https://github.com/zenstackhq/zenstack/issues/1090)) ([d3629be](https://github.com/zenstackhq/zenstack/commit/d3629bef459afc11c16461fb18621d2f77ac35cc)) +* several issues with using `auth()` in `[@default](https://github.com/default)` ([#1088](https://github.com/zenstackhq/zenstack/issues/1088)) ([36e515e](https://github.com/zenstackhq/zenstack/commit/36e515e485c580657b9edbfc52014f3542abfb96)) + + +### Performance Improvements + +* improve polymorphism code generation speed ([#1073](https://github.com/zenstackhq/zenstack/issues/1073)) ([5b103ba](https://github.com/zenstackhq/zenstack/commit/5b103badea7876b7dfc1da91c26eca3213ddd413)) + +## 0.5.0 (2022-12-15) ### Features @@ -12,7 +33,7 @@ - Next-auth adapter and helper are moved to a separate package `@zenstackhq/next-auth`. -# 0.4.0 (2022-12-01) +## 0.4.0 (2022-12-01) ### Features @@ -50,7 +71,7 @@ Use @zenstackhq/runtime/types for type definitions shared between client and server, @zenstackhq/runtime/client for client-specific libaries (like React hooks), and @zenstackhq/runtime/server for server-specific libraries. -# 0.3.0 (2022-11-08) +## 0.3.0 (2022-11-08) ### Features @@ -70,7 +91,7 @@ - Better overall documentation -# 0.2.0 (2022-10-29) +## 0.2.0 (2022-10-29) ### Features diff --git a/package.json b/package.json index 6c73b5f25..febc93264 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zenstack-monorepo", - "version": "2.0.0-alpha.5", + "version": "2.0.0-alpha.2", "description": "", "scripts": { "build": "pnpm -r build", diff --git a/packages/ide/jetbrains/CHANGELOG.md b/packages/ide/jetbrains/CHANGELOG.md index 6f0f0e7ff..aadf48631 100644 --- a/packages/ide/jetbrains/CHANGELOG.md +++ b/packages/ide/jetbrains/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.0.0-alpha.3](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2024-03-09) + + +### Bug Fixes + +* more robust calculation of default location for code generation ([#1095](https://github.com/zenstackhq/zenstack/issues/1095)) ([d11d4ba](https://github.com/zenstackhq/zenstack/commit/d11d4bade318d5a17d1a5e3860292352e25cc813)) +* prisma.d.ts is not properly saved ([#1090](https://github.com/zenstackhq/zenstack/issues/1090)) ([d3629be](https://github.com/zenstackhq/zenstack/commit/d3629bef459afc11c16461fb18621d2f77ac35cc)) + ## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21) diff --git a/packages/ide/jetbrains/package.json b/packages/ide/jetbrains/package.json index b42a1047b..45658df7a 100644 --- a/packages/ide/jetbrains/package.json +++ b/packages/ide/jetbrains/package.json @@ -1,6 +1,6 @@ { "name": "jetbrains", - "version": "2.0.0-alpha.5", + "version": "2.0.0-alpha.3", "displayName": "ZenStack JetBrains IDE Plugin", "description": "ZenStack JetBrains IDE plugin", "homepage": "https://zenstack.dev", diff --git a/packages/language/CHANGELOG.md b/packages/language/CHANGELOG.md index cc2a59fdc..bb8e8938c 100644 --- a/packages/language/CHANGELOG.md +++ b/packages/language/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.0.0-alpha.3](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2024-03-09) + + +### Bug Fixes + +* more robust calculation of default location for code generation ([#1095](https://github.com/zenstackhq/zenstack/issues/1095)) ([d11d4ba](https://github.com/zenstackhq/zenstack/commit/d11d4bade318d5a17d1a5e3860292352e25cc813)) +* prisma.d.ts is not properly saved ([#1090](https://github.com/zenstackhq/zenstack/issues/1090)) ([d3629be](https://github.com/zenstackhq/zenstack/commit/d3629bef459afc11c16461fb18621d2f77ac35cc)) + ## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21) diff --git a/packages/language/package.json b/packages/language/package.json index 5ea7cdfa8..d1928eb0a 100644 --- a/packages/language/package.json +++ b/packages/language/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/language", - "version": "2.0.0-alpha.5", + "version": "2.0.0-alpha.3", "displayName": "ZenStack modeling language compiler", "description": "ZenStack modeling language compiler", "homepage": "https://zenstack.dev", @@ -23,7 +23,7 @@ "plist2": "^1.1.3" }, "dependencies": { - "langium": "1.3.1" + "langium": "1.3.1" }, "contributes": { "languages": [ diff --git a/packages/misc/redwood/CHANGELOG.md b/packages/misc/redwood/CHANGELOG.md index cc2a59fdc..bb8e8938c 100644 --- a/packages/misc/redwood/CHANGELOG.md +++ b/packages/misc/redwood/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.0.0-alpha.3](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2024-03-09) + + +### Bug Fixes + +* more robust calculation of default location for code generation ([#1095](https://github.com/zenstackhq/zenstack/issues/1095)) ([d11d4ba](https://github.com/zenstackhq/zenstack/commit/d11d4bade318d5a17d1a5e3860292352e25cc813)) +* prisma.d.ts is not properly saved ([#1090](https://github.com/zenstackhq/zenstack/issues/1090)) ([d3629be](https://github.com/zenstackhq/zenstack/commit/d3629bef459afc11c16461fb18621d2f77ac35cc)) + ## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21) diff --git a/packages/misc/redwood/package.json b/packages/misc/redwood/package.json index 2f19b2305..10e4b55fb 100644 --- a/packages/misc/redwood/package.json +++ b/packages/misc/redwood/package.json @@ -1,7 +1,7 @@ { "name": "@zenstackhq/redwood", "displayName": "ZenStack RedwoodJS Integration", - "version": "2.0.0-alpha.5", + "version": "2.0.0-alpha.3", "description": "CLI and runtime for integrating ZenStack with RedwoodJS projects.", "repository": { "type": "git", diff --git a/packages/plugins/openapi/CHANGELOG.md b/packages/plugins/openapi/CHANGELOG.md index cc2a59fdc..719164936 100644 --- a/packages/plugins/openapi/CHANGELOG.md +++ b/packages/plugins/openapi/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [2.0.0-alpha.3](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2024-03-09) + + +### Bug Fixes + +* clean up generation of logical prisma client ([#1082](https://github.com/zenstackhq/zenstack/issues/1082)) ([6e7993a](https://github.com/zenstackhq/zenstack/commit/6e7993afa8dde03ae12c44f198bcca04724dbc92)) +* more robust calculation of default location for code generation ([#1095](https://github.com/zenstackhq/zenstack/issues/1095)) ([d11d4ba](https://github.com/zenstackhq/zenstack/commit/d11d4bade318d5a17d1a5e3860292352e25cc813)) +* prisma.d.ts is not properly saved ([#1090](https://github.com/zenstackhq/zenstack/issues/1090)) ([d3629be](https://github.com/zenstackhq/zenstack/commit/d3629bef459afc11c16461fb18621d2f77ac35cc)) + ## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21) diff --git a/packages/plugins/openapi/package.json b/packages/plugins/openapi/package.json index 314c71f1e..b4a539941 100644 --- a/packages/plugins/openapi/package.json +++ b/packages/plugins/openapi/package.json @@ -1,7 +1,7 @@ { "name": "@zenstackhq/openapi", "displayName": "ZenStack Plugin and Runtime for OpenAPI", - "version": "2.0.0-alpha.5", + "version": "2.0.0-alpha.3", "description": "ZenStack plugin and runtime supporting OpenAPI", "main": "index.js", "repository": { diff --git a/packages/plugins/swr/CHANGELOG.md b/packages/plugins/swr/CHANGELOG.md index cc2a59fdc..719164936 100644 --- a/packages/plugins/swr/CHANGELOG.md +++ b/packages/plugins/swr/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [2.0.0-alpha.3](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2024-03-09) + + +### Bug Fixes + +* clean up generation of logical prisma client ([#1082](https://github.com/zenstackhq/zenstack/issues/1082)) ([6e7993a](https://github.com/zenstackhq/zenstack/commit/6e7993afa8dde03ae12c44f198bcca04724dbc92)) +* more robust calculation of default location for code generation ([#1095](https://github.com/zenstackhq/zenstack/issues/1095)) ([d11d4ba](https://github.com/zenstackhq/zenstack/commit/d11d4bade318d5a17d1a5e3860292352e25cc813)) +* prisma.d.ts is not properly saved ([#1090](https://github.com/zenstackhq/zenstack/issues/1090)) ([d3629be](https://github.com/zenstackhq/zenstack/commit/d3629bef459afc11c16461fb18621d2f77ac35cc)) + ## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21) diff --git a/packages/plugins/swr/package.json b/packages/plugins/swr/package.json index fa22863fa..327a8dcfc 100644 --- a/packages/plugins/swr/package.json +++ b/packages/plugins/swr/package.json @@ -1,7 +1,7 @@ { "name": "@zenstackhq/swr", "displayName": "ZenStack plugin for generating SWR hooks", - "version": "2.0.0-alpha.5", + "version": "2.0.0-alpha.3", "description": "ZenStack plugin for generating SWR hooks", "main": "index.js", "repository": { diff --git a/packages/plugins/tanstack-query/CHANGELOG.md b/packages/plugins/tanstack-query/CHANGELOG.md index cc2a59fdc..719164936 100644 --- a/packages/plugins/tanstack-query/CHANGELOG.md +++ b/packages/plugins/tanstack-query/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [2.0.0-alpha.3](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2024-03-09) + + +### Bug Fixes + +* clean up generation of logical prisma client ([#1082](https://github.com/zenstackhq/zenstack/issues/1082)) ([6e7993a](https://github.com/zenstackhq/zenstack/commit/6e7993afa8dde03ae12c44f198bcca04724dbc92)) +* more robust calculation of default location for code generation ([#1095](https://github.com/zenstackhq/zenstack/issues/1095)) ([d11d4ba](https://github.com/zenstackhq/zenstack/commit/d11d4bade318d5a17d1a5e3860292352e25cc813)) +* prisma.d.ts is not properly saved ([#1090](https://github.com/zenstackhq/zenstack/issues/1090)) ([d3629be](https://github.com/zenstackhq/zenstack/commit/d3629bef459afc11c16461fb18621d2f77ac35cc)) + ## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21) diff --git a/packages/plugins/tanstack-query/package.json b/packages/plugins/tanstack-query/package.json index e4f2e548a..8dd0d15d3 100644 --- a/packages/plugins/tanstack-query/package.json +++ b/packages/plugins/tanstack-query/package.json @@ -1,7 +1,7 @@ { "name": "@zenstackhq/tanstack-query", "displayName": "ZenStack plugin for generating tanstack-query hooks", - "version": "2.0.0-alpha.5", + "version": "2.0.0-alpha.3", "description": "ZenStack plugin for generating tanstack-query hooks", "main": "index.js", "exports": { diff --git a/packages/plugins/trpc/CHANGELOG.md b/packages/plugins/trpc/CHANGELOG.md index cc2a59fdc..719164936 100644 --- a/packages/plugins/trpc/CHANGELOG.md +++ b/packages/plugins/trpc/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [2.0.0-alpha.3](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2024-03-09) + + +### Bug Fixes + +* clean up generation of logical prisma client ([#1082](https://github.com/zenstackhq/zenstack/issues/1082)) ([6e7993a](https://github.com/zenstackhq/zenstack/commit/6e7993afa8dde03ae12c44f198bcca04724dbc92)) +* more robust calculation of default location for code generation ([#1095](https://github.com/zenstackhq/zenstack/issues/1095)) ([d11d4ba](https://github.com/zenstackhq/zenstack/commit/d11d4bade318d5a17d1a5e3860292352e25cc813)) +* prisma.d.ts is not properly saved ([#1090](https://github.com/zenstackhq/zenstack/issues/1090)) ([d3629be](https://github.com/zenstackhq/zenstack/commit/d3629bef459afc11c16461fb18621d2f77ac35cc)) + ## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21) diff --git a/packages/plugins/trpc/package.json b/packages/plugins/trpc/package.json index a0ad55223..e4f8e4a05 100644 --- a/packages/plugins/trpc/package.json +++ b/packages/plugins/trpc/package.json @@ -1,7 +1,7 @@ { "name": "@zenstackhq/trpc", "displayName": "ZenStack plugin for tRPC", - "version": "2.0.0-alpha.5", + "version": "2.0.0-alpha.3", "description": "ZenStack plugin for tRPC", "main": "index.js", "repository": { diff --git a/packages/runtime/CHANGELOG.md b/packages/runtime/CHANGELOG.md index cc2a59fdc..c50b5e00b 100644 --- a/packages/runtime/CHANGELOG.md +++ b/packages/runtime/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.0.0-alpha.3](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2024-03-09) + + +### Bug Fixes + +* clean up generation of logical prisma client ([#1082](https://github.com/zenstackhq/zenstack/issues/1082)) ([6e7993a](https://github.com/zenstackhq/zenstack/commit/6e7993afa8dde03ae12c44f198bcca04724dbc92)) +* default auth without user context ([#1015](https://github.com/zenstackhq/zenstack/issues/1015)) ([e5b5a0f](https://github.com/zenstackhq/zenstack/commit/e5b5a0fee34e46bee5557229f6f5894629c6ad96)) +* more robust calculation of default location for code generation ([#1095](https://github.com/zenstackhq/zenstack/issues/1095)) ([d11d4ba](https://github.com/zenstackhq/zenstack/commit/d11d4bade318d5a17d1a5e3860292352e25cc813)) +* **polymorphism:** support `orderBy` with base fields ([#1086](https://github.com/zenstackhq/zenstack/issues/1086)) ([2e81a08](https://github.com/zenstackhq/zenstack/commit/2e81a089a1b57ebf61d25fc49300fa22f0cda06b)) +* prisma.d.ts is not properly saved ([#1090](https://github.com/zenstackhq/zenstack/issues/1090)) ([d3629be](https://github.com/zenstackhq/zenstack/commit/d3629bef459afc11c16461fb18621d2f77ac35cc)) +* several issues with using `auth()` in `[@default](https://github.com/default)` ([#1088](https://github.com/zenstackhq/zenstack/issues/1088)) ([36e515e](https://github.com/zenstackhq/zenstack/commit/36e515e485c580657b9edbfc52014f3542abfb96)) + ## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21) diff --git a/packages/runtime/package.json b/packages/runtime/package.json index 93bd0592e..c80bbca5f 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -1,7 +1,7 @@ { "name": "@zenstackhq/runtime", "displayName": "ZenStack Runtime Library", - "version": "2.0.0-alpha.5", + "version": "2.0.0-alpha.3", "description": "Runtime of ZenStack for both client-side and server-side environments.", "repository": { "type": "git", diff --git a/packages/sdk/CHANGELOG.md b/packages/sdk/CHANGELOG.md index cc2a59fdc..658872e42 100644 --- a/packages/sdk/CHANGELOG.md +++ b/packages/sdk/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [2.0.0-alpha.3](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2024-03-09) + + +### Bug Fixes + +* clean up generation of logical prisma client ([#1082](https://github.com/zenstackhq/zenstack/issues/1082)) ([6e7993a](https://github.com/zenstackhq/zenstack/commit/6e7993afa8dde03ae12c44f198bcca04724dbc92)) +* more robust calculation of default location for code generation ([#1095](https://github.com/zenstackhq/zenstack/issues/1095)) ([d11d4ba](https://github.com/zenstackhq/zenstack/commit/d11d4bade318d5a17d1a5e3860292352e25cc813)) +* prisma.d.ts is not properly saved ([#1090](https://github.com/zenstackhq/zenstack/issues/1090)) ([d3629be](https://github.com/zenstackhq/zenstack/commit/d3629bef459afc11c16461fb18621d2f77ac35cc)) +* several issues with using `auth()` in `[@default](https://github.com/default)` ([#1088](https://github.com/zenstackhq/zenstack/issues/1088)) ([36e515e](https://github.com/zenstackhq/zenstack/commit/36e515e485c580657b9edbfc52014f3542abfb96)) + ## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21) diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 11f17f3d6..5bdf1dc2b 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/sdk", - "version": "2.0.0-alpha.5", + "version": "2.0.0-alpha.3", "description": "ZenStack plugin development SDK", "main": "index.js", "scripts": { diff --git a/packages/server/CHANGELOG.md b/packages/server/CHANGELOG.md index cc2a59fdc..bb8e8938c 100644 --- a/packages/server/CHANGELOG.md +++ b/packages/server/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.0.0-alpha.3](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2024-03-09) + + +### Bug Fixes + +* more robust calculation of default location for code generation ([#1095](https://github.com/zenstackhq/zenstack/issues/1095)) ([d11d4ba](https://github.com/zenstackhq/zenstack/commit/d11d4bade318d5a17d1a5e3860292352e25cc813)) +* prisma.d.ts is not properly saved ([#1090](https://github.com/zenstackhq/zenstack/issues/1090)) ([d3629be](https://github.com/zenstackhq/zenstack/commit/d3629bef459afc11c16461fb18621d2f77ac35cc)) + ## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21) diff --git a/packages/server/package.json b/packages/server/package.json index 748b68e52..59c01026a 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/server", - "version": "2.0.0-alpha.5", + "version": "2.0.0-alpha.3", "displayName": "ZenStack Server-side Adapters", "description": "ZenStack server-side adapters", "homepage": "https://zenstack.dev", diff --git a/packages/testtools/CHANGELOG.md b/packages/testtools/CHANGELOG.md index cc2a59fdc..658872e42 100644 --- a/packages/testtools/CHANGELOG.md +++ b/packages/testtools/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [2.0.0-alpha.3](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2024-03-09) + + +### Bug Fixes + +* clean up generation of logical prisma client ([#1082](https://github.com/zenstackhq/zenstack/issues/1082)) ([6e7993a](https://github.com/zenstackhq/zenstack/commit/6e7993afa8dde03ae12c44f198bcca04724dbc92)) +* more robust calculation of default location for code generation ([#1095](https://github.com/zenstackhq/zenstack/issues/1095)) ([d11d4ba](https://github.com/zenstackhq/zenstack/commit/d11d4bade318d5a17d1a5e3860292352e25cc813)) +* prisma.d.ts is not properly saved ([#1090](https://github.com/zenstackhq/zenstack/issues/1090)) ([d3629be](https://github.com/zenstackhq/zenstack/commit/d3629bef459afc11c16461fb18621d2f77ac35cc)) +* several issues with using `auth()` in `[@default](https://github.com/default)` ([#1088](https://github.com/zenstackhq/zenstack/issues/1088)) ([36e515e](https://github.com/zenstackhq/zenstack/commit/36e515e485c580657b9edbfc52014f3542abfb96)) + ## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21) diff --git a/packages/testtools/package.json b/packages/testtools/package.json index b6ce4df2e..b4741bb63 100644 --- a/packages/testtools/package.json +++ b/packages/testtools/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/testtools", - "version": "2.0.0-alpha.5", + "version": "2.0.0-alpha.3", "description": "ZenStack Test Tools", "main": "index.js", "private": true,