@salesforce/sf-plugins-core 1.8.1 → 1.11.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/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
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.11.0](https://github.com/salesforcecli/sf-plugins-core/compare/v1.10.0...v1.11.0) (2022-03-31)
6
+
7
+ ### Features
8
+
9
+ - support error codes help section ([4852a4f](https://github.com/salesforcecli/sf-plugins-core/commit/4852a4f75bcc744febf276293ed5bf45080436e6))
10
+
11
+ ## [1.10.0](https://github.com/salesforcecli/sf-plugins-core/compare/v1.9.0...v1.10.0) (2022-03-31)
12
+
13
+ ### Features
14
+
15
+ - warn users when using a beta command ([2cf26f2](https://github.com/salesforcecli/sf-plugins-core/commit/2cf26f2d363a40b0739f082bfe4aedd62fd4531f))
16
+
17
+ ## [1.9.0](https://github.com/salesforcecli/sf-plugins-core/compare/v1.8.1...v1.9.0) (2022-03-24)
18
+
19
+ ### Features
20
+
21
+ - explain what a valid api version looks like ([4c5669a](https://github.com/salesforcecli/sf-plugins-core/commit/4c5669a969ef79eae1d4aec76f6cb20df92aae5e))
22
+
5
23
  ### [1.8.1](https://github.com/salesforcecli/sf-plugins-core/compare/v1.8.0...v1.8.1) (2022-03-24)
6
24
 
7
25
  ### Bug Fixes
package/lib/sfCommand.js CHANGED
@@ -140,6 +140,9 @@ class SfCommand extends core_1.Command {
140
140
  if (this.statics.requiresProject) {
141
141
  this.project = await this.assignProject();
142
142
  }
143
+ if (this.statics.state === 'beta') {
144
+ this.warn(messages.getMessage('warning.CommandInBeta'));
145
+ }
143
146
  this.lifecycle.onWarning(async (warning) => {
144
147
  this.warn(warning);
145
148
  });
package/lib/util.d.ts CHANGED
@@ -15,5 +15,5 @@ export declare type HelpSection = {
15
15
  * @param header
16
16
  * @param vars
17
17
  */
18
- export declare function toHelpSection(header: string, ...vars: Array<OrgConfigProperties | SfdxPropertyKeys | EnvironmentVariable | string>): HelpSection;
18
+ export declare function toHelpSection(header: string, ...vars: Array<OrgConfigProperties | SfdxPropertyKeys | EnvironmentVariable | string | Record<string, string>>): HelpSection;
19
19
  //# sourceMappingURL=util.d.ts.map
package/lib/util.js CHANGED
@@ -19,23 +19,28 @@ const core_1 = require("@salesforce/core");
19
19
  */
20
20
  function toHelpSection(header, ...vars) {
21
21
  const body = vars
22
- .map((v) => {
23
- const orgConfig = core_1.ORG_CONFIG_ALLOWED_PROPERTIES.find(({ key }) => {
24
- return key === v;
25
- });
26
- if (orgConfig) {
27
- return { name: orgConfig.key, description: orgConfig.description };
22
+ .flatMap((v) => {
23
+ if (typeof v === 'string') {
24
+ const orgConfig = core_1.ORG_CONFIG_ALLOWED_PROPERTIES.find(({ key }) => {
25
+ return key === v;
26
+ });
27
+ if (orgConfig) {
28
+ return { name: orgConfig.key, description: orgConfig.description };
29
+ }
30
+ const sfdxProperty = core_1.SFDX_ALLOWED_PROPERTIES.find(({ key }) => key === v);
31
+ if (sfdxProperty) {
32
+ return { name: sfdxProperty.key.valueOf(), description: sfdxProperty.description };
33
+ }
34
+ const envVar = Object.entries(core_1.SUPPORTED_ENV_VARS).find(([k]) => k === v);
35
+ if (envVar) {
36
+ const [eKey, data] = envVar;
37
+ return { name: eKey, description: data.description };
38
+ }
39
+ return undefined;
28
40
  }
29
- const sfdxProperty = core_1.SFDX_ALLOWED_PROPERTIES.find(({ key }) => key === v);
30
- if (sfdxProperty) {
31
- return { name: sfdxProperty.key.valueOf(), description: sfdxProperty.description };
41
+ else {
42
+ return Object.entries(v).map(([name, description]) => ({ name, description }));
32
43
  }
33
- const envVar = Object.entries(core_1.SUPPORTED_ENV_VARS).find(([k]) => k === v);
34
- if (envVar) {
35
- const [eKey, data] = envVar;
36
- return { name: eKey, description: data.description };
37
- }
38
- return undefined;
39
44
  })
40
45
  .filter((b) => b);
41
46
  return { header, body };
@@ -48,7 +48,7 @@ API versions up to %s are deprecated. See %s for more information.
48
48
 
49
49
  # errors.InvalidApiVersion
50
50
 
51
- %s is not a valid API version.
51
+ %s is not a valid API version. It should end in '.0' like '54.0'.
52
52
 
53
53
  # errors.RetiredApiVersion
54
54
 
@@ -73,3 +73,7 @@ Info:
73
73
  # actions.tryThis
74
74
 
75
75
  Try this:
76
+
77
+ # warning.CommandInBeta
78
+
79
+ This command is currently in beta. Any aspect of this command can change without advanced notice. Don't use beta commands in your scripts.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/sf-plugins-core",
3
- "version": "1.8.1",
3
+ "version": "1.11.0",
4
4
  "description": "Utils for writing deploy and retrieve plugins",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",
@@ -32,8 +32,8 @@
32
32
  "/messages"
33
33
  ],
34
34
  "dependencies": {
35
- "@oclif/core": "^1.6.0",
36
- "@salesforce/core": "^3.7.9",
35
+ "@oclif/core": "^1.6.3",
36
+ "@salesforce/core": "^3.11.0",
37
37
  "@salesforce/kit": "^1.5.34",
38
38
  "@salesforce/ts-types": "^1.5.20",
39
39
  "chalk": "^2.4.2",