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
Merge pull request #99 from thefrontside/tm/try-v4
### Motivation
All `@effectionx` extensions were migrated to v3 in #87, but we now want to ensure compatibility with effection v4. This PR adds the infrastructure to run tests against both v3 and v4 versions of effection, and prepares all packages for publishing with dual version support.
### Changes
#### Import Map Generation
- Created `tasks/generate-importmap.ts` that **dynamically fetches the latest v4 version** from the npm registry at generation time
- The import map automatically collects all external dependencies from workspace packages
- Maps `@effectionx/*` packages to their local paths for testing
#### CI Workflow Updates
- Refactored `.github/workflows/verify-posix.yaml` and `.github/workflows/verify-windows.yaml` to use `workflow_call` for reusability
- CI now runs both **V3 Tests** and **V4 Tests** on every PR and push to main
- Added `--trace-leaks` flag to v4 tests for better debugging
- Updated publish workflow to require verification jobs before publishing
#### NPM Peer Dependency
- Updated `tasks/build-npm.ts` to use `"effection": "^3 || ^4.0.0-0"` to support v4 prereleases
#### Version Bumps
All 16 packages received minor version bumps to publish with v3/v4 compatibility:
| Package | New Version |
|---------|-------------|
| @effectionx/context-api | 0.2.0 |
| @effectionx/deno-deploy | 0.3.0 |
| @effectionx/bdd | 0.3.0 |
| @effectionx/jsonl-store | 0.3.0 |
| @effectionx/fx | 0.3.0 |
| @effectionx/raf | 0.1.0 |
| @effectionx/task-buffer | 1.2.0 |
| @effectionx/test-adapter | 0.6.0 |
| @effectionx/timebox | 0.3.0 |
| @effectionx/tinyexec | 0.3.0 |
| @effectionx/watch | 0.3.0 |
| @effectionx/websocket | 2.2.0 |
| @effectionx/worker | 0.3.0 |
| @effectionx/stream-helpers | 0.4.0 |
| @effectionx/signals | 0.4.0 |
| @effectionx/process | 0.6.0 |
#### Test Adapter Enhancements
- Added sanitization options to test functions for disabling operation and resource sanitization when needed
#### Resource Refactoring
- Converted process to use resource pattern (required for v4 compatibility)
- Refactored inspector into a resource
#### Test Compatibility Fixes
Multiple test files were updated to work with both v3 and v4:
- Added `sleep(0)` calls to give the operation tree time to set up subscriptions
- Wrapped operations in `spawn` where v4's stricter lifecycle management requires it
- Fixed `batch` stream completion handling for proper done state propagation
#### Documentation
- Added testing instructions to root `README.md` for running v3 and v4 tests
- Rewrote `process/README.md` with comprehensive documentation
### How to Use
1. Generate the v4 import map:
```bash
deno task generate-importmap
```
2. Run tests with v4:
```bash
deno test --import-map v4.importmap.json -A
```
3. Run tests with v3 (default):
```bash
deno test -A
```
### Summary
- **53 files changed**, 1,211 insertions(+), 489 deletions(-)
- Key packages affected: `stream-helpers`, `signals`, `task-buffer`, `watch`, `process`, `test-adapter`, `fx`
Copy file name to clipboardExpand all lines: bdd/mod.ts
+74-17Lines changed: 74 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -6,24 +6,65 @@ import {
6
6
itas$it,
7
7
}from"@std/testing/bdd";
8
8
9
+
/**
10
+
* Sanitization options for test cases and test suites.
11
+
* These options control Deno's test sanitizers.
12
+
*/
13
+
exportinterfaceSanitizeOptions{
14
+
/** Ensure the test case does not prematurely cause the process to exit. Defaults to true. */
15
+
sanitizeExit?: boolean;
16
+
/** Check that the number of async completed ops after the test is the same as number of dispatched ops. Defaults to true. */
17
+
sanitizeOps?: boolean;
18
+
/** Ensure the test case does not "leak" resources - ie. the resource table after the test has exactly the same contents as before the test. Defaults to true. */
0 commit comments