@salesforce/cli 2.13.1 → 2.13.3

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.13.1 linux-x64 node-v18.18.0
27
+ @salesforce/cli/2.13.3 linux-x64 node-v18.18.0
28
28
  $ sf --help [COMMAND]
29
29
  USAGE
30
30
  $ sf COMMAND
@@ -3093,7 +3093,8 @@ FLAGS
3093
3093
  stronger the password.
3094
3094
  -l, --length=<value> [default: 13] Number of characters in the generated password; valid values are between
3095
3095
  8 and 100.
3096
- -o, --on-behalf-of=<value>... Comma-separated list of usernames or aliases to assign the password to.
3096
+ -o, --on-behalf-of=<value>... Comma-separated list of usernames or aliases to assign the password to; must have been
3097
+ created locally with the "org create user" command.
3097
3098
  -u, --target-org=<value> (required) Scratch org alias or login user.
3098
3099
  --api-version=<value> Override the api version used for api requests made by this command
3099
3100
 
@@ -3104,7 +3105,10 @@ DESCRIPTION
3104
3105
  Generate a random password for scratch org users.
3105
3106
 
3106
3107
  By default, new scratch orgs contain one admin user with no password. Use this command to generate or change a
3107
- password for any scratch org user. After it's set, you can’t unset a password, you can only change it.
3108
+ password for this admin user. After it's set, you can’t unset a password, you can only change it.
3109
+
3110
+ You can also use the --on-behalf-of flag to generate a password for a scratch org user that you've created locally
3111
+ with the "org create user" command. This command doesn't work for users you created in the scratch org using Setup.
3108
3112
 
3109
3113
  To change the password strength, set the --complexity flag to a value between 0 and 5. Each value specifies the types
3110
3114
  of characters used in the generated password:
@@ -3132,13 +3136,14 @@ EXAMPLES
3132
3136
 
3133
3137
  $ sf force user password generate --complexity 3
3134
3138
 
3135
- Generate a password for the specified users in the default scratch org:
3139
+ Generate a password for the specified users in the default scratch org; these users must have been created locally
3140
+ with the "org create user" command:
3136
3141
 
3137
3142
  $ sf force user password generate --on-behalf-of user1@my.org --on-behalf-of user2@my.org --on-behalf-of \
3138
3143
  user3@my.org
3139
3144
  ```
3140
3145
 
3141
- _See code: [@salesforce/plugin-user](https://github.com/salesforcecli/plugin-user/blob/2.3.35/src/commands/force/user/password/generate.ts)_
3146
+ _See code: [@salesforce/plugin-user](https://github.com/salesforcecli/plugin-user/blob/2.3.36/src/commands/force/user/password/generate.ts)_
3142
3147
 
3143
3148
  ## `sf help [COMMANDS]`
3144
3149
 
@@ -3655,7 +3660,7 @@ EXAMPLES
3655
3660
  $ sf org assign permset --name DreamHouse --on-behalf-of user1@my.org --on-behalf-of user2 --on-behalf-of user
3656
3661
  ```
3657
3662
 
3658
- _See code: [@salesforce/plugin-user](https://github.com/salesforcecli/plugin-user/blob/2.3.35/src/commands/org/assign/permset.ts)_
3663
+ _See code: [@salesforce/plugin-user](https://github.com/salesforcecli/plugin-user/blob/2.3.36/src/commands/org/assign/permset.ts)_
3659
3664
 
3660
3665
  ## `sf org assign permsetlicense`
3661
3666
 
@@ -3699,7 +3704,7 @@ EXAMPLES
3699
3704
  user3
3700
3705
  ```
3701
3706
 
3702
- _See code: [@salesforce/plugin-user](https://github.com/salesforcecli/plugin-user/blob/2.3.35/src/commands/org/assign/permsetlicense.ts)_
3707
+ _See code: [@salesforce/plugin-user](https://github.com/salesforcecli/plugin-user/blob/2.3.36/src/commands/org/assign/permsetlicense.ts)_
3703
3708
 
3704
3709
  ## `sf org create sandbox`
3705
3710
 
@@ -4055,7 +4060,7 @@ FLAG DESCRIPTIONS
4055
4060
  might be different than what you specify in the definition file.
4056
4061
  ```
4057
4062
 
4058
- _See code: [@salesforce/plugin-user](https://github.com/salesforcecli/plugin-user/blob/2.3.35/src/commands/org/create/user.ts)_
4063
+ _See code: [@salesforce/plugin-user](https://github.com/salesforcecli/plugin-user/blob/2.3.36/src/commands/org/create/user.ts)_
4059
4064
 
4060
4065
  ## `sf org delete sandbox`
4061
4066
 
@@ -4219,7 +4224,7 @@ EXAMPLES
4219
4224
  $ sf org display user --target-org me@my.org --json
4220
4225
  ```
4221
4226
 
4222
- _See code: [@salesforce/plugin-user](https://github.com/salesforcecli/plugin-user/blob/2.3.35/src/commands/org/display/user.ts)_
4227
+ _See code: [@salesforce/plugin-user](https://github.com/salesforcecli/plugin-user/blob/2.3.36/src/commands/org/display/user.ts)_
4223
4228
 
4224
4229
  ## `sf org generate password`
4225
4230
 
@@ -4230,7 +4235,8 @@ USAGE
4230
4235
  $ sf org generate password -o <value> [--json] [-b <value>] [-l <value>] [-c <value>] [--api-version <value>]
4231
4236
 
4232
4237
  FLAGS
4233
- -b, --on-behalf-of=<value>... Comma-separated list of usernames or aliases to assign the password to.
4238
+ -b, --on-behalf-of=<value>... Comma-separated list of usernames or aliases to assign the password to; must have been
4239
+ created locally with the "org create user" command.
4234
4240
  -c, --complexity=<value> [default: 5] Level of password complexity or strength; the higher the value, the
4235
4241
  stronger the password.
4236
4242
  -l, --length=<value> [default: 13] Number of characters in the generated password; valid values are between
@@ -4245,7 +4251,10 @@ DESCRIPTION
4245
4251
  Generate a random password for scratch org users.
4246
4252
 
4247
4253
  By default, new scratch orgs contain one admin user with no password. Use this command to generate or change a
4248
- password for any scratch org user. After it's set, you can’t unset a password, you can only change it.
4254
+ password for this admin user. After it's set, you can’t unset a password, you can only change it.
4255
+
4256
+ You can also use the --on-behalf-of flag to generate a password for a scratch org user that you've created locally
4257
+ with the "org create user" command. This command doesn't work for users you created in the scratch org using Setup.
4249
4258
 
4250
4259
  To change the password strength, set the --complexity flag to a value between 0 and 5. Each value specifies the types
4251
4260
  of characters used in the generated password:
@@ -4273,12 +4282,13 @@ EXAMPLES
4273
4282
 
4274
4283
  $ sf org generate password --complexity 3
4275
4284
 
4276
- Generate a password for the specified users in the default scratch org:
4285
+ Generate a password for the specified users in the default scratch org; these users must have been created locally
4286
+ with the "org create user" command:
4277
4287
 
4278
4288
  $ sf org generate password --on-behalf-of user1@my.org --on-behalf-of user2@my.org --on-behalf-of user3@my.org
4279
4289
  ```
4280
4290
 
4281
- _See code: [@salesforce/plugin-user](https://github.com/salesforcecli/plugin-user/blob/2.3.35/src/commands/org/generate/password.ts)_
4291
+ _See code: [@salesforce/plugin-user](https://github.com/salesforcecli/plugin-user/blob/2.3.36/src/commands/org/generate/password.ts)_
4282
4292
 
4283
4293
  ## `sf org list`
4284
4294
 
@@ -4500,7 +4510,7 @@ EXAMPLES
4500
4510
  $ sf org list users --target-org me@my.org
4501
4511
  ```
4502
4512
 
4503
- _See code: [@salesforce/plugin-user](https://github.com/salesforcecli/plugin-user/blob/2.3.35/src/commands/org/list/users.ts)_
4513
+ _See code: [@salesforce/plugin-user](https://github.com/salesforcecli/plugin-user/blob/2.3.36/src/commands/org/list/users.ts)_
4504
4514
 
4505
4515
  ## `sf org login access-token`
4506
4516
 
package/bin/dev.js ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ts-node
2
+
3
+ async function main() {
4
+ const oclif = await import('@oclif/core');
5
+ oclif.settings.performanceEnabled = true;
6
+ await oclif.execute({ development: true, dir: import.meta.url });
7
+ }
8
+
9
+ await main();
package/bin/run.js ADDED
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+
3
+ // Pre-process/prune flags before creating or running the actual CLI
4
+ (await import('../dist/flags.js')).preprocessCliFlags(process);
5
+
6
+ const oclif = await import('@oclif/core');
7
+ const { createRequire } = await import('module');
8
+ const pjson = createRequire(import.meta.url)('../package.json');
9
+
10
+ const cli = await import('../dist/cli.js');
11
+
12
+ async function main() {
13
+ // Since the CLI is a single process, we can have a larger amount of max listeners since
14
+ // the process gets shut down. Don't set it to 0 (no limit) since we should still be aware
15
+ // of rouge event listeners
16
+ process.setMaxListeners(parseInt(process.env.SF_MAX_EVENT_LISTENERS, 10) || 1000);
17
+
18
+ // Don't let other plugins override the CLI specified max listener count
19
+ process.setMaxListeners = () => {};
20
+
21
+ cli
22
+ .create({ version: pjson.version, bin: pjson.oclif.bin, channel: 'stable' })
23
+ .run()
24
+ .then(async () => {
25
+ await oclif.flush();
26
+ })
27
+ .catch(async (err) => {
28
+ await oclif.handle(err);
29
+ });
30
+ }
31
+
32
+ await main();
package/dist/cli.js CHANGED
@@ -1,59 +1,55 @@
1
- "use strict";
2
1
  /*
3
2
  * Copyright (c) 2022, salesforce.com, inc.
4
3
  * All rights reserved.
5
4
  * Licensed under the BSD 3-Clause license.
6
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
6
  */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.create = exports.configureAutoUpdate = exports.configureUpdateSites = exports.UPDATE_DISABLED_DEMO = exports.UPDATE_DISABLED_NPM = exports.UPDATE_DISABLED_INSTALLER = void 0;
10
- const os = require("os");
11
- const path = require("path");
12
- const core_1 = require("@oclif/core");
13
- const kit_1 = require("@salesforce/kit");
14
- const ts_types_1 = require("@salesforce/ts-types");
15
- const Debug = require("debug");
16
- const env_1 = require("./util/env");
7
+ import { platform, arch, release } from 'node:os';
8
+ import { resolve } from 'node:path';
9
+ import { fileURLToPath } from 'node:url';
10
+ import { Config, run as oclifRun, settings } from '@oclif/core';
11
+ import { set } from '@salesforce/kit';
12
+ import Debug from 'debug';
13
+ import { default as nodeEnv, Env } from './util/env.js';
17
14
  const debug = Debug('sf');
18
15
  const envVars = [
19
16
  ...new Set([
20
17
  ...Object.keys(process.env).filter((e) => e.startsWith('SF_') || e.startsWith('SFDX_')),
21
18
  'NODE_OPTIONS',
22
- env_1.Env.SF_AUTOUPDATE_DISABLE,
19
+ Env.SF_AUTOUPDATE_DISABLE,
23
20
  'SF_BINPATH',
24
21
  'SF_COMPILE_CACHE',
25
- env_1.Env.SF_DISABLE_AUTOUPDATE,
26
- env_1.Env.SF_ENV,
27
- env_1.Env.SF_INSTALLER,
28
- env_1.Env.SF_NPM_REGISTRY,
22
+ Env.SF_DISABLE_AUTOUPDATE,
23
+ Env.SF_ENV,
24
+ Env.SF_INSTALLER,
25
+ Env.SF_NPM_REGISTRY,
29
26
  'SF_REDIRECTED',
30
- env_1.Env.SF_UPDATE_INSTRUCTIONS,
27
+ Env.SF_UPDATE_INSTRUCTIONS,
31
28
  ]),
32
29
  ];
33
- exports.UPDATE_DISABLED_INSTALLER = 'Manual and automatic CLI updates have been disabled by setting "SF_AUTOUPDATE_DISABLE=true". ' +
30
+ export const UPDATE_DISABLED_INSTALLER = 'Manual and automatic CLI updates have been disabled by setting "SF_AUTOUPDATE_DISABLE=true". ' +
34
31
  'To check for a new version, unset that environment variable.';
35
- exports.UPDATE_DISABLED_NPM = 'Use "npm update --global @salesforce/cli" to update npm-based installations.';
36
- exports.UPDATE_DISABLED_DEMO = 'Manual and automatic CLI updates have been disabled in DEMO mode. ' +
32
+ export const UPDATE_DISABLED_NPM = 'Use "npm update --global @salesforce/cli" to update npm-based installations.';
33
+ export const UPDATE_DISABLED_DEMO = 'Manual and automatic CLI updates have been disabled in DEMO mode. ' +
37
34
  'To check for a new version, unset the environment variable SF_ENV.';
38
- function configureUpdateSites(config, env = env_1.default) {
35
+ export function configureUpdateSites(config, env = nodeEnv) {
39
36
  const npmRegistry = env.getNpmRegistryOverride();
40
37
  if (npmRegistry) {
41
38
  // Override config value if set via envar
42
- (0, kit_1.set)(config, 'pjson.oclif.warn-if-update-available.registry', npmRegistry);
39
+ set(config, 'pjson.oclif.warn-if-update-available.registry', npmRegistry);
43
40
  }
44
41
  }
45
- exports.configureUpdateSites = configureUpdateSites;
46
- function configureAutoUpdate(envars) {
42
+ export function configureAutoUpdate(envars) {
47
43
  if (envars.isDemoMode()) {
48
44
  // Disable autoupdates in demo mode
49
45
  envars.setAutoupdateDisabled(true);
50
- envars.setUpdateInstructions(exports.UPDATE_DISABLED_DEMO);
46
+ envars.setUpdateInstructions(UPDATE_DISABLED_DEMO);
51
47
  return;
52
48
  }
53
49
  if (envars.isInstaller()) {
54
50
  envars.normalizeAutoupdateDisabled();
55
51
  if (envars.isAutoupdateDisabled()) {
56
- envars.setUpdateInstructions(exports.UPDATE_DISABLED_INSTALLER);
52
+ envars.setUpdateInstructions(UPDATE_DISABLED_INSTALLER);
57
53
  }
58
54
  return;
59
55
  }
@@ -63,10 +59,9 @@ function configureAutoUpdate(envars) {
63
59
  envars.setAutoupdateDisabled(true);
64
60
  }
65
61
  if (envars.isAutoupdateDisabled()) {
66
- envars.setUpdateInstructions(exports.UPDATE_DISABLED_NPM);
62
+ envars.setUpdateInstructions(UPDATE_DISABLED_NPM);
67
63
  }
68
64
  }
69
- exports.configureAutoUpdate = configureAutoUpdate;
70
65
  function debugCliInfo(version, channel, env, config) {
71
66
  function debugSection(section, items) {
72
67
  const pad = 25;
@@ -74,9 +69,9 @@ function debugCliInfo(version, channel, env, config) {
74
69
  items.forEach(([name, value]) => debug('%s: %s', name.padStart(pad), value));
75
70
  }
76
71
  debugSection('OS', [
77
- ['platform', os.platform()],
78
- ['architecture', os.arch()],
79
- ['release', os.release()],
72
+ ['platform', platform()],
73
+ ['architecture', arch()],
74
+ ['release', release()],
80
75
  ['shell', config.shell],
81
76
  ]);
82
77
  debugSection('NODE', [['version', process.versions.node]]);
@@ -91,28 +86,26 @@ function debugCliInfo(version, channel, env, config) {
91
86
  debugSection('ENV', [...envVars].map((key) => [key, env.getString(key, '<not set>')]));
92
87
  debugSection('ARGS', process.argv.map((arg, i) => [i.toString(), arg]));
93
88
  }
94
- function create(version, channel, run, env = env_1.default) {
95
- core_1.settings.performanceEnabled = true;
96
- const root = path.resolve(__dirname, '..');
97
- // eslint-disable-next-line @typescript-eslint/no-var-requires
98
- const pjson = require(path.resolve(__dirname, '..', 'package.json'));
89
+ export function create({ version, bin, channel, run, env }) {
90
+ settings.performanceEnabled = true;
91
+ const root = resolve(fileURLToPath(import.meta.url), '..');
99
92
  const args = process.argv.slice(2);
93
+ const environment = env ?? nodeEnv;
100
94
  return {
101
95
  async run() {
102
- const config = new core_1.Config({
103
- name: (0, ts_types_1.get)(pjson, 'oclif.bin'),
96
+ const config = new Config({
97
+ name: bin,
104
98
  root,
105
99
  version,
106
100
  channel,
107
101
  });
108
102
  await config.load();
109
- configureUpdateSites(config, env);
110
- configureAutoUpdate(env);
111
- debugCliInfo(version, channel, env, config);
103
+ configureUpdateSites(config, environment);
104
+ configureAutoUpdate(environment);
105
+ debugCliInfo(version, channel, environment, config);
112
106
  // Example of how run is used in a test https://github.com/salesforcecli/cli/pull/171/files#diff-1deee0a575599b2df117c280da319f7938aaf6fdb0c04bcdbde769dbf464be69R46
113
- return run ? run(args, config) : (0, core_1.run)(args, config);
107
+ return run ? run(args, config) : oclifRun(args, config);
114
108
  },
115
109
  };
116
110
  }
117
- exports.create = create;
118
111
  //# sourceMappingURL=cli.js.map
package/dist/flags.js CHANGED
@@ -1,13 +1,10 @@
1
- "use strict";
2
1
  /*
3
2
  * Copyright (c) 2020, salesforce.com, inc.
4
3
  * All rights reserved.
5
4
  * Licensed under the BSD 3-Clause license.
6
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
6
  */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.preprocessCliFlags = void 0;
10
- function preprocessCliFlags(process) {
7
+ export function preprocessCliFlags(process) {
11
8
  process.argv.map((arg) => {
12
9
  if (arg === '--dev-debug') {
13
10
  let debug = '*';
@@ -25,7 +22,4 @@ function preprocessCliFlags(process) {
25
22
  }
26
23
  });
27
24
  }
28
- exports.preprocessCliFlags = preprocessCliFlags;
29
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
30
- module.exports.preprocessCliFlags = preprocessCliFlags;
31
25
  //# sourceMappingURL=flags.js.map
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SfCommandHelp = void 0;
4
1
  /*
5
2
  * Copyright (c) 2022, salesforce.com, inc.
6
3
  * All rights reserved.
7
4
  * Licensed under the BSD 3-Clause license.
8
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
9
6
  */
10
- const core_1 = require("@oclif/core");
11
- class SfCommandHelp extends core_1.CommandHelp {
7
+ import { CommandHelp } from '@oclif/core';
8
+ export class SfCommandHelp extends CommandHelp {
12
9
  constructor(command, config, opts) {
13
10
  super(command, config, opts);
14
11
  this.command = command;
@@ -27,35 +24,25 @@ class SfCommandHelp extends core_1.CommandHelp {
27
24
  if (this.shortHelp) {
28
25
  return sections.filter(({ header }) => ['USAGE', 'ARGUMENTS', 'FLAGS'].includes(header));
29
26
  }
30
- const additionaSfSections = [
27
+ const additionalSfSections = [
31
28
  {
32
29
  header: 'CONFIGURATION VARIABLES',
33
- generate: ({ cmd }) => {
34
- const sfCommand = cmd;
35
- return sfCommand.configurationVariablesSection;
36
- },
30
+ generate: ({ cmd }) => cmd.configurationVariablesSection,
37
31
  },
38
32
  {
39
33
  header: 'ENVIRONMENT VARIABLES',
40
- generate: ({ cmd }) => {
41
- const sfCommand = cmd;
42
- return sfCommand.envVariablesSection;
43
- },
34
+ generate: ({ cmd }) => cmd.envVariablesSection,
44
35
  },
45
36
  {
46
37
  header: 'ERROR CODES',
47
- generate: ({ cmd }) => {
48
- const sfCommand = cmd;
49
- return sfCommand.errorCodes;
50
- },
38
+ generate: ({ cmd }) => cmd.errorCodes,
51
39
  },
52
40
  ];
53
41
  const flagsIndex = (sections.findIndex((section) => section.header === 'FLAG DESCRIPTIONS') || sections.length - 1) + 1;
54
- sections.splice(flagsIndex, 0, additionaSfSections[0]);
55
- sections.splice(flagsIndex + 1, 0, additionaSfSections[1]);
56
- sections.splice(flagsIndex + 2, 0, additionaSfSections[2]);
42
+ sections.splice(flagsIndex, 0, additionalSfSections[0]);
43
+ sections.splice(flagsIndex + 1, 0, additionalSfSections[1]);
44
+ sections.splice(flagsIndex + 2, 0, additionalSfSections[2]);
57
45
  return sections;
58
46
  }
59
47
  }
60
- exports.SfCommandHelp = SfCommandHelp;
61
48
  //# sourceMappingURL=sfCommandHelp.js.map
@@ -1,18 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /*
4
2
  * Copyright (c) 2022, salesforce.com, inc.
5
3
  * All rights reserved.
6
4
  * Licensed under the BSD 3-Clause license.
7
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
8
6
  */
9
- const core_1 = require("@oclif/core");
10
- const chalk = require("chalk");
11
- const sfCommandHelp_1 = require("./sfCommandHelp");
12
- class SfHelp extends core_1.Help {
7
+ import { Help } from '@oclif/core';
8
+ import chalk from 'chalk';
9
+ import { SfCommandHelp } from './sfCommandHelp.js';
10
+ export default class SfHelp extends Help {
13
11
  constructor() {
14
12
  super(...arguments);
15
- this.CommandHelpClass = sfCommandHelp_1.SfCommandHelp;
13
+ this.CommandHelpClass = SfCommandHelp;
16
14
  this.showShortHelp = false;
17
15
  this.commands = [];
18
16
  this.subCommands = {};
@@ -45,5 +43,4 @@ class SfHelp extends core_1.Help {
45
43
  super.log(...formatted);
46
44
  }
47
45
  }
48
- exports.default = SfHelp;
49
46
  //# sourceMappingURL=sfHelp.js.map
@@ -1,47 +1,22 @@
1
- "use strict";
2
1
  /*
3
2
  * Copyright (c) 2021, salesforce.com, inc.
4
3
  * All rights reserved.
5
4
  * Licensed under the BSD 3-Clause license.
6
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
6
  */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const path_1 = require("path");
10
- const child_process_1 = require("child_process");
11
- const core_1 = require("@oclif/core");
12
- const logError = (msg) => {
13
- core_1.ux.log('NOTE: This error can be ignored in CI and may be silenced in the future');
14
- core_1.ux.log('- Set the SF_HIDE_RELEASE_NOTES env var to "true" to skip this script\n');
15
- core_1.ux.log(msg.toString());
16
- };
17
- /*
18
- * NOTE: Please read "Notes about the hook scripts" in this PR before making changes:
19
- * https://github.com/salesforcecli/sfdx-cli/pull/407
20
- */
21
- const hook = async () => new Promise((resolve) => {
22
- if (process.env.SF_HIDE_RELEASE_NOTES === 'true') {
23
- resolve();
7
+ import { ux } from '@oclif/core';
8
+ export const hook = async function ({ config }) {
9
+ if (process.env.SF_HIDE_RELEASE_NOTES === 'true')
10
+ return;
11
+ try {
12
+ return await config.runCommand('whatsnew', ['--hook']);
24
13
  }
25
- const executable = process.platform === 'win32' ? 'run.cmd' : 'run';
26
- const cmd = (0, child_process_1.spawn)((0, path_1.join)(__dirname, '..', '..', 'bin', executable), ['whatsnew', '--hook'], {
27
- stdio: ['ignore', 'inherit', 'pipe'],
28
- timeout: 10000,
29
- });
30
- cmd.stderr.on('data', (error) => {
31
- logError(error);
32
- resolve();
33
- });
34
- cmd.on('error', (error) => {
35
- logError(error);
36
- resolve();
37
- });
38
- // 'exit' fires whether or not the stream are finished
39
- cmd.on('exit', () => {
40
- resolve();
41
- });
42
- cmd.on('close', () => {
43
- resolve();
44
- });
45
- });
46
- exports.default = hook;
14
+ catch (err) {
15
+ const error = err;
16
+ ux.log('NOTE: This error can be ignored in CI and may be silenced in the future');
17
+ ux.log('- Set the SF_HIDE_RELEASE_NOTES env var to "true" to skip this script\n');
18
+ ux.log(error.message);
19
+ }
20
+ };
21
+ export default hook;
47
22
  //# sourceMappingURL=display-release-notes.js.map
@@ -1,16 +1,14 @@
1
- "use strict";
2
1
  /*
3
2
  * Copyright (c) 2022, salesforce.com, inc.
4
3
  * All rights reserved.
5
4
  * Licensed under the BSD 3-Clause license.
6
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
6
  */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const os = require("os");
10
- const core_1 = require("@oclif/core");
11
- const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
7
+ import * as os from 'os';
8
+ import { toConfiguredId, toStandardizedId, loadHelpClass } from '@oclif/core';
9
+ import { Prompter } from '@salesforce/sf-plugins-core';
12
10
  function buildChoices(matches, config) {
13
- const configuredIds = matches.map((p) => (0, core_1.toConfiguredId)(p.id, config));
11
+ const configuredIds = matches.map((p) => toConfiguredId(p.id, config));
14
12
  const maxCommandLength = configuredIds.reduce((max, id) => Math.max(max, id.length), 0);
15
13
  return matches.map((p, i) => {
16
14
  const summary = p.summary ?? p.description?.split(os.EOL)[0] ?? '';
@@ -22,7 +20,7 @@ function buildChoices(matches, config) {
22
20
  });
23
21
  }
24
22
  async function determineCommand(config, matches) {
25
- const prompter = new sf_plugins_core_1.Prompter();
23
+ const prompter = new Prompter();
26
24
  const choices = buildChoices(matches, config);
27
25
  const { command } = await prompter.timedPrompt([
28
26
  {
@@ -37,12 +35,12 @@ async function determineCommand(config, matches) {
37
35
  const hook = async function ({ config, matches, argv }) {
38
36
  const command = await determineCommand(config, matches);
39
37
  if (argv.includes('--help') || argv.includes('-h')) {
40
- const Help = await (0, core_1.loadHelpClass)(config);
38
+ const Help = await loadHelpClass(config);
41
39
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
42
40
  const help = new Help(config, config.pjson.helpOptions);
43
- return help.showHelp([(0, core_1.toStandardizedId)(command, config), ...argv]);
41
+ return help.showHelp([toStandardizedId(command, config), ...argv]);
44
42
  }
45
- return config.runCommand((0, core_1.toStandardizedId)(command, config), argv);
43
+ return config.runCommand(toStandardizedId(command, config), argv);
46
44
  };
47
- exports.default = hook;
45
+ export default hook;
48
46
  //# sourceMappingURL=incomplete.js.map
@@ -1,18 +1,16 @@
1
- "use strict";
2
1
  /*
3
2
  * Copyright (c) 2022, salesforce.com, inc.
4
3
  * All rights reserved.
5
4
  * Licensed under the BSD 3-Clause license.
6
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
6
  */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const core_1 = require("@oclif/core");
7
+ import { Errors } from '@oclif/core';
10
8
  const hook = async function (options) {
11
9
  const verifySignHookResult = await this.config.runHook('plugins:preinstall:verify:signature', options);
12
10
  const pluginTrustFailure = verifySignHookResult.failures.find((failure) => failure.plugin.name === '@salesforce/plugin-trust');
13
11
  if (pluginTrustFailure !== undefined) {
14
- core_1.Errors.handle(pluginTrustFailure.error);
12
+ await Errors.handle(pluginTrustFailure.error);
15
13
  }
16
14
  };
17
- exports.default = hook;
15
+ export default hook;
18
16
  //# sourceMappingURL=pluginsPreinstall.js.map
@@ -1,12 +1,10 @@
1
- "use strict";
2
1
  /*
3
2
  * Copyright (c) 2023, salesforce.com, inc.
4
3
  * All rights reserved.
5
4
  * Licensed under the BSD 3-Clause license.
6
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
6
  */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const core_1 = require("@oclif/core");
7
+ import { ux } from '@oclif/core';
10
8
  // eslint-disable-next-line @typescript-eslint/require-await
11
9
  const hook = async function ({ Command, config }) {
12
10
  if (process.argv.includes('--json'))
@@ -22,8 +20,8 @@ const hook = async function ({ Command, config }) {
22
20
  if (!specifiedVersion)
23
21
  return;
24
22
  if (plugin.version !== specifiedVersion) {
25
- core_1.ux.warn(`Plugin ${plugin.name} (${plugin.version}) differs from the version specified by ${config.bin} (${specifiedVersion})`);
23
+ ux.warn(`Plugin ${plugin.name} (${plugin.version}) differs from the version specified by ${config.bin} (${specifiedVersion})`);
26
24
  }
27
25
  };
28
- exports.default = hook;
26
+ export default hook;
29
27
  //# sourceMappingURL=prerun.js.map
package/dist/index.js CHANGED
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=index.js.map
package/dist/util/env.js CHANGED
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Env = void 0;
4
1
  /*
5
2
  * Copyright (c) 2022, salesforce.com, inc.
6
3
  * All rights reserved.
7
4
  * Licensed under the BSD 3-Clause license.
8
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
9
6
  */
10
- const envVars_1 = require("@salesforce/core/lib/config/envVars");
11
- class Env extends envVars_1.EnvVars {
7
+ import { EnvVars } from '@salesforce/core/lib/config/envVars.js';
8
+ export class Env extends EnvVars {
12
9
  constructor(env = process.env) {
13
10
  super(env);
14
11
  }
@@ -51,12 +48,11 @@ class Env extends envVars_1.EnvVars {
51
48
  }
52
49
  }
53
50
  }
54
- exports.Env = Env;
55
51
  Env.SF_AUTOUPDATE_DISABLE = 'SF_AUTOUPDATE_DISABLE';
56
52
  Env.SF_DISABLE_AUTOUPDATE = 'SF_DISABLE_AUTOUPDATE';
57
53
  Env.SF_ENV = 'SF_ENV';
58
54
  Env.SF_INSTALLER = 'SF_INSTALLER';
59
55
  Env.SF_NPM_REGISTRY = 'SF_NPM_REGISTRY';
60
56
  Env.SF_UPDATE_INSTRUCTIONS = 'SF_UPDATE_INSTRUCTIONS';
61
- exports.default = new Env();
57
+ export default new Env();
62
58
  //# sourceMappingURL=env.js.map