@jayree/sfdx-plugin-manifest 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE.txt +12 -0
- package/README.md +147 -0
- package/bin/is-sfdx.js +3 -0
- package/lib/commands/jayree/manifest/cleanup.d.ts +11 -0
- package/lib/commands/jayree/manifest/cleanup.js +79 -0
- package/lib/commands/jayree/manifest/cleanup.js.map +1 -0
- package/lib/commands/jayree/manifest/generate.d.ts +41 -0
- package/lib/commands/jayree/manifest/generate.js +207 -0
- package/lib/commands/jayree/manifest/generate.js.map +1 -0
- package/lib/commands/jayree/manifest/git/diff.d.ts +19 -0
- package/lib/commands/jayree/manifest/git/diff.js +245 -0
- package/lib/commands/jayree/manifest/git/diff.js.map +1 -0
- package/lib/hooks/changelog.d.ts +2 -0
- package/lib/hooks/changelog.js +59 -0
- package/lib/hooks/changelog.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -0
- package/lib/jayreeSfdxCommand.d.ts +5 -0
- package/lib/jayreeSfdxCommand.js +23 -0
- package/lib/jayreeSfdxCommand.js.map +1 -0
- package/lib/metadata/standardvalueset.json +84 -0
- package/lib/utils/gitdiff.d.ts +57 -0
- package/lib/utils/gitdiff.js +261 -0
- package/lib/utils/gitdiff.js.map +1 -0
- package/lib/utils/manifest.d.ts +1 -0
- package/lib/utils/manifest.js +73 -0
- package/lib/utils/manifest.js.map +1 -0
- package/messages/gitdiff.js +7 -0
- package/messages/manifestcleanup.json +5 -0
- package/messages/packagexml.json +15 -0
- package/oclif.manifest.json +1 -0
- package/package.json +138 -0
@@ -0,0 +1,245 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
/*
|
4
|
+
* Copyright (c) 2021, jayree
|
5
|
+
* All rights reserved.
|
6
|
+
* Licensed under the BSD 3-Clause license.
|
7
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
8
|
+
*/
|
9
|
+
const path_1 = require("path");
|
10
|
+
const util = require("util");
|
11
|
+
const command_1 = require("@salesforce/command");
|
12
|
+
const core_1 = require("@salesforce/core");
|
13
|
+
const fs = require("fs-extra");
|
14
|
+
const listr2_1 = require("listr2");
|
15
|
+
const kit = require("@salesforce/kit");
|
16
|
+
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
17
|
+
const gitdiff_1 = require("../../../../utils/gitdiff");
|
18
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
19
|
+
const messages = core_1.Messages.loadMessages('@jayree/sfdx-plugin-manifest', 'gitdiff');
|
20
|
+
const logger = new listr2_1.Logger({ useIcons: false });
|
21
|
+
// workaround until listr2 can catch emitWarnings with v4.0
|
22
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
23
|
+
const original = process.emitWarning;
|
24
|
+
process.emitWarning = (warning) => {
|
25
|
+
process.once('beforeExit', () => {
|
26
|
+
return original(warning);
|
27
|
+
});
|
28
|
+
};
|
29
|
+
const unexpectedArgument = (input) => {
|
30
|
+
if (input.includes('-')) {
|
31
|
+
throw new Error(`Unexpected argument: ${input}
|
32
|
+
See more help with --help`);
|
33
|
+
}
|
34
|
+
return input;
|
35
|
+
};
|
36
|
+
class GitDiff extends command_1.SfdxCommand {
|
37
|
+
async run() {
|
38
|
+
var _a, _b;
|
39
|
+
const isContentTypeJSON = kit.env.getString('SFDX_CONTENT_TYPE', '').toUpperCase() === 'JSON';
|
40
|
+
this.isOutputEnabled = !(process.argv.find((arg) => arg === '--json') || isContentTypeJSON);
|
41
|
+
const gitArgs = this.getGitArgsFromArgv();
|
42
|
+
const tasks = new listr2_1.Listr([
|
43
|
+
{
|
44
|
+
title: 'Analyze sfdx-project',
|
45
|
+
task: async (ctx, task) => {
|
46
|
+
ctx.projectRoot = this.project.getPath();
|
47
|
+
ctx.sfdxProjectFolders = this.project.getPackageDirectories().map((p) => (0, gitdiff_1.ensureOSPath)(p.path));
|
48
|
+
ctx.sourceApiVersion = (await this.project.retrieveSfdxProjectJson()).getContents().sourceApiVersion;
|
49
|
+
task.output = `packageDirectories: ${ctx.sfdxProjectFolders.length} sourceApiVersion: ${ctx.sourceApiVersion}`;
|
50
|
+
},
|
51
|
+
options: { persistentOutput: true },
|
52
|
+
},
|
53
|
+
{
|
54
|
+
title: "Execute 'git --no-pager diff --name-status --no-renames <pending>'",
|
55
|
+
task: async (ctx, task) => {
|
56
|
+
ctx.git = gitArgs;
|
57
|
+
task.title = `Execute 'git --no-pager diff --name-status --no-renames ${ctx.git.ref1ref2}'`;
|
58
|
+
ctx.gitLines = await (0, gitdiff_1.getGitDiff)(ctx.sfdxProjectFolders, ctx.git.ref1, ctx.git.ref2, ctx.projectRoot);
|
59
|
+
task.output = `Changed files: ${ctx.gitLines.length}`;
|
60
|
+
},
|
61
|
+
options: { persistentOutput: true },
|
62
|
+
},
|
63
|
+
{
|
64
|
+
title: 'Create virtual tree container',
|
65
|
+
skip: (ctx) => ctx.gitLines.length === 0,
|
66
|
+
task: (ctx, task) => task.newListr([
|
67
|
+
{
|
68
|
+
title: `ref1: ${ctx.git.ref1}`,
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
70
|
+
task: async (ctx) => {
|
71
|
+
ctx.ref1VirtualTreeContainer = await (0, gitdiff_1.createVirtualTreeContainer)(ctx.git.ref1, ctx.projectRoot, ctx.gitLines.filter((l) => l.status === 'M').map((l) => l.path));
|
72
|
+
},
|
73
|
+
},
|
74
|
+
{
|
75
|
+
title: ctx.git.ref2 !== '' ? `ref2: ${ctx.git.ref2}` : undefined,
|
76
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
77
|
+
task: async (ctx) => {
|
78
|
+
ctx.ref2VirtualTreeContainer =
|
79
|
+
ctx.git.ref2 !== ''
|
80
|
+
? await (0, gitdiff_1.createVirtualTreeContainer)(ctx.git.ref2, ctx.projectRoot, ctx.gitLines.filter((l) => l.status === 'M').map((l) => l.path))
|
81
|
+
: new gitdiff_1.NodeFSTreeContainer();
|
82
|
+
},
|
83
|
+
},
|
84
|
+
], { concurrent: true }),
|
85
|
+
},
|
86
|
+
{
|
87
|
+
title: 'Analyze git diff results',
|
88
|
+
skip: (ctx) => ctx.gitLines.length === 0,
|
89
|
+
task: async (ctx, task) => {
|
90
|
+
ctx.gitResults = await (0, gitdiff_1.getGitResults)(ctx.gitLines, ctx.ref1VirtualTreeContainer, ctx.ref2VirtualTreeContainer);
|
91
|
+
task.output = `Added: ${ctx.gitResults.counts.added}, Deleted: ${ctx.gitResults.counts.deleted}, Modified: ${ctx.gitResults.counts.modified}, Unchanged: ${ctx.gitResults.counts.unchanged}, Ignored: ${ctx.gitResults.counts.ignored}${ctx.gitResults.counts.error ? `, Errors: ${ctx.gitResults.counts.error}` : ''}`;
|
92
|
+
},
|
93
|
+
options: { persistentOutput: true },
|
94
|
+
},
|
95
|
+
{
|
96
|
+
// title: 'Error output',
|
97
|
+
skip: (ctx) => !ctx.gitResults.errors.length,
|
98
|
+
task: (ctx, task) => {
|
99
|
+
const errors = [...ctx.gitResults.errors];
|
100
|
+
const moreErrors = errors.splice(5);
|
101
|
+
for (const message of errors) {
|
102
|
+
task.output = `Error: ${message}`;
|
103
|
+
}
|
104
|
+
task.output = moreErrors.length ? `... ${moreErrors.length} more errors` : '';
|
105
|
+
},
|
106
|
+
options: { persistentOutput: true, bottomBar: 6 },
|
107
|
+
},
|
108
|
+
{
|
109
|
+
title: 'Generate manifests',
|
110
|
+
skip: (ctx) => !ctx.gitResults || (!ctx.gitResults.manifest.size && !ctx.gitResults.destructiveChanges.size),
|
111
|
+
task: (ctx, task) => task.newListr([
|
112
|
+
{
|
113
|
+
title: (0, path_1.join)('destructiveChanges', 'destructiveChanges.xml'),
|
114
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
115
|
+
skip: (ctx) => !ctx.gitResults.destructiveChanges.size,
|
116
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
117
|
+
task: async (ctx, task) => {
|
118
|
+
ctx.destructiveChangesComponentSet = (0, gitdiff_1.buildManifestComponentSet)(ctx.gitResults.destructiveChanges, true);
|
119
|
+
if (!ctx.destructiveChangesComponentSet.getObject(true).Package.types.length) {
|
120
|
+
task.skip();
|
121
|
+
return;
|
122
|
+
}
|
123
|
+
ctx.destructiveChanges = {
|
124
|
+
files: [
|
125
|
+
(0, path_1.join)(ctx.projectRoot, 'destructiveChanges', 'destructiveChanges.xml'),
|
126
|
+
(0, path_1.join)(ctx.projectRoot, 'destructiveChanges', 'package.xml'),
|
127
|
+
],
|
128
|
+
};
|
129
|
+
await fs.ensureDir((0, path_1.dirname)(ctx.destructiveChanges.files[0]));
|
130
|
+
await fs.writeFile(ctx.destructiveChanges.files[0], ctx.destructiveChangesComponentSet.getPackageXml(undefined, true));
|
131
|
+
await fs.writeFile(ctx.destructiveChanges.files[1], ctx.destructiveChangesComponentSet.getPackageXml());
|
132
|
+
},
|
133
|
+
options: { persistentOutput: true },
|
134
|
+
},
|
135
|
+
{
|
136
|
+
title: (0, path_1.join)('package', 'package.xml'),
|
137
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
138
|
+
skip: (ctx) => !ctx.gitResults.manifest.size,
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
140
|
+
task: async (ctx, task) => {
|
141
|
+
ctx.manifestComponentSet = (0, gitdiff_1.buildManifestComponentSet)(ctx.gitResults.manifest);
|
142
|
+
if (!ctx.manifestComponentSet.getObject().Package.types.length) {
|
143
|
+
task.skip();
|
144
|
+
return;
|
145
|
+
}
|
146
|
+
ctx.manifest = { file: (0, path_1.join)(ctx.projectRoot, 'package', 'package.xml') };
|
147
|
+
await fs.ensureDir((0, path_1.dirname)(ctx.manifest.file));
|
148
|
+
await fs.writeFile(ctx.manifest.file, ctx.manifestComponentSet.getPackageXml());
|
149
|
+
},
|
150
|
+
options: { persistentOutput: true },
|
151
|
+
},
|
152
|
+
], { concurrent: true, exitOnError: false }),
|
153
|
+
},
|
154
|
+
], {
|
155
|
+
rendererOptions: { showTimer: true, collapse: false, lazy: true, collapseErrors: false },
|
156
|
+
rendererSilent: !this.isOutputEnabled,
|
157
|
+
rendererFallback: gitdiff_1.debug.enabled,
|
158
|
+
});
|
159
|
+
try {
|
160
|
+
const context = await tasks.run();
|
161
|
+
if (gitdiff_1.debug.enabled && this.isOutputEnabled) {
|
162
|
+
logger.success(`Context: ${JSON.stringify(context, (key, value) => {
|
163
|
+
if (value instanceof source_deploy_retrieve_1.ComponentSet && value !== null) {
|
164
|
+
let types = value.getObject().Package.types;
|
165
|
+
if (types.length === 0) {
|
166
|
+
types = value.getObject(true).Package.types;
|
167
|
+
}
|
168
|
+
return types;
|
169
|
+
}
|
170
|
+
if (value instanceof source_deploy_retrieve_1.VirtualTreeContainer) {
|
171
|
+
return typeof value;
|
172
|
+
}
|
173
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
174
|
+
return value;
|
175
|
+
}, 2)}`);
|
176
|
+
}
|
177
|
+
return {
|
178
|
+
destructiveChanges: (_a = context.destructiveChangesComponentSet) === null || _a === void 0 ? void 0 : _a.getObject(true),
|
179
|
+
manifest: (_b = context.manifestComponentSet) === null || _b === void 0 ? void 0 : _b.getObject(),
|
180
|
+
};
|
181
|
+
}
|
182
|
+
catch (e) {
|
183
|
+
if (gitdiff_1.debug.enabled && this.isOutputEnabled) {
|
184
|
+
logger.fail(e.message);
|
185
|
+
}
|
186
|
+
throw e;
|
187
|
+
}
|
188
|
+
}
|
189
|
+
getGitArgsFromArgv() {
|
190
|
+
const argv = this.argv.filter((v) => !v.includes('-'));
|
191
|
+
let ref1ref2 = this.args.ref1;
|
192
|
+
const a = argv.join('.').split('.');
|
193
|
+
if ((a.length === 3 || a.length === 4) && typeof this.args.ref2 === 'undefined') {
|
194
|
+
this.args.ref1 = a[0];
|
195
|
+
this.args.ref2 = a[a.length - 1];
|
196
|
+
}
|
197
|
+
else if (a.length === 2 && typeof this.args.ref2 !== 'undefined') {
|
198
|
+
ref1ref2 = `${this.args.ref1}..${this.args.ref2}`;
|
199
|
+
}
|
200
|
+
else if (a.length === 1) {
|
201
|
+
this.args.ref2 = '';
|
202
|
+
}
|
203
|
+
else {
|
204
|
+
throw new Error(`Ambiguous ${util.format('argument%s', argv.length === 1 ? '' : 's')}: ${argv.join(', ')}
|
205
|
+
See more help with --help`);
|
206
|
+
}
|
207
|
+
return { ref1: this.args.ref1, ref2: this.args.ref2, ref1ref2 };
|
208
|
+
}
|
209
|
+
}
|
210
|
+
exports.default = GitDiff;
|
211
|
+
GitDiff.description = messages.getMessage('commandDescription');
|
212
|
+
GitDiff.examples = [
|
213
|
+
`$ sfdx jayree:manifest:git:diff <commit> <commit>
|
214
|
+
$ sfdx jayree:manifest:git:diff <commit>..<commit>
|
215
|
+
uses the changes between two arbitrary <commit>
|
216
|
+
`,
|
217
|
+
`$ sfdx jayree:manifest:git:diff <commit>...<commit>
|
218
|
+
uses the changes on the branch containing and up to the second <commit>, starting at a common ancestor of both <commit>.
|
219
|
+
`,
|
220
|
+
`$ sfdx jayree:manifest:git:diff branchA..branchB
|
221
|
+
uses the diff of what is unique in branchB (REF2) and unique in branchA (REF1)
|
222
|
+
`,
|
223
|
+
`$ sfdx jayree:manifest:git:diff branchA...branchB
|
224
|
+
uses the diff of what is unique in branchB (REF2)`,
|
225
|
+
];
|
226
|
+
GitDiff.args = [
|
227
|
+
{
|
228
|
+
name: 'ref1',
|
229
|
+
required: true,
|
230
|
+
description: 'base commit or branch',
|
231
|
+
parse: unexpectedArgument,
|
232
|
+
hidden: false,
|
233
|
+
},
|
234
|
+
{
|
235
|
+
name: 'ref2',
|
236
|
+
required: false,
|
237
|
+
description: 'commit or branch to compare to the base commit',
|
238
|
+
parse: unexpectedArgument,
|
239
|
+
hidden: false,
|
240
|
+
},
|
241
|
+
];
|
242
|
+
GitDiff.requiresUsername = false;
|
243
|
+
GitDiff.supportsDevhubUsername = false;
|
244
|
+
GitDiff.requiresProject = true;
|
245
|
+
//# sourceMappingURL=diff.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d;IACD;QACE,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,gDAAgD;QAC7D,KAAK,EAAE,kBAAkB;QACzB,MAAM,EAAE,KAAK;KACd;CACF,CAAC;AAEe,wBAAgB,GAAG,KAAK,CAAC;AACzB,8BAAsB,GAAG,KAAK,CAAC;AAC/B,uBAAe,GAAG,IAAI,CAAC"}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.changelog = void 0;
|
4
|
+
/*
|
5
|
+
* Copyright (c) 2021, jayree
|
6
|
+
* All rights reserved.
|
7
|
+
* Licensed under the BSD 3-Clause license.
|
8
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
9
|
+
*/
|
10
|
+
/* istanbul ignore file */
|
11
|
+
const path_1 = require("path");
|
12
|
+
const fs = require("fs-extra");
|
13
|
+
const debug_1 = require("debug");
|
14
|
+
const terminalRenderer = require("marked-terminal");
|
15
|
+
const marked = require("marked");
|
16
|
+
const debug = (0, debug_1.debug)('jayree:hooks');
|
17
|
+
const changelog = function () {
|
18
|
+
process.once('exit', () => {
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
20
|
+
marked.setOptions({ renderer: new terminalRenderer() });
|
21
|
+
try {
|
22
|
+
const moduleRootPath = (0, path_1.join)(__dirname, '..', '..');
|
23
|
+
const changelogFile = fs.readFileSync((0, path_1.join)(moduleRootPath, 'CHANGELOG.md'), 'utf8');
|
24
|
+
const packageJson = fs.readJSONSync((0, path_1.join)(moduleRootPath, 'package.json'));
|
25
|
+
const cacheDir = (0, path_1.join)(this.config.cacheDir, packageJson.name);
|
26
|
+
fs.ensureDirSync(cacheDir);
|
27
|
+
const versionFile = (0, path_1.join)(cacheDir, 'version');
|
28
|
+
let changelogText;
|
29
|
+
try {
|
30
|
+
const latestVersion = fs.readJSONSync(versionFile);
|
31
|
+
changelogText = changelogFile.substring(0, changelogFile.indexOf(`[${latestVersion.version}]`));
|
32
|
+
if (changelogText.length === 0) {
|
33
|
+
throw new Error('version not found');
|
34
|
+
}
|
35
|
+
}
|
36
|
+
catch (err) {
|
37
|
+
changelogText = changelogFile.substring(0, changelogFile.indexOf('# [', 2));
|
38
|
+
}
|
39
|
+
finally {
|
40
|
+
changelogText = changelogText.substring(0, changelogText.lastIndexOf('\n'));
|
41
|
+
if (changelogText.length > 0) {
|
42
|
+
// eslint-disable-next-line no-console
|
43
|
+
console.log(marked(`# CHANGELOG (${packageJson.name})`));
|
44
|
+
// eslint-disable-next-line no-console
|
45
|
+
console.log(marked(changelogText));
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
debug(`${packageJson.name} - no update`);
|
49
|
+
}
|
50
|
+
fs.writeJsonSync(versionFile, { version: packageJson.version });
|
51
|
+
}
|
52
|
+
}
|
53
|
+
catch (error) {
|
54
|
+
debug(error);
|
55
|
+
}
|
56
|
+
});
|
57
|
+
};
|
58
|
+
exports.changelog = changelog;
|
59
|
+
//# sourceMappingURL=changelog.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"changelog.js","sourceRoot":"","sources":["../../src/hooks/changelog.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,0BAA0B;AAC1B,+BAA4B;AAC5B,+BAA+B;AAE/B,iCAAuC;AACvC,oDAAqD;AACrD,iCAAkC;AAElC,MAAM,KAAK,GAAG,IAAA,aAAK,EAAC,cAAc,CAAC,CAAC;AAE7B,MAAM,SAAS,GAAsB;IAC1C,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;QACxB,sGAAsG;QACtG,MAAM,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,IAAI,gBAAgB,EAAE,EAAE,CAAC,CAAC;QACxD,IAAI;YACF,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,E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,CAAC,CAAC;oBACzD,sCAAsC;oBACtC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;iBACpC;qBAAM;oBACL,KAAK,CAAC,GAAG,WAAW,CAAC,IAAI,cAAc,CAAC,CAAC;iBAC1C;gBACD,EAAE,CAAC,aAAa,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;aACjE;SACF;QAAC,OAAO,KAAK,EAAE;YACd,KAAK,CAAC,KAAK,CAAC,CAAC;SACd;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AApCW,QAAA,SAAS,aAoCpB"}
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
/*
|
4
|
+
* Copyright (c) 2021, jayree
|
5
|
+
* All rights reserved.
|
6
|
+
* Licensed under the BSD 3-Clause license.
|
7
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
8
|
+
*/
|
9
|
+
exports.default = {};
|
10
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,kBAAe,EAAE,CAAC"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.JayreeSfdxCommand = void 0;
|
4
|
+
/*
|
5
|
+
* Copyright (c) 2021, jayree
|
6
|
+
* All rights reserved.
|
7
|
+
* Licensed under the BSD 3-Clause license.
|
8
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
9
|
+
*/
|
10
|
+
const command_1 = require("@salesforce/command");
|
11
|
+
const ts_types_1 = require("@salesforce/ts-types");
|
12
|
+
class JayreeSfdxCommand extends command_1.SfdxCommand {
|
13
|
+
warnIfRunByAlias(aliases, id) {
|
14
|
+
if (aliases.some((r) => process.argv.includes(r))) {
|
15
|
+
this.ux.warn(`You are using a deprecated alias of the command: ${id}`);
|
16
|
+
}
|
17
|
+
}
|
18
|
+
getFlag(flagName, defaultVal) {
|
19
|
+
return (0, ts_types_1.get)(this.flags, flagName, defaultVal);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
exports.JayreeSfdxCommand = JayreeSfdxCommand;
|
23
|
+
//# sourceMappingURL=jayreeSfdxCommand.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"jayreeSfdxCommand.js","sourceRoot":"","sources":["../src/jayreeSfdxCommand.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,iDAAkD;AAClD,mDAA2C;AAE3C,MAAsB,iBAAkB,SAAQ,qBAAW;IAC/C,gBAAgB,CAAC,OAAiB,EAAE,EAAU;QACtD,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;YACjD,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,oDAAoD,EAAE,EAAE,CAAC,CAAC;SACxE;IACH,CAAC;IAES,OAAO,CAAI,QAAgB,EAAE,UAAoB;QACzD,OAAO,IAAA,cAAG,EAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,UAAU,CAAM,CAAC;IACpD,CAAC;CACF;AAVD,8CAUC"}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
{
|
2
|
+
"fullNames": [
|
3
|
+
"AccountContactMultiRoles",
|
4
|
+
"AccountContactRole",
|
5
|
+
"AccountOwnership",
|
6
|
+
"AccountRating",
|
7
|
+
"AccountType",
|
8
|
+
"AssetStatus",
|
9
|
+
"CampaignMemberStatus",
|
10
|
+
"CampaignStatus",
|
11
|
+
"CampaignType",
|
12
|
+
"CareItemStatus",
|
13
|
+
"CaseContactRole",
|
14
|
+
"CaseOrigin",
|
15
|
+
"CasePriority",
|
16
|
+
"CaseReason",
|
17
|
+
"CaseStatus",
|
18
|
+
"CaseType",
|
19
|
+
"ContactRole",
|
20
|
+
"ContractContactRole",
|
21
|
+
"ContractStatus",
|
22
|
+
"EntitlementType",
|
23
|
+
"EventSubject",
|
24
|
+
"EventType",
|
25
|
+
"FiscalYearPeriodName",
|
26
|
+
"FiscalYearPeriodPrefix",
|
27
|
+
"FiscalYearQuarterName",
|
28
|
+
"FiscalYearQuarterPrefix",
|
29
|
+
"FulfillmentStatus",
|
30
|
+
"FulfillmentType",
|
31
|
+
"IdeaCategory",
|
32
|
+
"IdeaMultiCategory",
|
33
|
+
"IdeaStatus",
|
34
|
+
"IdeaThemeStatus",
|
35
|
+
"Industry",
|
36
|
+
"LeadSource",
|
37
|
+
"LeadStatus",
|
38
|
+
"OpportunityCompetitor",
|
39
|
+
"OpportunityStage",
|
40
|
+
"OpportunityType",
|
41
|
+
"OrderItemSummaryChgRsn",
|
42
|
+
"OrderStatus",
|
43
|
+
"OrderSummaryRoutingSchdRsn",
|
44
|
+
"OrderSummaryStatus",
|
45
|
+
"OrderType",
|
46
|
+
"PartnerRole",
|
47
|
+
"Product2Family",
|
48
|
+
"QuantityUnitOfMeasure",
|
49
|
+
"ProcessExceptionCategory",
|
50
|
+
"ProcessExceptionPriority",
|
51
|
+
"ProcessExceptionSeverity",
|
52
|
+
"ProcessExceptionStatus",
|
53
|
+
"QuestionOrigin",
|
54
|
+
"QuickTextCategory",
|
55
|
+
"QuickTextChannel",
|
56
|
+
"QuoteStatus",
|
57
|
+
"RoleInTerritory2",
|
58
|
+
"ResourceAbsenceType",
|
59
|
+
"ReturnOrderLineItemProcessPlan",
|
60
|
+
"ReturnOrderLineItemReasonForRejection",
|
61
|
+
"ReturnOrderLineItemReasonForReturn",
|
62
|
+
"ReturnOrderLineItemRepaymentMethod",
|
63
|
+
"ReturnOrderShipmentType",
|
64
|
+
"ReturnOrderStatus",
|
65
|
+
"SalesTeamRole",
|
66
|
+
"Salutation",
|
67
|
+
"ServiceAppointmentStatus",
|
68
|
+
"ServiceContractApprovalStatus",
|
69
|
+
"ServTerrMemRoleType",
|
70
|
+
"SocialPostClassification",
|
71
|
+
"SocialPostEngagementLevel",
|
72
|
+
"SocialPostReviewedStatus",
|
73
|
+
"SolutionStatus",
|
74
|
+
"TaskPriority",
|
75
|
+
"TaskStatus",
|
76
|
+
"TaskSubject",
|
77
|
+
"TaskType",
|
78
|
+
"WorkOrderLineItemStatus",
|
79
|
+
"WorkOrderPriority",
|
80
|
+
"WorkOrderStatus",
|
81
|
+
"WorkTypeDefApptType",
|
82
|
+
"WorkTypeGroupAddInfo"
|
83
|
+
]
|
84
|
+
}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
/// <reference types="debug" />
|
2
|
+
import { ComponentSet, VirtualTreeContainer, SourceComponent, NodeFSTreeContainer as FSTreeContainer } from '@salesforce/source-deploy-retrieve';
|
3
|
+
export declare const NodeFSTreeContainer: typeof FSTreeContainer;
|
4
|
+
export declare const debug: import("debug").Debugger;
|
5
|
+
export interface Ctx {
|
6
|
+
projectRoot: string;
|
7
|
+
sfdxProjectFolders: string[];
|
8
|
+
sourceApiVersion: string;
|
9
|
+
gitLines: Array<{
|
10
|
+
path: string;
|
11
|
+
status: string;
|
12
|
+
}>;
|
13
|
+
gitResults: {
|
14
|
+
manifest: ComponentSet;
|
15
|
+
destructiveChanges: ComponentSet;
|
16
|
+
unchanged: string[];
|
17
|
+
ignored: {
|
18
|
+
ref1: string[];
|
19
|
+
ref2: string[];
|
20
|
+
};
|
21
|
+
counts: {
|
22
|
+
added: number;
|
23
|
+
deleted: number;
|
24
|
+
modified: number;
|
25
|
+
unchanged: number;
|
26
|
+
ignored: number;
|
27
|
+
error: number;
|
28
|
+
};
|
29
|
+
errors: string[];
|
30
|
+
};
|
31
|
+
ref1VirtualTreeContainer: VirtualTreeContainer;
|
32
|
+
ref2VirtualTreeContainer: VirtualTreeContainer | FSTreeContainer;
|
33
|
+
destructiveChangesComponentSet: ComponentSet;
|
34
|
+
manifestComponentSet: ComponentSet;
|
35
|
+
git: {
|
36
|
+
ref1: string;
|
37
|
+
ref2: string;
|
38
|
+
ref1ref2: string;
|
39
|
+
};
|
40
|
+
destructiveChanges: {
|
41
|
+
files: string[];
|
42
|
+
};
|
43
|
+
manifest: {
|
44
|
+
file: string;
|
45
|
+
};
|
46
|
+
}
|
47
|
+
export declare function ensureOSPath(path: string): string;
|
48
|
+
export declare function ensureGitPath(path: string): string;
|
49
|
+
export declare function createVirtualTreeContainer(ref: string, dir: string, modifiedFiles: string[]): Promise<VirtualTreeContainer>;
|
50
|
+
export declare function analyzeFile(path: string, ref1VirtualTreeContainer: VirtualTreeContainer, ref2VirtualTreeContainer: VirtualTreeContainer | FSTreeContainer): Promise<{
|
51
|
+
status: number;
|
52
|
+
toManifest?: SourceComponent[];
|
53
|
+
toDestructiveChanges?: SourceComponent[];
|
54
|
+
}>;
|
55
|
+
export declare function getGitDiff(sfdxProjectFolders: string[], ref1: string, ref2: string, dir: string): Promise<Ctx['gitLines']>;
|
56
|
+
export declare function getGitResults(gitLines: Ctx['gitLines'], ref1VirtualTreeContainer: VirtualTreeContainer, ref2VirtualTreeContainer: VirtualTreeContainer | FSTreeContainer): Promise<Ctx['gitResults']>;
|
57
|
+
export declare function buildManifestComponentSet(cs: ComponentSet, forDestructiveChanges?: boolean): ComponentSet;
|