Skip to content

feat: replace Python submodule with TypeScript link checker, migrate scripts to ESM#806

Open
EchinopsisM wants to merge 3 commits into
masterfrom
feat/ts-link-checker
Open

feat: replace Python submodule with TypeScript link checker, migrate scripts to ESM#806
EchinopsisM wants to merge 3 commits into
masterfrom
feat/ts-link-checker

Conversation

@EchinopsisM
Copy link
Copy Markdown
Collaborator

Summary

  • Removes tools/docusaurus-link-checker git submodule (Python version)
  • Adds TypeScript link checker scripts (check_links.ts, check_live_links.ts) from ethersphere/docusaurus-link-checker
  • Converts fetch-awesome-swarm.mjs.ts and replaces validate-llms-txt.mjs with check-llms-coverage.ts
  • Adds tsconfig.json with NodeNext/ESM module resolution
  • Adds "type": "module" to package.json; renames babel.config.js and sidebars.js to .cjs to preserve CJS behaviour
  • Splits validation into two scripts: postbuild runs llms.txt coverage check; check:links runs full dead link check
  • Coverage check uses build HTML as ground truth instead of file-path inference (fixes Windows backslash bug in old script)
  • Updates README: removes submodule instructions, documents tsx-based checker usage

Test plan

  • npm install (picks up tsx, typescript, @types/node)
  • npm run build — postbuild coverage check runs, no errors
  • npm run check:links — dead link checker runs in local mode
  • npm run check:links -- --mode live --site-domain docs.ethswarm.org — live crawl
  • Verify babel.config.cjs and sidebars.cjs load correctly (Docusaurus starts)

🤖 Generated with Claude Code

…scripts to ESM

- Remove tools/docusaurus-link-checker git submodule (Python version)
- Add TypeScript link checker scripts: check_links.ts, check_live_links.ts
- Convert fetch-awesome-swarm.mjs → .ts, validate-llms-txt.mjs → check-llms-coverage.ts
- Add tsconfig.json with NodeNext/ESM module resolution
- Add "type": "module" to package.json; rename babel.config.js/.sidebars.js to .cjs
- Split validation: postbuild runs llms.txt coverage check; check:links runs dead link check
- Coverage check uses build HTML as ground truth (fixes Windows path bug)
- Update README: remove submodule instructions, document tsx-based checker

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 25, 2026

Deploy Preview for test-twitter-preview-testing-3 failed. Why did it fail? →

Name Link
🔨 Latest commit 01f61b7
🔍 Latest deploy log https://app.netlify.com/projects/test-twitter-preview-testing-3/deploys/6a1456fb6016220008f4d23e

EchinopsisM and others added 2 commits May 25, 2026 16:03
…rm.ts (34 passing)

Export walkFind, normalizeNewlines, and rewriteRelativeLinks.
Add test files using node:test + node:assert.
Add "test" script to package.json.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…port

check-llms-coverage.ts and fetch-awesome-swarm.ts were executing their
full logic (network calls, file writes, process.exit) when imported as
test subjects. Wrap in main() + isMain check using import.meta.url.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant