create-astro 5.0.0-beta.1 → 5.0.0-beta.3

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 +17 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -355,8 +355,15 @@ var getName = () => new Promise((resolve) => {
355
355
  var getVersion = (packageManager, packageName, packageTag = "latest", fallback = "") => new Promise(async (resolve) => {
356
356
  let registry = await getRegistry(packageManager);
357
357
  const { version } = await fetch(`${registry}/${packageName}/${packageTag}`, {
358
- redirect: "follow"
359
- }).then((res) => res.json()).catch(() => ({ version: fallback }));
358
+ redirect: "follow",
359
+ signal: AbortSignal.timeout(1e4)
360
+ }).then((res) => res.json()).catch(() => {
361
+ const fallbackName = fallback || `'latest'`;
362
+ console.warn(
363
+ `Unable to fetch latest ${packageName} version from the npm registry. Using ${fallbackName} instead.`
364
+ );
365
+ return { version: fallback };
366
+ });
360
367
  return resolve(version);
361
368
  });
362
369
  var log = (message) => stdout.write(message + "\n");
@@ -445,7 +452,7 @@ function printHelp({
445
452
  if (headline) {
446
453
  message.push(
447
454
  linebreak(),
448
- `${title(commandName)} ${color.green(`v${"5.0.0-beta.1"}`)} ${headline}`
455
+ `${title(commandName)} ${color.green(`v${"5.0.0-beta.3"}`)} ${headline}`
449
456
  );
450
457
  }
451
458
  if (usage) {
@@ -521,6 +528,12 @@ async function getContext(argv) {
521
528
  "--ref": ref,
522
529
  "--add": add
523
530
  } = flags;
531
+ if (add?.length && noInstall) {
532
+ console.error(
533
+ "The --add flag requires dependencies to be installed. Remove --no-install or run `astro add` manually after installation."
534
+ );
535
+ process.exit(1);
536
+ }
524
537
  let projectName2 = cwd;
525
538
  if (no) {
526
539
  yes = false;
@@ -538,7 +551,7 @@ async function getContext(argv) {
538
551
  packageManager,
539
552
  "astro",
540
553
  getPackageTag(packageSpecifier),
541
- "6.0.0-beta.1"
554
+ "6.0.0-beta.7"
542
555
  ),
543
556
  skipHouston,
544
557
  fancy,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-astro",
3
- "version": "5.0.0-beta.1",
3
+ "version": "5.0.0-beta.3",
4
4
  "type": "module",
5
5
  "author": "withastro",
6
6
  "license": "MIT",
@@ -33,7 +33,7 @@
33
33
  "astro-scripts": "0.0.14"
34
34
  },
35
35
  "engines": {
36
- "node": "^20.19.5 || >=22.12.0"
36
+ "node": "^20.19.1 || >=22.12.0"
37
37
  },
38
38
  "publishConfig": {
39
39
  "provenance": true