@salesforce/source-tracking 1.3.1 → 1.4.2

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,20 @@
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.4.2](https://github.com/forcedotcom/source-tracking/compare/v1.4.1...v1.4.2) (2022-04-29)
6
+
7
+ ### Bug Fixes
8
+
9
+ - use absolute paths in ComponentSet for matching local source ([#153](https://github.com/forcedotcom/source-tracking/issues/153)) ([b5690a5](https://github.com/forcedotcom/source-tracking/commit/b5690a5c4f3a3fe02f733fa1578467e2278e62bf))
10
+
11
+ ### [1.4.1](https://github.com/forcedotcom/source-tracking/compare/v1.4.0...v1.4.1) (2022-04-28)
12
+
13
+ ## [1.4.0](https://github.com/forcedotcom/source-tracking/compare/v1.3.1...v1.4.0) (2022-04-27)
14
+
15
+ ### Features
16
+
17
+ - comp set for pulls ([4b361a4](https://github.com/forcedotcom/source-tracking/commit/4b361a4f31ac4f810762ee8d6f8447f7eef1be31))
18
+
5
19
  ### [1.3.1](https://github.com/forcedotcom/source-tracking/compare/v1.3.0...v1.3.1) (2022-03-25)
6
20
 
7
21
  ### Bug Fixes
@@ -33,6 +33,7 @@ export declare class SourceTracking extends AsyncCreatable {
33
33
  * @returns ComponentSet[]
34
34
  */
35
35
  localChangesAsComponentSet(byPackageDir?: boolean): Promise<ComponentSet[]>;
36
+ remoteNonDeletesAsComponentSet(): Promise<ComponentSet>;
36
37
  /**
37
38
  * Does most of the work for the force:source:status command.
38
39
  * Outputs need a bit of massage since this aims to provide nice json.
@@ -116,6 +116,33 @@ class SourceTracking extends kit_1.AsyncCreatable {
116
116
  })
117
117
  .filter((componentSet) => componentSet.size > 0);
118
118
  }
119
+ async remoteNonDeletesAsComponentSet() {
120
+ const [changeResults, sourceBackedComponents] = await Promise.all([
121
+ // all changes based on remote tracking
122
+ this.getChanges({
123
+ origin: 'remote',
124
+ state: 'nondelete',
125
+ format: 'ChangeResult',
126
+ }),
127
+ // only returns source-backed components (SBC)
128
+ this.getChanges({
129
+ origin: 'remote',
130
+ state: 'nondelete',
131
+ format: 'SourceComponent',
132
+ }),
133
+ ]);
134
+ const componentSet = new source_deploy_retrieve_1.ComponentSet(sourceBackedComponents);
135
+ // there may be remote adds not in the SBC. So we add those manually
136
+ changeResults.forEach((cr) => {
137
+ if (cr.type && cr.name && !componentSet.has({ type: cr.type, fullName: cr.name })) {
138
+ componentSet.add({
139
+ type: cr.type,
140
+ fullName: cr.name,
141
+ });
142
+ }
143
+ });
144
+ return componentSet;
145
+ }
119
146
  /**
120
147
  * Does most of the work for the force:source:status command.
121
148
  * Outputs need a bit of massage since this aims to provide nice json.
@@ -203,7 +230,7 @@ class SourceTracking extends kit_1.AsyncCreatable {
203
230
  fullName: element === null || element === void 0 ? void 0 : element.name,
204
231
  })));
205
232
  const matchingLocalSourceComponentsSet = source_deploy_retrieve_1.ComponentSet.fromSource({
206
- fsPaths: this.packagesDirs.map((dir) => dir.path),
233
+ fsPaths: this.packagesDirs.map((dir) => (0, path_1.resolve)(dir.fullPath)),
207
234
  include: remoteChangesAsComponentSet,
208
235
  });
209
236
  if (options.format === 'string') {
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.3.1",
4
+ "version": "1.4.2",
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.4",
48
+ "@salesforce/source-deploy-retrieve": "^5.12.12",
49
49
  "graceful-fs": "^4.2.9",
50
50
  "isomorphic-git": "1.17.0",
51
51
  "ts-retry-promise": "^0.6.0"