Skip to content

Commit b08a6f9

Browse files
committed
docs: update readme to eliminate references to github api
1 parent dda5195 commit b08a6f9

2 files changed

Lines changed: 26 additions & 16 deletions

File tree

‎src/content-indexer/README.md‎

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Content Indexer is the indexing system that builds path indexes, navigation trees, and Algolia search records for the Alchemy docs site. It lives in the `docs` repository and processes documentation from three sources:
44

55
1. **Main Docs** - Manual content from `docs/fern/docs.yml` (local filesystem)
6-
2. **SDK References** - Generated content from `aa-sdk/docs/docs.yml` (GitHub API)
6+
2. **SDK References** - Generated content from `aa-sdk/docs/docs.yml` (sparse checkout in GHA)
77
3. **Changelog** - Entries from `docs/fern/changelog/*.md` (local filesystem)
88

99
## Three Indexers
@@ -28,8 +28,8 @@ Indexes manual documentation content from the local `docs` repository.
2828

2929
Indexes SDK reference documentation from the `aa-sdk` repository.
3030

31-
* **Trigger**: Changes to `aa-sdk/docs/docs.yml`
32-
* **Source**: GitHub API (aa-sdk repo)
31+
* **Trigger**: Changes to `aa-sdk/docs/docs.yml` via repository dispatch
32+
* **Source**: Local filesystem (sparse checkout of aa-sdk/docs in GHA)
3333
* **Updates**:
3434
* `{branch}/path-index:sdk` (Redis)
3535
* `{branch}/nav-tree:wallets` (Redis, merged with existing manual content)
@@ -112,7 +112,7 @@ flowchart TD
112112
**Key difference between main and SDK:**
113113

114114
* **Main**: Reads from local filesystem (`docs/fern/`)
115-
* **SDK**: Fetches from GitHub API (`aa-sdk/docs/`)
115+
* **SDK**: Reads from local filesystem (`aa-sdk-docs/docs/`) after sparse checkout in GHA
116116

117117
### Changelog Indexer: Simpler Flow
118118

@@ -320,7 +320,6 @@ content-indexer/
320320
│ └── redis.ts # Stores to Redis with branch scoping
321321
├── utils/ # Utility functions
322322
│ ├── filesystem.ts # Local file reading utilities
323-
│ ├── github.ts # GitHub API utilities
324323
│ ├── nav-tree-merge.ts # Wallets nav tree merging logic
325324
│ ├── openapi.ts # OpenAPI-specific utilities
326325
│ ├── openrpc.ts # OpenRPC-specific utilities
@@ -356,16 +355,16 @@ batchFetchContent(scanResult, source) → ContentCache
356355

357356
* Converts Sets to arrays and maps over them
358357
* Fetches all content in parallel with `Promise.all`
359-
* **Filesystem source**: Reads local files with `fs.readFile`
360-
* **GitHub source**: Fetches via GitHub API with `octokit`
358+
* Reads local files with `fs.readFile`
359+
* Supports `stripPathPrefix` for handling different repository structures
361360
* Parses frontmatter from MDX files using `gray-matter`
362361
* Stores everything in `ContentCache` for O(1) lookup
363362
* **Maximum parallelization** - all I/O happens simultaneously
364363

365364
### Phase 3: Process
366365

367366
```typescript
368-
buildAllOutputs(docsYml, contentCache, repoConfig)
367+
buildAllOutputs(docsYml, contentCache, stripPathPrefix?)
369368
→ { pathIndex, navigationTrees, algoliaRecords }
370369
```
371370
@@ -418,13 +417,26 @@ pnpm index:main
418417
# Main indexer (preview mode - branch-scoped)
419418
pnpm index:main:preview
420419

421-
# SDK indexer (fetches from aa-sdk repo, production only)
420+
# SDK indexer (reads from aa-sdk-docs/, production only)
422421
pnpm index:sdk
423422

424423
# Changelog indexer
425424
pnpm index:changelog
426425
```
427426
427+
**Note for SDK indexer local testing:**
428+
The SDK indexer expects `aa-sdk-docs/docs/` to exist. In GHA, this is created via sparse checkout. For local testing:
429+
430+
```bash
431+
# Sparse checkout aa-sdk/docs
432+
git clone --filter=blob:none --sparse https://github.com/alchemyplatform/aa-sdk.git aa-sdk-docs
433+
cd aa-sdk-docs
434+
git sparse-checkout set docs
435+
cd ..
436+
437+
pnpm index:sdk
438+
```
439+
428440
### Environment Variables
429441
430442
Create a `.env` file (see `.env.example`):
@@ -437,9 +449,6 @@ KV_REST_API_URL=your_url
437449
# Algolia (required for search index)
438450
ALGOLIA_APP_ID=your_app_id
439451
ALGOLIA_ADMIN_API_KEY=your_admin_key
440-
441-
# GitHub (required for SDK indexer, optional for main - increases API rate limits)
442-
GH_TOKEN=your_personal_access_token
443452
```
444453
445454
### Testing
@@ -498,13 +507,13 @@ Low coverage in I/O utilities (`filesystem.ts`, `github.ts`) is expected and acc
498507
**Cause:**
499508
500509
* (Main indexer) File doesn't exist locally at `fern/docs.yml`
501-
* (SDK indexer) GitHub API authentication failed or file path incorrect
510+
* (SDK indexer) `aa-sdk-docs/docs/` directory not found
502511
503512
**Fix:**
504513
505514
1. Verify file exists at expected location
506-
2. Check `GH_TOKEN` environment variable is set (for SDK indexer)
507-
3. Verify `repoConfig.docsPrefix` is correct
515+
2. (SDK indexer) Run sparse checkout to create `aa-sdk-docs/docs/` (see "Running the Indexers" section above)
516+
3. Verify the path in `index.ts` matches your local directory structure
508517
509518
### "Failed to read changelog file"
510519

‎tsconfig.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
"@/*": ["src/*"]
1616
}
1717
},
18-
"include": ["**/*.ts", "**/*.tsx", "**/*.mts"]
18+
"include": ["**/*.ts", "**/*.tsx", "**/*.mts"],
19+
"exclude": ["aa-sdk-docs"]
1920
}

0 commit comments

Comments
 (0)