@chappibunny/repolens 0.6.2 → 0.6.3
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 +50 -62
- package/README.md +8 -8
- package/RELEASE.md +32 -8
- package/package.json +1 -1
- package/src/cli.js +48 -2
- package/src/init.js +1 -1
- package/src/utils/telemetry.js +58 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,84 +2,72 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to RepoLens will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## 0.6.
|
|
5
|
+
## 0.6.3
|
|
6
6
|
|
|
7
7
|
### ✨ New Features
|
|
8
|
+
- **User Feedback**: Added `repolens feedback` CLI command for sending feedback directly to the RepoLens team via Sentry
|
|
9
|
+
- Interactive prompts for name, email, and message
|
|
10
|
+
- Works even when telemetry is disabled — feedback is always accepted
|
|
11
|
+
- Uses `Sentry.captureFeedback()` from `@sentry/node`
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
### 🔧 Maintenance
|
|
14
|
+
- Updated version references across all documentation
|
|
15
|
+
- Added `feedback` to CLI help and command listings
|
|
16
|
+
|
|
17
|
+
## 0.6.2
|
|
18
|
+
|
|
19
|
+
### 🐛 Bug Fixes
|
|
20
|
+
- **CI/CD**: Fixed release workflow failing with `Cannot find module @rollup/rollup-linux-x64-gnu`
|
|
21
|
+
- Root cause: macOS-generated `package-lock.json` doesn't resolve Linux platform-specific optional dependencies
|
|
22
|
+
- Fix: Changed all CI install steps to `rm -rf node_modules package-lock.json && npm install`
|
|
23
|
+
- Applied to both `publish-docs.yml` and `release.yml` workflows
|
|
24
|
+
|
|
25
|
+
### 🔧 Maintenance
|
|
26
|
+
- Updated version references across codebase
|
|
27
|
+
- Updated test assertions for version 0.6.2
|
|
28
|
+
|
|
29
|
+
## 0.6.1
|
|
30
|
+
|
|
31
|
+
### 🐛 Bug Fixes
|
|
32
|
+
- **Confluence Publisher**: Fixed `version` showing as `[object Object]1`
|
|
33
|
+
- Root cause: `existingPage.version` was the full version object, not just the number
|
|
34
|
+
- Fix: Normalize version to use cached structure with extracted version number
|
|
35
|
+
- **Confluence Publisher**: Fixed code block formatting in storage format
|
|
36
|
+
- Implemented 3-step extract→convert→restore pipeline
|
|
37
|
+
- Properly handles fenced code blocks in Markdown→Confluence conversion
|
|
38
|
+
|
|
39
|
+
### 📦 Package
|
|
40
|
+
- Renamed npm package from `@rabitai/repolens` to `@chappibunny/repolens`
|
|
41
|
+
- Updated all references across codebase, workflows, and documentation
|
|
42
|
+
- Published to npm registry under new scope
|
|
43
|
+
|
|
44
|
+
## 0.6.0 (Team Features & Observability)
|
|
45
|
+
|
|
46
|
+
### ✨ New Features
|
|
47
|
+
|
|
48
|
+
**Discord Integration** (`src/integrations/discord.js`):
|
|
10
49
|
- Rich embed notifications with coverage, health score, and change metrics
|
|
11
50
|
- Threshold-based notifications (default: >10% change)
|
|
12
51
|
- Branch filtering with glob pattern support
|
|
13
52
|
- Secure webhook configuration via `DISCORD_WEBHOOK_URL` environment variable
|
|
14
|
-
- Functions: `sendDiscordNotification()`, `buildDocUpdateNotification()`, `buildErrorNotification()`, `shouldNotify()`
|
|
15
53
|
- Color-coded embeds: success (green), warning (yellow), error (red), info (blue)
|
|
16
54
|
|
|
17
|
-
**Metrics Collection System** (`src/utils/metrics.js`
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
- Functions: `calculateCoverage()`, `calculateHealthScore()`, `detectStaleness()`, `analyzeQuality()`, `trackMetrics()`, `calculateTrends()`, `collectMetrics()`
|
|
25
|
-
|
|
26
|
-
**Interactive Dashboard** (`src/renderers/renderDashboard.js` - 1,020 lines):
|
|
27
|
-
- Beautiful HTML dashboard with inline CSS (zero dependencies)
|
|
28
|
-
- **Health Score Card**: Color-coded 0-100 score (excellent/good/fair/poor)
|
|
29
|
-
- **Coverage Breakdown**: Module/API/page coverage with progress bars
|
|
30
|
-
- **Freshness Tracking**: Stale file detection with last updated timestamps
|
|
31
|
-
- **Quality Issues List**: Severity badges (high/medium/low) with actionable items
|
|
32
|
-
- **Trend Charts**: SVG visualization of coverage and health score over time
|
|
33
|
-
- **Quick Links**: Direct links to Notion, GitHub, and Markdown documentation
|
|
34
|
-
- Responsive design with animations and smooth transitions
|
|
35
|
-
- Generated at `.repolens/dashboard/index.html`
|
|
36
|
-
|
|
37
|
-
**GitHub Pages Deployment** (`.github/workflows/deploy-dashboard.yml` - 73 lines):
|
|
38
|
-
- Automated deployment to `https://OWNER.github.io/REPO/`
|
|
39
|
-
- Deploys on every push to main branch
|
|
40
|
-
- Uses local code during development (`npm link`)
|
|
41
|
-
- Graceful fallback for missing dashboard files
|
|
42
|
-
- Security-conscious environment variable handling
|
|
55
|
+
**Metrics Collection System** (`src/utils/metrics.js`):
|
|
56
|
+
- Coverage calculation: weighted average (modules 50%, APIs 30%, pages 20%)
|
|
57
|
+
- Health score algorithm: 0-100 rating (40% coverage + 30% freshness + 30% quality)
|
|
58
|
+
- Staleness detection: flags documentation >90 days old
|
|
59
|
+
- Quality analysis: identifies undocumented modules/APIs/pages with severity levels
|
|
60
|
+
- Historical tracking: persists metrics to `.repolens/metrics-history.json`
|
|
61
|
+
- Trend indicators: up/down/stable trend detection (>1% threshold)
|
|
43
62
|
|
|
44
63
|
**Configuration Extensions** (`src/core/config-schema.js`):
|
|
45
|
-
-
|
|
46
|
-
* `discord.notifyOn`: "always", "significant", or "never"
|
|
47
|
-
* `discord.significantThreshold`: 0-100 (default: 10%)
|
|
48
|
-
* `discord.branches`: Array with glob pattern support
|
|
49
|
-
* `discord.enabled`: Boolean
|
|
50
|
-
- **Dashboard Configuration**:
|
|
51
|
-
* `dashboard.enabled`: Boolean (default: true)
|
|
52
|
-
* `dashboard.githubPages`: Boolean
|
|
53
|
-
* `dashboard.staleThreshold`: Number (default: 90 days)
|
|
64
|
+
- Discord configuration: `discord.notifyOn`, `discord.significantThreshold`, `discord.branches`, `discord.enabled`
|
|
54
65
|
|
|
55
66
|
**Publishing Integration** (`src/publishers/index.js`):
|
|
56
67
|
- Automatic metrics collection after publishing
|
|
57
|
-
- Dashboard generation integrated into publish flow
|
|
58
68
|
- Discord notifications sent after successful publish (if configured)
|
|
59
69
|
- Branch-aware notification filtering
|
|
60
|
-
- Graceful error handling (doesn't fail publish if
|
|
61
|
-
|
|
62
|
-
### 🔧 Configuration
|
|
63
|
-
|
|
64
|
-
**Environment Variables** (`.env.example`):
|
|
65
|
-
- Added `DISCORD_WEBHOOK_URL` for team notifications
|
|
66
|
-
- Security warnings and setup instructions
|
|
67
|
-
- GitHub Actions secret configuration guidance
|
|
68
|
-
|
|
69
|
-
**GitHub Actions** (`.github/workflows/publish-docs.yml`):
|
|
70
|
-
- Added `DISCORD_WEBHOOK_URL` to workflow environment
|
|
71
|
-
|
|
72
|
-
### 📊 Testing
|
|
73
|
-
- All 90 tests passing (47 main + 43 security)
|
|
74
|
-
- No regressions from Phase 4 integration
|
|
75
|
-
- Metrics algorithms validated
|
|
76
|
-
- Dashboard generation tested
|
|
77
|
-
|
|
78
|
-
### 🐛 Bug Fixes
|
|
79
|
-
- **GitHub Pages Workflow**: Fixed deployment to use local code during development
|
|
80
|
-
* Changed from `npx @chappibunny/repolens@latest` to `npm link && npx repolens`
|
|
81
|
-
* Added file existence checks before copying dashboard
|
|
82
|
-
* Created graceful fallback with "Coming Soon" placeholder for missing files
|
|
70
|
+
- Graceful error handling (doesn't fail publish if notifications fail)
|
|
83
71
|
|
|
84
72
|
## 0.5.0 (Phase 3: Security Audit)
|
|
85
73
|
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
AI-assisted documentation intelligence system that generates architecture docs for engineers AND readable system docs for stakeholders
|
|
22
22
|
|
|
23
|
-
**Current Status**: v0.6.
|
|
23
|
+
**Current Status**: v0.6.3 — Sentry User Feedback & Team Features
|
|
24
24
|
|
|
25
25
|
RepoLens automatically generates and maintains living architecture documentation by analyzing your repository structure, extracting meaningful insights from your package.json, and creating visual dependency graphs. Run it once, or let it auto-update on every push.
|
|
26
26
|
|
|
@@ -224,7 +224,7 @@ npm link
|
|
|
224
224
|
Install from a specific version:
|
|
225
225
|
|
|
226
226
|
```bash
|
|
227
|
-
npm install https://github.com/CHAPIBUNNY/repolens/releases/download/v0.6.
|
|
227
|
+
npm install https://github.com/CHAPIBUNNY/repolens/releases/download/v0.6.3/chappibunny-repolens-0.6.3.tgz
|
|
228
228
|
```
|
|
229
229
|
</details>
|
|
230
230
|
|
|
@@ -1077,7 +1077,7 @@ Simulates the full user installation experience:
|
|
|
1077
1077
|
npm pack
|
|
1078
1078
|
|
|
1079
1079
|
# Install globally from tarball
|
|
1080
|
-
npm install -g chappibunny-repolens-0.6.
|
|
1080
|
+
npm install -g chappibunny-repolens-0.6.3.tgz
|
|
1081
1081
|
|
|
1082
1082
|
# Verify
|
|
1083
1083
|
repolens --version
|
|
@@ -1152,13 +1152,13 @@ RepoLens uses automated GitHub Actions releases.
|
|
|
1152
1152
|
### Creating a Release
|
|
1153
1153
|
|
|
1154
1154
|
```bash
|
|
1155
|
-
# Patch version (0.6.
|
|
1155
|
+
# Patch version (0.6.3 → 0.6.4) - Bug fixes
|
|
1156
1156
|
npm run release:patch
|
|
1157
1157
|
|
|
1158
|
-
# Minor version (0.6.
|
|
1158
|
+
# Minor version (0.6.3 → 0.7.0) - New features
|
|
1159
1159
|
npm run release:minor
|
|
1160
1160
|
|
|
1161
|
-
# Major version (0.6.
|
|
1161
|
+
# Major version (0.6.3 → 1.0.0) - Breaking changes
|
|
1162
1162
|
npm run release:major
|
|
1163
1163
|
|
|
1164
1164
|
# Push the tag to trigger workflow
|
|
@@ -1190,11 +1190,11 @@ RepoLens is currently in early access. v1.0 will open for community contribution
|
|
|
1190
1190
|
|
|
1191
1191
|
## 🗺️ Roadmap to v1.0
|
|
1192
1192
|
|
|
1193
|
-
**Current Status:** v0.6.
|
|
1193
|
+
**Current Status:** v0.6.3 — Sentry User Feedback & Team Features
|
|
1194
1194
|
|
|
1195
1195
|
### Completed ✅
|
|
1196
1196
|
|
|
1197
|
-
- [x] CLI commands: `init`, `doctor`, `publish`, `migrate`, `version`, `help`
|
|
1197
|
+
- [x] CLI commands: `init`, `doctor`, `publish`, `migrate`, `feedback`, `version`, `help`
|
|
1198
1198
|
- [x] Config schema v1 with validation
|
|
1199
1199
|
- [x] Auto-discovery of `.repolens.yml`
|
|
1200
1200
|
- [x] Publishers: Notion + Confluence + Markdown
|
package/RELEASE.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
RepoLens uses semantic versioning:
|
|
6
6
|
|
|
7
|
-
- Patch
|
|
8
|
-
- Minor
|
|
9
|
-
- Major
|
|
7
|
+
- **Patch**: bug fixes, internal cleanup, non-breaking improvements
|
|
8
|
+
- **Minor**: new features, new commands, new publishers
|
|
9
|
+
- **Major**: breaking CLI or config changes
|
|
10
10
|
|
|
11
11
|
## Release Checklist
|
|
12
12
|
|
|
@@ -18,14 +18,19 @@ RepoLens uses semantic versioning:
|
|
|
18
18
|
4. Update `CHANGELOG.md`
|
|
19
19
|
5. Bump version in `package.json`
|
|
20
20
|
6. Commit release changes
|
|
21
|
-
7. Tag the release
|
|
22
|
-
8. Push branch and tag
|
|
23
|
-
9.
|
|
21
|
+
7. Tag the release: `git tag v<version>`
|
|
22
|
+
8. Push branch and tag: `git push --follow-tags`
|
|
23
|
+
9. GitHub Actions `release.yml` runs automatically:
|
|
24
|
+
- Security audit (dependency + secrets scanning)
|
|
25
|
+
- Test suite (90 tests)
|
|
26
|
+
- Create GitHub Release with tarball
|
|
27
|
+
- Publish to npm (`npm publish --access public`)
|
|
28
|
+
10. Verify on npm: `npm view @chappibunny/repolens version`
|
|
24
29
|
|
|
25
30
|
## Example Patch Release
|
|
26
31
|
|
|
27
32
|
```bash
|
|
28
|
-
# 1.
|
|
33
|
+
# 1. Bump version + create tag
|
|
29
34
|
npm run release:patch # or :minor, :major
|
|
30
35
|
|
|
31
36
|
# 2. Run tests
|
|
@@ -34,13 +39,32 @@ npm test
|
|
|
34
39
|
# 3. Test installation
|
|
35
40
|
npm run test:install
|
|
36
41
|
|
|
37
|
-
# 4. Push release
|
|
42
|
+
# 4. Push release (triggers release.yml workflow)
|
|
38
43
|
git push --follow-tags
|
|
39
44
|
|
|
40
45
|
# 5. Verify GitHub Actions
|
|
41
46
|
# Check: https://github.com/CHAPIBUNNY/repolens/actions
|
|
47
|
+
|
|
48
|
+
# 6. Verify npm publish
|
|
49
|
+
npm view @chappibunny/repolens version
|
|
42
50
|
```
|
|
43
51
|
|
|
52
|
+
## CI/CD Notes
|
|
53
|
+
|
|
54
|
+
### Important: CI Install Strategy
|
|
55
|
+
|
|
56
|
+
GitHub Actions workflows use `rm -rf node_modules package-lock.json && npm install` instead of `npm ci`. This is because a macOS-generated `package-lock.json` doesn't properly resolve Linux platform-specific optional dependencies (e.g., `@rollup/rollup-linux-x64-gnu` required by Vitest).
|
|
57
|
+
|
|
58
|
+
- **Do NOT** use `npm ci` in CI workflows
|
|
59
|
+
- **Do NOT** commit `package-lock.json` changes made on CI runners back to the repo
|
|
60
|
+
- Always delete both `node_modules` and `package-lock.json` before install in CI
|
|
61
|
+
|
|
62
|
+
### npm Publishing
|
|
63
|
+
|
|
64
|
+
The `release.yml` workflow publishes to npm automatically when a `v*` tag is pushed. It requires:
|
|
65
|
+
- `NPM_TOKEN` secret set in GitHub repository settings
|
|
66
|
+
- Token must have publish access to `@chappibunny` scope
|
|
67
|
+
|
|
44
68
|
## Testing Upgrade Path
|
|
45
69
|
|
|
46
70
|
To test that users can upgrade successfully:
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -31,8 +31,10 @@ import {
|
|
|
31
31
|
closeTelemetry,
|
|
32
32
|
trackUsage,
|
|
33
33
|
startTimer,
|
|
34
|
-
stopTimer
|
|
34
|
+
stopTimer,
|
|
35
|
+
sendFeedback
|
|
35
36
|
} from "./utils/telemetry.js";
|
|
37
|
+
import { createInterface } from "node:readline";
|
|
36
38
|
|
|
37
39
|
async function getPackageVersion() {
|
|
38
40
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -109,6 +111,7 @@ Commands:
|
|
|
109
111
|
doctor Validate your RepoLens setup
|
|
110
112
|
migrate Upgrade workflow files to v0.4.0 format
|
|
111
113
|
publish Scan, render, and publish documentation
|
|
114
|
+
feedback Send feedback to the RepoLens team
|
|
112
115
|
version Print the current RepoLens version
|
|
113
116
|
|
|
114
117
|
Options:
|
|
@@ -341,8 +344,51 @@ async function main() {
|
|
|
341
344
|
return;
|
|
342
345
|
}
|
|
343
346
|
|
|
347
|
+
if (command === "feedback") {
|
|
348
|
+
await printBanner();
|
|
349
|
+
info("Send feedback to the RepoLens team");
|
|
350
|
+
info("Your feedback is anonymous and helps us improve RepoLens.\n");
|
|
351
|
+
|
|
352
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
353
|
+
const ask = (q) => new Promise((resolve) => rl.question(q, resolve));
|
|
354
|
+
|
|
355
|
+
try {
|
|
356
|
+
const name = await ask("Your name: ");
|
|
357
|
+
const email = await ask("Your email: ");
|
|
358
|
+
const message = await ask("Feedback: ");
|
|
359
|
+
rl.close();
|
|
360
|
+
|
|
361
|
+
if (!message.trim()) {
|
|
362
|
+
error("Feedback message cannot be empty.");
|
|
363
|
+
await closeTelemetry();
|
|
364
|
+
process.exit(1);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
info("\nSending feedback...");
|
|
368
|
+
const sent = await sendFeedback(
|
|
369
|
+
name.trim() || "Anonymous",
|
|
370
|
+
email.trim() || "no-email@repolens.dev",
|
|
371
|
+
message.trim()
|
|
372
|
+
);
|
|
373
|
+
|
|
374
|
+
if (sent) {
|
|
375
|
+
info("✓ Thank you! Your feedback has been sent.");
|
|
376
|
+
} else {
|
|
377
|
+
error("Failed to send feedback. Please try again later.");
|
|
378
|
+
}
|
|
379
|
+
} catch (err) {
|
|
380
|
+
rl.close();
|
|
381
|
+
captureError(err, { command: "feedback" });
|
|
382
|
+
error("Failed to send feedback:");
|
|
383
|
+
error(err.message);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
await closeTelemetry();
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
|
|
344
390
|
error(`Unknown command: ${command}`);
|
|
345
|
-
error("Available commands: init, doctor, migrate, publish, version, help");
|
|
391
|
+
error("Available commands: init, doctor, migrate, publish, feedback, version, help");
|
|
346
392
|
process.exit(1);
|
|
347
393
|
}
|
|
348
394
|
|
package/src/init.js
CHANGED
|
@@ -61,7 +61,7 @@ NOTION_VERSION=2022-06-28
|
|
|
61
61
|
|
|
62
62
|
# Confluence Publishing
|
|
63
63
|
CONFLUENCE_URL=https://your-company.atlassian.net/wiki
|
|
64
|
-
CONFLUENCE_EMAIL=
|
|
64
|
+
CONFLUENCE_EMAIL=trades@rabitaitrades.com
|
|
65
65
|
CONFLUENCE_API_TOKEN=
|
|
66
66
|
CONFLUENCE_SPACE_KEY=DOCS
|
|
67
67
|
CONFLUENCE_PARENT_PAGE_ID=
|
package/src/utils/telemetry.js
CHANGED
|
@@ -373,3 +373,61 @@ export function trackMigration(migratedCount, skippedCount) {
|
|
|
373
373
|
// Silently fail
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
+
|
|
377
|
+
// ============================================================
|
|
378
|
+
// User Feedback
|
|
379
|
+
// ============================================================
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Ensure Sentry is initialized for feedback submission.
|
|
383
|
+
* Feedback always works, even if REPOLENS_TELEMETRY_ENABLED is false.
|
|
384
|
+
*/
|
|
385
|
+
function ensureSentryForFeedback() {
|
|
386
|
+
if (enabled) return true;
|
|
387
|
+
|
|
388
|
+
// Initialize Sentry in a minimal mode just for feedback
|
|
389
|
+
try {
|
|
390
|
+
const packageJsonPath = join(__dirname, "../../package.json");
|
|
391
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
392
|
+
const version = packageJson.version || "unknown";
|
|
393
|
+
|
|
394
|
+
Sentry.init({
|
|
395
|
+
dsn: "https://082083dbf5899ed7e65dfd9b8dc72f90@o4511014913703936.ingest.de.sentry.io/4511014919209040",
|
|
396
|
+
release: `repolens@${version}`,
|
|
397
|
+
environment: process.env.NODE_ENV || "production",
|
|
398
|
+
sampleRate: 1.0, // Always send feedback
|
|
399
|
+
tracesSampleRate: 0,
|
|
400
|
+
});
|
|
401
|
+
return true;
|
|
402
|
+
} catch (e) {
|
|
403
|
+
return false;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Send user feedback to Sentry
|
|
409
|
+
* Works even when telemetry is disabled — feedback is always accepted.
|
|
410
|
+
* @param {string} name - User's name
|
|
411
|
+
* @param {string} email - User's email
|
|
412
|
+
* @param {string} message - Feedback message
|
|
413
|
+
* @returns {Promise<boolean>} Whether feedback was sent successfully
|
|
414
|
+
*/
|
|
415
|
+
export async function sendFeedback(name, email, message) {
|
|
416
|
+
try {
|
|
417
|
+
if (!ensureSentryForFeedback()) {
|
|
418
|
+
return false;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
Sentry.captureFeedback({
|
|
422
|
+
name,
|
|
423
|
+
email,
|
|
424
|
+
message,
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
// Flush to make sure feedback is sent before process exits
|
|
428
|
+
await Sentry.flush(5000);
|
|
429
|
+
return true;
|
|
430
|
+
} catch (e) {
|
|
431
|
+
return false;
|
|
432
|
+
}
|
|
433
|
+
}
|