cmake-ts
Version:
cmake-js rewrite in typescript to support advanced build configurations
1 lines • 1.28 MB
Source Map (JSON)
{"version":3,"file":"main.mjs","sources":["../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/error.js","../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/argument.js","../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/help.js","../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/option.js","../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/suggestSimilar.js","../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/command.js","../node_modules/.pnpm/commander@13.1.0/node_modules/commander/index.js","../node_modules/.pnpm/commander@13.1.0/node_modules/commander/esm.mjs","../src/utils/env.ts","../src/utils/logger.ts","../src/args.ts","../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js","../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js","../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js","../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js","../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/fs/index.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/mkdirs/utils.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/mkdirs/make-dir.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/mkdirs/index.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/path-exists/index.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/util/utimes.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/util/stat.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/copy/copy.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/copy/copy-sync.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/copy/index.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/remove/rimraf.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/remove/index.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/empty/index.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/ensure/file.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/ensure/link.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/ensure/symlink-paths.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/ensure/symlink-type.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/ensure/symlink.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/ensure/index.js","../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js","../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/json/jsonfile.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/output-file/index.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/json/output-json.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/json/output-json-sync.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/json/index.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/move/move.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/move/move-sync.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/move/index.js","../node_modules/.pnpm/fs-extra@10.1.0/node_modules/fs-extra/lib/index.js","../node_modules/.pnpm/resolve@1.22.10/node_modules/resolve/lib/homedir.js","../node_modules/.pnpm/resolve@1.22.10/node_modules/resolve/lib/caller.js","../node_modules/.pnpm/path-parse@1.0.7/node_modules/path-parse/index.js","../node_modules/.pnpm/resolve@1.22.10/node_modules/resolve/lib/node-modules-paths.js","../node_modules/.pnpm/resolve@1.22.10/node_modules/resolve/lib/normalize-options.js","../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js","../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js","../node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js","../node_modules/.pnpm/is-core-module@2.16.1/node_modules/is-core-module/index.js","../node_modules/.pnpm/resolve@1.22.10/node_modules/resolve/lib/async.js","../node_modules/.pnpm/resolve@1.22.10/node_modules/resolve/async.js","../src/nodeAPIInclude/resolve.ts","../src/utils/fs.ts","../src/nodeAPIInclude/search.ts","../src/nodeAPIInclude/index.ts","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/parse-options.js","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js","../src/urlRegistry.ts","../src/vcvarsall.ts","../src/argumentBuilder.ts","../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js","../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js","../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js","../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/function/noop.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/is-value.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/normalize-options.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/math/sign/is-implemented.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/math/sign/shim.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/math/sign/index.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/number/to-integer.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/number/to-pos-integer.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/lib/resolve-length.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/valid-callable.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/valid-value.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/_iterate.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/for-each.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/assign/is-implemented.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/keys/is-implemented.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/keys/shim.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/keys/index.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/assign/shim.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/assign/index.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/is-object.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/error/custom.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/mixin.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/function/_define-length.js","../node_modules/.pnpm/type@2.7.3/node_modules/type/value/is.js","../node_modules/.pnpm/type@2.7.3/node_modules/type/object/is.js","../node_modules/.pnpm/type@2.7.3/node_modules/type/prototype/is.js","../node_modules/.pnpm/type@2.7.3/node_modules/type/function/is.js","../node_modules/.pnpm/type@2.7.3/node_modules/type/plain-function/is.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/string/#/contains/is-implemented.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/string/#/contains/shim.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/string/#/contains/index.js","../node_modules/.pnpm/d@1.0.2/node_modules/d/index.js","../node_modules/.pnpm/event-emitter@0.3.5/node_modules/event-emitter/index.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/array/from/is-implemented.js","../node_modules/.pnpm/ext@1.7.0/node_modules/ext/global-this/is-implemented.js","../node_modules/.pnpm/ext@1.7.0/node_modules/ext/global-this/implementation.js","../node_modules/.pnpm/ext@1.7.0/node_modules/ext/global-this/index.js","../node_modules/.pnpm/es6-symbol@3.1.4/node_modules/es6-symbol/is-implemented.js","../node_modules/.pnpm/es6-symbol@3.1.4/node_modules/es6-symbol/is-symbol.js","../node_modules/.pnpm/es6-symbol@3.1.4/node_modules/es6-symbol/validate-symbol.js","../node_modules/.pnpm/es6-symbol@3.1.4/node_modules/es6-symbol/lib/private/generate-name.js","../node_modules/.pnpm/es6-symbol@3.1.4/node_modules/es6-symbol/lib/private/setup/standard-symbols.js","../node_modules/.pnpm/es6-symbol@3.1.4/node_modules/es6-symbol/lib/private/setup/symbol-registry.js","../node_modules/.pnpm/es6-symbol@3.1.4/node_modules/es6-symbol/polyfill.js","../node_modules/.pnpm/es6-symbol@3.1.4/node_modules/es6-symbol/index.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/function/is-arguments.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/function/is-function.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/string/is-string.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/array/from/shim.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/array/from/index.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/array/to-array.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/lib/resolve-resolve.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/lib/resolve-normalize.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/lib/configure-map.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/plain.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/normalizers/primitive.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/normalizers/get-primitive-fixed.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/number/is-nan/is-implemented.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/number/is-nan/shim.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/number/is-nan/index.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/array/#/e-index-of.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/normalizers/get.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/normalizers/get-1.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/normalizers/get-fixed.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/map.js","../node_modules/.pnpm/next-tick@1.1.0/node_modules/next-tick/index.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/ext/async.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/primitive-set.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/is-callable.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/validate-stringifiable.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/validate-stringifiable-value.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/safe-to-string.js","../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/to-short-string-representation.js","../node_modules/.pnpm/is-promise@2.2.2/node_modules/is-promise/index.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/ext/promise.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/ext/dispose.js","../node_modules/.pnpm/timers-ext@0.1.8/node_modules/timers-ext/max-timeout.js","../node_modules/.pnpm/timers-ext@0.1.8/node_modules/timers-ext/valid-timeout.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/ext/max-age.js","../node_modules/.pnpm/lru-queue@0.1.0/node_modules/lru-queue/index.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/ext/max.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/ext/ref-counter.js","../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/index.js","../src/utils/exec.ts","../src/generator.ts","../src/config.ts","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/lrucache.js","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/eq.js","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/neq.js","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/cmp.js","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/comparator.js","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js","../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js","../src/override.ts","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/errno.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/fs.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/path.js","../node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.js","../node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.js","../node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.js","../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js","../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js","../node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.js","../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.js","../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js","../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js","../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js","../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js","../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js","../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js","../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js","../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js","../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.js","../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js","../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js","../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.js","../node_modules/.pnpm/micromatch@4.0.8/node_modules/micromatch/index.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/pattern.js","../node_modules/.pnpm/merge2@1.4.1/node_modules/merge2/index.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/stream.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/string.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/index.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/managers/tasks.js","../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.js","../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.js","../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/adapters/fs.js","../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js","../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.js","../node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/index.js","../node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/index.js","../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.js","../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/fs.js","../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.js","../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/common.js","../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/async.js","../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/sync.js","../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/adapters/fs.js","../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js","../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/index.js","../node_modules/.pnpm/reusify@1.1.0/node_modules/reusify/reusify.js","../node_modules/.pnpm/fastq@1.19.1/node_modules/fastq/queue.js","../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/common.js","../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/reader.js","../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/async.js","../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.js","../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/stream.js","../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/sync.js","../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/sync.js","../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js","../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/reader.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/stream.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/async.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/matchers/matcher.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/matchers/partial.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/deep.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/entry.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/error.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/transformers/entry.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/provider.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/async.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/stream.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/sync.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/sync.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/settings.js","../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/index.js","../node_modules/.pnpm/url-join@4.0.1/node_modules/url-join/lib/url-join.js","../src/libc.ts","../node_modules/.pnpm/node-downloader-helper@2.1.9/node_modules/node-downloader-helper/dist/index.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/high-level-opt.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/warn-mixin.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/types.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/large-numbers.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/header.js","../node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/iterator.js","../node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/yallist.js","../node_modules/.pnpm/minipass@5.0.0/node_modules/minipass/index.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/normalize-windows-path.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/read-entry.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/pax.js","../node_modules/.pnpm/minizlib@2.1.2/node_modules/minizlib/constants.js","../node_modules/.pnpm/minipass@3.3.6/node_modules/minipass/index.js","../node_modules/.pnpm/minizlib@2.1.2/node_modules/minizlib/index.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/parse.js","../node_modules/.pnpm/fs-minipass@2.1.0/node_modules/fs-minipass/index.js","../src/deps/mkdirp.ts","../node_modules/.pnpm/chownr@2.0.0/node_modules/chownr/chownr.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/mkdir.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/winchars.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/normalize-unicode.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/strip-trailing-slashes.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/path-reservations.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/strip-absolute-path.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/get-write-flag.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/unpack.js","../node_modules/.pnpm/tar@6.2.1/node_modules/tar/lib/extract.js","../src/utils/retry.ts","../src/utils/download.ts","../src/runtimeDistribution.ts","../src/build.ts","../src/main.ts"],"sourcesContent":["/**\n * CommanderError class\n */\nclass CommanderError extends Error {\n /**\n * Constructs the CommanderError class\n * @param {number} exitCode suggested exit code which could be used with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n */\n constructor(exitCode, code, message) {\n super(message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n this.code = code;\n this.exitCode = exitCode;\n this.nestedError = undefined;\n }\n}\n\n/**\n * InvalidArgumentError class\n */\nclass InvalidArgumentError extends CommanderError {\n /**\n * Constructs the InvalidArgumentError class\n * @param {string} [message] explanation of why argument is invalid\n */\n constructor(message) {\n super(1, 'commander.invalidArgument', message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n }\n}\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\n","const { InvalidArgumentError } = require('./error.js');\n\nclass Argument {\n /**\n * Initialize a new command argument with the given name and description.\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @param {string} name\n * @param {string} [description]\n */\n\n constructor(name, description) {\n this.description = description || '';\n this.variadic = false;\n this.parseArg = undefined;\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.argChoices = undefined;\n\n switch (name[0]) {\n case '<': // e.g. <required>\n this.required = true;\n this._name = name.slice(1, -1);\n break;\n case '[': // e.g. [optional]\n this.required = false;\n this._name = name.slice(1, -1);\n break;\n default:\n this.required = true;\n this._name = name;\n break;\n }\n\n if (this._name.length > 3 && this._name.slice(-3) === '...') {\n this.variadic = true;\n this._name = this._name.slice(0, -3);\n }\n }\n\n /**\n * Return argument name.\n *\n * @return {string}\n */\n\n name() {\n return this._name;\n }\n\n /**\n * @package\n */\n\n _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Argument}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n *\n * @param {Function} [fn]\n * @return {Argument}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Only allow argument value to be one of choices.\n *\n * @param {string[]} values\n * @return {Argument}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._concatValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Make argument required.\n *\n * @returns {Argument}\n */\n argRequired() {\n this.required = true;\n return this;\n }\n\n /**\n * Make argument optional.\n *\n * @returns {Argument}\n */\n argOptional() {\n this.required = false;\n return this;\n }\n}\n\n/**\n * Takes an argument and returns its human readable equivalent for help usage.\n *\n * @param {Argument} arg\n * @return {string}\n * @private\n */\n\nfunction humanReadableArgName(arg) {\n const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');\n\n return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']';\n}\n\nexports.Argument = Argument;\nexports.humanReadableArgName = humanReadableArgName;\n","const { humanReadableArgName } = require('./argument.js');\n\n/**\n * TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`\n * https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types\n * @typedef { import(\"./argument.js\").Argument } Argument\n * @typedef { import(\"./command.js\").Command } Command\n * @typedef { import(\"./option.js\").Option } Option\n */\n\n// Although this is a class, methods are static in style to allow override using subclass or just functions.\nclass Help {\n constructor() {\n this.helpWidth = undefined;\n this.minWidthToWrap = 40;\n this.sortSubcommands = false;\n this.sortOptions = false;\n this.showGlobalOptions = false;\n }\n\n /**\n * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`\n * and just before calling `formatHelp()`.\n *\n * Commander just uses the helpWidth and the rest is provided for optional use by more complex subclasses.\n *\n * @param {{ error?: boolean, helpWidth?: number, outputHasColors?: boolean }} contextOptions\n */\n prepareContext(contextOptions) {\n this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;\n }\n\n /**\n * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.\n *\n * @param {Command} cmd\n * @returns {Command[]}\n */\n\n visibleCommands(cmd) {\n const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);\n const helpCommand = cmd._getHelpCommand();\n if (helpCommand && !helpCommand._hidden) {\n visibleCommands.push(helpCommand);\n }\n if (this.sortSubcommands) {\n visibleCommands.sort((a, b) => {\n // @ts-ignore: because overloaded return type\n return a.name().localeCompare(b.name());\n });\n }\n return visibleCommands;\n }\n\n /**\n * Compare options for sort.\n *\n * @param {Option} a\n * @param {Option} b\n * @returns {number}\n */\n compareOptions(a, b) {\n const getSortKey = (option) => {\n // WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.\n return option.short\n ? option.short.replace(/^-/, '')\n : option.long.replace(/^--/, '');\n };\n return getSortKey(a).localeCompare(getSortKey(b));\n }\n\n /**\n * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleOptions(cmd) {\n const visibleOptions = cmd.options.filter((option) => !option.hidden);\n // Built-in help option.\n const helpOption = cmd._getHelpOption();\n if (helpOption && !helpOption.hidden) {\n // Automatically hide conflicting flags. Bit dubious but a historical behaviour that is convenient for single-command programs.\n const removeShort = helpOption.short && cmd._findOption(helpOption.short);\n const removeLong = helpOption.long && cmd._findOption(helpOption.long);\n if (!removeShort && !removeLong) {\n visibleOptions.push(helpOption); // no changes needed\n } else if (helpOption.long && !removeLong) {\n visibleOptions.push(\n cmd.createOption(helpOption.long, helpOption.description),\n );\n } else if (helpOption.short && !removeShort) {\n visibleOptions.push(\n cmd.createOption(helpOption.short, helpOption.description),\n );\n }\n }\n if (this.sortOptions) {\n visibleOptions.sort(this.compareOptions);\n }\n return visibleOptions;\n }\n\n /**\n * Get an array of the visible global options. (Not including help.)\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleGlobalOptions(cmd) {\n if (!this.showGlobalOptions) return [];\n\n const globalOptions = [];\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n const visibleOptions = ancestorCmd.options.filter(\n (option) => !option.hidden,\n );\n globalOptions.push(...visibleOptions);\n }\n if (this.sortOptions) {\n globalOptions.sort(this.compareOptions);\n }\n return globalOptions;\n }\n\n /**\n * Get an array of the arguments if any have a description.\n *\n * @param {Command} cmd\n * @returns {Argument[]}\n */\n\n visibleArguments(cmd) {\n // Side effect! Apply the legacy descriptions before the arguments are displayed.\n if (cmd._argsDescription) {\n cmd.registeredArguments.forEach((argument) => {\n argument.description =\n argument.description || cmd._argsDescription[argument.name()] || '';\n });\n }\n\n // If there are any arguments with a description then return all the arguments.\n if (cmd.registeredArguments.find((argument) => argument.description)) {\n return cmd.registeredArguments;\n }\n return [];\n }\n\n /**\n * Get the command term to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandTerm(cmd) {\n // Legacy. Ignores custom usage string, and nested commands.\n const args = cmd.registeredArguments\n .map((arg) => humanReadableArgName(arg))\n .join(' ');\n return (\n cmd._name +\n (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +\n (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option\n (args ? ' ' + args : '')\n );\n }\n\n /**\n * Get the option term to show in the list of options.\n *\n * @param {Option} option\n * @returns {string}\n */\n\n optionTerm(option) {\n return option.flags;\n }\n\n /**\n * Get the argument term to show in the list of arguments.\n *\n * @param {Argument} argument\n * @returns {string}\n */\n\n argumentTerm(argument) {\n return argument.name();\n }\n\n /**\n * Get the longest command term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestSubcommandTermLength(cmd, helper) {\n return helper.visibleCommands(cmd).reduce((max, command) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleSubcommandTerm(helper.subcommandTerm(command)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the longest option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestOptionTermLength(cmd, helper) {\n return helper.visibleOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest global option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestGlobalOptionTermLength(cmd, helper) {\n return helper.visibleGlobalOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest argument term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestArgumentTermLength(cmd, helper) {\n return helper.visibleArguments(cmd).reduce((max, argument) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the command usage to be displayed at the top of the built-in help.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandUsage(cmd) {\n // Usage\n let cmdName = cmd._name;\n if (cmd._aliases[0]) {\n cmdName = cmdName + '|' + cmd._aliases[0];\n }\n let ancestorCmdNames = '';\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;\n }\n return ancestorCmdNames + cmdName + ' ' + cmd.usage();\n }\n\n /**\n * Get the description for the command.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the subcommand summary to show in the list of subcommands.\n * (Fallback to description for backwards compatibility.)\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.summary() || cmd.description();\n }\n\n /**\n * Get the option description to show in the list of options.\n *\n * @param {Option} option\n * @return {string}\n */\n\n optionDescription(option) {\n const extraInfo = [];\n\n if (option.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (option.defaultValue !== undefined) {\n // default for boolean and negated more for programmer than end user,\n // but show true/false for boolean option as may be for hand-rolled env or config processing.\n const showDefault =\n option.required ||\n option.optional ||\n (option.isBoolean() && typeof option.defaultValue === 'boolean');\n if (showDefault) {\n extraInfo.push(\n `default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`,\n );\n }\n }\n // preset for boolean and negated are more for programmer than end user\n if (option.presetArg !== undefined && option.optional) {\n extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);\n }\n if (option.envVar !== undefined) {\n extraInfo.push(`env: ${option.envVar}`);\n }\n if (extraInfo.length > 0) {\n return `${option.description} (${extraInfo.join(', ')})`;\n }\n\n return option.description;\n }\n\n /**\n * Get the argument description to show in the list of arguments.\n *\n * @param {Argument} argument\n * @return {string}\n */\n\n argumentDescription(argument) {\n const extraInfo = [];\n if (argument.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (argument.defaultValue !== undefined) {\n extraInfo.push(\n `default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`,\n );\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (argument.description) {\n return `${argument.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n return argument.description;\n }\n\n /**\n * Generate the built-in help text.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {string}\n */\n\n formatHelp(cmd, helper) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth ?? 80; // in case prepareContext() was not called\n\n function callFormatItem(term, description) {\n return helper.formatItem(term, termWidth, description, helper);\n }\n\n // Usage\n let output = [\n `${helper.styleTitle('Usage:')} ${helper.styleUsage(helper.commandUsage(cmd))}`,\n '',\n ];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([\n helper.boxWrap(\n helper.styleCommandDescription(commandDescription),\n helpWidth,\n ),\n '',\n ]);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument) => {\n return callFormatItem(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n helper.styleArgumentDescription(helper.argumentDescription(argument)),\n );\n });\n if (argumentList.length > 0) {\n output = output.concat([\n helper.styleTitle('Arguments:'),\n ...argumentList,\n '',\n ]);\n }\n\n // Options\n const optionList = helper.visibleOptions(cmd).map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n if (optionList.length > 0) {\n output = output.concat([\n helper.styleTitle('Options:'),\n ...optionList,\n '',\n ]);\n }\n\n if (helper.showGlobalOptions) {\n const globalOptionList = helper\n .visibleGlobalOptions(cmd)\n .map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n if (globalOptionList.length > 0) {\n output = output.concat([\n helper.styleTitle('Global Options:'),\n ...globalOptionList,\n '',\n ]);\n }\n }\n\n // Commands\n const commandList = helper.visibleCommands(cmd).map((cmd) => {\n return callFormatItem(\n helper.styleSubcommandTerm(helper.subcommandTerm(cmd)),\n helper.styleSubcommandDescription(helper.subcommandDescription(cmd)),\n );\n });\n if (commandList.length > 0) {\n output = output.concat([\n helper.styleTitle('Commands:'),\n ...commandList,\n '',\n ]);\n }\n\n return output.join('\\n');\n }\n\n /**\n * Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations.\n *\n * @param {string} str\n * @returns {number}\n */\n displayWidth(str) {\n return stripColor(str).length;\n }\n\n /**\n * Style the title for displaying in the help. Called with 'Usage:', 'Options:', etc.\n *\n * @param {string} str\n * @returns {string}\n */\n styleTitle(str) {\n return str;\n }\n\n styleUsage(str) {\n // Usage has lots of parts the user might like to color separately! Assume default usage string which is formed like:\n // command subcommand [options] [command] <foo> [bar]\n return str\n .split(' ')\n .map((word) => {\n if (word === '[options]') return this.styleOptionText(word);\n if (word === '[command]') return this.styleSubcommandText(word);\n if (word[0] === '[' || word[0] === '<')\n return this.styleArgumentText(word);\n return this.styleCommandText(word); // Restrict to initial words?\n })\n .join(' ');\n }\n styleCommandDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleOptionDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleSubcommandDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleArgumentDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleDescriptionText(str) {\n return str;\n }\n styleOptionTerm(str) {\n return this.styleOptionText(str);\n }\n styleSubcommandTerm(str) {\n // This is very like usage with lots of parts! Assume default string which is formed like:\n // subcommand [options] <foo> [bar]\n return str\n .split(' ')\n .map((word) => {\n if (word === '[options]') return this.styleOptionText(word);\n if (word[0] === '[' || word[0] === '<')\n return this.styleArgumentText(word);\n return this.styleSubcommandText(word); // Restrict to initial words?\n })\n .join(' ');\n }\n styleArgumentTerm(str) {\n return this.styleArgumentText(str);\n }\n styleOptionText(str) {\n return str;\n }\n styleArgumentText(str) {\n return str;\n }\n styleSubcommandText(str) {\n return str;\n }\n styleCommandText(str) {\n return str;\n }\n\n /**\n * Calculate the pad width from the maximum term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n padWidth(cmd, helper) {\n return Math.max(\n helper.longestOptionTermLength(cmd, helper),\n helper.longestGlobalOptionTermLength(cmd, helper),\n helper.longestSubcommandTermLength(cmd, helper),\n helper.longestArgumentTermLength(cmd, helper),\n );\n }\n\n /**\n * Detect manually wrapped and indented strings by checking for line break followed by whitespace.\n *\n * @param {string} str\n * @returns {boolean}\n */\n preformatted(str) {\n return /\\n[^\\S\\r\\n]/.test(str);\n }\n\n /**\n * Format the \"item\", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.\n *\n * So \"TTT\", 5, \"DDD DDDD DD DDD\" might be formatted for this.helpWidth=17 like so:\n * TTT DDD DDDD\n * DD DDD\n *\n * @param {string} term\n * @param {number} termWidth\n * @param {string} description\n * @param {Help} helper\n * @returns {string}\n */\n formatItem(term, termWidth, description, helper) {\n const itemIndent = 2;\n const itemIndentStr = ' '.repeat(itemIndent);\n if (!description) return itemIndentStr + term;\n\n // Pad the term out to a consistent width, so descriptions are aligned.\n const paddedTerm = term.padEnd(\n termWidth + term.length - helper.displayWidth(term),\n );\n\n // Format the description.\n const spacerWidth = 2; // between term and description\n const helpWidth = this.helpWidth ?? 80; // in case prepareContext() was not called\n const remainingWidth = helpWidth - termWidth - spacerWidth - itemIndent;\n let formattedDescription;\n if (\n remainingWidth < this.minWidthToWrap ||\n helper.preformatted(description)\n ) {\n formattedDescription = description;\n } else {\n const wrappedDescription = helper.boxWrap(description, remainingWidth);\n formattedDescription = wrappedDescription.replace(\n /\\n/g,\n '\\n' + ' '.repeat(termWidth + spacerWidth),\n );\n }\n\n // Construct and overall indent.\n return (\n itemIndentStr +\n paddedTerm +\n ' '.repeat(spacerWidth) +\n formattedDescription.replace(/\\n/g, `\\n${itemIndentStr}`)\n );\n }\n\n /**\n * Wrap a string at whitespace, preserving existing line breaks.\n * Wrapping is skipped if the width is less than `minWidthToWrap`.\n *\n * @param {string} str\n * @param {number} width\n * @returns {string}\n */\n boxWrap(str, width) {\n if (width < this.minWidthToWrap) return str;\n\n const rawLines = str.split(/\\r\\n|\\n/);\n // split up text by whitespace\n const chunkPattern = /[\\s]*[^\\s]+/g;\n const wrappedLines = [];\n rawLines.forEach((line) => {\n const chunks = line.match(chunkPattern);\n if (chunks === null) {\n wrappedLines.push('');\n return;\n }\n\n let sumChunks = [chunks.shift()];\n let sumWidth = this.displayWidth(sumChunks[0]);\n chunks.forEach((chunk) => {\n const visibleWidth = this.displayWidth(chunk);\n // Accumulate chunks while they fit into width.\n if (sumWidth + visibleWidth <= width) {\n sumChunks.push(chunk);\n sumWidth += visibleWidth;\n return;\n }\n wrappedLines.push(sumChunks.join(''));\n\n const nextChunk = chunk.trimStart(); // trim space at line break\n sumChunks = [nextChunk];\n sumWidth = this.displayWidth(nextChunk);\n });\n wrappedLines.push(sumChunks.join(''));\n });\n\n return wrappedLines.join('\\n');\n }\n}\n\n/**\n * Strip style ANSI escape sequences from the string. In particular, SGR (Select Graphic Rendition) codes.\n *\n * @param {string} str\n * @returns {string}\n * @package\n */\n\nfunction stripColor(str) {\n // eslint-disable-next-line no-control-regex\n const sgrPattern = /\\x1b\\[\\d*(;\\d*)*m/g;\n return str.replace(sgrPattern, '');\n}\n\nexports.Help = Help;\nexports.stripColor = stripColor;\n","const { InvalidArgumentError } = require('./error.js');\n\nclass Option {\n /**\n * Initialize a new `Option` with the given `flags` and `description`.\n *\n * @param {string} flags\n * @param {string} [description]\n */\n\n constructor(flags, description) {\n this.flags = flags;\n this.description = description || '';\n\n this.required = flags.includes('<'); // A value must be supplied when the option is specified.\n this.optional = flags.includes('['); // A value is optional when the option is specified.\n // variadic test ignores <value,...> et al which might be used to describe custom splitting of single argument\n this.variadic = /\\w\\.\\.\\.[>\\]]$/.test(flags); // The option can take multiple values.\n this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.\n const optionFlags = splitOptionFlags(flags);\n this.short = optionFlags.shortFlag; // May be a short flag, undefined, or even a long flag (if option has two long flags).\n this.long = optionFlags.longFlag;\n this.negate = false;\n if (this.long) {\n this.negate = this.long.startsWith('--no-');\n }\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.presetArg = undefined;\n this.envVar = undefined;\n this.parseArg = undefined;\n this.hidden = false;\n this.argChoices = undefined;\n this.conflictsWith = [];\n this.implied = undefined;\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Option}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Preset to use when option used without option-argument, especially optional but also boolean and negated.\n * The custom processing (parseArg) is called.\n *\n * @example\n * new Option('--color').default('GREYSCALE').preset('RGB');\n * new Option('--donate [amount]').preset('20').argParser(parseFloat);\n *\n * @param {*} arg\n * @return {Option}\n */\n\n preset(arg) {\n this.presetArg = arg;\n return this;\n }\n\n /**\n * Add option name(s) that conflict with this option.\n * An error will be displayed if conflicting options are found during parsing.\n *\n * @example\n * new Option('--rgb').conflicts('cmyk');\n * new Option('--js').conflicts(['ts', 'jsx']);\n *\n * @param {(string | string[])} names\n * @return {Option}\n */\n\n conflicts(names) {\n this.conflictsWith = this.conflictsWith.concat(names);\n return this;\n }\n\n /**\n * Specify implied option values for when this option is set and the implied options are not.\n *\n * The custom processing (parseArg) is not called on the implied values.\n *\n * @example\n * program\n * .addOption(new Option('--log', 'write logging information to file'))\n * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));\n *\n * @param {object} impliedOptionValues\n * @return {Option}\n */\n implies(impliedOptionValues) {\n let newImplied = impliedOptionValues;\n if