feat(search): add static Pagefind docs search#348
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
3d418ac to
04f5239
Compare
bntvllnt
left a comment
There was a problem hiding this comment.
Review — 2 blocking findings (REQUEST_CHANGES recommended)
BLOCKING
-
C1 — Pagefind output is missing from the cached build contract.
- Evidence:
apps/registry/package.jsonnow runsnext build && pnpm search:indexand writespublic/_pagefind, butturbo.jsonstill declares registry build outputs as.next/**,dist/**, andpublic/r/**only. A cached registry build can therefore restore the Next artifact without restoring/_pagefind/pagefind.js, leaving the shipped docs-search UI with no Pagefind bundle. - Fix: add package-relative
public/_pagefind/**to the Turbobuildoutputs, or move search indexing into an uncached deploy step that always runs before artifact collection.
- Evidence:
-
R1 — shipped source includes a forbidden lint suppression.
- Evidence:
packages/ui/src/components/search-dialog/search-dialog.tsxadds// eslint-disable-next-line max-lines-per-function, and the registry copy mirrors it.docs/agents/COMPONENTS.mdexplicitly banseslint-disablein shipped code. - Fix: split
SearchDialoginto smaller helpers/subcomponents or change the lint policy deliberately, then regenerate the registry copy.
- Evidence:
VERIFIED CLEAN
- Re-fetched live PR #348 immediately before publication: open, non-draft, head unchanged at
04f52393ba9d48982de82ffdaf36a3c63e41364a. - Rechecked the current diff anchors for both blockers at this head.
- Prior full local coverage on this same head covered all 14 changed files; non-blocking validation was otherwise green.
VALIDATION
- Current publication pass:
gh pr view, pinned review worktree to the live head, inspectedapps/registry/package.json,turbo.json, andpackages/ui/src/components/search-dialog/search-dialog.tsx. - Not rerun in this publication pass: full workspace gates; relying on the earlier same-head validation evidence for non-blocking checks.
Note: GitHub rejected a formal REQUEST_CHANGES verdict because the authenticated reviewer is also the PR author, so this formal COMMENT review carries the blocking review gate instead.
| "lint:fix": "eslint . --fix", | ||
| "registry:build": "tsx scripts/inline-component-source.ts && shadcn build && tsx scripts/stamp-registry-metadata.ts && tsx scripts/generate-component-metadata.ts", | ||
| "registry:sync-shims": "tsx scripts/inline-component-source.ts", | ||
| "search:index": "pagefind --site .next/server/app --output-path public/_pagefind --root-selector main --force-language en", |
There was a problem hiding this comment.
Blocking: this adds search:index to generate public/_pagefind, but the registry build cache contract still omits public/_pagefind/** from Turbo outputs. A cached build can restore .next/** without restoring /_pagefind/pagefind.js, so the docs-search UI can ship with no Pagefind bundle. Add public/_pagefind/** to the package-relative Turbo build outputs, or make the search indexing step uncached and always run before deploy artifact collection.
| ); | ||
| } | ||
|
|
||
| // eslint-disable-next-line max-lines-per-function |
There was a problem hiding this comment.
Blocking: shipped source cannot add eslint-disable. docs/agents/COMPONENTS.md explicitly bans eslint-disable; the registry copy mirrors this component too. Split SearchDialog into smaller helpers/subcomponents or change the lint policy deliberately, then regenerate the registry copy.
| } | ||
|
|
||
| function stripMarkup(value: string) { | ||
| return value.replaceAll(/<[^>]*>/g, ""); |
Summary
search:indexafternext build, writing the generated bundle to ignoredpublic/_pagefind.public/_pagefind/**toturbo.jsonbuild outputs, so the generated Pagefind bundle is part of cached/restored build artifacts.SearchDialogwith Components, Docs, and Everything scopes, async docs results, keyboard-friendly command items, and highlighted snippets.eslint-disable-next-line max-lines-per-functionsuppression by splitting SearchDialog state/selection helpers into smaller functions, then regenerates the registry SearchDialog copy.Dependency tradeoff
Pagefind runs at build time and serves a static bundle, so this adds no hosted search service or runtime API dependency. The generated bundle is ignored and recreated during deploy builds, and
public/_pagefind/**is now declared as a Turbo build output for artifact cache correctness.Remediation notes
39c73764c0ffbb49f8aff3f8d51d5b2ea7d14e7fturbo.jsonbuild outputs includepublic/_pagefind/**.eslint-disableremains inpackages/ui/src/components/search-dialog/search-dialog.tsxorapps/registry/registry/default/search-dialog/search-dialog.tsx.pnpm -F @vllnt/ui-registry registry:build.Notes
/designroute is in feat: add DESIGN.md + /design page + design.tokens.json (agent-consumable brand guide) #250 and will be picked up by the same full static scan once that route exists on main.Validation
pnpm -F @vllnt/ui exec tsx scripts/verify-stories.ts— passedpnpm -F @vllnt/ui lint— passedpnpm -F @vllnt/ui exec tsc --noEmit --project tsconfig.build.json— passedpnpm -F @vllnt/ui-registry exec tsc --noEmit --project tsconfig.json— passedpnpm -F @vllnt/ui exec vitest run src/components/search-dialog/search-dialog.test.tsx— passedpnpm build— passed; Pagefind v1.5.2 indexed 233 pages / 14222 words topublic/_pagefindpnpm test:once— passed; 217 files / 1217 testsgit diff --check— passedCloses #257