@salesforce/sf-plugins-core 1.10.0 → 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,12 @@
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
+
5
11
  ## [1.10.0](https://github.com/salesforcecli/sf-plugins-core/compare/v1.9.0...v1.10.0) (2022-03-31)
6
12
 
7
13
  ### Features
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/sf-plugins-core",
3
- "version": "1.10.0",
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",