Skip to content

Refactor/ts standardize scripts#814

Open
EchinopsisM wants to merge 5 commits into
ethersphere:masterfrom
bullfrogbean:refactor/ts-standardize-scripts
Open

Refactor/ts standardize scripts#814
EchinopsisM wants to merge 5 commits into
ethersphere:masterfrom
bullfrogbean:refactor/ts-standardize-scripts

Conversation

@EchinopsisM
Copy link
Copy Markdown
Collaborator

No description provided.

EchinopsisM and others added 5 commits May 25, 2026 15:45
…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>
…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>
The PR's lockfile dropped the nested @noble/hashes@2.2.0 entries that
@orama/plugin-docusaurus-v3 -> jsdom -> @exodus/bytes requires, so
`npm ci` failed with an out-of-sync lockfile and broke CI/Netlify builds.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Unify the build/config/script layer on TypeScript instead of mixing
.ts, .mjs and .cjs:

- Drop `"type": "module"` from package.json. It is incompatible with
  Docusaurus 3.x (the SSR server bundle is CommonJS, causing
  `require.resolveWeak is not a function`) and unnecessary — .ts scripts
  run via tsx and the config is loaded by Docusaurus's own TS loader.
- Convert docusaurus.config.mjs -> docusaurus.config.ts (typed Config)
  and sidebars.cjs -> sidebars.ts (typed SidebarsConfig).
- Rename babel.config.cjs -> babel.config.js. Docusaurus hardcodes the
  filename 'babel.config.js', so the .cjs name was silently ignored,
  disabling babel-plugin-styled-components (needed by redocusaurus).
- Fix the test script: `tsx --test scripts/*.test.ts` works on Node 20
  and 22; the previous `node --import tsx/esm` form broke without
  type:module and the quoted glob wasn't expanded on Node 20.
- Add explicit .js extensions to local imports in RedundancyCalc.js.

Verified: npm ci, npm run build (clean), npm test (34/34 on Node 20 and
22), and npm run check:links all pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 27, 2026

Deploy Preview for test-twitter-preview-testing-3 ready!

Name Link
🔨 Latest commit 85b6ac9
🔍 Latest deploy log https://app.netlify.com/projects/test-twitter-preview-testing-3/deploys/6a1764cfd81d650008027d5a
😎 Deploy Preview https://deploy-preview-814--test-twitter-preview-testing-3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

2 participants