@salesforce/sf-plugins-core 1.18.1 → 1.19.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/lib/deployer.d.ts +1 -1
- package/lib/flags/duration.d.ts +2 -2
- package/lib/flags/salesforceId.d.ts +1 -1
- package/lib/hooks.d.ts +1 -1
- package/lib/sfCommand.js +17 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/util.d.ts +1 -1
- package/package.json +10 -10
package/lib/deployer.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
import { AnyJson, JsonMap } from '@salesforce/ts-types';
|
|
4
4
|
import { QuestionCollection, Answers } from 'inquirer';
|
|
5
|
-
export
|
|
5
|
+
export type DeployerResult = {
|
|
6
6
|
exitCode: number;
|
|
7
7
|
};
|
|
8
8
|
export declare abstract class Deployable {
|
package/lib/flags/duration.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Duration } from '@salesforce/kit';
|
|
2
|
-
|
|
3
|
-
export
|
|
2
|
+
type DurationUnit = Lowercase<keyof typeof Duration.Unit>;
|
|
3
|
+
export type DurationFlagConfig = {
|
|
4
4
|
unit: Required<DurationUnit>;
|
|
5
5
|
defaultValue?: number;
|
|
6
6
|
min?: number;
|
package/lib/hooks.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ interface SfHooks<T = unknown> extends Hooks {
|
|
|
13
13
|
'sf:login': Login.HookMeta;
|
|
14
14
|
'sf:logout': Logout.HookMeta<T & Deauthorizer>;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
type GenericHook<T extends keyof SfHooks, P> = Hook<T, SfHooks<P>>;
|
|
17
17
|
/**
|
|
18
18
|
* Class that provides a static method to run a pre-defined sf hook. See {@link SfHooks}.
|
|
19
19
|
*/
|
package/lib/sfCommand.js
CHANGED
|
@@ -202,6 +202,23 @@ class SfCommand extends core_1.Command {
|
|
|
202
202
|
this.lifecycle.onWarning(async (warning) => {
|
|
203
203
|
this.warn(warning);
|
|
204
204
|
});
|
|
205
|
+
const options = {
|
|
206
|
+
Command: this.ctor,
|
|
207
|
+
argv: this.argv,
|
|
208
|
+
commandId: this.id,
|
|
209
|
+
};
|
|
210
|
+
// what hooks are there in the plugins? Subscribe to matching lifecycle events
|
|
211
|
+
this.config.plugins
|
|
212
|
+
// omit oclif and telemetry (which subscribes itself to events already)
|
|
213
|
+
.filter((plugin) => !plugin.name.startsWith('@oclif/') && plugin.name !== '@salesforce/plugin-telemetry')
|
|
214
|
+
.flatMap((p) => Object.entries(p.hooks))
|
|
215
|
+
.map(([eventName, hooksForEvent]) => {
|
|
216
|
+
hooksForEvent.map(() => {
|
|
217
|
+
this.lifecycle.on(eventName, async (result) => {
|
|
218
|
+
await this.config.runHook(eventName, Object.assign(options, { result }));
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
});
|
|
205
222
|
return super._run();
|
|
206
223
|
}
|
|
207
224
|
/**
|
package/lib/types/index.d.ts
CHANGED
package/lib/util.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/sf-plugins-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.1",
|
|
4
4
|
"description": "Utils for writing deploy and retrieve plugins",
|
|
5
5
|
"main": "lib/exported",
|
|
6
6
|
"types": "lib/exported.d.ts",
|
|
@@ -33,40 +33,40 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@oclif/core": "^1.20.4",
|
|
36
|
-
"@salesforce/core": "^3.32.
|
|
36
|
+
"@salesforce/core": "^3.32.6",
|
|
37
37
|
"@salesforce/kit": "^1.7.1",
|
|
38
38
|
"@salesforce/ts-types": "^1.7.1",
|
|
39
39
|
"chalk": "^4",
|
|
40
40
|
"inquirer": "^8.2.5"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@oclif/test": "^2.2.
|
|
43
|
+
"@oclif/test": "^2.2.12",
|
|
44
44
|
"@salesforce/dev-config": "^3.0.0",
|
|
45
45
|
"@salesforce/dev-scripts": "^3.1.0",
|
|
46
46
|
"@salesforce/prettier-config": "^0.0.2",
|
|
47
47
|
"@salesforce/ts-sinon": "^1.4.2",
|
|
48
48
|
"@types/inquirer": "^8.2.3",
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
50
|
-
"@typescript-eslint/parser": "^5.
|
|
51
|
-
"chai": "^4.3.
|
|
52
|
-
"eslint": "^8.
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^5.44.0",
|
|
50
|
+
"@typescript-eslint/parser": "^5.45.0",
|
|
51
|
+
"chai": "^4.3.7",
|
|
52
|
+
"eslint": "^8.28.0",
|
|
53
53
|
"eslint-config-prettier": "^8.5.0",
|
|
54
54
|
"eslint-config-salesforce": "^1.1.0",
|
|
55
55
|
"eslint-config-salesforce-license": "^0.1.6",
|
|
56
56
|
"eslint-config-salesforce-typescript": "^1.1.1",
|
|
57
57
|
"eslint-plugin-header": "^3.1.1",
|
|
58
58
|
"eslint-plugin-import": "^2.26.0",
|
|
59
|
-
"eslint-plugin-jsdoc": "^39.6.
|
|
59
|
+
"eslint-plugin-jsdoc": "^39.6.4",
|
|
60
60
|
"husky": "^7.0.4",
|
|
61
61
|
"mocha": "^9.1.3",
|
|
62
62
|
"nyc": "^15.1.0",
|
|
63
|
-
"prettier": "^2.
|
|
63
|
+
"prettier": "^2.8.0",
|
|
64
64
|
"pretty-quick": "^3.1.3",
|
|
65
65
|
"shelljs": "0.8.5",
|
|
66
66
|
"sinon": "10.0.1",
|
|
67
67
|
"strip-ansi": "6.0.1",
|
|
68
68
|
"ts-node": "^10.7.0",
|
|
69
|
-
"typescript": "^4.
|
|
69
|
+
"typescript": "^4.9.3"
|
|
70
70
|
},
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|