Skip to content

Commit

Permalink
merge dev to main (v2.0.1) (#1384)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymc9 authored Apr 26, 2024
2 parents 2d4f330 + 7a15948 commit 3291c6e
Show file tree
Hide file tree
Showing 33 changed files with 225 additions and 158 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**

- ZenStack version: [e.g., 1.0.0-alpha.50]
- Prisma version: [e.g., 4.10.0]
- ZenStack version: [e.g., 2.0.0]
- Prisma version: [e.g., 5.7.0]
- Database type: [e.g. Postgresql]

**Additional context**
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ env:
DO_NOT_TRACK: '1'

on:
merge_group:
push:
branches:
- main
- dev
- release/*
- v2
pull_request:
branches:
- main
- dev
- release/*
- v2

permissions:
contents: read
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
name: Security - CodeQL

on:
merge_group:
push:
branches:
- main
- dev
- release/*
- v2
pull_request:
branches:
- main
- dev
- release/*
- v2
schedule:
- cron: '0 0 * * 1'

Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ env:
DO_NOT_TRACK: '1'

on:
merge_group:
push:
branches:
- main
- dev
- release/*
- v2
pull_request:
branches:
- main
- dev
- release/*
- v2

permissions:
contents: read
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/regression-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ env:
DO_NOT_TRACK: '1'

on:
merge_group:
push:
branches:
- main
- dev
- release/*
- v2
pull_request:
branches:
- main
- dev
- release/*
- v2

permissions:
contents: read
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ The following diagram gives a high-level architecture overview of ZenStack.

- [Custom attributes and functions](https://zenstack.dev/docs/reference/zmodel-language#custom-attributes-and-functions)
- [Multi-file schema and model inheritance](https://zenstack.dev/docs/guides/multiple-schema)
- [Polymorphic Relations](https://zenstack.dev/docs/guides/polymorphism)
- Strong-typed JSON field (coming soon)
- Polymorphism (future)
- 🙋🏻 [Request for an extension](https://discord.gg/Ykhr738dUe)

## Examples
Expand Down Expand Up @@ -213,6 +213,7 @@ Check out the [Multi-tenant Todo App](https://zenstack-todo.vercel.app/) for a r
- [Nuxt V3 + TanStack Query](https://github.com/zenstackhq/docs-tutorial-nuxt)
- [SvelteKit](https://github.com/zenstackhq/docs-tutorial-sveltekit)
- [Remix](https://github.com/zenstackhq/docs-tutorial-remix)
- [NestJS Backend API](https://github.com/zenstackhq/docs-tutorial-nestjs)
- [Express Backend API](https://github.com/zenstackhq/docs-tutorial-express)
- [Clerk Integration](https://github.com/zenstackhq/docs-tutorial-clerk)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zenstack-monorepo",
"version": "2.0.0",
"version": "2.0.1",
"description": "",
"scripts": {
"build": "pnpm -r build",
Expand Down
20 changes: 4 additions & 16 deletions packages/ide/jetbrains/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
# Changelog

## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21)


### Miscellaneous Chores

* release 2.0.0-alpha.2 ([f40d7e3](https://github.com/zenstackhq/zenstack/commit/f40d7e3718d4210137a2e131d28b5491d065b914))

## [Unreleased]
### Added
- Added support to complex usage of `@@index` attribute like `@@index([content(ops: raw("gin_trgm_ops"))], type: Gin)`.
### Fixed
- Fixed several ZModel validation issues related to model inheritance.
- ZenStack V2 release!

## 1.7.0
## 1.11.0
### Added

- Added support to complex usage of `@@index` attribute like `@@index([content(ops: raw("gin_trgm_ops"))], type: Gin)`.

- Added support to complex usage of `@@index` attribute like `@@index([content(ops: raw("gin_trgm_ops"))], type: Gin)`.
### Fixed

- Fixed several ZModel validation issues related to model inheritance.
- Fixed several ZModel validation issues related to model inheritance.

## 1.7.0

Expand Down
2 changes: 1 addition & 1 deletion packages/ide/jetbrains/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = "dev.zenstack"
version = "2.0.0"
version = "2.0.1"

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion packages/ide/jetbrains/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jetbrains",
"version": "2.0.0",
"version": "2.0.1",
"displayName": "ZenStack JetBrains IDE Plugin",
"description": "ZenStack JetBrains IDE plugin",
"homepage": "https://zenstack.dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/language/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zenstackhq/language",
"version": "2.0.0",
"version": "2.0.1",
"displayName": "ZenStack modeling language compiler",
"description": "ZenStack modeling language compiler",
"homepage": "https://zenstack.dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/misc/redwood/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/redwood",
"displayName": "ZenStack RedwoodJS Integration",
"version": "2.0.0",
"version": "2.0.1",
"description": "CLI and runtime for integrating ZenStack with RedwoodJS projects.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/openapi/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/openapi",
"displayName": "ZenStack Plugin and Runtime for OpenAPI",
"version": "2.0.0",
"version": "2.0.1",
"description": "ZenStack plugin and runtime supporting OpenAPI",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/swr/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/swr",
"displayName": "ZenStack plugin for generating SWR hooks",
"version": "2.0.0",
"version": "2.0.1",
"description": "ZenStack plugin for generating SWR hooks",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/tanstack-query/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/tanstack-query",
"displayName": "ZenStack plugin for generating tanstack-query hooks",
"version": "2.0.0",
"version": "2.0.1",
"description": "ZenStack plugin for generating tanstack-query hooks",
"main": "index.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/trpc/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/trpc",
"displayName": "ZenStack plugin for tRPC",
"version": "2.0.0",
"version": "2.0.1",
"description": "ZenStack plugin for tRPC",
"main": "index.js",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/trpc/tests/projects/t3-trpc-v10/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"start": "next start"
},
"dependencies": {
"@prisma/client": "5.12.0",
"@prisma/client": "^5.13.0",
"@t3-oss/env-nextjs": "^0.7.1",
"@tanstack/react-query": "^4.36.1",
"@trpc/client": "^10.43.6",
Expand All @@ -35,7 +35,7 @@
"@typescript-eslint/parser": "^6.11.0",
"eslint": "^8.54.0",
"eslint-config-next": "^14.0.4",
"prisma": "5.12.0",
"prisma": "^5.13.0",
"typescript": "^5.1.6"
},
"ct3aMetadata": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,6 @@ export interface ClientType<AppRouter extends AnyRouter, Context = AppRouter['_d
>;

};
createMany: {
useMutation: <T extends Prisma.PostCreateManyArgs>(
opts?: UseTRPCMutationOptions<
Prisma.PostCreateManyArgs,
TRPCClientErrorLike<AppRouter>,
Prisma.BatchPayload,
Context
>,
) => Omit<
UseTRPCMutationResult<
Prisma.BatchPayload,
TRPCClientErrorLike<AppRouter>,
Prisma.SelectSubset<T, Prisma.PostCreateManyArgs>,
Context
>,
'mutateAsync'
> & {
mutateAsync: <T extends Prisma.PostCreateManyArgs>(
variables: T,
opts?: UseTRPCMutationOptions<T, TRPCClientErrorLike<AppRouter>, Prisma.BatchPayload, Context>,
) => Promise<Prisma.BatchPayload>;
};
};
create: {

useMutation: <T extends Prisma.PostCreateArgs>(opts?: UseTRPCMutationOptions<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,6 @@ export interface ClientType<AppRouter extends AnyRouter, Context = AppRouter['_d
>;

};
createMany: {
useMutation: <T extends Prisma.UserCreateManyArgs>(
opts?: UseTRPCMutationOptions<
Prisma.UserCreateManyArgs,
TRPCClientErrorLike<AppRouter>,
Prisma.BatchPayload,
Context
>,
) => Omit<
UseTRPCMutationResult<
Prisma.BatchPayload,
TRPCClientErrorLike<AppRouter>,
Prisma.SelectSubset<T, Prisma.UserCreateManyArgs>,
Context
>,
'mutateAsync'
> & {
mutateAsync: <T extends Prisma.UserCreateManyArgs>(
variables: T,
opts?: UseTRPCMutationOptions<T, TRPCClientErrorLike<AppRouter>, Prisma.BatchPayload, Context>,
) => Promise<Prisma.BatchPayload>;
};
};
create: {

useMutation: <T extends Prisma.UserCreateArgs>(opts?: UseTRPCMutationOptions<
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/runtime",
"displayName": "ZenStack Runtime Library",
"version": "2.0.0",
"version": "2.0.1",
"description": "Runtime of ZenStack for both client-side and server-side environments.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -92,7 +92,7 @@
"zod-validation-error": "^1.5.0"
},
"peerDependencies": {
"@prisma/client": "5.0.0 - 5.12.x"
"@prisma/client": "5.0.0 - 5.13.x"
},
"author": {
"name": "ZenStack Team"
Expand Down
8 changes: 4 additions & 4 deletions packages/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publisher": "zenstack",
"displayName": "ZenStack Language Tools",
"description": "Build scalable web apps with minimum code by defining authorization and validation rules inside the data schema that closer to the database",
"version": "2.0.0",
"version": "2.0.1",
"author": {
"name": "ZenStack Team"
},
Expand Down Expand Up @@ -122,10 +122,10 @@
"zod-validation-error": "^1.5.0"
},
"peerDependencies": {
"prisma": "5.0.0 - 5.12.x"
"prisma": "5.0.0 - 5.13.x"
},
"devDependencies": {
"@prisma/client": "5.12.0",
"@prisma/client": "^5.13.0",
"@types/async-exit-hook": "^2.0.0",
"@types/pluralize": "^0.0.29",
"@types/semver": "^7.3.13",
Expand All @@ -137,7 +137,7 @@
"@zenstackhq/runtime": "workspace:*",
"dotenv": "^16.0.3",
"esbuild": "^0.15.12",
"prisma": "5.12.0",
"prisma": "^5.13.0",
"renamer": "^4.0.0",
"tmp": "^0.2.1",
"tsc-alias": "^1.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/src/language-server/zmodel-code-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class ZModelCodeActionProvider implements CodeActionProvider {

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const endOffset = oppositeModel.$cstNode!.end - 1;
const position = document.textDocument.positionAt(endOffset);
const position = targetDocument.textDocument.positionAt(endOffset);

return {
title: `Add opposite relation fields on ${oppositeModel.name}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,15 @@ export class ExpressionWriter {
}

private isFutureMemberAccess(expr: Expression): expr is MemberAccessExpr {
return isMemberAccessExpr(expr) && isFutureExpr(expr.operand);
if (!isMemberAccessExpr(expr)) {
return false;
}

if (isFutureExpr(expr.operand)) {
return true;
}

return this.isFutureMemberAccess(expr.operand);
}

private requireIdFields(dataModel: DataModel) {
Expand Down
12 changes: 8 additions & 4 deletions packages/schema/src/utils/ast-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,19 @@ function resolveTransitiveImportsInternal(
documents: LangiumDocuments,
model: Model,
initialModel = model,
visited: Set<URI> = new Set(),
visited: Set<string> = new Set(),
models: Set<Model> = new Set()
): Model[] {
const doc = getDocument(model);
if (initialModel !== model) {
const initialDoc = getDocument(initialModel);

if (initialDoc.uri.fsPath.toLowerCase() !== doc.uri.fsPath.toLowerCase()) {
models.add(model);
}
if (!visited.has(doc.uri)) {
visited.add(doc.uri);

const normalizedPath = doc.uri.fsPath.toLowerCase();
if (!visited.has(normalizedPath)) {
visited.add(normalizedPath);
for (const imp of model.imports) {
const importedModel = resolveImport(documents, imp);
if (importedModel) {
Expand Down
Loading

0 comments on commit 3291c6e

Please sign in to comment.