Skip to content

Commit 25e4639

Browse files
Keep workspace:* protocol in react-on-rails-pro package.json (#2177)
## Summary - Removes unnecessary manual conversion of `workspace:*` to explicit version during release - Restores `workspace:*` in `packages/react-on-rails-pro/package.json` Fixes #2176 ## Details The release script (`rakelib/release.rake`) was manually converting `workspace:*` to an explicit version in `packages/react-on-rails-pro/package.json` during release. This is **unnecessary** because pnpm automatically handles this conversion during `pnpm publish`. ### How pnpm handles workspace:* When running `pnpm pack` or `pnpm publish`, pnpm dynamically replaces `workspace:*` with the corresponding version. This is documented behavior: https://pnpm.io/workspaces ### Verified locally ```bash # 1. Set dependency to workspace:* # 2. Run pnpm pack # 3. Extract tarball's package.json # Result: "react-on-rails": "16.2.0-beta.13" (exact version) ``` ### Benefits - **Cleaner development experience** - Developers see `workspace:*` indicating a workspace dependency - **No spurious git changes** - The dependency line won't change on every release - **pnpm best practice** - Let the tool handle what it's designed for - **Simpler release script** - Less code to maintain ## Test plan - [x] Verified `pnpm pack` converts `workspace:*` to exact version in tarball - [x] Confirmed published package.json in tarball has correct version 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Simplified dependency management and release process for internal packages by streamlining version handling during builds. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude <noreply@anthropic.com>
1 parent b3d0430 commit 25e4639

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

packages/react-on-rails-pro/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"./ServerComponentFetchError": "./lib/ServerComponentFetchError.js"
5656
},
5757
"dependencies": {
58-
"react-on-rails": "16.2.0-beta.13"
58+
"react-on-rails": "workspace:*"
5959
},
6060
"peerDependencies": {
6161
"react": ">= 16",

rakelib/release.rake

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,8 @@ task :release, %i[version dry_run registry skip_push] do |_t, args|
196196
package_json_files.each do |file|
197197
content = JSON.parse(File.read(file))
198198
content["version"] = actual_npm_version
199-
200-
# For react-on-rails-pro package, also update the react-on-rails dependency to exact version
201-
if content["name"] == "react-on-rails-pro"
202-
content["dependencies"] ||= {}
203-
content["dependencies"]["react-on-rails"] = actual_npm_version
204-
end
199+
# Note: workspace:* dependencies (e.g., in react-on-rails-pro) are automatically
200+
# converted to exact versions by pnpm during publish. No manual conversion needed.
205201

206202
File.write(file, "#{JSON.pretty_generate(content)}\n")
207203
puts " Updated #{file}"
@@ -340,7 +336,7 @@ task :release, %i[version dry_run registry skip_push] do |_t, args|
340336
puts " - react_on_rails_pro/lib/react_on_rails_pro/version.rb"
341337
puts " - package.json (root)"
342338
puts " - packages/react-on-rails/package.json"
343-
puts " - packages/react-on-rails-pro/package.json (version + dependency)"
339+
puts " - packages/react-on-rails-pro/package.json (version only; workspace:* converted by pnpm)"
344340
puts " - packages/react-on-rails-pro-node-renderer/package.json"
345341
puts " - Gemfile.lock files (root, dummy apps, pro)"
346342
puts "\nAuto-synced (no write needed):"

0 commit comments

Comments
 (0)