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
* Watch folders based on BuildState
* Add additional test cases
* Code review feedback
* Make test cross plat (I hope)
* Avoids sleeps in test
* Log error when source folder does not exist.
* Add changelog entry
* Code review feedback
* Avoid race condition (I hope)
* Trigger CI
Copy file name to clipboardExpand all lines: AGENTS.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -389,6 +389,20 @@ make test-rewatch # Run integration tests
389
389
390
390
**Integration Tests**: The `make test-rewatch` command runs bash-based integration tests located in `rewatch/tests/suite.sh`. These tests use the `rewatch/testrepo/` directory as a test workspace with various package configurations to verify rewatch's behavior across different scenarios.
391
391
392
+
**Running Individual Integration Tests**: You can run individual test scripts directly by setting up the environment manually:
cargo run --manifest-path rewatch/Cargo.toml -- build
412
426
```
413
427
428
+
Note that the dev binary is `./rewatch/target/debug/rescript`, not `rewatch`. The binary name is `rescript` because that's the package name in `Cargo.toml`.
429
+
414
430
This is useful when testing rewatch changes against local compiler modifications without running a full `make` build cycle.
415
431
432
+
Use `-v` for info-level logging or `-vv` for debug-level logging (e.g., to see which folders are being watched in watch mode):
433
+
434
+
```bash
435
+
cargo run --manifest-path rewatch/Cargo.toml -- -vv watch <folder>
436
+
```
437
+
416
438
#### Performance Considerations
417
439
418
440
-**Incremental Builds**: Only recompile dirty modules
@@ -467,3 +489,9 @@ When clippy suggests refactoring that could impact performance, consider the tra
467
489
2. Update `AsyncWatchArgs` for new parameters
468
490
3. Handle different file types (`.res`, `.resi`, etc.)
469
491
4. Consider performance impact of watching many files
492
+
493
+
## CI Gotchas
494
+
495
+
-**`sleep` is fragile** — Prefer polling (e.g., `wait_for_file`) over fixed sleeps. CI runners are slower than local machines.
496
+
-**`exit_watcher` is async** — It only signals the watcher to stop (removes the lock file), it doesn't wait for the process to exit. Avoid triggering config-change events before exiting, as the watcher may start a concurrent rebuild.
497
+
-**`sed -i` differs across platforms** — macOS requires `sed -i '' ...`, Linux does not. Use the `replace` / `normalize_paths` helpers from `rewatch/tests/utils.sh` instead of raw `sed`.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,8 @@
24
24
25
25
#### :nail_care: Polish
26
26
27
+
- Build system: Watch only source folders from build state instead of the entire project directory, and report missing configured source folders. https://github.com/rescript-lang/rescript/pull/8219
0 commit comments