immosquare-cleaner 0.1.31 → 0.1.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/lib/immosquare-cleaner/version.rb +1 -1
  3. data/lib/immosquare-cleaner.rb +1 -0
  4. data/node_modules/@eslint/js/package.json +1 -1
  5. data/node_modules/eslint/lib/api.js +29 -1
  6. data/node_modules/eslint/lib/config/flat-config-schema.js +35 -20
  7. data/node_modules/eslint/lib/eslint/eslint.js +7 -0
  8. data/node_modules/eslint/lib/eslint/flat-eslint.js +17 -4
  9. data/node_modules/eslint/lib/options.js +1 -1
  10. data/node_modules/eslint/lib/rule-tester/flat-rule-tester.js +10 -1
  11. data/node_modules/eslint/package.json +4 -4
  12. data/node_modules/npm-check-updates/README.md +8 -4
  13. data/node_modules/npm-check-updates/build/cli.d.ts +1 -0
  14. data/node_modules/npm-check-updates/build/cli.js +28 -0
  15. data/node_modules/npm-check-updates/build/cli.js.map +1 -0
  16. data/node_modules/npm-check-updates/build/index-BnIU43YD.js +2 -0
  17. data/node_modules/npm-check-updates/build/index-BnIU43YD.js.map +1 -0
  18. data/node_modules/npm-check-updates/build/index-CI_x-D21.js +593 -0
  19. data/node_modules/npm-check-updates/build/index-CI_x-D21.js.map +1 -0
  20. data/node_modules/npm-check-updates/build/index-Ci8A2QXv.js +6 -0
  21. data/node_modules/npm-check-updates/build/index-Ci8A2QXv.js.map +1 -0
  22. data/node_modules/npm-check-updates/build/index-DgVn3Gax.js +36 -0
  23. data/node_modules/npm-check-updates/build/index-DgVn3Gax.js.map +1 -0
  24. data/node_modules/npm-check-updates/build/index-_DliZFxU.js +5 -0
  25. data/node_modules/npm-check-updates/build/index-_DliZFxU.js.map +1 -0
  26. data/node_modules/npm-check-updates/build/index.d.ts +209 -0
  27. data/node_modules/npm-check-updates/build/index.js +2 -0
  28. data/node_modules/npm-check-updates/build/index.js.map +1 -0
  29. data/node_modules/npm-check-updates/build/package.json +1 -1
  30. data/node_modules/npm-check-updates/build/src/cli-options.js +10 -4
  31. data/node_modules/npm-check-updates/build/src/cli-options.js.map +1 -1
  32. data/node_modules/npm-check-updates/build/src/lib/upgradePackageDefinitions.js +2 -1
  33. data/node_modules/npm-check-updates/build/src/lib/upgradePackageDefinitions.js.map +1 -1
  34. data/node_modules/npm-check-updates/build/src/package-managers/gitTags.d.ts +2 -0
  35. data/node_modules/npm-check-updates/build/src/package-managers/gitTags.js +10 -3
  36. data/node_modules/npm-check-updates/build/src/package-managers/gitTags.js.map +1 -1
  37. data/node_modules/npm-check-updates/build/src/package-managers/npm.js +1 -5
  38. data/node_modules/npm-check-updates/build/src/package-managers/npm.js.map +1 -1
  39. data/node_modules/npm-check-updates/package.json +1 -1
  40. data/package.json +2 -2
  41. metadata +20 -7
  42. data/node_modules/npm-check-updates/build/src/lib/queryVersions.d.mts +0 -13
  43. data/node_modules/npm-check-updates/build/src/lib/queryVersions.mjs +0 -111
  44. data/node_modules/npm-check-updates/build/src/lib/queryVersions.mjs.map +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c28e7be46dd847b08be778731fcae70c8be7b942070d7019b7dc289b133fb49
4
- data.tar.gz: 2500a66e9429c95ea6d03aa1ceddd2504272d2eaf86a9d9e552ba00814f27e0e
3
+ metadata.gz: 60f5cf5b4968b1304ddb2358728139db942dd80e26c8f9fcceb09cb8bf22b967
4
+ data.tar.gz: 9aba1417edd408b629119bc8088f4c25165eee2d799316b7a47914475a34cc0c
5
5
  SHA512:
6
- metadata.gz: 8372300b446ec7a60bc24b4b417d7d4d780182420e42f4a84b217d5bc17ebbea51546c7278d96a1932e6b93774c87219035b6f4bc90a744e6dedfdfc98992722
7
- data.tar.gz: f08b4f7674f8bca77c4ca24aa48454248976dff9439bf634f04051cd464c1b2d4c516b6cadef889e982c1793f85476d3abc40a29eea40bcc37e72710cb109336
6
+ metadata.gz: ebc810b6fd9b5aaed1c41dff198d6bbda6aeea13ce498277916031978fa6e6556b7d8bd3139301f2fd48703daa5f175bb4ee0ff9351268003bd37890a942465b
7
+ data.tar.gz: 8d6dfebb5882a661eed5b2ddaeb34c1bb6dc8006c7a30e925b03e505419c701c0a5e54260de07a603dcae4da6ac3c81deed5a86c6a8ecafcfbf31742e583a389
@@ -1,3 +1,3 @@
1
1
  module ImmosquareCleaner
2
- VERSION = "0.1.31".freeze
2
+ VERSION = "0.1.32".freeze
3
3
  end
@@ -1,5 +1,6 @@
1
1
  require "English"
2
2
  require "yaml"
3
+ require "json"
3
4
  require "immosquare-yaml"
4
5
  require "immosquare-extensions"
5
6
  require_relative "immosquare-cleaner/configuration"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint/js",
3
- "version": "8.56.0",
3
+ "version": "8.57.0",
4
4
  "description": "ESLint JavaScript language implementation",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {},
@@ -9,17 +9,45 @@
9
9
  // Requirements
10
10
  //-----------------------------------------------------------------------------
11
11
 
12
- const { ESLint } = require("./eslint");
12
+ const { ESLint, FlatESLint } = require("./eslint");
13
+ const { shouldUseFlatConfig } = require("./eslint/flat-eslint");
13
14
  const { Linter } = require("./linter");
14
15
  const { RuleTester } = require("./rule-tester");
15
16
  const { SourceCode } = require("./source-code");
16
17
 
18
+ //-----------------------------------------------------------------------------
19
+ // Functions
20
+ //-----------------------------------------------------------------------------
21
+
22
+ /**
23
+ * Loads the correct ESLint constructor given the options.
24
+ * @param {Object} [options] The options object
25
+ * @param {boolean} [options.useFlatConfig] Whether or not to use a flat config
26
+ * @param {string} [options.cwd] The current working directory
27
+ * @returns {Promise<ESLint|LegacyESLint>} The ESLint constructor
28
+ */
29
+ async function loadESLint({ useFlatConfig, cwd = process.cwd() } = {}) {
30
+
31
+ /*
32
+ * Note: The v9.x version of this function doesn't have a cwd option
33
+ * because it's not used. It's only used in the v8.x version of this
34
+ * function.
35
+ */
36
+
37
+ const shouldESLintUseFlatConfig = typeof useFlatConfig === "boolean"
38
+ ? useFlatConfig
39
+ : await shouldUseFlatConfig({ cwd });
40
+
41
+ return shouldESLintUseFlatConfig ? FlatESLint : ESLint;
42
+ }
43
+
17
44
  //-----------------------------------------------------------------------------
18
45
  // Exports
19
46
  //-----------------------------------------------------------------------------
20
47
 
21
48
  module.exports = {
22
49
  Linter,
50
+ loadESLint,
23
51
  ESLint,
24
52
  RuleTester,
25
53
  SourceCode
@@ -53,6 +53,15 @@ function isNonNullObject(value) {
53
53
  return typeof value === "object" && value !== null;
54
54
  }
55
55
 
56
+ /**
57
+ * Check if a value is a non-null non-array object.
58
+ * @param {any} value The value to check.
59
+ * @returns {boolean} `true` if the value is a non-null non-array object.
60
+ */
61
+ function isNonArrayObject(value) {
62
+ return isNonNullObject(value) && !Array.isArray(value);
63
+ }
64
+
56
65
  /**
57
66
  * Check if a value is undefined.
58
67
  * @param {any} value The value to check.
@@ -63,19 +72,27 @@ function isUndefined(value) {
63
72
  }
64
73
 
65
74
  /**
66
- * Deeply merges two objects.
75
+ * Deeply merges two non-array objects.
67
76
  * @param {Object} first The base object.
68
77
  * @param {Object} second The overrides object.
78
+ * @param {Map<string, Map<string, Object>>} [mergeMap] Maps the combination of first and second arguments to a merged result.
69
79
  * @returns {Object} An object with properties from both first and second.
70
80
  */
71
- function deepMerge(first = {}, second = {}) {
81
+ function deepMerge(first, second, mergeMap = new Map()) {
72
82
 
73
- /*
74
- * If the second value is an array, just return it. We don't merge
75
- * arrays because order matters and we can't know the correct order.
76
- */
77
- if (Array.isArray(second)) {
78
- return second;
83
+ let secondMergeMap = mergeMap.get(first);
84
+
85
+ if (secondMergeMap) {
86
+ const result = secondMergeMap.get(second);
87
+
88
+ if (result) {
89
+
90
+ // If this combination of first and second arguments has been already visited, return the previously created result.
91
+ return result;
92
+ }
93
+ } else {
94
+ secondMergeMap = new Map();
95
+ mergeMap.set(first, secondMergeMap);
79
96
  }
80
97
 
81
98
  /*
@@ -89,27 +106,25 @@ function deepMerge(first = {}, second = {}) {
89
106
  ...second
90
107
  };
91
108
 
109
+ delete result.__proto__; // eslint-disable-line no-proto -- don't merge own property "__proto__"
110
+
111
+ // Store the pending result for this combination of first and second arguments.
112
+ secondMergeMap.set(second, result);
113
+
92
114
  for (const key of Object.keys(second)) {
93
115
 
94
116
  // avoid hairy edge case
95
- if (key === "__proto__") {
117
+ if (key === "__proto__" || !Object.prototype.propertyIsEnumerable.call(first, key)) {
96
118
  continue;
97
119
  }
98
120
 
99
121
  const firstValue = first[key];
100
122
  const secondValue = second[key];
101
123
 
102
- if (isNonNullObject(firstValue)) {
103
- result[key] = deepMerge(firstValue, secondValue);
104
- } else if (isUndefined(firstValue)) {
105
- if (isNonNullObject(secondValue)) {
106
- result[key] = deepMerge(
107
- Array.isArray(secondValue) ? [] : {},
108
- secondValue
109
- );
110
- } else if (!isUndefined(secondValue)) {
111
- result[key] = secondValue;
112
- }
124
+ if (isNonArrayObject(firstValue) && isNonArrayObject(secondValue)) {
125
+ result[key] = deepMerge(firstValue, secondValue, mergeMap);
126
+ } else if (isUndefined(secondValue)) {
127
+ result[key] = firstValue;
113
128
  }
114
129
  }
115
130
 
@@ -682,6 +682,13 @@ class ESLint {
682
682
  }
683
683
  }
684
684
 
685
+ /**
686
+ * The type of configuration used by this class.
687
+ * @type {string}
688
+ * @static
689
+ */
690
+ ESLint.configType = "eslintrc";
691
+
685
692
  //------------------------------------------------------------------------------
686
693
  // Public Interface
687
694
  //------------------------------------------------------------------------------
@@ -91,7 +91,11 @@ const LintResultCache = require("../cli-engine/lint-result-cache");
91
91
  // Helpers
92
92
  //------------------------------------------------------------------------------
93
93
 
94
- const FLAT_CONFIG_FILENAME = "eslint.config.js";
94
+ const FLAT_CONFIG_FILENAMES = [
95
+ "eslint.config.js",
96
+ "eslint.config.mjs",
97
+ "eslint.config.cjs"
98
+ ];
95
99
  const debug = require("debug")("eslint:flat-eslint");
96
100
  const removedFormatters = new Set(["table", "codeframe"]);
97
101
  const privateMembers = new WeakMap();
@@ -248,7 +252,7 @@ function compareResultsByFilePath(a, b) {
248
252
  */
249
253
  function findFlatConfigFile(cwd) {
250
254
  return findUp(
251
- FLAT_CONFIG_FILENAME,
255
+ FLAT_CONFIG_FILENAMES,
252
256
  { cwd }
253
257
  );
254
258
  }
@@ -1112,11 +1116,20 @@ class FlatESLint {
1112
1116
  }
1113
1117
  }
1114
1118
 
1119
+ /**
1120
+ * The type of configuration used by this class.
1121
+ * @type {string}
1122
+ * @static
1123
+ */
1124
+ FlatESLint.configType = "flat";
1125
+
1115
1126
  /**
1116
1127
  * Returns whether flat config should be used.
1128
+ * @param {Object} [options] The options for this function.
1129
+ * @param {string} [options.cwd] The current working directory.
1117
1130
  * @returns {Promise<boolean>} Whether flat config should be used.
1118
1131
  */
1119
- async function shouldUseFlatConfig() {
1132
+ async function shouldUseFlatConfig({ cwd = process.cwd() } = {}) {
1120
1133
  switch (process.env.ESLINT_USE_FLAT_CONFIG) {
1121
1134
  case "true":
1122
1135
  return true;
@@ -1128,7 +1141,7 @@ async function shouldUseFlatConfig() {
1128
1141
  * If neither explicitly enabled nor disabled, then use the presence
1129
1142
  * of a flat config file to determine enablement.
1130
1143
  */
1131
- return !!(await findFlatConfigFile(process.cwd()));
1144
+ return !!(await findFlatConfigFile(cwd));
1132
1145
  }
1133
1146
  }
1134
1147
 
@@ -168,7 +168,7 @@ module.exports = function(usingFlatConfig) {
168
168
  alias: "c",
169
169
  type: "path::String",
170
170
  description: usingFlatConfig
171
- ? "Use this configuration instead of eslint.config.js"
171
+ ? "Use this configuration instead of eslint.config.js, eslint.config.mjs, or eslint.config.cjs"
172
172
  : "Use this configuration, overriding .eslintrc.* config options if present"
173
173
  },
174
174
  envFlag,
@@ -13,6 +13,7 @@
13
13
  const
14
14
  assert = require("assert"),
15
15
  util = require("util"),
16
+ path = require("path"),
16
17
  equal = require("fast-deep-equal"),
17
18
  Traverser = require("../shared/traverser"),
18
19
  { getRuleOptionsSchema } = require("../config/flat-config-helpers"),
@@ -592,7 +593,15 @@ class FlatRuleTester {
592
593
  * @private
593
594
  */
594
595
  function runRuleForItem(item) {
595
- const configs = new FlatConfigArray(testerConfig, { baseConfig });
596
+ const flatConfigArrayOptions = {
597
+ baseConfig
598
+ };
599
+
600
+ if (item.filename) {
601
+ flatConfigArrayOptions.basePath = path.parse(item.filename).root;
602
+ }
603
+
604
+ const configs = new FlatConfigArray(testerConfig, flatConfigArrayOptions);
596
605
 
597
606
  /*
598
607
  * Modify the returned config so that the parser is wrapped to catch
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint",
3
- "version": "8.56.0",
3
+ "version": "8.57.0",
4
4
  "author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
5
5
  "description": "An AST-based pattern checker for JavaScript.",
6
6
  "bin": {
@@ -65,8 +65,8 @@
65
65
  "@eslint-community/eslint-utils": "^4.2.0",
66
66
  "@eslint-community/regexpp": "^4.6.1",
67
67
  "@eslint/eslintrc": "^2.1.4",
68
- "@eslint/js": "8.56.0",
69
- "@humanwhocodes/config-array": "^0.11.13",
68
+ "@eslint/js": "8.57.0",
69
+ "@humanwhocodes/config-array": "^0.11.14",
70
70
  "@humanwhocodes/module-importer": "^1.0.1",
71
71
  "@nodelib/fs.walk": "^1.2.8",
72
72
  "@ungap/structured-clone": "^1.2.0",
@@ -122,7 +122,7 @@
122
122
  "eslint-plugin-eslint-plugin": "^5.2.1",
123
123
  "eslint-plugin-internal-rules": "file:tools/internal-rules",
124
124
  "eslint-plugin-jsdoc": "^46.2.5",
125
- "eslint-plugin-n": "^16.4.0",
125
+ "eslint-plugin-n": "^16.6.0",
126
126
  "eslint-plugin-unicorn": "^49.0.0",
127
127
  "eslint-release": "^3.2.0",
128
128
  "eslump": "^3.0.0",
@@ -444,7 +444,9 @@ Usage:
444
444
  ncu --filter [p]
445
445
  ncu -f [p]
446
446
 
447
- Include only package names matching the given string, wildcard, glob, comma-or-space-delimited list, /regex/, or predicate function.
447
+ Include only package names matching the given string, wildcard, glob, comma-or-space-delimited list, /regex/, or predicate function. Only included packages will be checked with `--peer`.
448
+
449
+ `--filter` runs _before_ new versions are fetched, in contrast to `--filterResults` which runs _after_.
448
450
 
449
451
  The predicate function is only available in .ncurc.js or when importing npm-check-updates as a module, not on the command line.
450
452
 
@@ -467,7 +469,7 @@ filterFunction: (name, semver) => {
467
469
 
468
470
  Filters out upgrades based on a user provided function.
469
471
 
470
- `filterResults` runs _after_ new versions are fetched, in contrast to `filter` and `filterVersion`, which run _before_. This allows you to filter out upgrades with `filterResults` based on how the version has changed (e.g. a major version change).
472
+ `filterResults` runs _after_ new versions are fetched, in contrast to `filter`, `reject`, `filterVersion`, and `rejectVersion`, which run _before_. This allows you to filter out upgrades with `filterResults` based on how the version has changed (e.g. a major version change).
471
473
 
472
474
  Only available in .ncurc.js or when importing npm-check-updates as a module.
473
475
 
@@ -675,7 +677,9 @@ Usage:
675
677
  ncu --reject [p]
676
678
  ncu -x [p]
677
679
 
678
- The inverse of `--filter`. Exclude package names matching the given string, wildcard, glob, comma-or-space-delimited list, /regex/, or predicate function.
680
+ The inverse of `--filter`. Exclude package names matching the given string, wildcard, glob, comma-or-space-delimited list, /regex/, or predicate function. This will also exclude them from the `--peer` check.
681
+
682
+ `--reject` runs _before_ new versions are fetched, in contrast to `--filterResults` which runs _after_.
679
683
 
680
684
  The predicate function is only available in .ncurc.js or when importing npm-check-updates as a module, not on the command line.
681
685
 
@@ -711,7 +715,7 @@ The predicate function is only available in .ncurc.js or when importing npm-chec
711
715
  (See: https://git.coolaj86.com/coolaj86/semver-utils.js#semverutils-parse-semverstring)
712
716
  @returns True if the package should be excluded, false if it should be included.
713
717
  */
714
- filterVersionFunction: (name, semver) => {
718
+ rejectVersionFunction: (name, semver) => {
715
719
  if (name.startsWith('@myorg/') && parseInt(semver[0]?.major) > 5) {
716
720
  return true
717
721
  }
@@ -0,0 +1 @@
1
+ export { }
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ "use strict";const ee=require("events"),te=require("child_process"),ie=require("path"),ne=require("fs"),se=require("process"),O=require("./index-CI_x-D21.js");var A={},S={},V={};let L=class extends Error{constructor(e,t,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},re=class extends L{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};V.CommanderError=L;V.InvalidArgumentError=re;const{InvalidArgumentError:oe}=V;let ae=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,i)=>{if(!this.argChoices.includes(t))throw new oe(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,i):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function le(u){const e=u.name()+(u.variadic===!0?"...":"");return u.required?"<"+e+">":"["+e+"]"}S.Argument=ae;S.humanReadableArgName=le;var U={},I={};const{humanReadableArgName:ue}=S;let he=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){const t=e.commands.filter(n=>!n._hidden),i=e._getHelpCommand();return i&&!i._hidden&&t.push(i),this.sortSubcommands&&t.sort((n,s)=>n.name().localeCompare(s.name())),t}compareOptions(e,t){const i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(e).localeCompare(i(t))}visibleOptions(e){const t=e.options.filter(n=>!n.hidden),i=e._getHelpOption();if(i&&!i.hidden){const n=i.short&&e._findOption(i.short),s=i.long&&e._findOption(i.long);!n&&!s?t.push(i):i.long&&!s?t.push(e.createOption(i.long,i.description)):i.short&&!n&&t.push(e.createOption(i.short,i.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];const t=[];for(let i=e.parent;i;i=i.parent){const n=i.options.filter(s=>!s.hidden);t.push(...n)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){const t=e.registeredArguments.map(i=>ue(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((i,n)=>Math.max(i,t.subcommandTerm(n).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((i,n)=>Math.max(i,t.optionTerm(n).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((i,n)=>Math.max(i,t.optionTerm(n).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((i,n)=>Math.max(i,t.argumentTerm(n).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let i="";for(let n=e.parent;n;n=n.parent)i=n.name()+" "+i;return i+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const i=`(${t.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatHelp(e,t){const i=t.padWidth(e,t),n=t.helpWidth||80,s=2,r=2;function a(m,$){if($){const v=`${m.padEnd(i+r)}${$}`;return t.wrap(v,n-s,i+r)}return m}function o(m){return m.join(`
3
+ `).replace(/^/gm," ".repeat(s))}let l=[`Usage: ${t.commandUsage(e)}`,""];const h=t.commandDescription(e);h.length>0&&(l=l.concat([t.wrap(h,n,0),""]));const p=t.visibleArguments(e).map(m=>a(t.argumentTerm(m),t.argumentDescription(m)));p.length>0&&(l=l.concat(["Arguments:",o(p),""]));const f=t.visibleOptions(e).map(m=>a(t.optionTerm(m),t.optionDescription(m)));if(f.length>0&&(l=l.concat(["Options:",o(f),""])),this.showGlobalOptions){const m=t.visibleGlobalOptions(e).map($=>a(t.optionTerm($),t.optionDescription($)));m.length>0&&(l=l.concat(["Global Options:",o(m),""]))}const b=t.visibleCommands(e).map(m=>a(t.subcommandTerm(m),t.subcommandDescription(m)));return b.length>0&&(l=l.concat(["Commands:",o(b),""])),l.join(`
4
+ `)}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,i,n=40){const s=" \\f\\t\\v   -    \uFEFF",r=new RegExp(`[\\n][${s}]+`);if(e.match(r))return e;const a=t-i;if(a<n)return e;const o=e.slice(0,i),l=e.slice(i).replace(`\r
5
+ `,`
6
+ `),h=" ".repeat(i),f="\\s​",b=new RegExp(`
7
+ |.{1,${a-1}}([${f}]|$)|[^${f}]+?([${f}]|$)`,"g"),m=l.match(b)||[];return o+m.map(($,v)=>$===`
8
+ `?"":(v>0?h:"")+$.trimEnd()).join(`
9
+ `)}};I.Help=he;var j={};const{InvalidArgumentError:ce}=V;let pe=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const i=fe(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,i)=>{if(!this.argChoices.includes(t))throw new ce(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,i):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return de(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},me=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(e,t){const i=t.attributeName();if(!this.dualOptions.has(i))return!0;const n=this.negativeOptions.get(i).presetArg,s=n!==void 0?n:!1;return t.negate===(s===e)}};function de(u){return u.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function fe(u){let e,t;const i=u.split(/[ |,]+/);return i.length>1&&!/^[[<]/.test(i[1])&&(e=i.shift()),t=i.shift(),!e&&/^-[^-]$/.test(t)&&(e=t,t=void 0),{shortFlag:e,longFlag:t}}j.Option=pe;j.DualOptions=me;var G={};const B=3;function ge(u,e){if(Math.abs(u.length-e.length)>B)return Math.max(u.length,e.length);const t=[];for(let i=0;i<=u.length;i++)t[i]=[i];for(let i=0;i<=e.length;i++)t[0][i]=i;for(let i=1;i<=e.length;i++)for(let n=1;n<=u.length;n++){let s=1;u[n-1]===e[i-1]?s=0:s=1,t[n][i]=Math.min(t[n-1][i]+1,t[n][i-1]+1,t[n-1][i-1]+s),n>1&&i>1&&u[n-1]===e[i-2]&&u[n-2]===e[i-1]&&(t[n][i]=Math.min(t[n][i],t[n-2][i-2]+1))}return t[u.length][e.length]}function _e(u,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));const t=u.startsWith("--");t&&(u=u.slice(2),e=e.map(r=>r.slice(2)));let i=[],n=B;const s=.4;return e.forEach(r=>{if(r.length<=1)return;const a=ge(u,r),o=Math.max(u.length,r.length);(o-a)/o>s&&(a<n?(n=a,i=[r]):a===n&&i.push(r))}),i.sort((r,a)=>r.localeCompare(a)),t&&(i=i.map(r=>`--${r}`)),i.length>1?`
10
+ (Did you mean one of ${i.join(", ")}?)`:i.length===1?`
11
+ (Did you mean ${i[0]}?)`:""}G.suggestSimilar=_e;const Oe=ee.EventEmitter,F=te,w=ie,D=ne,d=se,{Argument:be,humanReadableArgName:Ce}=S,{CommanderError:N}=V,{Help:Ae}=I,{Option:q,DualOptions:$e}=j,{suggestSimilar:W}=G;let we=class z extends Oe{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:t=>d.stdout.write(t),writeErr:t=>d.stderr.write(t),getOutHelpWidth:()=>d.stdout.isTTY?d.stdout.columns:void 0,getErrHelpWidth:()=>d.stderr.isTTY?d.stderr.columns:void 0,outputError:(t,i)=>i(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){const e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,i){let n=t,s=i;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};const[,r,a]=e.match(/([^ ]+) *(.*)/),o=this.createCommand(r);return n&&(o.description(n),o._executableHandler=!0),s.isDefault&&(this._defaultCommandName=o._name),o._hidden=!!(s.noHelp||s.hidden),o._executableFile=s.executableFile||null,a&&o.arguments(a),this._registerCommand(o),o.parent=this,o.copyInheritedSettings(this),n?this:o}createCommand(e){return new z(e)}createHelp(){return Object.assign(new Ae,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
12
+ - specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new be(e,t)}argument(e,t,i,n){const s=this.createArgument(e,t);return typeof i=="function"?s.default(n).argParser(i):s.default(i),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){const t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";const[,i,n]=e.match(/([^ ]+) *(.*)/),s=t??"display help for command",r=this.createCommand(i);return r.helpOption(!1),n&&r.arguments(n),s&&r.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=r,this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){const i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
13
+ Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,i){this._exitCallback&&this._exitCallback(new N(e,t,i)),d.exit(e)}action(e){const t=i=>{const n=this.registeredArguments.length,s=i.slice(0,n);return this._storeOptionsAsProperties?s[n]=this:s[n]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=t,this}createOption(e,t){return new q(e,t)}_callParseArg(e,t,i,n){try{return e.parseArg(t,i)}catch(s){if(s.code==="commander.invalidArgument"){const r=`${n} ${s.message}`;this.error(r,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(e){const t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){const i=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
14
+ - already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){const t=n=>[n.name()].concat(n.aliases()),i=t(e).find(n=>this._findCommand(n));if(i){const n=t(this._findCommand(i)).join("|"),s=t(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${n}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);const t=e.name(),i=e.attributeName();if(e.negate){const s=e.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(i,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");const n=(s,r,a)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);const o=this.getOptionValue(i);s!==null&&e.parseArg?s=this._callParseArg(e,s,o,r):s!==null&&e.variadic&&(s=e._concatValue(s,o)),s==null&&(e.negate?s=!1:e.isBoolean()||e.optional?s=!0:s=""),this.setOptionValueWithSource(i,s,a)};return this.on("option:"+t,s=>{const r=`error: option '${e.flags}' argument '${s}' is invalid.`;n(s,r,"cli")}),e.envVar&&this.on("optionEnv:"+t,s=>{const r=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;n(s,r,"env")}),this}_optionEx(e,t,i,n,s){if(typeof t=="object"&&t instanceof q)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const r=this.createOption(t,i);if(r.makeOptionMandatory(!!e.mandatory),typeof n=="function")r.default(s).argParser(n);else if(n instanceof RegExp){const a=n;n=(o,l)=>{const h=a.exec(o);return h?h[0]:l},r.default(s).argParser(n)}else r.default(n);return this.addOption(r)}option(e,t,i,n){return this._optionEx({},e,t,i,n)}requiredOption(e,t,i,n){return this._optionEx({mandatory:!0},e,t,i,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,i){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(t=i.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");t=t||{},e===void 0&&(e=d.argv,d.versions&&d.versions.electron&&(t.from="electron")),this.rawArgs=e.slice();let i;switch(t.from){case void 0:case"node":this._scriptPath=e[1],i=e.slice(2);break;case"electron":d.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case"user":i=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,t){const i=this._prepareUserArgs(e,t);return this._parseCommand([],i),this}async parseAsync(e,t){const i=this._prepareUserArgs(e,t);return await this._parseCommand([],i),this}_executeSubCommand(e,t){t=t.slice();let i=!1;const n=[".js",".ts",".tsx",".mjs",".cjs"];function s(h,p){const f=w.resolve(h,p);if(D.existsSync(f))return f;if(n.includes(w.extname(p)))return;const b=n.find(m=>D.existsSync(`${f}${m}`));if(b)return`${f}${b}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let h;try{h=D.realpathSync(this._scriptPath)}catch{h=this._scriptPath}a=w.resolve(w.dirname(h),a)}if(a){let h=s(a,r);if(!h&&!e._executableFile&&this._scriptPath){const p=w.basename(this._scriptPath,w.extname(this._scriptPath));p!==this._name&&(h=s(a,`${p}-${e._name}`))}r=h||r}i=n.includes(w.extname(r));let o;d.platform!=="win32"?i?(t.unshift(r),t=M(d.execArgv).concat(t),o=F.spawn(d.argv[0],t,{stdio:"inherit"})):o=F.spawn(r,t,{stdio:"inherit"}):(t.unshift(r),t=M(d.execArgv).concat(t),o=F.spawn(d.execPath,t,{stdio:"inherit"})),o.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(p=>{d.on(p,()=>{o.killed===!1&&o.exitCode===null&&o.kill(p)})});const l=this._exitCallback;o.on("close",(h,p)=>{h=h??1,l?l(new N(h,"commander.executeSubCommandAsync","(close)")):d.exit(h)}),o.on("error",h=>{if(h.code==="ENOENT"){const p=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",f=`'${r}' does not exist
15
+ - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
16
+ - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
17
+ - ${p}`;throw new Error(f)}else if(h.code==="EACCES")throw new Error(`'${r}' not executable`);if(!l)d.exit(1);else{const p=new N(1,"commander.executeSubCommandAsync","(error)");p.nestedError=h,l(p)}}),this.runningCommand=o}_dispatchSubcommand(e,t,i){const n=this._findCommand(e);n||this.help({error:!0});let s;return s=this._chainOrCallSubCommandHook(s,n,"preSubcommand"),s=this._chainOrCall(s,()=>{if(n._executableHandler)this._executeSubCommand(n,t.concat(i));else return n._parseCommand(t,i)}),s}_dispatchHelpCommand(e){e||this.help();const t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){const e=(i,n,s)=>{let r=n;if(n!==null&&i.parseArg){const a=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;r=this._callParseArg(i,n,s,a)}return r};this._checkNumberOfArguments();const t=[];this.registeredArguments.forEach((i,n)=>{let s=i.defaultValue;i.variadic?n<this.args.length?(s=this.args.slice(n),i.parseArg&&(s=s.reduce((r,a)=>e(i,a,r),i.defaultValue))):s===void 0&&(s=[]):n<this.args.length&&(s=this.args[n],i.parseArg&&(s=e(i,s,i.defaultValue))),t[n]=s}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let i=e;const n=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[t]!==void 0).forEach(s=>{s._lifeCycleHooks[t].forEach(r=>{n.push({hookedCommand:s,callback:r})})}),t==="postAction"&&n.reverse(),n.forEach(s=>{i=this._chainOrCall(i,()=>s.callback(s.hookedCommand,this))}),i}_chainOrCallSubCommandHook(e,t,i){let n=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(s=>{n=this._chainOrCall(n,()=>s(this,t))}),n}_parseCommand(e,t){const i=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),t=i.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let r;return r=this._chainOrCallHooks(r,"preAction"),r=this._chainOrCall(r,()=>this._actionHandler(this.processedArgs)),this.parent&&(r=this._chainOrCall(r,()=>{this.parent.emit(s,e,t)})),r=this._chainOrCallHooks(r,"postAction"),r}if(this.parent&&this.parent.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){const e=this.options.filter(i=>{const n=i.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{const n=e.find(s=>i.conflictsWith.includes(s.attributeName()));n&&this._conflictingOption(i,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){const t=[],i=[];let n=t;const s=e.slice();function r(o){return o.length>1&&o[0]==="-"}let a=null;for(;s.length;){const o=s.shift();if(o==="--"){n===i&&n.push(o),n.push(...s);break}if(a&&!r(o)){this.emit(`option:${a.name()}`,o);continue}if(a=null,r(o)){const l=this._findOption(o);if(l){if(l.required){const h=s.shift();h===void 0&&this.optionMissingArgument(l),this.emit(`option:${l.name()}`,h)}else if(l.optional){let h=null;s.length>0&&!r(s[0])&&(h=s.shift()),this.emit(`option:${l.name()}`,h)}else this.emit(`option:${l.name()}`);a=l.variadic?l:null;continue}}if(o.length>2&&o[0]==="-"&&o[1]!=="-"){const l=this._findOption(`-${o[1]}`);if(l){l.required||l.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${l.name()}`,o.slice(2)):(this.emit(`option:${l.name()}`),s.unshift(`-${o.slice(2)}`));continue}}if(/^--[^=]+=/.test(o)){const l=o.indexOf("="),h=this._findOption(o.slice(0,l));if(h&&(h.required||h.optional)){this.emit(`option:${h.name()}`,o.slice(l+1));continue}}if(r(o)&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&i.length===0){if(this._findCommand(o)){t.push(o),s.length>0&&i.push(...s);break}else if(this._getHelpCommand()&&o===this._getHelpCommand().name()){t.push(o),s.length>0&&t.push(...s);break}else if(this._defaultCommandName){i.push(o),s.length>0&&i.push(...s);break}}if(this._passThroughOptions){n.push(o),s.length>0&&n.push(...s);break}n.push(o)}return{operands:t,unknown:i}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let i=0;i<t;i++){const n=this.options[i].attributeName();e[n]=n===this._versionOptionName?this._version:this[n]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
18
+ `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
19
+ `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
20
+ `),this.outputHelp({error:!0}));const i=t||{},n=i.exitCode||1,s=i.code||"commander.error";this._exit(n,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in d.env){const t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,d.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){const e=new $e(this.options),t=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&t(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!t(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const i=r=>{const a=r.attributeName(),o=this.getOptionValue(a),l=this.options.find(p=>p.negate&&a===p.attributeName()),h=this.options.find(p=>!p.negate&&a===p.attributeName());return l&&(l.presetArg===void 0&&o===!1||l.presetArg!==void 0&&o===l.presetArg)?l:h||r},n=r=>{const a=i(r),o=a.attributeName();return this.getOptionValueSource(o)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{const r=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);n=n.concat(r),s=s.parent}while(s&&!s._enablePositionalOptions);t=W(e,n)}const i=`error: unknown option '${e}'${t}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this.registeredArguments.length,i=t===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${i} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias())}),t=W(e,n)}const i=`error: unknown command '${e}'${t}`;this.error(i,{code:"commander.unknownCommand"})}version(e,t,i){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",i=i||"output the version number";const n=this.createOption(t,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
21
+ `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");const i=this.parent?._findCommand(e);if(i){const n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;const t=this.registeredArguments.map(i=>Ce(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=w.basename(e,w.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){const t=this.createHelp();return t.helpWidth===void 0&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){e=e||{};const t={error:!!e.error};let i;return t.error?i=n=>this._outputConfiguration.writeErr(n):i=n=>this._outputConfiguration.writeOut(n),t.write=e.write||i,t.command=this,t}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);const i=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let n=this.helpInformation(i);if(t&&(n=t(n),typeof n!="string"&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(n),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,t){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=d.exitCode||0;t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
22
+ Expecting one of '${i.join("', '")}'`);const n=`${e}Help`;return this.on(n,s=>{let r;typeof t=="function"?r=t({error:s.error,command:s.command}):r=t,r&&s.write(`${r}
23
+ `)}),this}_outputHelpIfRequested(e){const t=this._getHelpOption();t&&e.find(n=>t.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function M(u){return u.map(e=>{if(!e.startsWith("--inspect"))return e;let t,i="127.0.0.1",n="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?t=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=s[1],/^\d+$/.test(s[3])?n=s[3]:i=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=s[1],i=s[3],n=s[4]),t&&n!=="0"?`${t}=${i}:${parseInt(n)+1}`:e})}U.Command=we;const{Argument:J}=S,{Command:T}=U,{CommanderError:ve,InvalidArgumentError:K}=V,{Help:ye}=I,{Option:Y}=j;A.program=new T;A.createCommand=u=>new T(u);A.createOption=(u,e)=>new Y(u,e);A.createArgument=(u,e)=>new J(u,e);A.Command=T;A.Option=Y;A.Argument=J;A.Help=ye;A.CommanderError=ve;A.InvalidArgumentError=K;A.InvalidOptionArgumentError=K;const{program:C,createCommand:ot,createArgument:at,createOption:lt,CommanderError:ut,InvalidArgumentError:ht,InvalidOptionArgumentError:ct,Command:pt,Argument:mt,Option:R,Help:Ee}=A;var ke=O._baseClone,xe=1,He=4;function Ve(u){return ke(u,xe|He)}var Se=Ve;const je=O.getDefaultExportFromCjs(Se),Pe="npm-check-updates",Fe="17.0.0-1",De="Tomas Junnonen <tomas1@gmail.com>",Ne="Apache-2.0",Ie=["Raine Revere (https://github.com/raineorshine)","Imamuzzaki Abu Salam <imamuzzaki@gmail.com>"],Te="Find newer versions of dependencies than what your package.json allows",qe=["npm","check","find","discover","updates","upgrades","dependencies","package.json","updater","version","management","ncu","bun","yarn","pnpm"],We={node:"^18.18.0 || >=20.0.0",npm:">=8.12.1"},Me="build/index.js",Re="build/index.d.ts",Le={build:"npm run build:options && vite build","build:options":"vite-node src/scripts/build-options.ts",lint:"cross-env FORCE_COLOR=1 npm-run-all --parallel --aggregate-output lint:*","lint:lockfile":"lockfile-lint","lint:markdown":'markdownlint "**/*.md" --ignore node_modules --ignore build --config .markdownlint.js',"lint:src":"eslint --cache --cache-location node_modules/.cache/.eslintcache --ignore-path .gitignore --report-unused-disable-directives .",prepare:"src/scripts/install-hooks && test/bun-setup.sh",prepublishOnly:"npm run build",prettier:"prettier . --check",test:"mocha test test/package-managers/*",ncu:"node build/cli.js"},Ue={"npm-check-updates":"build/cli.js",ncu:"build/cli.js"},Ge={type:"git",url:"git+https://github.com/raineorshine/npm-check-updates.git"},Be="https://github.com/raineorshine/npm-check-updates",ze={url:"https://github.com/raineorshine/npm-check-updates/issues"},Je={"@yarnpkg/parsers":"2.6.0"},Ke={"@trivago/prettier-plugin-sort-imports":"^4.3.0","@types/chai":"^4.3.12","@types/chai-as-promised":"^7.1.8","@types/chai-string":"^1.4.5","@types/cli-table":"^0.3.4","@types/hosted-git-info":"^3.0.5","@types/ini":"^4.1.0","@types/js-yaml":"^4.0.9","@types/json-parse-helpfulerror":"^1.0.3","@types/jsonlines":"^0.1.5","@types/lodash":"^4.17.0","@types/make-fetch-happen":"^10.0.4","@types/mocha":"^10.0.6","@types/node":"^20.11.27","@types/pacote":"^11.1.8","@types/parse-github-url":"^1.0.3","@types/picomatch":"^2.3.3","@types/progress":"^2.0.7","@types/prompts":"^2.4.9","@types/remote-git-tags":"^4.0.2","@types/semver":"^7.5.8","@types/semver-utils":"^1.1.3","@types/sinon":"^17.0.3","@types/update-notifier":"^6.0.8","@typescript-eslint/eslint-plugin":"^7.2.0","@typescript-eslint/parser":"^7.2.0",c8:"^9.1.0",chai:"^4.3.10","chai-as-promised":"^7.1.1","chai-string":"^1.5.0",chalk:"^5.3.0","cli-table3":"^0.6.3",commander:"^12.0.0","cross-env":"^7.0.3",eslint:"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-config-raine":"^0.5.0","eslint-config-standard":"^17.1.0","eslint-plugin-import":"^2.29.1","eslint-plugin-jsdoc":"^48.2.1","eslint-plugin-n":"^16.6.2","eslint-plugin-promise":"^6.1.1","fast-glob":"^3.3.2","fast-memoize":"^2.5.2","find-up":"5.0.0","fp-and-or":"^1.0.2","hosted-git-info":"^7.0.1",ini:"^4.1.2","js-yaml":"^4.1.0","json-parse-helpfulerror":"^1.0.3",jsonlines:"^0.1.1","lockfile-lint":"^4.13.2",lodash:"^4.17.21","make-fetch-happen":"^13.0.0","markdownlint-cli":"^0.39.0",mocha:"^10.3.0","npm-run-all":"^4.1.5","p-map":"^4.0.0",pacote:"17.0.6","parse-github-url":"^1.0.2",picomatch:"^4.0.1",prettier:"^3.2.5",progress:"^2.0.3","prompts-ncu":"^3.0.0","rc-config-loader":"^4.1.3","remote-git-tags":"^3.0.0",semver:"^7.6.0","semver-utils":"^1.1.4",should:"^13.2.3",sinon:"^17.0.1","source-map-support":"^0.5.21","spawn-please":"^3.0.0","strip-ansi":"^7.1.0","strip-json-comments":"^5.0.1","ts-node":"^10.9.2",typescript:"^5.4.2","typescript-json-schema":"^0.63.0",untildify:"^4.0.0","update-notifier":"^7.0.0",vite:"^5.1.6","vite-node":"^1.3.1","vite-plugin-dts":"^3.7.3",yarn:"^1.22.22"},Ye=["build","!**/test/**"],Qe={"check-leaks":!0,extension:["test.ts"],require:["source-map-support/register","ts-node/register"],timeout:6e4,"trace-deprecation":!0,"trace-warnings":!0,use_strict:!0},Xe={reporter:["html","lcov","text-summary"]},H={name:Pe,version:Fe,author:De,license:Ne,contributors:Ie,description:Te,keywords:qe,engines:We,main:Me,types:Re,scripts:Le,bin:Ue,repository:Ge,homepage:Be,bugs:ze,overrides:Je,devDependencies:Ke,files:Ye,"lockfile-lint":{"allowed-schemes":["https:"],"allowed-hosts":["npm"],"empty-hostname":!1,type:"npm ",path:"package-lock.json"},mocha:Qe,c8:Xe},Ze=u=>u.replace(/`/g,"");(async()=>{const{default:u}=await Promise.resolve().then(()=>require("./index-DgVn3Gax.js")),e=u({pkg:H});if(e.update&&e.update.latest!==H.version){const{default:c}=await Promise.resolve().then(()=>require("./index-Ci8A2QXv.js")),_=O.semver.parse(e.update.current)?.major,g=O.semver.parse(e.update.latest)?.major,E=(_&&g&&g>=_?new Array(g-_).fill(0).map((k,P)=>_+P+1):[]).map(k=>`${H.homepage??""}/releases/tag/v${k}.0.0`),y=`${H.homepage??""}/compare/v${e.update.current}...v${e.update.latest}`;e.notify({defer:!1,isGlobal:!0,message:`Update available ${c.dim("{currentVersion}")}${c.reset(" → ")}${e.update.type==="major"?c.red("{latestVersion}"):e.update.type==="minor"?c.yellow("{latestVersion}"):c.green("{latestVersion}")}
24
+ Run ${c.cyan("{updateCommand}")} to update
25
+ ${c.dim.underline(e.update.type==="major"?E.map(k=>c.dim.underline(k)).join(`
26
+ `):y)}`})}const t=process.argv.slice(2);if(t.includes("--help")&&t.length>1){const c=t.includes("--color");await O.chalkInit(c);const _=t.filter(g=>g!=="--help");_.forEach(g=>{const x=g.replace(/^-*/,""),E=O.cliOptionsSorted.find(y=>x===y.long||x===y.short||x===`no-${y.long}`&&y.type==="boolean");console.info(E?O.renderExtendedHelp(E)+`
27
+ `:`Unknown option: ${g}`)}),t.length-_.length>1&&console.info("Would you like some help with your help?"),process.exit(0)}const i=new Set(O.cliOptionsSorted.filter(c=>c.cli===!1).map(c=>`--${c.long}`));C.description("[filter] is a list or regex of package names to check (all others will be ignored).").usage("[options] [filter]").configureHelp({optionTerm:c=>c.long&&i.has(c.long)?c.long.replace("--","")+"*":c.long==="--version"?"-v, -V, --version":c.flags.replace("[bool]",""),optionDescription:c=>c.long==="--version"?"Output the version number of npm-check-updates.":c.long==="--help"?"You're lookin' at it.":Ee.prototype.optionDescription(c)}).addOption(new R("-v, --versionAlias").hideHelp()).on("option:versionAlias",()=>{console.info(H.version),process.exit(0)}),O.cliOptionsSorted.forEach(({long:c,short:_,arg:g,description:x,default:E,help:y,parse:k,type:P})=>{const X=`${_?`-${_}, `:""}--${c}${g?` <${g}>`:""}`,Z=`${Ze(x)}${y?` Run "ncu --help ${c}" for details.`:""}`;C.option(X,Z,k||E,k?E:void 0),P==="boolean"&&C.addOption(new R(`--no-${c}`).default(!1).hideHelp())}),C.version(H.version);const n=je(C._optionValues);C.parse(process.argv);const s=C.opts(),r=process.argv.slice(2),{color:a,configFileName:o,configFilePath:l,global:h,packageFile:p,mergeConfig:f}=s;await O.chalkInit(a);const b=!process.env.NCU_TESTS||l||f?await O.getNcuRc({configFileName:o,configFilePath:l,global:h,packageFile:p,options:{...s,cli:!0}}):null,m=(b?.args||[]).filter((c,_,g)=>(typeof c!="string"||!c.startsWith("-")||!r.includes(c))&&(typeof g[_-1]!="string"||!g[_-1].startsWith("-")||!r.includes(g[_-1]))),$=[...process.argv.slice(0,2),...m,...r];C._optionValues=n,C.parse($);const v=C.opts(),Q={...b&&Object.keys(b.config).length>0?{rcConfigPath:b.filePath}:null,...O.pickBy(C.opts(),c=>c!==void 0),args:C.args,...v.filter?{filter:v.filter}:null,...v.reject?{reject:v.reject}:null};O.run(Q,{cli:!0})})();
28
+ //# sourceMappingURL=cli.js.map