@salesforce/sf-plugins-core 1.6.1 → 1.7.2

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/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.7.2](https://github.com/salesforcecli/sf-plugins-core/compare/v1.7.1...v1.7.2) (2022-03-15)
6
+
7
+ ### Bug Fixes
8
+
9
+ - need to pass ms to timedPrompt function ([f285e07](https://github.com/salesforcecli/sf-plugins-core/commit/f285e07525937798d0251da69c86c05cc683edfd))
10
+
11
+ ### [1.7.1](https://github.com/salesforcecli/sf-plugins-core/compare/v1.7.0...v1.7.1) (2022-03-11)
12
+
13
+ ### Bug Fixes
14
+
15
+ - add oclif enum to exports ([71ee6ac](https://github.com/salesforcecli/sf-plugins-core/commit/71ee6ac7942790ffc519512ade67330614ada51b))
16
+ - expose timed prompt in command class ([3b056c6](https://github.com/salesforcecli/sf-plugins-core/commit/3b056c668d3379ada6f85e2e5b5f6da76c1a3223))
17
+
18
+ ## [1.7.0](https://github.com/salesforcecli/sf-plugins-core/compare/v1.6.1...v1.7.0) (2022-03-11)
19
+
20
+ ### Features
21
+
22
+ - suppress progress bar output with env vars ([d2e8a84](https://github.com/salesforcecli/sf-plugins-core/commit/d2e8a849d7ca93b3dba538a26ce5f9ab7f858984))
23
+
5
24
  ### [1.6.1](https://github.com/salesforcecli/sf-plugins-core/compare/v1.6.0...v1.6.1) (2022-03-09)
6
25
 
7
26
  ### Bug Fixes
package/lib/exported.d.ts CHANGED
@@ -11,6 +11,7 @@ export declare const Flags: {
11
11
  directory: (opts?: ({
12
12
  exists?: boolean | undefined;
13
13
  } & Partial<import("@oclif/core/lib/interfaces").OptionFlag<string>>) | undefined) => import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
14
+ enum: <T = string>(opts: import("@oclif/core/lib/interfaces").EnumFlagOptions<T>) => import("@oclif/core/lib/interfaces").OptionFlag<T>;
14
15
  file: (opts?: ({
15
16
  exists?: boolean | undefined;
16
17
  } & Partial<import("@oclif/core/lib/interfaces").OptionFlag<string>>) | undefined) => import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
package/lib/exported.js CHANGED
@@ -46,6 +46,7 @@ const duration_1 = require("./flags/duration");
46
46
  exports.Flags = {
47
47
  boolean: core_1.Flags.boolean,
48
48
  directory: core_1.Flags.directory,
49
+ enum: core_1.Flags.enum,
49
50
  file: core_1.Flags.file,
50
51
  integer: core_1.Flags.integer,
51
52
  string: core_1.Flags.string,
@@ -80,6 +80,10 @@ export declare abstract class SfCommand<T> extends Command {
80
80
  * }
81
81
  */
82
82
  prompt<R = Prompter.Answers>(questions: Prompter.Questions<R>, initialAnswers?: Partial<R>): Promise<R>;
83
+ /**
84
+ * Prompt user for information with a timeout (in milliseconds). See https://www.npmjs.com/package/inquirer for more.
85
+ */
86
+ timedPrompt<R = Prompter.Answers>(questions: Prompter.Questions<R>, ms?: number, initialAnswers?: Partial<R>): Promise<R>;
83
87
  _run<R>(): Promise<R | undefined>;
84
88
  /**
85
89
  * Wrap the command result into the standardized JSON structure.
package/lib/sfCommand.js CHANGED
@@ -28,7 +28,7 @@ class SfCommand extends core_1.Command {
28
28
  this.warnings = [];
29
29
  const outputEnabled = !this.jsonEnabled();
30
30
  this.spinner = new ux_1.Spinner(outputEnabled);
31
- this.progress = new ux_1.Progress(outputEnabled);
31
+ this.progress = new ux_1.Progress(outputEnabled && core_2.envVars.getBoolean(core_2.EnvironmentVariable.SF_USE_PROGRESS_BAR, true));
32
32
  this.ux = new ux_1.Ux(outputEnabled);
33
33
  this.prompter = new ux_1.Prompter();
34
34
  this.lifecycle = core_2.Lifecycle.getInstance();
@@ -113,6 +113,12 @@ class SfCommand extends core_1.Command {
113
113
  async prompt(questions, initialAnswers) {
114
114
  return this.prompter.prompt(questions, initialAnswers);
115
115
  }
116
+ /**
117
+ * Prompt user for information with a timeout (in milliseconds). See https://www.npmjs.com/package/inquirer for more.
118
+ */
119
+ async timedPrompt(questions, ms = 10000, initialAnswers) {
120
+ return this.prompter.timedPrompt(questions, ms, initialAnswers);
121
+ }
116
122
  async _run() {
117
123
  if (this.statics.requiresProject) {
118
124
  this.project = await this.assignProject();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/sf-plugins-core",
3
- "version": "1.6.1",
3
+ "version": "1.7.2",
4
4
  "description": "Utils for writing deploy and retrieve plugins",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",