Add CLI flags reference and auto-generation script#3179
Open
anegg0 wants to merge 3 commits intonitro-cli-guidefrom
Open
Add CLI flags reference and auto-generation script#3179anegg0 wants to merge 3 commits intonitro-cli-guidefrom
anegg0 wants to merge 3 commits intonitro-cli-guidefrom
Conversation
Introduce scripts/generate-cli-reference.ts that reads structured flag data from scripts/data/nitro-cli-flags.json (634 flags across 23 namespaces) and generates docs/run-arbitrum-node/nitro/cli-flags-reference.mdx with collapsible namespace sections, type/default columns, and cross-links to curated guides. Add all 5 Nitro CLI guide pages to sidebars.js and the generate-cli-reference script entry to package.json.
Run Prettier on generated output before comparing with the committed file, since Prettier reformats table padding, asterisk escaping, and column widths in markdown tables.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Curly braces in flag descriptions and defaults were being parsed as JSX expressions by MDX. Added escaping in the generation script and regenerated the output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/generate-cli-reference.ts) that generates the MDX from structured JSON datapackage.jsonscript entry:yarn generate-cli-referenceHow the auto-generation works
scripts/data/nitro-cli-flags.jsoncontains 634 flags with type, default, and descriptionscripts/generate-cli-reference.tsreads the JSON, groups by namespace, generates MDX with collapsible sectionsyarn generate-cli-referenceto regenerateyarn generate-cli-reference --checkin CI to verify the committed file matchesContent gap tracking
Test plan
yarn generate-cli-reference --checkpasses/run-arbitrum-node/nitro/cli-flags-referenceyarn buildpasses with all sidebar entries (requires all other PRs merged first)yarn lint:markdownpassesPart of #3174 — merge this last (contains sidebar entries referencing all other pages)