Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7745727
Phase 3: Prepare core package for workspace structure
AbanoubGhadban Sep 26, 2025
ce91f23
Fix CI failures: Update Knip config and test imports for workspace st…
AbanoubGhadban Sep 26, 2025
0182224
Fix package.json workspace configuration for publishing
AbanoubGhadban Sep 26, 2025
6f08b49
Fix workspace configuration for publishing and CI
AbanoubGhadban Sep 26, 2025
385df7f
Fix Knip configuration to ignore build output directories
AbanoubGhadban Sep 28, 2025
4417277
Fix ESLint configuration for workspace package imports
AbanoubGhadban Sep 28, 2025
3b34f34
Fix Jest configuration for workspace and testing library setup
AbanoubGhadban Sep 28, 2025
5fd223e
Fix Jest setupFilesAfterEnv path resolution for CI
AbanoubGhadban Sep 28, 2025
ef7c6e6
Update Gemfile.lock and package.json for path corrections
AbanoubGhadban Sep 28, 2025
4b94aba
Update script/convert for workspace structure
AbanoubGhadban Sep 28, 2025
8cf9138
Remove setupFilesAfterEnv from Jest configuration and clean up conver…
AbanoubGhadban Sep 28, 2025
ee4487a
Update CircleCI configuration to enhance caching strategy for node_mo…
AbanoubGhadban Sep 28, 2025
5eb784f
Update package.json to simplify link-source script by removing redund…
AbanoubGhadban Sep 28, 2025
a9e1e01
Update link-source script in package.json to target the correct direc…
AbanoubGhadban Sep 28, 2025
3250a03
Update build output path to workspace package directory
AbanoubGhadban Sep 28, 2025
660cab3
Complete workspace migration: move tests, scripts, and babel config
AbanoubGhadban Sep 28, 2025
eab8e2a
Refactor package.json scripts to utilize workspaces for improved comm…
AbanoubGhadban Sep 28, 2025
c1c6b45
Enhance package.json scripts for improved workspace management
AbanoubGhadban Sep 28, 2025
b34e161
Rename package to react-on-rails-workspace and streamline scripts in …
AbanoubGhadban Sep 28, 2025
946698d
Update CircleCI configuration to streamline caching for node_modules …
AbanoubGhadban Sep 28, 2025
a784eb6
Update Knip configuration and package.json scripts for improved path …
AbanoubGhadban Sep 28, 2025
87fe9cc
Revert unnecessary file extension changes
AbanoubGhadban Sep 29, 2025
3e992bc
Add global Jest configuration and refactor Knip settings
AbanoubGhadban Sep 29, 2025
20f2f0b
Update ESLint configuration to reflect new package structure
AbanoubGhadban Sep 29, 2025
dfc1275
Update configuration files to reflect package structure changes
AbanoubGhadban Sep 29, 2025
caf8d34
Update MONOREPO_MERGER_PLAN.md to reflect co-located test structure
AbanoubGhadban Sep 29, 2025
325e4e8
Update documentation and references to reflect new package structure
AbanoubGhadban Sep 29, 2025
e0d1365
Update test command in convert script for improved execution
AbanoubGhadban Sep 29, 2025
fd728b3
Update Knip configuration and package.json scripts for improved execu…
AbanoubGhadban Sep 29, 2025
0a97c1e
Update test command in package.json for improved execution
AbanoubGhadban Sep 29, 2025
86e0ab6
Update DIRECTORY_LICENSING.md to reflect new directory structure
AbanoubGhadban Sep 29, 2025
ceb15a6
Update DIRECTORY_LICENSING.md to reflect new directory structure and …
AbanoubGhadban Sep 29, 2025
4331ea1
Update CONTRIBUTING.md to correct link formatting
AbanoubGhadban Sep 29, 2025
40ccdb2
Update MONOREPO_MERGER_PLAN.md to specify new build output locations …
AbanoubGhadban Sep 29, 2025
c9c406f
Update MONOREPO_MERGER_PLAN.md and MONOREPO_MERGER_PLAN_REF.md to ref…
AbanoubGhadban Sep 29, 2025
804a88d
Update MONOREPO_MERGER_PLAN.md and MONOREPO_MERGER_PLAN_REF.md to ref…
AbanoubGhadban Sep 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint-js-and-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
yarn install --no-progress --no-emoji --frozen-lockfile
sudo yarn global add yalc
- name: yalc publish for react-on-rails
run: yalc publish
run: cd packages/react-on-rails && yalc publish
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Build before yalc publish to ensure lib exists

The workflow publishes via yalc without building first. Insert a build step before publishing.

-      - name: yalc publish for react-on-rails
-        run: cd packages/react-on-rails && yalc publish
+      - name: Build package
+        run: yarn workspace react-on-rails build
+      - name: yalc publish for react-on-rails
+        run: cd packages/react-on-rails && yalc publish
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
run: cd packages/react-on-rails && yalc publish
- name: Build package
run: yarn workspace react-on-rails build
- name: yalc publish for react-on-rails
run: cd packages/react-on-rails && yalc publish
πŸ€– Prompt for AI Agents
.github/workflows/lint-js-and-ruby.yml around line 48: the workflow calls "cd
packages/react-on-rails && yalc publish" without building the package first;
update the job to run the package's build script before publishing (e.g., "cd
packages/react-on-rails && yarn install && yarn build" or the equivalent
npm/pnpm commands), ensuring the lib/dist output exists before invoking "yalc
publish".

- name: yalc add react-on-rails
run: cd spec/dummy && yalc add react-on-rails
- name: Install Node modules with Yarn for dummy app
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
sudo yarn global add yalc
- name: yalc publish for react-on-rails
run: yalc publish
run: cd packages/react-on-rails && yalc publish
- name: yalc add react-on-rails
run: cd spec/dummy && yalc add react-on-rails
- name: Install Node modules with Yarn for dummy app
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:
yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
sudo yarn global add yalc
- name: yalc publish for react-on-rails
run: yalc publish
run: cd packages/react-on-rails && yalc publish
- name: yalc add react-on-rails
run: cd spec/dummy && yalc add react-on-rails
- name: Install Node modules with Yarn for dummy app
Expand Down
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This repository contains code under two different licenses:
The following directories and all their contents are licensed under the **MIT License** (see full text below):

- `lib/react_on_rails/` (excluding `lib/react_on_rails/pro/`)
- `node_package/src/` (excluding `node_package/src/pro/`)
- `packages/react-on-rails/` (excluding `packages/react-on-rails/src/pro/`)
- `node_package/lib/` (excluding `node_package/lib/pro/`)
- All other directories in this repository not explicitly listed as Pro-licensed

Expand All @@ -21,7 +21,7 @@ The following directories and all their contents are licensed under the **MIT Li
The following directories and all their contents are licensed under the **React on Rails Pro License**:

- `lib/react_on_rails/pro/`
- `node_package/src/pro/`
- `packages/react-on-rails/src/pro/`
- `node_package/lib/pro/`
- `react_on_rails_pro/` (entire directory)

Expand Down
60 changes: 11 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
{
"name": "react-on-rails",
"name": "react-on-rails-monorepo",
"version": "16.1.1",
"description": "react-on-rails JavaScript for react_on_rails Ruby gem",
"main": "node_package/lib/ReactOnRails.full.js",
"type": "module",
"exports": {
".": {
"react-server": "./node_package/lib/pro/ReactOnRailsRSC.js",
"node": "./node_package/lib/ReactOnRails.node.js",
"default": "./node_package/lib/ReactOnRails.full.js"
},
"./client": "./node_package/lib/ReactOnRails.client.js",
"./registerServerComponent/client": "./node_package/lib/pro/registerServerComponent/client.js",
"./registerServerComponent/server": {
"react-server": "./node_package/lib/pro/registerServerComponent/server.rsc.js",
"default": "./node_package/lib/pro/registerServerComponent/server.js"
},
"./wrapServerComponentRenderer/client": "./node_package/lib/pro/wrapServerComponentRenderer/client.js",
"./wrapServerComponentRenderer/server": {
"react-server": "./node_package/lib/pro/wrapServerComponentRenderer/server.rsc.js",
"default": "./node_package/lib/pro/wrapServerComponentRenderer/server.js"
},
"./RSCRoute": "./node_package/lib/pro/RSCRoute.js",
"./RSCProvider": "./node_package/lib/pro/RSCProvider.js",
"./ServerComponentFetchError": "./node_package/lib/pro/ServerComponentFetchError.js"
},
"description": "React on Rails monorepo workspace manager",
"private": true,
"workspaces": [
"packages/react-on-rails"
],
"directories": {
"doc": "docs"
},
Expand Down Expand Up @@ -75,34 +56,15 @@
"typescript": "^5.8.3",
"typescript-eslint": "^8.35.0"
},
"peerDependencies": {
"react": ">= 16",
"react-dom": ">= 16",
"react-on-rails-rsc": "19.0.2"
},
"peerDependenciesMeta": {
"react-on-rails-rsc": {
"optional": true
}
},
"files": [
"node_package/lib"
],
"scripts": {
"test": "jest node_package/tests",
"clean": "rm -rf node_package/lib",
"test": "yarn workspace react-on-rails test",
"clean": "yarn workspace react-on-rails clean",
"start": "nps",
"prepack": "nps build.prepack",
"prepare": "nps build.prepack",
"prepublishOnly": "yarn run build",
"build": "yarn run clean && yarn run tsc --declaration",
"build-watch": "yarn run clean && yarn run tsc --watch",
"build": "yarn workspace react-on-rails build",
"build-watch": "yarn workspace react-on-rails build-watch",
"lint": "nps eslint",
"check": "yarn run lint && yarn run test && yarn run type-check",
"type-check": "yarn run tsc --noEmit --noErrorTruncation",
"release:patch": "node_package/scripts/release patch",
"release:minor": "node_package/scripts/release minor",
"release:major": "node_package/scripts/release major",
"type-check": "yarn workspace react-on-rails type-check",
"postinstall": "test -f .lefthook.yml && test -d .git && command -v bundle >/dev/null 2>&1 && bundle exec lefthook install || true"
},
"repository": {
Expand Down
66 changes: 66 additions & 0 deletions packages/react-on-rails/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "react-on-rails",
"version": "16.1.1",
"description": "react-on-rails JavaScript for react_on_rails Ruby gem",
"main": "../../node_package/lib/ReactOnRails.full.js",
"type": "module",
"exports": {
".": {
"react-server": "../../node_package/lib/pro/ReactOnRailsRSC.js",
"node": "../../node_package/lib/ReactOnRails.node.js",
"default": "../../node_package/lib/ReactOnRails.full.js"
},
"./client": "../../node_package/lib/ReactOnRails.client.js",
"./registerServerComponent/client": "../../node_package/lib/pro/registerServerComponent/client.js",
"./registerServerComponent/server": {
"react-server": "../../node_package/lib/pro/registerServerComponent/server.rsc.js",
"default": "../../node_package/lib/pro/registerServerComponent/server.js"
},
"./wrapServerComponentRenderer/client": "../../node_package/lib/pro/wrapServerComponentRenderer/client.js",
"./wrapServerComponentRenderer/server": {
"react-server": "../../node_package/lib/pro/wrapServerComponentRenderer/server.rsc.js",
"default": "../../node_package/lib/pro/wrapServerComponentRenderer/server.js"
},
"./RSCRoute": "../../node_package/lib/pro/RSCRoute.js",
"./RSCProvider": "../../node_package/lib/pro/RSCProvider.js",
"./ServerComponentFetchError": "../../node_package/lib/pro/ServerComponentFetchError.js"
},
"peerDependencies": {
"react": ">= 16",
"react-dom": ">= 16",
"react-on-rails-rsc": "19.0.2"
},
"peerDependenciesMeta": {
"react-on-rails-rsc": {
"optional": true
}
},
"files": [
"../../node_package/lib"
],
"scripts": {
"build": "yarn run clean && yarn run tsc --declaration",
"build-watch": "yarn run clean && yarn run tsc --watch",
"clean": "rm -rf ../../node_package/lib",
"test": "jest ../../node_package/tests",
"type-check": "yarn run tsc --noEmit --noErrorTruncation"
},
"repository": {
"type": "git",
"url": "git+https://github.com/shakacode/react_on_rails.git"
},
"keywords": [
"react",
"webpack",
"JavaScript",
"Ruby",
"on",
"Rails"
],
"author": "justin.gordon@gmail.com",
"license": "MIT",
"bugs": {
"url": "https://github.com/shakacode/react_on_rails/issues"
},
"homepage": "https://github.com/shakacode/react_on_rails#readme"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion react_on_rails_pro/spec/dummy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"test": "yarn run build:test && yarn run lint && rspec",
"lint": "cd ../.. && nps lint",
"preinstall": "yarn run link-source && yalc add --link react-on-rails && yalc add --link @shakacode-tools/react-on-rails-pro-node-renderer",
"link-source": "cd ../.. && yarn && yarn run nps build && yalc publish",
"link-source": "cd ../.. && yarn && yarn run nps build && cd packages/react-on-rails && yalc publish",
"postinstall": "test -f post-yarn-install.local && ./post-yarn-install.local || true",
"build:test": "rm -rf public/webpack/test && rm -rf ssr-generated && RAILS_ENV=test NODE_ENV=test bin/shakapacker",
"build:dev": "rm -rf public/webpack/development && rm -rf ssr-generated && RAILS_ENV=development NODE_ENV=development bin/shakapacker",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"scripts": {
"preinstall": "yarn run link-source && yalc add --link react-on-rails",
"link-source": "cd ../../.. && yarn && yalc publish"
"link-source": "cd ../../.. && yarn && cd packages/react-on-rails && yalc publish"
},
"devDependencies": {
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
},
"scripts": {
"preinstall": "yarn run link-source && yalc add --link react-on-rails",
"link-source": "cd ../.. && yarn run build && yalc publish",
"link-source": "cd ../.. && yarn run build && cd packages/react-on-rails && yalc publish",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Run root install before build to avoid broken preinstall

link-source no longer runs yarn at repo root. On fresh clones, yarn run build will fail due to missing dev deps. Restore yarn before the build.

-    "link-source": "cd ../.. && yarn run build && cd packages/react-on-rails && yalc publish",
+    "link-source": "cd ../.. && yarn && yarn run build && cd packages/react-on-rails && yalc publish",
πŸ€– Prompt for AI Agents
In spec/dummy/package.json around line 69, the "link-source" script runs "cd
../.. && yarn run build && cd packages/react-on-rails && yalc publish" but no
longer runs yarn at the repo root, causing builds on fresh clones to fail due to
missing dev dependencies; update the script to run yarn (or npm install) at the
repository root before running the build (e.g., insert "yarn" after "cd ../.."
so root dependencies are installed, then run the build and continue to
packages/react-on-rails and yalc publish).

"lint": "cd ../.. && yarn run lint",
"format": "cd ../.. && yarn run nps format",
"test:js": "yarn run jest ./tests",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"target": "es2020",
"typeRoots": ["./node_modules/@types", "./node_package/types"]
},
"include": ["node_package/src/**/*", "node_package/types/**/*"]
"include": ["packages/react-on-rails/src/**/*", "node_package/types/**/*"]
}
Loading