|
1 | | -# CLAUDE.md |
| 1 | +# AGENTS.md |
2 | 2 |
|
3 | | -This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 3 | +Re.Pack is a toolkit for building and developing React Native applications with Webpack or Rspack instead of Metro. This repository contains the core bundling/runtime packages, integration plugins, and validation apps/tests used to verify behavior across supported setups. |
4 | 4 |
|
5 | | -## Development Commands |
| 5 | +## Repository Shape |
6 | 6 |
|
7 | | -This is a pnpm monorepo using Turborepo for task orchestration. The root package.json contains the most important commands: |
| 7 | +- This is a JavaScript/TypeScript monorepo for Re.Pack (React Native bundling with Webpack/Rspack). |
| 8 | +- `packages/` contains core libraries and integrations. |
| 9 | +- `apps/` contains runnable validation applications. |
| 10 | +- `tests/` contains compatibility and regression suites. |
8 | 11 |
|
9 | | -**Build & Development:** |
10 | | -- `pnpm build` - Run a Turborepo build across workspace packages |
11 | | -- `pnpm dev` - Run Turborepo watch mode for build across workspace packages |
12 | | -- `pnpm lint` - Run Biome linter with auto-fix |
13 | | -- `pnpm lint:ci` - Run Biome linter without auto-fix (CI mode) |
14 | | -- `pnpm typecheck` - Run TypeScript checking across all packages |
15 | | -- `pnpm test` - Run tests across all packages |
| 12 | +## Package Map (Relatively Stable Context) |
16 | 13 |
|
17 | | -**iOS Development:** |
18 | | -- `pnpm pods` - Install CocoaPods dependencies for all apps |
19 | | -- `pnpm pods:update` - Update CocoaPods dependencies |
| 14 | +- `packages/repack/`: Core toolkit with CLI commands, bundler plugins/loaders, and runtime modules. |
| 15 | +- `packages/dev-server/`: Bundler-agnostic React Native development server. |
| 16 | +- `packages/init/`: Initialization tooling for integrating Re.Pack into React Native projects. |
| 17 | +- `packages/plugin-expo-modules/`: Re.Pack integration for Expo Modules. |
| 18 | +- `packages/plugin-nativewind/`: Re.Pack integration for NativeWind. |
| 19 | +- `packages/plugin-reanimated/`: Re.Pack integration for react-native-reanimated. |
20 | 20 |
|
21 | | -**Testing with specific configurations:** |
22 | | -Use the test apps in the `apps/` directory to verify functionality: |
23 | | -- `apps/tester-app` - Main test application |
24 | | -- `apps/tester-federation-v2` - Module Federation v2 testing |
25 | | -- `apps/tester-federation` - Module Federation v1 testing |
| 21 | +## Validation Surfaces |
26 | 22 |
|
27 | | -**Individual package commands:** |
28 | | -Navigate to specific packages and use their local scripts. For example, in `packages/repack/`: |
29 | | -- `pnpm test` - Run Jest tests |
30 | | -- `pnpm build` - Build the package |
31 | | -- `pnpm clang-format` - Format native code (iOS and Android) |
| 23 | +### Apps |
32 | 24 |
|
33 | | -## Architecture Overview |
| 25 | +- `apps/tester-app/`: Primary manual/integration validation app. |
| 26 | +- `apps/tester-federation/`: Module Federation v1 validation app. |
| 27 | +- `apps/tester-federation-v2/`: Module Federation v2 validation app. |
34 | 28 |
|
35 | | -Re.Pack is a React Native bundler that provides webpack/rspack bundling as an alternative to Metro. The codebase is organized as follows: |
| 29 | +### Tests |
36 | 30 |
|
37 | | -**Core Packages:** |
38 | | -- `packages/repack/` - Main bundler package with CLI commands, webpack plugins, and runtime modules |
39 | | -- `packages/dev-server/` - Development server implementation |
40 | | -- `packages/init/` - CLI tool for initializing Re.Pack in React Native projects |
41 | | -- `packages/plugin-*` - Various plugins (expo-modules, nativewind, reanimated) |
42 | | - |
43 | | -**Key Architecture Components:** |
44 | | -- **Commands** (`packages/repack/src/commands/`) - CLI implementations for rspack and webpack bundling |
45 | | -- **Plugins** (`packages/repack/src/plugins/`) - Webpack/Rspack plugins for React Native bundling |
46 | | -- **Loaders** (`packages/repack/src/loaders/`) - Custom webpack loaders (assets, babel, flow, react-refresh) |
47 | | -- **Modules** (`packages/repack/src/modules/`) - Runtime modules including ScriptManager for chunk loading |
48 | | -- **Native Code** - iOS (Swift/Objective-C) and Android (Kotlin) implementations in `packages/repack/ios/` and `packages/repack/android/` |
49 | | - |
50 | | -**Development Server:** |
51 | | -The development server supports both single-platform (webpack CLI) and multi-platform (repack commands) modes with features like HMR, symbolication, and debugging. |
52 | | - |
53 | | -**Module Federation:** |
54 | | -Re.Pack provides first-class support for Module Federation for microfrontend architectures, with plugins for both v1 and v2. |
55 | | - |
56 | | -## Code Style & Standards |
57 | | - |
58 | | -- **Biome:** Uses Biome (configured in `biome.jsonc`) for import organization, formatting, and linting with specific rules for different file types |
59 | | -- **TypeScript:** Strict TypeScript configuration with path mapping |
60 | | -- **Formatting:** 2-space indentation, single quotes, trailing commas (ES5), semicolons always |
61 | | -- **Import Organization:** Biome automatically organizes imports when running `pnpm lint` |
62 | | -- **Native Code:** Use clang-format for iOS/Android C++/Swift/Kotlin code formatting |
63 | | - |
64 | | -## Testing Strategy |
65 | | - |
66 | | -- Jest for unit tests with specific configurations per package |
67 | | -- Metro compatibility tests in `tests/metro-compat/` |
68 | | -- Resolver test cases in `tests/resolver-cases/` |
69 | | -- Integration testing via tester apps |
70 | | - |
71 | | -## Key Development Notes |
72 | | - |
73 | | -- This is a monorepo managed by pnpm workspaces with Turborepo orchestration |
74 | | -- The project supports both Webpack and Rspack as bundling engines |
75 | | -- Native modules require building iOS and Android code when making changes |
76 | | -- Always run `pnpm lint` and `pnpm typecheck` before committing changes |
77 | | -- Use the tester apps to verify functionality across different React Native configurations |
78 | | -- When working with native code, run `pnpm clang-format` to ensure consistent formatting |
| 31 | +- `tests/integration/`: Integration-level automated coverage. |
| 32 | +- `tests/metro-compat/`: Metro compatibility behavior coverage. |
| 33 | +- `tests/resolver-cases/`: Resolver behavior and edge-case coverage. |
0 commit comments