@vibgrate/cli 1.0.22 → 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-IMK7DUPY.js";
5
- import "./chunk-JFMGFWKC.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-JFMGFWKC.js";
4
+ } from "./chunk-ZFE35ULS.js";
5
5
 
6
6
  // src/commands/baseline.ts
7
7
  import * as path from "path";
@@ -130,6 +130,80 @@ var SKIP_DIRS = /* @__PURE__ */ new Set([
130
130
  "packages",
131
131
  "TestResults"
132
132
  ]);
133
+ var SKIP_EXTENSIONS = /* @__PURE__ */ new Set([
134
+ // Fonts
135
+ ".woff",
136
+ ".woff2",
137
+ ".ttf",
138
+ ".otf",
139
+ ".eot",
140
+ // Images & vector
141
+ ".png",
142
+ ".jpg",
143
+ ".jpeg",
144
+ ".gif",
145
+ ".ico",
146
+ ".bmp",
147
+ ".tiff",
148
+ ".tif",
149
+ ".webp",
150
+ ".avif",
151
+ ".svg",
152
+ ".heic",
153
+ ".heif",
154
+ ".jfif",
155
+ ".psd",
156
+ ".ai",
157
+ ".eps",
158
+ ".raw",
159
+ ".cr2",
160
+ ".nef",
161
+ ".dng",
162
+ // Video
163
+ ".mp4",
164
+ ".webm",
165
+ ".avi",
166
+ ".mov",
167
+ ".mkv",
168
+ ".wmv",
169
+ ".flv",
170
+ ".m4v",
171
+ ".mpg",
172
+ ".mpeg",
173
+ ".3gp",
174
+ ".ogv",
175
+ // Audio
176
+ ".mp3",
177
+ ".wav",
178
+ ".ogg",
179
+ ".flac",
180
+ ".aac",
181
+ ".wma",
182
+ ".m4a",
183
+ ".opus",
184
+ ".aiff",
185
+ ".mid",
186
+ ".midi",
187
+ // Archives
188
+ ".zip",
189
+ ".tar",
190
+ ".gz",
191
+ ".bz2",
192
+ ".7z",
193
+ ".rar",
194
+ // Compiled / binary
195
+ ".exe",
196
+ ".dll",
197
+ ".so",
198
+ ".dylib",
199
+ ".o",
200
+ ".a",
201
+ ".class",
202
+ ".pyc",
203
+ ".pdb",
204
+ // Source maps & lockfiles (large, not useful for drift analysis)
205
+ ".map"
206
+ ]);
133
207
  var TEXT_CACHE_MAX_BYTES = 1048576;
134
208
  var FileCache = class _FileCache {
135
209
  /** Directory walk results keyed by rootDir */
@@ -207,23 +281,29 @@ var FileCache = class _FileCache {
207
281
  const stuckDirs = this._stuckPaths;
208
282
  async function walk(dir) {
209
283
  const relDir = path2.relative(rootDir, dir);
284
+ if (onProgress) {
285
+ onProgress(foundCount, relDir || ".");
286
+ }
210
287
  let entries;
211
288
  try {
212
- const readPromise = fs.readdir(dir, { withFileTypes: true });
213
- const result = await Promise.race([
214
- readPromise.then((e) => ({ ok: true, entries: e })),
215
- new Promise(
216
- (resolve7) => setTimeout(() => resolve7({ ok: false }), STUCK_TIMEOUT_MS)
217
- )
218
- ]);
219
- if (!result.ok) {
220
- stuckDirs.push(relDir || dir);
221
- return;
222
- }
223
- 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
+ });
224
303
  } catch {
225
304
  return;
226
305
  }
306
+ if (!entries) return;
227
307
  const subWalks = [];
228
308
  for (const e of entries) {
229
309
  const absPath = path2.join(dir, e.name);
@@ -232,8 +312,10 @@ var FileCache = class _FileCache {
232
312
  if (e.isDirectory()) {
233
313
  if (SKIP_DIRS.has(e.name) || extraSkip.has(e.name)) continue;
234
314
  results.push({ absPath, relPath, name: e.name, isFile: false, isDirectory: true });
235
- subWalks.push(sem.run(() => walk(absPath)));
315
+ subWalks.push(walk(absPath));
236
316
  } else if (e.isFile()) {
317
+ const ext = path2.extname(e.name).toLowerCase();
318
+ if (SKIP_EXTENSIONS.has(ext)) continue;
237
319
  results.push({ absPath, relPath, name: e.name, isFile: true, isDirectory: false });
238
320
  foundCount++;
239
321
  if (onProgress && foundCount - lastReported >= REPORT_INTERVAL) {
@@ -244,7 +326,7 @@ var FileCache = class _FileCache {
244
326
  }
245
327
  await Promise.all(subWalks);
246
328
  }
247
- await sem.run(() => walk(rootDir));
329
+ await walk(rootDir);
248
330
  if (onProgress && foundCount !== lastReported) {
249
331
  onProgress(foundCount, "");
250
332
  }
@@ -357,7 +439,7 @@ async function quickTreeCount(rootDir, excludePatterns) {
357
439
  async function count(dir) {
358
440
  let entries;
359
441
  try {
360
- entries = await fs.readdir(dir, { withFileTypes: true });
442
+ entries = await sem.run(() => fs.readdir(dir, { withFileTypes: true }));
361
443
  } catch {
362
444
  return;
363
445
  }
@@ -368,14 +450,15 @@ async function quickTreeCount(rootDir, excludePatterns) {
368
450
  if (e.isDirectory()) {
369
451
  if (SKIP_DIRS.has(e.name) || extraSkip.has(e.name)) continue;
370
452
  totalDirs++;
371
- subs.push(sem.run(() => count(path2.join(dir, e.name))));
453
+ subs.push(count(path2.join(dir, e.name)));
372
454
  } else if (e.isFile()) {
373
- totalFiles++;
455
+ const ext = path2.extname(e.name).toLowerCase();
456
+ if (!SKIP_EXTENSIONS.has(ext)) totalFiles++;
374
457
  }
375
458
  }
376
459
  await Promise.all(subs);
377
460
  }
378
- await sem.run(() => count(rootDir));
461
+ await count(rootDir);
379
462
  return { totalFiles, totalDirs };
380
463
  }
381
464
  async function findFiles(rootDir, predicate) {
@@ -386,7 +469,7 @@ async function findFiles(rootDir, predicate) {
386
469
  async function walk(dir) {
387
470
  let entries;
388
471
  try {
389
- entries = await fs.readdir(dir, { withFileTypes: true });
472
+ entries = await readDirSemaphore.run(() => fs.readdir(dir, { withFileTypes: true }));
390
473
  } catch {
391
474
  return;
392
475
  }
@@ -394,14 +477,15 @@ async function findFiles(rootDir, predicate) {
394
477
  for (const e of entries) {
395
478
  if (e.isDirectory()) {
396
479
  if (SKIP_DIRS.has(e.name)) continue;
397
- subDirectoryWalks.push(readDirSemaphore.run(() => walk(path2.join(dir, e.name))));
480
+ subDirectoryWalks.push(walk(path2.join(dir, e.name)));
398
481
  } else if (e.isFile() && predicate(e.name)) {
399
- results.push(path2.join(dir, e.name));
482
+ const ext = path2.extname(e.name).toLowerCase();
483
+ if (!SKIP_EXTENSIONS.has(ext)) results.push(path2.join(dir, e.name));
400
484
  }
401
485
  }
402
486
  await Promise.all(subDirectoryWalks);
403
487
  }
404
- await readDirSemaphore.run(() => walk(rootDir));
488
+ await walk(rootDir);
405
489
  return results;
406
490
  }
407
491
  async function findPackageJsonFiles(rootDir) {
@@ -4170,7 +4254,7 @@ var SKIP_DIRS2 = /* @__PURE__ */ new Set([
4170
4254
  ".output",
4171
4255
  ".svelte-kit"
4172
4256
  ]);
4173
- var SKIP_EXTENSIONS = /* @__PURE__ */ new Set([
4257
+ var SKIP_EXTENSIONS2 = /* @__PURE__ */ new Set([
4174
4258
  ".map",
4175
4259
  ".lock",
4176
4260
  ".png",
@@ -4182,6 +4266,7 @@ var SKIP_EXTENSIONS = /* @__PURE__ */ new Set([
4182
4266
  ".woff",
4183
4267
  ".woff2",
4184
4268
  ".ttf",
4269
+ ".otf",
4185
4270
  ".eot",
4186
4271
  ".mp4",
4187
4272
  ".webm"
@@ -4195,7 +4280,7 @@ async function scanFileHotspots(rootDir, cache) {
4195
4280
  for (const entry of entries) {
4196
4281
  if (!entry.isFile) continue;
4197
4282
  const ext = path14.extname(entry.name).toLowerCase();
4198
- if (SKIP_EXTENSIONS.has(ext)) continue;
4283
+ if (SKIP_EXTENSIONS2.has(ext)) continue;
4199
4284
  const depth = entry.relPath.split(path14.sep).length - 1;
4200
4285
  if (depth > maxDepth) maxDepth = depth;
4201
4286
  extensionCounts[ext] = (extensionCounts[ext] ?? 0) + 1;
@@ -4228,7 +4313,7 @@ async function scanFileHotspots(rootDir, cache) {
4228
4313
  await walk(path14.join(dir, e.name), depth + 1);
4229
4314
  } else if (e.isFile) {
4230
4315
  const ext = path14.extname(e.name).toLowerCase();
4231
- if (SKIP_EXTENSIONS.has(ext)) continue;
4316
+ if (SKIP_EXTENSIONS2.has(ext)) continue;
4232
4317
  extensionCounts[ext] = (extensionCounts[ext] ?? 0) + 1;
4233
4318
  try {
4234
4319
  const stat4 = await fs5.stat(path14.join(dir, e.name));
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-IMK7DUPY.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-JFMGFWKC.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-IOXJPCX7.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-JFMGFWKC.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.22",
3
+ "version": "1.0.24",
4
4
  "description": "CLI for measuring upgrade drift across Node & .NET projects",
5
5
  "type": "module",
6
6
  "bin": {