eventmodeler 0.3.10 → 0.4.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/dist/index.js
CHANGED
|
@@ -1293,8 +1293,16 @@ EXAMPLES:
|
|
|
1293
1293
|
`);
|
|
1294
1294
|
process.exit(0);
|
|
1295
1295
|
}
|
|
1296
|
-
const scenarioName = target;
|
|
1297
1296
|
const sliceArg = getNamedArg(filteredArgs, '--slice');
|
|
1297
|
+
// Filter out --slice and its value from remaining args to get scenario name
|
|
1298
|
+
const scenarioArgs = filteredArgs.slice(2).filter((arg, i, arr) => {
|
|
1299
|
+
if (arg === '--slice')
|
|
1300
|
+
return false;
|
|
1301
|
+
if (i > 0 && arr[i - 1] === '--slice')
|
|
1302
|
+
return false;
|
|
1303
|
+
return true;
|
|
1304
|
+
});
|
|
1305
|
+
const scenarioName = scenarioArgs.length > 0 ? scenarioArgs.join(' ') : undefined;
|
|
1298
1306
|
if (!scenarioName) {
|
|
1299
1307
|
console.error('Usage: eventmodeler remove scenario <name> [--slice <slice-name>]');
|
|
1300
1308
|
console.error('Run "eventmodeler remove scenario --help" for more information.');
|
|
@@ -14,11 +14,13 @@ function getSliceComponents(model, slice) {
|
|
|
14
14
|
const centerY = pos.y + height / 2;
|
|
15
15
|
return centerX >= bounds.left && centerX <= bounds.right && centerY >= bounds.top && centerY <= bounds.bottom;
|
|
16
16
|
}
|
|
17
|
+
// Only include canonical elements - linked copies are UI-only conveniences
|
|
18
|
+
// and should not appear as slice contents in codegen output
|
|
17
19
|
return {
|
|
18
20
|
commands: [...model.commands.values()].filter(c => isInSlice(c.position, c.width, c.height)),
|
|
19
|
-
events: [...model.events.values()].filter(e => isInSlice(e.position, e.width, e.height)),
|
|
20
|
-
readModels: [...model.readModels.values()].filter(rm => isInSlice(rm.position, rm.width, rm.height)),
|
|
21
|
-
screens: [...model.screens.values()].filter(s => isInSlice(s.position, s.width, s.height)),
|
|
21
|
+
events: [...model.events.values()].filter(e => !e.originalNodeId && isInSlice(e.position, e.width, e.height)),
|
|
22
|
+
readModels: [...model.readModels.values()].filter(rm => !rm.originalNodeId && isInSlice(rm.position, rm.width, rm.height)),
|
|
23
|
+
screens: [...model.screens.values()].filter(s => !s.originalNodeId && isInSlice(s.position, s.width, s.height)),
|
|
22
24
|
processors: [...model.processors.values()].filter(p => isInSlice(p.position, p.width, p.height)),
|
|
23
25
|
};
|
|
24
26
|
}
|