-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathprepare.ts
More file actions
43 lines (37 loc) 路 1.35 KB
/
Copy pathprepare.ts
File metadata and controls
43 lines (37 loc) 路 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { dirname } from "node:path";
await Bun.$`bun --bun lefthook install --force`.quiet();
const reactRouterConfigGlobs = [
new Bun.Glob("packages/*/react-router.config.ts"),
new Bun.Glob("packages/*/*/react-router.config.ts"),
new Bun.Glob("packages/*/*/*/react-router.config.ts"),
];
const nextConfigGlobs = [
new Bun.Glob("packages/*/next.config.ts"),
new Bun.Glob("packages/*/*/next.config.ts"),
new Bun.Glob("packages/*/*/*/next.config.ts"),
];
const fumadocsConfigGlobs = [
new Bun.Glob("packages/*/source.config.ts"),
new Bun.Glob("packages/*/*/source.config.ts"),
new Bun.Glob("packages/*/*/*/source.config.ts"),
];
const promises: Promise<unknown>[] = [];
for (const glob of reactRouterConfigGlobs) {
for await (const reactRouterConfigFile of glob.scan(".")) {
const dir = dirname(reactRouterConfigFile);
promises.push(Bun.$`bun --bun react-router typegen`.cwd(dir).quiet());
}
}
for (const glob of nextConfigGlobs) {
for await (const nextConfigFile of glob.scan(".")) {
const dir = dirname(nextConfigFile);
promises.push(Bun.$`bun --bun next typegen`.cwd(dir).quiet());
}
}
for (const glob of fumadocsConfigGlobs) {
for await (const fumadocsConfigFile of glob.scan(".")) {
const dir = dirname(fumadocsConfigFile);
promises.push(Bun.$`bun --bun fumadocs-mdx`.cwd(dir).quiet());
}
}
await Promise.all(promises);