create-astro 3.0.0 → 3.0.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.
Files changed (2) hide show
  1. package/dist/index.js +19 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -362,7 +362,7 @@ function printHelp({
362
362
  if (headline) {
363
363
  message.push(
364
364
  linebreak(),
365
- `${title(commandName)} ${color.green(`v${"3.0.0"}`)} ${headline}`
365
+ `${title(commandName)} ${color.green(`v${"3.0.1"}`)} ${headline}`
366
366
  );
367
367
  }
368
368
  if (usage) {
@@ -482,7 +482,10 @@ async function dependencies(ctx) {
482
482
  await spinner({
483
483
  start: `Dependencies installing with ${ctx.pkgManager}...`,
484
484
  end: "Dependencies installed",
485
- while: () => install({ pkgManager: ctx.pkgManager, cwd: ctx.cwd })
485
+ while: () => install({ pkgManager: ctx.pkgManager, cwd: ctx.cwd }).catch((e) => {
486
+ error("error", e);
487
+ process.exit(1);
488
+ })
486
489
  });
487
490
  } else {
488
491
  await info(
@@ -494,7 +497,8 @@ async function dependencies(ctx) {
494
497
  async function install({ pkgManager, cwd }) {
495
498
  const installExec = execa(pkgManager, ["install"], { cwd });
496
499
  return new Promise((resolve, reject) => {
497
- installExec.on("error", (error2) => reject(error2));
500
+ setTimeout(() => reject(`Request timed out after one minute`), 6e4);
501
+ installExec.on("error", (e) => reject(e));
498
502
  installExec.on("close", () => resolve());
499
503
  });
500
504
  }
@@ -526,7 +530,10 @@ async function git(ctx) {
526
530
  await spinner({
527
531
  start: "Git initializing...",
528
532
  end: "Git initialized",
529
- while: () => init({ cwd: ctx.cwd })
533
+ while: () => init({ cwd: ctx.cwd }).catch((e) => {
534
+ error("error", e);
535
+ process.exit(1);
536
+ })
530
537
  });
531
538
  } else {
532
539
  await info(
@@ -731,7 +738,10 @@ async function template(ctx) {
731
738
  await spinner({
732
739
  start: "Template copying...",
733
740
  end: "Template copied",
734
- while: () => copyTemplate(ctx.template, ctx)
741
+ while: () => copyTemplate(ctx.template, ctx).catch((e) => {
742
+ error("error", e);
743
+ process.exit(1);
744
+ })
735
745
  });
736
746
  } else {
737
747
  ctx.exit(1);
@@ -933,7 +943,10 @@ async function typescript(ctx) {
933
943
  await spinner({
934
944
  start: "TypeScript customizing...",
935
945
  end: "TypeScript customized",
936
- while: () => setupTypeScript(ts, { cwd: ctx.cwd })
946
+ while: () => setupTypeScript(ts, { cwd: ctx.cwd }).catch((e) => {
947
+ error("error", e);
948
+ process.exit(1);
949
+ })
937
950
  });
938
951
  } else {
939
952
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-astro",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "type": "module",
5
5
  "author": "withastro",
6
6
  "license": "MIT",