modality-kit 0.17.6 → 0.17.8

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -15605,16 +15605,19 @@ function recursiveScanForFiles(baseDir, options) {
15605
15605
  searchInSubfolders = false
15606
15606
  } = options;
15607
15607
  const extensionSet = new Set(fileExtensions);
15608
+ const errors3 = [];
15608
15609
  function scanDirectory(dir, relativePath = "", isSearchingForTarget = true) {
15609
- try {
15610
- const entries = readdirSync(dir);
15611
- for (const entry of entries) {
15610
+ const entries = readdirSync(dir);
15611
+ for (const entry of entries) {
15612
+ try {
15612
15613
  if (excludePatterns.some((pattern) => entry.startsWith(pattern))) {
15613
15614
  continue;
15614
15615
  }
15615
15616
  const fullPath = join(dir, entry);
15616
15617
  const relPath = relativePath ? `${relativePath}/${entry}` : entry;
15617
- const isDirectory = statSync(fullPath).isDirectory();
15618
+ const isDirectory = statSync(fullPath, {
15619
+ throwIfNoEntry: false
15620
+ })?.isDirectory();
15618
15621
  if (isSearchingForTarget) {
15619
15622
  if (isDirectory) {
15620
15623
  scanDirectory(fullPath, relPath, entry !== targetFolderName);
@@ -15626,10 +15629,15 @@ function recursiveScanForFiles(baseDir, options) {
15626
15629
  } else if ((!fileExtensions || extensionSet.has(extname(entry))) && fileNameFilter(entry)) {
15627
15630
  files.push({ filename: relPath, fullPath });
15628
15631
  }
15632
+ } catch (e) {
15633
+ errors3.push({ dir: e });
15629
15634
  }
15630
- } catch (e) {}
15635
+ }
15631
15636
  }
15632
15637
  scanDirectory(baseDir, "", true);
15638
+ if (errors3.length > 0) {
15639
+ throw new Error(`Error scanning directory: ${JSON.stringify(errors3)}`);
15640
+ }
15633
15641
  return files.sort((a, b) => a.filename.localeCompare(b.filename));
15634
15642
  }
15635
15643
  export {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.17.6",
2
+ "version": "0.17.8",
3
3
  "name": "modality-kit",
4
4
  "repository": {
5
5
  "type": "git",