@vibgrate/cli 1.0.23 → 1.0.24

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.
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  baselineCommand,
3
3
  runBaseline
4
- } from "./chunk-KQUBDWWG.js";
5
- import "./chunk-PG7GQN5E.js";
4
+ } from "./chunk-NP6ETKET.js";
5
+ import "./chunk-ZFE35ULS.js";
6
6
  export {
7
7
  baselineCommand,
8
8
  runBaseline
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  runScan,
3
3
  writeJsonFile
4
- } from "./chunk-PG7GQN5E.js";
4
+ } from "./chunk-ZFE35ULS.js";
5
5
 
6
6
  // src/commands/baseline.ts
7
7
  import * as path from "path";
@@ -286,21 +286,24 @@ var FileCache = class _FileCache {
286
286
  }
287
287
  let entries;
288
288
  try {
289
- const readPromise = fs.readdir(dir, { withFileTypes: true });
290
- const result = await Promise.race([
291
- readPromise.then((e) => ({ ok: true, entries: e })),
292
- new Promise(
293
- (resolve7) => setTimeout(() => resolve7({ ok: false }), STUCK_TIMEOUT_MS)
294
- )
295
- ]);
296
- if (!result.ok) {
297
- stuckDirs.push(relDir || dir);
298
- return;
299
- }
300
- entries = result.entries;
289
+ entries = await sem.run(async () => {
290
+ const readPromise = fs.readdir(dir, { withFileTypes: true });
291
+ const result = await Promise.race([
292
+ readPromise.then((e) => ({ ok: true, entries: e })),
293
+ new Promise(
294
+ (resolve7) => setTimeout(() => resolve7({ ok: false }), STUCK_TIMEOUT_MS)
295
+ )
296
+ ]);
297
+ if (!result.ok) {
298
+ stuckDirs.push(relDir || dir);
299
+ return null;
300
+ }
301
+ return result.entries;
302
+ });
301
303
  } catch {
302
304
  return;
303
305
  }
306
+ if (!entries) return;
304
307
  const subWalks = [];
305
308
  for (const e of entries) {
306
309
  const absPath = path2.join(dir, e.name);
@@ -309,7 +312,7 @@ var FileCache = class _FileCache {
309
312
  if (e.isDirectory()) {
310
313
  if (SKIP_DIRS.has(e.name) || extraSkip.has(e.name)) continue;
311
314
  results.push({ absPath, relPath, name: e.name, isFile: false, isDirectory: true });
312
- subWalks.push(sem.run(() => walk(absPath)));
315
+ subWalks.push(walk(absPath));
313
316
  } else if (e.isFile()) {
314
317
  const ext = path2.extname(e.name).toLowerCase();
315
318
  if (SKIP_EXTENSIONS.has(ext)) continue;
@@ -323,7 +326,7 @@ var FileCache = class _FileCache {
323
326
  }
324
327
  await Promise.all(subWalks);
325
328
  }
326
- await sem.run(() => walk(rootDir));
329
+ await walk(rootDir);
327
330
  if (onProgress && foundCount !== lastReported) {
328
331
  onProgress(foundCount, "");
329
332
  }
@@ -436,7 +439,7 @@ async function quickTreeCount(rootDir, excludePatterns) {
436
439
  async function count(dir) {
437
440
  let entries;
438
441
  try {
439
- entries = await fs.readdir(dir, { withFileTypes: true });
442
+ entries = await sem.run(() => fs.readdir(dir, { withFileTypes: true }));
440
443
  } catch {
441
444
  return;
442
445
  }
@@ -447,7 +450,7 @@ async function quickTreeCount(rootDir, excludePatterns) {
447
450
  if (e.isDirectory()) {
448
451
  if (SKIP_DIRS.has(e.name) || extraSkip.has(e.name)) continue;
449
452
  totalDirs++;
450
- subs.push(sem.run(() => count(path2.join(dir, e.name))));
453
+ subs.push(count(path2.join(dir, e.name)));
451
454
  } else if (e.isFile()) {
452
455
  const ext = path2.extname(e.name).toLowerCase();
453
456
  if (!SKIP_EXTENSIONS.has(ext)) totalFiles++;
@@ -455,7 +458,7 @@ async function quickTreeCount(rootDir, excludePatterns) {
455
458
  }
456
459
  await Promise.all(subs);
457
460
  }
458
- await sem.run(() => count(rootDir));
461
+ await count(rootDir);
459
462
  return { totalFiles, totalDirs };
460
463
  }
461
464
  async function findFiles(rootDir, predicate) {
@@ -466,7 +469,7 @@ async function findFiles(rootDir, predicate) {
466
469
  async function walk(dir) {
467
470
  let entries;
468
471
  try {
469
- entries = await fs.readdir(dir, { withFileTypes: true });
472
+ entries = await readDirSemaphore.run(() => fs.readdir(dir, { withFileTypes: true }));
470
473
  } catch {
471
474
  return;
472
475
  }
@@ -474,7 +477,7 @@ async function findFiles(rootDir, predicate) {
474
477
  for (const e of entries) {
475
478
  if (e.isDirectory()) {
476
479
  if (SKIP_DIRS.has(e.name)) continue;
477
- subDirectoryWalks.push(readDirSemaphore.run(() => walk(path2.join(dir, e.name))));
480
+ subDirectoryWalks.push(walk(path2.join(dir, e.name)));
478
481
  } else if (e.isFile() && predicate(e.name)) {
479
482
  const ext = path2.extname(e.name).toLowerCase();
480
483
  if (!SKIP_EXTENSIONS.has(ext)) results.push(path2.join(dir, e.name));
@@ -482,7 +485,7 @@ async function findFiles(rootDir, predicate) {
482
485
  }
483
486
  await Promise.all(subDirectoryWalks);
484
487
  }
485
- await readDirSemaphore.run(() => walk(rootDir));
488
+ await walk(rootDir);
486
489
  return results;
487
490
  }
488
491
  async function findPackageJsonFiles(rootDir) {
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-GN3IWKSY.js";
5
5
  import {
6
6
  baselineCommand
7
- } from "./chunk-KQUBDWWG.js";
7
+ } from "./chunk-NP6ETKET.js";
8
8
  import {
9
9
  VERSION,
10
10
  dsnCommand,
@@ -15,7 +15,7 @@ import {
15
15
  readJsonFile,
16
16
  scanCommand,
17
17
  writeDefaultConfig
18
- } from "./chunk-PG7GQN5E.js";
18
+ } from "./chunk-ZFE35ULS.js";
19
19
 
20
20
  // src/cli.ts
21
21
  import { Command as Command4 } from "commander";
@@ -38,7 +38,7 @@ var initCommand = new Command("init").description("Initialize vibgrate in a proj
38
38
  console.log(chalk.green("\u2714") + ` Created ${chalk.bold("vibgrate.config.ts")}`);
39
39
  }
40
40
  if (opts.baseline) {
41
- const { runBaseline } = await import("./baseline-4KY5EKYR.js");
41
+ const { runBaseline } = await import("./baseline-TMD4DPZ2.js");
42
42
  await runBaseline(rootDir);
43
43
  }
44
44
  console.log("");
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  formatText,
8
8
  generateFindings,
9
9
  runScan
10
- } from "./chunk-PG7GQN5E.js";
10
+ } from "./chunk-ZFE35ULS.js";
11
11
  export {
12
12
  computeDriftScore,
13
13
  formatMarkdown,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibgrate/cli",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "CLI for measuring upgrade drift across Node & .NET projects",
5
5
  "type": "module",
6
6
  "bin": {