Skip to content

Update conductor-setup.sh to use pnpm#2212

Merged
justin808 merged 1 commit intomasterfrom
jg/workspace-setup
Dec 12, 2025
Merged

Update conductor-setup.sh to use pnpm#2212
justin808 merged 1 commit intomasterfrom
jg/workspace-setup

Conversation

@justin808
Copy link
Copy Markdown
Member

@justin808 justin808 commented Dec 12, 2025

Summary

Updated the Conductor workspace setup script to use pnpm instead of yarn. This project uses pnpm as its package manager (configured via corepack), so the setup script now enables corepack and uses pnpm for all JavaScript package operations to match the actual project configuration.

Pull Request checklist

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

Not applicable for this infrastructure change.

Summary by CodeRabbit

  • Chores
    • Migrated JavaScript package manager from Yarn to pnpm for improved dependency management.
    • Enabled corepack support to streamline pnpm usage in the development workflow.

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

This project uses pnpm as its package manager (via corepack). Updated the setup
script to enable corepack and use pnpm for all JS package operations to match
the project's actual configuration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Haiku 4.5 <[email protected]>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 12, 2025

Walkthrough

The pull request migrates the JavaScript build toolchain in conductor-setup.sh from Yarn to pnpm. This includes removing the Yarn dependency check, enabling corepack for pnpm, and replacing all Yarn commands with their pnpm equivalents (install, build, type-check, test). Ruby-related steps remain unchanged.

Changes

Cohort / File(s) Summary
Package manager migration
conductor-setup.sh
Removed Yarn dependency check; enabled corepack for pnpm; replaced yarn install, yarn run build, yarn run type-check, and yarn run test with pnpm equivalents; updated messaging from Yarn to pnpm

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Single file with straightforward, repetitive tool replacement
  • Consistent find-and-replace pattern (Yarn → pnpm commands)
  • No complex logic changes or control flow modifications

Possibly related issues

Suggested labels

review-needed

Suggested reviewers

  • AbanoubGhadban

Poem

🐰 Hop, hop, hooray!
Pnpm now takes the stage,
Corepack enables the way—
Faster builds, lighter page!
No more Yarn to delay,
Just pnpm's modern age!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: updating the conductor-setup.sh script to use pnpm instead of yarn, which aligns with the primary objective of the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 jg/workspace-setup

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.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Dec 12, 2025

Code Review for PR #2212: Update conductor-setup.sh to use pnpm

✅ Overall Assessment

This is a clean, focused infrastructure update that correctly aligns the Conductor workspace setup script with the project's actual package manager configuration. The changes are well-executed and consistent.


🎯 Strengths

  1. Correctly aligns with project configuration: The project explicitly uses [email protected] via the packageManager field in package.json, so this change is necessary and correct.

  2. Proper use of corepack: Adding corepack enable is the right approach for ensuring pnpm is available, as corepack is included with Node.js 16.9+ and manages package manager versions automatically.

  3. Complete migration: All yarn references have been replaced:

    • ✅ Removed yarn from required tools check
    • ✅ Updated yarn installpnpm install
    • ✅ Updated yarn run buildpnpm run build
    • ✅ Updated yarn run type-checkpnpm run type-check
    • ✅ Updated help text to reference pnpm commands
  4. Good error handling: The || echo pattern for non-critical failures is preserved.

  5. Executable permissions preserved: The script remains executable (-rwxr-xr-x).


💡 Observations

  1. corepack availability: The script assumes corepack is available. This is a safe assumption since:

    • Node.js 16.9+ includes corepack by default
    • The script already validates Node.js >= 20.0.0 (line 34)
    • However, corepack might be disabled by default on some systems
  2. Error handling for corepack: Currently, if corepack enable fails, the script will exit due to set -e. This is probably fine for a setup script, but you might want to make it more defensive.


🔍 Potential Improvements (Optional)

1. Add error handling for corepack

# Enable corepack for pnpm (this project uses pnpm, not yarn)
echo "📦 Enabling corepack for pnpm..."
if \! command -v corepack >/dev/null 2>&1; then
    echo "⚠️ Warning: corepack not found. Attempting to enable..."
fi
corepack enable || { echo "❌ Error: Could not enable corepack. Please enable it manually with 'corepack enable'"; exit 1; }

2. Verify pnpm is available after enabling corepack

# Verify pnpm is available
if \! command -v pnpm >/dev/null 2>&1; then
    echo "❌ Error: pnpm is not available after enabling corepack."
    echo "   Please ensure Node.js >= 16.9 is installed (found: v$NODE_VERSION)"
    exit 1
fi
echo "✅ pnpm is available"

However, these are optional enhancements and not blockers. The current implementation should work fine for the target environment.


✅ Code Quality Checklist

  • Consistency: All yarn references replaced with pnpm
  • Documentation: Help text updated to reflect new commands
  • Best practices: Uses corepack (the official Node.js package manager manager)
  • No breaking changes: The script will work identically, just with the correct package manager
  • Security: No security concerns (infrastructure script only)
  • Performance: No performance impact
  • Testing: Not applicable for infrastructure script

📋 CLAUDE.md Compliance

Per the project's CLAUDE.md guidelines:

  • ✅ This is an infrastructure change, so tests/changelog are not required
  • ✅ No linting needed (bash script, not Ruby/JS)
  • ✅ No formatting issues (shell script doesn't use prettier)

🚀 Recommendation

APPROVE - This PR is ready to merge. The changes are correct, complete, and align with the project's actual configuration.

The optional improvements suggested above could be added in a follow-up PR if desired, but they're not necessary for this change to be effective.

Great work ensuring consistency between the project's declared package manager and its setup scripts!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
conductor-setup.sh (2)

56-59: Make corepack/pnpm activation deterministic (and fail with clearer messaging).
corepack enable doesn’t guarantee the expected pnpm version is activated on all machines; consider corepack prepare pnpm@<version> --activate (ideally sourced from package.json#packageManager) and add a small guard that pnpm is now available.

 # Enable corepack for pnpm (this project uses pnpm, not yarn)
 echo "📦 Enabling corepack for pnpm..."
-corepack enable
+command -v corepack >/dev/null 2>&1 || { echo "❌ Error: corepack is not available (check your Node.js install)."; exit 1; }
+corepack enable
+# Optional but more deterministic if package.json pins pnpm via "packageManager"
+# corepack prepare pnpm@<your_version> --activate
+command -v pnpm >/dev/null 2>&1 || { echo "❌ Error: pnpm not found after enabling corepack."; exit 1; }

62-62: Consider pnpm install --frozen-lockfile for reproducible workspace setup.
If this script is meant to produce consistent installs across machines/CI-like environments, --frozen-lockfile (or --prefer-frozen-lockfile) helps catch drift early.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 917f6f2 and e52e5d5.

📒 Files selected for processing (1)
  • conductor-setup.sh (2 hunks)
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T09:27:45.105Z
Learning: Applies to /CHANGELOG.md : Update `/CHANGELOG.md` for open-source features, bug fixes, breaking changes, deprecations, and performance improvements using format: `[PR 1818](https://github.com/shakacode/react_on_rails/pull/1818) by [username](https://github.com/username)`
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T09:27:45.105Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Only use `pnpm` as the JavaScript package manager, never use `npm` or `yarn`
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T09:27:45.105Z
Learning: Applies to package.json,pnpm-lock.yaml : Test build scripts after modifying package.json or dependencies: run `pnpm run prepack` and `pnpm run yalc.publish` to verify build pipeline
📚 Learning: 2025-12-10T09:27:45.105Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T09:27:45.105Z
Learning: Applies to package.json,pnpm-lock.yaml : Test build scripts after modifying package.json or dependencies: run `pnpm run prepack` and `pnpm run yalc.publish` to verify build pipeline

Applied to files:

  • conductor-setup.sh
📚 Learning: 2025-12-10T09:27:45.105Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T09:27:45.105Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Only use `pnpm` as the JavaScript package manager, never use `npm` or `yarn`

Applied to files:

  • conductor-setup.sh
📚 Learning: 2025-01-23T18:20:45.824Z
Learnt from: alexeyr-ci
Repo: shakacode/react_on_rails PR: 1687
File: spec/dummy/package.json:0-0
Timestamp: 2025-01-23T18:20:45.824Z
Learning: When adding or updating dependencies in spec/dummy/package.json, maintain version consistency with other package.json files in the codebase to avoid potential version conflicts.

Applied to files:

  • conductor-setup.sh
📚 Learning: 2025-09-29T14:45:42.687Z
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1833
File: lib/react_on_rails/dev/process_manager.rb:72-83
Timestamp: 2025-09-29T14:45:42.687Z
Learning: In Ruby bundler contexts, when bundler intercepts system commands for executables not in the Gemfile, both version checks (like `system("foreman", "--version")`) and execution commands (like `system("foreman", "start", ...)`) fail equally, both returning false. This means availability checks using version flags accurately reflect whether execution commands will work in the current bundler context.

Applied to files:

  • conductor-setup.sh
📚 Learning: 2025-12-10T09:27:45.105Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T09:27:45.105Z
Learning: Applies to **/*.{rb,js,ts,jsx,tsx,json,yml,yaml,md} : ALWAYS run `bundle exec rubocop` and fix ALL violations before every commit/push

Applied to files:

  • conductor-setup.sh
📚 Learning: 2025-12-10T09:27:45.105Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T09:27:45.105Z
Learning: Applies to spec/dummy/**/*.{spec,test}.{js,ts} : Playwright E2E tests use `cypress-on-rails` gem for Rails integration; use helpers like `app('clean')`, `appEval()`, and `appFactories()` for test setup instead of UI automation

Applied to files:

  • conductor-setup.sh
📚 Learning: 2025-12-10T09:27:45.105Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T09:27:45.105Z
Learning: Applies to spec/dummy/e2e/playwright/app_commands/**/*.rb : Create custom app commands for Playwright E2E tests in this directory using the `command` syntax provided by `cypress-on-rails` gem

Applied to files:

  • conductor-setup.sh
⏰ 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). (9)
  • GitHub Check: build-dummy-app-webpack-test-bundles (3.4, 22, latest)
  • GitHub Check: rspec-package-tests (3.4, latest)
  • GitHub Check: examples (3.4, latest)
  • GitHub Check: pro-lint-js-and-ruby
  • GitHub Check: build-dummy-app-webpack-test-bundles
  • GitHub Check: precompile-check
  • GitHub Check: build
  • GitHub Check: build-dummy-app-webpack-test-bundles
  • GitHub Check: claude-review
🔇 Additional comments (2)
conductor-setup.sh (2)

66-66: Good migration to pnpm commands; ensure script behavior matches “setup” intent.
pnpm run build and pnpm run type-check || ... look consistent with a developer-setup flow (non-fatal type-check). Just verify the repo’s scripts are named exactly build and type-check in the relevant package.json(s).

Also applies to: 79-80


86-87: Help text updated correctly to pnpm.
This aligns with repo guidance to avoid yarn. (Based on learnings, only use pnpm.)

@justin808 justin808 merged commit b47d102 into master Dec 12, 2025
27 checks passed
@justin808 justin808 deleted the jg/workspace-setup branch December 12, 2025 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant