@fairfox/polly 0.78.0 → 0.80.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/cli/polly.js +76 -3
- package/dist/cli/polly.js.map +3 -3
- package/dist/src/background/index.js.map +3 -3
- package/dist/src/background/message-router.js.map +3 -3
- package/dist/src/client/index.js +137 -32
- package/dist/src/client/index.js.map +6 -5
- package/dist/src/client/wrapper.d.ts +39 -2
- package/dist/src/elysia/index.js +22 -3
- package/dist/src/elysia/index.js.map +5 -5
- package/dist/src/elysia/route-match.d.ts +13 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +12 -2
- package/dist/src/index.js.map +7 -7
- package/dist/src/mesh.js +28 -9
- package/dist/src/mesh.js.map +10 -9
- package/dist/src/peer.js +6 -2
- package/dist/src/peer.js.map +5 -5
- package/dist/src/polly-ui/Badge.d.ts +5 -0
- package/dist/src/polly-ui/Button.d.ts +31 -6
- package/dist/src/polly-ui/Dropdown.d.ts +6 -0
- package/dist/src/polly-ui/Select.d.ts +11 -1
- package/dist/src/polly-ui/TextInput.d.ts +30 -0
- package/dist/src/polly-ui/index.css +10 -0
- package/dist/src/polly-ui/index.js +81 -32
- package/dist/src/polly-ui/index.js.map +10 -10
- package/dist/src/polly-ui/styles.css +10 -0
- package/dist/src/shared/adapters/index.js.map +3 -3
- package/dist/src/shared/lib/context-helpers.js.map +3 -3
- package/dist/src/shared/lib/message-bus.js.map +3 -3
- package/dist/src/shared/lib/resource.js +11 -2
- package/dist/src/shared/lib/resource.js.map +6 -6
- package/dist/src/shared/lib/state.d.ts +20 -0
- package/dist/src/shared/lib/state.js +11 -1
- package/dist/src/shared/lib/state.js.map +5 -5
- package/dist/src/shared/state/app-state.js +10 -1
- package/dist/src/shared/state/app-state.js.map +5 -5
- package/dist/tools/init/src/cli.js +23 -2
- package/dist/tools/init/src/cli.js.map +4 -4
- package/dist/tools/init/templates/pwa/package.json.template +1 -1
- package/dist/tools/init/templates/pwa/src/service-worker.ts.template +26 -15
- package/dist/tools/init/templates/pwa/src/shared-worker.ts.template +13 -3
- package/dist/tools/init/templates/pwa/tsconfig.json.template +2 -2
- package/dist/tools/init/templates/pwa/tsconfig.worker.json.template +17 -0
- package/dist/tools/test/src/browser/index.js +5 -2
- package/dist/tools/test/src/browser/index.js.map +3 -3
- package/dist/tools/test/src/contrast/index.js +20 -15
- package/dist/tools/test/src/contrast/index.js.map +3 -3
- package/dist/tools/test/src/coverage-policy/cli.d.ts +19 -0
- package/dist/tools/test/src/coverage-policy/cli.js +339 -0
- package/dist/tools/test/src/coverage-policy/cli.js.map +13 -0
- package/dist/tools/test/src/coverage-policy/discover.d.ts +23 -0
- package/dist/tools/test/src/coverage-policy/enforce.d.ts +54 -0
- package/dist/tools/test/src/coverage-policy/index.d.ts +10 -0
- package/dist/tools/test/src/coverage-policy/index.js +242 -0
- package/dist/tools/test/src/coverage-policy/index.js.map +13 -0
- package/dist/tools/test/src/coverage-policy/mutate-targets.d.ts +30 -0
- package/dist/tools/test/src/coverage-policy/types.d.ts +35 -0
- package/dist/tools/test/src/e2e-cli/index.d.ts +10 -0
- package/dist/tools/test/src/e2e-cli/run-cli.d.ts +25 -0
- package/dist/tools/test/src/e2e-cli/with-temp-dir.d.ts +15 -0
- package/dist/tools/test/src/e2e-mesh/index.js +29 -8
- package/dist/tools/test/src/e2e-mesh/index.js.map +7 -6
- package/dist/tools/test/src/e2e-mesh/launch-peer.d.ts +7 -1
- package/dist/tools/test/src/e2e-mesh/wait-for-convergence.d.ts +8 -0
- package/dist/tools/test/src/e2e-relay/index.d.ts +12 -0
- package/dist/tools/test/src/e2e-relay/index.js +1421 -0
- package/dist/tools/test/src/e2e-relay/index.js.map +30 -0
- package/dist/tools/test/src/e2e-relay/wait-for-relay-convergence.d.ts +35 -0
- package/dist/tools/test/src/e2e-relay/with-repo-server.d.ts +33 -0
- package/dist/tools/test/src/e2e-shared/assert.d.ts +18 -0
- package/dist/tools/test/src/e2e-shared/contract.d.ts +40 -0
- package/dist/tools/test/src/e2e-shared/index.d.ts +3 -0
- package/dist/tools/test/src/e2e-shared/timeout-context.d.ts +17 -0
- package/dist/tools/test/src/index.d.ts +1 -0
- package/dist/tools/test/src/index.js +16 -1
- package/dist/tools/test/src/index.js.map +5 -4
- package/dist/tools/test/src/tiers/args.d.ts +23 -0
- package/dist/tools/test/src/tiers/cli.d.ts +2 -0
- package/dist/tools/test/src/tiers/cli.js +490 -0
- package/dist/tools/test/src/tiers/cli.js.map +16 -0
- package/dist/tools/test/src/tiers/detect.d.ts +12 -0
- package/dist/tools/test/src/tiers/discover.d.ts +2 -0
- package/dist/tools/test/src/tiers/engine.d.ts +3 -0
- package/dist/tools/test/src/tiers/index.d.ts +14 -0
- package/dist/tools/test/src/tiers/protocol.d.ts +10 -0
- package/dist/tools/test/src/tiers/reporter.d.ts +12 -0
- package/dist/tools/test/src/tiers/types.d.ts +94 -0
- package/dist/tools/test/src/tiers/worker.d.ts +2 -0
- package/dist/tools/test/src/tiers/worker.js +60 -0
- package/dist/tools/test/src/tiers/worker.js.map +12 -0
- package/dist/tools/verify/src/cli.js +165 -30
- package/dist/tools/verify/src/cli.js.map +7 -6
- package/dist/tools/verify/src/stryker/index.js +20 -11
- package/dist/tools/verify/src/stryker/index.js.map +3 -3
- package/dist/tools/visualize/src/cli.js +8 -5
- package/dist/tools/visualize/src/cli.js.map +4 -4
- package/package.json +26 -6
|
@@ -32,16 +32,24 @@ var VERIFY_PRIMITIVES = new Set([
|
|
|
32
32
|
"somePeer"
|
|
33
33
|
]);
|
|
34
34
|
var POLLY_VERIFY_IGNORER_NAME = "polly-verify";
|
|
35
|
+
function isCallExpressionPath(path) {
|
|
36
|
+
return "isCallExpression" in path && typeof path.isCallExpression === "function";
|
|
37
|
+
}
|
|
38
|
+
function isBabelIdentifier(callee) {
|
|
39
|
+
return callee.type === "Identifier";
|
|
40
|
+
}
|
|
41
|
+
function isBabelMemberExpression(callee) {
|
|
42
|
+
return callee.type === "MemberExpression";
|
|
43
|
+
}
|
|
35
44
|
function calleeName(callee) {
|
|
36
45
|
if (!callee)
|
|
37
46
|
return;
|
|
38
|
-
if (callee
|
|
47
|
+
if (isBabelIdentifier(callee)) {
|
|
39
48
|
return callee.name;
|
|
40
49
|
}
|
|
41
|
-
if (callee
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return member.property.name;
|
|
50
|
+
if (isBabelMemberExpression(callee)) {
|
|
51
|
+
if (!callee.computed && callee.property.type === "Identifier") {
|
|
52
|
+
return callee.property.name;
|
|
45
53
|
}
|
|
46
54
|
}
|
|
47
55
|
return;
|
|
@@ -53,11 +61,10 @@ class PollyVerifyIgnorer {
|
|
|
53
61
|
this.primitives = primitives;
|
|
54
62
|
}
|
|
55
63
|
shouldIgnore(path) {
|
|
56
|
-
|
|
57
|
-
if (typeof callPath.isCallExpression !== "function" || !callPath.isCallExpression()) {
|
|
64
|
+
if (!isCallExpressionPath(path) || !path.isCallExpression()) {
|
|
58
65
|
return;
|
|
59
66
|
}
|
|
60
|
-
const name = calleeName(
|
|
67
|
+
const name = calleeName(path.node.callee);
|
|
61
68
|
if (name && this.primitives.has(name)) {
|
|
62
69
|
return `Inside polly's ${name}(...) — a runtime no-op (compiled away in production, ` + `translated to a TLA+ assertion in verification). No test can observe or kill ` + `mutations here, so they are excluded from the score (polly#143).`;
|
|
63
70
|
}
|
|
@@ -65,8 +72,10 @@ class PollyVerifyIgnorer {
|
|
|
65
72
|
}
|
|
66
73
|
}
|
|
67
74
|
function isEnabled(options) {
|
|
68
|
-
const polly = options
|
|
69
|
-
|
|
75
|
+
const polly = options["polly"];
|
|
76
|
+
if (typeof polly !== "object" || polly === null)
|
|
77
|
+
return true;
|
|
78
|
+
return !("excludeVerifyCallsites" in polly) || polly.excludeVerifyCallsites !== false;
|
|
70
79
|
}
|
|
71
80
|
var NOOP_IGNORER = { shouldIgnore: () => {
|
|
72
81
|
return;
|
|
@@ -92,4 +101,4 @@ export {
|
|
|
92
101
|
POLLY_VERIFY_IGNORER_NAME
|
|
93
102
|
};
|
|
94
103
|
|
|
95
|
-
//# debugId=
|
|
104
|
+
//# debugId=E89A09026CD3C7E064756E2164756E21
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../tools/verify/src/stryker/index.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"// Stryker mutation-testing ignorer for polly's verify primitives (polly#143).\n//\n// `requires`, `ensures`, `invariant`, `stateConstraint`, `forAllPeers`, and\n// `somePeer` are runtime no-ops: in production they compile away, in\n// verification they translate to TLA+ assertions. Nothing observes their\n// condition or message argument at test runtime, so EVERY mutation inside one\n// of these callsites is guaranteed to survive — a string-literal flip in an\n// `ensures(...)` message, an `===` → equality mutation in a `requires(...)`\n// condition. On a downstream project mutating six state-machine specs this\n// dragged the mutation score down to 21%, all of it noise rather than real\n// test-coverage gaps.\n//\n// Polly is the right place to ship this knowledge: it knows which of its\n// primitives are no-ops. This module is a Stryker `Ignore` plugin that marks\n// every mutant inside a verify callsite as ignored, plus a small config preset\n// consumers can spread into their `stryker.conf.*`.\n//\n// Usage (stryker.conf.json):\n//\n// {\n// \"plugins\": [\"@fairfox/polly/stryker\"],\n// \"ignorers\": [\"polly-verify\"]\n// }\n//\n// Or, in stryker.conf.mjs:\n//\n// import pollyStrykerPreset from \"@fairfox/polly/stryker\";\n// export default { ...pollyStrykerPreset, mutate: [\"src/**/*.ts\"] };\n//\n// Set `\"polly\": { \"excludeVerifyCallsites\": false }` to keep the plugin listed\n// but disable the ignoring (e.g. in a shared base config).\n\nimport type { StrykerOptions } from \"@stryker-mutator/api/core\";\nimport type { Ignorer, NodePath } from \"@stryker-mutator/api/ignore\";\nimport {\n commonTokens,\n declareFactoryPlugin,\n PluginKind,\n tokens,\n} from \"@stryker-mutator/api/plugin\";\n\n/**\n * The polly verify primitives whose argument expressions are runtime no-ops.\n * A mutation anywhere inside a call to one of these cannot be killed by a test,\n * so its mutants are excluded from scoring.\n */\nexport const VERIFY_PRIMITIVES: ReadonlySet<string> = new Set([\n \"requires\",\n \"ensures\",\n \"invariant\",\n \"stateConstraint\",\n \"forAllPeers\",\n \"somePeer\",\n]);\n\n/** The Stryker plugin name consumers reference in `ignorers`. */\nexport const POLLY_VERIFY_IGNORER_NAME = \"polly-verify\";\n\n// The Stryker API types `NodePath` as an empty interface; at runtime it is a\n// Babel NodePath. We narrow only the surface we touch — `isCallExpression()`\n// and `node.callee` — without pulling in @babel/types as a dependency.\ninterface BabelIdentifier {\n type: \"Identifier\";\n name: string;\n}\ninterface BabelMemberExpression {\n type: \"MemberExpression\";\n computed: boolean;\n property: { type: string; name?: string };\n}\ntype BabelCallee = BabelIdentifier | BabelMemberExpression | { type: string };\ninterface CallExpressionPath extends NodePath {\n isCallExpression(): boolean;\n node: { callee?: BabelCallee };\n}\n\n/**\n * Resolve the simple name of a call's callee, covering both a bare call\n * (`ensures(...)`) and a member call (`verify.ensures(...)` / `polly.ensures(...)`).\n * Computed member access (`obj[\"ensures\"](...)`) is intentionally not matched —\n * it cannot be resolved statically and is not a pattern polly emits.\n */\nfunction calleeName(callee: BabelCallee | undefined): string | undefined {\n if (!callee) return undefined;\n if (callee
|
|
5
|
+
"// Stryker mutation-testing ignorer for polly's verify primitives (polly#143).\n//\n// `requires`, `ensures`, `invariant`, `stateConstraint`, `forAllPeers`, and\n// `somePeer` are runtime no-ops: in production they compile away, in\n// verification they translate to TLA+ assertions. Nothing observes their\n// condition or message argument at test runtime, so EVERY mutation inside one\n// of these callsites is guaranteed to survive — a string-literal flip in an\n// `ensures(...)` message, an `===` → equality mutation in a `requires(...)`\n// condition. On a downstream project mutating six state-machine specs this\n// dragged the mutation score down to 21%, all of it noise rather than real\n// test-coverage gaps.\n//\n// Polly is the right place to ship this knowledge: it knows which of its\n// primitives are no-ops. This module is a Stryker `Ignore` plugin that marks\n// every mutant inside a verify callsite as ignored, plus a small config preset\n// consumers can spread into their `stryker.conf.*`.\n//\n// Usage (stryker.conf.json):\n//\n// {\n// \"plugins\": [\"@fairfox/polly/stryker\"],\n// \"ignorers\": [\"polly-verify\"]\n// }\n//\n// Or, in stryker.conf.mjs:\n//\n// import pollyStrykerPreset from \"@fairfox/polly/stryker\";\n// export default { ...pollyStrykerPreset, mutate: [\"src/**/*.ts\"] };\n//\n// Set `\"polly\": { \"excludeVerifyCallsites\": false }` to keep the plugin listed\n// but disable the ignoring (e.g. in a shared base config).\n\nimport type { StrykerOptions } from \"@stryker-mutator/api/core\";\nimport type { Ignorer, NodePath } from \"@stryker-mutator/api/ignore\";\nimport {\n commonTokens,\n declareFactoryPlugin,\n PluginKind,\n tokens,\n} from \"@stryker-mutator/api/plugin\";\n\n/**\n * The polly verify primitives whose argument expressions are runtime no-ops.\n * A mutation anywhere inside a call to one of these cannot be killed by a test,\n * so its mutants are excluded from scoring.\n */\nexport const VERIFY_PRIMITIVES: ReadonlySet<string> = new Set([\n \"requires\",\n \"ensures\",\n \"invariant\",\n \"stateConstraint\",\n \"forAllPeers\",\n \"somePeer\",\n]);\n\n/** The Stryker plugin name consumers reference in `ignorers`. */\nexport const POLLY_VERIFY_IGNORER_NAME = \"polly-verify\";\n\n// The Stryker API types `NodePath` as an empty interface; at runtime it is a\n// Babel NodePath. We narrow only the surface we touch — `isCallExpression()`\n// and `node.callee` — without pulling in @babel/types as a dependency.\ninterface BabelIdentifier {\n type: \"Identifier\";\n name: string;\n}\ninterface BabelMemberExpression {\n type: \"MemberExpression\";\n computed: boolean;\n property: { type: string; name?: string };\n}\ntype BabelCallee = BabelIdentifier | BabelMemberExpression | { type: string };\ninterface CallExpressionPath extends NodePath {\n isCallExpression(): boolean;\n node: { callee?: BabelCallee };\n}\n\n/** Narrow the opaque `NodePath` to the Babel surface we touch. */\nfunction isCallExpressionPath(path: NodePath): path is CallExpressionPath {\n return \"isCallExpression\" in path && typeof path.isCallExpression === \"function\";\n}\n\n/**\n * Resolve the simple name of a call's callee, covering both a bare call\n * (`ensures(...)`) and a member call (`verify.ensures(...)` / `polly.ensures(...)`).\n * Computed member access (`obj[\"ensures\"](...)`) is intentionally not matched —\n * it cannot be resolved statically and is not a pattern polly emits.\n */\nfunction isBabelIdentifier(callee: BabelCallee): callee is BabelIdentifier {\n return callee.type === \"Identifier\";\n}\n\nfunction isBabelMemberExpression(callee: BabelCallee): callee is BabelMemberExpression {\n return callee.type === \"MemberExpression\";\n}\n\nfunction calleeName(callee: BabelCallee | undefined): string | undefined {\n if (!callee) return undefined;\n if (isBabelIdentifier(callee)) {\n return callee.name;\n }\n if (isBabelMemberExpression(callee)) {\n if (!callee.computed && callee.property.type === \"Identifier\") {\n return callee.property.name;\n }\n }\n return undefined;\n}\n\n/**\n * A Stryker `Ignore` plugin. Stryker calls `shouldIgnore` on entering each AST\n * node; returning a message marks that node — and every descendant, until the\n * node is left — as ignored. So matching the verify `CallExpression` itself\n * covers its condition and message arguments in one shot.\n */\nexport class PollyVerifyIgnorer implements Ignorer {\n constructor(private readonly primitives: ReadonlySet<string> = VERIFY_PRIMITIVES) {}\n\n shouldIgnore(path: NodePath): string | undefined {\n if (!isCallExpressionPath(path) || !path.isCallExpression()) {\n return undefined;\n }\n const name = calleeName(path.node.callee);\n if (name && this.primitives.has(name)) {\n return (\n `Inside polly's ${name}(...) — a runtime no-op (compiled away in production, ` +\n `translated to a TLA+ assertion in verification). No test can observe or kill ` +\n `mutations here, so they are excluded from the score (polly#143).`\n );\n }\n return undefined;\n }\n}\n\n/** Reads `polly.excludeVerifyCallsites` (default: enabled) off Stryker options. */\nfunction isEnabled(options: StrykerOptions): boolean {\n const polly = options[\"polly\"];\n if (typeof polly !== \"object\" || polly === null) return true;\n return !(\"excludeVerifyCallsites\" in polly) || polly.excludeVerifyCallsites !== false;\n}\n\n// When disabled the plugin still loads but ignores nothing, so a shared config\n// can list it unconditionally and individual projects opt out via options.\nconst NOOP_IGNORER: Ignorer = { shouldIgnore: () => undefined };\n\nfunction pollyVerifyIgnorerFactory(options: StrykerOptions): Ignorer {\n return isEnabled(options) ? new PollyVerifyIgnorer() : NOOP_IGNORER;\n}\npollyVerifyIgnorerFactory.inject = tokens(commonTokens.options);\n\n/** The plugin array Stryker reads when this module is listed in `plugins`. */\nexport const strykerPlugins = [\n declareFactoryPlugin(PluginKind.Ignore, POLLY_VERIFY_IGNORER_NAME, pollyVerifyIgnorerFactory),\n];\n\n/**\n * A partial Stryker config that wires up the ignorer. Spread it into a\n * `stryker.conf.mjs` default export, or replicate its two keys in JSON.\n */\nexport const pollyStrykerPreset = {\n plugins: [\"@fairfox/polly/stryker\"],\n ignorers: [POLLY_VERIFY_IGNORER_NAME],\n} as const;\n\n// biome-ignore lint/style/noDefaultExport: ergonomic `import preset from \"@fairfox/polly/stryker\"`\nexport default pollyStrykerPreset;\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAkCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,IAAM,oBAAyC,IAAI,IAAI;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,IAAM,4BAA4B;
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAkCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,IAAM,oBAAyC,IAAI,IAAI;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,IAAM,4BAA4B;AAqBzC,SAAS,oBAAoB,CAAC,MAA4C;AAAA,EACxE,OAAO,sBAAsB,QAAQ,OAAO,KAAK,qBAAqB;AAAA;AASxE,SAAS,iBAAiB,CAAC,QAAgD;AAAA,EACzE,OAAO,OAAO,SAAS;AAAA;AAGzB,SAAS,uBAAuB,CAAC,QAAsD;AAAA,EACrF,OAAO,OAAO,SAAS;AAAA;AAGzB,SAAS,UAAU,CAAC,QAAqD;AAAA,EACvE,IAAI,CAAC;AAAA,IAAQ;AAAA,EACb,IAAI,kBAAkB,MAAM,GAAG;AAAA,IAC7B,OAAO,OAAO;AAAA,EAChB;AAAA,EACA,IAAI,wBAAwB,MAAM,GAAG;AAAA,IACnC,IAAI,CAAC,OAAO,YAAY,OAAO,SAAS,SAAS,cAAc;AAAA,MAC7D,OAAO,OAAO,SAAS;AAAA,IACzB;AAAA,EACF;AAAA,EACA;AAAA;AAAA;AASK,MAAM,mBAAsC;AAAA,EACpB;AAAA,EAA7B,WAAW,CAAkB,aAAkC,mBAAmB;AAAA,IAArD;AAAA;AAAA,EAE7B,YAAY,CAAC,MAAoC;AAAA,IAC/C,IAAI,CAAC,qBAAqB,IAAI,KAAK,CAAC,KAAK,iBAAiB,GAAG;AAAA,MAC3D;AAAA,IACF;AAAA,IACA,MAAM,OAAO,WAAW,KAAK,KAAK,MAAM;AAAA,IACxC,IAAI,QAAQ,KAAK,WAAW,IAAI,IAAI,GAAG;AAAA,MACrC,OACE,kBAAkB,+DAClB,kFACA;AAAA,IAEJ;AAAA,IACA;AAAA;AAEJ;AAGA,SAAS,SAAS,CAAC,SAAkC;AAAA,EACnD,MAAM,QAAQ,QAAQ;AAAA,EACtB,IAAI,OAAO,UAAU,YAAY,UAAU;AAAA,IAAM,OAAO;AAAA,EACxD,OAAO,EAAE,4BAA4B,UAAU,MAAM,2BAA2B;AAAA;AAKlF,IAAM,eAAwB,EAAE,cAAc,MAAG;AAAA,EAAG;AAAA,EAAU;AAE9D,SAAS,yBAAyB,CAAC,SAAkC;AAAA,EACnE,OAAO,UAAU,OAAO,IAAI,IAAI,qBAAuB;AAAA;AAEzD,0BAA0B,SAAS,OAAO,aAAa,OAAO;AAGvD,IAAM,iBAAiB;AAAA,EAC5B,qBAAqB,WAAW,QAAQ,2BAA2B,yBAAyB;AAC9F;AAMO,IAAM,qBAAqB;AAAA,EAChC,SAAS,CAAC,wBAAwB;AAAA,EAClC,UAAU,CAAC,yBAAyB;AACtC;AAGA,IAAe;",
|
|
8
|
+
"debugId": "E89A09026CD3C7E064756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -4624,8 +4624,11 @@ class MeshSnapshotError extends Error {
|
|
|
4624
4624
|
function isObject(value) {
|
|
4625
4625
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4626
4626
|
}
|
|
4627
|
+
function isStringArray(value) {
|
|
4628
|
+
return Array.isArray(value) && value.every((v) => typeof v === "string");
|
|
4629
|
+
}
|
|
4627
4630
|
function requireStringArray(value, path5) {
|
|
4628
|
-
if (!
|
|
4631
|
+
if (!isStringArray(value)) {
|
|
4629
4632
|
throw new MeshSnapshotError(`${path5} must be an array of strings`);
|
|
4630
4633
|
}
|
|
4631
4634
|
return value;
|
|
@@ -6325,7 +6328,7 @@ import * as fs6 from "node:fs";
|
|
|
6325
6328
|
import * as path5 from "node:path";
|
|
6326
6329
|
|
|
6327
6330
|
class DiagramExporter {
|
|
6328
|
-
static DOCKER_IMAGE = "structurizr/
|
|
6331
|
+
static DOCKER_IMAGE = "structurizr/structurizr:latest";
|
|
6329
6332
|
static DEFAULT_TIMEOUT = 120000;
|
|
6330
6333
|
async export(options) {
|
|
6331
6334
|
const { dslPath, outputDir, timeout = DiagramExporter.DEFAULT_TIMEOUT } = options;
|
|
@@ -6385,9 +6388,9 @@ class DiagramExporter {
|
|
|
6385
6388
|
"export",
|
|
6386
6389
|
"-workspace",
|
|
6387
6390
|
`/usr/local/structurizr/${dslFileName}`,
|
|
6388
|
-
"-
|
|
6391
|
+
"-f",
|
|
6389
6392
|
"static",
|
|
6390
|
-
"-
|
|
6393
|
+
"-o",
|
|
6391
6394
|
"/output"
|
|
6392
6395
|
];
|
|
6393
6396
|
await this.runDocker(args, timeout);
|
|
@@ -6819,4 +6822,4 @@ main().catch((_error) => {
|
|
|
6819
6822
|
process.exit(1);
|
|
6820
6823
|
});
|
|
6821
6824
|
|
|
6822
|
-
//# debugId=
|
|
6825
|
+
//# debugId=BC2B5CC50AAEB9A464756E2164756E21
|