mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-30 22:41:33 +01:00
653b730969
Update all libs to use explicit dependencies rather than relying on tsconfig.libs.json. This allows us to more easily understand the dependencies between libs and prevent users from accidentally adding new dependencies. We still use tsconfig.libs (now renamed tsconfig.spec) for tests.
40 lines
1.0 KiB
JavaScript
40 lines
1.0 KiB
JavaScript
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}`,
|
|
})),
|
|
]);
|