@zenuml/core 3.50.1 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenuml/core",
3
- "version": "3.50.1",
3
+ "version": "4.1.0",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -22,9 +22,13 @@
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 build:lib && bun run build:cli",
26
- "build:release": "RELEASE=1 bun run build:lib && RELEASE=1 bun run build:cli && RELEASE=1 bun run build:lsp",
27
- "build:analyze": "RELEASE=1 ANALYZE=1 bun run build:lib && RELEASE=1 bun run build:cli",
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",
29
+ "changeset": "changeset",
30
+ "changeset:version": "changeset version",
31
+ "release": "bun run build:release && changeset publish",
28
32
  "test": "bun test src test/unit",
29
33
  "parity:dualrun": "bun scripts/parity/dualrun-diff.mjs",
30
34
  "pw": "playwright test --reporter=list",
@@ -77,7 +81,17 @@
77
81
  }
78
82
  },
79
83
  "./lsp-worker": "./dist/lsp/zenuml-server.worker.js",
80
- "./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
+ }
81
95
  },
82
96
  "engines": {
83
97
  "node": ">=20"
@@ -106,8 +120,10 @@
106
120
  "tailwind-merge": "^3.4.0"
107
121
  },
108
122
  "devDependencies": {
123
+ "@changesets/changelog-github": "^0.7.0",
124
+ "@changesets/cli": "^2.31.0",
109
125
  "@eslint/js": "^9.39.2",
110
- "@happy-dom/global-registrator": "^18.0.1",
126
+ "@happy-dom/global-registrator": "^20.10.6",
111
127
  "@playwright/test": "^1.57.0",
112
128
  "@storybook/addon-docs": "^9.1.17",
113
129
  "@storybook/addon-onboarding": "^9.1.17",
@@ -130,7 +146,7 @@
130
146
  "eslint-plugin-react-refresh": "^0.4.26",
131
147
  "eslint-plugin-storybook": "^9.1.17",
132
148
  "globals": "^15.15.0",
133
- "happy-dom": "^18.0.1",
149
+ "happy-dom": "^20.10.6",
134
150
  "jsdom": "^26.1.0",
135
151
  "langium": "4.2.4",
136
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;