Skip to content

[node] Inherit CommonOptions in ForkOptions to support windowsHide - #75525

Merged
typescript-automation[bot] merged 1 commit into
DefinitelyTyped:masterfrom
christopher-buss:fix/node-fork-windows-hide
Sep 15, 2026
Merged

typescript-automation[bot] merged 1 commit into
DefinitelyTyped:masterfrom
christopher-buss:fix/node-fork-windows-hide

Conversation

@christopher-buss

Copy link
Copy Markdown
Contributor

fork() rejects windowsHide in TypeScript even though Node forwards the option to spawn() and uses it when creating cluster workers. Make ForkOptions extend CommonOptions, as suggested in discussion #75523.

Apply the same one-line correction to the latest, v22, v24, and v25 definitions. Existing child-process tests now exercise windowsHide with both fork overloads and retain coverage of timeout.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. Compiled against the patched definitions and ran both fork overloads with windowsHide: true; stdout, IPC messages, and exit status were preserved.
  • Add or edit tests to reflect the change. The regression tests rejected windowsHide before the declaration change.
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run pnpm test <package to test>. Passed pnpm test node, pnpm test node/v22, pnpm test node/v24, and pnpm test node/v25 across their supported TypeScript configurations.

For this existing definition:

  • Provide source context: Node's fork implementation forwards options to spawn, and its cluster worker implementation explicitly passes windowsHide to fork.
  • No version-number change is needed: this corrects an existing runtime API rather than introducing support for a new Node version.

Repository-wide test-all was not run; local validation was scoped to the Node packages in a sparse checkout.

Generated with Codex.

Extend CommonOptions as suggested in discussion DefinitelyTyped#75523 so fork accepts
windowsHide without a local intersection type. Apply the same correction
to the latest, v22, v24, and v25 definitions and exercise both overloads.

Package checks pass for all four versions. A compiled runtime example
preserves stdout, IPC, and successful exit with hidden forked workers.

Co-authored-by: Codex <[email protected]>
@typescript-automation

typescript-automation Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

@christopher-buss Thank you for submitting this PR!

This is a live comment that I will keep updated.

1 package in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by a DT maintainer

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 75525,
  "author": "christopher-buss",
  "headCommitOid": "1d8eb21ae6a41f47c8f4bc1d26e500ccb4ce236e",
  "mergeBaseOid": "af92471c4aa594ef307ac159ba753cf6a4cc01a0",
  "lastPushDate": "2026-09-07T19:43:07.000Z",
  "lastActivityDate": "2026-09-15T20:27:56.000Z",
  "mergeOfferDate": "2026-09-15T20:26:38.000Z",
  "mergeRequestDate": "2026-09-15T20:27:56.000Z",
  "mergeRequestUser": "christopher-buss",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "tooManyCommits": false,
  "tooManyReviews": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "node",
      "version": "26.5",
      "kind": "edit",
      "files": [
        {
          "path": "types/node/child_process.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/node-tests/child_process.ts",
          "kind": "test"
        },
        {
          "path": "types/node/v22/child_process.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/v22/test/child_process.ts",
          "kind": "test"
        },
        {
          "path": "types/node/v24/child_process.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/v24/test/child_process.ts",
          "kind": "test"
        },
        {
          "path": "types/node/v25/child_process.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/v25/node-tests/child_process.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "Microsoft",
        "jkomyno",
        "r3nya",
        "btoueg",
        "touffy",
        "mohsen1",
        "galkin",
        "eps1lon",
        "WilcoBakker",
        "chyzwar",
        "trivikr",
        "yoursunny",
        "qwelias",
        "ExE-Boss",
        "peterblazejewicz",
        "addaleax",
        "victorperin",
        "NodeJS",
        "LinusU",
        "wafuwafu13",
        "mcollina",
        "Semigradsky",
        "Renegade334",
        "anonrig"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "RyanCavanaugh",
      "date": "2026-09-15T20:26:00.000Z",
      "isMaintainer": true
    },
    {
      "type": "approved",
      "reviewer": "Renegade334",
      "date": "2026-09-07T19:55:38.000Z",
      "isMaintainer": false
    }
  ],
  "mainBotCommentID": 5575013456,
  "ciResult": "pass"
}

@typescript-automation

Copy link
Copy Markdown
Contributor

🔔 @microsoft @jkomyno @r3nya @btoueg @Touffy @mohsen1 @galkin @eps1lon @WilcoBakker @chyzwar @trivikr @yoursunny @qwelias @ExE-Boss @peterblazejewicz @addaleax @victorperin @nodejs @LinusU @wafuwafu13 @mcollina @Semigradsky @Renegade334 @anonrig — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-automation typescript-automation Bot moved this to Waiting for Code Reviews in Pull Request Status Board Sep 7, 2026
@typescript-automation typescript-automation Bot added the Owner Approved A listed owner of this package signed off on the pull request. label Sep 7, 2026
@typescript-automation typescript-automation Bot moved this from Waiting for Code Reviews to Needs Maintainer Review in Pull Request Status Board Sep 7, 2026
nodejs-github-bot pushed a commit to nodejs/node that referenced this pull request Sep 9, 2026
Describe the existing windowsHide option and its false default alongside
the other fork options, using the wording already documented for spawn.

Refs: DefinitelyTyped/DefinitelyTyped#75525
Signed-off-by: christopher-buss <[email protected]>
Assisted-by: Codex
Co-authored-by: Codex <[email protected]>
PR-URL: #65887
Reviewed-By: Xuguang Mei <[email protected]>
Reviewed-By: Stefan Stojanovic <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@christopher-buss

Copy link
Copy Markdown
Contributor Author

The doc change was merged into node if this helps at all :)

@typescript-automation typescript-automation Bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Sep 15, 2026
@typescript-automation

Copy link
Copy Markdown
Contributor

@christopher-buss: Everything looks good here. I am ready to merge this PR (at 1d8eb21) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@microsoft, @jkomyno, @r3nya, @btoueg, @Touffy, @mohsen1, @galkin, @eps1lon, @WilcoBakker, @chyzwar, @trivikr, @yoursunny, @qwelias, @ExE-Boss, @peterblazejewicz, @addaleax, @victorperin, @nodejs, @LinusU, @wafuwafu13, @mcollina, @Semigradsky, @Renegade334, @anonrig: you can do this too.)

@typescript-automation typescript-automation Bot moved this from Needs Maintainer Review to Waiting for Author to Merge in Pull Request Status Board Sep 15, 2026
@christopher-buss

Copy link
Copy Markdown
Contributor Author

Ready to merge

@typescript-automation typescript-automation Bot moved this from Waiting for Author to Merge to Recently Merged in Pull Request Status Board Sep 15, 2026
@typescript-automation
typescript-automation Bot merged commit e839b8f into DefinitelyTyped:master Sep 15, 2026
15 checks passed
@christopher-buss
christopher-buss deleted the fix/node-fork-windows-hide branch September 15, 2026 20:33
aduh95 pushed a commit to nodejs/node that referenced this pull request Sep 16, 2026
Describe the existing windowsHide option and its false default alongside
the other fork options, using the wording already documented for spawn.

Refs: DefinitelyTyped/DefinitelyTyped#75525
Signed-off-by: christopher-buss <[email protected]>
Assisted-by: Codex
Co-authored-by: Codex <[email protected]>
PR-URL: #65887
Reviewed-By: Xuguang Mei <[email protected]>
Reviewed-By: Stefan Stojanovic <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
aduh95 pushed a commit to nodejs/node that referenced this pull request Sep 22, 2026
Describe the existing windowsHide option and its false default alongside
the other fork options, using the wording already documented for spawn.

Refs: DefinitelyTyped/DefinitelyTyped#75525
Signed-off-by: christopher-buss <[email protected]>
Assisted-by: Codex
Co-authored-by: Codex <[email protected]>
PR-URL: #65887
Reviewed-By: Xuguang Mei <[email protected]>
Reviewed-By: Stefan Stojanovic <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Critical package Maintainer Approved Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants