Skip to content

Use cross-spawn types instead of raw types from Node#12029

Open
zpao wants to merge 1 commit into
facebook:mainfrom
zpao:cross-spawn-cleanup
Open

Use cross-spawn types instead of raw types from Node#12029
zpao wants to merge 1 commit into
facebook:mainfrom
zpao:cross-spawn-cleanup

Conversation

@zpao
Copy link
Copy Markdown
Member

@zpao zpao commented May 15, 2026

Cleans up some of the fallout from #11684 which simplified some code but removed some type safety.

Copilot AI review requested due to automatic review settings May 15, 2026 19:42
@zpao zpao requested review from Josh-Cena and slorber as code owners May 15, 2026 19:42
@meta-cla meta-cla Bot added the CLA Signed Signed Facebook CLA label May 15, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 15, 2026

[V2]

Name Link
🔨 Latest commit d2ee224
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/6a0779e8a71e3b0008355b13
😎 Deploy Preview https://deploy-preview-12029--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown

Copilot AI left a 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 restores type safety in create-docusaurus’s process spawning utility by using cross-spawn’s own TypeScript types (rather than reusing Node’s child_process types or suppressing type errors), following refactoring fallout from #11684.

Changes:

  • Add @types/cross-spawn to packages/create-docusaurus devDependencies.
  • Update runCommand()’s SpawnOptions typing to be derived from the cross-spawn call signature.
  • Update yarn.lock to include @types/cross-spawn (and also includes additional dependency resolution changes).

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
yarn.lock Adds @types/cross-spawn, but also includes additional lockfile changes that appear inconsistent with workspace resolutions.
packages/create-docusaurus/src/utils.ts Uses cross-spawn types directly for SpawnOptions to improve type compatibility.
packages/create-docusaurus/package.json Adds @types/cross-spawn to support the new typing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +10 to +11
// This is the same as node's child_process.SpawnOptions type, but extract from
// cross-spawn directly to ensure direct compatibility.
Comment thread yarn.lock Outdated
integrity sha512-RE3mdQ7P3FRSe7eqCWoeQ/Z9QXrtniSjp1wUjt5nRC3WIpz5rSCve6o3fsZ2aCpJtrZjSZgjwXAoTO5k4tEI0w==

axios@1.14.0, axios@^1.0.0, axios@^1.15.2, axios@^1.5.0, axios@^1.7.7:
axios@1.14.0:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, not sure why adding a dep decided to ignore the package overrides and rewrite this… :(

Cleans up some of the fallout from facebook#11684 which simplified some code but removed
some type safety.
@zpao zpao force-pushed the cross-spawn-cleanup branch from c50fecb to d2ee224 Compare May 15, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants