From 0952806c6f302d2216dc0673c54a29a7f4f6b74c Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Tue, 22 Oct 2024 16:24:35 -0600 Subject: [PATCH 01/12] fix: update tables, in progress --- package.json | 6 +- src/commands/package/create.ts | 2 +- src/commands/package/installed/list.ts | 28 +- src/commands/package/list.ts | 46 +-- src/commands/package/version/create/list.ts | 65 +-- src/commands/package/version/create/report.ts | 5 +- src/commands/package/version/list.ts | 109 +++-- src/commands/package/version/report.ts | 4 +- src/commands/package/version/retrieve.ts | 17 +- src/commands/package1/version/display.ts | 15 +- src/commands/package1/version/list.ts | 15 +- yarn.lock | 385 +++++++++++++----- 12 files changed, 415 insertions(+), 282 deletions(-) diff --git a/package.json b/package.json index 40b3c067..90c58662 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,10 @@ "bugs": "https://github.com/forcedotcom/cli/issues", "dependencies": { "@oclif/core": "^4", - "@salesforce/core": "^8.6.1", + "@salesforce/core": "^8.6.2", "@salesforce/kit": "^3.2.3", - "@salesforce/packaging": "^4.2.9", - "@salesforce/sf-plugins-core": "^11.3.12", + "@salesforce/packaging": "^4.2.15", + "@salesforce/sf-plugins-core": "^12.0.6", "chalk": "^5.3.0" }, "devDependencies": { diff --git a/src/commands/package/create.ts b/src/commands/package/create.ts index 5fdfc1c3..dadc1372 100644 --- a/src/commands/package/create.ts +++ b/src/commands/package/create.ts @@ -94,6 +94,6 @@ export class PackageCreateCommand extends SfCommand { 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 }] }); } } diff --git a/src/commands/package/installed/list.ts b/src/commands/package/installed/list.ts index 480d04c3..a6b69783 100644 --- a/src/commands/package/installed/list.ts +++ b/src/commands/package/installed/list.ts @@ -47,12 +47,18 @@ export class PackageInstalledListCommand extends SfCommand ({ } : {}), }); - -const columns = { - Id: { header: 'ID' }, - SubscriberPackageId: { header: 'Package ID' }, - SubscriberPackageName: { header: 'Package Name' }, - SubscriberPackageNamespace: { header: 'Namespace' }, - SubscriberPackageVersionId: { header: 'Package Version ID' }, - SubscriberPackageVersionName: { header: 'Version Name' }, - SubscriberPackageVersionNumber: { header: 'Version' }, -}; diff --git a/src/commands/package/list.ts b/src/commands/package/list.ts index 66675673..d6573dc1 100644 --- a/src/commands/package/list.ts +++ b/src/commands/package/list.ts @@ -61,30 +61,30 @@ export class PackageListCommand extends SfCommand { private displayResults(results: Package2Result[], verbose = false, apiVersion: string): void { this.styledHeader(chalk.blue(`Packages [${results.length}]`)); - const columns = { - NamespacePrefix: { header: messages.getMessage('namespace') }, - Name: { header: messages.getMessage('name') }, - Id: { header: messages.getMessage('id') }, - Alias: { header: messages.getMessage('alias') }, - Description: { header: messages.getMessage('description') }, - ContainerOptions: { - header: messages.getMessage('package-type'), - }, - ...(verbose - ? { - SubscriberPackageId: { header: messages.getMessage('package-id') }, - ConvertedFromPackageId: { header: messages.getMessage('convertedFromPackageId') }, - IsOrgDependent: { header: messages.getMessage('isOrgDependent') }, - PackageErrorUsername: { header: messages.getMessage('error-notification-username') }, - CreatedBy: { header: messages.getMessage('createdBy') }, - } - : {}), - ...(verbose && parseInt(apiVersion, 10) >= 59 - ? { AppAnalyticsEnabled: { header: messages.getMessage('app-analytics-enabled') } } - : {}), - }; + let columns = [ + { key: 'NamespacePrefix', name: messages.getMessage('namespace') }, + { key: 'Name', name: messages.getMessage('name') }, + { key: 'Id', name: messages.getMessage('id') }, + { key: 'Alias', name: messages.getMessage('alias') }, + { key: 'Description', name: messages.getMessage('description') }, + { key: 'ContainerOptions', name: messages.getMessage('package-type') }, + ]; - this.table(results, columns); + if (verbose) { + columns = columns.concat([ + { name: 'SubscriberPackageId', key: messages.getMessage('package-id') }, + { name: 'ConvertedFromPackageId', key: messages.getMessage('convertedFromPackageId') }, + { name: 'IsOrgDependent', key: messages.getMessage('isOrgDependent') }, + { name: 'PackageErrorUsername', key: messages.getMessage('error-notification-username') }, + { name: 'CreatedBy', key: messages.getMessage('createdBy') }, + ]); + + if (parseInt(apiVersion, 10) >= 59) { + columns.push({ name: 'AppAnalyticsEnabled', key: messages.getMessage('app-analytics-enabled') }); + } + } + // @ts-expect-error sdfsdfs + this.table({ data: results, columns }); } } diff --git a/src/commands/package/version/create/list.ts b/src/commands/package/version/create/list.ts index 730acae0..b390ea97 100644 --- a/src/commands/package/version/create/list.ts +++ b/src/commands/package/version/create/list.ts @@ -22,24 +22,6 @@ export type CreateListCommandResult = Array< } >; -type ColumnDataHeader = { - header?: string; -}; -type ColumnData = { - Id: ColumnDataHeader; - Status: ColumnDataHeader; - Package2Id: ColumnDataHeader; - Package2VersionId: ColumnDataHeader; - SubscriberPackageVersionId: ColumnDataHeader; - Tag: ColumnDataHeader; - Branch: ColumnDataHeader; - CreatedDate: ColumnDataHeader; - CreatedBy: ColumnDataHeader; - VersionName?: ColumnDataHeader; - VersionNumber?: ColumnDataHeader; - ConvertedFromVersionId?: ColumnDataHeader; -}; - type Status = 'Queued' | 'InProgress' | 'Success' | 'Error'; export class PackageVersionCreateListCommand extends SfCommand { @@ -87,47 +69,34 @@ export class PackageVersionCreateListCommand extends SfCommand 0) { this.log(''); diff --git a/src/commands/package/version/list.ts b/src/commands/package/version/list.ts index 90209e41..94274223 100644 --- a/src/commands/package/version/list.ts +++ b/src/commands/package/version/list.ts @@ -5,8 +5,9 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core'; +import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand } from '@salesforce/sf-plugins-core'; import { Messages } from '@salesforce/core'; +import type { TableOptions } from '@oclif/table'; import { getContainerOptions, getPackageVersionStrings, @@ -214,8 +215,9 @@ export class PackageVersionListCommand extends SfCommand> => { +): TableOptions['columns'] => { if (concise) { - return { - Package2Id: { header: messages.getMessage('package-id') }, - Version: { header: messages.getMessage('version') }, - SubscriberPackageVersionId: { - header: messages.getMessage('subscriberPackageVersionId'), - }, - IsReleased: { header: 'Released' }, - }; + return [ + { key: 'Package2Id', name: messages.getMessage('package-id') }, + { key: 'Version', name: messages.getMessage('version') }, + { key: 'SubscriberPackageVersionId', name: messages.getMessage('subscriberPackageVersionId') }, + { key: 'IsReleased', name: 'Released' }, + ]; } - let defaultCols = { - Package2Name: { header: 'Package Name' }, - NamespacePrefix: { header: 'Namespace' }, - Name: { header: 'Version Name' }, - Version: { header: messages.getMessage('version') }, - SubscriberPackageVersionId: { - header: messages.getMessage('subscriberPackageVersionId'), - }, - Alias: { header: messages.getMessage('alias') }, - IsPasswordProtected: { header: messages.getMessage('installKey') }, - IsReleased: { header: 'Released' }, - ValidationSkipped: { header: messages.getMessage('validationSkipped') }, - ValidatedAsync: { header: messages.getMessage('validatedAsync') }, - AncestorId: { header: 'Ancestor' }, - AncestorVersion: { header: 'Ancestor Version' }, - Branch: { header: messages.getMessage('packageBranch') }, - }; + const defaultCols = [ + { key: 'Package2Name', name: 'Package Name' }, + { key: 'NamespacePrefix', name: 'Namespace' }, + { key: 'Name', name: 'Version Name' }, + { key: 'Version', name: messages.getMessage('version') }, + { key: 'SubscriberPackageVersionId', name: messages.getMessage('subscriberPackageVersionId') }, + { key: 'Alias', name: messages.getMessage('alias') }, + { key: 'IsPasswordProtected', name: messages.getMessage('installKey') }, + { key: 'IsReleased', name: 'Released' }, + { key: 'ValidationSkipped', name: messages.getMessage('validationSkipped') }, + { key: 'ValidatedAsync', name: messages.getMessage('validatedAsync') }, + { key: 'AncestorId', name: 'Ancestor' }, + { key: 'AncestorVersion', name: 'Ancestor Version' }, + { key: 'Branch', name: messages.getMessage('packageBranch') }, + ]; if (conversions && !verbose) { - defaultCols = Object.assign(defaultCols, { - ConvertedFromVersionId: { - header: messages.getMessage('convertedFromVersionId'), - }, - }); + defaultCols.push({ key: 'ConvertedFromVersionId', name: messages.getMessage('convertedFromVersionId') }); } if (!verbose) { + // @ts-expect-error sdfsdfs return defaultCols; } else { // add additional columns for verbose output - return { - ...defaultCols, - Package2Id: { header: messages.getMessage('package-id') }, - InstallUrl: { header: messages.getMessage('installUrl') }, - Id: { header: messages.getMessage('id') }, - CreatedDate: { header: 'Created Date' }, - LastModifiedDate: { header: 'Last Modified Date' }, - Tag: { header: messages.getMessage('packageTag') }, - Description: { header: messages.getMessage('description') }, - CodeCoverage: { header: messages.getMessage('codeCoverage') }, - HasPassedCodeCoverageCheck: { - header: messages.getMessage('hasPassedCodeCoverageCheck'), - }, - ConvertedFromVersionId: { - header: messages.getMessage('convertedFromVersionId'), - }, - IsOrgDependent: { header: messages.getMessage('isOrgDependent') }, - ReleaseVersion: { header: messages.getMessage('releaseVersion') }, - BuildDurationInSeconds: { - header: messages.getMessage('buildDurationInSeconds'), - }, - HasMetadataRemoved: { - header: messages.getMessage('hasMetadataRemoved'), - }, - CreatedBy: { header: messages.getMessage('createdBy') }, - Language: { header: messages.getMessage('language') }, - }; + // @ts-expect-error sdfsdfs + return defaultCols.concat([ + { key: 'Package2Id', name: messages.getMessage('package-id') }, + { key: 'InstallUrl', name: messages.getMessage('installUrl') }, + { key: 'Id', name: messages.getMessage('id') }, + { key: 'CreatedDate', name: 'Created Date' }, + { key: 'LastModifiedDate', name: 'Last Modified Date' }, + { key: 'Tag', name: messages.getMessage('packageTag') }, + { key: 'Description', name: messages.getMessage('description') }, + { key: 'CodeCoverage', name: messages.getMessage('codeCoverage') }, + { key: 'HasPassedCodeCoverageCheck', name: messages.getMessage('hasPassedCodeCoverageCheck') }, + { key: 'ConvertedFromVersionId', name: messages.getMessage('convertedFromVersionId') }, + { key: 'IsOrgDependent', name: messages.getMessage('isOrgDependent') }, + { key: 'ReleaseVersion', name: messages.getMessage('releaseVersion') }, + { key: 'BuildDurationInSeconds', name: messages.getMessage('buildDurationInSeconds') }, + { key: 'HasMetadataRemoved', name: messages.getMessage('hasMetadataRemoved') }, + { key: 'CreatedBy', name: messages.getMessage('createdBy') }, + { key: 'Language', name: messages.getMessage('language') }, + ]); } }; diff --git a/src/commands/package/version/report.ts b/src/commands/package/version/report.ts index d607d264..7e5cae14 100644 --- a/src/commands/package/version/report.ts +++ b/src/commands/package/version/report.ts @@ -213,9 +213,9 @@ export class PackageVersionReportCommand extends SfCommand 0) { - this.table(displayCoverageRecords, { key: { header: 'Class Name' }, value: { header: 'Code Coverage' } }); + this.table({ data: displayCoverageRecords }); } } diff --git a/src/commands/package/version/retrieve.ts b/src/commands/package/version/retrieve.ts index d01e0721..c0d886f9 100644 --- a/src/commands/package/version/retrieve.ts +++ b/src/commands/package/version/retrieve.ts @@ -81,15 +81,14 @@ export class PackageVersionRetrieveCommand extends SfCommand ({ + const data = (await pv1.getPackageVersion()).map((result) => ({ MetadataPackageVersionId: result.Id, MetadataPackageId: result.MetadataPackageId, Name: result.Name, @@ -55,19 +55,12 @@ export class Package1VersionDisplayCommand extends SfCommand { const { flags } = await this.parse(Package1VersionListCommand); - const result = ( + const data = ( await Package1Version.list(flags['target-org'].getConnection(flags['api-version']), flags['package-id'] as string) ).map((record) => ({ MetadataPackageVersionId: record.Id, @@ -51,18 +51,11 @@ export class Package1VersionListCommand extends SfCommand=0.6.0: resolved "https://registry.yarnpkg.com/sax/-/sax-1.3.0.tgz#a5dbe77db3be05c9d1ee7785dbd3ea9de51593d0" integrity sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA== +scheduler@^0.23.0, scheduler@^0.23.2: + version "0.23.2" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.2.tgz#414ba64a3b282892e944cf2108ecc078d115cdc3" + integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ== + dependencies: + loose-envify "^1.1.0" + secure-json-parse@^2.4.0: version "2.7.0" resolved "https://registry.yarnpkg.com/secure-json-parse/-/secure-json-parse-2.7.0.tgz#5a5f9cd6ae47df23dba3151edd06855d47e09862" @@ -6690,7 +6848,7 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.2, signal-exit@^3.0.3: +signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== @@ -6739,6 +6897,14 @@ slash@^5.1.0: resolved "https://registry.yarnpkg.com/slash/-/slash-5.1.0.tgz#be3adddcdf09ac38eebe8dcdc7b1a57a75b095ce" integrity sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg== +slice-ansi@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-5.0.0.tgz#b73063c57aa96f9cd881654b15294d95d285c42a" + integrity sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ== + dependencies: + ansi-styles "^6.0.0" + is-fullwidth-code-point "^4.0.0" + slice-ansi@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-7.1.0.tgz#cd6b4655e298a8d1bdeb04250a433094b347b9a9" @@ -6884,6 +7050,13 @@ srcset@^5.0.0: resolved "https://registry.yarnpkg.com/srcset/-/srcset-5.0.0.tgz#9df6c3961b5b44a02532ce6ae4544832609e2e3f" integrity sha512-SqEZaAEhe0A6ETEa9O1IhSPC7MdvehZtCnTR0AftXk3QhY2UNgb+NApFOUPZILXk/YTDfFxMTNJOBpzrJsEdIA== +stack-utils@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" + integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== + dependencies: + escape-string-regexp "^2.0.0" + "string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -6911,7 +7084,7 @@ string-width@^5.0.1, string-width@^5.1.2: emoji-regex "^9.2.2" strip-ansi "^7.0.1" -string-width@^7.2.0: +string-width@^7.0.0, string-width@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-7.2.0.tgz#b5bb8e2165ce275d4d43476dd2700ad9091db6dc" integrity sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ== @@ -7237,6 +7410,11 @@ type-fest@^1.0.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-1.4.0.tgz#e9fb813fe3bf1744ec359d55d1affefa76f14be1" integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA== +type-fest@^4.8.3: + version "4.26.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.26.1.tgz#a4a17fa314f976dd3e6d6675ef6c775c16d7955e" + integrity sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg== + typed-array-buffer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz#18de3e7ed7974b0a729d3feecb94338d1472cd60" @@ -7334,11 +7512,6 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -undici-types@~6.18.2: - version "6.18.2" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.18.2.tgz#8b678cf939d4fc9ec56be3c68ed69c619dee28b0" - integrity sha512-5ruQbENj95yDYJNS3TvcaxPMshV7aizdv/hWYjGIKoANWKjhWNBsr2YEuYZKodQulB1b8l7ILOuDQep3afowQQ== - undici-types@~6.19.2: version "6.19.8" resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" @@ -7502,6 +7675,13 @@ widest-line@^3.1.0: dependencies: string-width "^4.0.0" +widest-line@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-5.0.0.tgz#b74826a1e480783345f0cd9061b49753c9da70d0" + integrity sha512-c9bZp7b5YtRj2wOe6dlj32MK+Bx/M/d+9VB2SHM1OtsUHR0aV0tdP6DWh/iMt0kWi1t5g1Iudu6hQRNd1A4PVA== + dependencies: + string-width "^7.0.0" + wireit@^0.14.5: version "0.14.5" resolved "https://registry.yarnpkg.com/wireit/-/wireit-0.14.5.tgz#cd1c4136444c8dbe655f34f60fe2454a9e69d430" @@ -7559,6 +7739,15 @@ wrap-ansi@^8.1.0: string-width "^5.0.1" strip-ansi "^7.0.1" +wrap-ansi@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-9.0.0.tgz#1a3dc8b70d85eeb8398ddfb1e4a02cd186e58b3e" + integrity sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q== + dependencies: + ansi-styles "^6.2.1" + string-width "^7.0.0" + strip-ansi "^7.1.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -7574,6 +7763,11 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" +ws@^8.15.0: + version "8.18.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" + integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== + xml2js@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.6.2.tgz#dd0b630083aa09c161e25a4d0901e2b2a929b499" @@ -7702,3 +7896,8 @@ yoctocolors-cjs@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz#f4b905a840a37506813a7acaa28febe97767a242" integrity sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA== + +yoga-wasm-web@~0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/yoga-wasm-web/-/yoga-wasm-web-0.3.3.tgz#eb8e9fcb18e5e651994732f19a220cb885d932ba" + integrity sha512-N+d4UJSJbt/R3wqY7Coqs5pcV0aUj2j9IaQ3rNj9bVCLld8tTGKRa2USARjnvZJWVx1NDmQev8EknoczaOQDOA== From e1f820b7ce62e2254b2498e681554721798b7a8c Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Wed, 23 Oct 2024 09:09:37 -0600 Subject: [PATCH 02/12] docs: fix missing template string --- messages/package_version_delete.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messages/package_version_delete.md b/messages/package_version_delete.md index 43e1688f..d1bd0e5f 100644 --- a/messages/package_version_delete.md +++ b/messages/package_version_delete.md @@ -50,4 +50,4 @@ Successfully deleted the package version with ID: %s # humanSuccessUndelete -Successfully undeleted the package version. +Successfully undeleted the package version. %s From de5c34504c645ed2ede2ba53ce15d80c427e1c05 Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Wed, 23 Oct 2024 10:13:43 -0600 Subject: [PATCH 03/12] chore: fix column types --- src/commands/package/list.ts | 42 ++++++++++----------- src/commands/package/version/create/list.ts | 35 ++++++++--------- src/commands/package/version/list.ts | 4 +- 3 files changed, 37 insertions(+), 44 deletions(-) diff --git a/src/commands/package/list.ts b/src/commands/package/list.ts index d6573dc1..94b0e0b5 100644 --- a/src/commands/package/list.ts +++ b/src/commands/package/list.ts @@ -61,30 +61,26 @@ export class PackageListCommand extends SfCommand { private displayResults(results: Package2Result[], verbose = false, apiVersion: string): void { this.styledHeader(chalk.blue(`Packages [${results.length}]`)); - let columns = [ - { key: 'NamespacePrefix', name: messages.getMessage('namespace') }, - { key: 'Name', name: messages.getMessage('name') }, - { key: 'Id', name: messages.getMessage('id') }, - { key: 'Alias', name: messages.getMessage('alias') }, - { key: 'Description', name: messages.getMessage('description') }, - { key: 'ContainerOptions', name: messages.getMessage('package-type') }, - ]; - if (verbose) { - columns = columns.concat([ - { name: 'SubscriberPackageId', key: messages.getMessage('package-id') }, - { name: 'ConvertedFromPackageId', key: messages.getMessage('convertedFromPackageId') }, - { name: 'IsOrgDependent', key: messages.getMessage('isOrgDependent') }, - { name: 'PackageErrorUsername', key: messages.getMessage('error-notification-username') }, - { name: 'CreatedBy', key: messages.getMessage('createdBy') }, - ]); - - if (parseInt(apiVersion, 10) >= 59) { - columns.push({ name: 'AppAnalyticsEnabled', key: messages.getMessage('app-analytics-enabled') }); - } - } - // @ts-expect-error sdfsdfs - this.table({ data: results, columns }); + const data = results.map((r) => ({ + 'Namespace Prefix': r.NamespacePrefix, + Name: r.Name, + Id: r.Id, + Alias: r.Alias, + Description: r.Description, + ContainerOptions: r.ContainerOptions, + ...(verbose + ? { + 'Package Id': r.SubscriberPackageId, + 'Converted From Package Id': r.ConvertedFromPackageId, + 'Org-Dependent Unlocked Package': r.IsOrgDependent, + 'Error Notification Username': r.PackageErrorUsername, + 'Created By': r.CreatedBy, + ...(parseInt(apiVersion, 10) >= 59 ? { 'App Analytics Enabled': r.AppAnalyticsEnabled } : {}), + } + : {}), + })); + this.table({ data }); } } diff --git a/src/commands/package/version/create/list.ts b/src/commands/package/version/create/list.ts index b390ea97..a5b001ad 100644 --- a/src/commands/package/version/create/list.ts +++ b/src/commands/package/version/create/list.ts @@ -69,34 +69,31 @@ export class PackageVersionCreateListCommand extends SfCommand ({ + Id: r.Id, + Status: r.Status, + 'Package Id': r.Package2Id, + 'Package Version Id': r.Package2VersionId, + 'Subscriber Package Version Id': r.SubscriberPackageVersionId, + Tag: r.Tag, + Branch: r.Branch, + 'Created Date': r.CreatedDate, + 'Created By': r.CreatedBy, + ...(flags['show-conversions-only'] ? { 'Converted From Version Id': r.ConvertedFromVersionId } : {}), + ...(flags.verbose ? { 'Version Name': r.VersionName, 'Version Number': r.VersionNumber } : {}), + })); - this.table({ data: results, columns: columnData }); + this.table({ data }); } return results; diff --git a/src/commands/package/version/list.ts b/src/commands/package/version/list.ts index 94274223..ec03684c 100644 --- a/src/commands/package/version/list.ts +++ b/src/commands/package/version/list.ts @@ -261,11 +261,11 @@ const getColumnData = ( } if (!verbose) { - // @ts-expect-error sdfsdfs + // @ts-expect-error the default cols don't match 1:1 to the data in the table, but that's on purpose return defaultCols; } else { // add additional columns for verbose output - // @ts-expect-error sdfsdfs + // @ts-expect-error the verbose match 1:1 to the data in the table, but that's on purpose, but the OCLIF types can't determine tha return defaultCols.concat([ { key: 'Package2Id', name: messages.getMessage('package-id') }, { key: 'InstallUrl', name: messages.getMessage('installUrl') }, From 8347ccad8526161cf299b0a6f12a003e5e5fc2ce Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Wed, 23 Oct 2024 10:38:53 -0600 Subject: [PATCH 04/12] docs: update per Juliet --- messages/package_version_delete.md | 2 +- test/commands/package/version.delete.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/messages/package_version_delete.md b/messages/package_version_delete.md index d1bd0e5f..03af6d62 100644 --- a/messages/package_version_delete.md +++ b/messages/package_version_delete.md @@ -50,4 +50,4 @@ Successfully deleted the package version with ID: %s # humanSuccessUndelete -Successfully undeleted the package version. %s +Successfully undeleted package version %s. diff --git a/test/commands/package/version.delete.test.ts b/test/commands/package/version.delete.test.ts index 6e469c07..7ede093d 100644 --- a/test/commands/package/version.delete.test.ts +++ b/test/commands/package/version.delete.test.ts @@ -111,7 +111,7 @@ describe('package:version:delete', () => { command.project = SfProject.getInstance(); const results: PackageSaveResult = await command.run(); expect(uxSuccessStub.calledOnce).to.be.true; - expect(uxSuccessStub.args[0][0]).to.equal('Successfully undeleted the package version. testId'); + expect(uxSuccessStub.args[0][0]).to.equal('Successfully undeleted package version testId.'); expect(results.id).to.equal('testId'); }); }); From 87e86b339e362de3a58f2ff4a97946fb9741bc3a Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Wed, 23 Oct 2024 13:48:21 -0600 Subject: [PATCH 05/12] chore: add overflow:wrap --- src/commands/package/installed/list.ts | 1 + src/commands/package/version/create/list.ts | 2 +- src/commands/package/version/list.ts | 1 + src/commands/package/version/retrieve.ts | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands/package/installed/list.ts b/src/commands/package/installed/list.ts index a6b69783..b3d00c8f 100644 --- a/src/commands/package/installed/list.ts +++ b/src/commands/package/installed/list.ts @@ -58,6 +58,7 @@ export class PackageInstalledListCommand extends SfCommand Date: Wed, 23 Oct 2024 15:07:28 -0600 Subject: [PATCH 06/12] test: remove creating new sandboxes in UTs --- test/commands/package/installReport.test.ts | 5 +---- test/commands/package/packageUninstall.test.ts | 8 +++----- .../package/packageVersionCreateReport.test.ts | 9 ++++----- test/commands/package/version.delete.test.ts | 6 ++---- test/commands/package/versionReport.test.ts | 10 ++++------ test/commands/package1/versionCreate.test.ts | 8 +++----- test/commands/package1/versionCreateGet.test.ts | 8 +++----- 7 files changed, 20 insertions(+), 34 deletions(-) diff --git a/test/commands/package/installReport.test.ts b/test/commands/package/installReport.test.ts index e2fe06a9..f49d8f28 100644 --- a/test/commands/package/installReport.test.ts +++ b/test/commands/package/installReport.test.ts @@ -44,8 +44,6 @@ describe('package:install:report', () => { const testOrg = new MockTestOrgData(); const config = new Config({ root: import.meta.url }); - const sandbox = sinon.createSandbox(); - // stubs let uxLogStub: sinon.SinonStub; let getInstallRequestStub: sinon.SinonStub; @@ -56,12 +54,11 @@ describe('package:install:report', () => { }); beforeEach(async () => { - uxLogStub = sandbox.stub(SfCommand.prototype, 'log'); + uxLogStub = $$.SANDBOX.stub(SfCommand.prototype, 'log'); }); afterEach(() => { $$.restore(); - sandbox.restore(); }); it('should error without required --request-id param', async () => { diff --git a/test/commands/package/packageUninstall.test.ts b/test/commands/package/packageUninstall.test.ts index d8d092dd..b62ace6a 100644 --- a/test/commands/package/packageUninstall.test.ts +++ b/test/commands/package/packageUninstall.test.ts @@ -18,8 +18,6 @@ describe('package:uninstall', () => { const testOrg = new MockTestOrgData(); const config = new Config({ root: import.meta.url }); - const sandbox = sinon.createSandbox(); - // stubs let logStub: sinon.SinonStub; @@ -29,16 +27,16 @@ describe('package:uninstall', () => { }); beforeEach(async () => { - logStub = sandbox.stub(SfCommand.prototype, 'log'); + logStub = $$.SANDBOX.stub(SfCommand.prototype, 'log'); }); afterEach(() => { $$.restore(); - sandbox.restore(); + $$.SANDBOX.restore(); }); const libraryStubResult = (status: 'Error' | 'InProgress' | 'Queued' | 'Success'): void => { - sandbox.stub(SubscriberPackageVersion.prototype, 'uninstall').resolves({ + $$.SANDBOX.stub(SubscriberPackageVersion.prototype, 'uninstall').resolves({ Id: '06y23000000002MXXX', IsDeleted: true, CreatedDate: 123, diff --git a/test/commands/package/packageVersionCreateReport.test.ts b/test/commands/package/packageVersionCreateReport.test.ts index 368e9c03..277160a0 100644 --- a/test/commands/package/packageVersionCreateReport.test.ts +++ b/test/commands/package/packageVersionCreateReport.test.ts @@ -89,11 +89,10 @@ describe('package:version:create:report - tests', () => { let warnStub: sinon.SinonStub; const config = new Config({ root: import.meta.url }); - const sandbox = sinon.createSandbox(); beforeEach(async () => { - warnStub = sandbox.stub(SfCommand.prototype, 'warn'); - styledHeaderStub = sandbox.stub(SfCommand.prototype, 'styledHeader'); - tableStub = sandbox.stub(SfCommand.prototype, 'table'); + warnStub = $$.SANDBOX.stub(SfCommand.prototype, 'warn'); + styledHeaderStub = $$.SANDBOX.stub(SfCommand.prototype, 'styledHeader'); + tableStub = $$.SANDBOX.stub(SfCommand.prototype, 'table'); }); before(async () => { @@ -103,7 +102,7 @@ describe('package:version:create:report - tests', () => { afterEach(() => { $$.restore(); - sandbox.restore(); + $$.SANDBOX.restore(); }); describe('package:version:create:report', () => { diff --git a/test/commands/package/version.delete.test.ts b/test/commands/package/version.delete.test.ts index 7ede093d..04877b11 100644 --- a/test/commands/package/version.delete.test.ts +++ b/test/commands/package/version.delete.test.ts @@ -18,8 +18,6 @@ describe('package:version:delete', () => { const testOrg = new MockTestOrgData(); const config = new Config({ root: import.meta.url }); - const sandbox = sinon.createSandbox(); - // stubs let uxSuccessStub: sinon.SinonStub; let uxConfirmStub: sinon.SinonStub; @@ -29,7 +27,7 @@ describe('package:version:delete', () => { let undeleteStub: sinon.SinonStub; beforeEach(async () => { - uxSuccessStub = sandbox.stub(SfCommand.prototype, 'logSuccess'); + uxSuccessStub = $$.SANDBOX.stub(SfCommand.prototype, 'logSuccess'); uxConfirmStub = $$.SANDBOX.stub(SfCommand.prototype, 'confirm'); deleteStub = $$.SANDBOX.stub(); undeleteStub = $$.SANDBOX.stub(); @@ -50,7 +48,7 @@ describe('package:version:delete', () => { afterEach(() => { $$.restore(); - sandbox.restore(); + $$.SANDBOX.restore(); }); beforeEach(() => {}); diff --git a/test/commands/package/versionReport.test.ts b/test/commands/package/versionReport.test.ts index eef172ec..a8a66be8 100644 --- a/test/commands/package/versionReport.test.ts +++ b/test/commands/package/versionReport.test.ts @@ -114,17 +114,15 @@ describe('package:version:report - tests', () => { const testOrg = new MockTestOrgData(); const config = new Config({ root: import.meta.url }); - const sandbox = sinon.createSandbox(); - // stubs let uxLogStub: sinon.SinonStub; let uxTableStub: sinon.SinonStub; let uxStyledHeaderStub: sinon.SinonStub; beforeEach(async () => { - uxLogStub = sandbox.stub(SfCommand.prototype, 'log'); - uxTableStub = sandbox.stub(SfCommand.prototype, 'table'); - uxStyledHeaderStub = sandbox.stub(SfCommand.prototype, 'styledHeader'); + uxLogStub = $$.SANDBOX.stub(SfCommand.prototype, 'log'); + uxTableStub = $$.SANDBOX.stub(SfCommand.prototype, 'table'); + uxStyledHeaderStub = $$.SANDBOX.stub(SfCommand.prototype, 'styledHeader'); }); before(async () => { @@ -134,7 +132,7 @@ describe('package:version:report - tests', () => { afterEach(() => { $$.restore(); - sandbox.restore(); + $$.SANDBOX.restore(); }); describe('package:version:report', () => { diff --git a/test/commands/package1/versionCreate.test.ts b/test/commands/package1/versionCreate.test.ts index 9ee9c37a..9ee9480d 100644 --- a/test/commands/package1/versionCreate.test.ts +++ b/test/commands/package1/versionCreate.test.ts @@ -18,8 +18,6 @@ describe('package1:version:create', () => { const testOrg = new MockTestOrgData(); const config = new Config({ root: import.meta.url }); - const sandbox = sinon.createSandbox(); - // stubs let uxLogStub: sinon.SinonStub; @@ -29,16 +27,16 @@ describe('package1:version:create', () => { }); beforeEach(async () => { - uxLogStub = sandbox.stub(SfCommand.prototype, 'log'); + uxLogStub = $$.SANDBOX.stub(SfCommand.prototype, 'log'); }); afterEach(() => { $$.restore(); - sandbox.restore(); + $$.SANDBOX.restore(); }); const libraryStubResult = (status: string): void => { - sandbox.stub(Package1Version, 'create').resolves({ + $$.SANDBOX.stub(Package1Version, 'create').resolves({ CreatedById: '', CreatedDate: 0, Description: '', diff --git a/test/commands/package1/versionCreateGet.test.ts b/test/commands/package1/versionCreateGet.test.ts index f2e701b1..13741f08 100644 --- a/test/commands/package1/versionCreateGet.test.ts +++ b/test/commands/package1/versionCreateGet.test.ts @@ -17,8 +17,6 @@ describe('package1:version:create:get', () => { const testOrg = new MockTestOrgData(); const config = new Config({ root: import.meta.url }); - const sandbox = sinon.createSandbox(); - // stubs let uxStub: sinon.SinonStub; @@ -28,16 +26,16 @@ describe('package1:version:create:get', () => { }); beforeEach(async () => { - uxStub = sandbox.stub(SfCommand.prototype, 'log'); + uxStub = $$.SANDBOX.stub(SfCommand.prototype, 'log'); }); afterEach(() => { $$.restore(); - sandbox.restore(); + $$.SANDBOX.restore(); }); const libraryStubResult = (status: string, errors?: { errors: Error[] }): void => { - sandbox.stub(Package1Version, 'getCreateStatus').resolves({ + $$.SANDBOX.stub(Package1Version, 'getCreateStatus').resolves({ CreatedById: '', CreatedDate: 0, Description: '', From af37bcf9384b43511448b40ac368c5406a15cb3a Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Thu, 24 Oct 2024 10:29:36 -0600 Subject: [PATCH 07/12] test: change regex to match new table --- test/commands/package/packageCreateAndDelete.nut.ts | 2 +- test/commands/package/packageInstalledList.nut.ts | 2 +- test/commands/package/packageList.nut.ts | 2 +- test/commands/package1/versionDisplay.nut.ts | 2 +- test/commands/package1/versionList.nut.ts | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/commands/package/packageCreateAndDelete.nut.ts b/test/commands/package/packageCreateAndDelete.nut.ts index 6ff7e66e..2cb69ef0 100644 --- a/test/commands/package/packageCreateAndDelete.nut.ts +++ b/test/commands/package/packageCreateAndDelete.nut.ts @@ -34,7 +34,7 @@ describe('package create/update/delete', () => { const command = `package:create -n ${pkgName} -v ${session.hubOrg.username} -t Unlocked -r ./force-app`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; expect(output).to.contain('=== Ids'); - expect(output).to.match(/Package Id\s+?0Ho/); + expect(output).to.match(/Package Id\s+?|0Ho/); }); it('should update a package - human readable results', () => { const command = `package:update --package ${pkgName} --description "My new description" -v ${session.hubOrg.username}`; diff --git a/test/commands/package/packageInstalledList.nut.ts b/test/commands/package/packageInstalledList.nut.ts index 6bb18243..f6cab208 100644 --- a/test/commands/package/packageInstalledList.nut.ts +++ b/test/commands/package/packageInstalledList.nut.ts @@ -26,7 +26,7 @@ describe('package:installed:list', () => { const command = `package:installed:list -o ${session.hubOrg.username}`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; expect(output).to.match( - /ID\s+?Package ID\s+?Package Name\s+?Namespace\s+?Package Version ID\s+?Version Name\s+?Version/ + /ID\s+?|Package ID\s+?|Package Name\s+?|Namespace\s+?|Package Version ID\s+?|Version Name\s+?|Version/ ); }); diff --git a/test/commands/package/packageList.nut.ts b/test/commands/package/packageList.nut.ts index 68235ebb..e29beee4 100644 --- a/test/commands/package/packageList.nut.ts +++ b/test/commands/package/packageList.nut.ts @@ -59,7 +59,7 @@ describe('package list', () => { const command = `package:list -v ${session.hubOrg.username}`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; expect(output).to.contain('=== Packages'); - expect(output).to.match(/Namespace Prefix\s+?Name\s+?Id\s+?Alias\s+?Description\s+?Type/); + expect(output).to.match(/Namespace Prefix\s+?|Name\s+?|Id\s+?|Alias\s+?|Description\s+?|Type/); }); it('should list packages in dev hub - verbose human readable results', () => { const command = `package:list -v ${session.hubOrg.username} --verbose`; diff --git a/test/commands/package1/versionDisplay.nut.ts b/test/commands/package1/versionDisplay.nut.ts index d9d18ad6..092553e9 100644 --- a/test/commands/package1/versionDisplay.nut.ts +++ b/test/commands/package1/versionDisplay.nut.ts @@ -29,7 +29,7 @@ describe('package1:version:display', () => { const command = `package1:version:display -i ${packageVersionId} -o ${session.hubOrg.username}`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; expect(output).to.match( - /MetadataPackageVersionId\s+?MetadataPackageId\s+?Name\s+?Version\s+?ReleaseState\s+?BuildNumber/ + /MetadataPackageVersionId\s+?|MetadataPackageId\s+?|Name\s+?|Version\s+?|ReleaseState\s+?|BuildNumber/ ); }); diff --git a/test/commands/package1/versionList.nut.ts b/test/commands/package1/versionList.nut.ts index ba5e6a3f..7206ff5d 100644 --- a/test/commands/package1/versionList.nut.ts +++ b/test/commands/package1/versionList.nut.ts @@ -29,7 +29,7 @@ describe('package1:version:list', () => { const command = `package1:version:list -o ${session.hubOrg.username}`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; expect(output).to.match( - /MetadataPackageVersionId\s+?MetadataPackageId\s+?Name\s+?Version\s+?ReleaseState\s+?BuildNumber/ + /MetadataPackageVersionId\s+?|MetadataPackageId\s+?|Name\s+?|Version\s+?|ReleaseState\s+?|BuildNumber/ ); }); @@ -60,7 +60,7 @@ describe('package1:version:list', () => { const command = `package1:version:list -i ${packageId} -o ${session.hubOrg.username}`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; expect(output).to.match( - /MetadataPackageVersionId\s+?MetadataPackageId\s+?Name\s+?Version\s+?ReleaseState\s+?BuildNumber/ + /MetadataPackageVersionId\s+?|MetadataPackageId\s+?|Name\s+?|Version\s+?|ReleaseState\s+?|BuildNumber/ ); }); From 6191625f07bc218e16ba273ae59d449783628f23 Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Thu, 24 Oct 2024 11:26:44 -0600 Subject: [PATCH 08/12] test: change regex to match new table rd II --- src/commands/package/version/create/report.ts | 22 +++++++++---------- test/commands/package/packageList.nut.ts | 4 ++-- test/commands/package/packageVersion.nut.ts | 18 +++++++-------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/commands/package/version/create/report.ts b/src/commands/package/version/create/report.ts index f0a7569a..c9ecce56 100644 --- a/src/commands/package/version/create/report.ts +++ b/src/commands/package/version/create/report.ts @@ -61,47 +61,47 @@ export class PackageVersionCreateReportCommand extends SfCommand { const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; expect(output).to.contain('=== Packages'); let headerExpression = - 'Namespace Prefix\\s+?Name\\s+?Id\\s+?Alias\\s+?Description\\s+?Type\\s+?Subscriber Package Id\\s+?Converted From Package Id\\s+?Org-Dependent Unlocked Package\\s+?Error Notification Username\\s+?Created By\\s+?App Analytics Enabled'; + 'Namespace Prefix\\s+?|Name\\s+?|Id\\s+?|Alias\\s+?|Description\\s+?|Type\\s+?|Subscriber Package Id\\s+?|Converted From Package Id\\s+?|Org-Dependent Unlocked Package\\s+?|Error Notification Username\\s+?|Created By\\s+?|App Analytics Enabled'; if (apiVersion < 59.0) { - headerExpression = headerExpression.replace('App Analytics Enabled\\s+?', ''); + headerExpression = headerExpression.replace('App Analytics Enabled\\s+?|', ''); } expect(output).to.match(new RegExp(headerExpression)); }); diff --git a/test/commands/package/packageVersion.nut.ts b/test/commands/package/packageVersion.nut.ts index d4667874..fa5bf5ce 100644 --- a/test/commands/package/packageVersion.nut.ts +++ b/test/commands/package/packageVersion.nut.ts @@ -197,7 +197,7 @@ describe('package:version:*', () => { const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; expect(output).to.contain('=== Package Version Create Requests ['); expect(output).to.match( - / Id\s+Status\s+Package Id\s+Package Version Id\s+Subscriber Package Version Id\s+Tag\s+Branch\s+Created Date\s+Created By\s+/ + / Id\s+?|Status\s+?|Package Id\s+?|Package Version Id\s+?|Subscriber Package Version Id\s+?|Tag\s+?|Branch\s+?|Created Date\s+?|Created By\s+?|/ ); }); @@ -242,7 +242,7 @@ describe('package:version:*', () => { const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; expect(output).to.contain('=== Package Version Create Requests ['); expect(output).to.match( - / Id\s+Status\s+Package Id\s+Package Version Id\s+Subscriber Package Version Id\s+Tag\s+Branch\s+Created Date\s+Created By\s+Converted From Version Id\s+/ + / Id\s+?|Status\s+?|Package Id\s+?|Package Version Id\s+?|Subscriber Package Version Id\s+?|Tag\s+?|Branch\s+?|Created Date\s+?|Created By\s+?|Converted From Version Id\s+?|/ ); }); it('should list the package versions created --verbose (json)', async () => { @@ -262,7 +262,7 @@ describe('package:version:*', () => { const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; expect(output).to.contain('=== Package Versions ['); expect(output).to.match( - /Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch/ + /Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch/ ); }); @@ -270,7 +270,7 @@ describe('package:version:*', () => { const command = `package:version:list -v ${session.hubOrg.username} --concise`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; expect(output).to.contain('=== Package Versions ['); - expect(output).to.match(/Package Id\s+Version\s+Subscriber Package Version Id\s+Released/); + expect(output).to.match(/Package Id\s+?|Version\s+?|Subscriber Package Version Id\s+?|Released/); }); it('should list package versions modified in the last 5 days', () => { @@ -278,7 +278,7 @@ describe('package:version:*', () => { const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; expect(output).to.contain('=== Package Versions ['); expect(output).to.match( - /Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch/ + /Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch/ ); }); it('should list package versions created in the last 5 days', () => { @@ -286,7 +286,7 @@ describe('package:version:*', () => { const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; expect(output).to.contain('=== Package Versions ['); expect(output).to.match( - /Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch/ + /Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch/ ); }); it('should list installed packages in dev hub - verbose human readable results', () => { @@ -294,7 +294,7 @@ describe('package:version:*', () => { const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; expect(output).to.contain('=== Package Versions ['); expect(output).to.match( - /Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch\s+Package Id\s+Installation URL\s+Package Version Id\s+Created Date\s+Last Modified Date\s+Tag\s+Description\s+Code Coverage\s+Code Coverage Met\s+Converted From Version Id\s+Org-Dependent\s+Unlocked Package\s+Release\s+Version\s+Build Duration in Seconds\s+Managed Metadata Removed\s+Created By/ + /Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch\s+?|Package Id\s+?|Installation URL\s+?|Package Version Id\s+?|Created Date\s+?|Last Modified Date\s+?|Tag\s+?|Description\s+?|Code Coverage\s+?|Code Coverage Met\s+?|Converted From Version Id\s+?|Org-Dependent\s+?|Unlocked Package\s+?|Release\s+?|Version\s+?|Build Duration in Seconds\s+?|Managed Metadata Removed\s+?|Created By/ ); }); @@ -303,7 +303,7 @@ describe('package:version:*', () => { const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; expect(output).to.contain('=== Package Versions ['); expect(output).to.match( - /Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch\s+Package Id\s+Installation URL\s+Package Version Id\s+Created Date\s+Last Modified Date\s+Tag\s+Description\s+Code Coverage\s+Code Coverage Met\s+Converted From Version Id\s+Org-Dependent\s+Unlocked Package\s+Release\s+Version\s+Build Duration in Seconds\s+Managed Metadata Removed\s+Created By/ + /Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch\s+?|Package Id\s+?|Installation URL\s+?|Package Version Id\s+?|Created Date\s+?|Last Modified Date\s+?|Tag\s+?|Description\s+?|Code Coverage\s+?|Code Coverage Met\s+?|Converted From Version Id\s+?|Org-Dependent\s+?|Unlocked Package\s+?|Release\s+?|Version\s+?|Build Duration in Seconds\s+?|Managed Metadata Removed\s+?|Created By/ ); expect(output).to.include('testing'); }); @@ -401,7 +401,7 @@ describe('package:version:*', () => { const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; expect(output).to.contain('=== Package Versions ['); expect(output).to.match( - /Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch\s+Converted From Version Id/ + /Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch\s+?|Converted From Version Id/ ); }); }); From 197bc69c3f8838a05a44c00e37fd10e2c0b22ef1 Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Tue, 29 Oct 2024 13:25:41 -0600 Subject: [PATCH 09/12] chore: bump sf-plugins-core --- package.json | 2 +- yarn.lock | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index a71bd342..edf7dd31 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "@salesforce/core": "^8.6.2", "@salesforce/kit": "^3.2.3", "@salesforce/packaging": "^4.2.15", - "@salesforce/sf-plugins-core": "^12.0.6", + "@salesforce/sf-plugins-core": "^12.0.10", "chalk": "^5.3.0" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 44cfcf78..a8be2b47 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1301,13 +1301,13 @@ http-call "^5.2.2" lodash "^4.17.21" -"@oclif/table@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@oclif/table/-/table-0.2.0.tgz#01330ec8f67fce1e5d79114bfb09f531c2a82bcb" - integrity sha512-+JjK+btxV+Xpjn2vFqYaAO4PLEpPRw1ampQbB/5rtziZpMwwHKjSqL9qEoMm/xUE0UujqNgcTbK/dRUlfCwuXw== +"@oclif/table@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@oclif/table/-/table-0.3.0.tgz#b87ba5d20e7e84a1d4744e68c64093dbc8bd8de9" + integrity sha512-HzUUyNcoEzfyvzzXL1evLZmiMBZ2SnH41lNHpoKJZJR4uCdiMkOzlkLf9M326qLmRJTDpKnUHgIZD778T647gg== dependencies: "@oclif/core" "^4" - "@types/react" "^18.3.11" + "@types/react" "^18.3.12" change-case "^5.4.4" cli-truncate "^4.0.0" ink "^5.0.1" @@ -1468,15 +1468,15 @@ string-width "^7.2.0" terminal-link "^3.0.0" -"@salesforce/sf-plugins-core@^12.0.6": - version "12.0.6" - resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-12.0.6.tgz#13ca551cf08cd5684303b96fee11d321a7213247" - integrity sha512-rHnPnq6wk1PcZ4Q+eANpoXYDy6nwzCD3q8kWPXV6SsPMGvyV4lbFNdOPjK/nhR5MESG29fC3ZVhVmUvOoDNIrg== +"@salesforce/sf-plugins-core@^12.0.10": + version "12.0.10" + resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-12.0.10.tgz#193796818cc9caad99f2fdc5bbaefd0206d1a08f" + integrity sha512-SCrA7NARQYEPlQZjEgEgBAVxAAEJLyDRJ2CDS2jm+H5sy3tmr8f4+Wvif7zO0MdWk2rLaR+D+L27171NG0PreQ== dependencies: "@inquirer/confirm" "^3.1.22" "@inquirer/password" "^2.2.0" "@oclif/core" "^4.0.27" - "@oclif/table" "^0.2.0" + "@oclif/table" "^0.3.0" "@salesforce/core" "^8.5.1" "@salesforce/kit" "^3.2.3" "@salesforce/ts-types" "^2.0.12" @@ -2230,10 +2230,10 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.13.tgz#2af91918ee12d9d32914feb13f5326658461b451" integrity sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA== -"@types/react@^18.3.11": - version "18.3.11" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.11.tgz#9d530601ff843ee0d7030d4227ea4360236bd537" - integrity sha512-r6QZ069rFTjrEYgFdOck1gK7FLVsgJE7tTz0pQBczlBNUhBNk0MQH4UbnFSwjpQLMkLzgqvBBa+qGpLje16eTQ== +"@types/react@^18.3.12": + version "18.3.12" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.12.tgz#99419f182ccd69151813b7ee24b792fe08774f60" + integrity sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw== dependencies: "@types/prop-types" "*" csstype "^3.0.2" From 15927e79b73db28c46e66c049a44fa3cd42e9cca Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Wed, 30 Oct 2024 13:30:31 -0600 Subject: [PATCH 10/12] chore: move styled headers into table title --- src/commands/package/create.ts | 3 +-- src/commands/package/list.ts | 4 +--- src/commands/package/version/create/list.ts | 4 +--- src/commands/package/version/create/report.ts | 3 +-- src/commands/package/version/list.ts | 2 +- src/commands/package/version/report.ts | 3 +-- test/commands/package/packageVersionCreateReport.test.ts | 4 ---- test/commands/package/versionReport.test.ts | 2 -- 8 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/commands/package/create.ts b/src/commands/package/create.ts index dadc1372..2b76cb8a 100644 --- a/src/commands/package/create.ts +++ b/src/commands/package/create.ts @@ -93,7 +93,6 @@ export class PackageCreateCommand extends SfCommand { } private display(result: PackageCreate): void { - this.styledHeader('Ids'); - this.table({ data: [{ name: 'Package Id', value: result.Id }] }); + this.table({ data: [{ name: 'Package Id', value: result.Id }], title: 'Ids' }); } } diff --git a/src/commands/package/list.ts b/src/commands/package/list.ts index 94b0e0b5..29e25ae3 100644 --- a/src/commands/package/list.ts +++ b/src/commands/package/list.ts @@ -60,8 +60,6 @@ export class PackageListCommand extends SfCommand { } private displayResults(results: Package2Result[], verbose = false, apiVersion: string): void { - this.styledHeader(chalk.blue(`Packages [${results.length}]`)); - const data = results.map((r) => ({ 'Namespace Prefix': r.NamespacePrefix, Name: r.Name, @@ -80,7 +78,7 @@ export class PackageListCommand extends SfCommand { } : {}), })); - this.table({ data }); + this.table({ data, title: chalk.blue(`Packages [${results.length}]`) }); } } diff --git a/src/commands/package/version/create/list.ts b/src/commands/package/version/create/list.ts index 12dd93cf..8f5ba4d7 100644 --- a/src/commands/package/version/create/list.ts +++ b/src/commands/package/version/create/list.ts @@ -68,8 +68,6 @@ export class PackageVersionCreateListCommand extends SfCommand 0) { this.log(''); diff --git a/src/commands/package/version/list.ts b/src/commands/package/version/list.ts index d92dff42..cca99d3d 100644 --- a/src/commands/package/version/list.ts +++ b/src/commands/package/version/list.ts @@ -214,8 +214,8 @@ export class PackageVersionListCommand extends SfCommand 0) { this.table({ data: displayCoverageRecords }); } diff --git a/test/commands/package/packageVersionCreateReport.test.ts b/test/commands/package/packageVersionCreateReport.test.ts index 277160a0..329f2942 100644 --- a/test/commands/package/packageVersionCreateReport.test.ts +++ b/test/commands/package/packageVersionCreateReport.test.ts @@ -85,13 +85,11 @@ describe('package:version:create:report - tests', () => { const testOrg = new MockTestOrgData(); let createStatusStub = $$.SANDBOX.stub(PackageVersion, 'getCreateStatus'); let tableStub: sinon.SinonStub; - let styledHeaderStub: sinon.SinonStub; let warnStub: sinon.SinonStub; const config = new Config({ root: import.meta.url }); beforeEach(async () => { warnStub = $$.SANDBOX.stub(SfCommand.prototype, 'warn'); - styledHeaderStub = $$.SANDBOX.stub(SfCommand.prototype, 'styledHeader'); tableStub = $$.SANDBOX.stub(SfCommand.prototype, 'table'); }); @@ -129,7 +127,6 @@ describe('package:version:create:report - tests', () => { }, ]); expect(tableStub.callCount).to.equal(1); - expect(styledHeaderStub.callCount).to.equal(1); }); it('should report on a new package version with async validation', async () => { @@ -157,7 +154,6 @@ describe('package:version:create:report - tests', () => { }, ]); expect(tableStub.callCount).to.equal(1); - expect(styledHeaderStub.callCount).to.equal(1); }); it('should report multiple errors', async () => { diff --git a/test/commands/package/versionReport.test.ts b/test/commands/package/versionReport.test.ts index a8a66be8..cd3d3725 100644 --- a/test/commands/package/versionReport.test.ts +++ b/test/commands/package/versionReport.test.ts @@ -148,8 +148,6 @@ describe('package:version:report - tests', () => { expect(result).to.deep.equal(pkgVersionReportResultModified); expect(uxLogStub.calledOnce).to.be.false; expect(uxTableStub.calledOnce).to.be.true; - expect(uxStyledHeaderStub.calledOnce).to.be.true; - expect(uxStyledHeaderStub.args[0][0]).to.include('Package Version'); }); it('should produce package version report - json result', async () => { const reportResult = Object.assign({}, pkgVersionReportResult); From 5e51c5116bff32a1d0d949ec3033b220a8668aa4 Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Wed, 30 Oct 2024 14:15:13 -0600 Subject: [PATCH 11/12] test: update NUT assertions without styled headers --- .../package/packageCreateAndDelete.nut.ts | 2 +- test/commands/package/packageList.nut.ts | 4 ++-- test/commands/package/packageVersion.nut.ts | 20 +++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test/commands/package/packageCreateAndDelete.nut.ts b/test/commands/package/packageCreateAndDelete.nut.ts index 2cb69ef0..6243a6f8 100644 --- a/test/commands/package/packageCreateAndDelete.nut.ts +++ b/test/commands/package/packageCreateAndDelete.nut.ts @@ -33,7 +33,7 @@ describe('package create/update/delete', () => { it('should create a package - human readable results', () => { const command = `package:create -n ${pkgName} -v ${session.hubOrg.username} -t Unlocked -r ./force-app`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; - expect(output).to.contain('=== Ids'); + expect(output).to.contain('Ids'); expect(output).to.match(/Package Id\s+?|0Ho/); }); it('should update a package - human readable results', () => { diff --git a/test/commands/package/packageList.nut.ts b/test/commands/package/packageList.nut.ts index 29546a4d..68c6b19b 100644 --- a/test/commands/package/packageList.nut.ts +++ b/test/commands/package/packageList.nut.ts @@ -58,13 +58,13 @@ describe('package list', () => { it('should list packages in dev hub - human readable results', () => { const command = `package:list -v ${session.hubOrg.username}`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; - expect(output).to.contain('=== Packages'); + expect(output).to.contain('Packages'); expect(output).to.match(/Namespace Prefix\s+?|Name\s+?|Id\s+?|Alias\s+?|Description\s+?|Type/); }); it('should list packages in dev hub - verbose human readable results', () => { const command = `package:list -v ${session.hubOrg.username} --verbose`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; - expect(output).to.contain('=== Packages'); + expect(output).to.contain('Packages'); let headerExpression = 'Namespace Prefix\\s+?|Name\\s+?|Id\\s+?|Alias\\s+?|Description\\s+?|Type\\s+?|Subscriber Package Id\\s+?|Converted From Package Id\\s+?|Org-Dependent Unlocked Package\\s+?|Error Notification Username\\s+?|Created By\\s+?|App Analytics Enabled'; if (apiVersion < 59.0) { diff --git a/test/commands/package/packageVersion.nut.ts b/test/commands/package/packageVersion.nut.ts index fa5bf5ce..2f81b1ab 100644 --- a/test/commands/package/packageVersion.nut.ts +++ b/test/commands/package/packageVersion.nut.ts @@ -178,7 +178,7 @@ describe('package:version:*', () => { ensureExitCode: 0, } ).shellOutput.stdout; - expect(resultHuman).to.include('=== Package Version Create Request'); + expect(resultHuman).to.include('Package Version Create Request'); expect(resultHuman).to.include('Name'); expect(resultHuman).to.include('Value'); expect(resultHuman).to.include('ID'); @@ -195,7 +195,7 @@ describe('package:version:*', () => { it('should list the package versions created (human)', async () => { const command = `package:version:create:list -v ${session.hubOrg.username}`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; - expect(output).to.contain('=== Package Version Create Requests ['); + expect(output).to.contain('Package Version Create Requests ['); expect(output).to.match( / Id\s+?|Status\s+?|Package Id\s+?|Package Version Id\s+?|Subscriber Package Version Id\s+?|Tag\s+?|Branch\s+?|Created Date\s+?|Created By\s+?|/ ); @@ -240,7 +240,7 @@ describe('package:version:*', () => { it('should list the package versions created as part of package conversion from 1GP --show-conversions-only flag (human)', async () => { const command = `package:version:create:list -v ${session.hubOrg.username} --show-conversions-only`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; - expect(output).to.contain('=== Package Version Create Requests ['); + expect(output).to.contain('Package Version Create Requests ['); expect(output).to.match( / Id\s+?|Status\s+?|Package Id\s+?|Package Version Id\s+?|Subscriber Package Version Id\s+?|Tag\s+?|Branch\s+?|Created Date\s+?|Created By\s+?|Converted From Version Id\s+?|/ ); @@ -260,7 +260,7 @@ describe('package:version:*', () => { it('should list package versions in dev hub - human readable results', () => { const command = `package:version:list -v ${session.hubOrg.username}`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; - expect(output).to.contain('=== Package Versions ['); + expect(output).to.contain('Package Versions ['); expect(output).to.match( /Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch/ ); @@ -269,14 +269,14 @@ describe('package:version:*', () => { it('should list package versions in dev hub - concise output', () => { const command = `package:version:list -v ${session.hubOrg.username} --concise`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; - expect(output).to.contain('=== Package Versions ['); + expect(output).to.contain('Package Versions ['); expect(output).to.match(/Package Id\s+?|Version\s+?|Subscriber Package Version Id\s+?|Released/); }); it('should list package versions modified in the last 5 days', () => { const command = `package:version:list -v ${session.hubOrg.username} --modified-last-days 5`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; - expect(output).to.contain('=== Package Versions ['); + expect(output).to.contain('Package Versions ['); expect(output).to.match( /Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch/ ); @@ -284,7 +284,7 @@ describe('package:version:*', () => { it('should list package versions created in the last 5 days', () => { const command = `package:version:list -v ${session.hubOrg.username} --createdlastdays 5`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; - expect(output).to.contain('=== Package Versions ['); + expect(output).to.contain('Package Versions ['); expect(output).to.match( /Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch/ ); @@ -292,7 +292,7 @@ describe('package:version:*', () => { it('should list installed packages in dev hub - verbose human readable results', () => { const command = `package:version:list -v ${session.hubOrg.username} --verbose`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; - expect(output).to.contain('=== Package Versions ['); + expect(output).to.contain('Package Versions ['); expect(output).to.match( /Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch\s+?|Package Id\s+?|Installation URL\s+?|Package Version Id\s+?|Created Date\s+?|Last Modified Date\s+?|Tag\s+?|Description\s+?|Code Coverage\s+?|Code Coverage Met\s+?|Converted From Version Id\s+?|Org-Dependent\s+?|Unlocked Package\s+?|Release\s+?|Version\s+?|Build Duration in Seconds\s+?|Managed Metadata Removed\s+?|Created By/ ); @@ -301,7 +301,7 @@ describe('package:version:*', () => { it("should list installed packages in dev hub - verbose human readable results only on the 'testing' branch", () => { const command = `package:version:list -v ${session.hubOrg.username} --verbose --branch testing`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; - expect(output).to.contain('=== Package Versions ['); + expect(output).to.contain('Package Versions ['); expect(output).to.match( /Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch\s+?|Package Id\s+?|Installation URL\s+?|Package Version Id\s+?|Created Date\s+?|Last Modified Date\s+?|Tag\s+?|Description\s+?|Code Coverage\s+?|Code Coverage Met\s+?|Converted From Version Id\s+?|Org-Dependent\s+?|Unlocked Package\s+?|Release\s+?|Version\s+?|Build Duration in Seconds\s+?|Managed Metadata Removed\s+?|Created By/ ); @@ -399,7 +399,7 @@ describe('package:version:*', () => { it.skip('should list package versions in dev hub created as part of package conversion from 1GP --show-conversions-only flag (human)', () => { const command = `package:version:list -v ${session.hubOrg.username} --show-conversions-only`; const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; - expect(output).to.contain('=== Package Versions ['); + expect(output).to.contain('Package Versions ['); expect(output).to.match( /Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch\s+?|Converted From Version Id/ ); From f222e00bd842e1a60374505200e1be89ae85d70d Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Wed, 30 Oct 2024 15:31:48 -0600 Subject: [PATCH 12/12] chore: bump sf-plugins-core --- package.json | 2 +- yarn.lock | 52 ++++++++++++---------------------------------------- 2 files changed, 13 insertions(+), 41 deletions(-) diff --git a/package.json b/package.json index edf7dd31..9f57d552 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "@salesforce/core": "^8.6.2", "@salesforce/kit": "^3.2.3", "@salesforce/packaging": "^4.2.15", - "@salesforce/sf-plugins-core": "^12.0.10", + "@salesforce/sf-plugins-core": "^12.0.11", "chalk": "^5.3.0" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index a8be2b47..5a84550a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1301,10 +1301,10 @@ http-call "^5.2.2" lodash "^4.17.21" -"@oclif/table@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@oclif/table/-/table-0.3.0.tgz#b87ba5d20e7e84a1d4744e68c64093dbc8bd8de9" - integrity sha512-HzUUyNcoEzfyvzzXL1evLZmiMBZ2SnH41lNHpoKJZJR4uCdiMkOzlkLf9M326qLmRJTDpKnUHgIZD778T647gg== +"@oclif/table@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@oclif/table/-/table-0.3.2.tgz#192a310488af67a7341ba203a0e3a0d67f1d8693" + integrity sha512-H8B41sRuXByT4E3ROSICbiQBbZDD3Kw30vYkJlPvKbE5QGEd11hPo+P9ahdGLA3AY0SkTflfTily8fFhHT0WDA== dependencies: "@oclif/core" "^4" "@types/react" "^18.3.12" @@ -1468,23 +1468,20 @@ string-width "^7.2.0" terminal-link "^3.0.0" -"@salesforce/sf-plugins-core@^12.0.10": - version "12.0.10" - resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-12.0.10.tgz#193796818cc9caad99f2fdc5bbaefd0206d1a08f" - integrity sha512-SCrA7NARQYEPlQZjEgEgBAVxAAEJLyDRJ2CDS2jm+H5sy3tmr8f4+Wvif7zO0MdWk2rLaR+D+L27171NG0PreQ== +"@salesforce/sf-plugins-core@^12.0.11": + version "12.0.11" + resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-12.0.11.tgz#5837bc385cb8f057c4bc86b71ead71464ba5063b" + integrity sha512-DYb54IeszQxcyl0N3e5qxSx3Vc571f36alZNE54qPqBTi9RAGEHQN4XR03dKLic0aNS/j4Z09RGH6YoH2zSL6A== dependencies: "@inquirer/confirm" "^3.1.22" "@inquirer/password" "^2.2.0" "@oclif/core" "^4.0.27" - "@oclif/table" "^0.3.0" + "@oclif/table" "^0.3.2" "@salesforce/core" "^8.5.1" "@salesforce/kit" "^3.2.3" "@salesforce/ts-types" "^2.0.12" ansis "^3.3.2" cli-progress "^3.12.0" - natural-orderby "^3.0.2" - slice-ansi "^7.1.0" - string-width "^7.2.0" terminal-link "^3.0.0" "@salesforce/source-deploy-retrieve@^12.8.0": @@ -7072,16 +7069,7 @@ stack-utils@^2.0.6: dependencies: escape-string-regexp "^2.0.0" -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -7149,14 +7137,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -7718,7 +7699,7 @@ workerpool@^6.5.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -7736,15 +7717,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"