@zenuml/core 4.0.0 → 4.2.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 +110 -51
- package/dist/parser/index.cjs +3 -0
- package/dist/parser/index.mjs +23237 -0
- package/dist/zenuml.esm.mjs +3817 -3784
- package/dist/zenuml.js +500 -500
- package/package.json +23 -8
- package/types/parser/index.d.ts +44 -0
- package/dist/CNAME.txt +0 -1
- package/dist/cli/zenuml.mjs.map +0 -1
- package/dist/cloud-icons-eHuugVSv.js.map +0 -1
- package/dist/embed-container-demo.html +0 -65
- package/dist/favicon.ico +0 -0
- package/dist/fonts/MS Sans Serif.ttf +0 -0
- package/dist/test-chinese.html +0 -202
- package/dist/vendor/codemirror/codemirror.min.css +0 -1
- package/dist/vendor/codemirror/codemirror.min.js +0 -8
- package/dist/vendor/codemirror/material-darker.min.css +0 -1
- package/dist/vendor/highlightjs/github-dark.min.css +0 -7
- package/dist/vendor/tailwindcss/tailwindcss.js +0 -83
- package/dist/vite.svg +0 -1
- package/dist/zenuml.esm.mjs.map +0 -1
- package/dist/zenuml.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenuml/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"dist/",
|
|
11
|
-
"types/"
|
|
11
|
+
"types/",
|
|
12
|
+
"!dist/**/*.map"
|
|
12
13
|
],
|
|
13
14
|
"scripts": {
|
|
14
15
|
"dev": "vite dev --port 14000 --host 0.0.0.0",
|
|
@@ -22,13 +23,15 @@
|
|
|
22
23
|
"build:lsp:worker": "bun run --bun vite build -c vite.config.lsp-worker.ts",
|
|
23
24
|
"build:lsp": "bun run build:lsp:node && bun run build:lsp:worker",
|
|
24
25
|
"lsp": "bun src/parser-langium/lsp/main.ts --stdio",
|
|
25
|
-
"build": "bun run
|
|
26
|
-
"build
|
|
27
|
-
"build:
|
|
26
|
+
"build:parser": "bun run --bun vite build -c vite.config.parser.ts",
|
|
27
|
+
"build": "bun run build:lib && bun run build:cli && bun run build:parser",
|
|
28
|
+
"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",
|
|
29
|
+
"build:analyze": "RELEASE=1 ANALYZE=1 bun run build:lib && RELEASE=1 bun run build:cli && RELEASE=1 bun run build:parser",
|
|
28
30
|
"changeset": "changeset",
|
|
29
31
|
"changeset:version": "changeset version",
|
|
30
32
|
"release": "bun run build:release && changeset publish",
|
|
31
33
|
"test": "bun test src test/unit",
|
|
34
|
+
"typecheck": "tsc -b",
|
|
32
35
|
"parity:dualrun": "bun scripts/parity/dualrun-diff.mjs",
|
|
33
36
|
"pw": "playwright test --reporter=list",
|
|
34
37
|
"pw:ci": "playwright test",
|
|
@@ -80,7 +83,17 @@
|
|
|
80
83
|
}
|
|
81
84
|
},
|
|
82
85
|
"./lsp-worker": "./dist/lsp/zenuml-server.worker.js",
|
|
83
|
-
"./lsp-server": "./dist/lsp/main.js"
|
|
86
|
+
"./lsp-server": "./dist/lsp/main.js",
|
|
87
|
+
"./parser": {
|
|
88
|
+
"import": {
|
|
89
|
+
"types": "./types/parser/index.d.ts",
|
|
90
|
+
"default": "./dist/parser/index.mjs"
|
|
91
|
+
},
|
|
92
|
+
"require": {
|
|
93
|
+
"types": "./types/parser/index.d.ts",
|
|
94
|
+
"default": "./dist/parser/index.cjs"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
84
97
|
},
|
|
85
98
|
"engines": {
|
|
86
99
|
"node": ">=20"
|
|
@@ -112,7 +125,7 @@
|
|
|
112
125
|
"@changesets/changelog-github": "^0.7.0",
|
|
113
126
|
"@changesets/cli": "^2.31.0",
|
|
114
127
|
"@eslint/js": "^9.39.2",
|
|
115
|
-
"@happy-dom/global-registrator": "^
|
|
128
|
+
"@happy-dom/global-registrator": "^20.10.6",
|
|
116
129
|
"@playwright/test": "^1.57.0",
|
|
117
130
|
"@storybook/addon-docs": "^9.1.17",
|
|
118
131
|
"@storybook/addon-onboarding": "^9.1.17",
|
|
@@ -120,10 +133,12 @@
|
|
|
120
133
|
"@testing-library/jest-dom": "^6.9.1",
|
|
121
134
|
"@testing-library/react": "^16.3.1",
|
|
122
135
|
"@types/antlr4": "~4.11.6",
|
|
136
|
+
"@types/bun": "^1.3.14",
|
|
123
137
|
"@types/color-string": "^1.5.5",
|
|
124
138
|
"@types/jsdom": "^21.1.7",
|
|
125
139
|
"@types/marked": "^4.3.2",
|
|
126
140
|
"@types/node": "^22.19.3",
|
|
141
|
+
"@types/pngjs": "^6.0.5",
|
|
127
142
|
"@types/react": "^19.2.7",
|
|
128
143
|
"@types/react-dom": "^19.2.3",
|
|
129
144
|
"@vitejs/plugin-react": "^4.7.0",
|
|
@@ -135,7 +150,7 @@
|
|
|
135
150
|
"eslint-plugin-react-refresh": "^0.4.26",
|
|
136
151
|
"eslint-plugin-storybook": "^9.1.17",
|
|
137
152
|
"globals": "^15.15.0",
|
|
138
|
-
"happy-dom": "^
|
|
153
|
+
"happy-dom": "^20.10.6",
|
|
139
154
|
"jsdom": "^26.1.0",
|
|
140
155
|
"langium": "4.2.4",
|
|
141
156
|
"langium-cli": "4.2.1",
|
|
@@ -0,0 +1,44 @@
|
|
|
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 `validate`/`parse` are reentrant:
|
|
5
|
+
* each call builds its own lexer/parser/error listener, so calls are safe to
|
|
6
|
+
* make repeatedly and concurrently.
|
|
7
|
+
*
|
|
8
|
+
* Import-time side effect: loading this module applies ZenUML's ANTLR prototype
|
|
9
|
+
* augmentation (methods such as `getFormattedText` are patched onto
|
|
10
|
+
* `antlr4.ParserRuleContext.prototype`). This is a one-time, process-wide
|
|
11
|
+
* mutation of the `antlr4` package you have installed — harmless on its own,
|
|
12
|
+
* but relevant if another library in the same process also depends on `antlr4`.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export interface ErrorDetail {
|
|
16
|
+
/** 1-based line of the offending token. */
|
|
17
|
+
line: number;
|
|
18
|
+
/** 0-based column of the offending token. */
|
|
19
|
+
column: number;
|
|
20
|
+
/** ANTLR diagnostic message. */
|
|
21
|
+
msg: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ParseResult {
|
|
25
|
+
/** True when the DSL parsed with no syntax errors. */
|
|
26
|
+
pass: boolean;
|
|
27
|
+
/** Structured syntax errors (empty when `pass` is true). */
|
|
28
|
+
errorDetails: ErrorDetail[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ParseTreeResult extends ParseResult {
|
|
32
|
+
/**
|
|
33
|
+
* ANTLR `ProgContext` parse tree. ANTLR error recovery still produces a
|
|
34
|
+
* best-effort tree even when `pass` is false, so this is generally present.
|
|
35
|
+
* Typed as `unknown` — cast to the ANTLR context type if you walk it.
|
|
36
|
+
*/
|
|
37
|
+
rootContext: unknown;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Validate ZenUML DSL syntax without exposing the parse tree. */
|
|
41
|
+
export declare function validate(code: string): ParseResult;
|
|
42
|
+
|
|
43
|
+
/** Parse ZenUML DSL, returning the error-recovered tree plus structured errors. */
|
|
44
|
+
export declare function parse(code: string): ParseTreeResult;
|
package/dist/CNAME.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
embed-viewer.zenuml.com
|