Skip to content

fix(debarrel): Fix cloud readdir startsWith crash - #39

Merged
alexbit-codemod merged 1 commit into
mainfrom
fix/debarrel-cloud-readdir-startswith
Aug 11, 2026
Merged

fix(debarrel): Fix cloud readdir startsWith crash#39
alexbit-codemod merged 1 commit into
mainfrom
fix/debarrel-cloud-readdir-startswith

Conversation

@alexbit-codemod

Copy link
Copy Markdown
Contributor

Summary

  • Cloud runs crashed in walkProjectSourceFiles with cannot read property 'startsWith' of undefined while checking whether barrels must be preserved
  • Cause: curated fs readdirSync({ withFileTypes: true }) entries did not always expose a usable .name
  • Fix: list directories with plain readdirSync, normalize string/Dirent names safely, and fall back to statSync for directory checks

Test plan

  • pnpm test in codemods/debarrel (283 passed)
  • Re-run debarrel on the same cloud target and confirm the Runtime initialization / startsWith error is gone
  • Merge Version Packages after this lands so 0.7.13 publishes

Made with Cursor

Walk project sources with plain readdir names and defensive Dirent handling so curated fs entries without `.name` no longer throw in barrelMustBePreserved.

Co-authored-by: Cursor <cursoragent@cursor.com>
@alexbit-codemod
alexbit-codemod merged commit 00a57b1 into main Aug 11, 2026
1 check passed
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