PnpmManager
API reference › Foxy › Asset › PnpmManager
Integrates pnpm with Foxy’s install, update, and audit workflows.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$config protected constructor | Foxy\ | Foxy configuration. | AbstractManifestAssetManager |
$executor protected constructor | Composer\ | Process executor used to invoke the manager. | AbstractAssetManager |
$fs protected constructor | Composer\ | Filesystem used to resolve and update manifest paths. | AbstractManifestAssetManager |
$io protected constructor | Composer\ | Composer output used for progress messages. | AbstractManifestAssetManager |
$updatable protected | bool | Whether an existing frontend installation may be updated. Default: true. | AbstractManifestAssetManager |
$versionConverter protected constructor | Foxy\| | Converter for manager version output. Default: null. | AbstractAssetManager |
Methods
Section titled “Methods”| Method | Description | Defined 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 pnpm audit JSON output. | PnpmManager |
getLockPackageName() | Returns pnpm’s lock-file name. | PnpmManager |
getName() | Returns the manager name used in Foxy configuration. | PnpmManager |
getPackageJsonPath() | Returns the frontend package manifest path. | AbstractManifestAssetManager |
getPackageName() | Returns the frontend package manifest filename. | AbstractManifestAssetManager |
getVersionConstraint() | Returns the pnpm versions supported by this integration. | PnpmManager |
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 pnpm lock file exist. | PnpmManager |
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() protected | Handles dependencies already present in the frontend installation. | AbstractManifestAssetManager |
actionWhenComposerDependenciesAreMerged() protected | Runs after the Composer asset dependencies are merged and before the asset package is written. | AbstractManifestAssetManager |
buildCommand() protected | Returns the manager command run by the configured or default binary, followed by the manager-options and manager-{action}-options values. | AbstractAssetManager |
buildUnconfiguredCommand() protected | Returns the manager command run by the configured or default binary, without the install and update options. | AbstractAssetManager |
getAuditCommand() protected | Returns the pnpm audit command for all or production dependencies. | PnpmManager |
getAuditEnvironment() protected | Get environment overrides required for a complete audit. | AbstractAssetManager |
getDefaultBinary() protected | Returns the executable used when manager-bin is not configured; defaults to the manager name. | AbstractAssetManager |
getInstallCommand() protected | Returns the command that installs the asset dependencies, followed by the manager-options and manager-install-options values. | AbstractAssetManager |
getLockFilePath() protected | Returns the manager lock-file path under the root package directory. | AbstractManifestAssetManager |
getManagerConfig() protected | Returns the configuration scoped to this manager, so manager-* map entries resolve to its own value. | AbstractManifestAssetManager |
getManagerWorkingDirectory() protected | Returns the configured manager working directory, or null to use the process default. | AbstractManifestAssetManager |
getNodeModulesPath() protected | Returns the node_modules path under the root package directory. | AbstractManifestAssetManager |
getRootPackageDir() protected | Returns the resolved root package directory. | AbstractManifestAssetManager |
getRootPackagePath() protected | Resolves a path under the root package directory. | AbstractManifestAssetManager |
getUpdateCommand() protected | Returns the command that updates the asset dependencies, followed by the manager-options and manager-update-options values. | AbstractAssetManager |
getVersion() protected | Returns the normalized manager version, or null when it cannot be detected. | AbstractAssetManager |
getVersionCommand() protected | Returns the command that prints the manager version, without the install and update options. | AbstractAssetManager |
normalizeVersionOutput() protected | Normalizes the trimmed output of the version command before it is converted. | AbstractAssetManager |
validateAuditConfiguration() protected | Validate manager configuration that can change the audit scope. | AbstractAssetManager |
withManagerTimeout() protected final | Runs the callback with the process timeout set to the manager-timeout option and restores the previous timeout afterward, even when the callback throws. | AbstractAssetManager |
Constants
Section titled “Constants”| Constant | Value | Description | Defined by |
|---|---|---|---|
NODE_MODULES_PATH | './node_modules' | AbstractManifestAssetManager |
Method details
Section titled “Method details”getAuditParser()
Section titled “getAuditParser() ”public function getAuditParser(): Foxy\Audit\AuditParserInterfaceReturns the parser for pnpm audit JSON output.
Returns
getLockPackageName()
Section titled “getLockPackageName() ”public function getLockPackageName(): stringReturns pnpm’s lock-file name.
Returns
string
getName()
Section titled “getName() ”public function getName(): stringReturns the manager name used in Foxy configuration.
Returns
string
getVersionConstraint()
Section titled “getVersionConstraint() ”public function getVersionConstraint(): stringReturns the pnpm versions supported by this integration.
Returns
string
isInstalled()
Section titled “isInstalled() ”public function isInstalled(): boolReturns whether the package manifest, dependency directory, and pnpm lock file exist.
Returns
bool
getAuditCommand()
Section titled “getAuditCommand() ”protected function getAuditCommand(bool $noDev): stringReturns the pnpm audit command for all or production dependencies.
Parameters
| Parameter | Type | Description |
|---|---|---|
$noDev | bool |
Returns
string