Home / File/ core.ts — astro Source File

core.ts — astro Source File

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

File typescript CoreAstro RenderingEngine 1 imports 9 functions 2 classes

Entity Profile

Dependency Diagram

graph LR
  02538c7d_0423_3484_a5c8_415c85ba2988["core.ts"]
  10250468_0e83_bd69_43e9_3bcef2294a91["piccolore"]
  02538c7d_0423_3484_a5c8_415c85ba2988 --> 10250468_0e83_bd69_43e9_3bcef2294a91
  style 02538c7d_0423_3484_a5c8_415c85ba2988 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import colors from 'piccolore';

export interface LogWritable<T> {
	write: (chunk: T) => boolean;
}

export type LoggerLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent'; // same as Pino

/**
 * Defined logger labels. Add more as needed, but keep them high-level & reusable,
 * 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.
 */
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'
	| 'csp'
	// SKIP_FORMAT: A special label that tells the logger not to apply any formatting.
	// Useful for messages that are already formatted, like the server start message.
	| 'SKIP_FORMAT';

export interface LogOptions {
	dest: LogWritable<LogMessage>;
	level: LoggerLevel;
}

// Hey, locales are pretty complicated! Be careful modifying this logic...
// If we throw at the top-level, international users can't use Astro.
//
// Using `[]` sets the default locale properly from the system!
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#parameters
//
// Here be the dragons we've slain:
// https://github.com/withastro/astro/issues/2625
// https://github.com/withastro/astro/issues/3309
/** @lintignore */
export const dateTimeFormat = new Intl.DateTimeFormat([], {
	hour: '2-digit',
	minute: '2-digit',
// ... (164 more lines)

Domain

Subdomains

Dependencies

  • piccolore

Frequently Asked Questions

What does core.ts do?
core.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 core.ts?
core.ts defines 9 function(s): chunk, debug, error, getEventPrefix, info, isLogLevelEnabled, log, timerMessage, warn.
What does core.ts depend on?
core.ts imports 1 module(s): piccolore.
Where is core.ts in the architecture?
core.ts is located at packages/astro/src/core/logger/core.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/core/logger).

Analyze Your Own Codebase

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

Try Supermodel Free