appmap 0.60.0 → 0.62.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -16
- data/ARCHITECTURE.md +68 -0
- data/CHANGELOG.md +33 -0
- data/exe/appmap-index +7 -0
- data/lib/appmap.rb +2 -0
- data/lib/appmap/agent.rb +0 -11
- data/lib/appmap/command/agent_setup/status.rb +1 -1
- data/lib/appmap/command/index.rb +25 -0
- data/lib/appmap/command/inspect.rb +0 -1
- data/lib/appmap/config.rb +8 -1
- data/lib/appmap/depends.rb +2 -0
- data/lib/appmap/depends/api.rb +84 -0
- data/lib/appmap/depends/configuration.rb +59 -0
- data/lib/appmap/depends/node_cli.rb +44 -0
- data/lib/appmap/depends/rake_tasks.rb +58 -0
- data/lib/appmap/depends/test_file_inspector.rb +89 -0
- data/lib/appmap/depends/test_runner.rb +106 -0
- data/lib/appmap/depends/util.rb +34 -0
- data/lib/appmap/service/integration_test_path_finder.rb +29 -25
- data/lib/appmap/service/test_command_provider.rb +5 -7
- data/lib/appmap/service/validator/config_validator.rb +9 -0
- data/lib/appmap/version.rb +1 -1
- data/node_modules/@appland/cli/CHANGELOG.md +96 -0
- data/node_modules/@appland/cli/package.json +49 -0
- data/node_modules/@appland/cli/src/appMapCatalog.js +39 -0
- data/node_modules/@appland/cli/src/appland/getAppMap.js +55 -0
- data/node_modules/@appland/cli/src/appland/listAppMaps.js +58 -0
- data/node_modules/@appland/cli/src/appland/settings.js +62 -0
- data/node_modules/@appland/cli/src/appland/types.d.ts +16 -0
- data/node_modules/@appland/cli/src/cli.js +576 -0
- data/node_modules/@appland/cli/src/database.js +197 -0
- data/node_modules/@appland/cli/src/depends.js +157 -0
- data/node_modules/@appland/cli/src/fingerprint/algorithms.js +71 -0
- data/node_modules/@appland/cli/src/fingerprint/canonicalize.js +70 -0
- data/node_modules/@appland/cli/src/fingerprint/canonicalize/base.js +58 -0
- data/node_modules/@appland/cli/src/fingerprint/canonicalize/classDependencies.js +36 -0
- data/node_modules/@appland/cli/src/fingerprint/canonicalize/classes.js +14 -0
- data/node_modules/@appland/cli/src/fingerprint/canonicalize/eventTree.js +19 -0
- data/node_modules/@appland/cli/src/fingerprint/canonicalize/httpClientRequests.js +18 -0
- data/node_modules/@appland/cli/src/fingerprint/canonicalize/httpServerRequests.js +18 -0
- data/node_modules/@appland/cli/src/fingerprint/canonicalize/info.js +55 -0
- data/node_modules/@appland/cli/src/fingerprint/canonicalize/labels.js +10 -0
- data/node_modules/@appland/cli/src/fingerprint/canonicalize/packageDependencies.js +36 -0
- data/node_modules/@appland/cli/src/fingerprint/canonicalize/packages.js +14 -0
- data/node_modules/@appland/cli/src/fingerprint/canonicalize/sqlNormalized.js +19 -0
- data/node_modules/@appland/cli/src/fingerprint/canonicalize/sqlTables.js +24 -0
- data/node_modules/@appland/cli/src/fingerprint/canonicalize/trace.js +57 -0
- data/node_modules/@appland/cli/src/fingerprint/canonicalize/unique.js +8 -0
- data/node_modules/@appland/cli/src/fingerprint/canonicalize/update.js +85 -0
- data/node_modules/@appland/cli/src/fingerprint/fingerprintDirectoryCommand.js +30 -0
- data/node_modules/@appland/cli/src/fingerprint/fingerprintQueue.js +30 -0
- data/node_modules/@appland/cli/src/fingerprint/fingerprintWatchCommand.js +64 -0
- data/node_modules/@appland/cli/src/fingerprint/fingerprinter.js +186 -0
- data/node_modules/@appland/cli/src/fingerprint/index.js +24 -0
- data/node_modules/@appland/cli/src/functionStats.js +168 -0
- data/node_modules/@appland/cli/src/inspect.js +7 -0
- data/node_modules/@appland/cli/src/inspect/fields.js +66 -0
- data/node_modules/@appland/cli/src/inspect/filter.js +105 -0
- data/node_modules/@appland/cli/src/inspect/home.js +64 -0
- data/node_modules/@appland/cli/src/inspect/print.js +231 -0
- data/node_modules/@appland/cli/src/inspect/reset.js +10 -0
- data/node_modules/@appland/cli/src/inspect/types.d.ts +11 -0
- data/node_modules/@appland/cli/src/inspect/undoFilter.js +10 -0
- data/node_modules/@appland/cli/src/inventoryCommand.js +59 -0
- data/node_modules/@appland/cli/src/search/codeObjectMatcher.js +75 -0
- data/node_modules/@appland/cli/src/search/constants.js +5 -0
- data/node_modules/@appland/cli/src/search/findCodeObjects.js +293 -0
- data/node_modules/@appland/cli/src/search/findEvents.js +184 -0
- data/node_modules/@appland/cli/src/search/matchFilter.js +65 -0
- data/node_modules/@appland/cli/src/search/matchSpec.js +198 -0
- data/node_modules/@appland/cli/src/search/trigram.js +107 -0
- data/node_modules/@appland/cli/src/search/types.d.ts +107 -0
- data/node_modules/@appland/cli/src/search/utils.js +4 -0
- data/node_modules/@appland/cli/src/swagger/README.md +75 -0
- data/node_modules/@appland/cli/src/swagger/command.js +42 -0
- data/node_modules/@appland/cli/src/swagger/method.js +173 -0
- data/node_modules/@appland/cli/src/swagger/model.js +54 -0
- data/node_modules/@appland/cli/src/swagger/path.js +38 -0
- data/node_modules/@appland/cli/src/swagger/response.js +34 -0
- data/node_modules/@appland/cli/src/swagger/schema.js +38 -0
- data/node_modules/@appland/cli/src/swagger/securitySchemes.js +60 -0
- data/node_modules/@appland/cli/src/swagger/settings.js +9 -0
- data/node_modules/@appland/cli/src/swagger/util.js +79 -0
- data/node_modules/@appland/cli/src/utils.js +164 -0
- data/node_modules/@appland/cli/tests/unit/depends.spec.js +55 -0
- data/node_modules/@appland/cli/tests/unit/fingerprint/canonicalize.spec.js +42 -0
- data/node_modules/@appland/cli/tests/unit/fingerprint/sql.spec.js +40 -0
- data/node_modules/@appland/cli/tests/unit/fixtures/app/controllers/organizations_controller.rb +1 -0
- data/node_modules/@appland/cli/tests/unit/fixtures/app/models/configuration.rb +1 -0
- data/node_modules/@appland/cli/tests/unit/fixtures/app/models/show.rb +1 -0
- data/node_modules/@appland/cli/tests/unit/fixtures/app/models/user.rb +1 -0
- data/node_modules/@appland/cli/tests/unit/fixtures/canonicalize/revoke_api_key.info.json +246 -0
- data/node_modules/@appland/cli/tests/unit/fixtures/canonicalize/revoke_api_key.trace.json +289 -0
- data/node_modules/@appland/cli/tests/unit/fixtures/canonicalize/revoke_api_key.update.json +78 -0
- data/node_modules/@appland/cli/tests/unit/fixtures/revoke_api_key.appmap.json +899 -0
- data/node_modules/@appland/cli/tests/unit/fixtures/user_page_scenario.appmap.json +1774 -0
- data/node_modules/@appland/cli/tests/unit/inspect.spec.js +94 -0
- data/node_modules/@appland/models/CHANGELOG.md +83 -0
- data/node_modules/@appland/models/README.md +8 -0
- data/node_modules/@appland/models/dist/index.cjs +4250 -0
- data/node_modules/@appland/models/dist/index.js +4193 -0
- data/node_modules/@appland/models/package.json +50 -0
- data/node_modules/@rollup/plugin-alias/CHANGELOG.md +92 -0
- data/node_modules/@rollup/plugin-alias/LICENSE +21 -0
- data/node_modules/@rollup/plugin-alias/README.md +174 -0
- data/node_modules/@rollup/plugin-alias/dist/index.es.js +95 -0
- data/node_modules/@rollup/plugin-alias/dist/index.js +101 -0
- data/node_modules/@rollup/plugin-alias/package.json +78 -0
- data/node_modules/@rollup/plugin-alias/types/index.d.ts +36 -0
- data/node_modules/ansi-regex/index.d.ts +37 -0
- data/node_modules/ansi-regex/index.js +10 -0
- data/node_modules/ansi-regex/license +9 -0
- data/node_modules/ansi-regex/package.json +55 -0
- data/node_modules/ansi-regex/readme.md +78 -0
- data/node_modules/ansi-styles/index.d.ts +345 -0
- data/node_modules/ansi-styles/index.js +163 -0
- data/node_modules/ansi-styles/license +9 -0
- data/node_modules/ansi-styles/package.json +56 -0
- data/node_modules/ansi-styles/readme.md +152 -0
- data/node_modules/anymatch/LICENSE +15 -0
- data/node_modules/anymatch/README.md +87 -0
- data/node_modules/anymatch/index.d.ts +19 -0
- data/node_modules/anymatch/index.js +104 -0
- data/node_modules/anymatch/package.json +48 -0
- data/node_modules/argparse/CHANGELOG.md +185 -0
- data/node_modules/argparse/LICENSE +21 -0
- data/node_modules/argparse/README.md +257 -0
- data/node_modules/argparse/index.js +3 -0
- data/node_modules/argparse/lib/action.js +146 -0
- data/node_modules/argparse/lib/action/append.js +53 -0
- data/node_modules/argparse/lib/action/append/constant.js +47 -0
- data/node_modules/argparse/lib/action/count.js +40 -0
- data/node_modules/argparse/lib/action/help.js +47 -0
- data/node_modules/argparse/lib/action/store.js +50 -0
- data/node_modules/argparse/lib/action/store/constant.js +43 -0
- data/node_modules/argparse/lib/action/store/false.js +27 -0
- data/node_modules/argparse/lib/action/store/true.js +26 -0
- data/node_modules/argparse/lib/action/subparsers.js +149 -0
- data/node_modules/argparse/lib/action/version.js +47 -0
- data/node_modules/argparse/lib/action_container.js +482 -0
- data/node_modules/argparse/lib/argparse.js +14 -0
- data/node_modules/argparse/lib/argument/error.js +50 -0
- data/node_modules/argparse/lib/argument/exclusive.js +54 -0
- data/node_modules/argparse/lib/argument/group.js +75 -0
- data/node_modules/argparse/lib/argument_parser.js +1161 -0
- data/node_modules/argparse/lib/const.js +21 -0
- data/node_modules/argparse/lib/help/added_formatters.js +87 -0
- data/node_modules/argparse/lib/help/formatter.js +795 -0
- data/node_modules/argparse/lib/namespace.js +76 -0
- data/node_modules/argparse/lib/utils.js +57 -0
- data/node_modules/argparse/package.json +34 -0
- data/node_modules/async/CHANGELOG.md +331 -0
- data/node_modules/async/LICENSE +19 -0
- data/node_modules/async/README.md +60 -0
- data/node_modules/async/all.js +54 -0
- data/node_modules/async/allLimit.js +46 -0
- data/node_modules/async/allSeries.js +45 -0
- data/node_modules/async/any.js +56 -0
- data/node_modules/async/anyLimit.js +47 -0
- data/node_modules/async/anySeries.js +46 -0
- data/node_modules/async/apply.js +55 -0
- data/node_modules/async/applyEach.js +57 -0
- data/node_modules/async/applyEachSeries.js +37 -0
- data/node_modules/async/asyncify.js +118 -0
- data/node_modules/async/auto.js +267 -0
- data/node_modules/async/autoInject.js +156 -0
- data/node_modules/async/bower.json +17 -0
- data/node_modules/async/cargo.js +63 -0
- data/node_modules/async/cargoQueue.js +71 -0
- data/node_modules/async/compose.js +55 -0
- data/node_modules/async/concat.js +47 -0
- data/node_modules/async/concatLimit.js +60 -0
- data/node_modules/async/concatSeries.js +41 -0
- data/node_modules/async/constant.js +55 -0
- data/node_modules/async/detect.js +61 -0
- data/node_modules/async/detectLimit.js +48 -0
- data/node_modules/async/detectSeries.js +47 -0
- data/node_modules/async/dir.js +43 -0
- data/node_modules/async/dist/async.js +4846 -0
- data/node_modules/async/dist/async.min.js +1 -0
- data/node_modules/async/dist/async.mjs +4734 -0
- data/node_modules/async/doDuring.js +68 -0
- data/node_modules/async/doUntil.js +46 -0
- data/node_modules/async/doWhilst.js +68 -0
- data/node_modules/async/during.js +78 -0
- data/node_modules/async/each.js +88 -0
- data/node_modules/async/eachLimit.js +50 -0
- data/node_modules/async/eachOf.js +116 -0
- data/node_modules/async/eachOfLimit.js +47 -0
- data/node_modules/async/eachOfSeries.js +39 -0
- data/node_modules/async/eachSeries.js +44 -0
- data/node_modules/async/ensureAsync.js +67 -0
- data/node_modules/async/every.js +54 -0
- data/node_modules/async/everyLimit.js +46 -0
- data/node_modules/async/everySeries.js +45 -0
- data/node_modules/async/filter.js +53 -0
- data/node_modules/async/filterLimit.js +45 -0
- data/node_modules/async/filterSeries.js +43 -0
- data/node_modules/async/find.js +61 -0
- data/node_modules/async/findLimit.js +48 -0
- data/node_modules/async/findSeries.js +47 -0
- data/node_modules/async/flatMap.js +47 -0
- data/node_modules/async/flatMapLimit.js +60 -0
- data/node_modules/async/flatMapSeries.js +41 -0
- data/node_modules/async/foldl.js +77 -0
- data/node_modules/async/foldr.js +41 -0
- data/node_modules/async/forEach.js +88 -0
- data/node_modules/async/forEachLimit.js +50 -0
- data/node_modules/async/forEachOf.js +116 -0
- data/node_modules/async/forEachOfLimit.js +47 -0
- data/node_modules/async/forEachOfSeries.js +39 -0
- data/node_modules/async/forEachSeries.js +44 -0
- data/node_modules/async/forever.js +68 -0
- data/node_modules/async/groupBy.js +54 -0
- data/node_modules/async/groupByLimit.js +71 -0
- data/node_modules/async/groupBySeries.js +36 -0
- data/node_modules/async/index.js +588 -0
- data/node_modules/async/inject.js +77 -0
- data/node_modules/async/internal/DoublyLinkedList.js +92 -0
- data/node_modules/async/internal/Heap.js +120 -0
- data/node_modules/async/internal/applyEach.js +29 -0
- data/node_modules/async/internal/asyncEachOfLimit.js +75 -0
- data/node_modules/async/internal/awaitify.js +27 -0
- data/node_modules/async/internal/breakLoop.js +10 -0
- data/node_modules/async/internal/consoleFunc.js +27 -0
- data/node_modules/async/internal/createTester.js +40 -0
- data/node_modules/async/internal/eachOfLimit.js +90 -0
- data/node_modules/async/internal/filter.js +55 -0
- data/node_modules/async/internal/getIterator.js +11 -0
- data/node_modules/async/internal/initialParams.js +14 -0
- data/node_modules/async/internal/isArrayLike.js +10 -0
- data/node_modules/async/internal/iterator.js +54 -0
- data/node_modules/async/internal/map.js +30 -0
- data/node_modules/async/internal/once.js +17 -0
- data/node_modules/async/internal/onlyOnce.js +15 -0
- data/node_modules/async/internal/parallel.js +34 -0
- data/node_modules/async/internal/promiseCallback.js +23 -0
- data/node_modules/async/internal/queue.js +291 -0
- data/node_modules/async/internal/range.js +14 -0
- data/node_modules/async/internal/reject.js +26 -0
- data/node_modules/async/internal/setImmediate.js +30 -0
- data/node_modules/async/internal/withoutIndex.js +10 -0
- data/node_modules/async/internal/wrapAsync.js +34 -0
- data/node_modules/async/log.js +41 -0
- data/node_modules/async/map.js +62 -0
- data/node_modules/async/mapLimit.js +45 -0
- data/node_modules/async/mapSeries.js +44 -0
- data/node_modules/async/mapValues.js +62 -0
- data/node_modules/async/mapValuesLimit.js +61 -0
- data/node_modules/async/mapValuesSeries.js +37 -0
- data/node_modules/async/memoize.js +91 -0
- data/node_modules/async/nextTick.js +52 -0
- data/node_modules/async/package.json +82 -0
- data/node_modules/async/parallel.js +91 -0
- data/node_modules/async/parallelLimit.js +41 -0
- data/node_modules/async/priorityQueue.js +84 -0
- data/node_modules/async/queue.js +167 -0
- data/node_modules/async/race.js +67 -0
- data/node_modules/async/reduce.js +77 -0
- data/node_modules/async/reduceRight.js +41 -0
- data/node_modules/async/reflect.js +78 -0
- data/node_modules/async/reflectAll.js +93 -0
- data/node_modules/async/reject.js +53 -0
- data/node_modules/async/rejectLimit.js +45 -0
- data/node_modules/async/rejectSeries.js +43 -0
- data/node_modules/async/retry.js +159 -0
- data/node_modules/async/retryable.js +77 -0
- data/node_modules/async/select.js +53 -0
- data/node_modules/async/selectLimit.js +45 -0
- data/node_modules/async/selectSeries.js +43 -0
- data/node_modules/async/seq.js +79 -0
- data/node_modules/async/series.js +86 -0
- data/node_modules/async/setImmediate.js +45 -0
- data/node_modules/async/some.js +56 -0
- data/node_modules/async/someLimit.js +47 -0
- data/node_modules/async/someSeries.js +46 -0
- data/node_modules/async/sortBy.js +88 -0
- data/node_modules/async/timeout.js +89 -0
- data/node_modules/async/times.js +50 -0
- data/node_modules/async/timesLimit.js +43 -0
- data/node_modules/async/timesSeries.js +32 -0
- data/node_modules/async/transform.js +81 -0
- data/node_modules/async/tryEach.js +78 -0
- data/node_modules/async/unmemoize.js +25 -0
- data/node_modules/async/until.js +61 -0
- data/node_modules/async/waterfall.js +105 -0
- data/node_modules/async/whilst.js +78 -0
- data/node_modules/async/wrapSync.js +118 -0
- data/node_modules/at-least-node/LICENSE +6 -0
- data/node_modules/at-least-node/README.md +25 -0
- data/node_modules/at-least-node/index.js +5 -0
- data/node_modules/at-least-node/package.json +32 -0
- data/node_modules/balanced-match/LICENSE.md +21 -0
- data/node_modules/balanced-match/README.md +97 -0
- data/node_modules/balanced-match/index.js +62 -0
- data/node_modules/balanced-match/package.json +48 -0
- data/node_modules/binary-extensions/binary-extensions.json +260 -0
- data/node_modules/binary-extensions/binary-extensions.json.d.ts +3 -0
- data/node_modules/binary-extensions/index.d.ts +14 -0
- data/node_modules/binary-extensions/index.js +1 -0
- data/node_modules/binary-extensions/license +9 -0
- data/node_modules/binary-extensions/package.json +38 -0
- data/node_modules/binary-extensions/readme.md +41 -0
- data/node_modules/brace-expansion/LICENSE +21 -0
- data/node_modules/brace-expansion/README.md +129 -0
- data/node_modules/brace-expansion/index.js +201 -0
- data/node_modules/brace-expansion/package.json +47 -0
- data/node_modules/braces/CHANGELOG.md +184 -0
- data/node_modules/braces/LICENSE +21 -0
- data/node_modules/braces/README.md +593 -0
- data/node_modules/braces/index.js +170 -0
- data/node_modules/braces/lib/compile.js +57 -0
- data/node_modules/braces/lib/constants.js +57 -0
- data/node_modules/braces/lib/expand.js +113 -0
- data/node_modules/braces/lib/parse.js +333 -0
- data/node_modules/braces/lib/stringify.js +32 -0
- data/node_modules/braces/lib/utils.js +112 -0
- data/node_modules/braces/package.json +77 -0
- data/node_modules/chokidar/LICENSE +21 -0
- data/node_modules/chokidar/README.md +308 -0
- data/node_modules/chokidar/index.js +973 -0
- data/node_modules/chokidar/lib/constants.js +65 -0
- data/node_modules/chokidar/lib/fsevents-handler.js +524 -0
- data/node_modules/chokidar/lib/nodefs-handler.js +646 -0
- data/node_modules/chokidar/package.json +78 -0
- data/node_modules/chokidar/types/index.d.ts +187 -0
- data/node_modules/cli-progress/CHANGES.md +169 -0
- data/node_modules/cli-progress/LICENSE.md +24 -0
- data/node_modules/cli-progress/README.md +446 -0
- data/node_modules/cli-progress/cli-progress.js +21 -0
- data/node_modules/cli-progress/lib/eta.js +73 -0
- data/node_modules/cli-progress/lib/format-bar.js +11 -0
- data/node_modules/cli-progress/lib/format-time.js +34 -0
- data/node_modules/cli-progress/lib/format-value.js +22 -0
- data/node_modules/cli-progress/lib/formatter.js +80 -0
- data/node_modules/cli-progress/lib/generic-bar.js +212 -0
- data/node_modules/cli-progress/lib/multi-bar.js +201 -0
- data/node_modules/cli-progress/lib/options.js +95 -0
- data/node_modules/cli-progress/lib/single-bar.js +124 -0
- data/node_modules/cli-progress/lib/terminal.js +159 -0
- data/node_modules/cli-progress/package.json +46 -0
- data/node_modules/cli-progress/presets/index.js +11 -0
- data/node_modules/cli-progress/presets/legacy.js +6 -0
- data/node_modules/cli-progress/presets/rect.js +5 -0
- data/node_modules/cli-progress/presets/shades-classic.js +6 -0
- data/node_modules/cli-progress/presets/shades-grey.js +8 -0
- data/node_modules/cliui/CHANGELOG.md +121 -0
- data/node_modules/cliui/LICENSE.txt +14 -0
- data/node_modules/cliui/README.md +141 -0
- data/node_modules/cliui/build/index.cjs +302 -0
- data/node_modules/cliui/build/lib/index.js +287 -0
- data/node_modules/cliui/build/lib/string-utils.js +27 -0
- data/node_modules/cliui/index.mjs +13 -0
- data/node_modules/cliui/package.json +83 -0
- data/node_modules/color-convert/CHANGELOG.md +54 -0
- data/node_modules/color-convert/LICENSE +21 -0
- data/node_modules/color-convert/README.md +68 -0
- data/node_modules/color-convert/conversions.js +839 -0
- data/node_modules/color-convert/index.js +81 -0
- data/node_modules/color-convert/package.json +48 -0
- data/node_modules/color-convert/route.js +97 -0
- data/node_modules/color-name/LICENSE +8 -0
- data/node_modules/color-name/README.md +11 -0
- data/node_modules/color-name/index.js +152 -0
- data/node_modules/color-name/package.json +28 -0
- data/node_modules/colors/LICENSE +25 -0
- data/node_modules/colors/README.md +221 -0
- data/node_modules/colors/examples/normal-usage.js +82 -0
- data/node_modules/colors/examples/safe-string.js +79 -0
- data/node_modules/colors/index.d.ts +136 -0
- data/node_modules/colors/lib/colors.js +211 -0
- data/node_modules/colors/lib/custom/trap.js +46 -0
- data/node_modules/colors/lib/custom/zalgo.js +110 -0
- data/node_modules/colors/lib/extendStringPrototype.js +110 -0
- data/node_modules/colors/lib/index.js +13 -0
- data/node_modules/colors/lib/maps/america.js +10 -0
- data/node_modules/colors/lib/maps/rainbow.js +12 -0
- data/node_modules/colors/lib/maps/random.js +11 -0
- data/node_modules/colors/lib/maps/zebra.js +5 -0
- data/node_modules/colors/lib/styles.js +95 -0
- data/node_modules/colors/lib/system/has-flag.js +35 -0
- data/node_modules/colors/lib/system/supports-colors.js +151 -0
- data/node_modules/colors/package.json +45 -0
- data/node_modules/colors/safe.d.ts +48 -0
- data/node_modules/colors/safe.js +10 -0
- data/node_modules/colors/themes/generic-logging.js +12 -0
- data/node_modules/concat-map/LICENSE +18 -0
- data/node_modules/concat-map/README.markdown +62 -0
- data/node_modules/concat-map/example/map.js +6 -0
- data/node_modules/concat-map/index.js +13 -0
- data/node_modules/concat-map/package.json +43 -0
- data/node_modules/concat-map/test/map.js +39 -0
- data/node_modules/console-table-printer/CHANGELOG.md +96 -0
- data/node_modules/console-table-printer/LICENSE +21 -0
- data/node_modules/console-table-printer/README.md +180 -0
- data/node_modules/console-table-printer/dist/index.d.ts +4 -0
- data/node_modules/console-table-printer/dist/index.js +10 -0
- data/node_modules/console-table-printer/dist/src/console-table-printer.d.ts +14 -0
- data/node_modules/console-table-printer/dist/src/console-table-printer.js +32 -0
- data/node_modules/console-table-printer/dist/src/internalTable/input-converter.d.ts +6 -0
- data/node_modules/console-table-printer/dist/src/internalTable/input-converter.js +15 -0
- data/node_modules/console-table-printer/dist/src/internalTable/internal-table-printer.d.ts +4 -0
- data/node_modules/console-table-printer/dist/src/internalTable/internal-table-printer.js +115 -0
- data/node_modules/console-table-printer/dist/src/internalTable/internal-table.d.ts +25 -0
- data/node_modules/console-table-printer/dist/src/internalTable/internal-table.js +80 -0
- data/node_modules/console-table-printer/dist/src/internalTable/table-pre-processors.d.ts +3 -0
- data/node_modules/console-table-printer/dist/src/internalTable/table-pre-processors.js +43 -0
- data/node_modules/console-table-printer/dist/src/models/common.d.ts +10 -0
- data/node_modules/console-table-printer/dist/src/models/common.js +2 -0
- data/node_modules/console-table-printer/dist/src/models/external-table.d.ts +26 -0
- data/node_modules/console-table-printer/dist/src/models/external-table.js +2 -0
- data/node_modules/console-table-printer/dist/src/models/internal-table.d.ts +21 -0
- data/node_modules/console-table-printer/dist/src/models/internal-table.js +2 -0
- data/node_modules/console-table-printer/dist/src/utils/colored-console-line.d.ts +8 -0
- data/node_modules/console-table-printer/dist/src/utils/colored-console-line.js +29 -0
- data/node_modules/console-table-printer/dist/src/utils/console-utils.d.ts +2 -0
- data/node_modules/console-table-printer/dist/src/utils/console-utils.js +8 -0
- data/node_modules/console-table-printer/dist/src/utils/string-utils.d.ts +4 -0
- data/node_modules/console-table-printer/dist/src/utils/string-utils.js +54 -0
- data/node_modules/console-table-printer/dist/src/utils/table-constants.d.ts +10 -0
- data/node_modules/console-table-printer/dist/src/utils/table-constants.js +49 -0
- data/node_modules/console-table-printer/dist/src/utils/table-helpers.d.ts +26 -0
- data/node_modules/console-table-printer/dist/src/utils/table-helpers.js +91 -0
- data/node_modules/console-table-printer/package.json +51 -0
- data/node_modules/cross-env/CHANGELOG.md +5 -0
- data/node_modules/cross-env/LICENSE +20 -0
- data/node_modules/cross-env/README.md +291 -0
- data/node_modules/cross-env/package.json +54 -0
- data/node_modules/cross-env/src/bin/cross-env-shell.js +5 -0
- data/node_modules/cross-env/src/bin/cross-env.js +5 -0
- data/node_modules/cross-env/src/command.js +32 -0
- data/node_modules/cross-env/src/index.js +95 -0
- data/node_modules/cross-env/src/is-windows.js +2 -0
- data/node_modules/cross-env/src/variable.js +69 -0
- data/node_modules/cross-spawn/CHANGELOG.md +130 -0
- data/node_modules/cross-spawn/LICENSE +21 -0
- data/node_modules/cross-spawn/README.md +96 -0
- data/node_modules/cross-spawn/index.js +39 -0
- data/node_modules/cross-spawn/lib/enoent.js +59 -0
- data/node_modules/cross-spawn/lib/parse.js +91 -0
- data/node_modules/cross-spawn/lib/util/escape.js +45 -0
- data/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
- data/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
- data/node_modules/cross-spawn/package.json +73 -0
- data/node_modules/crypto-js/CONTRIBUTING.md +28 -0
- data/node_modules/crypto-js/LICENSE +24 -0
- data/node_modules/crypto-js/README.md +249 -0
- data/node_modules/crypto-js/aes.js +234 -0
- data/node_modules/crypto-js/bower.json +35 -0
- data/node_modules/crypto-js/cipher-core.js +890 -0
- data/node_modules/crypto-js/core.js +797 -0
- data/node_modules/crypto-js/crypto-js.js +6059 -0
- data/node_modules/crypto-js/docs/QuickStartGuide.wiki +470 -0
- data/node_modules/crypto-js/enc-base64.js +136 -0
- data/node_modules/crypto-js/enc-hex.js +18 -0
- data/node_modules/crypto-js/enc-latin1.js +18 -0
- data/node_modules/crypto-js/enc-utf16.js +149 -0
- data/node_modules/crypto-js/enc-utf8.js +18 -0
- data/node_modules/crypto-js/evpkdf.js +134 -0
- data/node_modules/crypto-js/format-hex.js +66 -0
- data/node_modules/crypto-js/format-openssl.js +18 -0
- data/node_modules/crypto-js/hmac-md5.js +18 -0
- data/node_modules/crypto-js/hmac-ripemd160.js +18 -0
- data/node_modules/crypto-js/hmac-sha1.js +18 -0
- data/node_modules/crypto-js/hmac-sha224.js +18 -0
- data/node_modules/crypto-js/hmac-sha256.js +18 -0
- data/node_modules/crypto-js/hmac-sha3.js +18 -0
- data/node_modules/crypto-js/hmac-sha384.js +18 -0
- data/node_modules/crypto-js/hmac-sha512.js +18 -0
- data/node_modules/crypto-js/hmac.js +143 -0
- data/node_modules/crypto-js/index.js +18 -0
- data/node_modules/crypto-js/lib-typedarrays.js +76 -0
- data/node_modules/crypto-js/md5.js +268 -0
- data/node_modules/crypto-js/mode-cfb.js +80 -0
- data/node_modules/crypto-js/mode-ctr-gladman.js +116 -0
- data/node_modules/crypto-js/mode-ctr.js +58 -0
- data/node_modules/crypto-js/mode-ecb.js +40 -0
- data/node_modules/crypto-js/mode-ofb.js +54 -0
- data/node_modules/crypto-js/package.json +38 -0
- data/node_modules/crypto-js/pad-ansix923.js +49 -0
- data/node_modules/crypto-js/pad-iso10126.js +44 -0
- data/node_modules/crypto-js/pad-iso97971.js +40 -0
- data/node_modules/crypto-js/pad-nopadding.js +30 -0
- data/node_modules/crypto-js/pad-pkcs7.js +18 -0
- data/node_modules/crypto-js/pad-zeropadding.js +47 -0
- data/node_modules/crypto-js/pbkdf2.js +145 -0
- data/node_modules/crypto-js/rabbit-legacy.js +190 -0
- data/node_modules/crypto-js/rabbit.js +192 -0
- data/node_modules/crypto-js/rc4.js +139 -0
- data/node_modules/crypto-js/ripemd160.js +267 -0
- data/node_modules/crypto-js/sha1.js +150 -0
- data/node_modules/crypto-js/sha224.js +80 -0
- data/node_modules/crypto-js/sha256.js +199 -0
- data/node_modules/crypto-js/sha3.js +326 -0
- data/node_modules/crypto-js/sha384.js +83 -0
- data/node_modules/crypto-js/sha512.js +326 -0
- data/node_modules/crypto-js/tripledes.js +779 -0
- data/node_modules/crypto-js/x64-core.js +304 -0
- data/node_modules/diff/CONTRIBUTING.md +39 -0
- data/node_modules/diff/LICENSE +31 -0
- data/node_modules/diff/README.md +208 -0
- data/node_modules/diff/dist/diff.js +1582 -0
- data/node_modules/diff/lib/convert/dmp.js +32 -0
- data/node_modules/diff/lib/convert/xml.js +42 -0
- data/node_modules/diff/lib/diff/array.js +45 -0
- data/node_modules/diff/lib/diff/base.js +304 -0
- data/node_modules/diff/lib/diff/character.js +37 -0
- data/node_modules/diff/lib/diff/css.js +41 -0
- data/node_modules/diff/lib/diff/json.js +163 -0
- data/node_modules/diff/lib/diff/line.js +89 -0
- data/node_modules/diff/lib/diff/sentence.js +41 -0
- data/node_modules/diff/lib/diff/word.js +108 -0
- data/node_modules/diff/lib/index.es6.js +1553 -0
- data/node_modules/diff/lib/index.js +216 -0
- data/node_modules/diff/lib/index.mjs +1553 -0
- data/node_modules/diff/lib/patch/apply.js +238 -0
- data/node_modules/diff/lib/patch/create.js +267 -0
- data/node_modules/diff/lib/patch/merge.js +613 -0
- data/node_modules/diff/lib/patch/parse.js +167 -0
- data/node_modules/diff/lib/util/array.js +32 -0
- data/node_modules/diff/lib/util/distance-iterator.js +57 -0
- data/node_modules/diff/lib/util/params.js +24 -0
- data/node_modules/diff/package.json +87 -0
- data/node_modules/diff/release-notes.md +303 -0
- data/node_modules/diff/runtime.js +3 -0
- data/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
- data/node_modules/emoji-regex/README.md +73 -0
- data/node_modules/emoji-regex/es2015/index.js +6 -0
- data/node_modules/emoji-regex/es2015/text.js +6 -0
- data/node_modules/emoji-regex/index.d.ts +23 -0
- data/node_modules/emoji-regex/index.js +6 -0
- data/node_modules/emoji-regex/package.json +50 -0
- data/node_modules/emoji-regex/text.js +6 -0
- data/node_modules/escalade/dist/index.js +22 -0
- data/node_modules/escalade/dist/index.mjs +22 -0
- data/node_modules/escalade/index.d.ts +3 -0
- data/node_modules/escalade/license +9 -0
- data/node_modules/escalade/package.json +61 -0
- data/node_modules/escalade/readme.md +211 -0
- data/node_modules/escalade/sync/index.d.ts +2 -0
- data/node_modules/escalade/sync/index.js +18 -0
- data/node_modules/escalade/sync/index.mjs +18 -0
- data/node_modules/esprima/ChangeLog +235 -0
- data/node_modules/esprima/LICENSE.BSD +21 -0
- data/node_modules/esprima/README.md +46 -0
- data/node_modules/esprima/bin/esparse.js +139 -0
- data/node_modules/esprima/bin/esvalidate.js +236 -0
- data/node_modules/esprima/dist/esprima.js +6709 -0
- data/node_modules/esprima/package.json +112 -0
- data/node_modules/fill-range/LICENSE +21 -0
- data/node_modules/fill-range/README.md +237 -0
- data/node_modules/fill-range/index.js +249 -0
- data/node_modules/fill-range/package.json +69 -0
- data/node_modules/fs-extra/CHANGELOG.md +902 -0
- data/node_modules/fs-extra/LICENSE +15 -0
- data/node_modules/fs-extra/README.md +264 -0
- data/node_modules/fs-extra/lib/copy-sync/copy-sync.js +166 -0
- data/node_modules/fs-extra/lib/copy-sync/index.js +5 -0
- data/node_modules/fs-extra/lib/copy/copy.js +232 -0
- data/node_modules/fs-extra/lib/copy/index.js +6 -0
- data/node_modules/fs-extra/lib/empty/index.js +48 -0
- data/node_modules/fs-extra/lib/ensure/file.js +69 -0
- data/node_modules/fs-extra/lib/ensure/index.js +23 -0
- data/node_modules/fs-extra/lib/ensure/link.js +61 -0
- data/node_modules/fs-extra/lib/ensure/symlink-paths.js +99 -0
- data/node_modules/fs-extra/lib/ensure/symlink-type.js +31 -0
- data/node_modules/fs-extra/lib/ensure/symlink.js +63 -0
- data/node_modules/fs-extra/lib/fs/index.js +130 -0
- data/node_modules/fs-extra/lib/index.js +27 -0
- data/node_modules/fs-extra/lib/json/index.js +16 -0
- data/node_modules/fs-extra/lib/json/jsonfile.js +11 -0
- data/node_modules/fs-extra/lib/json/output-json-sync.js +12 -0
- data/node_modules/fs-extra/lib/json/output-json.js +12 -0
- data/node_modules/fs-extra/lib/mkdirs/index.js +14 -0
- data/node_modules/fs-extra/lib/mkdirs/make-dir.js +141 -0
- data/node_modules/fs-extra/lib/move-sync/index.js +5 -0
- data/node_modules/fs-extra/lib/move-sync/move-sync.js +47 -0
- data/node_modules/fs-extra/lib/move/index.js +6 -0
- data/node_modules/fs-extra/lib/move/move.js +65 -0
- data/node_modules/fs-extra/lib/output/index.js +40 -0
- data/node_modules/fs-extra/lib/path-exists/index.js +12 -0
- data/node_modules/fs-extra/lib/remove/index.js +9 -0
- data/node_modules/fs-extra/lib/remove/rimraf.js +302 -0
- data/node_modules/fs-extra/lib/util/stat.js +139 -0
- data/node_modules/fs-extra/lib/util/utimes.js +26 -0
- data/node_modules/fs-extra/package.json +70 -0
- data/node_modules/fs.realpath/LICENSE +43 -0
- data/node_modules/fs.realpath/README.md +33 -0
- data/node_modules/fs.realpath/index.js +66 -0
- data/node_modules/fs.realpath/old.js +303 -0
- data/node_modules/fs.realpath/package.json +26 -0
- data/node_modules/fsevents/LICENSE +22 -0
- data/node_modules/fsevents/README.md +83 -0
- data/node_modules/fsevents/fsevents.d.ts +46 -0
- data/node_modules/fsevents/fsevents.js +82 -0
- data/node_modules/fsevents/fsevents.node +0 -0
- data/node_modules/fsevents/package.json +62 -0
- data/node_modules/get-caller-file/LICENSE.md +6 -0
- data/node_modules/get-caller-file/README.md +41 -0
- data/node_modules/get-caller-file/index.d.ts +2 -0
- data/node_modules/get-caller-file/index.js +22 -0
- data/node_modules/get-caller-file/index.js.map +1 -0
- data/node_modules/get-caller-file/package.json +42 -0
- data/node_modules/glob-parent/CHANGELOG.md +110 -0
- data/node_modules/glob-parent/LICENSE +15 -0
- data/node_modules/glob-parent/README.md +137 -0
- data/node_modules/glob-parent/index.js +42 -0
- data/node_modules/glob-parent/package.json +48 -0
- data/node_modules/glob/LICENSE +21 -0
- data/node_modules/glob/README.md +375 -0
- data/node_modules/glob/changelog.md +67 -0
- data/node_modules/glob/common.js +234 -0
- data/node_modules/glob/glob.js +788 -0
- data/node_modules/glob/package.json +51 -0
- data/node_modules/glob/sync.js +484 -0
- data/node_modules/graceful-fs/LICENSE +15 -0
- data/node_modules/graceful-fs/README.md +133 -0
- data/node_modules/graceful-fs/clone.js +23 -0
- data/node_modules/graceful-fs/graceful-fs.js +373 -0
- data/node_modules/graceful-fs/legacy-streams.js +118 -0
- data/node_modules/graceful-fs/package.json +50 -0
- data/node_modules/graceful-fs/polyfills.js +346 -0
- data/node_modules/inflight/LICENSE +15 -0
- data/node_modules/inflight/README.md +37 -0
- data/node_modules/inflight/inflight.js +54 -0
- data/node_modules/inflight/package.json +29 -0
- data/node_modules/inherits/LICENSE +16 -0
- data/node_modules/inherits/README.md +42 -0
- data/node_modules/inherits/inherits.js +9 -0
- data/node_modules/inherits/inherits_browser.js +27 -0
- data/node_modules/inherits/package.json +29 -0
- data/node_modules/is-binary-path/index.d.ts +17 -0
- data/node_modules/is-binary-path/index.js +7 -0
- data/node_modules/is-binary-path/license +9 -0
- data/node_modules/is-binary-path/package.json +40 -0
- data/node_modules/is-binary-path/readme.md +34 -0
- data/node_modules/is-extglob/LICENSE +21 -0
- data/node_modules/is-extglob/README.md +107 -0
- data/node_modules/is-extglob/index.js +20 -0
- data/node_modules/is-extglob/package.json +69 -0
- data/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
- data/node_modules/is-fullwidth-code-point/index.js +50 -0
- data/node_modules/is-fullwidth-code-point/license +9 -0
- data/node_modules/is-fullwidth-code-point/package.json +42 -0
- data/node_modules/is-fullwidth-code-point/readme.md +39 -0
- data/node_modules/is-glob/LICENSE +21 -0
- data/node_modules/is-glob/README.md +206 -0
- data/node_modules/is-glob/index.js +48 -0
- data/node_modules/is-glob/package.json +81 -0
- data/node_modules/is-number/LICENSE +21 -0
- data/node_modules/is-number/README.md +187 -0
- data/node_modules/is-number/index.js +18 -0
- data/node_modules/is-number/package.json +82 -0
- data/node_modules/isexe/LICENSE +15 -0
- data/node_modules/isexe/README.md +51 -0
- data/node_modules/isexe/index.js +57 -0
- data/node_modules/isexe/mode.js +41 -0
- data/node_modules/isexe/package.json +31 -0
- data/node_modules/isexe/test/basic.js +221 -0
- data/node_modules/isexe/windows.js +42 -0
- data/node_modules/js-yaml/CHANGELOG.md +557 -0
- data/node_modules/js-yaml/LICENSE +21 -0
- data/node_modules/js-yaml/README.md +299 -0
- data/node_modules/js-yaml/bin/js-yaml.js +132 -0
- data/node_modules/js-yaml/dist/js-yaml.js +3989 -0
- data/node_modules/js-yaml/dist/js-yaml.min.js +1 -0
- data/node_modules/js-yaml/index.js +7 -0
- data/node_modules/js-yaml/lib/js-yaml.js +39 -0
- data/node_modules/js-yaml/lib/js-yaml/common.js +59 -0
- data/node_modules/js-yaml/lib/js-yaml/dumper.js +850 -0
- data/node_modules/js-yaml/lib/js-yaml/exception.js +43 -0
- data/node_modules/js-yaml/lib/js-yaml/loader.js +1644 -0
- data/node_modules/js-yaml/lib/js-yaml/mark.js +76 -0
- data/node_modules/js-yaml/lib/js-yaml/schema.js +108 -0
- data/node_modules/js-yaml/lib/js-yaml/schema/core.js +18 -0
- data/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +25 -0
- data/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +28 -0
- data/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +17 -0
- data/node_modules/js-yaml/lib/js-yaml/schema/json.js +25 -0
- data/node_modules/js-yaml/lib/js-yaml/type.js +61 -0
- data/node_modules/js-yaml/lib/js-yaml/type/binary.js +138 -0
- data/node_modules/js-yaml/lib/js-yaml/type/bool.js +35 -0
- data/node_modules/js-yaml/lib/js-yaml/type/float.js +116 -0
- data/node_modules/js-yaml/lib/js-yaml/type/int.js +173 -0
- data/node_modules/js-yaml/lib/js-yaml/type/js/function.js +93 -0
- data/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +60 -0
- data/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +28 -0
- data/node_modules/js-yaml/lib/js-yaml/type/map.js +8 -0
- data/node_modules/js-yaml/lib/js-yaml/type/merge.js +12 -0
- data/node_modules/js-yaml/lib/js-yaml/type/null.js +34 -0
- data/node_modules/js-yaml/lib/js-yaml/type/omap.js +44 -0
- data/node_modules/js-yaml/lib/js-yaml/type/pairs.js +53 -0
- data/node_modules/js-yaml/lib/js-yaml/type/seq.js +8 -0
- data/node_modules/js-yaml/lib/js-yaml/type/set.js +29 -0
- data/node_modules/js-yaml/lib/js-yaml/type/str.js +8 -0
- data/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +88 -0
- data/node_modules/js-yaml/package.json +49 -0
- data/node_modules/jsonfile/CHANGELOG.md +171 -0
- data/node_modules/jsonfile/LICENSE +15 -0
- data/node_modules/jsonfile/README.md +230 -0
- data/node_modules/jsonfile/index.js +88 -0
- data/node_modules/jsonfile/package.json +40 -0
- data/node_modules/jsonfile/utils.js +14 -0
- data/node_modules/lru-cache/LICENSE +15 -0
- data/node_modules/lru-cache/README.md +166 -0
- data/node_modules/lru-cache/index.js +334 -0
- data/node_modules/lru-cache/package.json +34 -0
- data/node_modules/minimatch/LICENSE +15 -0
- data/node_modules/minimatch/README.md +209 -0
- data/node_modules/minimatch/minimatch.js +923 -0
- data/node_modules/minimatch/package.json +30 -0
- data/node_modules/normalize-path/LICENSE +21 -0
- data/node_modules/normalize-path/README.md +127 -0
- data/node_modules/normalize-path/index.js +35 -0
- data/node_modules/normalize-path/package.json +77 -0
- data/node_modules/once/LICENSE +15 -0
- data/node_modules/once/README.md +79 -0
- data/node_modules/once/once.js +42 -0
- data/node_modules/once/package.json +33 -0
- data/node_modules/path-is-absolute/index.js +20 -0
- data/node_modules/path-is-absolute/license +21 -0
- data/node_modules/path-is-absolute/package.json +43 -0
- data/node_modules/path-is-absolute/readme.md +59 -0
- data/node_modules/path-key/index.d.ts +40 -0
- data/node_modules/path-key/index.js +16 -0
- data/node_modules/path-key/license +9 -0
- data/node_modules/path-key/package.json +39 -0
- data/node_modules/path-key/readme.md +61 -0
- data/node_modules/picomatch/CHANGELOG.md +126 -0
- data/node_modules/picomatch/LICENSE +21 -0
- data/node_modules/picomatch/README.md +707 -0
- data/node_modules/picomatch/index.js +3 -0
- data/node_modules/picomatch/lib/constants.js +179 -0
- data/node_modules/picomatch/lib/parse.js +1084 -0
- data/node_modules/picomatch/lib/picomatch.js +342 -0
- data/node_modules/picomatch/lib/scan.js +391 -0
- data/node_modules/picomatch/lib/utils.js +64 -0
- data/node_modules/picomatch/package.json +81 -0
- data/node_modules/readdirp/LICENSE +21 -0
- data/node_modules/readdirp/README.md +122 -0
- data/node_modules/readdirp/index.d.ts +43 -0
- data/node_modules/readdirp/index.js +287 -0
- data/node_modules/readdirp/package.json +122 -0
- data/node_modules/require-directory/LICENSE +22 -0
- data/node_modules/require-directory/README.markdown +184 -0
- data/node_modules/require-directory/index.js +86 -0
- data/node_modules/require-directory/package.json +40 -0
- data/node_modules/semver/CHANGELOG.md +111 -0
- data/node_modules/semver/LICENSE +15 -0
- data/node_modules/semver/README.md +566 -0
- data/node_modules/semver/bin/semver.js +173 -0
- data/node_modules/semver/classes/comparator.js +135 -0
- data/node_modules/semver/classes/index.js +5 -0
- data/node_modules/semver/classes/range.js +510 -0
- data/node_modules/semver/classes/semver.js +287 -0
- data/node_modules/semver/functions/clean.js +6 -0
- data/node_modules/semver/functions/cmp.js +48 -0
- data/node_modules/semver/functions/coerce.js +51 -0
- data/node_modules/semver/functions/compare-build.js +7 -0
- data/node_modules/semver/functions/compare-loose.js +3 -0
- data/node_modules/semver/functions/compare.js +5 -0
- data/node_modules/semver/functions/diff.js +23 -0
- data/node_modules/semver/functions/eq.js +3 -0
- data/node_modules/semver/functions/gt.js +3 -0
- data/node_modules/semver/functions/gte.js +3 -0
- data/node_modules/semver/functions/inc.js +15 -0
- data/node_modules/semver/functions/lt.js +3 -0
- data/node_modules/semver/functions/lte.js +3 -0
- data/node_modules/semver/functions/major.js +3 -0
- data/node_modules/semver/functions/minor.js +3 -0
- data/node_modules/semver/functions/neq.js +3 -0
- data/node_modules/semver/functions/parse.js +33 -0
- data/node_modules/semver/functions/patch.js +3 -0
- data/node_modules/semver/functions/prerelease.js +6 -0
- data/node_modules/semver/functions/rcompare.js +3 -0
- data/node_modules/semver/functions/rsort.js +3 -0
- data/node_modules/semver/functions/satisfies.js +10 -0
- data/node_modules/semver/functions/sort.js +3 -0
- data/node_modules/semver/functions/valid.js +6 -0
- data/node_modules/semver/index.js +48 -0
- data/node_modules/semver/internal/constants.js +17 -0
- data/node_modules/semver/internal/debug.js +9 -0
- data/node_modules/semver/internal/identifiers.js +23 -0
- data/node_modules/semver/internal/parse-options.js +11 -0
- data/node_modules/semver/internal/re.js +182 -0
- data/node_modules/semver/package.json +41 -0
- data/node_modules/semver/preload.js +2 -0
- data/node_modules/semver/range.bnf +16 -0
- data/node_modules/semver/ranges/gtr.js +4 -0
- data/node_modules/semver/ranges/intersects.js +7 -0
- data/node_modules/semver/ranges/ltr.js +4 -0
- data/node_modules/semver/ranges/max-satisfying.js +25 -0
- data/node_modules/semver/ranges/min-satisfying.js +24 -0
- data/node_modules/semver/ranges/min-version.js +60 -0
- data/node_modules/semver/ranges/outside.js +80 -0
- data/node_modules/semver/ranges/simplify.js +44 -0
- data/node_modules/semver/ranges/subset.js +222 -0
- data/node_modules/semver/ranges/to-comparators.js +8 -0
- data/node_modules/semver/ranges/valid.js +11 -0
- data/node_modules/shebang-command/index.js +19 -0
- data/node_modules/shebang-command/license +9 -0
- data/node_modules/shebang-command/package.json +34 -0
- data/node_modules/shebang-command/readme.md +34 -0
- data/node_modules/shebang-regex/index.d.ts +22 -0
- data/node_modules/shebang-regex/index.js +2 -0
- data/node_modules/shebang-regex/license +9 -0
- data/node_modules/shebang-regex/package.json +35 -0
- data/node_modules/shebang-regex/readme.md +33 -0
- data/node_modules/simple-wcswidth/CHANGELOG.md +13 -0
- data/node_modules/simple-wcswidth/LICENSE +21 -0
- data/node_modules/simple-wcswidth/README.md +100 -0
- data/node_modules/simple-wcswidth/dist/index.d.ts +3 -0
- data/node_modules/simple-wcswidth/dist/index.js +10 -0
- data/node_modules/simple-wcswidth/dist/src/binary-search.d.ts +3 -0
- data/node_modules/simple-wcswidth/dist/src/binary-search.js +24 -0
- data/node_modules/simple-wcswidth/dist/src/models.d.ts +4 -0
- data/node_modules/simple-wcswidth/dist/src/models.js +2 -0
- data/node_modules/simple-wcswidth/dist/src/non-spacing-chars.d.ts +3 -0
- data/node_modules/simple-wcswidth/dist/src/non-spacing-chars.js +149 -0
- data/node_modules/simple-wcswidth/dist/src/wcswidth.d.ts +2 -0
- data/node_modules/simple-wcswidth/dist/src/wcswidth.js +20 -0
- data/node_modules/simple-wcswidth/dist/src/wcwidth.d.ts +2 -0
- data/node_modules/simple-wcswidth/dist/src/wcwidth.js +67 -0
- data/node_modules/simple-wcswidth/package.json +44 -0
- data/node_modules/slash/index.d.ts +25 -0
- data/node_modules/slash/index.js +11 -0
- data/node_modules/slash/license +9 -0
- data/node_modules/slash/package.json +35 -0
- data/node_modules/slash/readme.md +44 -0
- data/node_modules/sprintf-js/LICENSE +24 -0
- data/node_modules/sprintf-js/README.md +88 -0
- data/node_modules/sprintf-js/bower.json +14 -0
- data/node_modules/sprintf-js/demo/angular.html +20 -0
- data/node_modules/sprintf-js/dist/angular-sprintf.min.js +4 -0
- data/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +1 -0
- data/node_modules/sprintf-js/dist/angular-sprintf.min.map +1 -0
- data/node_modules/sprintf-js/dist/sprintf.min.js +4 -0
- data/node_modules/sprintf-js/dist/sprintf.min.js.map +1 -0
- data/node_modules/sprintf-js/dist/sprintf.min.map +1 -0
- data/node_modules/sprintf-js/gruntfile.js +36 -0
- data/node_modules/sprintf-js/package.json +22 -0
- data/node_modules/sprintf-js/src/angular-sprintf.js +18 -0
- data/node_modules/sprintf-js/src/sprintf.js +208 -0
- data/node_modules/sprintf-js/test/test.js +82 -0
- data/node_modules/sqlite-parser/CHANGELOG.md +1263 -0
- data/node_modules/sqlite-parser/LICENSE +22 -0
- data/node_modules/sqlite-parser/README.md +187 -0
- data/node_modules/sqlite-parser/bin/sqlite-parser +7 -0
- data/node_modules/sqlite-parser/dist/sqlite-parser.js +19 -0
- data/node_modules/sqlite-parser/lib/index.js +6 -0
- data/node_modules/sqlite-parser/lib/parser.js +6 -0
- data/node_modules/sqlite-parser/lib/streaming-shim.js +6 -0
- data/node_modules/sqlite-parser/lib/streaming.js +6 -0
- data/node_modules/sqlite-parser/lib/tracer.js +6 -0
- data/node_modules/sqlite-parser/package.json +75 -0
- data/node_modules/string-width/index.d.ts +29 -0
- data/node_modules/string-width/index.js +47 -0
- data/node_modules/string-width/license +9 -0
- data/node_modules/string-width/package.json +56 -0
- data/node_modules/string-width/readme.md +50 -0
- data/node_modules/strip-ansi/index.d.ts +17 -0
- data/node_modules/strip-ansi/index.js +4 -0
- data/node_modules/strip-ansi/license +9 -0
- data/node_modules/strip-ansi/package.json +54 -0
- data/node_modules/strip-ansi/readme.md +46 -0
- data/node_modules/to-regex-range/LICENSE +21 -0
- data/node_modules/to-regex-range/README.md +305 -0
- data/node_modules/to-regex-range/index.js +288 -0
- data/node_modules/to-regex-range/package.json +88 -0
- data/node_modules/universalify/LICENSE +20 -0
- data/node_modules/universalify/README.md +76 -0
- data/node_modules/universalify/index.js +24 -0
- data/node_modules/universalify/package.json +34 -0
- data/node_modules/which/CHANGELOG.md +166 -0
- data/node_modules/which/LICENSE +15 -0
- data/node_modules/which/README.md +54 -0
- data/node_modules/which/bin/node-which +52 -0
- data/node_modules/which/package.json +43 -0
- data/node_modules/which/which.js +125 -0
- data/node_modules/wrap-ansi/index.js +216 -0
- data/node_modules/wrap-ansi/license +9 -0
- data/node_modules/wrap-ansi/package.json +62 -0
- data/node_modules/wrap-ansi/readme.md +91 -0
- data/node_modules/wrappy/LICENSE +15 -0
- data/node_modules/wrappy/README.md +36 -0
- data/node_modules/wrappy/package.json +29 -0
- data/node_modules/wrappy/wrappy.js +33 -0
- data/node_modules/y18n/CHANGELOG.md +100 -0
- data/node_modules/y18n/LICENSE +13 -0
- data/node_modules/y18n/README.md +127 -0
- data/node_modules/y18n/build/index.cjs +203 -0
- data/node_modules/y18n/build/lib/cjs.js +6 -0
- data/node_modules/y18n/build/lib/index.js +174 -0
- data/node_modules/y18n/build/lib/platform-shims/node.js +19 -0
- data/node_modules/y18n/index.mjs +8 -0
- data/node_modules/y18n/package.json +70 -0
- data/node_modules/yallist/LICENSE +15 -0
- data/node_modules/yallist/README.md +204 -0
- data/node_modules/yallist/iterator.js +8 -0
- data/node_modules/yallist/package.json +29 -0
- data/node_modules/yallist/yallist.js +426 -0
- data/node_modules/yargs-parser/CHANGELOG.md +263 -0
- data/node_modules/yargs-parser/LICENSE.txt +14 -0
- data/node_modules/yargs-parser/README.md +518 -0
- data/node_modules/yargs-parser/browser.js +29 -0
- data/node_modules/yargs-parser/build/index.cjs +1042 -0
- data/node_modules/yargs-parser/build/lib/index.js +59 -0
- data/node_modules/yargs-parser/build/lib/string-utils.js +65 -0
- data/node_modules/yargs-parser/build/lib/tokenize-arg-string.js +40 -0
- data/node_modules/yargs-parser/build/lib/yargs-parser-types.js +12 -0
- data/node_modules/yargs-parser/build/lib/yargs-parser.js +1037 -0
- data/node_modules/yargs-parser/package.json +87 -0
- data/node_modules/yargs/CHANGELOG.md +151 -0
- data/node_modules/yargs/LICENSE +21 -0
- data/node_modules/yargs/README.md +204 -0
- data/node_modules/yargs/browser.mjs +7 -0
- data/node_modules/yargs/build/index.cjs +1 -0
- data/node_modules/yargs/build/lib/argsert.js +62 -0
- data/node_modules/yargs/build/lib/command.js +436 -0
- data/node_modules/yargs/build/lib/completion-templates.js +48 -0
- data/node_modules/yargs/build/lib/completion.js +166 -0
- data/node_modules/yargs/build/lib/middleware.js +85 -0
- data/node_modules/yargs/build/lib/parse-command.js +32 -0
- data/node_modules/yargs/build/lib/typings/common-types.js +9 -0
- data/node_modules/yargs/build/lib/typings/yargs-parser-types.js +1 -0
- data/node_modules/yargs/build/lib/usage.js +567 -0
- data/node_modules/yargs/build/lib/utils/apply-extends.js +59 -0
- data/node_modules/yargs/build/lib/utils/is-promise.js +5 -0
- data/node_modules/yargs/build/lib/utils/levenshtein.js +26 -0
- data/node_modules/yargs/build/lib/utils/maybe-async-result.js +17 -0
- data/node_modules/yargs/build/lib/utils/obj-filter.js +10 -0
- data/node_modules/yargs/build/lib/utils/process-argv.js +17 -0
- data/node_modules/yargs/build/lib/utils/set-blocking.js +12 -0
- data/node_modules/yargs/build/lib/utils/which-module.js +10 -0
- data/node_modules/yargs/build/lib/validation.js +279 -0
- data/node_modules/yargs/build/lib/yargs-factory.js +1452 -0
- data/node_modules/yargs/build/lib/yerror.js +7 -0
- data/node_modules/yargs/helpers/helpers.mjs +10 -0
- data/node_modules/yargs/helpers/index.js +14 -0
- data/node_modules/yargs/helpers/package.json +3 -0
- data/node_modules/yargs/index.cjs +43 -0
- data/node_modules/yargs/index.mjs +8 -0
- data/node_modules/yargs/lib/platform-shims/browser.mjs +94 -0
- data/node_modules/yargs/lib/platform-shims/esm.mjs +67 -0
- data/node_modules/yargs/locales/be.json +46 -0
- data/node_modules/yargs/locales/de.json +46 -0
- data/node_modules/yargs/locales/en.json +51 -0
- data/node_modules/yargs/locales/es.json +46 -0
- data/node_modules/yargs/locales/fi.json +49 -0
- data/node_modules/yargs/locales/fr.json +53 -0
- data/node_modules/yargs/locales/hi.json +49 -0
- data/node_modules/yargs/locales/hu.json +46 -0
- data/node_modules/yargs/locales/id.json +50 -0
- data/node_modules/yargs/locales/it.json +46 -0
- data/node_modules/yargs/locales/ja.json +51 -0
- data/node_modules/yargs/locales/ko.json +49 -0
- data/node_modules/yargs/locales/nb.json +44 -0
- data/node_modules/yargs/locales/nl.json +49 -0
- data/node_modules/yargs/locales/nn.json +44 -0
- data/node_modules/yargs/locales/pirate.json +13 -0
- data/node_modules/yargs/locales/pl.json +49 -0
- data/node_modules/yargs/locales/pt.json +45 -0
- data/node_modules/yargs/locales/pt_BR.json +48 -0
- data/node_modules/yargs/locales/ru.json +46 -0
- data/node_modules/yargs/locales/th.json +46 -0
- data/node_modules/yargs/locales/tr.json +48 -0
- data/node_modules/yargs/locales/uk_UA.json +51 -0
- data/node_modules/yargs/locales/zh_CN.json +48 -0
- data/node_modules/yargs/locales/zh_TW.json +47 -0
- data/node_modules/yargs/package.json +116 -0
- data/node_modules/yargs/yargs +9 -0
- data/package.json +1 -1
- data/spec/depends/api_spec.rb +184 -0
- data/spec/depends/spec_helper.rb +27 -0
- data/spec/fixtures/depends/.gitignore +2 -0
- data/spec/fixtures/depends/app/controllers/api/api_keys_controller.rb +2 -0
- data/spec/fixtures/depends/app/controllers/organizations_controller.rb +2 -0
- data/spec/fixtures/depends/app/models/api_key.rb +2 -0
- data/spec/fixtures/depends/app/models/configuration.rb +2 -0
- data/spec/fixtures/depends/app/models/show.rb +2 -0
- data/spec/fixtures/depends/app/models/user.rb +2 -0
- data/spec/fixtures/depends/revoke_api_key.appmap.json +901 -0
- data/spec/fixtures/depends/spec/actual_rspec_test.rb +7 -0
- data/spec/fixtures/depends/spec/api_spec.rb +2 -0
- data/spec/fixtures/depends/spec/user_spec.rb +2 -0
- data/spec/fixtures/depends/test/actual_minitest_test.rb +5 -0
- data/spec/fixtures/depends/user_page_scenario.appmap.json +1776 -0
- data/spec/fixtures/rails5_users_app/create_app +3 -3
- data/spec/fixtures/rails6_users_app/create_app +3 -3
- data/spec/fixtures/rails6_users_app/lib/tasks/appmap.rake +11 -1
- data/spec/service/config_analyzer_spec.rb +3 -3
- data/spec/service/integration_test_path_finder_spec.rb +24 -0
- data/test/agent_setup_status_test.rb +7 -4
- data/test/agent_setup_validate_test.rb +19 -2
- data/test/test_helper.rb +3 -0
- data/yarn.lock +23 -9
- metadata +984 -7
@@ -0,0 +1,1452 @@
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
|
2
|
+
if (!privateMap.has(receiver)) {
|
3
|
+
throw new TypeError("attempted to set private field on non-instance");
|
4
|
+
}
|
5
|
+
privateMap.set(receiver, value);
|
6
|
+
return value;
|
7
|
+
};
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
|
9
|
+
if (!privateMap.has(receiver)) {
|
10
|
+
throw new TypeError("attempted to get private field on non-instance");
|
11
|
+
}
|
12
|
+
return privateMap.get(receiver);
|
13
|
+
};
|
14
|
+
var _command, _cwd, _context, _completion, _completionCommand, _defaultShowHiddenOpt, _exitError, _detectLocale, _exitProcess, _frozens, _globalMiddleware, _groups, _hasOutput, _helpOpt, _logger, _output, _options, _parentRequire, _parserConfig, _parseFn_1, _parseContext, _pkgs, _preservedGroups, _processArgs, _recommendCommands, _shim_1, _strict, _strictCommands, _strictOptions, _usage, _versionOpt, _validation;
|
15
|
+
import { command as Command, } from './command.js';
|
16
|
+
import { assertNotStrictEqual, assertSingleKey, objectKeys, } from './typings/common-types.js';
|
17
|
+
import { YError } from './yerror.js';
|
18
|
+
import { usage as Usage } from './usage.js';
|
19
|
+
import { argsert } from './argsert.js';
|
20
|
+
import { completion as Completion, } from './completion.js';
|
21
|
+
import { validation as Validation, } from './validation.js';
|
22
|
+
import { objFilter } from './utils/obj-filter.js';
|
23
|
+
import { applyExtends } from './utils/apply-extends.js';
|
24
|
+
import { applyMiddleware, GlobalMiddleware, } from './middleware.js';
|
25
|
+
import { isPromise } from './utils/is-promise.js';
|
26
|
+
import { maybeAsyncResult } from './utils/maybe-async-result.js';
|
27
|
+
import setBlocking from './utils/set-blocking.js';
|
28
|
+
export function YargsFactory(_shim) {
|
29
|
+
return (processArgs = [], cwd = _shim.process.cwd(), parentRequire) => {
|
30
|
+
const yargs = new YargsInstance(processArgs, cwd, parentRequire, _shim);
|
31
|
+
Object.defineProperty(yargs, 'argv', {
|
32
|
+
get: () => {
|
33
|
+
return yargs.parse();
|
34
|
+
},
|
35
|
+
enumerable: true,
|
36
|
+
});
|
37
|
+
yargs.help();
|
38
|
+
yargs.version();
|
39
|
+
return yargs;
|
40
|
+
};
|
41
|
+
}
|
42
|
+
const kCopyDoubleDash = Symbol('copyDoubleDash');
|
43
|
+
const kCreateLogger = Symbol('copyDoubleDash');
|
44
|
+
const kDeleteFromParserHintObject = Symbol('deleteFromParserHintObject');
|
45
|
+
const kFreeze = Symbol('freeze');
|
46
|
+
const kGetDollarZero = Symbol('getDollarZero');
|
47
|
+
const kGetParserConfiguration = Symbol('getParserConfiguration');
|
48
|
+
const kGuessLocale = Symbol('guessLocale');
|
49
|
+
const kGuessVersion = Symbol('guessVersion');
|
50
|
+
const kParsePositionalNumbers = Symbol('parsePositionalNumbers');
|
51
|
+
const kPkgUp = Symbol('pkgUp');
|
52
|
+
const kPopulateParserHintArray = Symbol('populateParserHintArray');
|
53
|
+
const kPopulateParserHintSingleValueDictionary = Symbol('populateParserHintSingleValueDictionary');
|
54
|
+
const kPopulateParserHintArrayDictionary = Symbol('populateParserHintArrayDictionary');
|
55
|
+
const kPopulateParserHintDictionary = Symbol('populateParserHintDictionary');
|
56
|
+
const kSanitizeKey = Symbol('sanitizeKey');
|
57
|
+
const kSetKey = Symbol('setKey');
|
58
|
+
const kUnfreeze = Symbol('unfreeze');
|
59
|
+
const kValidateAsync = Symbol('validateAsync');
|
60
|
+
const kGetCommandInstance = Symbol('getCommandInstance');
|
61
|
+
const kGetContext = Symbol('getContext');
|
62
|
+
const kGetHasOutput = Symbol('getHasOutput');
|
63
|
+
const kGetLoggerInstance = Symbol('getLoggerInstance');
|
64
|
+
const kGetParseContext = Symbol('getParseContext');
|
65
|
+
const kGetUsageInstance = Symbol('getUsageInstance');
|
66
|
+
const kGetValidationInstance = Symbol('getValidationInstance');
|
67
|
+
const kHasParseCallback = Symbol('hasParseCallback');
|
68
|
+
const kPostProcess = Symbol('postProcess');
|
69
|
+
const kRebase = Symbol('rebase');
|
70
|
+
const kReset = Symbol('reset');
|
71
|
+
const kRunYargsParserAndExecuteCommands = Symbol('runYargsParserAndExecuteCommands');
|
72
|
+
const kRunValidation = Symbol('runValidation');
|
73
|
+
const kSetHasOutput = Symbol('setHasOutput');
|
74
|
+
export class YargsInstance {
|
75
|
+
constructor(processArgs = [], cwd, parentRequire, shim) {
|
76
|
+
this.customScriptName = false;
|
77
|
+
this.parsed = false;
|
78
|
+
_command.set(this, void 0);
|
79
|
+
_cwd.set(this, void 0);
|
80
|
+
_context.set(this, { commands: [], fullCommands: [] });
|
81
|
+
_completion.set(this, null);
|
82
|
+
_completionCommand.set(this, null);
|
83
|
+
_defaultShowHiddenOpt.set(this, 'show-hidden');
|
84
|
+
_exitError.set(this, null);
|
85
|
+
_detectLocale.set(this, true);
|
86
|
+
_exitProcess.set(this, true);
|
87
|
+
_frozens.set(this, []);
|
88
|
+
_globalMiddleware.set(this, void 0);
|
89
|
+
_groups.set(this, {});
|
90
|
+
_hasOutput.set(this, false);
|
91
|
+
_helpOpt.set(this, null);
|
92
|
+
_logger.set(this, void 0);
|
93
|
+
_output.set(this, '');
|
94
|
+
_options.set(this, void 0);
|
95
|
+
_parentRequire.set(this, void 0);
|
96
|
+
_parserConfig.set(this, {});
|
97
|
+
_parseFn_1.set(this, null);
|
98
|
+
_parseContext.set(this, null);
|
99
|
+
_pkgs.set(this, {});
|
100
|
+
_preservedGroups.set(this, {});
|
101
|
+
_processArgs.set(this, void 0);
|
102
|
+
_recommendCommands.set(this, false);
|
103
|
+
_shim_1.set(this, void 0);
|
104
|
+
_strict.set(this, false);
|
105
|
+
_strictCommands.set(this, false);
|
106
|
+
_strictOptions.set(this, false);
|
107
|
+
_usage.set(this, void 0);
|
108
|
+
_versionOpt.set(this, null);
|
109
|
+
_validation.set(this, void 0);
|
110
|
+
__classPrivateFieldSet(this, _shim_1, shim);
|
111
|
+
__classPrivateFieldSet(this, _processArgs, processArgs);
|
112
|
+
__classPrivateFieldSet(this, _cwd, cwd);
|
113
|
+
__classPrivateFieldSet(this, _parentRequire, parentRequire);
|
114
|
+
__classPrivateFieldSet(this, _globalMiddleware, new GlobalMiddleware(this));
|
115
|
+
this.$0 = this[kGetDollarZero]();
|
116
|
+
this[kReset]();
|
117
|
+
__classPrivateFieldSet(this, _command, __classPrivateFieldGet(this, _command));
|
118
|
+
__classPrivateFieldSet(this, _usage, __classPrivateFieldGet(this, _usage));
|
119
|
+
__classPrivateFieldSet(this, _validation, __classPrivateFieldGet(this, _validation));
|
120
|
+
__classPrivateFieldSet(this, _options, __classPrivateFieldGet(this, _options));
|
121
|
+
__classPrivateFieldGet(this, _options).showHiddenOpt = __classPrivateFieldGet(this, _defaultShowHiddenOpt);
|
122
|
+
__classPrivateFieldSet(this, _logger, this[kCreateLogger]());
|
123
|
+
}
|
124
|
+
addHelpOpt(opt, msg) {
|
125
|
+
const defaultHelpOpt = 'help';
|
126
|
+
argsert('[string|boolean] [string]', [opt, msg], arguments.length);
|
127
|
+
if (__classPrivateFieldGet(this, _helpOpt)) {
|
128
|
+
this[kDeleteFromParserHintObject](__classPrivateFieldGet(this, _helpOpt));
|
129
|
+
__classPrivateFieldSet(this, _helpOpt, null);
|
130
|
+
}
|
131
|
+
if (opt === false && msg === undefined)
|
132
|
+
return this;
|
133
|
+
__classPrivateFieldSet(this, _helpOpt, typeof opt === 'string' ? opt : defaultHelpOpt);
|
134
|
+
this.boolean(__classPrivateFieldGet(this, _helpOpt));
|
135
|
+
this.describe(__classPrivateFieldGet(this, _helpOpt), msg || __classPrivateFieldGet(this, _usage).deferY18nLookup('Show help'));
|
136
|
+
return this;
|
137
|
+
}
|
138
|
+
help(opt, msg) {
|
139
|
+
return this.addHelpOpt(opt, msg);
|
140
|
+
}
|
141
|
+
addShowHiddenOpt(opt, msg) {
|
142
|
+
argsert('[string|boolean] [string]', [opt, msg], arguments.length);
|
143
|
+
if (opt === false && msg === undefined)
|
144
|
+
return this;
|
145
|
+
const showHiddenOpt = typeof opt === 'string' ? opt : __classPrivateFieldGet(this, _defaultShowHiddenOpt);
|
146
|
+
this.boolean(showHiddenOpt);
|
147
|
+
this.describe(showHiddenOpt, msg || __classPrivateFieldGet(this, _usage).deferY18nLookup('Show hidden options'));
|
148
|
+
__classPrivateFieldGet(this, _options).showHiddenOpt = showHiddenOpt;
|
149
|
+
return this;
|
150
|
+
}
|
151
|
+
showHidden(opt, msg) {
|
152
|
+
return this.addShowHiddenOpt(opt, msg);
|
153
|
+
}
|
154
|
+
alias(key, value) {
|
155
|
+
argsert('<object|string|array> [string|array]', [key, value], arguments.length);
|
156
|
+
this[kPopulateParserHintArrayDictionary](this.alias.bind(this), 'alias', key, value);
|
157
|
+
return this;
|
158
|
+
}
|
159
|
+
array(keys) {
|
160
|
+
argsert('<array|string>', [keys], arguments.length);
|
161
|
+
this[kPopulateParserHintArray]('array', keys);
|
162
|
+
return this;
|
163
|
+
}
|
164
|
+
boolean(keys) {
|
165
|
+
argsert('<array|string>', [keys], arguments.length);
|
166
|
+
this[kPopulateParserHintArray]('boolean', keys);
|
167
|
+
return this;
|
168
|
+
}
|
169
|
+
check(f, global) {
|
170
|
+
argsert('<function> [boolean]', [f, global], arguments.length);
|
171
|
+
this.middleware((argv, _yargs) => {
|
172
|
+
return maybeAsyncResult(() => {
|
173
|
+
return f(argv);
|
174
|
+
}, (result) => {
|
175
|
+
if (!result) {
|
176
|
+
__classPrivateFieldGet(this, _usage).fail(__classPrivateFieldGet(this, _shim_1).y18n.__('Argument check failed: %s', f.toString()));
|
177
|
+
}
|
178
|
+
else if (typeof result === 'string' || result instanceof Error) {
|
179
|
+
__classPrivateFieldGet(this, _usage).fail(result.toString(), result);
|
180
|
+
}
|
181
|
+
return argv;
|
182
|
+
}, (err) => {
|
183
|
+
__classPrivateFieldGet(this, _usage).fail(err.message ? err.message : err.toString(), err);
|
184
|
+
return argv;
|
185
|
+
});
|
186
|
+
}, false, global);
|
187
|
+
return this;
|
188
|
+
}
|
189
|
+
choices(key, value) {
|
190
|
+
argsert('<object|string|array> [string|array]', [key, value], arguments.length);
|
191
|
+
this[kPopulateParserHintArrayDictionary](this.choices.bind(this), 'choices', key, value);
|
192
|
+
return this;
|
193
|
+
}
|
194
|
+
coerce(keys, value) {
|
195
|
+
argsert('<object|string|array> [function]', [keys, value], arguments.length);
|
196
|
+
if (Array.isArray(keys)) {
|
197
|
+
if (!value) {
|
198
|
+
throw new YError('coerce callback must be provided');
|
199
|
+
}
|
200
|
+
for (const key of keys) {
|
201
|
+
this.coerce(key, value);
|
202
|
+
}
|
203
|
+
return this;
|
204
|
+
}
|
205
|
+
else if (typeof keys === 'object') {
|
206
|
+
for (const key of Object.keys(keys)) {
|
207
|
+
this.coerce(key, keys[key]);
|
208
|
+
}
|
209
|
+
return this;
|
210
|
+
}
|
211
|
+
if (!value) {
|
212
|
+
throw new YError('coerce callback must be provided');
|
213
|
+
}
|
214
|
+
__classPrivateFieldGet(this, _options).key[keys] = true;
|
215
|
+
__classPrivateFieldGet(this, _globalMiddleware).addCoerceMiddleware((argv, yargs) => {
|
216
|
+
let aliases;
|
217
|
+
return maybeAsyncResult(() => {
|
218
|
+
aliases = yargs.getAliases();
|
219
|
+
return value(argv[keys]);
|
220
|
+
}, (result) => {
|
221
|
+
argv[keys] = result;
|
222
|
+
if (aliases[keys]) {
|
223
|
+
for (const alias of aliases[keys]) {
|
224
|
+
argv[alias] = result;
|
225
|
+
}
|
226
|
+
}
|
227
|
+
return argv;
|
228
|
+
}, (err) => {
|
229
|
+
throw new YError(err.message);
|
230
|
+
});
|
231
|
+
}, keys);
|
232
|
+
return this;
|
233
|
+
}
|
234
|
+
conflicts(key1, key2) {
|
235
|
+
argsert('<string|object> [string|array]', [key1, key2], arguments.length);
|
236
|
+
__classPrivateFieldGet(this, _validation).conflicts(key1, key2);
|
237
|
+
return this;
|
238
|
+
}
|
239
|
+
config(key = 'config', msg, parseFn) {
|
240
|
+
argsert('[object|string] [string|function] [function]', [key, msg, parseFn], arguments.length);
|
241
|
+
if (typeof key === 'object' && !Array.isArray(key)) {
|
242
|
+
key = applyExtends(key, __classPrivateFieldGet(this, _cwd), this[kGetParserConfiguration]()['deep-merge-config'] || false, __classPrivateFieldGet(this, _shim_1));
|
243
|
+
__classPrivateFieldGet(this, _options).configObjects = (__classPrivateFieldGet(this, _options).configObjects || []).concat(key);
|
244
|
+
return this;
|
245
|
+
}
|
246
|
+
if (typeof msg === 'function') {
|
247
|
+
parseFn = msg;
|
248
|
+
msg = undefined;
|
249
|
+
}
|
250
|
+
this.describe(key, msg || __classPrivateFieldGet(this, _usage).deferY18nLookup('Path to JSON config file'));
|
251
|
+
(Array.isArray(key) ? key : [key]).forEach(k => {
|
252
|
+
__classPrivateFieldGet(this, _options).config[k] = parseFn || true;
|
253
|
+
});
|
254
|
+
return this;
|
255
|
+
}
|
256
|
+
completion(cmd, desc, fn) {
|
257
|
+
argsert('[string] [string|boolean|function] [function]', [cmd, desc, fn], arguments.length);
|
258
|
+
if (typeof desc === 'function') {
|
259
|
+
fn = desc;
|
260
|
+
desc = undefined;
|
261
|
+
}
|
262
|
+
__classPrivateFieldSet(this, _completionCommand, cmd || __classPrivateFieldGet(this, _completionCommand) || 'completion');
|
263
|
+
if (!desc && desc !== false) {
|
264
|
+
desc = 'generate completion script';
|
265
|
+
}
|
266
|
+
this.command(__classPrivateFieldGet(this, _completionCommand), desc);
|
267
|
+
if (fn)
|
268
|
+
__classPrivateFieldGet(this, _completion).registerFunction(fn);
|
269
|
+
return this;
|
270
|
+
}
|
271
|
+
command(cmd, description, builder, handler, middlewares, deprecated) {
|
272
|
+
argsert('<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]', [cmd, description, builder, handler, middlewares, deprecated], arguments.length);
|
273
|
+
__classPrivateFieldGet(this, _command).addHandler(cmd, description, builder, handler, middlewares, deprecated);
|
274
|
+
return this;
|
275
|
+
}
|
276
|
+
commands(cmd, description, builder, handler, middlewares, deprecated) {
|
277
|
+
return this.command(cmd, description, builder, handler, middlewares, deprecated);
|
278
|
+
}
|
279
|
+
commandDir(dir, opts) {
|
280
|
+
argsert('<string> [object]', [dir, opts], arguments.length);
|
281
|
+
const req = __classPrivateFieldGet(this, _parentRequire) || __classPrivateFieldGet(this, _shim_1).require;
|
282
|
+
__classPrivateFieldGet(this, _command).addDirectory(dir, req, __classPrivateFieldGet(this, _shim_1).getCallerFile(), opts);
|
283
|
+
return this;
|
284
|
+
}
|
285
|
+
count(keys) {
|
286
|
+
argsert('<array|string>', [keys], arguments.length);
|
287
|
+
this[kPopulateParserHintArray]('count', keys);
|
288
|
+
return this;
|
289
|
+
}
|
290
|
+
default(key, value, defaultDescription) {
|
291
|
+
argsert('<object|string|array> [*] [string]', [key, value, defaultDescription], arguments.length);
|
292
|
+
if (defaultDescription) {
|
293
|
+
assertSingleKey(key, __classPrivateFieldGet(this, _shim_1));
|
294
|
+
__classPrivateFieldGet(this, _options).defaultDescription[key] = defaultDescription;
|
295
|
+
}
|
296
|
+
if (typeof value === 'function') {
|
297
|
+
assertSingleKey(key, __classPrivateFieldGet(this, _shim_1));
|
298
|
+
if (!__classPrivateFieldGet(this, _options).defaultDescription[key])
|
299
|
+
__classPrivateFieldGet(this, _options).defaultDescription[key] = __classPrivateFieldGet(this, _usage).functionDescription(value);
|
300
|
+
value = value.call();
|
301
|
+
}
|
302
|
+
this[kPopulateParserHintSingleValueDictionary](this.default.bind(this), 'default', key, value);
|
303
|
+
return this;
|
304
|
+
}
|
305
|
+
defaults(key, value, defaultDescription) {
|
306
|
+
return this.default(key, value, defaultDescription);
|
307
|
+
}
|
308
|
+
demandCommand(min = 1, max, minMsg, maxMsg) {
|
309
|
+
argsert('[number] [number|string] [string|null|undefined] [string|null|undefined]', [min, max, minMsg, maxMsg], arguments.length);
|
310
|
+
if (typeof max !== 'number') {
|
311
|
+
minMsg = max;
|
312
|
+
max = Infinity;
|
313
|
+
}
|
314
|
+
this.global('_', false);
|
315
|
+
__classPrivateFieldGet(this, _options).demandedCommands._ = {
|
316
|
+
min,
|
317
|
+
max,
|
318
|
+
minMsg,
|
319
|
+
maxMsg,
|
320
|
+
};
|
321
|
+
return this;
|
322
|
+
}
|
323
|
+
demand(keys, max, msg) {
|
324
|
+
if (Array.isArray(max)) {
|
325
|
+
max.forEach(key => {
|
326
|
+
assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _shim_1));
|
327
|
+
this.demandOption(key, msg);
|
328
|
+
});
|
329
|
+
max = Infinity;
|
330
|
+
}
|
331
|
+
else if (typeof max !== 'number') {
|
332
|
+
msg = max;
|
333
|
+
max = Infinity;
|
334
|
+
}
|
335
|
+
if (typeof keys === 'number') {
|
336
|
+
assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _shim_1));
|
337
|
+
this.demandCommand(keys, max, msg, msg);
|
338
|
+
}
|
339
|
+
else if (Array.isArray(keys)) {
|
340
|
+
keys.forEach(key => {
|
341
|
+
assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _shim_1));
|
342
|
+
this.demandOption(key, msg);
|
343
|
+
});
|
344
|
+
}
|
345
|
+
else {
|
346
|
+
if (typeof msg === 'string') {
|
347
|
+
this.demandOption(keys, msg);
|
348
|
+
}
|
349
|
+
else if (msg === true || typeof msg === 'undefined') {
|
350
|
+
this.demandOption(keys);
|
351
|
+
}
|
352
|
+
}
|
353
|
+
return this;
|
354
|
+
}
|
355
|
+
demandOption(keys, msg) {
|
356
|
+
argsert('<object|string|array> [string]', [keys, msg], arguments.length);
|
357
|
+
this[kPopulateParserHintSingleValueDictionary](this.demandOption.bind(this), 'demandedOptions', keys, msg);
|
358
|
+
return this;
|
359
|
+
}
|
360
|
+
deprecateOption(option, message) {
|
361
|
+
argsert('<string> [string|boolean]', [option, message], arguments.length);
|
362
|
+
__classPrivateFieldGet(this, _options).deprecatedOptions[option] = message;
|
363
|
+
return this;
|
364
|
+
}
|
365
|
+
describe(keys, description) {
|
366
|
+
argsert('<object|string|array> [string]', [keys, description], arguments.length);
|
367
|
+
this[kSetKey](keys, true);
|
368
|
+
__classPrivateFieldGet(this, _usage).describe(keys, description);
|
369
|
+
return this;
|
370
|
+
}
|
371
|
+
detectLocale(detect) {
|
372
|
+
argsert('<boolean>', [detect], arguments.length);
|
373
|
+
__classPrivateFieldSet(this, _detectLocale, detect);
|
374
|
+
return this;
|
375
|
+
}
|
376
|
+
env(prefix) {
|
377
|
+
argsert('[string|boolean]', [prefix], arguments.length);
|
378
|
+
if (prefix === false)
|
379
|
+
delete __classPrivateFieldGet(this, _options).envPrefix;
|
380
|
+
else
|
381
|
+
__classPrivateFieldGet(this, _options).envPrefix = prefix || '';
|
382
|
+
return this;
|
383
|
+
}
|
384
|
+
epilogue(msg) {
|
385
|
+
argsert('<string>', [msg], arguments.length);
|
386
|
+
__classPrivateFieldGet(this, _usage).epilog(msg);
|
387
|
+
return this;
|
388
|
+
}
|
389
|
+
epilog(msg) {
|
390
|
+
return this.epilogue(msg);
|
391
|
+
}
|
392
|
+
example(cmd, description) {
|
393
|
+
argsert('<string|array> [string]', [cmd, description], arguments.length);
|
394
|
+
if (Array.isArray(cmd)) {
|
395
|
+
cmd.forEach(exampleParams => this.example(...exampleParams));
|
396
|
+
}
|
397
|
+
else {
|
398
|
+
__classPrivateFieldGet(this, _usage).example(cmd, description);
|
399
|
+
}
|
400
|
+
return this;
|
401
|
+
}
|
402
|
+
exit(code, err) {
|
403
|
+
__classPrivateFieldSet(this, _hasOutput, true);
|
404
|
+
__classPrivateFieldSet(this, _exitError, err);
|
405
|
+
if (__classPrivateFieldGet(this, _exitProcess))
|
406
|
+
__classPrivateFieldGet(this, _shim_1).process.exit(code);
|
407
|
+
}
|
408
|
+
exitProcess(enabled = true) {
|
409
|
+
argsert('[boolean]', [enabled], arguments.length);
|
410
|
+
__classPrivateFieldSet(this, _exitProcess, enabled);
|
411
|
+
return this;
|
412
|
+
}
|
413
|
+
fail(f) {
|
414
|
+
argsert('<function|boolean>', [f], arguments.length);
|
415
|
+
if (typeof f === 'boolean' && f !== false) {
|
416
|
+
throw new YError("Invalid first argument. Expected function or boolean 'false'");
|
417
|
+
}
|
418
|
+
__classPrivateFieldGet(this, _usage).failFn(f);
|
419
|
+
return this;
|
420
|
+
}
|
421
|
+
getAliases() {
|
422
|
+
return this.parsed ? this.parsed.aliases : {};
|
423
|
+
}
|
424
|
+
async getCompletion(args, done) {
|
425
|
+
argsert('<array> [function]', [args, done], arguments.length);
|
426
|
+
if (!done) {
|
427
|
+
return new Promise((resolve, reject) => {
|
428
|
+
__classPrivateFieldGet(this, _completion).getCompletion(args, (err, completions) => {
|
429
|
+
if (err)
|
430
|
+
reject(err);
|
431
|
+
else
|
432
|
+
resolve(completions);
|
433
|
+
});
|
434
|
+
});
|
435
|
+
}
|
436
|
+
else {
|
437
|
+
return __classPrivateFieldGet(this, _completion).getCompletion(args, done);
|
438
|
+
}
|
439
|
+
}
|
440
|
+
getDemandedOptions() {
|
441
|
+
argsert([], 0);
|
442
|
+
return __classPrivateFieldGet(this, _options).demandedOptions;
|
443
|
+
}
|
444
|
+
getDemandedCommands() {
|
445
|
+
argsert([], 0);
|
446
|
+
return __classPrivateFieldGet(this, _options).demandedCommands;
|
447
|
+
}
|
448
|
+
getDeprecatedOptions() {
|
449
|
+
argsert([], 0);
|
450
|
+
return __classPrivateFieldGet(this, _options).deprecatedOptions;
|
451
|
+
}
|
452
|
+
getDetectLocale() {
|
453
|
+
return __classPrivateFieldGet(this, _detectLocale);
|
454
|
+
}
|
455
|
+
getExitProcess() {
|
456
|
+
return __classPrivateFieldGet(this, _exitProcess);
|
457
|
+
}
|
458
|
+
getGroups() {
|
459
|
+
return Object.assign({}, __classPrivateFieldGet(this, _groups), __classPrivateFieldGet(this, _preservedGroups));
|
460
|
+
}
|
461
|
+
getHelp() {
|
462
|
+
__classPrivateFieldSet(this, _hasOutput, true);
|
463
|
+
if (!__classPrivateFieldGet(this, _usage).hasCachedHelpMessage()) {
|
464
|
+
if (!this.parsed) {
|
465
|
+
const parse = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _processArgs), undefined, undefined, 0, true);
|
466
|
+
if (isPromise(parse)) {
|
467
|
+
return parse.then(() => {
|
468
|
+
return __classPrivateFieldGet(this, _usage).help();
|
469
|
+
});
|
470
|
+
}
|
471
|
+
}
|
472
|
+
const builderResponse = __classPrivateFieldGet(this, _command).runDefaultBuilderOn(this);
|
473
|
+
if (isPromise(builderResponse)) {
|
474
|
+
return builderResponse.then(() => {
|
475
|
+
return __classPrivateFieldGet(this, _usage).help();
|
476
|
+
});
|
477
|
+
}
|
478
|
+
}
|
479
|
+
return Promise.resolve(__classPrivateFieldGet(this, _usage).help());
|
480
|
+
}
|
481
|
+
getOptions() {
|
482
|
+
return __classPrivateFieldGet(this, _options);
|
483
|
+
}
|
484
|
+
getStrict() {
|
485
|
+
return __classPrivateFieldGet(this, _strict);
|
486
|
+
}
|
487
|
+
getStrictCommands() {
|
488
|
+
return __classPrivateFieldGet(this, _strictCommands);
|
489
|
+
}
|
490
|
+
getStrictOptions() {
|
491
|
+
return __classPrivateFieldGet(this, _strictOptions);
|
492
|
+
}
|
493
|
+
global(globals, global) {
|
494
|
+
argsert('<string|array> [boolean]', [globals, global], arguments.length);
|
495
|
+
globals = [].concat(globals);
|
496
|
+
if (global !== false) {
|
497
|
+
__classPrivateFieldGet(this, _options).local = __classPrivateFieldGet(this, _options).local.filter(l => globals.indexOf(l) === -1);
|
498
|
+
}
|
499
|
+
else {
|
500
|
+
globals.forEach(g => {
|
501
|
+
if (__classPrivateFieldGet(this, _options).local.indexOf(g) === -1)
|
502
|
+
__classPrivateFieldGet(this, _options).local.push(g);
|
503
|
+
});
|
504
|
+
}
|
505
|
+
return this;
|
506
|
+
}
|
507
|
+
group(opts, groupName) {
|
508
|
+
argsert('<string|array> <string>', [opts, groupName], arguments.length);
|
509
|
+
const existing = __classPrivateFieldGet(this, _preservedGroups)[groupName] || __classPrivateFieldGet(this, _groups)[groupName];
|
510
|
+
if (__classPrivateFieldGet(this, _preservedGroups)[groupName]) {
|
511
|
+
delete __classPrivateFieldGet(this, _preservedGroups)[groupName];
|
512
|
+
}
|
513
|
+
const seen = {};
|
514
|
+
__classPrivateFieldGet(this, _groups)[groupName] = (existing || []).concat(opts).filter(key => {
|
515
|
+
if (seen[key])
|
516
|
+
return false;
|
517
|
+
return (seen[key] = true);
|
518
|
+
});
|
519
|
+
return this;
|
520
|
+
}
|
521
|
+
hide(key) {
|
522
|
+
argsert('<string>', [key], arguments.length);
|
523
|
+
__classPrivateFieldGet(this, _options).hiddenOptions.push(key);
|
524
|
+
return this;
|
525
|
+
}
|
526
|
+
implies(key, value) {
|
527
|
+
argsert('<string|object> [number|string|array]', [key, value], arguments.length);
|
528
|
+
__classPrivateFieldGet(this, _validation).implies(key, value);
|
529
|
+
return this;
|
530
|
+
}
|
531
|
+
locale(locale) {
|
532
|
+
argsert('[string]', [locale], arguments.length);
|
533
|
+
if (!locale) {
|
534
|
+
this[kGuessLocale]();
|
535
|
+
return __classPrivateFieldGet(this, _shim_1).y18n.getLocale();
|
536
|
+
}
|
537
|
+
__classPrivateFieldSet(this, _detectLocale, false);
|
538
|
+
__classPrivateFieldGet(this, _shim_1).y18n.setLocale(locale);
|
539
|
+
return this;
|
540
|
+
}
|
541
|
+
middleware(callback, applyBeforeValidation, global) {
|
542
|
+
return __classPrivateFieldGet(this, _globalMiddleware).addMiddleware(callback, !!applyBeforeValidation, global);
|
543
|
+
}
|
544
|
+
nargs(key, value) {
|
545
|
+
argsert('<string|object|array> [number]', [key, value], arguments.length);
|
546
|
+
this[kPopulateParserHintSingleValueDictionary](this.nargs.bind(this), 'narg', key, value);
|
547
|
+
return this;
|
548
|
+
}
|
549
|
+
normalize(keys) {
|
550
|
+
argsert('<array|string>', [keys], arguments.length);
|
551
|
+
this[kPopulateParserHintArray]('normalize', keys);
|
552
|
+
return this;
|
553
|
+
}
|
554
|
+
number(keys) {
|
555
|
+
argsert('<array|string>', [keys], arguments.length);
|
556
|
+
this[kPopulateParserHintArray]('number', keys);
|
557
|
+
return this;
|
558
|
+
}
|
559
|
+
option(key, opt) {
|
560
|
+
argsert('<string|object> [object]', [key, opt], arguments.length);
|
561
|
+
if (typeof key === 'object') {
|
562
|
+
Object.keys(key).forEach(k => {
|
563
|
+
this.options(k, key[k]);
|
564
|
+
});
|
565
|
+
}
|
566
|
+
else {
|
567
|
+
if (typeof opt !== 'object') {
|
568
|
+
opt = {};
|
569
|
+
}
|
570
|
+
__classPrivateFieldGet(this, _options).key[key] = true;
|
571
|
+
if (opt.alias)
|
572
|
+
this.alias(key, opt.alias);
|
573
|
+
const deprecate = opt.deprecate || opt.deprecated;
|
574
|
+
if (deprecate) {
|
575
|
+
this.deprecateOption(key, deprecate);
|
576
|
+
}
|
577
|
+
const demand = opt.demand || opt.required || opt.require;
|
578
|
+
if (demand) {
|
579
|
+
this.demand(key, demand);
|
580
|
+
}
|
581
|
+
if (opt.demandOption) {
|
582
|
+
this.demandOption(key, typeof opt.demandOption === 'string' ? opt.demandOption : undefined);
|
583
|
+
}
|
584
|
+
if (opt.conflicts) {
|
585
|
+
this.conflicts(key, opt.conflicts);
|
586
|
+
}
|
587
|
+
if ('default' in opt) {
|
588
|
+
this.default(key, opt.default);
|
589
|
+
}
|
590
|
+
if (opt.implies !== undefined) {
|
591
|
+
this.implies(key, opt.implies);
|
592
|
+
}
|
593
|
+
if (opt.nargs !== undefined) {
|
594
|
+
this.nargs(key, opt.nargs);
|
595
|
+
}
|
596
|
+
if (opt.config) {
|
597
|
+
this.config(key, opt.configParser);
|
598
|
+
}
|
599
|
+
if (opt.normalize) {
|
600
|
+
this.normalize(key);
|
601
|
+
}
|
602
|
+
if (opt.choices) {
|
603
|
+
this.choices(key, opt.choices);
|
604
|
+
}
|
605
|
+
if (opt.coerce) {
|
606
|
+
this.coerce(key, opt.coerce);
|
607
|
+
}
|
608
|
+
if (opt.group) {
|
609
|
+
this.group(key, opt.group);
|
610
|
+
}
|
611
|
+
if (opt.boolean || opt.type === 'boolean') {
|
612
|
+
this.boolean(key);
|
613
|
+
if (opt.alias)
|
614
|
+
this.boolean(opt.alias);
|
615
|
+
}
|
616
|
+
if (opt.array || opt.type === 'array') {
|
617
|
+
this.array(key);
|
618
|
+
if (opt.alias)
|
619
|
+
this.array(opt.alias);
|
620
|
+
}
|
621
|
+
if (opt.number || opt.type === 'number') {
|
622
|
+
this.number(key);
|
623
|
+
if (opt.alias)
|
624
|
+
this.number(opt.alias);
|
625
|
+
}
|
626
|
+
if (opt.string || opt.type === 'string') {
|
627
|
+
this.string(key);
|
628
|
+
if (opt.alias)
|
629
|
+
this.string(opt.alias);
|
630
|
+
}
|
631
|
+
if (opt.count || opt.type === 'count') {
|
632
|
+
this.count(key);
|
633
|
+
}
|
634
|
+
if (typeof opt.global === 'boolean') {
|
635
|
+
this.global(key, opt.global);
|
636
|
+
}
|
637
|
+
if (opt.defaultDescription) {
|
638
|
+
__classPrivateFieldGet(this, _options).defaultDescription[key] = opt.defaultDescription;
|
639
|
+
}
|
640
|
+
if (opt.skipValidation) {
|
641
|
+
this.skipValidation(key);
|
642
|
+
}
|
643
|
+
const desc = opt.describe || opt.description || opt.desc;
|
644
|
+
this.describe(key, desc);
|
645
|
+
if (opt.hidden) {
|
646
|
+
this.hide(key);
|
647
|
+
}
|
648
|
+
if (opt.requiresArg) {
|
649
|
+
this.requiresArg(key);
|
650
|
+
}
|
651
|
+
}
|
652
|
+
return this;
|
653
|
+
}
|
654
|
+
options(key, opt) {
|
655
|
+
return this.option(key, opt);
|
656
|
+
}
|
657
|
+
parse(args, shortCircuit, _parseFn) {
|
658
|
+
argsert('[string|array] [function|boolean|object] [function]', [args, shortCircuit, _parseFn], arguments.length);
|
659
|
+
this[kFreeze]();
|
660
|
+
if (typeof args === 'undefined') {
|
661
|
+
args = __classPrivateFieldGet(this, _processArgs);
|
662
|
+
}
|
663
|
+
if (typeof shortCircuit === 'object') {
|
664
|
+
__classPrivateFieldSet(this, _parseContext, shortCircuit);
|
665
|
+
shortCircuit = _parseFn;
|
666
|
+
}
|
667
|
+
if (typeof shortCircuit === 'function') {
|
668
|
+
__classPrivateFieldSet(this, _parseFn_1, shortCircuit);
|
669
|
+
shortCircuit = false;
|
670
|
+
}
|
671
|
+
if (!shortCircuit)
|
672
|
+
__classPrivateFieldSet(this, _processArgs, args);
|
673
|
+
if (__classPrivateFieldGet(this, _parseFn_1))
|
674
|
+
__classPrivateFieldSet(this, _exitProcess, false);
|
675
|
+
const parsed = this[kRunYargsParserAndExecuteCommands](args, !!shortCircuit);
|
676
|
+
const tmpParsed = this.parsed;
|
677
|
+
__classPrivateFieldGet(this, _completion).setParsed(this.parsed);
|
678
|
+
if (isPromise(parsed)) {
|
679
|
+
return parsed
|
680
|
+
.then(argv => {
|
681
|
+
if (__classPrivateFieldGet(this, _parseFn_1))
|
682
|
+
__classPrivateFieldGet(this, _parseFn_1).call(this, __classPrivateFieldGet(this, _exitError), argv, __classPrivateFieldGet(this, _output));
|
683
|
+
return argv;
|
684
|
+
})
|
685
|
+
.catch(err => {
|
686
|
+
if (__classPrivateFieldGet(this, _parseFn_1)) {
|
687
|
+
__classPrivateFieldGet(this, _parseFn_1)(err, this.parsed.argv, __classPrivateFieldGet(this, _output));
|
688
|
+
}
|
689
|
+
throw err;
|
690
|
+
})
|
691
|
+
.finally(() => {
|
692
|
+
this[kUnfreeze]();
|
693
|
+
this.parsed = tmpParsed;
|
694
|
+
});
|
695
|
+
}
|
696
|
+
else {
|
697
|
+
if (__classPrivateFieldGet(this, _parseFn_1))
|
698
|
+
__classPrivateFieldGet(this, _parseFn_1).call(this, __classPrivateFieldGet(this, _exitError), parsed, __classPrivateFieldGet(this, _output));
|
699
|
+
this[kUnfreeze]();
|
700
|
+
this.parsed = tmpParsed;
|
701
|
+
}
|
702
|
+
return parsed;
|
703
|
+
}
|
704
|
+
parseAsync(args, shortCircuit, _parseFn) {
|
705
|
+
const maybePromise = this.parse(args, shortCircuit, _parseFn);
|
706
|
+
if (!isPromise(maybePromise)) {
|
707
|
+
return Promise.resolve(maybePromise);
|
708
|
+
}
|
709
|
+
else {
|
710
|
+
return maybePromise;
|
711
|
+
}
|
712
|
+
}
|
713
|
+
parseSync(args, shortCircuit, _parseFn) {
|
714
|
+
const maybePromise = this.parse(args, shortCircuit, _parseFn);
|
715
|
+
if (isPromise(maybePromise)) {
|
716
|
+
throw new YError('.parseSync() must not be used with asynchronous builders, handlers, or middleware');
|
717
|
+
}
|
718
|
+
return maybePromise;
|
719
|
+
}
|
720
|
+
parserConfiguration(config) {
|
721
|
+
argsert('<object>', [config], arguments.length);
|
722
|
+
__classPrivateFieldSet(this, _parserConfig, config);
|
723
|
+
return this;
|
724
|
+
}
|
725
|
+
pkgConf(key, rootPath) {
|
726
|
+
argsert('<string> [string]', [key, rootPath], arguments.length);
|
727
|
+
let conf = null;
|
728
|
+
const obj = this[kPkgUp](rootPath || __classPrivateFieldGet(this, _cwd));
|
729
|
+
if (obj[key] && typeof obj[key] === 'object') {
|
730
|
+
conf = applyExtends(obj[key], rootPath || __classPrivateFieldGet(this, _cwd), this[kGetParserConfiguration]()['deep-merge-config'] || false, __classPrivateFieldGet(this, _shim_1));
|
731
|
+
__classPrivateFieldGet(this, _options).configObjects = (__classPrivateFieldGet(this, _options).configObjects || []).concat(conf);
|
732
|
+
}
|
733
|
+
return this;
|
734
|
+
}
|
735
|
+
positional(key, opts) {
|
736
|
+
argsert('<string> <object>', [key, opts], arguments.length);
|
737
|
+
const supportedOpts = [
|
738
|
+
'default',
|
739
|
+
'defaultDescription',
|
740
|
+
'implies',
|
741
|
+
'normalize',
|
742
|
+
'choices',
|
743
|
+
'conflicts',
|
744
|
+
'coerce',
|
745
|
+
'type',
|
746
|
+
'describe',
|
747
|
+
'desc',
|
748
|
+
'description',
|
749
|
+
'alias',
|
750
|
+
];
|
751
|
+
opts = objFilter(opts, (k, v) => {
|
752
|
+
let accept = supportedOpts.indexOf(k) !== -1;
|
753
|
+
if (k === 'type' && ['string', 'number', 'boolean'].indexOf(v) === -1)
|
754
|
+
accept = false;
|
755
|
+
return accept;
|
756
|
+
});
|
757
|
+
const fullCommand = __classPrivateFieldGet(this, _context).fullCommands[__classPrivateFieldGet(this, _context).fullCommands.length - 1];
|
758
|
+
const parseOptions = fullCommand
|
759
|
+
? __classPrivateFieldGet(this, _command).cmdToParseOptions(fullCommand)
|
760
|
+
: {
|
761
|
+
array: [],
|
762
|
+
alias: {},
|
763
|
+
default: {},
|
764
|
+
demand: {},
|
765
|
+
};
|
766
|
+
objectKeys(parseOptions).forEach(pk => {
|
767
|
+
const parseOption = parseOptions[pk];
|
768
|
+
if (Array.isArray(parseOption)) {
|
769
|
+
if (parseOption.indexOf(key) !== -1)
|
770
|
+
opts[pk] = true;
|
771
|
+
}
|
772
|
+
else {
|
773
|
+
if (parseOption[key] && !(pk in opts))
|
774
|
+
opts[pk] = parseOption[key];
|
775
|
+
}
|
776
|
+
});
|
777
|
+
this.group(key, __classPrivateFieldGet(this, _usage).getPositionalGroupName());
|
778
|
+
return this.option(key, opts);
|
779
|
+
}
|
780
|
+
recommendCommands(recommend = true) {
|
781
|
+
argsert('[boolean]', [recommend], arguments.length);
|
782
|
+
__classPrivateFieldSet(this, _recommendCommands, recommend);
|
783
|
+
return this;
|
784
|
+
}
|
785
|
+
required(keys, max, msg) {
|
786
|
+
return this.demand(keys, max, msg);
|
787
|
+
}
|
788
|
+
require(keys, max, msg) {
|
789
|
+
return this.demand(keys, max, msg);
|
790
|
+
}
|
791
|
+
requiresArg(keys) {
|
792
|
+
argsert('<array|string|object> [number]', [keys], arguments.length);
|
793
|
+
if (typeof keys === 'string' && __classPrivateFieldGet(this, _options).narg[keys]) {
|
794
|
+
return this;
|
795
|
+
}
|
796
|
+
else {
|
797
|
+
this[kPopulateParserHintSingleValueDictionary](this.requiresArg.bind(this), 'narg', keys, NaN);
|
798
|
+
}
|
799
|
+
return this;
|
800
|
+
}
|
801
|
+
showCompletionScript($0, cmd) {
|
802
|
+
argsert('[string] [string]', [$0, cmd], arguments.length);
|
803
|
+
$0 = $0 || this.$0;
|
804
|
+
__classPrivateFieldGet(this, _logger).log(__classPrivateFieldGet(this, _completion).generateCompletionScript($0, cmd || __classPrivateFieldGet(this, _completionCommand) || 'completion'));
|
805
|
+
return this;
|
806
|
+
}
|
807
|
+
showHelp(level) {
|
808
|
+
argsert('[string|function]', [level], arguments.length);
|
809
|
+
__classPrivateFieldSet(this, _hasOutput, true);
|
810
|
+
if (!__classPrivateFieldGet(this, _usage).hasCachedHelpMessage()) {
|
811
|
+
if (!this.parsed) {
|
812
|
+
const parse = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _processArgs), undefined, undefined, 0, true);
|
813
|
+
if (isPromise(parse)) {
|
814
|
+
parse.then(() => {
|
815
|
+
__classPrivateFieldGet(this, _usage).showHelp(level);
|
816
|
+
});
|
817
|
+
return this;
|
818
|
+
}
|
819
|
+
}
|
820
|
+
const builderResponse = __classPrivateFieldGet(this, _command).runDefaultBuilderOn(this);
|
821
|
+
if (isPromise(builderResponse)) {
|
822
|
+
builderResponse.then(() => {
|
823
|
+
__classPrivateFieldGet(this, _usage).showHelp(level);
|
824
|
+
});
|
825
|
+
return this;
|
826
|
+
}
|
827
|
+
}
|
828
|
+
__classPrivateFieldGet(this, _usage).showHelp(level);
|
829
|
+
return this;
|
830
|
+
}
|
831
|
+
scriptName(scriptName) {
|
832
|
+
this.customScriptName = true;
|
833
|
+
this.$0 = scriptName;
|
834
|
+
return this;
|
835
|
+
}
|
836
|
+
showHelpOnFail(enabled, message) {
|
837
|
+
argsert('[boolean|string] [string]', [enabled, message], arguments.length);
|
838
|
+
__classPrivateFieldGet(this, _usage).showHelpOnFail(enabled, message);
|
839
|
+
return this;
|
840
|
+
}
|
841
|
+
showVersion(level) {
|
842
|
+
argsert('[string|function]', [level], arguments.length);
|
843
|
+
__classPrivateFieldGet(this, _usage).showVersion(level);
|
844
|
+
return this;
|
845
|
+
}
|
846
|
+
skipValidation(keys) {
|
847
|
+
argsert('<array|string>', [keys], arguments.length);
|
848
|
+
this[kPopulateParserHintArray]('skipValidation', keys);
|
849
|
+
return this;
|
850
|
+
}
|
851
|
+
strict(enabled) {
|
852
|
+
argsert('[boolean]', [enabled], arguments.length);
|
853
|
+
__classPrivateFieldSet(this, _strict, enabled !== false);
|
854
|
+
return this;
|
855
|
+
}
|
856
|
+
strictCommands(enabled) {
|
857
|
+
argsert('[boolean]', [enabled], arguments.length);
|
858
|
+
__classPrivateFieldSet(this, _strictCommands, enabled !== false);
|
859
|
+
return this;
|
860
|
+
}
|
861
|
+
strictOptions(enabled) {
|
862
|
+
argsert('[boolean]', [enabled], arguments.length);
|
863
|
+
__classPrivateFieldSet(this, _strictOptions, enabled !== false);
|
864
|
+
return this;
|
865
|
+
}
|
866
|
+
string(key) {
|
867
|
+
argsert('<array|string>', [key], arguments.length);
|
868
|
+
this[kPopulateParserHintArray]('string', key);
|
869
|
+
return this;
|
870
|
+
}
|
871
|
+
terminalWidth() {
|
872
|
+
argsert([], 0);
|
873
|
+
return __classPrivateFieldGet(this, _shim_1).process.stdColumns;
|
874
|
+
}
|
875
|
+
updateLocale(obj) {
|
876
|
+
return this.updateStrings(obj);
|
877
|
+
}
|
878
|
+
updateStrings(obj) {
|
879
|
+
argsert('<object>', [obj], arguments.length);
|
880
|
+
__classPrivateFieldSet(this, _detectLocale, false);
|
881
|
+
__classPrivateFieldGet(this, _shim_1).y18n.updateLocale(obj);
|
882
|
+
return this;
|
883
|
+
}
|
884
|
+
usage(msg, description, builder, handler) {
|
885
|
+
argsert('<string|null|undefined> [string|boolean] [function|object] [function]', [msg, description, builder, handler], arguments.length);
|
886
|
+
if (description !== undefined) {
|
887
|
+
assertNotStrictEqual(msg, null, __classPrivateFieldGet(this, _shim_1));
|
888
|
+
if ((msg || '').match(/^\$0( |$)/)) {
|
889
|
+
return this.command(msg, description, builder, handler);
|
890
|
+
}
|
891
|
+
else {
|
892
|
+
throw new YError('.usage() description must start with $0 if being used as alias for .command()');
|
893
|
+
}
|
894
|
+
}
|
895
|
+
else {
|
896
|
+
__classPrivateFieldGet(this, _usage).usage(msg);
|
897
|
+
return this;
|
898
|
+
}
|
899
|
+
}
|
900
|
+
version(opt, msg, ver) {
|
901
|
+
const defaultVersionOpt = 'version';
|
902
|
+
argsert('[boolean|string] [string] [string]', [opt, msg, ver], arguments.length);
|
903
|
+
if (__classPrivateFieldGet(this, _versionOpt)) {
|
904
|
+
this[kDeleteFromParserHintObject](__classPrivateFieldGet(this, _versionOpt));
|
905
|
+
__classPrivateFieldGet(this, _usage).version(undefined);
|
906
|
+
__classPrivateFieldSet(this, _versionOpt, null);
|
907
|
+
}
|
908
|
+
if (arguments.length === 0) {
|
909
|
+
ver = this[kGuessVersion]();
|
910
|
+
opt = defaultVersionOpt;
|
911
|
+
}
|
912
|
+
else if (arguments.length === 1) {
|
913
|
+
if (opt === false) {
|
914
|
+
return this;
|
915
|
+
}
|
916
|
+
ver = opt;
|
917
|
+
opt = defaultVersionOpt;
|
918
|
+
}
|
919
|
+
else if (arguments.length === 2) {
|
920
|
+
ver = msg;
|
921
|
+
msg = undefined;
|
922
|
+
}
|
923
|
+
__classPrivateFieldSet(this, _versionOpt, typeof opt === 'string' ? opt : defaultVersionOpt);
|
924
|
+
msg = msg || __classPrivateFieldGet(this, _usage).deferY18nLookup('Show version number');
|
925
|
+
__classPrivateFieldGet(this, _usage).version(ver || undefined);
|
926
|
+
this.boolean(__classPrivateFieldGet(this, _versionOpt));
|
927
|
+
this.describe(__classPrivateFieldGet(this, _versionOpt), msg);
|
928
|
+
return this;
|
929
|
+
}
|
930
|
+
wrap(cols) {
|
931
|
+
argsert('<number|null|undefined>', [cols], arguments.length);
|
932
|
+
__classPrivateFieldGet(this, _usage).wrap(cols);
|
933
|
+
return this;
|
934
|
+
}
|
935
|
+
[(_command = new WeakMap(), _cwd = new WeakMap(), _context = new WeakMap(), _completion = new WeakMap(), _completionCommand = new WeakMap(), _defaultShowHiddenOpt = new WeakMap(), _exitError = new WeakMap(), _detectLocale = new WeakMap(), _exitProcess = new WeakMap(), _frozens = new WeakMap(), _globalMiddleware = new WeakMap(), _groups = new WeakMap(), _hasOutput = new WeakMap(), _helpOpt = new WeakMap(), _logger = new WeakMap(), _output = new WeakMap(), _options = new WeakMap(), _parentRequire = new WeakMap(), _parserConfig = new WeakMap(), _parseFn_1 = new WeakMap(), _parseContext = new WeakMap(), _pkgs = new WeakMap(), _preservedGroups = new WeakMap(), _processArgs = new WeakMap(), _recommendCommands = new WeakMap(), _shim_1 = new WeakMap(), _strict = new WeakMap(), _strictCommands = new WeakMap(), _strictOptions = new WeakMap(), _usage = new WeakMap(), _versionOpt = new WeakMap(), _validation = new WeakMap(), kCopyDoubleDash)](argv) {
|
936
|
+
if (!argv._ || !argv['--'])
|
937
|
+
return argv;
|
938
|
+
argv._.push.apply(argv._, argv['--']);
|
939
|
+
try {
|
940
|
+
delete argv['--'];
|
941
|
+
}
|
942
|
+
catch (_err) { }
|
943
|
+
return argv;
|
944
|
+
}
|
945
|
+
[kCreateLogger]() {
|
946
|
+
return {
|
947
|
+
log: (...args) => {
|
948
|
+
if (!this[kHasParseCallback]())
|
949
|
+
console.log(...args);
|
950
|
+
__classPrivateFieldSet(this, _hasOutput, true);
|
951
|
+
if (__classPrivateFieldGet(this, _output).length)
|
952
|
+
__classPrivateFieldSet(this, _output, __classPrivateFieldGet(this, _output) + '\n');
|
953
|
+
__classPrivateFieldSet(this, _output, __classPrivateFieldGet(this, _output) + args.join(' '));
|
954
|
+
},
|
955
|
+
error: (...args) => {
|
956
|
+
if (!this[kHasParseCallback]())
|
957
|
+
console.error(...args);
|
958
|
+
__classPrivateFieldSet(this, _hasOutput, true);
|
959
|
+
if (__classPrivateFieldGet(this, _output).length)
|
960
|
+
__classPrivateFieldSet(this, _output, __classPrivateFieldGet(this, _output) + '\n');
|
961
|
+
__classPrivateFieldSet(this, _output, __classPrivateFieldGet(this, _output) + args.join(' '));
|
962
|
+
},
|
963
|
+
};
|
964
|
+
}
|
965
|
+
[kDeleteFromParserHintObject](optionKey) {
|
966
|
+
objectKeys(__classPrivateFieldGet(this, _options)).forEach((hintKey) => {
|
967
|
+
if (((key) => key === 'configObjects')(hintKey))
|
968
|
+
return;
|
969
|
+
const hint = __classPrivateFieldGet(this, _options)[hintKey];
|
970
|
+
if (Array.isArray(hint)) {
|
971
|
+
if (~hint.indexOf(optionKey))
|
972
|
+
hint.splice(hint.indexOf(optionKey), 1);
|
973
|
+
}
|
974
|
+
else if (typeof hint === 'object') {
|
975
|
+
delete hint[optionKey];
|
976
|
+
}
|
977
|
+
});
|
978
|
+
delete __classPrivateFieldGet(this, _usage).getDescriptions()[optionKey];
|
979
|
+
}
|
980
|
+
[kFreeze]() {
|
981
|
+
__classPrivateFieldGet(this, _frozens).push({
|
982
|
+
options: __classPrivateFieldGet(this, _options),
|
983
|
+
configObjects: __classPrivateFieldGet(this, _options).configObjects.slice(0),
|
984
|
+
exitProcess: __classPrivateFieldGet(this, _exitProcess),
|
985
|
+
groups: __classPrivateFieldGet(this, _groups),
|
986
|
+
strict: __classPrivateFieldGet(this, _strict),
|
987
|
+
strictCommands: __classPrivateFieldGet(this, _strictCommands),
|
988
|
+
strictOptions: __classPrivateFieldGet(this, _strictOptions),
|
989
|
+
completionCommand: __classPrivateFieldGet(this, _completionCommand),
|
990
|
+
output: __classPrivateFieldGet(this, _output),
|
991
|
+
exitError: __classPrivateFieldGet(this, _exitError),
|
992
|
+
hasOutput: __classPrivateFieldGet(this, _hasOutput),
|
993
|
+
parsed: this.parsed,
|
994
|
+
parseFn: __classPrivateFieldGet(this, _parseFn_1),
|
995
|
+
parseContext: __classPrivateFieldGet(this, _parseContext),
|
996
|
+
});
|
997
|
+
__classPrivateFieldGet(this, _usage).freeze();
|
998
|
+
__classPrivateFieldGet(this, _validation).freeze();
|
999
|
+
__classPrivateFieldGet(this, _command).freeze();
|
1000
|
+
__classPrivateFieldGet(this, _globalMiddleware).freeze();
|
1001
|
+
}
|
1002
|
+
[kGetDollarZero]() {
|
1003
|
+
let $0 = '';
|
1004
|
+
let default$0;
|
1005
|
+
if (/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this, _shim_1).process.argv()[0])) {
|
1006
|
+
default$0 = __classPrivateFieldGet(this, _shim_1).process.argv().slice(1, 2);
|
1007
|
+
}
|
1008
|
+
else {
|
1009
|
+
default$0 = __classPrivateFieldGet(this, _shim_1).process.argv().slice(0, 1);
|
1010
|
+
}
|
1011
|
+
$0 = default$0
|
1012
|
+
.map(x => {
|
1013
|
+
const b = this[kRebase](__classPrivateFieldGet(this, _cwd), x);
|
1014
|
+
return x.match(/^(\/|([a-zA-Z]:)?\\)/) && b.length < x.length ? b : x;
|
1015
|
+
})
|
1016
|
+
.join(' ')
|
1017
|
+
.trim();
|
1018
|
+
if (__classPrivateFieldGet(this, _shim_1).getEnv('_') &&
|
1019
|
+
__classPrivateFieldGet(this, _shim_1).getProcessArgvBin() === __classPrivateFieldGet(this, _shim_1).getEnv('_')) {
|
1020
|
+
$0 = __classPrivateFieldGet(this, _shim_1).getEnv('_')
|
1021
|
+
.replace(`${__classPrivateFieldGet(this, _shim_1).path.dirname(__classPrivateFieldGet(this, _shim_1).process.execPath())}/`, '');
|
1022
|
+
}
|
1023
|
+
return $0;
|
1024
|
+
}
|
1025
|
+
[kGetParserConfiguration]() {
|
1026
|
+
return __classPrivateFieldGet(this, _parserConfig);
|
1027
|
+
}
|
1028
|
+
[kGuessLocale]() {
|
1029
|
+
if (!__classPrivateFieldGet(this, _detectLocale))
|
1030
|
+
return;
|
1031
|
+
const locale = __classPrivateFieldGet(this, _shim_1).getEnv('LC_ALL') ||
|
1032
|
+
__classPrivateFieldGet(this, _shim_1).getEnv('LC_MESSAGES') ||
|
1033
|
+
__classPrivateFieldGet(this, _shim_1).getEnv('LANG') ||
|
1034
|
+
__classPrivateFieldGet(this, _shim_1).getEnv('LANGUAGE') ||
|
1035
|
+
'en_US';
|
1036
|
+
this.locale(locale.replace(/[.:].*/, ''));
|
1037
|
+
}
|
1038
|
+
[kGuessVersion]() {
|
1039
|
+
const obj = this[kPkgUp]();
|
1040
|
+
return obj.version || 'unknown';
|
1041
|
+
}
|
1042
|
+
[kParsePositionalNumbers](argv) {
|
1043
|
+
const args = argv['--'] ? argv['--'] : argv._;
|
1044
|
+
for (let i = 0, arg; (arg = args[i]) !== undefined; i++) {
|
1045
|
+
if (__classPrivateFieldGet(this, _shim_1).Parser.looksLikeNumber(arg) &&
|
1046
|
+
Number.isSafeInteger(Math.floor(parseFloat(`${arg}`)))) {
|
1047
|
+
args[i] = Number(arg);
|
1048
|
+
}
|
1049
|
+
}
|
1050
|
+
return argv;
|
1051
|
+
}
|
1052
|
+
[kPkgUp](rootPath) {
|
1053
|
+
const npath = rootPath || '*';
|
1054
|
+
if (__classPrivateFieldGet(this, _pkgs)[npath])
|
1055
|
+
return __classPrivateFieldGet(this, _pkgs)[npath];
|
1056
|
+
let obj = {};
|
1057
|
+
try {
|
1058
|
+
let startDir = rootPath || __classPrivateFieldGet(this, _shim_1).mainFilename;
|
1059
|
+
if (!rootPath && __classPrivateFieldGet(this, _shim_1).path.extname(startDir)) {
|
1060
|
+
startDir = __classPrivateFieldGet(this, _shim_1).path.dirname(startDir);
|
1061
|
+
}
|
1062
|
+
const pkgJsonPath = __classPrivateFieldGet(this, _shim_1).findUp(startDir, (dir, names) => {
|
1063
|
+
if (names.includes('package.json')) {
|
1064
|
+
return 'package.json';
|
1065
|
+
}
|
1066
|
+
else {
|
1067
|
+
return undefined;
|
1068
|
+
}
|
1069
|
+
});
|
1070
|
+
assertNotStrictEqual(pkgJsonPath, undefined, __classPrivateFieldGet(this, _shim_1));
|
1071
|
+
obj = JSON.parse(__classPrivateFieldGet(this, _shim_1).readFileSync(pkgJsonPath, 'utf8'));
|
1072
|
+
}
|
1073
|
+
catch (_noop) { }
|
1074
|
+
__classPrivateFieldGet(this, _pkgs)[npath] = obj || {};
|
1075
|
+
return __classPrivateFieldGet(this, _pkgs)[npath];
|
1076
|
+
}
|
1077
|
+
[kPopulateParserHintArray](type, keys) {
|
1078
|
+
keys = [].concat(keys);
|
1079
|
+
keys.forEach(key => {
|
1080
|
+
key = this[kSanitizeKey](key);
|
1081
|
+
__classPrivateFieldGet(this, _options)[type].push(key);
|
1082
|
+
});
|
1083
|
+
}
|
1084
|
+
[kPopulateParserHintSingleValueDictionary](builder, type, key, value) {
|
1085
|
+
this[kPopulateParserHintDictionary](builder, type, key, value, (type, key, value) => {
|
1086
|
+
__classPrivateFieldGet(this, _options)[type][key] = value;
|
1087
|
+
});
|
1088
|
+
}
|
1089
|
+
[kPopulateParserHintArrayDictionary](builder, type, key, value) {
|
1090
|
+
this[kPopulateParserHintDictionary](builder, type, key, value, (type, key, value) => {
|
1091
|
+
__classPrivateFieldGet(this, _options)[type][key] = (__classPrivateFieldGet(this, _options)[type][key] || []).concat(value);
|
1092
|
+
});
|
1093
|
+
}
|
1094
|
+
[kPopulateParserHintDictionary](builder, type, key, value, singleKeyHandler) {
|
1095
|
+
if (Array.isArray(key)) {
|
1096
|
+
key.forEach(k => {
|
1097
|
+
builder(k, value);
|
1098
|
+
});
|
1099
|
+
}
|
1100
|
+
else if (((key) => typeof key === 'object')(key)) {
|
1101
|
+
for (const k of objectKeys(key)) {
|
1102
|
+
builder(k, key[k]);
|
1103
|
+
}
|
1104
|
+
}
|
1105
|
+
else {
|
1106
|
+
singleKeyHandler(type, this[kSanitizeKey](key), value);
|
1107
|
+
}
|
1108
|
+
}
|
1109
|
+
[kSanitizeKey](key) {
|
1110
|
+
if (key === '__proto__')
|
1111
|
+
return '___proto___';
|
1112
|
+
return key;
|
1113
|
+
}
|
1114
|
+
[kSetKey](key, set) {
|
1115
|
+
this[kPopulateParserHintSingleValueDictionary](this[kSetKey].bind(this), 'key', key, set);
|
1116
|
+
return this;
|
1117
|
+
}
|
1118
|
+
[kUnfreeze]() {
|
1119
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
1120
|
+
const frozen = __classPrivateFieldGet(this, _frozens).pop();
|
1121
|
+
assertNotStrictEqual(frozen, undefined, __classPrivateFieldGet(this, _shim_1));
|
1122
|
+
let configObjects;
|
1123
|
+
(_a = this, _b = this, _c = this, _d = this, _e = this, _f = this, _g = this, _h = this, _j = this, _k = this, _l = this, _m = this, {
|
1124
|
+
options: ({ set value(_o) { __classPrivateFieldSet(_a, _options, _o); } }).value,
|
1125
|
+
configObjects,
|
1126
|
+
exitProcess: ({ set value(_o) { __classPrivateFieldSet(_b, _exitProcess, _o); } }).value,
|
1127
|
+
groups: ({ set value(_o) { __classPrivateFieldSet(_c, _groups, _o); } }).value,
|
1128
|
+
output: ({ set value(_o) { __classPrivateFieldSet(_d, _output, _o); } }).value,
|
1129
|
+
exitError: ({ set value(_o) { __classPrivateFieldSet(_e, _exitError, _o); } }).value,
|
1130
|
+
hasOutput: ({ set value(_o) { __classPrivateFieldSet(_f, _hasOutput, _o); } }).value,
|
1131
|
+
parsed: this.parsed,
|
1132
|
+
strict: ({ set value(_o) { __classPrivateFieldSet(_g, _strict, _o); } }).value,
|
1133
|
+
strictCommands: ({ set value(_o) { __classPrivateFieldSet(_h, _strictCommands, _o); } }).value,
|
1134
|
+
strictOptions: ({ set value(_o) { __classPrivateFieldSet(_j, _strictOptions, _o); } }).value,
|
1135
|
+
completionCommand: ({ set value(_o) { __classPrivateFieldSet(_k, _completionCommand, _o); } }).value,
|
1136
|
+
parseFn: ({ set value(_o) { __classPrivateFieldSet(_l, _parseFn_1, _o); } }).value,
|
1137
|
+
parseContext: ({ set value(_o) { __classPrivateFieldSet(_m, _parseContext, _o); } }).value,
|
1138
|
+
} = frozen);
|
1139
|
+
__classPrivateFieldGet(this, _options).configObjects = configObjects;
|
1140
|
+
__classPrivateFieldGet(this, _usage).unfreeze();
|
1141
|
+
__classPrivateFieldGet(this, _validation).unfreeze();
|
1142
|
+
__classPrivateFieldGet(this, _command).unfreeze();
|
1143
|
+
__classPrivateFieldGet(this, _globalMiddleware).unfreeze();
|
1144
|
+
}
|
1145
|
+
[kValidateAsync](validation, argv) {
|
1146
|
+
return maybeAsyncResult(argv, result => {
|
1147
|
+
validation(result);
|
1148
|
+
return result;
|
1149
|
+
});
|
1150
|
+
}
|
1151
|
+
getInternalMethods() {
|
1152
|
+
return {
|
1153
|
+
getCommandInstance: this[kGetCommandInstance].bind(this),
|
1154
|
+
getContext: this[kGetContext].bind(this),
|
1155
|
+
getHasOutput: this[kGetHasOutput].bind(this),
|
1156
|
+
getLoggerInstance: this[kGetLoggerInstance].bind(this),
|
1157
|
+
getParseContext: this[kGetParseContext].bind(this),
|
1158
|
+
getParserConfiguration: this[kGetParserConfiguration].bind(this),
|
1159
|
+
getUsageInstance: this[kGetUsageInstance].bind(this),
|
1160
|
+
getValidationInstance: this[kGetValidationInstance].bind(this),
|
1161
|
+
hasParseCallback: this[kHasParseCallback].bind(this),
|
1162
|
+
postProcess: this[kPostProcess].bind(this),
|
1163
|
+
reset: this[kReset].bind(this),
|
1164
|
+
runValidation: this[kRunValidation].bind(this),
|
1165
|
+
runYargsParserAndExecuteCommands: this[kRunYargsParserAndExecuteCommands].bind(this),
|
1166
|
+
setHasOutput: this[kSetHasOutput].bind(this),
|
1167
|
+
};
|
1168
|
+
}
|
1169
|
+
[kGetCommandInstance]() {
|
1170
|
+
return __classPrivateFieldGet(this, _command);
|
1171
|
+
}
|
1172
|
+
[kGetContext]() {
|
1173
|
+
return __classPrivateFieldGet(this, _context);
|
1174
|
+
}
|
1175
|
+
[kGetHasOutput]() {
|
1176
|
+
return __classPrivateFieldGet(this, _hasOutput);
|
1177
|
+
}
|
1178
|
+
[kGetLoggerInstance]() {
|
1179
|
+
return __classPrivateFieldGet(this, _logger);
|
1180
|
+
}
|
1181
|
+
[kGetParseContext]() {
|
1182
|
+
return __classPrivateFieldGet(this, _parseContext) || {};
|
1183
|
+
}
|
1184
|
+
[kGetUsageInstance]() {
|
1185
|
+
return __classPrivateFieldGet(this, _usage);
|
1186
|
+
}
|
1187
|
+
[kGetValidationInstance]() {
|
1188
|
+
return __classPrivateFieldGet(this, _validation);
|
1189
|
+
}
|
1190
|
+
[kHasParseCallback]() {
|
1191
|
+
return !!__classPrivateFieldGet(this, _parseFn_1);
|
1192
|
+
}
|
1193
|
+
[kPostProcess](argv, populateDoubleDash, calledFromCommand, runGlobalMiddleware) {
|
1194
|
+
if (calledFromCommand)
|
1195
|
+
return argv;
|
1196
|
+
if (isPromise(argv))
|
1197
|
+
return argv;
|
1198
|
+
if (!populateDoubleDash) {
|
1199
|
+
argv = this[kCopyDoubleDash](argv);
|
1200
|
+
}
|
1201
|
+
const parsePositionalNumbers = this[kGetParserConfiguration]()['parse-positional-numbers'] ||
|
1202
|
+
this[kGetParserConfiguration]()['parse-positional-numbers'] === undefined;
|
1203
|
+
if (parsePositionalNumbers) {
|
1204
|
+
argv = this[kParsePositionalNumbers](argv);
|
1205
|
+
}
|
1206
|
+
if (runGlobalMiddleware) {
|
1207
|
+
argv = applyMiddleware(argv, this, __classPrivateFieldGet(this, _globalMiddleware).getMiddleware(), false);
|
1208
|
+
}
|
1209
|
+
return argv;
|
1210
|
+
}
|
1211
|
+
[kReset](aliases = {}) {
|
1212
|
+
__classPrivateFieldSet(this, _options, __classPrivateFieldGet(this, _options) || {});
|
1213
|
+
const tmpOptions = {};
|
1214
|
+
tmpOptions.local = __classPrivateFieldGet(this, _options).local ? __classPrivateFieldGet(this, _options).local : [];
|
1215
|
+
tmpOptions.configObjects = __classPrivateFieldGet(this, _options).configObjects
|
1216
|
+
? __classPrivateFieldGet(this, _options).configObjects
|
1217
|
+
: [];
|
1218
|
+
const localLookup = {};
|
1219
|
+
tmpOptions.local.forEach(l => {
|
1220
|
+
localLookup[l] = true;
|
1221
|
+
(aliases[l] || []).forEach(a => {
|
1222
|
+
localLookup[a] = true;
|
1223
|
+
});
|
1224
|
+
});
|
1225
|
+
Object.assign(__classPrivateFieldGet(this, _preservedGroups), Object.keys(__classPrivateFieldGet(this, _groups)).reduce((acc, groupName) => {
|
1226
|
+
const keys = __classPrivateFieldGet(this, _groups)[groupName].filter(key => !(key in localLookup));
|
1227
|
+
if (keys.length > 0) {
|
1228
|
+
acc[groupName] = keys;
|
1229
|
+
}
|
1230
|
+
return acc;
|
1231
|
+
}, {}));
|
1232
|
+
__classPrivateFieldSet(this, _groups, {});
|
1233
|
+
const arrayOptions = [
|
1234
|
+
'array',
|
1235
|
+
'boolean',
|
1236
|
+
'string',
|
1237
|
+
'skipValidation',
|
1238
|
+
'count',
|
1239
|
+
'normalize',
|
1240
|
+
'number',
|
1241
|
+
'hiddenOptions',
|
1242
|
+
];
|
1243
|
+
const objectOptions = [
|
1244
|
+
'narg',
|
1245
|
+
'key',
|
1246
|
+
'alias',
|
1247
|
+
'default',
|
1248
|
+
'defaultDescription',
|
1249
|
+
'config',
|
1250
|
+
'choices',
|
1251
|
+
'demandedOptions',
|
1252
|
+
'demandedCommands',
|
1253
|
+
'deprecatedOptions',
|
1254
|
+
];
|
1255
|
+
arrayOptions.forEach(k => {
|
1256
|
+
tmpOptions[k] = (__classPrivateFieldGet(this, _options)[k] || []).filter((k) => !localLookup[k]);
|
1257
|
+
});
|
1258
|
+
objectOptions.forEach((k) => {
|
1259
|
+
tmpOptions[k] = objFilter(__classPrivateFieldGet(this, _options)[k], k => !localLookup[k]);
|
1260
|
+
});
|
1261
|
+
tmpOptions.envPrefix = __classPrivateFieldGet(this, _options).envPrefix;
|
1262
|
+
__classPrivateFieldSet(this, _options, tmpOptions);
|
1263
|
+
__classPrivateFieldSet(this, _usage, __classPrivateFieldGet(this, _usage) ? __classPrivateFieldGet(this, _usage).reset(localLookup)
|
1264
|
+
: Usage(this, __classPrivateFieldGet(this, _shim_1)));
|
1265
|
+
__classPrivateFieldSet(this, _validation, __classPrivateFieldGet(this, _validation) ? __classPrivateFieldGet(this, _validation).reset(localLookup)
|
1266
|
+
: Validation(this, __classPrivateFieldGet(this, _usage), __classPrivateFieldGet(this, _shim_1)));
|
1267
|
+
__classPrivateFieldSet(this, _command, __classPrivateFieldGet(this, _command) ? __classPrivateFieldGet(this, _command).reset()
|
1268
|
+
: Command(__classPrivateFieldGet(this, _usage), __classPrivateFieldGet(this, _validation), __classPrivateFieldGet(this, _globalMiddleware), __classPrivateFieldGet(this, _shim_1)));
|
1269
|
+
if (!__classPrivateFieldGet(this, _completion))
|
1270
|
+
__classPrivateFieldSet(this, _completion, Completion(this, __classPrivateFieldGet(this, _usage), __classPrivateFieldGet(this, _command), __classPrivateFieldGet(this, _shim_1)));
|
1271
|
+
__classPrivateFieldGet(this, _globalMiddleware).reset();
|
1272
|
+
__classPrivateFieldSet(this, _completionCommand, null);
|
1273
|
+
__classPrivateFieldSet(this, _output, '');
|
1274
|
+
__classPrivateFieldSet(this, _exitError, null);
|
1275
|
+
__classPrivateFieldSet(this, _hasOutput, false);
|
1276
|
+
this.parsed = false;
|
1277
|
+
return this;
|
1278
|
+
}
|
1279
|
+
[kRebase](base, dir) {
|
1280
|
+
return __classPrivateFieldGet(this, _shim_1).path.relative(base, dir);
|
1281
|
+
}
|
1282
|
+
[kRunYargsParserAndExecuteCommands](args, shortCircuit, calledFromCommand, commandIndex = 0, helpOnly = false) {
|
1283
|
+
let skipValidation = !!calledFromCommand || helpOnly;
|
1284
|
+
args = args || __classPrivateFieldGet(this, _processArgs);
|
1285
|
+
__classPrivateFieldGet(this, _options).__ = __classPrivateFieldGet(this, _shim_1).y18n.__;
|
1286
|
+
__classPrivateFieldGet(this, _options).configuration = this[kGetParserConfiguration]();
|
1287
|
+
const populateDoubleDash = !!__classPrivateFieldGet(this, _options).configuration['populate--'];
|
1288
|
+
const config = Object.assign({}, __classPrivateFieldGet(this, _options).configuration, {
|
1289
|
+
'populate--': true,
|
1290
|
+
});
|
1291
|
+
const parsed = __classPrivateFieldGet(this, _shim_1).Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _options), {
|
1292
|
+
configuration: { 'parse-positional-numbers': false, ...config },
|
1293
|
+
}));
|
1294
|
+
const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _parseContext));
|
1295
|
+
let argvPromise = undefined;
|
1296
|
+
const aliases = parsed.aliases;
|
1297
|
+
let helpOptSet = false;
|
1298
|
+
let versionOptSet = false;
|
1299
|
+
Object.keys(argv).forEach(key => {
|
1300
|
+
if (key === __classPrivateFieldGet(this, _helpOpt) && argv[key]) {
|
1301
|
+
helpOptSet = true;
|
1302
|
+
}
|
1303
|
+
else if (key === __classPrivateFieldGet(this, _versionOpt) && argv[key]) {
|
1304
|
+
versionOptSet = true;
|
1305
|
+
}
|
1306
|
+
});
|
1307
|
+
argv.$0 = this.$0;
|
1308
|
+
this.parsed = parsed;
|
1309
|
+
if (commandIndex === 0) {
|
1310
|
+
__classPrivateFieldGet(this, _usage).clearCachedHelpMessage();
|
1311
|
+
}
|
1312
|
+
try {
|
1313
|
+
this[kGuessLocale]();
|
1314
|
+
if (shortCircuit) {
|
1315
|
+
return this[kPostProcess](argv, populateDoubleDash, !!calledFromCommand, false);
|
1316
|
+
}
|
1317
|
+
if (__classPrivateFieldGet(this, _helpOpt)) {
|
1318
|
+
const helpCmds = [__classPrivateFieldGet(this, _helpOpt)]
|
1319
|
+
.concat(aliases[__classPrivateFieldGet(this, _helpOpt)] || [])
|
1320
|
+
.filter(k => k.length > 1);
|
1321
|
+
if (~helpCmds.indexOf('' + argv._[argv._.length - 1])) {
|
1322
|
+
argv._.pop();
|
1323
|
+
helpOptSet = true;
|
1324
|
+
}
|
1325
|
+
}
|
1326
|
+
const handlerKeys = __classPrivateFieldGet(this, _command).getCommands();
|
1327
|
+
const requestCompletions = __classPrivateFieldGet(this, _completion).completionKey in argv;
|
1328
|
+
const skipRecommendation = helpOptSet || requestCompletions || helpOnly;
|
1329
|
+
if (argv._.length) {
|
1330
|
+
if (handlerKeys.length) {
|
1331
|
+
let firstUnknownCommand;
|
1332
|
+
for (let i = commandIndex || 0, cmd; argv._[i] !== undefined; i++) {
|
1333
|
+
cmd = String(argv._[i]);
|
1334
|
+
if (~handlerKeys.indexOf(cmd) && cmd !== __classPrivateFieldGet(this, _completionCommand)) {
|
1335
|
+
const innerArgv = __classPrivateFieldGet(this, _command).runCommand(cmd, this, parsed, i + 1, helpOnly, helpOptSet || versionOptSet || helpOnly);
|
1336
|
+
return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false);
|
1337
|
+
}
|
1338
|
+
else if (!firstUnknownCommand &&
|
1339
|
+
cmd !== __classPrivateFieldGet(this, _completionCommand)) {
|
1340
|
+
firstUnknownCommand = cmd;
|
1341
|
+
break;
|
1342
|
+
}
|
1343
|
+
}
|
1344
|
+
if (!__classPrivateFieldGet(this, _command).hasDefaultCommand() && __classPrivateFieldGet(this, _recommendCommands) &&
|
1345
|
+
firstUnknownCommand &&
|
1346
|
+
!skipRecommendation) {
|
1347
|
+
__classPrivateFieldGet(this, _validation).recommendCommands(firstUnknownCommand, handlerKeys);
|
1348
|
+
}
|
1349
|
+
}
|
1350
|
+
if (__classPrivateFieldGet(this, _completionCommand) &&
|
1351
|
+
~argv._.indexOf(__classPrivateFieldGet(this, _completionCommand)) &&
|
1352
|
+
!requestCompletions) {
|
1353
|
+
if (__classPrivateFieldGet(this, _exitProcess))
|
1354
|
+
setBlocking(true);
|
1355
|
+
this.showCompletionScript();
|
1356
|
+
this.exit(0);
|
1357
|
+
}
|
1358
|
+
}
|
1359
|
+
if (__classPrivateFieldGet(this, _command).hasDefaultCommand() && !skipRecommendation) {
|
1360
|
+
const innerArgv = __classPrivateFieldGet(this, _command).runCommand(null, this, parsed, 0, helpOnly, helpOptSet || versionOptSet || helpOnly);
|
1361
|
+
return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false);
|
1362
|
+
}
|
1363
|
+
if (requestCompletions) {
|
1364
|
+
if (__classPrivateFieldGet(this, _exitProcess))
|
1365
|
+
setBlocking(true);
|
1366
|
+
args = [].concat(args);
|
1367
|
+
const completionArgs = args.slice(args.indexOf(`--${__classPrivateFieldGet(this, _completion).completionKey}`) + 1);
|
1368
|
+
__classPrivateFieldGet(this, _completion).getCompletion(completionArgs, (err, completions) => {
|
1369
|
+
if (err)
|
1370
|
+
throw new YError(err.message);
|
1371
|
+
(completions || []).forEach(completion => {
|
1372
|
+
__classPrivateFieldGet(this, _logger).log(completion);
|
1373
|
+
});
|
1374
|
+
this.exit(0);
|
1375
|
+
});
|
1376
|
+
return this[kPostProcess](argv, !populateDoubleDash, !!calledFromCommand, false);
|
1377
|
+
}
|
1378
|
+
if (!__classPrivateFieldGet(this, _hasOutput)) {
|
1379
|
+
if (helpOptSet) {
|
1380
|
+
if (__classPrivateFieldGet(this, _exitProcess))
|
1381
|
+
setBlocking(true);
|
1382
|
+
skipValidation = true;
|
1383
|
+
this.showHelp('log');
|
1384
|
+
this.exit(0);
|
1385
|
+
}
|
1386
|
+
else if (versionOptSet) {
|
1387
|
+
if (__classPrivateFieldGet(this, _exitProcess))
|
1388
|
+
setBlocking(true);
|
1389
|
+
skipValidation = true;
|
1390
|
+
__classPrivateFieldGet(this, _usage).showVersion('log');
|
1391
|
+
this.exit(0);
|
1392
|
+
}
|
1393
|
+
}
|
1394
|
+
if (!skipValidation && __classPrivateFieldGet(this, _options).skipValidation.length > 0) {
|
1395
|
+
skipValidation = Object.keys(argv).some(key => __classPrivateFieldGet(this, _options).skipValidation.indexOf(key) >= 0 && argv[key] === true);
|
1396
|
+
}
|
1397
|
+
if (!skipValidation) {
|
1398
|
+
if (parsed.error)
|
1399
|
+
throw new YError(parsed.error.message);
|
1400
|
+
if (!requestCompletions) {
|
1401
|
+
const validation = this[kRunValidation](aliases, {}, parsed.error);
|
1402
|
+
if (!calledFromCommand) {
|
1403
|
+
argvPromise = applyMiddleware(argv, this, __classPrivateFieldGet(this, _globalMiddleware).getMiddleware(), true);
|
1404
|
+
}
|
1405
|
+
argvPromise = this[kValidateAsync](validation, argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv);
|
1406
|
+
if (isPromise(argvPromise) && !calledFromCommand) {
|
1407
|
+
argvPromise = argvPromise.then(() => {
|
1408
|
+
return applyMiddleware(argv, this, __classPrivateFieldGet(this, _globalMiddleware).getMiddleware(), false);
|
1409
|
+
});
|
1410
|
+
}
|
1411
|
+
}
|
1412
|
+
}
|
1413
|
+
}
|
1414
|
+
catch (err) {
|
1415
|
+
if (err instanceof YError)
|
1416
|
+
__classPrivateFieldGet(this, _usage).fail(err.message, err);
|
1417
|
+
else
|
1418
|
+
throw err;
|
1419
|
+
}
|
1420
|
+
return this[kPostProcess](argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv, populateDoubleDash, !!calledFromCommand, true);
|
1421
|
+
}
|
1422
|
+
[kRunValidation](aliases, positionalMap, parseErrors, isDefaultCommand) {
|
1423
|
+
aliases = { ...aliases };
|
1424
|
+
positionalMap = { ...positionalMap };
|
1425
|
+
const demandedOptions = { ...this.getDemandedOptions() };
|
1426
|
+
return (argv) => {
|
1427
|
+
if (parseErrors)
|
1428
|
+
throw new YError(parseErrors.message);
|
1429
|
+
__classPrivateFieldGet(this, _validation).nonOptionCount(argv);
|
1430
|
+
__classPrivateFieldGet(this, _validation).requiredArguments(argv, demandedOptions);
|
1431
|
+
let failedStrictCommands = false;
|
1432
|
+
if (__classPrivateFieldGet(this, _strictCommands)) {
|
1433
|
+
failedStrictCommands = __classPrivateFieldGet(this, _validation).unknownCommands(argv);
|
1434
|
+
}
|
1435
|
+
if (__classPrivateFieldGet(this, _strict) && !failedStrictCommands) {
|
1436
|
+
__classPrivateFieldGet(this, _validation).unknownArguments(argv, aliases, positionalMap, !!isDefaultCommand);
|
1437
|
+
}
|
1438
|
+
else if (__classPrivateFieldGet(this, _strictOptions)) {
|
1439
|
+
__classPrivateFieldGet(this, _validation).unknownArguments(argv, aliases, {}, false, false);
|
1440
|
+
}
|
1441
|
+
__classPrivateFieldGet(this, _validation).limitedChoices(argv);
|
1442
|
+
__classPrivateFieldGet(this, _validation).implications(argv);
|
1443
|
+
__classPrivateFieldGet(this, _validation).conflicting(argv);
|
1444
|
+
};
|
1445
|
+
}
|
1446
|
+
[kSetHasOutput]() {
|
1447
|
+
__classPrivateFieldSet(this, _hasOutput, true);
|
1448
|
+
}
|
1449
|
+
}
|
1450
|
+
export function isYargsInstance(y) {
|
1451
|
+
return !!y && typeof y.getInternalMethods === 'function';
|
1452
|
+
}
|