create-react-router 8.5.0 → 8.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # `create-react-router`
2
2
 
3
+ ## v8.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix package manager command execution on Windows by handling `.cmd` shims properly ([#15565](https://github.com/remix-run/react-router/pull/15565))
8
+
3
9
  ## v8.5.0
4
10
 
5
11
  ### Patch Changes
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * create-react-router v8.5.0
3
+ * create-react-router v8.5.1
4
4
  *
5
5
  * Copyright (c) Remix Software Inc.
6
6
  *
@@ -1237,7 +1237,7 @@ var CopyTemplateError = class extends Error {
1237
1237
  };
1238
1238
  //#endregion
1239
1239
  //#region package.json
1240
- var version = "8.5.0";
1240
+ var version = "8.5.1";
1241
1241
  //#endregion
1242
1242
  //#region index.ts
1243
1243
  const currentFileDir = path.dirname(fileURLToPath(import.meta.url));
@@ -1670,9 +1670,32 @@ async function installDependencies({ pkgManager, cwd, showInstallOutput }) {
1670
1670
  throw err;
1671
1671
  }
1672
1672
  }
1673
+ const WINDOWS_CMD_SHIMS = new Set([
1674
+ "npm",
1675
+ "npx",
1676
+ "pnpm",
1677
+ "pnpx",
1678
+ "yarn",
1679
+ "yarnpkg"
1680
+ ]);
1681
+ const WINDOWS_EXE_SHIMS = new Set(["bun", "bunx"]);
1682
+ function resolveWindowsCommand(command, args) {
1683
+ if (command.includes("/") || command.includes("\\") || command.includes(".")) return [command, args];
1684
+ const normalizedCommand = command.toLowerCase();
1685
+ if (WINDOWS_CMD_SHIMS.has(normalizedCommand)) return ["cmd.exe", [
1686
+ "/d",
1687
+ "/s",
1688
+ "/c",
1689
+ command,
1690
+ ...args
1691
+ ]];
1692
+ if (WINDOWS_EXE_SHIMS.has(normalizedCommand)) return [`${command}.exe`, args];
1693
+ return [command, args];
1694
+ }
1673
1695
  function runCommand(command, args, options) {
1674
1696
  return new Promise((resolve, reject) => {
1675
- let child = spawn(command, args, options);
1697
+ const [resolvedCommand, resolvedArgs] = process.platform === "win32" ? resolveWindowsCommand(command, args) : [command, args];
1698
+ const child = spawn(resolvedCommand, resolvedArgs, options);
1676
1699
  child.on("error", reject);
1677
1700
  child.on("exit", (code, signal) => {
1678
1701
  if (code === 0) resolve();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-react-router",
3
3
  "type": "module",
4
- "version": "8.5.0",
4
+ "version": "8.5.1",
5
5
  "description": "Create a new React Router app",
6
6
  "homepage": "https://reactrouter.com",
7
7
  "bugs": {