Skip to content

Commit 6990656

Browse files
authored
merge dev to main (v2.4.0) (#1635)
2 parents bf2acfd + ca40e00 commit 6990656

Some content is hidden

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

52 files changed

+1035
-450
lines changed

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
auto-install-peers=true
22
git-checks=false
3+
node-linker=hoisted

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zenstack-monorepo",
3-
"version": "2.3.3",
3+
"version": "2.4.0",
44
"description": "",
55
"scripts": {
66
"build": "pnpm -r build",

packages/ide/jetbrains/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
}
1010

1111
group = "dev.zenstack"
12-
version = "2.3.3"
12+
version = "2.4.0"
1313

1414
repositories {
1515
mavenCentral()

packages/ide/jetbrains/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jetbrains",
3-
"version": "2.3.3",
3+
"version": "2.4.0",
44
"displayName": "ZenStack JetBrains IDE Plugin",
55
"description": "ZenStack JetBrains IDE plugin",
66
"homepage": "https://zenstack.dev",

packages/language/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenstackhq/language",
3-
"version": "2.3.3",
3+
"version": "2.4.0",
44
"displayName": "ZenStack modeling language compiler",
55
"description": "ZenStack modeling language compiler",
66
"homepage": "https://zenstack.dev",

packages/misc/redwood/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/redwood",
33
"displayName": "ZenStack RedwoodJS Integration",
4-
"version": "2.3.3",
4+
"version": "2.4.0",
55
"description": "CLI and runtime for integrating ZenStack with RedwoodJS projects.",
66
"repository": {
77
"type": "git",
@@ -39,17 +39,18 @@
3939
"homepage": "https://zenstack.dev",
4040
"license": "MIT",
4141
"dependencies": {
42+
"@redwoodjs/cli-helpers": "^7.7.3",
4243
"@zenstackhq/runtime": "workspace:*",
4344
"colors": "1.4.0",
44-
"ts-morph": "^16.0.0",
45-
"@redwoodjs/cli-helpers": "^6.6.0",
4645
"execa": "^5.0.0",
4746
"listr2": "^6.0.0",
47+
"semver": "^7.5.2",
4848
"terminal-link": "^2.0.0",
49+
"ts-morph": "^16.0.0",
4950
"yargs": "^17.7.2"
5051
},
5152
"devDependencies": {
52-
"@redwoodjs/graphql-server": "^6.6.0",
53+
"@redwoodjs/graphql-server": "^7.7.3",
5354
"@types/yargs": "^17.0.32",
5455
"graphql-yoga": "^5.0.2"
5556
}

packages/misc/redwood/src/commands/setup.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { getPaths, updateTomlConfig } from '@redwoodjs/cli-helpers';
1+
import { getInstalledRedwoodVersion, getPaths, updateTomlConfig } from '@redwoodjs/cli-helpers';
22
import colors from 'colors';
33
import execa from 'execa';
44
import fs from 'fs';
55
import { Listr, ListrTask } from 'listr2';
66
import path from 'path';
7+
import semver from 'semver';
78
import terminalLink from 'terminal-link';
89
import { Project, SyntaxKind, type PropertyAssignment } from 'ts-morph';
910
import type { CommandModule } from 'yargs';
@@ -47,8 +48,8 @@ function bootstrapSchema() {
4748
const pkg = JSON.parse(content);
4849
if (!pkg.zenstack) {
4950
pkg.zenstack = {
50-
schema: path.relative(apiPaths.base, zmodel),
51-
prisma: path.relative(apiPaths.base, apiPaths.dbSchema),
51+
schema: normalizePath(path.relative(apiPaths.base, zmodel)),
52+
prisma: normalizePath(path.relative(apiPaths.base, apiPaths.dbSchema)),
5253
};
5354
fs.writeFileSync(pkgJson, JSON.stringify(pkg, null, 4));
5455
}
@@ -57,6 +58,11 @@ function bootstrapSchema() {
5758
};
5859
}
5960

61+
// ensures posix path separators are used in package.json
62+
function normalizePath(_path: string) {
63+
return _path.replaceAll(path.sep, path.posix.sep);
64+
}
65+
6066
// install ZenStack GraphQLYoga plugin
6167
function installGraphQLPlugin() {
6268
return {
@@ -144,11 +150,17 @@ function installGraphQLPlugin() {
144150
if (graphQlSourcePath.endsWith('.ts')) {
145151
const typeDefPath = path.join(getPaths().api.src, 'zenstack.d.ts');
146152
if (!fs.existsSync(typeDefPath)) {
153+
const rwVersion: string = getInstalledRedwoodVersion();
154+
const contextModule =
155+
rwVersion && semver.lt(rwVersion, '7.0.0')
156+
? '@redwoodjs/graphql-server' // pre v7
157+
: '@redwoodjs/context'; // v7+
158+
147159
const typeDefSourceFile = project.createSourceFile(
148160
typeDefPath,
149-
`import type { PrismaClient } from '@prisma/client'
161+
`import type { PrismaClient } from '@zenstackhq/runtime'
150162
151-
declare module '@redwoodjs/graphql-server' {
163+
declare module '${contextModule}' {
152164
interface GlobalContext {
153165
db: PrismaClient
154166
}

packages/plugins/openapi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/openapi",
33
"displayName": "ZenStack Plugin and Runtime for OpenAPI",
4-
"version": "2.3.3",
4+
"version": "2.4.0",
55
"description": "ZenStack plugin and runtime supporting OpenAPI",
66
"main": "index.js",
77
"repository": {

packages/plugins/swr/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/swr",
33
"displayName": "ZenStack plugin for generating SWR hooks",
4-
"version": "2.3.3",
4+
"version": "2.4.0",
55
"description": "ZenStack plugin for generating SWR hooks",
66
"main": "index.js",
77
"repository": {

packages/plugins/tanstack-query/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/tanstack-query",
33
"displayName": "ZenStack plugin for generating tanstack-query hooks",
4-
"version": "2.3.3",
4+
"version": "2.4.0",
55
"description": "ZenStack plugin for generating tanstack-query hooks",
66
"main": "index.js",
77
"exports": {

0 commit comments

Comments
 (0)