@chappibunny/repolens 1.9.0 → 1.9.2
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 +14 -0
- package/README.md +26 -18
- package/docs/AI.md +329 -0
- package/docs/ARCHITECTURE.md +145 -0
- package/docs/CONFIGURATION.md +121 -0
- package/docs/DEVELOPMENT.md +79 -0
- package/docs/ENVIRONMENT.md +57 -0
- package/docs/INSTALLATION.md +45 -0
- package/docs/KNOWN_ISSUES.md +309 -0
- package/docs/MIGRATION.md +311 -0
- package/docs/ONBOARDING.md +382 -0
- package/docs/PRODUCTION_CHECKLIST.md +470 -0
- package/docs/ROADMAP.md +151 -0
- package/docs/STABILITY.md +265 -0
- package/docs/TELEMETRY.md +166 -0
- package/docs/TROUBLESHOOTING.md +377 -0
- package/package.json +3 -3
- package/src/cli.js +99 -41
- package/src/docs/generate-doc-set.js +15 -2
- package/src/publishers/confluence.js +37 -6
- package/src/publishers/notion.js +48 -0
- package/src/publishers/publish.js +36 -12
- /package/{RELEASE.md → docs/RELEASE.md} +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# ⚙️ Configuration Reference
|
|
2
|
+
|
|
3
|
+
## Complete Example
|
|
4
|
+
|
|
5
|
+
```yaml
|
|
6
|
+
configVersion: 1 # Schema version for future migrations
|
|
7
|
+
|
|
8
|
+
project:
|
|
9
|
+
name: "my-awesome-app"
|
|
10
|
+
docs_title_prefix: "MyApp"
|
|
11
|
+
|
|
12
|
+
# Configure output destinations
|
|
13
|
+
publishers:
|
|
14
|
+
- notion
|
|
15
|
+
- confluence
|
|
16
|
+
- markdown
|
|
17
|
+
|
|
18
|
+
# Notion-specific settings (optional)
|
|
19
|
+
notion:
|
|
20
|
+
branches:
|
|
21
|
+
- main # Only main branch publishes
|
|
22
|
+
- staging # Also staging
|
|
23
|
+
- release/* # Glob patterns supported
|
|
24
|
+
includeBranchInTitle: false # Clean titles without [branch-name]
|
|
25
|
+
|
|
26
|
+
# Confluence-specific settings (optional)
|
|
27
|
+
confluence:
|
|
28
|
+
branches:
|
|
29
|
+
- main # Only main branch publishes to Confluence
|
|
30
|
+
|
|
31
|
+
# Discord notifications (optional)
|
|
32
|
+
discord:
|
|
33
|
+
enabled: true # Default: true (if DISCORD_WEBHOOK_URL set)
|
|
34
|
+
notifyOn: significant # Options: always, significant, never
|
|
35
|
+
significantThreshold: 10 # Notify if change >10% (default)
|
|
36
|
+
branches: # Which branches to notify (default: all)
|
|
37
|
+
- main
|
|
38
|
+
- develop
|
|
39
|
+
|
|
40
|
+
# GitHub integration (optional)
|
|
41
|
+
github:
|
|
42
|
+
owner: "your-username"
|
|
43
|
+
repo: "your-repo-name"
|
|
44
|
+
|
|
45
|
+
# File scanning configuration
|
|
46
|
+
scan:
|
|
47
|
+
include:
|
|
48
|
+
- "src/**/*.{ts,tsx,js,jsx}"
|
|
49
|
+
- "app/**/*.{ts,tsx,js,jsx}"
|
|
50
|
+
- "pages/**/*.{ts,tsx,js,jsx}"
|
|
51
|
+
- "lib/**/*.{ts,tsx,js,jsx}"
|
|
52
|
+
ignore:
|
|
53
|
+
- "node_modules/**"
|
|
54
|
+
- ".next/**"
|
|
55
|
+
- "dist/**"
|
|
56
|
+
- "build/**"
|
|
57
|
+
- "coverage/**"
|
|
58
|
+
|
|
59
|
+
# Module organization
|
|
60
|
+
module_roots:
|
|
61
|
+
- "src"
|
|
62
|
+
- "app"
|
|
63
|
+
- "lib"
|
|
64
|
+
- "pages"
|
|
65
|
+
|
|
66
|
+
# Documentation pages to generate
|
|
67
|
+
outputs:
|
|
68
|
+
pages:
|
|
69
|
+
- key: "system_overview"
|
|
70
|
+
title: "System Overview"
|
|
71
|
+
description: "High-level snapshot and tech stack"
|
|
72
|
+
- key: "module_catalog"
|
|
73
|
+
title: "Module Catalog"
|
|
74
|
+
description: "Complete module inventory"
|
|
75
|
+
- key: "api_surface"
|
|
76
|
+
title: "API Surface"
|
|
77
|
+
description: "REST endpoints and methods"
|
|
78
|
+
- key: "route_map"
|
|
79
|
+
title: "Route Map"
|
|
80
|
+
description: "Frontend routes and pages"
|
|
81
|
+
- key: "system_map"
|
|
82
|
+
title: "System Map"
|
|
83
|
+
description: "Visual dependency graph"
|
|
84
|
+
|
|
85
|
+
# Feature flags (optional, experimental)
|
|
86
|
+
features:
|
|
87
|
+
architecture_diff: true
|
|
88
|
+
route_map: true
|
|
89
|
+
visual_diagrams: true
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Configuration Fields
|
|
93
|
+
|
|
94
|
+
| Field | Type | Required | Description |
|
|
95
|
+
|-------|------|----------|-------------|
|
|
96
|
+
| `configVersion` | number | **Yes** | Schema version (must be `1`) |
|
|
97
|
+
| `project.name` | string | Yes | Project name |
|
|
98
|
+
| `project.docs_title_prefix` | string | No | Prefix for documentation titles (default: project name) |
|
|
99
|
+
| `publishers` | array | Yes | Output targets: `notion`, `confluence`, `github_wiki`, `markdown` (+ plugin publishers) |
|
|
100
|
+
| `plugins` | array | No | Plugin paths or npm package names |
|
|
101
|
+
| `notion.branches` | array | No | Branch whitelist for Notion publishing. Supports globs. |
|
|
102
|
+
| `notion.includeBranchInTitle` | boolean | No | Add `[branch-name]` to titles (default: `true`) |
|
|
103
|
+
| `confluence.branches` | array | No | Branch whitelist for Confluence publishing. Supports globs. |
|
|
104
|
+
| `github_wiki.branches` | array | No | Branch whitelist for GitHub Wiki publishing. Supports globs. |
|
|
105
|
+
| `github_wiki.sidebar` | boolean | No | Generate `_Sidebar.md` navigation (default: `true`) |
|
|
106
|
+
| `github_wiki.footer` | boolean | No | Generate `_Footer.md` (default: `true`) |
|
|
107
|
+
| `discord.enabled` | boolean | No | Enable Discord notifications (default: `true` if webhook set) |
|
|
108
|
+
| `discord.notifyOn` | string | No | Notification policy: `always`, `significant`, `never` (default: `significant`) |
|
|
109
|
+
| `discord.significantThreshold` | number | No | Change % threshold for notifications (default: `10`) |
|
|
110
|
+
| `discord.branches` | array | No | Branch filter for notifications. Supports globs. (default: all) |
|
|
111
|
+
| `github.owner` | string | No | GitHub org/username |
|
|
112
|
+
| `github.repo` | string | No | Repository name |
|
|
113
|
+
| `scan.include` | array | Yes | Glob patterns for files to scan |
|
|
114
|
+
| `scan.ignore` | array | Yes | Glob patterns to exclude |
|
|
115
|
+
| `module_roots` | array | No | Root directories for module detection |
|
|
116
|
+
| `outputs.pages` | array | Yes | Documentation pages to generate |
|
|
117
|
+
| `features` | object | No | Feature flags (boolean values) |
|
|
118
|
+
| `ai.enabled` | boolean | No | Enable AI-powered documentation |
|
|
119
|
+
| `ai.mode` | string | No | AI mode: `hybrid`, `full`, or `off` |
|
|
120
|
+
| `ai.temperature` | number | No | Generation temperature (0–2). Not supported by all models (e.g. gpt-5-mini ignores it) |
|
|
121
|
+
| `ai.max_tokens` | number | No | Max completion tokens per request (>0) |
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# 🧪 Development
|
|
2
|
+
|
|
3
|
+
## Setup
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
git clone https://github.com/CHAPIBUNNY/repolens.git
|
|
7
|
+
cd repolens
|
|
8
|
+
npm install
|
|
9
|
+
npm link # Makes 'repolens' command available globally
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Run Tests
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm test
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Test Suite:**
|
|
19
|
+
- Config discovery and validation
|
|
20
|
+
- Branch detection (GitHub/GitLab/CircleCI)
|
|
21
|
+
- CLI commands (version, help, uninstall)
|
|
22
|
+
- Markdown publisher and parser tests (Notion, Confluence)
|
|
23
|
+
- Integration and HTTP integration workflows
|
|
24
|
+
- Doctor command validation
|
|
25
|
+
- Init wizard and scaffolding
|
|
26
|
+
- AI provider and structured output tests
|
|
27
|
+
- Extended analysis (GraphQL, TypeScript, dependency graph, drift)
|
|
28
|
+
- Plugin system (loader, manager, config)
|
|
29
|
+
- Renderers (system map, diff, analysis)
|
|
30
|
+
- Deterministic enrichment (all 6 AI-enhanced doc types)
|
|
31
|
+
- Security fuzzing and rate-limit stress tests
|
|
32
|
+
- Watch mode and migration (including e2e)
|
|
33
|
+
- Robustness (timeout, partial-publish, error isolation)
|
|
34
|
+
|
|
35
|
+
**Coverage:** 380 tests passing across 22 test files
|
|
36
|
+
|
|
37
|
+
## Test Package Installation Locally
|
|
38
|
+
|
|
39
|
+
Simulates the full user installation experience:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Pack the tarball
|
|
43
|
+
npm pack
|
|
44
|
+
|
|
45
|
+
# Install globally from tarball
|
|
46
|
+
npm install -g chappibunny-repolens-1.8.1.tgz
|
|
47
|
+
|
|
48
|
+
# Verify
|
|
49
|
+
repolens --version
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Release Process
|
|
53
|
+
|
|
54
|
+
RepoLens uses automated GitHub Actions releases.
|
|
55
|
+
|
|
56
|
+
### Creating a Release
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Patch version (1.0.0 → 1.0.1) - Bug fixes
|
|
60
|
+
npm run release:patch
|
|
61
|
+
|
|
62
|
+
# Minor version (1.0.0 → 1.1.0) - New features
|
|
63
|
+
npm run release:minor
|
|
64
|
+
|
|
65
|
+
# Major version (1.0.0 → 2.0.0) - Breaking changes
|
|
66
|
+
npm run release:major
|
|
67
|
+
|
|
68
|
+
# Push the tag to trigger workflow
|
|
69
|
+
git push --follow-tags
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**What happens:**
|
|
73
|
+
1. Security audit runs (dependency audit + secret scanning)
|
|
74
|
+
2. All tests run
|
|
75
|
+
3. Package tarball created
|
|
76
|
+
4. GitHub Release published with tarball attached
|
|
77
|
+
5. npm package published to `@chappibunny/repolens`
|
|
78
|
+
|
|
79
|
+
See [RELEASE.md](./RELEASE.md) for detailed workflow.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# 🔐 Environment Variables
|
|
2
|
+
|
|
3
|
+
## Notion Publisher
|
|
4
|
+
|
|
5
|
+
| Variable | Required | Description |
|
|
6
|
+
|----------|----------|-------------|
|
|
7
|
+
| `NOTION_TOKEN` | Yes | Integration token from notion.so/my-integrations |
|
|
8
|
+
| `NOTION_PARENT_PAGE_ID` | Yes | Page ID where docs will be created |
|
|
9
|
+
| `NOTION_VERSION` | No | API version (default: `2022-06-28`) |
|
|
10
|
+
|
|
11
|
+
## Confluence Publisher
|
|
12
|
+
|
|
13
|
+
| Variable | Required | Description |
|
|
14
|
+
|----------|----------|-------------|
|
|
15
|
+
| `CONFLUENCE_URL` | Yes | Base URL (e.g., `https://your-company.atlassian.net/wiki`) |
|
|
16
|
+
| `CONFLUENCE_EMAIL` | Yes | Atlassian account email |
|
|
17
|
+
| `CONFLUENCE_API_TOKEN` | Yes | API token from [Atlassian](https://id.atlassian.com/manage-profile/security/api-tokens) |
|
|
18
|
+
| `CONFLUENCE_SPACE_KEY` | Yes | Target space key (e.g., `DOCS`, `ENG`) |
|
|
19
|
+
| `CONFLUENCE_PARENT_PAGE_ID` | No | Parent page ID (docs created at space root if omitted) |
|
|
20
|
+
|
|
21
|
+
## Discord Notifications
|
|
22
|
+
|
|
23
|
+
| Variable | Required | Description |
|
|
24
|
+
|----------|----------|-------------|
|
|
25
|
+
| `DISCORD_WEBHOOK_URL` | No | Discord webhook URL for team notifications |
|
|
26
|
+
|
|
27
|
+
## GitHub Wiki Publisher
|
|
28
|
+
|
|
29
|
+
| Variable | Required | Description |
|
|
30
|
+
|----------|----------|-------------|
|
|
31
|
+
| `GITHUB_TOKEN` | Yes | Personal access token or Actions `${{ secrets.GITHUB_TOKEN }}` |
|
|
32
|
+
| `GITHUB_REPOSITORY` | No | `owner/repo` (auto-detected from git remote in Actions) |
|
|
33
|
+
|
|
34
|
+
## AI Enhancement
|
|
35
|
+
|
|
36
|
+
| Variable | Required | Description |
|
|
37
|
+
|----------|----------|-------------|
|
|
38
|
+
| `REPOLENS_AI_ENABLED` | No | Enable AI-powered sections (`true`/`false`) |
|
|
39
|
+
| `REPOLENS_AI_PROVIDER` | No | Provider: `openai_compatible` (default), `anthropic`, `google`, `github` |
|
|
40
|
+
| `REPOLENS_AI_API_KEY` | No | API key for AI provider (not needed for `github` provider) |
|
|
41
|
+
| `REPOLENS_AI_BASE_URL` | No | API base URL (auto-set per provider; override for custom endpoints) |
|
|
42
|
+
| `REPOLENS_AI_MODEL` | No | Model name (e.g., `gpt-5-mini`, `gpt-4o-mini`, `claude-sonnet-4-20250514`) |
|
|
43
|
+
| `REPOLENS_AI_TEMPERATURE` | No | Generation temperature (omitted by default for GPT-5 compatibility) |
|
|
44
|
+
| `REPOLENS_AI_MAX_TOKENS` | No | Max completion tokens per request (default: `2000`) |
|
|
45
|
+
|
|
46
|
+
> **GitHub Models (free):** Set `REPOLENS_AI_PROVIDER=github` in GitHub Actions — uses `GITHUB_TOKEN` automatically, no separate API key required. See [AI.md](AI.md) for details.
|
|
47
|
+
|
|
48
|
+
## Telemetry
|
|
49
|
+
|
|
50
|
+
| Variable | Required | Description |
|
|
51
|
+
|----------|----------|-------------|
|
|
52
|
+
| `REPOLENS_TELEMETRY_ENABLED` | No | Enable Sentry error tracking (`true`/`false`) |
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
**Local Development:** Create `.env` file in project root
|
|
57
|
+
**GitHub Actions:** Add as repository secrets in Settings → Secrets and variables → Actions
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# 📦 Installation
|
|
2
|
+
|
|
3
|
+
## Recommended: npm Registry
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @chappibunny/repolens
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Installs from npm registry.
|
|
10
|
+
|
|
11
|
+
## Alternative Methods
|
|
12
|
+
|
|
13
|
+
<details>
|
|
14
|
+
<summary><b>Option B: GitHub Direct Install</b></summary>
|
|
15
|
+
|
|
16
|
+
Install from the latest GitHub commit:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install github:CHAPIBUNNY/repolens
|
|
20
|
+
```
|
|
21
|
+
</details>
|
|
22
|
+
|
|
23
|
+
<details>
|
|
24
|
+
<summary><b>Option C: Local Development</b></summary>
|
|
25
|
+
|
|
26
|
+
Clone and link for development:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git clone https://github.com/CHAPIBUNNY/repolens.git
|
|
30
|
+
cd repolens
|
|
31
|
+
npm link
|
|
32
|
+
```
|
|
33
|
+
</details>
|
|
34
|
+
|
|
35
|
+
<details>
|
|
36
|
+
<summary><b>Option D: GitHub Release Tarball</b></summary>
|
|
37
|
+
|
|
38
|
+
Install from a specific version:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install https://github.com/CHAPIBUNNY/repolens/releases/download/v1.4.0/chappibunny-repolens-1.4.0.tgz
|
|
42
|
+
```
|
|
43
|
+
</details>
|
|
44
|
+
|
|
45
|
+
> **Having install problems?** See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for solutions to common issues like `ENOTEMPTY`, `npm ci` failures, and stale versions.
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
# Known Issues & Limitations
|
|
2
|
+
|
|
3
|
+
This document tracks known issues, limitations, and edge cases in RepoLens. We're committed to transparency about what works, what doesn't, and what we're working on.
|
|
4
|
+
|
|
5
|
+
**Last Updated:** June 2025
|
|
6
|
+
**Version:** 1.5.0
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 🔄 Migration Tool (`repolens migrate`)
|
|
11
|
+
|
|
12
|
+
### Fixed Issues (v0.4.2 - v0.4.3)
|
|
13
|
+
|
|
14
|
+
These bugs were discovered in production and have been fixed:
|
|
15
|
+
|
|
16
|
+
#### ✅ Duplicate `run:` Keys (Fixed in v0.4.2)
|
|
17
|
+
**Symptom:** Migration created duplicate `run:` keys in workflow steps, causing YAML validation errors.
|
|
18
|
+
|
|
19
|
+
**Root Cause:** Pattern insertion didn't capture existing `run:` command when adding environment variables.
|
|
20
|
+
|
|
21
|
+
**Fix:** Updated regex pattern to `/(- name: .*\n)(\s+)(run:.*)/i` to capture and preserve run command.
|
|
22
|
+
|
|
23
|
+
**Regression Test:** `tests/e2e/migration.test.js` includes specific test case.
|
|
24
|
+
|
|
25
|
+
#### ✅ Over-Aggressive npm Install Removal (Fixed in v0.4.3)
|
|
26
|
+
**Symptom:** Migration removed ALL `npm ci` and `npm install` commands, corrupting release workflows.
|
|
27
|
+
|
|
28
|
+
**Root Cause:** Pattern matched any npm install, not just the legacy RepoLens-specific pattern.
|
|
29
|
+
|
|
30
|
+
**Fix:** Only removes npm install from multi-line `run: |` blocks containing `cd tools/repolens`.
|
|
31
|
+
|
|
32
|
+
**Pattern:** `/(run:\s*\|[^\n]*\n(?:\s+[^\n]*\n)*?\s+)npm\s+(?:ci|install)\s*\n/g`
|
|
33
|
+
|
|
34
|
+
**Regression Test:** `tests/e2e/migration.test.js` includes `release-with-npm-ci.yml` fixture.
|
|
35
|
+
|
|
36
|
+
### Current Limitations
|
|
37
|
+
|
|
38
|
+
#### Manual Review Still Recommended
|
|
39
|
+
**Issue:** While migration is highly reliable (185 tests passing), edge cases may exist in complex workflows.
|
|
40
|
+
|
|
41
|
+
**Workaround:**
|
|
42
|
+
1. Run `npx @chappibunny/repolens migrate --dry-run` first
|
|
43
|
+
2. Review the diff before applying
|
|
44
|
+
3. Check backup files created as `*.backup`
|
|
45
|
+
4. Test locally with `npx @chappibunny/repolens@latest publish`
|
|
46
|
+
|
|
47
|
+
#### Multi-File Workflows Not Supported
|
|
48
|
+
**Issue:** If RepoLens publish steps are split across multiple workflow files, migration may miss some.
|
|
49
|
+
|
|
50
|
+
**Workaround:** Search codebase for `npx repolens` and manually update other files using the migration pattern:
|
|
51
|
+
```bash
|
|
52
|
+
git grep "npx repolens" .github/workflows/
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### Custom Environment Variable Names
|
|
56
|
+
**Issue:** If you've renamed `NOTION_TOKEN` or `REPOLENS_AI_API_KEY` in your setup, migration adds the default names.
|
|
57
|
+
|
|
58
|
+
**Workaround:** After migration, manually update environment variable names to match your GitHub Secrets.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 📊 Publishing
|
|
63
|
+
|
|
64
|
+
### Branch-Aware Notion Publishing
|
|
65
|
+
|
|
66
|
+
#### Title Conflicts on Multi-Branch Publishing
|
|
67
|
+
**Issue:** If multiple branches publish to the same Notion workspace without `.repolens.yml` → `notion.branches` filter, pages may overwrite each other.
|
|
68
|
+
|
|
69
|
+
**Current Behavior:** Non-main branches get `[branch-name]` suffix to avoid collisions.
|
|
70
|
+
|
|
71
|
+
**Best Practice:** Configure branch filtering in `.repolens.yml`:
|
|
72
|
+
```yaml
|
|
73
|
+
notion:
|
|
74
|
+
branches:
|
|
75
|
+
- main
|
|
76
|
+
- production
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Workaround (if not configured):** Create separate Notion pages for each branch or use branch-specific workspace IDs.
|
|
80
|
+
|
|
81
|
+
#### Cache Collisions on Shared Runners
|
|
82
|
+
**Issue:** GitHub Actions cache keys were not branch-scoped in early versions, causing cross-branch pollution.
|
|
83
|
+
|
|
84
|
+
**Status:** Fixed in v0.4.0 (cache keys now include `${{ github.ref_name }}`).
|
|
85
|
+
|
|
86
|
+
**Workaround (if using <v0.4.0):** Clear Actions cache manually in GitHub Settings → Actions → Management → Caches.
|
|
87
|
+
|
|
88
|
+
### Markdown Publisher
|
|
89
|
+
|
|
90
|
+
#### Large Diagrams in Markdown
|
|
91
|
+
**Issue:** Unicode diagrams work well for simple architectures, but can become unwieldy for 50+ modules.
|
|
92
|
+
|
|
93
|
+
**Current Behavior:** System generates box-drawing diagrams regardless of size.
|
|
94
|
+
|
|
95
|
+
**Workaround:** Filter modules by domain in `.repolens.yml`:
|
|
96
|
+
```yaml
|
|
97
|
+
scan:
|
|
98
|
+
exclude:
|
|
99
|
+
- "**/*.test.js"
|
|
100
|
+
- "**/fixtures/**"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 🤖 AI-Assisted Documentation
|
|
106
|
+
|
|
107
|
+
### Provider-Specific Issues
|
|
108
|
+
|
|
109
|
+
#### OpenAI Rate Limits
|
|
110
|
+
**Issue:** Free tier OpenAI accounts may hit rate limits on large repositories.
|
|
111
|
+
|
|
112
|
+
**Symptom:** `Too Many Requests` errors during document generation.
|
|
113
|
+
|
|
114
|
+
**Workaround:**
|
|
115
|
+
1. Upgrade to OpenAI paid tier, or
|
|
116
|
+
2. Use local model (Ollama) with `AI_PROVIDER=ollama`, or
|
|
117
|
+
3. Run without AI enhancement (deterministic mode, no API key required)
|
|
118
|
+
|
|
119
|
+
#### Anthropic Context Window Limits
|
|
120
|
+
**Issue:** Claude models have 200k token limit; very large repositories may exceed this.
|
|
121
|
+
|
|
122
|
+
**Symptom:** API errors about context length during synthesis.
|
|
123
|
+
|
|
124
|
+
**Workaround:** Use structured context mode (default) which sends only JSON artifacts, not raw code.
|
|
125
|
+
|
|
126
|
+
#### Azure OpenAI Availability
|
|
127
|
+
**Issue:** Azure OpenAI requires separate deployment and endpoint configuration.
|
|
128
|
+
|
|
129
|
+
**Status:** Supported but requires manual setup (see README.md).
|
|
130
|
+
|
|
131
|
+
**Configuration:**
|
|
132
|
+
```bash
|
|
133
|
+
AI_PROVIDER=azure
|
|
134
|
+
AZURE_OPENAI_API_KEY=your-key
|
|
135
|
+
AZURE_OPENAI_ENDPOINT=https://your-instance.openai.azure.com/
|
|
136
|
+
AZURE_OPENAI_DEPLOYMENT_NAME=your-deployment
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Hallucination Prevention
|
|
140
|
+
|
|
141
|
+
#### AI Context Boundaries
|
|
142
|
+
**Issue:** Even with structured context, AI may occasionally make logical leaps.
|
|
143
|
+
|
|
144
|
+
**Status:** Mitigated in v1.4.0 — `truncateContext()` enforces a 12K character cap with progressive field pruning.
|
|
145
|
+
|
|
146
|
+
**Mitigation:**
|
|
147
|
+
- Prompts enforce word limits and require evidence-based reasoning
|
|
148
|
+
- AI receives only JSON artifacts (stats, domains, modules, routes)
|
|
149
|
+
- Never receives raw code to prevent fabrication
|
|
150
|
+
- Deterministic fallback available (disable AI with no API key)
|
|
151
|
+
|
|
152
|
+
**Best Practice:** Review generated documentation before publishing to stakeholders.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## 🔧 Configuration
|
|
157
|
+
|
|
158
|
+
### Config Discovery
|
|
159
|
+
|
|
160
|
+
#### Search Stops at Git Root
|
|
161
|
+
**Issue:** `.repolens.yml` discovery walks up directories until hitting git root, then stops.
|
|
162
|
+
|
|
163
|
+
**Impact:** If config is outside repository root, it won't be found.
|
|
164
|
+
|
|
165
|
+
**Workaround:** Use `--config` flag explicitly:
|
|
166
|
+
```bash
|
|
167
|
+
npx @chappibunny/repolens@latest publish --config ../shared/.repolens.yml
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
#### YAML Schema Version Compatibility
|
|
171
|
+
**Issue:** `configVersion: 1` required in `.repolens.yml`, but no migration tool exists yet for future version bumps.
|
|
172
|
+
|
|
173
|
+
**Status:** Pre-1.0 schema changes may require manual migration.
|
|
174
|
+
|
|
175
|
+
**Best Practice:** Pin to specific versions in package.json if strict stability required.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## 📦 Package Management
|
|
180
|
+
|
|
181
|
+
### Scoped Package Name
|
|
182
|
+
**Issue:** Package was renamed from `repolens` to `@chappibunny/repolens` due to npm name conflict.
|
|
183
|
+
|
|
184
|
+
**Impact:** Old documentation may reference unscoped name.
|
|
185
|
+
|
|
186
|
+
**Migration:** Use `npx @chappibunny/repolens migrate` to automatically update workflows.
|
|
187
|
+
|
|
188
|
+
**Note:** Unscoped `repolens` package (v0.0.1) is a placeholder from another author.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## 🛡️ Security
|
|
193
|
+
|
|
194
|
+
### Secrets in Telemetry
|
|
195
|
+
**Issue:** Sentry error tracking could theoretically capture environment variables in stack traces.
|
|
196
|
+
|
|
197
|
+
**Mitigation:** `beforeSend()` hook in `src/utils/telemetry.js` strips:
|
|
198
|
+
- Cookies
|
|
199
|
+
- Authorization headers
|
|
200
|
+
- Full file paths (sanitized to project-relative)
|
|
201
|
+
- Query parameters
|
|
202
|
+
|
|
203
|
+
**Best Practice:** Use `REPOLENS_TELEMETRY_ENABLED=false` (default) if handling extremely sensitive data.
|
|
204
|
+
|
|
205
|
+
### GitHub Token Permissions
|
|
206
|
+
**Issue:** GitHub Actions workflows need `contents: write` for PR comments, but this grants broad repository access.
|
|
207
|
+
|
|
208
|
+
**Current Requirement:**
|
|
209
|
+
```yaml
|
|
210
|
+
permissions:
|
|
211
|
+
contents: write
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**Planned:** Reduce to minimum required permissions:
|
|
215
|
+
```yaml
|
|
216
|
+
permissions:
|
|
217
|
+
contents: read
|
|
218
|
+
pull-requests: write # Only for PR comments
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## 🚀 Performance
|
|
224
|
+
|
|
225
|
+
### Large Repository Scanning
|
|
226
|
+
**Issue:** Repositories with >10,000 files may have slow scan times.
|
|
227
|
+
|
|
228
|
+
**Current Behavior:**
|
|
229
|
+
- Warning at 10k files
|
|
230
|
+
- Hard failure at 50k files
|
|
231
|
+
|
|
232
|
+
**Workaround:** Use `.repolens.yml` exclude patterns:
|
|
233
|
+
```yaml
|
|
234
|
+
scan:
|
|
235
|
+
exclude:
|
|
236
|
+
- "**/node_modules/**"
|
|
237
|
+
- "**/dist/**"
|
|
238
|
+
- "**/build/**"
|
|
239
|
+
- "**/__tests__/**"
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### AI Generation Speed
|
|
243
|
+
**Issue:** Full document generation with AI can take 2-5 minutes for large codebases.
|
|
244
|
+
|
|
245
|
+
**Expected Behavior:** This is normal due to API rate limits and model processing time.
|
|
246
|
+
|
|
247
|
+
**Workaround:**
|
|
248
|
+
- Use deterministic mode (no AI) for faster generation
|
|
249
|
+
- Cache results in CI (already implemented via Actions cache)
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## � CI/CD
|
|
254
|
+
|
|
255
|
+
### macOS Lockfile on Linux Runners
|
|
256
|
+
**Issue:** A `package-lock.json` generated on macOS doesn't include Linux platform-specific optional dependencies (e.g., `@rollup/rollup-linux-x64-gnu` used by Vitest/Vite).
|
|
257
|
+
|
|
258
|
+
**Symptom:** `Cannot find module @rollup/rollup-linux-x64-gnu` during `npm test` in GitHub Actions.
|
|
259
|
+
|
|
260
|
+
**Fix:** All CI workflows now use:
|
|
261
|
+
```bash
|
|
262
|
+
rm -rf node_modules package-lock.json && npm install
|
|
263
|
+
```
|
|
264
|
+
Do NOT use `npm ci` in GitHub Actions workflows.
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## 🔮 Planned Improvements
|
|
269
|
+
|
|
270
|
+
### Future
|
|
271
|
+
- [ ] Obsidian vault publisher
|
|
272
|
+
- [ ] Cross-repository architecture analysis
|
|
273
|
+
- [ ] VS Code extension for architecture visualization
|
|
274
|
+
- [ ] Slack notifications
|
|
275
|
+
- [ ] Custom webhook support
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## 📝 Reporting Issues
|
|
280
|
+
|
|
281
|
+
If you encounter a bug not listed here:
|
|
282
|
+
|
|
283
|
+
1. **Check Sentry:** If telemetry enabled, error automatically reported
|
|
284
|
+
2. **GitHub Issues:** https://github.com/CHAPIBUNNY/repolens/issues
|
|
285
|
+
3. **Include:**
|
|
286
|
+
- RepoLens version (`npx @chappibunny/repolens@latest version`)
|
|
287
|
+
- Node.js version (`node --version`)
|
|
288
|
+
- Operating system
|
|
289
|
+
- `.repolens.yml` config (sanitize secrets)
|
|
290
|
+
- Error message and stack trace
|
|
291
|
+
- Steps to reproduce
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## 🤝 Contributing
|
|
296
|
+
|
|
297
|
+
Know a workaround? Found a fix? Submit a PR:
|
|
298
|
+
|
|
299
|
+
1. Fork repository
|
|
300
|
+
2. Create branch: `git checkout -b fix/your-issue`
|
|
301
|
+
3. Add test case to `tests/` covering the issue
|
|
302
|
+
4. Implement fix
|
|
303
|
+
5. Verify `npm test` passes (185 tests)
|
|
304
|
+
6. Submit PR with clear description
|
|
305
|
+
|
|
306
|
+
We prioritize issues with:
|
|
307
|
+
- ✅ Reproducible test case
|
|
308
|
+
- ✅ Clear user impact
|
|
309
|
+
- ✅ Proposed solution or workaround
|