前端初始化

This commit is contained in:
“hsc”
2026-08-21 15:36:24 +08:00
commit e4d8ecde13
14411 changed files with 2275932 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
import { a as Diagnostic } from "../diagnostic-wduO7saY.mjs";
//#region src/formatters/ansi.d.ts
interface Colors {
red: (s: string) => string;
yellow: (s: string) => string;
cyan: (s: string) => string;
gray: (s: string) => string;
bold: (s: string) => string;
dim: (s: string) => string;
}
declare function ansiFormatter(colors: Colors): (d: Diagnostic) => string;
//#endregion
export { Colors, ansiFormatter };
//# sourceMappingURL=ansi.d.mts.map
+19
View File
@@ -0,0 +1,19 @@
//#region src/formatters/ansi.ts
/* @__NO_SIDE_EFFECTS__ */
function ansiFormatter(colors) {
return (d) => {
const header = `${colors.bold(colors.red(`[${d.name}]`))} ${d.message}`;
const details = [];
if (d.fix) details.push(`${colors.dim("fix:")} ${d.fix}`);
if (d.sources?.length) details.push(`${colors.dim("sources:")} ${d.sources.join(", ")}`);
if (d.docs) details.push(`${colors.dim("see:")} ${colors.cyan(d.docs)}`);
if (details.length === 0) return header;
return [header, ...details.map((detail, i) => {
return `${colors.dim(i < details.length - 1 ? "├▶" : "╰▶")} ${detail}`;
})].join("\n");
};
}
//#endregion
export { ansiFormatter };
//# sourceMappingURL=ansi.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"ansi.mjs","names":[],"sources":["../../src/formatters/ansi.ts"],"sourcesContent":["import type { Diagnostic } from '../diagnostic'\n\nexport interface Colors {\n red: (s: string) => string\n yellow: (s: string) => string\n cyan: (s: string) => string\n gray: (s: string) => string\n bold: (s: string) => string\n dim: (s: string) => string\n}\n\n/* @__NO_SIDE_EFFECTS__ */\nexport function ansiFormatter(colors: Colors): (d: Diagnostic) => string {\n return (d) => {\n const tag = colors.bold(colors.red(`[${d.name}]`))\n const header = `${tag} ${d.message}`\n\n const details: string[] = []\n if (d.fix)\n details.push(`${colors.dim('fix:')} ${d.fix}`)\n if (d.sources?.length)\n details.push(`${colors.dim('sources:')} ${d.sources.join(', ')}`)\n if (d.docs)\n details.push(`${colors.dim('see:')} ${colors.cyan(d.docs)}`)\n\n if (details.length === 0)\n return header\n\n const lines = details.map((detail, i) => {\n const connector = colors.dim(i < details.length - 1 ? '├▶' : '╰▶')\n return `${connector} ${detail}`\n })\n return [header, ...lines].join('\\n')\n }\n}\n"],"mappings":";;AAYA,SAAgB,cAAc,QAA2C;CACvE,QAAQ,MAAM;EAEZ,MAAM,SAAS,GADH,OAAO,KAAK,OAAO,IAAI,IAAI,EAAE,KAAK,EAAE,CAC5B,EAAE,GAAG,EAAE;EAE3B,MAAM,UAAoB,CAAC;EAC3B,IAAI,EAAE,KACJ,QAAQ,KAAK,GAAG,OAAO,IAAI,MAAM,EAAE,GAAG,EAAE,KAAK;EAC/C,IAAI,EAAE,SAAS,QACb,QAAQ,KAAK,GAAG,OAAO,IAAI,UAAU,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,GAAG;EAClE,IAAI,EAAE,MACJ,QAAQ,KAAK,GAAG,OAAO,IAAI,MAAM,EAAE,GAAG,OAAO,KAAK,EAAE,IAAI,GAAG;EAE7D,IAAI,QAAQ,WAAW,GACrB,OAAO;EAMT,OAAO,CAAC,QAAQ,GAJF,QAAQ,KAAK,QAAQ,MAAM;GAEvC,OAAO,GADW,OAAO,IAAI,IAAI,QAAQ,SAAS,IAAI,OAAO,IAC3C,EAAE,GAAG;EACzB,CACuB,CAAC,CAAC,CAAC,KAAK,IAAI;CACrC;AACF"}
+7
View File
@@ -0,0 +1,7 @@
import { a as Diagnostic } from "../diagnostic-wduO7saY.mjs";
//#region src/formatters/json.d.ts
declare const jsonFormatter: (d: Diagnostic) => string;
//#endregion
export { jsonFormatter };
//# sourceMappingURL=json.d.mts.map
+6
View File
@@ -0,0 +1,6 @@
//#region src/formatters/json.ts
const jsonFormatter = (d) => JSON.stringify(d);
//#endregion
export { jsonFormatter };
//# sourceMappingURL=json.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"json.mjs","names":[],"sources":["../../src/formatters/json.ts"],"sourcesContent":["import type { Diagnostic } from '../diagnostic'\n\nexport const jsonFormatter = (d: Diagnostic): string => JSON.stringify(d)\n"],"mappings":";AAEA,MAAa,iBAAiB,MAA0B,KAAK,UAAU,CAAC"}