Home / File/ messages.ts — astro Source File

messages.ts — astro Source File

Architecture documentation for messages.ts, a typescript file in the astro codebase. 7 imports, 0 dependents.

File typescript CoreAstro RenderingEngine 7 imports 24 functions

Entity Profile

Dependency Diagram

graph LR
  a89de736_d85a_fc8a_68a9_5d9ea54128d5["messages.ts"]
  5c1f16d1_f599_2e31_eb17_4c8b8189d4ed["../errors/dev/utils.js"]
  a89de736_d85a_fc8a_68a9_5d9ea54128d5 --> 5c1f16d1_f599_2e31_eb17_4c8b8189d4ed
  ef8a1e3f_e350_75a6_b92d_62a8566d8db9["../core/errors/index.js"]
  a89de736_d85a_fc8a_68a9_5d9ea54128d5 --> ef8a1e3f_e350_75a6_b92d_62a8566d8db9
  f68003f1_292f_ca44_03ce_21af87a33c7b["../core/util.js"]
  a89de736_d85a_fc8a_68a9_5d9ea54128d5 --> f68003f1_292f_ca44_03ce_21af87a33c7b
  61b635e2_549a_1d06_be03_2c8dced634c4["package-manager-detector"]
  a89de736_d85a_fc8a_68a9_5d9ea54128d5 --> 61b635e2_549a_1d06_be03_2c8dced634c4
  10250468_0e83_bd69_43e9_3bcef2294a91["piccolore"]
  a89de736_d85a_fc8a_68a9_5d9ea54128d5 --> 10250468_0e83_bd69_43e9_3bcef2294a91
  263e522e_1aa5_ebc3_e7d6_45ebc51671f7["vite"]
  a89de736_d85a_fc8a_68a9_5d9ea54128d5 --> 263e522e_1aa5_ebc3_e7d6_45ebc51671f7
  a2586aae_ce09_613d_4444_659268b61a89["core"]
  a89de736_d85a_fc8a_68a9_5d9ea54128d5 --> a2586aae_ce09_613d_4444_659268b61a89
  style a89de736_d85a_fc8a_68a9_5d9ea54128d5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { detect, resolveCommand } from 'package-manager-detector';
import colors from 'piccolore';
import type { ResolvedServerUrls } from 'vite';
import type { $ZodError } from 'zod/v4/core';
import { getDocsForError, renderErrorMarkdown } from './errors/dev/utils.js';
import {
	AstroError,
	AstroUserError,
	CompilerError,
	type ErrorWithMetadata,
} from './errors/index.js';
import { padMultilineString } from './util.js';

const {
	bgGreen,
	bgYellow,
	bgCyan,
	bgWhite,
	black,
	blue,
	bold,
	cyan,
	dim,
	green,
	red,
	underline,
	yellow,
} = colors;

/**
 * Prestyled messages for the CLI. Used by astro CLI commands.
 */

/** Display server host and startup time */
export function serverStart({
	startupTime,
	resolvedUrls,
	host,
	base,
}: {
	startupTime: number;
	resolvedUrls: ResolvedServerUrls;
	host: string | boolean;
	base: string;
}): string {
	// PACKAGE_VERSION is injected at build-time
	const version = process.env.PACKAGE_VERSION ?? '0.0.0';
	const localPrefix = `${dim('┃')} Local    `;
	const networkPrefix = `${dim('┃')} Network  `;
	const emptyPrefix = ' '.repeat(11);

	const localUrlMessages = resolvedUrls.local.map((url, i) => {
		return `${i === 0 ? localPrefix : emptyPrefix}${cyan(new URL(url).origin + base)}`;
	});
	const networkUrlMessages = resolvedUrls.network.map((url, i) => {
		return `${i === 0 ? networkPrefix : emptyPrefix}${cyan(new URL(url).origin + base)}`;
	});

	if (networkUrlMessages.length === 0) {
		const networkLogging = getNetworkLogging(host);
// ... (318 more lines)

Domain

Subdomains

Dependencies

  • ../core/errors/index.js
  • ../core/util.js
  • ../errors/dev/utils.js
  • core
  • package-manager-detector
  • piccolore
  • vite

Frequently Asked Questions

What does messages.ts do?
messages.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What functions are defined in messages.ts?
messages.ts defines 24 function(s): actionRequired, cancelled, formatConfigErrorMessage, formatErrorMessage, formatErrorStackTrace, fsStrictWarning, getNetworkLogging, newVersionAvailable, preferenceDefault, preferenceDefaultIntro, and 14 more.
What does messages.ts depend on?
messages.ts imports 7 module(s): ../core/errors/index.js, ../core/util.js, ../errors/dev/utils.js, core, package-manager-detector, piccolore, vite.
Where is messages.ts in the architecture?
messages.ts is located at packages/astro/src/core/messages.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/core).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free