Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zenstack-monorepo",
"version": "1.0.0-alpha.29",
"version": "1.0.0-alpha.30",
"description": "",
"scripts": {
"build": "pnpm -r build",
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": "1.0.0-alpha.29",
"version": "1.0.0-alpha.30",
"displayName": "ZenStack modeling language compiler",
"description": "ZenStack modeling language compiler",
"homepage": "https://zenstack.dev",
Expand Down
127 changes: 118 additions & 9 deletions packages/language/src/generated/grammar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ export const ZModelGrammar = (): Grammar => loadedZModelGrammar ?? (loadedZModel
"definition": {
"$type": "Group",
"elements": [
{
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@56"
},
"arguments": [],
"cardinality": "*"
},
{
"$type": "Keyword",
"value": "datasource"
Expand Down Expand Up @@ -156,6 +164,14 @@ export const ZModelGrammar = (): Grammar => loadedZModelGrammar ?? (loadedZModel
"definition": {
"$type": "Group",
"elements": [
{
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@56"
},
"arguments": [],
"cardinality": "*"
},
{
"$type": "Assignment",
"feature": "name",
Expand Down Expand Up @@ -211,6 +227,14 @@ export const ZModelGrammar = (): Grammar => loadedZModelGrammar ?? (loadedZModel
"definition": {
"$type": "Group",
"elements": [
{
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@56"
},
"arguments": [],
"cardinality": "*"
},
{
"$type": "Keyword",
"value": "generator"
Expand Down Expand Up @@ -263,6 +287,14 @@ export const ZModelGrammar = (): Grammar => loadedZModelGrammar ?? (loadedZModel
"definition": {
"$type": "Group",
"elements": [
{
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@56"
},
"arguments": [],
"cardinality": "*"
},
{
"$type": "Assignment",
"feature": "name",
Expand Down Expand Up @@ -318,6 +350,14 @@ export const ZModelGrammar = (): Grammar => loadedZModelGrammar ?? (loadedZModel
"definition": {
"$type": "Group",
"elements": [
{
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@56"
},
"arguments": [],
"cardinality": "*"
},
{
"$type": "Keyword",
"value": "plugin"
Expand Down Expand Up @@ -370,6 +410,14 @@ export const ZModelGrammar = (): Grammar => loadedZModelGrammar ?? (loadedZModel
"definition": {
"$type": "Group",
"elements": [
{
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@56"
},
"arguments": [],
"cardinality": "*"
},
{
"$type": "Assignment",
"feature": "name",
Expand Down Expand Up @@ -1589,6 +1637,14 @@ export const ZModelGrammar = (): Grammar => loadedZModelGrammar ?? (loadedZModel
"definition": {
"$type": "Group",
"elements": [
{
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@56"
},
"arguments": [],
"cardinality": "*"
},
{
"$type": "Keyword",
"value": "enum"
Expand Down Expand Up @@ -1639,16 +1695,29 @@ export const ZModelGrammar = (): Grammar => loadedZModelGrammar ?? (loadedZModel
"$type": "ParserRule",
"name": "EnumField",
"definition": {
"$type": "Assignment",
"feature": "name",
"operator": "=",
"terminal": {
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@53"
"$type": "Group",
"elements": [
{
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@56"
},
"arguments": [],
"cardinality": "*"
},
"arguments": []
}
{
"$type": "Assignment",
"feature": "name",
"operator": "=",
"terminal": {
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@53"
},
"arguments": []
}
}
]
},
"definesHiddenTokens": false,
"entry": false,
Expand All @@ -1663,6 +1732,14 @@ export const ZModelGrammar = (): Grammar => loadedZModelGrammar ?? (loadedZModel
"definition": {
"$type": "Group",
"elements": [
{
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@56"
},
"arguments": [],
"cardinality": "*"
},
{
"$type": "Keyword",
"value": "function"
Expand Down Expand Up @@ -1779,6 +1856,14 @@ export const ZModelGrammar = (): Grammar => loadedZModelGrammar ?? (loadedZModel
"definition": {
"$type": "Group",
"elements": [
{
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@56"
},
"arguments": [],
"cardinality": "*"
},
{
"$type": "Assignment",
"feature": "name",
Expand Down Expand Up @@ -2034,6 +2119,14 @@ export const ZModelGrammar = (): Grammar => loadedZModelGrammar ?? (loadedZModel
"definition": {
"$type": "Group",
"elements": [
{
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@56"
},
"arguments": [],
"cardinality": "*"
},
{
"$type": "Keyword",
"value": "attribute"
Expand Down Expand Up @@ -2126,6 +2219,14 @@ export const ZModelGrammar = (): Grammar => loadedZModelGrammar ?? (loadedZModel
"definition": {
"$type": "Group",
"elements": [
{
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@56"
},
"arguments": [],
"cardinality": "*"
},
{
"$type": "Assignment",
"feature": "default",
Expand Down Expand Up @@ -2323,6 +2424,14 @@ export const ZModelGrammar = (): Grammar => loadedZModelGrammar ?? (loadedZModel
"definition": {
"$type": "Group",
"elements": [
{
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@56"
},
"arguments": [],
"cardinality": "*"
},
{
"$type": "Assignment",
"feature": "decl",
Expand Down
26 changes: 13 additions & 13 deletions packages/language/src/zmodel.langium
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ AbstractDeclaration:

// datasource
DataSource:
'datasource' name=ID '{' (fields+=DataSourceField)* '}';
TRIPLE_SLASH_COMMENT* 'datasource' name=ID '{' (fields+=DataSourceField)* '}';

DataSourceField:
name=ID '=' value=(LiteralExpr|InvocationExpr);
TRIPLE_SLASH_COMMENT* name=ID '=' value=(LiteralExpr|InvocationExpr);

// generator
GeneratorDecl:
'generator' name=ID '{' (fields+=GeneratorField)* '}';
TRIPLE_SLASH_COMMENT* 'generator' name=ID '{' (fields+=GeneratorField)* '}';

GeneratorField:
name=ID '=' value=(LiteralExpr | ArrayExpr);
TRIPLE_SLASH_COMMENT* name=ID '=' value=(LiteralExpr | ArrayExpr);

// plugin
Plugin:
'plugin' name=ID '{' (fields+=PluginField)* '}';
TRIPLE_SLASH_COMMENT* 'plugin' name=ID '{' (fields+=PluginField)* '}';

PluginField:
name=ID '=' value=(LiteralExpr | ArrayExpr);
TRIPLE_SLASH_COMMENT* name=ID '=' value=(LiteralExpr | ArrayExpr);

// expression
Expression:
Expand Down Expand Up @@ -149,17 +149,17 @@ DataModelFieldType:

// enum
Enum:
'enum' name=ID '{' (fields+=EnumField)+ '}';
TRIPLE_SLASH_COMMENT* 'enum' name=ID '{' (fields+=EnumField)+ '}';

EnumField:
name=ID;
TRIPLE_SLASH_COMMENT* name=ID;

// function
FunctionDecl:
'function' name=ID '(' (params+=FunctionParam (',' params+=FunctionParam)*)? ')' ':' returnType=FunctionParamType '{' (expression=Expression)? '}';
TRIPLE_SLASH_COMMENT* 'function' name=ID '(' (params+=FunctionParam (',' params+=FunctionParam)*)? ')' ':' returnType=FunctionParamType '{' (expression=Expression)? '}';

FunctionParam:
name=ID ':' type=FunctionParamType;
TRIPLE_SLASH_COMMENT* name=ID ':' type=FunctionParamType;

FunctionParamType:
(type=ExpressionType | reference=[TypeDeclaration]) (array?='[]')?;
Expand All @@ -184,10 +184,10 @@ AttributeName returns string:

// attribute
Attribute:
'attribute' name=AttributeName '(' (params+=AttributeParam (',' params+=AttributeParam)*)? ')' (attributes+=AttributeAttribute)*;
TRIPLE_SLASH_COMMENT* 'attribute' name=AttributeName '(' (params+=AttributeParam (',' params+=AttributeParam)*)? ')' (attributes+=AttributeAttribute)*;

AttributeParam:
(default?='_')? name=ID ':' type=AttributeParamType;
TRIPLE_SLASH_COMMENT* (default?='_')? name=ID ':' type=AttributeParamType;

// FieldReference refers to fields declared in the current model
// TransitiveFieldReference refers to fields declared in the model type of the current field
Expand All @@ -200,7 +200,7 @@ DataModelFieldAttribute:
decl=[Attribute:DataModelFieldAttributeName] ('(' AttributeArgList? ')')?;

DataModelAttribute:
decl=[Attribute:DataModelAttributeName] ('(' AttributeArgList? ')')?;
TRIPLE_SLASH_COMMENT* decl=[Attribute:DataModelAttributeName] ('(' AttributeArgList? ')')?;

AttributeAttribute:
decl=[Attribute:AttributeAttributeName] ('(' AttributeArgList? ')')?;
Expand Down
2 changes: 1 addition & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zenstackhq/next",
"version": "1.0.0-alpha.29",
"version": "1.0.0-alpha.30",
"displayName": "ZenStack Next.js integration",
"description": "ZenStack Next.js integration",
"homepage": "https://zenstack.dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/react",
"displayName": "ZenStack plugin and runtime for ReactJS",
"version": "1.0.0-alpha.29",
"version": "1.0.0-alpha.30",
"description": "ZenStack plugin and runtime for ReactJS",
"main": "index.js",
"repository": {
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": "1.0.0-alpha.29",
"version": "1.0.0-alpha.30",
"description": "ZenStack plugin for tRPC",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion 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": "1.0.0-alpha.29",
"version": "1.0.0-alpha.30",
"description": "Runtime of ZenStack for both client-side and server-side environments.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion 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": "A toolkit for building secure CRUD apps with Next.js + Typescript",
"version": "1.0.0-alpha.29",
"version": "1.0.0-alpha.30",
"author": {
"name": "ZenStack Team"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zenstackhq/sdk",
"version": "1.0.0-alpha.29",
"version": "1.0.0-alpha.30",
"description": "ZenStack plugin development SDK",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test-run/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.