Repository: facebook/react
Pull request: Added windows powershell syntax to build scripts

<!--
  Thanks for submitting a pull request!
  We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory.

  Before submitting a pull request, please make sure the following is done:

  1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`.
  2. Run `yarn` in the repository root.
  3. If you've fixed a bug or added code that should be tested, add tests!
  4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
  5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`.
  6. If you need a debugger, run `yarn test --debug --watch TestName`, open `chrome://inspect`, and press "Inspect".
  7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
  8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

  Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html
-->

## Summary

I had to change the commands to be windows specific so that it doesn't cause any crashes

## How did you test this change?

I successfully built the different types of devtools extenstions on my personal computer. In future may need to add a github action with windows config to test these errors 

 #27193


Changed files:
filename: package.json
patch: @@ -91,6 +91,7 @@
     "rollup-plugin-prettier": "^4.1.1",
     "rollup-plugin-strip-banner": "^3.0.0",
     "semver": "^7.1.1",
+    "shelljs":"^0.8.5",
     "signedsource": "^2.0.0",
     "targz": "^1.0.1",
     "through2": "^3.0.1",
@@ -108,7 +109,7 @@
   "scripts": {
     "build": "node ./scripts/rollup/build-all-release-channels.js",
     "build-combined": "echo 'build-combined is deprecated. yarn build instead.'",
-    "build-for-devtools": "cross-env RELEASE_CHANNEL=experimental yarn build react/index,react/jsx,react-dom/index,react-dom/unstable_testing,react-dom/test-utils,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh,react-art --type=NODE && cp -r ./build/node_modules build/oss-experimental/",
+    "build-for-devtools": "cross-env RELEASE_CHANNEL=experimental yarn build react/index,react/jsx,react-dom/index,react-dom/unstable_testing,react-dom/test-utils,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh,react-art --type=NODE",
     "build-for-devtools-dev": "yarn build-for-devtools --type=NODE_DEV",
     "build-for-devtools-prod": "yarn build-for-devtools --type=NODE_PROD",
     "linc": "node ./scripts/tasks/linc.js",

filename: packages/react-devtools-extensions/deploy.js
patch: @@ -5,7 +5,7 @@
 const {exec, execSync} = require('child_process');
 const {readFileSync, writeFileSync} = require('fs');
 const {join} = require('path');
-
+const shell = require('shelljs');
 const main = async buildId => {
   const root = join(__dirname, buildId);
   const buildPath = join(root, 'build');
@@ -18,11 +18,7 @@ const main = async buildId => {
     },
     stdio: 'inherit',
   });
-
-  await exec(`cp ${join(root, 'now.json')} ${join(buildPath, 'now.json')}`, {
-    cwd: root,
-  });
-
+  shell.cp(join(root, 'now.json'), join(buildPath, 'now.json'));
   const file = readFileSync(join(root, 'now.json'));
   const json = JSON.parse(file);
   const alias = json.alias[0];

filename: scripts/release/build-release-locally-commands/build-artifacts.js
patch: @@ -5,6 +5,7 @@
 const {exec} = require('child-process-promise');
 const {join} = require('path');
 const {logPromise} = require('../utils');
+const shell = require('shelljs');
 
 const run = async ({cwd, dry, tempDirectory}) => {
   const defaultOptions = {
@@ -17,7 +18,7 @@ const run = async ({cwd, dry, tempDirectory}) => {
   const tempNodeModulesPath = join(tempDirectory, 'build', 'node_modules');
   const buildPath = join(cwd, 'build');
 
-  await exec(`cp -r ${tempNodeModulesPath} ${buildPath}`);
+  shell.cp('-r', tempNodeModulesPath, buildPath);
 };
 
 module.exports = async params => {

filename: scripts/rollup/build-all-release-channels.js
patch: @@ -8,7 +8,7 @@ const fse = require('fs-extra');
 const {spawnSync} = require('child_process');
 const path = require('path');
 const tmp = require('tmp');
-
+const shell = require('shelljs');
 const {
   ReactVersion,
   stablePackages,
@@ -115,11 +115,7 @@ function processStable(buildDir) {
   if (fs.existsSync(buildDir + '/node_modules')) {
     // Identical to `oss-stable` but with real, semver versions. This is what
     // will get published to @latest.
-    spawnSync('cp', [
-      '-r',
-      buildDir + '/node_modules',
-      buildDir + '/oss-stable-semver',
-    ]);
+    shell.cp('-r', buildDir + '/node_modules', buildDir + '/oss-stable-semver');
 
     const defaultVersionIfNotFound = '0.0.0' + '-' + sha + '-' + dateString;
     const versionsMap = new Map();

filename: yarn.lock
patch: @@ -13871,6 +13871,15 @@ shelljs@0.7.7:
     interpret "^1.0.0"
     rechoir "^0.6.2"
 
+shelljs@^0.8.5:
+  version "0.8.5"
+  resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c"
+  integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==
+  dependencies:
+    glob "^7.0.0"
+    interpret "^1.0.0"
+    rechoir "^0.6.2"
+
 shellwords@^0.1.1:
   version "0.1.1"
   resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"