@jvittechs/j 1.0.20 → 1.0.21
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 +16 -6
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -169,7 +169,7 @@ import { basename as basename4 } from "path";
|
|
|
169
169
|
// package.json
|
|
170
170
|
var package_default = {
|
|
171
171
|
name: "@jvittechs/j",
|
|
172
|
-
version: "1.0.
|
|
172
|
+
version: "1.0.21",
|
|
173
173
|
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.",
|
|
174
174
|
type: "module",
|
|
175
175
|
bin: {
|
|
@@ -3717,6 +3717,7 @@ var IDE_FORMATS = {
|
|
|
3717
3717
|
};
|
|
3718
3718
|
|
|
3719
3719
|
// src/services/ide-detection.service.ts
|
|
3720
|
+
var DEFAULT_RULE_KEYWORD = "jai1";
|
|
3720
3721
|
var IdeDetectionService = class {
|
|
3721
3722
|
projectPath;
|
|
3722
3723
|
constructor(projectPath = process.cwd()) {
|
|
@@ -3780,9 +3781,11 @@ var IdeDetectionService = class {
|
|
|
3780
3781
|
const rulesPath = join5(this.projectPath, format.rulesPath);
|
|
3781
3782
|
const rulesExist = await this.pathExists(rulesPath);
|
|
3782
3783
|
if (rulesExist) {
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3784
|
+
const totalRules = await this.countFiles(rulesPath, format.fileExtension);
|
|
3785
|
+
const customRules = await this.countFiles(rulesPath, format.fileExtension, [DEFAULT_RULE_KEYWORD]);
|
|
3786
|
+
detection.hasRules = customRules > 0;
|
|
3787
|
+
detection.ruleCount = customRules;
|
|
3788
|
+
if (totalRules > 0) {
|
|
3786
3789
|
detection.detected = true;
|
|
3787
3790
|
}
|
|
3788
3791
|
}
|
|
@@ -3902,10 +3905,17 @@ var IdeDetectionService = class {
|
|
|
3902
3905
|
/**
|
|
3903
3906
|
* Count files with specific extension in a directory
|
|
3904
3907
|
*/
|
|
3905
|
-
async countFiles(dirPath, extension) {
|
|
3908
|
+
async countFiles(dirPath, extension, excludeKeywords = []) {
|
|
3906
3909
|
try {
|
|
3907
3910
|
const entries = await fs8.readdir(dirPath, { withFileTypes: true });
|
|
3908
|
-
return entries.filter((entry) =>
|
|
3911
|
+
return entries.filter((entry) => {
|
|
3912
|
+
if (!entry.isFile() || !entry.name.endsWith(extension)) return false;
|
|
3913
|
+
if (excludeKeywords.length > 0) {
|
|
3914
|
+
const nameLower = entry.name.toLowerCase();
|
|
3915
|
+
return !excludeKeywords.some((kw) => nameLower.includes(kw));
|
|
3916
|
+
}
|
|
3917
|
+
return true;
|
|
3918
|
+
}).length;
|
|
3909
3919
|
} catch {
|
|
3910
3920
|
return 0;
|
|
3911
3921
|
}
|