fix(docs): serve JSON-LD in the HTML, fix sidebar spacing, and tighten the CLI guides - #6763
Conversation
…ling weight `--global` is valid but `-g` is what every comparable CLI documents, and the long form only came from the package README. Also drops the yarn tab: it read `yarn global add sim`, which works on Yarn 1 only — Yarn 2 removed global installs, so that command fails for anyone on a modern Yarn. Adds `npx sim` for running without installing. The guides had accumulated design rationale that belongs in code comments rather than user docs — why the filter grammar is JSON, why the config section naming is asymmetric, why an unexpected error keeps its stack trace. Surveying how gh, Vercel, Turborepo, Deno, Bun and Supabase write theirs, none carry that kind of justification, and callouts are reserved for content whose absence produces a wrong result rather than for general asides. So: 1016 lines to 763, and 12 callouts to 3. The three that remain are the pairing-code check, that `sim logout` does not revoke the key, and the `--limit 100` default on `batch-delete`/`batch-update`, which silently truncates a larger match. Troubleshooting drops the entries whose error message already contained its own fix and keeps the seven whose cause is not obvious.
All four structured-data blocks — WebSite, TechArticle, BreadcrumbList, SoftwareApplication — were rendered with `next/script`, which never emitted a script tag. Measured on a production build, `/api-reference/getting-started` contained zero `<script type="application/ld+json">` elements; the payload existed only in the `__next_s` client-injection queue and the RSC flight data, so anything reading the served HTML saw no structured data at all. React was also logging "Encountered a script tag while rendering React component" on every page. `next/script` is for loading and executing JavaScript. JSON-LD is data, and Next's own guidance is a native `<script>` in the component. `serializeJsonLd` already escapes the `<` character to its unicode form, which is the sanitization that guidance calls for, so only the element changes. Same build, after: three valid tags per page with `WebSite` in `<head>`, and the injection queue gone entirely.
…rator `[data-separator]:not([data-separator] ~ [data-separator])` was meant to keep the first sidebar group flush against the top padding, but `~` only reaches siblings, so it also matched the first separator inside every expanded folder. Under Self-Hosting, "Install" lost its top margin and crowded the "Architecture" link above it — 25px of gap where "Configure" and "Operate" below it had 40px. `:first-child` expresses the intent directly. Only the four sidebar roots open with a separator; every nested folder starts with a page, so the intended case still goes flush and nothing else changes.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview Sidebar drops the broken sibling-selector margin rule in CLI docs are trimmed across MDX pages and the generator: install uses Reviewed by Cursor Bugbot for commit 91faee7. Configure here. |
Greptile SummaryThe PR makes JSON-LD available directly in server-rendered HTML, localizes sidebar separator spacing to its component, and streamlines the public CLI documentation.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/docs/app/[lang]/layout.tsx | Replaces the WebSite JSON-LD next/script component with a native server-rendered script element. |
| apps/docs/components/structured-data.tsx | Renders article, breadcrumb, and software structured data as native JSON-LD script elements. |
| apps/docs/components/docs-layout/sidebar-components.tsx | Localizes first-separator margin behavior with the component-level first:mt-0 Tailwind variant. |
| apps/docs/app/global.css | Removes the global separator margin selector previously flagged for cross-component coupling. |
| apps/docs/content/docs/en/cli/index.mdx | Updates supported package-manager installation examples and documents running the CLI through npx. |
| scripts/generate-cli-docs.ts | Keeps generated CLI reference copy aligned with the shortened checked-in documentation. |
Reviews (2): Last reviewed commit: "fix(docs): move the flush-separator rule..." | Re-trigger Greptile
Keeps the styling with the component that owns it, per the repo standard, and
lets the global rule be deleted outright rather than corrected — `global.css`
now only loses a rule in this PR. Tailwind's `first:` variant compiles to the
same `:first-child` selector, so behavior is unchanged: the build emits
`.first\:mt-0:first-child{margin-top:0}` and the prerendered HTML carries the
class on the separator.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 91faee7. Configure here.
Follow-up to #6762.
Summary
Install command.
--global→-g, which is what every comparable CLI documents. Drops the yarn tab: it readyarn global add sim, which works on Yarn 1 only — Yarn 2 removed global installs, so that command fails for anyone on a modern Yarn. Addsnpx simfor running without installing.Trimmed the CLI guides: 1016 lines → 763, 12 callouts → 3. The pages had accumulated design rationale that belongs in code comments rather than user docs — why the filter grammar is JSON, why the config section naming is asymmetric, why an unexpected error keeps its stack trace. I surveyed how gh, Vercel, Turborepo, Deno, Bun and Supabase write their CLI docs: none carry that kind of justification, and callouts are reserved for content whose absence produces a wrong result, not for general asides. The three that remain are the pairing-code check, that
sim logoutdoes not revoke the key, and the--limit 100default onbatch-delete/batch-update, which silently truncates a larger match. Troubleshooting drops the entries whose error message already contained its own fix and keeps the seven whose cause is not obvious.JSON-LD never reached the HTML. All four structured-data blocks (WebSite, TechArticle, BreadcrumbList, SoftwareApplication) were rendered with
next/script, which never emitted a script tag. Measured on a production build,/api-reference/getting-startedcontained zero<script type="application/ld+json">elements — the payload existed only in the__next_sclient-injection queue and the RSC flight data, so anything reading the served HTML saw no structured data. React was also loggingEncountered a script tag while rendering React componenton every page.next/scriptis for loading and executing JavaScript; JSON-LD is data, and Next's own guidance is a native<script>in the component.serializeJsonLdalready performs the escaping that guidance calls for, so only the element changes. Same build after the fix: three valid tags per page withWebSitein<head>, injection queue gone.Sidebar separator spacing.
[data-separator]:not([data-separator] ~ [data-separator])was meant to keep the first sidebar group flush against the top padding, but~only reaches siblings, so it also matched the first separator inside every expanded folder. Under Self-Hosting, "Install" lost its top margin and crowded "Architecture" — 25px of gap where "Configure" and "Operate" below it had 40px.:first-childexpresses the intent directly; only the four sidebar roots open with a separator, so nothing else changes.Type of Change
Testing
WebSitein<head>,__next_squeue absentmeta.jsonfiles — only the four sidebar roots open with a separator, so no nested folder regressesnode_modules/.binand offPATH, confirming-gis requiredbun run check:audits(29/29), 242 CLI tests, type-checks clean onapps/docsandpackages/sim-cli, full site builds, all routes 200Checklist