full site update
This commit is contained in:
2
node_modules/astro/dist/core/logger/console.js
generated
vendored
2
node_modules/astro/dist/core/logger/console.js
generated
vendored
@@ -3,7 +3,7 @@ const consoleLogDestination = {
|
||||
write(event) {
|
||||
let dest = console.error;
|
||||
if (levels[event.level] < levels["error"]) {
|
||||
dest = console.log;
|
||||
dest = console.info;
|
||||
}
|
||||
if (event.label === "SKIP_FORMAT") {
|
||||
dest(event.message);
|
||||
|
12
node_modules/astro/dist/core/logger/core.d.ts
generated
vendored
12
node_modules/astro/dist/core/logger/core.d.ts
generated
vendored
@@ -7,11 +7,12 @@ export type LoggerLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
||||
* rather than specific to a single command, function, use, etc. The label will be
|
||||
* shown in the log message to the user, so it should be relevant.
|
||||
*/
|
||||
export type LoggerLabel = 'add' | 'build' | 'check' | 'config' | 'content' | 'crypto' | 'deprecated' | 'markdown' | 'router' | 'types' | 'vite' | 'watch' | 'middleware' | 'preferences' | 'redirects' | 'sync' | 'toolbar' | 'assets' | 'env' | 'update' | 'SKIP_FORMAT';
|
||||
type LoggerLabel = 'add' | 'build' | 'check' | 'config' | 'content' | 'crypto' | 'deprecated' | 'markdown' | 'router' | 'types' | 'vite' | 'watch' | 'middleware' | 'preferences' | 'redirects' | 'sync' | 'session' | 'toolbar' | 'assets' | 'env' | 'update' | 'adapter' | 'islands' | 'SKIP_FORMAT';
|
||||
export interface LogOptions {
|
||||
dest: LogWritable<LogMessage>;
|
||||
level: LoggerLevel;
|
||||
}
|
||||
/** @lintignore */
|
||||
export declare const dateTimeFormat: Intl.DateTimeFormat;
|
||||
export interface LogMessage {
|
||||
label: string | null;
|
||||
@@ -20,15 +21,7 @@ export interface LogMessage {
|
||||
newLine: boolean;
|
||||
}
|
||||
export declare const levels: Record<LoggerLevel, number>;
|
||||
/** Full logging API */
|
||||
export declare function log(opts: LogOptions, level: LoggerLevel, label: string | null, message: string, newLine?: boolean): void;
|
||||
export declare function isLogLevelEnabled(configuredLogLevel: LoggerLevel, level: LoggerLevel): boolean;
|
||||
/** Emit a user-facing message. Useful for UI and other console messages. */
|
||||
export declare function info(opts: LogOptions, label: string | null, message: string, newLine?: boolean): void;
|
||||
/** Emit a warning message. Useful for high-priority messages that aren't necessarily errors. */
|
||||
export declare function warn(opts: LogOptions, label: string | null, message: string, newLine?: boolean): void;
|
||||
/** Emit a error message, Useful when Astro can't recover from some error. */
|
||||
export declare function error(opts: LogOptions, label: string | null, message: string, newLine?: boolean): void;
|
||||
export declare function debug(...args: any[]): void;
|
||||
/**
|
||||
* Get the prefix for a log message.
|
||||
@@ -61,3 +54,4 @@ export declare class AstroIntegrationLogger {
|
||||
error(message: string): void;
|
||||
debug(message: string): void;
|
||||
}
|
||||
export {};
|
||||
|
6
node_modules/astro/dist/core/logger/core.js
generated
vendored
6
node_modules/astro/dist/core/logger/core.js
generated
vendored
@@ -126,12 +126,8 @@ export {
|
||||
Logger,
|
||||
dateTimeFormat,
|
||||
debug,
|
||||
error,
|
||||
getEventPrefix,
|
||||
info,
|
||||
isLogLevelEnabled,
|
||||
levels,
|
||||
log,
|
||||
timerMessage,
|
||||
warn
|
||||
timerMessage
|
||||
};
|
||||
|
2
node_modules/astro/dist/core/logger/vite.js
generated
vendored
2
node_modules/astro/dist/core/logger/vite.js
generated
vendored
@@ -13,6 +13,7 @@ const viteHmrUpdateMsg = /hmr update (.*)/;
|
||||
const viteBuildMsg = /vite.*building.*for production/;
|
||||
const viteShortcutTitleMsg = /^\s*Shortcuts\s*$/;
|
||||
const viteShortcutHelpMsg = /press (.+?) to (.+)$/s;
|
||||
const lightningcssUnsupportedPseudoMsg = /\[lightningcss\] 'global'.*not recognized.*pseudo-class/s;
|
||||
function createViteLogger(astroLogger, viteLogLevel = "info") {
|
||||
const warnedMessages = /* @__PURE__ */ new Set();
|
||||
const loggedErrors = /* @__PURE__ */ new WeakSet();
|
||||
@@ -38,6 +39,7 @@ function createViteLogger(astroLogger, viteLogLevel = "info") {
|
||||
},
|
||||
warn(msg) {
|
||||
if (!isLogLevelEnabled(viteLogLevel, "warn")) return;
|
||||
if (lightningcssUnsupportedPseudoMsg.test(msg)) return;
|
||||
logger.hasWarned = true;
|
||||
astroLogger.warn("vite", msg);
|
||||
},
|
||||
|
Reference in New Issue
Block a user