@bpmnkit/cli 0.0.18 → 0.0.22

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/README.md CHANGED
@@ -6,6 +6,8 @@
6
6
  [![npm](https://img.shields.io/npm/v/@bpmnkit/cli?style=flat-square&color=6244d7)](https://www.npmjs.com/package/@bpmnkit/cli)
7
7
  [![license](https://img.shields.io/npm/l/@bpmnkit/cli?style=flat-square)](https://github.com/bpmnkit/monorepo/blob/main/LICENSE)
8
8
  [![typescript](https://img.shields.io/badge/TypeScript-strict-6244d7?style=flat-square&logo=typescript&logoColor=white)](https://github.com/bpmnkit/monorepo)
9
+ [![ai-assisted](https://img.shields.io/badge/AI--assisted-claude-8b5cf6?style=flat-square)](https://github.com/bpmnkit/monorepo)
10
+ [![experimental](https://img.shields.io/badge/status-experimental-f59e0b?style=flat-square)](https://github.com/bpmnkit/monorepo)
9
11
 
10
12
  [Website](https://bpmnkit.com) · [Documentation](https://docs.bpmnkit.com) · [GitHub](https://github.com/bpmnkit/monorepo) · [Changelog](https://github.com/bpmnkit/monorepo/blob/main/apps/cli/CHANGELOG.md)
11
13
  </div>
@@ -1,6 +1,6 @@
1
- import { readFile } from "node:fs/promises";
2
- import { Bpmn } from "@bpmnkit/core";
3
- import { Engine, runScenario } from "@bpmnkit/engine";
1
+ import { readFile, readdir } from "node:fs/promises";
2
+ import { dirname, extname, join } from "node:path";
3
+ import { runScenarioWasm } from "@bpmnkit/engine/wasm-runner";
4
4
  const testCmd = {
5
5
  name: "test",
6
6
  description: "Run scenario tests for a BPMN process file",
@@ -41,12 +41,26 @@ const testCmd = {
41
41
  ctx.output.info("No scenarios found.");
42
42
  return;
43
43
  }
44
- const defs = Bpmn.parse(bpmnXml);
45
- const engine = new Engine();
44
+ // Build a decision-ID → DMN XML map from all *.dmn files in the BPMN's directory.
45
+ const bpmnDir = dirname(bpmnPath);
46
+ const dirFiles = await readdir(bpmnDir).catch(() => []);
47
+ const decisionMap = new Map();
48
+ for (const file of dirFiles) {
49
+ if (extname(file).toLowerCase() !== ".dmn")
50
+ continue;
51
+ const dmnXml = await readFile(join(bpmnDir, file), "utf8").catch(() => null);
52
+ if (dmnXml === null)
53
+ continue;
54
+ for (const [, id] of dmnXml.matchAll(/<decision[^>]+\bid="([^"]+)"/g)) {
55
+ if (id)
56
+ decisionMap.set(id, dmnXml);
57
+ }
58
+ }
59
+ const getDecisionDmn = decisionMap.size > 0 ? (id) => decisionMap.get(id) ?? null : undefined;
46
60
  let passed = 0;
47
61
  let failed = 0;
48
62
  for (const scenario of scenarios) {
49
- const result = await runScenario(engine, defs, scenario);
63
+ const result = await runScenarioWasm(bpmnXml, scenario, getDecisionDmn);
50
64
  if (result.passed) {
51
65
  passed++;
52
66
  ctx.output.ok(`PASS ${scenario.name} (${result.durationMs}ms)`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmnkit/cli",
3
- "version": "0.0.18",
3
+ "version": "0.0.22",
4
4
  "description": "Command-line interface for Camunda 8 — deploy, manage, and monitor processes from the terminal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,12 +15,12 @@
15
15
  "node": ">=20"
16
16
  },
17
17
  "dependencies": {
18
- "@bpmnkit/api": "0.0.13",
19
- "@bpmnkit/ascii": "0.0.16",
20
- "@bpmnkit/connector-gen": "0.0.8",
21
- "@bpmnkit/core": "0.0.16",
22
- "@bpmnkit/engine": "0.1.15",
23
- "@bpmnkit/profiles": "0.0.11"
18
+ "@bpmnkit/api": "0.0.16",
19
+ "@bpmnkit/ascii": "0.0.20",
20
+ "@bpmnkit/connector-gen": "0.0.11",
21
+ "@bpmnkit/core": "0.0.20",
22
+ "@bpmnkit/profiles": "0.0.14",
23
+ "@bpmnkit/engine": "0.1.19"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public"