Skip to content

Commit 325e4e8

Browse files
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.
1 parent caf8d34 commit 325e4e8

File tree

12 files changed

+22
-20
lines changed

12 files changed

+22
-20
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Changes since the last non-beta release.
7171

7272
#### Pro License Features
7373

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)
7575
- **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)
7676
- **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)
7777
- **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
400400
@ ./client/app/packs/client-bundle.js 5:0-42 32:0-23 35:0-21 59:0-26
401401
```
402402

403+
_Note: The `node_package/lib/` path in these error examples is now `packages/react-on-rails/lib/` in the current structure._
404+
403405
It can be safely [suppressed](https://webpack.js.org/configuration/other-options/#ignorewarnings) in your Webpack configuration.
404406

405407
### [13.0.2] - 2022-03-09

CLAUDE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Git hooks will automatically run linting on **all changed files (staged + unstag
3636
- **Code Formatting**:
3737
- Format code with Prettier: `rake autofix`
3838
- Check formatting without fixing: `yarn start format.listDifferent`
39-
- **Build**: `yarn run build` (compiles TypeScript to JavaScript in node_package/lib)
39+
- **Build**: `yarn run build` (compiles TypeScript to JavaScript in packages/react-on-rails/lib)
4040
- **Type checking**: `yarn run type-check`
4141
- **⚠️ MANDATORY BEFORE GIT PUSH**: `bundle exec rubocop` and fix ALL violations + ensure trailing newlines
4242
- Never run `npm` commands, only equivalent Yarn Classic ones
@@ -86,7 +86,7 @@ Git hooks will automatically run linting on **all changed files (staged + unstag
8686
This project maintains both a Ruby gem and an NPM package:
8787

8888
- **Ruby gem**: Located in `lib/`, provides Rails integration and server-side rendering
89-
- **NPM package**: Located in `node_package/src/`, provides client-side React integration
89+
- **NPM package**: Located in `packages/react-on-rails/src/`, provides client-side React integration
9090

9191
### Core Components
9292

@@ -98,7 +98,7 @@ This project maintains both a Ruby gem and an NPM package:
9898
- **`engine.rb`**: Rails engine integration
9999
- **Generators**: Located in `lib/generators/react_on_rails/`
100100

101-
#### JavaScript/TypeScript Side (`node_package/src/`)
101+
#### JavaScript/TypeScript Side (`packages/react-on-rails/src/`)
102102

103103
- **`ReactOnRails.ts`**: Main entry point for client-side functionality
104104
- **`serverRenderReactComponent.ts`**: Server-side rendering logic
@@ -108,7 +108,7 @@ This project maintains both a Ruby gem and an NPM package:
108108
### Build System
109109

110110
- **Ruby**: Standard gemspec-based build
111-
- **JavaScript**: TypeScript compilation to `node_package/lib/`
111+
- **JavaScript**: TypeScript compilation to `packages/react-on-rails/lib/`
112112
- **Testing**: Jest for JS, RSpec for Ruby
113113
- **Linting**: ESLint for JS/TS, RuboCop for Ruby
114114

@@ -130,6 +130,6 @@ This project maintains both a Ruby gem and an NPM package:
130130

131131
Exclude these directories to prevent IDE slowdowns:
132132

133-
- `/coverage`, `/tmp`, `/gen-examples`, `/node_package/lib`
133+
- `/coverage`, `/tmp`, `/gen-examples`, `/packages/react-on-rails/lib`
134134
- `/node_modules`, `/spec/dummy/node_modules`, `/spec/dummy/tmp`
135135
- `/spec/dummy/app/assets/webpack`, `/spec/dummy/log`

CODING_AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Use `gh pr create` with:
287287
When analyzing codebases, ignore these directories to avoid confusion:
288288

289289
- `/coverage`, `/tmp`, `/gen-examples`
290-
- `/node_package/lib`, `/node_modules`
290+
- `/packages/react-on-rails/lib`, `/node_modules`
291291
- `/spec/dummy/app/assets/webpack`
292292
- `/spec/dummy/log`, `/spec/dummy/node_modules`, `/spec/dummy/tmp`
293293
- `/spec/react_on_rails/dummy-for-generators`

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ It's critical to configure your IDE/editor to ignore certain directories. Otherw
4040
- /coverage
4141
- /tmp
4242
- /gen-examples
43-
- /node_package/lib
43+
- /packages/react-on-rails/lib
4444
- /node_modules
4545
- /spec/dummy/app/assets/webpack
4646
- /spec/dummy/log
@@ -121,7 +121,7 @@ Don't forget you may need to run yarn after adding packages with yalc to install
121121

122122
#### Example: Testing NPM changes with the dummy app
123123

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.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`.
125125
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.
126126

127127
# 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
134134

135135
### Local Node Package
136136

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.
138138

139139
_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:_
140140

LICENSE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The following directories and all their contents are licensed under the **MIT Li
1313

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

1919
### Pro Licensed Code
@@ -22,7 +22,7 @@ The following directories and all their contents are licensed under the **React
2222

2323
- `lib/react_on_rails/pro/`
2424
- `packages/react-on-rails/src/pro/`
25-
- `node_package/lib/pro/`
25+
- `packages/react-on-rails/lib/pro/`
2626
- `react_on_rails_pro/` (entire directory)
2727

2828
See [REACT-ON-RAILS-PRO-LICENSE.md](./REACT-ON-RAILS-PRO-LICENSE.md) for complete Pro license terms.

docs/DIRECTORY_LICENSING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ All directories in the `react_on_rails` repository are MIT licensed:
1111
```
1212
react_on_rails/
1313
├── lib/react_on_rails/ # Core Ruby code (MIT)
14-
├── node_package/src/ # Core JS/TS code (MIT)
14+
├── packages/react-on-rails/src/ # Core JS/TS code (MIT)
1515
│ └── pro/ # Pro features with license validation (Pro licensed)
1616
├── spec/ # Core tests (MIT)
1717
├── docs/ # Documentation (MIT)
1818
├── .github/ # GitHub workflows (MIT)
1919
└── [all other directories] # MIT
2020
```
2121

22-
**Exception:** The `node_package/src/pro/` directory contains Pro implementation code licensed under the React on Rails Pro License. This code is included in the package but requires a valid Pro license to use.
22+
**Exception:** The `packages/react-on-rails/src/pro/` directory contains Pro implementation code licensed under the React on Rails Pro License. This code is included in the package but requires a valid Pro license to use.
2323

2424
**Important Distinction:**
2525

docs/additional-details/manual-installation-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The only requirements within this directory for basic React on Rails integration
1313
1. Your Webpack configuration files:
1414
1. Create outputs in a directory like `/public/webpack`, which is customizable in your `config/initializers/react_on_rails.rb`.
1515
1. Provide server rendering if you wish to use that feature.
16-
1. Your JavaScript code "registers" any components and stores per the ReactOnRails APIs of ReactOnRails.register(components) and ReactOnRails.registerStore(stores). See [our JavaScript API docs](../api/javascript-api.md) and the [React on Rails source](https://github.com/shakacode/react_on_rails/tree/master/node_package/src/ReactOnRails.client.ts).
16+
1. Your JavaScript code "registers" any components and stores per the ReactOnRails APIs of ReactOnRails.register(components) and ReactOnRails.registerStore(stores). See [our JavaScript API docs](../api/javascript-api.md) and the [React on Rails source](https://github.com/shakacode/react_on_rails/tree/master/packages/react-on-rails/src/ReactOnRails.client.ts).
1717
1. Set your registration file as an "entry" point in your Webpack configs.
1818
1. Configure scripts in `client/package.json` as shown in the example apps. These are used for building your Webpack assets. Also do this for your top-level `package.json`.
1919

docs/api/javascript-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ If you are using [jquery-ujs](https://github.com/rails/jquery-ujs) for AJAX call
1818

1919
## API
2020

21-
The best source of docs is the `interface ReactOnRails` in [types/index.ts](https://github.com/shakacode/react_on_rails/blob/master/node_package/src/types/index.ts). Here's a quick summary. No guarantees that this won't be outdated!
21+
The best source of docs is the `interface ReactOnRails` in [types/index.ts](https://github.com/shakacode/react_on_rails/blob/master/packages/react-on-rails/src/types/index.ts). Here's a quick summary. No guarantees that this won't be outdated!
2222

2323
```js
2424
/**

docs/contributor-info/releasing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ index aa7b000..af8761e 100644
5858
- "version": "2.0.2",
5959
+ "version": "2.1.0",
6060
"description": "react-on-rails JavaScript for react_on_rails Ruby gem",
61-
"main": "node_package/lib/ReactOnRails.js",
61+
"main": "packages/react-on-rails/lib/ReactOnRails.js",
6262
"directories": {
6363
diff --git a/spec/dummy/Gemfile.lock b/spec/dummy/Gemfile.lock
6464
index 8ef51df..4489bfe 100644

docs/javascript/render-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const MyComponent = (props, _railsContext) => {
123123

124124
## Important Rendering Behavior
125125

126-
Take a look at [serverRenderReactComponent.test.ts](https://github.com/shakacode/react_on_rails/blob/master/node_package/tests/serverRenderReactComponent.test.ts):
126+
Take a look at [serverRenderReactComponent.test.ts](https://github.com/shakacode/react_on_rails/blob/master/packages/react-on-rails/tests/serverRenderReactComponent.test.ts):
127127

128128
1. **Direct String Returns Don't Work** - Returning a raw HTML string directly from a render function causes an error. Always wrap HTML strings in `{ renderedHtml: '...' }`.
129129

0 commit comments

Comments
 (0)