@salesforce/plugin-apex 2.2.22 → 2.3.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/lib/commands/apex/run/test.d.ts +4 -5
- package/lib/commands/apex/run/test.js +26 -25
- package/lib/commands/apex/run/test.js.map +1 -1
- package/messages/runtest.md +12 -10
- package/oclif.manifest.json +31 -16
- package/package.json +16 -16
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CancellationTokenSource,
|
|
1
|
+
import { CancellationTokenSource, TestRunIdResult } from '@salesforce/apex-node';
|
|
2
2
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
3
|
import { Duration } from '@salesforce/kit';
|
|
4
4
|
import { RunResult } from '../../../reporters';
|
|
@@ -17,17 +17,16 @@ export default class Test extends SfCommand<RunCommandResult> {
|
|
|
17
17
|
'code-coverage': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
18
|
'output-dir': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
19
19
|
'test-level': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
20
|
-
'class-names': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
20
|
+
'class-names': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
21
21
|
'result-format': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
22
|
-
'suite-names': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
23
|
-
tests: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
22
|
+
'suite-names': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
23
|
+
tests: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
24
24
|
wait: import("@oclif/core/lib/interfaces").OptionFlag<Duration | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
25
25
|
synchronous: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
26
26
|
'detailed-coverage': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
27
27
|
};
|
|
28
28
|
protected cancellationTokenSource: CancellationTokenSource;
|
|
29
29
|
run(): Promise<RunCommandResult>;
|
|
30
|
-
validateFlags(codeCoverage?: boolean, resultFormatFlag?: string, classNames?: string, suiteNames?: string, tests?: string, synchronous?: boolean, testLevel?: TestLevel): Promise<TestLevel>;
|
|
31
30
|
private runTest;
|
|
32
31
|
private runTestAsynchronous;
|
|
33
32
|
}
|
|
@@ -15,6 +15,7 @@ const utils_1 = require("../../../utils");
|
|
|
15
15
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
16
16
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-apex', 'runtest');
|
|
17
17
|
exports.TestLevelValues = ['RunLocalTests', 'RunAllTestsInOrg', 'RunSpecifiedTests'];
|
|
18
|
+
const exclusiveTestSpecifiers = ['class-names', 'suite-names', 'tests'];
|
|
18
19
|
class Test extends sf_plugins_core_1.SfCommand {
|
|
19
20
|
constructor() {
|
|
20
21
|
super(...arguments);
|
|
@@ -22,7 +23,7 @@ class Test extends sf_plugins_core_1.SfCommand {
|
|
|
22
23
|
}
|
|
23
24
|
async run() {
|
|
24
25
|
const { flags } = await this.parse(Test);
|
|
25
|
-
const testLevel = await
|
|
26
|
+
const testLevel = await validateFlags(flags['class-names'], flags['suite-names'], flags.tests, flags.synchronous, flags['test-level']);
|
|
26
27
|
// add listener for errors
|
|
27
28
|
process.on('uncaughtException', (err) => {
|
|
28
29
|
throw messages.createError('apexLibErr', [err.message]);
|
|
@@ -57,35 +58,16 @@ class Test extends sf_plugins_core_1.SfCommand {
|
|
|
57
58
|
return result;
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
// eslint-disable-next-line class-methods-use-this
|
|
61
|
-
async validateFlags(codeCoverage, resultFormatFlag, classNames, suiteNames, tests, synchronous, testLevel) {
|
|
62
|
-
if ((classNames && (suiteNames || tests)) || (suiteNames && tests)) {
|
|
63
|
-
return Promise.reject(new Error(messages.getMessage('classSuiteTestErr')));
|
|
64
|
-
}
|
|
65
|
-
if (synchronous && (suiteNames || (classNames && classNames.split(',').length > 1))) {
|
|
66
|
-
return Promise.reject(new Error(messages.getMessage('syncClassErr')));
|
|
67
|
-
}
|
|
68
|
-
if ((tests || classNames || suiteNames) && testLevel && testLevel !== 'RunSpecifiedTests') {
|
|
69
|
-
return Promise.reject(new Error(messages.getMessage('testLevelErr')));
|
|
70
|
-
}
|
|
71
|
-
if (testLevel) {
|
|
72
|
-
return testLevel;
|
|
73
|
-
}
|
|
74
|
-
if (classNames || suiteNames || tests) {
|
|
75
|
-
return "RunSpecifiedTests" /* TestLevel.RunSpecifiedTests */;
|
|
76
|
-
}
|
|
77
|
-
return "RunLocalTests" /* TestLevel.RunLocalTests */;
|
|
78
|
-
}
|
|
79
61
|
async runTest(testService, flags, testLevel) {
|
|
80
62
|
const payload = {
|
|
81
|
-
...(await testService.buildSyncPayload(testLevel, flags.tests, flags['class-names'])),
|
|
63
|
+
...(await testService.buildSyncPayload(testLevel, flags.tests?.join(','), flags['class-names']?.join(','))),
|
|
82
64
|
skipCodeCoverage: !flags['code-coverage'],
|
|
83
65
|
};
|
|
84
66
|
return testService.runTestSynchronous(payload, flags['code-coverage'], this.cancellationTokenSource.token);
|
|
85
67
|
}
|
|
86
68
|
async runTestAsynchronous(testService, flags, testLevel) {
|
|
87
69
|
const payload = {
|
|
88
|
-
...(await testService.buildAsyncPayload(testLevel, flags.tests, flags['class-names'], flags['suite-names'])),
|
|
70
|
+
...(await testService.buildAsyncPayload(testLevel, flags.tests?.join(','), flags['class-names']?.join(','), flags['suite-names']?.join(','))),
|
|
89
71
|
skipCodeCoverage: !flags['code-coverage'],
|
|
90
72
|
};
|
|
91
73
|
// cast as TestRunIdResult because we're building an async payload which will return an async result
|
|
@@ -122,12 +104,13 @@ Test.flags = {
|
|
|
122
104
|
description: messages.getMessage('flags.test-level.description'),
|
|
123
105
|
options: exports.TestLevelValues,
|
|
124
106
|
}),
|
|
125
|
-
'class-names': sf_plugins_core_1.
|
|
107
|
+
'class-names': (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
126
108
|
deprecateAliases: true,
|
|
127
109
|
aliases: ['classnames'],
|
|
128
110
|
char: 'n',
|
|
129
111
|
summary: messages.getMessage('flags.class-names.summary'),
|
|
130
112
|
description: messages.getMessage('flags.class-names.description'),
|
|
113
|
+
exclusive: exclusiveTestSpecifiers.filter((specifier) => specifier !== 'class-names'),
|
|
131
114
|
}),
|
|
132
115
|
'result-format': sf_plugins_core_1.Flags.string({
|
|
133
116
|
deprecateAliases: true,
|
|
@@ -137,17 +120,19 @@ Test.flags = {
|
|
|
137
120
|
options: utils_1.resultFormat,
|
|
138
121
|
default: 'human',
|
|
139
122
|
}),
|
|
140
|
-
'suite-names': sf_plugins_core_1.
|
|
123
|
+
'suite-names': (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
141
124
|
deprecateAliases: true,
|
|
142
125
|
aliases: ['suitenames'],
|
|
143
126
|
char: 's',
|
|
144
127
|
summary: messages.getMessage('flags.suite-names.summary'),
|
|
145
128
|
description: messages.getMessage('flags.suite-names.description'),
|
|
129
|
+
exclusive: exclusiveTestSpecifiers.filter((specifier) => specifier !== 'suite-names'),
|
|
146
130
|
}),
|
|
147
|
-
tests: sf_plugins_core_1.
|
|
131
|
+
tests: (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
148
132
|
char: 't',
|
|
149
133
|
summary: messages.getMessage('flags.tests.summary'),
|
|
150
134
|
description: messages.getMessage('flags.tests.description'),
|
|
135
|
+
exclusive: exclusiveTestSpecifiers.filter((specifier) => specifier !== 'tests'),
|
|
151
136
|
}),
|
|
152
137
|
// we want to pass `undefined` to the API
|
|
153
138
|
// eslint-disable-next-line sf-plugin/flag-min-max-default
|
|
@@ -169,4 +154,20 @@ Test.flags = {
|
|
|
169
154
|
dependsOn: ['code-coverage'],
|
|
170
155
|
}),
|
|
171
156
|
};
|
|
157
|
+
// eslint-disable-next-line class-methods-use-this
|
|
158
|
+
const validateFlags = async (classNames, suiteNames, tests, synchronous, testLevel) => {
|
|
159
|
+
if (synchronous && (suiteNames || (classNames?.length && classNames.length > 1))) {
|
|
160
|
+
return Promise.reject(new Error(messages.getMessage('syncClassErr')));
|
|
161
|
+
}
|
|
162
|
+
if ((tests || classNames || suiteNames) && testLevel && testLevel !== 'RunSpecifiedTests') {
|
|
163
|
+
return Promise.reject(new Error(messages.getMessage('testLevelErr')));
|
|
164
|
+
}
|
|
165
|
+
if (testLevel) {
|
|
166
|
+
return testLevel;
|
|
167
|
+
}
|
|
168
|
+
if (classNames || suiteNames || tests) {
|
|
169
|
+
return "RunSpecifiedTests" /* TestLevel.RunSpecifiedTests */;
|
|
170
|
+
}
|
|
171
|
+
return "RunLocalTests" /* TestLevel.RunLocalTests */;
|
|
172
|
+
};
|
|
172
173
|
//# sourceMappingURL=test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../../src/commands/apex/run/test.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,qDAAqH;AACrH,
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../../src/commands/apex/run/test.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,qDAAqH;AACrH,iEAQqC;AACrC,2CAAqD;AAGrD,kDAA6D;AAC7D,0CAA8C;AAE9C,eAAQ,CAAC,uBAAu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AC;IACF,mBAAmB,EAAE,uBAAK,CAAC,OAAO,CAAC;QACjC,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE,CAAC,kBAAkB,CAAC;QAC7B,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,iCAAiC,CAAC;QAC/D,SAAS,EAAE,CAAC,eAAe,CAAC;KAC7B,CAAC;CACH,CAAC;AA+GJ,kDAAkD;AAClD,MAAM,aAAa,GAAG,KAAK,EACzB,UAAqB,EACrB,UAAqB,EACrB,KAAgB,EAChB,WAAqB,EACrB,SAAqB,EACD,EAAE;IACtB,IAAI,WAAW,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,EAAE,MAAM,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE;QAChF,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;KACvE;IAED,IAAI,CAAC,KAAK,IAAI,UAAU,IAAI,UAAU,CAAC,IAAI,SAAS,IAAI,SAAS,KAAK,mBAAmB,EAAE;QACzF,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;KACvE;IAED,IAAI,SAAS,EAAE;QACb,OAAO,SAAS,CAAC;KAClB;IACD,IAAI,UAAU,IAAI,UAAU,IAAI,KAAK,EAAE;QACrC,6DAAmC;KACpC;IACD,qDAA+B;AACjC,CAAC,CAAC"}
|
package/messages/runtest.md
CHANGED
|
@@ -20,15 +20,15 @@ NOTE: The testRunCoverage value (JSON and JUnit result formats) is a percentage
|
|
|
20
20
|
|
|
21
21
|
- Run the specified Apex test classes in your default org and display results in human-readable form:
|
|
22
22
|
|
|
23
|
-
<%= config.bin %> <%= command.id %> --class-names
|
|
23
|
+
<%= config.bin %> <%= command.id %> --class-names MyClassTest --class-names MyOtherClassTest --result-format human
|
|
24
24
|
|
|
25
25
|
- Run the specified Apex test suites in your default org and include code coverage results and additional details:
|
|
26
26
|
|
|
27
|
-
<%= config.bin %> <%= command.id %> --suite-names
|
|
27
|
+
<%= config.bin %> <%= command.id %> --suite-names MySuite --suite-names MyOtherSuite --code-coverage --detailed-coverage
|
|
28
28
|
|
|
29
29
|
- Run the specified Apex tests in your default org and display results in human-readable output:
|
|
30
30
|
|
|
31
|
-
<%= config.bin %> <%= command.id %> --tests
|
|
31
|
+
<%= config.bin %> <%= command.id %> --tests MyClassTest.testCoolFeature --tests MyClassTest.testAwesomeFeature --tests AnotherClassTest --tests namespace.TheirClassTest.testThis --result-format human
|
|
32
32
|
|
|
33
33
|
- Run all tests in the org with the specified username with the specified test level; save the output to the specified directory:
|
|
34
34
|
|
|
@@ -40,27 +40,33 @@ Format of the test results.
|
|
|
40
40
|
|
|
41
41
|
# flags.class-names.summary
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
Apex test class names to run; default is all classes.
|
|
44
44
|
|
|
45
45
|
# flags.class-names.description
|
|
46
46
|
|
|
47
47
|
If you select --class-names, you can't specify --suite-names or --tests.
|
|
48
|
+
For multiple classes, repeat the flag for each.
|
|
49
|
+
--class-names Class1 --class-names Class2
|
|
48
50
|
|
|
49
51
|
# flags.suite-names.summary
|
|
50
52
|
|
|
51
|
-
|
|
53
|
+
Apex test suite names to run; default is all suites.
|
|
52
54
|
|
|
53
55
|
# flags.suite-names.description
|
|
54
56
|
|
|
55
57
|
If you select --suite-names, you can't specify --class-names or --tests.
|
|
58
|
+
For multiple suites, repeat the flag for each.
|
|
59
|
+
--suite-names Suite1 --suite-names Suite2
|
|
56
60
|
|
|
57
61
|
# flags.tests.summary
|
|
58
62
|
|
|
59
|
-
|
|
63
|
+
Apex test class names or IDs and, if applicable, test methods to run; default is all tests.
|
|
60
64
|
|
|
61
65
|
# flags.tests.description
|
|
62
66
|
|
|
63
67
|
If you specify --tests, you can't specify --class-names or --suite-names
|
|
68
|
+
For multiple tests, repeat the flag for each.
|
|
69
|
+
--tests Test1 --tests Test2
|
|
64
70
|
|
|
65
71
|
# flags.code-coverage.summary
|
|
66
72
|
|
|
@@ -98,10 +104,6 @@ Display detailed code coverage per test.
|
|
|
98
104
|
|
|
99
105
|
Run "%s apex get test -i %s -o %s" to retrieve test results
|
|
100
106
|
|
|
101
|
-
# classSuiteTestErr
|
|
102
|
-
|
|
103
|
-
Specify either classnames, suitenames, or tests
|
|
104
|
-
|
|
105
107
|
# syncClassErr
|
|
106
108
|
|
|
107
109
|
Synchronous test runs can include test methods from only one Apex class. Omit the --synchronous flag or include tests from only one class
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.3.0",
|
|
3
3
|
"commands": {
|
|
4
4
|
"apex:run": {
|
|
5
5
|
"id": "apex:run",
|
|
@@ -363,9 +363,9 @@
|
|
|
363
363
|
],
|
|
364
364
|
"examples": [
|
|
365
365
|
"Run all Apex tests and suites in your default org:\n<%= config.bin %> <%= command.id %>",
|
|
366
|
-
"Run the specified Apex test classes in your default org and display results in human-readable form:\n<%= config.bin %> <%= command.id %> --class-names
|
|
367
|
-
"Run the specified Apex test suites in your default org and include code coverage results and additional details:\n<%= config.bin %> <%= command.id %> --suite-names
|
|
368
|
-
"Run the specified Apex tests in your default org and display results in human-readable output:\n<%= config.bin %> <%= command.id %> --tests
|
|
366
|
+
"Run the specified Apex test classes in your default org and display results in human-readable form:\n<%= config.bin %> <%= command.id %> --class-names MyClassTest --class-names MyOtherClassTest --result-format human",
|
|
367
|
+
"Run the specified Apex test suites in your default org and include code coverage results and additional details:\n<%= config.bin %> <%= command.id %> --suite-names MySuite --suite-names MyOtherSuite --code-coverage --detailed-coverage",
|
|
368
|
+
"Run the specified Apex tests in your default org and display results in human-readable output:\n<%= config.bin %> <%= command.id %> --tests MyClassTest.testCoolFeature --tests MyClassTest.testAwesomeFeature --tests AnotherClassTest --tests namespace.TheirClassTest.testThis --result-format human",
|
|
369
369
|
"Run all tests in the org with the specified username with the specified test level; save the output to the specified directory:\n<%= config.bin %> <%= command.id %> --test-level RunLocalTests --output-dir <path to outputdir> --target-org me@my.org"
|
|
370
370
|
],
|
|
371
371
|
"deprecateAliases": true,
|
|
@@ -455,13 +455,18 @@
|
|
|
455
455
|
"name": "class-names",
|
|
456
456
|
"type": "option",
|
|
457
457
|
"char": "n",
|
|
458
|
-
"summary": "
|
|
459
|
-
"description": "If you select --class-names, you can't specify --suite-names or --tests
|
|
460
|
-
"multiple":
|
|
458
|
+
"summary": "Apex test class names to run; default is all classes.",
|
|
459
|
+
"description": "If you select --class-names, you can't specify --suite-names or --tests.\nFor multiple classes, repeat the flag for each.\n--class-names Class1 --class-names Class2",
|
|
460
|
+
"multiple": true,
|
|
461
|
+
"exclusive": [
|
|
462
|
+
"suite-names",
|
|
463
|
+
"tests"
|
|
464
|
+
],
|
|
461
465
|
"deprecateAliases": true,
|
|
462
466
|
"aliases": [
|
|
463
467
|
"classnames"
|
|
464
|
-
]
|
|
468
|
+
],
|
|
469
|
+
"delimiter": ","
|
|
465
470
|
},
|
|
466
471
|
"result-format": {
|
|
467
472
|
"name": "result-format",
|
|
@@ -485,22 +490,32 @@
|
|
|
485
490
|
"name": "suite-names",
|
|
486
491
|
"type": "option",
|
|
487
492
|
"char": "s",
|
|
488
|
-
"summary": "
|
|
489
|
-
"description": "If you select --suite-names, you can't specify --class-names or --tests
|
|
490
|
-
"multiple":
|
|
493
|
+
"summary": "Apex test suite names to run; default is all suites.",
|
|
494
|
+
"description": "If you select --suite-names, you can't specify --class-names or --tests.\nFor multiple suites, repeat the flag for each.\n--suite-names Suite1 --suite-names Suite2",
|
|
495
|
+
"multiple": true,
|
|
496
|
+
"exclusive": [
|
|
497
|
+
"class-names",
|
|
498
|
+
"tests"
|
|
499
|
+
],
|
|
491
500
|
"deprecateAliases": true,
|
|
492
501
|
"aliases": [
|
|
493
502
|
"suitenames"
|
|
494
|
-
]
|
|
503
|
+
],
|
|
504
|
+
"delimiter": ","
|
|
495
505
|
},
|
|
496
506
|
"tests": {
|
|
497
507
|
"name": "tests",
|
|
498
508
|
"type": "option",
|
|
499
509
|
"char": "t",
|
|
500
|
-
"summary": "
|
|
501
|
-
"description": "If you specify --tests, you can't specify --class-names or --suite-names",
|
|
502
|
-
"multiple":
|
|
503
|
-
"
|
|
510
|
+
"summary": "Apex test class names or IDs and, if applicable, test methods to run; default is all tests.",
|
|
511
|
+
"description": "If you specify --tests, you can't specify --class-names or --suite-names\nFor multiple tests, repeat the flag for each.\n--tests Test1 --tests Test2",
|
|
512
|
+
"multiple": true,
|
|
513
|
+
"exclusive": [
|
|
514
|
+
"class-names",
|
|
515
|
+
"suite-names"
|
|
516
|
+
],
|
|
517
|
+
"deprecateAliases": true,
|
|
518
|
+
"delimiter": ","
|
|
504
519
|
},
|
|
505
520
|
"wait": {
|
|
506
521
|
"name": "wait",
|
package/package.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-apex",
|
|
3
3
|
"description": "Apex commands",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"main": "lib/index.js",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@oclif/core": "^2.8.2",
|
|
10
10
|
"@salesforce/apex-node": "^1.6.1",
|
|
11
|
-
"@salesforce/core": "^3.36.
|
|
12
|
-
"@salesforce/sf-plugins-core": "^2.4.
|
|
11
|
+
"@salesforce/core": "^3.36.0",
|
|
12
|
+
"@salesforce/sf-plugins-core": "^2.4.2",
|
|
13
13
|
"chalk": "^4.1.0",
|
|
14
14
|
"tslib": "^2"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@oclif/plugin-command-snapshot": "^3.3.
|
|
17
|
+
"@oclif/plugin-command-snapshot": "^3.3.13",
|
|
18
18
|
"@oclif/plugin-help": "^5",
|
|
19
|
-
"@salesforce/dev-config": "
|
|
20
|
-
"@salesforce/dev-scripts": "^
|
|
19
|
+
"@salesforce/dev-config": "^4.0.1",
|
|
20
|
+
"@salesforce/dev-scripts": "^5.1.0",
|
|
21
21
|
"@salesforce/plugin-command-reference": "^2.4.5",
|
|
22
|
-
"@salesforce/prettier-config": "^0.0.
|
|
22
|
+
"@salesforce/prettier-config": "^0.0.3",
|
|
23
23
|
"@salesforce/ts-sinon": "^1.4.4",
|
|
24
|
-
"@salesforce/ts-types": "
|
|
25
|
-
"@swc/core": "^1.3.
|
|
24
|
+
"@salesforce/ts-types": "^2.0.1",
|
|
25
|
+
"@swc/core": "^1.3.60",
|
|
26
26
|
"@typescript-eslint/eslint-plugin": "^5.59.5",
|
|
27
|
-
"@typescript-eslint/parser": "^5.59.
|
|
27
|
+
"@typescript-eslint/parser": "^5.59.7",
|
|
28
28
|
"chai": "^4.2.0",
|
|
29
|
-
"eslint": "^8.
|
|
29
|
+
"eslint": "^8.41.0",
|
|
30
30
|
"eslint-config-prettier": "^8.8.0",
|
|
31
|
-
"eslint-config-salesforce": "^
|
|
31
|
+
"eslint-config-salesforce": "^2.0.1",
|
|
32
32
|
"eslint-config-salesforce-license": "^0.2.0",
|
|
33
33
|
"eslint-config-salesforce-typescript": "^1.1.1",
|
|
34
34
|
"eslint-plugin-header": "^3.0.0",
|
|
35
35
|
"eslint-plugin-import": "^2.27.5",
|
|
36
|
-
"eslint-plugin-jsdoc": "^
|
|
36
|
+
"eslint-plugin-jsdoc": "^43.0.5",
|
|
37
37
|
"eslint-plugin-sf-plugin": "^1.15.3",
|
|
38
38
|
"husky": "^7.0.4",
|
|
39
39
|
"mocha": "^9.1.3",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"wireit": "^0.9.5"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
51
|
-
"node": ">=
|
|
51
|
+
"node": ">=16.0.0"
|
|
52
52
|
},
|
|
53
53
|
"files": [
|
|
54
54
|
"yarn.lock",
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
}
|
|
230
230
|
},
|
|
231
231
|
"sfdx": {
|
|
232
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-apex/2.
|
|
233
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-apex/2.
|
|
232
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-apex/2.3.0.crt",
|
|
233
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-apex/2.3.0.sig"
|
|
234
234
|
}
|
|
235
235
|
}
|