|
| 1 | +# Development |
| 2 | + |
| 3 | +This is a multi-language monorepo (JS / Ruby / PHP). To avoid requiring every contributor to install three toolchains locally, **all tests run inside Docker**. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Docker + Docker Compose |
| 8 | + |
| 9 | +That's it. No local Node, Ruby, PHP, or Composer needed. |
| 10 | + |
| 11 | +## Running tests |
| 12 | + |
| 13 | +```bash |
| 14 | +make test # all three languages |
| 15 | +make test-node # eslint-plugin-aaa |
| 16 | +make test-ruby # rubocop-aaa |
| 17 | +make test-php # phpcs-aaa |
| 18 | +``` |
| 19 | + |
| 20 | +Under the hood these run `docker compose run --rm <service>` against the services defined in `docker-compose.yml`: |
| 21 | + |
| 22 | +| Service | Image | Workdir | |
| 23 | +|---|---|---| |
| 24 | +| `node` | `node:20-alpine` | repo root (npm workspaces) | |
| 25 | +| `ruby` | `ruby:3.2-alpine` | `packages/rubocop-aaa` | |
| 26 | +| `php` | `composer:2` | `packages/phpcs-aaa` | |
| 27 | + |
| 28 | +The first run pulls images and installs dependencies into bind-mounted volumes (`node_modules`, `packages/rubocop-aaa/vendor/bundle`, `packages/phpcs-aaa/vendor`). Subsequent runs are fast. |
| 29 | + |
| 30 | +## Dev Container (optional) |
| 31 | + |
| 32 | +Opening the repo in VS Code with the Dev Containers extension will build a universal image pre-loaded with Node 20, Ruby 3.2, PHP 8.2, and Docker-in-Docker. See `.devcontainer/devcontainer.json`. |
| 33 | + |
| 34 | +## Running locally (without Docker) |
| 35 | + |
| 36 | +If you have the relevant toolchain installed you can also run tests directly: |
| 37 | + |
| 38 | +```bash |
| 39 | +# JS |
| 40 | +npm test --workspace=eslint-plugin-aaa |
| 41 | + |
| 42 | +# Ruby |
| 43 | +cd packages/rubocop-aaa && bundle install && bundle exec rspec |
| 44 | + |
| 45 | +# PHP |
| 46 | +cd packages/phpcs-aaa && composer install && composer test |
| 47 | +``` |
| 48 | + |
| 49 | +## Cleaning up |
| 50 | + |
| 51 | +```bash |
| 52 | +make clean # remove node_modules, vendor/, .bundle/ |
| 53 | +``` |
0 commit comments