Lines 2891-2931javascript
2892 for (const m of raw.matchAll(SID_RE)) sids.add(m[1].toLowerCase());
2893 return { kind, stableIds: [...sids], raw };
2895function matchRepair(refusal, repairs) {
2896 if (refusal.kind === "other") return void 0;
2897 return repairs.find(
2898 (r) => r.matcher.refusal === refusal.kind && refusal.stableIds.includes(r.matcher.stableId.toLowerCase())
2901function knownRepairBlock(repair) {
2904 `\u2726 KNOWN REPAIR: '${repair.id}' (${repair.file}) declares a remedy for exactly this refusal.`,
2905 ` reason: ${repair.reason}`,
2906 " Re-run with --repair to execute it."
2909function resolveTsxCli(cwd) {
2910 const pkgDir = (name, fromDir) => {
2912 return dirname2(createRequire(pathToFileURL(join3(fromDir, "noop.js")).href).resolve(`${name}/package.json`));
2913 } catch {
MediumDynamic Require
Package source references dynamic require/import behavior.
dist/cli.mjsView on unpkg · L2911 2917 const dslDir = pkgDir("@githolon/dsl", cwd) ?? (() => {
2919 return dirname2(createRequire(import.meta.url).resolve("@githolon/dsl/package.json"));
2924 const tsxDir = pkgDir("tsx", cwd) ?? (dslDir !== void 0 ? pkgDir("tsx", dslDir) : void 0);
2925 if (tsxDir === void 0) return void 0;
2927 const pkg = JSON.parse(
2928 readFileSync2(join3(tsxDir, "package.json"), "utf8")
2930 const rel = typeof pkg.bin === "string" ? pkg.bin : pkg.bin?.["tsx"];
2931 return join3(tsxDir, rel ?? "dist/cli.mjs");