Skip to content

Commit 4b94aba

Browse files
Update script/convert for workspace structure
- Update Jest command modification to target workspace package.json - Add workspace package peerDependencies React version updates - Add clarifying comment about dev dependencies location - Ensures convert script works correctly with Phase 3 workspace structure 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent ef7c6e6 commit 4b94aba

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

script/convert

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ gsub_file_content("../Gemfile.development_dependencies", /gem "shakapacker", "[^
2222
gsub_file_content("../spec/dummy/package.json", /"shakapacker": "[^"]*",/, '"shakapacker": "8.2.0",')
2323

2424
# The below packages don't work on the oldest supported Node version and aren't needed there anyway
25+
# Note: All dev dependencies remain in root package.json even after workspace migration
2526
gsub_file_content("../package.json", /"[^"]*eslint[^"]*": "[^"]*",?/, "")
2627
gsub_file_content("../package.json", /"globals": "[^"]*",/, "")
2728
gsub_file_content("../package.json", /"knip": "[^"]*",/, "")
@@ -37,10 +38,14 @@ gsub_file_content("../package.json", /"react": "[^"]*",/, '"react": "18.0.0",')
3738
gsub_file_content("../package.json", /"react-dom": "[^"]*",/, '"react-dom": "18.0.0",')
3839
gsub_file_content("../spec/dummy/package.json", /"react": "[^"]*",/, '"react": "18.0.0",')
3940
gsub_file_content("../spec/dummy/package.json", /"react-dom": "[^"]*",/, '"react-dom": "18.0.0",')
41+
# Update workspace package peerDependencies for minimum React version
42+
gsub_file_content("../packages/react-on-rails/package.json", /"react": ">= 16",/, '"react": ">= 18",')
43+
gsub_file_content("../packages/react-on-rails/package.json", /"react-dom": ">= 16",/, '"react-dom": ">= 18",')
44+
# Update workspace package jest command for minimum Node version support
4045
gsub_file_content(
41-
"../package.json",
42-
"jest node_package/tests",
43-
'jest node_package/tests --testPathIgnorePatterns=\".*(RSC|stream|' \
46+
"../packages/react-on-rails/package.json",
47+
"cd ../.. && jest node_package/tests",
48+
'cd ../.. && jest node_package/tests --testPathIgnorePatterns=\".*(RSC|stream|' \
4449
'registerServerComponent|serverRenderReactComponent|SuspenseHydration).*\"'
4550
)
4651
# Keep modern JSX transform for React 18+

0 commit comments

Comments
 (0)