@jayree/sfdx-plugin-manifest 2.6.4 → 2.7.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +19 -0
- package/README.md +58 -53
- package/lib/SDR-extra/collections/componentSetExtra.d.ts +2 -3
- package/lib/SDR-extra/collections/componentSetExtra.js +28 -18
- package/lib/SDR-extra/collections/componentSetExtra.js.map +1 -1
- package/lib/SDR-extra/collections/index.d.ts +1 -0
- package/lib/SDR-extra/collections/index.js +8 -0
- package/lib/SDR-extra/collections/index.js.map +1 -0
- package/lib/SDR-extra/index.d.ts +3 -0
- package/lib/SDR-extra/index.js +10 -0
- package/lib/SDR-extra/index.js.map +1 -0
- package/lib/SDR-extra/resolve/gitDiffResolver.d.ts +3 -6
- package/lib/SDR-extra/resolve/gitDiffResolver.js +22 -18
- package/lib/SDR-extra/resolve/gitDiffResolver.js.map +1 -1
- package/lib/SDR-extra/resolve/index.d.ts +2 -0
- package/lib/SDR-extra/resolve/index.js +9 -0
- package/lib/SDR-extra/resolve/index.js.map +1 -0
- package/lib/SDR-extra/resolve/treeContainersExtra.d.ts +1 -1
- package/lib/SDR-extra/resolve/treeContainersExtra.js +9 -8
- package/lib/SDR-extra/resolve/treeContainersExtra.js.map +1 -1
- package/lib/SDR-extra/utils/index.d.ts +1 -0
- package/lib/SDR-extra/utils/index.js +8 -0
- package/lib/SDR-extra/utils/index.js.map +1 -0
- package/lib/SDR-extra/utils/localGitRepo.d.ts +39 -0
- package/lib/SDR-extra/utils/localGitRepo.js +239 -0
- package/lib/SDR-extra/utils/localGitRepo.js.map +1 -0
- package/lib/commands/jayree/manifest/beta/git/diff.d.ts +15 -10
- package/lib/commands/jayree/manifest/beta/git/diff.js +49 -35
- package/lib/commands/jayree/manifest/beta/git/diff.js.map +1 -1
- package/lib/commands/jayree/manifest/cleanup.js +7 -1
- package/lib/commands/jayree/manifest/cleanup.js.map +1 -1
- package/lib/commands/jayree/manifest/generate.js +7 -1
- package/lib/commands/jayree/manifest/generate.js.map +1 -1
- package/lib/commands/jayree/manifest/git/diff.js +7 -2
- package/lib/commands/jayree/manifest/git/diff.js.map +1 -1
- package/lib/hooks/changelog.js +7 -2
- package/lib/hooks/changelog.js.map +1 -1
- package/lib/utils/gitdiff.js +2 -2
- package/lib/utils/gitdiff.js.map +1 -1
- package/messages/gitdiffbeta.md +78 -0
- package/oclif.manifest.json +1 -1
- package/package.json +5 -3
- package/lib/SDR-extra/utils/git-extra.d.ts +0 -71
- package/lib/SDR-extra/utils/git-extra.js +0 -202
- package/lib/SDR-extra/utils/git-extra.js.map +0 -1
- package/messages/gitdiffbeta.json +0 -17
@@ -0,0 +1,39 @@
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
2
|
+
interface GitRepoOptions {
|
3
|
+
gitDir: string;
|
4
|
+
packageDirs?: string[];
|
5
|
+
}
|
6
|
+
export declare class GitRepo {
|
7
|
+
private static instanceMap;
|
8
|
+
gitDir: string;
|
9
|
+
private packageDirs;
|
10
|
+
private constructor();
|
11
|
+
static getInstance(options: GitRepoOptions): GitRepo;
|
12
|
+
resolveMultiRefString(ref: string): Promise<{
|
13
|
+
ref1: string;
|
14
|
+
ref2: string;
|
15
|
+
}>;
|
16
|
+
resolveSingleRefString(ref: string): Promise<string>;
|
17
|
+
getStatus(ref: string): Promise<Array<{
|
18
|
+
path: string;
|
19
|
+
status: string;
|
20
|
+
}>>;
|
21
|
+
getFileState(options: {
|
22
|
+
ref1: string;
|
23
|
+
ref2: string;
|
24
|
+
}): Promise<[
|
25
|
+
{
|
26
|
+
path: string;
|
27
|
+
status: string;
|
28
|
+
}
|
29
|
+
]>;
|
30
|
+
listFullPathFiles(ref: string): Promise<string[]>;
|
31
|
+
getOid(ref: string): Promise<string>;
|
32
|
+
readBlobAsBuffer(options: {
|
33
|
+
oid: string;
|
34
|
+
filename: string;
|
35
|
+
}): Promise<Buffer>;
|
36
|
+
private getCommitLog;
|
37
|
+
private ensureGitRelPath;
|
38
|
+
}
|
39
|
+
export {};
|
@@ -0,0 +1,239 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) 2022, jayree
|
3
|
+
* All rights reserved.
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
6
|
+
*/
|
7
|
+
import util from 'util';
|
8
|
+
import path from 'node:path';
|
9
|
+
import git from 'isomorphic-git';
|
10
|
+
import { Lifecycle } from '@salesforce/core';
|
11
|
+
import fs from 'graceful-fs';
|
12
|
+
export class GitRepo {
|
13
|
+
constructor(options) {
|
14
|
+
this.gitDir = options.gitDir;
|
15
|
+
this.packageDirs = options.packageDirs;
|
16
|
+
}
|
17
|
+
static getInstance(options) {
|
18
|
+
if (!GitRepo.instanceMap.has(options.gitDir)) {
|
19
|
+
const newInstance = new GitRepo(options);
|
20
|
+
GitRepo.instanceMap.set(options.gitDir, newInstance);
|
21
|
+
}
|
22
|
+
return GitRepo.instanceMap.get(options.gitDir);
|
23
|
+
}
|
24
|
+
async resolveMultiRefString(ref) {
|
25
|
+
const a = ref.split('.');
|
26
|
+
let ref1;
|
27
|
+
let ref2;
|
28
|
+
if (a.length === 3 || a.length === 4) {
|
29
|
+
ref1 = a[0];
|
30
|
+
ref2 = a[a.length - 1];
|
31
|
+
}
|
32
|
+
else if (a.length === 1) {
|
33
|
+
ref1 = a[0];
|
34
|
+
ref2 = undefined;
|
35
|
+
}
|
36
|
+
else {
|
37
|
+
throw new Error(`Ambiguous ${util.format('argument%s', ref.length === 1 ? '' : 's')}: ${ref}
|
38
|
+
See more help with --help`);
|
39
|
+
}
|
40
|
+
if (a.length === 4) {
|
41
|
+
ref1 = (await git.findMergeBase({
|
42
|
+
fs,
|
43
|
+
dir: this.gitDir,
|
44
|
+
oids: [ref2, ref1],
|
45
|
+
}))[0];
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
ref1 = await this.resolveSingleRefString(ref1);
|
49
|
+
}
|
50
|
+
ref2 = await this.resolveSingleRefString(ref2);
|
51
|
+
return { ref1, ref2 };
|
52
|
+
}
|
53
|
+
async resolveSingleRefString(ref) {
|
54
|
+
if (ref === undefined) {
|
55
|
+
return '';
|
56
|
+
}
|
57
|
+
if (!['~', '^'].some((el) => ref.includes(el))) {
|
58
|
+
return (await this.getCommitLog(ref)).oid;
|
59
|
+
}
|
60
|
+
const firstIndex = [ref.indexOf('^'), ref.indexOf('~')].filter((a) => a >= 0).reduce((a, b) => Math.min(a, b));
|
61
|
+
let ipath = ref.substring(firstIndex);
|
62
|
+
let resolvedRef = ref.substring(0, firstIndex);
|
63
|
+
while (ipath.length && resolvedRef !== undefined) {
|
64
|
+
if (ipath.startsWith('^')) {
|
65
|
+
ipath = ipath.substring(1);
|
66
|
+
let next = Number(ipath.substring(0, 1));
|
67
|
+
ipath = next ? ipath.substring(1) : ipath;
|
68
|
+
next = next ? next : 1;
|
69
|
+
// eslint-disable-next-line no-await-in-loop
|
70
|
+
resolvedRef = (await this.getCommitLog(resolvedRef)).parents[next - 1];
|
71
|
+
}
|
72
|
+
else if (ipath.startsWith('~')) {
|
73
|
+
ipath = ipath.substring(1);
|
74
|
+
let next = Number(ipath.substring(0, 1));
|
75
|
+
ipath = next ? ipath.substring(1) : ipath;
|
76
|
+
next = next ? next : 1;
|
77
|
+
for (let index = 0; index <= next - 1; index++) {
|
78
|
+
// eslint-disable-next-line no-await-in-loop
|
79
|
+
resolvedRef = (await this.getCommitLog(resolvedRef)).parents[0];
|
80
|
+
}
|
81
|
+
}
|
82
|
+
else {
|
83
|
+
resolvedRef = undefined;
|
84
|
+
}
|
85
|
+
}
|
86
|
+
if (resolvedRef === undefined) {
|
87
|
+
throw new Error(`ambiguous argument '${ref}': unknown revision or path not in the working tree.`);
|
88
|
+
}
|
89
|
+
return resolvedRef;
|
90
|
+
}
|
91
|
+
async getStatus(ref) {
|
92
|
+
const getStatusText = (row) => {
|
93
|
+
if ([
|
94
|
+
[0, 2, 2],
|
95
|
+
[0, 2, 3], // added, staged, with unstaged changes
|
96
|
+
].some((a) => a.every((val, index) => val === row[index]))) {
|
97
|
+
return 'A';
|
98
|
+
}
|
99
|
+
if ([
|
100
|
+
[1, 0, 0],
|
101
|
+
[1, 0, 1],
|
102
|
+
[1, 1, 0],
|
103
|
+
[1, 2, 0],
|
104
|
+
[1, 0, 3], // modified, staged, with unstaged deletion
|
105
|
+
].some((a) => a.every((val, index) => val === row[index]))) {
|
106
|
+
return 'D';
|
107
|
+
}
|
108
|
+
if ([
|
109
|
+
[1, 2, 1],
|
110
|
+
[1, 2, 2],
|
111
|
+
[1, 2, 3], // modified, staged, with unstaged changes
|
112
|
+
].some((a) => a.every((val, index) => val === row[index]))) {
|
113
|
+
return 'M';
|
114
|
+
}
|
115
|
+
};
|
116
|
+
const statusMatrix = await git.statusMatrix({
|
117
|
+
fs,
|
118
|
+
dir: this.gitDir,
|
119
|
+
ref,
|
120
|
+
filter: (f) => this.packageDirs ? this.packageDirs.some((fDir) => f.startsWith(this.ensureGitRelPath(fDir))) : true,
|
121
|
+
});
|
122
|
+
const warningMatrix = statusMatrix.filter((row) => [
|
123
|
+
[0, 2, 3],
|
124
|
+
[1, 0, 3],
|
125
|
+
[1, 2, 3],
|
126
|
+
[1, 1, 0],
|
127
|
+
[1, 2, 0],
|
128
|
+
[0, 0, 3],
|
129
|
+
[1, 1, 3],
|
130
|
+
[1, 2, 1],
|
131
|
+
[1, 0, 1],
|
132
|
+
[0, 2, 0], // new, untracked
|
133
|
+
].some((a) => a.every((val, index) => val === row.slice(1)[index])));
|
134
|
+
if (warningMatrix.length) {
|
135
|
+
const buildWarningArray = (warnings) => {
|
136
|
+
const LifecycleInstance = Lifecycle.getInstance();
|
137
|
+
const emitWarningArray = [];
|
138
|
+
warnings.forEach((warning) => {
|
139
|
+
const filteredChanges = warningMatrix
|
140
|
+
.filter((row) => warning.filter.some((a) => a.every((val, index) => val === row.slice(1)[index])))
|
141
|
+
.map((row) => path.join(this.gitDir, ensureOSPath(row[0])));
|
142
|
+
for (const file of filteredChanges) {
|
143
|
+
emitWarningArray.push(LifecycleInstance.emitWarning(util.format(warning.message, file)));
|
144
|
+
}
|
145
|
+
});
|
146
|
+
return emitWarningArray;
|
147
|
+
};
|
148
|
+
// prettier-ignore
|
149
|
+
await Promise.all(buildWarningArray([
|
150
|
+
{ filter: [[0, 2, 3], [1, 0, 3], [1, 2, 3], [1, 1, 0], [1, 2, 0]], message: 'The staged file with unstaged changes "%s" was processed.', },
|
151
|
+
{ filter: [[0, 0, 3], [1, 1, 3]], message: 'The staged file with unstaged changes "%s" was ignored.', },
|
152
|
+
{ filter: [[1, 2, 1], [1, 0, 1]], message: 'The unstaged file "%s" was processed.', },
|
153
|
+
{ filter: [[0, 2, 0]], message: 'The untracked file "%s" was ignored.', },
|
154
|
+
]));
|
155
|
+
}
|
156
|
+
const gitlines = statusMatrix
|
157
|
+
.filter((row) => ![
|
158
|
+
[0, 0, 0],
|
159
|
+
[1, 1, 1],
|
160
|
+
[0, 0, 3],
|
161
|
+
[0, 2, 0],
|
162
|
+
[1, 1, 3], // modified, staged, with unstaged original file
|
163
|
+
].some((a) => a.every((val, index) => val === row.slice(1)[index])))
|
164
|
+
.map((row) => ({
|
165
|
+
path: path.join(this.gitDir, ensureOSPath(row[0])),
|
166
|
+
status: getStatusText(row.slice(1)),
|
167
|
+
}));
|
168
|
+
return gitlines;
|
169
|
+
}
|
170
|
+
async getFileState(options) {
|
171
|
+
const gitDir = this.gitDir;
|
172
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
173
|
+
return git.walk({
|
174
|
+
fs,
|
175
|
+
dir: this.gitDir,
|
176
|
+
trees: [git.TREE({ ref: options.ref1 }), git.TREE({ ref: options.ref2 })],
|
177
|
+
async map(filepath, [A, B]) {
|
178
|
+
if (filepath === '.' || (await A?.type()) === 'tree' || (await B?.type()) === 'tree') {
|
179
|
+
return;
|
180
|
+
}
|
181
|
+
const Aoid = await A?.oid();
|
182
|
+
const Boid = await B?.oid();
|
183
|
+
let type = 'EQ';
|
184
|
+
if (Aoid !== Boid) {
|
185
|
+
type = 'M';
|
186
|
+
}
|
187
|
+
if (Aoid === undefined) {
|
188
|
+
type = 'A';
|
189
|
+
}
|
190
|
+
if (Boid === undefined) {
|
191
|
+
type = 'D';
|
192
|
+
}
|
193
|
+
if (type !== 'EQ') {
|
194
|
+
return {
|
195
|
+
path: path.join(gitDir, ensureOSPath(filepath)),
|
196
|
+
status: type,
|
197
|
+
};
|
198
|
+
}
|
199
|
+
},
|
200
|
+
});
|
201
|
+
}
|
202
|
+
async listFullPathFiles(ref) {
|
203
|
+
return (await git.listFiles({ fs, dir: this.gitDir, ref })).map((p) => path.join(this.gitDir, ensureOSPath(p)));
|
204
|
+
}
|
205
|
+
async getOid(ref) {
|
206
|
+
return ref ? git.resolveRef({ fs, dir: this.gitDir, ref }) : '';
|
207
|
+
}
|
208
|
+
async readBlobAsBuffer(options) {
|
209
|
+
return Buffer.from((await git.readBlob({
|
210
|
+
fs,
|
211
|
+
dir: this.gitDir,
|
212
|
+
oid: options.oid,
|
213
|
+
filepath: this.ensureGitRelPath(options.filename),
|
214
|
+
})).blob);
|
215
|
+
}
|
216
|
+
async getCommitLog(ref) {
|
217
|
+
try {
|
218
|
+
const [log] = await git.log({
|
219
|
+
fs,
|
220
|
+
dir: this.gitDir,
|
221
|
+
ref,
|
222
|
+
depth: 1,
|
223
|
+
});
|
224
|
+
return { oid: log.oid, parents: log.commit.parent };
|
225
|
+
}
|
226
|
+
catch (error) {
|
227
|
+
throw new Error(`ambiguous argument '${ref}': unknown revision or path not in the working tree.
|
228
|
+
See more help with --help`);
|
229
|
+
}
|
230
|
+
}
|
231
|
+
ensureGitRelPath(fpath) {
|
232
|
+
return path.relative(this.gitDir, fpath).split(path.sep).join(path.posix.sep);
|
233
|
+
}
|
234
|
+
}
|
235
|
+
GitRepo.instanceMap = new Map();
|
236
|
+
function ensureOSPath(fpath) {
|
237
|
+
return fpath.split(path.posix.sep).join(path.sep);
|
238
|
+
}
|
239
|
+
//# sour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
2
|
-
import {
|
3
|
-
import {
|
2
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
3
|
+
import { Optional } from '@salesforce/ts-types';
|
4
4
|
export interface GitDiffCommandResult {
|
5
5
|
manifest?: {
|
6
6
|
path: string;
|
@@ -11,14 +11,18 @@ export interface GitDiffCommandResult {
|
|
11
11
|
name: string;
|
12
12
|
};
|
13
13
|
}
|
14
|
-
export default class GitDiffCommand extends
|
15
|
-
static
|
16
|
-
static
|
17
|
-
static
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
14
|
+
export default class GitDiffCommand extends SfCommand<GitDiffCommandResult> {
|
15
|
+
static readonly summary: string;
|
16
|
+
static readonly description: string;
|
17
|
+
static readonly examples: string[];
|
18
|
+
static readonly args: ArgInput;
|
19
|
+
static readonly requiresProject = true;
|
20
|
+
static readonly flags: {
|
21
|
+
'api-version': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
22
|
+
'source-dir': import("@oclif/core/lib/interfaces").OptionFlag<string[]>;
|
23
|
+
'output-dir': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
24
|
+
'destructive-changes-only': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
25
|
+
};
|
22
26
|
private outputDir;
|
23
27
|
private manifestName;
|
24
28
|
private destructiveChangesName;
|
@@ -26,6 +30,7 @@ export default class GitDiffCommand extends JayreeSfdxCommand {
|
|
26
30
|
private componentSet;
|
27
31
|
private destructiveChangesOnly;
|
28
32
|
run(): Promise<GitDiffCommandResult>;
|
33
|
+
protected getSourceApiVersion(): Promise<Optional<string>>;
|
29
34
|
protected createManifest(): Promise<void>;
|
30
35
|
protected formatResult(): GitDiffCommandResult;
|
31
36
|
}
|
@@ -4,31 +4,40 @@
|
|
4
4
|
* Licensed under the BSD 3-Clause license.
|
5
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
6
6
|
*/
|
7
|
-
import
|
8
|
-
import {
|
9
|
-
import { flags } from '@salesforce/command';
|
7
|
+
import { join, dirname } from 'node:path';
|
8
|
+
import { fileURLToPath } from 'node:url';
|
10
9
|
import { Messages } from '@salesforce/core';
|
11
10
|
import fs from 'fs-extra';
|
12
11
|
import { DestructiveChangesType } from '@salesforce/source-deploy-retrieve';
|
13
|
-
import {
|
14
|
-
import {
|
15
|
-
|
12
|
+
import { SfCommand, Flags, orgApiVersionFlagWithDeprecations, arrayWithDeprecation } from '@salesforce/sf-plugins-core';
|
13
|
+
import { getString } from '@salesforce/ts-types';
|
14
|
+
import { ComponentSetExtra } from '../../../../../SDR-extra/index.js';
|
15
|
+
// eslint-disable-next-line no-underscore-dangle
|
16
|
+
const __filename = fileURLToPath(import.meta.url);
|
17
|
+
// eslint-disable-next-line no-underscore-dangle
|
18
|
+
const __dirname = dirname(__filename);
|
19
|
+
Messages.importMessagesDirectory(__dirname);
|
16
20
|
const messages = Messages.loadMessages('@jayree/sfdx-plugin-manifest', 'gitdiffbeta');
|
17
|
-
export default class GitDiffCommand extends
|
21
|
+
export default class GitDiffCommand extends SfCommand {
|
18
22
|
async run() {
|
19
23
|
await this.createManifest();
|
20
24
|
return this.formatResult();
|
21
25
|
}
|
26
|
+
async getSourceApiVersion() {
|
27
|
+
const projectConfig = await this.project.resolveProjectConfig();
|
28
|
+
return getString(projectConfig, 'sourceApiVersion');
|
29
|
+
}
|
22
30
|
async createManifest() {
|
31
|
+
const { flags, args } = await this.parse(GitDiffCommand);
|
23
32
|
this.manifestName = 'package.xml';
|
24
33
|
this.destructiveChangesName = 'destructiveChanges.xml';
|
25
|
-
this.outputDir =
|
26
|
-
this.destructiveChangesOnly =
|
34
|
+
this.outputDir = flags['output-dir'];
|
35
|
+
this.destructiveChangesOnly = flags['destructive-changes-only'];
|
27
36
|
this.componentSet = await ComponentSetExtra.fromGitDiff({
|
28
|
-
ref: [
|
29
|
-
fsPaths:
|
37
|
+
ref: [args.ref1, args.ref2],
|
38
|
+
fsPaths: flags['source-dir'],
|
30
39
|
});
|
31
|
-
this.componentSet.sourceApiVersion =
|
40
|
+
this.componentSet.sourceApiVersion = flags['api-version'] ?? (await this.getSourceApiVersion());
|
32
41
|
if (this.outputDir) {
|
33
42
|
await fs.ensureDir(this.outputDir);
|
34
43
|
this.outputPath = join(this.outputDir, this.manifestName);
|
@@ -52,26 +61,26 @@ export default class GitDiffCommand extends JayreeSfdxCommand {
|
|
52
61
|
}
|
53
62
|
}
|
54
63
|
formatResult() {
|
55
|
-
if (!this.
|
64
|
+
if (!this.jsonEnabled()) {
|
56
65
|
if (this.componentSet.size) {
|
57
66
|
if (this.destructiveChangesOnly && !this.componentSet.getTypesOfDestructiveChanges().length) {
|
58
|
-
this.
|
67
|
+
this.log(messages.getMessage('noComponents'));
|
59
68
|
}
|
60
69
|
else if (this.outputDir) {
|
61
|
-
this.
|
70
|
+
this.log(messages.getMessage('successOutputDir', [this.manifestName, this.outputDir]));
|
62
71
|
if (this.componentSet.getTypesOfDestructiveChanges().length) {
|
63
|
-
this.
|
72
|
+
this.log(messages.getMessage('successOutputDir', [this.destructiveChangesName, this.outputDir]));
|
64
73
|
}
|
65
74
|
}
|
66
75
|
else {
|
67
|
-
this.
|
76
|
+
this.log(messages.getMessage('success', [this.manifestName]));
|
68
77
|
if (this.componentSet.getTypesOfDestructiveChanges().length) {
|
69
|
-
this.
|
78
|
+
this.log(messages.getMessage('success', [this.destructiveChangesName]));
|
70
79
|
}
|
71
80
|
}
|
72
81
|
}
|
73
82
|
else {
|
74
|
-
this.
|
83
|
+
this.log(messages.getMessage('noComponents'));
|
75
84
|
}
|
76
85
|
}
|
77
86
|
if (this.componentSet.getTypesOfDestructiveChanges().length) {
|
@@ -91,8 +100,9 @@ export default class GitDiffCommand extends JayreeSfdxCommand {
|
|
91
100
|
}
|
92
101
|
}
|
93
102
|
}
|
103
|
+
GitDiffCommand.summary = messages.getMessage('summary');
|
94
104
|
GitDiffCommand.description = messages.getMessage('description');
|
95
|
-
GitDiffCommand.examples = messages.
|
105
|
+
GitDiffCommand.examples = messages.getMessages('examples');
|
96
106
|
GitDiffCommand.args = [
|
97
107
|
{
|
98
108
|
name: 'ref1',
|
@@ -104,24 +114,28 @@ GitDiffCommand.args = [
|
|
104
114
|
description: 'commit or branch to compare to the base commit',
|
105
115
|
},
|
106
116
|
];
|
107
|
-
GitDiffCommand.
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
117
|
+
GitDiffCommand.requiresProject = true;
|
118
|
+
GitDiffCommand.flags = {
|
119
|
+
'api-version': orgApiVersionFlagWithDeprecations,
|
120
|
+
'source-dir': arrayWithDeprecation({
|
121
|
+
char: 'd',
|
122
|
+
summary: messages.getMessage('flags.source-dir.summary'),
|
123
|
+
description: messages.getMessage('flags.source-dir.description'),
|
124
|
+
deprecateAliases: true,
|
125
|
+
aliases: ['sourcepath', 'p'],
|
112
126
|
}),
|
113
|
-
|
114
|
-
|
115
|
-
description: messages.getMessage('flags.
|
127
|
+
'output-dir': Flags.directory({
|
128
|
+
summary: messages.getMessage('flags.output-dir.summary'),
|
129
|
+
description: messages.getMessage('flags.output-dir.description'),
|
116
130
|
default: '',
|
131
|
+
deprecateAliases: true,
|
132
|
+
aliases: ['outputdir', 'o'],
|
117
133
|
}),
|
118
|
-
|
119
|
-
|
120
|
-
description: messages.getMessage('flags.
|
121
|
-
|
134
|
+
'destructive-changes-only': Flags.boolean({
|
135
|
+
summary: messages.getMessage('flags.destructive-changes-only.summary'),
|
136
|
+
description: messages.getMessage('flags.destructive-changes-only.description'),
|
137
|
+
deprecateAliases: true,
|
138
|
+
aliases: ['destructivechangesonly'],
|
122
139
|
}),
|
123
140
|
};
|
124
|
-
GitDiffCommand.requiresUsername = false;
|
125
|
-
GitDiffCommand.supportsDevhubUsername = false;
|
126
|
-
GitDiffCommand.requiresProject = true;
|
127
141
|
//# sourceMappingURL=diff.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../../../../../src/commands/jayree/manifest/beta/git/diff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C,CAAC;AAE5C,mBAAI,GAAa;IACtC;QACE,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,uBAAuB;KACrC;IACD;QACE,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,gDAAgD;KAC9D;CACF,CAAC;AAEqB,8BAAe,GAAG,IAAI,CAAC;AAEvB,oBAAK,GAAG;IAC7B,aAAa,EAAE,iCAAiC;IAChD,YAAY,EAAE,oBAAoB,CAAC;QACjC,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;QACxD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC;QAChE,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE,CAAC,YAAY,EAAE,GAAG,CAAC;KAC7B,CAAC;IACF,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC;QAC5B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;QACxD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC;QAChE,OAAO,EAAE,EAAE;QACX,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE,CAAC,WAAW,EAAE,GAAG,CAAC;KAC5B,CAAC;IACF,0BAA0B,EAAE,KAAK,CAAC,OAAO,CAAC;QACxC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,wCAAwC,CAAC;QACtE,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,4CAA4C,CAAC;QAC9E,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE,CAAC,wBAAwB,CAAC;KACpC,CAAC;CACH,CAAC"}
|
@@ -5,12 +5,18 @@
|
|
5
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
6
6
|
*/
|
7
7
|
import os from 'os';
|
8
|
+
import { dirname } from 'node:path';
|
9
|
+
import { fileURLToPath } from 'node:url';
|
8
10
|
import { flags } from '@salesforce/command';
|
9
11
|
import { Messages } from '@salesforce/core';
|
10
12
|
import fs from 'fs-extra';
|
11
13
|
import { JayreeSfdxCommand } from '../../../jayreeSfdxCommand.js';
|
12
14
|
import { cleanupManifestFile } from '../../../utils/manifest.js';
|
13
|
-
|
15
|
+
// eslint-disable-next-line no-underscore-dangle
|
16
|
+
const __filename = fileURLToPath(import.meta.url);
|
17
|
+
// eslint-disable-next-line no-underscore-dangle
|
18
|
+
const __dirname = dirname(__filename);
|
19
|
+
Messages.importMessagesDirectory(__dirname);
|
14
20
|
const messages = Messages.loadMessages('@jayree/sfdx-plugin-manifest', 'manifestcleanup');
|
15
21
|
export default class CleanupManifest extends JayreeSfdxCommand {
|
16
22
|
async run() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../../../../src/commands/jayree/manifest/cleanup.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,KAAK,EAAe,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,
|
1
|
+
{"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../../../../src/commands/jayree/manifest/cleanup.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EAAe,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAA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,QAAQ,CAAC;QACvB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,yBAAyB,CAAC;KAC5D,CAAC;IACF,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,qBAAqB,CAAC;KACxD,CAAC;CACH,CAAC;AAEe,gCAAgB,GAAG,KAAK,CAAC;AACzB,sCAAsB,GAAG,KAAK,CAAC;AAC/B,+BAAe,GAAG,IAAI,CAAC"}
|
@@ -5,14 +5,20 @@
|
|
5
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
6
6
|
*/
|
7
7
|
import os from 'os';
|
8
|
+
import { dirname } from 'node:path';
|
9
|
+
import { fileURLToPath } from 'node:url';
|
8
10
|
import { flags } from '@salesforce/command';
|
9
11
|
import { Messages } from '@salesforce/core';
|
10
12
|
import { RegistryAccess, ComponentSet } from '@salesforce/source-deploy-retrieve';
|
11
13
|
import { ensureArray } from '@salesforce/kit';
|
12
14
|
import fs from 'fs-extra';
|
13
15
|
import { JayreeSfdxCommand } from '../../../jayreeSfdxCommand.js';
|
16
|
+
// eslint-disable-next-line no-underscore-dangle
|
17
|
+
const __filename = fileURLToPath(import.meta.url);
|
18
|
+
// eslint-disable-next-line no-underscore-dangle
|
19
|
+
const __dirname = dirname(__filename);
|
20
|
+
Messages.importMessagesDirectory(__dirname);
|
14
21
|
const registryAccess = new RegistryAccess();
|
15
|
-
Messages.importMessagesDirectory(new URL('./', import.meta.url).pathname);
|
16
22
|
const messages = Messages.loadMessages('@jayree/sfdx-plugin-manifest', 'manifestgenerate');
|
17
23
|
export default class GeneratePackageXML extends JayreeSfdxCommand {
|
18
24
|
// eslint-disable-next-line complexity
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../../src/commands/jayree/manifest/generate.ts"],"names":[],"mappings":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full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
6
6
|
*/
|
7
7
|
import os from 'os';
|
8
|
-
import { join, dirname, resolve } from 'path';
|
8
|
+
import { join, dirname, resolve } from 'node:path';
|
9
|
+
import { fileURLToPath } from 'node:url';
|
9
10
|
import { flags } from '@salesforce/command';
|
10
11
|
import { Messages, SfError } from '@salesforce/core';
|
11
12
|
import fs from 'fs-extra';
|
@@ -14,7 +15,11 @@ import kit from '@salesforce/kit';
|
|
14
15
|
import { DestructiveChangesType } from '@salesforce/source-deploy-retrieve';
|
15
16
|
import { JayreeSfdxCommand } from '../../../../jayreeSfdxCommand.js';
|
16
17
|
import { getGitResults, createVirtualTreeContainer, fixComponentSetChilds, getGitDiff, debug, getGitArgsFromArgv, } from '../../../../utils/gitdiff.js';
|
17
|
-
|
18
|
+
// eslint-disable-next-line no-underscore-dangle
|
19
|
+
const __filename = fileURLToPath(import.meta.url);
|
20
|
+
// eslint-disable-next-line no-underscore-dangle
|
21
|
+
const __dirname = dirname(__filename);
|
22
|
+
Messages.importMessagesDirectory(__dirname);
|
18
23
|
const messages = Messages.loadMessages('@jayree/sfdx-plugin-manifest', 'gitdiff');
|
19
24
|
const logger = new Logger({ useIcons: false });
|
20
25
|
// eslint-disable-next-line @typescript-eslint/require-await
|