UNPKG

@salesforce/plugin-packaging

Version:

SF plugin that support Salesforce Packaging Platform

56 lines 2.38 kB
/* * Copyright 2026, Salesforce, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand } from '@salesforce/sf-plugins-core'; import { PackageBundle } from '@salesforce/packaging'; import { Messages } from '@salesforce/core'; import { requiredHubFlag } from '../../../utils/hubFlag.js'; Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'bundle_create'); export class PackageBundlesCreate extends SfCommand { static hidden = true; static state = 'beta'; static summary = messages.getMessage('summary'); static description = messages.getMessage('description'); static examples = messages.getMessages('examples'); static requiresProject = true; static flags = { loglevel, name: Flags.string({ char: 'n', summary: messages.getMessage('flags.name.summary'), required: true, }), description: Flags.string({ char: 'd', summary: messages.getMessage('flags.description.summary'), }), 'target-dev-hub': requiredHubFlag, 'api-version': orgApiVersionFlagWithDeprecations, }; async run() { const { flags } = await this.parse(PackageBundlesCreate); const options = { Description: flags.description ?? '', BundleName: flags.name, }; this.spinner.start(`Creating Bundle with name ${options.BundleName}`); const result = await PackageBundle.create(flags['target-dev-hub'].getConnection(flags['api-version']), this.project, options); this.spinner.stop(); this.table({ data: [{ name: 'Bundle Id', value: result.Id }], title: 'Ids' }); return result; } } //# sourceMappingURL=create.js.map