Skip to content

Commit 0182224

Browse files
Fix package.json workspace configuration for publishing
- Fixed root package.json to support both workspace management and publishing - Restored peerDependencies, files, and export fields to root package - Made workspace package private and simplified scripts - Tests pass and build successful 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent ce91f23 commit 0182224

File tree

2 files changed

+47
-41
lines changed

2 files changed

+47
-41
lines changed

package.json

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,49 @@
11
{
2-
"name": "react-on-rails-monorepo",
2+
"name": "react-on-rails",
33
"version": "16.1.1",
4-
"description": "React on Rails monorepo workspace manager",
5-
"private": true,
4+
"description": "react-on-rails JavaScript for react_on_rails Ruby gem",
5+
"main": "node_package/lib/ReactOnRails.full.js",
6+
"type": "module",
7+
"exports": {
8+
".": {
9+
"react-server": "./node_package/lib/pro/ReactOnRailsRSC.js",
10+
"node": "./node_package/lib/ReactOnRails.node.js",
11+
"default": "./node_package/lib/ReactOnRails.full.js"
12+
},
13+
"./client": "./node_package/lib/ReactOnRails.client.js",
14+
"./registerServerComponent/client": "./node_package/lib/pro/registerServerComponent/client.js",
15+
"./registerServerComponent/server": {
16+
"react-server": "./node_package/lib/pro/registerServerComponent/server.rsc.js",
17+
"default": "./node_package/lib/pro/registerServerComponent/server.js"
18+
},
19+
"./wrapServerComponentRenderer/client": "./node_package/lib/pro/wrapServerComponentRenderer/client.js",
20+
"./wrapServerComponentRenderer/server": {
21+
"react-server": "./node_package/lib/pro/wrapServerComponentRenderer/server.rsc.js",
22+
"default": "./node_package/lib/pro/wrapServerComponentRenderer/server.js"
23+
},
24+
"./RSCRoute": "./node_package/lib/pro/RSCRoute.js",
25+
"./RSCProvider": "./node_package/lib/pro/RSCProvider.js",
26+
"./ServerComponentFetchError": "./node_package/lib/pro/ServerComponentFetchError.js"
27+
},
628
"workspaces": [
729
"packages/react-on-rails"
830
],
931
"directories": {
1032
"doc": "docs"
1133
},
34+
"peerDependencies": {
35+
"react": ">= 16",
36+
"react-dom": ">= 16",
37+
"react-on-rails-rsc": "19.0.2"
38+
},
39+
"peerDependenciesMeta": {
40+
"react-on-rails-rsc": {
41+
"optional": true
42+
}
43+
},
44+
"files": [
45+
"node_package/lib"
46+
],
1247
"devDependencies": {
1348
"@arethetypeswrong/cli": "^0.17.4",
1449
"@babel/core": "^7.20.12",
@@ -60,11 +95,17 @@
6095
"test": "yarn workspace react-on-rails test",
6196
"clean": "yarn workspace react-on-rails clean",
6297
"start": "nps",
98+
"prepack": "nps build.prepack",
99+
"prepare": "nps build.prepack",
100+
"prepublishOnly": "yarn run build",
63101
"build": "yarn workspace react-on-rails build",
64102
"build-watch": "yarn workspace react-on-rails build-watch",
65103
"lint": "nps eslint",
66104
"check": "yarn run lint && yarn run test && yarn run type-check",
67105
"type-check": "yarn workspace react-on-rails type-check",
106+
"release:patch": "node_package/scripts/release patch",
107+
"release:minor": "node_package/scripts/release minor",
108+
"release:major": "node_package/scripts/release major",
68109
"postinstall": "test -f .lefthook.yml && test -d .git && command -v bundle >/dev/null 2>&1 && bundle exec lefthook install || true"
69110
},
70111
"repository": {

packages/react-on-rails/package.json

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,13 @@
11
{
22
"name": "react-on-rails",
33
"version": "16.1.1",
4-
"description": "react-on-rails JavaScript for react_on_rails Ruby gem",
5-
"main": "../../node_package/lib/ReactOnRails.full.js",
6-
"type": "module",
7-
"exports": {
8-
".": {
9-
"react-server": "../../node_package/lib/pro/ReactOnRailsRSC.js",
10-
"node": "../../node_package/lib/ReactOnRails.node.js",
11-
"default": "../../node_package/lib/ReactOnRails.full.js"
12-
},
13-
"./client": "../../node_package/lib/ReactOnRails.client.js",
14-
"./registerServerComponent/client": "../../node_package/lib/pro/registerServerComponent/client.js",
15-
"./registerServerComponent/server": {
16-
"react-server": "../../node_package/lib/pro/registerServerComponent/server.rsc.js",
17-
"default": "../../node_package/lib/pro/registerServerComponent/server.js"
18-
},
19-
"./wrapServerComponentRenderer/client": "../../node_package/lib/pro/wrapServerComponentRenderer/client.js",
20-
"./wrapServerComponentRenderer/server": {
21-
"react-server": "../../node_package/lib/pro/wrapServerComponentRenderer/server.rsc.js",
22-
"default": "../../node_package/lib/pro/wrapServerComponentRenderer/server.js"
23-
},
24-
"./RSCRoute": "../../node_package/lib/pro/RSCRoute.js",
25-
"./RSCProvider": "../../node_package/lib/pro/RSCProvider.js",
26-
"./ServerComponentFetchError": "../../node_package/lib/pro/ServerComponentFetchError.js"
27-
},
28-
"peerDependencies": {
29-
"react": ">= 16",
30-
"react-dom": ">= 16",
31-
"react-on-rails-rsc": "19.0.2"
32-
},
33-
"peerDependenciesMeta": {
34-
"react-on-rails-rsc": {
35-
"optional": true
36-
}
37-
},
38-
"files": [
39-
"../../node_package/lib"
40-
],
4+
"description": "react-on-rails workspace package - not for publishing",
5+
"private": true,
416
"scripts": {
427
"build": "yarn run clean && yarn run tsc --declaration",
438
"build-watch": "yarn run clean && yarn run tsc --watch",
449
"clean": "rm -rf ../../node_package/lib",
45-
"test": "jest ../../node_package/tests",
10+
"test": "cd ../.. && jest node_package/tests",
4611
"type-check": "yarn run tsc --noEmit --noErrorTruncation"
4712
},
4813
"repository": {

0 commit comments

Comments
 (0)