Skip to content

Conversation

nad182
Copy link
Contributor

@nad182 nad182 commented Oct 15, 2025

Motivations

  • Make the docs generator quieter and easier to operate, while keeping behavior consistent with the target branch.
  • Improve path stability in generated JSON and avoid unnecessary work when requested.

Changes

Added

  • -t/--touched mode: only write outputs when the source is newer than the existing JSON (mtime-based skip).
  • Unknown flag guard: fail fast on invalid flags with a short usage message.

Changed

  • Parse using a relative path so JSON filePath entries remain stable and relative.
  • Resolve base directories via __dirname/fileURLToPath and build paths via path.join.
  • DRY generation flow with a small generate() helper reused for web, native, and V2 auto-detect.
  • Reduce noisy per-item logs; print a concise end-of-run summary (parsed/updated/skipped) and list updated files.

Removed

  • Autocomplete V2 special-case (now covered by the generic V2 auto-detection).
  • Content-diff write logic (default runs always write; touched mode controls skipping via mtime).

Fixed

  • Stable filePath values in generated JSON by parsing via a relative path.

Security

  • n/a

Testing

  1. From packages/site, run npm run generate.
    • Expect all JSONs to be regenerated and a concise summary printed at the end.
  2. Run npm run generate -- -t.
    • Expect only stale outputs to be written; summary should show a non-zero Skipped count if nothing changed.
  3. Run npm run generate -- -g.
    • Expect an error about unknown flags with usage instructions.

nad182 added 5 commits October 8, 2025 14:32
…clude inherited React props

- Introduced a new function, `filterOutInheritedReactProps`, to clean up component documentation by removing inherited props from React base attributes.
- Updated the documentation processing pipeline in `generateDocs.mjs` to include this new filtering step.
- Removed unnecessary `key` prop entries from various component prop JSON files to streamline documentation.
- Combined import statements from both branches
- Merged function implementations with error handling and file change detection
- Integrated filterOutInheritedReactProps function for better prop filtering
- Combined V2 component generation approaches
- Added summary output for better user feedback
- Fixed all linting errors
- Auto-detect <Component>.rebuilt.tsx and emit src/content/<Component>V2/<Component>V2.props.json
- Remove Autocomplete V2 one-off; rely on generic V2 detection
- Preserve relative file paths in output by parsing via relative path
@nad182 nad182 requested a review from a team as a code owner October 15, 2025 00:22
@nad182 nad182 marked this pull request as draft October 15, 2025 00:22
Copy link

cloudflare-workers-and-pages bot commented Oct 15, 2025

Deploying atlantis with  Cloudflare Pages  Cloudflare Pages

Latest commit: 85646ff
Status: ✅  Deploy successful!
Preview URL: https://6612e8ae.atlantis.pages.dev
Branch Preview URL: https://cleanup-improve-generatedocs.atlantis.pages.dev

View logs

@nad182 nad182 changed the title build: improve generateDocs script (touched mode, flags, stable paths, summary) chore(docx): improve generateDocs script (touched mode, flags, stable paths, summary) Oct 15, 2025
@nad182 nad182 changed the title chore(docx): improve generateDocs script (touched mode, flags, stable paths, summary) chore(docx): improve generateDocs script to have a touched mode Oct 15, 2025
@nad182 nad182 changed the title chore(docx): improve generateDocs script to have a touched mode chore(docx): improve generateDocs script to run only for update components when running with -t flag Oct 15, 2025
@nad182 nad182 changed the title chore(docx): improve generateDocs script to run only for update components when running with -t flag chore(docx): improve generateDocs script to run only for updated components with -t/--touched flag Oct 20, 2025
Base automatically changed from JOB-138157/update-docgen-script-for-V2-components to master October 20, 2025 15:01
@nad182 nad182 marked this pull request as ready for review October 20, 2025 15:02
@nad182 nad182 requested a review from ZakaryH October 20, 2025 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant