Skip to content

Move patching helpers to helpers.ts#426

Merged
bl-ue merged 1 commit intomainfrom
helpers
Jan 28, 2026
Merged

Move patching helpers to helpers.ts#426
bl-ue merged 1 commit intomainfrom
helpers

Conversation

@bl-ue
Copy link
Member

@bl-ue bl-ue commented Jan 28, 2026

@coderabbitai ignore

Summary by CodeRabbit

  • Refactor
    • Reorganized internal helper utilities into a dedicated module for improved code organization.

✏️ Tip: You can customize this high-level summary in your review settings.

@bl-ue bl-ue enabled auto-merge (squash) January 28, 2026 15:11
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

📝 Walkthrough

Walkthrough

Helper functions for JavaScript bundle static analysis are extracted from src/patches/index.ts into a new dedicated module src/patches/helpers.ts. The 11 utility functions—including findChalkVar, getReactVar, findBoxComponent, and others—are moved to the helpers module and re-exported from the index file, consolidating helper logic into a separate file without changing functionality.

Changes

Cohort / File(s) Summary
Helper Functions Extraction
src/patches/helpers.ts
New module created with 11 static analysis utility functions for JavaScript bundles: findChalkVar, getModuleLoaderFunction, getReactModuleNameNonBun, getReactModuleFunctionBun, getReactVar, clearReactVarCache, findRequireFunc, getRequireFuncName, clearRequireFuncNameCache, findTextComponent, findBoxComponent. Includes multi-regex parsing logic, environment-aware branching (Bun vs esbuild), and caching mechanisms (+343 lines).
Module Reorganization
src/patches/index.ts
Removes inline exports of 11 helper functions and adds consolidated re-export statement from './helpers' module, centralizing helper function definitions (-342 lines, +13 lines).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • PR #352: Overlapping changes to getModuleLoaderFunction with enhanced native vs NPM bundle detection logic.

Poem

🐰 Helpers hop into their brand new home,
Extracted clean, no longer alone,
Static patterns dance through the dedicated file,
Organization blooms with newfound style!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main change: moving patching helper functions from src/patches/index.ts to a new src/patches/helpers.ts module. The title is concise, clear, and directly reflects the refactoring work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@bl-ue bl-ue merged commit 1029e44 into main Jan 28, 2026
1 of 2 checks passed
@bl-ue bl-ue deleted the helpers branch January 28, 2026 15:12
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.

1 participant