@jvittechs/j 1.0.50 → 1.0.51

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/cli.js CHANGED
@@ -149,7 +149,7 @@ import { basename as basename5 } from "path";
149
149
  // package.json
150
150
  var package_default = {
151
151
  name: "@jvittechs/j",
152
- version: "1.0.50",
152
+ version: "1.0.51",
153
153
  description: "A unified CLI tool for JV-IT TECHS developers to manage Jai1 Framework. Supports both `j` and `jai1` commands. Please contact TeamAI for usage instructions.",
154
154
  type: "module",
155
155
  bin: {
@@ -3642,19 +3642,31 @@ var IdeDetectionService = class {
3642
3642
  }
3643
3643
  }
3644
3644
  /**
3645
- * Count files with specific extension in a directory
3645
+ * Count files with specific extension in a directory (recursive)
3646
+ * Supports both flat files and files in subdirectories
3646
3647
  */
3647
3648
  async countFiles(dirPath, extension, excludeKeywords = []) {
3648
3649
  try {
3649
3650
  const entries = await fs7.readdir(dirPath, { withFileTypes: true });
3650
- return entries.filter((entry) => {
3651
- if (!entry.isFile() || !entry.name.endsWith(extension)) return false;
3652
- if (excludeKeywords.length > 0) {
3653
- const nameLower = entry.name.toLowerCase();
3654
- return !excludeKeywords.some((kw) => nameLower.includes(kw));
3651
+ let count = 0;
3652
+ for (const entry of entries) {
3653
+ if (entry.isDirectory()) {
3654
+ count += await this.countFiles(
3655
+ join4(dirPath, entry.name),
3656
+ extension,
3657
+ excludeKeywords
3658
+ );
3659
+ } else if (entry.isFile() && entry.name.endsWith(extension)) {
3660
+ if (excludeKeywords.length > 0) {
3661
+ const nameLower = entry.name.toLowerCase();
3662
+ if (excludeKeywords.some((kw) => nameLower.includes(kw))) {
3663
+ continue;
3664
+ }
3665
+ }
3666
+ count++;
3655
3667
  }
3656
- return true;
3657
- }).length;
3668
+ }
3669
+ return count;
3658
3670
  } catch {
3659
3671
  return 0;
3660
3672
  }