You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(plugin-rsc): simplify contributing guide and fix commands
- Remove Project Structure section and verbose code examples
- Reference existing test files instead of inline examples
- Fix test commands to use correct test-e2e script name
- Add --ui and -g filter options for better developer experience
- Streamline content for contributors and coding agents
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
This guide provides essential tips for contributors working on the RSC plugin.
4
4
5
-
## Project Structure
6
-
7
-
-`src/` - Plugin source code
8
-
-`examples/` - Example projects for testing and documentation
9
-
-`e2e/` - End-to-end tests using Playwright
10
-
-`types/` - TypeScript type definitions
11
-
12
5
## Testing
13
6
14
7
### E2E Test Setup
@@ -17,134 +10,51 @@ The e2e testing uses a scalable approach inspired by React Router's integration
17
10
18
11
#### Test Fixture Patterns
19
12
20
-
**1. Using existing examples directly:**
21
-
22
-
```typescript
23
-
// Test against existing example projects
24
-
const f =useFixture({ root: 'examples/basic', mode: 'dev' })
25
-
```
26
-
27
-
**2. Creating isolated fixtures (full copy):**
13
+
**1. Using existing examples directly:** See `e2e/starter.test.ts` for examples using `useFixture` with existing example projects.
28
14
29
-
```typescript
30
-
// For tests that need to modify files
31
-
test.beforeAll(async () => {
32
-
awaitsetupIsolatedFixture({
33
-
src: 'examples/basic',
34
-
dest: 'examples/e2e/temp/my-test',
35
-
})
36
-
})
37
-
```
15
+
**2. Creating isolated fixtures:** See `e2e/basic.test.ts` for examples using `setupIsolatedFixture` for tests that need to modify files.
38
16
39
-
**3. Creating inline fixtures (recommended for new tests):**
40
-
41
-
```typescript
42
-
// For creating test-specific variations
43
-
test.beforeAll(async () => {
44
-
awaitsetupInlineFixture({
45
-
src: 'examples/starter',
46
-
dest: 'examples/e2e/temp/my-test',
47
-
files: {
48
-
'src/root.tsx': /* tsx */`
49
-
export function Root() {
50
-
return <div>Custom test content</div>
51
-
}
52
-
`,
53
-
'src/client.tsx': /* tsx */`
54
-
"use client";
55
-
export function MyComponent() {
56
-
return <span>Client component</span>
57
-
}
58
-
`,
59
-
},
60
-
})
61
-
})
62
-
```
17
+
**3. Creating inline fixtures (recommended for new tests):** See `e2e/ssr-thenable.test.ts` for examples using `setupInlineFixture` to create test-specific variations.
63
18
64
19
The new test structure uses:
65
20
66
21
-`examples/e2e/temp/` as base directory for test projects
67
22
-`setupInlineFixture` utility for creating test environments
68
23
-`examples/starter` as the lightweight base template (faster than `examples/basic`)
69
-
- Each test project is runnable locally: `pnpm -C packages/plugin-rsc/examples/e2e/temp/my-test dev`
24
+
- Each test project is runnable locally
70
25
71
26
### Adding New Test Cases
72
27
73
-
#### Option 1: Using `setupInlineFixture` (Recommended)
0 commit comments