Skip to content
View as Markdown
View as Markdown

@salesforce/b2c-tooling-sdk / operations/cap / commerceAppPackage

Function: commerceAppPackage()

commerceAppPackage(sourceDir, options): Promise<CommerceAppPackageResult>

Defined in: packages/b2c-tooling-sdk/src/operations/cap/package.ts:59

Packages a CAP directory into a distributable .zip file.

The zip root directory is named {id}-v{version}/ as required by the CAP spec. Reads commerce-app.json to determine the app name and version.

Parameters

sourceDir

string

Path to the CAP directory

options

CommerceAppPackageOptions = {}

Packaging options

Returns

Promise<CommerceAppPackageResult>

Result with the output zip path and manifest

Example

typescript
const result = await commerceAppPackage('./commerce-avalara-tax-app-v0.2.5');
console.log(`Packaged to: ${result.outputPath}`);

Released under the Apache-2.0 License.