Skip to content

Commit 839141e

Browse files
chore: cleanup and harden API client (#162)
* chore: cleanup and harden API client - gitignore package-lock.json (pnpm project) - move @changesets/cli to devDependencies - add packageManager field to package.json - add 30s fetch timeout to all API calls - consolidate duplicate sanitizeText into shared sanitize.ts - add updateComponentOwner GraphQL mutation + tests - add project plan document Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ci: use packageManager field instead of hardcoded pnpm version Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: regenerate lockfile after moving @changesets/cli to devDependencies Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ce81ba7 commit 839141e

File tree

14 files changed

+208
-5841
lines changed

14 files changed

+208
-5841
lines changed

.github/workflows/lint.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717
- uses: pnpm/action-setup@v4
18-
with:
19-
version: 8
2018
- name: Installation
2119
run: pnpm i
2220
- name: ESLint

.github/workflows/release.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ jobs:
1515
with:
1616
fetch-depth: 0
1717

18-
- name: Use Node.js 20.x
19-
uses: pnpm/action-setup@v4
20-
with:
21-
version: 8
18+
- uses: pnpm/action-setup@v4
2219
- name: Installation
2320
run: pnpm install
2421
- name: Build

.github/workflows/tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919
- uses: pnpm/action-setup@v4
20-
with:
21-
version: 8
2220
- name: Installation
2321
run: pnpm install
2422
- name: Run tests

.github/workflows/verify-build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818
- uses: pnpm/action-setup@v4
19-
with:
20-
version: 8
2119
- name: Installation
2220
run: pnpm i
2321
- name: Build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ dist/
22
node_modules/
33
.vscode
44
coverage/
5+
package-lock.json

PLAN.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Project Plan
2+
3+
## Cleanup (done)
4+
5+
### 1. Gitignore `package-lock.json` — done
6+
7+
Added `package-lock.json` to `.gitignore` and removed it from git tracking.
8+
9+
### 2. Clean stale remote branches — done
10+
11+
Deleted 15 stale remote branches. Only `main` and one active dependabot branch remain.
12+
13+
### 3. Move `@changesets/cli` to devDependencies — done
14+
15+
Moved from `dependencies` to `devDependencies` in `package.json`.
16+
17+
### 4. Add `packageManager` field to `package.json` — done
18+
19+
Added `"packageManager": "pnpm@9.15.9"` to enforce correct package manager via corepack.
20+
21+
## Code Improvements (done)
22+
23+
### 5. Fetch timeout protection — done
24+
25+
Added `AbortSignal.timeout(30_000)` to all 4 fetch calls in `compass-api.ts`.
26+
27+
### 6. Consolidate duplicate `sanitizeText` — done
28+
29+
Extracted shared HTML entity escaping into `src/sanitize.ts` (`sanitizeHtml`, `sanitizeId`). Updated `compass-api.ts`, `index.ts`, and `service.ts` to import from the shared module.
30+
31+
### 7. Cherry-pick `updateComponentOwner` from feature branch — done
32+
33+
Added `updateComponentOwner` GraphQL mutation and 3 tests directly to `compass-api.ts` (with timeout included). Feature branch deleted.
34+
35+
## Features
36+
37+
### 8. Team enrichment in service markdown
38+
39+
The generator fetches team display names via `fetchTeamById()`, but the team data could be richer: team members, team lead, contact channels. Compass exposes this through the Teams API. Richer team data would make EventCatalog service pages more actionable for on-call and ownership discovery.
40+
41+
### 9. Event discovery from AsyncAPI/OpenAPI specs
42+
43+
The generator produces services and domains, but EventCatalog's core concept is events. If Compass components reference AsyncAPI specs in their links, the generator could parse those specs and auto-create event entries linked to producing/consuming services. This would be the highest-value feature addition.
44+
45+
### 10. Incremental/diff mode
46+
47+
The generator rewrites everything on each run. For large catalogs (100+ components), an incremental mode that only updates services whose Compass config has changed (based on hash or timestamp) would improve performance and reduce unnecessary git diffs.
48+
49+
### 11. Component relationship visualisation
50+
51+
The generator resolves `DEPENDS_ON` relationships and writes them into markdown. A dedicated dependency graph page using EventCatalog's visualisation capabilities would give a bird's-eye view of service interdependencies pulled from Compass.
52+
53+
### 12. Multi-site support
54+
55+
The current `ApiConfig` targets a single Atlassian site. Organisations with multiple Compass instances could benefit from aggregating into a single EventCatalog. Supporting an array of API configs would enable that.

0 commit comments

Comments
 (0)