@salesforce/source-tracking 0.4.2 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +94 -57
- package/LICENSE.txt +1 -1
- package/lib/shared/functions.d.ts +2 -0
- package/lib/shared/functions.js +3 -1
- package/lib/shared/guards.d.ts +2 -2
- package/lib/shared/guards.js +5 -5
- package/lib/shared/localShadowRepo.js +8 -2
- package/lib/sourceTracking.d.ts +9 -2
- package/lib/sourceTracking.js +129 -50
- package/package.json +12 -46
- package/lib/shared/filenamesToVirtualTree.d.ts +0 -10
- package/lib/shared/filenamesToVirtualTree.js +0 -39
package/CHANGELOG.md
CHANGED
|
@@ -2,77 +2,114 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.5.1](https://github.com/forcedotcom/source-tracking/compare/v0.5.0...v0.5.1) (2021-12-03)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- support addressable child types ([8251095](https://github.com/forcedotcom/source-tracking/commit/82510955ba8ffe4a2e7e5411973795da3671d01e))
|
|
10
|
+
|
|
11
|
+
## [0.5.0](https://github.com/forcedotcom/source-tracking/compare/v0.4.4...v0.5.0) (2021-12-02)
|
|
12
|
+
|
|
13
|
+
### ⚠ BREAKING CHANGES
|
|
14
|
+
|
|
15
|
+
- mpd suport (array of componentSets for localChanges)
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
- delete bundle member but not the bundle ([fbb81f2](https://github.com/forcedotcom/source-tracking/commit/fbb81f25af4cb9e81e3bbee93a08b072318eca10))
|
|
20
|
+
- delete bundle members instead of bundle ([0aedbd5](https://github.com/forcedotcom/source-tracking/commit/0aedbd56b3bf34ce9e344ec03bb258c9db2098aa))
|
|
21
|
+
- mpd suport (array of componentSets for localChanges) ([dd072bb](https://github.com/forcedotcom/source-tracking/commit/dd072bb86450a2e071dca3aece3cba6a2339b05a))
|
|
22
|
+
- trackingFiles handle deleted bundle members ([137cd39](https://github.com/forcedotcom/source-tracking/commit/137cd391f0ea8ae60b3351d7b3361ae97b890d45))
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
- deploy by pkgDir groupings, not all ([7f1262e](https://github.com/forcedotcom/source-tracking/commit/7f1262e1d05a57d3094849d052376b13dd7a5ec7))
|
|
27
|
+
- windows paths when pkgDir path has separators in it ([b0ab346](https://github.com/forcedotcom/source-tracking/commit/b0ab3468d9c54722f832fb7d27a84525d593d4f7))
|
|
28
|
+
|
|
29
|
+
### [0.4.4](https://github.com/forcedotcom/source-tracking/compare/v0.4.3...v0.4.4) (2021-12-01)
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
- update version of core and sdr ([977ab56](https://github.com/forcedotcom/source-tracking/commit/977ab56deb9fa610cb21b26bfef6d30a1f9f8f58))
|
|
34
|
+
|
|
35
|
+
### [0.4.3](https://github.com/forcedotcom/source-tracking/compare/v0.4.2...v0.4.3) (2021-11-11)
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
- emit warnings for types not pulled ([fdeabbf](https://github.com/forcedotcom/source-tracking/commit/fdeabbfb11bb4ba1fd17931adedc49f9cb5ae658))
|
|
40
|
+
|
|
41
|
+
### Bug Fixes
|
|
42
|
+
|
|
43
|
+
- don't pull remote changes where type isn't in SDR registry ([46250ee](https://github.com/forcedotcom/source-tracking/commit/46250eef09e29dfa0d06af984bbfcc3e88765968))
|
|
44
|
+
- don't pull things not in the registry ([38136bb](https://github.com/forcedotcom/source-tracking/commit/38136bbbf1e44c8e58bc06621957819913273b4e))
|
|
45
|
+
|
|
5
46
|
### [0.4.2](https://github.com/forcedotcom/source-tracking/compare/v0.4.1...v0.4.2) (2021-10-28)
|
|
6
47
|
|
|
7
48
|
### [0.4.1](https://github.com/forcedotcom/source-tracking/compare/v0.4.0...v0.4.1) (2021-10-28)
|
|
8
49
|
|
|
9
|
-
|
|
10
50
|
### Bug Fixes
|
|
11
51
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
52
|
+
- better conflict handling (can match filenames or type/name) ([4441a0a](https://github.com/forcedotcom/source-tracking/commit/4441a0abd70c7f8f315e1c638b4cef7fcf3e2e68))
|
|
53
|
+
- gitignore stashing location ([5145545](https://github.com/forcedotcom/source-tracking/commit/5145545eeee6c800986014327479d20e943143e5))
|
|
54
|
+
- polling exclusion logic for aura meta.xml was wrong ([2d40b2e](https://github.com/forcedotcom/source-tracking/commit/2d40b2ef65ef9a3145d0c75cd4943e4325d5745c))
|
|
15
55
|
|
|
16
56
|
## 0.4.0 (2021-10-22)
|
|
17
57
|
|
|
18
|
-
|
|
19
58
|
### ⚠ BREAKING CHANGES
|
|
20
59
|
|
|
21
|
-
|
|
60
|
+
- remove retrieve simplifier
|
|
22
61
|
|
|
23
62
|
### Features
|
|
24
63
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
64
|
+
- add commitlint and sample circleci config ([43e7fa4](https://github.com/forcedotcom/source-tracking/commit/43e7fa4a44dbcb9da37d21618678687f4edda644))
|
|
65
|
+
- add new tests and upadte readme ([6a7ad54](https://github.com/forcedotcom/source-tracking/commit/6a7ad542f42ce75275ebacc78d50ee4dc0ab6f32))
|
|
66
|
+
- add option to get remoteChanges with filePaths, use for Conflicts ([350a0d6](https://github.com/forcedotcom/source-tracking/commit/350a0d60599cfce2c432c223f4523c25a4f53c81))
|
|
67
|
+
- basic using isogit ([f39e6c5](https://github.com/forcedotcom/source-tracking/commit/f39e6c5e305fcb2fdb6a27b343d9dc20800202c9))
|
|
68
|
+
- conflict detection ([3e22774](https://github.com/forcedotcom/source-tracking/commit/3e22774d8949a1aa4302e62d8580b69c4b35aab5))
|
|
69
|
+
- consolidate conflict handling, return data in error ([45178c7](https://github.com/forcedotcom/source-tracking/commit/45178c7b13ed61e657f9a07ea5b40f49f73f651a))
|
|
70
|
+
- delete handling public for pull ([eb87eb7](https://github.com/forcedotcom/source-tracking/commit/eb87eb7dfa81ba5256735af7f2b8bc29dfb1e16b))
|
|
71
|
+
- finish status, add clear/reset ([c71e66f](https://github.com/forcedotcom/source-tracking/commit/c71e66f7f7a3dc20d2c965349b5e01e15edabf36))
|
|
72
|
+
- handle status ignore marking from STL ([2ec6fad](https://github.com/forcedotcom/source-tracking/commit/2ec6fad4b4f4f2e124da7e4f53cf8e534354d342))
|
|
73
|
+
- ignorewarnings flag for push ([b13fd05](https://github.com/forcedotcom/source-tracking/commit/b13fd0534930fb063075c39e6f75ea46ab9d3be8))
|
|
74
|
+
- migrate messages/descriptions ([8fea6e5](https://github.com/forcedotcom/source-tracking/commit/8fea6e5242c50865dd635412d7592164ab57fec4))
|
|
75
|
+
- most of sourceStatus logic, code cleanup ([f100cb8](https://github.com/forcedotcom/source-tracking/commit/f100cb83f220b3724284ae69301712a08b14376d))
|
|
76
|
+
- non-delete push works ([487a20e](https://github.com/forcedotcom/source-tracking/commit/487a20e48c428a02ef315b58db24b714d2de0416))
|
|
77
|
+
- push supporting bundle types ([639d459](https://github.com/forcedotcom/source-tracking/commit/639d459101cd4990fa217f657b99d64517611383))
|
|
78
|
+
- remote and conflicts ([f98ecf1](https://github.com/forcedotcom/source-tracking/commit/f98ecf17fc6cbe386d8edae6994500388b7e0ed6))
|
|
79
|
+
- remote tracknig with UT ([cb805e5](https://github.com/forcedotcom/source-tracking/commit/cb805e5745020be9a266a261f584979713e4b351))
|
|
80
|
+
- source tracking from toolbelt ([6c2ebb4](https://github.com/forcedotcom/source-tracking/commit/6c2ebb444ce5518eaa81402b685fe00f1090e437))
|
|
81
|
+
- sourcemember polling like toolbelt ([abdd7b3](https://github.com/forcedotcom/source-tracking/commit/abdd7b3ad275ea4739673a6e1b1a99853f1de2da))
|
|
82
|
+
- spinners while waiting on pull ([dfe5aea](https://github.com/forcedotcom/source-tracking/commit/dfe5aeae0a5f9a30eddfe96852e0dab025972e1e))
|
|
83
|
+
- status result sorting ([b7b109c](https://github.com/forcedotcom/source-tracking/commit/b7b109cf3e7bcad60507618099873c717ff31f61))
|
|
84
|
+
- sync customObj when their fields sync ([3ded96d](https://github.com/forcedotcom/source-tracking/commit/3ded96dbd7a7ea45cb8f97719b98bae294905c05))
|
|
85
|
+
- throws if "old" source files are present ([4b868d8](https://github.com/forcedotcom/source-tracking/commit/4b868d8232769eec5e227052bf823a35baedd288))
|
|
86
|
+
- typed push ([6e76812](https://github.com/forcedotcom/source-tracking/commit/6e7681263b81d3b692d002a3ce5deb8ef00bbd13))
|
|
87
|
+
- virtualTree for deletes ([b425d77](https://github.com/forcedotcom/source-tracking/commit/b425d77b4fca5c6fbab2faab7490e3516bf3f547))
|
|
50
88
|
|
|
51
89
|
### Bug Fixes
|
|
52
90
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
* remove retrieve simplifier ([bd71eef](https://github.com/forcedotcom/source-tracking/commit/bd71eef784bc7c7efd1999ba11193e632aef3d47))
|
|
91
|
+
- again with the promises ([ad9dec5](https://github.com/forcedotcom/source-tracking/commit/ad9dec50336c61996456d48ee489426393c62329))
|
|
92
|
+
- another attempt at node12 support ([c8736d0](https://github.com/forcedotcom/source-tracking/commit/c8736d0bbe53756d1b5572e00402e55af94003c1))
|
|
93
|
+
- case of empty orgId dir ([1cb6333](https://github.com/forcedotcom/source-tracking/commit/1cb6333d14cfcee02b27711b6db273d5db31fc8e))
|
|
94
|
+
- case on formatter filename ([02adf22](https://github.com/forcedotcom/source-tracking/commit/02adf22419d2bf81fb070d7d7d90f7d996bd1ada))
|
|
95
|
+
- casing on imports ([d4425d9](https://github.com/forcedotcom/source-tracking/commit/d4425d9ee2ad77c4e28d32333025e59a3c7e3af9))
|
|
96
|
+
- correct statusCommand description ([b834a2f](https://github.com/forcedotcom/source-tracking/commit/b834a2fa0213fbc72dbc6dc3a563cd92f413d222))
|
|
97
|
+
- don't commit empty changelists ([67b9772](https://github.com/forcedotcom/source-tracking/commit/67b9772eccd6d2d4850322eb80f5a6113aac18e6))
|
|
98
|
+
- export compatibility ([c6e5f7c](https://github.com/forcedotcom/source-tracking/commit/c6e5f7cba68ed6a7739b237adb027fda2442e8c4))
|
|
99
|
+
- fix vscode image in readme ([441c15f](https://github.com/forcedotcom/source-tracking/commit/441c15f79dbaf4a97c84d9d6ddc923eae59bca34))
|
|
100
|
+
- handle org:create's single tracking file ([008793d](https://github.com/forcedotcom/source-tracking/commit/008793d0fa15210ffb263cc5d179a0be8dcb05ff))
|
|
101
|
+
- handle stash failures ([09dacc9](https://github.com/forcedotcom/source-tracking/commit/09dacc9484e48f3cba4813f3d733c66d2a30cd6b))
|
|
102
|
+
- leif .yml merge [skip-validate-pr] ([ff10f84](https://github.com/forcedotcom/source-tracking/commit/ff10f84ec15757df55657ba73cc6976c5892595c))
|
|
103
|
+
- local ST uses graceful via core2 ([3ba883f](https://github.com/forcedotcom/source-tracking/commit/3ba883ff2b02e27b0eb01a709f6c1e03ef91bb73))
|
|
104
|
+
- match server subfiles with forward slash ([c2489a6](https://github.com/forcedotcom/source-tracking/commit/c2489a62c244a64fe0938e0eecdc087f4529b5ad))
|
|
105
|
+
- normalize windows paths on commit, too ([4339e46](https://github.com/forcedotcom/source-tracking/commit/4339e46a1cb9cbeb4cc652572e340b60e3b5bc68))
|
|
106
|
+
- one more fs/promises fixed for node12 ([71bafcf](https://github.com/forcedotcom/source-tracking/commit/71bafcf7738e60d8b86150199ef8d0687167a010))
|
|
107
|
+
- path normalizing for metadata keys ([6190590](https://github.com/forcedotcom/source-tracking/commit/6190590df2c2e7cc9a25eab0fa8891e3b8df9057))
|
|
108
|
+
- path normalizing from iso-git ([b8cddaf](https://github.com/forcedotcom/source-tracking/commit/b8cddaf40930bedd18f3edec578a030220454627))
|
|
109
|
+
- status output on windows uses backslash ([78ac398](https://github.com/forcedotcom/source-tracking/commit/78ac3988d3d04e956f17f35c67de4d1144062fcb))
|
|
110
|
+
- support windows path on commits with \\ ([5712af4](https://github.com/forcedotcom/source-tracking/commit/5712af4447ee03e30d7a5a769fc5ba58f6913552))
|
|
111
|
+
- there could be nested LWC templates ([d833981](https://github.com/forcedotcom/source-tracking/commit/d8339810bf76c0ab75824faee7aef59ff9a2d89e))
|
|
112
|
+
- turns bundle parts of SourceMembers into real MDtypes ([5646042](https://github.com/forcedotcom/source-tracking/commit/564604269be7d56499963699b51920b81227297f))
|
|
113
|
+
- use correct var name ([0708312](https://github.com/forcedotcom/source-tracking/commit/0708312c5b4f11cb94539416d0a10b5432850310))
|
|
114
|
+
|
|
115
|
+
- remove retrieve simplifier ([bd71eef](https://github.com/forcedotcom/source-tracking/commit/bd71eef784bc7c7efd1999ba11193e632aef3d47))
|
package/LICENSE.txt
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { SourceComponent } from '@salesforce/source-deploy-retrieve';
|
|
1
2
|
import { RemoteChangeElement, ChangeResult } from './types';
|
|
2
3
|
export declare const getMetadataKey: (metadataType: string, metadataName: string) => string;
|
|
3
4
|
export declare const getKeyFromObject: (element: RemoteChangeElement | ChangeResult) => string;
|
|
5
|
+
export declare const isBundle: (cmp: SourceComponent) => boolean;
|
package/lib/shared/functions.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.getKeyFromObject = exports.getMetadataKey = void 0;
|
|
9
|
+
exports.isBundle = exports.getKeyFromObject = exports.getMetadataKey = void 0;
|
|
10
10
|
const getMetadataKey = (metadataType, metadataName) => {
|
|
11
11
|
return `${metadataType}__${metadataName}`;
|
|
12
12
|
};
|
|
@@ -18,4 +18,6 @@ const getKeyFromObject = (element) => {
|
|
|
18
18
|
throw new Error(`unable to complete key from ${JSON.stringify(element)}`);
|
|
19
19
|
};
|
|
20
20
|
exports.getKeyFromObject = getKeyFromObject;
|
|
21
|
+
const isBundle = (cmp) => { var _a; return ((_a = cmp.type.strategies) === null || _a === void 0 ? void 0 : _a.adapter) === 'bundle'; };
|
|
22
|
+
exports.isBundle = isBundle;
|
|
21
23
|
//# sourceMappingURL=functions.js.map
|
package/lib/shared/guards.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SourceComponent } from '@salesforce/source-deploy-retrieve';
|
|
2
|
-
export declare const stringGuard: (input: string | undefined) => input is string;
|
|
1
|
+
import { SourceComponent, MetadataMember } from '@salesforce/source-deploy-retrieve';
|
|
3
2
|
export declare const sourceComponentGuard: (input: SourceComponent | undefined) => input is SourceComponent;
|
|
3
|
+
export declare const metadataMemberGuard: (input: MetadataMember | undefined) => input is MetadataMember;
|
package/lib/shared/guards.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.metadataMemberGuard = exports.sourceComponentGuard = void 0;
|
|
4
4
|
/*
|
|
5
5
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
6
6
|
* All rights reserved.
|
|
@@ -8,12 +8,12 @@ exports.sourceComponentGuard = exports.stringGuard = void 0;
|
|
|
8
8
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
9
|
*/
|
|
10
10
|
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
11
|
-
const stringGuard = (input) => {
|
|
12
|
-
return typeof input === 'string';
|
|
13
|
-
};
|
|
14
|
-
exports.stringGuard = stringGuard;
|
|
15
11
|
const sourceComponentGuard = (input) => {
|
|
16
12
|
return input instanceof source_deploy_retrieve_1.SourceComponent;
|
|
17
13
|
};
|
|
18
14
|
exports.sourceComponentGuard = sourceComponentGuard;
|
|
15
|
+
const metadataMemberGuard = (input) => {
|
|
16
|
+
return input !== undefined && typeof input.fullName === 'string' && typeof input.type === 'string';
|
|
17
|
+
};
|
|
18
|
+
exports.metadataMemberGuard = metadataMemberGuard;
|
|
19
19
|
//# sourceMappingURL=guards.js.map
|
|
@@ -81,18 +81,24 @@ class ShadowRepo {
|
|
|
81
81
|
async getStatus(noCache = false) {
|
|
82
82
|
if (!this.status || noCache) {
|
|
83
83
|
try {
|
|
84
|
+
// only ask about OS once but use twice
|
|
85
|
+
const isWindows = os.type() === 'Windows_NT';
|
|
84
86
|
await this.stashIgnoreFile();
|
|
87
|
+
const filepaths = isWindows
|
|
88
|
+
? // iso-git uses posix paths, but packageDirs has already normalized them so we need to convert if windows
|
|
89
|
+
this.packageDirs.map((dir) => dir.path.split(path.sep).join(path.posix.sep))
|
|
90
|
+
: this.packageDirs.map((dir) => dir.path);
|
|
85
91
|
// status hasn't been initalized yet
|
|
86
92
|
this.status = await git.statusMatrix({
|
|
87
93
|
fs: core_1.fs,
|
|
88
94
|
dir: this.projectPath,
|
|
89
95
|
gitdir: this.gitDir,
|
|
90
|
-
filepaths
|
|
96
|
+
filepaths,
|
|
91
97
|
// filter out hidden files and __tests__ patterns, regardless of gitignore
|
|
92
98
|
filter: (f) => !f.includes(`${path.sep}.`) && !f.includes('__tests__'),
|
|
93
99
|
});
|
|
94
100
|
// isomorphic-git stores things in unix-style tree. Convert to windows-style if necessary
|
|
95
|
-
if (
|
|
101
|
+
if (isWindows) {
|
|
96
102
|
this.status = this.status.map((row) => [path.normalize(row[FILE]), row[HEAD], row[WORKDIR], row[3]]);
|
|
97
103
|
}
|
|
98
104
|
}
|
package/lib/sourceTracking.d.ts
CHANGED
|
@@ -21,12 +21,18 @@ export declare class SourceTracking extends AsyncCreatable {
|
|
|
21
21
|
private packagesDirs;
|
|
22
22
|
private username;
|
|
23
23
|
private logger;
|
|
24
|
+
private registry;
|
|
24
25
|
private localRepo;
|
|
25
26
|
private remoteSourceTrackingService;
|
|
26
27
|
private forceIgnore;
|
|
27
28
|
constructor(options: SourceTrackingOptions);
|
|
28
29
|
init(): Promise<void>;
|
|
29
|
-
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param byPackageDir if true, returns one ComponentSet for each packageDir with changes
|
|
33
|
+
* @returns ComponentSet[]
|
|
34
|
+
*/
|
|
35
|
+
localChangesAsComponentSet(byPackageDir?: boolean): Promise<ComponentSet[]>;
|
|
30
36
|
/**
|
|
31
37
|
* Does most of the work for the force:source:status command.
|
|
32
38
|
* Outputs need a bit of massage since this aims to provide nice json.
|
|
@@ -101,12 +107,13 @@ export declare class SourceTracking extends AsyncCreatable {
|
|
|
101
107
|
* uses SDR to translate remote metadata records into local file paths (which only typically have the filename).
|
|
102
108
|
*
|
|
103
109
|
* @input elements: ChangeResult[]
|
|
104
|
-
* @input
|
|
110
|
+
* @input excludeUnresolvable: boolean Filter out components where you can't get the name and type (that is, it's probably not a valid source component)
|
|
105
111
|
* @input resolveDeleted: constructs a virtualTree instead of the actual filesystem--useful when the files no longer exist
|
|
106
112
|
* @input useFsForceIgnore: (default behavior) use forceIgnore from the filesystem. If false, uses the base forceIgnore from SDR
|
|
107
113
|
*/
|
|
108
114
|
private populateTypesAndNames;
|
|
109
115
|
private getLocalStatusRows;
|
|
116
|
+
private registrySupportsType;
|
|
110
117
|
/**
|
|
111
118
|
* uses SDR to translate remote metadata records into local file paths
|
|
112
119
|
*/
|
package/lib/sourceTracking.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.SourceTracking = void 0;
|
|
|
8
8
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
9
|
*/
|
|
10
10
|
const fs = require("fs");
|
|
11
|
-
const
|
|
11
|
+
const path_1 = require("path");
|
|
12
12
|
const os_1 = require("os");
|
|
13
13
|
const core_1 = require("@salesforce/core");
|
|
14
14
|
const kit_1 = require("@salesforce/kit");
|
|
@@ -16,7 +16,6 @@ const ts_types_1 = require("@salesforce/ts-types");
|
|
|
16
16
|
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
17
17
|
const remoteSourceTrackingService_1 = require("./shared/remoteSourceTrackingService");
|
|
18
18
|
const localShadowRepo_1 = require("./shared/localShadowRepo");
|
|
19
|
-
const filenamesToVirtualTree_1 = require("./shared/filenamesToVirtualTree");
|
|
20
19
|
const guards_1 = require("./shared/guards");
|
|
21
20
|
const functions_1 = require("./shared/functions");
|
|
22
21
|
/**
|
|
@@ -28,6 +27,7 @@ const functions_1 = require("./shared/functions");
|
|
|
28
27
|
class SourceTracking extends kit_1.AsyncCreatable {
|
|
29
28
|
constructor(options) {
|
|
30
29
|
super(options);
|
|
30
|
+
this.registry = new source_deploy_retrieve_1.RegistryAccess();
|
|
31
31
|
this.orgId = options.org.getOrgId();
|
|
32
32
|
this.username = options.org.getUsername();
|
|
33
33
|
this.projectPath = options.project.getPath();
|
|
@@ -38,43 +38,82 @@ class SourceTracking extends kit_1.AsyncCreatable {
|
|
|
38
38
|
async init() {
|
|
39
39
|
// reserved for future use
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @param byPackageDir if true, returns one ComponentSet for each packageDir with changes
|
|
44
|
+
* @returns ComponentSet[]
|
|
45
|
+
*/
|
|
46
|
+
async localChangesAsComponentSet(byPackageDir = false) {
|
|
47
|
+
var _a;
|
|
42
48
|
const [projectConfig] = await Promise.all([this.project.resolveProjectConfig(), this.ensureLocalTracking()]);
|
|
49
|
+
(_a = this.forceIgnore) !== null && _a !== void 0 ? _a : (this.forceIgnore = source_deploy_retrieve_1.ForceIgnore.findAndCreate(this.project.getDefaultPackage().name));
|
|
43
50
|
const sourceApiVersion = (0, ts_types_1.getString)(projectConfig, 'sourceApiVersion');
|
|
44
|
-
const componentSet = new source_deploy_retrieve_1.ComponentSet();
|
|
45
|
-
if (sourceApiVersion) {
|
|
46
|
-
componentSet.sourceApiVersion = sourceApiVersion;
|
|
47
|
-
}
|
|
48
|
-
const [nonDeletes, deletes] = await Promise.all([
|
|
49
|
-
this.localRepo.getNonDeleteFilenames(),
|
|
50
|
-
this.localRepo.getDeleteFilenames(),
|
|
51
|
-
]);
|
|
52
|
-
if (nonDeletes.length === 0 && deletes.length === 0) {
|
|
53
|
-
this.logger.debug('no local changes found in source tracking files');
|
|
54
|
-
return componentSet;
|
|
55
|
-
}
|
|
56
51
|
// optimistic resolution...some files may not be possible to resolve
|
|
57
52
|
const resolverForNonDeletes = new source_deploy_retrieve_1.MetadataResolver();
|
|
58
53
|
// we need virtual components for the deletes.
|
|
59
54
|
// TODO: could we use the same for the non-deletes?
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
const [allNonDeletes, allDeletes] = (await Promise.all([this.localRepo.getNonDeleteFilenames(), this.localRepo.getDeleteFilenames()]))
|
|
56
|
+
// remove the forceIgnored items early
|
|
57
|
+
.map((group) => group.filter((item) => this.forceIgnore.accepts(item)));
|
|
58
|
+
// it'll be easier to filter filenames and work with smaller component sets than to filter SourceComponents
|
|
59
|
+
const groupings = (byPackageDir
|
|
60
|
+
? this.packagesDirs.map((pkgDir) => ({
|
|
61
|
+
path: pkgDir.name,
|
|
62
|
+
nonDeletes: allNonDeletes.filter((f) => f.startsWith(pkgDir.name)),
|
|
63
|
+
deletes: allDeletes.filter((f) => f.startsWith(pkgDir.name)),
|
|
64
|
+
}))
|
|
65
|
+
: [
|
|
66
|
+
{
|
|
67
|
+
nonDeletes: allNonDeletes,
|
|
68
|
+
deletes: allDeletes,
|
|
69
|
+
path: this.packagesDirs.map((dir) => dir.name).join(';'),
|
|
70
|
+
},
|
|
71
|
+
]).filter((group) => group.deletes.length || group.nonDeletes.length);
|
|
72
|
+
this.logger.debug(`will build array of ${groupings.length} componentSet(s)`);
|
|
73
|
+
return groupings
|
|
74
|
+
.map((grouping) => {
|
|
75
|
+
this.logger.debug(`building componentSet for ${grouping.path} (deletes: ${grouping.deletes.length} nonDeletes: ${grouping.nonDeletes.length})`);
|
|
76
|
+
const componentSet = new source_deploy_retrieve_1.ComponentSet();
|
|
77
|
+
if (sourceApiVersion) {
|
|
78
|
+
componentSet.sourceApiVersion = sourceApiVersion;
|
|
69
79
|
}
|
|
80
|
+
const resolverForDeletes = new source_deploy_retrieve_1.MetadataResolver(undefined, source_deploy_retrieve_1.VirtualTreeContainer.fromFilePaths(grouping.deletes));
|
|
81
|
+
grouping.deletes
|
|
82
|
+
.flatMap((filename) => resolverForDeletes.getComponentsFromPath(filename))
|
|
83
|
+
.filter(guards_1.sourceComponentGuard)
|
|
84
|
+
.map((component) => {
|
|
85
|
+
// if the component is a file in a bundle type AND there are files from the bundle that are not deleted, set the bundle for deploy, not for delete
|
|
86
|
+
if ((0, functions_1.isBundle)(component) && component.content && fs.existsSync(component.content)) {
|
|
87
|
+
// all bundle types have a directory name
|
|
88
|
+
try {
|
|
89
|
+
resolverForNonDeletes
|
|
90
|
+
.getComponentsFromPath((0, path_1.resolve)(component.content))
|
|
91
|
+
.filter(guards_1.sourceComponentGuard)
|
|
92
|
+
.map((nonDeletedComponent) => componentSet.add(nonDeletedComponent));
|
|
93
|
+
}
|
|
94
|
+
catch (e) {
|
|
95
|
+
this.logger.warn(`unable to find component at ${component.content}. That's ok if it was supposed to be deleted`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
componentSet.add(component, source_deploy_retrieve_1.DestructiveChangesType.POST);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
grouping.nonDeletes
|
|
103
|
+
.flatMap((filename) => {
|
|
104
|
+
try {
|
|
105
|
+
return resolverForNonDeletes.getComponentsFromPath((0, path_1.resolve)(filename));
|
|
106
|
+
}
|
|
107
|
+
catch (e) {
|
|
108
|
+
this.logger.warn(`unable to resolve ${filename}`);
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
})
|
|
112
|
+
.filter(guards_1.sourceComponentGuard)
|
|
113
|
+
.map((component) => componentSet.add(component));
|
|
114
|
+
return componentSet;
|
|
70
115
|
})
|
|
71
|
-
.filter(
|
|
72
|
-
.map((component) => componentSet.add(component));
|
|
73
|
-
deletes
|
|
74
|
-
.flatMap((filename) => resolverForDeletes.getComponentsFromPath(filename))
|
|
75
|
-
.filter(guards_1.sourceComponentGuard)
|
|
76
|
-
.map((component) => componentSet.add(component, source_deploy_retrieve_1.DestructiveChangesType.POST));
|
|
77
|
-
return componentSet;
|
|
116
|
+
.filter((componentSet) => componentSet.size > 0);
|
|
78
117
|
}
|
|
79
118
|
/**
|
|
80
119
|
* Does most of the work for the force:source:status command.
|
|
@@ -99,7 +138,7 @@ class SourceTracking extends kit_1.AsyncCreatable {
|
|
|
99
138
|
}
|
|
100
139
|
if (local && remote) {
|
|
101
140
|
// keys like ApexClass__MyClass.cls
|
|
102
|
-
const conflictFiles = (await this.getConflicts()).flatMap((conflict) => conflict.filenames).filter(
|
|
141
|
+
const conflictFiles = (await this.getConflicts()).flatMap((conflict) => conflict.filenames).filter(ts_types_1.isString);
|
|
103
142
|
results = results.map((row) => ({
|
|
104
143
|
...row,
|
|
105
144
|
conflict: !!row.filePath && conflictFiles.includes(row.filePath),
|
|
@@ -128,7 +167,7 @@ class SourceTracking extends kit_1.AsyncCreatable {
|
|
|
128
167
|
}
|
|
129
168
|
if (options.format === 'SourceComponent') {
|
|
130
169
|
const resolver = options.state === 'delete'
|
|
131
|
-
? new source_deploy_retrieve_1.MetadataResolver(undefined,
|
|
170
|
+
? new source_deploy_retrieve_1.MetadataResolver(undefined, source_deploy_retrieve_1.VirtualTreeContainer.fromFilePaths(filenames))
|
|
132
171
|
: new source_deploy_retrieve_1.MetadataResolver();
|
|
133
172
|
return filenames
|
|
134
173
|
.flatMap((filename) => {
|
|
@@ -147,7 +186,10 @@ class SourceTracking extends kit_1.AsyncCreatable {
|
|
|
147
186
|
await this.ensureRemoteTracking();
|
|
148
187
|
const remoteChanges = await this.remoteSourceTrackingService.retrieveUpdates();
|
|
149
188
|
this.logger.debug('remoteChanges', remoteChanges);
|
|
150
|
-
const filteredChanges = remoteChanges
|
|
189
|
+
const filteredChanges = remoteChanges
|
|
190
|
+
.filter(remoteFilterByState[options.state])
|
|
191
|
+
// skip any remote types not in the registry. Will emit node warnings
|
|
192
|
+
.filter((rce) => this.registrySupportsType(rce.type));
|
|
151
193
|
if (options.format === 'ChangeResult') {
|
|
152
194
|
return filteredChanges.map((change) => (0, remoteSourceTrackingService_1.remoteChangeElementToChangeResult)(change));
|
|
153
195
|
}
|
|
@@ -220,9 +262,28 @@ class SourceTracking extends kit_1.AsyncCreatable {
|
|
|
220
262
|
async updateLocalTracking(options) {
|
|
221
263
|
var _a, _b;
|
|
222
264
|
await this.ensureLocalTracking();
|
|
265
|
+
// relative paths make smaller trees AND isogit wants them relative
|
|
266
|
+
const relativeOptions = {
|
|
267
|
+
files: ((_a = options.files) !== null && _a !== void 0 ? _a : []).map((file) => this.ensureRelative(file)),
|
|
268
|
+
deletedFiles: ((_b = options.deletedFiles) !== null && _b !== void 0 ? _b : []).map((file) => this.ensureRelative(file)),
|
|
269
|
+
};
|
|
270
|
+
// plot twist: if you delete a member of a bundle (ex: lwc/foo/foo.css) and push, it'll not be in the fileResponses (deployedFiles) or deletedFiles
|
|
271
|
+
// what got deleted? Any local changes NOT in the fileResponses but part of a successfully deployed bundle
|
|
272
|
+
const deployedFilesAsVirtualComponentSet = source_deploy_retrieve_1.ComponentSet.fromSource({
|
|
273
|
+
// resolve from highest possible level. TODO: can we use [.]
|
|
274
|
+
fsPaths: relativeOptions.files.length ? [relativeOptions.files[0].split(path_1.sep)[0]] : [],
|
|
275
|
+
tree: source_deploy_retrieve_1.VirtualTreeContainer.fromFilePaths(relativeOptions.files),
|
|
276
|
+
});
|
|
277
|
+
// these are top-level bundle paths like lwc/foo
|
|
278
|
+
const bundlesWithDeletedFiles = (await this.getChanges({ origin: 'local', state: 'delete', format: 'SourceComponent' }))
|
|
279
|
+
.filter(functions_1.isBundle)
|
|
280
|
+
.filter((cmp) => deployedFilesAsVirtualComponentSet.has({ type: cmp.type, fullName: cmp.fullName }))
|
|
281
|
+
.map((cmp) => cmp.content)
|
|
282
|
+
.filter(ts_types_1.isString);
|
|
223
283
|
await this.localRepo.commitChanges({
|
|
224
|
-
deployedFiles:
|
|
225
|
-
deletedFiles: (
|
|
284
|
+
deployedFiles: relativeOptions.files,
|
|
285
|
+
deletedFiles: relativeOptions.deletedFiles.concat((await this.localRepo.getDeleteFilenames()).filter((deployedFile) => bundlesWithDeletedFiles.some((bundlePath) => deployedFile.startsWith(bundlePath)) &&
|
|
286
|
+
!relativeOptions.files.includes(deployedFile))),
|
|
226
287
|
});
|
|
227
288
|
}
|
|
228
289
|
/**
|
|
@@ -249,7 +310,7 @@ class SourceTracking extends kit_1.AsyncCreatable {
|
|
|
249
310
|
}
|
|
250
311
|
this.localRepo = await localShadowRepo_1.ShadowRepo.getInstance({
|
|
251
312
|
orgId: this.orgId,
|
|
252
|
-
projectPath: this.projectPath,
|
|
313
|
+
projectPath: (0, path_1.normalize)(this.projectPath),
|
|
253
314
|
packageDirs: this.packagesDirs,
|
|
254
315
|
});
|
|
255
316
|
// loads the status from file so that it's cached
|
|
@@ -373,7 +434,7 @@ class SourceTracking extends kit_1.AsyncCreatable {
|
|
|
373
434
|
* uses SDR to translate remote metadata records into local file paths (which only typically have the filename).
|
|
374
435
|
*
|
|
375
436
|
* @input elements: ChangeResult[]
|
|
376
|
-
* @input
|
|
437
|
+
* @input excludeUnresolvable: boolean Filter out components where you can't get the name and type (that is, it's probably not a valid source component)
|
|
377
438
|
* @input resolveDeleted: constructs a virtualTree instead of the actual filesystem--useful when the files no longer exist
|
|
378
439
|
* @input useFsForceIgnore: (default behavior) use forceIgnore from the filesystem. If false, uses the base forceIgnore from SDR
|
|
379
440
|
*/
|
|
@@ -382,9 +443,9 @@ class SourceTracking extends kit_1.AsyncCreatable {
|
|
|
382
443
|
return [];
|
|
383
444
|
}
|
|
384
445
|
this.logger.debug(`populateTypesAndNames for ${elements.length} change elements`);
|
|
385
|
-
const filenames = elements.flatMap((element) => element.filenames).filter(
|
|
446
|
+
const filenames = elements.flatMap((element) => element.filenames).filter(ts_types_1.isString);
|
|
386
447
|
// component set generated from the filenames on all local changes
|
|
387
|
-
const resolver = new source_deploy_retrieve_1.MetadataResolver(undefined, resolveDeleted ?
|
|
448
|
+
const resolver = new source_deploy_retrieve_1.MetadataResolver(undefined, resolveDeleted ? source_deploy_retrieve_1.VirtualTreeContainer.fromFilePaths(filenames) : undefined, useFsForceIgnore);
|
|
388
449
|
const sourceComponents = filenames
|
|
389
450
|
.flatMap((filename) => {
|
|
390
451
|
try {
|
|
@@ -411,9 +472,9 @@ class SourceTracking extends kit_1.AsyncCreatable {
|
|
|
411
472
|
if ((matchingComponent === null || matchingComponent === void 0 ? void 0 : matchingComponent.fullName) && (matchingComponent === null || matchingComponent === void 0 ? void 0 : matchingComponent.type.name)) {
|
|
412
473
|
const filenamesFromMatchingComponent = [matchingComponent.xml, ...matchingComponent.walkContent()];
|
|
413
474
|
// Set the ignored status at the component level so it can apply to all its files, some of which may not match the ignoreFile (ex: ApexClass)
|
|
414
|
-
|
|
475
|
+
(_a = this.forceIgnore) !== null && _a !== void 0 ? _a : (this.forceIgnore = source_deploy_retrieve_1.ForceIgnore.findAndCreate(this.project.getDefaultPackage().path));
|
|
415
476
|
const ignored = filenamesFromMatchingComponent
|
|
416
|
-
.filter(
|
|
477
|
+
.filter(ts_types_1.isString)
|
|
417
478
|
.filter((filename) => !filename.includes('__tests__'))
|
|
418
479
|
.some((filename) => this.forceIgnore.denies(filename));
|
|
419
480
|
filenamesFromMatchingComponent.map((filename) => {
|
|
@@ -456,6 +517,17 @@ class SourceTracking extends kit_1.AsyncCreatable {
|
|
|
456
517
|
results = results.concat(localAdds.flatMap((item) => this.localChangesToOutputRow(item, 'add')), localModifies.flatMap((item) => this.localChangesToOutputRow(item, 'modify')), localDeletes.flatMap((item) => this.localChangesToOutputRow(item, 'delete')));
|
|
457
518
|
return results;
|
|
458
519
|
}
|
|
520
|
+
registrySupportsType(type) {
|
|
521
|
+
try {
|
|
522
|
+
// this must use getTypeByName because findType doesn't support addressable child types (ex: customField!)
|
|
523
|
+
this.registry.getTypeByName(type);
|
|
524
|
+
return true;
|
|
525
|
+
}
|
|
526
|
+
catch (e) {
|
|
527
|
+
process.emitWarning(`Unable to find type ${type} in registry`);
|
|
528
|
+
return false;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
459
531
|
/**
|
|
460
532
|
* uses SDR to translate remote metadata records into local file paths
|
|
461
533
|
*/
|
|
@@ -464,12 +536,19 @@ class SourceTracking extends kit_1.AsyncCreatable {
|
|
|
464
536
|
return [];
|
|
465
537
|
}
|
|
466
538
|
this.logger.debug('populateFilePaths for change elements', elements);
|
|
467
|
-
// component set generated from an array of
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
539
|
+
// component set generated from an array of MetadataMember from all the remote changes
|
|
540
|
+
// but exclude the ones that aren't in the registry
|
|
541
|
+
const remoteChangesAsMetadataMember = elements
|
|
542
|
+
.map((element) => {
|
|
543
|
+
if (typeof element.type === 'string' && typeof element.name === 'string') {
|
|
544
|
+
return {
|
|
545
|
+
type: element.type,
|
|
546
|
+
fullName: element.name,
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
})
|
|
550
|
+
.filter(guards_1.metadataMemberGuard);
|
|
551
|
+
const remoteChangesAsComponentSet = new source_deploy_retrieve_1.ComponentSet(remoteChangesAsMetadataMember);
|
|
473
552
|
this.logger.debug(` the generated component set has ${remoteChangesAsComponentSet.size.toString()} items`);
|
|
474
553
|
if (remoteChangesAsComponentSet.size < elements.length) {
|
|
475
554
|
// iterate the elements to see which ones didn't make it into the component set
|
|
@@ -504,7 +583,7 @@ class SourceTracking extends kit_1.AsyncCreatable {
|
|
|
504
583
|
return Array.from(elementMap.values());
|
|
505
584
|
}
|
|
506
585
|
ensureRelative(filePath) {
|
|
507
|
-
return
|
|
586
|
+
return (0, path_1.isAbsolute)(filePath) ? (0, path_1.relative)(this.projectPath, filePath) : filePath;
|
|
508
587
|
}
|
|
509
588
|
async getLocalChangesAsFilenames(state) {
|
|
510
589
|
if (state === 'modify') {
|
|
@@ -546,7 +625,7 @@ class SourceTracking extends kit_1.AsyncCreatable {
|
|
|
546
625
|
async remoteChangesToOutputRows(input) {
|
|
547
626
|
var _a, _b, _c, _d;
|
|
548
627
|
this.logger.debug('converting ChangeResult to a row', input);
|
|
549
|
-
|
|
628
|
+
(_a = this.forceIgnore) !== null && _a !== void 0 ? _a : (this.forceIgnore = source_deploy_retrieve_1.ForceIgnore.findAndCreate(this.project.getDefaultPackage().path));
|
|
550
629
|
const baseObject = {
|
|
551
630
|
type: (_b = input.type) !== null && _b !== void 0 ? _b : '',
|
|
552
631
|
origin: input.origin,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/source-tracking",
|
|
3
3
|
"description": "API for tracking local and remote Salesforce metadata changes",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.1",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "lib/index.js",
|
|
@@ -18,12 +18,13 @@
|
|
|
18
18
|
"format": "sf-format",
|
|
19
19
|
"lint": "sf-lint",
|
|
20
20
|
"lint-fix": "yarn sf-lint --fix",
|
|
21
|
-
"prepack": "sf-build",
|
|
22
21
|
"postpack": "shx rm -f oclif.manifest.json",
|
|
22
|
+
"prepack": "sf-prepack",
|
|
23
|
+
"prepare": "sf-install",
|
|
23
24
|
"pretest": "sf-compile-test",
|
|
24
|
-
"
|
|
25
|
-
"test
|
|
26
|
-
"
|
|
25
|
+
"prune:dead": "ts-prune | grep -v 'source-deploy-retrieve' | grep -v 'index.ts'",
|
|
26
|
+
"test": "sf-test",
|
|
27
|
+
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel"
|
|
27
28
|
},
|
|
28
29
|
"keywords": [
|
|
29
30
|
"force",
|
|
@@ -40,28 +41,20 @@
|
|
|
40
41
|
"!lib/**/*.map",
|
|
41
42
|
"/oclif.manifest.json"
|
|
42
43
|
],
|
|
43
|
-
"husky": {
|
|
44
|
-
"hooks": {
|
|
45
|
-
"commit-msg": "sf-husky-commit-msg",
|
|
46
|
-
"pre-commit": "sf-husky-pre-commit",
|
|
47
|
-
"pre-push": "sf-husky-pre-push"
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
44
|
"dependencies": {
|
|
51
|
-
"@salesforce/core": "^2.
|
|
45
|
+
"@salesforce/core": "^2.31.0",
|
|
52
46
|
"@salesforce/kit": "^1.5.17",
|
|
53
|
-
"@salesforce/source-deploy-retrieve": "^5.
|
|
47
|
+
"@salesforce/source-deploy-retrieve": "^5.8.0",
|
|
54
48
|
"isomorphic-git": "^1.9.2",
|
|
55
49
|
"ts-retry-promise": "^0.6.0"
|
|
56
50
|
},
|
|
57
51
|
"devDependencies": {
|
|
58
52
|
"@salesforce/cli-plugins-testkit": "^1.3.7",
|
|
59
53
|
"@salesforce/dev-config": "^2.1.2",
|
|
60
|
-
"@salesforce/dev-scripts": "^0.
|
|
54
|
+
"@salesforce/dev-scripts": "^1.0.2",
|
|
61
55
|
"@salesforce/prettier-config": "^0.0.2",
|
|
62
56
|
"@salesforce/ts-sinon": "^1.3.21",
|
|
63
57
|
"@types/shelljs": "^0.8.9",
|
|
64
|
-
"@types/sinon": "^10.0.2",
|
|
65
58
|
"@typescript-eslint/eslint-plugin": "^4.29.0",
|
|
66
59
|
"@typescript-eslint/parser": "^4.29.0",
|
|
67
60
|
"chai": "^4.3.0",
|
|
@@ -72,10 +65,10 @@
|
|
|
72
65
|
"eslint-config-salesforce-license": "^0.1.6",
|
|
73
66
|
"eslint-config-salesforce-typescript": "^0.2.7",
|
|
74
67
|
"eslint-plugin-header": "^3.1.1",
|
|
75
|
-
"eslint-plugin-import": "
|
|
68
|
+
"eslint-plugin-import": "2.24.2",
|
|
76
69
|
"eslint-plugin-jsdoc": "^37.0.1",
|
|
77
70
|
"eslint-plugin-prettier": "^3.4.0",
|
|
78
|
-
"husky": "^
|
|
71
|
+
"husky": "^7.0.4",
|
|
79
72
|
"mocha": "^9.0.3",
|
|
80
73
|
"nyc": "^15.1.0",
|
|
81
74
|
"prettier": "^2.3.2",
|
|
@@ -85,34 +78,7 @@
|
|
|
85
78
|
"sinon": "^10.0.0",
|
|
86
79
|
"ts-node": "^10.1.0",
|
|
87
80
|
"ts-prune": "^0.10.0",
|
|
88
|
-
"typescript": "^4.
|
|
89
|
-
},
|
|
90
|
-
"oclif": {
|
|
91
|
-
"commands": "./lib/commands",
|
|
92
|
-
"bin": "sfdx",
|
|
93
|
-
"devPlugins": [
|
|
94
|
-
"@oclif/plugin-help",
|
|
95
|
-
"@oclif/plugin-command-snapshot",
|
|
96
|
-
"@salesforce/plugin-command-reference"
|
|
97
|
-
],
|
|
98
|
-
"topics": {
|
|
99
|
-
"force": {
|
|
100
|
-
"external": true,
|
|
101
|
-
"subtopics": {
|
|
102
|
-
"user": {
|
|
103
|
-
"description": "commands that perform user-related admin tasks",
|
|
104
|
-
"subtopics": {
|
|
105
|
-
"permset": {
|
|
106
|
-
"description": "Use to interact with permission sets assigned to a user"
|
|
107
|
-
},
|
|
108
|
-
"password": {
|
|
109
|
-
"description": "Used to generate and set passwords for users"
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
81
|
+
"typescript": "^4.4.4"
|
|
116
82
|
},
|
|
117
83
|
"config": {
|
|
118
84
|
"commitizen": {
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { VirtualTreeContainer } from '@salesforce/source-deploy-retrieve';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated this is moving to SDR
|
|
4
|
-
* Designed for recreating virtual files from deleted files where the only information we have is the file's former location
|
|
5
|
-
* Any use of MetadataResolver was trying to access the non-existent files and throwing
|
|
6
|
-
*
|
|
7
|
-
* @param filenames full paths to files
|
|
8
|
-
* @returns VirtualTreeContainer to use with MetadataResolver
|
|
9
|
-
*/
|
|
10
|
-
export declare const filenamesToVirtualTree: (filenames: string[]) => VirtualTreeContainer;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.filenamesToVirtualTree = void 0;
|
|
4
|
-
/*
|
|
5
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
|
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 path = require("path");
|
|
11
|
-
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated this is moving to SDR
|
|
14
|
-
* Designed for recreating virtual files from deleted files where the only information we have is the file's former location
|
|
15
|
-
* Any use of MetadataResolver was trying to access the non-existent files and throwing
|
|
16
|
-
*
|
|
17
|
-
* @param filenames full paths to files
|
|
18
|
-
* @returns VirtualTreeContainer to use with MetadataResolver
|
|
19
|
-
*/
|
|
20
|
-
const filenamesToVirtualTree = (filenames) => {
|
|
21
|
-
// a map to reduce array iterations
|
|
22
|
-
const virtualDirectoryByFullPath = new Map();
|
|
23
|
-
filenames.map((filename) => {
|
|
24
|
-
var _a;
|
|
25
|
-
const splits = filename.split(path.sep);
|
|
26
|
-
for (let i = 0; i < splits.length - 1; i++) {
|
|
27
|
-
const fullPathSoFar = splits.slice(0, i + 1).join(path.sep);
|
|
28
|
-
const existing = virtualDirectoryByFullPath.get(fullPathSoFar);
|
|
29
|
-
virtualDirectoryByFullPath.set(fullPathSoFar, {
|
|
30
|
-
dirPath: fullPathSoFar,
|
|
31
|
-
// only add to children if we don't already have it
|
|
32
|
-
children: Array.from(new Set((_a = existing === null || existing === void 0 ? void 0 : existing.children) !== null && _a !== void 0 ? _a : []).add(splits[i + 1])),
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
return new source_deploy_retrieve_1.VirtualTreeContainer(Array.from(virtualDirectoryByFullPath.values()));
|
|
37
|
-
};
|
|
38
|
-
exports.filenamesToVirtualTree = filenamesToVirtualTree;
|
|
39
|
-
//# sourceMappingURL=filenamesToVirtualTree.js.map
|