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

fix(deps): devScripts update for oclif/core-4 #680

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"author": "Salesforce",
"bugs": "https://github.com/forcedotcom/cli/issues",
"dependencies": {
"@oclif/core": "^3.26.5",
"@oclif/core": "^4",
"@salesforce/core": "^7.3.8",
"@salesforce/kit": "^3.1.0",
"@salesforce/packaging": "^3.5.16",
"@salesforce/sf-plugins-core": "^9.0.10",
"@salesforce/sf-plugins-core": "^10.0.0",
"chalk": "^5.3.0"
},
"devDependencies": {
"@oclif/plugin-command-snapshot": "^5.1.8",
"@salesforce/cli-plugins-testkit": "^5.2.0",
"@salesforce/dev-scripts": "^9.1.2",
"@salesforce/dev-scripts": "^10.1.0",
"@salesforce/plugin-command-reference": "^3.0.82",
"eslint-plugin-sf-plugin": "^1.18.0",
"oclif": "^4.10.11",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/package/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { Messages } from '@salesforce/core/messages';
import { Package, PackageCreateOptions, PackageType } from '@salesforce/packaging';
import { requiredHubFlag } from '../../utils/hubFlag.js';

Expand Down
2 changes: 1 addition & 1 deletion src/commands/package/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { Messages } from '@salesforce/core/messages';
import { Package, PackageSaveResult } from '@salesforce/packaging';
import { requiredHubFlag } from '../../utils/hubFlag.js';

Expand Down
26 changes: 14 additions & 12 deletions src/commands/package/installed/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

import { Messages } from '@salesforce/core';
import { Messages } from '@salesforce/core/messages';
import {
loglevel,
orgApiVersionFlagWithDeprecations,
requiredOrgFlagWithDeprecations,
SfCommand,
} from '@salesforce/sf-plugins-core';
import { ux } from '@oclif/core';
import { SubscriberPackageVersion } from '@salesforce/packaging';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
Expand Down Expand Up @@ -59,16 +58,19 @@ export class PackageInstalledListCommand extends SfCommand<PackageInstalledComma
SubscriberPackageVersionNumber: `${record.SubscriberPackageVersion?.MajorVersion}.${record.SubscriberPackageVersion?.MinorVersion}.${record.SubscriberPackageVersion?.PatchVersion}.${record.SubscriberPackageVersion?.BuildNumber}`,
}));

const tableOptions: ux.Table.table.Options = {
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' },
};
this.table(records, tableOptions, { 'no-truncate': true });
this.table(
records,
{
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' },
},
{ 'no-truncate': true }
);

return records;
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/package/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { Messages } from '@salesforce/core/messages';
import { Package, PackagingSObjects } from '@salesforce/packaging';
import chalk from 'chalk';
import { requiredHubFlag } from '../../utils/hubFlag.js';
Expand Down
2 changes: 1 addition & 1 deletion src/commands/package/uninstall/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
requiredOrgFlagWithDeprecations,
SfCommand,
} from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { Messages } from '@salesforce/core/messages';
import { PackagingSObjects, SubscriberPackageVersion } from '@salesforce/packaging';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
Expand Down
2 changes: 1 addition & 1 deletion src/commands/package/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { Messages } from '@salesforce/core/messages';
import { Package, PackageSaveResult } from '@salesforce/packaging';
import { requiredHubFlag } from '../../utils/hubFlag.js';

Expand Down
2 changes: 1 addition & 1 deletion src/commands/package/version/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { Messages } from '@salesforce/core/messages';
import { PackageSaveResult, PackageVersion } from '@salesforce/packaging';
import { requiredHubFlag } from '../../../utils/hubFlag.js';

Expand Down
2 changes: 1 addition & 1 deletion src/commands/package/version/displayancestry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { Messages } from '@salesforce/core/messages';
import { Package, PackageAncestryNodeData } from '@salesforce/packaging';
import { requiredHubFlag } from '../../../utils/hubFlag.js';

Expand Down
136 changes: 67 additions & 69 deletions src/commands/package/version/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
* 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 } from '@salesforce/sf-plugins-core';
import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
import { Messages, SfProject } from '@salesforce/core';
import { ux } from '@oclif/core';
import {
getContainerOptions,
getPackageVersionStrings,
Expand Down Expand Up @@ -202,7 +201,7 @@ export class PackageVersionListCommand extends SfCommand<PackageVersionListComma
});
});
this.styledHeader(`Package Versions [${results.length}]`);
this.table(results, this.getColumnData(flags.concise, flags.verbose, flags['show-conversions-only']), {
this.table(results, getColumnData(flags.concise, flags.verbose, flags['show-conversions-only']), {
'no-truncate': true,
});
} else {
Expand All @@ -211,79 +210,78 @@ export class PackageVersionListCommand extends SfCommand<PackageVersionListComma

return results;
}
}

// eslint-disable-next-line class-methods-use-this
private getColumnData(
concise: boolean,
verbose: boolean,
conversions: boolean
): ux.Table.table.Columns<Record<string, unknown>> {
if (concise) {
return {
Package2Id: { header: messages.getMessage('package-id') },
Version: { header: messages.getMessage('version') },
SubscriberPackageVersionId: {
header: messages.getMessage('subscriberPackageVersionId'),
},
IsReleased: { header: 'Released' },
};
}
let defaultCols = {
Package2Name: { header: 'Package Name' },
NamespacePrefix: { header: 'Namespace' },
Name: { header: 'Version Name' },
const getColumnData = (
concise: boolean,
verbose: boolean,
conversions: boolean
): Ux.Table.Columns<Record<string, unknown>> => {
if (concise) {
return {
Package2Id: { header: messages.getMessage('package-id') },
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') },
AncestorId: { header: 'Ancestor' },
AncestorVersion: { header: 'Ancestor Version' },
Branch: { header: messages.getMessage('packageBranch') },
};
}
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') },
AncestorId: { header: 'Ancestor' },
AncestorVersion: { header: 'Ancestor Version' },
Branch: { header: messages.getMessage('packageBranch') },
};

if (conversions && !verbose) {
defaultCols = Object.assign(defaultCols, {
ConvertedFromVersionId: {
header: messages.getMessage('convertedFromVersionId'),
},
});
}
if (conversions && !verbose) {
defaultCols = Object.assign(defaultCols, {
ConvertedFromVersionId: {
header: messages.getMessage('convertedFromVersionId'),
},
});
}

if (!verbose) {
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') },
};
}
if (!verbose) {
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') },
};
}
}
};
2 changes: 1 addition & 1 deletion src/commands/package/version/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { Messages } from '@salesforce/core/messages';
import {
CodeCoverage,
PackageVersion,
Expand Down
22 changes: 9 additions & 13 deletions src/commands/package/version/retrieve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import {
requiredOrgFlagWithDeprecations,
SfCommand,
} from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { ux } from '@oclif/core';
import { Messages } from '@salesforce/core/messages';
import { Package, PackageVersionMetadataDownloadResult } from '@salesforce/packaging';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
Expand Down Expand Up @@ -82,18 +81,15 @@ export class PackageVersionRetrieveCommand extends SfCommand<PackageVersionRetri
}
});

const columnData: ux.Table.table.Columns<Record<string, unknown>> = {
fullName: {
header: messages.getMessage('headers.fullName'),
this.table(
results,
{
fullName: { header: messages.getMessage('headers.fullName') },
type: { header: messages.getMessage('headers.type') },
filePath: { header: messages.getMessage('headers.filePath') },
},
type: {
header: messages.getMessage('headers.type'),
},
filePath: {
header: messages.getMessage('headers.filePath'),
},
};
this.table(results, columnData, { 'no-truncate': true });
{ 'no-truncate': true }
);

return results;
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/package/version/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { Messages } from '@salesforce/core/messages';
import { PackageSaveResult, PackageVersion } from '@salesforce/packaging';
import { requiredHubFlag } from '../../../utils/hubFlag.js';

Expand Down
2 changes: 1 addition & 1 deletion src/commands/package1/version/create/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
requiredOrgFlagWithDeprecations,
SfCommand,
} from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { Messages } from '@salesforce/core/messages';
import { Package1Version, PackagingSObjects } from '@salesforce/packaging';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
Expand Down
2 changes: 1 addition & 1 deletion src/commands/package1/version/display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
requiredOrgFlagWithDeprecations,
SfCommand,
} from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { Messages } from '@salesforce/core/messages';
import { Package1Display, Package1Version } from '@salesforce/packaging';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
Expand Down
2 changes: 1 addition & 1 deletion src/commands/package1/version/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
requiredOrgFlagWithDeprecations,
SfCommand,
} from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { Messages } from '@salesforce/core/messages';
import { Package1Display, Package1Version } from '@salesforce/packaging';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
Expand Down
2 changes: 1 addition & 1 deletion test/commands/package/versionPromoteUpdate.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { execCmd, genUniqueString, TestSession } from '@salesforce/cli-plugins-t
import { expect } from 'chai';
import { PackageSaveResult, PackageVersionCreateRequestResult } from '@salesforce/packaging';
import { Duration } from '@salesforce/kit';
import { Messages } from '@salesforce/core';
import { Messages } from '@salesforce/core/messages';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'package_version_update');
Expand Down
Loading
Loading