@chappibunny/repolens 0.4.1
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 +219 -0
- package/README.md +899 -0
- package/RELEASE.md +52 -0
- package/bin/repolens.js +2 -0
- package/package.json +61 -0
- package/src/ai/document-plan.js +133 -0
- package/src/ai/generate-sections.js +271 -0
- package/src/ai/prompts.js +312 -0
- package/src/ai/provider.js +134 -0
- package/src/analyzers/context-builder.js +146 -0
- package/src/analyzers/domain-inference.js +127 -0
- package/src/analyzers/flow-inference.js +198 -0
- package/src/cli.js +271 -0
- package/src/core/config-schema.js +266 -0
- package/src/core/config.js +18 -0
- package/src/core/diff.js +45 -0
- package/src/core/scan.js +312 -0
- package/src/delivery/comment.js +139 -0
- package/src/docs/generate-doc-set.js +123 -0
- package/src/docs/write-doc-set.js +85 -0
- package/src/doctor.js +174 -0
- package/src/init.js +540 -0
- package/src/migrate.js +251 -0
- package/src/publishers/index.js +33 -0
- package/src/publishers/markdown.js +32 -0
- package/src/publishers/notion.js +325 -0
- package/src/publishers/publish.js +31 -0
- package/src/renderers/render.js +256 -0
- package/src/renderers/renderDiff.js +139 -0
- package/src/renderers/renderMap.js +224 -0
- package/src/utils/branch.js +93 -0
- package/src/utils/logger.js +26 -0
- package/src/utils/retry.js +55 -0
- package/src/utils/update-check.js +150 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to RepoLens will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## 0.4.1
|
|
6
|
+
|
|
7
|
+
### ✨ New Features
|
|
8
|
+
|
|
9
|
+
**Migration Command**:
|
|
10
|
+
- Added `repolens migrate` command to automatically upgrade workflow files from legacy formats to v0.4.0+
|
|
11
|
+
- Auto-detects legacy patterns: `cd tools/repolens`, missing `@latest` suffix, missing Node.js setup, missing environment variables
|
|
12
|
+
- Shows preview diff of changes before applying
|
|
13
|
+
- Creates backup files (*.backup) for safety
|
|
14
|
+
- Supports `--dry-run` flag to preview changes without applying
|
|
15
|
+
- Supports `--force` flag to skip interactive confirmation
|
|
16
|
+
- Handles multiple workflow files in `.github/workflows/`
|
|
17
|
+
- Comprehensive test coverage (7 test cases)
|
|
18
|
+
|
|
19
|
+
**Migration Detection**:
|
|
20
|
+
- Detects outdated `cd tools/repolens` directory changes
|
|
21
|
+
- Detects `npx repolens` without `@latest` suffix
|
|
22
|
+
- Detects missing `actions/setup-node@v4` setup
|
|
23
|
+
- Detects missing environment variables (NOTION_TOKEN, REPOLENS_AI_API_KEY)
|
|
24
|
+
- Automatically adds AI environment variables to existing env sections
|
|
25
|
+
- Skips already-migrated workflows (no-op when up to date)
|
|
26
|
+
|
|
27
|
+
**Documentation**:
|
|
28
|
+
- Added comprehensive migration section to [MIGRATION.md](MIGRATION.md)
|
|
29
|
+
- Updated [README.md](README.md) with migration instructions
|
|
30
|
+
- Added migration examples to CLI help text
|
|
31
|
+
- Updated [RELEASE.md](RELEASE.md) with correct workflow format
|
|
32
|
+
|
|
33
|
+
### 🐛 Bug Fixes
|
|
34
|
+
- Fixed outdated workflow format in RELEASE.md that caused `cd: tools/repolens: No such file or directory` errors
|
|
35
|
+
|
|
36
|
+
### 📚 Documentation
|
|
37
|
+
- Prominently documented workflow migration in MIGRATION.md
|
|
38
|
+
- Added troubleshooting section for common migration issues
|
|
39
|
+
- Clarified v0.3.0 → v0.4.0 upgrade path
|
|
40
|
+
- Added step-by-step migration guide for existing users
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 0.4.0
|
|
45
|
+
|
|
46
|
+
### 💥 Breaking Changes
|
|
47
|
+
- **Major architectural transformation**: RepoLens is now an AI-assisted documentation intelligence system
|
|
48
|
+
- **New document types**: Added 6 new audience-aware documents (11 total, formerly 6)
|
|
49
|
+
- **Three-layer architecture**: deterministic extraction → structured artifacts → AI synthesis
|
|
50
|
+
- **Config schema changes**: New sections added: `features`, `ai`, `documentation`, `domains`
|
|
51
|
+
- **Default behavior unchanged**: AI features are opt-in via environment variables (deterministic mode by default)
|
|
52
|
+
|
|
53
|
+
### ✨ New Features - AI-Assisted Documentation
|
|
54
|
+
|
|
55
|
+
**Multi-Audience Documentation**:
|
|
56
|
+
- **Executive Summary**: Non-technical project overview for leadership (500 words)
|
|
57
|
+
- **Business Domains**: Functional area descriptions readable by all stakeholders (150 words per domain)
|
|
58
|
+
- **Architecture Overview**: Layered technical analysis for engineers (600 words)
|
|
59
|
+
- **Data Flows**: How information moves through the system (200 words per flow)
|
|
60
|
+
- **Developer Onboarding**: Getting started guide for new contributors (800 words)
|
|
61
|
+
- **Change Impact**: Architecture diff with natural language context
|
|
62
|
+
|
|
63
|
+
**AI Integration**:
|
|
64
|
+
- Provider-agnostic design works with any OpenAI-compatible API
|
|
65
|
+
- Supported providers: OpenAI (GPT-4, GPT-3.5), Anthropic Claude, Azure OpenAI, local models (Ollama)
|
|
66
|
+
- Configurable temperature, max tokens, timeout, and model selection
|
|
67
|
+
- Non-blocking AI calls with graceful timeout handling
|
|
68
|
+
- Zero hallucination policy: AI receives only structured JSON context, never raw code
|
|
69
|
+
- Strict prompts prevent fabrication and enforce word limits
|
|
70
|
+
|
|
71
|
+
**Intelligent Analysis**:
|
|
72
|
+
- **Domain Inference**: Automatically maps folders/files to business domains (Authentication, Market Data, Content, etc.)
|
|
73
|
+
- **Context Builder**: Extracts structured artifacts for AI synthesis (no raw code sent to AI)
|
|
74
|
+
- **Flow Inference**: Detects major data flows through heuristic pattern matching
|
|
75
|
+
- **Deterministic Fallback**: Always generates documentation even if AI unavailable or disabled
|
|
76
|
+
|
|
77
|
+
**Document Orchestration**:
|
|
78
|
+
- New document generation pipeline: scan → generateDocumentSet → writeDocumentSet → publish
|
|
79
|
+
- Artifacts saved as JSON in `.repolens/artifacts/` for inspection and debugging
|
|
80
|
+
- Backward compatible: Builds legacy renderedPages format for existing Notion integrations
|
|
81
|
+
|
|
82
|
+
### 🎨 Improvements
|
|
83
|
+
|
|
84
|
+
**Configuration**:
|
|
85
|
+
- New `features` section enables/disables specific documents
|
|
86
|
+
- New `ai` section controls AI behavior (enabled, mode, temperature, max_tokens)
|
|
87
|
+
- New `documentation` section configures output directory and artifacts
|
|
88
|
+
- New `domains` section defines custom business domain mappings
|
|
89
|
+
- Extended `SUPPORTED_PAGE_KEYS` with new document types
|
|
90
|
+
- All new sections optional for backward compatibility
|
|
91
|
+
|
|
92
|
+
**Environment Variables**:
|
|
93
|
+
- `REPOLENS_AI_ENABLED`: Enable/disable AI features (default: false)
|
|
94
|
+
- `REPOLENS_AI_API_KEY`: API key for AI provider
|
|
95
|
+
- `REPOLENS_AI_BASE_URL`: Custom provider endpoint (default: OpenAI)
|
|
96
|
+
- `REPOLENS_AI_MODEL`: Model to use (default: gpt-4-turbo-preview)
|
|
97
|
+
- `REPOLENS_AI_TEMPERATURE`: Creativity level 0.0-1.0 (default: 0.3)
|
|
98
|
+
- `REPOLENS_AI_MAX_TOKENS`: Token limit per request (default: 2000)
|
|
99
|
+
- `REPOLENS_AI_TIMEOUT_MS`: Request timeout (default: 30000ms)
|
|
100
|
+
|
|
101
|
+
**Documentation**:
|
|
102
|
+
- Created comprehensive AI.md guide (350+ lines)
|
|
103
|
+
- Added .env.example with all environment variables documented
|
|
104
|
+
- Added .repolens.example.yml with complete configuration examples
|
|
105
|
+
- Updated README.md with AI features onboarding
|
|
106
|
+
- Cost estimates provided for different repo sizes
|
|
107
|
+
- Provider setup guides for OpenAI, Anthropic, Azure, local models
|
|
108
|
+
|
|
109
|
+
**Cost Management**:
|
|
110
|
+
- Configurable token limits prevent runaway costs
|
|
111
|
+
- Selective document generation (enable only what you need)
|
|
112
|
+
- Usage tips in documentation for cost optimization
|
|
113
|
+
- Estimates: Small repos $0.10-$0.30, Medium $0.30-$0.80, Large $0.80-$2.00 per run
|
|
114
|
+
|
|
115
|
+
### 🔧 Technical Changes
|
|
116
|
+
|
|
117
|
+
**New Modules**:
|
|
118
|
+
- `src/analyzers/domain-inference.js` (155 lines): Business domain mapping from paths
|
|
119
|
+
- `src/analyzers/context-builder.js` (145 lines): Structured AI context assembly
|
|
120
|
+
- `src/analyzers/flow-inference.js` (185 lines): Data flow detection via heuristics
|
|
121
|
+
- `src/ai/provider.js` (130 lines): Provider-agnostic AI text generation
|
|
122
|
+
- `src/ai/prompts.js` (280 lines): Strict prompt templates preventing hallucination
|
|
123
|
+
- `src/ai/document-plan.js` (95 lines): Canonical document structure definition
|
|
124
|
+
- `src/ai/generate-sections.js` (240 lines): AI-powered section generation with fallbacks
|
|
125
|
+
- `src/docs/generate-doc-set.js` (95 lines): Document generation orchestration
|
|
126
|
+
- `src/docs/write-doc-set.js` (75 lines): Write documentation set to disk with artifacts
|
|
127
|
+
|
|
128
|
+
**Modified Modules**:
|
|
129
|
+
- `src/cli.js`: Updated publish flow to use new document generation pipeline
|
|
130
|
+
- `src/core/config-schema.js`: Extended validation for new config sections
|
|
131
|
+
|
|
132
|
+
**Testing**:
|
|
133
|
+
- All 32 existing tests passing
|
|
134
|
+
- No breaking changes to existing functionality
|
|
135
|
+
- Deterministic mode extensively tested
|
|
136
|
+
|
|
137
|
+
### 📦 Package Changes
|
|
138
|
+
- Total additions: 2116+ lines of production code
|
|
139
|
+
- New files: 10 (analyzers, AI layer, docs orchestration)
|
|
140
|
+
- Modified files: 4 (cli, config schema, documentation)
|
|
141
|
+
- Zero new runtime dependencies (uses existing node-fetch, fs, path)
|
|
142
|
+
- Optional AI features add no bundle weight when disabled
|
|
143
|
+
|
|
144
|
+
### 🎯 Philosophy Shift
|
|
145
|
+
|
|
146
|
+
RepoLens is no longer just a "flashy code intelligence toy" — it's now a **documentation intelligence system** that serves both engineers and stakeholders:
|
|
147
|
+
|
|
148
|
+
- **Engineers** get technical architecture docs with code-level detail
|
|
149
|
+
- **Product/Ops/Leadership** get readable system docs explaining what the code does
|
|
150
|
+
- **Deterministic by default** ensures reliability and zero cost baseline
|
|
151
|
+
- **AI-enhanced optionally** adds natural language explanations when needed
|
|
152
|
+
- **Zero hallucination** via structured context and strict prompts
|
|
153
|
+
- **Provider flexibility** prevents vendor lock-in
|
|
154
|
+
|
|
155
|
+
## 0.3.0
|
|
156
|
+
|
|
157
|
+
### 💥 Breaking Changes
|
|
158
|
+
- **Removed Mermaid diagram system**: Replaced complex SVG/mermaid.ink pipeline with simple Unicode architecture diagrams
|
|
159
|
+
- System map now renders as beautiful ASCII art using box-drawing characters
|
|
160
|
+
- No longer requires 50MB @mermaid-js/mermaid-cli dependency
|
|
161
|
+
- No longer generates or commits SVG files to repository
|
|
162
|
+
- Diagrams now always work reliably in Notion and Markdown without external dependencies
|
|
163
|
+
|
|
164
|
+
### ✨ New Features
|
|
165
|
+
- **Automatic update notifications**: CLI checks for new versions and notifies users
|
|
166
|
+
- **Version checking in doctor command**: `repolens doctor` now shows if updates are available
|
|
167
|
+
- **24-hour cache**: Update checks cached to avoid excessive npm registry calls
|
|
168
|
+
- **Non-blocking**: Update check runs in background, doesn't slow down commands
|
|
169
|
+
|
|
170
|
+
### 🎨 Improvements
|
|
171
|
+
- **Unicode Architecture Diagrams**: Clean, always-working diagrams with emoji icons (🎯, ⚙️, 📋, 🔌, 🛠️, ✅, 📦)
|
|
172
|
+
- **Simpler workflow**: Removed Mermaid CLI installation and SVG commit steps from GitHub Actions
|
|
173
|
+
- **Faster publishing**: No SVG generation or git operations needed
|
|
174
|
+
- **Better reliability**: No URL length limits, no image loading issues, no external service dependencies
|
|
175
|
+
- **Interactive credential collection**: `repolens init` now prompts for Notion credentials and auto-creates .env file
|
|
176
|
+
- **Smart CI detection**: Prompts skip in CI but work via npx
|
|
177
|
+
|
|
178
|
+
### 🔧 Technical Changes
|
|
179
|
+
- Added `src/utils/update-check.js` with version comparison logic
|
|
180
|
+
- Integrated update checking at CLI startup (non-blocking)
|
|
181
|
+
- Enhanced doctor command with forced version checking
|
|
182
|
+
- Simplified `renderSystemMap()` to return plain markdown with Unicode diagrams
|
|
183
|
+
- Removed `generateMermaidImageUrl()`, `prepareDiagramUrl()`, and mermaid.ink fallback logic
|
|
184
|
+
- Simplified `replacePageContent()` in notion.js - no longer handles image embedding
|
|
185
|
+
- Simplified markdown publisher - no longer generates SVG files
|
|
186
|
+
- Cleaned up GitHub Actions workflow - removed write permissions and diagram commits
|
|
187
|
+
|
|
188
|
+
### 📦 Package Changes
|
|
189
|
+
- Removed test artifacts from repository (cleaner npm package)
|
|
190
|
+
- Updated .gitignore to exclude test files
|
|
191
|
+
- Simplified workflow template to use `npx repolens@latest`
|
|
192
|
+
|
|
193
|
+
## 0.2.0
|
|
194
|
+
|
|
195
|
+
- Added interactive credential collection to `repolens init`
|
|
196
|
+
- Improved documentation clarity for non-technical users
|
|
197
|
+
- Added emoji icons to all documentation pages
|
|
198
|
+
- Auto-detection of Notion secrets for seamless publishing
|
|
199
|
+
- Branch-aware publishing with title namespacing
|
|
200
|
+
- URL length validation for Notion image embeds
|
|
201
|
+
- Package.json metadata extraction for tech stack detection
|
|
202
|
+
|
|
203
|
+
## 0.1.1
|
|
204
|
+
|
|
205
|
+
- Initial RepoLens CLI
|
|
206
|
+
- Added `init` command
|
|
207
|
+
- Added `doctor` command
|
|
208
|
+
- Added `publish` command
|
|
209
|
+
- Added `version` and `help` commands
|
|
210
|
+
- Added Notion publisher
|
|
211
|
+
- Added Markdown publisher
|
|
212
|
+
- Added route map generation
|
|
213
|
+
- Added system map generation
|
|
214
|
+
- Added architecture diff generation
|
|
215
|
+
- Added PR comment publishing
|
|
216
|
+
- Added repo structure autodetection in `init`
|
|
217
|
+
- Added `.env.example` generation
|
|
218
|
+
- Added `README.repolens.md` generation
|
|
219
|
+
- Added test coverage for config, init, doctor, markdown publisher, and CLI
|