@salesforce/cli 2.12.7-esm.0 → 2.12.7

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.
@@ -1,22 +1,47 @@
1
+ "use strict";
1
2
  /*
2
3
  * Copyright (c) 2021, salesforce.com, inc.
3
4
  * All rights reserved.
4
5
  * Licensed under the BSD 3-Clause license.
5
6
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
7
  */
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']);
13
- }
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
- }
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());
20
16
  };
21
- export default hook;
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();
24
+ }
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;
22
47
  //# sourceMappingURL=display-release-notes.js.map
@@ -1,18 +1,19 @@
1
+ "use strict";
1
2
  /*
2
3
  * Copyright (c) 2022, salesforce.com, inc.
3
4
  * All rights reserved.
4
5
  * Licensed under the BSD 3-Clause license.
5
6
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
7
  */
7
- import * as os from 'os';
8
- import { toConfiguredId, toStandardizedId, loadHelpClass } from '@oclif/core';
9
- import { Prompter } from '@salesforce/sf-plugins-core';
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");
10
12
  function buildChoices(matches, config) {
11
- const configuredIds = matches.map((p) => toConfiguredId(p.id, config));
13
+ const configuredIds = matches.map((p) => (0, core_1.toConfiguredId)(p.id, config));
12
14
  const maxCommandLength = configuredIds.reduce((max, id) => Math.max(max, id.length), 0);
13
15
  return matches.map((p, i) => {
14
- var _a, _b, _c;
15
- const summary = (_c = (_a = p.summary) !== null && _a !== void 0 ? _a : (_b = p.description) === null || _b === void 0 ? void 0 : _b.split(os.EOL)[0]) !== null && _c !== void 0 ? _c : '';
16
+ const summary = p.summary ?? p.description?.split(os.EOL)[0] ?? '';
16
17
  return {
17
18
  name: `${configuredIds[i].padEnd(maxCommandLength + 5, ' ')}${summary}`,
18
19
  value: p,
@@ -21,7 +22,7 @@ function buildChoices(matches, config) {
21
22
  });
22
23
  }
23
24
  async function determineCommand(config, matches) {
24
- const prompter = new Prompter();
25
+ const prompter = new sf_plugins_core_1.Prompter();
25
26
  const choices = buildChoices(matches, config);
26
27
  const { command } = await prompter.timedPrompt([
27
28
  {
@@ -36,12 +37,12 @@ async function determineCommand(config, matches) {
36
37
  const hook = async function ({ config, matches, argv }) {
37
38
  const command = await determineCommand(config, matches);
38
39
  if (argv.includes('--help') || argv.includes('-h')) {
39
- const Help = await loadHelpClass(config);
40
+ const Help = await (0, core_1.loadHelpClass)(config);
40
41
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
41
42
  const help = new Help(config, config.pjson.helpOptions);
42
- return help.showHelp([toStandardizedId(command, config), ...argv]);
43
+ return help.showHelp([(0, core_1.toStandardizedId)(command, config), ...argv]);
43
44
  }
44
- return config.runCommand(toStandardizedId(command, config), argv);
45
+ return config.runCommand((0, core_1.toStandardizedId)(command, config), argv);
45
46
  };
46
- export default hook;
47
+ exports.default = hook;
47
48
  //# sourceMappingURL=incomplete.js.map
@@ -1,16 +1,18 @@
1
+ "use strict";
1
2
  /*
2
3
  * Copyright (c) 2022, salesforce.com, inc.
3
4
  * All rights reserved.
4
5
  * Licensed under the BSD 3-Clause license.
5
6
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
7
  */
7
- import { Errors } from '@oclif/core';
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ const core_1 = require("@oclif/core");
8
10
  const hook = async function (options) {
9
11
  const verifySignHookResult = await this.config.runHook('plugins:preinstall:verify:signature', options);
10
12
  const pluginTrustFailure = verifySignHookResult.failures.find((failure) => failure.plugin.name === '@salesforce/plugin-trust');
11
13
  if (pluginTrustFailure !== undefined) {
12
- await Errors.handle(pluginTrustFailure.error);
14
+ core_1.Errors.handle(pluginTrustFailure.error);
13
15
  }
14
16
  };
15
- export default hook;
17
+ exports.default = hook;
16
18
  //# sourceMappingURL=pluginsPreinstall.js.map
@@ -1,13 +1,14 @@
1
+ "use strict";
1
2
  /*
2
3
  * Copyright (c) 2023, salesforce.com, inc.
3
4
  * All rights reserved.
4
5
  * Licensed under the BSD 3-Clause license.
5
6
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
7
  */
7
- import { ux } from '@oclif/core';
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ const core_1 = require("@oclif/core");
8
10
  // eslint-disable-next-line @typescript-eslint/require-await
9
11
  const hook = async function ({ Command, config }) {
10
- var _a, _b, _c;
11
12
  if (process.argv.includes('--json'))
12
13
  return;
13
14
  const { plugin } = Command;
@@ -15,14 +16,14 @@ const hook = async function ({ Command, config }) {
15
16
  return;
16
17
  if (plugin.type === 'link')
17
18
  return;
18
- const jitPlugins = (_a = config.pjson.oclif.jitPlugins) !== null && _a !== void 0 ? _a : {};
19
- const deps = (_b = config.pjson.dependencies) !== null && _b !== void 0 ? _b : {};
20
- const specifiedVersion = (_c = jitPlugins[plugin.name]) !== null && _c !== void 0 ? _c : deps[plugin.name];
19
+ const jitPlugins = config.pjson.oclif.jitPlugins ?? {};
20
+ const deps = config.pjson.dependencies ?? {};
21
+ const specifiedVersion = jitPlugins[plugin.name] ?? deps[plugin.name];
21
22
  if (!specifiedVersion)
22
23
  return;
23
24
  if (plugin.version !== specifiedVersion) {
24
- ux.warn(`Plugin ${plugin.name} (${plugin.version}) differs from the version specified by ${config.bin} (${specifiedVersion})`);
25
+ core_1.ux.warn(`Plugin ${plugin.name} (${plugin.version}) differs from the version specified by ${config.bin} (${specifiedVersion})`);
25
26
  }
26
27
  };
27
- export default hook;
28
+ exports.default = hook;
28
29
  //# sourceMappingURL=prerun.js.map
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=index.js.map
package/dist/util/env.js CHANGED
@@ -1,11 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Env = void 0;
1
4
  /*
2
5
  * Copyright (c) 2022, salesforce.com, inc.
3
6
  * All rights reserved.
4
7
  * Licensed under the BSD 3-Clause license.
5
8
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
9
  */
7
- import { EnvVars } from '@salesforce/core/lib/config/envVars.js';
8
- export class Env extends EnvVars {
10
+ const envVars_1 = require("@salesforce/core/lib/config/envVars");
11
+ class Env extends envVars_1.EnvVars {
9
12
  constructor(env = process.env) {
10
13
  super(env);
11
14
  }
@@ -48,11 +51,12 @@ export class Env extends EnvVars {
48
51
  }
49
52
  }
50
53
  }
54
+ exports.Env = Env;
51
55
  Env.SF_AUTOUPDATE_DISABLE = 'SF_AUTOUPDATE_DISABLE';
52
56
  Env.SF_DISABLE_AUTOUPDATE = 'SF_DISABLE_AUTOUPDATE';
53
57
  Env.SF_ENV = 'SF_ENV';
54
58
  Env.SF_INSTALLER = 'SF_INSTALLER';
55
59
  Env.SF_NPM_REGISTRY = 'SF_NPM_REGISTRY';
56
60
  Env.SF_UPDATE_INSTRUCTIONS = 'SF_UPDATE_INSTRUCTIONS';
57
- export default new Env();
61
+ exports.default = new Env();
58
62
  //# sourceMappingURL=env.js.map