@zenuml/core 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/zenuml.mjs +54 -0
- package/dist/cli/zenuml.mjs.map +1 -1
- package/dist/parser/index.cjs +3 -0
- package/dist/parser/index.cjs.map +1 -0
- package/dist/parser/index.mjs +23285 -0
- package/dist/parser/index.mjs.map +1 -0
- package/dist/zenuml.esm.mjs +1753 -1729
- package/dist/zenuml.esm.mjs.map +1 -1
- package/dist/zenuml.js +482 -482
- package/dist/zenuml.js.map +1 -1
- package/package.json +18 -7
- package/types/parser/index.d.ts +37 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenuml/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -22,9 +22,10 @@
|
|
|
22
22
|
"build:lsp:worker": "bun run --bun vite build -c vite.config.lsp-worker.ts",
|
|
23
23
|
"build:lsp": "bun run build:lsp:node && bun run build:lsp:worker",
|
|
24
24
|
"lsp": "bun src/parser-langium/lsp/main.ts --stdio",
|
|
25
|
-
"build": "bun run
|
|
26
|
-
"build
|
|
27
|
-
"build:
|
|
25
|
+
"build:parser": "bun run --bun vite build -c vite.config.parser.ts",
|
|
26
|
+
"build": "bun run build:lib && bun run build:cli && bun run build:parser",
|
|
27
|
+
"build:release": "RELEASE=1 bun run build:lib && RELEASE=1 bun run build:cli && RELEASE=1 bun run build:lsp && RELEASE=1 bun run build:parser",
|
|
28
|
+
"build:analyze": "RELEASE=1 ANALYZE=1 bun run build:lib && RELEASE=1 bun run build:cli && RELEASE=1 bun run build:parser",
|
|
28
29
|
"changeset": "changeset",
|
|
29
30
|
"changeset:version": "changeset version",
|
|
30
31
|
"release": "bun run build:release && changeset publish",
|
|
@@ -80,7 +81,17 @@
|
|
|
80
81
|
}
|
|
81
82
|
},
|
|
82
83
|
"./lsp-worker": "./dist/lsp/zenuml-server.worker.js",
|
|
83
|
-
"./lsp-server": "./dist/lsp/main.js"
|
|
84
|
+
"./lsp-server": "./dist/lsp/main.js",
|
|
85
|
+
"./parser": {
|
|
86
|
+
"import": {
|
|
87
|
+
"types": "./types/parser/index.d.ts",
|
|
88
|
+
"default": "./dist/parser/index.mjs"
|
|
89
|
+
},
|
|
90
|
+
"require": {
|
|
91
|
+
"types": "./types/parser/index.d.ts",
|
|
92
|
+
"default": "./dist/parser/index.cjs"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
84
95
|
},
|
|
85
96
|
"engines": {
|
|
86
97
|
"node": ">=20"
|
|
@@ -112,7 +123,7 @@
|
|
|
112
123
|
"@changesets/changelog-github": "^0.7.0",
|
|
113
124
|
"@changesets/cli": "^2.31.0",
|
|
114
125
|
"@eslint/js": "^9.39.2",
|
|
115
|
-
"@happy-dom/global-registrator": "^
|
|
126
|
+
"@happy-dom/global-registrator": "^20.10.6",
|
|
116
127
|
"@playwright/test": "^1.57.0",
|
|
117
128
|
"@storybook/addon-docs": "^9.1.17",
|
|
118
129
|
"@storybook/addon-onboarding": "^9.1.17",
|
|
@@ -135,7 +146,7 @@
|
|
|
135
146
|
"eslint-plugin-react-refresh": "^0.4.26",
|
|
136
147
|
"eslint-plugin-storybook": "^9.1.17",
|
|
137
148
|
"globals": "^15.15.0",
|
|
138
|
-
"happy-dom": "^
|
|
149
|
+
"happy-dom": "^20.10.6",
|
|
139
150
|
"jsdom": "^26.1.0",
|
|
140
151
|
"langium": "4.2.4",
|
|
141
152
|
"langium-cli": "4.2.1",
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@zenuml/core/parser` — headless, server-safe ANTLR parsing/validation for
|
|
3
|
+
* ZenUML DSL. Unlike the default `@zenuml/core` entry (a browser/DOM bundle),
|
|
4
|
+
* this subpath imports cleanly in Node and is reentrant (safe to call
|
|
5
|
+
* repeatedly/concurrently — it does not touch any shared module state).
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export interface ErrorDetail {
|
|
9
|
+
/** 1-based line of the offending token. */
|
|
10
|
+
line: number;
|
|
11
|
+
/** 0-based column of the offending token. */
|
|
12
|
+
column: number;
|
|
13
|
+
/** ANTLR diagnostic message. */
|
|
14
|
+
msg: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ParseResult {
|
|
18
|
+
/** True when the DSL parsed with no syntax errors. */
|
|
19
|
+
pass: boolean;
|
|
20
|
+
/** Structured syntax errors (empty when `pass` is true). */
|
|
21
|
+
errorDetails: ErrorDetail[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ParseTreeResult extends ParseResult {
|
|
25
|
+
/**
|
|
26
|
+
* ANTLR `ProgContext` parse tree. ANTLR error recovery still produces a
|
|
27
|
+
* best-effort tree even when `pass` is false, so this is generally present.
|
|
28
|
+
* Typed as `unknown` — cast to the ANTLR context type if you walk it.
|
|
29
|
+
*/
|
|
30
|
+
rootContext: unknown;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Validate ZenUML DSL syntax without exposing the parse tree. */
|
|
34
|
+
export declare function validate(code: string): ParseResult;
|
|
35
|
+
|
|
36
|
+
/** Parse ZenUML DSL, returning the error-recovered tree plus structured errors. */
|
|
37
|
+
export declare function parse(code: string): ParseTreeResult;
|