Skip to main content

addDependency

plugin.projectStructure.addDependency(packageId: string, dependency: Omit<Dependency, "id">, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Add a dependency to a package

Parameters

ParameterTypeRequiredDescription
packageIdstringYes
dependencyOmit<Dependency, "id">Yes
workspacePathstringNo

Returns

Promise<ProjectStructureUpdateResponse>

Example

import plugin from '@codebolt/plugin-sdk';

const result = await plugin.projectStructure.addDependency('packageId', /* Omit<Dependency, "id"> */);
console.log(result);