@salesforce/plugin-deploy-retrieve 1.1.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +35 -7
- package/lib/commands/deploy/metadata.d.ts +14 -12
- package/lib/commands/deploy/metadata.js +79 -70
- package/lib/commands/deploy/metadata.js.map +1 -1
- package/lib/commands/retrieve/metadata.d.ts +4 -3
- package/lib/commands/retrieve/metadata.js +48 -47
- package/lib/commands/retrieve/metadata.js.map +1 -1
- package/lib/hooks/deploy.js +1 -1
- package/lib/hooks/deploy.js.map +1 -1
- package/lib/utils/deploy.d.ts +29 -0
- package/lib/utils/deploy.js +81 -0
- package/lib/utils/deploy.js.map +1 -0
- package/lib/utils/metadataDeployer.d.ts +1 -1
- package/lib/utils/metadataDeployer.js +14 -13
- package/lib/utils/metadataDeployer.js.map +1 -1
- package/lib/utils/output.d.ts +8 -9
- package/lib/utils/output.js +127 -29
- package/lib/utils/output.js.map +1 -1
- package/lib/utils/progressBar.d.ts +1 -1
- package/lib/utils/project.d.ts +3 -0
- package/lib/utils/project.js +22 -0
- package/lib/utils/project.js.map +1 -0
- package/lib/utils/{testLevel.d.ts → types.d.ts} +10 -0
- package/lib/utils/{testLevel.js → types.js} +7 -2
- package/lib/utils/types.js.map +1 -0
- package/messages/deploy.md +8 -3
- package/messages/deploy.metadata.md +42 -2
- package/messages/retrieve.metadata.md +10 -2
- package/oclif.manifest.json +1 -1
- package/package.json +27 -12
- package/schemas/deploy-metadata.json +5 -2
- package/lib/utils/componentSetBuilder.d.ts +0 -28
- package/lib/utils/componentSetBuilder.js +0 -124
- package/lib/utils/componentSetBuilder.js.map +0 -1
- package/lib/utils/config.d.ts +0 -1
- package/lib/utils/config.js +0 -18
- package/lib/utils/config.js.map +0 -1
- package/lib/utils/orgs.d.ts +0 -4
- package/lib/utils/orgs.js +0 -39
- package/lib/utils/orgs.js.map +0 -1
- package/lib/utils/requiredFlagValidator.d.ts +0 -3
- package/lib/utils/requiredFlagValidator.js +0 -19
- package/lib/utils/requiredFlagValidator.js.map +0 -1
- package/lib/utils/testLevel.js.map +0 -1
- package/messages/required.flag.md +0 -3
package/lib/hooks/deploy.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
const core_1 = require("@salesforce/core");
|
|
10
10
|
const metadataDeployer_1 = require("../utils/metadataDeployer");
|
|
11
11
|
const hook = async function () {
|
|
12
|
-
const project = await core_1.
|
|
12
|
+
const project = await core_1.SfProject.resolve();
|
|
13
13
|
const packageDirectories = project.getPackageDirectories();
|
|
14
14
|
return [new metadataDeployer_1.MetadataDeployer(packageDirectories)];
|
|
15
15
|
};
|
package/lib/hooks/deploy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/hooks/deploy.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/hooks/deploy.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,2CAA6C;AAE7C,gEAA6D;AAE7D,MAAM,IAAI,GAAoC,KAAK;IACjD,MAAM,OAAO,GAAG,MAAM,gBAAS,CAAC,OAAO,EAAE,CAAC;IAC1C,MAAM,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAC3D,OAAO,CAAC,IAAI,mCAAgB,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,kBAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Interfaces } from '@oclif/core';
|
|
2
|
+
import { Duration } from '@salesforce/kit';
|
|
3
|
+
import { Nullable } from '@salesforce/ts-types';
|
|
4
|
+
import { ComponentSet, DeployResult, MetadataApiDeploy } from '@salesforce/source-deploy-retrieve';
|
|
5
|
+
import { API, TestLevel, TestResults } from './types';
|
|
6
|
+
declare type Options = {
|
|
7
|
+
api: API;
|
|
8
|
+
'target-org': string;
|
|
9
|
+
'test-level': TestLevel;
|
|
10
|
+
'api-version'?: string;
|
|
11
|
+
'dry-run'?: boolean;
|
|
12
|
+
'ignore-errors'?: boolean;
|
|
13
|
+
'ignore-warnings'?: boolean;
|
|
14
|
+
manifest?: string;
|
|
15
|
+
metadata?: string[];
|
|
16
|
+
'source-dir'?: string[];
|
|
17
|
+
tests?: string[];
|
|
18
|
+
wait?: Duration;
|
|
19
|
+
verbose?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare function validateTests(testLevel: TestLevel, tests: Nullable<string[]>): boolean;
|
|
22
|
+
export declare function resolveRestDeploy(): API;
|
|
23
|
+
export declare function executeDeploy(opts: Partial<Options>): Promise<{
|
|
24
|
+
deploy: MetadataApiDeploy;
|
|
25
|
+
componentSet: ComponentSet;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const testLevelFlag: (opts?: Partial<Interfaces.OptionFlag<TestLevel | undefined>>) => Interfaces.OptionFlag<TestLevel | undefined>;
|
|
28
|
+
export declare function getTestResults(result: DeployResult): TestResults;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022, salesforce.com, inc.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Licensed under the BSD 3-Clause license.
|
|
6
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.getTestResults = exports.testLevelFlag = exports.executeDeploy = exports.resolveRestDeploy = exports.validateTests = void 0;
|
|
10
|
+
const core_1 = require("@oclif/core");
|
|
11
|
+
const core_2 = require("@salesforce/core");
|
|
12
|
+
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
13
|
+
const project_1 = require("./project");
|
|
14
|
+
const types_1 = require("./types");
|
|
15
|
+
function validateTests(testLevel, tests) {
|
|
16
|
+
if (testLevel === types_1.TestLevel.RunSpecifiedTests && (tests !== null && tests !== void 0 ? tests : []).length === 0)
|
|
17
|
+
return false;
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
exports.validateTests = validateTests;
|
|
21
|
+
function resolveRestDeploy() {
|
|
22
|
+
const restDeployConfig = core_2.ConfigAggregator.getValue(core_2.SfdxPropertyKeys.REST_DEPLOY).value;
|
|
23
|
+
if (restDeployConfig === 'false') {
|
|
24
|
+
return types_1.API.SOAP;
|
|
25
|
+
}
|
|
26
|
+
else if (restDeployConfig === 'true') {
|
|
27
|
+
return types_1.API.REST;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return types_1.API.SOAP;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.resolveRestDeploy = resolveRestDeploy;
|
|
34
|
+
async function executeDeploy(opts) {
|
|
35
|
+
const componentSet = await source_deploy_retrieve_1.ComponentSetBuilder.build({
|
|
36
|
+
apiversion: opts['api-version'],
|
|
37
|
+
sourceapiversion: await (0, project_1.getSourceApiVersion)(),
|
|
38
|
+
sourcepath: opts['source-dir'],
|
|
39
|
+
manifest: opts.manifest && {
|
|
40
|
+
manifestPath: opts.manifest,
|
|
41
|
+
directoryPaths: await (0, project_1.getPackageDirs)(),
|
|
42
|
+
},
|
|
43
|
+
metadata: opts.metadata && {
|
|
44
|
+
metadataEntries: opts.metadata,
|
|
45
|
+
directoryPaths: await (0, project_1.getPackageDirs)(),
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
const deploy = await componentSet.deploy({
|
|
49
|
+
usernameOrConnection: opts['target-org'],
|
|
50
|
+
apiOptions: {
|
|
51
|
+
checkOnly: opts['dry-run'] || false,
|
|
52
|
+
ignoreWarnings: opts['ignore-warnings'] || false,
|
|
53
|
+
rest: opts.api === types_1.API.REST,
|
|
54
|
+
rollbackOnError: !opts['ignore-errors'] || false,
|
|
55
|
+
runTests: opts.tests || [],
|
|
56
|
+
testLevel: opts['test-level'],
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
return { deploy, componentSet };
|
|
60
|
+
}
|
|
61
|
+
exports.executeDeploy = executeDeploy;
|
|
62
|
+
const testLevelFlag = (opts = {}) => {
|
|
63
|
+
return core_1.Flags.build({
|
|
64
|
+
char: 'l',
|
|
65
|
+
parse: (input) => Promise.resolve(input),
|
|
66
|
+
options: Object.values(types_1.TestLevel),
|
|
67
|
+
...opts,
|
|
68
|
+
})();
|
|
69
|
+
};
|
|
70
|
+
exports.testLevelFlag = testLevelFlag;
|
|
71
|
+
function getTestResults(result) {
|
|
72
|
+
var _a, _b, _c;
|
|
73
|
+
const passing = (_a = result.response.numberTestsCompleted) !== null && _a !== void 0 ? _a : 0;
|
|
74
|
+
const failing = (_b = result.response.numberTestErrors) !== null && _b !== void 0 ? _b : 0;
|
|
75
|
+
const total = (_c = result.response.numberTestsTotal) !== null && _c !== void 0 ? _c : 0;
|
|
76
|
+
const testResults = { passing, failing, total };
|
|
77
|
+
const time = result.response.details.runTestResult.totalTime;
|
|
78
|
+
return time ? { ...testResults, time } : testResults;
|
|
79
|
+
}
|
|
80
|
+
exports.getTestResults = getTestResults;
|
|
81
|
+
//# sourceMappingURL=deploy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/utils/deploy.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,sCAAgD;AAChD,2CAAsE;AAGtE,+EAAwH;AACxH,uCAAgE;AAChE,mCAAsD;AAkBtD,SAAgB,aAAa,CAAC,SAAoB,EAAE,KAAyB;IAC3E,IAAI,SAAS,KAAK,iBAAS,CAAC,iBAAiB,IAAI,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAA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able, Deployer } from '@salesforce/sf-plugins-core';
|
|
3
|
-
import { TestLevel } from './
|
|
3
|
+
import { TestLevel } from './types';
|
|
4
4
|
export interface MetadataDeployOptions extends Deployer.Options {
|
|
5
5
|
testLevel?: TestLevel;
|
|
6
6
|
username?: string;
|
|
@@ -12,13 +12,12 @@ const chalk_1 = require("chalk");
|
|
|
12
12
|
const kit_1 = require("@salesforce/kit");
|
|
13
13
|
const core_1 = require("@salesforce/core");
|
|
14
14
|
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
15
|
-
const componentSetBuilder_1 = require("./componentSetBuilder");
|
|
16
15
|
const output_1 = require("./output");
|
|
17
|
-
const
|
|
16
|
+
const types_1 = require("./types");
|
|
18
17
|
const progressBar_1 = require("./progressBar");
|
|
19
|
-
const
|
|
18
|
+
const deploy_1 = require("./deploy");
|
|
20
19
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
21
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy
|
|
20
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy');
|
|
22
21
|
const compareOrgs = (a, b) => {
|
|
23
22
|
// scratch orgs before other orgs
|
|
24
23
|
if (a.isScratchOrg && !b.isScratchOrg) {
|
|
@@ -68,7 +67,7 @@ class MetadataDeployer extends sf_plugins_core_1.Deployer {
|
|
|
68
67
|
constructor(packages) {
|
|
69
68
|
super();
|
|
70
69
|
this.packages = packages;
|
|
71
|
-
this.testLevel =
|
|
70
|
+
this.testLevel = types_1.TestLevel.NoTestRun;
|
|
72
71
|
this.deployables = this.packages.map((pkg) => new DeployablePackage(pkg, this));
|
|
73
72
|
}
|
|
74
73
|
getName() {
|
|
@@ -98,11 +97,13 @@ class MetadataDeployer extends sf_plugins_core_1.Deployer {
|
|
|
98
97
|
async deploy() {
|
|
99
98
|
const directories = this.deployables.map((d) => d.pkg.fullPath);
|
|
100
99
|
const name = this.deployables.map((p) => chalk_1.cyan.bold(p.getPath())).join(', ');
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const deploy = await
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
const api = (0, deploy_1.resolveRestDeploy)();
|
|
101
|
+
this.log(`${os_1.EOL}Deploying ${name} to ${this.username} using ${api} API`);
|
|
102
|
+
const { deploy } = await (0, deploy_1.executeDeploy)({
|
|
103
|
+
'target-org': this.username,
|
|
104
|
+
'source-dir': directories,
|
|
105
|
+
'test-level': this.testLevel,
|
|
106
|
+
api,
|
|
106
107
|
});
|
|
107
108
|
new progressBar_1.DeployProgress(deploy).start();
|
|
108
109
|
const result = await deploy.pollStatus(500, kit_1.Duration.minutes(33).seconds);
|
|
@@ -192,11 +193,11 @@ class MetadataDeployer extends sf_plugins_core_1.Deployer {
|
|
|
192
193
|
loop: false,
|
|
193
194
|
pageSize: 4,
|
|
194
195
|
choices: [
|
|
195
|
-
{ name: "Don't run tests", value:
|
|
196
|
-
{ name: 'Run local tests', value:
|
|
196
|
+
{ name: "Don't run tests", value: types_1.TestLevel.NoTestRun, short: "Don't run tests" },
|
|
197
|
+
{ name: 'Run local tests', value: types_1.TestLevel.RunLocalTests, short: 'Run local tests' },
|
|
197
198
|
{
|
|
198
199
|
name: 'Run all tests in environment',
|
|
199
|
-
value:
|
|
200
|
+
value: types_1.TestLevel.RunAllTestsInOrg,
|
|
200
201
|
short: 'Run all tests in environment',
|
|
201
202
|
},
|
|
202
203
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadataDeployer.js","sourceRoot":"","sources":["../../src/utils/metadataDeployer.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2BAAyB;AACzB,iCAAkC;AAClC,yCAA2C;AAC3C,2CAQ0B;AAC1B,iEAAyF;AAEzF
|
|
1
|
+
{"version":3,"file":"metadataDeployer.js","sourceRoot":"","sources":["../../src/utils/metadataDeployer.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2BAAyB;AACz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AAC,CAAC;aACrD;SACF;IACH,CAAC;IAEM,KAAK,CAAC,kBAAkB;QAC7B,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAwB;YAC7D;gBACE,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,8CAA8C;gBACvD,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,KAAK;gBACX,QAAQ,EAAE,CAAC;gBACX,OAAO,EAAE;oBACP,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAS,CAAC,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAE;oBACjF,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAS,CAAC,aAAa,EAAE,KAAK,EAAE,iBAAiB,EAAE;oBACrF;wBACE,IAAI,EAAE,8BAA8B;wBACpC,KAAK,EAAE,iBAAS,CAAC,gBAAgB;wBACjC,KAAK,EAAE,8BAA8B;qBACtC;iBACF;aACF;SACF,CAAC,CAAC;QACH,OAAO,SAAsB,CAAC;IAChC,CAAC;;AA3JH,4CA4JC;AA3Je,qBAAI,GAAG,iBAAiB,CAAC"}
|
package/lib/utils/output.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { DeployResult, FileResponse, RetrieveResult } from '@
|
|
2
|
-
import {
|
|
3
|
-
import { TestLevel } from './
|
|
4
|
-
export declare type PackageRetrieval = {
|
|
5
|
-
name: string;
|
|
6
|
-
path: string;
|
|
7
|
-
};
|
|
1
|
+
import { DeployResult, FileResponse, RetrieveResult, Failures, Successes, ComponentSet } from '@salesforce/source-deploy-retrieve';
|
|
2
|
+
import { NamedPackageDir } from '@salesforce/core';
|
|
3
|
+
import { API, TestLevel } from './types';
|
|
8
4
|
export declare function asRelativePaths(fileResponses: FileResponse[]): FileResponse[];
|
|
9
5
|
/**
|
|
10
6
|
* Sorts file responds by type, then by filePath, then by fullName
|
|
@@ -12,7 +8,10 @@ export declare function asRelativePaths(fileResponses: FileResponse[]): FileResp
|
|
|
12
8
|
export declare function sortFileResponses(fileResponses: FileResponse[]): FileResponse[];
|
|
13
9
|
export declare function sortTestResults(results?: Failures[] | Successes[]): Failures[] | Successes[];
|
|
14
10
|
export declare function toArray<T>(entryOrArray: T | T[] | undefined): T[];
|
|
11
|
+
export declare function displayDeployResults(result: DeployResult, testLevel: TestLevel, verbose: boolean): void;
|
|
15
12
|
export declare function displaySuccesses(result: DeployResult | RetrieveResult): void;
|
|
16
|
-
export declare function displayPackages(result: RetrieveResult, packages:
|
|
17
|
-
export declare function displayTestResults(result: DeployResult, testLevel: TestLevel): void;
|
|
13
|
+
export declare function displayPackages(result: RetrieveResult, packages: NamedPackageDir[]): void;
|
|
14
|
+
export declare function displayTestResults(result: DeployResult, testLevel: TestLevel, verbose?: boolean): void;
|
|
18
15
|
export declare function displayFailures(result: DeployResult | RetrieveResult): void;
|
|
16
|
+
export declare function displayDeletes(result: DeployResult): void;
|
|
17
|
+
export declare function getVersionMessage(action: string, componentSet: ComponentSet, api: API): string;
|
package/lib/utils/output.js
CHANGED
|
@@ -6,26 +6,28 @@
|
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.displayFailures = exports.displayTestResults = exports.displayPackages = exports.displaySuccesses = exports.toArray = exports.sortTestResults = exports.sortFileResponses = exports.asRelativePaths = void 0;
|
|
9
|
+
exports.getVersionMessage = exports.displayDeletes = exports.displayFailures = exports.displayTestResults = exports.displayPackages = exports.displaySuccesses = exports.displayDeployResults = exports.toArray = exports.sortTestResults = exports.sortFileResponses = exports.asRelativePaths = void 0;
|
|
10
10
|
const os = require("os");
|
|
11
11
|
const path = require("path");
|
|
12
12
|
const core_1 = require("@oclif/core");
|
|
13
13
|
const chalk_1 = require("chalk");
|
|
14
|
-
const
|
|
15
|
-
const types_1 = require("
|
|
16
|
-
const ts_types_1 = require("@salesforce/ts-types");
|
|
17
|
-
const testLevel_1 = require("./testLevel");
|
|
14
|
+
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
15
|
+
const types_1 = require("./types");
|
|
18
16
|
function info(message) {
|
|
19
17
|
return (0, chalk_1.blue)((0, chalk_1.bold)(message));
|
|
20
18
|
}
|
|
21
19
|
function error(message) {
|
|
22
20
|
return (0, chalk_1.red)((0, chalk_1.bold)(message));
|
|
23
21
|
}
|
|
22
|
+
function success(message) {
|
|
23
|
+
return (0, chalk_1.green)((0, chalk_1.bold)(message));
|
|
24
|
+
}
|
|
24
25
|
function table(responses, columns, options) {
|
|
25
26
|
// Interfaces cannot be casted to Record<string, unknown> so we have to cast to unknown first
|
|
26
27
|
// See https://github.com/microsoft/TypeScript/issues/15300
|
|
27
|
-
core_1.CliUx.ux.table(responses, columns, options);
|
|
28
|
+
core_1.CliUx.ux.table(responses, columns, options !== null && options !== void 0 ? options : {});
|
|
28
29
|
}
|
|
30
|
+
const check = (0, chalk_1.green)('✓');
|
|
29
31
|
function asRelativePaths(fileResponses) {
|
|
30
32
|
fileResponses.forEach((file) => {
|
|
31
33
|
if (file.filePath) {
|
|
@@ -66,6 +68,13 @@ function toArray(entryOrArray) {
|
|
|
66
68
|
return [];
|
|
67
69
|
}
|
|
68
70
|
exports.toArray = toArray;
|
|
71
|
+
function displayDeployResults(result, testLevel, verbose) {
|
|
72
|
+
displaySuccesses(result);
|
|
73
|
+
displayFailures(result);
|
|
74
|
+
displayDeletes(result);
|
|
75
|
+
displayTestResults(result, testLevel, verbose);
|
|
76
|
+
}
|
|
77
|
+
exports.displayDeployResults = displayDeployResults;
|
|
69
78
|
function displaySuccesses(result) {
|
|
70
79
|
var _a;
|
|
71
80
|
const fileResponses = asRelativePaths((_a = result.getFileResponses()) !== null && _a !== void 0 ? _a : []);
|
|
@@ -78,7 +87,7 @@ function displaySuccesses(result) {
|
|
|
78
87
|
type: { header: 'Type' },
|
|
79
88
|
filePath: { header: 'Path' },
|
|
80
89
|
};
|
|
81
|
-
const title = result instanceof
|
|
90
|
+
const title = result instanceof source_deploy_retrieve_1.DeployResult ? 'Deployed Source' : 'Retrieved Source';
|
|
82
91
|
const options = { title: info(title) };
|
|
83
92
|
core_1.CliUx.ux.log();
|
|
84
93
|
table(successes, columns, options);
|
|
@@ -88,7 +97,7 @@ function displayPackages(result, packages) {
|
|
|
88
97
|
if (packages === null || packages === void 0 ? void 0 : packages.length) {
|
|
89
98
|
const columns = {
|
|
90
99
|
name: { header: 'Package Name' },
|
|
91
|
-
|
|
100
|
+
fullPath: { header: 'Converted Location' },
|
|
92
101
|
};
|
|
93
102
|
const title = 'Retrieved Packages';
|
|
94
103
|
const options = { title: info(title) };
|
|
@@ -97,33 +106,23 @@ function displayPackages(result, packages) {
|
|
|
97
106
|
}
|
|
98
107
|
}
|
|
99
108
|
exports.displayPackages = displayPackages;
|
|
100
|
-
function displayTestResults(result, testLevel) {
|
|
109
|
+
function displayTestResults(result, testLevel, verbose = false) {
|
|
101
110
|
var _a, _b, _c, _d;
|
|
102
|
-
if (testLevel ===
|
|
111
|
+
if (testLevel === types_1.TestLevel.NoTestRun) {
|
|
103
112
|
core_1.CliUx.ux.log();
|
|
104
113
|
return;
|
|
105
114
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
core_1.CliUx.ux.log();
|
|
111
|
-
core_1.CliUx.ux.log(error(`Test Failures [${failureCount}]`));
|
|
112
|
-
for (const test of tests) {
|
|
113
|
-
const testName = (0, chalk_1.underline)(`${test.name}.${test.methodName}`);
|
|
114
|
-
const stackTrace = test.stackTrace.replace(/\n/g, `${os.EOL} `);
|
|
115
|
-
core_1.CliUx.ux.log(`• ${testName}`);
|
|
116
|
-
core_1.CliUx.ux.log(` ${(0, chalk_1.dim)('message')}: ${test.message}`);
|
|
117
|
-
core_1.CliUx.ux.log(` ${(0, chalk_1.dim)('stacktrace')}: ${os.EOL} ${stackTrace}`);
|
|
118
|
-
core_1.CliUx.ux.log();
|
|
119
|
-
}
|
|
115
|
+
displayVerboseTestFailures(result);
|
|
116
|
+
if (verbose) {
|
|
117
|
+
displayVerboseTestSuccesses(result);
|
|
118
|
+
displayVerboseTestCoverage(result);
|
|
120
119
|
}
|
|
121
120
|
core_1.CliUx.ux.log();
|
|
122
121
|
core_1.CliUx.ux.log(info('Test Results Summary'));
|
|
123
|
-
const passing = (
|
|
124
|
-
const failing = (
|
|
125
|
-
const total = (
|
|
126
|
-
const time = (
|
|
122
|
+
const passing = (_a = result.response.numberTestsCompleted) !== null && _a !== void 0 ? _a : 0;
|
|
123
|
+
const failing = (_b = result.response.numberTestErrors) !== null && _b !== void 0 ? _b : 0;
|
|
124
|
+
const total = (_c = result.response.numberTestsTotal) !== null && _c !== void 0 ? _c : 0;
|
|
125
|
+
const time = (_d = result.response.details.runTestResult.totalTime) !== null && _d !== void 0 ? _d : 0;
|
|
127
126
|
core_1.CliUx.ux.log(`Passing: ${passing}`);
|
|
128
127
|
core_1.CliUx.ux.log(`Failing: ${failing}`);
|
|
129
128
|
core_1.CliUx.ux.log(`Total: ${total}`);
|
|
@@ -131,9 +130,72 @@ function displayTestResults(result, testLevel) {
|
|
|
131
130
|
core_1.CliUx.ux.log(`Time: ${time}`);
|
|
132
131
|
}
|
|
133
132
|
exports.displayTestResults = displayTestResults;
|
|
133
|
+
function displayVerboseTestFailures(result) {
|
|
134
|
+
var _a, _b, _c;
|
|
135
|
+
if (!result.response.numberTestErrors)
|
|
136
|
+
return;
|
|
137
|
+
const failures = toArray((_b = (_a = result.response.details) === null || _a === void 0 ? void 0 : _a.runTestResult) === null || _b === void 0 ? void 0 : _b.failures);
|
|
138
|
+
const failureCount = (_c = result.response.details.runTestResult) === null || _c === void 0 ? void 0 : _c.numFailures;
|
|
139
|
+
const testFailures = sortTestResults(failures);
|
|
140
|
+
core_1.CliUx.ux.log();
|
|
141
|
+
core_1.CliUx.ux.log(error(`Test Failures [${failureCount}]`));
|
|
142
|
+
for (const test of testFailures) {
|
|
143
|
+
const testName = (0, chalk_1.underline)(`${test.name}.${test.methodName}`);
|
|
144
|
+
const stackTrace = test.stackTrace.replace(/\n/g, `${os.EOL} `);
|
|
145
|
+
core_1.CliUx.ux.log(`• ${testName}`);
|
|
146
|
+
core_1.CliUx.ux.log(` ${(0, chalk_1.dim)('message')}: ${test.message}`);
|
|
147
|
+
core_1.CliUx.ux.log(` ${(0, chalk_1.dim)('stacktrace')}: ${os.EOL} ${stackTrace}`);
|
|
148
|
+
core_1.CliUx.ux.log();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function displayVerboseTestSuccesses(result) {
|
|
152
|
+
var _a, _b;
|
|
153
|
+
const successes = toArray((_b = (_a = result.response.details) === null || _a === void 0 ? void 0 : _a.runTestResult) === null || _b === void 0 ? void 0 : _b.successes);
|
|
154
|
+
if (successes.length > 0) {
|
|
155
|
+
const testSuccesses = sortTestResults(successes);
|
|
156
|
+
core_1.CliUx.ux.log();
|
|
157
|
+
core_1.CliUx.ux.log(success(`Test Success [${successes.length}]`));
|
|
158
|
+
for (const test of testSuccesses) {
|
|
159
|
+
const testName = (0, chalk_1.underline)(`${test.name}.${test.methodName}`);
|
|
160
|
+
core_1.CliUx.ux.log(`${check} ${testName}`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
function displayVerboseTestCoverage(result) {
|
|
165
|
+
var _a;
|
|
166
|
+
const codeCoverage = toArray((_a = result.response.details.runTestResult) === null || _a === void 0 ? void 0 : _a.codeCoverage);
|
|
167
|
+
if (codeCoverage.length) {
|
|
168
|
+
const coverage = codeCoverage.sort((a, b) => {
|
|
169
|
+
return a.name.toUpperCase() > b.name.toUpperCase() ? 1 : -1;
|
|
170
|
+
});
|
|
171
|
+
core_1.CliUx.ux.log();
|
|
172
|
+
core_1.CliUx.ux.log(info('Apex Code Coverage'));
|
|
173
|
+
coverage.map((cov) => {
|
|
174
|
+
const numLocationsNum = parseInt(cov.numLocations, 10);
|
|
175
|
+
const numLocationsNotCovered = parseInt(cov.numLocationsNotCovered, 10);
|
|
176
|
+
const color = numLocationsNotCovered > 0 ? chalk_1.red : chalk_1.green;
|
|
177
|
+
let pctCovered = 100;
|
|
178
|
+
const coverageDecimal = parseFloat(((numLocationsNum - numLocationsNotCovered) / numLocationsNum).toFixed(2));
|
|
179
|
+
if (numLocationsNum > 0) {
|
|
180
|
+
pctCovered = coverageDecimal * 100;
|
|
181
|
+
}
|
|
182
|
+
cov.numLocations = color(`${pctCovered}%`);
|
|
183
|
+
if (!cov.locationsNotCovered) {
|
|
184
|
+
cov.lineNotCovered = '';
|
|
185
|
+
}
|
|
186
|
+
const locations = toArray(cov.locationsNotCovered);
|
|
187
|
+
cov.lineNotCovered = locations.map((location) => location.line).join(',');
|
|
188
|
+
});
|
|
189
|
+
table(coverage, {
|
|
190
|
+
name: { header: 'Name' },
|
|
191
|
+
numLocations: { header: '% Covered' },
|
|
192
|
+
lineNotCovered: { header: 'Uncovered Lines' },
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
134
196
|
function displayFailures(result) {
|
|
135
197
|
var _a;
|
|
136
|
-
if (result.response.status ===
|
|
198
|
+
if (result.response.status === source_deploy_retrieve_1.RequestStatus.Succeeded)
|
|
137
199
|
return;
|
|
138
200
|
const fileResponses = asRelativePaths((_a = result.getFileResponses()) !== null && _a !== void 0 ? _a : []);
|
|
139
201
|
const failures = sortFileResponses(fileResponses.filter((f) => f.state === 'Failed'));
|
|
@@ -149,4 +211,40 @@ function displayFailures(result) {
|
|
|
149
211
|
table(failures, columns, options);
|
|
150
212
|
}
|
|
151
213
|
exports.displayFailures = displayFailures;
|
|
214
|
+
function displayDeletes(result) {
|
|
215
|
+
var _a;
|
|
216
|
+
const fileResponses = asRelativePaths((_a = result.getFileResponses()) !== null && _a !== void 0 ? _a : []);
|
|
217
|
+
const deletions = sortFileResponses(fileResponses.filter((f) => f.state === 'Deleted'));
|
|
218
|
+
if (!deletions.length)
|
|
219
|
+
return;
|
|
220
|
+
const columns = {
|
|
221
|
+
fullName: { header: 'Name' },
|
|
222
|
+
type: { header: 'Type' },
|
|
223
|
+
filePath: { header: 'Path' },
|
|
224
|
+
};
|
|
225
|
+
const options = { title: info('Deleted Source') };
|
|
226
|
+
core_1.CliUx.ux.log();
|
|
227
|
+
table(deletions, columns, options);
|
|
228
|
+
}
|
|
229
|
+
exports.displayDeletes = displayDeletes;
|
|
230
|
+
function getVersionMessage(action, componentSet, api) {
|
|
231
|
+
var _a;
|
|
232
|
+
// commands pass in the.componentSet, which may not exist in some tests or mdapi deploys
|
|
233
|
+
if (!componentSet) {
|
|
234
|
+
return `*** ${action} with ${api} ***`;
|
|
235
|
+
}
|
|
236
|
+
// neither
|
|
237
|
+
if (!componentSet.sourceApiVersion && !componentSet.apiVersion) {
|
|
238
|
+
return `*** ${action} with ${api} ***`;
|
|
239
|
+
}
|
|
240
|
+
// either OR both match (SDR will use either)
|
|
241
|
+
if (!componentSet.sourceApiVersion ||
|
|
242
|
+
!componentSet.apiVersion ||
|
|
243
|
+
componentSet.sourceApiVersion === componentSet.apiVersion) {
|
|
244
|
+
return `*** ${action} with ${api} API v${(_a = componentSet.apiVersion) !== null && _a !== void 0 ? _a : componentSet.sourceApiVersion} ***`;
|
|
245
|
+
}
|
|
246
|
+
// has both but they don't match
|
|
247
|
+
return `*** ${action} v${componentSet.sourceApiVersion} metadata with ${api} API v${componentSet.apiVersion} connection ***`;
|
|
248
|
+
}
|
|
249
|
+
exports.getVersionMessage = getVersionMessage;
|
|
152
250
|
//# sourceMappingURL=output.js.map
|
package/lib/utils/output.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yBAAyB;AACzB,6BAA6B;AAC7B,sCAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"output.js","s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8CAmBC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022, salesforce.com, inc.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Licensed under the BSD 3-Clause license.
|
|
6
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.getSourceApiVersion = exports.getPackageDirs = void 0;
|
|
10
|
+
const core_1 = require("@salesforce/core");
|
|
11
|
+
async function getPackageDirs() {
|
|
12
|
+
const project = await core_1.SfProject.resolve();
|
|
13
|
+
return project.getUniquePackageDirectories().map((pDir) => pDir.fullPath);
|
|
14
|
+
}
|
|
15
|
+
exports.getPackageDirs = getPackageDirs;
|
|
16
|
+
async function getSourceApiVersion() {
|
|
17
|
+
const project = await core_1.SfProject.resolve();
|
|
18
|
+
const projectConfig = await project.resolveProjectConfig();
|
|
19
|
+
return projectConfig.sourceApiVersion;
|
|
20
|
+
}
|
|
21
|
+
exports.getSourceApiVersion = getSourceApiVersion;
|
|
22
|
+
//# sourceMappingURL=project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/utils/project.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2CAA6C;AAGtC,KAAK,UAAU,cAAc;IAClC,MAAM,OAAO,GAAG,MAAM,gBAAS,CAAC,OAAO,EAAE,CAAC;IAC1C,OAAO,OAAO,CAAC,2BAA2B,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC5E,CAAC;AAHD,wCAGC;AAEM,KAAK,UAAU,mBAAmB;IACvC,MAAM,OAAO,GAAG,MAAM,gBAAS,CAAC,OAAO,EAAE,CAAC;IAC1C,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAC3D,OAAO,aAAa,CAAC,gBAAoC,CAAC;AAC5D,CAAC;AAJD,kDAIC"}
|
|
@@ -4,3 +4,13 @@ export declare enum TestLevel {
|
|
|
4
4
|
RunLocalTests = "RunLocalTests",
|
|
5
5
|
RunAllTestsInOrg = "RunAllTestsInOrg"
|
|
6
6
|
}
|
|
7
|
+
export declare enum API {
|
|
8
|
+
SOAP = "SOAP",
|
|
9
|
+
REST = "REST"
|
|
10
|
+
}
|
|
11
|
+
export declare type TestResults = {
|
|
12
|
+
passing: number;
|
|
13
|
+
failing: number;
|
|
14
|
+
total: number;
|
|
15
|
+
time?: string;
|
|
16
|
+
};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.TestLevel = void 0;
|
|
9
|
+
exports.API = exports.TestLevel = void 0;
|
|
10
10
|
var TestLevel;
|
|
11
11
|
(function (TestLevel) {
|
|
12
12
|
TestLevel["NoTestRun"] = "NoTestRun";
|
|
@@ -14,4 +14,9 @@ var TestLevel;
|
|
|
14
14
|
TestLevel["RunLocalTests"] = "RunLocalTests";
|
|
15
15
|
TestLevel["RunAllTestsInOrg"] = "RunAllTestsInOrg";
|
|
16
16
|
})(TestLevel = exports.TestLevel || (exports.TestLevel = {}));
|
|
17
|
-
|
|
17
|
+
var API;
|
|
18
|
+
(function (API) {
|
|
19
|
+
API["SOAP"] = "SOAP";
|
|
20
|
+
API["REST"] = "REST";
|
|
21
|
+
})(API = exports.API || (exports.API = {}));
|
|
22
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,oCAAuB,CAAA;IACvB,oDAAuC,CAAA;IACvC,4CAA+B,CAAA;IAC/B,kDAAqC,CAAA;AACvC,CAAC,EALW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAKpB;AAED,IAAY,GAGX;AAHD,WAAY,GAAG;IACb,oBAAa,CAAA;IACb,oBAAa,CAAA;AACf,CAAC,EAHW,GAAG,GAAH,WAAG,KAAH,WAAG,QAGd"}
|