feat(docs): add apps/docs documentation site#105
Conversation
Add apps/docs — the ASK documentation site built on the docs-please Nuxt layer (Nuxt 4 + Nuxt Content v3 + shadcn-vue + Tailwind 4), deployed to Cloudflare Pages with D1. ## What was added - apps/docs/ full scaffold: package.json, nuxt.config.ts, app/app.config.ts, content/index.md, content/docs/1.getting-started/ (introduction + installation pages), eslint.config.ts, tsconfig.json, wrangler.jsonc (D1 binding configured with db name ask-docs-db, id 13fc057c-92f7-4879-9fb1-e9a7a457fd57), README.md - ARCHITECTURE.md: new apps/docs module section - CLAUDE.md: apps/docs commands and new gotchas for bunfig.toml and the docs-please patch ## Why two workarounds are required ### bunfig.toml — hoisted linker Bun 1.3.2+ defaults to the isolated linker. Nitro's Rollup pipeline crashes when a dependency ships raw .ts/.vue files from node_modules/ and the isolated linker places each package in its own virtual store. Forcing `linker = "hoisted"` in bunfig.toml restores the flat layout that Nitro expects. See nuxt-content/docus#1279 for the upstream report on this class of issue. ### patches/docs-please@0.2.6.patch — Vue SFC compiler workaround Two SFCs in docs-please extend NuxtLinkProps / PrimitiveProps via TypeScript type syntax. The Vue SFC compiler cannot resolve auto-imported types from .vue files inside node_modules/, so it emits a fatal error at build time. The patch injects `/* @vue-ignore */` before those extends clauses to suppress the unresolvable type. The docs-please repo itself uses `workspace:*` for its own packages so its authors never hit this; a follow-up PR to pleaseai/docs will let us drop this patch once the fix lands upstream. ## Infrastructure note The Cloudflare D1 database `ask-docs-db` (id 13fc057c-92f7-4879-9fb1-e9a7a457fd57) is already created and bound in wrangler.jsonc. Cloudflare Pages project setup (linking the repo, setting build command / output dir, binding D1) is a follow-up manual step.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Deploying ask-registry with
|
| Latest commit: |
028a5c6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://29034748.ask-registry.pages.dev |
| Branch Preview URL: | https://worktree-corona-cholla.ask-registry.pages.dev |
There was a problem hiding this comment.
2 issues found across 19 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/docs/.wrangler/deploy/config.json">
<violation number="1" location="apps/docs/.wrangler/deploy/config.json:1">
P2: Remove this file and add `.wrangler/` to `.gitignore`. The `config.json` inside `.wrangler/deploy/` is auto-generated by `wrangler deploy` / `wrangler pages deploy` and should not be committed to version control. The repo's source-of-truth for Wrangler config is already `apps/docs/wrangler.jsonc`.</violation>
</file>
<file name="apps/docs/content/docs/1.getting-started/.navigation.yml">
<violation number="1" location="apps/docs/content/docs/1.getting-started/.navigation.yml:2">
P2: The `icon` field must be nested under a `navigation:` key. Without this, Nuxt Content will not apply the icon to the directory navigation item returned by `queryCollectionNavigation()`.</violation>
</file>
Architecture diagram
sequenceDiagram
participant Dev as Developer
participant Workspace as Monorepo Workspace
participant Bun as Bun Installer
participant DocsApp as apps/docs (Nuxt App)
participant DocsPlease as docs-please Nuxt Layer
participant NuxtContent as @nuxt/content v3
participant D1 as Cloudflare D1
participant SQLite as Native SQLite
Note over Dev,D1: Build-time Architecture
Dev->>Bun: bun install
Bun->>Bun: Read bunfig.toml (linker = "hoisted")
Bun->>Workspace: Install deps with flat node_modules
Workspace->>DocsApp: Patched docs-please@0.2.6 (Vue SFC extends fix)
Note over DocsApp,D1: Build Phase
Dev->>DocsApp: nuxt build --preset=cloudflare_pages
DocsApp->>DocsPlease: Extend Nuxt layer (chrome, components)
DocsApp->>DocsPlease: Provide app.config.ts (site metadata)
DocsApp->>NuxtContent: Initialize content database
alt Cloudflare Build
NuxtContent->>D1: Use type: "d1", bindingName: "DB"
D1-->>NuxtContent: D1 binding configured
else Local Build
NuxtContent->>SQLite: Use type: "sqlite", filename: .data/content/contents.sqlite
SQLite-->>NuxtContent: Native sqlite connector
end
DocsPlease->>DocsApp: Render chrome (header, footer, sidebar, TOC)
NuxtContent->>DocsApp: Parse content/ .md files
DocsApp->>DocsApp: Generate static pages
Note over Dev,D1: Runtime (Cloudflare Pages Worker)
Client->>D1: GET /docs/getting-started/introduction
D1->>NuxtContent: Query content from D1
NuxtContent-->>D1: Return MDC content
D1-->>Client: Rendered HTML page
Note over Dev,D1: Local Development
Client->>SQLite: GET /docs/getting-started/introduction
SQLite->>NuxtContent: Query content from .data/content/contents.sqlite
NuxtContent-->>SQLite: Return MDC content
SQLite-->>Client: Rendered HTML page
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| @@ -0,0 +1 @@ | |||
| { "configPath": "../../dist/_worker.js/wrangler.json" } | |||
There was a problem hiding this comment.
P2: Remove this file and add .wrangler/ to .gitignore. The config.json inside .wrangler/deploy/ is auto-generated by wrangler deploy / wrangler pages deploy and should not be committed to version control. The repo's source-of-truth for Wrangler config is already apps/docs/wrangler.jsonc.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/docs/.wrangler/deploy/config.json, line 1:
<comment>Remove this file and add `.wrangler/` to `.gitignore`. The `config.json` inside `.wrangler/deploy/` is auto-generated by `wrangler deploy` / `wrangler pages deploy` and should not be committed to version control. The repo's source-of-truth for Wrangler config is already `apps/docs/wrangler.jsonc`.</comment>
<file context>
@@ -0,0 +1 @@
+{ "configPath": "../../dist/_worker.js/wrangler.json" }
</file context>
| @@ -0,0 +1,2 @@ | |||
| title: Getting Started | |||
| icon: i-lucide-rocket | |||
There was a problem hiding this comment.
P2: The icon field must be nested under a navigation: key. Without this, Nuxt Content will not apply the icon to the directory navigation item returned by queryCollectionNavigation().
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/docs/content/docs/1.getting-started/.navigation.yml, line 2:
<comment>The `icon` field must be nested under a `navigation:` key. Without this, Nuxt Content will not apply the icon to the directory navigation item returned by `queryCollectionNavigation()`.</comment>
<file context>
@@ -0,0 +1,2 @@
+title: Getting Started
+icon: i-lucide-rocket
</file context>
- Add SKIP_DEPENDENCY_INSTALL=1 to vars so Cloudflare Pages does not auto-run npm install. The monorepo installs via bun at the repo root (same pattern as apps/registry). - Ignore .wrangler/ build artifacts and untrack the accidentally-committed deploy/config.json from #105.
Summary
Add
apps/docs/— the ASK documentation site built on the docs-please Nuxt layer (Nuxt 4 + Nuxt Content v3 + shadcn-vue + Tailwind 4), deployed to Cloudflare Pages with D1.This is a single logical change: a new docs site plus the two supporting workarounds it required.
What Changed
New:
apps/docs/Full scaffold for the ASK docs site:
package.json— workspace package wired into the monoreponuxt.config.ts— extendsdocs-please, configures Cloudflare Pages preset, D1 bindingapp/app.config.ts— site title and navigation configcontent/index.md— landing pagecontent/docs/1.getting-started/— introduction and installation docseslint.config.ts,tsconfig.json— tooling configwrangler.jsonc— Cloudflare Workers config with D1 binding (ask-docs-db, id13fc057c-92f7-4879-9fb1-e9a7a457fd57)README.mdNew:
bunfig.toml— hoisted linker workaroundBun 1.3.2+ defaults to the isolated linker. Nitro's Rollup pipeline crashes when a dependency ships raw
.ts/.vuefiles fromnode_modules/because the isolated linker places each package in its own virtual store, breaking Rollup's module resolution. Forcinglinker = "hoisted"restores the flat layout Nitro expects.See nuxt-content/docus#1279 for the upstream report on this class of issue.
New:
patches/docs-please@0.2.6.patch— Vue SFC compiler workaroundTwo SFCs in
docs-pleaseextendNuxtLinkProps/PrimitivePropsvia TypeScriptextendstype syntax. The Vue SFC compiler cannot resolve auto-imported types from.vuefiles insidenode_modules/, so it emits a fatal build error. The patch injects/* @vue-ignore */before thoseextendsclauses to suppress the unresolvable type check.The
docs-pleaserepo itself usesworkspace:*for its own packages, so its authors do not hit this in development. A follow-up PR to pleaseai/docs will let us drop this patch once the fix lands upstream.Modified files
package.json— addspatchedDependencies["docs-please@0.2.6"]bun.lock— regenerated under hoisted linkerARCHITECTURE.md— newapps/docs/module sectionCLAUDE.md—apps/docs/commands + gotchas forbunfig.tomland thedocs-pleasepatchVerification
bun run build— 4/4 packages succeed (cli, schema, registry, docs)bun run lint— 5/5 succeedapps/docsbuilds with--preset=cloudflare_pages(default) and the plain Node preset (build:node)Follow-up Items
cd apps/docs && bun run build), output dir (apps/docs/.output/public), and bind the D1 databaseask-docs-db/* @vue-ignore */fix so we can eventually droppatches/docs-please@0.2.6.patchSummary by cubic
Adds
apps/docs— the ASK documentation site built ondocs-please(Nuxt 4 +@nuxt/contentv3), deployable to Cloudflare Pages with D1. Also adds a hoisted Bun linker and a temporarydocs-please@0.2.6patch to keep builds green.New Features
apps/docs/scaffold extendingdocs-pleasewith site config and starter content (landing + Getting Started).DBon Cloudflare builds; native sqlite locally.wrangler.jsoncwith D1 databaseask-docs-db(id13fc057c-92f7-4879-9fb1-e9a7a457fd57).Migration
bun run --cwd apps/docs build, outputapps/docs/dist.bunfig.tomlforceslinker = "hoisted"(required for Nuxt/Content builds).patches/docs-please@0.2.6.patch; remove after the upstream fix.Written for commit 028a5c6. Summary will update on new commits.