Warning
This is an internal project, and is not intended for public use. No support or stability guarantees are provided.
The validate command ensures that committed files match the expected output. It processes all page.mdx files to verify parent indexes are up-to-date, and all types.ts files to ensure generated types.md documentation is current.
pnpm docs-infra validate [paths...]
| Argument | Type | Description |
|---|---|---|
paths | string[] | Optional paths to validate (e.g., docs-infra/components) |
| Option | Type | Default | Description |
|---|---|---|---|
--command | string | pnpm docs-infra validate | Command to suggest when indexes are out of date |
--useVisibleDescription | boolean | false | Use first visible paragraph as description |
--indexes | boolean | false | Only validate page.mdx index files |
--types | boolean | false | Only validate types.ts files |
pnpm docs-infra validate
Processes all page.mdx files in src/app/ and app/ directories.
pnpm docs-infra validate docs-infra/components docs-infra/functions
Only validates indexes under the specified paths.
pnpm docs-infra validate --useVisibleDescription
Uses the first visible paragraph in each page as the description, instead of the meta tag.
pnpm docs-infra validate --indexes
Only processes page.mdx files, skipping types validation.
pnpm docs-infra validate --types
Only processes types.ts files, skipping index validation.
page.mdx files in the app directoriestransformMarkdownMetadatatypes.ts files in the app directoriescreateTypesMeta calls from each filesyncTypes to regenerate type documentationtypes.md files were updatedIn CI environments (CI=true), the command exits with error code 1 if any files changed, suggesting the command to run locally.
Validating committed files match expected output...
Processing 47 indexed page.mdx files...
Processing 12 types.md files...
No files needed updating
✓ 0 files updated in 1.23s [indexes: 0.85s, types: 0.38s]
Validating committed files match expected output...
Processing 47 indexed page.mdx files...
Updated index files:
app/docs-infra/components/page.mdx
app/docs-infra/functions/page.mdx
Processing 12 types.md files...
Updated types.md files:
app/docs-infra/components/code-highlighter/types.md
Total: 3 files updated
✓ 3 files updated in 1.45s [indexes: 0.92s, types: 0.53s]
When running in CI (CI=true) and files are out of date:
Updated index files:
app/docs-infra/components/page.mdx
Updated types.md files:
app/docs-infra/components/code-highlighter/types.md
Total: 2 files updated
✓ 2 files updated in 1.23s [indexes: 0.85s, types: 0.38s]
✗ Generated files are out of date. Run this command locally:
pnpm docs-infra validate docs-infra/components
Then commit the results.
Exit code: 1
The command uses marker files to track which indexes were updated:
.next/cache/docs-infra/index-updates/The validate command uses the transformMarkdownMetadata plugin internally:
const processor = unified()
.use(remarkParse)
.use(remarkMdx)
.use(transformMarkdownMetadata, {
extractToIndex: {
include: includePatterns,
exclude: [],
baseDir: cwd,
onlyUpdateIndexes: true,
markerDir: '.next/cache/docs-infra/index-updates',
useVisibleDescription,
},
});
transformMarkdownMetadata - Remark plugin for metadata extractionsyncPageIndex - Function that performs the actual index updatessyncTypes - Function that generates type documentationcreateSitemap - Uses extracted metadata for search