@aiready/core 0.3.7 → 0.5.0
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/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +26 -17
- package/dist/index.mjs +27 -18
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -10,7 +10,7 @@ interface Issue {
|
|
|
10
10
|
location: Location;
|
|
11
11
|
suggestion?: string;
|
|
12
12
|
}
|
|
13
|
-
type IssueType = 'duplicate-pattern' | 'context-fragmentation' | 'doc-drift' | 'naming-inconsistency' | 'dead-code' | 'circular-dependency' | 'missing-types';
|
|
13
|
+
type IssueType = 'duplicate-pattern' | 'context-fragmentation' | 'doc-drift' | 'naming-inconsistency' | 'naming-quality' | 'pattern-inconsistency' | 'architecture-inconsistency' | 'dead-code' | 'circular-dependency' | 'missing-types';
|
|
14
14
|
interface Location {
|
|
15
15
|
file: string;
|
|
16
16
|
line: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ interface Issue {
|
|
|
10
10
|
location: Location;
|
|
11
11
|
suggestion?: string;
|
|
12
12
|
}
|
|
13
|
-
type IssueType = 'duplicate-pattern' | 'context-fragmentation' | 'doc-drift' | 'naming-inconsistency' | 'dead-code' | 'circular-dependency' | 'missing-types';
|
|
13
|
+
type IssueType = 'duplicate-pattern' | 'context-fragmentation' | 'doc-drift' | 'naming-inconsistency' | 'naming-quality' | 'pattern-inconsistency' | 'architecture-inconsistency' | 'dead-code' | 'circular-dependency' | 'missing-types';
|
|
14
14
|
interface Location {
|
|
15
15
|
file: string;
|
|
16
16
|
line: number;
|
package/dist/index.js
CHANGED
|
@@ -53,6 +53,7 @@ var DEFAULT_EXCLUDE = [
|
|
|
53
53
|
"**/target/**",
|
|
54
54
|
"**/bin/**",
|
|
55
55
|
"**/obj/**",
|
|
56
|
+
"**/cdk.out/**",
|
|
56
57
|
// Framework-specific build dirs
|
|
57
58
|
"**/.next/**",
|
|
58
59
|
"**/.nuxt/**",
|
|
@@ -160,26 +161,34 @@ var CONFIG_FILES = [
|
|
|
160
161
|
".aireadyrc.js"
|
|
161
162
|
];
|
|
162
163
|
function loadConfig(rootDir) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
164
|
+
let currentDir = (0, import_path.resolve)(rootDir);
|
|
165
|
+
while (true) {
|
|
166
|
+
for (const configFile of CONFIG_FILES) {
|
|
167
|
+
const configPath = (0, import_path.join)(currentDir, configFile);
|
|
168
|
+
if ((0, import_fs.existsSync)(configPath)) {
|
|
169
|
+
try {
|
|
170
|
+
let config;
|
|
171
|
+
if (configFile.endsWith(".js")) {
|
|
172
|
+
delete require.cache[require.resolve(configPath)];
|
|
173
|
+
config = require(configPath);
|
|
174
|
+
} else {
|
|
175
|
+
const content = (0, import_fs.readFileSync)(configPath, "utf-8");
|
|
176
|
+
config = JSON.parse(content);
|
|
177
|
+
}
|
|
178
|
+
if (typeof config !== "object" || config === null) {
|
|
179
|
+
throw new Error("Config must be an object");
|
|
180
|
+
}
|
|
181
|
+
return config;
|
|
182
|
+
} catch (error) {
|
|
183
|
+
throw new Error(`Failed to load config from ${configPath}: ${error}`);
|
|
174
184
|
}
|
|
175
|
-
if (typeof config !== "object" || config === null) {
|
|
176
|
-
throw new Error("Config must be an object");
|
|
177
|
-
}
|
|
178
|
-
return config;
|
|
179
|
-
} catch (error) {
|
|
180
|
-
throw new Error(`Failed to load config from ${configPath}: ${error}`);
|
|
181
185
|
}
|
|
182
186
|
}
|
|
187
|
+
const parent = (0, import_path.dirname)(currentDir);
|
|
188
|
+
if (parent === currentDir) {
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
currentDir = parent;
|
|
183
192
|
}
|
|
184
193
|
return null;
|
|
185
194
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -19,6 +19,7 @@ var DEFAULT_EXCLUDE = [
|
|
|
19
19
|
"**/target/**",
|
|
20
20
|
"**/bin/**",
|
|
21
21
|
"**/obj/**",
|
|
22
|
+
"**/cdk.out/**",
|
|
22
23
|
// Framework-specific build dirs
|
|
23
24
|
"**/.next/**",
|
|
24
25
|
"**/.nuxt/**",
|
|
@@ -116,7 +117,7 @@ function similarityScore(str1, str2) {
|
|
|
116
117
|
|
|
117
118
|
// src/utils/config.ts
|
|
118
119
|
import { readFileSync, existsSync } from "fs";
|
|
119
|
-
import { resolve } from "path";
|
|
120
|
+
import { join, resolve, dirname } from "path";
|
|
120
121
|
var CONFIG_FILES = [
|
|
121
122
|
"aiready.json",
|
|
122
123
|
"aiready.config.json",
|
|
@@ -126,26 +127,34 @@ var CONFIG_FILES = [
|
|
|
126
127
|
".aireadyrc.js"
|
|
127
128
|
];
|
|
128
129
|
function loadConfig(rootDir) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
130
|
+
let currentDir = resolve(rootDir);
|
|
131
|
+
while (true) {
|
|
132
|
+
for (const configFile of CONFIG_FILES) {
|
|
133
|
+
const configPath = join(currentDir, configFile);
|
|
134
|
+
if (existsSync(configPath)) {
|
|
135
|
+
try {
|
|
136
|
+
let config;
|
|
137
|
+
if (configFile.endsWith(".js")) {
|
|
138
|
+
delete __require.cache[__require.resolve(configPath)];
|
|
139
|
+
config = __require(configPath);
|
|
140
|
+
} else {
|
|
141
|
+
const content = readFileSync(configPath, "utf-8");
|
|
142
|
+
config = JSON.parse(content);
|
|
143
|
+
}
|
|
144
|
+
if (typeof config !== "object" || config === null) {
|
|
145
|
+
throw new Error("Config must be an object");
|
|
146
|
+
}
|
|
147
|
+
return config;
|
|
148
|
+
} catch (error) {
|
|
149
|
+
throw new Error(`Failed to load config from ${configPath}: ${error}`);
|
|
140
150
|
}
|
|
141
|
-
if (typeof config !== "object" || config === null) {
|
|
142
|
-
throw new Error("Config must be an object");
|
|
143
|
-
}
|
|
144
|
-
return config;
|
|
145
|
-
} catch (error) {
|
|
146
|
-
throw new Error(`Failed to load config from ${configPath}: ${error}`);
|
|
147
151
|
}
|
|
148
152
|
}
|
|
153
|
+
const parent = dirname(currentDir);
|
|
154
|
+
if (parent === currentDir) {
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
currentDir = parent;
|
|
149
158
|
}
|
|
150
159
|
return null;
|
|
151
160
|
}
|