Use cross-spawn types instead of raw types from Node#12029
Open
zpao wants to merge 1 commit into
Open
Conversation
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
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-spawntopackages/create-docusaurusdevDependencies. - Update
runCommand()’sSpawnOptionstyping to be derived from thecross-spawncall signature. - Update
yarn.lockto 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. |
zpao
commented
May 15, 2026
| 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: |
Member
Author
There was a problem hiding this comment.
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.
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.
Cleans up some of the fallout from #11684 which simplified some code but removed some type safety.