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

Wr/tables #823

Merged
merged 13 commits into from
Oct 30, 2024
Merged

Wr/tables #823

merged 13 commits into from
Oct 30, 2024

Conversation

WillieRuemmele
Copy link
Contributor

What does this PR do?

updates to new sf-plugins-core
updates tables
fixes message string without template string

What issues does this PR fix or reference?

@W-16736199@

@WillieRuemmele WillieRuemmele requested a review from a team as a code owner October 23, 2024 16:14
@@ -94,6 +94,6 @@ export class PackageCreateCommand extends SfCommand<PackageCreate> {

private display(result: PackageCreate): void {
this.styledHeader('Ids');
this.table([{ name: 'Package Id', value: result.Id }], { name: { header: 'NAME' }, value: { header: 'VALUE' } });
this.table({ data: [{ name: 'Package Id', value: result.Id }] });
Copy link
Contributor

Choose a reason for hiding this comment

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

you should use the title prop now,

this.table({
  data,
  title: 'Ids',
})

key: { header: 'Name' },
value: { header: 'Value' },
});
this.table({ data });
Copy link
Contributor

Choose a reason for hiding this comment

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

replace this.styledHeader by passing in the title prop to this.table

...(flags.verbose ? { 'Version Name': r.VersionName, 'Version Number': r.VersionNumber } : {}),
}));

this.table({ data, overflow: 'wrap' });
Copy link
Contributor

Choose a reason for hiding this comment

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

replace this.styledHeader by passing in the title prop to this.table

@@ -214,8 +215,10 @@ export class PackageVersionListCommand extends SfCommand<PackageVersionListComma
});
});
this.styledHeader(`Package Versions [${results.length}]`);
this.table(results, getColumnData(flags.concise, flags.verbose, flags['show-conversions-only']), {
'no-truncate': true,
this.table({
Copy link
Contributor

Choose a reason for hiding this comment

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

replace this.styledHeader by passing in the title prop to this.table


this.table(results, columns);
}));
this.table({ data });
Copy link
Contributor

Choose a reason for hiding this comment

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

replace this.styledHeader by passing in the title prop to this.table

@@ -213,9 +213,9 @@ export class PackageVersionReportCommand extends SfCommand<PackageVersionReportR
displayCoverageRecords.splice(0, displayCoverageRecords.length);
}
this.styledHeader(chalk.blue('Package Version'));
this.table(displayRecords, { key: { header: 'Name' }, value: { header: 'Value' } });
this.table({ data: displayRecords });
Copy link
Contributor

Choose a reason for hiding this comment

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

replace this.styledHeader by passing in the title prop to this.table

@mdonnalley
Copy link
Contributor

QA

🟢 package create

❯ sf package create --name MyPackage3 --package-type Unlocked --path force-app
 ›   Warning: @salesforce/plugin-packaging is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used
 ›    instead.
=== Ids

┌────────────┬────────────────────┐
│ Name       │ Value              │
├────────────┼────────────────────┤
│ Package Id │ 0HoKY0000000Exg0AE │
└────────────┴────────────────────┘

🟢 package version create report

❯ sf package version create report -i 08cKY0000000JVNYA2
 ›   Warning: @salesforce/plugin-packaging is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used
 ›    instead.
=== Package Version Create Request

┌───────────────────────────────┬───────────────────────────────────────────────────────────────────────────────────┐
│ Name                          │ Value                                                                             │
├───────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────┤
│ ID                            │ 08cKY0000000JVNYA2                                                                │
│ Status                        │ Success                                                                           │
│ Package Id                    │ 0HoKY0000000Exg0AE                                                                │
│ Package Version Id            │ 05iKY0000000JU5YAM                                                                │
│ Subscriber Package Version Id │ 04tKY000000HWMuYAO                                                                │
│ Tag                           │                                                                                   │
│ Branch                        │                                                                                   │
│ Created Date                  │ 2024-10-30 13:04                                                                  │
│ Installation URL              │ https://login.salesforce.com/packaging/installPackage.apexp?p0=04tKY000000HWMuYAO │
│ Created By                    │ 00546000002jDFFAA2                                                                │
└───────────────────────────────┴───────────────────────────────────────────────────────────────────────────────────┘

🟢 sf package version create list

❯ sf package version create list --created-last-days 0 --status Success
 ›   Warning: @salesforce/plugin-packaging is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used instead.
=== Package Version Create Requests  [17]

┌────────────────────┬─────────┬────────────────────┬────────────────────┬───────────────────────────────┬─────┬─────────┬──────────────────┬────────────────────┐
│ Id                 │ Status  │ Package Id         │ Package Version Id │ Subscriber Package Version Id │ Tag │ Branch  │ Created Date     │ Created By         │
├────────────────────┼─────────┼────────────────────┼────────────────────┼───────────────────────────────┼─────┼─────────┼──────────────────┼────────────────────┤
│ 08cKY0000000JVNYA2 │ Success │ 0HoKY0000000Exg0AE │ 05iKY0000000JU5YAM │ 04tKY000000HWMuYAO            │     │         │ 2024-10-30 13:04 │ 00546000002jDFFAA2 │
│ 08cKY0000000JVIYA2 │ Success │ 0HoKY0000000ExM0AU │ 05iKY0000000JTvYAM │ 04tKY000000HWMkYAO            │     │         │ 2024-10-30 09:32 │ 00546000002jDFFAA2 │
│ 08cKY0000000JVDYA2 │ Success │ 0HoKY0000000ExM0AU │ 05iKY0000000JU0YAM │ 04tKY000000HWMpYAO            │ tag │ branch  │ 2024-10-30 09:32 │ 00546000002jDFFAA2 │
│ 08cKY0000000JV8YAM │ Success │ 0HoKY0000000Exb0AE │ 05iKY0000000JTqYAM │ 04tKY000000HWMfYAO            │ tag │ branch  │ 2024-10-30 09:30 │ 00546000002jDFFAA2 │
│ 08cKY0000000JV3YAM │ Success │ 0HoKY0000000ExM0AU │ 05iKY0000000JTlYAM │ 04tKY000000HWMaYAO            │     │         │ 2024-10-30 09:29 │ 00546000002jDFFAA2 │
│ 08cKY0000000JUtYAM │ Success │ 0HoKY0000000ExM0AU │ 05iKY0000000JTgYAM │ 04tKY000000HWMVYA4            │     │ testing │ 2024-10-30 09:29 │ 00546000002jDFFAA2 │
│ 08cKY0000000JUoYAM │ Success │ 0HoKY0000000Ex70AE │ 05iKY0000000JTbYAM │ 04tKY000000HWMQYA4            │     │         │ 2024-10-30 09:27 │ 00546000002jDFFAA2 │
│ 08cKY0000000JUjYAM │ Success │ 0HoKY0000000Ex70AE │ 05iKY0000000JTWYA2 │ 04tKY000000HWMLYA4            │ tag │ branch  │ 2024-10-30 09:26 │ 00546000002jDFFAA2 │
│ 08cKY0000000JUeYAM │ Success │ 0HoKY0000000ExH0AU │ 05iKY0000000JTRYA2 │ 04tKY000000HWMGYA4            │ tag │ branch  │ 2024-10-30 09:25 │ 00546000002jDFFAA2 │
│ 08cKY0000000JUZYA2 │ Success │ 0HoKY0000000Ex70AE │ 05iKY0000000JTCYA2 │ 04tKY000000HWM1YAO            │     │         │ 2024-10-30 09:25 │ 00546000002jDFFAA2 │
│ 08cKY0000000JUPYA2 │ Success │ 0HoKY0000000Ex70AE │ 05iKY0000000JTHYA2 │ 04tKY000000HWM6YAO            │     │ testing │ 2024-10-30 09:25 │ 00546000002jDFFAA2 │
│ 08cKY0000000JUKYA2 │ Success │ 0HoKY0000000Ewn0AE │ 05iKY0000000JT2YAM │ 04tKY000000HWLrYAO            │     │         │ 2024-10-30 09:22 │ 00546000002jDFFAA2 │
│ 08cKY0000000JUBYA2 │ Success │ 0HoKY0000000Ewn0AE │ 05iKY0000000JT7YAM │ 04tKY000000HWLwYAO            │ tag │ branch  │ 2024-10-30 09:22 │ 00546000002jDFFAA2 │
│ 08cKY0000000JUFYA2 │ Success │ 0HoKY0000000Ewx0AE │ 05iKY0000000JSxYAM │ 04tKY000000HWLmYAO            │ tag │ branch  │ 2024-10-30 09:21 │ 00546000002jDFFAA2 │
│ 08cKY0000000JUAYA2 │ Success │ 0HoKY0000000Ewn0AE │ 05iKY0000000JSnYAM │ 04tKY000000HWLcYAO            │     │         │ 2024-10-30 09:21 │ 00546000002jDFFAA2 │
│ 08cKY0000000JU5YAM │ Success │ 0HoKY0000000Ewn0AE │ 05iKY0000000JSiYAM │ 04tKY000000HWLXYA4            │     │         │ 2024-10-30 09:20 │ 00546000002jDFFAA2 │
│ 08cKY0000000JU0YAM │ Success │ 0HoKY0000000Ewn0AE │ 05iKY0000000JSsYAM │ 04tKY000000HWLhYAO            │     │ testing │ 2024-10-30 09:20 │ 00546000002jDFFAA2 │
└────────────────────┴─────────┴────────────────────┴────────────────────┴───────────────────────────────┴─────┴─────────┴──────────────────┴────────────────────┘

🟢 sf package version list --created-last-days 1 --released --order-by PatchVersion

❯ sf package version list --created-last-days 1 --released --order-by PatchVersion
 ›   Warning: @salesforce/plugin-packaging is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used instead.
=== Package Versions [14]

┌─────────────────────────────┬───────────┬──────────────┬─────────┬───────────────────────────────┬───────┬──────────────────┬──────────┬────────────────────┬─────────────────┬──────────┬──────────────────┬────────────────────┐
│ Package Name                │ Namespace │ Version Name │ Version │ Subscriber Package Version Id │ Alias │ Installation Key │ Released │ Validation Skipped │ Validated Async │ Ancestor │ Ancestor Version │ Branch             │
├─────────────────────────────┼───────────┼──────────────┼─────────┼───────────────────────────────┼───────┼──────────────────┼──────────┼────────────────────┼─────────────────┼──────────┼──────────────────┼────────────────────┤
│ dancingbears-15dbc043df6a46 │           │ ver 0.1      │ 1.0.0.1 │ 04tKY000000HWFjYAO            │       │ false            │ true     │ false              │ false           │ N/A      │ N/A              │ MySuperCoolBranch2 │
│ bd                          │           │              │         │                               │       │                  │          │                    │                 │          │                  │                    │
│ dancingbears-c6102f6f5d87bf │           │ ver 0.1      │ 1.0.0.1 │ 04tKY000000HWFpYAO            │       │ false            │ true     │ false              │ false           │ N/A      │ N/A              │ MySuperCoolBranch2 │
│ 2d                          │           │              │         │                               │       │                  │          │                    │                 │          │                  │                    │
│ dancingbears-0a213ec521e5ba │           │ ver 0.1      │ 1.0.0.1 │ 04tKY000000HWGXYA4            │       │ false            │ true     │ false              │ false           │ N/A      │ N/A              │ MySuperCoolBranch2 │
│ f6                          │           │              │         │                               │       │                  │          │                    │                 │          │                  │                    │
│ dancingbears-1d827df84a3452 │           │ ver 0.1      │ 1.0.0.1 │ 04tKY000000HWHBYA4            │       │ false            │ true     │ false              │ false           │ N/A      │ N/A              │ MySuperCoolBranch2 │
│ 22                          │           │              │         │                               │       │                  │          │                    │                 │          │                  │                    │
│ dancingbears-e2982187741947 │           │ ver 0.1      │ 1.0.0.1 │ 04tKY000000HWHQYA4            │       │ false            │ true     │ false              │ false           │ N/A      │ N/A              │ MySuperCoolBranch2 │
│ 2f                          │           │              │         │                               │       │                  │          │                    │                 │          │                  │                    │
│ dancingbears-c113dfeb352caa │           │ ver 0.1      │ 1.0.0.1 │ 04tKY000000HWHkYAO            │       │ false            │ true     │ false              │ false           │ N/A      │ N/A              │ MySuperCoolBranch2 │
│ 8c                          │           │              │         │                               │       │                  │          │                    │                 │          │                  │                    │
│ dancingbears-fc7ea8afd60f09 │           │ ver 0.1      │ 1.0.0.1 │ 04tKY000000HWMfYAO            │       │ false            │ true     │ false              │ false           │ N/A      │ N/A              │ MySuperCoolBranch2 │
│ ce                          │           │              │         │                               │       │                  │          │                    │                 │          │                  │                    │
│ dancingbears-4c43bdeb215252 │           │ ver 0.1      │ 1.0.0.1 │ 04tKY000000HWInYAO            │       │ false            │ true     │ false              │ false           │ N/A      │ N/A              │ MySuperCoolBranch2 │
│ 00                          │           │              │         │                               │       │                  │          │                    │                 │          │                  │                    │
│ dancingbears-09becaaaf8121a │           │ ver 0.1      │ 1.0.0.1 │ 04tKY000000HWJCYA4            │       │ false            │ true     │ false              │ false           │ N/A      │ N/A              │ MySuperCoolBranch2 │
│ 07                          │           │              │         │                               │       │                  │          │                    │                 │          │                  │                    │
│ dancingbears-07e92612f51aba │           │ ver 0.1      │ 1.0.0.1 │ 04tKY000000HWK0YAO            │       │ false            │ true     │ false              │ false           │ N/A      │ N/A              │ MySuperCoolBranch2 │
│ 58                          │           │              │         │                               │       │                  │          │                    │                 │          │                  │                    │
│ dancingbears-43548efcb0c263 │           │ ver 0.1      │ 1.0.0.1 │ 04tKY000000HWKeYAO            │       │ false            │ true     │ false              │ false           │ N/A      │ N/A              │ MySuperCoolBranch2 │
│ 4b                          │           │              │         │                               │       │                  │          │                    │                 │          │                  │                    │
│ dancingbears-43911f6a34cf1d │           │ ver 0.1      │ 1.0.0.1 │ 04tKY000000HWLIYA4            │       │ false            │ true     │ false              │ false           │ N/A      │ N/A              │ MySuperCoolBranch2 │
│ 24                          │           │              │         │                               │       │                  │          │                    │                 │          │                  │                    │
│ dancingbears-9a4bbefe09fad9 │           │ ver 0.1      │ 1.0.0.1 │ 04tKY000000HWMGYA4            │       │ false            │ true     │ false              │ false           │ N/A      │ N/A              │ MySuperCoolBranch2 │
│ e9                          │           │              │         │                               │       │                  │          │                    │                 │          │                  │                    │
│ dancingbears-5a876480588f37 │           │ ver 0.1      │ 1.0.0.1 │ 04tKY000000HWIJYA4            │       │ false            │ true     │ false              │ false           │ N/A      │ N/A              │ MySuperCoolBranch2 │
│ 47                          │           │              │         │                               │       │                  │          │                    │                 │          │                  │                    │
└─────────────────────────────┴───────────┴──────────────┴─────────┴───────────────────────────────┴───────┴──────────────────┴──────────┴────────────────────┴─────────────────┴──────────┴──────────────────┴────────────────────┘

🟡 sf package version list --created-last-days 1 --released --order-by PatchVersion --verbose

This doesn't look great even if you use the SF_TABLE_OVERFLOW=truncate to force truncation instead of wrapping.

The problem is that the table is designed to never truncate or wrap table headers, which in retrospect wasn't a great decision. I can make a PR to modify that

🟢 sf package list
🟢 sf package list --verbose
🟢 sf package installed list
🟢 sf pacage version retrieve

@mdonnalley mdonnalley merged commit f67e5fa into main Oct 30, 2024
13 checks passed
@mdonnalley mdonnalley deleted the wr/tables branch October 30, 2024 21:54
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.

3 participants