Skip to content

Conversation

@alexeyr-ci2
Copy link
Collaborator

@alexeyr-ci2 alexeyr-ci2 commented Oct 22, 2025

Summary

Documented use as a Git dependency and fixed an issue with the Pro Node renderer there.

Pull Request checklist

  • Add/update test to cover these changes
  • Update documentation
  • Update CHANGELOG file

This change is Reviewable

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Packages can now be successfully installed as Git dependencies.
  • Documentation

    • Enhanced contributor guide with comprehensive testing workflows, development methodologies, and troubleshooting resources for improved setup reliability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

Walkthrough

This PR updates changelog and contributor documentation to document Git dependency installation, refactors the preinstall workflow in react_on_rails_pro from inline commands to a dedicated Node script for improved modularity and error handling, and adjusts related package configuration.

Changes

Cohort / File(s) Summary
Documentation updates
CHANGELOG.md, CONTRIBUTING.md
CHANGELOG.md adds a Bug Fixes subsection noting Git dependency installation support and updates anchor labels to lowercase. CONTRIBUTING.md comprehensively rewrites testing guidance with expanded multi-method workflows (Ruby, JS, Git dependencies, Tarball), adds explicit commands, introduces troubleshooting sections, and replaces local path references with placeholder tokens.
Preinstall workflow refactoring
react_on_rails_pro/package.json, react_on_rails_pro/script/preinstall.js
package.json changes preinstall from inline yarn run link-source && yalc add --link react-on-rails to delegating to a new Node script. New preinstall.js handles optional linkage: skips if running in node_modules, executes link-source and yalc commands sequentially with error handling, and gracefully exits on failure to avoid blocking install.

Sequence Diagram

sequenceDiagram
    autonumber
    actor User
    participant npm/yarn as npm/yarn install
    participant pkg.json as package.json<br/>(preinstall)
    participant script as preinstall.js
    participant cmds as link-source &<br/>yalc commands

    User->>npm/yarn: npm/yarn install
    npm/yarn->>pkg.json: trigger preinstall hook
    pkg.json->>script: node ./script/preinstall.js
    
    rect rgb(240, 248, 255)
    note right of script: Guard check
    script->>script: if in node_modules?
    script->>script: exit 0 (skip)
    end
    
    rect rgb(240, 248, 255)
    note right of script: Execute commands
    script->>cmds: yarn run link-source
    cmds-->>script: success/error
    script->>cmds: yalc add --link<br/>react-on-rails
    cmds-->>script: success/error
    end
    
    rect rgb(240, 248, 255)
    note right of script: Error handling
    alt Any command fails
        script->>script: log error, exit 0
    else All succeed
        script->>script: complete
    end
    end
    
    script-->>npm/yarn: exit code 0
    npm/yarn-->>User: install complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Rationale: The diff spans diverse file types (documentation, configuration, new script) with mixed complexity. CONTRIBUTING.md is large but consists of consistent documentation rewrites and example updates. The preinstall.js is new but straightforward with clear error-handling logic. The package.json change is minimal. The heterogeneous nature (documentation + script refactoring) and moderate scope warrant careful review of the script's error-handling assumptions and documentation accuracy, but no dense logic or structural complexity is present.

Possibly related PRs

  • PR Update CHANGELOG for 14.2.0 #1704: Modifies CHANGELOG.md anchor/link entries in the Unreleased section, directly aligning with changelog structural changes.
  • PR Fix generator tests #1706: Updates package.json workflow for linking react-on-rails via yalc postinstall scripts, paralleling the preinstall script refactoring in this PR.
  • PR Enable use as a Git dependency #1664: Modifies packaging/install scripts and CHANGELOG entries to enable and document Git dependency installation support.

Suggested reviewers

  • justin808
  • AbanoubGhadban
  • Judahmeek

Poem

🐰✨ A preinstall script hops into place,
Where yarn and yalc once ran their race—
Now modular and clean, with grace and care,
The docs bloom bright with workflows rare! 🌱

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Update preinstall script to enable use as a Git dependency" directly corresponds to the primary changes in this pull request. The changeset's core modifications focus on refactoring the preinstall script in react_on_rails_pro/package.json to call a new preinstall.js Node script, which implements improved error handling and optional linkage logic to support Git dependency installation. The supporting changes to CHANGELOG.md and CONTRIBUTING.md document and provide guidance for this new capability. The title is concise, specific, and clearly communicates the main objective without vague language or noise.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch alexeyr/fix-prepare-script

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d527ddf and 6a040ee.

📒 Files selected for processing (4)
  • CHANGELOG.md (2 hunks)
  • CONTRIBUTING.md (2 hunks)
  • react_on_rails_pro/package.json (1 hunks)
  • react_on_rails_pro/script/preinstall.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx,css,scss,json,yml,yaml,md}

📄 CodeRabbit inference engine (CLAUDE.md)

Prettier is the sole authority for formatting all non-Ruby files; never manually format them

Files:

  • react_on_rails_pro/script/preinstall.js
  • react_on_rails_pro/package.json
  • CONTRIBUTING.md
  • CHANGELOG.md
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use ESLint for JS/TS code (lint via rake lint or yarn lint)

Files:

  • react_on_rails_pro/script/preinstall.js
🧠 Learnings (1)
📚 Learning: 2025-10-23T17:22:01.064Z
Learnt from: AbanoubGhadban
PR: shakacode/react_on_rails#1875
File: lib/react_on_rails/utils.rb:112-124
Timestamp: 2025-10-23T17:22:01.064Z
Learning: In React on Rails, when Pro is installed but not licensed, the intended behavior is to raise an error on boot. The `react_on_rails_pro?` method validates licenses and should raise errors early (including during path resolution in methods like `server_bundle?`) to enforce licensing requirements rather than failing later with obscure errors.

Applied to files:

  • CHANGELOG.md
🪛 LanguageTool
CONTRIBUTING.md

[style] ~95-~95: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...led files yarn run build-watch ``` You need to do this once to make sure your app depe...

(REP_NEED_TO_VB)


[style] ~106-~106: Consider shortening or rephrasing this to strengthen your wording.
Context: ...eact-on-rails ``` The workflow is: 1. Make changes to the node package. 2. CRITICAL: Run ...

(MAKE_CHANGES)


[grammar] ~137-~137: Use a hyphen to join words.
Context: ...ing an update to the node package client side. Do the same for function `serverRe...

(QB_NEW_EN_HYPHEN)

🪛 markdownlint-cli2 (0.18.1)
CONTRIBUTING.md

97-97: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


109-109: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


165-165: Bare URL used

(MD034, no-bare-urls)


173-173: Bare URL used

(MD034, no-bare-urls)


181-181: Bare URL used

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (11)
react_on_rails_pro/package.json (1)

119-119: LGTM: Improved modularity and error handling.

The migration from inline shell commands to a dedicated Node.js script is a solid improvement. The new preinstall.js provides better cross-platform compatibility, proper error handling, and prevents install failures when running as a Git dependency.

CHANGELOG.md (2)

30-33: LGTM: Clear and helpful documentation.

The Bug Fixes entry clearly documents the new Git dependency capability with proper attribution and helpful references to documentation. This will assist users who need to test unreleased versions or work with forks.


1774-1774: LGTM: Improves consistency.

The lowercase anchor [unreleased] aligns with the naming convention used for all other version links in the file (lines 1775-1920). This consistency is good for maintainability.

react_on_rails_pro/script/preinstall.js (3)

1-11: LGTM: Smart node_modules detection prevents recursion.

The early exit when running inside node_modules is essential for Git dependency support. This prevents infinite recursion when the package is installed as a dependency. The cross-platform path checking using path.sep is a solid approach.


13-17: LGTM: Clean command execution with proper error handling.

The runCommand function uses spawnSync with stdio: 'inherit' for transparent output, and properly checks both the error property and exit status. This provides clear feedback when commands fail.


19-31: LGTM: Graceful failure for optional development steps.

The try-catch pattern with process.exit(0) on failure is exactly right for optional linking steps. This ensures:

  • Development workflow works when tools are available
  • Production/CI installs succeed even without yalc/link-source
  • Clear error messages when something goes wrong

The comment on line 26 accurately describes the behavior.

CONTRIBUTING.md (5)

52-59: LGTM: Clear documentation with helpful links.

The example apps section is well-organized with direct links to the relevant directories. Using the placeholder <React on Rails root> is better than hardcoded paths and makes the instructions more universally applicable.


66-133: LGTM: Excellent practical guidance with critical warnings.

The local version testing instructions are comprehensive and practical. The prominent warning about yalc push (line 107) is crucial—many developers forget this step. The inclusion of expected output (lines 121-129) helps users verify they're on the right track.


140-194: LGTM: Comprehensive Git dependency documentation.

The Git dependencies section excellently covers the different approaches across package managers. The specific examples for Yarn Berry, PNPM, and NPM (with the candid note about NPM's limitations) are very helpful. The tarball alternative provides a reliable fallback option.

Note: Static analysis flagged bare URLs at lines 165, 173, 181, but these are documentation links in context and not a concern.


351-541: LGTM: Outstanding practical testing guidance.

The generator testing sections (manual workflow, yalc setup, and troubleshooting) are exceptionally thorough and practical. Particularly valuable:

  • The clean baseline approach with git tags (lines 373-380)
  • Two-scenario testing methodology (lines 386-421)
  • The "npm pack" alternative to yalc (lines 467-484) which is more reliable for CI/CD
  • Comprehensive troubleshooting section covering real-world issues

This level of detail will significantly help contributors test generator changes correctly.


542-721: LGTM: Professional documentation standards.

The pre-commit automation guidance (with both automated and manual options) and the AI coding agent best practices are excellent additions. The demo naming convention section provides clear, actionable standards that will improve discoverability and consistency across React on Rails demos.


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

@claude
Copy link

claude bot commented Oct 22, 2025

Code Review: PR #1873 - Update preinstall script to enable use as a Git dependency

Summary

This PR refactors the preinstall script from inline shell commands to a dedicated Node.js script, enabling the package to work properly when installed as a Git dependency.


✅ Strengths

1. Code Quality

  • Clean separation of concerns: Moving complex logic from package.json to a dedicated script improves maintainability
  • Good error handling: The try-catch block gracefully handles failures without breaking the install process
  • Cross-platform compatibility: Using Node.js instead of shell commands ensures Windows compatibility
  • Clear intent: Comments explain the purpose and behavior well

2. Implementation

  • Smart detection: The inNodeModules check (preinstall.js:7) correctly identifies when the package is being installed as a dependency
  • Process control: Using spawnSync with stdio: 'inherit' properly streams output to the parent process
  • Graceful degradation: Exit code 0 on failure ensures the install continues, which is appropriate for optional development tooling

🔍 Issues & Recommendations

Critical: Inconsistent Error Handling

Location: react_on_rails_pro/script/preinstall.js:14-18

The runCommand function throws errors on failure, but the catch block at line 26 catches them and exits with code 0. This creates inconsistent behavior where exceptions are used for control flow.

Recommendation: Since these commands are optional, consider removing the throws from runCommand and returning a boolean status instead. This makes the intent clearer and avoids using exceptions for control flow.


Minor: Edge Case - Missing __dirname

Location: preinstall.js:6

The fallback to process.cwd() is good defensive coding, but __dirname should always be defined in CommonJS scripts. This fallback might mask a real problem if __dirname is ever undefined.

Recommendation: Consider adding a comment explaining when this fallback would be needed, or remove it if it's unnecessary.


Minor: Error Object Logging

Location: preinstall.js:29

Logging the entire error object may produce unclear output. Consider logging just the message for better readability.


🔒 Security Considerations

No security concerns identified

  • No arbitrary code execution vulnerabilities
  • No file system operations outside expected boundaries
  • Proper use of spawnSync with explicit arguments (no shell injection)
  • Script runs in development context only (not in production)

⚡ Performance Considerations

Performance is appropriate

  • Synchronous operations are acceptable for install scripts
  • Early exit when inNodeModules === true avoids unnecessary work
  • No blocking operations that would significantly impact install time

🧪 Test Coverage

⚠️ No tests provided

While install scripts are notoriously difficult to test, consider:

  1. Manual testing documentation: Add a section to the PR description or CONTRIBUTING.md showing how to verify this works
  2. Simple validation script: Create a test that verifies the script exists and has valid syntax

📝 Documentation

PR description mentions documentation updates

  • Consider adding a comment in package.json next to the preinstall script explaining its purpose
  • Document the Git dependency use case in relevant docs if not already done

🎯 Final Recommendation

Approve with minor suggestions

The PR successfully solves the Git dependency installation issue with a clean, cross-platform solution. The main concerns are around code clarity and error handling patterns rather than functional issues.

Before merging:

  1. ✅ Update error handling in runCommand to avoid throw/catch for control flow
  2. ✅ Improve error logging clarity
  3. ✅ Consider adding manual testing documentation
  4. ⚠️ CRITICAL: Run bundle exec rubocop and ensure all files end with newlines (per CLAUDE.md requirements)
  5. ⚠️ Verify Prettier formatting has been run on the new JavaScript file

Alignment with CLAUDE.md

  • ✅ Cross-platform compatibility (no shell-specific commands)
  • ⚠️ Verify Prettier formatting has been run
  • ⚠️ Ensure the new file ends with a newline character

Great work on improving the developer experience for Git dependency usage! 🚀

@claude
Copy link

claude bot commented Oct 22, 2025

Code Review - PR #1873

Summary

This PR refactors the preinstall script to enable the react_on_rails_pro package to work as a Git dependency by moving the logic from a shell command string to a dedicated Node.js script.


Positive Aspects

  1. Cross-platform compatibility: Converting from shell commands to Node.js using child_process.spawnSync makes this work on Windows, macOS, and Linux.

  2. Smart detection logic: The inNodeModules check prevents the link steps from running when installed as a dependency, which is exactly what is needed for Git dependencies.

  3. Graceful error handling: The try-catch block with process.exit(0) ensures that optional linking steps do not break installations when yalc or other tools are not available.

  4. Preserves existing behavior: For local development, the script still runs the same link-source and yalc add commands.


Code Quality Issues

  1. Missing newline at end of file - CRITICAL
    File: react_on_rails_pro/script/preinstall.js

The new file is missing a trailing newline character, which will cause CI to fail per the CLAUDE.md requirements.

Fix: Add a newline after the final closing brace on line 31.

  1. Potential false positives in path detection
    File: react_on_rails_pro/script/preinstall.js:7

The check for node_modules could incorrectly match if someone has node_modules anywhere in their directory path.

Recommendation: Use a more robust check that looks for node_modules as a directory boundary.

  1. Inconsistent directory reference
    File: react_on_rails_pro/script/preinstall.js:6

The fallback to process.cwd() is unnecessary since __dirname is always defined in regular Node.js scripts.

  1. Error handling could be more specific
    File: react_on_rails_pro/script/preinstall.js:28-30

The generic error catch makes debugging harder. Consider adding more specific error information including the error message and code.


Testing Concerns

Issue: The PR checklist shows test coverage is not complete.

Recommendation: Consider adding tests for:

  • Script behavior when run inside node_modules (should skip)
  • Script behavior when run outside node_modules (should execute commands)
  • Script behavior when yarn or yalc are not available (should gracefully exit)

Security Considerations

No security concerns identified. The script:

  • Only runs commands specified in the codebase
  • Does not accept external input
  • Uses synchronous spawning (no shell injection risk)
  • Has proper error boundaries

Performance Considerations

Performance impact is minimal:

  • Script runs only during yarn install
  • Uses synchronous operations (appropriate for install scripts)
  • Early exit for node_modules case minimizes overhead

Additional Recommendations

  1. Add execute permissions: Run chmod +x react_on_rails_pro/script/preinstall.js

  2. Documentation: Consider updating the CONTRIBUTING.md to mention this change for users who might add this as a Git dependency.

  3. Linting: Before committing, ensure you run bundle exec rubocop and rake autofix


Must Fix Before Merge

  • CRITICAL: Add trailing newline to preinstall.js
  • IMPORTANT: Run bundle exec rubocop and fix any violations
  • RECOMMENDED: Improve node_modules detection logic

Overall Assessment

This is a well-intentioned change that solves a real problem (Git dependency support). The code structure is clean and the approach is sound. However, there are critical formatting issues that will cause CI to fail, and some edge cases in the detection logic that should be addressed.

Recommendation: Request changes to fix the critical formatting issue and improve the path detection logic before merging.


Review generated by Claude Code following repository conventions from CLAUDE.md

@alexeyr-ci2 alexeyr-ci2 force-pushed the alexeyr/fix-prepare-script branch from 1b62ceb to 8d54e33 Compare October 22, 2025 13:17
@claude
Copy link

claude bot commented Oct 22, 2025

Code Review: PR #1873

This PR successfully enables Git dependency support by refactoring the preinstall script. Overall assessment: Approve with minor suggestions

Strengths

  1. Excellent architecture: Moving from inline shell commands to a dedicated Node.js script improves maintainability and cross-platform compatibility
  2. Smart detection logic: The inNodeModules check elegantly skips link steps when installed as a dependency
  3. Graceful error handling: Optional dev tooling failures don't break production installs
  4. Comprehensive documentation: CONTRIBUTING.md now clearly documents all three testing methods (local, Git, tarball)

Issues & Recommendations

Minor: Node Modules Detection Edge Case

Location: preinstall.js:7

The check could produce false positives if 'node_modules' appears anywhere in the directory path. Consider using a more robust check that verifies node_modules is a direct parent directory.

Severity: Low

Minor: Redundant Fallback

Location: preinstall.js:6

The fallback to process.cwd() is unnecessary since __dirname is always defined in CommonJS modules.

Severity: Very Low

Code Style: Exception Control Flow

Location: preinstall.js:14-18, 26-31

The runCommand function throws errors which are then caught and ignored. Consider refactoring to return status objects instead.

Severity: Low (stylistic preference)

Security & Performance

  • Security: No concerns identified. Proper use of spawnSync with explicit arguments prevents shell injection
  • Performance: Appropriate for install scripts. Early exit avoids unnecessary work

CLAUDE.md Compliance

Before merging, verify:

  1. CRITICAL: preinstall.js file ends with a newline character (will cause CI failure if missing)
  2. IMPORTANT: Run rake autofix to ensure Prettier formatting
  3. IMPORTANT: Run bundle exec rubocop and fix any violations
  4. RECOMMENDED: Add manual testing notes to PR description

Impact Assessment

  • Breaking changes: None
  • Backward compatibility: Fully maintained
  • Risk level: Low

Great work on improving the Git dependency support!


Review by Claude Code following CLAUDE.md conventions

@claude
Copy link

claude bot commented Oct 23, 2025

Pull Request Review: Update preinstall script to enable use as a Git dependency

Summary

This PR successfully enables React on Rails packages to be installed as Git dependencies, which is valuable for development and testing. The changes are well-documented and the implementation is thoughtful.

Code Quality & Best Practices

Strengths ✅

  1. Excellent Documentation: The CONTRIBUTING.md updates are comprehensive and well-structured:

    • Clear separation of local, Git, and tarball dependency methods
    • Specific examples for different package managers (Yarn Berry, PNPM, NPM)
    • Practical examples that maintainers and contributors can follow
  2. Smart Environment Detection: The preinstall.js script correctly detects whether it's running inside node_modules to avoid unnecessary operations:

    const inNodeModules = dir.split(path.sep).includes('node_modules');
  3. Cross-Platform Compatibility: Uses Node.js built-in modules (path, child_process) ensuring it works across Windows, macOS, and Linux.

  4. Graceful Degradation: The try-catch block with informative error logging ensures installations don't fail when optional link steps aren't available:

    catch (err) {
      console.error('preinstall: optional link steps failed or are unavailable — continuing.', err);
      process.exit(0);
    }
  5. CHANGELOG Compliance: Properly documented in CHANGELOG.md with PR reference and attribution.

Areas for Improvement 🔍

  1. Error Handling Specificity: The current error handling treats all failures the same way. Consider differentiating between:

    • Commands not found (expected in Git dependencies)
    • Actual execution failures (might need user attention)

    Suggestion:

    catch (err) {
      if (err.code === 'ENOENT') {
        console.log('preinstall: yalc not found — skipping local development setup (this is normal for Git dependencies).');
      } else {
        console.error('preinstall: optional link steps failed:', err.message);
      }
      process.exit(0);
    }
  2. Minor Documentation Inconsistency:

    • CONTRIBUTING.md line 130 references port http://localhost:3000/
    • Previous content (line 125 from original) referenced http://localhost:5000/
    • Verify which port is actually used by the dummy app

Potential Bugs or Issues

Medium Priority

  1. Race Condition Potential: The sequential runCommand calls could fail if the first command modifies the file system in a way that affects the second:

    runCommand('yarn', ['run', 'link-source']);  // publishes to yalc
    runCommand('yalc', ['add', '--link', 'react-on-rails']);  // consumes from yalc

    While unlikely to cause issues, consider adding a small delay or checking for completion.

  2. Undefined __dirname in ES Modules: If this package ever migrates to ES modules, __dirname won't be available. Consider future-proofing:

    const dir = __dirname || process.cwd();

    Actually, this is already handled! Good defensive programming.

Performance Considerations

  1. Unnecessary Work Avoided: ✅ The inNodeModules check prevents running expensive yalc operations when installed as a dependency.

  2. Subprocess Overhead: The two runCommand calls spawn separate processes. This is acceptable given they only run during local development setup.

Security Concerns

Low Risk ✅

  1. No User Input: The script doesn't accept user input, reducing injection attack surface.
  2. Fixed Command Arguments: All command arguments are hardcoded arrays, preventing shell injection.
  3. Standard Node.js APIs: Uses only built-in Node modules, no third-party dependencies.

Recommendations

  1. Validate Command Existence: Consider checking if commands exist before execution to provide better error messages:
    function commandExists(cmd) {
      try {
        cp.execSync(`which ${cmd}`, { stdio: 'ignore' });
        return true;
      } catch {
        return false;
      }
    }

Test Coverage

Concerns ⚠️

  1. No Automated Tests: The PR checklist shows:

    • Add/update test to cover these changes ❌

    Recommendation: Add integration tests that:

    • Verify the script runs successfully in node_modules
    • Verify the script skips operations when inside node_modules
    • Test error handling paths
    • Validate Git dependency installation works end-to-end
  2. Manual Testing Needed: The changes should be manually tested:

    • Install from Git using Yarn Berry, PNPM (if possible), and as a tarball
    • Verify the Pro Node renderer works correctly when installed as a Git dependency
    • Test on Windows, macOS, and Linux

Additional Observations

  1. Package Manager Coverage: The documentation now covers Yarn Berry and PNPM but correctly notes NPM's lack of support for Git subdirectory dependencies. This is accurate and helpful.

  2. Consistency with Project Standards:

    • ✅ File ends with newline
    • ✅ Uses single quotes consistently
    • ✅ Follows existing code style
    • ⚠️ Should run bundle exec rubocop to verify no Ruby violations

Recommendations Summary

Must Do (Before Merge)

  1. Verify the port number discrepancy in documentation (5000 vs 3000)
  2. Run bundle exec rubocop to ensure Ruby code passes linting

Should Do (Before or After Merge)

  1. Add integration tests for the preinstall script
  2. Manually test Git dependency installation across platforms
  3. Consider improving error message specificity

Nice to Have (Future Enhancement)

  1. Add command existence checks for better error messages
  2. Consider adding a small test app in CI that installs from Git to catch regressions

Conclusion

This is a high-quality PR that solves a real problem and is well-documented. The code is clean, cross-platform, and follows good defensive programming practices. The main gap is test coverage, which should be addressed either before or shortly after merge.

Recommendation: Approve with minor suggestions. The lack of automated tests is the only significant concern, but given the scope and the quality of the implementation, this can be addressed in a follow-up.


Review generated by Claude Code

@alexeyr-ci2 alexeyr-ci2 force-pushed the alexeyr/fix-prepare-script branch from 8d54e33 to b21f860 Compare October 24, 2025 10:18
@alexeyr-ci2 alexeyr-ci2 force-pushed the alexeyr/fix-prepare-script branch from b21f860 to 6a040ee Compare October 24, 2025 10:21
@alexeyr-ci2 alexeyr-ci2 marked this pull request as ready for review October 24, 2025 12:01
@alexeyr-ci2
Copy link
Collaborator Author

A better long-term solution is to make react_on_rails_pro just another package in the workspace like packages/react-on-rails and packages/react-on-rails-pro, then the preinstall script can be removed.

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