-
-
Notifications
You must be signed in to change notification settings - Fork 22
WorkerConnector.IConnectOptions.cwd
#94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the tgrid package to version 1.2.0, renames the timeout parameter to options for clarity, and introduces cwd and env options to control worker process environments.
- Bump package version from
1.1.0to1.2.0 - Rename
timeouttooptionsinWorkerConnectormethods - Add
cwdandenvsupport inWorkerConnectorand forward them inProcessWorker
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| package.json | Bumped version from 1.1.0 to 1.2.0 |
| src/protocols/workers/WorkerConnector.ts | Renamed timeout to options and added required cwd/env |
| src/protocols/workers/internal/processes/ProcessWorker.ts | Forward cwd and env into fork options |
Comments suppressed due to low confidence (3)
src/protocols/workers/WorkerConnector.ts:358
- The new cwd field is marked as required. Consider making it optional (cwd?: string) to avoid breaking existing callers who do not provide this option.
cwd: string;
src/protocols/workers/WorkerConnector.ts:363
- The env option is required and replaces the entire child process environment. Consider making it optional (env?: Record<string, string>) and merging it with process.env in the fork call to preserve inherited variables.
env: Record<string, string>;
src/protocols/workers/internal/processes/ProcessWorker.ts:23
- Add tests to verify that the cwd option correctly sets the working directory of the forked process, ensuring the new behavior works as expected in various environments.
cwd: options?.cwd,
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This pull request introduces a version update to the
tgridpackage and enhances theWorkerConnectorclass by improving parameter naming and adding support for specifying the working directory and environment variables for worker processes. Below are the key changes:Version Update:
package.json: Updated the package version from1.1.0to1.2.0.Enhancements to
WorkerConnector:src/protocols/workers/WorkerConnector.ts:timeoutparameter tooptionsfor better clarity in both thecompileandconnectmethods. [1] [2]cwdfor current working directory andenvfor environment variables) in theWorkerConnectornamespace to allow more control over worker server initialization.Process Worker Support:
src/protocols/workers/internal/processes/ProcessWorker.ts: Updated theforkmethod to utilize the newcwdandenvoptions, enabling customization of the worker process environment.