@jayree/sfdx-plugin-manifest 2.6.2 → 2.6.4
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +20 -2
- package/README.md +5 -5
- package/lib/SDR-extra/collections/componentSetExtra.js +11 -4
- package/lib/SDR-extra/collections/componentSetExtra.js.map +1 -1
- package/lib/SDR-extra/resolve/gitDiffResolver.d.ts +10 -2
- package/lib/SDR-extra/resolve/gitDiffResolver.js +82 -76
- package/lib/SDR-extra/resolve/gitDiffResolver.js.map +1 -1
- package/lib/SDR-extra/resolve/treeContainersExtra.d.ts +1 -0
- package/lib/SDR-extra/resolve/treeContainersExtra.js +4 -3
- package/lib/SDR-extra/resolve/treeContainersExtra.js.map +1 -1
- package/lib/SDR-extra/utils/git-extra.d.ts +32 -26
- package/lib/SDR-extra/utils/git-extra.js +21 -17
- package/lib/SDR-extra/utils/git-extra.js.map +1 -1
- package/lib/commands/jayree/manifest/beta/git/diff.d.ts +4 -5
- package/lib/commands/jayree/manifest/beta/git/diff.js +8 -8
- 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/oclif.manifest.json +1 -1
- package/package.json +19 -17
- 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/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
## [2.6.4](https://github.com/jayree/sfdx-plugin-manifest/compare/v2.6.3...v2.6.4) (2023-01-09)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* **manifest:beta:git:diff:** fix sourcepath parameter ([0cc68bf](https://github.com/jayree/sfdx-plugin-manifest/commit/0cc68bf9547cc3ea67c0b6b591c2166f2debc852))
|
7
|
+
* **manifest:git:diff:** ignore modified forceignored metadata ([a264829](https://github.com/jayree/sfdx-plugin-manifest/commit/a26482954f18cb316b71e79d53191f2e6307b4c6))
|
8
|
+
|
9
|
+
## [2.6.3](https://github.com/jayree/sfdx-plugin-manifest/compare/v2.6.2...v2.6.3) (2023-01-06)
|
10
|
+
|
11
|
+
|
12
|
+
### Bug Fixes
|
13
|
+
|
14
|
+
* **deps:** bump @salesforce/command from 5.2.35 to 5.2.37 ([#477](https://github.com/jayree/sfdx-plugin-manifest/issues/477)) ([ced3e56](https://github.com/jayree/sfdx-plugin-manifest/commit/ced3e5618909acd588d9ba621f248dd85162f2d8))
|
15
|
+
* **deps:** bump @salesforce/kit from 1.8.0 to 1.8.2 ([#480](https://github.com/jayree/sfdx-plugin-manifest/issues/480)) ([0fea125](https://github.com/jayree/sfdx-plugin-manifest/commit/0fea1257ea0742188dc38e788e28b7f0e12cadc0))
|
16
|
+
* **deps:** bump @salesforce/source-deploy-retrieve from 7.5.19 to 7.5.22 ([#479](https://github.com/jayree/sfdx-plugin-manifest/issues/479)) ([47b6e55](https://github.com/jayree/sfdx-plugin-manifest/commit/47b6e55a042dfe1279be1a8f7f12166ed16873b0))
|
17
|
+
* **deps:** bump json5 from 1.0.1 to 1.0.2 ([#484](https://github.com/jayree/sfdx-plugin-manifest/issues/484)) ([469375b](https://github.com/jayree/sfdx-plugin-manifest/commit/469375b2b93687439e1474f2b3436ef539aa0061))
|
18
|
+
|
1
19
|
## [2.6.2](https://github.com/jayree/sfdx-plugin-manifest/compare/v2.6.1...v2.6.2) (2023-01-01)
|
2
20
|
|
3
21
|
|
@@ -17,7 +35,7 @@
|
|
17
35
|
|
18
36
|
### Bug Fixes
|
19
37
|
|
20
|
-
* **
|
38
|
+
* **manifest:git:diff:** fix diff status of childComponents ([ef13e60](https://github.com/jayree/sfdx-plugin-manifest/commit/ef13e600df02bf23aa764084686c0eb789055c20))
|
21
39
|
|
22
40
|
|
23
41
|
### Features
|
@@ -32,7 +50,7 @@ I plan to make the beta command generally available in the near future.
|
|
32
50
|
|
33
51
|
### Bug Fixes
|
34
52
|
|
35
|
-
* **
|
53
|
+
* **manifest:git:diff:** fix warnings ([b28f12e](https://github.com/jayree/sfdx-plugin-manifest/commit/b28f12eff17c206204c4f5d00b2b5de7f7f6b2f3))
|
36
54
|
|
37
55
|
## [2.5.2](https://github.com/jayree/sfdx-plugin-manifest/compare/v2.5.1...v2.5.2) (2022-12-30)
|
38
56
|
|
package/README.md
CHANGED
@@ -22,7 +22,7 @@ $ sfdx plugins:install @jayree/sfdx-plugin-manifest
|
|
22
22
|
$ sfdx jayree:[COMMAND]
|
23
23
|
running command...
|
24
24
|
$ sfdx plugins
|
25
|
-
@jayree/sfdx-plugin-manifest 2.6.
|
25
|
+
@jayree/sfdx-plugin-manifest 2.6.4
|
26
26
|
$ sfdx help jayree:[COMMAND]
|
27
27
|
USAGE
|
28
28
|
$ sfdx jayree:COMMAND
|
@@ -94,7 +94,7 @@ EXAMPLES
|
|
94
94
|
uses the diff of what is unique in branchB (REF2)
|
95
95
|
```
|
96
96
|
|
97
|
-
_See code: [src/commands/jayree/manifest/beta/git/diff.ts](https://github.com/jayree/sfdx-plugin-manifest/blob/v2.6.
|
97
|
+
_See code: [src/commands/jayree/manifest/beta/git/diff.ts](https://github.com/jayree/sfdx-plugin-manifest/blob/v2.6.4/src/commands/jayree/manifest/beta/git/diff.ts)_
|
98
98
|
|
99
99
|
### `sfdx jayree:manifest:cleanup`
|
100
100
|
|
@@ -122,7 +122,7 @@ EXAMPLES
|
|
122
122
|
$ sfdx jayree:manifest:cleanup --manifest=package.xml --file=packageignore.xml
|
123
123
|
```
|
124
124
|
|
125
|
-
_See code: [src/commands/jayree/manifest/cleanup.ts](https://github.com/jayree/sfdx-plugin-manifest/blob/v2.6.
|
125
|
+
_See code: [src/commands/jayree/manifest/cleanup.ts](https://github.com/jayree/sfdx-plugin-manifest/blob/v2.6.4/src/commands/jayree/manifest/cleanup.ts)_
|
126
126
|
|
127
127
|
### `sfdx jayree:manifest:generate`
|
128
128
|
|
@@ -165,7 +165,7 @@ EXAMPLES
|
|
165
165
|
<Package xmlns='http://soap.sforce.com/2006/04/metadata'>...</Package>
|
166
166
|
```
|
167
167
|
|
168
|
-
_See code: [src/commands/jayree/manifest/generate.ts](https://github.com/jayree/sfdx-plugin-manifest/blob/v2.6.
|
168
|
+
_See code: [src/commands/jayree/manifest/generate.ts](https://github.com/jayree/sfdx-plugin-manifest/blob/v2.6.4/src/commands/jayree/manifest/generate.ts)_
|
169
169
|
|
170
170
|
### `sfdx jayree:manifest:git:diff`
|
171
171
|
|
@@ -219,5 +219,5 @@ EXAMPLES
|
|
219
219
|
uses the diff of what is unique in branchB (REF2)
|
220
220
|
```
|
221
221
|
|
222
|
-
_See code: [src/commands/jayree/manifest/git/diff.ts](https://github.com/jayree/sfdx-plugin-manifest/blob/v2.6.
|
222
|
+
_See code: [src/commands/jayree/manifest/git/diff.ts](https://github.com/jayree/sfdx-plugin-manifest/blob/v2.6.4/src/commands/jayree/manifest/git/diff.ts)_
|
223
223
|
<!-- commandsstop -->
|
@@ -4,9 +4,11 @@
|
|
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 path from 'path';
|
7
8
|
import { ComponentSet, DestructiveChangesType, registry as untypedRegistry, } from '@salesforce/source-deploy-retrieve';
|
8
9
|
import { SfProject } from '@salesforce/core';
|
9
10
|
import Debug from 'debug';
|
11
|
+
import fs from 'fs-extra';
|
10
12
|
import { GitDiffResolver } from '../resolve/gitDiffResolver.js';
|
11
13
|
export const debug = Debug('sf:gitDiff:ComponentSetExtra');
|
12
14
|
export class ComponentSetExtra extends ComponentSet {
|
@@ -35,10 +37,13 @@ export class ComponentSetExtra extends ComponentSet {
|
|
35
37
|
else {
|
36
38
|
ref1 = input;
|
37
39
|
}
|
38
|
-
const
|
39
|
-
|
40
|
-
const gitDiffResolver = new GitDiffResolver();
|
40
|
+
const project = await SfProject.resolve();
|
41
|
+
const gitDiffResolver = new GitDiffResolver(project, fs);
|
41
42
|
const inclusiveFilter = await gitDiffResolver.resolve(ref1, ref2, fsPaths);
|
43
|
+
fsPaths =
|
44
|
+
fsPaths?.map((filepath) => path.resolve(filepath)).filter((filepath) => fs.existsSync(filepath)) ||
|
45
|
+
project.getUniquePackageDirectories().map((pDir) => pDir.fullPath);
|
46
|
+
debug({ fsPaths });
|
42
47
|
const components = ComponentSet.fromSource({
|
43
48
|
fsPaths,
|
44
49
|
include: inclusiveFilter,
|
@@ -51,7 +56,9 @@ export class ComponentSetExtra extends ComponentSet {
|
|
51
56
|
...Object.keys(untypedRegistry.types.customobjecttranslation.children.types),
|
52
57
|
...Object.keys(untypedRegistry.types.bot.children.types),
|
53
58
|
];
|
54
|
-
for (const component of inclusiveFilter
|
59
|
+
for (const component of inclusiveFilter
|
60
|
+
.getSourceComponents()
|
61
|
+
.filter((comp) => fsPaths.some((fsPath) => path.resolve(comp.xml).startsWith(fsPath)))) {
|
55
62
|
if (component.isMarkedForDelete()) {
|
56
63
|
components.add(component, DestructiveChangesType.POST);
|
57
64
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"componentSetExtra.js","sourceRoot":"","sources":["../../../src/SDR-extra/collections/componentSetExtra.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,YAAY,EAGZ,sBAAsB,EAEtB,QAAQ,IAAI,eAAe,GAC5B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,MAAM,CAAC,MAAM,K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C,EAAE;YACxF,IAAI,SAAS,CAAC,iBAAiB,EAAE,EAAE;gBACjC,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,sBAAsB,CAAC,IAAI,CAAC,CAAC;aACxD;iBAAM,IAAI,0BAA0B,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;gBACjE,KAAK,CACH,cAAc,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC,MAAM,CAAC,QAAQ,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC,QAAQ,cAAc,CACpI,CAAC;gBACF,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;aAClC;SACF;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF"}
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import { ComponentSet } from '@salesforce/source-deploy-retrieve';
|
2
|
+
import { SfProject } from '@salesforce/core';
|
2
3
|
import Debug from 'debug';
|
4
|
+
import { CallbackFsClient, PromiseFsClient } from '../utils/git-extra.js';
|
3
5
|
export declare const debug: Debug.Debugger;
|
4
6
|
/**
|
5
7
|
* Resolver for metadata type and component objects from a git diff result
|
@@ -7,12 +9,18 @@ export declare const debug: Debug.Debugger;
|
|
7
9
|
* @internal
|
8
10
|
*/
|
9
11
|
export declare class GitDiffResolver {
|
10
|
-
private
|
12
|
+
private fs;
|
11
13
|
private ref2VirtualTreeContainer;
|
12
14
|
private ref1Resolver;
|
13
15
|
private ref2Resolver;
|
14
|
-
private
|
16
|
+
private dir;
|
17
|
+
private uniquePackageDirectories;
|
18
|
+
/**
|
19
|
+
* @param dir SFDX project directory
|
20
|
+
*/
|
21
|
+
constructor(project: SfProject, fs: CallbackFsClient | PromiseFsClient);
|
15
22
|
resolve(ref1: string, ref2: string, fsPaths: string[]): Promise<ComponentSet>;
|
23
|
+
private getFileStatus;
|
16
24
|
private getComponentSet;
|
17
25
|
private getChildComponentStatus;
|
18
26
|
}
|
@@ -6,13 +6,11 @@
|
|
6
6
|
*/
|
7
7
|
import path from 'path';
|
8
8
|
import { ComponentSet, RegistryAccess, MetadataResolver, SourceComponent, DestructiveChangesType, } from '@salesforce/source-deploy-retrieve';
|
9
|
-
import {
|
10
|
-
import fs from 'fs-extra';
|
11
|
-
import { parseMetadataXml } from '@salesforce/source-deploy-retrieve/lib/src/utils/index.js';
|
9
|
+
import { SfError } from '@salesforce/core';
|
12
10
|
import equal from 'fast-deep-equal';
|
13
11
|
import Debug from 'debug';
|
14
|
-
import { resolveMultiRefString, resolveSingleRefString, getFileState, getStatus } from '../utils/git-extra.js';
|
15
|
-
import { VirtualTreeContainerExtra } from './treeContainersExtra.js';
|
12
|
+
import { resolveMultiRefString, resolveSingleRefString, getFileState, getStatus, } from '../utils/git-extra.js';
|
13
|
+
import { VirtualTreeContainerExtra, parseMetadataXml } from './treeContainersExtra.js';
|
16
14
|
export const debug = Debug('sf:gitDiff:resolver');
|
17
15
|
const registryAccess = new RegistryAccess();
|
18
16
|
/**
|
@@ -21,103 +19,108 @@ const registryAccess = new RegistryAccess();
|
|
21
19
|
* @internal
|
22
20
|
*/
|
23
21
|
export class GitDiffResolver {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
files = files.filter((l) => resolveSourcePaths.some((f) => l.path.startsWith(f)));
|
32
|
-
}
|
33
|
-
files = files.filter((file) => {
|
34
|
-
if (file.status === 'D') {
|
35
|
-
for (const sourcePath of resolveSourcePaths) {
|
36
|
-
const defaultFolder = path.join(sourcePath, 'main', 'default');
|
37
|
-
const filePath = file.path.replace(file.path.startsWith(defaultFolder) ? defaultFolder : sourcePath, '');
|
38
|
-
const target = files.find((t) => t.path.endsWith(filePath) && t.status === 'A');
|
39
|
-
if (target) {
|
40
|
-
return false;
|
41
|
-
}
|
42
|
-
}
|
43
|
-
}
|
44
|
-
return true;
|
45
|
-
});
|
46
|
-
return files;
|
22
|
+
/**
|
23
|
+
* @param dir SFDX project directory
|
24
|
+
*/
|
25
|
+
constructor(project, fs) {
|
26
|
+
this.fs = fs;
|
27
|
+
this.dir = project.getPath();
|
28
|
+
this.uniquePackageDirectories = project.getUniquePackageDirectories().map((pDir) => pDir.fullPath);
|
47
29
|
}
|
48
30
|
async resolve(ref1, ref2, fsPaths) {
|
49
|
-
const proj = await SfProject.resolve();
|
50
31
|
if (ref2 === undefined) {
|
51
|
-
const { ref1: r1, ref2: r2 } = await resolveMultiRefString({ ref: ref1, dir:
|
32
|
+
const { ref1: r1, ref2: r2 } = await resolveMultiRefString({ ref: ref1, dir: this.dir, fs: this.fs });
|
52
33
|
ref1 = r1;
|
53
34
|
ref2 = r2;
|
54
35
|
}
|
55
36
|
else {
|
56
37
|
const [r1, r2] = await Promise.all([
|
57
|
-
resolveSingleRefString({ ref: ref1, dir:
|
58
|
-
resolveSingleRefString({ ref: ref2, dir:
|
38
|
+
resolveSingleRefString({ ref: ref1, dir: this.dir, fs: this.fs }),
|
39
|
+
resolveSingleRefString({ ref: ref2, dir: this.dir, fs: this.fs }),
|
59
40
|
]);
|
60
41
|
ref1 = r1;
|
61
42
|
ref2 = r2;
|
62
43
|
}
|
63
44
|
debug({ ref1, ref2 });
|
64
|
-
const fileStatus = await
|
45
|
+
const fileStatus = await this.getFileStatus(ref1, ref2);
|
65
46
|
debug({ fileStatus });
|
66
47
|
const [ref1VirtualTreeContainer, ref2VirtualTreeContainer] = await Promise.all([
|
67
|
-
VirtualTreeContainerExtra.fromGitRef(ref1,
|
68
|
-
VirtualTreeContainerExtra.fromGitRef(ref2,
|
48
|
+
VirtualTreeContainerExtra.fromGitRef(ref1, this.dir, fileStatus.filter((l) => l.status === 'M').map((l) => l.path)),
|
49
|
+
VirtualTreeContainerExtra.fromGitRef(ref2, this.dir, fileStatus.filter((l) => l.status === 'M').map((l) => l.path)),
|
69
50
|
]);
|
70
|
-
|
51
|
+
if (fsPaths) {
|
52
|
+
fsPaths.map((filepath) => {
|
53
|
+
filepath = path.resolve(filepath);
|
54
|
+
if (!ref1VirtualTreeContainer.exists(filepath) && !ref2VirtualTreeContainer.exists(filepath)) {
|
55
|
+
throw new SfError(`The sourcepath "${filepath}" is not a valid source file path.`);
|
56
|
+
}
|
57
|
+
});
|
58
|
+
}
|
71
59
|
this.ref2VirtualTreeContainer = ref2VirtualTreeContainer;
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
60
|
+
this.ref1Resolver = new MetadataResolver(registryAccess, ref1VirtualTreeContainer);
|
61
|
+
this.ref2Resolver = new MetadataResolver(registryAccess, this.ref2VirtualTreeContainer);
|
62
|
+
return this.getComponentSet(fileStatus);
|
63
|
+
}
|
64
|
+
async getFileStatus(ref1, ref2) {
|
65
|
+
let files;
|
66
|
+
if (ref2) {
|
67
|
+
files = await getFileState({ ref1, ref2, dir: this.dir, fs: this.fs });
|
68
|
+
}
|
69
|
+
else {
|
70
|
+
files = await getStatus({ dir: this.dir, ref: ref1, fs: this.fs });
|
71
|
+
}
|
72
|
+
files = files.filter((file) => {
|
73
|
+
if (file.status === 'D') {
|
74
|
+
for (const sourcePath of this.uniquePackageDirectories) {
|
75
|
+
const defaultFolder = path.join(sourcePath, 'main', 'default');
|
76
|
+
const filePath = file.path.replace(file.path.startsWith(defaultFolder) ? defaultFolder : sourcePath, '');
|
77
|
+
const target = files.find((t) => t.path.endsWith(filePath) && t.status === 'A');
|
78
|
+
// debug({ target, file, sourcePath, filePath });
|
79
|
+
if (target) {
|
80
|
+
return false;
|
81
|
+
}
|
82
|
+
}
|
76
83
|
}
|
77
|
-
return
|
84
|
+
return true;
|
78
85
|
});
|
79
|
-
|
80
|
-
this.ref1Resolver = new MetadataResolver(registryAccess, this.ref1VirtualTreeContainer);
|
81
|
-
this.ref2Resolver = new MetadataResolver(registryAccess, this.ref2VirtualTreeContainer);
|
82
|
-
return this.getComponentSet(fileStatus, fsPaths);
|
86
|
+
return files;
|
83
87
|
}
|
84
|
-
async getComponentSet(gitLines
|
88
|
+
async getComponentSet(gitLines) {
|
85
89
|
const results = new ComponentSet(undefined, registryAccess);
|
86
90
|
const childComponentPromises = [];
|
87
91
|
for (const [, { status, path: fpath }] of gitLines.entries()) {
|
88
|
-
if (
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
}
|
103
|
-
catch (e) {
|
104
|
-
debug(`unable to find component at ${c.content}. That's ok if it was supposed to be deleted`);
|
105
|
-
}
|
92
|
+
if (status === 'D') {
|
93
|
+
for (const c of this.ref1Resolver.getComponentsFromPath(fpath)) {
|
94
|
+
// if the component supports partial delete AND there are files that are not deleted,
|
95
|
+
// set the component for deploy, not for delete.
|
96
|
+
// https://github.com/forcedotcom/source-tracking/blob/5cb32bef2e5860c0f8fc2afa3ea65432fe511a99/src/shared/localComponentSetArray.ts#L81
|
97
|
+
if (!!c.type.supportsPartialDelete && c.content && this.ref2VirtualTreeContainer.exists(c.content)) {
|
98
|
+
// all bundle types have a directory name
|
99
|
+
try {
|
100
|
+
this.ref2Resolver
|
101
|
+
.getComponentsFromPath(path.resolve(c.content))
|
102
|
+
.filter((input) => input instanceof SourceComponent)
|
103
|
+
.map((nonDeletedComponent) => {
|
104
|
+
results.add(nonDeletedComponent);
|
105
|
+
});
|
106
106
|
}
|
107
|
-
|
108
|
-
|
107
|
+
catch (e) {
|
108
|
+
debug(`unable to find component at ${c.content}. That's ok if it was supposed to be deleted`);
|
109
109
|
}
|
110
110
|
}
|
111
|
-
|
112
|
-
|
113
|
-
for (const c of this.ref2Resolver.getComponentsFromPath(fpath)) {
|
114
|
-
results.add(c);
|
111
|
+
else {
|
112
|
+
results.add(c, DestructiveChangesType.POST);
|
115
113
|
}
|
116
114
|
}
|
117
|
-
|
118
|
-
|
115
|
+
}
|
116
|
+
else if (status === 'A') {
|
117
|
+
for (const c of this.ref2Resolver.getComponentsFromPath(fpath)) {
|
118
|
+
results.add(c);
|
119
119
|
}
|
120
120
|
}
|
121
|
+
else {
|
122
|
+
childComponentPromises.push(this.getChildComponentStatus(fpath));
|
123
|
+
}
|
121
124
|
}
|
122
125
|
for await (const check of childComponentPromises) {
|
123
126
|
if (check.status === 0) {
|
@@ -128,6 +131,9 @@ export class GitDiffResolver {
|
|
128
131
|
else if (check.status === -1) {
|
129
132
|
// unchanged file
|
130
133
|
}
|
134
|
+
else if (check.status === -2) {
|
135
|
+
// forceignored file
|
136
|
+
}
|
131
137
|
else {
|
132
138
|
for (const c of check.toDestructiveChanges) {
|
133
139
|
results.add(c, DestructiveChangesType.POST);
|
@@ -138,10 +144,7 @@ export class GitDiffResolver {
|
|
138
144
|
}
|
139
145
|
}
|
140
146
|
debug({
|
141
|
-
forceIgnoredPaths:
|
142
|
-
ref1: Array.from(this.ref1Resolver.forceIgnoredPaths),
|
143
|
-
ref2: Array.from(this.ref2Resolver.forceIgnoredPaths),
|
144
|
-
},
|
147
|
+
forceIgnoredPaths: Array.from(new Set([...this.ref1Resolver.forceIgnoredPaths, ...this.ref2Resolver.forceIgnoredPaths])),
|
145
148
|
});
|
146
149
|
return results;
|
147
150
|
}
|
@@ -151,6 +154,9 @@ export class GitDiffResolver {
|
|
151
154
|
}
|
152
155
|
const [ref2Component] = this.ref2Resolver.getComponentsFromPath(fpath); // git path only conaints files
|
153
156
|
const [ref1Component] = this.ref1Resolver.getComponentsFromPath(fpath); // git path only conaints files
|
157
|
+
if (this.ref1Resolver.forceIgnoredPaths.has(fpath) || this.ref2Resolver.forceIgnoredPaths.has(fpath)) {
|
158
|
+
return { path: fpath, status: -2 };
|
159
|
+
}
|
154
160
|
if (equal(await ref1Component.parseXml(), await ref2Component.parseXml())) {
|
155
161
|
return { path: fpath, status: -1 };
|
156
162
|
}
|
@@ -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,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,YAAY,EACZ,SAAS,GAGV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEvF,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,qBAAqB,CAAC,CAAC;AAElD,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC;AAE5C;;;;GAIG;AACH,MAAM,OAAO,eAAe;IAO1B;;OAEG;IACH,YAAmB,OAAkB,EAAU,EAAsC;QAAtC,OAAE,GAAF,EAAE,CAAoC;QACnF,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,wBAAwB,GAAG,OAAO,CAAC,2BAA2B,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrG,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,IAAY,EA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AAC,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,sBAAsB,CAAC,QAAQ,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ;QAC9G,MAAM,4BAA4B,GAAG,aAAa;aAC/C,WAAW,EAAE;aACb,MAAM,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,sBAAsB,CAAC,QAAQ,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY;QAEjH,IAAI,KAAK,EAAE,MAAM,kBAAkB,IAAI,4BAA4B,EAAE;YACnE,MAAM,CAAC,kBAAkB,CAAC,GAAG,aAAa;iBACvC,WAAW,EAAE;iBACb,MAAM,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,KAAK,mBAAmB,CAAC,cAAc,CAAC,CAAC,CAAC;YAC/G,IAAI,CAAC,KAAK,CAAC,MAAM,kBAAkB,CAAC,QAAQ,EAAE,EAAE,MAAM,kBAAkB,CAAC,QAAQ,EAAE,CAAC,EAAE;gBACpF,wBAAwB,CAAC,IAAI,CAAC,kBAAkB,CAAC,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"}
|
@@ -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,6 +9,7 @@ import { VirtualTreeContainer } from '@salesforce/source-deploy-retrieve';
|
|
9
9
|
import { parseMetadataXml } from '@salesforce/source-deploy-retrieve/lib/src/utils/index.js';
|
10
10
|
import fs from 'fs-extra';
|
11
11
|
import { listFullPathFiles, getOid, readBlobAsBuffer } from '../utils/git-extra.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
|
@@ -20,8 +21,8 @@ export class VirtualTreeContainerExtra extends VirtualTreeContainer {
|
|
20
21
|
* @returns VirtualTreeContainer
|
21
22
|
*/
|
22
23
|
static async fromGitRef(ref, dir, includeBufferForFiles) {
|
23
|
-
const paths = await listFullPathFiles(dir, ref);
|
24
|
-
const oid = await getOid(dir, ref);
|
24
|
+
const paths = await listFullPathFiles({ dir, ref, fs });
|
25
|
+
const oid = await getOid({ dir, ref, fs });
|
25
26
|
const virtualDirectoryByFullPath = new Map();
|
26
27
|
for await (const filename of paths) {
|
27
28
|
let dirPath = path.dirname(filename);
|
@@ -31,7 +32,7 @@ export class VirtualTreeContainerExtra extends VirtualTreeContainer {
|
|
31
32
|
name: path.basename(filename),
|
32
33
|
data: parseMetadataXml(filename) && includeBufferForFiles.includes(filename)
|
33
34
|
? oid
|
34
|
-
? await readBlobAsBuffer(dir, oid, filename)
|
35
|
+
? await readBlobAsBuffer({ dir, oid, filename, fs })
|
35
36
|
: await fs.readFile(filename)
|
36
37
|
: Buffer.from(''),
|
37
38
|
})),
|
@@ -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;AACxB,OAAO,EAAE,oBAAoB,EAAoB,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;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AC,CAAC,CAAC;iBAC1G,CAAC,CAAC;aACJ;SACF;QACD,OAAO,IAAI,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACnF,CAAC;CACF"}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
2
2
|
import { CallbackFsClient, PromiseFsClient } from 'isomorphic-git';
|
3
|
-
|
4
|
-
|
5
|
-
export interface GetCommitLogOptions {
|
3
|
+
export { CallbackFsClient, PromiseFsClient } from 'isomorphic-git';
|
4
|
+
interface RefOptions {
|
6
5
|
/**
|
7
6
|
* File paths or directory paths to resolve components against
|
8
7
|
*/
|
@@ -16,29 +15,20 @@ export interface GetCommitLogOptions {
|
|
16
15
|
*/
|
17
16
|
fs: CallbackFsClient | PromiseFsClient;
|
18
17
|
}
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
* File paths or directory paths to resolve components against
|
26
|
-
*/
|
27
|
-
dir: string;
|
18
|
+
export declare function resolveMultiRefString(options: RefOptions): Promise<{
|
19
|
+
ref1: string;
|
20
|
+
ref2: string;
|
21
|
+
}>;
|
22
|
+
export declare function resolveSingleRefString(options: RefOptions): Promise<string>;
|
23
|
+
interface FileStateOptions {
|
28
24
|
/**
|
29
25
|
* File paths or directory paths to resolve components against
|
30
26
|
*/
|
31
|
-
fs: CallbackFsClient | PromiseFsClient;
|
32
|
-
}
|
33
|
-
export declare function resolveMultiRefString(options: MultiRefStringOptions): Promise<{
|
34
27
|
ref1: string;
|
35
|
-
ref2: string;
|
36
|
-
}>;
|
37
|
-
interface SingleRefStringOptions {
|
38
28
|
/**
|
39
29
|
* File paths or directory paths to resolve components against
|
40
30
|
*/
|
41
|
-
|
31
|
+
ref2: string;
|
42
32
|
/**
|
43
33
|
* File paths or directory paths to resolve components against
|
44
34
|
*/
|
@@ -48,18 +38,34 @@ interface SingleRefStringOptions {
|
|
48
38
|
*/
|
49
39
|
fs: CallbackFsClient | PromiseFsClient;
|
50
40
|
}
|
51
|
-
export declare function
|
52
|
-
export declare function getFileState(commitHash1: string, commitHash2: string, dir: string): Promise<[
|
41
|
+
export declare function getFileState(options: FileStateOptions): Promise<[
|
53
42
|
{
|
54
43
|
path: string;
|
55
44
|
status: string;
|
56
45
|
}
|
57
46
|
]>;
|
58
|
-
export declare function getStatus(
|
47
|
+
export declare function getStatus(options: RefOptions): Promise<Array<{
|
59
48
|
path: string;
|
60
49
|
status: string;
|
61
50
|
}>>;
|
62
|
-
export declare function listFullPathFiles(
|
63
|
-
export declare function getOid(
|
64
|
-
|
65
|
-
|
51
|
+
export declare function listFullPathFiles(options: RefOptions): Promise<string[]>;
|
52
|
+
export declare function getOid(options: RefOptions): Promise<string>;
|
53
|
+
interface BlobOptions {
|
54
|
+
/**
|
55
|
+
* File paths or directory paths to resolve components against
|
56
|
+
*/
|
57
|
+
oid: string;
|
58
|
+
/**
|
59
|
+
* File paths or directory paths to resolve components against
|
60
|
+
*/
|
61
|
+
filename: string;
|
62
|
+
/**
|
63
|
+
* File paths or directory paths to resolve components against
|
64
|
+
*/
|
65
|
+
dir: string;
|
66
|
+
/**
|
67
|
+
* File paths or directory paths to resolve components against
|
68
|
+
*/
|
69
|
+
fs: CallbackFsClient | PromiseFsClient;
|
70
|
+
}
|
71
|
+
export declare function readBlobAsBuffer(options: BlobOptions): Promise<Buffer>;
|