full site update
This commit is contained in:
30
node_modules/astro/dist/core/messages.js
generated
vendored
30
node_modules/astro/dist/core/messages.js
generated
vendored
@@ -1,7 +1,6 @@
|
||||
import {
|
||||
bgCyan,
|
||||
bgGreen,
|
||||
bgRed,
|
||||
bgWhite,
|
||||
bgYellow,
|
||||
black,
|
||||
@@ -14,7 +13,7 @@ import {
|
||||
underline,
|
||||
yellow
|
||||
} from "kleur/colors";
|
||||
import { getExecCommand } from "../cli/install-package.js";
|
||||
import { detect, resolveCommand } from "package-manager-detector";
|
||||
import { getDocsForError, renderErrorMarkdown } from "./errors/dev/utils.js";
|
||||
import {
|
||||
AstroError,
|
||||
@@ -38,7 +37,7 @@ function serverStart({
|
||||
host,
|
||||
base
|
||||
}) {
|
||||
const version = "4.16.18";
|
||||
const version = "5.12.3";
|
||||
const localPrefix = `${dim("\u2503")} Local `;
|
||||
const networkPrefix = `${dim("\u2503")} Network `;
|
||||
const emptyPrefix = " ".repeat(11);
|
||||
@@ -74,8 +73,9 @@ function serverShortcuts({ key, label }) {
|
||||
async function newVersionAvailable({ latestVersion }) {
|
||||
const badge = bgYellow(black(` update `));
|
||||
const headline = yellow(`\u25B6 New version of Astro available: ${latestVersion}`);
|
||||
const execCommand = await getExecCommand();
|
||||
const details = ` Run ${cyan(`${execCommand} @astrojs/upgrade`)} to update`;
|
||||
const packageManager = (await detect())?.agent ?? "npm";
|
||||
const execCommand = resolveCommand(packageManager, "execute", ["@astrojs/upgrade"]);
|
||||
const details = !execCommand ? "" : ` Run ${cyan(`${execCommand.command} ${execCommand.args.join(" ")}`)} to update`;
|
||||
return ["", `${badge} ${headline}`, details, ""].join("\n");
|
||||
}
|
||||
function telemetryNotice() {
|
||||
@@ -155,12 +155,10 @@ function success(message, tip) {
|
||||
\u25B6 ${tip}` : void 0;
|
||||
return ["", `${badge} ${headline}`, footer].filter((v) => v !== void 0).map((msg) => ` ${msg}`).join("\n");
|
||||
}
|
||||
function failure(message, tip) {
|
||||
const badge = bgRed(black(` error `));
|
||||
const headline = red(message);
|
||||
const footer = tip ? `
|
||||
\u25B6 ${tip}` : void 0;
|
||||
return ["", `${badge} ${headline}`, footer].filter((v) => v !== void 0).map((msg) => ` ${msg}`).join("\n");
|
||||
function actionRequired(message) {
|
||||
const badge = bgYellow(black(` action required `));
|
||||
const headline = yellow(message);
|
||||
return ["", `${badge} ${headline}`].filter((v) => v !== void 0).map((msg) => ` ${msg}`).join("\n");
|
||||
}
|
||||
function cancelled(message, tip) {
|
||||
const badge = bgYellow(black(` cancelled `));
|
||||
@@ -179,13 +177,15 @@ function getNetworkLogging(host) {
|
||||
return "visible";
|
||||
}
|
||||
}
|
||||
const codeRegex = /`([^`]+)`/g;
|
||||
function formatConfigErrorMessage(err) {
|
||||
const errorList = err.issues.map(
|
||||
(issue) => ` ! ${bold(issue.path.join("."))} ${red(issue.message + ".")}`
|
||||
(issue) => `! ${renderErrorMarkdown(issue.message, "cli")}`.replaceAll(codeRegex, blue("$1")).split("\n").map((line, index) => index === 0 ? red(line) : " " + line).join("\n")
|
||||
);
|
||||
return `${red("[config]")} Astro found issue(s) with your configuration:
|
||||
|
||||
${errorList.join(
|
||||
"\n"
|
||||
"\n\n"
|
||||
)}`;
|
||||
}
|
||||
const STACK_LINE_REGEXP = /^\s+at /g;
|
||||
@@ -274,7 +274,7 @@ function printHelp({
|
||||
message.push(
|
||||
linebreak(),
|
||||
` ${bgGreen(black(` ${commandName} `))} ${green(
|
||||
`v${"4.16.18"}`
|
||||
`v${"5.12.3"}`
|
||||
)} ${headline}`
|
||||
);
|
||||
}
|
||||
@@ -298,8 +298,8 @@ function printHelp({
|
||||
console.log(message.join("\n") + "\n");
|
||||
}
|
||||
export {
|
||||
actionRequired,
|
||||
cancelled,
|
||||
failure,
|
||||
formatConfigErrorMessage,
|
||||
formatErrorMessage,
|
||||
fsStrictWarning,
|
||||
|
Reference in New Issue
Block a user