Skip to content
PHP Ecosystem
Explore

BunManager

API reference › Foxy › Asset › BunManager

Integrates the Bun package manager with Foxy’s install, update, and audit workflows.

PropertyTypeDescriptionDefined by
$config protected constructorFoxy\Config\ConfigFoxy configuration.AbstractManifestAssetManager
$executor protected constructorComposer\Util\ProcessExecutorProcess executor used to invoke the manager.AbstractAssetManager
$fs protected constructorComposer\Util\FilesystemFilesystem used to resolve and update manifest paths.AbstractManifestAssetManager
$io protected constructorComposer\IO\IOInterfaceComposer output used for progress messages.AbstractManifestAssetManager
$updatable protectedboolWhether an existing frontend installation may be updated. Default: true.AbstractManifestAssetManager
$versionConverter protected constructorFoxy\Converter\VersionConverterInterface|nullConverter for manager version output. Default: null.AbstractAssetManager
MethodDescriptionDefined by
__construct()Creates a manager that executes frontend commands for the configured asset manifest.AbstractAssetManager
addDependencies()Merges Composer asset dependencies into the frontend package manifest.AbstractManifestAssetManager
audit()Runs the manager audit command against the current lock file.AbstractAssetManager
getAuditParser()Returns the parser for Bun audit JSON output.BunManager
getLockPackageName()Returns Bun’s text lock-file name.BunManager
getName()Returns the manager name used in Foxy configuration.BunManager
getPackageJsonPath()Returns the frontend package manifest path.AbstractManifestAssetManager
getPackageName()Returns the frontend package manifest filename.AbstractManifestAssetManager
getVersionConstraint()Returns the Bun versions supported by this integration.BunManager
hasLockFile()Returns whether the manager lock file exists.AbstractManifestAssetManager
isAvailable()Returns whether the manager executable reports a detectable version.AbstractAssetManager
isInstalled()Returns whether the package manifest, dependency directory, and Bun lock file exist.BunManager
isUpdatable()Returns whether an existing frontend installation may be updated.AbstractManifestAssetManager
run()Installs or updates frontend dependencies according to the manager state and configuration.AbstractAssetManager
setUpdatable()Enables or disables updates of an existing frontend installation.AbstractManifestAssetManager
validate()Validates the installed manager version against Foxy’s supported and configured constraints.AbstractAssetManager
actionWhenComposerDependenciesAreAlreadyInstalled() protectedHandles dependencies already present in the frontend installation.AbstractManifestAssetManager
actionWhenComposerDependenciesAreMerged() protectedRuns after the Composer asset dependencies are merged and before the asset package is written.AbstractManifestAssetManager
buildCommand() protectedReturns the manager command run by the configured or default binary, followed by the manager-options and manager-{action}-options values.AbstractAssetManager
buildUnconfiguredCommand() protectedReturns the manager command run by the configured or default binary, without the install and update options.AbstractAssetManager
getAuditCommand() protectedReturns the Bun audit command for all or production dependencies.BunManager
getAuditEnvironment() protectedGet environment overrides required for a complete audit.AbstractAssetManager
getDefaultBinary() protectedReturns the platform-specific Bun binary name.BunManager
getInstallCommand() protectedReturns the command that installs the asset dependencies, followed by the manager-options and manager-install-options values.AbstractAssetManager
getLockFilePath() protectedReturns the manager lock-file path under the root package directory.AbstractManifestAssetManager
getManagerConfig() protectedReturns the configuration scoped to this manager, so manager-* map entries resolve to its own value.AbstractManifestAssetManager
getManagerWorkingDirectory() protectedReturns the configured manager working directory, or null to use the process default.AbstractManifestAssetManager
getNodeModulesPath() protectedReturns the node_modules path under the root package directory.AbstractManifestAssetManager
getRootPackageDir() protectedReturns the resolved root package directory.AbstractManifestAssetManager
getRootPackagePath() protectedResolves a path under the root package directory.AbstractManifestAssetManager
getUpdateCommand() protectedReturns the command that updates the asset dependencies, followed by the manager-options and manager-update-options values.AbstractAssetManager
getVersion() protectedReturns the normalized manager version, or null when it cannot be detected.AbstractAssetManager
getVersionCommand() protectedReturns the command that prints the manager version, without the install and update options.AbstractAssetManager
normalizeVersionOutput() protectedNormalizes the trimmed output of the version command before it is converted.AbstractAssetManager
validateAuditConfiguration() protectedRejects Bun and npm configuration that would narrow or ignore audit results.BunManager
withManagerTimeout() protected finalRuns the callback with the process timeout set to the manager-timeout option and restores the previous timeout afterward, even when the callback throws.AbstractAssetManager
ConstantValueDescriptionDefined by
NODE_MODULES_PATH'./node_modules'AbstractManifestAssetManager
public function getAuditParser(): Foxy\Audit\AuditParserInterface

Returns the parser for Bun audit JSON output.

public function getLockPackageName(): string

Returns Bun’s text lock-file name.

Returns

string

public function getName(): string

Returns the manager name used in Foxy configuration.

Returns

string

public function getVersionConstraint(): string

Returns the Bun versions supported by this integration.

Returns

string

public function isInstalled(): bool

Returns whether the package manifest, dependency directory, and Bun lock file exist.

Returns

bool

protected function getAuditCommand(bool $noDev): string

Returns the Bun audit command for all or production dependencies.

Parameters

ParameterTypeDescription
$noDevbool

Returns

string

protected function getDefaultBinary(): string

Returns the platform-specific Bun binary name.

Returns

string

protected function validateAuditConfiguration(bool $noDev): void

Rejects Bun and npm configuration that would narrow or ignore audit results.

Parameters

ParameterTypeDescription
$noDevbool