Home / Function/ searchForWorkspaceRoot() — astro Function Reference

searchForWorkspaceRoot() — astro Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  d8111c96_abe6_3306_3d6d_efb817cc311e["searchForWorkspaceRoot()"]
  f146dc60_74d2_b1d6_cb66_a8216ff4ea82["searchRoot.ts"]
  d8111c96_abe6_3306_3d6d_efb817cc311e -->|defined in| f146dc60_74d2_b1d6_cb66_a8216ff4ea82
  7740c3c3_0d00_7505_8dda_d4a010921894["searchForPackageRoot()"]
  d8111c96_abe6_3306_3d6d_efb817cc311e -->|calls| 7740c3c3_0d00_7505_8dda_d4a010921894
  1a343d52_2690_8cfd_6c70_17c7dd892681["hasRootFile()"]
  d8111c96_abe6_3306_3d6d_efb817cc311e -->|calls| 1a343d52_2690_8cfd_6c70_17c7dd892681
  b9482f7f_1dfc_7fbc_d27c_84c79b91ee61["hasWorkspacePackageJSON()"]
  d8111c96_abe6_3306_3d6d_efb817cc311e -->|calls| b9482f7f_1dfc_7fbc_d27c_84c79b91ee61
  style d8111c96_abe6_3306_3d6d_efb817cc311e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/vercel/src/lib/searchRoot.ts lines 91–103

export function searchForWorkspaceRoot(
	current: string,
	root = searchForPackageRoot(current),
): string {
	if (hasRootFile(current)) return current;
	if (hasWorkspacePackageJSON(current)) return current;

	const dir = dirname(current);
	// reach the fs root
	if (!dir || dir === current) return root;

	return searchForWorkspaceRoot(dir, root);
}

Domain

Subdomains

Frequently Asked Questions

What does searchForWorkspaceRoot() do?
searchForWorkspaceRoot() is a function in the astro codebase, defined in packages/integrations/vercel/src/lib/searchRoot.ts.
Where is searchForWorkspaceRoot() defined?
searchForWorkspaceRoot() is defined in packages/integrations/vercel/src/lib/searchRoot.ts at line 91.
What does searchForWorkspaceRoot() call?
searchForWorkspaceRoot() calls 3 function(s): hasRootFile, hasWorkspacePackageJSON, searchForPackageRoot.

Analyze Your Own Codebase

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

Try Supermodel Free