@zenwave360/dsl 1.10.0 → 1.11.0-next.18.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
@@ -1,125 +1,125 @@
1
-
2
- ZenWave Domain and Flow Language
3
- =====================================
4
-
5
- [![Maven Central](https://img.shields.io/maven-central/v/io.zenwave360.dsl/dsl-kotlin.svg?label=Maven%20Central&logo=apachemaven)](https://search.maven.org/artifact/io.zenwave360.dsl/dsl-kotlin)
6
- [![build](https://github.com/ZenWave360/dsl-kotlin/actions/workflows/publish-maven-snapshots.yml/badge.svg?branch=develop)](https://github.com/ZenWave360/dsl-kotlin/actions/workflows/publish-maven-snapshots.yml)
7
- [![line coverage](https://raw.githubusercontent.com/ZenWave360/dsl-kotlin/badges/coverage.svg)](https://github.com/ZenWave360/dsl-kotlin/actions/workflows/main.yml)
8
- [![branch coverage](https://raw.githubusercontent.com/ZenWave360/dsl-kotlin/badges/branches.svg)](https://github.com/ZenWave360/dsl-kotlin/actions/workflows/main.yml)
9
- [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/ZenWave360/dsl-kotlin/blob/main/LICENSE)
10
-
11
- `dsl-kotlin` provides Kotlin Multiplatform parsers for both ZDL and ZFL.
12
-
13
- - [ZDL](https://www.zenwave360.io/docs/event-driven-design/zenwave-domain-language/) is a Domain Specific Language (DSL) for Event-Driven Architectures. With Domain Driven Design principles built-in, it can be used to map the discoveries of an [EventStorming](https://www.eventstorming.com/) session.
14
- - [ZFL](https://www.zenwave360.io/docs/event-driven-design/zenwave-flow-language/) is a flow language for modelling event-driven workflows, commands, outcomes, policies, and terminal flow states.
15
-
16
- Both languages are designed to be developer-friendly, compact, and machine-readable so they can be parsed and converted into software artifacts such as:
17
- - documentation
18
- - diagrams
19
- - API definitions like OpenAPI and AsyncAPI v2/v3
20
- - backend implementations and tests
21
-
22
- ![EventStorming ZDL](docs/EvenStorming-ZDL.png)
23
- ![ZFL Flow](https://ivangsa.com/assets/articles/arcadia-editions/zfl-flow.png)
24
-
25
- Usage:
26
-
27
- * Java:
28
-
29
- ```xml
30
- <dependency>
31
- <groupId>io.zenwave360.dsl</groupId>
32
- <artifactId>dsl-kotlin-jvm</artifactId>
33
- <version>${dsl-kotlin.version}</version>
34
- </dependency>
35
- ```
36
-
37
- ```java
38
- String zdlContent = "...";
39
- ZdlParser parser = new ZdlParser();
40
- ZdlModel model = parser.parseModel(zdlContent);
41
-
42
- String zflContent = "...";
43
- ZflParser flowParser = new ZflParser();
44
- ZflModel flowModel = flowParser.parseModel(zflContent);
45
- ```
46
-
47
- NOTE: JVM version includes working `ZdlParser` and `ZflParser` implementations compiled from the Kotlin ANTLR4 target and also the Java target parser/lexer classes used by `intellij-antlr-adapter`.
48
-
49
- * JavaScript/TypeScript:
50
-
51
- For package build and publishing instructions, see [Publishing to npm](docs/npm-publishing.md).
52
-
53
- ```bash
54
- npm install @zenwave360/dsl@next
55
- ```
56
-
57
- The `next` tag selects the opt-in prerelease train. Stable releases use `latest`.
58
-
59
- ```js
60
- import { parseZdl } from '@zenwave360/dsl';
61
- import { parseZfl } from '@zenwave360/dsl';
62
-
63
- const zdlContent = "...";
64
- const zdlModel = parseZdl(zdlContent);
65
-
66
- const zflContent = "...";
67
- const zflModel = parseZfl(zflContent);
68
- ```
69
-
70
- ZDL plugin option source spans are available in `model.locations` under
71
- `pluginsList.<n>.config.<option>` and `pluginsList.<n>.cliOptions.<option>`.
72
- Each declaration has a span; its `.value` span covers only the value, including
73
- quote delimiters. A CLI flag without a value has no `.value` span. The first two
74
- span entries are the start offset and exclusive end offset in the original
75
- source, suitable for `source.slice(span[0], span[1])`. Model values are unchanged.
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
-
85
- These spans are implemented in shared Kotlin source. JS consumers must rebuild
86
- the package with `./gradlew jsProductionExecutableCompileSync` and update their
87
- bundled or installed artifact; an existing JS bundle does not gain them automatically.
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
- The repository builds three modules:
98
-
99
- | Module | Maven artifact | Content |
100
- | --- | --- | --- |
101
- | `dsl-kotlin` | `io.zenwave360.dsl:dsl-kotlin` | ZDL and ZFL parsers, semantic models, event flow view models; npm `@zenwave360/dsl` |
102
- | `dsl-views` | `io.zenwave360.dsl:dsl-views` | Mermaid diagrams from ZDL and ZFL models: class diagram, flows, and the architecture of several ZDL modules; see [dsl-views/README.md](dsl-views/README.md) |
103
- | `dsl-docs` | `io.zenwave360.dsl:dsl-docs` | Markdown documentation with those diagrams, from ZDL, ZFL, OpenAPI and AsyncAPI files; see [dsl-docs/README.md](dsl-docs/README.md) |
104
-
105
- ZDL class diagrams and ZFL flowcharts and sequence diagrams are Mermaid text from `dsl-views`:
106
-
107
- ```kotlin
108
- val classDiagram = GenerateMermaidFromZdl().execute(zdlContent)
109
- val flowDiagrams = GenerateMermaidFromZfl().execute(zflContent)
110
- ```
111
-
112
- The class diagram contains aggregates with their commands, entities with their fields, enums with their
113
- values, inputs, outputs and events, services with their commands, and relationships with their
114
- cardinality. It contains no `click`, `link` or `callback` directives and no remote references.
115
- `dsl-views` and `dsl-docs` are not published to npm yet.
116
-
117
- The JS package loads in browsers and Web Workers as well as in Node.js: `./gradlew check`
118
- runs `jsBrowserTest` in a headless Chromium-based browser (Karma; set `CHROME_BIN`, or a local
119
- Chrome, Chromium or Edge is used).
120
-
121
- * Further reading:
122
- - [ZDL Domain Language Reference](https://www.zenwave360.io/docs/event-driven-design/zenwave-domain-language/)
123
- - [ZFL Flow Language Reference](https://www.zenwave360.io/docs/event-driven-design/zenwave-flow-language/)
124
- - [ZenWave SDK](https://zenwave360.github.io/zenwave-sdk/)
125
- - [ZenWave Editor for IntelliJ](https://zenwave360.github.io/plugin/)
1
+
2
+ ZenWave Domain and Flow Language
3
+ =====================================
4
+
5
+ [![Maven Central](https://img.shields.io/maven-central/v/io.zenwave360.dsl/dsl-kotlin.svg?label=Maven%20Central&logo=apachemaven)](https://search.maven.org/artifact/io.zenwave360.dsl/dsl-kotlin)
6
+ [![build](https://github.com/ZenWave360/dsl-kotlin/actions/workflows/publish-maven-snapshots.yml/badge.svg?branch=develop)](https://github.com/ZenWave360/dsl-kotlin/actions/workflows/publish-maven-snapshots.yml)
7
+ [![line coverage](https://raw.githubusercontent.com/ZenWave360/dsl-kotlin/badges/coverage.svg)](https://github.com/ZenWave360/dsl-kotlin/actions/workflows/main.yml)
8
+ [![branch coverage](https://raw.githubusercontent.com/ZenWave360/dsl-kotlin/badges/branches.svg)](https://github.com/ZenWave360/dsl-kotlin/actions/workflows/main.yml)
9
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/ZenWave360/dsl-kotlin/blob/main/LICENSE)
10
+
11
+ `dsl-kotlin` provides Kotlin Multiplatform parsers for both ZDL and ZFL.
12
+
13
+ - [ZDL](https://www.zenwave360.io/docs/event-driven-design/zenwave-domain-language/) is a Domain Specific Language (DSL) for Event-Driven Architectures. With Domain Driven Design principles built-in, it can be used to map the discoveries of an [EventStorming](https://www.eventstorming.com/) session.
14
+ - [ZFL](https://www.zenwave360.io/docs/event-driven-design/zenwave-flow-language/) is a flow language for modelling event-driven workflows, commands, outcomes, policies, and terminal flow states.
15
+
16
+ Both languages are designed to be developer-friendly, compact, and machine-readable so they can be parsed and converted into software artifacts such as:
17
+ - documentation
18
+ - diagrams
19
+ - API definitions like OpenAPI and AsyncAPI v2/v3
20
+ - backend implementations and tests
21
+
22
+ ![EventStorming ZDL](docs/EvenStorming-ZDL.png)
23
+ ![ZFL Flow](https://ivangsa.com/assets/articles/arcadia-editions/zfl-flow.png)
24
+
25
+ Usage:
26
+
27
+ * Java:
28
+
29
+ ```xml
30
+ <dependency>
31
+ <groupId>io.zenwave360.dsl</groupId>
32
+ <artifactId>dsl-kotlin-jvm</artifactId>
33
+ <version>${dsl-kotlin.version}</version>
34
+ </dependency>
35
+ ```
36
+
37
+ ```java
38
+ String zdlContent = "...";
39
+ ZdlParser parser = new ZdlParser();
40
+ ZdlModel model = parser.parseModel(zdlContent);
41
+
42
+ String zflContent = "...";
43
+ ZflParser flowParser = new ZflParser();
44
+ ZflModel flowModel = flowParser.parseModel(zflContent);
45
+ ```
46
+
47
+ NOTE: JVM version includes working `ZdlParser` and `ZflParser` implementations compiled from the Kotlin ANTLR4 target and also the Java target parser/lexer classes used by `intellij-antlr-adapter`.
48
+
49
+ * JavaScript/TypeScript:
50
+
51
+ For package build and publishing instructions, see [Publishing to npm](docs/npm-publishing.md).
52
+
53
+ ```bash
54
+ npm install @zenwave360/dsl@next
55
+ ```
56
+
57
+ The `next` tag selects the opt-in prerelease train. Stable releases use `latest`.
58
+
59
+ ```js
60
+ import { parseZdl } from '@zenwave360/dsl';
61
+ import { parseZfl } from '@zenwave360/dsl';
62
+
63
+ const zdlContent = "...";
64
+ const zdlModel = parseZdl(zdlContent);
65
+
66
+ const zflContent = "...";
67
+ const zflModel = parseZfl(zflContent);
68
+ ```
69
+
70
+ ZDL plugin option source spans are available in `model.locations` under
71
+ `pluginsList.<n>.config.<option>` and `pluginsList.<n>.cliOptions.<option>`.
72
+ Each declaration has a span; its `.value` span covers only the value, including
73
+ quote delimiters. A CLI flag without a value has no `.value` span. The first two
74
+ span entries are the start offset and exclusive end offset in the original
75
+ source, suitable for `source.slice(span[0], span[1])`. Model values are unchanged.
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
+
85
+ These spans are implemented in shared Kotlin source. JS consumers must rebuild
86
+ the package with `./gradlew jsProductionExecutableCompileSync` and update their
87
+ bundled or installed artifact; an existing JS bundle does not gain them automatically.
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
+ The repository builds three modules:
98
+
99
+ | Module | Maven artifact | Content |
100
+ | --- | --- | --- |
101
+ | `dsl-kotlin` | `io.zenwave360.dsl:dsl-kotlin` | ZDL and ZFL parsers, semantic models, event flow view models; npm `@zenwave360/dsl` |
102
+ | `dsl-views` | `io.zenwave360.dsl:dsl-views` | Mermaid diagrams from ZDL and ZFL models: class diagram, flows, and the architecture of several ZDL modules; see [dsl-views/README.md](dsl-views/README.md) |
103
+ | `dsl-docs` | `io.zenwave360.dsl:dsl-docs` | Markdown documentation with those diagrams, from ZDL, ZFL, OpenAPI and AsyncAPI files; see [dsl-docs/README.md](dsl-docs/README.md) |
104
+
105
+ ZDL class diagrams and ZFL flowcharts and sequence diagrams are Mermaid text from `dsl-views`:
106
+
107
+ ```kotlin
108
+ val classDiagram = GenerateMermaidFromZdl().execute(zdlContent)
109
+ val flowDiagrams = GenerateMermaidFromZfl().execute(zflContent)
110
+ ```
111
+
112
+ The class diagram contains aggregates with their commands, entities with their fields, enums with their
113
+ values, inputs, outputs and events, services with their commands, and relationships with their
114
+ cardinality. It contains no `click`, `link` or `callback` directives and no remote references.
115
+ `dsl-views` and `dsl-docs` are not published to npm yet.
116
+
117
+ The JS package loads in browsers and Web Workers as well as in Node.js: `./gradlew check`
118
+ runs `jsBrowserTest` in a headless Chromium-based browser (Karma; set `CHROME_BIN`, or a local
119
+ Chrome, Chromium or Edge is used).
120
+
121
+ * Further reading:
122
+ - [ZDL Domain Language Reference](https://www.zenwave360.io/docs/event-driven-design/zenwave-domain-language/)
123
+ - [ZFL Flow Language Reference](https://www.zenwave360.io/docs/event-driven-design/zenwave-flow-language/)
124
+ - [ZenWave SDK](https://zenwave360.github.io/zenwave-sdk/)
125
+ - [ZenWave Editor for IntelliJ](https://zenwave360.github.io/plugin/)