@chappibunny/repolens 1.12.2 → 1.13.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 +100 -0
- package/README.md +25 -36
- package/bin/repolens.js +21 -1
- package/package.json +20 -11
- package/src/ai/provider.js +1 -2
- package/src/analyzers/monorepo-detector.js +8 -20
- package/src/cli-args.js +60 -0
- package/src/cli.js +80 -100
- package/src/core/config-schema.js +47 -1
- package/src/core/config.js +5 -2
- package/src/core/diff.js +43 -20
- package/src/core/scan.js +24 -4
- package/src/delivery/comment.js +5 -2
- package/src/docs/write-doc-set.js +9 -7
- package/src/doctor.js +16 -3
- package/src/help.js +54 -0
- package/src/index.js +13 -0
- package/src/init.js +99 -62
- package/src/integrations/discord.js +16 -2
- package/src/migrate.js +2 -2
- package/src/publishers/confluence.js +17 -3
- package/src/publishers/github-wiki.js +61 -32
- package/src/publishers/index.js +24 -9
- package/src/publishers/markdown.js +3 -2
- package/src/publishers/notion.js +10 -4
- package/src/publishers/obsidian.js +716 -0
- package/src/utils/branch.js +37 -42
- package/src/utils/github-repo.js +8 -0
- package/src/utils/interactive.js +20 -0
- package/src/utils/logger.js +5 -1
- package/src/utils/retry.js +30 -6
- package/src/utils/safe-path.js +50 -0
- package/src/utils/secrets.js +3 -1
- package/src/utils/telemetry.js +34 -6
- package/src/utils/update-check.js +23 -6
- package/src/utils/validate.js +70 -1
- package/src/utils/yaml.js +27 -0
- package/src/watch.js +1 -1
- package/docs/AI.md +0 -329
- package/docs/ARCHITECTURE.md +0 -145
- package/docs/CONFIGURATION.md +0 -121
- package/docs/DEVELOPMENT.md +0 -79
- package/docs/ENVIRONMENT.md +0 -79
- package/docs/INSTALLATION.md +0 -45
- package/docs/KNOWN_ISSUES.md +0 -309
- package/docs/MIGRATION.md +0 -311
- package/docs/ONBOARDING.md +0 -382
- package/docs/PRODUCTION_CHECKLIST.md +0 -470
- package/docs/RELEASE.md +0 -76
- package/docs/ROADMAP.md +0 -151
- package/docs/STABILITY.md +0 -265
- package/docs/TELEMETRY.md +0 -166
- package/docs/TROUBLESHOOTING.md +0 -377
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { info } from "../utils/logger.js";
|
|
4
|
+
import { resolveOutputDir, safeFileName } from "../utils/safe-path.js";
|
|
4
5
|
|
|
5
6
|
function outputDir(cfg) {
|
|
6
|
-
return
|
|
7
|
+
return resolveOutputDir(cfg.__repoRoot, ".repolens");
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
function pageFileName(key) {
|
|
@@ -27,7 +28,7 @@ function pageFileName(key) {
|
|
|
27
28
|
code_health: "code_health.md"
|
|
28
29
|
};
|
|
29
30
|
|
|
30
|
-
return mapping[key] || `${key}.md
|
|
31
|
+
return safeFileName(mapping[key] || `${key}.md`);
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
export async function publishToMarkdown(cfg, renderedPages) {
|
package/src/publishers/notion.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import fetch from "node-fetch";
|
|
2
1
|
import fs from "node:fs/promises";
|
|
3
2
|
import path from "node:path";
|
|
4
3
|
import { log, warn } from "../utils/logger.js";
|
|
5
4
|
import { fetchWithRetry } from "../utils/retry.js";
|
|
6
5
|
import { executeNotionRequest } from "../utils/rate-limit.js";
|
|
7
6
|
import { createRepoLensError } from "../utils/errors.js";
|
|
7
|
+
import { sanitizeSecrets } from "../utils/secrets.js";
|
|
8
8
|
|
|
9
9
|
function notionHeaders() {
|
|
10
10
|
const token = process.env.NOTION_TOKEN;
|
|
@@ -36,7 +36,8 @@ async function notionRequest(method, url, body) {
|
|
|
36
36
|
|
|
37
37
|
if (!res.ok) {
|
|
38
38
|
const text = await res.text();
|
|
39
|
-
|
|
39
|
+
const clipped = sanitizeSecrets(String(text || "").replace(/\s+/g, " ").slice(0, 500));
|
|
40
|
+
throw new Error(`Notion API error ${res.status}: ${clipped}`);
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
return await res.json();
|
|
@@ -62,10 +63,15 @@ async function writeCache(cache) {
|
|
|
62
63
|
|
|
63
64
|
async function getChildBlocks(blockId) {
|
|
64
65
|
const results = [];
|
|
66
|
+
const seenCursors = new Set();
|
|
65
67
|
let cursor = undefined;
|
|
66
68
|
|
|
67
|
-
while (
|
|
68
|
-
|
|
69
|
+
while (results.length < 10000) {
|
|
70
|
+
if (cursor) {
|
|
71
|
+
if (seenCursors.has(cursor)) break;
|
|
72
|
+
seenCursors.add(cursor);
|
|
73
|
+
}
|
|
74
|
+
const suffix = cursor ? `?start_cursor=${encodeURIComponent(cursor)}` : "";
|
|
69
75
|
const response = await notionRequest("GET", `/blocks/${blockId}/children${suffix}`);
|
|
70
76
|
|
|
71
77
|
if (response.results?.length) {
|