Skip to content

docs(feature-map): keep the page's sources in the repo; npm run docs:feature-map - #567

Merged
huyplb merged 1 commit into
mainfrom
docs/feature-map-source
Oct 26, 2026
Merged

huyplb merged 1 commit into
mainfrom
docs/feature-map-source

Conversation

@huyplb

@huyplb huyplb commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What

docs/feature-map.html is generated, but its sources lived only in one session's scratch folder, so any change meant hand-editing the generated page. This PR moves them in:

  • docs/feature-map/template.html, data.js and app.js: the layout, the inventory and the page script.
  • scripts/feature-map/build.mjs fills in the Mermaid diagrams from docs/FEATURE_MAP.md and writes docs/feature-map.html. Run it with npm run docs:feature-map. --board <file> also writes the planning-board page that is published as an Artifact.
  • FEATURE_MAP.md's "Keeping this page true" section says where to edit and how to rebuild.

The build reproduces today's docs/feature-map.html byte for byte, so the page itself is unchanged here.

Tests

packages/shared/src/feature-map-build.test.ts checks:

  • the diagram is placed and escaped
  • a $ in the sources stays literal
  • a template that places a diagram the doc lacks fails the build
  • the static wrapper

A/B: two of the tests fail with plain-string replacement and no range check. Lint, security lint and tsc are clean.

Note

#563 (a Cursor agent's docs PR) hand-edits docs/feature-map.html. Its text doesn't conflict with this PR. But once both are in, data.js should take #563's numbers, or the next rebuild drops them. I'll do that in a follow-up, together with adding SQL Tracer to the page.

🤖 Generated with Claude Code


Note

Low Risk
Docs-only tooling and generated HTML; no runtime product code paths change. Main risk is build/template drift if FEATURE_MAP.md diagrams are reordered without updating placeholders.

Overview
Moves the interactive feature map from a hand-edited generated file into maintainable sources, so inventory and UI logic can change without patching docs/feature-map.html directly.

Adds docs/feature-map/ (template.html, data.js, app.js) and scripts/feature-map/build.mjs, which inlines inventory and app script, pulls Mermaid blocks from docs/FEATURE_MAP.md into __M<n>__ slots (with HTML escaping and a fail-fast check if template and doc drift), and writes the repo copy via npm run docs:feature-map. The static output sets FOX_MAP_STATIC (no shared Plan board) and loads pinned Mermaid from CDN; --board <file> emits the full planning-board page for Artifact publish.

FEATURE_MAP.md now documents where to edit and how to rebuild. packages/shared/src/feature-map-build.test.ts covers diagram placement/escaping, literal $ in sources, missing-diagram errors, and the static HTML wrapper.

Reviewed by Cursor Bugbot for commit 9347a65. Bugbot is set up for automated code reviews on this repo. Configure here.

…m run docs:feature-map

docs/feature-map.html was built from a template, an inventory file and a
script that lived only in one session's scratch folder, so the next change
meant hand-editing the generated page. The sources now live in
docs/feature-map/ (template.html, data.js, app.js), and
scripts/feature-map/build.mjs fills in the diagrams from FEATURE_MAP.md and
writes the page. `--board <file>` also writes the planning-board page that is
published as an Artifact.

The build reproduces today's docs/feature-map.html byte for byte. Tests cover
diagram placement and escaping, a `$` in the sources staying literal, a
missing diagram failing the build, and the static wrapper (A/B: two fail
with plain-string replacement and no range check).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 58ca45c0-b3d9-4b60-9c97-0610470cc0cd)

Comment thread docs/feature-map/data.js
};

// Routes per feature, from the 153 pinned in http-contract.test.ts.
const ROUTES = [
Comment thread docs/feature-map/data.js
];

// Unit-test files per package.
const TESTS = [
Comment thread docs/feature-map/data.js
['packages/workflow-contract', 1], ['packages/ui-shared', 1],
];

const E2E_GROUPS = ['PostgreSQL', 'MySQL', 'MariaDB', 'SQL Server', 'Oracle', 'DB2', 'SQLite', 'Azure SQL', 'ClickHouse', 'Redshift', 'CockroachDB', 'YugabyteDB', 'TiDB', 'DuckDB', 'Smoke', 'Sign-in', 'One admin or several', 'Workspaces', 'SQL Editor (14 specs)', 'Send feedback', 'Browse', 'History', 'Revert', 'Revert edges', 'Access SQLite', 'Workflow', 'Utilities', 'DB Access', 'Access all', 'Migrations in Git', 'Execute gate', 'Backup & Restore', 'Backup commands'];
Comment thread docs/feature-map/data.js
const E2E_GROUPS = ['PostgreSQL', 'MySQL', 'MariaDB', 'SQL Server', 'Oracle', 'DB2', 'SQLite', 'Azure SQL', 'ClickHouse', 'Redshift', 'CockroachDB', 'YugabyteDB', 'TiDB', 'DuckDB', 'Smoke', 'Sign-in', 'One admin or several', 'Workspaces', 'SQL Editor (14 specs)', 'Send feedback', 'Browse', 'History', 'Revert', 'Revert edges', 'Access SQLite', 'Workflow', 'Utilities', 'DB Access', 'Access all', 'Migrations in Git', 'Execute gate', 'Backup & Restore', 'Backup commands'];

// Metadata table → owning feature, column count (schema.ts, 31 migrations).
const TABLES = [
@huyplb
huyplb merged commit 2c042d6 into main Oct 26, 2026
12 checks passed
@huyplb
huyplb deleted the docs/feature-map-source branch October 26, 2026 22:19
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