docs: migrate documentation to Fumadocs

This commit is contained in:
ajnart committed 2026-09-10 20:33:21 +02:00
1 parent 6db26a0d99
commit 2356fc56f7
257 files changed
+6024 -11022

No files matched your search

+2 -1
View File
@@ -20,6 +20,7 @@ RUN mkdir -p /corepack && corepack enable pnpm && corepack install --global pnpm
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json turbo.json ./
COPY patches ./patches
COPY apps/docs ./apps/docs
COPY packages/common ./packages/common
COPY packages/custom-widgets ./packages/custom-widgets
COPY packages/definitions ./packages/definitions
COPY packages/workshop ./packages/workshop
@@ -55,7 +56,7 @@ ARG WORKSHOP_WEB_URL=https://homarr.dev/workshop
ENV HOMARR_WEBSITE_URL=$HOMARR_WEBSITE_URL
ENV WORKSHOP_API_URL=$WORKSHOP_API_URL
ENV WORKSHOP_WEB_URL=$WORKSHOP_WEB_URL
COPY --from=website /app/apps/docs/build /pb_public
COPY --from=website /app/apps/docs/out /pb_public
COPY apps/workshop/pb_migrations /pb_migrations
COPY apps/workshop/pb_hooks /pb_hooks
RUN chown -R pocketbase:pocketbase /pb_hooks /pb_migrations /pb_public
+4 -3
View File
@@ -1,7 +1,8 @@
.git
.next
.turbo
**/.next
**/.source
**/.turbo
**/node_modules
**/pb_data
apps/docs/build
apps/docs/out
coverage
+1 -1
View File
@@ -21,7 +21,7 @@ const workshopDetailPage = (event) => {
const id = event.request.pathValue("id");
if (id === "admin") return event.fileFS($os.dirFS("/pb_public"), "workshop/admin/index.html");
const indexHtml = toString($os.readFile("/pb_public/index.html"));
const indexHtml = toString($os.readFile("/pb_public/404.html"));
try {
const { renderWorkshopSocialHtml } = require(`${__hooks}/workshop-utils.js`);
const submission = event.app.findRecordById("submissions", id);
+12 -10
View File
@@ -4,7 +4,9 @@ set -eu
WORKSHOP_IMAGE_TEST_PORT=${WORKSHOP_IMAGE_TEST_PORT:-18091}
WORKSHOP_IMAGE_TEST_NAME="homarr-workshop-image-test-$$"
WORKSHOP_IMAGE_TEST_TAG="homarr-workshop:test-$$"
PREVIEW_ORIGIN=https://v2.preview.homarr.dev
PREVIEW_WEBSITE_URL=https://v2.preview.homarr.dev/about-us
PREVIEW_API_URL=https://v2.preview.homarr.dev
PREVIEW_WORKSHOP_URL=$PREVIEW_API_URL/workshop
cleanup() {
docker rm --force "$WORKSHOP_IMAGE_TEST_NAME" >/dev/null 2>&1 || true
@@ -14,10 +16,10 @@ trap cleanup EXIT
docker build --target production -f apps/workshop/Dockerfile -t "$WORKSHOP_IMAGE_TEST_TAG" .
docker run --detach --name "$WORKSHOP_IMAGE_TEST_NAME" \
--publish "127.0.0.1:$WORKSHOP_IMAGE_TEST_PORT:8090" \
--env HOMARR_WEBSITE_URL="$PREVIEW_ORIGIN" \
--env WORKSHOP_API_URL="$PREVIEW_ORIGIN" \
--env WORKSHOP_WEB_URL="$PREVIEW_ORIGIN/workshop" \
--env WORKSHOP_PUBLIC_ORIGIN="$PREVIEW_ORIGIN" \
--env HOMARR_WEBSITE_URL="$PREVIEW_WEBSITE_URL" \
--env WORKSHOP_API_URL="$PREVIEW_API_URL" \
--env WORKSHOP_WEB_URL="$PREVIEW_WORKSHOP_URL" \
--env WORKSHOP_PUBLIC_ORIGIN="$PREVIEW_API_URL" \
--env PB_ALLOWED_ORIGINS='*' \
"$WORKSHOP_IMAGE_TEST_TAG" >/dev/null
@@ -33,16 +35,16 @@ for attempt in $(seq 1 60); do
done
WORKSHOP_TEST_URL="http://127.0.0.1:$WORKSHOP_IMAGE_TEST_PORT" \
EXPECTED_HOMARR_WEBSITE_URL="$PREVIEW_ORIGIN" \
EXPECTED_WORKSHOP_API_URL="$PREVIEW_ORIGIN" \
EXPECTED_WORKSHOP_WEB_URL="$PREVIEW_ORIGIN/workshop" \
EXPECTED_HOMARR_WEBSITE_URL="$PREVIEW_WEBSITE_URL" \
EXPECTED_WORKSHOP_API_URL="$PREVIEW_API_URL" \
EXPECTED_WORKSHOP_WEB_URL="$PREVIEW_WORKSHOP_URL" \
node apps/workshop/tests/runtime-config.integration.mjs
docker exec "$WORKSHOP_IMAGE_TEST_NAME" pocketbase superuser create \
workshop-image@example.invalid 'WorkshopImageTest123!' --dir=/pb_data
WORKSHOP_TEST_URL="http://127.0.0.1:$WORKSHOP_IMAGE_TEST_PORT" \
EXPECTED_WORKSHOP_API_URL="$PREVIEW_ORIGIN" \
EXPECTED_WORKSHOP_WEB_URL="$PREVIEW_ORIGIN/workshop" \
EXPECTED_WORKSHOP_API_URL="$PREVIEW_API_URL" \
EXPECTED_WORKSHOP_WEB_URL="$PREVIEW_WORKSHOP_URL" \
node apps/workshop/tests/workshop-social-metadata.integration.mjs
curl --fail --location --silent "http://127.0.0.1:$WORKSHOP_IMAGE_TEST_PORT/workshop" >/dev/null
+6 -5
View File
@@ -128,14 +128,15 @@ if (!entrypoint.includes("/pb_public/workshop-runtime-config.js") || !entrypoint
throw new Error("Workshop must publish its API URL when the container starts");
}
const docsConfig = await read("apps/docs/docusaurus.config.ts");
if (!docsConfig.includes('scripts: [{ src: "/workshop-runtime-config.js" }]')) {
const docsLayout = await read("apps/docs/src/app/layout.tsx");
if (!docsLayout.includes('<Script src="/workshop-runtime-config.js" strategy="beforeInteractive" />')) {
throw new Error("Workshop must load the container runtime configuration before the documentation bundle");
}
if (!docsConfig.includes('path: "/workshop/:id"') || !docsConfig.includes("priority: -1")) {
const docsFallback = await read("apps/docs/src/components/workshop/WorkshopNotFoundRouter.tsx");
if (!docsFallback.includes("isWorkshopDetail") || !docsFallback.includes("workshop\\/admin")) {
throw new Error("Workshop submission routes must not capture the moderation page");
}
await access(resolve("apps/docs/static/workshop-runtime-config.js"));
await access(resolve("apps/docs/src/pages/workshop/admin/index.tsx"));
await access(resolve("apps/docs/public/workshop-runtime-config.js"));
await access(resolve("apps/docs/src/app/(home)/workshop/admin/page.tsx"));
console.log("Workshop static contracts passed");