Commit f8e5f4b
authored
fix(global): monitor workspaces dir change (#337)
### TL;DR
Added `is_monorepo` flag to `PackageManager` to properly handle monorepo workspace packages in fingerprint ignores.
### What changed?
- Added an `is_monorepo` field to the `PackageManager` struct to track whether the workspace is a monorepo
- Modified `get_fingerprint_ignores()` to return a `Result` and include parent directories of workspace packages in monorepos
- Added detection logic to determine if a workspace is a monorepo based on the presence of workspace configuration files
- Updated all test fixtures to include the new `is_monorepo` field
- Added a new snap test for issue [#31](voidzero-dev/vite-task#31) to verify the fix works correctly
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Detects monorepos and updates fingerprint ignores to watch workspace parent dirs, wires the change through install, and adds a snap test; also whitelists VITE_* env vars.
>
> - **vite_install (core)**:
> - `PackageManager`:
> - Add `is_monorepo` flag; detect via `WorkspaceFile` in builder.
> - Change `get_fingerprint_ignores()` to return `Result` and, when monorepo, include parent dirs of workspace packages using `get_package_graph()`.
> - Import `get_package_graph` and update ignores logic/tests (add monorepo-specific test).
> - Update test helpers across `commands/*` to set `is_monorepo: false`.
> - **CLI (install)**:
> - Propagate errors from `package_manager.get_fingerprint_ignores()?` when building the task.
> - **Tests/Snaps**:
> - Add `packages/global/snap-tests/command-install-bug-31/*` to verify workspace dir changes are detected (issue #31).
> - **Tools**:
> - Allow `VITE_*` env vars to pass through in `packages/tools/src/utils.ts`.
>
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6e76efa. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 3f2b8a1 commit f8e5f4b
24 files changed
Lines changed: 166 additions & 13 deletions
File tree
- crates/vite_install/src
- commands
- packages
- cli/binding/src/commands
- global/snap-tests/command-install-bug-31
- packages/utils
- tools/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
| 306 | + | |
306 | 307 | | |
307 | 308 | | |
308 | 309 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
309 | 310 | | |
310 | 311 | | |
311 | 312 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
| |||
497 | 498 | | |
498 | 499 | | |
499 | 500 | | |
| 501 | + | |
500 | 502 | | |
501 | 503 | | |
502 | 504 | | |
| |||
531 | 533 | | |
532 | 534 | | |
533 | 535 | | |
| 536 | + | |
534 | 537 | | |
535 | 538 | | |
536 | 539 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| |||
0 commit comments