Skip to content

Commit 7acc790

Browse files
authored
Fix npm run test:build (#232)
- Update BabelCacheBuster import path in mobx - Improve run-build.mjs so it does not descend into third-party git repos
1 parent 99b925c commit 7acc790

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

mobx/webpack.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { fileURLToPath } from "url";
33
import TerserPlugin from "terser-webpack-plugin";
44
import { LicenseFilePlugin } from "generate-license-file-webpack-plugin";
55

6-
import CacheBusterCommentPlugin from "../startup-helper/BabelCacheBuster.mjs";
6+
import CacheBusterCommentPlugin from "../utils/BabelCacheBuster.mjs";
77

88
const __filename = fileURLToPath(import.meta.url);
99
const __dirname = path.dirname(__filename);

tests/run-build.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,15 @@ async function findPackageJsonFiles(dir, accumulator=[]) {
4343
if (dirent.name === "node_modules" || dirent.name === ".git")
4444
continue;
4545
const fullPath = path.join(dir, dirent.name);
46-
if (dirent.isDirectory())
46+
if (dirent.isDirectory()) {
47+
// Ignore third-party git dirs.
48+
if (fs.existsSync(path.join(fullPath, ".git"))) {
49+
continue;
50+
}
4751
findPackageJsonFiles(fullPath, accumulator);
48-
else if (dirent.name === "package.json")
52+
} else if (dirent.name === "package.json") {
4953
accumulator.push(fullPath)
54+
}
5055
}
5156
return accumulator;
5257
}
@@ -56,6 +61,7 @@ async function runBuilds() {
5661
let success = true;
5762

5863
logInfo(`Found ${packageJsonFiles.length} package.json files`);
64+
console.log(packageJsonFiles)
5965
let filteredPackageJsonFiles = packageJsonFiles;
6066
if (options.changedDirs?.size === 0) {
6167
logInfo("No file changes detected, skipping all");

0 commit comments

Comments
 (0)