Skip to content

Commit 5db3284

Browse files
committed
zdl-kotlin: working jvm and js versions
1 parent bded313 commit 5db3284

File tree

2 files changed

+50
-4
lines changed

2 files changed

+50
-4
lines changed

README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
> **Work in Progress**: This repository is a migration attempt to Kotlin Multiplatform.
3+
> **Work in Progress**: Migration to kotlin multiplatform from the original [zdl-jvm](https://github.com/ZenWave360/zdl-jvm) repository.
44
55
ZenWave Domain Model Language
66
=====================================
@@ -10,15 +10,44 @@ ZenWave Domain Model Language
1010
[![coverage](https://raw.githubusercontent.com/ZenWave360/zdl-kotlin/badges/coverage.svg)](https://github.com/ZenWave360/zdl-kotlin/actions/workflows/main.yml)
1111
[![GitHub](https://img.shields.io/github/license/ZenWave360/zdl-kotlin)](https://github.com/ZenWave360/zdl-kotlin/blob/main/LICENSE)
1212

13-
> Since version 1.3.0 groupId was changed to `io.zenwave360.sdk`
14-
1513
ZDL 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.
1614

1715
- Designed to be developer friendly, with a simple and compact syntax.
1816
- It retains the language of the business process discoveries found in Event-Storming sessions.
1917
- And because it's machine-friendly it can be parsed and converted into multiple software artifacts like:
2018
- documentation, drawings, API definitions like OpenAPI and AsyncAPI v2/v3 and multiple backend implementations and its tests.
2119

20+
Usage:
21+
22+
* Java:
23+
24+
```xml
25+
<dependency>
26+
<groupId>io.zenwave360.sdk</groupId>
27+
<artifactId>zdl-kotlin-jvm</artifactId>
28+
<version>${zdl-kotlin.version}</version>
29+
</dependency>
30+
```
31+
32+
```java
33+
String zdlContent = "...";
34+
ZdlParser parser = new ZdlParser();
35+
ZdlModel model = parser.parseModel(zdlContent);
36+
```
37+
38+
* JavaScript/TypeScript:
39+
40+
```bash
41+
npm install @zenwave360/zdl
42+
```
43+
44+
```js
45+
import { parseZdl } from '@zenwave360/zdl';
46+
47+
const zdlContent = "...";
48+
const model = parseZdl(zdlContent);
49+
```
50+
2251
Further reading:
2352
- [ZDL Domain Language Reference](https://zenwave360.github.io/docs/event-driven-design/zenwave-domain-language)
2453
- [ZenWave SDK](https://zenwave360.github.io/zenwave-sdk/)

build.gradle.kts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,29 @@ kotlin {
105105
}
106106

107107

108+
// Node.js integration tests - Install dependencies
109+
val nodeIntegrationTestInstall = tasks.register<Exec>("nodeIntegrationTestInstall") {
110+
group = "verification"
111+
description = "Install dependencies for Node.js integration tests"
112+
113+
dependsOn("jsProductionExecutableCompileSync", "kotlinNodeJsSetup")
114+
115+
workingDir = file("nodejs-test-project")
116+
117+
// Detect OS and use appropriate command
118+
val isWindows = System.getProperty("os.name").lowercase().contains("windows")
119+
val npmCmd = if (isWindows) "npm.cmd" else "npm"
120+
121+
// Install npm dependencies
122+
commandLine(npmCmd, "install")
123+
}
124+
108125
// Node.js integration tests
109126
val nodeIntegrationTest = tasks.register<Exec>("nodeIntegrationTest") {
110127
group = "verification"
111128
description = "Run Node.js integration tests for the published NPM package"
112129

113-
dependsOn("jsProductionExecutableCompileSync", "kotlinNodeJsSetup")
130+
dependsOn("nodeIntegrationTestInstall")
114131

115132
workingDir = file("nodejs-test-project")
116133

0 commit comments

Comments
 (0)