forked from bitwarden/clients
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-types.js
39 lines (36 loc) · 1.02 KB
/
test-types.js
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
const concurrently = require("concurrently");
const path = require("path");
const fs = require("fs");
function getFiles(dir) {
results = [];
fs.readdirSync(dir).forEach((file) => {
file = path.join(dir, file);
const stat = fs.statSync(file);
if (stat && stat.isDirectory()) {
results = results.concat(getFiles(file));
} else {
results.push(file);
}
});
return results;
}
const files = getFiles(path.join(__dirname, "..", "libs"))
.filter((file) => {
const name = path.basename(file);
return name === "tsconfig.spec.json";
})
.filter((path) => {
// Exclude shared since it's not actually a library
return !path.includes("libs/shared/");
});
concurrently([
{
// run the strict type check plugin until we're fully converted, then update tsconfig.json to use strict
name: "typescript-strict-plugin",
command: "npx tsc-strict",
},
...files.map((file) => ({
name: path.basename(path.dirname(file)),
command: `npx tsc --noEmit --project ${file}`,
})),
]);