Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 9 additions & 3 deletions .github/workflows/pro-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ jobs:
- name: Setup Node
uses: ./.github/actions/setup-node-with-retry
with:
node-version: 22
# Pin to 22.12.x (LTS) - V8 bug from issue #56010 was fixed in 22.12.0
# https://github.com/nodejs/node/issues/56010
node-version: '22.12.x'
cache: yarn
cache-dependency-path: 'react_on_rails_pro/**/yarn.lock'

Expand Down Expand Up @@ -191,7 +193,9 @@ jobs:
- name: Setup Node
uses: ./.github/actions/setup-node-with-retry
with:
node-version: 22
# Pin to 22.12.x (LTS) - V8 bug from issue #56010 was fixed in 22.12.0
# https://github.com/nodejs/node/issues/56010
node-version: '22.12.x'
cache: yarn
cache-dependency-path: 'react_on_rails_pro/**/yarn.lock'

Expand Down Expand Up @@ -388,7 +392,9 @@ jobs:
- name: Setup Node
uses: ./.github/actions/setup-node-with-retry
with:
node-version: 22
# Pin to 22.12.x (LTS) - V8 bug from issue #56010 was fixed in 22.12.0
# https://github.com/nodejs/node/issues/56010
node-version: '22.12.x'
cache: yarn
cache-dependency-path: 'react_on_rails_pro/**/yarn.lock'

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/pro-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ jobs:
- name: Setup Node
uses: ./.github/actions/setup-node-with-retry
with:
node-version: 22
# Pin to 22.11.0 (LTS) to avoid V8 bug in 22.21.0
# https://github.com/nodejs/node/issues/56010
node-version: '22.11.0'
cache: yarn
cache-dependency-path: 'react_on_rails_pro/**/yarn.lock'

Expand Down Expand Up @@ -159,6 +161,10 @@ jobs:
- name: Generate file-system based entrypoints
run: cd spec/dummy && bundle exec rake react_on_rails:generate_packs

- name: Build react-on-rails package (required for Pro eslint import resolution)
working-directory: .
run: yarn workspace react-on-rails-pro build

- name: Lint Ruby
run: bundle exec rubocop --ignore-parent-exclusion

Expand Down
35 changes: 12 additions & 23 deletions .github/workflows/pro-test-package-and-gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ jobs:
- name: Setup Node
uses: ./.github/actions/setup-node-with-retry
with:
node-version: 22
# Pin to 22.11.0 (LTS) to avoid V8 bug in 22.21.0
# https://github.com/nodejs/node/issues/56010
node-version: '22.11.0'
cache: yarn
cache-dependency-path: 'react_on_rails_pro/**/yarn.lock'
cache-dependency-path: '**/yarn.lock'

- name: Print system information
run: |
Expand Down Expand Up @@ -196,9 +198,11 @@ jobs:
- name: Setup Node
uses: ./.github/actions/setup-node-with-retry
with:
node-version: 22
# Pin to 22.11.0 (LTS) to avoid V8 bug in 22.21.0
# https://github.com/nodejs/node/issues/56010
node-version: '22.11.0'
cache: yarn
cache-dependency-path: 'react_on_rails_pro/**/yarn.lock'
cache-dependency-path: '**/yarn.lock'

- name: Print system information
run: |
Expand All @@ -214,29 +218,14 @@ jobs:
path: react_on_rails_pro/node_modules
key: v4-pro-package-node-modules-cache-${{ hashFiles('react_on_rails_pro/yarn.lock') }}

- name: Remove old webpack bundles
run: |
rm -rf spec/dummy/public/webpack
rm -rf spec/dummy/ssr-generated

- id: get-sha
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"

- name: Restore test webpack bundles from cache
uses: actions/cache@v4
with:
path: |
react_on_rails_pro/spec/dummy/public/webpack/test
react_on_rails_pro/spec/dummy/ssr-generated
key: v4-pro-dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}

- name: Install Node modules with Yarn for Pro package
working-directory: .
run: |
sudo yarn global add yalc
yarn install --frozen-lockfile --no-progress --no-emoji

- name: Run JS unit tests for Pro package
run: yarn run nps test.ci
run: yarn workspace react-on-rails-pro-node-renderer run ci
env:
JEST_JUNIT_OUTPUT_DIR: ./jest
JEST_JUNIT_ADD_FILE_ATTRIBUTE: "true"
Expand All @@ -246,10 +235,10 @@ jobs:
if: always()
with:
name: pro-jest-results
path: react_on_rails_pro/jest
path: packages/react-on-rails-pro-node-renderer/jest

# RSpec tests for Pro package
rspec-package-specs:
rspec-gem-specs:
needs: detect-changes
if: |
!(
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,10 @@ ssr-generated

# Claude Code local settings
.claude/settings.local.json
packages/

# Workspace package build outputs (but track source code)
packages/*/lib/
packages/**/node_modules/

# Jest test reports
junit.xml
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules/
package.json
# Exclude pro package (has its own formatting)
react_on_rails_pro/
packages/react-on-rails-pro-node-renderer/tests/fixtures/projects
tmp/
coverage/
**/app/assets/webpack/
Expand Down
1 change: 1 addition & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,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**:

- `packages/react-on-rails-pro/` (entire package)
- `packages/react-on-rails-pro-node-renderer/` (entire package)
- `react_on_rails_pro/` (entire directory)

See [REACT-ON-RAILS-PRO-LICENSE.md](./REACT-ON-RAILS-PRO-LICENSE.md) for complete Pro license terms.
Expand Down
41 changes: 41 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ const config = tsEslint.config([
// generator templates - exclude TypeScript templates that need tsconfig.json
'**/templates/**/*.tsx',
'**/templates/**/*.ts',
// test config files in packages - Jest/Babel configs cause ESM/CJS conflicts with ESLint
'packages/*/tests/**',
'packages/*/*.test.{js,jsx,ts,tsx}',
'packages/*/babel.config.js',
'packages/*/jest.config.js',
]),
{
files: ['**/*.[jt]s', '**/*.[jt]sx', '**/*.[cm][jt]s'],
Expand Down Expand Up @@ -227,6 +232,15 @@ const config = tsEslint.config([
// TypeScript compiler validates these imports
'import/named': 'off',
'import/no-unresolved': 'off',
'import/no-cycle': 'off',
'import/no-relative-packages': 'off',
'import/no-duplicates': 'off',
'import/extensions': 'off',
'import/order': 'off',
'import/no-self-import': 'off',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
'import/export': 'off',
// Disable unsafe type rules - Pro package uses internal APIs with complex types
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
Expand All @@ -240,6 +254,24 @@ const config = tsEslint.config([
'@typescript-eslint/unbound-method': 'off',
},
},
{
files: ['packages/react-on-rails-pro-node-renderer/**/*'],
rules: {
// Disable import rules for node-renderer - ESM requires .js extensions but ESLint
// can't resolve them for .ts files. TypeScript compiler validates these imports
'import/named': 'off',
'import/no-unresolved': 'off',
'import/prefer-default-export': 'off',
// Disable unsafe type rules - node-renderer uses external libs with complex types
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
// Allow missing extensions in require() calls - dynamic imports
'import/extensions': 'off',
},
},
{
files: ['**/app-react16/**/*'],
rules: {
Expand All @@ -262,6 +294,15 @@ const config = tsEslint.config([
'testing-library/no-node-access': 'off',
},
},
{
files: ['packages/react-on-rails-pro-node-renderer/tests/**/*'],
rules: {
// Allow non-null assertions in tests - they're acceptable for test data
'@typescript-eslint/no-non-null-assertion': 'off',
// Some tests validate error conditions without explicit assertions
'jest/expect-expect': 'off',
},
},
// must be the last config in the array
// https://github.com/prettier/eslint-plugin-prettier?tab=readme-ov-file#configuration-new-eslintconfigjs
prettierRecommended,
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"type": "module",
"workspaces": [
"packages/react-on-rails",
"packages/react-on-rails-pro"
"packages/react-on-rails-pro",
"packages/react-on-rails-pro-node-renderer"
],
"directories": {
"doc": "docs"
Expand All @@ -19,6 +20,7 @@
"@babel/preset-react": "^7.26.3",
"@babel/preset-typescript": "^7.27.1",
"@eslint/compat": "^1.2.7",
"@jest/globals": "^29.7.0",
"@swc/core": "^1.15.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
Expand All @@ -45,6 +47,7 @@
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"jest-junit": "^16.0.0",
"jsdom": "^22.1.0",
"knip": "^5.46.0",
"nps": "^5.9.3",
Expand All @@ -65,10 +68,10 @@
"scripts": {
"test": "yarn workspaces run test",
"clean": "yarn workspaces run clean",
"start": "nps",
"build": "yarn workspace react-on-rails run build && yarn workspace react-on-rails-pro run build",
"start": "yarn run nps",
"build": "yarn workspace react-on-rails run build && yarn workspace react-on-rails-pro run build && yarn workspace react-on-rails-pro-node-renderer run build",
"build-watch": "yarn workspaces run build-watch",
"lint": "nps eslint",
"lint": "yarn run nps eslint",
"lint:scss": "stylelint \"spec/dummy/app/assets/stylesheets/**/*.scss\" \"spec/dummy/client/**/*.scss\"",
"check": "yarn run lint && yarn workspaces run check",
"type-check": "yarn workspaces run type-check",
Expand Down
7 changes: 7 additions & 0 deletions packages/react-on-rails-pro-node-renderer/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
'@babel/preset-react',
],
};
Loading
Loading