Porting process to V3#87
Merged
Merged
Conversation
Co-authored-by: Charles Lowell <cowboyd@frontside.com>
> resolves #360 This adds a `spawn()` operation to the `Task` api which, unsuprisingly, spawns a child in the context of a particular task. Note that this is an _operation_, and not a synchronous function. Calling the `spawn()` method will not actually do anything until the operation is evaluated. Now, it is very easy and safe to spawn operations within the context of a specific task without having to use the `within()` syntax (which we might deprecate in the future).
Co-authored-by: frontsidejack <frontsidejack@users.noreply.github.com>
* create a lib directory for esm * add tsconfig.dist-esm.json * copy package.json into dist for version in @effection/core * rename tsconfig.dist.json to tsconfig.cjs.json * add tsconfig.esm.json files * rollback inspect-ui changes * add return types * more return types * readd patches * fix copy * add copy task to core * again * remove copy * remove copy * remove copy 2 * copy 3 * copy 4 * copy 5 * use cp instead of copy * use copy-cli alias
* Add sideEffects field to package.json * expand sideEffects in inspect-ui * remove sideEffects from mocha package.json * remove sideEffects from inspect
Co-authored-by: frontsidejack <frontsidejack@users.noreply.github.com>
Add spawn operation directly to Task.
cowboyd
reviewed
Oct 8, 2025
cowboyd
left a comment
Member
There was a problem hiding this comment.
It seems like there are a lot of changes on this branch that are unrelated to process. Did these come in from a different branch?
Member
Author
|
I imported history from v2 when bringing process and it imported all of those commits. |
cowboyd
approved these changes
Oct 9, 2025
added 3 commits
October 17, 2025 19:07
Downgraded packages to versions lower than their lowest published versions on JSR: - websocket: 2.1.0 → 2.0.0 - worker: 0.2.0 → 0.1.0 - test-adapter: 0.5.1 → 0.1.0 - timebox: 0.2.0 → 0.1.0 - watch: 0.2.0 → 0.1.1 - jsonl-store: 0.2.0 → 0.1.0 - task-buffer: 1.1.0 → 1.0.1 - raf: 1.0.0-alpha.1 → 0.0.1 All packages were previously downgraded from Effection v4 to v3, and now need version numbers that don't conflict with already-published versions. Added path-dependencies.md documenting: - Projects with path-based dependencies - Effection v4 → v3 downgrade history - Published versions on JSR - Suggested downgrade versions
Updated dependency versions to match downgraded package versions: - worker: timebox dependency from ^0.2.0 → ^0.1.0 - bdd: test-adapter dependency from ^0.5.1 → ^0.1.0 These packages depend on packages that were downgraded to unpublished versions, so their dependency constraints need to be updated accordingly. Updated path-dependencies.md to document the dependency changes.
Changes: - process: stream-helpers path → jsr:@effectionx/stream-helpers@0.3.0 - watch: process path → jsr:@effectionx/process@0.5.0 - watch: stream-helpers path → jsr:@effectionx/stream-helpers@0.3.0 - worker: timebox jsr → npm:@effectionx/timebox@^0.1.0 - stream-helpers: signals jsr → npm:@effectionx/signals@0.3.0 - bdd: test-adapter npm → jsr:@effectionx/test-adapter@^0.1.0 - All packages: bdd version 0.1.0 → 0.2.2 to match actual bdd package version Most @effectionx packages use JSR for dependencies on other @effectionx packages except timebox and signals which use npm. Dependency versions now match actual package versions to avoid Deno workspace member warnings.
added 2 commits
October 17, 2025 19:43
Added version constraint @6.0.6 to @types/cross-spawn in the @ts-types directive to satisfy JSR publish requirements. This ensures the package can be published without warnings about missing version constraints.
taras
pushed a commit
that referenced
this pull request
Dec 8, 2025
### 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`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
We need a repliable way to spawn processes. We did a lot of research for processes in v2 and it running it's tests passed on my machine which has been experiecing a weird problem not being able to terminate processes.
Approach
Rewrite to V3