Skip to content

Commit 92bcf05

Browse files
committed
feat: add field files
1 parent 0397fa9 commit 92bcf05

22 files changed

Lines changed: 36305 additions & 0 deletions

scripts/update-index.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { exec } from "node:child_process";
2+
import { readdir, writeFile } from "node:fs/promises";
3+
import process from "node:process";
4+
import { promisify } from "node:util";
5+
6+
const execAsync = promisify(exec);
7+
8+
async function run() {
9+
console.log("updating index.ts...");
10+
let files = await readdir("./src");
11+
files = files.filter((file) => file.endsWith(".ts") && file !== "index.ts");
12+
13+
const content = `// This file is auto-generated by scripts/update-index.ts
14+
// Do not edit this file directly.
15+
16+
${files.map((file) => `export * as ${file.replace(".ts", "").replace(".", "_")} from './${file.replace(".ts", "")}';`).join("\n")}
17+
`;
18+
19+
// update index.ts
20+
await writeFile("./src/index.ts", content, {
21+
encoding: "utf-8",
22+
});
23+
24+
await execAsync("npx eslint ./src/index.ts --fix");
25+
26+
console.log("index.ts updated successfully!");
27+
}
28+
29+
run().catch((error) => {
30+
console.error(error);
31+
process.exit(1);
32+
});

src/index.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// This file is auto-generated by scripts/update-index.ts
2+
// Do not edit this file directly.
3+
4+
export * as v4_1 from "./v4.1";
5+
export * as v5 from "./v5";
6+
export * as v5_1 from "./v5.1";
7+
export * as v5_2 from "./v5.2";
8+
export * as v6 from "./v6";
9+
export * as v6_1 from "./v6.1";
10+
export * as v6_2 from "./v6.2";
11+
export * as v6_3 from "./v6.3";
12+
export * as v7 from "./v7";
13+
export * as v8 from "./v8";
14+
export * as v9 from "./v9";
15+
export * as v10 from "./v10";
16+
export * as v11 from "./v11";
17+
export * as v12 from "./v12";
18+
export * as v12_1 from "./v12.1";
19+
export * as v13 from "./v13";
20+
export * as v14 from "./v14";
21+
export * as v15 from "./v15";
22+
export * as v15_1 from "./v15.1";
23+
export * as v16 from "./v16";

0 commit comments

Comments
 (0)