@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.
@@ -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', 'v'],
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 declare type DeployerResult = {
5
+ export type DeployerResult = {
6
6
  exitCode: number;
7
7
  };
8
8
  export declare abstract class Deployable {
@@ -1,6 +1,6 @@
1
1
  import { Duration } from '@salesforce/kit';
2
- declare type DurationUnit = Lowercase<keyof typeof Duration.Unit>;
3
- export declare type DurationFlagConfig = {
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;
@@ -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(),
@@ -1,4 +1,4 @@
1
- export declare type IdFlagConfig = {
1
+ export type IdFlagConfig = {
2
2
  /**
3
3
  * Can specify if the version must be 15 or 18 characters long. Leave blank to allow either 15 or 18.
4
4
  */
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
- declare type GenericHook<T extends keyof SfHooks, P> = Hook<T, SfHooks<P>>;
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
  /**
@@ -1,6 +1,6 @@
1
1
  import { Deauthorizer } from '../deauthorizer';
2
2
  import { Deployer } from '../deployer';
3
- export declare type JsonObject = {
3
+ export type JsonObject = {
4
4
  [key: string]: string | string[] | number | number[] | boolean | boolean[] | null | undefined;
5
5
  };
6
6
  /**
package/lib/util.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { EnvironmentVariable, OrgConfigProperties, SfdxPropertyKeys } from '@salesforce/core';
2
- export declare type HelpSection = {
2
+ export type HelpSection = {
3
3
  header: string;
4
4
  body: Array<{
5
5
  name: string;
@@ -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.18.0",
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.40.0",
50
- "@typescript-eslint/parser": "^5.42.0",
51
- "chai": "^4.3.6",
52
- "eslint": "^8.26.0",
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.8.4"
69
+ "typescript": "^4.9.3"
70
70
  },
71
71
  "publishConfig": {
72
72
  "access": "public"