@salesforce/source-tracking 1.0.0 → 1.0.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 CHANGED
@@ -2,6 +2,12 @@
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.1](https://github.com/forcedotcom/source-tracking/compare/v1.0.0...v1.0.1) (2022-01-25)
6
+
7
+ ### Bug Fixes
8
+
9
+ - emailTempalteFolder via aliased types ([f4c88f9](https://github.com/forcedotcom/source-tracking/commit/f4c88f9b59ad6d061933bfd3f6827e44a59b0e80))
10
+
5
11
  ## [1.0.0](https://github.com/forcedotcom/source-tracking/compare/v0.5.2...v1.0.0) (2022-01-20)
6
12
 
7
13
  ### Bug Fixes
@@ -14,6 +14,12 @@ const functions_1 = require("./functions");
14
14
  const pathAfterFullName = (fileResponse) => fileResponse && fileResponse.filePath
15
15
  ? fileResponse.filePath.substr(fileResponse.filePath.indexOf(fileResponse.fullName)).replace(/\\/gi, '/')
16
16
  : '';
17
+ const registry = new source_deploy_retrieve_1.RegistryAccess();
18
+ // only compute once
19
+ const aliasTypes = registry
20
+ .getAliasTypes()
21
+ .map((aliasType) => [aliasType.name, registry.getTypeByName(aliasType.aliasFor).name]);
22
+ const reverseAliasTypes = new Map(aliasTypes.map(([alias, type]) => [type, alias]));
17
23
  // handle all "weird" type/name translation between SourceMember and SDR FileResponse
18
24
  // These get de-duplicated in a set later, so it's ok to have one per file
19
25
  const getMetadataKeyFromFileResponse = (fileResponse) => {
@@ -46,11 +52,19 @@ const getMetadataKeyFromFileResponse = (fileResponse) => {
46
52
  .toArray()
47
53
  .flatMap((component) => component.getChildren().map((child) => (0, functions_1.getMetadataKey)('CustomLabel', child.fullName)));
48
54
  }
55
+ // if we've aliased a type, we'll have to possibly sync both types--you can't tell from the sourceComponent retrieved which way it was stored on the server
56
+ if (reverseAliasTypes.has(fileResponse.type)) {
57
+ return [
58
+ (0, functions_1.getMetadataKey)(fileResponse.type, fileResponse.fullName),
59
+ (0, functions_1.getMetadataKey)(reverseAliasTypes.get(fileResponse.type), fileResponse.fullName),
60
+ ];
61
+ }
49
62
  // standard key for everything else
50
63
  return [(0, functions_1.getMetadataKey)(fileResponse.type, fileResponse.fullName)];
51
64
  };
52
65
  exports.getMetadataKeyFromFileResponse = getMetadataKeyFromFileResponse;
53
66
  exports.mappingsForSourceMemberTypesToMetadataType = new Map([
67
+ ...aliasTypes,
54
68
  ['AuraDefinition', 'AuraDefinitionBundle'],
55
69
  ['LightningComponentResource', 'LightningComponentBundle'],
56
70
  ]);
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": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "author": "Salesforce",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "lib/index.js",
@@ -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.9.3",
48
+ "@salesforce/source-deploy-retrieve": "^5.9.4",
49
49
  "isomorphic-git": "^1.9.2",
50
50
  "ts-retry-promise": "^0.6.0"
51
51
  },