create-astro 3.1.9 → 3.1.11
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 +9 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -175,7 +175,7 @@ import os from "node:os";
|
|
|
175
175
|
import detectPackageManager2 from "which-pm-runs";
|
|
176
176
|
|
|
177
177
|
// src/messages.ts
|
|
178
|
-
import { color,
|
|
178
|
+
import { color, say as houston, label, spinner as load } from "@astrojs/cli-kit";
|
|
179
179
|
import { align, sleep } from "@astrojs/cli-kit/utils";
|
|
180
180
|
import { execa } from "execa";
|
|
181
181
|
import fetch from "node-fetch-native";
|
|
@@ -243,11 +243,11 @@ var welcome = [
|
|
|
243
243
|
`Awaiting further instructions.`
|
|
244
244
|
];
|
|
245
245
|
var getName = () => new Promise((resolve) => {
|
|
246
|
-
exec("git config user.name", { encoding: "utf-8" }, (_1, gitName
|
|
246
|
+
exec("git config user.name", { encoding: "utf-8" }, (_1, gitName) => {
|
|
247
247
|
if (gitName.trim()) {
|
|
248
248
|
return resolve(gitName.split(" ")[0].trim());
|
|
249
249
|
}
|
|
250
|
-
exec("whoami", { encoding: "utf-8" }, (_3, whoami
|
|
250
|
+
exec("whoami", { encoding: "utf-8" }, (_3, whoami) => {
|
|
251
251
|
if (whoami.trim()) {
|
|
252
252
|
return resolve(whoami.split(" ")[0].trim());
|
|
253
253
|
}
|
|
@@ -261,7 +261,8 @@ var getVersion = () => new Promise(async (resolve) => {
|
|
|
261
261
|
return resolve(v);
|
|
262
262
|
let registry = await getRegistry();
|
|
263
263
|
const { version } = await fetch(`${registry}/astro/latest`, { redirect: "follow" }).then(
|
|
264
|
-
(res) => res.json()
|
|
264
|
+
(res) => res.json(),
|
|
265
|
+
() => ({ version: "" })
|
|
265
266
|
);
|
|
266
267
|
v = version;
|
|
267
268
|
resolve(version);
|
|
@@ -269,9 +270,7 @@ var getVersion = () => new Promise(async (resolve) => {
|
|
|
269
270
|
var log = (message) => stdout.write(message + "\n");
|
|
270
271
|
var banner = async (version) => log(
|
|
271
272
|
`
|
|
272
|
-
${label("astro", color.bgGreen, color.black)} ${color.green(
|
|
273
|
-
color.bold(`v${version}`)
|
|
274
|
-
)} ${color.bold("Launch sequence initiated.")}`
|
|
273
|
+
${label("astro", color.bgGreen, color.black)} ${version ? color.green(color.bold(`v${version}`)) : ""} ${color.bold("Launch sequence initiated.")}`
|
|
275
274
|
);
|
|
276
275
|
var info = async (prefix, text) => {
|
|
277
276
|
await sleep(100);
|
|
@@ -356,7 +355,7 @@ function printHelp({
|
|
|
356
355
|
if (headline) {
|
|
357
356
|
message.push(
|
|
358
357
|
linebreak(),
|
|
359
|
-
`${title(commandName)} ${color.green(`v${"3.1.
|
|
358
|
+
`${title(commandName)} ${color.green(`v${"3.1.11"}`)} ${headline}`
|
|
360
359
|
);
|
|
361
360
|
}
|
|
362
361
|
if (usage) {
|
|
@@ -475,7 +474,7 @@ async function dependencies(ctx) {
|
|
|
475
474
|
await info("--dry-run", `Skipping dependency installation`);
|
|
476
475
|
} else if (deps) {
|
|
477
476
|
await spinner({
|
|
478
|
-
start: `
|
|
477
|
+
start: `Installing dependencies with ${ctx.pkgManager}...`,
|
|
479
478
|
end: "Dependencies installed",
|
|
480
479
|
while: () => {
|
|
481
480
|
return install({ pkgManager: ctx.pkgManager, cwd: ctx.cwd }).catch((e) => {
|
|
@@ -596,7 +595,7 @@ async function intro(ctx) {
|
|
|
596
595
|
"Welcome",
|
|
597
596
|
"to",
|
|
598
597
|
label2("astro", color4.bgGreen, color4.black),
|
|
599
|
-
color4.green(`v${ctx.version}`) + ",",
|
|
598
|
+
(ctx.version ? color4.green(`v${ctx.version}`) : "") + ",",
|
|
600
599
|
`${ctx.username}!`
|
|
601
600
|
],
|
|
602
601
|
random(welcome)
|