This is the source code for the Cocos AI documentation site, built with Next.js and Fumadocs.
The site is configured to live under:
https://www.ultraviolet.rs/docs/cocos-aipnpm installRun the development server:
pnpm devOpen http://localhost:3000/docs/cocos-ai with your browser to see the docs.
pnpm run lint
pnpm run types:checkBiome is used for code linting and formatting:
pnpm run lint:fix
pnpm run formatpnpm run buildThe build exports static assets to out/, then nests the export under out/docs/cocos-ai so Cloudflare Workers can serve the docs at the configured base path.
app/: Next.js app router pages and layouts.content/docs/: Documentation content in Markdown and MDX.lib/: Utility functions and Fumadocs configuration.public/: Static assets, Cloudflare_headers,_redirects, androbots.txt.worker/: Cloudflare Worker script that proxies/img/...requests to R2; runs only for requests that don't match a static file. See scripts/README.md.scripts/nest-static-export.mjs: Moves the static export underout/docs/cocos-ai.scripts/publish-image.mjs: Maintainer-only image publishing tool. See scripts/README.md.wrangler.jsonc: Cloudflare Workers assets + Worker deployment config.
Images are served from Cloudflare R2 (not committed to this repo) via
worker/index.ts, which keeps existing /img/... URLs working unchanged.
Maintainers publishing new/updated images: see scripts/README.md.
The site is exported as static assets and can be deployed to Cloudflare Workers with Wrangler:
pnpm run deployTo upload a version without deploying it immediately:
pnpm run upload