@salesforce/cli 1.58.1 → 1.60.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/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2022, Salesforce.com, Inc.
1
+ Copyright (c) 2023, Salesforce.com, Inc.
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
package/bin/run CHANGED
@@ -1,8 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- /* tslint:disable:no-var-requires only-arrow-functions */
4
- /* eslint-disable global-require, prefer-arrow-callback */
5
-
6
3
  // Since the CLI is a single process, we can have a larger amount of max listeners since
7
4
  // the process gets shut down. Don't set it to 0 (no limit) since we should still be aware
8
5
  // of rouge event listeners
@@ -14,6 +11,9 @@ process.setMaxListeners = () => {};
14
11
  // Check node version before requiring additional packages
15
12
  require('../dist/versions').checkNodeVersion();
16
13
 
14
+ // Pre-process/prune flags before creating or running the actual CLI
15
+ require('../dist/flags').preprocessCliFlags(process);
16
+
17
17
  const cli = require('../dist/cli');
18
18
  const pjson = require('../package.json');
19
19
 
package/dist/flags.js ADDED
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2020, salesforce.com, inc.
4
+ * All rights reserved.
5
+ * Licensed under the BSD 3-Clause license.
6
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.preprocessCliFlags = void 0;
10
+ function preprocessCliFlags(process) {
11
+ process.argv.map((arg) => {
12
+ if (arg === '--dev-debug') {
13
+ let debug = '*';
14
+ const filterIndex = process.argv.indexOf('--debug-filter');
15
+ if (filterIndex > 0) {
16
+ debug = process.argv[filterIndex + 1];
17
+ process.argv.splice(filterIndex, 2);
18
+ }
19
+ // convert --dev-debug into a set of environment variables
20
+ process.env.DEBUG = debug;
21
+ process.env.SF_DEBUG = '1';
22
+ process.env.SF_ENV = 'development';
23
+ process.env.SFDX_DEBUG = '1';
24
+ process.env.SFDX_ENV = 'development';
25
+ // need to calculate indexOf --dev-debug here because it might've changed based on --debug-filter
26
+ process.argv.splice(process.argv.indexOf('--dev-debug'), 1);
27
+ }
28
+ });
29
+ }
30
+ exports.preprocessCliFlags = preprocessCliFlags;
31
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
32
+ module.exports.preprocessCliFlags = preprocessCliFlags;
33
+ //# sourceMappingURL=flags.js.map
@@ -6,8 +6,10 @@
6
6
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
+ const os = require("os");
9
10
  const core_1 = require("@oclif/core");
10
11
  const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
12
+ const core_2 = require("@salesforce/core");
11
13
  async function determineCommand(config, matches) {
12
14
  if (matches.length === 1)
13
15
  return matches[0].id;
@@ -27,6 +29,9 @@ const hook = async function ({ config, matches, argv }) {
27
29
  if (argv.includes('--help') || argv.includes('-h')) {
28
30
  return config.runCommand('help', [(0, core_1.toStandardizedId)(command, config)]);
29
31
  }
32
+ if (matches.length === 1) {
33
+ await core_2.Lifecycle.getInstance().emitWarning(`One command matches the partial command entered, running command:${os.EOL}${config.bin} ${(0, core_1.toConfiguredId)(command, config)} ${argv.join(' ')}`);
34
+ }
30
35
  return config.runCommand((0, core_1.toStandardizedId)(command, config), argv);
31
36
  };
32
37
  exports.default = hook;
package/dist/versions.js CHANGED
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable */
3
2
  /*
4
3
  * Copyright (c) 2022, salesforce.com, inc.
5
4
  * All rights reserved.
@@ -24,6 +23,7 @@ function isVersion(tag) {
24
23
  return !!semver.valid(tag) || false;
25
24
  }
26
25
  exports.isVersion = isVersion;
26
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
27
27
  module.exports.isVersion = isVersion;
28
28
  /**
29
29
  * Checks the current Node version for compatibility before launching the CLI.
@@ -42,5 +42,6 @@ function checkNodeVersion(preferThrow = false, currentVersion = process.versions
42
42
  }
43
43
  }
44
44
  exports.checkNodeVersion = checkNodeVersion;
45
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
45
46
  module.exports.checkNodeVersion = checkNodeVersion;
46
47
  //# sourceMappingURL=versions.js.map