Commit 5963e36
committed
refactor: Add type annotations and address code review feedback
Address feedback from automated code review:
- Add JSDoc type annotations throughout dev-watch.js for better type
safety (ProcessInfo, ChildProcess, FSWatcher types)
- Add clarifying comment explaining child_process.spawn is
Bun-compatible (Bun supports Node.js APIs)
- Convert test file from require() to ES6 imports (readFileSync)
- Add function documentation with @param and @returns annotations
Note: child_process.spawn is intentionally kept instead of Bun.spawn
for compatibility with existing event handlers. Bun fully supports
child_process APIs. fs.watch from node:fs is the correct API to use
(native Bun.watch() doesn't exist yet).
All tests passing (8/8).1 parent 9bc72dc commit 5963e36
2 files changed
+39
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
| 98 | + | |
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
| |||
116 | 115 | | |
117 | 116 | | |
118 | 117 | | |
119 | | - | |
120 | | - | |
| 118 | + | |
121 | 119 | | |
122 | 120 | | |
123 | 121 | | |
| |||
126 | 124 | | |
127 | 125 | | |
128 | 126 | | |
129 | | - | |
130 | | - | |
| 127 | + | |
131 | 128 | | |
132 | 129 | | |
133 | 130 | | |
| |||
136 | 133 | | |
137 | 134 | | |
138 | 135 | | |
139 | | - | |
140 | | - | |
| 136 | + | |
141 | 137 | | |
142 | 138 | | |
143 | 139 | | |
144 | 140 | | |
145 | 141 | | |
146 | 142 | | |
147 | 143 | | |
148 | | - | |
149 | | - | |
| 144 | + | |
150 | 145 | | |
151 | 146 | | |
152 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
| |||
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
| 35 | + | |
27 | 36 | | |
| 37 | + | |
28 | 38 | | |
| 39 | + | |
29 | 40 | | |
| 41 | + | |
30 | 42 | | |
| 43 | + | |
31 | 44 | | |
32 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
33 | 51 | | |
34 | 52 | | |
35 | 53 | | |
36 | 54 | | |
37 | 55 | | |
| 56 | + | |
38 | 57 | | |
39 | 58 | | |
40 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
41 | 65 | | |
42 | 66 | | |
43 | 67 | | |
| |||
70 | 94 | | |
71 | 95 | | |
72 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
73 | 101 | | |
74 | 102 | | |
75 | 103 | | |
| |||
101 | 129 | | |
102 | 130 | | |
103 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
104 | 136 | | |
105 | 137 | | |
106 | 138 | | |
| |||
0 commit comments