Home / File/ index.ts — astro Source File

index.ts — astro Source File

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

File typescript CoreAstro CoreMiddleware 4 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  4ecbc5f0_c710_d782_6339_7a45fc4af496["index.ts"]
  7a2ced66_a643_377e_5fa0_3349bbc1879b["../../core/dev/index.js"]
  4ecbc5f0_c710_d782_6339_7a45fc4af496 --> 7a2ced66_a643_377e_5fa0_3349bbc1879b
  8db17b08_b9e5_db7e_cd39_46be76c6d5ad["../core/messages.js"]
  4ecbc5f0_c710_d782_6339_7a45fc4af496 --> 8db17b08_b9e5_db7e_cd39_46be76c6d5ad
  9323e55c_9236_cd3d_d0b3_e20df52a4e84["../flags.js"]
  4ecbc5f0_c710_d782_6339_7a45fc4af496 --> 9323e55c_9236_cd3d_d0b3_e20df52a4e84
  10250468_0e83_bd69_43e9_3bcef2294a91["piccolore"]
  4ecbc5f0_c710_d782_6339_7a45fc4af496 --> 10250468_0e83_bd69_43e9_3bcef2294a91
  style 4ecbc5f0_c710_d782_6339_7a45fc4af496 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import colors from 'piccolore';
import devServer from '../../core/dev/index.js';
import { printHelp } from '../../core/messages.js';
import { type Flags, flagsToAstroInlineConfig } from '../flags.js';

interface DevOptions {
	flags: Flags;
}

export async function dev({ flags }: DevOptions) {
	if (flags.help || flags.h) {
		printHelp({
			commandName: 'astro dev',
			usage: '[...flags]',
			tables: {
				Flags: [
					['--mode', `Specify the mode of the project. Defaults to "development".`],
					['--port', `Specify which port to run on. Defaults to 4321.`],
					['--host', `Listen on all addresses, including LAN and public addresses.`],
					['--host <custom-address>', `Expose on a network IP address at <custom-address>`],
					['--open', 'Automatically open the app in the browser on server start'],
					['--force', 'Clear the content layer cache, forcing a full rebuild.'],
					[
						'--allowed-hosts',
						'Specify a comma-separated list of allowed hosts or allow any hostname.',
					],
					['--help (-h)', 'See all available flags.'],
				],
			},
			description: `Check ${colors.cyan(
				'https://docs.astro.build/en/reference/cli-reference/#astro-dev',
			)} for more information.`,
		});
		return;
	}

	const inlineConfig = flagsToAstroInlineConfig(flags);

	return await devServer(inlineConfig);
}

Domain

Subdomains

Functions

Types

Dependencies

  • ../../core/dev/index.js
  • ../core/messages.js
  • ../flags.js
  • piccolore

Frequently Asked Questions

What does index.ts do?
index.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, CoreMiddleware subdomain.
What functions are defined in index.ts?
index.ts defines 1 function(s): dev.
What does index.ts depend on?
index.ts imports 4 module(s): ../../core/dev/index.js, ../core/messages.js, ../flags.js, piccolore.
Where is index.ts in the architecture?
index.ts is located at packages/astro/src/cli/dev/index.ts (domain: CoreAstro, subdomain: CoreMiddleware, directory: packages/astro/src/cli/dev).

Analyze Your Own Codebase

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

Try Supermodel Free