Reorganize compiler code into src-compile directory#132
Conversation
This proposal outlines the plan to split Ray.Compiler into two packages: - ray/compiled-injector: Runtime execution (11KB, production dependency) - ray/compiler: Build tool (35KB, dev dependency) Benefits: - Security: Remove compilation code from production - Size: 75% reduction in production deployment - Clarity: Clear separation of runtime vs build-time concerns - Simple migration: Only composer.json changes needed The proposal includes: - Detailed implementation plan (Phase 1-3) - File classification and migration checklist - Package structure and composer.json specifications - Migration guide for existing users
…erns Move build-time files (Compiler, CompileVisitor, etc.) from src/ to src-compile/ to clarify the separation between runtime and compile-time concerns. Runtime files (CompiledInjector, InjectionPoint, etc.) remain in src/. This is a structural reorganization only: - No namespace changes (Ray\Compiler\* preserved) - No public API changes - Full backward compatibility via PSR-4 multi-path autoload - Sets up future option to extract a ray/compiled-injector package Updates: - 14 files moved to src-compile/ via git mv (history preserved) - composer.json: autoload paths + cs/cs-fix/metrics/phpmd scripts - phpstan.neon, psalm.xml, phpcs.xml: include src-compile Verified: - composer test: 88 tests, 149 assertions PASS - composer cs: PASS - psalm: No errors - phpstan: No errors https://claude.ai/code/session_01QLnL9zQtJ8WAo5HSNBBWhZ
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value). 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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #132 +/- ##
============================================
Coverage 100.00% 100.00%
+ Complexity 93 25 -68
============================================
Files 11 2 -9
Lines 232 64 -168
============================================
- Hits 232 64 -168 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The proposal file was a planning artifact and is no longer needed now that the structural reorganization (src/ vs src-compile/) has been implemented. https://claude.ai/code/session_01QLnL9zQtJ8WAo5HSNBBWhZ
Summary
This PR reorganizes the Ray.Compiler codebase by moving all compilation-related code into a dedicated
src-compiledirectory, while keeping runtime code insrc. This is a preparatory step toward the proposed separation of runtime (CompiledInjector) and build-time (Compiler) concerns.Key Changes
Directory restructuring: Moved all compiler implementation files from
src/tosrc-compile/:Compiler.php,CompileVisitor.php,InstanceScript.php,Scripts.phpInjectorFactory.php,FilePutContents.phpCompilerModule.php,DiCompileModule.php,OverrideLazyModule.php,LazyModuleInterface.phpAnnotation/Compile.phpException/subdirectory with compilation-specific exceptionsConfiguration updates: Updated all analysis and linting tools to include the new
src-compiledirectory:composer.json: Addedsrc-compileto PSR-4 autoload paths and script commandsphpcs.xml: Addedsrc-compileto checked filesphpstan.neon: Addedsrc-compileto analysis pathspsalm.xml: Addedsrc-compileto project filesImplementation Details
src/directory now contains only runtime code (CompiledInjector, ScriptInjectorInterface, InjectionPoint, Types, and runtime exceptions)src-compile/directory contains all build-time compilation logicRay\Compiler\namespaceray/compiled-injectorpackage while maintaining backward compatibilityRelated
This change implements the directory structure proposed in
SEPARATION_PROPOSAL.md, which outlines the full separation of runtime and compiler concerns for improved security and reduced deployment size.https://claude.ai/code/session_01QLnL9zQtJ8WAo5HSNBBWhZ