Skip to content

Conversation

@avivkeller
Copy link
Member

#509 broke Windows runs of doc-kit, as globSync was called on complete file paths.

This doesn't break Unix, since a complete unix path is a valid glob. A complete Windows path, however, is not a valid glob.

So, this PR removes the loaders/, as they are performed in the ast and ast-js generators directly.

Requesting fast-track, as this breaks windows.

Copilot AI review requested due to automatic review settings December 10, 2025 22:48
@avivkeller avivkeller requested a review from a team as a code owner December 10, 2025 22:48
@vercel
Copy link

vercel bot commented Dec 10, 2025

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

Project Deployment Preview Updated (UTC)
api-docs-tooling Ready Ready Preview Dec 10, 2025 10:53pm

@avivkeller avivkeller added the fast track This PR can land before the typical review time, with a :+1: from collaborators label Dec 10, 2025
@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

❌ Patch coverage is 58.33333% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.79%. Comparing base (50f6fbf) to head (3923a66).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/generators/ast/index.mjs 23.07% 10 Missing ⚠️
src/parsers/javascript.mjs 72.22% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #511      +/-   ##
==========================================
- Coverage   80.81%   80.79%   -0.02%     
==========================================
  Files         121      119       -2     
  Lines       11984    11864     -120     
  Branches      846      843       -3     
==========================================
- Hits         9685     9586      -99     
+ Misses       2296     2275      -21     
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a critical Windows compatibility issue where globSync was being called on complete file paths rather than glob patterns, which breaks on Windows since Windows paths (e.g., C:\path\to\file) are not valid glob patterns.

The fix removes the redundant loader layer (src/loaders/markdown.mjs and src/loaders/javascript.mjs) that was performing unnecessary globSync operations in the file processing pipeline, and replaces them with direct usage of the to-vfile library's read function.

Key changes:

  • Eliminates redundant globSync calls on complete file paths that broke Windows
  • Simplifies the architecture by removing the loader abstraction layer
  • Refactors the JavaScript parser from a factory pattern to a direct export

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/parsers/javascript.mjs Refactored from factory pattern to direct function export; removes wrapper without changing core parsing logic
src/loaders/markdown.mjs Deleted loader that was calling globSync on complete file paths
src/loaders/javascript.mjs Deleted loader that was calling globSync on complete file paths
src/generators/ast/index.mjs Updated to use to-vfile's read function directly instead of going through the markdown loader
src/generators/ast-js/index.mjs Updated to use to-vfile's read function directly and import parseJsSource as a named export
package.json Added to-vfile@^8.0.0 dependency for direct file reading
npm-shrinkwrap.json Lockfile updates for the new to-vfile dependency and automatic peer dependency resolution changes
Files not reviewed (1)
  • npm-shrinkwrap.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@avivkeller avivkeller merged commit 06f981e into main Dec 10, 2025
27 of 28 checks passed
@avivkeller avivkeller deleted the fix/globsync branch December 10, 2025 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fast track This PR can land before the typical review time, with a :+1: from collaborators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants