-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
33 lines (27 loc) · 834 Bytes
/
index.ts
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
import ora from "ora";
import { Options, TComputedTypeMap } from "./src/types/types";
import { readConfig } from "./src/getFiles";
import { showPrompt } from "./src/prompt";
import { processDirectory } from "./src";
export const currentDirectory = process.cwd();
const spinner = ora({
text: "Doing some stuff...",
spinner: "fingerDance",
}).start();
const buildTypesMap = (options: Options): Promise<TComputedTypeMap> => {
return new Promise((resolve) => {
const computedTypeMap = processDirectory(currentDirectory, options);
resolve(computedTypeMap);
});
};
const start = async () => {
const options = readConfig();
const computedTypeMap = await buildTypesMap(options);
spinner.stop();
try {
await showPrompt(computedTypeMap, options.strict);
} catch (err) {
console.log(err);
}
};
start();