@salesforce/plugin-deploy-retrieve 1.20.3 → 2.0.1
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/README.md +66 -64
- package/lib/commands/deploy.d.ts +1 -1
- package/lib/commands/deploy.js +48 -51
- package/lib/commands/deploy.js.map +1 -1
- package/lib/commands/project/convert/mdapi.d.ts +8 -8
- package/lib/commands/project/convert/mdapi.js +63 -63
- package/lib/commands/project/convert/mdapi.js.map +1 -1
- package/lib/commands/project/convert/source.d.ts +16 -40
- package/lib/commands/project/convert/source.js +71 -72
- package/lib/commands/project/convert/source.js.map +1 -1
- package/lib/commands/project/delete/source.d.ts +9 -61
- package/lib/commands/project/delete/source.js +182 -180
- package/lib/commands/project/delete/source.js.map +1 -1
- package/lib/commands/project/delete/tracking.d.ts +4 -4
- package/lib/commands/project/delete/tracking.js +27 -29
- package/lib/commands/project/delete/tracking.js.map +1 -1
- package/lib/commands/project/deploy/cancel.d.ts +5 -5
- package/lib/commands/project/deploy/cancel.js +58 -59
- package/lib/commands/project/deploy/cancel.js.map +1 -1
- package/lib/commands/project/deploy/preview.d.ts +6 -6
- package/lib/commands/project/deploy/preview.js +57 -58
- package/lib/commands/project/deploy/preview.js.map +1 -1
- package/lib/commands/project/deploy/quick.d.ts +9 -9
- package/lib/commands/project/deploy/quick.js +85 -86
- package/lib/commands/project/deploy/quick.js.map +1 -1
- package/lib/commands/project/deploy/report.d.ts +8 -60
- package/lib/commands/project/deploy/report.js +72 -73
- package/lib/commands/project/deploy/report.js.map +1 -1
- package/lib/commands/project/deploy/resume.d.ts +9 -61
- package/lib/commands/project/deploy/resume.js +82 -83
- package/lib/commands/project/deploy/resume.js.map +1 -1
- package/lib/commands/project/deploy/start.d.ts +24 -128
- package/lib/commands/project/deploy/start.js +168 -169
- package/lib/commands/project/deploy/start.js.map +1 -1
- package/lib/commands/project/deploy/validate.d.ts +21 -125
- package/lib/commands/project/deploy/validate.js +149 -149
- package/lib/commands/project/deploy/validate.js.map +1 -1
- package/lib/commands/project/generate/manifest.d.ts +9 -9
- package/lib/commands/project/generate/manifest.js +73 -78
- package/lib/commands/project/generate/manifest.js.map +1 -1
- package/lib/commands/project/list/ignored.d.ts +1 -1
- package/lib/commands/project/list/ignored.js +27 -29
- package/lib/commands/project/list/ignored.js.map +1 -1
- package/lib/commands/project/reset/tracking.d.ts +5 -5
- package/lib/commands/project/reset/tracking.js +33 -35
- package/lib/commands/project/reset/tracking.js.map +1 -1
- package/lib/commands/project/retrieve/preview.d.ts +3 -3
- package/lib/commands/project/retrieve/preview.js +35 -36
- package/lib/commands/project/retrieve/preview.js.map +1 -1
- package/lib/commands/project/retrieve/start.d.ts +11 -11
- package/lib/commands/project/retrieve/start.js +148 -149
- package/lib/commands/project/retrieve/start.js.map +1 -1
- package/lib/configMeta.js +8 -9
- package/lib/configMeta.js.map +1 -1
- package/lib/formatters/asyncDeployCancelResultFormatter.d.ts +1 -1
- package/lib/formatters/asyncDeployCancelResultFormatter.js +12 -12
- package/lib/formatters/asyncDeployCancelResultFormatter.js.map +1 -1
- package/lib/formatters/asyncDeployResultFormatter.d.ts +1 -1
- package/lib/formatters/asyncDeployResultFormatter.js +14 -14
- package/lib/formatters/asyncDeployResultFormatter.js.map +1 -1
- package/lib/formatters/deleteResultFormatter.d.ts +2 -2
- package/lib/formatters/deleteResultFormatter.js +21 -23
- package/lib/formatters/deleteResultFormatter.js.map +1 -1
- package/lib/formatters/deployCancelResultFormatter.d.ts +1 -1
- package/lib/formatters/deployCancelResultFormatter.js +7 -10
- package/lib/formatters/deployCancelResultFormatter.js.map +1 -1
- package/lib/formatters/deployReportResultFormatter.d.ts +1 -1
- package/lib/formatters/deployReportResultFormatter.js +18 -22
- package/lib/formatters/deployReportResultFormatter.js.map +1 -1
- package/lib/formatters/deployResultFormatter.d.ts +2 -2
- package/lib/formatters/deployResultFormatter.js +53 -50
- package/lib/formatters/deployResultFormatter.js.map +1 -1
- package/lib/formatters/metadataConvertResultFormatter.d.ts +1 -1
- package/lib/formatters/metadataConvertResultFormatter.js +7 -9
- package/lib/formatters/metadataConvertResultFormatter.js.map +1 -1
- package/lib/formatters/metadataRetrieveResultFormatter.d.ts +1 -1
- package/lib/formatters/metadataRetrieveResultFormatter.js +17 -16
- package/lib/formatters/metadataRetrieveResultFormatter.js.map +1 -1
- package/lib/formatters/retrieveResultFormatter.d.ts +1 -1
- package/lib/formatters/retrieveResultFormatter.js +17 -17
- package/lib/formatters/retrieveResultFormatter.js.map +1 -1
- package/lib/formatters/sourceConvertResultFormatter.d.ts +1 -1
- package/lib/formatters/sourceConvertResultFormatter.js +12 -14
- package/lib/formatters/sourceConvertResultFormatter.js.map +1 -1
- package/lib/formatters/testResultsFormatter.d.ts +1 -1
- package/lib/formatters/testResultsFormatter.js +38 -38
- package/lib/formatters/testResultsFormatter.js.map +1 -1
- package/lib/hooks/deploy.d.ts +1 -1
- package/lib/hooks/deploy.js +5 -7
- package/lib/hooks/deploy.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib/utils/conflicts.js +3 -7
- package/lib/utils/conflicts.js.map +1 -1
- package/lib/utils/coverage.js +20 -30
- package/lib/utils/coverage.js.map +1 -1
- package/lib/utils/deploy.d.ts +1 -1
- package/lib/utils/deploy.js +55 -64
- package/lib/utils/deploy.js.map +1 -1
- package/lib/utils/deployCache.d.ts +1 -1
- package/lib/utils/deployCache.js +12 -16
- package/lib/utils/deployCache.js.map +1 -1
- package/lib/utils/errorCodes.js +15 -16
- package/lib/utils/errorCodes.js.map +1 -1
- package/lib/utils/flags.d.ts +25 -7
- package/lib/utils/flags.js +24 -27
- package/lib/utils/flags.js.map +1 -1
- package/lib/utils/manifestCache.js +9 -14
- package/lib/utils/manifestCache.js.map +1 -1
- package/lib/utils/metadataDeployer.d.ts +1 -1
- package/lib/utils/metadataDeployer.js +40 -39
- package/lib/utils/metadataDeployer.js.map +1 -1
- package/lib/utils/output.js +13 -22
- package/lib/utils/output.js.map +1 -1
- package/lib/utils/previewOutput.js +46 -52
- package/lib/utils/previewOutput.js.map +1 -1
- package/lib/utils/progressBar.js +19 -21
- package/lib/utils/progressBar.js.map +1 -1
- package/lib/utils/project.js +7 -13
- package/lib/utils/project.js.map +1 -1
- package/lib/utils/promiseQueue.js +3 -7
- package/lib/utils/promiseQueue.js.map +1 -1
- package/lib/utils/types.js +12 -19
- package/lib/utils/types.js.map +1 -1
- package/oclif.lock +8667 -0
- package/oclif.manifest.json +1442 -942
- package/package.json +37 -35
- package/schemas/project-retrieve-start.json +14 -11
package/lib/utils/flags.js
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.commaWarningForMultipleFlags = exports.coverageFormattersFlag = exports.testsFlag = exports.zipFileFlag = exports.fileOrDirFlag = exports.testLevelFlag = exports.ensuredDirFlag = exports.DEFAULT_ZIP_FILE_NAME = void 0;
|
|
4
1
|
/*
|
|
5
2
|
* Copyright (c) 2022, salesforce.com, inc.
|
|
6
3
|
* All rights reserved.
|
|
7
4
|
* Licensed under the BSD 3-Clause license.
|
|
8
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
6
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
7
|
+
import * as fs from 'node:fs';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { resolve, extname, dirname } from 'node:path';
|
|
10
|
+
import { Flags } from '@oclif/core';
|
|
11
|
+
import { Messages, Lifecycle } from '@salesforce/core';
|
|
12
|
+
import { TestLevel, reportsFormatters } from './types.js';
|
|
13
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
|
14
|
+
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'validation');
|
|
15
|
+
const commonFlagMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'commonFlags');
|
|
18
16
|
const parsePathInfo = async (input, opts) => {
|
|
19
17
|
if (opts.exists && !fs.existsSync(input)) {
|
|
20
18
|
throw messages.createError('error.InvalidFlagPath', [input, messages.getMessage('error.ExpectedFileOrDirToExist')]);
|
|
@@ -30,7 +28,7 @@ const parsePathInfo = async (input, opts) => {
|
|
|
30
28
|
*/
|
|
31
29
|
async function ensureDirectoryPath(path) {
|
|
32
30
|
const trimmedPath = path.trim();
|
|
33
|
-
const resolvedPath = trimmedPath?.length ?
|
|
31
|
+
const resolvedPath = trimmedPath?.length ? resolve(trimmedPath) : '';
|
|
34
32
|
try {
|
|
35
33
|
const stats = await fs.promises.stat(resolvedPath);
|
|
36
34
|
const isDir = stats.isDirectory();
|
|
@@ -50,60 +48,59 @@ async function ensureDirectoryPath(path) {
|
|
|
50
48
|
}
|
|
51
49
|
function resolveZipFileName(zipFileName) {
|
|
52
50
|
if (!zipFileName) {
|
|
53
|
-
return
|
|
51
|
+
return DEFAULT_ZIP_FILE_NAME;
|
|
54
52
|
}
|
|
55
53
|
// If no file extension was provided append, '.zip'
|
|
56
|
-
return !
|
|
54
|
+
return !extname(zipFileName) ? (zipFileName += '.zip') : zipFileName;
|
|
57
55
|
}
|
|
58
|
-
|
|
56
|
+
export const DEFAULT_ZIP_FILE_NAME = 'unpackaged.zip';
|
|
59
57
|
/**
|
|
60
58
|
* Flag value is a directory path that may or may not exist. If it doesn't exist, then it will be created.
|
|
61
59
|
*/
|
|
62
|
-
|
|
60
|
+
export const ensuredDirFlag = Flags.custom({
|
|
63
61
|
parse: async (input) => ensureDirectoryPath(input),
|
|
64
62
|
});
|
|
65
|
-
|
|
63
|
+
export const testLevelFlag = Flags.custom({
|
|
66
64
|
char: 'l',
|
|
67
65
|
parse: (input) => Promise.resolve(input),
|
|
68
|
-
options: Object.values(
|
|
66
|
+
options: Object.values(TestLevel),
|
|
69
67
|
});
|
|
70
68
|
/**
|
|
71
69
|
* Flag value could either be a file path or a directory path.
|
|
72
70
|
*/
|
|
73
|
-
|
|
71
|
+
export const fileOrDirFlag = Flags.custom({
|
|
74
72
|
parse: async (input, _, opts) => parsePathInfo(input, opts),
|
|
75
73
|
});
|
|
76
74
|
/**
|
|
77
75
|
* Flag value is the name of a zip file that defaults to 'unpackaged.zip'.
|
|
78
76
|
*/
|
|
79
|
-
|
|
77
|
+
export const zipFileFlag = Flags.custom({
|
|
80
78
|
parse: async (input) => Promise.resolve(resolveZipFileName(input)),
|
|
81
79
|
});
|
|
82
|
-
|
|
80
|
+
export const testsFlag = Flags.custom({
|
|
83
81
|
char: 't',
|
|
84
82
|
multiple: true,
|
|
85
83
|
dependsOn: ['test-level'],
|
|
86
84
|
summary: commonFlagMessages.getMessage('flags.tests.summary'),
|
|
87
85
|
description: commonFlagMessages.getMessage('flags.tests.description'),
|
|
88
86
|
// the old version allowed comma separated values, and the change is confusing enough to deserve a warning
|
|
89
|
-
parse: async (input) =>
|
|
87
|
+
parse: async (input) => commaWarningForMultipleFlags(input, commonFlagMessages.getMessage('commaWarningForTests', [commonFlagMessages.getMessage('flags.tests.description')])),
|
|
90
88
|
});
|
|
91
|
-
|
|
89
|
+
export const coverageFormattersFlag = Flags.custom({
|
|
92
90
|
multiple: true,
|
|
93
91
|
summary: commonFlagMessages.getMessage('flags.coverage-formatters.summary'),
|
|
94
92
|
description: commonFlagMessages.getMessage('flags.coverage-formatters.description'),
|
|
95
|
-
options:
|
|
93
|
+
options: reportsFormatters,
|
|
96
94
|
});
|
|
97
95
|
/**
|
|
98
96
|
* use when the old version allowed comma separated values, and the change is confusing enough to deserve a warning
|
|
99
97
|
* Put this as the parse function, like the testsFlag above
|
|
100
98
|
*
|
|
101
99
|
*/
|
|
102
|
-
const commaWarningForMultipleFlags = async (input, warningText) => {
|
|
100
|
+
export const commaWarningForMultipleFlags = async (input, warningText) => {
|
|
103
101
|
if (input.includes(',')) {
|
|
104
|
-
await
|
|
102
|
+
await Lifecycle.getInstance().emitWarning(warningText);
|
|
105
103
|
}
|
|
106
104
|
return input;
|
|
107
105
|
};
|
|
108
|
-
exports.commaWarningForMultipleFlags = commaWarningForMultipleFlags;
|
|
109
106
|
//# sourceMappingURL=flags.js.map
|
package/lib/utils/flags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/utils/flags.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/utils/flags.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAY,SAAS,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpE,QAAQ,CAAC,uBAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1E,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,YAAY,CAAC,CAAC;AAC3F,MAAM,kBAAkB,GAAG,QAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,aAAa,CAAC,CAAC;AAEtG,MAAM,aAAa,GAAG,KAAK,EAAE,KAAa,EAAE,IAA0B,EAAqB,EAAE;IAC3F,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;QACxC,MAAM,QAAQ,CAAC,WAAW,CAAC,uBAAuB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EAAE,CAAC,YAAY,CAAC;IACzB,OAAO,EAAE,kBAAkB,CAAC,UAAU,CAAC,qBAAqB,CAAC;IAC7D,WAAW,EAAE,kBAAkB,CAAC,UAAU,CAAC,yBAAyB,CAAC;IACrE,0GAA0G;IAC1G,KAAK,EAAE,KAAK,EAAE,KAAa,EAAmB,EAAE,CAC9C,4BAA4B,CAC1B,KAAK,EACL,kBAAkB,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC,kBAAkB,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAClH;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,MAAM,CAAC;IACjD,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,kBAAkB,CAAC,UAAU,CAAC,mCAAmC,CAAC;IAC3E,WAAW,EAAE,kBAAkB,CAAC,UAAU,CAAC,uCAAuC,CAAC;IACnF,OAAO,EAAE,iBAAiB;CAC3B,CAAC,CAAC;AACH;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,EAAE,KAAa,EAAE,WAAmB,EAAmB,EAAE;IACxG,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACvB,MAAM,SAAS,CAAC,WAAW,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;KACxD;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.maybeDestroyManifest = exports.writeManifest = void 0;
|
|
4
1
|
/*
|
|
5
2
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
6
3
|
* All rights reserved.
|
|
7
4
|
* Licensed under the BSD 3-Clause license.
|
|
8
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
6
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
import * as path from 'node:path';
|
|
8
|
+
import { homedir } from 'node:os';
|
|
9
|
+
import * as fs from 'node:fs';
|
|
10
|
+
import { ComponentSet } from '@salesforce/source-deploy-retrieve';
|
|
11
|
+
import { Global } from '@salesforce/core';
|
|
15
12
|
const MANIFEST_CACHE_DIR = 'manifestCache';
|
|
16
13
|
/** Give it a jobId, ComponentSet it will write the manifest file
|
|
17
14
|
* returns the file path it wrote to */
|
|
18
|
-
const writeManifest = async (jobId, componentSet) => {
|
|
15
|
+
export const writeManifest = async (jobId, componentSet) => {
|
|
19
16
|
const types = new Set((await componentSet.getObject()).Package.types.map((t) => t.name));
|
|
20
17
|
// when we write a manifest, we will omit the CustomLabels component since it's redundant with the individual labels.
|
|
21
18
|
// this makes the use of the manifest in report/resume/etc accurate in certain mpd scenarios where it would otherwise pull in ALL labels from every dir
|
|
@@ -28,7 +25,7 @@ const writeManifest = async (jobId, componentSet) => {
|
|
|
28
25
|
// cs.filter doesn't return the SAME component set, it just returns a new one...
|
|
29
26
|
// and so when we set anything on the component set that was passed in, it won't be set on the filtered one
|
|
30
27
|
// so, we create a new CS, and set the values from the original
|
|
31
|
-
const cs = new
|
|
28
|
+
const cs = new ComponentSet(componentSet.filter((c) => c.type.name !== 'CustomLabels'));
|
|
32
29
|
cs.sourceApiVersion = componentSet.sourceApiVersion;
|
|
33
30
|
cs.apiVersion = componentSet.apiVersion;
|
|
34
31
|
xml = await cs.getPackageXml();
|
|
@@ -41,8 +38,7 @@ const writeManifest = async (jobId, componentSet) => {
|
|
|
41
38
|
await fs.promises.writeFile(filePath, xml);
|
|
42
39
|
return filePath;
|
|
43
40
|
};
|
|
44
|
-
|
|
45
|
-
const maybeDestroyManifest = async (jobId) => {
|
|
41
|
+
export const maybeDestroyManifest = async (jobId) => {
|
|
46
42
|
try {
|
|
47
43
|
return await fs.promises.rm(getManifestFilePath(jobId));
|
|
48
44
|
}
|
|
@@ -50,6 +46,5 @@ const maybeDestroyManifest = async (jobId) => {
|
|
|
50
46
|
// that's ok in a maybe
|
|
51
47
|
}
|
|
52
48
|
};
|
|
53
|
-
|
|
54
|
-
const getManifestFilePath = (jobId) => path.join((0, node_os_1.homedir)(), core_1.Global.SF_STATE_FOLDER, MANIFEST_CACHE_DIR, `${jobId}.xml`);
|
|
49
|
+
const getManifestFilePath = (jobId) => path.join(homedir(), Global.SF_STATE_FOLDER, MANIFEST_CACHE_DIR, `${jobId}.xml`);
|
|
55
50
|
//# sourceMappingURL=manifestCache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifestCache.js","sourceRoot":"","sources":["../../src/utils/manifestCache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifestCache.js","sourceRoot":"","sources":["../../src/utils/manifestCache.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAE3C;uCACuC;AACvC,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,KAAa,EAAE,YAA0B,EAAmB,EAAE;IAChG,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACzF,qHAAqH;IACrH,uJAAuJ;IACvJ,oDAAoD;IACpD,2JAA2J;IAC3J,qJAAqJ;IACrJ,gEAAgE;IAEhE,IAAI,GAA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kB,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NamedPackageDir } from '@salesforce/core';
|
|
2
2
|
import { Deployable, Deployer, DeployerResult } from '@salesforce/sf-plugins-core';
|
|
3
|
-
import { TestLevel } from './types';
|
|
3
|
+
import { TestLevel } from './types.js';
|
|
4
4
|
export interface MetadataDeployOptions extends Deployer.Options {
|
|
5
5
|
testLevel?: TestLevel;
|
|
6
6
|
username?: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2021, salesforce.com, inc.
|
|
4
3
|
* All rights reserved.
|
|
@@ -6,19 +5,19 @@
|
|
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
7
|
/* eslint-disable class-methods-use-this */
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const messages =
|
|
8
|
+
import { dirname } from 'node:path';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
import { EOL } from 'node:os';
|
|
11
|
+
import chalk from 'chalk';
|
|
12
|
+
import { Duration } from '@salesforce/kit';
|
|
13
|
+
import { AuthInfo, ConfigAggregator, StateAggregator, Messages, OrgConfigProperties, Org, } from '@salesforce/core';
|
|
14
|
+
import { Deployable, Deployer, generateTableChoices } from '@salesforce/sf-plugins-core';
|
|
15
|
+
import { DeployResultFormatter } from '../formatters/deployResultFormatter.js';
|
|
16
|
+
import { TestLevel } from './types.js';
|
|
17
|
+
import { DeployProgress } from './progressBar.js';
|
|
18
|
+
import { determineExitCode, executeDeploy, resolveApi } from './deploy.js';
|
|
19
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
|
20
|
+
const messages = 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) {
|
|
@@ -44,7 +43,9 @@ const compareOrgs = (a, b) => {
|
|
|
44
43
|
// orgs are equal by type - sort by name ascending
|
|
45
44
|
return a.username.localeCompare(b.username);
|
|
46
45
|
};
|
|
47
|
-
class DeployablePackage extends
|
|
46
|
+
export class DeployablePackage extends Deployable {
|
|
47
|
+
pkg;
|
|
48
|
+
parent;
|
|
48
49
|
constructor(pkg, parent) {
|
|
49
50
|
super();
|
|
50
51
|
this.pkg = pkg;
|
|
@@ -63,12 +64,14 @@ class DeployablePackage extends sf_plugins_core_1.Deployable {
|
|
|
63
64
|
return this.parent;
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
export class MetadataDeployer extends Deployer {
|
|
68
|
+
packages;
|
|
69
|
+
static NAME = 'Salesforce Apps';
|
|
70
|
+
testLevel = TestLevel.NoTestRun;
|
|
71
|
+
username;
|
|
68
72
|
constructor(packages) {
|
|
69
73
|
super();
|
|
70
74
|
this.packages = packages;
|
|
71
|
-
this.testLevel = types_1.TestLevel.NoTestRun;
|
|
72
75
|
this.deployables = this.packages.map((pkg) => new DeployablePackage(pkg, this));
|
|
73
76
|
}
|
|
74
77
|
getName() {
|
|
@@ -96,45 +99,45 @@ class MetadataDeployer extends sf_plugins_core_1.Deployer {
|
|
|
96
99
|
}
|
|
97
100
|
async deploy() {
|
|
98
101
|
const directories = this.deployables.map((d) => d.pkg.fullPath);
|
|
99
|
-
const name = this.deployables.map((p) =>
|
|
100
|
-
const api = await
|
|
101
|
-
this.log(`${
|
|
102
|
-
const { deploy } = await
|
|
102
|
+
const name = this.deployables.map((p) => chalk.cyan.bold(p.getPath())).join(', ');
|
|
103
|
+
const api = await resolveApi();
|
|
104
|
+
this.log(`${EOL}Deploying ${name} to ${this.username} using ${api} API`);
|
|
105
|
+
const { deploy } = await executeDeploy({
|
|
103
106
|
'target-org': this.username,
|
|
104
107
|
'source-dir': directories,
|
|
105
108
|
'test-level': this.testLevel,
|
|
106
109
|
api,
|
|
107
110
|
}, undefined, undefined, undefined, true);
|
|
108
|
-
new
|
|
109
|
-
const result = await deploy.pollStatus(500,
|
|
110
|
-
const formatter = new
|
|
111
|
+
new DeployProgress(deploy).start();
|
|
112
|
+
const result = await deploy.pollStatus(500, Duration.minutes(33).seconds);
|
|
113
|
+
const formatter = new DeployResultFormatter(result, {
|
|
111
114
|
'test-level': this.testLevel,
|
|
112
115
|
verbose: false,
|
|
113
116
|
concise: false,
|
|
114
|
-
'target-org': await
|
|
117
|
+
'target-org': await Org.create({ aliasOrUsername: this.username }),
|
|
115
118
|
});
|
|
116
119
|
formatter.display();
|
|
117
120
|
const deployerResult = {
|
|
118
|
-
exitCode:
|
|
121
|
+
exitCode: determineExitCode(result),
|
|
119
122
|
};
|
|
120
123
|
return deployerResult;
|
|
121
124
|
}
|
|
122
125
|
async promptForUsername() {
|
|
123
|
-
const aliasOrUsername =
|
|
124
|
-
const stateAggregator = await
|
|
126
|
+
const aliasOrUsername = ConfigAggregator.getValue(OrgConfigProperties.TARGET_ORG)?.value;
|
|
127
|
+
const stateAggregator = await StateAggregator.getInstance();
|
|
125
128
|
await stateAggregator.orgs.readAll();
|
|
126
129
|
const allAliases = stateAggregator.aliases.getAll();
|
|
127
130
|
let targetOrgAuth;
|
|
128
131
|
// make sure the "target-org" can be used in this deploy
|
|
129
132
|
if (aliasOrUsername) {
|
|
130
|
-
targetOrgAuth = (await
|
|
133
|
+
targetOrgAuth = (await AuthInfo.listAllAuthorizations((a) => (a.username === aliasOrUsername || a.aliases?.some((alias) => alias === aliasOrUsername)) ?? false)).find((a) => a);
|
|
131
134
|
if (targetOrgAuth) {
|
|
132
135
|
if (targetOrgAuth?.isExpired) {
|
|
133
136
|
const continueAnswer = await this.prompt([
|
|
134
137
|
{
|
|
135
138
|
name: 'continue',
|
|
136
139
|
type: 'confirm',
|
|
137
|
-
message:
|
|
140
|
+
message: chalk.red(messages.getMessage('warning.TargetOrgIsExpired', [aliasOrUsername])),
|
|
138
141
|
},
|
|
139
142
|
]);
|
|
140
143
|
if (!continueAnswer.continue) {
|
|
@@ -147,7 +150,7 @@ class MetadataDeployer extends sf_plugins_core_1.Deployer {
|
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
if (!aliasOrUsername || targetOrgAuth?.isExpired) {
|
|
150
|
-
const promises = (await
|
|
153
|
+
const promises = (await AuthInfo.listAllAuthorizations((orgAuth) => !orgAuth.error && orgAuth.isExpired !== true)).map(async (orgAuth) => {
|
|
151
154
|
const stat = await stateAggregator.orgs.stat(orgAuth.username);
|
|
152
155
|
const timestamp = stat ? new Date(stat.mtimeMs) : new Date();
|
|
153
156
|
return { ...orgAuth, timestamp };
|
|
@@ -170,7 +173,7 @@ class MetadataDeployer extends sf_plugins_core_1.Deployer {
|
|
|
170
173
|
name: 'username',
|
|
171
174
|
message: 'Select the org you want to deploy to:',
|
|
172
175
|
type: 'list',
|
|
173
|
-
choices:
|
|
176
|
+
choices: generateTableChoices(columns, options, false),
|
|
174
177
|
},
|
|
175
178
|
]);
|
|
176
179
|
if (targetOrgAuth?.isExpired) {
|
|
@@ -182,7 +185,7 @@ class MetadataDeployer extends sf_plugins_core_1.Deployer {
|
|
|
182
185
|
},
|
|
183
186
|
]);
|
|
184
187
|
if (setTargetOrg.save) {
|
|
185
|
-
const authInfo = await
|
|
188
|
+
const authInfo = await AuthInfo.create({ username });
|
|
186
189
|
await authInfo.setAsDefault({ org: true });
|
|
187
190
|
}
|
|
188
191
|
}
|
|
@@ -203,11 +206,11 @@ class MetadataDeployer extends sf_plugins_core_1.Deployer {
|
|
|
203
206
|
loop: false,
|
|
204
207
|
pageSize: 4,
|
|
205
208
|
choices: [
|
|
206
|
-
{ name: "Don't run tests", value:
|
|
207
|
-
{ name: 'Run local tests', value:
|
|
209
|
+
{ name: "Don't run tests", value: TestLevel.NoTestRun, short: "Don't run tests" },
|
|
210
|
+
{ name: 'Run local tests', value: TestLevel.RunLocalTests, short: 'Run local tests' },
|
|
208
211
|
{
|
|
209
212
|
name: 'Run all tests in environment',
|
|
210
|
-
value:
|
|
213
|
+
value: TestLevel.RunAllTestsInOrg,
|
|
211
214
|
short: 'Run all tests in environment',
|
|
212
215
|
},
|
|
213
216
|
],
|
|
@@ -216,6 +219,4 @@ class MetadataDeployer extends sf_plugins_core_1.Deployer {
|
|
|
216
219
|
return testLevel;
|
|
217
220
|
}
|
|
218
221
|
}
|
|
219
|
-
exports.MetadataDeployer = MetadataDeployer;
|
|
220
|
-
MetadataDeployer.NAME = 'Salesforce Apps';
|
|
221
222
|
//# sourceMappingURL=metadataDeployer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadataDeployer.js","sourceRoot":"","sources":["../../src/utils/metadataDeployer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"metadataDeployer.js","sourceRoot":"","sources":["../../src/utils/metadataDeployer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,2CAA2C;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,QAAQ,EAGR,mBAAmB,EACnB,GAAG,GACJ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAkB,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEzG,OAAO,EAAE,qBAAqB,EAAE,MAAM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AAC;IACnB,CAAC"}
|
package/lib/utils/output.js
CHANGED
|
@@ -1,28 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2021, salesforce.com, inc.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function tableHeader(message) {
|
|
14
|
-
return (0, chalk_1.blue)((0, chalk_1.bold)(message));
|
|
7
|
+
import * as path from 'node:path';
|
|
8
|
+
import chalk from 'chalk';
|
|
9
|
+
import { StandardColors } from '@salesforce/sf-plugins-core';
|
|
10
|
+
export function tableHeader(message) {
|
|
11
|
+
return chalk.blue.bold(message);
|
|
15
12
|
}
|
|
16
|
-
|
|
17
|
-
function asRelativePaths(fileResponses) {
|
|
13
|
+
export function asRelativePaths(fileResponses) {
|
|
18
14
|
const relative = fileResponses.map((file) => file.filePath ? { ...file, filePath: path.relative(process.cwd(), file.filePath) } : file);
|
|
19
15
|
return relative;
|
|
20
16
|
}
|
|
21
|
-
exports.asRelativePaths = asRelativePaths;
|
|
22
17
|
/**
|
|
23
18
|
* Sorts file responds by type, then by filePath, then by fullName
|
|
24
19
|
*/
|
|
25
|
-
function sortFileResponses(fileResponses) {
|
|
20
|
+
export function sortFileResponses(fileResponses) {
|
|
26
21
|
return fileResponses.sort((i, j) => {
|
|
27
22
|
if (i.type === j.type && i.filePath && j.filePath) {
|
|
28
23
|
if (i.filePath === j.filePath) {
|
|
@@ -33,16 +28,12 @@ function sortFileResponses(fileResponses) {
|
|
|
33
28
|
return i.type > j.type ? 1 : -1;
|
|
34
29
|
});
|
|
35
30
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
function error(message) {
|
|
40
|
-
return sf_plugins_core_1.StandardColors.error((0, chalk_1.bold)(message));
|
|
31
|
+
export const getFileResponseSuccessProps = (successes) => successes.map((s) => ({ filePath: s.filePath, fullName: s.fullName, type: s.type, state: s.state }));
|
|
32
|
+
export function error(message) {
|
|
33
|
+
return StandardColors.error(chalk.bold(message));
|
|
41
34
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return sf_plugins_core_1.StandardColors.success((0, chalk_1.bold)(message));
|
|
35
|
+
export function success(message) {
|
|
36
|
+
return StandardColors.success(chalk.bold(message));
|
|
45
37
|
}
|
|
46
|
-
|
|
47
|
-
exports.check = sf_plugins_core_1.StandardColors.success('✓');
|
|
38
|
+
export const check = StandardColors.success('✓');
|
|
48
39
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,aAAkB;IAElB,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAC1C,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAC1F,C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