@chappibunny/repolens 0.6.0 → 0.6.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/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ <p align="center">
2
+ <img src="Avatar.png" alt="RepoLens" width="120" />
3
+ </p>
4
+
1
5
  ```
2
6
  ██████╗ ███████╗██████╗ ██████╗ ██╗ ███████╗███╗ ██╗███████╗
3
7
  ██╔══██╗██╔════╝██╔══██╗██╔═══██╗██║ ██╔════╝████╗ ██║██╔════╝
@@ -16,7 +20,7 @@
16
20
 
17
21
  AI-assisted documentation intelligence system that generates architecture docs for engineers AND readable system docs for stakeholders
18
22
 
19
- **Current Status**: v0.6.0Team Features & Observability Dashboard
23
+ **Current Status**: v0.6.1Confluence Publisher & Team Features
20
24
 
21
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.
22
26
 
@@ -49,7 +53,7 @@ For Confluence:
49
53
  ```bash
50
54
  # Edit .env and add:
51
55
  CONFLUENCE_URL=https://your-company.atlassian.net/wiki
52
- CONFLUENCE_EMAIL=your@email.com
56
+ CONFLUENCE_EMAIL=trades@rabitaitrades.com
53
57
  CONFLUENCE_API_TOKEN=your-token
54
58
  CONFLUENCE_SPACE_KEY=DOCS
55
59
  ```
@@ -128,56 +132,11 @@ RepoLens automatically detects:
128
132
  ✅ **Branch-Aware** - Prevent doc conflicts across branches
129
133
  ✅ **GitHub Actions** - Autonomous operation on every push
130
134
  ✅ **Team Notifications** - Discord integration with rich embeds (NEW in v0.6.0)
131
- ✅ **Observability Dashboard** - Interactive HTML metrics dashboard (NEW in v0.6.0)
132
135
  ✅ **Health Score Tracking** - Monitor documentation quality over time (NEW in v0.6.0)
133
- ✅ **GitHub Pages Deployment** - Automated public dashboard hosting (NEW in v0.6.0)
134
136
 
135
137
  ---
136
138
 
137
- ## 👥 Team Features & Observability (New in v0.6.0)
138
-
139
- ### 📊 Interactive Dashboard
140
-
141
- RepoLens now generates a beautiful HTML dashboard with real-time metrics and trends:
142
-
143
- **Features:**
144
- - **Health Score** — 0-100 rating based on coverage, freshness, and quality
145
- - **Coverage Metrics** — Module, API, and page documentation coverage with progress bars
146
- - **Freshness Tracking** — Identifies stale documentation (>90 days old)
147
- - **Quality Issues** — Lists undocumented modules, APIs, and pages with severity badges
148
- - **Trend Charts** — SVG visualization of coverage and health score over time
149
- - **Quick Links** — Direct links to Notion, GitHub, and Markdown documentation
150
-
151
- **Access your dashboard:**
152
- - **Local**: `.repolens/dashboard/index.html` after running `repolens publish`
153
- - **Public**: `https://OWNER.github.io/REPO/` (with GitHub Pages enabled)
154
-
155
- **Setup GitHub Pages (Optional):**
156
-
157
- 1. **Add workflow** (created by `repolens init` in v0.6.0+):
158
- - File: `.github/workflows/deploy-dashboard.yml`
159
- - Triggers: Runs on every push to main
160
-
161
- 2. **Enable GitHub Pages**:
162
- - Go to repo Settings → Pages
163
- - Source: **GitHub Actions**
164
- - Save
165
-
166
- 3. **Add secrets** (if using publishers or notifications):
167
- ```
168
- NOTION_TOKEN
169
- NOTION_PARENT_PAGE_ID
170
- CONFLUENCE_URL
171
- CONFLUENCE_EMAIL
172
- CONFLUENCE_API_TOKEN
173
- CONFLUENCE_SPACE_KEY
174
- CONFLUENCE_PARENT_PAGE_ID # Optional
175
- DISCORD_WEBHOOK_URL # Optional
176
- ```
177
- DISCORD_WEBHOOK_URL
178
- ```
179
-
180
- Your dashboard will be live at `https://OWNER.github.io/REPO/` within minutes!
139
+ ## 👥 Team Features (New in v0.6.0)
181
140
 
182
141
  ### 💬 Discord Notifications
183
142
 
@@ -221,7 +180,7 @@ Get notified when documentation changes significantly:
221
180
  - Files scanned and modules analyzed
222
181
  - Coverage percentage and health score
223
182
  - Change percentage from previous run
224
- - Direct links to dashboard, Notion, and GitHub
183
+ - Direct links to Notion and GitHub documentation
225
184
 
226
185
  ---
227
186
 
@@ -233,7 +192,7 @@ Get notified when documentation changes significantly:
233
192
  npm install @chappibunny/repolens
234
193
  ```
235
194
 
236
- Installs from npm registry. ✨ **Now available in beta!**
195
+ Installs from npm registry.
237
196
 
238
197
  ### Alternative Methods
239
198
 
@@ -265,7 +224,7 @@ npm link
265
224
  Install from a specific version:
266
225
 
267
226
  ```bash
268
- npm install https://github.com/CHAPIBUNNY/repolens/releases/download/v0.2.0/repolens-0.2.0.tgz
227
+ npm install https://github.com/CHAPIBUNNY/repolens/releases/download/v0.6.1/chappibunny-repolens-0.6.1.tgz
269
228
  ```
270
229
  </details>
271
230
 
@@ -465,7 +424,7 @@ If using the Confluence publisher:
465
424
  Create `.env` in your project root:
466
425
  ```bash
467
426
  CONFLUENCE_URL=https://your-company.atlassian.net/wiki
468
- CONFLUENCE_EMAIL=your@email.com
427
+ CONFLUENCE_EMAIL=trades@rabitaitrades.com
469
428
  CONFLUENCE_API_TOKEN=your-api-token-here
470
429
  CONFLUENCE_SPACE_KEY=DOCS
471
430
  CONFLUENCE_PARENT_PAGE_ID=123456789 # Optional
@@ -486,7 +445,7 @@ Add as repository secrets:
486
445
  2. Click **"New repository secret"**
487
446
  3. Add:
488
447
  - Name: `CONFLUENCE_URL`, Value: `https://your-company.atlassian.net/wiki`
489
- - Name: `CONFLUENCE_EMAIL`, Value: `your@email.com`
448
+ - Name: `CONFLUENCE_EMAIL`, Value: `trades@rabitaitrades.com`
490
449
  - Name: `CONFLUENCE_API_TOKEN`, Value: `your-token`
491
450
  - Name: `CONFLUENCE_SPACE_KEY`, Value: `DOCS`
492
451
  - Name: `CONFLUENCE_PARENT_PAGE_ID`, Value: `123456789` (optional)
@@ -557,7 +516,7 @@ npx @chappibunny/repolens publish
557
516
 
558
517
  **Expected output:**
559
518
  ```
560
- RABITAI 🐰
519
+ RepoLens 🔍
561
520
  ────────────────────────────────────────────────────
562
521
  [RepoLens] Using config: /path/to/.repolens.yml
563
522
  [RepoLens] Loading configuration...
@@ -582,7 +541,7 @@ ls .repolens/
582
541
  # api_surface.md
583
542
  # route_map.md
584
543
  # system_map.md
585
- # diagrams/system_map.svg
544
+ # system_map.md
586
545
  ```
587
546
 
588
547
  **Notion Output:**
@@ -652,7 +611,7 @@ Validates:
652
611
  - ✅ Required config fields present
653
612
  - ✅ Publishers configured correctly
654
613
  - ✅ Scan patterns defined
655
- - ✅ Mermaid CLI installation status
614
+ - ✅ Publisher configuration valid
656
615
 
657
616
  ### Migrate Workflows
658
617
 
@@ -854,7 +813,7 @@ RepoLens implements **defense-in-depth** security to protect your credentials, c
854
813
 
855
814
  ### Vulnerability Reporting
856
815
 
857
- - 📧 **Email**: [your-email@example.com] (replace with actual contact)
816
+ - 📧 **Email**: trades@rabitaitrades.com
858
817
  - 🚨 **DO NOT** open public issues for security bugs
859
818
  - ⏱️ **Response**: Within 48 hours
860
819
  - 🔒 **Fix Timeline**: Critical issues within 7 days, others within 30 days
@@ -895,6 +854,7 @@ project:
895
854
  # Configure output destinations
896
855
  publishers:
897
856
  - notion
857
+ - confluence
898
858
  - markdown
899
859
 
900
860
  # Notion-specific settings (optional)
@@ -905,6 +865,11 @@ notion:
905
865
  - release/* # Glob patterns supported
906
866
  includeBranchInTitle: false # Clean titles without [branch-name]
907
867
 
868
+ # Confluence-specific settings (optional)
869
+ confluence:
870
+ branches:
871
+ - main # Only main branch publishes to Confluence
872
+
908
873
  # Discord notifications (optional, new in v0.6.0)
909
874
  discord:
910
875
  enabled: true # Default: true (if DISCORD_WEBHOOK_URL set)
@@ -914,12 +879,6 @@ discord:
914
879
  - main
915
880
  - develop
916
881
 
917
- # Observability dashboard (optional, new in v0.6.0)
918
- dashboard:
919
- enabled: true # Default: true
920
- githubPages: true # Deploy to GitHub Pages
921
- staleThreshold: 90 # Flag docs older than 90 days
922
-
923
882
  # GitHub integration (optional)
924
883
  github:
925
884
  owner: "your-username"
@@ -979,18 +938,16 @@ features:
979
938
  | `configVersion` | number | No | Schema version (current: 1) for future migrations |
980
939
  | `project.name` | string | Yes | Project name |
981
940
  | `project.docs_title_prefix` | string | No | Prefix for documentation titles (default: project name) |
982
- | `publishers` | array | Yes | Output targets: `notion`, `markdown` |
941
+ | `publishers` | array | Yes | Output targets: `notion`, `confluence`, `markdown` |
983
942
  | `notion.branches` | array | No | Branch whitelist for Notion publishing. Supports globs. |
984
943
  | `notion.includeBranchInTitle` | boolean | No | Add `[branch-name]` to titles (default: `true`) |
944
+ | `confluence.branches` | array | No | Branch whitelist for Confluence publishing. Supports globs. |
985
945
  | `discord.enabled` | boolean | No | Enable Discord notifications (default: `true` if webhook set) |
986
946
  | `discord.notifyOn` | string | No | Notification policy: `always`, `significant`, `never` (default: `significant`) |
987
947
  | `discord.significantThreshold` | number | No | Change % threshold for notifications (default: `10`) |
988
948
  | `discord.branches` | array | No | Branch filter for notifications. Supports globs. (default: all) |
989
- | `dashboard.enabled` | boolean | No | Generate HTML dashboard (default: `true`) |
990
- | `dashboard.githubPages` | boolean | No | Deploy to GitHub Pages (default: `false`) |
991
- | `dashboard.staleThreshold` | number | No | Days before docs flagged as stale (default: `90`) |
992
- | `github.owner` | string | No | GitHub org/username for SVG hosting |
993
- | `github.repo` | string | No | Repository name for SVG hosting |
949
+ | `github.owner` | string | No | GitHub org/username |
950
+ | `github.repo` | string | No | Repository name |
994
951
  | `scan.include` | array | Yes | Glob patterns for files to scan |
995
952
  | `scan.ignore` | array | Yes | Glob patterns to exclude |
996
953
  | `module_roots` | array | No | Root directories for module detection |
@@ -1009,7 +966,17 @@ Required for Notion publisher:
1009
966
  | `NOTION_PARENT_PAGE_ID` | Yes | Page ID where docs will be created |
1010
967
  | `NOTION_VERSION` | No | API version (default: `2022-06-28`) |
1011
968
 
1012
- Optional for Discord notifications (new in v0.6.0):
969
+ Required for Confluence publisher:
970
+
971
+ | Variable | Required | Description |
972
+ |----------|----------|-------------|
973
+ | `CONFLUENCE_URL` | Yes | Base URL (e.g., `https://your-company.atlassian.net/wiki`) |
974
+ | `CONFLUENCE_EMAIL` | Yes | Atlassian account email |
975
+ | `CONFLUENCE_API_TOKEN` | Yes | API token from [Atlassian](https://id.atlassian.com/manage-profile/security/api-tokens) |
976
+ | `CONFLUENCE_SPACE_KEY` | Yes | Target space key (e.g., `DOCS`, `ENG`) |
977
+ | `CONFLUENCE_PARENT_PAGE_ID` | No | Parent page ID (docs created at space root if omitted) |
978
+
979
+ Optional for Discord notifications:
1013
980
 
1014
981
  | Variable | Required | Description |
1015
982
  |----------|----------|-------------|
@@ -1028,8 +995,8 @@ Optional for Discord notifications (new in v0.6.0):
1028
995
  1. SCAN 2. ANALYZE 3. RENDER 4. PUBLISH
1029
996
  ──────────────────────────────────────────────────────────────────
1030
997
  Read files → Detect tech → Generate docs → Notion pages
1031
- from patterns stack patterns with insights + Markdown files
1032
- + SVG diagrams
998
+ from patterns stack patterns with insights + Confluence pages
999
+ + Markdown files
1033
1000
  ```
1034
1001
 
1035
1002
  **Scan Phase:**
@@ -1053,8 +1020,7 @@ from patterns stack patterns with insights + Markdown files
1053
1020
  **Publish Phase:**
1054
1021
  - Markdown: Writes files to `.repolens/` directory
1055
1022
  - Notion: Creates/updates pages via API with retry logic
1056
- - SVG: Generates diagrams with optional mermaid-cli
1057
- - Git: Commits diagrams back to repo for GitHub CDN hosting
1023
+ - Confluence: Creates/updates pages via REST API v1 (storage format)
1058
1024
 
1059
1025
  ### Module Dependency Detection
1060
1026
 
@@ -1100,7 +1066,7 @@ npm test
1100
1066
  - Integration workflows
1101
1067
  - Doctor command validation
1102
1068
 
1103
- **Coverage:** 32 tests passing
1069
+ **Coverage:** 90 tests passing across 11 test files
1104
1070
 
1105
1071
  ### Test Package Installation Locally
1106
1072
 
@@ -1111,7 +1077,7 @@ Simulates the full user installation experience:
1111
1077
  npm pack
1112
1078
 
1113
1079
  # Install globally from tarball
1114
- npm install -g repolens-0.2.0.tgz
1080
+ npm install -g chappibunny-repolens-0.6.1.tgz
1115
1081
 
1116
1082
  # Verify
1117
1083
  repolens --version
@@ -1127,28 +1093,49 @@ repolens/
1127
1093
  │ ├── cli.js # Command orchestration + banner
1128
1094
  │ ├── init.js # Scaffolding command
1129
1095
  │ ├── doctor.js # Validation command
1096
+ │ ├── migrate.js # Workflow migration (legacy → current)
1130
1097
  │ ├── core/
1131
1098
  │ │ ├── config.js # Config loading + validation
1132
1099
  │ │ ├── config-schema.js # Schema version tracking
1133
1100
  │ │ ├── diff.js # Git diff operations
1134
1101
  │ │ └── scan.js # Repository scanning + metadata extraction
1102
+ │ ├── analyzers/
1103
+ │ │ ├── domain-inference.js # Business domain mapping
1104
+ │ │ ├── context-builder.js # Structured AI context assembly
1105
+ │ │ └── flow-inference.js # Data flow detection
1106
+ │ ├── ai/
1107
+ │ │ ├── provider.js # Provider-agnostic AI generation
1108
+ │ │ ├── prompts.js # Strict prompt templates
1109
+ │ │ ├── document-plan.js # Document structure definition
1110
+ │ │ └── generate-sections.js # AI section generation + fallbacks
1111
+ │ ├── docs/
1112
+ │ │ ├── generate-doc-set.js # Document generation orchestration
1113
+ │ │ └── write-doc-set.js # Write docs to disk
1135
1114
  │ ├── renderers/
1136
1115
  │ │ ├── render.js # System overview, catalog, API, routes
1137
1116
  │ │ ├── renderDiff.js # Architecture diff rendering
1138
- │ │ └── renderMap.js # Mermaid dependency graphs
1117
+ │ │ └── renderMap.js # Unicode dependency diagrams
1139
1118
  │ ├── publishers/
1140
1119
  │ │ ├── index.js # Publisher orchestration + branch filtering
1141
- │ │ ├── publish.js # Notion publishing pipeline
1120
+ │ │ ├── publish.js # Publishing pipeline
1142
1121
  │ │ ├── notion.js # Notion API integration
1122
+ │ │ ├── confluence.js # Confluence REST API integration
1143
1123
  │ │ └── markdown.js # Local Markdown generation
1124
+ │ ├── integrations/
1125
+ │ │ └── discord.js # Discord webhook notifications
1144
1126
  │ ├── delivery/
1145
1127
  │ │ └── comment.js # PR comment delivery
1146
1128
  │ └── utils/
1147
1129
  │ ├── logger.js # Logging utilities
1148
- │ ├── retry.js # API retry logic
1130
+ │ ├── retry.js # API retry logic (exponential backoff)
1149
1131
  │ ├── branch.js # Branch detection (multi-platform)
1150
- └── mermaid.js # SVG rendering + GitHub URL handling
1151
- ├── tests/ # Vitest test suite
1132
+ ├── validate.js # Configuration validation & security
1133
+ ├── metrics.js # Documentation coverage & health scoring
1134
+ │ ├── rate-limit.js # Token bucket rate limiter for APIs
1135
+ │ ├── secrets.js # Secret detection & sanitization
1136
+ │ ├── telemetry.js # Opt-in error tracking (Sentry)
1137
+ │ └── update-check.js # Version update notifications
1138
+ ├── tests/ # Vitest test suite (90 tests across 11 files)
1152
1139
  ├── .repolens.yml # Dogfooding config
1153
1140
  ├── package.json
1154
1141
  ├── CHANGELOG.md
@@ -1165,13 +1152,13 @@ RepoLens uses automated GitHub Actions releases.
1165
1152
  ### Creating a Release
1166
1153
 
1167
1154
  ```bash
1168
- # Patch version (0.2.0 → 0.2.1) - Bug fixes
1155
+ # Patch version (0.6.1 → 0.6.2) - Bug fixes
1169
1156
  npm run release:patch
1170
1157
 
1171
- # Minor version (0.2.0 → 0.3.0) - New features
1158
+ # Minor version (0.6.1 → 0.7.0) - New features
1172
1159
  npm run release:minor
1173
1160
 
1174
- # Major version (0.2.0 → 1.0.0) - Breaking changes
1161
+ # Major version (0.6.1 → 1.0.0) - Breaking changes
1175
1162
  npm run release:major
1176
1163
 
1177
1164
  # Push the tag to trigger workflow
@@ -1179,10 +1166,11 @@ git push --follow-tags
1179
1166
  ```
1180
1167
 
1181
1168
  **What happens:**
1182
- 1. ✅ All tests run
1183
- 2. ✅ Package tarball created
1184
- 3. ✅ GitHub Release published
1185
- 4. ✅ Tarball attached as artifact
1169
+ 1. ✅ Security audit runs (dependency audit + secret scanning)
1170
+ 2. ✅ All tests run
1171
+ 3. ✅ Package tarball created
1172
+ 4. ✅ GitHub Release published with tarball attached
1173
+ 5. ✅ npm package published to `@chappibunny/repolens`
1186
1174
 
1187
1175
  See [RELEASE.md](./RELEASE.md) for detailed workflow.
1188
1176
 
@@ -1202,30 +1190,30 @@ RepoLens is currently in early access. v1.0 will open for community contribution
1202
1190
 
1203
1191
  ## 🗺️ Roadmap to v1.0
1204
1192
 
1205
- **Current Status:** v0.2.0~92% production-ready
1193
+ **Current Status:** v0.6.1Confluence Publisher & Team Features
1206
1194
 
1207
1195
  ### Completed ✅
1208
1196
 
1209
- - [x] CLI commands: `init`, `doctor`, `publish`, `version`, `help`
1197
+ - [x] CLI commands: `init`, `doctor`, `publish`, `migrate`, `version`, `help`
1210
1198
  - [x] Config schema v1 with validation
1211
1199
  - [x] Auto-discovery of `.repolens.yml`
1212
- - [x] Publishers: Notion + Markdown
1200
+ - [x] Publishers: Notion + Confluence + Markdown
1213
1201
  - [x] Branch-aware publishing with filtering
1214
1202
  - [x] Smart tech stack detection from package.json
1215
- - [x] Dependency graphs with actual module relationships
1216
- - [x] Visual diagrams with optional SVG rendering
1217
- - [x] GitHub Actions automation
1203
+ - [x] Unicode dependency diagrams (no external deps)
1204
+ - [x] AI-assisted documentation intelligence (provider-agnostic)
1205
+ - [x] Business domain inference & data flow analysis
1206
+ - [x] GitHub Actions automation (publish + release)
1218
1207
  - [x] PR architecture diff comments
1219
1208
  - [x] Performance guardrails (10k warning, 50k limit)
1220
- - [x] Comprehensive test suite (32 tests)
1221
- - [x] Interactive mermaid-cli installation
1222
-
1223
- ### In Progress 🚧
1224
-
1225
- - [ ] Production stability validation
1226
- - [ ] Enhanced error messages and debugging
1227
- - [ ] Performance optimization for large repos
1228
- - [ ] Additional framework detection (Remix, SvelteKit, Astro)
1209
+ - [x] Comprehensive test suite (90 tests across 11 files)
1210
+ - [x] Security hardening (secret detection, injection prevention, fuzzing)
1211
+ - [x] Discord notifications with rich embeds
1212
+ - [x] Documentation coverage & health scoring
1213
+ - [x] Opt-in telemetry (Sentry)
1214
+ - [x] npm registry publication (`@chappibunny/repolens`)
1215
+ - [x] Automated npm releases via GitHub Actions
1216
+ - [x] Workflow migration command (`repolens migrate`)
1229
1217
 
1230
1218
  ### Planned for v1.0 🎯
1231
1219
 
@@ -1234,7 +1222,7 @@ RepoLens is currently in early access. v1.0 will open for community contribution
1234
1222
  - [ ] TypeScript type graph analysis
1235
1223
  - [ ] Interactive configuration wizard
1236
1224
  - [ ] Watch mode for local development
1237
- - [ ] npm registry publication
1225
+ - [ ] Additional publishers (GitHub Wiki, Obsidian)
1238
1226
 
1239
1227
  See [ROADMAP.md](./ROADMAP.md) for detailed planning.
1240
1228
 
@@ -1256,6 +1244,6 @@ MIT
1256
1244
 
1257
1245
  <div align="center">
1258
1246
 
1259
- **Made with RABITAI for developers who care about architecture**
1247
+ **Made with ❤️ by RepoLens for developers who care about architecture**
1260
1248
 
1261
1249
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chappibunny/repolens",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "AI-assisted documentation intelligence system for technical and non-technical audiences",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -22,15 +22,15 @@
22
22
  "architecture",
23
23
  "github",
24
24
  "notion",
25
+ "confluence",
25
26
  "markdown",
26
27
  "developer-tools",
27
- "rabitai",
28
28
  "repolens",
29
29
  "observability",
30
- "dashboard",
31
30
  "metrics",
32
31
  "team-collaboration",
33
- "discord"
32
+ "discord",
33
+ "ai-documentation"
34
34
  ],
35
35
  "repository": {
36
36
  "type": "git",
@@ -203,32 +203,6 @@ export function validateConfig(config) {
203
203
  }
204
204
  }
205
205
 
206
- // Validate dashboard configuration (optional)
207
- if (config.dashboard !== undefined) {
208
- if (typeof config.dashboard !== "object" || Array.isArray(config.dashboard)) {
209
- errors.push("dashboard must be an object");
210
- } else {
211
- // Validate enabled flag
212
- if (config.dashboard.enabled !== undefined && typeof config.dashboard.enabled !== "boolean") {
213
- errors.push("dashboard.enabled must be a boolean");
214
- }
215
-
216
- // Validate githubPages flag
217
- if (config.dashboard.githubPages !== undefined && typeof config.dashboard.githubPages !== "boolean") {
218
- errors.push("dashboard.githubPages must be a boolean");
219
- }
220
-
221
- // Validate staleThreshold
222
- if (config.dashboard.staleThreshold !== undefined) {
223
- if (typeof config.dashboard.staleThreshold !== "number") {
224
- errors.push("dashboard.staleThreshold must be a number");
225
- } else if (config.dashboard.staleThreshold < 1) {
226
- errors.push("dashboard.staleThreshold must be at least 1");
227
- }
228
- }
229
- }
230
- }
231
-
232
206
  // Validate feature flags (optional)
233
207
  if (config.features !== undefined) {
234
208
  if (typeof config.features !== "object" || Array.isArray(config.features)) {
@@ -101,7 +101,6 @@ export function buildDocUpdateNotification(options) {
101
101
  modulesDetected,
102
102
  coverage,
103
103
  notionUrl,
104
- dashboardUrl,
105
104
  changePercent,
106
105
  } = options;
107
106
 
@@ -166,9 +165,6 @@ export function buildDocUpdateNotification(options) {
166
165
  if (notionUrl) {
167
166
  links.push(`[📚 Notion Docs](${notionUrl})`);
168
167
  }
169
- if (dashboardUrl) {
170
- links.push(`[📊 Dashboard](${dashboardUrl})`);
171
- }
172
168
 
173
169
  if (links.length > 0) {
174
170
  fields.push({
@@ -317,6 +317,8 @@ async function publishPage(cfg, key, markdown, cache) {
317
317
  title: existingPage.title,
318
318
  version: existingPage.version.number
319
319
  };
320
+ // Update existingPage to match cache structure (version as number)
321
+ existingPage = cache[key];
320
322
  }
321
323
  } else {
322
324
  // Verify cached page still exists
@@ -5,8 +5,6 @@ import { shouldPublishToNotion, shouldPublishToConfluence, getCurrentBranch } fr
5
5
  import { info, warn } from "../utils/logger.js";
6
6
  import { trackPublishing } from "../utils/telemetry.js";
7
7
  import { collectMetrics } from "../utils/metrics.js";
8
- import { generateDashboard } from "../renderers/renderDashboard.js";
9
- import { publishDashboardToNotion } from "./notion.js";
10
8
  import {
11
9
  sendDiscordNotification,
12
10
  buildDocUpdateNotification,
@@ -82,33 +80,15 @@ export async function publishDocs(cfg, renderedPages, scanResult) {
82
80
  }
83
81
  }
84
82
 
85
- // Collect metrics and generate dashboard (Phase 4)
86
- const dashboardEnabled = cfg.dashboard?.enabled !== false; // Default true
87
- if (dashboardEnabled) {
88
- try {
89
- info("Collecting documentation metrics...");
90
- const docsPath = path.join(process.cwd(), ".repolens");
91
- const historyPath = path.join(docsPath, "metrics-history.json");
92
-
93
- const metrics = await collectMetrics(scanResult, renderedPages, docsPath, historyPath);
94
-
95
- // Generate dashboard
96
- const dashboardPath = path.join(docsPath, "dashboard", "index.html");
97
- await generateDashboard(metrics, cfg, dashboardPath);
98
-
99
- // Publish dashboard to Notion if enabled
100
- if (hasNotionSecrets() && shouldPublishToNotion(cfg, currentBranch)) {
101
- try {
102
- const parentPageId = process.env.NOTION_PARENT_PAGE_ID;
103
- await publishDashboardToNotion(parentPageId, metrics, cfg);
104
- info("✓ Dashboard published to Notion");
105
- } catch (err) {
106
- warn(`Failed to publish dashboard to Notion: ${err.message}`);
107
- // Don't fail the whole publish if Notion dashboard fails
108
- }
109
- }
110
-
111
- // Send Discord notification if configured
83
+ // Collect metrics and send Discord notification
84
+ try {
85
+ info("Collecting documentation metrics...");
86
+ const docsPath = path.join(process.cwd(), ".repolens");
87
+ const historyPath = path.join(docsPath, "metrics-history.json");
88
+
89
+ const metrics = await collectMetrics(scanResult, renderedPages, docsPath, historyPath);
90
+
91
+ // Send Discord notification if configured
112
92
  const webhookUrl = process.env.DISCORD_WEBHOOK_URL;
113
93
  const discordConfig = cfg.discord || {};
114
94
  const discordEnabled = discordConfig.enabled !== false; // Default true if webhook configured
@@ -132,37 +112,28 @@ export async function publishDocs(cfg, renderedPages, scanResult) {
132
112
  : undefined;
133
113
 
134
114
  if (shouldNotify(changePercent, notifyOn, significantThreshold)) {
135
- const githubOwner = cfg.github?.owner || process.env.GITHUB_REPOSITORY?.split("/")[0];
136
- const githubRepo = cfg.github?.repo || process.env.GITHUB_REPOSITORY?.split("/")[1];
137
- const dashboardUrl = githubOwner && githubRepo
138
- ? `https://${githubOwner}.github.io/${githubRepo}/`
139
- : undefined;
140
-
141
- const notification = buildDocUpdateNotification({
142
- branch: currentBranch,
143
- commitSha: process.env.GITHUB_SHA || process.env.CI_COMMIT_SHA,
144
- commitMessage: process.env.GITHUB_EVENT_NAME === "push"
145
- ? process.env.GITHUB_EVENT_HEAD_COMMIT_MESSAGE
146
- : undefined,
147
- filesScanned: scanResult.filesCount,
148
- modulesDetected: scanResult.modules?.length || 0,
149
- coverage: metrics.coverage.overall,
150
- notionUrl,
151
- dashboardUrl,
152
- changePercent,
115
+ const notification = buildDocUpdateNotification({
116
+ branch: currentBranch,
117
+ commitSha: process.env.GITHUB_SHA || process.env.CI_COMMIT_SHA,
118
+ commitMessage: process.env.GITHUB_EVENT_NAME === "push"
119
+ ? process.env.GITHUB_EVENT_HEAD_COMMIT_MESSAGE
120
+ : undefined,
121
+ filesScanned: scanResult.filesCount,
122
+ modulesDetected: scanResult.modules?.length || 0,
123
+ coverage: metrics.coverage.overall,
124
+ notionUrl,
153
125
  });
154
126
 
155
127
  await sendDiscordNotification(webhookUrl, notification);
156
128
  } else {
157
129
  info(`Skipping Discord notification: change ${changePercent?.toFixed(1) || 0}% below threshold ${significantThreshold}%`);
158
130
  }
159
- } else if (!webhookUrl && discordConfig.enabled !== false) {
160
- info("Discord webhook not configured. Set DISCORD_WEBHOOK_URL environment variable to enable notifications.");
161
- }
162
- } catch (err) {
163
- warn(`Failed to generate dashboard or send notifications: ${err.message}`);
164
- // Don't fail the whole publish if dashboard/notifications fail
131
+ } else if (!webhookUrl && discordConfig.enabled !== false) {
132
+ info("Discord webhook not configured. Set DISCORD_WEBHOOK_URL environment variable to enable notifications.");
165
133
  }
134
+ } catch (err) {
135
+ warn(`Failed to send notifications: ${err.message}`);
136
+ // Don't fail the whole publish if notifications fail
166
137
  }
167
138
 
168
139
  // Track publishing metrics