@antelopejs/dms 0.20.7 → 0.20.8-next.916.gd319141
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/bin/control/commands-verify.mjs +8 -49
- package/bin/control/options.mjs +0 -1
- package/bin/control/run-state.mjs +1 -1
- package/bin/control/timing.mjs +1 -16
- package/bin/control/timing.test.mjs +0 -11
- package/bin/control/verify/decode.mjs +4 -144
- package/bin/control/verify/decode.test.mjs +1 -149
- package/bin/control/verify/formal.mjs +22 -218
- package/bin/control/verify/formal.test.mjs +60 -117
- package/bin/control/verify/map.test.mjs +0 -73
- package/bin/control/verify/types.mjs +4 -18
- package/bin/dms-control.mjs +0 -2
- package/dist/implementations/dms/page/controller.d.ts +2 -1
- package/dist/implementations/dms/page/controller.js.map +1 -1
- package/dist/implementations/dms-builder/engine/connection-access-config.js +2 -2
- package/dist/implementations/dms-builder/engine/connection-targets.js.map +1 -1
- package/dist/implementations/dms-builder/engine/database-access.d.ts +1 -1
- package/dist/implementations/dms-builder/engine/database-access.js +2 -2
- package/dist/implementations/dms-builder/engine/database-check-input.d.ts +3 -2
- package/dist/implementations/dms-builder/engine/database-check-input.js.map +1 -1
- package/dist/implementations/dms-builder/engine/database-check.js +2 -2
- package/dist/implementations/dms-builder/engine/database-check.js.map +1 -1
- package/dist/implementations/dms-builder/engine/probe-answer.d.ts +44 -1
- package/dist/implementations/dms-builder/engine/probe-answer.js +2 -5
- package/dist/implementations/dms-builder/engine/probe-answer.js.map +1 -1
- package/dist/mockup/files.d.ts +1 -1
- package/dist/mockup/files.js +2 -2
- package/dist/pages/settings/users/roles.js.map +1 -1
- package/dist/store/internal/frontend/frontend-ready.d.ts +2 -1
- package/dist/store/internal/frontend/frontend-ready.js.map +1 -1
- package/dist/store/operations.js +4 -4
- package/dist/store/operations.js.map +1 -1
- package/dist/utils/upload-constraints.d.ts +1 -1
- package/dist/utils/upload-constraints.js +2 -2
- package/dist/utils/upload-constraints.js.map +1 -1
- package/dist/validation/issue-message.d.ts +1 -1
- package/dist/validation/issue-message.js +3 -3
- package/dist/validation/issue-message.js.map +1 -1
- package/frontend-vue/layers/dms-core/app/utils/formatter.ts +1 -0
- package/frontend-vue/layers/dms-layout/app/build/composables/navigation/useVisitNavBadges.ts +11 -14
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/security/useSecurityFormat.ts +5 -5
- package/frontend-vue/layers/dms-layout/app/build/utils/modules-catalog.ts +7 -2
- package/frontend-vue/layers/dms-layout/app/build/utils/notificationPayload.ts +9 -5
- package/frontend-vue/layers/dms-layout/app/composables/page/useModuleHistory.ts +4 -1
- package/frontend-vue/layers/dms-layout/app/composables/page/useModulesListing.ts +7 -17
- package/frontend-vue/layers/dms-layout/app/custom-pages/modules.vue +5 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupCatalog.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +18 -16
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/containers/drawerSize.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationBadges.ts +2 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldComponentProps.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/layout/sidePanelState.ts +5 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/period/periodQuery.ts +6 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionValues.ts +13 -13
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/writeError.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreview.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +26 -18
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCatalog.ts +7 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/components/chart/ApexChartHost.vue +2 -0
- package/frontend-vue/layers/dms-ui/app/composables/useExportJob.ts +2 -2
- package/package.json +32 -30
- package/skills/dms-project/scripts/dms-dev.sh +0 -0
- package/bin/control/verify/behaviour.mjs +0 -183
- package/bin/control/verify/behaviour.test.mjs +0 -472
- package/bin/control/verify/emit.mjs +0 -539
- package/bin/control/verify/judgement.mjs +0 -101
- package/bin/control/verify/verdict.mjs +0 -327
- package/frontend-vue/scripts/probes/capture-frontend-probe.cjs +0 -23
- package/frontend-vue/scripts/probes/frontend-behavior.cjs +0 -606
- package/frontend-vue/scripts/probes/frontend-legacy.cjs +0 -620
- package/frontend-vue/scripts/probes/frontend-probe-controls.cjs +0 -322
- package/frontend-vue/scripts/prove-comment-emit.mjs +0 -171
- package/frontend-vue/scripts/prove-component-registration.mjs +0 -259
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
import { existsSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { join, relative } from "node:path";
|
|
3
|
-
import { git } from "../git.mjs";
|
|
4
|
-
import { loadJourneys } from "../journey-load.mjs";
|
|
5
|
-
import {
|
|
6
|
-
formatSeconds,
|
|
7
|
-
markdownTimings,
|
|
8
|
-
readTimings,
|
|
9
|
-
summarize,
|
|
10
|
-
} from "../timing.mjs";
|
|
11
|
-
import { readFeatureResults } from "./decode.mjs";
|
|
12
|
-
import { flaggedDoors } from "./doors.mjs";
|
|
13
|
-
import {
|
|
14
|
-
formalGate,
|
|
15
|
-
readFormalResult,
|
|
16
|
-
touchedFormalChecks,
|
|
17
|
-
} from "./formal.mjs";
|
|
18
|
-
import { planFor } from "./map.mjs";
|
|
19
|
-
import { journeysFile } from "./skill.mjs";
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @param {string} sha A commit
|
|
23
|
-
* @returns {string} Its first seven characters
|
|
24
|
-
*/
|
|
25
|
-
function short(sha) {
|
|
26
|
-
return sha.slice(0, 7);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @param {string[]} entries The list items
|
|
31
|
-
* @param {string} empty The item that stands for an empty list
|
|
32
|
-
* @returns {string[]} The Markdown bullets
|
|
33
|
-
*/
|
|
34
|
-
function bullets(entries, empty) {
|
|
35
|
-
return (entries.length > 0 ? entries : [empty]).map((entry) => `- ${entry}`);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @param {Pick<import("../run-state.mjs").RunState, "evidence">} state The run
|
|
40
|
-
* @param {string} feature The feature
|
|
41
|
-
* @returns {import("./types.mjs").FeatureResult[]} The journey results the run recorded
|
|
42
|
-
*/
|
|
43
|
-
function readResults(state, feature) {
|
|
44
|
-
return readFeatureResults(join(state.evidence, feature, "feature.json"));
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @param {import("./skill.mjs").Skill} skill The skill
|
|
49
|
-
* @param {Pick<import("../run-state.mjs").RunState, "evidence">} state The run
|
|
50
|
-
* @param {import("./types.mjs").Plan} plan The plan
|
|
51
|
-
* @returns {Promise<{ rows: string[], reasons: string[] }>} The table rows and why the verdict fails
|
|
52
|
-
*/
|
|
53
|
-
async function journeyRows(skill, state, plan) {
|
|
54
|
-
/** @type {string[]} */
|
|
55
|
-
const rows = [];
|
|
56
|
-
/** @type {string[]} */
|
|
57
|
-
const reasons = [];
|
|
58
|
-
for (const feature of plan.run) {
|
|
59
|
-
const results = readResults(state, feature);
|
|
60
|
-
const file = journeysFile(skill, feature);
|
|
61
|
-
const registered = existsSync(file)
|
|
62
|
-
? (await loadJourneys(file)).map((journey) => journey.id)
|
|
63
|
-
: [];
|
|
64
|
-
for (const id of registered.filter(
|
|
65
|
-
(journey) => !results.some((result) => result.journey === journey),
|
|
66
|
-
)) {
|
|
67
|
-
reasons.push(`${feature}/${id} was not run`);
|
|
68
|
-
}
|
|
69
|
-
for (const result of results) {
|
|
70
|
-
if (!registered.includes(result.journey))
|
|
71
|
-
reasons.push(
|
|
72
|
-
`${feature}/${result.journey} is not a registered journey`,
|
|
73
|
-
);
|
|
74
|
-
if (result.status === "FAIL")
|
|
75
|
-
reasons.push(`${feature}/${result.journey} failed`);
|
|
76
|
-
const outcome = result.status === "PASS" ? "pass" : "**fail**";
|
|
77
|
-
const time =
|
|
78
|
-
result.ms === undefined ? "-" : `${formatSeconds(result.ms)} s`;
|
|
79
|
-
rows.push(
|
|
80
|
-
`| ${feature} | \`${result.journey}\`: ${result.entryPoint} | ${outcome}: ${result.title} | ${time} | \`${result.folder}\` |`,
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return { rows, reasons };
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* @param {import("./skill.mjs").Skill} skill The skill
|
|
89
|
-
* @param {import("./types.mjs").Judgement} judgement The verifier's judgement
|
|
90
|
-
* @param {import("./types.mjs").Plan} plan The plan
|
|
91
|
-
* @returns {string[]} Why the doors fail the verdict
|
|
92
|
-
*/
|
|
93
|
-
function doorReasons(skill, judgement, plan) {
|
|
94
|
-
/** @type {string[]} */
|
|
95
|
-
const reasons = [];
|
|
96
|
-
for (const door of flaggedDoors(skill, plan.changed)) {
|
|
97
|
-
for (const file of door.files) {
|
|
98
|
-
const listed = judgement.doors.some(
|
|
99
|
-
(row) => row.kind === door.kind && row.location.includes(file),
|
|
100
|
-
);
|
|
101
|
-
const dismissed = judgement.falsePositives.some(
|
|
102
|
-
(entry) => entry.kind === door.kind && entry.location === file,
|
|
103
|
-
);
|
|
104
|
-
if (!listed && !dismissed) {
|
|
105
|
-
reasons.push(
|
|
106
|
-
`path rules flag a ${door.kind} door at ${file} that the One-way doors section neither lists nor dismisses`,
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return reasons;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* @param {import("./types.mjs").Judgement} judgement The verifier's judgement
|
|
116
|
-
* @returns {string[]} The section's lines
|
|
117
|
-
*/
|
|
118
|
-
function doorsSection(judgement) {
|
|
119
|
-
const dismissed = judgement.falsePositives.map(
|
|
120
|
-
(entry) =>
|
|
121
|
-
`- Not a door: \`${entry.location}\` matches the ${entry.kind} path rules. ${entry.reason}`,
|
|
122
|
-
);
|
|
123
|
-
if (judgement.doors.length === 0)
|
|
124
|
-
return [`None: ${judgement.doorsNone}`, ...dismissed];
|
|
125
|
-
return [
|
|
126
|
-
...dismissed,
|
|
127
|
-
"| Kind | Location | What cannot be undone | Containment |",
|
|
128
|
-
"|---|---|---|---|",
|
|
129
|
-
...judgement.doors.map(
|
|
130
|
-
(door) =>
|
|
131
|
-
`| ${door.kind} | \`${door.location}\` | ${door.irreversible} | ${door.containment} |`,
|
|
132
|
-
),
|
|
133
|
-
];
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* @param {import("./skill.mjs").Skill} skill The skill
|
|
138
|
-
* @param {Pick<import("../run-state.mjs").RunState, "evidence">} state The run
|
|
139
|
-
* @param {import("./types.mjs").Plan} plan The plan
|
|
140
|
-
* @returns {{ reasons: string[], lines: string[] }} Why the formal checks fail the verdict, and their lines
|
|
141
|
-
*/
|
|
142
|
-
function formalSection(skill, state, plan) {
|
|
143
|
-
const reasons = [];
|
|
144
|
-
const lines = [];
|
|
145
|
-
const touched = touchedFormalChecks(skill, plan.changed).map(
|
|
146
|
-
(check) => check.name,
|
|
147
|
-
);
|
|
148
|
-
for (const check of skill.config.formal) {
|
|
149
|
-
const result = readFormalResult(state, check.name);
|
|
150
|
-
const gate = touched.includes(check.name);
|
|
151
|
-
if (!result) {
|
|
152
|
-
if (gate)
|
|
153
|
-
reasons.push(
|
|
154
|
-
`formal check ${check.name} covers the diff but was not run`,
|
|
155
|
-
);
|
|
156
|
-
continue;
|
|
157
|
-
}
|
|
158
|
-
if (gate && !result.behaviour && result.exitCode === 0) {
|
|
159
|
-
reasons.push(
|
|
160
|
-
`formal check ${check.name} covers the diff but its run did not compare the covered behaviour with the base`,
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
const weight = formalGate(result);
|
|
164
|
-
if (gate && weight.fails)
|
|
165
|
-
reasons.push(`formal check ${check.name}: ${weight.outcome}`);
|
|
166
|
-
const summary = gate
|
|
167
|
-
? weight.outcome
|
|
168
|
-
: result.violated.length > 0
|
|
169
|
-
? `violated: ${result.violated.join(", ")}`
|
|
170
|
-
: `exit ${result.exitCode}, no violated rule`;
|
|
171
|
-
const role = gate
|
|
172
|
-
? "covers the diff, gates the verdict"
|
|
173
|
-
: "does not cover the diff, informational";
|
|
174
|
-
lines.push(
|
|
175
|
-
`\`${check.name}\` (${role}): ${summary}. Evidence: \`${result.folder}\``,
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
return { reasons, lines };
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* @param {import("./types.mjs").Judgement} judgement The verifier's judgement
|
|
183
|
-
* @param {import("./types.mjs").Plan} plan The plan
|
|
184
|
-
* @returns {string[]} The docs pages that no longer match
|
|
185
|
-
*/
|
|
186
|
-
function docsReasons(judgement, plan) {
|
|
187
|
-
return plan.docs.flatMap((page) => {
|
|
188
|
-
const docs = judgement.docs.find((entry) => entry.page === page);
|
|
189
|
-
if (!docs)
|
|
190
|
-
throw new Error(
|
|
191
|
-
`judgement.json: docs page ${page} of a touched feature has no judgement`,
|
|
192
|
-
);
|
|
193
|
-
return docs.matches ? [] : [`${page} no longer matches the behaviour`];
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* @param {import("./skill.mjs").Skill} skill The skill
|
|
199
|
-
* @param {import("./types.mjs").VerdictCore} verdict The verdict
|
|
200
|
-
* @param {{ plan: import("./types.mjs").Plan, judgement: import("./types.mjs").Judgement, journeys: Awaited<ReturnType<typeof journeyRows>>, formal: ReturnType<typeof formalSection>, timing: import("../timing.mjs").TimingSummary, reasons: string[], attention: string[] }} parts What the verdict is rendered from
|
|
201
|
-
* @returns {string} The verdict as Markdown
|
|
202
|
-
*/
|
|
203
|
-
function markdown(skill, verdict, parts) {
|
|
204
|
-
const { plan, judgement, journeys, formal, timing, reasons, attention } =
|
|
205
|
-
parts;
|
|
206
|
-
const touched = plan.touched.map(
|
|
207
|
-
(entry) =>
|
|
208
|
-
`\`${entry.feature}\` (diff: ${entry.files.map((file) => `\`${file}\``).join(", ")})`,
|
|
209
|
-
);
|
|
210
|
-
const docs = judgement.docs.map(
|
|
211
|
-
(entry) =>
|
|
212
|
-
`\`${entry.page}\`: ${entry.matches ? "matches" : "**stale**"}${entry.note ? `. ${entry.note}` : ""}`,
|
|
213
|
-
);
|
|
214
|
-
return [
|
|
215
|
-
`## Verify: ${verdict.result}`,
|
|
216
|
-
"",
|
|
217
|
-
`**Head** \`${short(plan.headSha)}\` · **Skill** \`${skill.name}\` @ \`${short(verdict.skillSha)}\` (not trusted yet) · **Verifier** ${judgement.verifier}`,
|
|
218
|
-
"",
|
|
219
|
-
"### One-way doors",
|
|
220
|
-
...doorsSection(judgement),
|
|
221
|
-
"",
|
|
222
|
-
"### Touched features",
|
|
223
|
-
...bullets(touched, "none"),
|
|
224
|
-
`- ${skill.config.smoke}: ${skill.config.smokeJourney}`,
|
|
225
|
-
"",
|
|
226
|
-
...(plan.shared.length > 0
|
|
227
|
-
? [
|
|
228
|
-
"### Shared files",
|
|
229
|
-
`Every feature runs (${plan.run.length}), because the diff changes:`,
|
|
230
|
-
...plan.shared.map((file) => `- \`${file}\``),
|
|
231
|
-
"",
|
|
232
|
-
]
|
|
233
|
-
: []),
|
|
234
|
-
...(plan.unmapped.length > 0
|
|
235
|
-
? [
|
|
236
|
-
"### Unmapped surfaces",
|
|
237
|
-
...plan.unmapped.map(
|
|
238
|
-
(file) =>
|
|
239
|
-
`- \`${file}\` matches no feature glob; add it to a feature file.`,
|
|
240
|
-
),
|
|
241
|
-
"",
|
|
242
|
-
]
|
|
243
|
-
: []),
|
|
244
|
-
...(reasons.length > 0
|
|
245
|
-
? ["### Why it fails", ...reasons.map((reason) => `- ${reason}`), ""]
|
|
246
|
-
: []),
|
|
247
|
-
"### Journeys",
|
|
248
|
-
"| Feature | Entry point | Result | Time | Evidence |",
|
|
249
|
-
"|---|---|---|---|---|",
|
|
250
|
-
...journeys.rows,
|
|
251
|
-
"",
|
|
252
|
-
"### Timing",
|
|
253
|
-
...(timing.rows.length > 0 ? markdownTimings(timing) : ["None recorded."]),
|
|
254
|
-
"",
|
|
255
|
-
"### Formal checks",
|
|
256
|
-
...bullets(formal.lines, "None ran."),
|
|
257
|
-
"",
|
|
258
|
-
"### Docs",
|
|
259
|
-
...bullets(docs, "No touched feature links a page."),
|
|
260
|
-
"",
|
|
261
|
-
"### Not verified",
|
|
262
|
-
...bullets(judgement.notVerified, "Nothing."),
|
|
263
|
-
"",
|
|
264
|
-
"### Attention",
|
|
265
|
-
...bullets(attention, "Nothing."),
|
|
266
|
-
"",
|
|
267
|
-
].join("\n");
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Computes the verdict of a run from its journey results, the diff plan,
|
|
272
|
-
* the formal check results and the verifier's judgement, and writes
|
|
273
|
-
* verdict.md, verdict.json and plan.json into the evidence folder.
|
|
274
|
-
*
|
|
275
|
-
* @param {import("./skill.mjs").Skill} skill The skill
|
|
276
|
-
* @param {Pick<import("../run-state.mjs").RunState, "baseRef" | "headSha" | "evidence">} state The run
|
|
277
|
-
* @param {number} pr The pull request
|
|
278
|
-
* @param {import("./types.mjs").Judgement} judgement The verifier's judgement
|
|
279
|
-
* @param {boolean} [all] Require every feature, as `plan --all` does for a release
|
|
280
|
-
* @returns {Promise<import("./types.mjs").Verdict>} The verdict
|
|
281
|
-
*/
|
|
282
|
-
export async function renderVerdict(skill, state, pr, judgement, all = false) {
|
|
283
|
-
const plan = planFor(skill, state.baseRef, all);
|
|
284
|
-
const skillSha =
|
|
285
|
-
git(
|
|
286
|
-
["log", "-1", "--format=%H", "--", relative(skill.repo, skill.dir)],
|
|
287
|
-
skill.repo,
|
|
288
|
-
) || plan.headSha;
|
|
289
|
-
const reasons = [];
|
|
290
|
-
if (plan.headSha !== state.headSha) {
|
|
291
|
-
reasons.push(
|
|
292
|
-
`the run was created at ${short(state.headSha ?? "unknown")} but HEAD is ${short(plan.headSha)}`,
|
|
293
|
-
);
|
|
294
|
-
}
|
|
295
|
-
const journeys = await journeyRows(skill, state, plan);
|
|
296
|
-
const formal = formalSection(skill, state, plan);
|
|
297
|
-
reasons.push(
|
|
298
|
-
...journeys.reasons,
|
|
299
|
-
...plan.unmapped.map((file) => `unmapped surface ${file}`),
|
|
300
|
-
...docsReasons(judgement, plan),
|
|
301
|
-
...doorReasons(skill, judgement, plan),
|
|
302
|
-
...formal.reasons,
|
|
303
|
-
);
|
|
304
|
-
const attention = judgement.attention;
|
|
305
|
-
const notes = judgement.notVerified.length + attention.length > 0;
|
|
306
|
-
const result = reasons.length > 0 ? "FAIL" : notes ? "PASS+NOTES" : "PASS";
|
|
307
|
-
const verdict = { result, headSha: plan.headSha, skillSha, pr, reasons };
|
|
308
|
-
const text = markdown(skill, verdict, {
|
|
309
|
-
plan,
|
|
310
|
-
judgement,
|
|
311
|
-
journeys,
|
|
312
|
-
formal,
|
|
313
|
-
timing: summarize(readTimings(state.evidence)),
|
|
314
|
-
reasons,
|
|
315
|
-
attention,
|
|
316
|
-
});
|
|
317
|
-
writeFileSync(join(state.evidence, "verdict.md"), text);
|
|
318
|
-
writeFileSync(
|
|
319
|
-
join(state.evidence, "plan.json"),
|
|
320
|
-
`${JSON.stringify(plan, null, 2)}\n`,
|
|
321
|
-
);
|
|
322
|
-
writeFileSync(
|
|
323
|
-
join(state.evidence, "verdict.json"),
|
|
324
|
-
`${JSON.stringify(verdict, null, 2)}\n`,
|
|
325
|
-
);
|
|
326
|
-
return { ...verdict, markdown: text };
|
|
327
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const path = require("node:path");
|
|
4
|
-
const { createRequire } = require("node:module");
|
|
5
|
-
/** @type {(id: string) => typeof import("esbuild")} */
|
|
6
|
-
const loadEsbuild = createRequire(require.resolve("vite/package.json"));
|
|
7
|
-
const { buildSync } = loadEsbuild("esbuild");
|
|
8
|
-
|
|
9
|
-
/** @param {string} outfile */
|
|
10
|
-
function captureProbe(outfile) {
|
|
11
|
-
buildSync({
|
|
12
|
-
entryPoints: [path.join(__dirname, "frontend-behavior.cjs")],
|
|
13
|
-
outfile,
|
|
14
|
-
bundle: true,
|
|
15
|
-
platform: "node",
|
|
16
|
-
format: "cjs",
|
|
17
|
-
logLevel: "silent",
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
module.exports = { captureProbe };
|
|
22
|
-
|
|
23
|
-
if (require.main === module) captureProbe(path.resolve(process.argv[2]));
|