Home / Function/ hasWorkspacePackageJSON() — astro Function Reference

hasWorkspacePackageJSON() — astro Function Reference

Architecture documentation for the hasWorkspacePackageJSON() function in searchRoot.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  b9482f7f_1dfc_7fbc_d27c_84c79b91ee61["hasWorkspacePackageJSON()"]
  f146dc60_74d2_b1d6_cb66_a8216ff4ea82["searchRoot.ts"]
  b9482f7f_1dfc_7fbc_d27c_84c79b91ee61 -->|defined in| f146dc60_74d2_b1d6_cb66_a8216ff4ea82
  d8111c96_abe6_3306_3d6d_efb817cc311e["searchForWorkspaceRoot()"]
  d8111c96_abe6_3306_3d6d_efb817cc311e -->|calls| b9482f7f_1dfc_7fbc_d27c_84c79b91ee61
  3458c191_918d_8674_45e4_2ce7b6917eaf["isFileReadable()"]
  b9482f7f_1dfc_7fbc_d27c_84c79b91ee61 -->|calls| 3458c191_918d_8674_45e4_2ce7b6917eaf
  style b9482f7f_1dfc_7fbc_d27c_84c79b91ee61 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/vercel/src/lib/searchRoot.ts lines 53–64

function hasWorkspacePackageJSON(root: string): boolean {
	const path = join(root, 'package.json');
	if (!isFileReadable(path)) {
		return false;
	}
	try {
		const content = JSON.parse(fs.readFileSync(path, 'utf-8')) || {};
		return !!content.workspaces;
	} catch {
		return false;
	}
}

Domain

Subdomains

Frequently Asked Questions

What does hasWorkspacePackageJSON() do?
hasWorkspacePackageJSON() is a function in the astro codebase, defined in packages/integrations/vercel/src/lib/searchRoot.ts.
Where is hasWorkspacePackageJSON() defined?
hasWorkspacePackageJSON() is defined in packages/integrations/vercel/src/lib/searchRoot.ts at line 53.
What does hasWorkspacePackageJSON() call?
hasWorkspacePackageJSON() calls 1 function(s): isFileReadable.
What calls hasWorkspacePackageJSON()?
hasWorkspacePackageJSON() is called by 1 function(s): searchForWorkspaceRoot.

Analyze Your Own Codebase

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

Try Supermodel Free