Documentation for the Swarm Bee Client. View at docs.ethswarm.org.
Pull Requests are welcome, but please read our CODING guide!
You must use node 18 or above. We recommend nvm.
After the initial cloning of the repo you need to run:
npm ci
to download the exact revisions of the dependencies captured in
package-lock.json.
If the dependencies are updated in package.json, or if you wish to
test with the latest revisions of the dependencies, then you should
run:
npm install
and then consider pushing the updated package-lock.json to the
repository if everything works fine.
npm start
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
npm run build
This command generates static content into the build directory and can be served using any static contents hosting service.
The lunr search plugin relies on manual swizzling, which ejects the SearchBar component from the theme to allow for customization. Upgrading the Docusaurus theme WILL NOT upgrade swizzled components. This means upgrading the theme could break the search bare. Therefore whenever you upgrade the theme, make sure to delete the old swizzleed SearchBar component at src/theme/SearchBar and swizzle it again using this command:
npm run swizzle docusaurus-lunr-search SearchBar -- --eject --danger
See the documentation for the above command and the plugin at its github repo here.
The site serves two files for AI agents at the root:
/llms.txt— Hand-crafted index file (static/llms.txt). A curated, categorised list of every documentation page with one-line descriptions. This is the entry point AI agents use to find relevant pages./llms-full.txt— Auto-generated bydocusaurus-plugin-llmsat build time. Contains the full text of every page concatenated into a single file.
The validation script scripts/validate-llms-txt.mjs runs automatically during npm run build (via the prebuild hook). It cross-checks static/llms.txt against the actual doc files and prints warnings for:
- Stale links — a URL in
llms.txtpoints to a doc page that no longer exists (renamed/deleted). - Missing coverage — a doc file exists that isn't listed in
llms.txt(new page added without updating the index).
The script is informational only (exit 0) — it won't block the build.
- Stale link: Open
static/llms.txt, find the flagged URL, and either update the path to match the renamed page or remove the entry if the page was deleted. - Missing coverage: Decide which section the new page belongs in and add a line in
static/llms.txtfollowing the existing format:- [Title](https://docs.ethswarm.org/docs/path): One-line description. If the page is a landing/index page with no unique content, it's fine to leave it out — the warning is expected.
A few pages are intentionally excluded (intro/landing pages that only contain navigation cards). Their warnings are expected and can be ignored.
Don't forget to find and replace the version number for the whole of the docs folder.
The OpenAPI reference docs are compiled at build time from the OpenAPI yaml files in the /openapi directory using the redocusaurus plugin for Docusaurus. They must be manually updated to stay up to date with the OpenAPI specs in the Bee repo.