Introduction
Second generation packaging via the Salesforce CLI is awesome, but it's the area I spend most of my time remembering what parameters it supports, as well as figuring out the ids or names of the packages I'm working with.
I've actually had this functionality in the GUI for a while now, but I hadn't been using it in anger across all the various package types, so I didn't publicise it. Since then I've used it to create managed, unlocked and org dependent packages, and base and extension packages, so I think it's good enough to unleash on the world. The examples below are based on the org-dependent package that I created for London's Calling 2021.
Commands
The updated commands configuration file in the repo adds support for five package commands in their own tab:
(I have them in the order that I typically use them on a day to day basis, but they can easily be reordered by updating the commands.js file).
Create Package
Typically only used when I start a project, the Create Package command will default to the configured dev hub if there is one, but I can change it if for some reason I want to use another. Only dev hub orgs appear in the select list. The Path parameter will be used to update the packageDirectories property from the sfdx-project.json file.
Create Version
This is probably the command I use most when developing packages - creating a new version in the hope that I've finally fixed that elusive bug, but expecting further disappointment!
When I click the Get Packages button, the available packages managed by the dev hub are retrieved and the sfdx-project.json checked to see if there is already a package defined that it can default to. I can choose any other package if I need to.
Promote Version
There's always a bit of Stockholm Syndrome about this command when developing a package. At the start, I'll do pretty much anything rather promote the version to fix the functionality and commit myself to the package contents, but after a few versions I'll be executing it without a second thought.
As before, the Get Packages button retrieves the packages being administered by the dev hub. Get Package Versions retrieves the versions for the selected package, saving me remembering names or ids. It also only shows my versions that haven't been promoted:
List Packages
A simple command - as it's name suggests it lists the packages currently being administered by the dev hub.
The package information is shown in the log panel, which automatically opens when the command is executed:
List Package Versions
Again, does exactly what it says on the tin.
Although this time I can reduce the results based on the when the version was created or modified, and limit it to released versions only. These parameters might seem unnecessary when you are starting out with a package, but after a few years and 100+ versions, you'll be glad of them.
Wrap Up
As usual, I've tested these commands on MacOS and Windows 10, but if you come across any issues feel free to raise them at the Github repository.
Related Posts
- GitHub Repository for the CLI GUI
- Giving the CLI Scanner the GUI Treatment
- Going GUI over the Salesforce CLI Part 3
- Going GUI over the Salesforce CLI Part 2
- Going GUI over the Salesforce CLI
No comments:
Post a Comment