sedum-cli 0.1.0-alpha.17 → 0.1.0-alpha.20
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 +65 -0
- package/dist/{affected-selection-KRK5HRF4.js → affected-selection-NTBVWIK5.js} +8 -50
- package/dist/auth-command-TSTYIWGX.js +634 -0
- package/dist/{chunk-GJ5QI7JQ.js → chunk-CGDXQY2Y.js} +1 -1
- package/dist/{chunk-F4RD4S4P.js → chunk-DXNJ3PGB.js} +41 -17
- package/dist/{chunk-ACDJLEMS.js → chunk-FOGLJA3Z.js} +56 -24
- package/dist/{chunk-OKZ6VJKA.js → chunk-J7CLCLHW.js} +266 -151
- package/dist/chunk-JYWNBHN7.js +109 -0
- package/dist/{chunk-A7HBQLEM.js → chunk-KMWECJ4D.js} +158 -64
- package/dist/chunk-NIUOM3FA.js +50 -0
- package/dist/{chunk-ZAACPFCW.js → chunk-QVCT63FH.js} +1 -1
- package/dist/cli.js +10 -4
- package/dist/cloud-command-YYQ47FTU.js +329 -0
- package/dist/cloud-upload-IGNNU5WX.js +243 -0
- package/dist/{doctor-command-KIGPIDQA.js → doctor-command-OFMURNPN.js} +5 -3
- package/dist/{explore-command-NRRJADY4.js → explore-command-KMS6UAPM.js} +3 -2
- package/dist/index.d.ts +16 -0
- package/dist/index.js +5 -4
- package/dist/{init-command-DEEVMROG.js → init-command-IXR3YUQW.js} +3 -3
- package/dist/{run-command-EVUWZI4F.js → run-command-WYSLSLYM.js} +10 -7
- package/package.json +6 -5
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AuthError
|
|
3
|
+
} from "./chunk-JYWNBHN7.js";
|
|
1
4
|
import {
|
|
2
5
|
collectText,
|
|
3
6
|
exploreMode,
|
|
4
7
|
seedValue,
|
|
5
8
|
startUrl,
|
|
6
9
|
watchOrigin
|
|
7
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FOGLJA3Z.js";
|
|
8
11
|
import {
|
|
9
12
|
MAX_PARALLEL,
|
|
10
13
|
clearLocatorCache,
|
|
@@ -16,13 +19,13 @@ import {
|
|
|
16
19
|
import {
|
|
17
20
|
configDiagnostic,
|
|
18
21
|
renderDiagnostic
|
|
19
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-CGDXQY2Y.js";
|
|
20
23
|
import {
|
|
21
24
|
ProjectConfigError,
|
|
22
25
|
discoverConfiguredTests,
|
|
23
26
|
loadProjectConfig,
|
|
24
27
|
validAffectedGlob
|
|
25
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-J7CLCLHW.js";
|
|
26
29
|
|
|
27
30
|
// src/invocation.ts
|
|
28
31
|
function sedumCommand(env = process.env, script = process.argv[1] ?? "") {
|
|
@@ -30,7 +33,7 @@ function sedumCommand(env = process.env, script = process.argv[1] ?? "") {
|
|
|
30
33
|
return "npx sedum";
|
|
31
34
|
return /[\\/]node_modules[\\/]/.test(script) ? "npx sedum" : "sedum";
|
|
32
35
|
}
|
|
33
|
-
var SUBCOMMAND = /(?<![\w./-]|npx )sedum (?=(?:run|browsers|doctor|validate|init|list)\b|--help\b|--version\b)/g;
|
|
36
|
+
var SUBCOMMAND = /(?<![\w./-]|npx )sedum (?=(?:run|runs|tests|browsers|doctor|validate|init|list|auth)\b|--help\b|--version\b)/g;
|
|
34
37
|
function withCommand(text, command) {
|
|
35
38
|
return command === "sedum" ? text : text.replace(SUBCOMMAND, `${command} `);
|
|
36
39
|
}
|
|
@@ -365,7 +368,7 @@ async function loadProjectContext(paths, cwd) {
|
|
|
365
368
|
}
|
|
366
369
|
function renderConfigErrors(errors, cwd) {
|
|
367
370
|
return errors.map((item) => {
|
|
368
|
-
const file = path.relative(cwd, item.file).split(path.sep).join("/");
|
|
371
|
+
const file = path.isAbsolute(item.file) ? path.relative(cwd, item.file).split(path.sep).join("/") : item.file;
|
|
369
372
|
return `${file}:${item.line}:${item.col}: error ${item.code}: ${item.message}
|
|
370
373
|
Fix: ${item.fix}
|
|
371
374
|
`;
|
|
@@ -858,25 +861,21 @@ async function runCli(args, version, runtime = {}) {
|
|
|
858
861
|
const writeOut = (value) => rawOut(withCommand(value, command));
|
|
859
862
|
const writeErr = (value) => rawErr(withCommand(value, command));
|
|
860
863
|
const capabilities = runtime.capabilities ?? plainOutput;
|
|
861
|
-
const executeRun = runtime.executeRun ?? (async (options) => (await import("./run-command-
|
|
864
|
+
const executeRun = runtime.executeRun ?? (async (options) => (await import("./run-command-WYSLSLYM.js")).executeRunCommand(options));
|
|
862
865
|
const cwd = runtime.cwd ?? process.cwd();
|
|
863
866
|
let exitCode = 3;
|
|
864
|
-
const program =
|
|
865
|
-
|
|
866
|
-
|
|
867
|
+
const program = createProgram(version, writeOut, writeErr);
|
|
868
|
+
await registerAccountCommands(program, runtime, {
|
|
869
|
+
rawOut,
|
|
867
870
|
writeOut,
|
|
868
871
|
writeErr,
|
|
869
|
-
|
|
870
|
-
})
|
|
871
|
-
"after",
|
|
872
|
-
"\nExamples:\n sedum init\n sedum run tests/login.test.yaml\n sedum validate\n sedum list --json\n sedum doctor --json\n sedum browsers install chromium\n\nExit codes:\n 0 passed\n 1 failed test (validate and list: invalid test files)\n 2 flagged pass with --strict\n 3 command or operational error\n"
|
|
873
|
-
);
|
|
874
|
-
program.action(() => commandHelp(program, writeErr));
|
|
872
|
+
setExitCode: (value) => exitCode = value
|
|
873
|
+
});
|
|
875
874
|
program.command("init").description("scaffold a runnable Sedum project in the current directory").addHelpText(
|
|
876
875
|
"after",
|
|
877
876
|
"\nCreates a config, a SauceDemo example, .env.example, and ignore rules.\nExisting files are never replaced.\n"
|
|
878
877
|
).action(async () => {
|
|
879
|
-
const { executeInitCommand } = await import("./init-command-
|
|
878
|
+
const { executeInitCommand } = await import("./init-command-IXR3YUQW.js");
|
|
880
879
|
const interactive = capabilities.stdoutIsTTY && (process.stdin.isTTY === true || runtime.confirmInit !== void 0);
|
|
881
880
|
const confirm = runtime.confirmInit ?? (interactive ? async (question) => {
|
|
882
881
|
const { createInterface } = await import("readline/promises");
|
|
@@ -982,7 +981,7 @@ async function runCli(args, version, runtime = {}) {
|
|
|
982
981
|
"--provider-concurrency <n>",
|
|
983
982
|
"cap concurrent model-provider requests (default min(4, 2 x lanes))",
|
|
984
983
|
positiveCount(32)
|
|
985
|
-
).option("--replay", "capture replay frames for executed steps", false).option("--no-evidence", "disable non-passing evidence frames").option("--no-locator-cache", "disable the local locator cache").option("--locator-cache-ci", "enable the local locator cache in CI", false).option(
|
|
984
|
+
).option("--replay", "capture replay frames for executed steps", false).option("--no-evidence", "disable non-passing evidence frames").option("--no-cloud", "disable automatic upload to Sedum Cloud").option("--no-locator-cache", "disable the local locator cache").option("--locator-cache-ci", "enable the local locator cache in CI", false).option(
|
|
986
985
|
"--sensitive-origin <url>",
|
|
987
986
|
"omit sensitive page details and frames (repeatable)",
|
|
988
987
|
collectOrigin,
|
|
@@ -1040,7 +1039,7 @@ async function runCli(args, version, runtime = {}) {
|
|
|
1040
1039
|
return;
|
|
1041
1040
|
}
|
|
1042
1041
|
if (options.affected) {
|
|
1043
|
-
const { selectAffectedTests, AffectedSelectionError } = await import("./affected-selection-
|
|
1042
|
+
const { selectAffectedTests, AffectedSelectionError } = await import("./affected-selection-NTBVWIK5.js");
|
|
1044
1043
|
const { ProviderError: ProviderError2 } = await import("@sedum-dev/core");
|
|
1045
1044
|
writeErr(
|
|
1046
1045
|
"Experimental selection sends the committed Git diff and complete test/module sources to the configured provider. Tracked local edits are refused. Full CI is still recommended.\n"
|
|
@@ -1129,6 +1128,7 @@ No tests were run. Fix the selection error or run without --affected.
|
|
|
1129
1128
|
if (output) writeOut(output);
|
|
1130
1129
|
}
|
|
1131
1130
|
};
|
|
1131
|
+
const upload = options.cloud ? await (await import("./cloud-upload-IGNNU5WX.js")).prepareCloudUpload(process.cwd()) : void 0;
|
|
1132
1132
|
const execution = await executeRun({
|
|
1133
1133
|
command,
|
|
1134
1134
|
...runtime.onStrayRejection ? { onStrayRejection: runtime.onStrayRejection } : {},
|
|
@@ -1173,38 +1173,29 @@ No tests were run. Fix the selection error or run without --affected.
|
|
|
1173
1173
|
...runtime.onRunDeadline ? { onDeadline: runtime.onRunDeadline } : {},
|
|
1174
1174
|
onSnapshot: emit
|
|
1175
1175
|
});
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
code: "reporter_output_error",
|
|
1200
|
-
message: "The selected reporter could not write output.",
|
|
1201
|
-
fix: "Check terminal output access and rerun the command."
|
|
1202
|
-
}
|
|
1203
|
-
)
|
|
1204
|
-
);
|
|
1205
|
-
exitCode = 3;
|
|
1206
|
-
return;
|
|
1207
|
-
}
|
|
1176
|
+
try {
|
|
1177
|
+
writeFinalRunReport(execution, {
|
|
1178
|
+
reporters,
|
|
1179
|
+
emit,
|
|
1180
|
+
context,
|
|
1181
|
+
writeOut,
|
|
1182
|
+
capabilities,
|
|
1183
|
+
showCosts: options.costs
|
|
1184
|
+
});
|
|
1185
|
+
} catch {
|
|
1186
|
+
const failure = await execution.onReporterFailure?.();
|
|
1187
|
+
if (upload && failure) writeErr(await upload(failure));
|
|
1188
|
+
writeErr(
|
|
1189
|
+
renderDiagnostic(
|
|
1190
|
+
failure?.diagnostic ?? {
|
|
1191
|
+
code: "reporter_output_error",
|
|
1192
|
+
message: "The selected reporter could not write output.",
|
|
1193
|
+
fix: "Check terminal output access and rerun the command."
|
|
1194
|
+
}
|
|
1195
|
+
)
|
|
1196
|
+
);
|
|
1197
|
+
exitCode = 3;
|
|
1198
|
+
return;
|
|
1208
1199
|
}
|
|
1209
1200
|
if (!reporters.length && execution.artifacts.authoritative && execution.artifacts.markdownPath) {
|
|
1210
1201
|
writeOut(`markdown ${execution.artifacts.markdownPath}
|
|
@@ -1215,6 +1206,7 @@ No tests were run. Fix the selection error or run without --affected.
|
|
|
1215
1206
|
}
|
|
1216
1207
|
if (execution.diagnostic)
|
|
1217
1208
|
writeErr(renderDiagnostic(execution.diagnostic));
|
|
1209
|
+
if (upload) writeErr(await upload(execution));
|
|
1218
1210
|
exitCode = runExitCode(execution.result, options.strict);
|
|
1219
1211
|
}
|
|
1220
1212
|
);
|
|
@@ -1288,7 +1280,7 @@ No tests were run. Fix the selection error or run without --affected.
|
|
|
1288
1280
|
"after",
|
|
1289
1281
|
"\nGuided mode and --shrink make billable TypeSafe calls (TYPESAFE_API_KEY).\nSafety is off by default, for disposable staging: exploration clicks real buttons\nand completes forms. Use --safe on shared or production-like data.\n\nWrites trace.jsonl, result.json, report.md and report.html into --out/<run-id>/.\n\nExamples:\n sedum explore https://staging.example.com --steps 200 --seed 7 --replay\n sedum explore https://staging.example.com --safe --shrink\n sedum explore --rerun .sedum/explore/<run>/trace.jsonl\n\nExit codes:\n 0 no failures observed\n 1 console errors, page exceptions or HTTP 5xx observed\n 3 command or operational error\n"
|
|
1290
1282
|
).action(async (url, options) => {
|
|
1291
|
-
const { exploreAction } = await import("./explore-command-
|
|
1283
|
+
const { exploreAction } = await import("./explore-command-KMS6UAPM.js");
|
|
1292
1284
|
exitCode = await exploreAction(url, options, {
|
|
1293
1285
|
cwd,
|
|
1294
1286
|
write: writeOut,
|
|
@@ -1305,22 +1297,24 @@ No tests were run. Fix the selection error or run without --affected.
|
|
|
1305
1297
|
);
|
|
1306
1298
|
exitCode = 0;
|
|
1307
1299
|
});
|
|
1308
|
-
program.command("doctor").description("check whether this environment can run Sedum").option("--env <name>", "select a named environment").option("--json", "print versioned JSON checks on stdout", false).addHelpText(
|
|
1300
|
+
program.command("doctor").description("check whether this environment can run Sedum").option("--env <name>", "select a named environment").option("--browser <kind>", "chrome or chromium").option("--json", "print versioned JSON checks on stdout", false).addHelpText(
|
|
1309
1301
|
"after",
|
|
1310
1302
|
"\nThe authenticated API check makes one small, potentially billable request.\n\nExit codes:\n 0 all checks passed\n 3 one or more prerequisites failed\n"
|
|
1311
|
-
).action(
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1303
|
+
).action(
|
|
1304
|
+
async (options) => {
|
|
1305
|
+
const { doctorOptions, executeDoctorCommand, renderDoctorText } = await import("./doctor-command-OFMURNPN.js");
|
|
1306
|
+
const result = await executeDoctorCommand(
|
|
1307
|
+
cwd,
|
|
1308
|
+
runtime.doctorProbes,
|
|
1309
|
+
doctorOptions(options)
|
|
1310
|
+
);
|
|
1311
|
+
writeOut(
|
|
1312
|
+
options.json ? `${JSON.stringify(result)}
|
|
1320
1313
|
` : renderDoctorText(result)
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1314
|
+
);
|
|
1315
|
+
exitCode = result.checks.every((check) => check.status === "pass") ? 0 : 3;
|
|
1316
|
+
}
|
|
1317
|
+
);
|
|
1324
1318
|
program.command("validate").description(
|
|
1325
1319
|
"check tests and modules without a browser or model key (offline by default)"
|
|
1326
1320
|
).argument(
|
|
@@ -1433,6 +1427,106 @@ Fix: rerun the command; if it happens again, report it with the run's result.jso
|
|
|
1433
1427
|
}
|
|
1434
1428
|
return { stdout: stdout.join(""), stderr: stderr.join(""), exitCode };
|
|
1435
1429
|
}
|
|
1430
|
+
function createProgram(version, writeOut, writeErr) {
|
|
1431
|
+
const program = new Command2().name("sedum").description(
|
|
1432
|
+
"Run plain-English browser tests with deterministic automation."
|
|
1433
|
+
).version(version, "-v, --version", "print the installed Sedum version").helpOption("-h, --help", "show command help").showSuggestionAfterError().showHelpAfterError("Run `sedum --help` to see available commands.").exitOverride().configureOutput({
|
|
1434
|
+
writeOut,
|
|
1435
|
+
writeErr,
|
|
1436
|
+
outputError: (value, write) => write(value)
|
|
1437
|
+
}).addHelpText(
|
|
1438
|
+
"after",
|
|
1439
|
+
"\nExamples:\n sedum init\n sedum run tests/login.test.yaml\n sedum validate\n sedum list --json\n sedum doctor --json\n sedum browsers install chromium\n sedum auth login --url <Cloud origin>\n\nExit codes:\n 0 passed\n 1 failed test (validate and list: invalid test files)\n 2 flagged pass with --strict\n 3 command or operational error\n"
|
|
1440
|
+
);
|
|
1441
|
+
program.action(() => commandHelp(program, writeErr));
|
|
1442
|
+
return program;
|
|
1443
|
+
}
|
|
1444
|
+
async function registerAccountCommands(program, runtime, output) {
|
|
1445
|
+
const { writeOut, writeErr } = output;
|
|
1446
|
+
const auth = program.command("auth").description(
|
|
1447
|
+
"manage Cloud account sessions (separate from CI upload tokens)"
|
|
1448
|
+
);
|
|
1449
|
+
auth.action(() => commandHelp(auth, writeErr));
|
|
1450
|
+
for (const name of ["login", "status", "logout"]) {
|
|
1451
|
+
auth.command(name).description(`${name} a Cloud account session`).option("--url <origin>", "self-hosted Cloud origin (or SEDUM_CLOUD_URL)").option("--organization <id-or-name>", "select current organization").option("--project <id-or-name>", "select current project").option(
|
|
1452
|
+
"--no-browser",
|
|
1453
|
+
"print activation instructions without opening a browser"
|
|
1454
|
+
).action(async (options) => {
|
|
1455
|
+
const { executeAuthCommand } = await import("./auth-command-TSTYIWGX.js");
|
|
1456
|
+
const interactive = (runtime.capabilities ?? plainOutput).stdoutIsTTY && process.stdin.isTTY === true;
|
|
1457
|
+
const choose = runtime.auth?.choose ?? (interactive ? promptAuthChoice(writeOut) : void 0);
|
|
1458
|
+
output.setExitCode(
|
|
1459
|
+
await executeAuthCommand(
|
|
1460
|
+
name,
|
|
1461
|
+
{
|
|
1462
|
+
options,
|
|
1463
|
+
runtime: { ...runtime.auth, ...choose ? { choose } : {} },
|
|
1464
|
+
write: writeOut,
|
|
1465
|
+
writeErr
|
|
1466
|
+
},
|
|
1467
|
+
runtime.signal
|
|
1468
|
+
)
|
|
1469
|
+
);
|
|
1470
|
+
});
|
|
1471
|
+
}
|
|
1472
|
+
const { registerCloudCommands } = await import("./cloud-command-YYQ47FTU.js");
|
|
1473
|
+
registerCloudCommands(program, runtime, output);
|
|
1474
|
+
}
|
|
1475
|
+
function promptAuthChoice(writeOut) {
|
|
1476
|
+
return async (kind, choices, signal) => {
|
|
1477
|
+
const { createInterface } = await import("readline/promises");
|
|
1478
|
+
const prompt = createInterface({
|
|
1479
|
+
input: process.stdin,
|
|
1480
|
+
output: process.stdout
|
|
1481
|
+
});
|
|
1482
|
+
const controller = new AbortController();
|
|
1483
|
+
const cancel = () => controller.abort();
|
|
1484
|
+
prompt.on("close", cancel);
|
|
1485
|
+
prompt.on("SIGINT", cancel);
|
|
1486
|
+
try {
|
|
1487
|
+
choices.forEach(
|
|
1488
|
+
(item, index) => writeOut(
|
|
1489
|
+
`${index + 1}. ${JSON.stringify(item.name)} (${JSON.stringify(item.id)})
|
|
1490
|
+
`
|
|
1491
|
+
)
|
|
1492
|
+
);
|
|
1493
|
+
const answer = await prompt.question(`Select ${kind} number: `, {
|
|
1494
|
+
signal: AbortSignal.any([signal, controller.signal])
|
|
1495
|
+
});
|
|
1496
|
+
return choices[Number(answer) - 1]?.id ?? "";
|
|
1497
|
+
} catch (error) {
|
|
1498
|
+
throw choiceFailure(error, [signal, controller.signal]);
|
|
1499
|
+
} finally {
|
|
1500
|
+
prompt.close();
|
|
1501
|
+
}
|
|
1502
|
+
};
|
|
1503
|
+
}
|
|
1504
|
+
function choiceFailure(error, signals) {
|
|
1505
|
+
if (signals.some((signal) => signal.aborted))
|
|
1506
|
+
return new AuthError("Authentication cancelled.");
|
|
1507
|
+
if (error instanceof Error && error.name === "AbortError")
|
|
1508
|
+
return new AuthError("Authentication cancelled.");
|
|
1509
|
+
return error;
|
|
1510
|
+
}
|
|
1511
|
+
function writeFinalRunReport(execution, output) {
|
|
1512
|
+
if (execution.reporterFailed || !output.reporters.length) return;
|
|
1513
|
+
output.emit(execution.result, execution.artifacts);
|
|
1514
|
+
output.writeOut(
|
|
1515
|
+
renderRunSummary(
|
|
1516
|
+
execution.result,
|
|
1517
|
+
output.capabilities,
|
|
1518
|
+
execution.artifacts,
|
|
1519
|
+
output.showCosts
|
|
1520
|
+
)
|
|
1521
|
+
);
|
|
1522
|
+
for (const [index, reporter] of output.reporters.entries()) {
|
|
1523
|
+
const text = reporter.onResult(execution.result, {
|
|
1524
|
+
...output.context(execution.artifacts),
|
|
1525
|
+
includeSharedSummary: index === 0
|
|
1526
|
+
});
|
|
1527
|
+
if (text) output.writeOut(text);
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1436
1530
|
|
|
1437
1531
|
export {
|
|
1438
1532
|
sedumCommand,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/affected-git-read.ts
|
|
2
|
+
import { spawn } from "child_process";
|
|
3
|
+
import { isUtf8 } from "buffer";
|
|
4
|
+
var MAX_DIFF_BYTES = 16 * 1024 * 1024;
|
|
5
|
+
var AffectedSelectionError = class extends Error {
|
|
6
|
+
};
|
|
7
|
+
function gitRead(cwd, args, signal, limit = MAX_DIFF_BYTES) {
|
|
8
|
+
return new Promise((resolve, reject) => {
|
|
9
|
+
const child = spawn("git", args, {
|
|
10
|
+
cwd,
|
|
11
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
12
|
+
env: { ...process.env, GIT_OPTIONAL_LOCKS: "0" },
|
|
13
|
+
...signal ? { signal } : {}
|
|
14
|
+
});
|
|
15
|
+
const buffers = [];
|
|
16
|
+
let bytes = 0;
|
|
17
|
+
let exceeded = false;
|
|
18
|
+
child.stdout.on("data", (buffer) => {
|
|
19
|
+
bytes += buffer.length;
|
|
20
|
+
if (bytes > limit) {
|
|
21
|
+
exceeded = true;
|
|
22
|
+
child.kill();
|
|
23
|
+
} else buffers.push(buffer);
|
|
24
|
+
});
|
|
25
|
+
child.on("error", reject);
|
|
26
|
+
child.on("close", (code) => {
|
|
27
|
+
if (exceeded)
|
|
28
|
+
reject(
|
|
29
|
+
new AffectedSelectionError(
|
|
30
|
+
"Retained Git input exceeds the 16 MiB guard. Run the full suite; input was not truncated."
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
else if (code !== 0) reject(new Error("Git read failed"));
|
|
34
|
+
else resolve(Buffer.concat(buffers));
|
|
35
|
+
});
|
|
36
|
+
}).then(decodeGitOutput);
|
|
37
|
+
}
|
|
38
|
+
function decodeGitOutput(output) {
|
|
39
|
+
if (!isUtf8(output))
|
|
40
|
+
throw new AffectedSelectionError(
|
|
41
|
+
"Git input is not valid UTF-8. Run the full suite."
|
|
42
|
+
);
|
|
43
|
+
return output.toString("utf8");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
MAX_DIFF_BYTES,
|
|
48
|
+
AffectedSelectionError,
|
|
49
|
+
gitRead
|
|
50
|
+
};
|
package/dist/cli.js
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runCli,
|
|
4
4
|
sedumCommand
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-KMWECJ4D.js";
|
|
6
|
+
import "./chunk-JYWNBHN7.js";
|
|
7
|
+
import "./chunk-FOGLJA3Z.js";
|
|
7
8
|
import "./chunk-EFRMSNBD.js";
|
|
8
9
|
import "./chunk-N5CTUO2A.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-CGDXQY2Y.js";
|
|
11
|
+
import "./chunk-J7CLCLHW.js";
|
|
11
12
|
|
|
12
13
|
// src/cli.ts
|
|
13
14
|
import { createRequire } from "module";
|
|
@@ -60,6 +61,11 @@ process.on("unhandledRejection", (reason) => {
|
|
|
60
61
|
`A promise nobody awaited rejected outside any running test: ${describeRejection(reason)}`
|
|
61
62
|
);
|
|
62
63
|
});
|
|
64
|
+
var ignoreClosedPipe = (error) => {
|
|
65
|
+
if (error.code !== "EPIPE") throw error;
|
|
66
|
+
};
|
|
67
|
+
process.stdout.on("error", ignoreClosedPipe);
|
|
68
|
+
process.stderr.on("error", ignoreClosedPipe);
|
|
63
69
|
var onSigint = () => interrupts.request("SIGINT");
|
|
64
70
|
var onSigterm = () => interrupts.request("SIGTERM");
|
|
65
71
|
process.on("SIGINT", onSigint);
|