Home / Function/ astroAdd() — astro Function Reference

astroAdd() — astro Function Reference

Architecture documentation for the astroAdd() function in dependencies.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  764fd32a_377f_5c75_5b38_ba0c44a31213["astroAdd()"]
  ed06fbb8_fa50_eed4_1fe7_4e2bd1cca13a["dependencies.ts"]
  764fd32a_377f_5c75_5b38_ba0c44a31213 -->|defined in| ed06fbb8_fa50_eed4_1fe7_4e2bd1cca13a
  cc689499_9606_7a8e_588b_53c80795c124["dependencies()"]
  cc689499_9606_7a8e_588b_53c80795c124 -->|calls| 764fd32a_377f_5c75_5b38_ba0c44a31213
  e67de588_a25b_7bad_d4e1_4c35821e73ed["ensureYarnLock()"]
  764fd32a_377f_5c75_5b38_ba0c44a31213 -->|calls| e67de588_a25b_7bad_d4e1_4c35821e73ed
  style 764fd32a_377f_5c75_5b38_ba0c44a31213 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/create-astro/src/actions/dependencies.ts lines 86–105

async function astroAdd({
	integrations,
	packageManager,
	cwd,
}: {
	integrations: string[];
	packageManager: string;
	cwd: string;
}) {
	if (packageManager === 'yarn') await ensureYarnLock({ cwd });

	// Build command and args properly for spawn without shell interpretation
	const command = packageManager === 'npm' ? 'npx' : packageManager;
	const args =
		packageManager === 'npm'
			? ['astro', 'add', ...integrations, '-y']
			: ['dlx', 'astro', 'add', ...integrations, '-y'];

	return shell(command, args, { cwd, timeout: 90_000, stdio: 'ignore' });
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does astroAdd() do?
astroAdd() is a function in the astro codebase, defined in packages/create-astro/src/actions/dependencies.ts.
Where is astroAdd() defined?
astroAdd() is defined in packages/create-astro/src/actions/dependencies.ts at line 86.
What does astroAdd() call?
astroAdd() calls 1 function(s): ensureYarnLock.
What calls astroAdd()?
astroAdd() is called by 1 function(s): dependencies.

Analyze Your Own Codebase

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

Try Supermodel Free