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
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+46-16Lines changed: 46 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,31 +3,38 @@
3
3
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
4
4
5
5
## Project Overview
6
+
6
7
AMQP client.js is a TypeScript library providing AMQP 0-9-1 client functionality for both Node.js (TCP Socket) and browsers (WebSocket). The library has zero runtime dependencies and is designed for high performance messaging.
7
8
8
9
## Working Effectively
9
10
10
11
### Prerequisites and Setup
12
+
11
13
- Requires Node.js >= 16.0.0 (verified working with Node.js 20.x)
12
14
- Docker and Docker Compose for RabbitMQ testing server
13
15
- For browser testing: Playwright (optional, may not work in all environments)
14
16
15
17
### Bootstrap and Build Process
18
+
16
19
Run these commands in sequence:
17
20
18
21
1.**Install dependencies**:
22
+
19
23
```bash
20
24
npm install
21
25
```
26
+
22
27
- Takes ~16 seconds
23
28
- Automatically runs the build process via `prepare` script
24
29
- NEVER CANCEL: Set timeout to 30+ minutes for initial install
25
30
26
31
2.**Manual build** (if needed):
32
+
27
33
```bash
28
34
npm run build
29
35
```
30
-
- Takes ~5.4 seconds
36
+
37
+
- Takes ~5.4 seconds
31
38
- NEVER CANCEL: Set timeout to 10+ minutes
32
39
- Creates three output formats:
33
40
- ES modules in `lib/mjs/`
@@ -36,9 +43,11 @@ Run these commands in sequence:
36
43
- Browser bundle in `dist/`
37
44
38
45
3.**Start RabbitMQ services**:
46
+
39
47
```bash
40
48
docker compose up -d
41
49
```
50
+
42
51
- Takes ~11 seconds for first startup
43
52
- NEVER CANCEL: Set timeout to 15+ minutes for Docker image pulls
44
53
- Starts RabbitMQ server on ports 5671 (TLS) and 5672 (plain)
@@ -47,42 +56,51 @@ Run these commands in sequence:
47
56
### Testing
48
57
49
58
#### Node.js Tests
59
+
50
60
```bash
51
61
npm test
52
62
```
63
+
53
64
- Takes ~15 seconds
54
65
- NEVER CANCEL: Set timeout to 30+ minutes
55
66
- Runs Node.js tests with coverage using Vitest
56
67
-**EXPECTED**: 2 TLS-related tests may fail if certificates are not set up (normal in development)
57
68
- All other tests should pass when RabbitMQ is running
58
69
59
-
#### Browser Tests
70
+
#### Browser Tests
71
+
60
72
```bash
61
73
npx playwright install --with-deps chromium
62
74
npm run test-browser
63
75
```
76
+
64
77
-**WARNING**: Playwright installation often fails in CI environments
65
78
- Browser tests require WebSocket functionality
66
79
- NEVER CANCEL: Playwright install can take 30+ minutes
67
80
- Only attempt browser tests if Playwright installs successfully
68
81
69
82
#### Linting
83
+
70
84
```bash
71
85
npm run lint
72
86
```
87
+
73
88
- Takes ~1.8 seconds
74
89
- Uses ESLint with TypeScript support
75
90
- Must pass before committing (CI requirement)
76
91
77
92
#### Documentation Generation
93
+
78
94
```bash
79
-
npm run docs
95
+
npm run docs
80
96
```
97
+
81
98
- Takes ~3.4 seconds
82
99
- Generates API documentation in `docs/` directory
83
100
- Uses TypeDoc
84
101
85
102
### Validation Scenarios
103
+
86
104
After making changes, always run this validation sequence:
87
105
88
106
1.**Build validation**: `npm run build` - ensure TypeScript compilation succeeds
@@ -91,89 +109,101 @@ After making changes, always run this validation sequence:
91
109
4.**Functionality validation**: Test actual AMQP operations (see examples below)
92
110
93
111
### Manual Functional Testing
112
+
94
113
Always test functionality manually when making changes to core AMQP logic:
- Uses DataView for binary protocol parsing (browser compatibility)
167
196
- Optimized frame buffering for WebSocket connections
168
197
169
198
## Development Workflow
199
+
170
200
1. Start RabbitMQ: `docker compose up -d`
171
-
2. Install dependencies: `npm install`
201
+
2. Install dependencies: `npm install`
172
202
3. Make changes to `src/` files
173
203
4. Build: `npm run build`
174
204
5. Test: `npm test`
175
205
6. Lint: `npm run lint`
176
206
7. Manual validation with real AMQP operations
177
207
8. Clean up: `docker compose down`
178
208
179
-
Always run the full validation sequence before committing changes. The CI pipeline (.github/workflows/ci.yml) will run all these steps and must pass for merge approval.
209
+
Always run the full validation sequence before committing changes. The CI pipeline (.github/workflows/ci.yml) will run all these steps and must pass for merge approval.
0 commit comments