Skip to content

docs(flame): enable algolia search and ask ai on the docs site - #479

Merged
gitfromwildan merged 3 commits into
mainfrom
docs/enable-algolia-search
Nov 6, 2026
Merged

gitfromwildan merged 3 commits into
mainfrom
docs/enable-algolia-search

Conversation

@gitfromwildan

@gitfromwildan gitfromwildan commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Summary

The docs site now uses @docubook/plugin-search-algolia 0.1.0: Algolia DocSearch in the search dialog, and Ask AI in its own side panel.

  • packages/flame/docu.json adds the plugin with App ID 5CCYZZZ96E, the search-only key, the docsearch_docubook index, and Ask AI agent cdd1d1a2-….
    • The key's ACL is search, listIndexes and settings. settings is read-only: editing needs editSettings. The key cannot write to the index.
    • The App ID, index and key are visible in browser requests anyway, as the Algolia page explains.
  • Flame's own landing page and 404 page keep no search, as before.
  • meta.baseURL changes from https://docs.docubook.pro/ to https://docubook.pro/ (8be448c). Canonical, og:url and og:image links now use https://docubook.pro. All three hosts (docubook.pro, www., docs.) currently serve the site with 200 and no redirect.

How the plugin is linked

Linking the workspace package (workspace:*) would make turbo fail with "Cyclic dependency detected": flame → plugin for the docs site, and plugin → flame for types and tests. Instead:

  • packages/flame/package.json adds a devDependency "@docubook/plugin-search-algolia": "npm:@docubook/plugin-search-algolia@^0.1.0". Turbo treats an npm: alias as external, so there is no cycle in the build, lint, typecheck or test graphs. The docs site uses the published plugin, not unreleased code from plugins/.
  • pnpm-workspace.yaml adds the override "@docubook/plugin-search-algolia>@docubook/flame": "workspace:*". Without it, pnpm resolved the plugin's flame peer to a second copy of flame 2.5.0 from npm, with core, markdown, ui-react and themes-colors. The lockfile now has @docubook/flame@packages+flame.
  • pnpm-workspace.yaml exempts @docubook/[email protected] from pnpm's minimumReleaseAge (b7af263). The version was published on 2026-11-06, so without the entry every frozen install fails with ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION: CI, the release workflow and Vercel. The entry is pinned to this version and can be dropped once 0.1.0 is older than the window. (An earlier version of this description said the entry was unnecessary. That check had read a cached pnpm verdict.)

Verification

  • turbo build|lint|typecheck|test --filter=@docubook/flame... --dry reports no cycle. The build graph contains core, markdown, themes-colors, ui-react and flame. The plugin is not built, since it comes from npm.
  • In a fresh worktree with an empty HOME and empty XDG_* caches, pnpm install --frozen-lockfile --filter=@docubook/flame... fails without the exemption, which reproduces CI. With it, that install and the unfiltered pnpm install --frozen-lockfile both pass the supply-chain check.
  • The docs build gives 27 pages. Docs pages carry #docubook-search-provider, and the landing and 404 pages do not. The build writes assets/docsearch/ (client.js, style.css, chunks/).
  • In headless Chromium, the built site was served with the CSP from vercel.json, against the live Algolia app:
    • Ctrl K, then typing "plugin", returns /docs/getting-started/plugins and two anchors on that page. Clicking the first opens that page on the local origin, because of relativeUrls.
    • Ctrl I opens the Ask AI panel. No question was sent, so the agent's quota was not used.
    • No page errors and no CSP violations.
  • scripts/check-release-plan.mjs passes all 6 scenarios.
  • After the baseURL change, every absolute URL in the 27 built pages uses https://docubook.pro (116 occurrences). None uses docs.docubook.pro. The base path is unchanged.

Follow-up outside this PR: the crawler

The index is stale. docsearch_docubook was last updated on 2026-09-20 with 358 records. Its URLs are on www.docubook.pro, and its records still use the old crawler config: lvl0 is "Docs" everywhere, and 27 records hold the "Last updated … Made with DocuBook" footer. Since 2026-09-23, docsearch_docubook.tmp has 0 records, which suggests later crawls fetched nothing and the safety check kept the old index.

Search works now with those records. To refresh it:

  1. Paste the crawler config from the Algolia page into the Crawler editor.
  2. Check the domain (verification, Cloudflare bot rules) with the URL Tester.
  3. Run a crawl with startUrls, discoveryPatterns and pathsToMatch on https://docubook.pro, to match the new canonical.

The docs site loads @docubook/plugin-search-algolia with the docsearch_docubook index and the Ask AI agent. The search-only key can only query the index.

flame installs the plugin from npm through an npm: alias, so turbo does not see a flame <-> plugin cycle. A pnpm override points the plugin's flame peer at the workspace package instead of a second copy of flame from npm.
@vercel

vercel Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docu Ignored Ignored Preview Nov 6, 2026 3:14am UTC

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Every CI job on this PR fails at pnpm install --frozen-lockfile with ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION, because @docubook/[email protected] was published less than 24h ago. If this merges before the cutoff clears, main's release workflow and the Vercel production deploy fail at install too. The config change itself checks out: see the inline comment.

Reviewed changes

Mode: senior (it touches the docs-site build and the workspace dependency graph). I reviewed the whole diff and rebuilt the docs site locally under Node with the release-age policy turned off.

  • Algolia plugin on the docs site: packages/flame/docu.json registers the plugin with a search-only key. docu.json is not in flame's files, and template/ has its own config, so none of this ships to users.
  • npm: alias devDependency: flame installs the published plugin through an alias, so turbo does not see a flame ↔ plugin cycle.
  • Workspace override: @docubook/plugin-search-algolia>@docubook/flame links the plugin's flame peer to the workspace flame. The npm peer is ^2.5.0, so without the override pnpm pulls in a second copy of flame. The override also matches the local plugins/search-algolia importer, which is why its lockfile specifier changed to workspace:*. That is harmless, because publishing reads the package.json.

What I checked locally:

  • FLAME_RUNTIME=node build: 27 pages, and assets/docsearch/{client.js,style.css,chunks} was emitted.
  • Every docs page has docubook-search-provider. The landing page and 404.html do not.
  • deploy --silent --force printed nothing.
  • pnpm test:release-plan passed all 6 scenarios.
  • Not checked: Deno, which is not available in the review shell.

Top priorities:

  1. Get CI green before merging. Once the cutoff has passed, re-running the checks is enough.
  2. Nothing else is blocking.

Verdict: READY WITH MINOR FIXES (CI install only).

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread packages/flame/package.json Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ The new commit introduces no new issues. The open thread on packages/flame/package.json:85 still applies: every CI job on 8be448c fails at pnpm install --frozen-lockfile with ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION again.

Reviewed changes

Mode: standard (one config value changed). This run covers only 8be448c.

  • Moved the docs site's canonical host to https://docubook.pro/: only the host of meta.baseURL changed. resolveDeployPath (base-path.ts) reads only the path, which is still empty. So basePath, asset URLs and the build cache stamp stay the same. Only the canonical, og:url and og:image hosts from seo.ts change. I checked live: docubook.pro, www.docubook.pro and docs.docubook.pro all return 200 from Vercel with no redirect, and https://docubook.pro/docs/getting-started/introduction returns 200.

Not part of this diff, for reference only: plugins/search-algolia/README.md still links to docs.docubook.pro, and the flame template links to www.docubook.pro. Both hosts still work, so nothing is broken.

Top priorities:

  1. Get CI green. Re-run the checks after 2026-11-07T02:15Z, or commit a minimumReleaseAgeExclude entry pinned to this version (see the open thread).
  2. Nothing else is blocking.

Verdict: READY WITH MINOR FIXES (CI install only).

Pullfrog  | Fix it ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

@gitfromwildan gitfromwildan self-assigned this Nov 6, 2026
Exempt @docubook/[email protected] from pnpm's minimumReleaseAge. It was published on 2026-11-06, so every frozen install (CI, the release workflow, Vercel) failed with ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION. The entry is pinned to this version, so later releases still wait out the window.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found. b7af263 fixes the install failure from the previous review, and I resolved that thread.

Reviewed changes

Mode: standard (a single workspace config entry). This run covers only b7af263.

  • Exempted the new plugin release from pnpm's release-age check: pnpm-workspace.yaml adds minimumReleaseAgeExclude: ["@docubook/[email protected]"], with a comment saying to drop it later. It is pinned to this one version, so later plugin releases still go through the release-age check. On b7af263, ci (build), ci (lint), ci (typecheck), release-plan, commitlint and runtime-smoke (node) now pass. Earlier, every job failed at install. ci (test) and runtime-smoke (deno) were still running when I posted this review.

Verdict: READY. One optional cleanup: after 2026-11-07T02:15Z, a follow-up commit can remove the exclude entry.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@gitfromwildan
gitfromwildan merged commit fb89eaa into main Nov 6, 2026
15 checks passed
@gitfromwildan
gitfromwildan deleted the docs/enable-algolia-search branch November 6, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant