Home / Function/ verifyAstroProject() — astro Function Reference

verifyAstroProject() — astro Function Reference

Architecture documentation for the verifyAstroProject() function in verify.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  499ccc6e_4075_3c7a_f08f_38b26a6c1fd1["verifyAstroProject()"]
  bf354028_170b_aac5_1cb8_bcd8677afe9a["verify.ts"]
  499ccc6e_4075_3c7a_f08f_38b26a6c1fd1 -->|defined in| bf354028_170b_aac5_1cb8_bcd8677afe9a
  72ce97da_518d_6810_433e_3fe04405324b["verify()"]
  72ce97da_518d_6810_433e_3fe04405324b -->|calls| 499ccc6e_4075_3c7a_f08f_38b26a6c1fd1
  0f5d9f1c_e794_a457_dfb5_0044fc3fcffc["safeJSONParse()"]
  499ccc6e_4075_3c7a_f08f_38b26a6c1fd1 -->|calls| 0f5d9f1c_e794_a457_dfb5_0044fc3fcffc
  86dc2b9b_78e5_91dc_4649_8f79e626ceff["collectPackageInfo()"]
  499ccc6e_4075_3c7a_f08f_38b26a6c1fd1 -->|calls| 86dc2b9b_78e5_91dc_4649_8f79e626ceff
  style 499ccc6e_4075_3c7a_f08f_38b26a6c1fd1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/upgrade/src/actions/verify.ts lines 59–72

async function verifyAstroProject(ctx: Pick<Context, 'cwd' | 'version' | 'packages'>) {
	const packageJson = new URL('./package.json', ctx.cwd);
	if (!existsSync(packageJson)) return false;
	const contents = await readFile(packageJson, { encoding: 'utf-8' });
	if (!contents.includes('astro')) return false;

	const { dependencies = {}, devDependencies = {} } = safeJSONParse(contents);
	if (dependencies['astro'] === undefined && devDependencies['astro'] === undefined) return false;

	// Side-effect! Persist dependency info to the shared context
	collectPackageInfo(ctx, dependencies, devDependencies);

	return true;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does verifyAstroProject() do?
verifyAstroProject() is a function in the astro codebase, defined in packages/upgrade/src/actions/verify.ts.
Where is verifyAstroProject() defined?
verifyAstroProject() is defined in packages/upgrade/src/actions/verify.ts at line 59.
What does verifyAstroProject() call?
verifyAstroProject() calls 2 function(s): collectPackageInfo, safeJSONParse.
What calls verifyAstroProject()?
verifyAstroProject() is called by 1 function(s): verify.

Analyze Your Own Codebase

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

Try Supermodel Free