-
-
Notifications
You must be signed in to change notification settings - Fork 639
Phase 3: Prepare core package for workspace structure #1830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 29 commits
7745727
ce91f23
0182224
6f08b49
385df7f
4417277
3b34f34
5fd223e
ef7c6e6
4b94aba
8cf9138
ee4487a
5eb784f
a9e1e01
3250a03
660cab3
eab8e2a
c1c6b45
b34e161
946698d
a784eb6
87fe9cc
3e992bc
20f2f0b
dfc1275
caf8d34
325e4e8
e0d1365
fd728b3
0a97c1e
86e0ab6
ceb15a6
4331ea1
40ccdb2
c9c406f
804a88d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ tmp/ | |
|
|
||
| node_modules | ||
|
|
||
| /node_package/lib | ||
| /packages/*/lib | ||
|
|
||
| yarn-debug.* | ||
| yarn-error.* | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,7 +6,7 @@ tmp/ | |||||||
| coverage/ | ||||||||
| **/app/assets/webpack/ | ||||||||
| gen-examples/examples/* | ||||||||
| node_package/lib/* | ||||||||
| packages/*/lib/* | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep ignoring node_package/lib while builds still output there PR states outDir remains node_package/lib; replacing the ignore with packages//lib/ drops coverage for node_package/lib and may format compiled artifacts. Add both patterns. Apply: - packages/*/lib/*
+node_package/lib/*
+packages/*/lib/*Based on learnings. π Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||
| spec/react_on_rails/dummy-for-generators/app/javascript/bundles/HelloWorld/* | ||||||||
| bundle/ | ||||||||
| spec/dummy/lib/bs/** | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -71,7 +71,7 @@ Changes since the last non-beta release. | |||||
|
|
||||||
| #### Pro License Features | ||||||
|
|
||||||
| - **Core/Pro separation**: Moved Pro features into dedicated `lib/react_on_rails/pro/` and `node_package/src/pro/` directories with clear licensing boundaries [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban) | ||||||
| - **Core/Pro separation**: Moved Pro features into dedicated `lib/react_on_rails/pro/` and `node_package/src/pro/` directories with clear licensing boundaries (now located at `packages/react-on-rails/src/pro/`) [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban) | ||||||
| - **Runtime license validation**: Implemented Pro license gating with graceful fallback to core functionality when Pro license unavailable [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban) | ||||||
| - **Enhanced immediate hydration**: Improved immediate hydration functionality with Pro license validation and warning badges [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban) | ||||||
| - **License documentation**: Added NOTICE files in Pro directories referencing canonical `REACT-ON-RAILS-PRO-LICENSE.md` [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban) | ||||||
|
|
@@ -400,6 +400,8 @@ _Major bump because dropping support for Ruby 2.7 and deprecated `webpackConfigL | |||||
| @ ./client/app/packs/client-bundle.js 5:0-42 32:0-23 35:0-21 59:0-26 | ||||||
| ``` | ||||||
|
|
||||||
| _Note: The `node_package/lib/` path in these error examples is now `packages/react-on-rails/lib/` in the current structure._ | ||||||
|
|
||||||
|
Comment on lines
+403
to
+404
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Path note contradicts Phase 3 objective; keep output at node_package/lib The note says errors now point to packages/react-on-rails/lib/, but Phase 3 preserves build output at node_package/lib/ for backward compatibility. Update the note accordingly to avoid confusing users and tools relying on that path. - _Note: The `node_package/lib/` path in these error examples is now `packages/react-on-rails/lib/` in the current structure._
+ _Note: The build output path remains `node_package/lib/` for backward compatibility in this phase._Based on learnings. π Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||
| It can be safely [suppressed](https://webpack.js.org/configuration/other-options/#ignorewarnings) in your Webpack configuration. | ||||||
|
|
||||||
| ### [13.0.2] - 2022-03-09 | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ It's critical to configure your IDE/editor to ignore certain directories. Otherw | |
| - /coverage | ||
| - /tmp | ||
| - /gen-examples | ||
| - /node_package/lib | ||
| - /packages/react-on-rails/lib | ||
| - /node_modules | ||
|
Comment on lines
40
to
44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restore The TypeScript build still writes compiled output to π€ Prompt for AI Agents |
||
| - /spec/dummy/app/assets/webpack | ||
| - /spec/dummy/log | ||
|
|
@@ -121,7 +121,7 @@ Don't forget you may need to run yarn after adding packages with yalc to install | |
|
|
||
| #### Example: Testing NPM changes with the dummy app | ||
|
|
||
| 1. Add `console.log('Hello!')` to [clientStartup.ts, function render](https://github.com/shakacode/react_on_rails/blob/master/node_package/src/clientStartup.ts in `/node_package/src/clientStartup.js` to confirm we're getting an update to the node package client side. Do the same for function `serverRenderReactComponent` in `/node_package/src/serverRenderReactComponent.ts`. | ||
| 1. Add `console.log('Hello!')` to [clientStartup.ts, function render](https://github.com/shakacode/react_on_rails/blob/master/packages/react-on-rails/src/clientStartup.ts in `/packages/react-on-rails/src/clientStartup.js` to confirm we're getting an update to the node package client side. Do the same for function `serverRenderReactComponent` in `/packages/react-on-rails/src/serverRenderReactComponent.ts`. | ||
AbanoubGhadban marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 2. Refresh the browser if the server is already running or start the server using `foreman start` from `react_on_rails/spec/dummy` and navigate to `http://localhost:5000/`. You will now see the `Hello!` message printed in the browser's console. If you did not see that message, then review the steps above for the workflow of making changes and pushing them via yalc. | ||
|
|
||
| # Development Setup for Gem and Node Package Contributors | ||
|
|
@@ -134,7 +134,7 @@ After checking out the repo, making sure you have Ruby and Node version managers | |
|
|
||
| ### Local Node Package | ||
|
|
||
| Note, the example and dummy apps will use your local `node_packages` folder as the `react-on-rails` node package. This will also be done automatically for you via the `rake examples:gen_all` rake task. | ||
| Note, the example and dummy apps will use your local `packages/react-on-rails` folder as the `react-on-rails` node package. This will also be done automatically for you via the `rake examples:gen_all` rake task. | ||
|
|
||
| _Side note: It's critical to use the alias section of the Webpack config to avoid a double inclusion error. This has already been done for you in the example and dummy apps, but for reference:_ | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,19 +70,18 @@ react_on_rails_pro/ | |
| react_on_rails/ (monorepo root) | ||
| βββ lib/ | ||
| β βββ react_on_rails/ # Core Ruby (MIT) | ||
| β β βββ spec/ # Core Ruby specs | ||
| β βββ react_on_rails_pro/ # Pro Ruby (Pro license) | ||
| β βββ spec/ # Pro Ruby specs | ||
| βββ packages/ # NPM packages (yarn workspace) | ||
| β βββ react-on-rails/ # Core JS/TS (MIT) | ||
| β β βββ tests/ # Core JS/TS tests | ||
| β βββ react-on-rails-pro/ # Pro JS/TS (Pro license) | ||
| β β βββ tests/ # Pro JS/TS tests | ||
| β βββ react-on-rails-pro-node-renderer/ # Pro node renderer | ||
| βββ spec/ | ||
| β βββ ruby/ # Ruby specs organized by package | ||
| β β βββ react_on_rails/ | ||
| β β βββ react_on_rails_pro/ | ||
| β βββ packages/ # JS specs organized by package | ||
| β βββ react-on-rails/ | ||
| β βββ react-on-rails-pro/ | ||
| β βββ react-on-rails-pro-node-renderer/ | ||
| β βββ tests/ # Pro node renderer tests | ||
| βββ spec/ # Monorepo-level integration tests | ||
| β βββ dummy/ # Rails dummy app for testing | ||
| βββ tools/ # Shared development tools | ||
| βββ docs/ # Unified documentation | ||
| βββ react_on_rails.gemspec # Core gem | ||
|
|
@@ -306,6 +305,7 @@ After the initial merge, the following CI adjustments may be needed: | |
| - [ ] Update root `package.json` to workspace manager (packages/react-on-rails only) | ||
| - [ ] Update build scripts and import paths | ||
| - [ ] Update TypeScript configurations | ||
| - [ ] Move core JS tests to `packages/react-on-rails/tests/` | ||
| - [ ] Keep `react_on_rails_pro/` directory unchanged | ||
| - [ ] Update CI to build via workspace | ||
| - [ ] Update LICENSE.md to include new package path | ||
|
|
@@ -359,7 +359,7 @@ After the initial merge, the following CI adjustments may be needed: | |
| - [ ] Update root workspace to include all 3 NPM packages | ||
| - [ ] Update CI to test all packages | ||
| - [ ] Setup proper dependencies between packages | ||
| - [ ] Move JS specs to organized structure | ||
| - [ ] Move pro JS tests to package directories (`packages/react-on-rails-pro/tests/`, `packages/react-on-rails-pro-node-renderer/tests/`) | ||
|
|
||
| **License Compliance:** | ||
|
|
||
|
|
@@ -368,14 +368,14 @@ After the initial merge, the following CI adjustments may be needed: | |
| ```md | ||
| ## MIT License applies to: | ||
|
|
||
| - `lib/react_on_rails/` | ||
| - `packages/react-on-rails/` | ||
| - `lib/react_on_rails/` (including specs) | ||
| - `packages/react-on-rails/` (including tests) | ||
|
|
||
| ## React on Rails Pro License applies to: | ||
|
|
||
| - `lib/react_on_rails_pro/` | ||
| - `packages/react-on-rails-pro/` (NEW) | ||
| - `packages/react-on-rails-pro-node-renderer/` (NEW) | ||
| - `lib/react_on_rails_pro/` (including specs) | ||
| - `packages/react-on-rails-pro/` (including tests) (NEW) | ||
| - `packages/react-on-rails-pro-node-renderer/` (including tests) (NEW) | ||
| - `react_on_rails_pro/` (remaining files) | ||
| ``` | ||
|
|
||
|
|
@@ -414,13 +414,10 @@ After the initial merge, the following CI adjustments may be needed: | |
|
|
||
| - [ ] Move `react_on_rails_pro/lib/react_on_rails_pro/` to `lib/react_on_rails_pro/` | ||
| - [ ] Move `react_on_rails_pro/react_on_rails_pro.gemspec` to root as `react_on_rails_pro.gemspec` | ||
| - [ ] Move all Ruby specs to organized structure: | ||
| - `spec/ruby/react_on_rails/` (core specs) | ||
| - `spec/ruby/react_on_rails_pro/` (pro specs) | ||
| - [ ] Move JS specs to organized structure: | ||
| - `spec/packages/react-on-rails/` | ||
| - `spec/packages/react-on-rails-pro/` | ||
| - `spec/packages/react-on-rails-pro-node-renderer/` | ||
| - [ ] Move Ruby specs to gem directories: | ||
| - Core specs: `lib/react_on_rails/spec/` (or keep existing `spec/` location) | ||
| - Pro specs: `lib/react_on_rails_pro/spec/` | ||
| - [ ] JS tests remain in package directories (already handled in previous phases) | ||
| - [ ] Update root `Gemfile` to include both gemspecs | ||
|
Comment on lines
+468
to
472
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π οΈ Refactor suggestion | π Major π§© Analysis chainResolve indecision on Ruby spec location. βlib/.../spec (or keep existing spec location)β is ambiguous. Choose one and use it consistently across this doc and CI. Given your βDevelopment Workflowβ uses -- [ ] Move Ruby specs to gem directories:
- - Core specs: `lib/react_on_rails/spec/` (or keep existing `spec/` location)
- - Pro specs: `lib/react_on_rails_pro/spec/`
+- [ ] Move Ruby specs to root spec directories (preferred):
+ - Core specs: `spec/ruby/react_on_rails/`
+ - Pro specs: `spec/ruby/react_on_rails_pro/`π Script executed: #!/bin/bash
# Ensure rspec config/globs match the chosen path
fd -a .rspec rspec*.rb spec_helper*.rb | xargs rg -n .Length of output: 291067 π Script executed: #!/bin/bash
set -uo pipefail
echo "=== git ls-files matching spec paths ==="
git ls-files | rg -n --line-number '^spec/|/spec/' || echo "(no tracked paths under 'spec/')"
echo
echo "=== tracked files: spec_helper.rb, rails_helper.rb, .rspec ==="
git ls-files | rg -n '(^|/)(spec_helper|rails_helper)\.rb$|(^|/)\.rspec$' || echo "(none of those files tracked)"
echo
echo "=== find 'spec' directories (fd fallback to find) ==="
if command -v fd >/dev/null 2>&1; then
fd -H -t d --hidden '^spec$' || true
else
find . -type d -name spec -print || true
fi
echo
echo "=== occurrences of 'bundle exec rspec' and 'rspec' in repo ==="
rg -n -S --hidden --glob '!node_modules/**' 'bundle exec rspec' || echo "(no 'bundle exec rspec' matches)"
rg -n -S --hidden --glob '!node_modules/**' '\brspec\b' || echo "(no 'rspec' token matches)"
echo
echo "=== search .github/workflows for rspec ==="
rg -n -S --hidden --glob '!node_modules/**' '\brspec\b' .github || echo "(no rspec in .github/workflows or .github not present)"
echo
echo "=== root Gemfile (first 200 lines) ==="
if [ -f Gemfile ]; then
sed -n '1,200p' Gemfile
else
echo "(no Gemfile at repo root)"
fi
echo
echo "=== docs references to spec location ==="
rg -n -S --hidden --glob '!node_modules/**' 'Move Ruby specs|spec/ruby|lib/.*/spec' docs || echo "(no matching mentions in docs)"Length of output: 58534 Unify Ruby spec location β prefer root-level specs Replace the ambiguous "lib/.../spec (or keep existing π€ Prompt for AI Agents |
||
| - [ ] Remove empty `react_on_rails_pro/` directory | ||
| - [ ] Update all require paths in Ruby code | ||
|
|
@@ -433,19 +430,14 @@ After the initial merge, the following CI adjustments may be needed: | |
| ```md | ||
| ## MIT License applies to: | ||
|
|
||
| - `lib/react_on_rails/` | ||
| - `packages/react-on-rails/` | ||
| - `spec/ruby/react_on_rails/` | ||
| - `spec/packages/react-on-rails/` | ||
| - `lib/react_on_rails/` (including specs) | ||
| - `packages/react-on-rails/` (including tests) | ||
|
|
||
| ## React on Rails Pro License applies to: | ||
|
|
||
| - `lib/react_on_rails_pro/` | ||
| - `packages/react-on-rails-pro/` | ||
| - `packages/react-on-rails-pro-node-renderer/` | ||
| - `spec/ruby/react_on_rails_pro/` | ||
| - `spec/packages/react-on-rails-pro/` | ||
| - `spec/packages/react-on-rails-pro-node-renderer/` | ||
| - `lib/react_on_rails_pro/` (including specs) | ||
| - `packages/react-on-rails-pro/` (including tests) | ||
| - `packages/react-on-rails-pro-node-renderer/` (including tests) | ||
| ``` | ||
|
|
||
| - [ ] Update both gemspec files with correct license: | ||
|
|
@@ -579,14 +571,14 @@ After the initial merge, the following CI adjustments may be needed: | |
|
|
||
| - `react_on_rails` Ruby gem | ||
| - `react-on-rails` NPM package | ||
| - Core functionality in `lib/react_on_rails/` and `packages/react-on-rails/` | ||
| - Core functionality in `lib/react_on_rails/` and `packages/react-on-rails/` (including tests/specs) | ||
|
|
||
| ### Pro Licensed (Subscription Required for Production): | ||
|
|
||
| - `react_on_rails_pro` Ruby gem | ||
| - `react-on-rails-pro` NPM package | ||
| - `react-on-rails-pro-node-renderer` NPM package | ||
| - Pro functionality in `lib/react_on_rails_pro/` and `packages/react-on-rails-pro*/` | ||
| - Pro functionality in `lib/react_on_rails_pro/` and `packages/react-on-rails-pro*/` (including tests/specs) | ||
|
|
||
| See [LICENSE.md](LICENSE.md) and [REACT-ON-RAILS-PRO-LICENSE.md](REACT-ON-RAILS-PRO-LICENSE.md) | ||
| ``` | ||
|
|
@@ -615,7 +607,7 @@ After the initial merge, the following CI adjustments may be needed: | |
|
|
||
| 1. **Directory Classification:** | ||
|
|
||
| - **MIT Licensed:** `lib/react_on_rails/`, `packages/react-on-rails/`, core specs | ||
| - **MIT Licensed:** `lib/react_on_rails/` (including specs), `packages/react-on-rails/` (including tests) | ||
| - **Pro Licensed:** All directories explicitly listed in LICENSE.md under "React on Rails Pro License" | ||
|
|
||
| 2. **LICENSE.md Updates:** | ||
|
|
@@ -643,16 +635,11 @@ PRO_DIRECTORIES = %w[ | |
| lib/react_on_rails_pro | ||
| packages/react-on-rails-pro | ||
| packages/react-on-rails-pro-node-renderer | ||
| spec/ruby/react_on_rails_pro | ||
| spec/packages/react-on-rails-pro | ||
| spec/packages/react-on-rails-pro-node-renderer | ||
| ].freeze | ||
|
|
||
| MIT_DIRECTORIES = %w[ | ||
| lib/react_on_rails | ||
| packages/react-on-rails | ||
| spec/ruby/react_on_rails | ||
| spec/packages/react-on-rails | ||
| ].freeze | ||
|
|
||
| def check_pro_license_headers | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build before yalc publish to ensure lib exists
The workflow publishes via yalc without building first. Insert a build step before publishing.
π Committable suggestion
π€ Prompt for AI Agents