Lines 3412-3452javascript
3413 for (const m of raw.matchAll(SID_RE)) sids.add(m[1].toLowerCase());
3414 return { kind, stableIds: [...sids], raw };
3416function matchRepair(refusal, repairs) {
3417 if (refusal.kind === "other") return void 0;
3418 return repairs.find(
3419 (r) => r.matcher.refusal === refusal.kind && refusal.stableIds.includes(r.matcher.stableId.toLowerCase())
3422function knownRepairBlock(repair) {
3425 `\u2726 KNOWN REPAIR: '${repair.id}' (${repair.file}) declares a remedy for exactly this refusal.`,
3426 ` reason: ${repair.reason}`,
3427 " Re-run with --repair to execute it."
3430function resolveTsxCli(cwd) {
3431 const pkgDir = (name, fromDir) => {
3433 return dirname2(createRequire(pathToFileURL(join3(fromDir, "noop.js")).href).resolve(`${name}/package.json`));
3434 } catch {
MediumDynamic Require
Package source references dynamic require/import behavior.
dist/cli.mjsView on unpkg · L3432 3438 const dslDir = pkgDir("@githolon/dsl", cwd) ?? (() => {
3440 return dirname2(createRequire(import.meta.url).resolve("@githolon/dsl/package.json"));
3445 const tsxDir = pkgDir("tsx", cwd) ?? (dslDir !== void 0 ? pkgDir("tsx", dslDir) : void 0);
3446 if (tsxDir === void 0) return void 0;
3448 const pkg = JSON.parse(
3449 readFileSync2(join3(tsxDir, "package.json"), "utf8")
3451 const rel = typeof pkg.bin === "string" ? pkg.bin : pkg.bin?.["tsx"];
3452 return join3(tsxDir, rel ?? "dist/cli.mjs");