@zenwave360/dsl 1.9.0-next.0 → 1.10.0-next.11.1

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022-2026 ZenWave's Authors and Contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022-2026 ZenWave's Authors and Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -68,16 +68,51 @@ const zflModel = parseZfl(zflContent);
68
68
  ```
69
69
 
70
70
  ZDL plugin option source spans are available in `model.locations` under
71
- `plugins.<plugin>.config.<option>` and `plugins.<plugin>.cliOptions.<option>`.
71
+ `pluginsList.<n>.config.<option>` and `pluginsList.<n>.cliOptions.<option>`.
72
72
  Each declaration has a span; its `.value` span covers only the value, including
73
73
  quote delimiters. A CLI flag without a value has no `.value` span. The first two
74
74
  span entries are the start offset and exclusive end offset in the original
75
75
  source, suitable for `source.slice(span[0], span[1])`. Model values are unchanged.
76
76
 
77
+ `model.pluginsList` is every plugin declaration in order. Each instance's
78
+ declaration span is `locations['pluginsList.N']`.
79
+
80
+ CLI options may also be declared directly inside `config`, before `plugins`,
81
+ for consumers that apply shared command-line defaults. They are reported in
82
+ `model.cliOptions`; their spans use `cliOptions.<option>` and
83
+ `cliOptions.<option>.value`, with no value span for a valueless flag.
84
+
77
85
  These spans are implemented in shared Kotlin source. JS consumers must rebuild
78
86
  the package with `./gradlew jsProductionExecutableCompileSync` and update their
79
87
  bundled or installed artifact; an existing JS bundle does not gain them automatically.
80
88
 
89
+ Numbers in `parseZdl` and `parseZfl` output are plain JavaScript values: an integer is a JS
90
+ `number` (for example `maxDepth 3` gives `3`), or its exact decimal string when it lies beyond
91
+ `Number.MAX_SAFE_INTEGER` (±(2^53 - 1)). Decimals stay strings (`ratio 1.25` gives `"1.25"`),
92
+ as in the JVM model. Negative literals keep their sign (`neg -2` gives `-2`).
93
+ Before 1.10.0 an integer was an opaque Kotlin `Long` object with compiler-generated field names
94
+ (`{"h2_1":3,"i2_1":0}`) and the sign of a negative literal was dropped; JS consumers that worked
95
+ around either should read the value directly. The JVM model is unchanged (`Long` and `String`).
96
+
97
+ ZDL class diagrams are available as Mermaid text, on the JVM and in JavaScript:
98
+
99
+ ```js
100
+ import { generateMermaidFromZdl } from '@zenwave360/dsl';
101
+ const mermaid = generateMermaidFromZdl(zdlContent); // starts with "classDiagram"
102
+ ```
103
+
104
+ ```kotlin
105
+ val mermaid = GenerateMermaidFromZdl().execute(zdlContent)
106
+ ```
107
+
108
+ The diagram contains aggregates with their commands, entities with their fields, enums with their
109
+ values, inputs, outputs and events, services with their commands, and relationships with their
110
+ cardinality. It contains no `click`, `link` or `callback` directives and no remote references.
111
+
112
+ The JS package loads in browsers and Web Workers as well as in Node.js: `./gradlew check`
113
+ runs `jsBrowserTest` in a headless Chromium-based browser (Karma; set `CHROME_BIN`, or a local
114
+ Chrome, Chromium or Edge is used).
115
+
81
116
  * Further reading:
82
117
  - [ZDL Domain Language Reference](https://www.zenwave360.io/docs/event-driven-design/zenwave-domain-language/)
83
118
  - [ZFL Flow Language Reference](https://www.zenwave360.io/docs/event-driven-design/zenwave-flow-language/)