@chappibunny/repolens 0.9.0 → 1.2.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/CHANGELOG.md +93 -0
- package/README.md +67 -33
- package/package.json +1 -1
- package/src/ai/generate-sections.js +0 -6
- package/src/ai/provider.js +30 -19
- package/src/cli.js +35 -15
- package/src/core/config-schema.js +61 -12
- package/src/init.js +2 -5
- package/src/migrate.js +91 -9
- package/src/publishers/github-wiki.js +461 -0
- package/src/publishers/index.js +24 -2
- package/src/publishers/notion.js +2 -2
- package/src/publishers/publish.js +2 -1
- package/src/utils/branch.js +27 -0
- package/src/utils/rate-limit.js +4 -2
- package/src/utils/telemetry.js +6 -2
- package/src/utils/update-check.js +2 -2
- package/src/utils/validate.js +33 -24
package/src/utils/validate.js
CHANGED
|
@@ -103,13 +103,13 @@ function validateScanConfig(scan) {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
if (scan.
|
|
107
|
-
if (!Array.isArray(scan.
|
|
108
|
-
errors.push("scan.
|
|
106
|
+
if (scan.ignore) {
|
|
107
|
+
if (!Array.isArray(scan.ignore)) {
|
|
108
|
+
errors.push("scan.ignore must be an array of glob patterns");
|
|
109
109
|
} else {
|
|
110
|
-
for (const pattern of scan.
|
|
110
|
+
for (const pattern of scan.ignore) {
|
|
111
111
|
if (typeof pattern !== "string") {
|
|
112
|
-
errors.push(`Invalid pattern in scan.
|
|
112
|
+
errors.push(`Invalid pattern in scan.ignore: ${pattern} (must be string)`);
|
|
113
113
|
continue; // Skip further checks if not a string
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -135,7 +135,7 @@ function validatePublishers(publishers) {
|
|
|
135
135
|
return errors;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
const validPublishers = ["notion", "markdown", "confluence"];
|
|
138
|
+
const validPublishers = ["notion", "markdown", "confluence", "github_wiki"];
|
|
139
139
|
|
|
140
140
|
if (Array.isArray(publishers)) {
|
|
141
141
|
for (const pub of publishers) {
|
|
@@ -207,33 +207,34 @@ function checkNotionWarnings(notion) {
|
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
|
-
* Validate domains configuration
|
|
210
|
+
* Validate domains configuration (object format: { key: { match: [], description? } })
|
|
211
211
|
*/
|
|
212
212
|
function validateDomains(domains) {
|
|
213
213
|
const errors = [];
|
|
214
214
|
|
|
215
|
-
if (
|
|
216
|
-
errors.push("domains must be an
|
|
215
|
+
if (typeof domains !== "object" || Array.isArray(domains)) {
|
|
216
|
+
errors.push("domains must be an object");
|
|
217
217
|
return errors;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
for (const domain of domains) {
|
|
221
|
-
if (
|
|
222
|
-
errors.push(
|
|
220
|
+
for (const [key, domain] of Object.entries(domains)) {
|
|
221
|
+
if (typeof domain !== "object" || Array.isArray(domain)) {
|
|
222
|
+
errors.push(`domains.${key} must be an object`);
|
|
223
|
+
continue;
|
|
223
224
|
}
|
|
224
225
|
|
|
225
|
-
if (!domain.
|
|
226
|
-
errors.push(`
|
|
226
|
+
if (!domain.match || !Array.isArray(domain.match)) {
|
|
227
|
+
errors.push(`domains.${key} must have a 'match' array`);
|
|
227
228
|
} else {
|
|
228
|
-
for (const pattern of domain.
|
|
229
|
+
for (const pattern of domain.match) {
|
|
229
230
|
if (typeof pattern !== "string") {
|
|
230
|
-
errors.push(`Invalid pattern in
|
|
231
|
+
errors.push(`Invalid pattern in domains.${key}.match: ${pattern}`);
|
|
231
232
|
}
|
|
232
233
|
}
|
|
233
234
|
}
|
|
234
235
|
|
|
235
236
|
if (domain.description && typeof domain.description !== "string") {
|
|
236
|
-
errors.push(`
|
|
237
|
+
errors.push(`domains.${key}.description must be a string`);
|
|
237
238
|
}
|
|
238
239
|
}
|
|
239
240
|
|
|
@@ -319,17 +320,25 @@ function checkForInjection(config) {
|
|
|
319
320
|
});
|
|
320
321
|
}
|
|
321
322
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
323
|
+
if (config.scan?.ignore && Array.isArray(config.scan.ignore)) {
|
|
324
|
+
config.scan.ignore.forEach((pattern, i) => {
|
|
325
|
+
if (typeof pattern === "string") {
|
|
326
|
+
checkString(pattern, `scan.ignore[${i}]`);
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// Check domain patterns (object format: { key: { match: [] } })
|
|
332
|
+
if (config.domains && typeof config.domains === "object" && !Array.isArray(config.domains)) {
|
|
333
|
+
for (const [domainKey, domain] of Object.entries(config.domains)) {
|
|
334
|
+
if (domain.match && Array.isArray(domain.match)) {
|
|
335
|
+
domain.match.forEach((pattern, j) => {
|
|
327
336
|
if (typeof pattern === "string") {
|
|
328
|
-
checkString(pattern, `domains
|
|
337
|
+
checkString(pattern, `domains.${domainKey}.match[${j}]`);
|
|
329
338
|
}
|
|
330
339
|
});
|
|
331
340
|
}
|
|
332
|
-
}
|
|
341
|
+
}
|
|
333
342
|
}
|
|
334
343
|
|
|
335
344
|
return errors;
|