Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sh/display version in list #370

Merged
merged 5 commits into from
Jul 6, 2023
Merged

Sh/display version in list #370

merged 5 commits into from
Jul 6, 2023

Conversation

shetzel
Copy link
Contributor

@shetzel shetzel commented Jun 26, 2023

NOTE: Requires this packaging library PR to merge before tests will pass.

What does this PR do?

Adds a --verbose flag to the package version create list command that displays package name and version in the table results and the JSON.

What issues does this PR fix or reference?

@W-13650725@
forcedotcom/cli#222

@shetzel shetzel requested a review from a team as a code owner June 26, 2023 23:00
Comment on lines 149 to 153
const vDataMap: VersionDataMap = {};
versionData.map((vData) => {
const version = getPackageVersionNumber(vData as PackagingSObjects.Package2Version, true);
vDataMap[vData.Id] = { name: vData.Name, version };
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should let you remove the internal type definition for VersionDataMap since the object type becomes inferable when you avoid mutating the empty object.

Suggested change
const vDataMap: VersionDataMap = {};
versionData.map((vData) => {
const version = getPackageVersionNumber(vData as PackagingSObjects.Package2Version, true);
vDataMap[vData.Id] = { name: vData.Name, version };
});
const vDataMap = Object.fromEntries(
versionData.map((vData) => {
const version = getPackageVersionNumber(vData as PackagingSObjects.Package2Version, true);
return [vData.Id, { name: vData.Name, version }]
});
)

src/commands/package/version/create/list.ts Outdated Show resolved Hide resolved
@mshanemc
Copy link
Contributor

mshanemc commented Jul 6, 2023

QA (using na40 hub)

✅ without verbose (no extra columns show up)
✅ with verbose (I see version/number columns)
✅ json without verbose (no extra fields show up)
✅ json + verbose (I see version/number props)
✅ used with -c 10 with/without json to limit the output

@mshanemc mshanemc merged commit 0f4e1c8 into main Jul 6, 2023
@mshanemc mshanemc deleted the sh/display-version-in-list branch July 6, 2023 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants