@@ -5,8 +5,9 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
55## Development Commands
66
77### Essential Commands
8+
89- ** Install dependencies** : ` bundle && yarn `
9- - ** Run tests** :
10+ - ** Run tests** :
1011 - Ruby tests: ` rake run_rspec `
1112 - JavaScript tests: ` yarn run test ` or ` rake js_tests `
1213 - All tests: ` rake ` (default task runs lint and all tests except examples)
@@ -18,58 +19,69 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
1819- ** Type checking** : ` yarn run type-check `
1920
2021### Development Setup Commands
22+
2123- ** Initial setup** : ` bundle && yarn && rake shakapacker_examples:gen_all && rake node_package && rake `
2224- ** Prepare examples** : ` rake shakapacker_examples:gen_all `
2325- ** Generate node package** : ` rake node_package `
2426- ** Run single test example** : ` rake run_rspec:example_basic `
2527
2628### Test Environment Commands
29+
2730- ** Dummy app tests** : ` rake run_rspec:dummy `
2831- ** Gem-only tests** : ` rake run_rspec:gem `
2932- ** All tests except examples** : ` rake all_but_examples `
3033
3134## Project Architecture
3235
3336### Dual Package Structure
37+
3438This project maintains both a Ruby gem and an NPM package:
39+
3540- ** Ruby gem** : Located in ` lib/ ` , provides Rails integration and server-side rendering
3641- ** NPM package** : Located in ` node_package/src/ ` , provides client-side React integration
3742
3843### Core Components
3944
4045#### Ruby Side (` lib/react_on_rails/ ` )
46+
4147- ** ` helper.rb ` ** : Rails view helpers for rendering React components
4248- ** ` server_rendering_pool.rb ` ** : Manages Node.js processes for server-side rendering
4349- ** ` configuration.rb ` ** : Global configuration management
4450- ** ` engine.rb ` ** : Rails engine integration
4551- ** Generators** : Located in ` lib/generators/react_on_rails/ `
4652
4753#### JavaScript/TypeScript Side (` node_package/src/ ` )
54+
4855- ** ` ReactOnRails.ts ` ** : Main entry point for client-side functionality
4956- ** ` serverRenderReactComponent.ts ` ** : Server-side rendering logic
5057- ** ` ComponentRegistry.ts ` ** : Manages React component registration
5158- ** ` StoreRegistry.ts ` ** : Manages Redux store registration
5259
5360### Build System
61+
5462- ** Ruby** : Standard gemspec-based build
5563- ** JavaScript** : TypeScript compilation to ` node_package/lib/ `
5664- ** Testing** : Jest for JS, RSpec for Ruby
5765- ** Linting** : ESLint for JS/TS, RuboCop for Ruby
5866
5967### Examples and Testing
68+
6069- ** Dummy app** : ` spec/dummy/ ` - Rails app for testing integration
6170- ** Examples** : Generated via rake tasks for different webpack configurations
6271- ** Rake tasks** : Defined in ` rakelib/ ` for various development operations
6372
6473## Important Notes
74+
6575- Use ` yalc ` for local development when testing with external apps
6676- The project supports both Webpacker and Shakapacker
6777- Server-side rendering uses isolated Node.js processes
6878- React Server Components support available in Pro version
6979- Generated examples are in ` gen-examples/ ` (ignored by git)
7080
7181## IDE Configuration
82+
7283Exclude these directories to prevent IDE slowdowns:
84+
7385- ` /coverage ` , ` /tmp ` , ` /gen-examples ` , ` /node_package/lib `
7486- ` /node_modules ` , ` /spec/dummy/node_modules ` , ` /spec/dummy/tmp `
75- - ` /spec/dummy/app/assets/webpack ` , ` /spec/dummy/log `
87+ - ` /spec/dummy/app/assets/webpack ` , ` /spec/dummy/log `
0 commit comments