Skip to content

Commit

Permalink
fix(deps): devScripts update (#493) and core v6
Browse files Browse the repository at this point in the history
* chore: updates from devScripts

* feat: bump packaging lib to 3.0

* fix: current eslint (enums)

* test: correct nut logic

---------

Co-authored-by: mshanemc <shane.mclaughlin@salesforce.com>
  • Loading branch information
svc-cli-bot and mshanemc authored Nov 16, 2023
1 parent f48273d commit e8f1534
Show file tree
Hide file tree
Showing 5 changed files with 227 additions and 167 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
"author": "Salesforce",
"bugs": "https://github.com/forcedotcom/cli/issues",
"dependencies": {
"@oclif/core": "^2.15.0",
"@salesforce/core": "^5.3.20",
"@oclif/core": "^3.11.0",
"@salesforce/core": "^6.1.3",
"@salesforce/kit": "^3.0.15",
"@salesforce/packaging": "^2.4.21",
"@salesforce/sf-plugins-core": "^3.1.25",
"@salesforce/packaging": "^3.0.0",
"@salesforce/sf-plugins-core": "^5.0.1",
"chalk": "^4.1.2",
"tslib": "^2"
},
"devDependencies": {
"@oclif/plugin-command-snapshot": "^4.0.16",
"@salesforce/cli-plugins-testkit": "^4.4.12",
"@salesforce/dev-scripts": "^6.0.4",
"@salesforce/dev-scripts": "^7.1.0",
"@salesforce/plugin-command-reference": "^3.0.46",
"@swc/core": "1.3.39",
"eslint-plugin-sf-plugin": "^1.16.15",
Expand Down
5 changes: 3 additions & 2 deletions src/commands/package/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
PackageEvents,
PackageVersionCreateEventData,
PackageVersionCreateRequestResult,
PackagingSObjects,
} from '@salesforce/packaging';
import { camelCaseToTitleCase, Duration } from '@salesforce/kit';
import { requiredHubFlag } from '../../utils/hubFlag';
Expand Down Expand Up @@ -128,10 +129,10 @@ export class PackageConvert extends SfCommand<PackageVersionCreateRequestResult>
);

switch (result.Status) {
case 'Error':
case PackagingSObjects['Package2VersionStatus'].error:
this.spinner.stop();
throw new SfError(result.Error?.join('\n') ?? pvcMessages.getMessage('unknownError'));
case 'Success': {
case PackagingSObjects['Package2VersionStatus'].success: {
const successMessage = pvcMessages.getMessage(result.Status, [
result.Id,
result.SubscriberPackageVersionId,
Expand Down
4 changes: 2 additions & 2 deletions src/commands/package/version/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ export class PackageVersionCreateCommand extends SfCommand<PackageVersionCommand
}

switch (result.Status) {
case 'Error':
case Package2VersionStatus.error:
throw messages.createError('multipleErrors', [
result.Error?.map((e: string, i) => `${os.EOL}(${i + 1}) ${e}`).join(''),
]);
case 'Success':
case Package2VersionStatus.success:
this.log(
messages.getMessage(result.Status, [
result.Id,
Expand Down
13 changes: 7 additions & 6 deletions test/commands/package/packageVersion.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,15 @@ describe('package:version:*', () => {
const project = await SfProject.resolve();
const projectJson = project.getSfProjectJson();
const contents = projectJson.getContents();
const packageDir = contents.packageDirectories.find((pkgDir) => pkgDir.package === pkgName);
if (packageDir) {
packageDir.package = packageId;
} else {
if (!contents.packageDirectories.some((pkgDir) => pkgDir.package === pkgName)) {
expect.fail('packageDirectory not found');
}
projectJson.setContents(contents);
projectJson.writeSync(contents);
const newPackageDirs = contents.packageDirectories.map((pkgDir) =>
pkgDir.package === pkgName ? { ...pkgDir, package: packageId } : pkgDir
);

projectJson.set('packageDirectories', newPackageDirs);
projectJson.writeSync();
execCmd(`package:version:create --package ${packageId} -x --json`, { ensureExitCode: 0 });
});
});
Expand Down
Loading

0 comments on commit e8f1534

Please sign in to comment.