-
Notifications
You must be signed in to change notification settings - Fork 0
Reorganize into monorepo structure #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
9f3921f
b031070
fd8520c
507be19
8265d7d
9873588
ae081c6
e7a74e1
2fed447
379dc76
1c501df
0a4eb78
a019604
e008aaf
73b801a
4bf8d43
ffba293
a997e94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, master ] | ||
| pull_request: | ||
| branches: [ main, master ] | ||
|
|
||
| jobs: | ||
| lint-demo-common: | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: packages/demo_common | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '3.3' | ||
| bundler-cache: true | ||
| working-directory: packages/demo_common | ||
| - name: Run RuboCop | ||
| run: bundle exec rubocop | ||
|
|
||
| test-demo-common: | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: packages/demo_common | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '3.3' | ||
| bundler-cache: true | ||
| working-directory: packages/demo_common | ||
| - name: Set up Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: packages/demo_common/package-lock.json | ||
| - name: Install npm dependencies | ||
| run: npm ci | ||
| - name: Run tests | ||
| run: bundle exec rake spec | ||
|
|
||
| lint-javascript-demo-common: | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: packages/demo_common | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: packages/demo_common/package-lock.json | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| - name: Run ESLint | ||
| run: npm run lint | ||
| continue-on-error: true # Allow to continue if lint script doesn't exist | ||
| - name: Check Prettier formatting | ||
| run: npm run format:check | ||
| continue-on-error: true # Allow to continue if format script doesn't exist | ||
|
||
|
|
||
| # Matrix build for demos when they are added | ||
| test-demos: | ||
| if: github.event_name == 'pull_request' | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| demo: [] # Will be populated as demos are added | ||
| fail-fast: false | ||
| steps: | ||
|
Comment on lines
76
to
80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove empty matrix; run loop without strategy. Empty Apply this diff: - strategy:
- matrix:
- demo: [] # Will be populated as demos are added
- fail-fast: falseπ§° Toolsπͺ actionlint (1.7.7)78-78: "matrix values" section should not be empty (syntax-check) π€ Prompt for AI Agents |
||
| - uses: actions/checkout@v4 | ||
| - name: Detect changed demos | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| id: changed-demos | ||
| run: | | ||
| if [ -d "demos" ] && [ "$(ls -A demos)" ]; then | ||
| CHANGED=$(git diff --name-only origin/main...HEAD | grep '^demos/' | cut -d/ -f2 | sort -u | head -5) | ||
| if [ -n "$CHANGED" ]; then | ||
| echo "demos=$CHANGED" >> $GITHUB_OUTPUT | ||
| fi | ||
| fi | ||
| - name: Set up Ruby | ||
| if: steps.changed-demos.outputs.demos | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '3.3' | ||
| - name: Set up Node | ||
| if: steps.changed-demos.outputs.demos | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| - name: Run demo tests | ||
| if: steps.changed-demos.outputs.demos | ||
| run: | | ||
| for demo in ${{ steps.changed-demos.outputs.demos }}; do | ||
| if [ -d "demos/$demo" ]; then | ||
| echo "Testing $demo..." | ||
| cd "demos/$demo" | ||
| if [ -f "Gemfile" ]; then | ||
| bundle install | ||
| fi | ||
| if [ -f "package.json" ]; then | ||
| npm ci | ||
| fi | ||
| if [ -f "bin/rails" ] && [ -f "spec" ]; then | ||
| bundle exec rspec | ||
| fi | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| cd ../.. | ||
| fi | ||
| done | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,54 @@ | ||
| *.gem | ||
| *.rbc | ||
| .bundle | ||
| .config | ||
| .yardoc | ||
| Gemfile.lock | ||
| InstalledFiles | ||
| _yardoc | ||
| coverage | ||
| doc/ | ||
| lib/bundler/man | ||
| pkg | ||
| rdoc | ||
| spec/reports | ||
| test/tmp | ||
| test/version_tmp | ||
| tmp | ||
| *.bundle | ||
| *.so | ||
| *.o | ||
| *.a | ||
| mkmf.log | ||
| # Dependencies | ||
| node_modules/ | ||
| npm-debug.log* | ||
| yarn-error.log* | ||
| .DS_Store | ||
| *.log | ||
| .pnpm-debug.log* | ||
|
|
||
| # Build outputs | ||
| dist/ | ||
| build/ | ||
| tmp/ | ||
| coverage/ | ||
|
|
||
| # IDE | ||
| .idea/ | ||
| .vscode/ | ||
| .vscode/ | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
| .DS_Store | ||
|
|
||
| # Environment | ||
| .env | ||
| .env.local | ||
| .env.*.local | ||
|
|
||
| # Ruby | ||
| *.gem | ||
| .bundle/ | ||
| vendor/bundle/ | ||
| .ruby-version | ||
| .ruby-gemset | ||
|
|
||
| # Rails | ||
| /demos/*/log/* | ||
| /demos/*/tmp/* | ||
| !/demos/*/log/.keep | ||
| !/demos/*/tmp/.keep | ||
| /demos/*/storage/* | ||
| !/demos/*/storage/.keep | ||
| /demos/*/public/assets | ||
| /demos/*/public/packs | ||
| /demos/*/public/packs-test | ||
| /demos/*/yarn-error.log | ||
|
|
||
| # Testing | ||
| /demos/*/coverage/ | ||
| /demos/*/test/reports/ | ||
|
|
||
| # Database | ||
| /demos/*/db/*.sqlite3 | ||
| /demos/*/db/*.sqlite3-* | ||
|
|
||
| # Ignore master key for decrypting credentials and more | ||
| /demos/*/config/master.key | ||
| /demos/*/config/credentials.yml.enc |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| # Contributing to React on Rails Demos | ||
|
|
||
| Thank you for your interest in contributing to the React on Rails demo applications! This document provides guidelines and instructions for contributing. | ||
|
|
||
| ## Code of Conduct | ||
|
|
||
| Please note that this project adheres to a code of conduct. By participating, you are expected to uphold this standard. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| 1. Fork the repository | ||
| 2. Clone your fork | ||
| 3. Create a new branch for your feature or fix | ||
| 4. Make your changes | ||
| 5. Run tests and linting | ||
| 6. Submit a pull request | ||
|
|
||
| ## Development Setup | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| - Ruby 3.3+ | ||
| - Node.js 20+ | ||
| - PostgreSQL | ||
| - pnpm (recommended) or npm/yarn | ||
|
|
||
| ### Initial Setup | ||
|
|
||
| ```bash | ||
| # Clone the repository | ||
| git clone https://github.com/shakacode/react_on_rails-demos.git | ||
| cd react_on_rails-demos | ||
|
|
||
| # Bootstrap all demos | ||
| ./scripts/bootstrap-all.sh | ||
| ``` | ||
|
|
||
| ## Working with Demos | ||
|
|
||
| ### Running a Specific Demo | ||
|
|
||
| ```bash | ||
| cd demos/react_on_rails-demo-v16-[feature-name] | ||
| bin/dev | ||
| ``` | ||
|
|
||
| ### Creating a New Demo | ||
|
|
||
| ```bash | ||
| ./scripts/new-demo.sh react_on_rails-demo-v16-your-feature | ||
|
|
||
| # Or use the scaffold script with options: | ||
| ./scripts/scaffold-demo.sh react_on_rails-demo-v16-your-feature --typescript --tailwind | ||
| ``` | ||
|
|
||
| ### Testing | ||
|
|
||
| Run tests for all demos: | ||
| ```bash | ||
| ./scripts/test-all.sh | ||
| ``` | ||
|
|
||
| Run tests for a specific demo: | ||
| ```bash | ||
| cd demos/react_on_rails-demo-v16-[feature-name] | ||
| bundle exec rspec | ||
| ``` | ||
|
|
||
| ## Code Style | ||
|
|
||
| All demos share common linting configurations: | ||
|
|
||
| ### Ruby Code | ||
| ```bash | ||
| bundle exec rubocop | ||
| ``` | ||
|
|
||
| ### JavaScript/TypeScript Code | ||
| ```bash | ||
| pnpm run lint | ||
| ``` | ||
|
|
||
| ## Commit Guidelines | ||
|
|
||
| - Use clear, descriptive commit messages | ||
| - Follow conventional commit format when possible | ||
| - Reference issues in commit messages where applicable | ||
|
|
||
| Example: | ||
| ``` | ||
| feat: add TypeScript support to v16 demo | ||
|
|
||
| - Configure TypeScript with React on Rails | ||
| - Add type definitions for server rendering | ||
| - Update webpack configuration | ||
|
|
||
| Fixes #123 | ||
| ``` | ||
|
|
||
| ## Pull Request Process | ||
|
|
||
| 1. **Update Documentation**: Ensure README files are updated with details of changes | ||
| 2. **Run Tests**: Verify all tests pass locally | ||
| 3. **Lint Code**: Ensure code passes all linting checks | ||
| 4. **Update Changelog**: Add notes about your changes if significant | ||
| 5. **Request Review**: Tag maintainers for review | ||
|
|
||
| ### PR Title Format | ||
|
|
||
| Use descriptive titles that explain what the PR does: | ||
| - `feat: add React Server Components demo` | ||
| - `fix: correct webpack configuration in SSR demo` | ||
| - `docs: update setup instructions for demos` | ||
|
|
||
| ## Demo Standards | ||
|
|
||
| Each demo should: | ||
|
|
||
| 1. **Have a Clear Purpose**: Focus on demonstrating specific React on Rails features | ||
| 2. **Include Documentation**: Provide a comprehensive README explaining: | ||
| - What features are demonstrated | ||
| - How to run the demo | ||
| - Key files to examine | ||
| - Any special configuration | ||
| 3. **Follow Best Practices**: Use current React on Rails best practices | ||
| 4. **Be Self-Contained**: Each demo should run independently | ||
| 5. **Include Tests**: Add appropriate test coverage | ||
|
|
||
| ## Shared Configuration | ||
|
|
||
| When modifying shared configuration in `packages/demo_common/`: | ||
|
|
||
| 1. Test changes across multiple demos | ||
| 2. Update documentation if configuration options change | ||
| 3. Consider backward compatibility | ||
| 4. Update the gem/npm package versions appropriately | ||
|
|
||
| ## Questions and Support | ||
|
|
||
| - Open an issue for bugs or feature requests | ||
| - Join the [ShakaCode Slack](https://www.shakacode.com/slack-invite) for discussion | ||
| - Tag `@shakacode/react-on-rails` for React on Rails specific questions | ||
|
|
||
| ## License | ||
|
|
||
| By contributing, you agree that your contributions will be licensed under the same license as the project. | ||
|
|
||
| ## Acknowledgments | ||
|
|
||
| Thank you for helping make React on Rails better through clear, working examples! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix paths to renamed package directory (breaking).
Jobs still use packages/demo_common. The repo renamed to packages/shakacode_demo_common, so steps will run in a non-existent path and fail.
Apply this diff:
Also applies to: 22-22, 30-31, 38-38, 44-45, 54-55, 62-62
π€ Prompt for AI Agents