Lines 2972-3012javascript
2973 for (const m of raw.matchAll(SID_RE)) sids.add(m[1].toLowerCase());
2974 return { kind, stableIds: [...sids], raw };
2976function matchRepair(refusal, repairs) {
2977 if (refusal.kind === "other") return void 0;
2978 return repairs.find(
2979 (r) => r.matcher.refusal === refusal.kind && refusal.stableIds.includes(r.matcher.stableId.toLowerCase())
2982function knownRepairBlock(repair) {
2985 `\u2726 KNOWN REPAIR: '${repair.id}' (${repair.file}) declares a remedy for exactly this refusal.`,
2986 ` reason: ${repair.reason}`,
2987 " Re-run with --repair to execute it."
2990function resolveTsxCli(cwd) {
2991 const pkgDir = (name, fromDir) => {
2993 return dirname2(createRequire(pathToFileURL(join3(fromDir, "noop.js")).href).resolve(`${name}/package.json`));
2994 } catch {
MediumDynamic Require
Package source references dynamic require/import behavior.
dist/cli.mjsView on unpkg · L2992 2998 const dslDir = pkgDir("@githolon/dsl", cwd) ?? (() => {
3000 return dirname2(createRequire(import.meta.url).resolve("@githolon/dsl/package.json"));
3005 const tsxDir = pkgDir("tsx", cwd) ?? (dslDir !== void 0 ? pkgDir("tsx", dslDir) : void 0);
3006 if (tsxDir === void 0) return void 0;
3008 const pkg = JSON.parse(
3009 readFileSync2(join3(tsxDir, "package.json"), "utf8")
3011 const rel = typeof pkg.bin === "string" ? pkg.bin : pkg.bin?.["tsx"];
3012 return join3(tsxDir, rel ?? "dist/cli.mjs");