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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<div align="center">
<a href="https://zenstack.dev">
<img src="https://user-images.githubusercontent.com/104139426/214809937-4ed30485-a683-4fea-b737-928c48e86fd7.png" style="max-width: 512px; width: 100%; height: auto; margin-bottom: 1rem;"
>
</a>
<div></div>
<a href="https://www.npmjs.com/package/zenstack">
<img src="https://img.shields.io/npm/v/zenstack">
Expand Down Expand Up @@ -99,7 +101,7 @@ The following diagram gives a high-level overview of how it works.
- [Documentation](https://zenstack.dev/docs)
- [Community chat](https://go.zenstack.dev/chat)
- [Twitter](https://twitter.com/zenstackhq)
- [Blog](https://dev.to/zenstack)
- [Blog](https://zenstack.dev/blog)

## Features

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": "1.0.0-alpha.82",
"version": "1.0.0-alpha.85",
"description": "",
"scripts": {
"build": "pnpm -r build",
Expand Down
6 changes: 3 additions & 3 deletions 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.82",
"version": "1.0.0-alpha.85",
"displayName": "ZenStack modeling language compiler",
"description": "ZenStack modeling language compiler",
"homepage": "https://zenstack.dev",
Expand All @@ -22,11 +22,11 @@
"devDependencies": {
"concurrently": "^7.4.0",
"copyfiles": "^2.4.1",
"langium-cli": "1.0.0",
"langium-cli": "1.1.0",
"rimraf": "^3.0.2",
"typescript": "^4.9.4"
},
"dependencies": {
"langium": "1.0.1"
"langium": "1.1.0"
}
}
12 changes: 10 additions & 2 deletions packages/language/src/generated/ast.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************
* This file was generated by langium-cli 1.0.0.
* This file was generated by langium-cli 1.1.0.
* DO NOT EDIT MANUALLY!
******************************************************************************/

Expand All @@ -16,7 +16,7 @@ export function isAbstractDeclaration(item: unknown): item is AbstractDeclaratio

export type AttributeAttributeName = string;

export type AttributeName = string;
export type AttributeName = AttributeAttributeName | DataModelAttributeName | DataModelFieldAttributeName;

export type BuiltinType = 'BigInt' | 'Boolean' | 'Bytes' | 'DateTime' | 'Decimal' | 'Float' | 'Int' | 'Json' | 'String';

Expand Down Expand Up @@ -785,6 +785,14 @@ export class ZModelAstReflection extends AbstractAstReflection {
]
};
}
case 'LiteralExpr': {
return {
name: 'LiteralExpr',
mandatory: [
{ name: 'value', type: 'boolean' }
]
};
}
case 'Model': {
return {
name: 'Model',
Expand Down
84 changes: 40 additions & 44 deletions packages/language/src/generated/grammar.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************
* This file was generated by langium-cli 1.0.0.
* This file was generated by langium-cli 1.1.0.
* DO NOT EDIT MANUALLY!
******************************************************************************/

Expand Down Expand Up @@ -3130,55 +3130,51 @@ export const ZModelGrammar = (): Grammar => loadedZModelGrammar ?? (loadedZModel
"types": [
{
"$type": "Type",
"typeAlternatives": [
{
"$type": "AtomType",
"refType": {
"$ref": "#/rules@35"
},
"isArray": false,
"isRef": false
},
{
"$type": "AtomType",
"refType": {
"$ref": "#/rules@30"
"name": "ReferenceTarget",
"type": {
"$type": "UnionType",
"types": [
{
"$type": "SimpleType",
"typeRef": {
"$ref": "#/rules@35"
}
},
"isArray": false,
"isRef": false
},
{
"$type": "AtomType",
"refType": {
"$ref": "#/rules@33"
{
"$type": "SimpleType",
"typeRef": {
"$ref": "#/rules@30"
}
},
"isArray": false,
"isRef": false
}
],
"name": "ReferenceTarget"
{
"$type": "SimpleType",
"typeRef": {
"$ref": "#/rules@33"
}
}
]
}
},
{
"$type": "Type",
"typeAlternatives": [
{
"$type": "AtomType",
"refType": {
"$ref": "#/rules@29"
},
"isArray": false,
"isRef": false
},
{
"$type": "AtomType",
"refType": {
"$ref": "#/rules@32"
"name": "TypeDeclaration",
"type": {
"$type": "UnionType",
"types": [
{
"$type": "SimpleType",
"typeRef": {
"$ref": "#/rules@29"
}
},
"isArray": false,
"isRef": false
}
],
"name": "TypeDeclaration"
{
"$type": "SimpleType",
"typeRef": {
"$ref": "#/rules@32"
}
}
]
}
}
],
"definesHiddenTokens": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/language/src/generated/module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************
* This file was generated by langium-cli 1.0.0.
* This file was generated by langium-cli 1.1.0.
* DO NOT EDIT MANUALLY!
******************************************************************************/

Expand Down
22 changes: 18 additions & 4 deletions packages/language/syntaxes/zmodel.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,27 @@
},
{
"name": "keyword.control.zmodel",
"match": "\\b(Any|Asc|attribute|BigInt|Boolean|Bytes|ContextType|datasource|DateTime|Decimal|Desc|enum|FieldReference|Float|function|generator|in|Int|Json|model|Null|Object|plugin|sort|String|TransitiveFieldReference)\\b"
"match": "\\b(Any|Asc|BigInt|Boolean|Bytes|ContextType|DateTime|Decimal|Desc|FieldReference|Float|Int|Json|Null|Object|String|TransitiveFieldReference|attribute|datasource|enum|function|generator|in|model|plugin|sort)\\b"
},
{
"name": "string.quoted.double.zmodel",
"begin": "\"",
"end": "\""
"end": "\"",
"patterns": [
{
"include": "#string-character-escape"
}
]
},
{
"name": "string.quoted.single.zmodel",
"begin": "'",
"end": "'"
"end": "'",
"patterns": [
{
"include": "#string-character-escape"
}
]
}
],
"repository": {
Expand Down Expand Up @@ -52,6 +62,10 @@
"name": "comment.line.zmodel"
}
]
},
"string-character-escape": {
"name": "constant.character.escape.zmodel",
"match": "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)"
}
}
}
}
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.82",
"version": "1.0.0-alpha.85",
"displayName": "ZenStack Next.js integration",
"description": "ZenStack Next.js integration",
"homepage": "https://zenstack.dev",
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": "1.0.0-alpha.82",
"version": "1.0.0-alpha.85",
"description": "ZenStack plugin and runtime supporting OpenAPI",
"main": "index.js",
"repository": {
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.82",
"version": "1.0.0-alpha.85",
"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.82",
"version": "1.0.0-alpha.85",
"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.82",
"version": "1.0.0-alpha.85",
"description": "Runtime of ZenStack for both client-side and server-side environments.",
"repository": {
"type": "git",
Expand Down
9 changes: 5 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": "A toolkit for building secure CRUD apps with Next.js + Typescript",
"version": "1.0.0-alpha.82",
"version": "1.0.0-alpha.85",
"author": {
"name": "ZenStack Team"
},
Expand Down Expand Up @@ -90,7 +90,7 @@
"colors": "1.4.0",
"commander": "^8.3.0",
"cuid": "^2.1.8",
"langium": "1.0.1",
"langium": "1.1.0",
"mixpanel": "^0.17.0",
"node-machine-id": "^1.1.12",
"ora": "^5.4.1",
Expand Down Expand Up @@ -119,6 +119,7 @@
"@types/vscode": "^1.56.0",
"@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0",
"@zenstackhq/testtools": "workspace:*",
"concurrently": "^7.4.0",
"copyfiles": "^2.4.1",
"dotenv": "^16.0.3",
Expand All @@ -134,7 +135,7 @@
"ts-node": "^10.9.1",
"tsc-alias": "^1.7.0",
"typescript": "^4.8.4",
"vsce": "^2.13.0",
"@zenstackhq/testtools": "workspace:*"
"vitest": "^0.29.7",
"vsce": "^2.13.0"
}
}
5 changes: 4 additions & 1 deletion packages/schema/tests/schema/formatter.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
/// <reference types="@types/jest" />

import { EmptyFileSystem } from 'langium';
import { expectFormatting } from 'langium/test';
import { createZModelServices } from '../../src/language-server/zmodel-module';
const services = createZModelServices({ ...EmptyFileSystem }).ZModel;
const formatting = expectFormatting(services);

describe('ZModelFormatter', () => {
it('declaration formatting', async () => {
// eslint-disable-next-line jest/no-disabled-tests
test.skip('declaration formatting', async () => {
await formatting({
before: `datasource db { provider = 'postgresql' url = env('DATABASE_URL')} generator js {provider = 'prisma-client-js'}
plugin reactHooks {provider = '@zenstackhq/react'output = 'lib/hooks'}
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.82",
"version": "1.0.0-alpha.85",
"description": "ZenStack plugin development SDK",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zenstackhq/server",
"version": "1.0.0-alpha.82",
"version": "1.0.0-alpha.85",
"displayName": "ZenStack Server-side Adapters",
"description": "ZenStack server-side adapters",
"homepage": "https://zenstack.dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/testtools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zenstackhq/testtools",
"version": "1.0.0-alpha.82",
"version": "1.0.0-alpha.85",
"description": "ZenStack Test Tools",
"main": "index.js",
"publishConfig": {
Expand Down
Loading