@oss-ma/tpl 1.0.34 → 1.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/check.js +19 -4
- package/package.json +1 -1
package/dist/commands/check.js
CHANGED
|
@@ -15,15 +15,30 @@ async function hashFile(filePath) {
|
|
|
15
15
|
const content = await fs.readFile(filePath);
|
|
16
16
|
return crypto.createHash("sha256").update(content).digest("hex");
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
const EXCLUDED_DIRS = new Set([
|
|
19
|
+
"node_modules",
|
|
20
|
+
".git",
|
|
21
|
+
".next",
|
|
22
|
+
"dist",
|
|
23
|
+
"build",
|
|
24
|
+
"coverage",
|
|
25
|
+
".turbo",
|
|
26
|
+
".cache",
|
|
27
|
+
]);
|
|
28
|
+
async function collectFiles(dir, root) {
|
|
29
|
+
const baseDir = root ?? dir;
|
|
19
30
|
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
20
31
|
const results = [];
|
|
21
32
|
for (const entry of entries) {
|
|
33
|
+
if (EXCLUDED_DIRS.has(entry.name))
|
|
34
|
+
continue;
|
|
22
35
|
const full = path.join(dir, entry.name);
|
|
23
|
-
if (entry.isDirectory())
|
|
24
|
-
results.push(...(await collectFiles(full)));
|
|
25
|
-
|
|
36
|
+
if (entry.isDirectory()) {
|
|
37
|
+
results.push(...(await collectFiles(full, baseDir)));
|
|
38
|
+
}
|
|
39
|
+
else if (entry.isFile()) {
|
|
26
40
|
results.push(full);
|
|
41
|
+
}
|
|
27
42
|
}
|
|
28
43
|
return results.sort();
|
|
29
44
|
}
|