@salesforce/source-tracking 2.2.12 → 2.2.14
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/lib/compatibility.d.ts +1 -1
- package/lib/shared/functions.d.ts +1 -1
- package/lib/shared/functions.js +3 -3
- package/lib/shared/localComponentSetArray.js +3 -2
- package/lib/shared/localShadowRepo.d.ts +1 -1
- package/lib/shared/remoteSourceTrackingService.d.ts +1 -1
- package/lib/shared/types.d.ts +7 -7
- package/lib/sourceTracking.d.ts +1 -1
- package/lib/sourceTracking.js +1 -1
- package/package.json +18 -18
package/lib/compatibility.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Org } from '@salesforce/core';
|
|
2
|
-
|
|
2
|
+
type TrackingFileVersion = 'plugin-source' | 'toolbelt' | 'none';
|
|
3
3
|
export declare const hasSfdxTrackingFiles: (orgId: string, projectPath: string) => boolean;
|
|
4
4
|
/**
|
|
5
5
|
* A project can have "old" (toolbelt), "new" (plugin-source) or "none" tracking files
|
|
@@ -2,7 +2,7 @@ import { SourceComponent } from '@salesforce/source-deploy-retrieve';
|
|
|
2
2
|
import { RemoteChangeElement, ChangeResult } from './types';
|
|
3
3
|
export declare const getMetadataKey: (metadataType: string, metadataName: string) => string;
|
|
4
4
|
export declare const getKeyFromObject: (element: RemoteChangeElement | ChangeResult) => string;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const supportsPartialDelete: (cmp: SourceComponent) => boolean;
|
|
6
6
|
export declare const isLwcLocalOnlyTest: (filePath: string) => boolean;
|
|
7
7
|
/**
|
|
8
8
|
* Verify that a filepath starts exactly with a complete parent path
|
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.ensureRelative = exports.chunkArray = exports.pathIsInFolder = exports.isLwcLocalOnlyTest = exports.
|
|
9
|
+
exports.ensureRelative = exports.chunkArray = exports.pathIsInFolder = exports.isLwcLocalOnlyTest = exports.supportsPartialDelete = exports.getKeyFromObject = exports.getMetadataKey = void 0;
|
|
10
10
|
const path_1 = require("path");
|
|
11
11
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
12
12
|
const getMetadataKey = (metadataType, metadataName) => `${metadataType}__${metadataName}`;
|
|
@@ -18,8 +18,8 @@ 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
|
|
22
|
-
exports.
|
|
21
|
+
const supportsPartialDelete = (cmp) => !!cmp.type.supportsPartialDelete;
|
|
22
|
+
exports.supportsPartialDelete = supportsPartialDelete;
|
|
23
23
|
const isLwcLocalOnlyTest = (filePath) => filePath.includes('__utam__') || filePath.includes('__tests__');
|
|
24
24
|
exports.isLwcLocalOnlyTest = isLwcLocalOnlyTest;
|
|
25
25
|
/**
|
|
@@ -45,8 +45,9 @@ const getComponentSets = (groupings, sourceApiVersion) => {
|
|
|
45
45
|
.flatMap((filename) => resolverForDeletes.getComponentsFromPath(filename))
|
|
46
46
|
.filter(guards_1.sourceComponentGuard)
|
|
47
47
|
.map((component) => {
|
|
48
|
-
// if the component
|
|
49
|
-
|
|
48
|
+
// if the component supports partial delete AND there are files that are not deleted,
|
|
49
|
+
// set the component for deploy, not for delete.
|
|
50
|
+
if ((0, functions_1.supportsPartialDelete)(component) && component.content && fs.existsSync(component.content)) {
|
|
50
51
|
// all bundle types have a directory name
|
|
51
52
|
try {
|
|
52
53
|
resolverForNonDeletes
|
|
@@ -5,7 +5,7 @@ interface ShadowRepoOptions {
|
|
|
5
5
|
packageDirs: NamedPackageDir[];
|
|
6
6
|
hasSfdxTrackingFiles: boolean;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
type StatusRow = [file: string, head: number, workdir: number, stage: number];
|
|
9
9
|
interface CommitRequest {
|
|
10
10
|
deployedFiles?: string[];
|
|
11
11
|
deletedFiles?: string[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConfigFile, Logger, Org } from '@salesforce/core';
|
|
2
2
|
import { Dictionary } from '@salesforce/ts-types';
|
|
3
3
|
import { ChangeResult, RemoteChangeElement, MemberRevision, SourceMember, RemoteSyncInput } from './types';
|
|
4
|
-
|
|
4
|
+
type Contents = {
|
|
5
5
|
serverMaxRevisionCounter: number;
|
|
6
6
|
sourceMembers: Dictionary<MemberRevision>;
|
|
7
7
|
};
|
package/lib/shared/types.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export interface ChangeOptions {
|
|
|
5
5
|
state: 'add' | 'delete' | 'modify' | 'nondelete';
|
|
6
6
|
format: 'ChangeResult' | 'SourceComponent' | 'string' | 'ChangeResultWithPaths';
|
|
7
7
|
}
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export type RemoteSyncInput = Pick<FileResponse, 'fullName' | 'filePath' | 'type' | 'state'>;
|
|
9
|
+
export type StatusOutputRow = Pick<FileResponse, 'fullName' | 'filePath' | 'type'> & {
|
|
10
10
|
conflict?: boolean;
|
|
11
11
|
ignored?: boolean;
|
|
12
12
|
} & Pick<ChangeOptions, 'origin' | 'state'>;
|
|
@@ -14,7 +14,7 @@ export interface LocalUpdateOptions {
|
|
|
14
14
|
files?: string[];
|
|
15
15
|
deletedFiles?: string[];
|
|
16
16
|
}
|
|
17
|
-
export
|
|
17
|
+
export type RemoteChangeElement = {
|
|
18
18
|
name: string;
|
|
19
19
|
type: string;
|
|
20
20
|
deleted?: boolean;
|
|
@@ -23,18 +23,18 @@ export declare type RemoteChangeElement = {
|
|
|
23
23
|
/**
|
|
24
24
|
* Summary type that supports both local and remote change types
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export type ChangeResult = Partial<RemoteChangeElement> & {
|
|
27
27
|
origin: 'local' | 'remote';
|
|
28
28
|
filenames?: string[];
|
|
29
29
|
ignored?: boolean;
|
|
30
30
|
};
|
|
31
|
-
export
|
|
31
|
+
export type MemberRevision = {
|
|
32
32
|
serverRevisionCounter: number;
|
|
33
33
|
lastRetrievedFromServer: number | null;
|
|
34
34
|
memberType: string;
|
|
35
35
|
isNameObsolete: boolean;
|
|
36
36
|
};
|
|
37
|
-
export
|
|
37
|
+
export type SourceMember = {
|
|
38
38
|
MemberType: string;
|
|
39
39
|
MemberName: string;
|
|
40
40
|
IsNameObsolete: boolean;
|
|
@@ -53,4 +53,4 @@ export interface SourceConflictError extends SfError {
|
|
|
53
53
|
}
|
|
54
54
|
export declare class SourceConflictError extends SfError implements SourceConflictError {
|
|
55
55
|
}
|
|
56
|
-
export
|
|
56
|
+
export type ChangeOptionType = ChangeResult | SourceComponent | string;
|
package/lib/sourceTracking.d.ts
CHANGED
package/lib/sourceTracking.js
CHANGED
|
@@ -260,7 +260,7 @@ class SourceTracking extends kit_1.AsyncCreatable {
|
|
|
260
260
|
});
|
|
261
261
|
// these are top-level bundle paths like lwc/foo
|
|
262
262
|
const bundlesWithDeletedFiles = (await this.getChanges({ origin: 'local', state: 'delete', format: 'SourceComponent' }))
|
|
263
|
-
.filter(functions_1.
|
|
263
|
+
.filter(functions_1.supportsPartialDelete)
|
|
264
264
|
.filter((cmp) => deployedFilesAsVirtualComponentSet.has({ type: cmp.type, fullName: cmp.fullName }))
|
|
265
265
|
.map((cmp) => cmp.content)
|
|
266
266
|
.filter(ts_types_1.isString);
|
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": "2.2.
|
|
4
|
+
"version": "2.2.14",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "lib/index.js",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"/oclif.manifest.json"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@salesforce/core": "^3.31.
|
|
47
|
-
"@salesforce/kit": "^1.
|
|
48
|
-
"@salesforce/source-deploy-retrieve": "^7.
|
|
49
|
-
"graceful-fs": "^4.2.
|
|
46
|
+
"@salesforce/core": "^3.31.19",
|
|
47
|
+
"@salesforce/kit": "^1.8.0",
|
|
48
|
+
"@salesforce/source-deploy-retrieve": "^7.5.12",
|
|
49
|
+
"graceful-fs": "^4.2.10",
|
|
50
50
|
"isomorphic-git": "1.17.0",
|
|
51
51
|
"ts-retry-promise": "^0.7.0"
|
|
52
52
|
},
|
|
@@ -55,30 +55,30 @@
|
|
|
55
55
|
"@salesforce/dev-config": "^3.1.0",
|
|
56
56
|
"@salesforce/dev-scripts": "^3.1.0",
|
|
57
57
|
"@salesforce/prettier-config": "^0.0.2",
|
|
58
|
-
"@salesforce/ts-sinon": "^1.4.
|
|
59
|
-
"@types/shelljs": "^0.8.
|
|
60
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
61
|
-
"@typescript-eslint/parser": "^5.
|
|
62
|
-
"chai": "^4.3.
|
|
63
|
-
"eslint": "^8.
|
|
58
|
+
"@salesforce/ts-sinon": "^1.4.2",
|
|
59
|
+
"@types/shelljs": "^0.8.11",
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^5.43.0",
|
|
61
|
+
"@typescript-eslint/parser": "^5.43.0",
|
|
62
|
+
"chai": "^4.3.7",
|
|
63
|
+
"eslint": "^8.27.0",
|
|
64
64
|
"eslint-config-prettier": "^8.5.0",
|
|
65
65
|
"eslint-config-salesforce": "^1.1.0",
|
|
66
66
|
"eslint-config-salesforce-license": "^0.1.6",
|
|
67
67
|
"eslint-config-salesforce-typescript": "^1.1.1",
|
|
68
68
|
"eslint-plugin-header": "^3.1.1",
|
|
69
69
|
"eslint-plugin-import": "^2.26.0",
|
|
70
|
-
"eslint-plugin-jsdoc": "^39.
|
|
70
|
+
"eslint-plugin-jsdoc": "^39.6.2",
|
|
71
71
|
"husky": "^7.0.4",
|
|
72
|
-
"mocha": "^9.
|
|
72
|
+
"mocha": "^9.2.2",
|
|
73
73
|
"nyc": "^15.1.0",
|
|
74
74
|
"prettier": "^2.7.1",
|
|
75
|
-
"pretty-quick": "^3.1.
|
|
76
|
-
"shelljs": "^0.8.
|
|
77
|
-
"shx": "^0.3.
|
|
75
|
+
"pretty-quick": "^3.1.3",
|
|
76
|
+
"shelljs": "^0.8.5",
|
|
77
|
+
"shx": "^0.3.4",
|
|
78
78
|
"sinon": "^10.0.0",
|
|
79
79
|
"ts-node": "^10.9.1",
|
|
80
|
-
"ts-prune": "^0.10.
|
|
81
|
-
"typescript": "^4.
|
|
80
|
+
"ts-prune": "^0.10.3",
|
|
81
|
+
"typescript": "^4.9.3"
|
|
82
82
|
},
|
|
83
83
|
"config": {},
|
|
84
84
|
"publishConfig": {
|