Home / Function/ getWorkspacePackageVersion() — astro Function Reference

getWorkspacePackageVersion() — astro Function Reference

Architecture documentation for the getWorkspacePackageVersion() function in build.js from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  54c14f9b_68a8_7018_8347_979f35e3b60e["getWorkspacePackageVersion()"]
  35c0b351_a315_b75b_aa2a_7f7a823ba60f["build.js"]
  54c14f9b_68a8_7018_8347_979f35e3b60e -->|defined in| 35c0b351_a315_b75b_aa2a_7f7a823ba60f
  364ea233_0325_d0c3_d524_7cd1b4b3767d["getDefinedEntries()"]
  364ea233_0325_d0c3_d524_7cd1b4b3767d -->|calls| 54c14f9b_68a8_7018_8347_979f35e3b60e
  9430cf94_cdae_0511_de17_f315fa672a00["readPackageJSON()"]
  54c14f9b_68a8_7018_8347_979f35e3b60e -->|calls| 9430cf94_cdae_0511_de17_f315fa672a00
  style 54c14f9b_68a8_7018_8347_979f35e3b60e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/cmd/build.js lines 166–178

async function getWorkspacePackageVersion(packageName) {
	const { dependencies, devDependencies } = await readPackageJSON(
		new URL('../../package.json', import.meta.url),
	);
	const deps = { ...dependencies, ...devDependencies };
	const version = deps[packageName];
	if (!version) {
		throw new Error(
			`Unable to resolve "${packageName}". Is it a dependency of the workspace root?`,
		);
	}
	return version.replace(/^\D+/, '');
}

Domain

Subdomains

Frequently Asked Questions

What does getWorkspacePackageVersion() do?
getWorkspacePackageVersion() is a function in the astro codebase, defined in scripts/cmd/build.js.
Where is getWorkspacePackageVersion() defined?
getWorkspacePackageVersion() is defined in scripts/cmd/build.js at line 166.
What does getWorkspacePackageVersion() call?
getWorkspacePackageVersion() calls 1 function(s): readPackageJSON.
What calls getWorkspacePackageVersion()?
getWorkspacePackageVersion() is called by 1 function(s): getDefinedEntries.

Analyze Your Own Codebase

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

Try Supermodel Free