create-react-router 8.5.1 → 8.5.2

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,13 @@
1
1
  # `create-react-router`
2
2
 
3
+ ## v8.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Allow project scaffolding to complete when `git add` or the initial `git commit` fails ([#15737](https://github.com/remix-run/react-router/pull/15737))
8
+ - Derive the generated package name from the project directory basename ([#15698](https://github.com/remix-run/react-router/pull/15698))
9
+ - Handle absolute paths, trailing separators, and paths entered at the directory prompt
10
+
3
11
  ## v8.5.1
4
12
 
5
13
  ### 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.1
3
+ * create-react-router v8.5.2
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.1";
1240
+ var version = "8.5.2";
1241
1241
  //#endregion
1242
1242
  //#region index.ts
1243
1243
  const currentFileDir = path.dirname(fileURLToPath(import.meta.url));
@@ -1378,18 +1378,8 @@ async function projectNameStep(ctx) {
1378
1378
  initial: "./my-react-router-app"
1379
1379
  });
1380
1380
  ctx.cwd = name;
1381
- ctx.projectName = toValidProjectName(name);
1382
- return;
1383
- }
1384
- let name = ctx.cwd;
1385
- if (name === "." || name === "./") {
1386
- let parts = process.cwd().split(path.sep);
1387
- name = parts[parts.length - 1];
1388
- } else if (name.startsWith("./") || name.startsWith("../")) {
1389
- let parts = name.split("/");
1390
- name = parts[parts.length - 1];
1391
1381
  }
1392
- ctx.projectName = toValidProjectName(name);
1382
+ ctx.projectName = toValidProjectName(path.basename(path.resolve(ctx.cwd)));
1393
1383
  }
1394
1384
  async function copyTemplateToTempDirStep(ctx) {
1395
1385
  if (ctx.template) {
@@ -1595,6 +1585,11 @@ async function gitInitStep(ctx) {
1595
1585
  let commitMsg = "Initial commit from create-react-router";
1596
1586
  try {
1597
1587
  await runCommand("git", ["init"], options);
1588
+ } catch (err) {
1589
+ error("Oh no!", "Failed to initialize git.");
1590
+ throw err;
1591
+ }
1592
+ try {
1598
1593
  await runCommand("git", ["add", "."], options);
1599
1594
  await runCommand("git", [
1600
1595
  "commit",
@@ -1602,8 +1597,8 @@ async function gitInitStep(ctx) {
1602
1597
  commitMsg
1603
1598
  ], options);
1604
1599
  } catch (err) {
1605
- error("Oh no!", "Failed to initialize git.");
1606
- throw err;
1600
+ error("Git initialized, but the initial add/commit failed.", "Ensure Git user.name and user.email are configured, then create the commit manually.");
1601
+ if (ctx.debug) console.error(err);
1607
1602
  }
1608
1603
  },
1609
1604
  ctx
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-react-router",
3
3
  "type": "module",
4
- "version": "8.5.1",
4
+ "version": "8.5.2",
5
5
  "description": "Create a new React Router app",
6
6
  "homepage": "https://reactrouter.com",
7
7
  "bugs": {