|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +## Project Overview |
| 4 | + |
| 5 | +Monorepo of community-maintained Expo config plugins for React Native libraries. Plugins auto-configure native Android/iOS projects during `npx expo prebuild`. |
| 6 | + |
| 7 | +- **Namespace**: `@config-plugins/*` |
| 8 | +- **Package manager**: Yarn v1 with workspaces |
| 9 | +- **Orchestrator**: Lerna 3.4.1 (independent versioning) |
| 10 | +- **Workspaces**: `apps/*` (example apps), `packages/*` (published plugins) |
| 11 | + |
| 12 | +## Common Commands |
| 13 | + |
| 14 | +```bash |
| 15 | +# Install dependencies |
| 16 | +yarn |
| 17 | + |
| 18 | +# Build all packages |
| 19 | +yarn prepare |
| 20 | + |
| 21 | +# Watch build all packages |
| 22 | +yarn start |
| 23 | + |
| 24 | +# Generate a new plugin |
| 25 | +yarn gen |
| 26 | + |
| 27 | +# Run tests for a specific package |
| 28 | +cd packages/<name> && yarn test |
| 29 | + |
| 30 | +# Lint a specific package |
| 31 | +cd packages/<name> && yarn lint --max-warnings 0 |
| 32 | + |
| 33 | +# Build a specific package |
| 34 | +cd packages/<name> && yarn build |
| 35 | + |
| 36 | +# Clean a specific package |
| 37 | +cd packages/<name> && yarn clean |
| 38 | + |
| 39 | +# Rebuild an example app to test config plugins |
| 40 | +cd apps/<name> && yarn expo prebuild --clean |
| 41 | +``` |
| 42 | + |
| 43 | +## Project Structure |
| 44 | + |
| 45 | +- `packages/` — Config plugin packages (each has `src/`, `__tests__/`) |
| 46 | +- `apps/` — Example apps for testing plugins |
| 47 | +- `fixtures/` — Shared test fixtures (native config files: AppDelegate, build.gradle, Podfile, etc.) |
| 48 | +- `scripts/` — Repo tooling (plugin generator, dependabot config, issue templates) |
| 49 | + |
| 50 | +## Conventions |
| 51 | + |
| 52 | +- Use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) (e.g., `feat(react-native-foo): add bar`) |
| 53 | +- Branch naming: `@your-github-username/type/description` |
| 54 | +- Each package delegates build/test/lint to `expo-module-scripts` |
| 55 | +- TypeScript source in `src/`, compiled output in `build/` |
| 56 | +- Peer dependency on `expo@^55` |
| 57 | +- Tests use Jest with `memfs` for virtual filesystem testing |
| 58 | + |
| 59 | +## CI |
| 60 | + |
| 61 | +GitHub Actions runs on Node 20 and 22. Build step runs `yarn lerna run prepare --stream`, then per-package lint and test. Not all packages have CI tests — check `.github/workflows/test.yml` for the matrix. |
| 62 | + |
| 63 | +## Upgrading Plugins for a New Expo SDK Version |
| 64 | + |
| 65 | +When a new Expo SDK is released (e.g., SDK 54 → SDK 55), every package and example app must be updated. Use conventional commits scoped to the package name (e.g., `chore(react-native-foo): bump to expo@^55`). |
| 66 | + |
| 67 | +### Per-package updates (`packages/<name>/`) |
| 68 | + |
| 69 | +For each package: |
| 70 | + |
| 71 | +1. **`package.json`** — Update `peerDependencies.expo` to `^<NEW_SDK>`. |
| 72 | +2. **`README.md`** — Add a new row to the version compatibility table with the new SDK version, the latest compatible upstream package version, and the next config plugin major version. |
| 73 | +3. **Build & test** — Run `yarn build` and `yarn test` (if tests exist) to verify nothing broke. |
| 74 | + |
| 75 | +### Example app updates (`apps/<name>/`) |
| 76 | + |
| 77 | +For each example app: |
| 78 | + |
| 79 | +1. **`package.json`** — Update `expo` to the new SDK version (e.g., `~54` → `~55`). |
| 80 | +2. Run `npx expo install --fix` to align all other dependencies (`react`, `react-native`, `expo-splash-screen`, etc.) to compatible versions. |
| 81 | +3. Remove any stale vendored templates or files (e.g., old `expo-template-bare-minimum-*.tgz`). |
| 82 | + |
| 83 | +### Monorepo root updates |
| 84 | + |
| 85 | +1. **`package.json`** — Update `expo-module-scripts` to the version matching the new SDK (e.g., `^55.0.2`). |
| 86 | +2. **`scripts/generate-plugin.ts`** — Update `SDK_VERSION` to the new SDK number. |
| 87 | +3. **`scripts/template/package.json`** — Update the `expo` peer dependency version. |
| 88 | + |
| 89 | +### Final steps |
| 90 | + |
| 91 | +1. Run `yarn` from the root to regenerate `yarn.lock`. |
| 92 | +2. Run `yarn prepare` to verify all packages build. |
| 93 | +3. Run tests for packages that have them. |
| 94 | +4. Update `CLAUDE.md` if any conventions changed (e.g., the peer dependency version listed under Conventions). |
| 95 | + |
| 96 | +## After Adding/Removing Packages |
| 97 | + |
| 98 | +Run these from the root: |
| 99 | +```bash |
| 100 | +yarn update-dependabot-config |
| 101 | +yarn update-issue-template |
| 102 | +``` |
0 commit comments