|
| 1 | +# Directory Licensing Documentation |
| 2 | + |
| 3 | +This document outlines the current and post-merger directory licensing structure for React on Rails projects. |
| 4 | + |
| 5 | +## Current Structure (Pre-Merger) |
| 6 | + |
| 7 | +### react_on_rails Repository - MIT Licensed |
| 8 | + |
| 9 | +All directories in the `react_on_rails` repository are MIT licensed: |
| 10 | + |
| 11 | +``` |
| 12 | +react_on_rails/ |
| 13 | +├── lib/react_on_rails/ # Core Ruby code (MIT) |
| 14 | +├── node_package/src/ # Core JS/TS code (MIT) |
| 15 | +│ └── pro/ # Pro features placeholder (MIT but references pro) |
| 16 | +├── spec/ # Core tests (MIT) |
| 17 | +├── docs/ # Documentation (MIT) |
| 18 | +├── .github/ # GitHub workflows (MIT) |
| 19 | +└── [all other directories] # MIT |
| 20 | +``` |
| 21 | + |
| 22 | +**Exception:** The `node_package/src/pro/` directory contains placeholder code that references Pro features, but the actual Pro implementation is in the separate `react_on_rails_pro` repository. |
| 23 | + |
| 24 | +### react_on_rails_pro Repository - Pro Licensed |
| 25 | + |
| 26 | +All directories in the `react_on_rails_pro` repository are Pro licensed: |
| 27 | + |
| 28 | +``` |
| 29 | +react_on_rails_pro/ |
| 30 | +├── lib/react_on_rails_pro/ # Pro Ruby code |
| 31 | +├── packages/node-renderer/ # Pro Node.js renderer |
| 32 | +├── spec/ # Pro tests |
| 33 | +├── .circleci/ # CircleCI config |
| 34 | +└── [all other directories] # Pro licensed |
| 35 | +``` |
| 36 | + |
| 37 | +## Post-Merger Structure (Target) |
| 38 | + |
| 39 | +After the monorepo merger, the unified repository will have clear directory-based licensing: |
| 40 | + |
| 41 | +### MIT Licensed Directories |
| 42 | + |
| 43 | +``` |
| 44 | +react_on_rails/ (monorepo root) |
| 45 | +├── lib/react_on_rails/ # Core Ruby code |
| 46 | +├── packages/react-on-rails/ # Core NPM package |
| 47 | +├── spec/ruby/react_on_rails/ # Core Ruby tests |
| 48 | +├── spec/packages/react-on-rails/ # Core JS tests |
| 49 | +├── docs/ # Shared documentation |
| 50 | +├── tools/ # Shared development tools |
| 51 | +├── .github/ # Unified GitHub workflows |
| 52 | +└── [shared config files] # Build configs, etc. |
| 53 | +``` |
| 54 | + |
| 55 | +### Pro Licensed Directories |
| 56 | + |
| 57 | +``` |
| 58 | +react_on_rails/ (monorepo root) |
| 59 | +├── lib/react_on_rails_pro/ # Pro Ruby code |
| 60 | +├── packages/react-on-rails-pro/ # Pro NPM package |
| 61 | +├── packages/react-on-rails-pro-node-renderer/ # Pro Node renderer |
| 62 | +├── spec/ruby/react_on_rails_pro/ # Pro Ruby tests |
| 63 | +├── spec/packages/react-on-rails-pro/ # Pro JS tests |
| 64 | +└── spec/packages/react-on-rails-pro-node-renderer/ # Pro Node renderer tests |
| 65 | +``` |
| 66 | + |
| 67 | +## License Compliance Rules |
| 68 | + |
| 69 | +### File-Level Compliance |
| 70 | + |
| 71 | +1. **Repository-Level Licensing**: Files inherit their license from the directory they're located in |
| 72 | +2. **No Mixed Directories**: Each directory is either entirely MIT or entirely Pro - no mixed licensing within a directory |
| 73 | +3. **Clear Boundaries**: The `LICENSE.md` file explicitly lists which directories fall under which license |
| 74 | + |
| 75 | +### Package-Level Compliance |
| 76 | + |
| 77 | +1. **Gemspec Files**: |
| 78 | + |
| 79 | + - `react_on_rails.gemspec`: `s.license = "MIT"` |
| 80 | + - `react_on_rails_pro.gemspec`: `s.license = "UNLICENSED"` |
| 81 | + |
| 82 | +2. **Package.json Files**: |
| 83 | + - `packages/react-on-rails/package.json`: `"license": "MIT"` |
| 84 | + - `packages/react-on-rails-pro/package.json`: `"license": "UNLICENSED"` |
| 85 | + - `packages/react-on-rails-pro-node-renderer/package.json`: `"license": "UNLICENSED"` |
| 86 | + |
| 87 | +### Critical Compliance Points |
| 88 | + |
| 89 | +1. **Never Move Pro Code to MIT Directories**: During the merger, strict verification ensures no Pro-licensed code accidentally ends up in MIT-licensed directories |
| 90 | + |
| 91 | +2. **Update LICENSE.md Immediately**: Whenever directories are moved or created, `LICENSE.md` must be updated to reflect the new structure |
| 92 | + |
| 93 | +3. **Automated Verification**: CI checks will verify: |
| 94 | + - All Pro directories are listed in LICENSE.md |
| 95 | + - Package.json and gemspec files have correct license fields |
| 96 | + - No orphaned or unlisted directories exist |
| 97 | + |
| 98 | +## Migration Phases and License Updates |
| 99 | + |
| 100 | +The monorepo merger plan includes specific license compliance checkpoints at each phase: |
| 101 | + |
| 102 | +- **Phase 1**: Update license references and documentation |
| 103 | +- **Phase 2**: Establish dual CI with clear directory boundaries |
| 104 | +- **Phase 3-4**: Reorganize directories while maintaining license compliance |
| 105 | +- **Phase 5-6**: Finalize structure and add automated license checking |
| 106 | +- **Phase 7**: Complete documentation and verification |
| 107 | + |
| 108 | +Each phase includes mandatory license compliance verification before proceeding to the next phase. |
| 109 | + |
| 110 | +## Developer Guidelines |
| 111 | + |
| 112 | +### When Adding New Files |
| 113 | + |
| 114 | +1. Determine if the functionality is Core (MIT) or Pro (subscription required) |
| 115 | +2. Place the file in the appropriate licensed directory |
| 116 | +3. Ensure the package.json or gemspec correctly reflects the license |
| 117 | +4. Update LICENSE.md if creating new directories |
| 118 | + |
| 119 | +### When Moving Files |
| 120 | + |
| 121 | +1. Verify the destination directory has the correct license for the file content |
| 122 | +2. Never move Pro features to MIT directories |
| 123 | +3. Update import statements and references |
| 124 | +4. Verify no licensing boundaries are crossed inappropriately |
| 125 | + |
| 126 | +### When Contributing |
| 127 | + |
| 128 | +1. Core features (MIT): Open for all contributors |
| 129 | +2. Pro features: Contributions become part of Pro offering |
| 130 | +3. Shared tooling/docs (MIT): Benefits both packages |
| 131 | +4. License compliance: Never compromise on proper licensing |
| 132 | + |
| 133 | +--- |
| 134 | + |
| 135 | +_This document is maintained as part of the React on Rails monorepo merger plan. For implementation details, see [MONOREPO_MERGER_PLAN_REF.md](./MONOREPO_MERGER_PLAN_REF.md)_ |
0 commit comments