Home / File/ dev-debug-info-provider.ts — astro Source File

dev-debug-info-provider.ts — astro Source File

Architecture documentation for dev-debug-info-provider.ts, a typescript file in the astro codebase. 4 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  7a3a9020_f42d_ba8c_b998_323b90da9215["dev-debug-info-provider.ts"]
  baa53824_73a3_1e03_2043_4d0c058ecca5["../types/public/index.js"]
  7a3a9020_f42d_ba8c_b998_323b90da9215 --> baa53824_73a3_1e03_2043_4d0c058ecca5
  7db42c05_e873_0887_a39f_34451c181149["../definitions.js"]
  7a3a9020_f42d_ba8c_b998_323b90da9215 --> 7db42c05_e873_0887_a39f_34451c181149
  f458772b_5926_6ea0_4412_a27162311db0["../definitions.js"]
  7a3a9020_f42d_ba8c_b998_323b90da9215 --> f458772b_5926_6ea0_4412_a27162311db0
  e5ceaf46_c86f_15d7_841c_6af002438fd8["../domain/debug-info.js"]
  7a3a9020_f42d_ba8c_b998_323b90da9215 --> e5ceaf46_c86f_15d7_841c_6af002438fd8
  style 7a3a9020_f42d_ba8c_b998_323b90da9215 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { AstroConfig } from '../../../types/public/index.js';
import type { AstroVersionProvider, OperatingSystemProvider } from '../../definitions.js';
import type { DebugInfoProvider, NodeVersionProvider, PackageManager } from '../definitions.js';
import type { DebugInfo } from '../domain/debug-info.js';

/**
 * Returns debug info without any package versions, to avoid slowing down the dev server
 */
export class DevDebugInfoProvider implements DebugInfoProvider {
	readonly #config: Pick<AstroConfig, 'output' | 'adapter' | 'integrations'>;
	readonly #astroVersionProvider: AstroVersionProvider;
	readonly #packageManager: PackageManager;
	readonly #operatingSystemProvider: OperatingSystemProvider;
	readonly #nodeVersionProvider: NodeVersionProvider;

	constructor({
		config,
		astroVersionProvider,
		packageManager,
		operatingSystemProvider,
		nodeVersionProvider,
	}: {
		config: Pick<AstroConfig, 'output' | 'adapter' | 'integrations'>;
		astroVersionProvider: AstroVersionProvider;
		packageManager: PackageManager;
		operatingSystemProvider: OperatingSystemProvider;
		nodeVersionProvider: NodeVersionProvider;
	}) {
		this.#config = config;
		this.#astroVersionProvider = astroVersionProvider;
		this.#packageManager = packageManager;
		this.#operatingSystemProvider = operatingSystemProvider;
		this.#nodeVersionProvider = nodeVersionProvider;
	}

	async get(): Promise<DebugInfo> {
		const debugInfo: DebugInfo = [
			['Astro', `v${this.#astroVersionProvider.version}`],
			['Node', this.#nodeVersionProvider.version],
			['System', this.#operatingSystemProvider.displayName],
			['Package Manager', this.#packageManager.name],
			['Output', this.#config.output],
			['Adapter', this.#config.adapter?.name ?? 'none'],
		];

		const integrations = this.#config.integrations.map((integration) => integration.name);

		debugInfo.push(['Integrations', integrations.length > 0 ? integrations : 'none']);

		return debugInfo;
	}
}

Domain

Subdomains

Dependencies

  • ../definitions.js
  • ../definitions.js
  • ../domain/debug-info.js
  • ../types/public/index.js

Frequently Asked Questions

What does dev-debug-info-provider.ts do?
dev-debug-info-provider.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What does dev-debug-info-provider.ts depend on?
dev-debug-info-provider.ts imports 4 module(s): ../definitions.js, ../definitions.js, ../domain/debug-info.js, ../types/public/index.js.
Where is dev-debug-info-provider.ts in the architecture?
dev-debug-info-provider.ts is located at packages/astro/src/cli/info/infra/dev-debug-info-provider.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/cli/info/infra).

Analyze Your Own Codebase

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

Try Supermodel Free