@salesforce/source-tracking 0.5.2 → 1.0.0
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
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
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
|
+
## [1.0.0](https://github.com/forcedotcom/source-tracking/compare/v0.5.2...v1.0.0) (2022-01-20)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- handle element count errors ([8817329](https://github.com/forcedotcom/source-tracking/commit/8817329f8198ce701aba22c7a4476ef31a4d73a4))
|
|
10
|
+
- lightning EmailTemplateFolder ([554c766](https://github.com/forcedotcom/source-tracking/commit/554c76676a85c7a4b673879116912cde51dd1498))
|
|
11
|
+
- remove emailtf attempt ([262839d](https://github.com/forcedotcom/source-tracking/commit/262839dc025c7094d8868d3ae9d769dd39ad5324))
|
|
12
|
+
- sourceMember excepton for nondecomposed children ([05db59e](https://github.com/forcedotcom/source-tracking/commit/05db59e7a6e070224a45f5fbf08013565c9f2131))
|
|
13
|
+
|
|
5
14
|
### [0.5.2](https://github.com/forcedotcom/source-tracking/compare/v0.5.1...v0.5.2) (2022-01-05)
|
|
6
15
|
|
|
7
16
|
### Features
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMetadataKeyFromFileResponse = void 0;
|
|
3
|
+
exports.mappingsForSourceMemberTypesToMetadataType = exports.getMetadataKeyFromFileResponse = void 0;
|
|
4
4
|
/*
|
|
5
5
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
6
6
|
* All rights reserved.
|
|
@@ -8,6 +8,7 @@ exports.getMetadataKeyFromFileResponse = 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 path = require("path");
|
|
11
|
+
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
11
12
|
const functions_1 = require("./functions");
|
|
12
13
|
// LWC can have child folders (ex: dynamic templates like /templates/noDataIllustration.html
|
|
13
14
|
const pathAfterFullName = (fileResponse) => fileResponse && fileResponse.filePath
|
|
@@ -38,8 +39,19 @@ const getMetadataKeyFromFileResponse = (fileResponse) => {
|
|
|
38
39
|
(0, functions_1.getMetadataKey)(fileResponse.type, fileResponse.fullName),
|
|
39
40
|
];
|
|
40
41
|
}
|
|
41
|
-
//
|
|
42
|
+
// CustomLabels (file) => CustomLabel[] (how they're storedin SourceMembers)
|
|
43
|
+
if (fileResponse.type === 'CustomLabels' && fileResponse.filePath) {
|
|
44
|
+
return source_deploy_retrieve_1.ComponentSet.fromSource(fileResponse.filePath)
|
|
45
|
+
.getSourceComponents()
|
|
46
|
+
.toArray()
|
|
47
|
+
.flatMap((component) => component.getChildren().map((child) => (0, functions_1.getMetadataKey)('CustomLabel', child.fullName)));
|
|
48
|
+
}
|
|
49
|
+
// standard key for everything else
|
|
42
50
|
return [(0, functions_1.getMetadataKey)(fileResponse.type, fileResponse.fullName)];
|
|
43
51
|
};
|
|
44
52
|
exports.getMetadataKeyFromFileResponse = getMetadataKeyFromFileResponse;
|
|
53
|
+
exports.mappingsForSourceMemberTypesToMetadataType = new Map([
|
|
54
|
+
['AuraDefinition', 'AuraDefinitionBundle'],
|
|
55
|
+
['LightningComponentResource', 'LightningComponentBundle'],
|
|
56
|
+
]);
|
|
45
57
|
//# sourceMappingURL=metadataKeys.js.map
|
|
@@ -477,18 +477,14 @@ RemoteSourceTrackingService.remoteSourceTrackingServiceDictionary = {};
|
|
|
477
477
|
const remoteChangeElementToChangeResult = (rce) => {
|
|
478
478
|
return {
|
|
479
479
|
...rce,
|
|
480
|
-
...(mappingsForSourceMemberTypesToMetadataType.has(rce.type)
|
|
480
|
+
...(metadataKeys_1.mappingsForSourceMemberTypesToMetadataType.has(rce.type)
|
|
481
481
|
? {
|
|
482
482
|
name: rce.name.split('/')[0],
|
|
483
|
-
type: mappingsForSourceMemberTypesToMetadataType.get(rce.type),
|
|
483
|
+
type: metadataKeys_1.mappingsForSourceMemberTypesToMetadataType.get(rce.type),
|
|
484
484
|
}
|
|
485
485
|
: {}),
|
|
486
486
|
origin: 'remote', // we know they're remote
|
|
487
487
|
};
|
|
488
488
|
};
|
|
489
489
|
exports.remoteChangeElementToChangeResult = remoteChangeElementToChangeResult;
|
|
490
|
-
const mappingsForSourceMemberTypesToMetadataType = new Map([
|
|
491
|
-
['AuraDefinition', 'AuraDefinitionBundle'],
|
|
492
|
-
['LightningComponentResource', 'LightningComponentBundle'],
|
|
493
|
-
]);
|
|
494
490
|
//# sourceMappingURL=remoteSourceTrackingService.js.map
|
package/lib/sourceTracking.js
CHANGED
|
@@ -18,6 +18,7 @@ const remoteSourceTrackingService_1 = require("./shared/remoteSourceTrackingServ
|
|
|
18
18
|
const localShadowRepo_1 = require("./shared/localShadowRepo");
|
|
19
19
|
const guards_1 = require("./shared/guards");
|
|
20
20
|
const functions_1 = require("./shared/functions");
|
|
21
|
+
const metadataKeys_1 = require("./shared/metadataKeys");
|
|
21
22
|
/**
|
|
22
23
|
* Manages source tracking files (remote and local)
|
|
23
24
|
*
|
|
@@ -519,6 +520,9 @@ class SourceTracking extends kit_1.AsyncCreatable {
|
|
|
519
520
|
}
|
|
520
521
|
registrySupportsType(type) {
|
|
521
522
|
try {
|
|
523
|
+
if (metadataKeys_1.mappingsForSourceMemberTypesToMetadataType.has(type)) {
|
|
524
|
+
return true;
|
|
525
|
+
}
|
|
522
526
|
// this must use getTypeByName because findType doesn't support addressable child types (ex: customField!)
|
|
523
527
|
this.registry.getTypeByName(type);
|
|
524
528
|
return true;
|
|
@@ -551,11 +555,16 @@ class SourceTracking extends kit_1.AsyncCreatable {
|
|
|
551
555
|
const remoteChangesAsComponentSet = new source_deploy_retrieve_1.ComponentSet(remoteChangesAsMetadataMember);
|
|
552
556
|
this.logger.debug(` the generated component set has ${remoteChangesAsComponentSet.size.toString()} items`);
|
|
553
557
|
if (remoteChangesAsComponentSet.size < elements.length) {
|
|
558
|
+
// there *could* be something missing
|
|
559
|
+
// some types (ex: LWC) show up as multiple files in the remote changes, but only one in the component set
|
|
554
560
|
// iterate the elements to see which ones didn't make it into the component set
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
561
|
+
const missingComponents = elements.filter((element) => !remoteChangesAsComponentSet.has({ type: element === null || element === void 0 ? void 0 : element.type, fullName: element === null || element === void 0 ? void 0 : element.name }));
|
|
562
|
+
// Throw if anything was actually missing
|
|
563
|
+
if (missingComponents.length > 0) {
|
|
564
|
+
throw new Error(`unable to generate complete component set for ${elements
|
|
565
|
+
.map((element) => `${element.name} (${element.type})`)
|
|
566
|
+
.join(os_1.EOL)}`);
|
|
567
|
+
}
|
|
559
568
|
}
|
|
560
569
|
const matchingLocalSourceComponentsSet = source_deploy_retrieve_1.ComponentSet.fromSource({
|
|
561
570
|
fsPaths: this.packagesDirs.map((dir) => dir.path),
|
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": "1.0.0",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "lib/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"prune:dead": "ts-prune | grep -v 'source-deploy-retrieve' | grep -v 'index.ts'",
|
|
26
26
|
"test": "sf-test",
|
|
27
27
|
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
|
|
28
|
-
"test:nuts:local": "mocha \"**/local
|
|
28
|
+
"test:nuts:local": "mocha \"**/local/*.nut.ts\" --slow 4500 --timeout 600000 --parallel"
|
|
29
29
|
},
|
|
30
30
|
"keywords": [
|
|
31
31
|
"force",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@salesforce/core": "^2.33.1",
|
|
47
47
|
"@salesforce/kit": "^1.5.17",
|
|
48
|
-
"@salesforce/source-deploy-retrieve": "^5.
|
|
48
|
+
"@salesforce/source-deploy-retrieve": "^5.9.3",
|
|
49
49
|
"isomorphic-git": "^1.9.2",
|
|
50
50
|
"ts-retry-promise": "^0.6.0"
|
|
51
51
|
},
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"eslint-config-salesforce-license": "^0.1.6",
|
|
67
67
|
"eslint-config-salesforce-typescript": "^0.2.7",
|
|
68
68
|
"eslint-plugin-header": "^3.1.1",
|
|
69
|
-
"eslint-plugin-import": "2.
|
|
69
|
+
"eslint-plugin-import": "2.25.4",
|
|
70
70
|
"eslint-plugin-jsdoc": "^37.0.1",
|
|
71
71
|
"eslint-plugin-prettier": "^3.4.0",
|
|
72
72
|
"husky": "^7.0.4",
|