@salesforce/cli 2.41.1 → 2.41.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/README.md CHANGED
@@ -24,7 +24,7 @@ $ npm install -g @salesforce/cli
24
24
  $ sf COMMAND
25
25
  running command...
26
26
  $ sf (--version|-v)
27
- @salesforce/cli/2.41.1 linux-x64 node-v20.12.2
27
+ @salesforce/cli/2.41.2 linux-x64 node-v20.12.2
28
28
  $ sf --help [COMMAND]
29
29
  USAGE
30
30
  $ sf COMMAND
@@ -3251,7 +3251,7 @@ EXAMPLES
3251
3251
  $ sf org list auth
3252
3252
  ```
3253
3253
 
3254
- _See code: [@salesforce/plugin-auth](https://github.com/salesforcecli/plugin-auth/blob/3.6.5/src/commands/org/list/auth.ts)_
3254
+ _See code: [@salesforce/plugin-auth](https://github.com/salesforcecli/plugin-auth/blob/3.6.6/src/commands/org/list/auth.ts)_
3255
3255
 
3256
3256
  ## `sf org list limits`
3257
3257
 
@@ -3551,7 +3551,7 @@ FLAG DESCRIPTIONS
3551
3551
  To specify a sandbox, set --instance-url to "https://<MyDomainName>--<SandboxName>.sandbox.my.salesforce.com".
3552
3552
  ```
3553
3553
 
3554
- _See code: [@salesforce/plugin-auth](https://github.com/salesforcecli/plugin-auth/blob/3.6.5/src/commands/org/login/access-token.ts)_
3554
+ _See code: [@salesforce/plugin-auth](https://github.com/salesforcecli/plugin-auth/blob/3.6.6/src/commands/org/login/access-token.ts)_
3555
3555
 
3556
3556
  ## `sf org login device`
3557
3557
 
@@ -3611,7 +3611,7 @@ FLAG DESCRIPTIONS
3611
3611
  To specify a sandbox, set --instance-url to "https://<MyDomainName>--<SandboxName>.sandbox.my.salesforce.com".
3612
3612
  ```
3613
3613
 
3614
- _See code: [@salesforce/plugin-auth](https://github.com/salesforcecli/plugin-auth/blob/3.6.5/src/commands/org/login/device.ts)_
3614
+ _See code: [@salesforce/plugin-auth](https://github.com/salesforcecli/plugin-auth/blob/3.6.6/src/commands/org/login/device.ts)_
3615
3615
 
3616
3616
  ## `sf org login jwt`
3617
3617
 
@@ -3702,7 +3702,7 @@ FLAG DESCRIPTIONS
3702
3702
  To specify a sandbox, set --instance-url to "https://<MyDomainName>--<SandboxName>.sandbox.my.salesforce.com".
3703
3703
  ```
3704
3704
 
3705
- _See code: [@salesforce/plugin-auth](https://github.com/salesforcecli/plugin-auth/blob/3.6.5/src/commands/org/login/jwt.ts)_
3705
+ _See code: [@salesforce/plugin-auth](https://github.com/salesforcecli/plugin-auth/blob/3.6.6/src/commands/org/login/jwt.ts)_
3706
3706
 
3707
3707
  ## `sf org login sfdx-url`
3708
3708
 
@@ -3767,7 +3767,7 @@ EXAMPLES
3767
3767
  $ echo url | sf org login sfdx-url --sfdx-url-stdin
3768
3768
  ```
3769
3769
 
3770
- _See code: [@salesforce/plugin-auth](https://github.com/salesforcecli/plugin-auth/blob/3.6.5/src/commands/org/login/sfdx-url.ts)_
3770
+ _See code: [@salesforce/plugin-auth](https://github.com/salesforcecli/plugin-auth/blob/3.6.6/src/commands/org/login/sfdx-url.ts)_
3771
3771
 
3772
3772
  ## `sf org login web`
3773
3773
 
@@ -3854,7 +3854,7 @@ FLAG DESCRIPTIONS
3854
3854
  To specify a sandbox, set --instance-url to "https://<MyDomainName>--<SandboxName>.sandbox.my.salesforce.com".
3855
3855
  ```
3856
3856
 
3857
- _See code: [@salesforce/plugin-auth](https://github.com/salesforcecli/plugin-auth/blob/3.6.5/src/commands/org/login/web.ts)_
3857
+ _See code: [@salesforce/plugin-auth](https://github.com/salesforcecli/plugin-auth/blob/3.6.6/src/commands/org/login/web.ts)_
3858
3858
 
3859
3859
  ## `sf org logout`
3860
3860
 
@@ -3915,7 +3915,7 @@ FLAG DESCRIPTIONS
3915
3915
  All orgs includes Dev Hubs, sandboxes, DE orgs, and expired, deleted, and unknown-status scratch orgs.
3916
3916
  ```
3917
3917
 
3918
- _See code: [@salesforce/plugin-auth](https://github.com/salesforcecli/plugin-auth/blob/3.6.5/src/commands/org/logout.ts)_
3918
+ _See code: [@salesforce/plugin-auth](https://github.com/salesforcecli/plugin-auth/blob/3.6.6/src/commands/org/logout.ts)_
3919
3919
 
3920
3920
  ## `sf org open`
3921
3921
 
@@ -9,15 +9,41 @@ import stripAnsi from 'strip-ansi';
9
9
  import chalk from 'chalk';
10
10
  import { SfCommandHelp } from './sfCommandHelp.js';
11
11
  export default class SfHelp extends Help {
12
- constructor() {
13
- super(...arguments);
12
+ constructor(config, opts) {
13
+ super(config, opts);
14
14
  this.CommandHelpClass = SfCommandHelp;
15
15
  this.showShortHelp = false;
16
16
  this.commands = [];
17
+ this.commands = this.config.commandIDs.map((c) => `${this.config.bin} ${toConfiguredId(c, this.config)}`);
18
+ const regexes = [];
19
+ for (const cmd of this.commands) {
20
+ const subCommands = this.commands.filter((c) => c !== cmd && c.startsWith(cmd)).map((c) => c.replace(cmd, ''));
21
+ /**
22
+ * This regex matches any command in the help output.
23
+ * It will continue to match until the next space, quote, or period.
24
+ *
25
+ * Examples that will match (see sf project deploy start as an example):
26
+ * - sf deploy project start
27
+ * - "sf deploy project start"
28
+ * - sf org create scratch|sandbox
29
+ * - "sf org create scratch|sandbox"
30
+ *
31
+ * It will not match any child commands of the current command.
32
+ * For instance, the examples in `sf org list metadata --help` should match `sf org list metadata` but not `sf org list`.
33
+ *
34
+ * Example of constructed regex that won't match child commands:
35
+ * - /sf org list([^\s".]+)?(?! auth| limits| sobject record-counts| metadata| metadata-types| users)/g
36
+ * - /sf org list metadata([^\s".]+)?(?!-types)/g
37
+ */
38
+ let regexString = `${cmd}([^\\s".]+)?`;
39
+ if (subCommands.length)
40
+ regexString += `(?!${subCommands.join('|')})`;
41
+ regexes.push(regexString);
42
+ }
43
+ this.commandIdRegex = new RegExp(regexes.join('|'), 'g');
17
44
  }
18
45
  async showHelp(argv) {
19
46
  this.showShortHelp = argv.includes('-h');
20
- this.commands = this.config.commandIDs.map((c) => `${this.config.bin} ${toConfiguredId(c, this.config)}`);
21
47
  return super.showHelp(argv);
22
48
  }
23
49
  getCommandHelpClass(command) {
@@ -27,24 +53,12 @@ export default class SfHelp extends Help {
27
53
  }
28
54
  log(...args) {
29
55
  const formatted = args.map((arg) => {
30
- for (const cmd of this.commands) {
31
- /**
32
- * This regex matches any command in the help output.
33
- * It will continue to match until the next space, quote, or period.
34
- *
35
- * Examples that will match:
36
- * - sf deploy project start
37
- * - "sf deploy project start"
38
- * - sf org create scratch|sandbox
39
- * - "sf org create scratch|sandbox"
40
- */
41
- const regex = new RegExp(`${cmd}([^\\s".]+)?`, 'g');
42
- const [match] = stripAnsi(arg.slice()).match(regex) ?? [];
43
- if (match) {
44
- arg = arg.replace(regex, chalk.dim(match));
45
- }
56
+ let formattedArg = arg.slice();
57
+ const matches = stripAnsi(formattedArg).match(this.commandIdRegex) ?? [];
58
+ for (const match of matches) {
59
+ formattedArg = formattedArg.replaceAll(match, chalk.dim(match));
46
60
  }
47
- return arg;
61
+ return formattedArg;
48
62
  });
49
63
  super.log(...formatted);
50
64
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@salesforce/cli",
3
- "version": "2.41.1",
3
+ "version": "2.41.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@salesforce/cli",
9
- "version": "2.41.1",
9
+ "version": "2.41.2",
10
10
  "hasInstallScript": true,
11
11
  "license": "BSD-3-Clause",
12
12
  "dependencies": {
@@ -25,7 +25,7 @@
25
25
  "@salesforce/core": "^7.2.0",
26
26
  "@salesforce/kit": "^3.1.0",
27
27
  "@salesforce/plugin-apex": "3.1.11",
28
- "@salesforce/plugin-auth": "3.6.5",
28
+ "@salesforce/plugin-auth": "3.6.6",
29
29
  "@salesforce/plugin-data": "3.3.2",
30
30
  "@salesforce/plugin-deploy-retrieve": "3.6.9",
31
31
  "@salesforce/plugin-info": "3.2.4",
@@ -37,7 +37,7 @@
37
37
  "@salesforce/plugin-settings": "2.2.3",
38
38
  "@salesforce/plugin-sobject": "1.3.6",
39
39
  "@salesforce/plugin-source": "3.3.5",
40
- "@salesforce/plugin-telemetry": "3.3.4",
40
+ "@salesforce/plugin-telemetry": "3.3.5",
41
41
  "@salesforce/plugin-templates": "56.2.4",
42
42
  "@salesforce/plugin-trust": "3.6.8",
43
43
  "@salesforce/plugin-user": "3.5.5",
@@ -4656,9 +4656,9 @@
4656
4656
  }
4657
4657
  },
4658
4658
  "node_modules/@salesforce/plugin-auth": {
4659
- "version": "3.6.5",
4660
- "resolved": "https://registry.npmjs.org/@salesforce/plugin-auth/-/plugin-auth-3.6.5.tgz",
4661
- "integrity": "sha512-lqDSKeJlC2nBlNuH9xQ8ihmjCpM590Ayxd0C2VuVHyhWk+GNL0mEJV/y6H5Rtl3Hyxq6/99eAEeGdzUdCRvXyg==",
4659
+ "version": "3.6.6",
4660
+ "resolved": "https://registry.npmjs.org/@salesforce/plugin-auth/-/plugin-auth-3.6.6.tgz",
4661
+ "integrity": "sha512-h8U6PQ7RSjQjKQjvIbG8/w8A0DFPWG90hPjxR2nkVNCUuvg4FjM+ookptQGzuKay8MxBr0bYJDsfc4c5po+jxA==",
4662
4662
  "license": "BSD-3-Clause",
4663
4663
  "dependencies": {
4664
4664
  "@inquirer/checkbox": "^1.5.2",
@@ -5137,9 +5137,9 @@
5137
5137
  }
5138
5138
  },
5139
5139
  "node_modules/@salesforce/plugin-telemetry": {
5140
- "version": "3.3.4",
5141
- "resolved": "https://registry.npmjs.org/@salesforce/plugin-telemetry/-/plugin-telemetry-3.3.4.tgz",
5142
- "integrity": "sha512-Xuc3yNbe5k2oW8hFONq7vY+pL2ivRQFyuLAit4Jz485aY4AoBP8htBFoFp8vls4xgO/3bCtNec0rRi9KcgROXQ==",
5140
+ "version": "3.3.5",
5141
+ "resolved": "https://registry.npmjs.org/@salesforce/plugin-telemetry/-/plugin-telemetry-3.3.5.tgz",
5142
+ "integrity": "sha512-6RJEYxEYPNru6izCBuDf4Rwh8H+YImGBvXPUF8h7YsNdg3TDvhjIKiiMjvYsByjRywenqkF5ZTpQ9OC2nAPoTA==",
5143
5143
  "license": "BSD-3-Clause",
5144
5144
  "dependencies": {
5145
5145
  "@oclif/core": "^3.26.2",
package/oclif.lock CHANGED
@@ -2365,10 +2365,10 @@
2365
2365
  color-convert "^2.0.1"
2366
2366
  color-name "^2.0.0"
2367
2367
 
2368
- "@salesforce/plugin-auth@3.6.5":
2369
- version "3.6.5"
2370
- resolved "https://registry.npmjs.org/@salesforce/plugin-auth/-/plugin-auth-3.6.5.tgz"
2371
- integrity sha512-lqDSKeJlC2nBlNuH9xQ8ihmjCpM590Ayxd0C2VuVHyhWk+GNL0mEJV/y6H5Rtl3Hyxq6/99eAEeGdzUdCRvXyg==
2368
+ "@salesforce/plugin-auth@3.6.6":
2369
+ version "3.6.6"
2370
+ resolved "https://registry.npmjs.org/@salesforce/plugin-auth/-/plugin-auth-3.6.6.tgz"
2371
+ integrity sha512-h8U6PQ7RSjQjKQjvIbG8/w8A0DFPWG90hPjxR2nkVNCUuvg4FjM+ookptQGzuKay8MxBr0bYJDsfc4c5po+jxA==
2372
2372
  dependencies:
2373
2373
  "@inquirer/checkbox" "^1.5.2"
2374
2374
  "@inquirer/select" "^1.3.3"
@@ -2573,10 +2573,10 @@
2573
2573
  got "^13.0.0"
2574
2574
  proxy-agent "^6.3.1"
2575
2575
 
2576
- "@salesforce/plugin-telemetry@3.3.4":
2577
- version "3.3.4"
2578
- resolved "https://registry.npmjs.org/@salesforce/plugin-telemetry/-/plugin-telemetry-3.3.4.tgz"
2579
- integrity sha512-Xuc3yNbe5k2oW8hFONq7vY+pL2ivRQFyuLAit4Jz485aY4AoBP8htBFoFp8vls4xgO/3bCtNec0rRi9KcgROXQ==
2576
+ "@salesforce/plugin-telemetry@3.3.5":
2577
+ version "3.3.5"
2578
+ resolved "https://registry.npmjs.org/@salesforce/plugin-telemetry/-/plugin-telemetry-3.3.5.tgz"
2579
+ integrity sha512-6RJEYxEYPNru6izCBuDf4Rwh8H+YImGBvXPUF8h7YsNdg3TDvhjIKiiMjvYsByjRywenqkF5ZTpQ9OC2nAPoTA==
2580
2580
  dependencies:
2581
2581
  "@oclif/core" "^3.26.2"
2582
2582
  "@salesforce/core" "^7.2.0"
@@ -5384,5 +5384,5 @@
5384
5384
  ]
5385
5385
  }
5386
5386
  },
5387
- "version": "2.41.1"
5387
+ "version": "2.41.2"
5388
5388
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/cli",
3
3
  "description": "The Salesforce CLI",
4
- "version": "2.41.1",
4
+ "version": "2.41.2",
5
5
  "author": "Salesforce",
6
6
  "bin": {
7
7
  "sf": "./bin/run.js",
@@ -153,7 +153,7 @@
153
153
  "@salesforce/core": "^7.2.0",
154
154
  "@salesforce/kit": "^3.1.0",
155
155
  "@salesforce/plugin-apex": "3.1.11",
156
- "@salesforce/plugin-auth": "3.6.5",
156
+ "@salesforce/plugin-auth": "3.6.6",
157
157
  "@salesforce/plugin-data": "3.3.2",
158
158
  "@salesforce/plugin-deploy-retrieve": "3.6.9",
159
159
  "@salesforce/plugin-info": "3.2.4",
@@ -165,7 +165,7 @@
165
165
  "@salesforce/plugin-settings": "2.2.3",
166
166
  "@salesforce/plugin-sobject": "1.3.6",
167
167
  "@salesforce/plugin-source": "3.3.5",
168
- "@salesforce/plugin-telemetry": "3.3.4",
168
+ "@salesforce/plugin-telemetry": "3.3.5",
169
169
  "@salesforce/plugin-templates": "56.2.4",
170
170
  "@salesforce/plugin-trust": "3.6.8",
171
171
  "@salesforce/plugin-user": "3.5.5",
@@ -275,7 +275,7 @@
275
275
  "messages/**"
276
276
  ],
277
277
  "output": [
278
- "lib/**",
278
+ "dist/**",
279
279
  "*.tsbuildinfo"
280
280
  ],
281
281
  "clean": "if-file-deleted"