Skip to content

Conversation

@anegg0
Copy link
Contributor

@anegg0 anegg0 commented Dec 12, 2025

Add docs/sdk/index.mdx and docs/sdk/migrate.mdx to .prettierignore to prevent them being staged upon each build.

Description

Document type

  • Gentle introduction
  • Quickstart
  • How-to
  • Concept
  • FAQ
  • Troubleshooting
  • Reference
  • Third-party content
  • Not applicable

Add docs/sdk/index.mdx and docs/sdk/migrate.mdx to .prettierignore to prevent
automatic formatting of manually maintained SDK documentation landing pages.
@vercel
Copy link

vercel bot commented Dec 12, 2025

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

Project Deployment Preview Updated (UTC)
arbitrum-docs Ready Ready Preview Dec 12, 2025 5:30am

The pre-commit hook was passing files explicitly to Prettier via xargs, which
bypasses .prettierignore rules. This caused docs/sdk/index.mdx and
docs/sdk/migrate.mdx to be formatted despite being in .prettierignore.

Changes:
- Add filter_prettier_ignored() function to check Prettier ignore status
- Filter JS/TS and Markdown files before passing to Prettier
- Only format files that are not ignored

This ensures .prettierignore rules are respected even when files are
explicitly staged, preventing unwanted formatting of manually maintained
SDK documentation landing pages.
The sdkDocsHandler was unconditionally overwriting index.mdx and migrate.mdx
on every TypeDoc generation, causing manual edits to be lost.

Changes:
- Only generate index.mdx if it doesn't exist
- Only generate migrate.mdx if it doesn't exist
- Preserve manual edits across doc regenerations

This allows the files to be manually maintained while still providing
default templates for initial generation.
The root cause was that TypeDoc was cleaning the output directory before
generating docs, which deleted index.mdx and migrate.mdx. Then the generator
would recreate them from hardcoded templates, overwriting any manual edits.

Solution:
1. Set cleanOutputDir: false in TypeDoc config to prevent auto-cleaning
2. Use custom cleanDirectory function that preserves index.mdx and migrate.mdx
3. Only generate these files if they don't exist (bootstrap mode)

This allows index.mdx and migrate.mdx to be manually maintained while
still cleaning auto-generated API documentation on each build.
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.

2 participants