@jayree/sfdx-plugin-manifest 2.6.3 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +20 -0
- package/README.md +48 -53
- package/lib/SDR-extra/collections/componentSetExtra.d.ts +2 -3
- package/lib/SDR-extra/collections/componentSetExtra.js +32 -15
- 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 +9 -4
- package/lib/SDR-extra/resolve/gitDiffResolver.js +88 -79
- 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 +2 -1
- package/lib/SDR-extra/resolve/treeContainersExtra.js +9 -7
- 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 +18 -14
- package/lib/commands/jayree/manifest/beta/git/diff.js +44 -35
- package/lib/commands/jayree/manifest/beta/git/diff.js.map +1 -1
- package/lib/commands/jayree/manifest/cleanup.d.ts +1 -2
- package/lib/commands/jayree/manifest/cleanup.js +1 -1
- package/lib/commands/jayree/manifest/cleanup.js.map +1 -1
- package/lib/commands/jayree/manifest/git/diff.d.ts +5 -2
- package/lib/commands/jayree/manifest/git/diff.js.map +1 -1
- package/lib/utils/gitdiff.js +10 -2
- package/lib/utils/gitdiff.js.map +1 -1
- package/messages/gitdiffbeta.md +67 -0
- package/oclif.manifest.json +1 -1
- package/package.json +9 -5
- package/schemas/jayree-manifest-beta-git-diff.json +38 -0
- package/schemas/jayree-manifest-generate.json +51 -0
- package/schemas/jayree-manifest-git-diff.json +19 -0
- package/lib/SDR-extra/utils/git-extra.d.ts +0 -65
- package/lib/SDR-extra/utils/git-extra.js +0 -198
- package/lib/SDR-extra/utils/git-extra.js.map +0 -1
- package/messages/gitdiffbeta.json +0 -17
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"gitDiffResolver.js","sourceRoot":"","sources":["../../../src/SDR-extra/resolve/gitDiffResolver.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,
|
1
|
+
{"version":3,"file":"gitDiffResolver.js","sourceRoot":"","sources":["../../../src/SDR-extra/resolve/gitDiffResolver.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAa,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEzE,MAAM,KAAK,GAAG,KAAK,CAAC,qBAAqB,CAAC,CAAC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CAAC,CAAC,4BAA4B;aAChF;SACF;QAED,OAAO;YACL,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,CAAC,GAAG,wBAAwB,CAAC,MAAM,GAAG,wBAAwB,CAAC,MAAM;YAC7E,UAAU,EAAE,wBAAwB;YACpC,oBAAoB,EAAE,wBAAwB;SAC/C,CAAC;IACJ,CAAC;CACF"}
|
@@ -0,0 +1,9 @@
|
|
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
|
+
export * from './gitDiffResolver.js';
|
8
|
+
export * from './treeContainersExtra.js';
|
9
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/SDR-extra/resolve/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC"}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { VirtualTreeContainer } from '@salesforce/source-deploy-retrieve';
|
2
|
+
export { parseMetadataXml } from '@salesforce/source-deploy-retrieve/lib/src/utils/index.js';
|
2
3
|
export declare class VirtualTreeContainerExtra extends VirtualTreeContainer {
|
3
4
|
/**
|
4
5
|
* Designed for recreating virtual files from a git ref
|
@@ -9,5 +10,5 @@ export declare class VirtualTreeContainerExtra extends VirtualTreeContainer {
|
|
9
10
|
* @param includeBufferForFiles full paths to modified files
|
10
11
|
* @returns VirtualTreeContainer
|
11
12
|
*/
|
12
|
-
static fromGitRef(ref: string,
|
13
|
+
static fromGitRef(ref: string, gitDir: string, includeBufferForFiles: string[]): Promise<VirtualTreeContainer>;
|
13
14
|
}
|
@@ -7,8 +7,9 @@
|
|
7
7
|
import path from 'path';
|
8
8
|
import { VirtualTreeContainer } from '@salesforce/source-deploy-retrieve';
|
9
9
|
import { parseMetadataXml } from '@salesforce/source-deploy-retrieve/lib/src/utils/index.js';
|
10
|
-
import fs from 'fs
|
11
|
-
import {
|
10
|
+
import fs from 'graceful-fs';
|
11
|
+
import { GitRepo } from '../utils/index.js';
|
12
|
+
export { parseMetadataXml } from '@salesforce/source-deploy-retrieve/lib/src/utils/index.js';
|
12
13
|
export class VirtualTreeContainerExtra extends VirtualTreeContainer {
|
13
14
|
/**
|
14
15
|
* Designed for recreating virtual files from a git ref
|
@@ -19,9 +20,10 @@ export class VirtualTreeContainerExtra extends VirtualTreeContainer {
|
|
19
20
|
* @param includeBufferForFiles full paths to modified files
|
20
21
|
* @returns VirtualTreeContainer
|
21
22
|
*/
|
22
|
-
static async fromGitRef(ref,
|
23
|
-
const
|
24
|
-
const
|
23
|
+
static async fromGitRef(ref, gitDir, includeBufferForFiles) {
|
24
|
+
const localRepo = GitRepo.getInstance({ gitDir });
|
25
|
+
const paths = await localRepo.listFullPathFiles(ref);
|
26
|
+
const oid = await localRepo.getOid(ref);
|
25
27
|
const virtualDirectoryByFullPath = new Map();
|
26
28
|
for await (const filename of paths) {
|
27
29
|
let dirPath = path.dirname(filename);
|
@@ -31,8 +33,8 @@ export class VirtualTreeContainerExtra extends VirtualTreeContainer {
|
|
31
33
|
name: path.basename(filename),
|
32
34
|
data: parseMetadataXml(filename) && includeBufferForFiles.includes(filename)
|
33
35
|
? oid
|
34
|
-
? await readBlobAsBuffer(
|
35
|
-
: await fs.readFile(filename)
|
36
|
+
? await localRepo.readBlobAsBuffer({ oid, filename })
|
37
|
+
: await fs.promises.readFile(filename)
|
36
38
|
: Buffer.from(''),
|
37
39
|
})),
|
38
40
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"treeContainersExtra.js","sourceRoot":"","sources":["../../../src/SDR-extra/resolve/treeContainersExtra.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,IAAI,MAAM,MAAM,CAAC;AACx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from './localGitRepo.js';
|
@@ -0,0 +1,8 @@
|
|
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
|
+
export * from './localGitRepo.js';
|
8
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/SDR-extra/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,mBAAmB,CAAC"}
|
@@ -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 '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
|
+
//# sourceMappingURL=localGitRepo.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"localGitRepo.js","sourceRoot":"","sources":["../../../src/SDR-extra/utils/localGitRepo.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,GAAG,MAAM,gBAAgB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,aAAa,CAAC;AAO7B,MAAM,OAAO,OAAO;IAOlB,YAAoB,OAAuB;QACzC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACzC,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,OAAuB;QAC/C,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC5C,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;YACzC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;SACtD;QACD,OAAO,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IAEM,KAAK,CAAC,qBAAqB,CAAC,GAAW;QAI5C,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACzB,IAAI,IAAY,CAAC;QACjB,IAAI,IAAY,CAAC;QAEjB,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;YACpC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACZ,IAAI,GAAG,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
|
1
1
|
import { ArgInput } from '@oclif/core/lib/interfaces';
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
interface
|
2
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
3
|
+
import { Optional } from '@salesforce/ts-types';
|
4
|
+
export interface GitDiffCommandResult {
|
5
5
|
manifest?: {
|
6
6
|
path: string;
|
7
7
|
name: string;
|
@@ -11,22 +11,26 @@ interface CreateCommandResult {
|
|
11
11
|
name: string;
|
12
12
|
};
|
13
13
|
}
|
14
|
-
export default class
|
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;
|
25
29
|
private outputPath;
|
26
30
|
private componentSet;
|
27
31
|
private destructiveChangesOnly;
|
28
|
-
run(): Promise<
|
32
|
+
run(): Promise<GitDiffCommandResult>;
|
33
|
+
protected getSourceApiVersion(): Promise<Optional<string>>;
|
29
34
|
protected createManifest(): Promise<void>;
|
30
|
-
protected formatResult():
|
35
|
+
protected formatResult(): GitDiffCommandResult;
|
31
36
|
}
|
32
|
-
export {};
|
@@ -4,31 +4,35 @@
|
|
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 os from 'os';
|
8
7
|
import { join } from 'path';
|
9
|
-
import { flags } from '@salesforce/command';
|
10
8
|
import { Messages } from '@salesforce/core';
|
11
9
|
import fs from 'fs-extra';
|
12
10
|
import { DestructiveChangesType } from '@salesforce/source-deploy-retrieve';
|
13
|
-
import {
|
14
|
-
import {
|
11
|
+
import { SfCommand, Flags, orgApiVersionFlagWithDeprecations, arrayWithDeprecation } from '@salesforce/sf-plugins-core';
|
12
|
+
import { getString } from '@salesforce/ts-types';
|
13
|
+
import { ComponentSetExtra } from '../../../../../SDR-extra/index.js';
|
15
14
|
Messages.importMessagesDirectory(new URL('./', import.meta.url).pathname);
|
16
15
|
const messages = Messages.loadMessages('@jayree/sfdx-plugin-manifest', 'gitdiffbeta');
|
17
|
-
export default class
|
16
|
+
export default class GitDiffCommand extends SfCommand {
|
18
17
|
async run() {
|
19
18
|
await this.createManifest();
|
20
19
|
return this.formatResult();
|
21
20
|
}
|
21
|
+
async getSourceApiVersion() {
|
22
|
+
const projectConfig = await this.project.resolveProjectConfig();
|
23
|
+
return getString(projectConfig, 'sourceApiVersion');
|
24
|
+
}
|
22
25
|
async createManifest() {
|
26
|
+
const { flags, args } = await this.parse(GitDiffCommand);
|
23
27
|
this.manifestName = 'package.xml';
|
24
28
|
this.destructiveChangesName = 'destructiveChanges.xml';
|
25
|
-
this.outputDir =
|
26
|
-
this.destructiveChangesOnly =
|
29
|
+
this.outputDir = flags['output-dir'];
|
30
|
+
this.destructiveChangesOnly = flags['destructive-changes-only'];
|
27
31
|
this.componentSet = await ComponentSetExtra.fromGitDiff({
|
28
|
-
ref: [
|
29
|
-
fsPaths:
|
32
|
+
ref: [args.ref1, args.ref2],
|
33
|
+
fsPaths: flags['source-dir'],
|
30
34
|
});
|
31
|
-
this.componentSet.sourceApiVersion =
|
35
|
+
this.componentSet.sourceApiVersion = flags['api-version'] ?? (await this.getSourceApiVersion());
|
32
36
|
if (this.outputDir) {
|
33
37
|
await fs.ensureDir(this.outputDir);
|
34
38
|
this.outputPath = join(this.outputDir, this.manifestName);
|
@@ -52,26 +56,26 @@ export default class gitDiff extends JayreeSfdxCommand {
|
|
52
56
|
}
|
53
57
|
}
|
54
58
|
formatResult() {
|
55
|
-
if (!this.
|
59
|
+
if (!this.jsonEnabled()) {
|
56
60
|
if (this.componentSet.size) {
|
57
61
|
if (this.destructiveChangesOnly && !this.componentSet.getTypesOfDestructiveChanges().length) {
|
58
|
-
this.
|
62
|
+
this.log(messages.getMessage('noComponents'));
|
59
63
|
}
|
60
64
|
else if (this.outputDir) {
|
61
|
-
this.
|
65
|
+
this.log(messages.getMessage('successOutputDir', [this.manifestName, this.outputDir]));
|
62
66
|
if (this.componentSet.getTypesOfDestructiveChanges().length) {
|
63
|
-
this.
|
67
|
+
this.log(messages.getMessage('successOutputDir', [this.destructiveChangesName, this.outputDir]));
|
64
68
|
}
|
65
69
|
}
|
66
70
|
else {
|
67
|
-
this.
|
71
|
+
this.log(messages.getMessage('success', [this.manifestName]));
|
68
72
|
if (this.componentSet.getTypesOfDestructiveChanges().length) {
|
69
|
-
this.
|
73
|
+
this.log(messages.getMessage('success', [this.destructiveChangesName]));
|
70
74
|
}
|
71
75
|
}
|
72
76
|
}
|
73
77
|
else {
|
74
|
-
this.
|
78
|
+
this.log(messages.getMessage('noComponents'));
|
75
79
|
}
|
76
80
|
}
|
77
81
|
if (this.componentSet.getTypesOfDestructiveChanges().length) {
|
@@ -91,9 +95,10 @@ export default class gitDiff extends JayreeSfdxCommand {
|
|
91
95
|
}
|
92
96
|
}
|
93
97
|
}
|
94
|
-
|
95
|
-
|
96
|
-
|
98
|
+
GitDiffCommand.summary = messages.getMessage('summary');
|
99
|
+
GitDiffCommand.description = messages.getMessage('description');
|
100
|
+
GitDiffCommand.examples = messages.getMessages('examples');
|
101
|
+
GitDiffCommand.args = [
|
97
102
|
{
|
98
103
|
name: 'ref1',
|
99
104
|
required: true,
|
@@ -104,24 +109,28 @@ gitDiff.args = [
|
|
104
109
|
description: 'commit or branch to compare to the base commit',
|
105
110
|
},
|
106
111
|
];
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
+
GitDiffCommand.requiresProject = true;
|
113
|
+
GitDiffCommand.flags = {
|
114
|
+
'api-version': orgApiVersionFlagWithDeprecations,
|
115
|
+
'source-dir': arrayWithDeprecation({
|
116
|
+
char: 'd',
|
117
|
+
summary: messages.getMessage('flags.source-dir.summary'),
|
118
|
+
description: messages.getMessage('flags.source-dir.description'),
|
119
|
+
deprecateAliases: true,
|
120
|
+
aliases: ['sourcepath', 'p'],
|
112
121
|
}),
|
113
|
-
|
114
|
-
|
115
|
-
description: messages.getMessage('flags.
|
122
|
+
'output-dir': Flags.directory({
|
123
|
+
summary: messages.getMessage('flags.output-dir.summary'),
|
124
|
+
description: messages.getMessage('flags.output-dir.description'),
|
116
125
|
default: '',
|
126
|
+
deprecateAliases: true,
|
127
|
+
aliases: ['outputdir', 'o'],
|
117
128
|
}),
|
118
|
-
|
119
|
-
|
120
|
-
description: messages.getMessage('flags.
|
121
|
-
|
129
|
+
'destructive-changes-only': Flags.boolean({
|
130
|
+
summary: messages.getMessage('flags.destructive-changes-only.summary'),
|
131
|
+
description: messages.getMessage('flags.destructive-changes-only.description'),
|
132
|
+
deprecateAliases: true,
|
133
|
+
aliases: ['destructivechangesonly'],
|
122
134
|
}),
|
123
135
|
};
|
124
|
-
gitDiff.requiresUsername = false;
|
125
|
-
gitDiff.supportsDevhubUsername = false;
|
126
|
-
gitDiff.requiresProject = true;
|
127
136
|
//# sourceMappingURL=diff.js.map
|