You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Phase 3: Prepare react-on-rails package for workspace structure (#1830)
* Phase 3: Prepare core package for workspace structure
- Create packages/react-on-rails/ directory structure
- Move entire node_package/src/ to packages/react-on-rails/src/ (including pro/)
- Create packages/react-on-rails/package.json with workspace configuration
- Update root package.json to workspace manager with workspaces config
- Update tsconfig.json to build from packages/react-on-rails/src/
- Update LICENSE.md with new package paths including pro directory
- Update CI workflows to publish from workspace directory
- Update dummy app scripts to use workspace build and publish process
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix CI failures: Update Knip config and test imports for workspace structure
- Update Knip configuration to look for source files in packages/react-on-rails/src/ instead of node_package/src/
- Update all test import paths from ../src/ to ../../packages/react-on-rails/src/
- Fix dead code detection issues that were causing CI failures
- Verify Knip passes locally in both normal and production modes
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* 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 <noreply@anthropic.com>
* Fix workspace configuration for publishing and CI
- Made root package private workspace manager
- Made workspace package publishable with proper exports
- Fixed CI workflow to pack from workspace package only
- Updated build to copy lib output to workspace package
- Fixed all package paths to be relative to workspace package
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix Knip configuration to ignore build output directories
- Added ignore patterns for packages/react-on-rails/lib/** and node_package/lib/**
- Added /packages/*/lib to .gitignore to exclude workspace build outputs
- Resolves Knip dead code detection failures for build artifacts
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix ESLint configuration for workspace package imports
- Added import/extensions rule override for packages/react-on-rails/src/**/*
- Allows TypeScript files to use .ts extensions in imports (ignorePackages)
- Resolves 111 ESLint import/extensions violations after workspace migration
- Matches existing node_package/**/* rule configuration
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix Jest configuration for workspace and testing library setup
- Convert jest.config.js to jest.config.mjs for ES module compatibility
- Add setupFilesAfterEnv: ['@testing-library/jest-dom'] for custom matchers
- Resolves toBeInTheDocument TypeScript errors in test files
- Fixes @testing-library/react import resolution issues
- All JavaScript tests now pass on Node 20/22
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix Jest setupFilesAfterEnv path resolution for CI
- Use explicit path <rootDir>/node_modules/@testing-library/jest-dom
- Resolves module resolution issues when Jest runs from workspace directory
- Fixes "Module @testing-library/jest-dom was not found" error in CI
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update Gemfile.lock and package.json for path corrections
* 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 <noreply@anthropic.com>
* Remove setupFilesAfterEnv from Jest configuration and clean up convert script by removing outdated React version updates for workspace packages. This streamlines the configuration and ensures compatibility with the latest React version.
* Update CircleCI configuration to enhance caching strategy for node_modules directories. Added additional checksum for yarn.lock to restore cached directories, improving build performance and reliability.
* Update package.json to simplify link-source script by removing redundant path navigation. This change streamlines the build process for the dummy application.
* Update link-source script in package.json to target the correct directory for improved build process in the dummy application.
* Update build output path to workspace package directory
- Changed TypeScript outDir from node_package/lib to packages/react-on-rails/lib
- Simplified workspace package build script (no more copying from old location)
- Updated package-scripts.yml prepack checks to use new build path
- Removed old node_package/lib reference from Knip configuration
- Build output now goes directly to the publishable workspace package
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Complete workspace migration: move tests, scripts, and babel config
**File Moves:**
- Move node_package/tests/* -> packages/react-on-rails/tests/
- Move node_package/scripts/* -> packages/react-on-rails/scripts/
- Move node_package/babel.config.js -> packages/react-on-rails/babel.config.cjs
- Remove empty node_package/ directory
**Path Updates:**
- Updated all test import paths from ../../packages/react-on-rails/src -> ../src
- Updated jest.setup.js mock paths to use relative imports
- Updated Jest config setupFiles and moduleNameMapper paths
- Updated Knip babel config and ignore file paths
- Updated root package.json release script paths
- Updated script/convert for new workspace structure
**Configuration Fixes:**
- Renamed babel.config.js to babel.config.cjs for ES module compatibility
- Added React and TypeScript presets to babel config
- Fixed workspace package test command to run from root
**Result:**
- Workspace package is now fully self-contained with src/, tests/, scripts/, lib/
- All tests pass when run from root: yarn test
- Git history preserved for all moved files
- Build output goes to packages/react-on-rails/lib/
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Refactor package.json scripts to utilize workspaces for improved command execution
- Updated scripts in both root and react-on-rails package.json to use `yarn workspaces run` for consistency and better management.
- Adjusted test, clean, start, prepack, prepare, prepublishOnly, build, build-watch, check, type-check, and release scripts accordingly.
This change enhances the build process and ensures all commands are executed within the context of the workspace.
* Enhance package.json scripts for improved workspace management
- Added new scripts for `yalc:publish`, `yalc`, and `publish` in the root package.json to streamline publishing processes.
- Updated the react-on-rails package.json to utilize `yalc` commands and removed redundant `start` script for clarity.
These changes improve the overall command execution and maintain consistency across the workspace.
* Rename package to react-on-rails-workspace and streamline scripts in package.json
- Updated the package name from `react-on-rails` to `react-on-rails-workspace` for clarity.
- Adjusted script entries to maintain consistency, including reordering and removing redundant entries.
These changes enhance the organization and clarity of the package configuration.
* Update CircleCI configuration to streamline caching for node_modules directories
* Update Knip configuration and package.json scripts for improved path consistency
- Adjusted Knip configuration to point to the correct test and script directories within the packages/react-on-rails structure.
- Updated package.json scripts to use relative paths for release commands, ensuring consistency across the workspace.
These changes enhance the organization and clarity of the project structure.
* Revert unnecessary file extension changes
- Revert babel.config.cjs back to babel.config.js (CommonJS works fine in workspace)
- Remove unnecessary React/TypeScript presets from babel config
- Update knip.ts to reference correct babel config path
- Keep jest.config.mjs (ES module extension is actually required)
Testing confirmed:
- babel.config.js works with CommonJS syntax in workspace package
- React/TypeScript presets were unnecessary (ts-jest handles JSX/TSX)
- All tests pass with simplified configuration
- jest.config.js extension causes "Cannot use import statement" error
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Add global Jest configuration and refactor Knip settings
- Introduced a new global Jest configuration file (jest.config.base.js) for consistent testing settings across the monorepo.
- Removed the outdated jest.config.mjs file to streamline configuration management.
- Updated Knip configuration in knip.ts to enhance workspace management, including clearer entry and ignore patterns for the root and package-specific settings.
- Adjusted package.json scripts in the react-on-rails package to simplify test execution.
These changes improve the organization and maintainability of the testing setup and workspace structure.
* Update ESLint configuration to reflect new package structure
- Modified ESLint ignore patterns to accommodate the new directory structure, changing references from 'node_package' to 'packages/*'.
- Updated file patterns for linting and testing to ensure consistency across all packages.
These changes enhance the ESLint setup, aligning it with the recent restructuring of the project.
* Update configuration files to reflect package structure changes
- Removed references to 'node_package' in .gitignore, .prettierignore, and tsconfig.json to align with the new directory structure.
- Updated Jest configuration comments for clarity.
These changes enhance consistency across the project and ensure proper file management in the updated workspace.
* Update MONOREPO_MERGER_PLAN.md to reflect co-located test structure
- Update target architecture to show tests within package directories
- Modify Phase 3-5 tasks to reflect new test organization approach
- Simplify license compliance framework for co-located tests
- Update documentation examples to clarify test/spec inclusion
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update documentation and references to reflect new package structure
- Updated paths in CHANGELOG.md, CLAUDE.md, CODING_AGENTS.md, CONTRIBUTING.md, LICENSE.md, and various documentation files to replace 'node_package' with 'packages/react-on-rails'.
- Adjusted links and comments in the codebase to align with the new directory structure.
- Enhanced clarity and consistency across documentation regarding the project's organization.
These changes ensure that all references are accurate and up-to-date with the recent restructuring of the project.
* Update test command in convert script for improved execution
- Modified the test command in the convert script to simplify the execution process by removing unnecessary path references.
- Ensured compatibility with the new test structure by updating the command to reflect the current organization.
These changes enhance the clarity and efficiency of the testing setup in the project.
* Update Knip configuration and package.json scripts for improved execution
- Added 'nps' to the ignoreBinaries in Knip configuration to prevent unnecessary warnings.
- Updated the start script in package.json to use 'nps' for better script management.
These changes enhance the efficiency and clarity of the project's script execution.
* Update test command in package.json for improved execution
- Modified the test command in package.json to specify the 'tests' directory, enhancing clarity and ensuring compatibility with the current test structure.
This change improves the testing setup by clearly defining the test location.
* Update DIRECTORY_LICENSING.md to reflect new directory structure
- Changed references from 'packages/react-on-rails/src/' to 'node_package/src/' for clarity and consistency with the updated project organization.
- Updated the exception note to accurately describe the licensing of the Pro implementation code.
These changes ensure that the licensing documentation is aligned with the recent restructuring of the project.
* Update DIRECTORY_LICENSING.md to reflect new directory structure and test organization
- Revised directory structure descriptions to include specifications for Ruby and NPM packages, as well as integration tests.
- Clarified the organization of Pro implementation code and its associated tests.
These updates ensure that the licensing documentation accurately represents the current project structure and testing framework.
* Update CONTRIBUTING.md to correct link formatting
- Revised the link to `clientStartup.ts` for clarity and accuracy in the testing example.
- Adjusted the link for `serverRenderReactComponent.ts` to ensure proper navigation.
These updates enhance the documentation by providing clearer references for contributors.
* Update MONOREPO_MERGER_PLAN.md to specify new build output locations for Pro packages
- Added a note indicating that Pro packages will now output to `packages/react-on-rails-pro/lib/` and `packages/react-on-rails-pro-node-renderer/lib/`.
- This update clarifies the expected output structure following the initial merge, ensuring proper organization and compliance with licensing requirements.
* Update MONOREPO_MERGER_PLAN.md and MONOREPO_MERGER_PLAN_REF.md to reflect completion of Phase 3
- Marked Phase 3 as complete in the merger plan reference document.
- Updated task list in the main merger plan to indicate completion of all tasks related to the preparation of the core package for the workspace structure.
These changes ensure that the merger plan accurately reflects the current status of the project and the progress made in restructuring.
* Update MONOREPO_MERGER_PLAN.md and MONOREPO_MERGER_PLAN_REF.md to reflect changes in merger phases and package structure
- Updated the implementation plan to outline an 8-phase process for merging the `react_on_rails` and `react_on_rails_pro` repositories.
- Adjusted estimated durations and success criteria for various phases to align with the new structure.
- Clarified tasks related to the separation of Pro packages and ensured proper licensing compliance.
These updates provide a clearer roadmap for the merger process and ensure that all documentation reflects the current project status.
---------
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ Changes since the last non-beta release.
71
71
72
72
#### Pro License Features
73
73
74
-
-**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)
74
+
-**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)
75
75
-**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)
76
76
-**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)
77
77
-**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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
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
40
40
- /coverage
41
41
- /tmp
42
42
- /gen-examples
43
-
- /node_package/lib
43
+
- /packages/react-on-rails/lib
44
44
- /node_modules
45
45
- /spec/dummy/app/assets/webpack
46
46
- /spec/dummy/log
@@ -121,7 +121,7 @@ Don't forget you may need to run yarn after adding packages with yalc to install
121
121
122
122
#### Example: Testing NPM changes with the dummy app
123
123
124
-
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`.
124
+
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.ts` 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](https://github.com/shakacode/react_on_rails/blob/master/packages/react-on-rails/src/serverRenderReactComponent.ts).
125
125
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.
126
126
127
127
# 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
134
134
135
135
### Local Node Package
136
136
137
-
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.
137
+
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.
138
138
139
139
_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:_
0 commit comments