Skip to content

fix(docs): serve JSON-LD in the HTML, fix sidebar spacing, and tighten the CLI guides - #6763

Merged
waleedlatif1 merged 4 commits into
stagingfrom
docs/cli-install-command
Aug 16, 2026
Merged

fix(docs): serve JSON-LD in the HTML, fix sidebar spacing, and tighten the CLI guides#6763
waleedlatif1 merged 4 commits into
stagingfrom
docs/cli-install-command

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Follow-up to #6762.

Summary

Install command. --global-g, which is what every comparable CLI documents. 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.

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 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.

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-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. 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 performs the escaping that guidance calls for, so only the element changes. Same build after the fix: three valid tags per page with WebSite in <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-child expresses the intent directly; only the four sidebar roots open with a separator, so nothing else changes.

Type of Change

  • Bug fix (JSON-LD not served; sidebar spacing; a documented install command that fails on Yarn 2+)
  • Documentation

Testing

  • JSON-LD measured before and after on a production build and over HTTP: 0 → 3 valid tags per page, WebSite in <head>, __next_s queue absent
  • Sidebar rule verified against all 21 meta.json files — only the four sidebar roots open with a separator, so no nested folder regresses
  • Non-global npm install verified to leave the binary in node_modules/.bin and off PATH, confirming -g is required
  • bun run check:audits (29/29), 242 CLI tests, type-checks clean on apps/docs and packages/sim-cli, full site builds, all routes 200

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…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.
@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 16, 2026 3:40am

Request Review

@cursor

cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Documentation and docs-site presentation changes only; JSON-LD fix aligns with Next.js guidance and is low risk for SEO/crawlers.

Overview
JSON-LD switches from next/script to native <script type="application/ld+json"> in the docs layout and structured-data.tsx, so structured data is in the served HTML instead of client injection.

Sidebar drops the broken sibling-selector margin rule in global.css and uses first:mt-0 on SidebarSeparator so only the first group label is flush to the top—not every first separator inside expanded folders.

CLI docs are trimmed across MDX pages and the generator: install uses -g (yarn tab removed), prose and callouts are cut to user-facing essentials, troubleshooting keeps non-obvious cases, and the reference page intro matches the shorter style. packages/sim-cli/README.md uses -g as well.

Reviewed by Cursor Bugbot for commit 91faee7. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR makes JSON-LD available directly in server-rendered HTML, localizes sidebar separator spacing to its component, and streamlines the public CLI documentation.

  • Replaces next/script with native JSON-LD script elements.
  • Moves first-separator spacing from the global stylesheet to a Tailwind variant on SidebarSeparator.
  • Updates installation commands and condenses CLI guides, troubleshooting content, and generated reference copy.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

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

Comment thread apps/docs/app/global.css Outdated
Comment thread apps/docs/content/docs/en/cli/index.mdx
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.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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.

@waleedlatif1
waleedlatif1 merged commit 025ea4d into staging Aug 16, 2026
29 of 30 checks passed
@waleedlatif1
waleedlatif1 deleted the docs/cli-install-command branch August 16, 2026 03:39
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