Skip to content

Commit b962e05

Browse files
authored
chore: refactor zmodel-code-generator and move it to sdk package (#836)
1 parent cccbc3c commit b962e05

File tree

23 files changed

+691
-354
lines changed

23 files changed

+691
-354
lines changed

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": "1.3.0",
3+
"version": "1.3.1",
44
"description": "",
55
"scripts": {
66
"build": "pnpm -r build",

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": "1.3.0",
3+
"version": "1.3.1",
44
"displayName": "ZenStack modeling language compiler",
55
"description": "ZenStack modeling language compiler",
66
"homepage": "https://zenstack.dev",

packages/language/src/generated/grammar.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,8 @@ export const ZModelGrammar = (): Grammar => loadedZModelGrammar ?? (loadedZModel
665665
"rule": {
666666
"$ref": "#/rules@15"
667667
},
668-
"arguments": []
668+
"arguments": [],
669+
"cardinality": "?"
669670
},
670671
{
671672
"$type": "Keyword",

packages/language/src/zmodel.langium

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ ArrayExpr:
5151
'[' (items+=Expression (',' items+=Expression)*)? ']';
5252

5353
ConfigInvocationExpr:
54-
name=ID ('(' ConfigInvocationArgList ')')?;
54+
name=ID ('(' ConfigInvocationArgList? ')')?;
5555

5656
fragment ConfigInvocationArgList:
5757
args+=ConfigInvocationArg (',' args+=ConfigInvocationArg)*;
@@ -67,7 +67,6 @@ ConfigExpr:
6767
LiteralExpr | InvocationExpr | ConfigArrayExpr;
6868

6969
type ReferenceTarget = FunctionParam | DataModelField | EnumField;
70-
7170
ThisExpr:
7271
value=THIS;
7372

@@ -259,7 +258,6 @@ AttributeParamType:
259258
(type=(ExpressionType | 'FieldReference' | 'TransitiveFieldReference' | 'ContextType') | reference=[TypeDeclaration:RegularID]) (array?='[' ']')? (optional?='?')?;
260259

261260
type TypeDeclaration = DataModel | Enum;
262-
263261
DataModelFieldAttribute:
264262
decl=[Attribute:DataModelFieldAttributeName] ('(' AttributeArgList? ')')?;
265263

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": "1.3.0",
4+
"version": "1.3.1",
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": "1.3.0",
4+
"version": "1.3.1",
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": "1.3.0",
4+
"version": "1.3.1",
55
"description": "ZenStack plugin for generating tanstack-query hooks",
66
"main": "index.js",
77
"exports": {

packages/plugins/trpc/package.json

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

packages/runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/runtime",
33
"displayName": "ZenStack Runtime Library",
4-
"version": "1.3.0",
4+
"version": "1.3.1",
55
"description": "Runtime of ZenStack for both client-side and server-side environments.",
66
"repository": {
77
"type": "git",

packages/schema/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 Language Tools",
55
"description": "Build scalable web apps with minimum code by defining authorization and validation rules inside the data schema that closer to the database",
6-
"version": "1.3.0",
6+
"version": "1.3.1",
77
"author": {
88
"name": "ZenStack Team"
99
},

0 commit comments

Comments
 (0)