|
76 | 76 | ``` |
77 | 77 |
|
78 | 78 | ## Dependency Management |
| 79 | + |
| 80 | +### pnpm Workspace |
79 | 81 | - Use pnpm for all npm-related commands. We're using a pnpm workspace. |
80 | 82 |
|
| 83 | +### RivetKit Package Resolutions |
| 84 | +The root `/package.json` contains `resolutions` that map RivetKit packages to their local workspace versions: |
| 85 | + |
| 86 | +```json |
| 87 | +{ |
| 88 | + "resolutions": { |
| 89 | + "rivetkit": "workspace:*", |
| 90 | + "@rivetkit/react": "workspace:*", |
| 91 | + "@rivetkit/workflow-engine": "workspace:*", |
| 92 | + // ... other @rivetkit/* packages |
| 93 | + } |
| 94 | +} |
| 95 | +``` |
| 96 | + |
| 97 | +When adding RivetKit dependencies to examples in `/examples/`, use `*` as the version. The root resolutions will automatically resolve these to the local workspace packages: |
| 98 | + |
| 99 | +```json |
| 100 | +{ |
| 101 | + "dependencies": { |
| 102 | + "rivetkit": "*", |
| 103 | + "@rivetkit/react": "*" |
| 104 | + } |
| 105 | +} |
| 106 | +``` |
| 107 | + |
| 108 | +If you need to add a new `@rivetkit/*` package that isn't already in the root resolutions, add it to the `resolutions` object in `/package.json` with `"workspace:*"` as the value. Internal packages like `@rivetkit/workflow-engine` should be re-exported from `rivetkit` subpaths (e.g., `rivetkit/workflow`) rather than added as direct dependencies. |
| 109 | + |
| 110 | +### Rust Dependencies |
| 111 | + |
81 | 112 | ## Documentation |
82 | 113 |
|
83 | 114 | - If you need to look at the documentation for a package, visit `https://docs.rs/{package-name}`. For example, serde docs live at https://docs.rs/serde/ |
@@ -168,7 +199,7 @@ Key points: |
168 | 199 | - For example: `fn foo() -> Result<i64> { /* ... */ }` |
169 | 200 | - Do not glob import (`::*`) from anyhow. Instead, import individual types and traits |
170 | 201 |
|
171 | | -**Dependency Management** |
| 202 | +**Rust Dependency Management** |
172 | 203 | - When adding a dependency, check for a workspace dependency in Cargo.toml |
173 | 204 | - If available, use the workspace dependency (e.g., `anyhow.workspace = true`) |
174 | 205 | - If you need to add a dependency and can't find it in the Cargo.toml of the workspace, add it to the workspace dependencies in Cargo.toml (`[workspace.dependencies]`) and then add it to the package you need with `{dependency}.workspace = true` |
@@ -220,6 +251,7 @@ Data structures often include: |
220 | 251 | ## Testing Guidelines |
221 | 252 | - When running tests, always pipe the test to a file in /tmp/ then grep it in a second step. You can grep test logs multiple times to search for different log lines. |
222 | 253 | - For RivetKit TypeScript tests, run from `rivetkit-typescript/packages/rivetkit` and use `pnpm test <filter>` with `-t` to narrow to specific suites. For example: `pnpm test driver-file-system -t ".*Actor KV.*"`. |
| 254 | +- For frontend testing, use the `agent-browser` skill to interact with and test web UIs in examples. This allows automated browser-based testing of frontend applications. |
223 | 255 |
|
224 | 256 | ## Optimizations |
225 | 257 |
|
|
0 commit comments