create-astro 5.0.0-beta.2 → 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.
- package/dist/index.js +17 -4
- package/package.json +1 -1
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
|
-
|
|
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.
|
|
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.
|
|
554
|
+
"6.0.0-beta.7"
|
|
542
555
|
),
|
|
543
556
|
skipHouston,
|
|
544
557
|
fancy,
|