sf-delta-tests 0.2.0 → 0.2.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/README.md +38 -2
- package/lib/commands/delta/test-classes.js +11 -3
- package/lib/commands/delta/test-classes.js.map +1 -1
- package/lib/services/flow-service.d.ts +21 -4
- package/lib/services/flow-service.js +52 -24
- package/lib/services/flow-service.js.map +1 -1
- package/messages/delta.test-classes.md +1 -1
- package/oclif.manifest.json +2 -2
- package/package.json +215 -159
package/README.md
CHANGED
|
@@ -39,7 +39,43 @@ sf plugins
|
|
|
39
39
|
|
|
40
40
|
## Commands
|
|
41
41
|
|
|
42
|
-
<!-- commands -->
|
|
42
|
+
<!-- commands -->
|
|
43
|
+
* [`sf delta test-classes`](#sf-delta-test-classes)
|
|
44
|
+
|
|
45
|
+
## `sf delta test-classes`
|
|
46
|
+
|
|
47
|
+
Run only related tests
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
USAGE
|
|
51
|
+
$ sf delta test-classes -o <value> [--json] [--flags-dir <value>] [-p <value>] [--always-run-test <value>...]
|
|
52
|
+
[--include-all-flows]
|
|
53
|
+
|
|
54
|
+
FLAGS
|
|
55
|
+
-o, --target-org=<value> (required) The org you want to check the dependencies against.
|
|
56
|
+
-p, --package-path=<value> [default: manifest/package.xml] Path to the package.xml that will be deployed.
|
|
57
|
+
--always-run-test=<value>... A test class to run when no tests need to be ran.
|
|
58
|
+
--[no-]include-all-flows When enabled, if any Flow is changed, include all Flows that require test coverage
|
|
59
|
+
based on their trigger type or process type. This ensures proper test coverage
|
|
60
|
+
validation since Salesforce checks coverage for all such Flows during deployment,
|
|
61
|
+
not just the changed ones. Use --no-include-all-flows to disable.
|
|
62
|
+
|
|
63
|
+
GLOBAL FLAGS
|
|
64
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
65
|
+
--json Format output as json.
|
|
66
|
+
|
|
67
|
+
DESCRIPTION
|
|
68
|
+
Run only related tests
|
|
69
|
+
|
|
70
|
+
Calculates the tests needed to be ran based on the changed metadata given using the Salesforce Dependency API. For
|
|
71
|
+
Flows, also queries FlowTestCoverage to include test classes that have previously covered the Flows.
|
|
72
|
+
|
|
73
|
+
EXAMPLES
|
|
74
|
+
testCmd=$(sf delta test-classes --target-org matt@never.io.dev)
|
|
75
|
+
|
|
76
|
+
$ sf project deploy validate ${testCmd}
|
|
77
|
+
```
|
|
78
|
+
<!-- commandsstop -->
|
|
43
79
|
|
|
44
80
|
- [`sf delta test-classes`](#sf-delta-test-classes)
|
|
45
81
|
|
|
@@ -76,4 +112,4 @@ EXAMPLES
|
|
|
76
112
|
$ sf project deploy validate ${testCmd}
|
|
77
113
|
```
|
|
78
114
|
|
|
79
|
-
<!-- commandsstop -->
|
|
115
|
+
<!-- commandsstop -->
|
|
@@ -62,6 +62,7 @@ export default class TestClasses extends SfCommand {
|
|
|
62
62
|
const org = flags['target-org'];
|
|
63
63
|
const conn = org.getConnection(undefined);
|
|
64
64
|
this.dependencyService.connect(conn);
|
|
65
|
+
this.flowService.connect(conn);
|
|
65
66
|
this.debug('Getting dependencies from SF');
|
|
66
67
|
// Download all dependencies from SF
|
|
67
68
|
const combinedApexClassData = await this.dependencyService.getDependenciesByObjects();
|
|
@@ -72,10 +73,11 @@ export default class TestClasses extends SfCommand {
|
|
|
72
73
|
// Get manifest data and transform that into a list of metadata
|
|
73
74
|
const manifestData = await this.manifestService.parseManifest(flags['package-path']);
|
|
74
75
|
const changedMetadataWithType = this.manifestService.extractMetadataComponentsWithType(manifestData);
|
|
75
|
-
|
|
76
|
-
const
|
|
76
|
+
// Get changed flows and their trigger objects for dependency analysis
|
|
77
|
+
const changedFlowNames = this.flowService.getChangedFlowNames(changedMetadataWithType);
|
|
78
|
+
const flowTriggerObjectNames = await this.flowService.getTriggerObjectsFromFlows(changedFlowNames);
|
|
77
79
|
const changedMetadata = lodash.uniq([
|
|
78
|
-
...
|
|
80
|
+
...changedFlowNames,
|
|
79
81
|
...flowTriggerObjectNames,
|
|
80
82
|
...changedMetadataWithType.map((c) => c.name),
|
|
81
83
|
]);
|
|
@@ -98,9 +100,15 @@ export default class TestClasses extends SfCommand {
|
|
|
98
100
|
const testNames = await this.apexClassService.filterApexTest(classList);
|
|
99
101
|
const simpleTestNames = this.apexClassService.filterApexTestSimple(classList);
|
|
100
102
|
this.debug({ testNames, simpleTestNames });
|
|
103
|
+
const hasTestableFlowChanged = await this.flowService.hasTestableFlowChanged(changedFlowNames);
|
|
104
|
+
if (hasTestableFlowChanged) {
|
|
105
|
+
const flowCoverageTestNames = await this.flowService.getFlowTestCoverage(changedFlowNames, flags['include-all-flows']);
|
|
106
|
+
testNames.push(...flowCoverageTestNames);
|
|
107
|
+
}
|
|
101
108
|
if (flags['always-run-test']) {
|
|
102
109
|
testNames.push(...flags['always-run-test']);
|
|
103
110
|
}
|
|
111
|
+
this.debug({ testNames, simpleTestNames });
|
|
104
112
|
if (testNames.length === 0) {
|
|
105
113
|
this.debug('No relevant tests found, skip running tests');
|
|
106
114
|
// TODO: Debate this one, if we found no relevant tests, should all or none be ran?
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-classes.js","sourceRoot":"","sources":["../../../src/commands/delta/test-classes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC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CAAC;gBACvB,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;YAC1E,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;YACrC,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC5D,CAAC;IACH,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Connection } from '@salesforce/core';
|
|
1
2
|
import { MetadataComponent } from './manifest-service.js';
|
|
2
3
|
export type FlowMetadata = {
|
|
3
4
|
apiName: string;
|
|
@@ -5,16 +6,27 @@ export type FlowMetadata = {
|
|
|
5
6
|
processType?: string;
|
|
6
7
|
triggerObjectOrEvent?: string;
|
|
7
8
|
};
|
|
9
|
+
export type FlowTestCoverage = {
|
|
10
|
+
ApexTestClassId: string;
|
|
11
|
+
FlowDefinitionViewId: string;
|
|
12
|
+
TestMethodName: string;
|
|
13
|
+
NumElementsCovered: number;
|
|
14
|
+
NumElementsNotCovered: number;
|
|
15
|
+
};
|
|
8
16
|
export declare class FlowService {
|
|
9
17
|
private alwaysArray;
|
|
10
18
|
private xmlParser;
|
|
11
19
|
private logger;
|
|
20
|
+
private connection;
|
|
21
|
+
connect(connection: Connection): void;
|
|
22
|
+
/**
|
|
23
|
+
* Gets changed Flow names from the manifest.
|
|
24
|
+
*/
|
|
25
|
+
getChangedFlowNames(changedMetadataWithType: MetadataComponent[]): string[];
|
|
12
26
|
/**
|
|
13
|
-
*
|
|
14
|
-
* If includeAllFlows is true, and any changed flow requires tests, return changed flows plus all flows that require tests.
|
|
15
|
-
* Otherwise, returns only the changed flows.
|
|
27
|
+
* Checks if any of the changed flows require test coverage.
|
|
16
28
|
*/
|
|
17
|
-
|
|
29
|
+
hasTestableFlowChanged(changedFlowNames: string[], rootPath?: string): Promise<boolean>;
|
|
18
30
|
/**
|
|
19
31
|
* Extracts Flow metadata from local Flow definition files.
|
|
20
32
|
* Parses .flow-meta.xml files to get trigger information.
|
|
@@ -28,6 +40,11 @@ export declare class FlowService {
|
|
|
28
40
|
* Gets all Flow API names from local Flow definition files.
|
|
29
41
|
*/
|
|
30
42
|
getAllFlowNames(rootPath?: string): Promise<string[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Gets test class names that cover the specified Flows from Salesforce's FlowTestCoverage records.
|
|
45
|
+
* This queries the Tooling API to find which Apex test classes have previously executed and covered these Flows.
|
|
46
|
+
*/
|
|
47
|
+
getFlowTestCoverage(changedFlows: string[] | undefined, includeAllFlows: boolean): Promise<string[]>;
|
|
31
48
|
/**
|
|
32
49
|
* Determines if a Flow requires test coverage.
|
|
33
50
|
* All processes and autolaunched flows require coverage, except Screen Flows.
|
|
@@ -4,7 +4,7 @@ import { readFile } from 'fs/promises';
|
|
|
4
4
|
import { glob } from 'glob';
|
|
5
5
|
import { XMLParser } from 'fast-xml-parser';
|
|
6
6
|
import { Logger } from '@salesforce/core';
|
|
7
|
-
import
|
|
7
|
+
import loash from 'lodash';
|
|
8
8
|
import { FLOW } from '../elements/object-types.js';
|
|
9
9
|
export class FlowService {
|
|
10
10
|
alwaysArray = ['Flow.processMetadataValues'];
|
|
@@ -15,33 +15,28 @@ export class FlowService {
|
|
|
15
15
|
isArray: (_, jpath) => this.alwaysArray.includes(jpath),
|
|
16
16
|
});
|
|
17
17
|
logger = new Logger('FlowService');
|
|
18
|
+
connection;
|
|
19
|
+
connect(connection) {
|
|
20
|
+
this.connection = connection;
|
|
21
|
+
}
|
|
18
22
|
/**
|
|
19
|
-
* Gets Flow names
|
|
20
|
-
* If includeAllFlows is true, and any changed flow requires tests, return changed flows plus all flows that require tests.
|
|
21
|
-
* Otherwise, returns only the changed flows.
|
|
23
|
+
* Gets changed Flow names from the manifest.
|
|
22
24
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
getChangedFlowNames(changedMetadataWithType) {
|
|
26
|
+
return changedMetadataWithType.filter((m) => m.type === FLOW).map((m) => m.name);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Checks if any of the changed flows require test coverage.
|
|
30
|
+
*/
|
|
31
|
+
async hasTestableFlowChanged(changedFlowNames, rootPath = 'force-app/main/default/flows') {
|
|
32
|
+
if (changedFlowNames.length === 0) {
|
|
33
|
+
return false;
|
|
27
34
|
}
|
|
28
|
-
|
|
29
|
-
const changedFlowMetadata = await this.getFlowMetadata(changedFlows);
|
|
35
|
+
const changedFlowMetadata = await this.getFlowMetadata(changedFlowNames, rootPath);
|
|
30
36
|
const changedFlowsRequiringTests = changedFlowMetadata.filter((flow) => this.flowRequiresTestCoverage(flow));
|
|
31
|
-
this.logger.
|
|
32
|
-
this.logger.
|
|
33
|
-
|
|
34
|
-
// Get all flows and filter to only those requiring test coverage
|
|
35
|
-
const allFlowNames = await this.getAllFlowNames();
|
|
36
|
-
const allFlowsRequiringTests = (await this.getFlowMetadata(allFlowNames))
|
|
37
|
-
.filter((flow) => this.flowRequiresTestCoverage(flow))
|
|
38
|
-
.map((flow) => flow.apiName);
|
|
39
|
-
this.logger.info('changedFlows', changedFlows);
|
|
40
|
-
this.logger.info('allFlowNames', allFlowNames);
|
|
41
|
-
this.logger.info('allFlowsRequiringTests', allFlowsRequiringTests);
|
|
42
|
-
return loadsh.uniq([...changedFlows, ...allFlowsRequiringTests]);
|
|
43
|
-
}
|
|
44
|
-
return changedFlows;
|
|
37
|
+
this.logger.debug('changedFlowMetadata', changedFlowMetadata);
|
|
38
|
+
this.logger.debug('changedFlowsRequiringTests', changedFlowsRequiringTests);
|
|
39
|
+
return changedFlowsRequiringTests.length > 0;
|
|
45
40
|
}
|
|
46
41
|
/**
|
|
47
42
|
* Extracts Flow metadata from local Flow definition files.
|
|
@@ -96,6 +91,39 @@ export class FlowService {
|
|
|
96
91
|
return parsedPath.name.replace('.flow-meta', '');
|
|
97
92
|
});
|
|
98
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Gets test class names that cover the specified Flows from Salesforce's FlowTestCoverage records.
|
|
96
|
+
* This queries the Tooling API to find which Apex test classes have previously executed and covered these Flows.
|
|
97
|
+
*/
|
|
98
|
+
async getFlowTestCoverage(changedFlows = [], includeAllFlows) {
|
|
99
|
+
if (!this.connection) {
|
|
100
|
+
throw new Error('Connection not set. Call connect() first.');
|
|
101
|
+
}
|
|
102
|
+
if (changedFlows.length === 0) {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
const result = await this.connection.tooling
|
|
107
|
+
.sobject('FlowTestCoverage')
|
|
108
|
+
.find({
|
|
109
|
+
'FlowVersion.Definition.DeveloperName': includeAllFlows
|
|
110
|
+
? { $ne: null }
|
|
111
|
+
: { $in: changedFlows },
|
|
112
|
+
}, {
|
|
113
|
+
'ApexTestClass.Name': 1,
|
|
114
|
+
'FlowVersion.Definition.DeveloperName': 1,
|
|
115
|
+
});
|
|
116
|
+
const testClassNames = result
|
|
117
|
+
.map((record) => record.ApexTestClass?.Name)
|
|
118
|
+
.filter(this.isNotNullOrUndefined);
|
|
119
|
+
this.logger.debug('FlowTestCoverage query returned test classes:', testClassNames);
|
|
120
|
+
return loash.uniq(testClassNames);
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
this.logger.warn('Failed to query FlowTestCoverage:', error);
|
|
124
|
+
return [];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
99
127
|
/**
|
|
100
128
|
* Determines if a Flow requires test coverage.
|
|
101
129
|
* All processes and autolaunched flows require coverage, except Screen Flows.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-service.js","sourceRoot":"","sources":["../../src/services/flow-service.ts"],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K,EAAE,WAAW,EAAE,CAAC;gBAC3C,oBAAoB,GAAG,kBAAkB,CAAC,KAAK,CAAC,WAAW,CAAC;YAC9D,CAAC;QACH,CAAC;QAED,OAAO;YACL,WAAW;YACX,WAAW;YACX,oBAAoB;SACrB,CAAC;IACJ,CAAC;IAEO,oBAAoB,GAAG,CAAI,KAA2B,EAAc,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC;CACtH"}
|
|
@@ -4,7 +4,7 @@ Run only related tests
|
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
Calculates the tests needed to be ran based on the changed metadata given using the Salesforce Dependency API
|
|
7
|
+
Calculates the tests needed to be ran based on the changed metadata given using the Salesforce Dependency API. For Flows, also queries FlowTestCoverage to include test classes that have previously covered the Flows.
|
|
8
8
|
|
|
9
9
|
# examples
|
|
10
10
|
|
package/oclif.manifest.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"delta:test-classes": {
|
|
4
4
|
"aliases": [],
|
|
5
5
|
"args": {},
|
|
6
|
-
"description": "Calculates the tests needed to be ran based on the changed metadata given using the Salesforce Dependency API",
|
|
6
|
+
"description": "Calculates the tests needed to be ran based on the changed metadata given using the Salesforce Dependency API. For Flows, also queries FlowTestCoverage to include test classes that have previously covered the Flows.",
|
|
7
7
|
"examples": [
|
|
8
8
|
"testCmd=$(sf delta test-classes --target-org matt@never.io.dev)\r\nsf project deploy validate ${testCmd}"
|
|
9
9
|
],
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
]
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
|
-
"version": "0.1
|
|
77
|
+
"version": "0.2.1"
|
|
78
78
|
}
|
package/package.json
CHANGED
|
@@ -1,159 +1,215 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "sf-delta-tests",
|
|
3
|
-
"description": "Calculate dependencies and scope to relevant tests",
|
|
4
|
-
"version": "0.2.
|
|
5
|
-
"type": "module",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@oclif/core": "^4.8.0",
|
|
8
|
-
"@salesforce/core": "^8.24.0",
|
|
9
|
-
"@salesforce/kit": "^3.2.4",
|
|
10
|
-
"@salesforce/sf-plugins-core": "^12.2.6",
|
|
11
|
-
"@salesforce/source-deploy-retrieve": "^12.31.4",
|
|
12
|
-
"fast-xml-parser": "^5.3.3",
|
|
13
|
-
"glob": "^13.0.0",
|
|
14
|
-
"lodash": "^4.17.21",
|
|
15
|
-
"tslib": "^2.8.1"
|
|
16
|
-
},
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"/
|
|
22
|
-
"/
|
|
23
|
-
"/
|
|
24
|
-
|
|
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
|
-
"
|
|
50
|
-
"
|
|
51
|
-
},
|
|
52
|
-
"
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"files": [
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
"
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
"
|
|
127
|
-
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
"
|
|
133
|
-
]
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
"
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
"
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "sf-delta-tests",
|
|
3
|
+
"description": "Calculate dependencies and scope to relevant tests",
|
|
4
|
+
"version": "0.2.1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@oclif/core": "^4.8.0",
|
|
8
|
+
"@salesforce/core": "^8.24.0",
|
|
9
|
+
"@salesforce/kit": "^3.2.4",
|
|
10
|
+
"@salesforce/sf-plugins-core": "^12.2.6",
|
|
11
|
+
"@salesforce/source-deploy-retrieve": "^12.31.4",
|
|
12
|
+
"fast-xml-parser": "^5.3.3",
|
|
13
|
+
"glob": "^13.0.0",
|
|
14
|
+
"lodash": "^4.17.21",
|
|
15
|
+
"tslib": "^2.8.1"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@salesforce/dev-config": "^4.3.2",
|
|
19
|
+
"@salesforce/dev-scripts": "^11.0.4",
|
|
20
|
+
"@salesforce/prettier-config": "^0.0.4",
|
|
21
|
+
"@salesforce/ts-sinon": "^1.4.31",
|
|
22
|
+
"@swc/core": "^1.15.8",
|
|
23
|
+
"@types/inquirer": "^9.0.9",
|
|
24
|
+
"@types/lodash": "^4.17.23",
|
|
25
|
+
"@types/node": "24.10.7",
|
|
26
|
+
"@typescript-eslint/eslint-plugin": "^5.59.8",
|
|
27
|
+
"@typescript-eslint/parser": "^5.62.0",
|
|
28
|
+
"chai": "^6.2.2",
|
|
29
|
+
"clean-publish": "^6.0.1",
|
|
30
|
+
"eslint": "^8.47.0",
|
|
31
|
+
"eslint-config-prettier": "^8.5.0",
|
|
32
|
+
"eslint-config-salesforce": "^2.0.1",
|
|
33
|
+
"eslint-config-salesforce-typescript": "^1.1.2",
|
|
34
|
+
"eslint-plugin-import": "2.27.5",
|
|
35
|
+
"eslint-plugin-jsdoc": "^46.4.6",
|
|
36
|
+
"eslint-plugin-sf-plugin": "^1.16.2",
|
|
37
|
+
"husky": "^9.1.7",
|
|
38
|
+
"mocha": "^11.7.5",
|
|
39
|
+
"nyc": "^17.1.0",
|
|
40
|
+
"oclif": "^4.22.65",
|
|
41
|
+
"prettier": "^3.7.4",
|
|
42
|
+
"pretty-quick": "^4.2.2",
|
|
43
|
+
"shx": "^0.4.0",
|
|
44
|
+
"sinon": "^21.0.1",
|
|
45
|
+
"ts-node": "^10.9.2",
|
|
46
|
+
"typescript": "^5.9.3",
|
|
47
|
+
"wireit": "^0.14.12"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=14.0.0"
|
|
51
|
+
},
|
|
52
|
+
"files": [
|
|
53
|
+
"/lib",
|
|
54
|
+
"/messages",
|
|
55
|
+
"/oclif.manifest.json"
|
|
56
|
+
],
|
|
57
|
+
"keywords": [
|
|
58
|
+
"force",
|
|
59
|
+
"salesforce",
|
|
60
|
+
"sfdx",
|
|
61
|
+
"salesforcedx",
|
|
62
|
+
"sfdx-plugin",
|
|
63
|
+
"sf-plugin",
|
|
64
|
+
"sf"
|
|
65
|
+
],
|
|
66
|
+
"license": "BSD-3-Clause",
|
|
67
|
+
"main": "lib/index.js",
|
|
68
|
+
"oclif": {
|
|
69
|
+
"commands": "./lib/commands",
|
|
70
|
+
"bin": "sf",
|
|
71
|
+
"topicSeparator": " ",
|
|
72
|
+
"devPlugins": [
|
|
73
|
+
"@oclif/plugin-help"
|
|
74
|
+
],
|
|
75
|
+
"topics": {
|
|
76
|
+
"hello": {
|
|
77
|
+
"description": "Commands to say hello."
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"scripts": {
|
|
82
|
+
"build": "wireit",
|
|
83
|
+
"clean": "sf-clean",
|
|
84
|
+
"clean-all": "sf-clean all",
|
|
85
|
+
"clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json",
|
|
86
|
+
"compile": "wireit",
|
|
87
|
+
"docs": "sf-docs",
|
|
88
|
+
"format": "wireit",
|
|
89
|
+
"lint": "wireit",
|
|
90
|
+
"postinstall": "yarn husky install",
|
|
91
|
+
"postpack": "shx rm -f oclif.manifest.json",
|
|
92
|
+
"prepublish": "sf-prepack",
|
|
93
|
+
"postpublish": "shx rm -f oclif.manifest.json",
|
|
94
|
+
"publish": "clean-publish --fields scripts",
|
|
95
|
+
"prepack": "sf-prepack",
|
|
96
|
+
"test": "wireit",
|
|
97
|
+
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
|
|
98
|
+
"test:only": "wireit",
|
|
99
|
+
"version": "oclif readme",
|
|
100
|
+
"prepare": "husky"
|
|
101
|
+
},
|
|
102
|
+
"publishConfig": {
|
|
103
|
+
"access": "public"
|
|
104
|
+
},
|
|
105
|
+
"wireit": {
|
|
106
|
+
"build": {
|
|
107
|
+
"dependencies": [
|
|
108
|
+
"compile",
|
|
109
|
+
"lint"
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"compile": {
|
|
113
|
+
"command": "tsc -p . --pretty --incremental",
|
|
114
|
+
"files": [
|
|
115
|
+
"src/**/*.ts",
|
|
116
|
+
"**/tsconfig.json",
|
|
117
|
+
"messages/**"
|
|
118
|
+
],
|
|
119
|
+
"output": [
|
|
120
|
+
"lib/**",
|
|
121
|
+
"*.tsbuildinfo"
|
|
122
|
+
],
|
|
123
|
+
"clean": "if-file-deleted"
|
|
124
|
+
},
|
|
125
|
+
"format": {
|
|
126
|
+
"command": "prettier --write \"+(src|test|schemas)/**/*.+(ts|js|json)|command-snapshot.json\"",
|
|
127
|
+
"files": [
|
|
128
|
+
"src/**/*.ts",
|
|
129
|
+
"test/**/*.ts",
|
|
130
|
+
"schemas/**/*.json",
|
|
131
|
+
"command-snapshot.json",
|
|
132
|
+
".prettier*"
|
|
133
|
+
],
|
|
134
|
+
"output": []
|
|
135
|
+
},
|
|
136
|
+
"lint": {
|
|
137
|
+
"command": "eslint src test --color --cache --cache-location .eslintcache",
|
|
138
|
+
"files": [
|
|
139
|
+
"src/**/*.ts",
|
|
140
|
+
"test/**/*.ts",
|
|
141
|
+
"messages/**",
|
|
142
|
+
"**/.eslint*",
|
|
143
|
+
"**/tsconfig.json"
|
|
144
|
+
],
|
|
145
|
+
"output": []
|
|
146
|
+
},
|
|
147
|
+
"test:compile": {
|
|
148
|
+
"command": "tsc -p \"./test\" --pretty",
|
|
149
|
+
"files": [
|
|
150
|
+
"test/**/*.ts",
|
|
151
|
+
"**/tsconfig.json"
|
|
152
|
+
],
|
|
153
|
+
"output": []
|
|
154
|
+
},
|
|
155
|
+
"test": {
|
|
156
|
+
"dependencies": [
|
|
157
|
+
"test:compile",
|
|
158
|
+
"test:only",
|
|
159
|
+
"lint"
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
"test:only": {
|
|
163
|
+
"command": "nyc mocha \"test/**/*.test.ts\"",
|
|
164
|
+
"env": {
|
|
165
|
+
"FORCE_COLOR": "2"
|
|
166
|
+
},
|
|
167
|
+
"files": [
|
|
168
|
+
"test/**/*.ts",
|
|
169
|
+
"src/**/*.ts",
|
|
170
|
+
"**/tsconfig.json",
|
|
171
|
+
".mocha*",
|
|
172
|
+
"!*.nut.ts",
|
|
173
|
+
".nycrc"
|
|
174
|
+
],
|
|
175
|
+
"output": []
|
|
176
|
+
},
|
|
177
|
+
"test:command-reference": {
|
|
178
|
+
"command": "\"./bin/dev\" commandreference:generate --erroronwarnings",
|
|
179
|
+
"files": [
|
|
180
|
+
"src/**/*.ts",
|
|
181
|
+
"messages/**",
|
|
182
|
+
"package.json"
|
|
183
|
+
],
|
|
184
|
+
"output": [
|
|
185
|
+
"tmp/root"
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
"test:deprecation-policy": {
|
|
189
|
+
"command": "\"./bin/dev\" snapshot:compare",
|
|
190
|
+
"files": [
|
|
191
|
+
"src/**/*.ts"
|
|
192
|
+
],
|
|
193
|
+
"output": [],
|
|
194
|
+
"dependencies": [
|
|
195
|
+
"compile"
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
"test:json-schema": {
|
|
199
|
+
"command": "\"./bin/dev\" schema:compare",
|
|
200
|
+
"files": [
|
|
201
|
+
"src/**/*.ts",
|
|
202
|
+
"schemas"
|
|
203
|
+
],
|
|
204
|
+
"output": []
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"author": "matthew-gladman",
|
|
208
|
+
"volta": {
|
|
209
|
+
"node": "24.12.0",
|
|
210
|
+
"yarn": "1.22.22"
|
|
211
|
+
},
|
|
212
|
+
"clean-publish": {
|
|
213
|
+
"packageManager": "yarn"
|
|
214
|
+
}
|
|
215
|
+
}
|