@salesforce/sf-plugins-core 1.18.0 → 1.19.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/compatibility.js +1 -1
- package/lib/deployer.d.ts +1 -1
- package/lib/flags/duration.d.ts +2 -2
- package/lib/flags/orgFlags.js +2 -0
- 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/messages/messages.md +8 -0
- package/package.json +6 -6
package/lib/compatibility.js
CHANGED
|
@@ -67,7 +67,7 @@ exports.requiredOrgFlagWithDeprecations = (0, orgFlags_1.requiredOrgFlag)({
|
|
|
67
67
|
* @deprecated
|
|
68
68
|
*/
|
|
69
69
|
exports.requiredHubFlagWithDeprecations = (0, orgFlags_1.requiredHubFlag)({
|
|
70
|
-
aliases: ['targetdevhubusername'
|
|
70
|
+
aliases: ['targetdevhubusername'],
|
|
71
71
|
deprecateAliases: true,
|
|
72
72
|
});
|
|
73
73
|
//# sourceMappingURL=compatibility.js.map
|
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/flags/orgFlags.js
CHANGED
|
@@ -96,6 +96,7 @@ exports.optionalOrgFlag = core_1.Flags.custom({
|
|
|
96
96
|
*/
|
|
97
97
|
exports.requiredOrgFlag = core_1.Flags.custom({
|
|
98
98
|
char: 'o',
|
|
99
|
+
summary: messages.getMessage('flags.targetOrg.summary'),
|
|
99
100
|
parse: async (input) => getOrgOrThrow(input),
|
|
100
101
|
default: async () => getOrgOrThrow(),
|
|
101
102
|
defaultHelp: async () => (await getOrgOrThrow())?.getUsername(),
|
|
@@ -124,6 +125,7 @@ exports.requiredOrgFlag = core_1.Flags.custom({
|
|
|
124
125
|
*/
|
|
125
126
|
exports.requiredHubFlag = core_1.Flags.custom({
|
|
126
127
|
char: 'v',
|
|
128
|
+
summary: messages.getMessage('flags.targetDevHubOrg.summary'),
|
|
127
129
|
parse: async (input) => getHubOrThrow(input),
|
|
128
130
|
default: async () => getHubOrThrow(),
|
|
129
131
|
defaultHelp: async () => (await getHubOrThrow())?.getUsername(),
|
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/messages/messages.md
CHANGED
|
@@ -34,6 +34,14 @@ No default dev hub found. Use -v or --target-dev-hub to specify an environment.
|
|
|
34
34
|
|
|
35
35
|
The specified org %s is not a Dev Hub.
|
|
36
36
|
|
|
37
|
+
# flags.targetOrg.summary
|
|
38
|
+
|
|
39
|
+
Username or alias of the target org.
|
|
40
|
+
|
|
41
|
+
# flags.targetDevHubOrg.summary
|
|
42
|
+
|
|
43
|
+
Username or alias of the Dev Hub org.
|
|
44
|
+
|
|
37
45
|
# flags.apiVersion.description
|
|
38
46
|
|
|
39
47
|
Override the api version used for api requests made by this command
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/sf-plugins-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "Utils for writing deploy and retrieve plugins",
|
|
5
5
|
"main": "lib/exported",
|
|
6
6
|
"types": "lib/exported.d.ts",
|
|
@@ -46,10 +46,10 @@
|
|
|
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.43.0",
|
|
50
|
+
"@typescript-eslint/parser": "^5.43.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",
|
|
@@ -66,7 +66,7 @@
|
|
|
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"
|