@automattic/vip 4.1.4 → 4.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/dev-env.lando.template.yml.ejs +6 -2
- package/config/config.local.json +6 -0
- package/dist/bin/vip-config-software-get.js +9 -0
- package/dist/bin/vip-wp.js +128 -39
- package/dist/lib/client-file-uploader.js +34 -5
- package/dist/lib/config/software.js +42 -2
- package/dist/lib/dev-environment/dev-environment-cli.js +8 -5
- package/dist/lib/dev-environment/dev-environment-core.js +1 -1
- package/helpers/generate-docs.js +9 -3
- package/node_modules/@apollo/client/CHANGELOG.md +38 -0
- package/node_modules/@apollo/client/__cjs/cache/core/cache.cjs +1 -1
- package/node_modules/@apollo/client/__cjs/cache/core/cache.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/cache/core/cache.d.cts +4 -1
- package/node_modules/@apollo/client/__cjs/cache/core/types/Cache.d.cts +5 -0
- package/node_modules/@apollo/client/__cjs/cache/inmemory/entityStore.cjs +4 -4
- package/node_modules/@apollo/client/__cjs/cache/inmemory/inMemoryCache.cjs +15 -5
- package/node_modules/@apollo/client/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/cache/inmemory/inMemoryCache.d.cts +3 -1
- package/node_modules/@apollo/client/__cjs/cache/inmemory/key-extractor.cjs +1 -1
- package/node_modules/@apollo/client/__cjs/cache/inmemory/policies.cjs +5 -5
- package/node_modules/@apollo/client/__cjs/cache/inmemory/readFromStore.cjs +28 -10
- package/node_modules/@apollo/client/__cjs/cache/inmemory/readFromStore.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/cache/inmemory/types.d.cts +7 -2
- package/node_modules/@apollo/client/__cjs/cache/inmemory/writeToStore.cjs +29 -14
- package/node_modules/@apollo/client/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/cache/inmemory/writeToStore.d.cts +5 -2
- package/node_modules/@apollo/client/__cjs/core/ApolloClient.cjs +14 -14
- package/node_modules/@apollo/client/__cjs/core/ObservableQuery.cjs +8 -8
- package/node_modules/@apollo/client/__cjs/core/QueryInfo.cjs +13 -32
- package/node_modules/@apollo/client/__cjs/core/QueryInfo.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/core/QueryManager.cjs +12 -12
- package/node_modules/@apollo/client/__cjs/core/RefetchEventManager.cjs +3 -3
- package/node_modules/@apollo/client/__cjs/incremental/handlers/defer20220824.cjs +15 -2
- package/node_modules/@apollo/client/__cjs/incremental/handlers/defer20220824.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/incremental/handlers/defer20220824.d.cts +5 -1
- package/node_modules/@apollo/client/__cjs/incremental/handlers/graphql17Alpha9.cjs +58 -14
- package/node_modules/@apollo/client/__cjs/incremental/handlers/graphql17Alpha9.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/incremental/handlers/graphql17Alpha9.d.cts +23 -12
- package/node_modules/@apollo/client/__cjs/incremental/handlers/notImplemented.cjs +1 -1
- package/node_modules/@apollo/client/__cjs/incremental/types.d.cts +19 -1
- package/node_modules/@apollo/client/__cjs/invariantErrorCodes.cjs +64 -58
- package/node_modules/@apollo/client/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
- package/node_modules/@apollo/client/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/react/hooks/useLazyQuery.cjs +27 -1
- package/node_modules/@apollo/client/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/utilities/internal/index.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/utilities/internal/index.d.cts +0 -1
- package/node_modules/@apollo/client/__cjs/utilities/internal/isDeferredFragment.cjs +24 -26
- package/node_modules/@apollo/client/__cjs/utilities/internal/isDeferredFragment.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/utilities/internal/isDeferredFragment.d.cts +1 -1
- package/node_modules/@apollo/client/__cjs/utilities/internal/isStreamField.cjs +24 -20
- package/node_modules/@apollo/client/__cjs/utilities/internal/isStreamField.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/utilities/internal/isStreamField.d.cts +1 -1
- package/node_modules/@apollo/client/__cjs/version.cjs +1 -1
- package/node_modules/@apollo/client/cache/core/cache.d.ts +4 -1
- package/node_modules/@apollo/client/cache/core/cache.js +1 -1
- package/node_modules/@apollo/client/cache/core/cache.js.map +1 -1
- package/node_modules/@apollo/client/cache/core/types/Cache.d.ts +5 -0
- package/node_modules/@apollo/client/cache/core/types/Cache.js.map +1 -1
- package/node_modules/@apollo/client/cache/inmemory/entityStore.js +4 -4
- package/node_modules/@apollo/client/cache/inmemory/inMemoryCache.d.ts +3 -1
- package/node_modules/@apollo/client/cache/inmemory/inMemoryCache.js +15 -5
- package/node_modules/@apollo/client/cache/inmemory/inMemoryCache.js.map +1 -1
- package/node_modules/@apollo/client/cache/inmemory/key-extractor.js +1 -1
- package/node_modules/@apollo/client/cache/inmemory/policies.js +5 -5
- package/node_modules/@apollo/client/cache/inmemory/readFromStore.js +28 -10
- package/node_modules/@apollo/client/cache/inmemory/readFromStore.js.map +1 -1
- package/node_modules/@apollo/client/cache/inmemory/types.d.ts +7 -2
- package/node_modules/@apollo/client/cache/inmemory/types.js.map +1 -1
- package/node_modules/@apollo/client/cache/inmemory/writeToStore.d.ts +5 -2
- package/node_modules/@apollo/client/cache/inmemory/writeToStore.js +30 -15
- package/node_modules/@apollo/client/cache/inmemory/writeToStore.js.map +1 -1
- package/node_modules/@apollo/client/core/ApolloClient.js +14 -14
- package/node_modules/@apollo/client/core/ObservableQuery.js +8 -8
- package/node_modules/@apollo/client/core/QueryInfo.js +14 -33
- package/node_modules/@apollo/client/core/QueryInfo.js.map +1 -1
- package/node_modules/@apollo/client/core/QueryManager.js +12 -12
- package/node_modules/@apollo/client/core/RefetchEventManager.js +3 -3
- package/node_modules/@apollo/client/incremental/handlers/defer20220824.d.ts +5 -1
- package/node_modules/@apollo/client/incremental/handlers/defer20220824.js +15 -2
- package/node_modules/@apollo/client/incremental/handlers/defer20220824.js.map +1 -1
- package/node_modules/@apollo/client/incremental/handlers/graphql17Alpha9.d.ts +23 -12
- package/node_modules/@apollo/client/incremental/handlers/graphql17Alpha9.js +58 -14
- package/node_modules/@apollo/client/incremental/handlers/graphql17Alpha9.js.map +1 -1
- package/node_modules/@apollo/client/incremental/handlers/notImplemented.js +1 -1
- package/node_modules/@apollo/client/incremental/types.d.ts +19 -1
- package/node_modules/@apollo/client/incremental/types.js.map +1 -1
- package/node_modules/@apollo/client/invariantErrorCodes.js +64 -58
- package/node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js +1 -1
- package/node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/node_modules/@apollo/client/package.json +1 -1
- package/node_modules/@apollo/client/react/hooks/useLazyQuery.js +27 -1
- package/node_modules/@apollo/client/react/hooks/useLazyQuery.js.map +1 -1
- package/node_modules/@apollo/client/react/hooks-compiled/useLazyQuery.js +27 -1
- package/node_modules/@apollo/client/react/hooks-compiled/useLazyQuery.js.map +1 -1
- package/node_modules/@apollo/client/utilities/internal/index.d.ts +0 -1
- package/node_modules/@apollo/client/utilities/internal/index.js.map +1 -1
- package/node_modules/@apollo/client/utilities/internal/isDeferredFragment.d.ts +1 -1
- package/node_modules/@apollo/client/utilities/internal/isDeferredFragment.js +23 -25
- package/node_modules/@apollo/client/utilities/internal/isDeferredFragment.js.map +1 -1
- package/node_modules/@apollo/client/utilities/internal/isStreamField.d.ts +1 -1
- package/node_modules/@apollo/client/utilities/internal/isStreamField.js +23 -19
- package/node_modules/@apollo/client/utilities/internal/isStreamField.js.map +1 -1
- package/node_modules/@apollo/client/version.js +1 -1
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/child_process.d.ts +1 -1
- package/node_modules/@types/node/crypto.d.ts +22 -10
- package/node_modules/@types/node/dgram.d.ts +1 -1
- package/node_modules/@types/node/ffi.d.ts +14 -0
- package/node_modules/@types/node/http2.d.ts +3 -2
- package/node_modules/@types/node/net.d.ts +16 -4
- package/node_modules/@types/node/package.json +2 -17
- package/node_modules/@types/node/process.d.ts +1 -0
- package/node_modules/@types/node/quic.d.ts +39 -1
- package/node_modules/@types/node/stream/iter.d.ts +9 -12
- package/node_modules/@types/node/test/reporters.d.ts +1 -0
- package/node_modules/@types/node/test.d.ts +72 -0
- package/node_modules/@types/node/tls.d.ts +14 -10
- package/node_modules/@types/node/util.d.ts +6 -3
- package/node_modules/@types/node/vm.d.ts +2 -1
- package/node_modules/@types/node/worker_threads.d.ts +4 -1
- package/node_modules/@types/node/zlib.d.ts +6 -0
- package/node_modules/axios/CHANGELOG.md +62 -0
- package/node_modules/axios/README.md +297 -5
- package/node_modules/axios/dist/axios.js +728 -170
- package/node_modules/axios/dist/axios.min.js +3 -3
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +871 -188
- package/node_modules/axios/dist/esm/axios.js +871 -188
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +1037 -225
- package/node_modules/axios/index.d.cts +102 -74
- package/node_modules/axios/index.d.ts +100 -68
- package/node_modules/axios/lib/adapters/fetch.js +64 -11
- package/node_modules/axios/lib/adapters/http.js +140 -67
- package/node_modules/axios/lib/adapters/xhr.js +52 -3
- package/node_modules/axios/lib/core/Axios.js +43 -20
- package/node_modules/axios/lib/core/AxiosError.js +33 -2
- package/node_modules/axios/lib/core/AxiosHeaders.js +124 -1
- package/node_modules/axios/lib/core/InterceptorManager.js +107 -8
- package/node_modules/axios/lib/core/buildFullPath.js +41 -15
- package/node_modules/axios/lib/core/dispatchRequest.js +8 -2
- package/node_modules/axios/lib/core/mergeConfig.js +19 -4
- package/node_modules/axios/lib/core/methodList.js +17 -0
- package/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
- package/node_modules/axios/lib/defaults/index.js +2 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/Http2Sessions.js +2 -0
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +12 -1
- package/node_modules/axios/lib/helpers/combineURLs.js +11 -3
- package/node_modules/axios/lib/helpers/composeSignals.js +12 -1
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +115 -54
- package/node_modules/axios/lib/helpers/formDataToJSON.js +11 -5
- package/node_modules/axios/lib/helpers/fromDataURI.js +5 -4
- package/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
- package/node_modules/axios/lib/helpers/parseHeaders.js +5 -3
- package/node_modules/axios/lib/helpers/progressEventReducer.js +4 -4
- package/node_modules/axios/lib/helpers/resolveConfig.js +5 -17
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +300 -5
- package/node_modules/axios/lib/helpers/throttle.js +3 -2
- package/node_modules/axios/lib/helpers/toFormData.js +17 -23
- package/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
- package/node_modules/axios/lib/utils.js +151 -18
- package/node_modules/axios/package.json +21 -19
- package/node_modules/chalk/package.json +1 -1
- package/node_modules/chalk/source/index.js +2 -1
- package/node_modules/cpu-features/build/config.gypi +2 -2
- package/node_modules/ejs/README.md +64 -28
- package/node_modules/ejs/bin/cli.js +220 -158
- package/node_modules/ejs/ejs.js +64 -94
- package/node_modules/ejs/ejs.min.js +1 -1
- package/node_modules/ejs/jakefile.js +44 -0
- package/node_modules/ejs/lib/cjs/ejs.js +64 -63
- package/node_modules/ejs/lib/cjs/parseargs.js +129 -77
- package/node_modules/ejs/lib/cjs/utils.js +0 -31
- package/node_modules/ejs/lib/esm/ejs.js +66 -65
- package/node_modules/ejs/lib/esm/parseargs.js +136 -82
- package/node_modules/ejs/lib/esm/utils.js +0 -32
- package/node_modules/ejs/package.json +3 -2
- package/node_modules/ejs/usage.txt +9 -9
- package/node_modules/follow-redirects/index.js +10 -1
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/graphql-ws/dist/client.cjs +28 -13
- package/node_modules/graphql-ws/dist/client.js +28 -13
- package/node_modules/graphql-ws/dist/index.cjs +1 -1
- package/node_modules/graphql-ws/dist/index.d.cts +1 -1
- package/node_modules/graphql-ws/dist/index.d.ts +1 -1
- package/node_modules/graphql-ws/dist/index.js +1 -1
- package/node_modules/graphql-ws/dist/{server-B8ZBs9OC.d.ts → server-BzBeHlSW.d.ts} +26 -1
- package/node_modules/graphql-ws/dist/{server-DN5-9C2B.cjs → server-Ce-Z86Ys.cjs} +10 -4
- package/node_modules/graphql-ws/dist/{server-ChpuX357.d.cts → server-u6zrlwzL.d.cts} +26 -1
- package/node_modules/graphql-ws/dist/{server-DHPI7HHW.js → server-zBhvXJ_Z.js} +10 -4
- package/node_modules/graphql-ws/dist/use/@fastify/websocket.cjs +2 -2
- package/node_modules/graphql-ws/dist/use/@fastify/websocket.d.cts +8 -2
- package/node_modules/graphql-ws/dist/use/@fastify/websocket.d.ts +8 -2
- package/node_modules/graphql-ws/dist/use/@fastify/websocket.js +2 -2
- package/node_modules/graphql-ws/dist/use/bun.cjs +1 -1
- package/node_modules/graphql-ws/dist/use/bun.d.cts +2 -2
- package/node_modules/graphql-ws/dist/use/bun.d.ts +2 -2
- package/node_modules/graphql-ws/dist/use/bun.js +2 -2
- package/node_modules/graphql-ws/dist/use/crossws.cjs +16 -4
- package/node_modules/graphql-ws/dist/use/crossws.d.cts +6 -1
- package/node_modules/graphql-ws/dist/use/crossws.d.ts +6 -1
- package/node_modules/graphql-ws/dist/use/crossws.js +16 -4
- package/node_modules/graphql-ws/dist/use/deno.d.ts +1 -1
- package/node_modules/graphql-ws/dist/use/deno.js +1 -1
- package/node_modules/graphql-ws/dist/use/uWebSockets.cjs +2 -2
- package/node_modules/graphql-ws/dist/use/uWebSockets.d.cts +8 -2
- package/node_modules/graphql-ws/dist/use/uWebSockets.d.ts +8 -2
- package/node_modules/graphql-ws/dist/use/uWebSockets.js +2 -2
- package/node_modules/graphql-ws/dist/use/ws.cjs +2 -2
- package/node_modules/graphql-ws/dist/use/ws.d.cts +8 -2
- package/node_modules/graphql-ws/dist/use/ws.d.ts +8 -2
- package/node_modules/graphql-ws/dist/use/ws.js +2 -2
- package/node_modules/graphql-ws/package.json +3 -3
- package/node_modules/graphql-ws/umd/graphql-ws.js +28 -13
- package/node_modules/graphql-ws/umd/graphql-ws.min.js +1 -1
- package/node_modules/graphql-ws/umd/graphql-ws.min.js.gz +0 -0
- package/node_modules/js-yaml/dist/browser/js-yaml.esm.min.mjs +522 -495
- package/node_modules/js-yaml/dist/browser/js-yaml.esm.min.mjs.map +1 -1
- package/node_modules/js-yaml/dist/browser/js-yaml.umd.min.js +24 -24
- package/node_modules/js-yaml/dist/browser/js-yaml.umd.min.js.map +1 -1
- package/node_modules/js-yaml/dist/js-yaml.cjs.js +135 -78
- package/node_modules/js-yaml/dist/js-yaml.cjs.js.map +1 -1
- package/node_modules/js-yaml/dist/js-yaml.mjs +129 -72
- package/node_modules/js-yaml/dist/js-yaml.mjs.map +1 -1
- package/node_modules/js-yaml/node_modules/argparse/LICENSE +47 -0
- package/node_modules/js-yaml/node_modules/argparse/README.md +89 -0
- package/node_modules/js-yaml/node_modules/argparse/lib/_colorize.js +72 -0
- package/node_modules/js-yaml/node_modules/argparse/lib/argparse.d.ts +292 -0
- package/node_modules/{argparse → js-yaml/node_modules/argparse/lib}/argparse.js +1142 -1029
- package/node_modules/js-yaml/node_modules/argparse/lib/difflib.js +190 -0
- package/node_modules/{argparse → js-yaml/node_modules/argparse}/lib/sub.js +4 -4
- package/node_modules/{argparse → js-yaml/node_modules/argparse}/lib/textwrap.js +28 -28
- package/node_modules/js-yaml/node_modules/argparse/package.json +38 -0
- package/node_modules/js-yaml/package.json +12 -12
- package/node_modules/lando/.github/dependabot.yml +4 -0
- package/node_modules/lando/.github/workflows/build-util-images.yml +1 -1
- package/node_modules/lando/.github/workflows/pr-core-tests.yml +4 -2
- package/node_modules/lando/.github/workflows/pr-db-tools-tests.yml +4 -2
- package/node_modules/lando/.github/workflows/pr-django-tests.yml +4 -2
- package/node_modules/lando/.github/workflows/pr-linter.yml +2 -2
- package/node_modules/lando/.github/workflows/pr-unit-tests.yml +2 -2
- package/node_modules/lando/.node-version +1 -1
- package/node_modules/lando/bin/lando.js +3 -83
- package/node_modules/lando/config.yml +0 -1
- package/node_modules/lando/eslint.config.mjs +4 -0
- package/node_modules/lando/examples/django/.lando.yml +1 -1
- package/node_modules/lando/examples/django/README.md +1 -1
- package/node_modules/lando/examples/django/requirements.txt +1 -1
- package/node_modules/lando/examples/sql-export/README.md +5 -0
- package/node_modules/lando/lib/app.js +78 -84
- package/node_modules/lando/lib/art.js +86 -30
- package/node_modules/lando/lib/bootstrap.js +148 -45
- package/node_modules/lando/lib/cache.js +14 -15
- package/node_modules/lando/lib/cli.js +67 -63
- package/node_modules/lando/lib/compose.js +76 -45
- package/node_modules/lando/lib/config.js +51 -33
- package/node_modules/lando/lib/daemon.js +27 -10
- package/node_modules/lando/lib/docker.js +46 -19
- package/node_modules/lando/lib/engine.js +131 -144
- package/node_modules/lando/lib/env.js +25 -46
- package/node_modules/lando/lib/error.js +15 -6
- package/node_modules/lando/lib/esm/package.json +3 -0
- package/node_modules/lando/lib/esm/string-argv.js +2 -0
- package/node_modules/lando/lib/esm/yargs.js +2 -0
- package/node_modules/lando/lib/events.js +15 -15
- package/node_modules/lando/lib/factory.js +43 -14
- package/node_modules/lando/lib/formatters.js +19 -31
- package/node_modules/lando/lib/lando.js +59 -48
- package/node_modules/lando/lib/logger.js +12 -24
- package/node_modules/lando/lib/plugins.js +27 -15
- package/node_modules/lando/lib/promise.js +17 -17
- package/node_modules/lando/lib/router.js +75 -21
- package/node_modules/lando/lib/scan.js +29 -12
- package/node_modules/lando/lib/shell.js +44 -20
- package/node_modules/lando/lib/user.js +14 -20
- package/node_modules/lando/lib/utils.js +87 -44
- package/node_modules/lando/lib/yaml.js +11 -9
- package/node_modules/lando/node_modules/ansi-regex/index.d.ts +33 -0
- package/node_modules/lando/node_modules/ansi-regex/index.js +15 -0
- package/node_modules/lando/node_modules/ansi-regex/package.json +61 -0
- package/node_modules/lando/node_modules/ansi-regex/readme.md +66 -0
- package/node_modules/lando/node_modules/cliui/README.md +26 -6
- package/node_modules/lando/node_modules/cliui/build/lib/index.js +2 -2
- package/node_modules/lando/node_modules/cliui/build/tsconfig.tsbuildinfo +1 -0
- package/node_modules/lando/node_modules/cliui/index.mjs +7 -5
- package/node_modules/lando/node_modules/cliui/node_modules/string-width/index.d.ts +39 -0
- package/node_modules/lando/node_modules/cliui/node_modules/string-width/index.js +82 -0
- package/node_modules/lando/node_modules/cliui/node_modules/string-width/license +9 -0
- package/node_modules/lando/node_modules/cliui/node_modules/string-width/package.json +64 -0
- package/node_modules/lando/node_modules/cliui/node_modules/string-width/readme.md +66 -0
- package/node_modules/lando/node_modules/cliui/package.json +21 -32
- package/node_modules/lando/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
- package/node_modules/lando/node_modules/emoji-regex/README.md +107 -0
- package/node_modules/lando/node_modules/emoji-regex/index.d.ts +3 -0
- package/node_modules/lando/node_modules/emoji-regex/index.js +4 -0
- package/node_modules/lando/node_modules/emoji-regex/index.mjs +4 -0
- package/node_modules/lando/node_modules/emoji-regex/package.json +45 -0
- package/node_modules/lando/node_modules/string-width/index.d.ts +39 -0
- package/node_modules/lando/node_modules/string-width/index.js +203 -0
- package/node_modules/lando/node_modules/string-width/license +9 -0
- package/node_modules/lando/node_modules/string-width/package.json +65 -0
- package/node_modules/lando/node_modules/string-width/readme.md +66 -0
- package/node_modules/lando/node_modules/strip-ansi/index.d.ts +15 -0
- package/node_modules/lando/node_modules/strip-ansi/index.js +19 -0
- package/node_modules/lando/node_modules/strip-ansi/license +9 -0
- package/node_modules/lando/node_modules/strip-ansi/package.json +59 -0
- package/node_modules/lando/node_modules/strip-ansi/readme.md +37 -0
- package/node_modules/lando/node_modules/yargs/README.md +16 -36
- package/node_modules/lando/node_modules/yargs/browser.d.ts +5 -0
- package/node_modules/lando/node_modules/yargs/browser.mjs +2 -2
- package/node_modules/lando/node_modules/yargs/build/lib/command.js +308 -211
- package/node_modules/lando/node_modules/yargs/build/lib/completion-templates.js +28 -9
- package/node_modules/lando/node_modules/yargs/build/lib/completion.js +233 -91
- package/node_modules/lando/node_modules/yargs/build/lib/middleware.js +51 -16
- package/node_modules/lando/node_modules/yargs/build/lib/usage.js +88 -52
- package/node_modules/lando/node_modules/yargs/build/lib/utils/apply-extends.js +4 -2
- package/node_modules/lando/node_modules/yargs/build/lib/utils/levenshtein.js +9 -1
- package/node_modules/lando/node_modules/yargs/build/lib/utils/maybe-async-result.js +17 -0
- package/node_modules/lando/node_modules/yargs/build/lib/validation.js +51 -54
- package/node_modules/lando/node_modules/yargs/build/lib/yargs-factory.js +1261 -887
- package/node_modules/lando/node_modules/yargs/build/lib/yerror.js +3 -1
- package/node_modules/lando/node_modules/yargs/index.mjs +4 -2
- package/node_modules/lando/node_modules/yargs/lib/platform-shims/browser.mjs +9 -2
- package/node_modules/lando/node_modules/yargs/lib/platform-shims/esm.mjs +22 -22
- package/node_modules/lando/node_modules/yargs/locales/cs.json +51 -0
- package/node_modules/lando/node_modules/yargs/locales/de.json +1 -1
- package/node_modules/lando/node_modules/yargs/locales/en.json +4 -0
- package/node_modules/lando/node_modules/yargs/locales/fi.json +1 -1
- package/node_modules/lando/node_modules/yargs/locales/he.json +55 -0
- package/node_modules/lando/node_modules/yargs/locales/ka.json +55 -0
- package/node_modules/lando/node_modules/yargs/locales/ko.json +25 -25
- package/node_modules/lando/node_modules/yargs/locales/ru.json +6 -1
- package/node_modules/lando/node_modules/yargs/locales/uk_UA.json +51 -0
- package/node_modules/lando/node_modules/yargs/locales/uz.json +52 -0
- package/node_modules/lando/node_modules/yargs/locales/zh_TW.json +50 -46
- package/node_modules/lando/node_modules/yargs/package.json +41 -60
- package/node_modules/lando/node_modules/yargs-parser/build/lib/index.js +13 -8
- package/node_modules/lando/node_modules/yargs-parser/build/lib/yargs-parser.js +21 -12
- package/node_modules/lando/node_modules/yargs-parser/package.json +31 -40
- package/node_modules/lando/package.json +59 -22
- package/node_modules/lando/plugins/lando-compose/index.js +4 -0
- package/node_modules/lando/plugins/lando-compose/lib/utils.js +16 -7
- package/node_modules/lando/plugins/lando-core/index.js +1 -2
- package/node_modules/lando/plugins/lando-core/lib/utils.js +35 -15
- package/node_modules/lando/plugins/lando-core/lib/warnings.js +27 -0
- package/node_modules/lando/plugins/lando-core/tasks/destroy.js +1 -1
- package/node_modules/lando/plugins/lando-core/tasks/rebuild.js +1 -1
- package/node_modules/lando/plugins/lando-events/index.js +4 -0
- package/node_modules/lando/plugins/lando-events/lib/utils.js +27 -6
- package/node_modules/lando/plugins/lando-networking/app.js +2 -2
- package/node_modules/lando/plugins/lando-networking/index.js +9 -2
- package/node_modules/lando/plugins/lando-networking/test/app.spec.js +87 -0
- package/node_modules/lando/plugins/lando-proxy/index.js +6 -1
- package/node_modules/lando/plugins/lando-proxy/lib/utils.js +63 -28
- package/node_modules/lando/plugins/lando-proxy/lib/warnings.js +10 -0
- package/node_modules/lando/plugins/lando-recipes/index.js +4 -0
- package/node_modules/lando/plugins/lando-recipes/lib/build.js +22 -4
- package/node_modules/lando/plugins/lando-recipes/lib/options.js +42 -66
- package/node_modules/lando/plugins/lando-recipes/lib/utils.js +30 -13
- package/node_modules/lando/plugins/lando-recipes/lib/warnings.js +5 -0
- package/node_modules/lando/plugins/lando-recipes/sources/remote.js +0 -26
- package/node_modules/lando/plugins/lando-recipes/tasks/init.js +1 -1
- package/node_modules/lando/plugins/lando-services/index.js +4 -0
- package/node_modules/lando/plugins/lando-services/lib/utils.js +38 -15
- package/node_modules/lando/plugins/lando-sharing/index.js +4 -0
- package/node_modules/lando/plugins/lando-sharing/lib/utils.js +28 -5
- package/node_modules/lando/plugins/lando-tooling/index.js +5 -0
- package/node_modules/lando/plugins/lando-tooling/lib/build.js +5 -2
- package/node_modules/lando/plugins/lando-tooling/lib/utils.js +83 -47
- package/node_modules/lando/test/cli.spec.js +59 -21
- package/node_modules/lando/test/docker.spec.js +24 -28
- package/node_modules/lando/test/env.spec.js +8 -0
- package/node_modules/lando/test/error.spec.js +1 -1
- package/node_modules/lando/test/events.spec.js +6 -7
- package/node_modules/lando/test/lando.spec.js +1 -1
- package/node_modules/lando/test/plugins.spec.js +2 -3
- package/node_modules/lando/test/promise.spec.js +1 -1
- package/node_modules/lando/test/scan.spec.js +1 -1
- package/node_modules/lando/test/shell.spec.js +19 -2
- package/node_modules/lando/test/utils.spec.js +52 -0
- package/node_modules/open/index.js +3 -5
- package/node_modules/open/package.json +1 -1
- package/node_modules/socket.io-client/README.md +1 -0
- package/node_modules/socket.io-client/build/cjs/index.d.ts +3 -3
- package/node_modules/socket.io-client/build/cjs/manager.d.ts +1 -2
- package/node_modules/socket.io-client/build/cjs/manager.js +17 -7
- package/node_modules/socket.io-client/build/cjs/socket.d.ts +5 -2
- package/node_modules/socket.io-client/build/cjs/socket.js +0 -1
- package/node_modules/socket.io-client/build/esm/index.d.ts +3 -3
- package/node_modules/socket.io-client/build/esm/index.js +1 -1
- package/node_modules/socket.io-client/build/esm/manager.d.ts +1 -2
- package/node_modules/socket.io-client/build/esm/package.json +1 -1
- package/node_modules/socket.io-client/build/esm/socket.d.ts +5 -2
- package/node_modules/socket.io-client/build/esm/socket.js +0 -1
- package/node_modules/socket.io-client/build/esm-debug/index.d.ts +3 -3
- package/node_modules/socket.io-client/build/esm-debug/index.js +1 -1
- package/node_modules/socket.io-client/build/esm-debug/manager.d.ts +1 -2
- package/node_modules/socket.io-client/build/esm-debug/package.json +1 -1
- package/node_modules/socket.io-client/build/esm-debug/socket.d.ts +5 -2
- package/node_modules/socket.io-client/build/esm-debug/socket.js +0 -1
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js +3 -3
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js.map +1 -1
- package/node_modules/socket.io-client/dist/socket.io.js +174 -242
- package/node_modules/socket.io-client/dist/socket.io.js.map +1 -1
- package/node_modules/socket.io-client/dist/socket.io.min.js +3 -3
- package/node_modules/socket.io-client/dist/socket.io.min.js.map +1 -1
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js +3 -3
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js.map +1 -1
- package/node_modules/socket.io-client/package.json +2 -2
- package/node_modules/string-argv/CHANGELOG.md +38 -0
- package/node_modules/string-argv/README.md +96 -50
- package/node_modules/string-argv/index.d.ts +2 -0
- package/node_modules/string-argv/index.js +55 -35
- package/node_modules/string-argv/package.json +50 -40
- package/node_modules/undici/README.md +35 -4
- package/node_modules/undici/docs/docs/api/Agent.md +8 -8
- package/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
- package/node_modules/undici/docs/docs/api/Client.md +11 -6
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
- package/node_modules/undici/docs/docs/api/Dispatcher.md +12 -0
- package/node_modules/undici/docs/docs/api/Errors.md +101 -1
- package/node_modules/undici/docs/docs/api/Fetch.md +10 -0
- package/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
- package/node_modules/undici/docs/docs/api/Interceptors.md +17 -9
- package/node_modules/undici/docs/docs/api/Pool.md +5 -6
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
- package/node_modules/undici/docs/docs/index.md +22 -13
- package/node_modules/undici/docs/docs/type-map.json +66 -66
- package/node_modules/undici/lib/api/readable.js +1 -2
- package/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
- package/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
- package/node_modules/undici/lib/core/connect.js +10 -4
- package/node_modules/undici/lib/core/constants.js +12 -1
- package/node_modules/undici/lib/core/errors.js +38 -1
- package/node_modules/undici/lib/core/request.js +39 -3
- package/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/undici/lib/core/util.js +26 -40
- package/node_modules/undici/lib/dispatcher/agent.js +6 -2
- package/node_modules/undici/lib/dispatcher/client-h1.js +127 -84
- package/node_modules/undici/lib/dispatcher/client-h2.js +97 -21
- package/node_modules/undici/lib/dispatcher/client.js +10 -2
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
- package/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
- package/node_modules/undici/lib/dispatcher/pool-base.js +117 -19
- package/node_modules/undici/lib/dispatcher/pool.js +99 -13
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +34 -11
- package/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
- package/node_modules/undici/lib/handler/cache-handler.js +153 -15
- package/node_modules/undici/lib/handler/deduplication-handler.js +126 -52
- package/node_modules/undici/lib/handler/redirect-handler.js +31 -6
- package/node_modules/undici/lib/handler/retry-handler.js +116 -24
- package/node_modules/undici/lib/interceptor/cache.js +15 -4
- package/node_modules/undici/lib/interceptor/decompress.js +253 -73
- package/node_modules/undici/lib/interceptor/dns.js +11 -0
- package/node_modules/undici/lib/interceptor/response-error.js +72 -28
- package/node_modules/undici/lib/milo/LICENSE.md +7 -0
- package/node_modules/undici/lib/milo/no-simd.js +1002 -0
- package/node_modules/undici/lib/milo/simd.js +1002 -0
- package/node_modules/undici/lib/mock/mock-agent.js +11 -0
- package/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
- package/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
- package/node_modules/undici/lib/util/cache.js +11 -5
- package/node_modules/undici/lib/web/cache/cache.js +17 -8
- package/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
- package/node_modules/undici/lib/web/cookies/index.js +19 -7
- package/node_modules/undici/lib/web/cookies/util.js +21 -2
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
- package/node_modules/undici/lib/web/eventsource/eventsource.js +50 -3
- package/node_modules/undici/lib/web/fetch/body.js +69 -53
- package/node_modules/undici/lib/web/fetch/data-url.js +6 -6
- package/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
- package/node_modules/undici/lib/web/fetch/formdata.js +30 -36
- package/node_modules/undici/lib/web/fetch/headers.js +36 -33
- package/node_modules/undici/lib/web/fetch/index.js +54 -29
- package/node_modules/undici/lib/web/fetch/request.js +74 -79
- package/node_modules/undici/lib/web/fetch/response.js +43 -44
- package/node_modules/undici/lib/web/fetch/util.js +7 -7
- package/node_modules/undici/lib/web/infra/index.js +16 -1
- package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
- package/node_modules/undici/lib/web/webidl/index.js +2 -14
- package/node_modules/undici/lib/web/websocket/connection.js +33 -12
- package/node_modules/undici/lib/web/websocket/events.js +43 -26
- package/node_modules/undici/lib/web/websocket/receiver.js +27 -4
- package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +19 -4
- package/node_modules/undici/lib/web/websocket/websocket.js +44 -41
- package/node_modules/undici/package.json +7 -5
- package/node_modules/undici/types/cache-interceptor.d.ts +10 -0
- package/node_modules/undici/types/client.d.ts +10 -4
- package/node_modules/undici/types/diagnostics-channel.d.ts +2 -1
- package/node_modules/undici/types/errors.d.ts +16 -1
- package/node_modules/undici/types/h2c-client.d.ts +1 -1
- package/node_modules/undici/types/interceptors.d.ts +7 -2
- package/node_modules/undici/types/webidl.d.ts +13 -7
- package/node_modules/{lando/node_modules/js-yaml → unicode-segmenter}/LICENSE +6 -6
- package/node_modules/unicode-segmenter/README.md +324 -0
- package/node_modules/unicode-segmenter/_emoji_data.cjs +24 -0
- package/node_modules/unicode-segmenter/_emoji_data.d.cts +1 -0
- package/node_modules/unicode-segmenter/_emoji_data.d.ts +12 -0
- package/node_modules/unicode-segmenter/_emoji_data.js +26 -0
- package/node_modules/unicode-segmenter/_general_data.cjs +30 -0
- package/node_modules/unicode-segmenter/_general_data.d.cts +1 -0
- package/node_modules/unicode-segmenter/_general_data.d.ts +16 -0
- package/node_modules/unicode-segmenter/_general_data.js +34 -0
- package/node_modules/unicode-segmenter/_grapheme_data.cjs +125 -0
- package/node_modules/unicode-segmenter/_grapheme_data.d.cts +1 -0
- package/node_modules/unicode-segmenter/_grapheme_data.d.ts +112 -0
- package/node_modules/unicode-segmenter/_grapheme_data.js +123 -0
- package/node_modules/unicode-segmenter/core.cjs +135 -0
- package/node_modules/unicode-segmenter/core.d.cts +1 -0
- package/node_modules/unicode-segmenter/core.d.ts +118 -0
- package/node_modules/unicode-segmenter/core.js +129 -0
- package/node_modules/unicode-segmenter/emoji.cjs +43 -0
- package/node_modules/unicode-segmenter/emoji.d.cts +1 -0
- package/node_modules/unicode-segmenter/emoji.d.ts +23 -0
- package/node_modules/unicode-segmenter/emoji.js +42 -0
- package/node_modules/unicode-segmenter/general.cjs +51 -0
- package/node_modules/unicode-segmenter/general.d.cts +1 -0
- package/node_modules/unicode-segmenter/general.d.ts +26 -0
- package/node_modules/unicode-segmenter/general.js +50 -0
- package/node_modules/unicode-segmenter/grapheme.cjs +405 -0
- package/node_modules/unicode-segmenter/grapheme.d.cts +1 -0
- package/node_modules/unicode-segmenter/grapheme.d.ts +64 -0
- package/node_modules/unicode-segmenter/grapheme.js +438 -0
- package/node_modules/unicode-segmenter/index.cjs +26 -0
- package/node_modules/unicode-segmenter/index.d.cts +1 -0
- package/node_modules/unicode-segmenter/index.d.ts +4 -0
- package/node_modules/unicode-segmenter/index.js +6 -0
- package/node_modules/unicode-segmenter/intl-adapter.cjs +124 -0
- package/node_modules/unicode-segmenter/intl-adapter.d.cts +1 -0
- package/node_modules/unicode-segmenter/intl-adapter.d.ts +62 -0
- package/node_modules/unicode-segmenter/intl-adapter.js +113 -0
- package/node_modules/unicode-segmenter/intl-polyfill.cjs +17 -0
- package/node_modules/unicode-segmenter/intl-polyfill.d.cts +1 -0
- package/node_modules/unicode-segmenter/intl-polyfill.d.ts +1 -0
- package/node_modules/unicode-segmenter/intl-polyfill.js +16 -0
- package/node_modules/unicode-segmenter/package.json +165 -0
- package/node_modules/unicode-segmenter/utils.cjs +99 -0
- package/node_modules/unicode-segmenter/utils.d.cts +1 -0
- package/node_modules/unicode-segmenter/utils.d.ts +64 -0
- package/node_modules/unicode-segmenter/utils.js +89 -0
- package/package.json +6 -6
- package/.buildkite/build-linux.sh +0 -68
- package/.buildkite/build-macos-installer.sh +0 -34
- package/.buildkite/build-macos.sh +0 -67
- package/.buildkite/build-windows-installer.ps1 +0 -65
- package/.buildkite/build-windows.ps1 +0 -59
- package/.buildkite/fetch-search-replace.sh +0 -65
- package/.buildkite/pack-release.sh +0 -26
- package/.buildkite/pipeline.yml +0 -81
- package/.buildkite/shared-pipeline-vars +0 -16
- package/.buildkite/sign-windows.ps1 +0 -21
- package/.buildkite/test-windows-installer-download.ps1 +0 -54
- package/.buildkite/test_pipeline.py +0 -69
- package/.bundle/config +0 -4
- package/.editorconfig +0 -11
- package/.prettierignore +0 -13
- package/.ruby-version +0 -1
- package/.sonarcloud.properties +0 -2
- package/.xcode-version +0 -1
- package/AGENTS.md +0 -101
- package/CLAUDE.md +0 -4
- package/Gemfile +0 -8
- package/Gemfile.lock +0 -377
- package/Makefile +0 -293
- package/cmd/installer-payload/main.go +0 -19
- package/cmd/installer-version/main.go +0 -22
- package/cmd/stamp-version/main.go +0 -25
- package/cmd/vip-next/auth_bootstrap.go +0 -139
- package/cmd/vip-next/auth_bootstrap_test.go +0 -379
- package/cmd/vip-next/auth_bypass_wiring_test.go +0 -162
- package/cmd/vip-next/cli_error_hook_test.go +0 -91
- package/cmd/vip-next/commands/app.go +0 -23
- package/cmd/vip-next/commands/app_debug_test.go +0 -89
- package/cmd/vip-next/commands/app_deploy.go +0 -217
- package/cmd/vip-next/commands/app_deploy_test.go +0 -297
- package/cmd/vip-next/commands/app_deploy_validate.go +0 -58
- package/cmd/vip-next/commands/app_get.go +0 -293
- package/cmd/vip-next/commands/app_get_test.go +0 -226
- package/cmd/vip-next/commands/app_list.go +0 -93
- package/cmd/vip-next/commands/app_list_test.go +0 -95
- package/cmd/vip-next/commands/backup.go +0 -16
- package/cmd/vip-next/commands/backup_db.go +0 -137
- package/cmd/vip-next/commands/backup_db_test.go +0 -187
- package/cmd/vip-next/commands/cache.go +0 -16
- package/cmd/vip-next/commands/cache_purge_url.go +0 -90
- package/cmd/vip-next/commands/cache_purge_url_test.go +0 -154
- package/cmd/vip-next/commands/config.go +0 -17
- package/cmd/vip-next/commands/config_debug_test.go +0 -137
- package/cmd/vip-next/commands/config_envvar.go +0 -16
- package/cmd/vip-next/commands/config_envvar_delete.go +0 -135
- package/cmd/vip-next/commands/config_envvar_delete_test.go +0 -140
- package/cmd/vip-next/commands/config_envvar_get.go +0 -72
- package/cmd/vip-next/commands/config_envvar_get_all.go +0 -58
- package/cmd/vip-next/commands/config_envvar_get_all_test.go +0 -83
- package/cmd/vip-next/commands/config_envvar_get_test.go +0 -79
- package/cmd/vip-next/commands/config_envvar_list.go +0 -70
- package/cmd/vip-next/commands/config_envvar_list_test.go +0 -134
- package/cmd/vip-next/commands/config_envvar_set.go +0 -162
- package/cmd/vip-next/commands/config_envvar_set_test.go +0 -251
- package/cmd/vip-next/commands/config_software.go +0 -229
- package/cmd/vip-next/commands/config_software_test.go +0 -161
- package/cmd/vip-next/commands/config_software_update.go +0 -270
- package/cmd/vip-next/commands/config_software_update_test.go +0 -334
- package/cmd/vip-next/commands/db.go +0 -16
- package/cmd/vip-next/commands/db_phpmyadmin.go +0 -122
- package/cmd/vip-next/commands/db_phpmyadmin_test.go +0 -277
- package/cmd/vip-next/commands/defensive_mode.go +0 -106
- package/cmd/vip-next/commands/defensive_mode_configure.go +0 -150
- package/cmd/vip-next/commands/defensive_mode_disable.go +0 -62
- package/cmd/vip-next/commands/defensive_mode_enable.go +0 -62
- package/cmd/vip-next/commands/defensive_mode_test.go +0 -389
- package/cmd/vip-next/commands/devenv.go +0 -48
- package/cmd/vip-next/commands/devenv_create_appinfo.go +0 -158
- package/cmd/vip-next/commands/devenv_create_appinfo_test.go +0 -29
- package/cmd/vip-next/commands/devenv_create_test.go +0 -269
- package/cmd/vip-next/commands/devenv_data.go +0 -86
- package/cmd/vip-next/commands/devenv_data_confirm_test.go +0 -49
- package/cmd/vip-next/commands/devenv_debug_test.go +0 -34
- package/cmd/vip-next/commands/devenv_e2e_gate_test.go +0 -17
- package/cmd/vip-next/commands/devenv_e2e_test.go +0 -34
- package/cmd/vip-next/commands/devenv_envvar.go +0 -180
- package/cmd/vip-next/commands/devenv_envvar_test.go +0 -183
- package/cmd/vip-next/commands/devenv_exec.go +0 -75
- package/cmd/vip-next/commands/devenv_exec_test.go +0 -39
- package/cmd/vip-next/commands/devenv_flag_grammar_test.go +0 -241
- package/cmd/vip-next/commands/devenv_lifecycle.go +0 -778
- package/cmd/vip-next/commands/devenv_logs.go +0 -29
- package/cmd/vip-next/commands/devenv_resolve.go +0 -106
- package/cmd/vip-next/commands/devenv_resolve_test.go +0 -221
- package/cmd/vip-next/commands/devenv_sync.go +0 -256
- package/cmd/vip-next/commands/devenv_sync_sites.go +0 -116
- package/cmd/vip-next/commands/devenv_sync_sites_test.go +0 -151
- package/cmd/vip-next/commands/devenv_sync_test.go +0 -63
- package/cmd/vip-next/commands/devenv_test.go +0 -60
- package/cmd/vip-next/commands/devenv_update.go +0 -207
- package/cmd/vip-next/commands/devenv_update_test.go +0 -109
- package/cmd/vip-next/commands/devenv_versions_proxy_test.go +0 -133
- package/cmd/vip-next/commands/edge_workers.go +0 -197
- package/cmd/vip-next/commands/edge_workers_flags.go +0 -56
- package/cmd/vip-next/commands/edge_workers_local.go +0 -127
- package/cmd/vip-next/commands/edge_workers_mutation.go +0 -130
- package/cmd/vip-next/commands/edge_workers_read.go +0 -103
- package/cmd/vip-next/commands/edge_workers_test.go +0 -272
- package/cmd/vip-next/commands/export.go +0 -16
- package/cmd/vip-next/commands/export_sql.go +0 -333
- package/cmd/vip-next/commands/export_sql_test.go +0 -321
- package/cmd/vip-next/commands/format_env.go +0 -17
- package/cmd/vip-next/commands/import.go +0 -19
- package/cmd/vip-next/commands/import_debug_test.go +0 -110
- package/cmd/vip-next/commands/import_media.go +0 -433
- package/cmd/vip-next/commands/import_media_abort.go +0 -76
- package/cmd/vip-next/commands/import_media_confirm.go +0 -83
- package/cmd/vip-next/commands/import_media_confirm_test.go +0 -249
- package/cmd/vip-next/commands/import_media_fetch_test.go +0 -98
- package/cmd/vip-next/commands/import_media_status.go +0 -58
- package/cmd/vip-next/commands/import_media_test.go +0 -370
- package/cmd/vip-next/commands/import_sql.go +0 -1161
- package/cmd/vip-next/commands/import_sql_status.go +0 -67
- package/cmd/vip-next/commands/import_sql_test.go +0 -746
- package/cmd/vip-next/commands/import_validate_files.go +0 -157
- package/cmd/vip-next/commands/import_validate_files_test.go +0 -157
- package/cmd/vip-next/commands/import_validate_sql.go +0 -207
- package/cmd/vip-next/commands/import_validate_sql_test.go +0 -293
- package/cmd/vip-next/commands/login.go +0 -53
- package/cmd/vip-next/commands/login_test.go +0 -25
- package/cmd/vip-next/commands/logout.go +0 -43
- package/cmd/vip-next/commands/logout_test.go +0 -158
- package/cmd/vip-next/commands/logs.go +0 -169
- package/cmd/vip-next/commands/logs_test.go +0 -174
- package/cmd/vip-next/commands/nodeflag_aliases.go +0 -59
- package/cmd/vip-next/commands/progress_renderer.go +0 -118
- package/cmd/vip-next/commands/progress_renderer_test.go +0 -28
- package/cmd/vip-next/commands/searchreplace.go +0 -75
- package/cmd/vip-next/commands/searchreplace_debug_test.go +0 -82
- package/cmd/vip-next/commands/searchreplace_test.go +0 -155
- package/cmd/vip-next/commands/slowlogs.go +0 -167
- package/cmd/vip-next/commands/slowlogs_test.go +0 -159
- package/cmd/vip-next/commands/sqlreport.go +0 -183
- package/cmd/vip-next/commands/sqlreport_test.go +0 -66
- package/cmd/vip-next/commands/sync.go +0 -189
- package/cmd/vip-next/commands/sync_confirm.go +0 -121
- package/cmd/vip-next/commands/sync_confirm_test.go +0 -202
- package/cmd/vip-next/commands/sync_render.go +0 -207
- package/cmd/vip-next/commands/sync_render_test.go +0 -101
- package/cmd/vip-next/commands/sync_test.go +0 -148
- package/cmd/vip-next/commands/update.go +0 -85
- package/cmd/vip-next/commands/update_test.go +0 -49
- package/cmd/vip-next/commands/whoami.go +0 -161
- package/cmd/vip-next/commands/whoami_debug_test.go +0 -79
- package/cmd/vip-next/commands/whoami_test.go +0 -85
- package/cmd/vip-next/commands/wp.go +0 -376
- package/cmd/vip-next/commands/wp_debug_test.go +0 -32
- package/cmd/vip-next/commands/wp_test.go +0 -276
- package/cmd/vip-next/debug_args.go +0 -63
- package/cmd/vip-next/debug_test.go +0 -122
- package/cmd/vip-next/edge_workers_test.go +0 -108
- package/cmd/vip-next/flags_node_parity_test.go +0 -434
- package/cmd/vip-next/main.go +0 -391
- package/cmd/vip-next/main_test.go +0 -202
- package/cmd/vip-next/pendo_wiring_test.go +0 -148
- package/cmd/vip-next/root.go +0 -211
- package/cmd/vip-next/update_bootstrap.go +0 -94
- package/cmd/vip-next/update_bootstrap_test.go +0 -85
- package/cmd/vip-next/update_integration_test.go +0 -137
- package/cmd/vip-next-prerelease/main.go +0 -108
- package/cmd/vip-next-prerelease/main_test.go +0 -46
- package/docs/ARCHITECTURE.md +0 -95
- package/docs/BUILD-SIGNING.md +0 -501
- package/docs/CHANGELOG.md +0 -1844
- package/docs/COMMANDER-MIGRATION.md +0 -45
- package/docs/CONTRIBUTING.md +0 -29
- package/docs/CUTOVER-BREAKING-CHANGES.md +0 -261
- package/docs/DEBUGGING.md +0 -94
- package/docs/EDGE-WORKERS.md +0 -256
- package/docs/GO-UPDATES.md +0 -97
- package/docs/NPM-RELEASE-RECOVERY.md +0 -47
- package/docs/RELEASING.md +0 -211
- package/docs/SECURITY.md +0 -9
- package/docs/SETUP.md +0 -154
- package/docs/TESTING.md +0 -67
- package/docs/decisions/0001-operation-scoped-elevated-token-reuse.md +0 -87
- package/docs/dev-env-windows-wsl-testing.md +0 -191
- package/docs/vip-next-vip-command-reference.md +0 -257
- package/docs/vip-wp-line-parse-dfa.dot +0 -31
- package/eslint.config.js +0 -35
- package/fastlane/Fastfile +0 -204
- package/fastlane/example.env +0 -8
- package/fastlane/test_signing.rb +0 -83
- package/go.mod +0 -39
- package/go.sum +0 -127
- package/internal/appctx/app_resolver.go +0 -202
- package/internal/appctx/app_resolver_test.go +0 -187
- package/internal/appctx/confirm.go +0 -180
- package/internal/appctx/confirm_payload_test.go +0 -201
- package/internal/appctx/confirm_test.go +0 -120
- package/internal/appctx/context.go +0 -94
- package/internal/appctx/context_test.go +0 -56
- package/internal/appctx/env_resolver.go +0 -110
- package/internal/appctx/env_resolver_test.go +0 -215
- package/internal/appctx/format.go +0 -72
- package/internal/appctx/format_test.go +0 -75
- package/internal/appctx/interactive.go +0 -50
- package/internal/appctx/interactive_test.go +0 -134
- package/internal/appctx/middleware.go +0 -56
- package/internal/appctx/middleware_test.go +0 -88
- package/internal/appctx/prompts.go +0 -70
- package/internal/appctx/prompts_test.go +0 -97
- package/internal/appctx/required_args.go +0 -24
- package/internal/appctx/required_args_test.go +0 -38
- package/internal/appctx/telemetry.go +0 -22
- package/internal/appctx/telemetry_test.go +0 -42
- package/internal/appctx/wildcard.go +0 -29
- package/internal/appctx/wildcard_test.go +0 -53
- package/internal/auth/bypass.go +0 -84
- package/internal/auth/bypass_test.go +0 -97
- package/internal/auth/login.go +0 -156
- package/internal/auth/login_test.go +0 -184
- package/internal/auth/logout.go +0 -44
- package/internal/auth/logout_test.go +0 -78
- package/internal/auth/store.go +0 -130
- package/internal/auth/store_test.go +0 -339
- package/internal/auth/token.go +0 -117
- package/internal/auth/token_test.go +0 -90
- package/internal/backup/backup.go +0 -194
- package/internal/backup/backup_test.go +0 -228
- package/internal/cachepurge/cachepurge.go +0 -38
- package/internal/cachepurge/cachepurge_test.go +0 -92
- package/internal/customdeploy/archive.go +0 -205
- package/internal/customdeploy/archive_test.go +0 -174
- package/internal/customdeploy/customdeploy.go +0 -91
- package/internal/customdeploy/customdeploy_test.go +0 -82
- package/internal/debuglog/debuglog.go +0 -85
- package/internal/debuglog/debuglog_test.go +0 -44
- package/internal/defensivemode/api.go +0 -89
- package/internal/defensivemode/api_test.go +0 -122
- package/internal/devenv/adapters.go +0 -168
- package/internal/devenv/adapters_test.go +0 -44
- package/internal/devenv/adopt.go +0 -20
- package/internal/devenv/adopt_setup_test.go +0 -30
- package/internal/devenv/compose/labels.go +0 -90
- package/internal/devenv/compose/labels_test.go +0 -136
- package/internal/devenv/compose/project.go +0 -88
- package/internal/devenv/compose/project_test.go +0 -148
- package/internal/devenv/compose/render.go +0 -54
- package/internal/devenv/compose/render_test.go +0 -90
- package/internal/devenv/compose/services.go +0 -337
- package/internal/devenv/compose/services_test.go +0 -258
- package/internal/devenv/compose/testdata/full.golden.yml +0 -265
- package/internal/devenv/compose/types.go +0 -97
- package/internal/devenv/compose/types_test.go +0 -61
- package/internal/devenv/compose/view.go +0 -205
- package/internal/devenv/compose/view_test.go +0 -120
- package/internal/devenv/configfile.go +0 -300
- package/internal/devenv/configfile_test.go +0 -246
- package/internal/devenv/create.go +0 -130
- package/internal/devenv/create_test.go +0 -98
- package/internal/devenv/debug.go +0 -4
- package/internal/devenv/debug_test.go +0 -103
- package/internal/devenv/devenv.go +0 -434
- package/internal/devenv/devenv_test.go +0 -77
- package/internal/devenv/devexec.go +0 -140
- package/internal/devenv/devexec_test.go +0 -91
- package/internal/devenv/devlog/devlog.go +0 -219
- package/internal/devenv/devlog/devlog_test.go +0 -112
- package/internal/devenv/devterm/devterm.go +0 -65
- package/internal/devenv/devterm/devterm_pty.go +0 -58
- package/internal/devenv/devterm/devterm_stub.go +0 -20
- package/internal/devenv/devterm/devterm_test.go +0 -78
- package/internal/devenv/dockercli/capture.go +0 -84
- package/internal/devenv/dockercli/capture_test.go +0 -33
- package/internal/devenv/dockercli/compose.go +0 -30
- package/internal/devenv/dockercli/compose_test.go +0 -35
- package/internal/devenv/dockercli/runner.go +0 -214
- package/internal/devenv/dockercli/runner_test.go +0 -157
- package/internal/devenv/dockercli/socket.go +0 -56
- package/internal/devenv/dockercli/socket_test.go +0 -52
- package/internal/devenv/e2e_gate_test.go +0 -17
- package/internal/devenv/e2e_test.go +0 -499
- package/internal/devenv/e2esafety/gate_wiring_test.go +0 -90
- package/internal/devenv/e2esafety/safety.go +0 -52
- package/internal/devenv/e2esafety/safety_test.go +0 -71
- package/internal/devenv/eachenv_test.go +0 -132
- package/internal/devenv/editor.go +0 -82
- package/internal/devenv/editor_test.go +0 -60
- package/internal/devenv/envfile.go +0 -287
- package/internal/devenv/envvar.go +0 -165
- package/internal/devenv/envvar_test.go +0 -178
- package/internal/devenv/hostops/context.go +0 -38
- package/internal/devenv/hostops/context_test.go +0 -24
- package/internal/devenv/hostops/e2e_gate_test.go +0 -17
- package/internal/devenv/hostops/e2e_test.go +0 -429
- package/internal/devenv/hostops/elevate.go +0 -248
- package/internal/devenv/hostops/elevate_message_test.go +0 -35
- package/internal/devenv/hostops/elevate_test.go +0 -111
- package/internal/devenv/hostops/hosts.go +0 -255
- package/internal/devenv/hostops/hosts_test.go +0 -178
- package/internal/devenv/hostops/thumbprint_test.go +0 -57
- package/internal/devenv/hostops/trust.go +0 -115
- package/internal/devenv/hostops/trust_test.go +0 -90
- package/internal/devenv/hostrefresh.go +0 -127
- package/internal/devenv/hostrefresh_test.go +0 -123
- package/internal/devenv/importdata.go +0 -491
- package/internal/devenv/importdata_test.go +0 -142
- package/internal/devenv/importdecompress_test.go +0 -90
- package/internal/devenv/importgate_test.go +0 -166
- package/internal/devenv/importvalidate.go +0 -437
- package/internal/devenv/importvalidate_test.go +0 -293
- package/internal/devenv/info_table.go +0 -165
- package/internal/devenv/info_table_test.go +0 -111
- package/internal/devenv/instancedata/instancedata.go +0 -239
- package/internal/devenv/instancedata/instancedata_test.go +0 -281
- package/internal/devenv/instancedata/testdata/legacy_keys.json +0 -16
- package/internal/devenv/instancedata/testdata/unknown_keys.json +0 -19
- package/internal/devenv/lifecycle/adopt.go +0 -24
- package/internal/devenv/lifecycle/adopt_test.go +0 -43
- package/internal/devenv/lifecycle/health.go +0 -28
- package/internal/devenv/lifecycle/health_test.go +0 -34
- package/internal/devenv/lifecycle/hosts.go +0 -42
- package/internal/devenv/lifecycle/hosts_test.go +0 -41
- package/internal/devenv/lifecycle/migrate.go +0 -44
- package/internal/devenv/lifecycle/migrate_test.go +0 -78
- package/internal/devenv/lifecycle/pull.go +0 -19
- package/internal/devenv/lifecycle/pull_test.go +0 -29
- package/internal/devenv/lifecycle/setup.go +0 -35
- package/internal/devenv/lifecycle/setup_test.go +0 -46
- package/internal/devenv/lifecycle/start.go +0 -132
- package/internal/devenv/lifecycle/start_test.go +0 -350
- package/internal/devenv/lifecycle/teardown.go +0 -32
- package/internal/devenv/lifecycle/teardown_test.go +0 -83
- package/internal/devenv/lifecycle/types.go +0 -86
- package/internal/devenv/lifecycle/waiter.go +0 -49
- package/internal/devenv/lifecycle/waiter_test.go +0 -98
- package/internal/devenv/list.go +0 -49
- package/internal/devenv/list_test.go +0 -24
- package/internal/devenv/logs.go +0 -43
- package/internal/devenv/logs_test.go +0 -28
- package/internal/devenv/materialize.go +0 -44
- package/internal/devenv/materialize_test.go +0 -112
- package/internal/devenv/paths/paths.go +0 -42
- package/internal/devenv/paths/paths_test.go +0 -39
- package/internal/devenv/postimport.go +0 -134
- package/internal/devenv/postimport_test.go +0 -389
- package/internal/devenv/proxy/ca.go +0 -110
- package/internal/devenv/proxy/ca_test.go +0 -111
- package/internal/devenv/proxy/network.go +0 -28
- package/internal/devenv/proxy/network_test.go +0 -68
- package/internal/devenv/proxy/ports.go +0 -104
- package/internal/devenv/proxy/ports_test.go +0 -76
- package/internal/devenv/proxy/proxy.go +0 -143
- package/internal/devenv/proxy/proxy_test.go +0 -149
- package/internal/devenv/proxy/scripts/gen-certs.sh +0 -73
- package/internal/devenv/proxy/spec.go +0 -60
- package/internal/devenv/proxy/spec_test.go +0 -44
- package/internal/devenv/proxy/testhelpers_test.go +0 -7
- package/internal/devenv/proxy_policy_test.go +0 -155
- package/internal/devenv/syncplan.go +0 -573
- package/internal/devenv/syncplan_test.go +0 -256
- package/internal/devenv/syncsql.go +0 -247
- package/internal/devenv/syncsql_repair.go +0 -169
- package/internal/devenv/syncsql_repair_test.go +0 -150
- package/internal/devenv/syncsql_test.go +0 -220
- package/internal/devenv/update.go +0 -87
- package/internal/devenv/update_test.go +0 -47
- package/internal/edgeworkers/api.go +0 -173
- package/internal/edgeworkers/api_test.go +0 -256
- package/internal/edgeworkers/build.go +0 -188
- package/internal/edgeworkers/build_test.go +0 -175
- package/internal/edgeworkers/confirmation.go +0 -72
- package/internal/edgeworkers/deployment.go +0 -156
- package/internal/edgeworkers/deployment_test.go +0 -165
- package/internal/edgeworkers/output.go +0 -131
- package/internal/edgeworkers/output_test.go +0 -98
- package/internal/edgeworkers/project.go +0 -264
- package/internal/edgeworkers/project_test.go +0 -167
- package/internal/edgeworkers/scaffold.go +0 -88
- package/internal/edgeworkers/templates/README.md +0 -25
- package/internal/edgeworkers/templates/edge-workers.json +0 -4
- package/internal/edgeworkers/templates/gitignore +0 -2
- package/internal/edgeworkers/templates/package.json +0 -16
- package/internal/edgeworkers/templates/tsconfig.json +0 -6
- package/internal/edgeworkers/templates/worker.ts +0 -19
- package/internal/edgeworkers/types.go +0 -37
- package/internal/edgeworkers/validation.go +0 -177
- package/internal/envalias/envalias.go +0 -50
- package/internal/envalias/envalias_test.go +0 -147
- package/internal/envvar/envvar.go +0 -253
- package/internal/envvar/envvar_test.go +0 -274
- package/internal/envvar/reload_manifest.go +0 -99
- package/internal/envvar/reload_manifest_test.go +0 -44
- package/internal/envvar/value_confirm.go +0 -26
- package/internal/envvar/value_confirm_test.go +0 -22
- package/internal/exit/exit.go +0 -94
- package/internal/exit/exit_test.go +0 -119
- package/internal/gql/SCHEMA.md +0 -21
- package/internal/gql/client.go +0 -54
- package/internal/gql/client_test.go +0 -71
- package/internal/gql/debug_test.go +0 -79
- package/internal/gql/decoder_compat_helpers_test.go +0 -35
- package/internal/gql/decoder_compat_test.go +0 -78
- package/internal/gql/doc.go +0 -13
- package/internal/gql/edgeworkerinput/input.go +0 -58
- package/internal/gql/edgeworkerinput/input_test.go +0 -52
- package/internal/gql/error.go +0 -163
- package/internal/gql/error_test.go +0 -203
- package/internal/gql/generated.go +0 -10425
- package/internal/gql/genqlient.yaml +0 -26
- package/internal/gql/import_sql_marshal_test.go +0 -69
- package/internal/gql/operation.go +0 -67
- package/internal/gql/operation_test.go +0 -60
- package/internal/gql/operations/app_get.graphql +0 -43
- package/internal/gql/operations/app_list.graphql +0 -9
- package/internal/gql/operations/app_resolve.graphql +0 -37
- package/internal/gql/operations/backup_export_deploy.graphql +0 -123
- package/internal/gql/operations/cachepurge.graphql +0 -6
- package/internal/gql/operations/defensive_mode.graphql +0 -13
- package/internal/gql/operations/dev_env_create.graphql +0 -38
- package/internal/gql/operations/dev_env_sync.graphql +0 -15
- package/internal/gql/operations/edge_workers.graphql +0 -53
- package/internal/gql/operations/envvar.graphql +0 -52
- package/internal/gql/operations/fragments.graphql +0 -5
- package/internal/gql/operations/import_media.graphql +0 -61
- package/internal/gql/operations/import_sql.graphql +0 -135
- package/internal/gql/operations/logs.graphql +0 -22
- package/internal/gql/operations/me.graphql +0 -13
- package/internal/gql/operations/phpmyadmin.graphql +0 -21
- package/internal/gql/operations/slowlogs.graphql +0 -25
- package/internal/gql/operations/software.graphql +0 -53
- package/internal/gql/operations/sync.graphql +0 -51
- package/internal/gql/operations/wp.graphql +0 -37
- package/internal/gql/proxy_test.go +0 -62
- package/internal/gql/rechallenge.go +0 -218
- package/internal/gql/rechallenge_test.go +0 -471
- package/internal/gql/retry.go +0 -130
- package/internal/gql/retry_test.go +0 -230
- package/internal/gql/schema.gql +0 -9337
- package/internal/gql/transport.go +0 -65
- package/internal/gql/transport_helper.go +0 -24
- package/internal/httpproxy/callers_test.go +0 -211
- package/internal/httpproxy/debug_test.go +0 -32
- package/internal/httpproxy/httpproxy.go +0 -315
- package/internal/httpproxy/httpproxy_test.go +0 -435
- package/internal/installer/version.go +0 -41
- package/internal/installer/version_test.go +0 -33
- package/internal/keychain/fallback.go +0 -93
- package/internal/keychain/keychain.go +0 -197
- package/internal/keychain/keychain_select_test.go +0 -34
- package/internal/keychain/keychain_test.go +0 -112
- package/internal/logsapi/logsapi.go +0 -165
- package/internal/logsapi/logsapi_test.go +0 -82
- package/internal/mediaimport/mediaimport.go +0 -26
- package/internal/mediaimport/mediaimport_test.go +0 -46
- package/internal/mediaimport/status.go +0 -162
- package/internal/mediaimport/status_test.go +0 -159
- package/internal/mediaimport/tracker.go +0 -116
- package/internal/mediaimport/tracker_test.go +0 -62
- package/internal/nodeflags/nodeflags.go +0 -130
- package/internal/nodeflags/nodeflags_test.go +0 -138
- package/internal/nodeflags/optionalvalue.go +0 -123
- package/internal/nodeflags/optionalvalue_test.go +0 -158
- package/internal/output/csv.go +0 -178
- package/internal/output/fields.go +0 -22
- package/internal/output/fields_test.go +0 -21
- package/internal/output/ids.go +0 -26
- package/internal/output/ids_test.go +0 -32
- package/internal/output/json.go +0 -113
- package/internal/output/keyvalue.go +0 -35
- package/internal/output/keyvalue_block.go +0 -77
- package/internal/output/keyvalue_block_test.go +0 -95
- package/internal/output/keyvalue_test.go +0 -35
- package/internal/output/ordered.go +0 -44
- package/internal/output/ordered_test.go +0 -42
- package/internal/output/output.go +0 -62
- package/internal/output/output_test.go +0 -400
- package/internal/output/table.go +0 -231
- package/internal/output/table_layout.go +0 -472
- package/internal/output/table_layout_test.go +0 -107
- package/internal/output/table_layout_tty_test.go +0 -63
- package/internal/output/text.go +0 -24
- package/internal/output/text_test.go +0 -31
- package/internal/output/typename.go +0 -35
- package/internal/output/typename_test.go +0 -48
- package/internal/parity/backup_export_deploy_scenario_test.go +0 -285
- package/internal/parity/cache_scenario_test.go +0 -173
- package/internal/parity/command_surface_scenario_test.go +0 -530
- package/internal/parity/defensive_mode_scenario_test.go +0 -133
- package/internal/parity/diff.go +0 -128
- package/internal/parity/diff_test.go +0 -155
- package/internal/parity/differential_test.go +0 -166
- package/internal/parity/edge_workers_build_smoke_test.go +0 -69
- package/internal/parity/edge_workers_cases_test.go +0 -77
- package/internal/parity/edge_workers_debug_test.go +0 -87
- package/internal/parity/edge_workers_differential_test.go +0 -483
- package/internal/parity/edge_workers_prompt_test.go +0 -151
- package/internal/parity/env.go +0 -176
- package/internal/parity/env_test.go +0 -211
- package/internal/parity/envvar_mutation_scenario_test.go +0 -188
- package/internal/parity/harness.go +0 -28
- package/internal/parity/harness_test.go +0 -62
- package/internal/parity/import_media_scenario_test.go +0 -207
- package/internal/parity/import_sql_scenario_test.go +0 -198
- package/internal/parity/import_validate_sql_scenario_test.go +0 -68
- package/internal/parity/keychain.go +0 -538
- package/internal/parity/keychain_test.go +0 -201
- package/internal/parity/m5_differential_test.go +0 -185
- package/internal/parity/m5_scenarios_test.go +0 -225
- package/internal/parity/nodebin.go +0 -120
- package/internal/parity/nodebin_test.go +0 -148
- package/internal/parity/parker.go +0 -491
- package/internal/parity/parker_discovery.go +0 -373
- package/internal/parity/parker_discovery_test.go +0 -267
- package/internal/parity/parker_live_test.go +0 -164
- package/internal/parity/parker_test.go +0 -480
- package/internal/parity/pendo_test.go +0 -122
- package/internal/parity/phpmyadmin_scenario_test.go +0 -214
- package/internal/parity/runner.go +0 -56
- package/internal/parity/runner_test.go +0 -67
- package/internal/parity/scenario.go +0 -82
- package/internal/parity/scenario_test.go +0 -52
- package/internal/parity/surface_differential_test.go +0 -494
- package/internal/parity/sync_scenario_test.go +0 -172
- package/internal/parity/vendored_src_test.go +0 -84
- package/internal/parity/whoami_scenario_test.go +0 -69
- package/internal/parity/wp_scenario_test.go +0 -428
- package/internal/phpmyadmin/client.go +0 -221
- package/internal/phpmyadmin/client_test.go +0 -418
- package/internal/poll/poll.go +0 -85
- package/internal/poll/poll_test.go +0 -136
- package/internal/polling/polling.go +0 -97
- package/internal/polling/polling_test.go +0 -59
- package/internal/rechallenge/browser.go +0 -16
- package/internal/rechallenge/client.go +0 -198
- package/internal/rechallenge/client_test.go +0 -169
- package/internal/rechallenge/errors.go +0 -137
- package/internal/rechallenge/errors_test.go +0 -81
- package/internal/rechallenge/flow.go +0 -232
- package/internal/rechallenge/flow_noninteractive_test.go +0 -285
- package/internal/rechallenge/flow_test.go +0 -217
- package/internal/rechallenge/interactive.go +0 -90
- package/internal/rechallenge/interactive_test.go +0 -106
- package/internal/rechallenge/redact.go +0 -36
- package/internal/rechallenge/redact_test.go +0 -142
- package/internal/rechallenge/tokencache.go +0 -148
- package/internal/rechallenge/tokencache_test.go +0 -139
- package/internal/rechallenge/types.go +0 -100
- package/internal/rechallenge/types_test.go +0 -56
- package/internal/redact/redact.go +0 -99
- package/internal/redact/redact_test.go +0 -80
- package/internal/releasepromotion/buildkite.go +0 -233
- package/internal/releasepromotion/buildkite_test.go +0 -284
- package/internal/releasepromotion/contract.go +0 -165
- package/internal/releasepromotion/contract_test.go +0 -211
- package/internal/releasepromotion/github.go +0 -378
- package/internal/releasepromotion/github_test.go +0 -399
- package/internal/releasepromotion/optional_installers_test.go +0 -87
- package/internal/releasepromotion/promoter.go +0 -134
- package/internal/releasepromotion/promoter_test.go +0 -147
- package/internal/releasepromotion/verify.go +0 -239
- package/internal/releasepromotion/verify_test.go +0 -296
- package/internal/searchreplace/debug_test.go +0 -71
- package/internal/searchreplace/dumpdetails.go +0 -104
- package/internal/searchreplace/dumpdetails_test.go +0 -86
- package/internal/searchreplace/searchreplace.go +0 -261
- package/internal/searchreplace/searchreplace_test.go +0 -250
- package/internal/siteimport/debug_test.go +0 -34
- package/internal/siteimport/siteimport.go +0 -18
- package/internal/siteimport/siteimport_test.go +0 -19
- package/internal/siteimport/sitetype.go +0 -74
- package/internal/siteimport/sitetype_test.go +0 -62
- package/internal/siteimport/status.go +0 -282
- package/internal/siteimport/status_test.go +0 -234
- package/internal/slowlogsapi/slowlogsapi.go +0 -176
- package/internal/slowlogsapi/slowlogsapi_test.go +0 -93
- package/internal/softwaresettings/format.go +0 -192
- package/internal/softwaresettings/format_test.go +0 -123
- package/internal/sqlexport/diskspace.go +0 -36
- package/internal/sqlexport/diskspace_unix.go +0 -24
- package/internal/sqlexport/diskspace_windows.go +0 -26
- package/internal/sqlexport/download.go +0 -75
- package/internal/sqlexport/download_test.go +0 -103
- package/internal/sqlexport/export.go +0 -321
- package/internal/sqlexport/export_test.go +0 -313
- package/internal/sqlexport/format.go +0 -44
- package/internal/sqlexport/livecopy.go +0 -150
- package/internal/sqlexport/livecopy_test.go +0 -273
- package/internal/sqlvalidation/devenv_checks_test.go +0 -134
- package/internal/sqlvalidation/filename.go +0 -30
- package/internal/sqlvalidation/line_by_line.go +0 -91
- package/internal/sqlvalidation/line_by_line_test.go +0 -165
- package/internal/sqlvalidation/multisite.go +0 -31
- package/internal/sqlvalidation/multisite_test.go +0 -34
- package/internal/sqlvalidation/sql.go +0 -510
- package/internal/sqlvalidation/sql_test.go +0 -206
- package/internal/sync/sync.go +0 -246
- package/internal/sync/sync_test.go +0 -253
- package/internal/telemetry/config.go +0 -34
- package/internal/telemetry/default.go +0 -67
- package/internal/telemetry/default_endpoint_test.go +0 -111
- package/internal/telemetry/pendo.go +0 -185
- package/internal/telemetry/pendo_auth_test.go +0 -92
- package/internal/telemetry/pendo_test.go +0 -252
- package/internal/telemetry/scrub.go +0 -90
- package/internal/telemetry/scrub_test.go +0 -131
- package/internal/telemetry/tracker.go +0 -102
- package/internal/telemetry/tracker_test.go +0 -76
- package/internal/telemetry/tracks.go +0 -82
- package/internal/telemetry/tracks_test.go +0 -129
- package/internal/telemetry/uuid.go +0 -50
- package/internal/telemetry/uuid_test.go +0 -90
- package/internal/tui/progress.go +0 -153
- package/internal/tui/progress_test.go +0 -89
- package/internal/tui/progress_tracker.go +0 -299
- package/internal/tui/progress_tracker_test.go +0 -155
- package/internal/update/archive.go +0 -134
- package/internal/update/archive_test.go +0 -132
- package/internal/update/download.go +0 -138
- package/internal/update/download_test.go +0 -32
- package/internal/update/github.go +0 -121
- package/internal/update/install.go +0 -265
- package/internal/update/install_test.go +0 -151
- package/internal/update/lock_unix.go +0 -23
- package/internal/update/lock_windows.go +0 -22
- package/internal/update/native_test.go +0 -70
- package/internal/update/notify.go +0 -91
- package/internal/update/ownership.go +0 -117
- package/internal/update/ownership_test.go +0 -102
- package/internal/update/release.go +0 -120
- package/internal/update/release_test.go +0 -168
- package/internal/update/service.go +0 -197
- package/internal/update/service_test.go +0 -118
- package/internal/update/state.go +0 -116
- package/internal/update/state_test.go +0 -132
- package/internal/upload/debug_test.go +0 -76
- package/internal/upload/filemeta.go +0 -112
- package/internal/upload/filemeta_test.go +0 -94
- package/internal/upload/multipart.go +0 -215
- package/internal/upload/multipart_test.go +0 -210
- package/internal/upload/orchestrate.go +0 -81
- package/internal/upload/parts.go +0 -39
- package/internal/upload/parts_test.go +0 -39
- package/internal/upload/presign.go +0 -103
- package/internal/upload/presign_test.go +0 -128
- package/internal/upload/proxy_test.go +0 -55
- package/internal/upload/putobject.go +0 -92
- package/internal/upload/putobject_test.go +0 -79
- package/internal/upload/retry.go +0 -45
- package/internal/upload/upload.go +0 -22
- package/internal/upload/xmlerror.go +0 -28
- package/internal/validatefiles/files.go +0 -105
- package/internal/validatefiles/files_test.go +0 -143
- package/internal/validatefiles/report.go +0 -172
- package/internal/validatefiles/validatefiles.go +0 -271
- package/internal/validatefiles/validatefiles_test.go +0 -127
- package/internal/version/stamp.go +0 -15
- package/internal/version/stamp_test.go +0 -25
- package/internal/version/version.go +0 -14
- package/internal/version/version_test.go +0 -25
- package/internal/wpshell/parser.go +0 -68
- package/internal/wpshell/parser_test.go +0 -58
- package/internal/wpshell/repl.go +0 -81
- package/internal/wpshell/repl_test.go +0 -71
- package/internal/wpshell/requote.go +0 -13
- package/internal/wpshell/requote_test.go +0 -15
- package/internal/wpssh/debug_test.go +0 -67
- package/internal/wpssh/wpssh.go +0 -124
- package/internal/wpssh/wpssh_test.go +0 -203
- package/internal/wpstream/debug_test.go +0 -116
- package/internal/wpstream/e2e_test.go +0 -178
- package/internal/wpstream/engineio.go +0 -291
- package/internal/wpstream/engineio_test.go +0 -82
- package/internal/wpstream/iostream.go +0 -391
- package/internal/wpstream/iostream_test.go +0 -138
- package/internal/wpstream/run.go +0 -364
- package/internal/wpstream/run_test.go +0 -184
- package/internal/wpstream/socketio.go +0 -435
- package/internal/wpstream/socketio_test.go +0 -402
- package/internal/wpstream/testdata/fixture-server.js +0 -54
- package/make.ps1 +0 -155
- package/node_modules/@apollo/client/__cjs/utilities/internal/types/DeferInfo.cjs +0 -3
- package/node_modules/@apollo/client/__cjs/utilities/internal/types/DeferInfo.cjs.map +0 -1
- package/node_modules/@apollo/client/__cjs/utilities/internal/types/DeferInfo.d.cts +0 -10
- package/node_modules/@apollo/client/utilities/internal/types/DeferInfo.d.ts +0 -10
- package/node_modules/@apollo/client/utilities/internal/types/DeferInfo.js +0 -2
- package/node_modules/@apollo/client/utilities/internal/types/DeferInfo.js.map +0 -1
- package/node_modules/argparse/LICENSE +0 -254
- package/node_modules/argparse/README.md +0 -84
- package/node_modules/argparse/package.json +0 -31
- package/node_modules/lando/node_modules/cliui/build/index.cjs +0 -302
- package/node_modules/lando/node_modules/cliui/build/lib/string-utils.js +0 -27
- package/node_modules/lando/node_modules/js-yaml/README.md +0 -233
- package/node_modules/lando/node_modules/js-yaml/bin/js-yaml.js +0 -117
- package/node_modules/lando/node_modules/js-yaml/dist/js-yaml.js +0 -3022
- package/node_modules/lando/node_modules/js-yaml/dist/js-yaml.js.map +0 -1
- package/node_modules/lando/node_modules/js-yaml/dist/js-yaml.min.js +0 -2
- package/node_modules/lando/node_modules/js-yaml/dist/js-yaml.min.js.map +0 -1
- package/node_modules/lando/node_modules/js-yaml/dist/js-yaml.mjs +0 -3082
- package/node_modules/lando/node_modules/js-yaml/dist/js-yaml.mjs.map +0 -1
- package/node_modules/lando/node_modules/js-yaml/index.js +0 -44
- package/node_modules/lando/node_modules/js-yaml/lib/common.js +0 -50
- package/node_modules/lando/node_modules/js-yaml/lib/dumper.js +0 -937
- package/node_modules/lando/node_modules/js-yaml/lib/exception.js +0 -51
- package/node_modules/lando/node_modules/js-yaml/lib/index_vite_proxy.tmp.mjs +0 -37
- package/node_modules/lando/node_modules/js-yaml/lib/loader.js +0 -1803
- package/node_modules/lando/node_modules/js-yaml/lib/schema/core.js +0 -9
- package/node_modules/lando/node_modules/js-yaml/lib/schema/default.js +0 -20
- package/node_modules/lando/node_modules/js-yaml/lib/schema/failsafe.js +0 -14
- package/node_modules/lando/node_modules/js-yaml/lib/schema/json.js +0 -17
- package/node_modules/lando/node_modules/js-yaml/lib/schema.js +0 -109
- package/node_modules/lando/node_modules/js-yaml/lib/snippet.js +0 -96
- package/node_modules/lando/node_modules/js-yaml/lib/type/binary.js +0 -122
- package/node_modules/lando/node_modules/js-yaml/lib/type/bool.js +0 -35
- package/node_modules/lando/node_modules/js-yaml/lib/type/float.js +0 -99
- package/node_modules/lando/node_modules/js-yaml/lib/type/int.js +0 -142
- package/node_modules/lando/node_modules/js-yaml/lib/type/map.js +0 -8
- package/node_modules/lando/node_modules/js-yaml/lib/type/merge.js +0 -12
- package/node_modules/lando/node_modules/js-yaml/lib/type/null.js +0 -35
- package/node_modules/lando/node_modules/js-yaml/lib/type/omap.js +0 -45
- package/node_modules/lando/node_modules/js-yaml/lib/type/pairs.js +0 -50
- package/node_modules/lando/node_modules/js-yaml/lib/type/seq.js +0 -8
- package/node_modules/lando/node_modules/js-yaml/lib/type/set.js +0 -29
- package/node_modules/lando/node_modules/js-yaml/lib/type/str.js +0 -8
- package/node_modules/lando/node_modules/js-yaml/lib/type/timestamp.js +0 -88
- package/node_modules/lando/node_modules/js-yaml/lib/type.js +0 -66
- package/node_modules/lando/node_modules/js-yaml/package.json +0 -83
- package/node_modules/lando/node_modules/wrap-ansi/index.js +0 -216
- package/node_modules/lando/node_modules/wrap-ansi/package.json +0 -62
- package/node_modules/lando/node_modules/wrap-ansi/readme.md +0 -91
- package/node_modules/lando/node_modules/yargs/build/index.cjs +0 -2920
- package/node_modules/lando/node_modules/yargs/helpers/index.js +0 -14
- package/node_modules/lando/node_modules/yargs/index.cjs +0 -39
- package/node_modules/lando/node_modules/yargs/yargs +0 -9
- package/node_modules/lando/node_modules/yargs-parser/build/index.cjs +0 -1042
- package/node_modules/lando/plugins/lando-test/index.js +0 -3
- package/node_modules/lando/plugins/lando-test/plugin.yml +0 -2
- package/packaging/macos/build-pkg.sh +0 -53
- package/packaging/macos/preinstall +0 -33
- package/packaging/macos/test-install.sh +0 -51
- package/packaging/macos/test_package.py +0 -74
- package/packaging/macos/uninstall.sh +0 -24
- package/packaging/macos/verify-pkg.py +0 -61
- package/packaging/windows/build-msi.ps1 +0 -153
- package/packaging/windows/test-msi.ps1 +0 -225
- package/packaging/windows/verify-msi.ps1 +0 -74
- package/packaging/windows/vip-next.wxs +0 -79
- package/scripts/catalog_script_test.go +0 -123
- package/scripts/vip-next-command-catalog.sh +0 -506
- package/test-utils/undici-mock.js +0 -25
- package/testdata/installer-fixture/main.go +0 -40
- package/testdata/parity/app-deploy-completed.yaml +0 -14
- package/testdata/parity/app-deploy-missing-token.yaml +0 -21
- package/testdata/parity/app-deploy-validate-clean.yaml +0 -11
- package/testdata/parity/app-deploy-validate-missing-themes.yaml +0 -21
- package/testdata/parity/app-get-baseline.yaml +0 -14
- package/testdata/parity/app-get-custom-deploy.yaml +0 -14
- package/testdata/parity/app-get-json.yaml +0 -14
- package/testdata/parity/app-get-not-found.yaml +0 -13
- package/testdata/parity/app-list-baseline.yaml +0 -14
- package/testdata/parity/app-list-csv.yaml +0 -13
- package/testdata/parity/app-list-empty.yaml +0 -13
- package/testdata/parity/app-list-ids.yaml +0 -26
- package/testdata/parity/app-list-json.yaml +0 -13
- package/testdata/parity/app-list-unknown-format.yaml +0 -29
- package/testdata/parity/backup-db-already-in-progress.yaml +0 -15
- package/testdata/parity/backup-db-completed.yaml +0 -14
- package/testdata/parity/backup-db-help.yaml +0 -10
- package/testdata/parity/cache-purge-url-empty.yaml +0 -26
- package/testdata/parity/cache-purge-url-from-file.yaml +0 -21
- package/testdata/parity/cache-purge-url-multi.yaml +0 -19
- package/testdata/parity/cache-purge-url-single.yaml +0 -18
- package/testdata/parity/defensive-mode-enable-with-rechallenge.yaml +0 -20
- package/testdata/parity/edge-workers-artifact-symlink.yaml +0 -8
- package/testdata/parity/edge-workers-bare-location.yaml +0 -8
- package/testdata/parity/edge-workers-bare-path.yaml +0 -8
- package/testdata/parity/edge-workers-bare-type.yaml +0 -8
- package/testdata/parity/edge-workers-build-all.yaml +0 -8
- package/testdata/parity/edge-workers-build-compiler-error.yaml +0 -8
- package/testdata/parity/edge-workers-build-empty.yaml +0 -8
- package/testdata/parity/edge-workers-build-missing-compiler.yaml +0 -8
- package/testdata/parity/edge-workers-build-name-all.yaml +0 -8
- package/testdata/parity/edge-workers-build-one.yaml +0 -8
- package/testdata/parity/edge-workers-delete-force.yaml +0 -8
- package/testdata/parity/edge-workers-delete-rejected.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-active-update-enable.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-active-update.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-all-preparation-failure.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-create-enable.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-create.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-enable-failure.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-inactive-update-enable.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-inactive-update.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-location-clear.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-location-preserve.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-location-replace.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-name-all.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-production-refused.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-production-skip.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-skip-source-create.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-skip-source.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-skip-validate.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-source-empty.yaml +0 -8
- package/testdata/parity/edge-workers-deploy-upload-failure.yaml +0 -8
- package/testdata/parity/edge-workers-disable.yaml +0 -8
- package/testdata/parity/edge-workers-double-dash.yaml +0 -8
- package/testdata/parity/edge-workers-duplicate-names.yaml +0 -8
- package/testdata/parity/edge-workers-enable-production-refused.yaml +0 -8
- package/testdata/parity/edge-workers-enable.yaml +0 -8
- package/testdata/parity/edge-workers-entry-escape.yaml +0 -8
- package/testdata/parity/edge-workers-get-empty-source.yaml +0 -8
- package/testdata/parity/edge-workers-get-missing.yaml +0 -8
- package/testdata/parity/edge-workers-get-no-source.yaml +0 -8
- package/testdata/parity/edge-workers-get-source.yaml +0 -8
- package/testdata/parity/edge-workers-get.yaml +0 -8
- package/testdata/parity/edge-workers-init-invalid-type.yaml +0 -8
- package/testdata/parity/edge-workers-init-nonempty.yaml +0 -8
- package/testdata/parity/edge-workers-init.yaml +0 -8
- package/testdata/parity/edge-workers-json-control-name.yaml +0 -8
- package/testdata/parity/edge-workers-list-csv.yaml +0 -8
- package/testdata/parity/edge-workers-list-empty-json.yaml +0 -8
- package/testdata/parity/edge-workers-list-empty.yaml +0 -8
- package/testdata/parity/edge-workers-list-json.yaml +0 -8
- package/testdata/parity/edge-workers-list-table.yaml +0 -8
- package/testdata/parity/edge-workers-mutation-graphql-error.yaml +0 -8
- package/testdata/parity/edge-workers-mutation-null.yaml +0 -8
- package/testdata/parity/edge-workers-new-invalid-location.yaml +0 -8
- package/testdata/parity/edge-workers-new-invalid-name.yaml +0 -8
- package/testdata/parity/edge-workers-new-location.yaml +0 -8
- package/testdata/parity/edge-workers-new.yaml +0 -8
- package/testdata/parity/edge-workers-read-null.yaml +0 -8
- package/testdata/parity/edge-workers-repeated-path.yaml +0 -8
- package/testdata/parity/edge-workers-repeated-type.yaml +0 -8
- package/testdata/parity/edge-workers-short-equals.yaml +0 -8
- package/testdata/parity/edge-workers-table-control-name.yaml +0 -8
- package/testdata/parity/edge-workers-unicode-order.yaml +0 -8
- package/testdata/parity/edge-workers-validate-all.yaml +0 -8
- package/testdata/parity/edge-workers-validate-invalid.yaml +0 -8
- package/testdata/parity/edge-workers-validate-name-all.yaml +0 -8
- package/testdata/parity/edge-workers-validate-no-artifact.yaml +0 -8
- package/testdata/parity/edge-workers-validate-no-name.yaml +0 -8
- package/testdata/parity/edge-workers-validate-null.yaml +0 -8
- package/testdata/parity/edge-workers-validate.yaml +0 -8
- package/testdata/parity/envvar-delete-baseline.yaml +0 -19
- package/testdata/parity/envvar-delete-prod-cancel.yaml +0 -41
- package/testdata/parity/envvar-delete-typed-mismatch.yaml +0 -44
- package/testdata/parity/envvar-get-baseline.yaml +0 -14
- package/testdata/parity/envvar-get-lowercase-input.yaml +0 -14
- package/testdata/parity/envvar-get-named-help.yaml +0 -24
- package/testdata/parity/envvar-get-not-found.yaml +0 -17
- package/testdata/parity/envvar-getall-baseline.yaml +0 -14
- package/testdata/parity/envvar-getall-empty.yaml +0 -15
- package/testdata/parity/envvar-getall-keyvalue.yaml +0 -22
- package/testdata/parity/envvar-list-baseline.yaml +0 -15
- package/testdata/parity/envvar-list-empty.yaml +0 -15
- package/testdata/parity/envvar-list-ids.yaml +0 -14
- package/testdata/parity/envvar-list-json.yaml +0 -14
- package/testdata/parity/envvar-list-keyvalue.yaml +0 -22
- package/testdata/parity/envvar-set-baseline.yaml +0 -21
- package/testdata/parity/envvar-set-invalid-name.yaml +0 -20
- package/testdata/parity/envvar-set-newrelic-blocked.yaml +0 -21
- package/testdata/parity/envvar-set-prod-cancel.yaml +0 -42
- package/testdata/parity/envvar-set-prod-confirm-skipped.yaml +0 -20
- package/testdata/parity/export-sql-completed.yaml +0 -14
- package/testdata/parity/export-sql-config-conflict.yaml +0 -21
- package/testdata/parity/export-sql-help.yaml +0 -11
- package/testdata/parity/import-media-abort-noninteractive.yaml +0 -19
- package/testdata/parity/import-media-help.yaml +0 -12
- package/testdata/parity/import-media-invalid-archive.yaml +0 -18
- package/testdata/parity/import-media-status-completed.yaml +0 -19
- package/testdata/parity/import-media-status-failed.yaml +0 -18
- package/testdata/parity/import-media-url-completed.yaml +0 -18
- package/testdata/parity/import-sql-bad-extension.yaml +0 -26
- package/testdata/parity/import-sql-help.yaml +0 -12
- package/testdata/parity/import-sql-in-progress.yaml +0 -26
- package/testdata/parity/import-sql-invalid-md5.yaml +0 -27
- package/testdata/parity/import-sql-noninteractive-abort.yaml +0 -20
- package/testdata/parity/import-sql-status-completed.yaml +0 -17
- package/testdata/parity/import-sql-status-no-job.yaml +0 -17
- package/testdata/parity/import-sql-validation-failure.yaml +0 -18
- package/testdata/parity/import-validate-files-clean.yaml +0 -18
- package/testdata/parity/import-validate-files-not-dir.yaml +0 -16
- package/testdata/parity/import-validate-sql-clean.yaml +0 -23
- package/testdata/parity/import-validate-sql-dangerous-stmt.yaml +0 -27
- package/testdata/parity/import-validate-sql-multisite-warn.yaml +0 -23
- package/testdata/parity/logs-baseline.yaml +0 -24
- package/testdata/parity/logs-batch.yaml +0 -24
- package/testdata/parity/logs-empty.yaml +0 -15
- package/testdata/parity/logs-format-json.yaml +0 -15
- package/testdata/parity/logs-limit-100.yaml +0 -24
- package/testdata/parity/phpmyadmin-error.yaml +0 -24
- package/testdata/parity/phpmyadmin-print.yaml +0 -22
- package/testdata/parity/phpmyadmin-silent.yaml +0 -16
- package/testdata/parity/recordings/app-get-baseline/app.json +0 -11
- package/testdata/parity/recordings/app-get-custom-deploy/app.json +0 -8
- package/testdata/parity/recordings/app-get-json/app.json +0 -11
- package/testdata/parity/recordings/app-get-not-found/app.json +0 -1
- package/testdata/parity/recordings/app-list-baseline/apps.json +0 -1
- package/testdata/parity/recordings/app-list-csv/apps.json +0 -1
- package/testdata/parity/recordings/app-list-empty/apps.json +0 -1
- package/testdata/parity/recordings/app-list-json/apps.json +0 -1
- package/testdata/parity/recordings/backup-db-already-in-progress/backup-status-1.json +0 -1
- package/testdata/parity/recordings/backup-db-already-in-progress/backup-status-2.json +0 -1
- package/testdata/parity/recordings/backup-db-completed/backup-status-1.json +0 -1
- package/testdata/parity/recordings/backup-db-completed/backup-status-2.json +0 -1
- package/testdata/parity/recordings/backup-db-completed/backup-status-3.json +0 -1
- package/testdata/parity/recordings/cache-purge-url-empty/resolve-app.json +0 -1
- package/testdata/parity/recordings/cache-purge-url-from-file/purge.json +0 -1
- package/testdata/parity/recordings/cache-purge-url-from-file/resolve-app.json +0 -1
- package/testdata/parity/recordings/cache-purge-url-from-file/urls.txt +0 -2
- package/testdata/parity/recordings/cache-purge-url-multi/purge.json +0 -1
- package/testdata/parity/recordings/cache-purge-url-multi/resolve-app.json +0 -1
- package/testdata/parity/recordings/cache-purge-url-single/purge.json +0 -1
- package/testdata/parity/recordings/cache-purge-url-single/resolve-app.json +0 -1
- package/testdata/parity/recordings/config-software-get/resolve-app.json +0 -1
- package/testdata/parity/recordings/config-software-update/resolve-app.json +0 -1
- package/testdata/parity/recordings/defensive-mode-enable-rechallenge/mutation-elevated.json +0 -1
- package/testdata/parity/recordings/defensive-mode-enable-rechallenge/mutation-success.json +0 -1
- package/testdata/parity/recordings/defensive-mode-enable-rechallenge/parker-create-session.json +0 -1
- package/testdata/parity/recordings/defensive-mode-enable-rechallenge/parker-exchange.json +0 -1
- package/testdata/parity/recordings/defensive-mode-enable-rechallenge/parker-status-verified.json +0 -1
- package/testdata/parity/recordings/envvar-delete-baseline/delete.json +0 -1
- package/testdata/parity/recordings/envvar-delete-baseline/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-delete-prod-cancel/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-delete-typed-mismatch/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-get-baseline/envvars.json +0 -1
- package/testdata/parity/recordings/envvar-get-baseline/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-get-lowercase-input/envvars.json +0 -1
- package/testdata/parity/recordings/envvar-get-lowercase-input/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-get-named-help/envvars.json +0 -1
- package/testdata/parity/recordings/envvar-get-named-help/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-get-not-found/envvars.json +0 -1
- package/testdata/parity/recordings/envvar-get-not-found/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-getall-baseline/envvars.json +0 -1
- package/testdata/parity/recordings/envvar-getall-baseline/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-getall-empty/envvars.json +0 -1
- package/testdata/parity/recordings/envvar-getall-empty/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-getall-keyvalue/envvars.json +0 -1
- package/testdata/parity/recordings/envvar-getall-keyvalue/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-list-baseline/envvars.json +0 -1
- package/testdata/parity/recordings/envvar-list-baseline/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-list-empty/envvars.json +0 -1
- package/testdata/parity/recordings/envvar-list-empty/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-list-ids/envvars.json +0 -1
- package/testdata/parity/recordings/envvar-list-ids/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-list-json/envvars.json +0 -1
- package/testdata/parity/recordings/envvar-list-json/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-list-keyvalue/envvars.json +0 -1
- package/testdata/parity/recordings/envvar-list-keyvalue/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-set-baseline/add.json +0 -1
- package/testdata/parity/recordings/envvar-set-baseline/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-set-baseline/value.txt +0 -1
- package/testdata/parity/recordings/envvar-set-invalid-name/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-set-invalid-name/value.txt +0 -1
- package/testdata/parity/recordings/envvar-set-newrelic-blocked/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-set-newrelic-blocked/value.txt +0 -1
- package/testdata/parity/recordings/envvar-set-prod-cancel/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-set-prod-cancel/value.txt +0 -1
- package/testdata/parity/recordings/envvar-set-prod-confirm-skipped/add.json +0 -1
- package/testdata/parity/recordings/envvar-set-prod-confirm-skipped/resolve-app.json +0 -1
- package/testdata/parity/recordings/envvar-set-prod-confirm-skipped/value.txt +0 -1
- package/testdata/parity/recordings/export-sql-completed/export-status-1.json +0 -1
- package/testdata/parity/recordings/export-sql-completed/export-status-2.json +0 -1
- package/testdata/parity/recordings/import-media-invalid-archive/file.sql +0 -1
- package/testdata/parity/recordings/import-media-shared/abort-media-import.json +0 -1
- package/testdata/parity/recordings/import-media-shared/env-info.json +0 -1
- package/testdata/parity/recordings/import-media-shared/resolve-app.json +0 -1
- package/testdata/parity/recordings/import-media-shared/start-media-import.json +0 -1
- package/testdata/parity/recordings/import-media-status-completed/progress.json +0 -1
- package/testdata/parity/recordings/import-media-status-failed/progress.json +0 -1
- package/testdata/parity/recordings/import-media-url-completed/progress.json +0 -1
- package/testdata/parity/recordings/import-sql-bad-extension/file.txt +0 -1
- package/testdata/parity/recordings/import-sql-in-progress/env-info.json +0 -1
- package/testdata/parity/recordings/import-sql-in-progress/resolve-app.json +0 -1
- package/testdata/parity/recordings/import-sql-noninteractive-abort/clean.sql +0 -5
- package/testdata/parity/recordings/import-sql-shared/env-info.json +0 -1
- package/testdata/parity/recordings/import-sql-shared/multisite.json +0 -1
- package/testdata/parity/recordings/import-sql-shared/resolve-app.json +0 -1
- package/testdata/parity/recordings/import-sql-status-completed/progress.json +0 -1
- package/testdata/parity/recordings/import-sql-status-no-job/progress.json +0 -1
- package/testdata/parity/recordings/import-sql-validation-failure/dirty.sql +0 -6
- package/testdata/parity/recordings/import-validate-files-clean/config.json +0 -1
- package/testdata/parity/recordings/import-validate-files-clean/uploads/2020/06/a.jpg +0 -1
- package/testdata/parity/recordings/import-validate-files-clean/uploads/2020/06/b.png +0 -1
- package/testdata/parity/recordings/import-validate-sql-clean/clean.sql +0 -17
- package/testdata/parity/recordings/import-validate-sql-dangerous-stmt/dangerous.sql +0 -11
- package/testdata/parity/recordings/import-validate-sql-multisite-warn/multisite.sql +0 -12
- package/testdata/parity/recordings/logs-baseline/logs.json +0 -1
- package/testdata/parity/recordings/logs-baseline/resolve-app.json +0 -1
- package/testdata/parity/recordings/logs-batch/logs.json +0 -1
- package/testdata/parity/recordings/logs-batch/resolve-app.json +0 -1
- package/testdata/parity/recordings/logs-empty/logs.json +0 -1
- package/testdata/parity/recordings/logs-empty/resolve-app.json +0 -1
- package/testdata/parity/recordings/logs-format-json/logs.json +0 -1
- package/testdata/parity/recordings/logs-format-json/resolve-app.json +0 -1
- package/testdata/parity/recordings/logs-limit-100/logs.json +0 -1
- package/testdata/parity/recordings/logs-limit-100/resolve-app.json +0 -1
- package/testdata/parity/recordings/m7c-shared/resolve-app.json +0 -1
- package/testdata/parity/recordings/phpmyadmin-error/enable.json +0 -1
- package/testdata/parity/recordings/phpmyadmin-error/resolve-app.json +0 -1
- package/testdata/parity/recordings/phpmyadmin-print/enable.json +0 -1
- package/testdata/parity/recordings/phpmyadmin-print/generate.json +0 -1
- package/testdata/parity/recordings/phpmyadmin-print/resolve-app.json +0 -1
- package/testdata/parity/recordings/phpmyadmin-print/status.json +0 -1
- package/testdata/parity/recordings/phpmyadmin-silent/enable.json +0 -1
- package/testdata/parity/recordings/phpmyadmin-silent/generate.json +0 -1
- package/testdata/parity/recordings/phpmyadmin-silent/resolve-app.json +0 -1
- package/testdata/parity/recordings/phpmyadmin-silent/status.json +0 -1
- package/testdata/parity/recordings/slowlogs-baseline/resolve-app.json +0 -1
- package/testdata/parity/recordings/slowlogs-baseline/slowlogs.json +0 -1
- package/testdata/parity/recordings/slowlogs-csv/resolve-app.json +0 -1
- package/testdata/parity/recordings/slowlogs-csv/slowlogs.json +0 -1
- package/testdata/parity/recordings/slowlogs-empty/resolve-app.json +0 -1
- package/testdata/parity/recordings/slowlogs-empty/slowlogs.json +0 -1
- package/testdata/parity/recordings/slowlogs-limit-50/resolve-app.json +0 -1
- package/testdata/parity/recordings/slowlogs-limit-50/slowlogs.json +0 -1
- package/testdata/parity/recordings/sync-already-syncing/resolve-app.json +0 -1
- package/testdata/parity/recordings/sync-already-syncing/sync-start.json +0 -1
- package/testdata/parity/recordings/sync-already-syncing/sync-status-1.json +0 -1
- package/testdata/parity/recordings/sync-already-syncing/sync-status-2.json +0 -1
- package/testdata/parity/recordings/sync-baseline/resolve-app.json +0 -1
- package/testdata/parity/recordings/sync-baseline/sync-start.json +0 -1
- package/testdata/parity/recordings/sync-baseline/sync-status-1.json +0 -1
- package/testdata/parity/recordings/sync-baseline/sync-status-2.json +0 -1
- package/testdata/parity/recordings/whoami-baseline/me-response.json +0 -1
- package/testdata/parity/recordings/wp-nodejs-rejected/resolve-app.json +0 -1
- package/testdata/parity/recordings/wp-production-confirm-decline/resolve-app.json +0 -1
- package/testdata/parity/recordings/wp-ssh-happy/resolve-app.json +0 -1
- package/testdata/parity/recordings/wp-websocket-redirect/resolve-app.json +0 -1
- package/testdata/parity/slowlogs-baseline.yaml +0 -18
- package/testdata/parity/slowlogs-csv.yaml +0 -16
- package/testdata/parity/slowlogs-empty.yaml +0 -17
- package/testdata/parity/slowlogs-limit-50.yaml +0 -16
- package/testdata/parity/sync-already-syncing.yaml +0 -20
- package/testdata/parity/sync-baseline.yaml +0 -19
- package/testdata/parity/version-smoke.yaml +0 -14
- package/testdata/parity/whoami-baseline.yaml +0 -14
- package/testdata/parity/wp-help.yaml +0 -12
- package/testdata/parity/wp-nodejs-rejected.yaml +0 -13
- package/testdata/parity/wp-production-confirm-decline.yaml +0 -14
- package/testdata/parity/wp-ssh-happy.yaml +0 -15
- package/testdata/parity/wp-websocket-redirect.yaml +0 -14
- package/testdata/parity-local/app-get-csv.yaml +0 -8
- package/testdata/parity-local/app-get-json.yaml +0 -8
- package/testdata/parity-local/app-get-table.yaml +0 -8
- package/testdata/parity-local/app-list-csv.yaml +0 -8
- package/testdata/parity-local/app-list-json.yaml +0 -8
- package/testdata/parity-local/app-list-table.yaml +0 -8
- package/testdata/parity-local/edge-workers/basic/edge-workers.json +0 -1
- package/testdata/parity-local/edge-workers/basic/workers/headers/assembly/index.ts +0 -1
- package/testdata/parity-local/edge-workers/basic/workers/headers/worker.json +0 -1
- package/testdata/parity-local/edge-workers/two-workers/edge-workers.json +0 -1
- package/testdata/parity-local/edge-workers/two-workers/workers/a/assembly/index.ts +0 -1
- package/testdata/parity-local/edge-workers/two-workers/workers/a/worker.json +0 -1
- package/testdata/parity-local/edge-workers/two-workers/workers/b/assembly/index.ts +0 -1
- package/testdata/parity-local/edge-workers/two-workers/workers/b/worker.json +0 -1
- package/testdata/parity-local/envvar-list-csv.yaml +0 -8
- package/testdata/parity-local/envvar-list-ids.yaml +0 -8
- package/testdata/parity-local/envvar-list-json.yaml +0 -8
- package/testdata/parity-local/envvar-list-keyvalue.yaml +0 -8
- package/testdata/parity-local/envvar-list-table.yaml +0 -8
- package/testdata/parity-local/software-get-csv.yaml +0 -8
- package/testdata/parity-local/software-get-json.yaml +0 -8
- package/testdata/parity-local/software-get-table.yaml +0 -8
- package/testdata/parity-local/whoami.yaml +0 -8
- package/testdata/update-fixture/main.go +0 -62
- package/third_party/go-search-replace/MANIFEST +0 -33
- package/tsconfig.json +0 -25
- /package/node_modules/lando/node_modules/{wrap-ansi → ansi-regex}/license +0 -0
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _YargsInstance_command, _YargsInstance_cwd, _YargsInstance_context, _YargsInstance_completion, _YargsInstance_completionCommand, _YargsInstance_defaultShowHiddenOpt, _YargsInstance_exitError, _YargsInstance_detectLocale, _YargsInstance_emittedWarnings, _YargsInstance_exitProcess, _YargsInstance_frozens, _YargsInstance_globalMiddleware, _YargsInstance_groups, _YargsInstance_hasOutput, _YargsInstance_helpOpt, _YargsInstance_isGlobalContext, _YargsInstance_logger, _YargsInstance_output, _YargsInstance_options, _YargsInstance_parentRequire, _YargsInstance_parserConfig, _YargsInstance_parseFn, _YargsInstance_parseContext, _YargsInstance_pkgs, _YargsInstance_preservedGroups, _YargsInstance_processArgs, _YargsInstance_recommendCommands, _YargsInstance_shim, _YargsInstance_strict, _YargsInstance_strictCommands, _YargsInstance_strictOptions, _YargsInstance_usage, _YargsInstance_usageConfig, _YargsInstance_versionOpt, _YargsInstance_validation;
|
|
1
13
|
import { command as Command, } from './command.js';
|
|
2
14
|
import { assertNotStrictEqual, assertSingleKey, objectKeys, } from './typings/common-types.js';
|
|
3
15
|
import { YError } from './yerror.js';
|
|
@@ -7,389 +19,325 @@ import { completion as Completion, } from './completion.js';
|
|
|
7
19
|
import { validation as Validation, } from './validation.js';
|
|
8
20
|
import { objFilter } from './utils/obj-filter.js';
|
|
9
21
|
import { applyExtends } from './utils/apply-extends.js';
|
|
10
|
-
import {
|
|
22
|
+
import { applyMiddleware, GlobalMiddleware, } from './middleware.js';
|
|
11
23
|
import { isPromise } from './utils/is-promise.js';
|
|
24
|
+
import { maybeAsyncResult } from './utils/maybe-async-result.js';
|
|
12
25
|
import setBlocking from './utils/set-blocking.js';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
let completion = null;
|
|
22
|
-
let groups = {};
|
|
23
|
-
const globalMiddleware = [];
|
|
24
|
-
let output = '';
|
|
25
|
-
const preservedGroups = {};
|
|
26
|
-
let usage;
|
|
27
|
-
let validation;
|
|
28
|
-
let handlerFinishCommand = null;
|
|
29
|
-
const y18n = shim.y18n;
|
|
30
|
-
self.middleware = globalMiddlewareFactory(globalMiddleware, self);
|
|
31
|
-
self.scriptName = function (scriptName) {
|
|
32
|
-
self.customScriptName = true;
|
|
33
|
-
self.$0 = scriptName;
|
|
34
|
-
return self;
|
|
35
|
-
};
|
|
36
|
-
let default$0;
|
|
37
|
-
if (/\b(node|iojs|electron)(\.exe)?$/.test(shim.process.argv()[0])) {
|
|
38
|
-
default$0 = shim.process.argv().slice(1, 2);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
default$0 = shim.process.argv().slice(0, 1);
|
|
42
|
-
}
|
|
43
|
-
self.$0 = default$0
|
|
44
|
-
.map(x => {
|
|
45
|
-
const b = rebase(cwd, x);
|
|
46
|
-
return x.match(/^(\/|([a-zA-Z]:)?\\)/) && b.length < x.length ? b : x;
|
|
47
|
-
})
|
|
48
|
-
.join(' ')
|
|
49
|
-
.trim();
|
|
50
|
-
if (shim.getEnv('_') && shim.getProcessArgvBin() === shim.getEnv('_')) {
|
|
51
|
-
self.$0 = shim
|
|
52
|
-
.getEnv('_')
|
|
53
|
-
.replace(`${shim.path.dirname(shim.process.execPath())}/`, '');
|
|
54
|
-
}
|
|
55
|
-
const context = { resets: -1, commands: [], fullCommands: [], files: [] };
|
|
56
|
-
self.getContext = () => context;
|
|
57
|
-
let hasOutput = false;
|
|
58
|
-
let exitError = null;
|
|
59
|
-
self.exit = (code, err) => {
|
|
60
|
-
hasOutput = true;
|
|
61
|
-
exitError = err;
|
|
62
|
-
if (exitProcess)
|
|
63
|
-
shim.process.exit(code);
|
|
64
|
-
};
|
|
65
|
-
let completionCommand = null;
|
|
66
|
-
self.completion = function (cmd, desc, fn) {
|
|
67
|
-
argsert('[string] [string|boolean|function] [function]', [cmd, desc, fn], arguments.length);
|
|
68
|
-
if (typeof desc === 'function') {
|
|
69
|
-
fn = desc;
|
|
70
|
-
desc = undefined;
|
|
71
|
-
}
|
|
72
|
-
completionCommand = cmd || completionCommand || 'completion';
|
|
73
|
-
if (!desc && desc !== false) {
|
|
74
|
-
desc = 'generate completion script';
|
|
75
|
-
}
|
|
76
|
-
self.command(completionCommand, desc);
|
|
77
|
-
if (fn)
|
|
78
|
-
completion.registerFunction(fn);
|
|
79
|
-
return self;
|
|
80
|
-
};
|
|
81
|
-
let options;
|
|
82
|
-
self.resetOptions = self.reset = function resetOptions(aliases = {}) {
|
|
83
|
-
context.resets++;
|
|
84
|
-
options = options || {};
|
|
85
|
-
const tmpOptions = {};
|
|
86
|
-
tmpOptions.local = options.local ? options.local : [];
|
|
87
|
-
tmpOptions.configObjects = options.configObjects
|
|
88
|
-
? options.configObjects
|
|
89
|
-
: [];
|
|
90
|
-
const localLookup = {};
|
|
91
|
-
tmpOptions.local.forEach(l => {
|
|
92
|
-
localLookup[l] = true;
|
|
93
|
-
(aliases[l] || []).forEach(a => {
|
|
94
|
-
localLookup[a] = true;
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
Object.assign(preservedGroups, Object.keys(groups).reduce((acc, groupName) => {
|
|
98
|
-
const keys = groups[groupName].filter(key => !(key in localLookup));
|
|
99
|
-
if (keys.length > 0) {
|
|
100
|
-
acc[groupName] = keys;
|
|
101
|
-
}
|
|
102
|
-
return acc;
|
|
103
|
-
}, {}));
|
|
104
|
-
groups = {};
|
|
105
|
-
const arrayOptions = [
|
|
106
|
-
'array',
|
|
107
|
-
'boolean',
|
|
108
|
-
'string',
|
|
109
|
-
'skipValidation',
|
|
110
|
-
'count',
|
|
111
|
-
'normalize',
|
|
112
|
-
'number',
|
|
113
|
-
'hiddenOptions',
|
|
114
|
-
];
|
|
115
|
-
const objectOptions = [
|
|
116
|
-
'narg',
|
|
117
|
-
'key',
|
|
118
|
-
'alias',
|
|
119
|
-
'default',
|
|
120
|
-
'defaultDescription',
|
|
121
|
-
'config',
|
|
122
|
-
'choices',
|
|
123
|
-
'demandedOptions',
|
|
124
|
-
'demandedCommands',
|
|
125
|
-
'coerce',
|
|
126
|
-
'deprecatedOptions',
|
|
127
|
-
];
|
|
128
|
-
arrayOptions.forEach(k => {
|
|
129
|
-
tmpOptions[k] = (options[k] || []).filter((k) => !localLookup[k]);
|
|
26
|
+
export function YargsFactory(_shim) {
|
|
27
|
+
return (processArgs = [], cwd = _shim.process.cwd(), parentRequire) => {
|
|
28
|
+
const yargs = new YargsInstance(processArgs, cwd, parentRequire, _shim);
|
|
29
|
+
Object.defineProperty(yargs, 'argv', {
|
|
30
|
+
get: () => {
|
|
31
|
+
return yargs.parse();
|
|
32
|
+
},
|
|
33
|
+
enumerable: true,
|
|
130
34
|
});
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
tmpOptions.envPrefix = options.envPrefix;
|
|
135
|
-
options = tmpOptions;
|
|
136
|
-
usage = usage ? usage.reset(localLookup) : Usage(self, y18n, shim);
|
|
137
|
-
validation = validation
|
|
138
|
-
? validation.reset(localLookup)
|
|
139
|
-
: Validation(self, usage, y18n, shim);
|
|
140
|
-
command = command
|
|
141
|
-
? command.reset()
|
|
142
|
-
: Command(self, usage, validation, globalMiddleware, shim);
|
|
143
|
-
if (!completion)
|
|
144
|
-
completion = Completion(self, usage, command, shim);
|
|
145
|
-
completionCommand = null;
|
|
146
|
-
output = '';
|
|
147
|
-
exitError = null;
|
|
148
|
-
hasOutput = false;
|
|
149
|
-
self.parsed = false;
|
|
150
|
-
return self;
|
|
35
|
+
yargs.help();
|
|
36
|
+
yargs.version();
|
|
37
|
+
return yargs;
|
|
151
38
|
};
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
39
|
+
}
|
|
40
|
+
const kCopyDoubleDash = Symbol('copyDoubleDash');
|
|
41
|
+
const kCreateLogger = Symbol('copyDoubleDash');
|
|
42
|
+
const kDeleteFromParserHintObject = Symbol('deleteFromParserHintObject');
|
|
43
|
+
const kEmitWarning = Symbol('emitWarning');
|
|
44
|
+
const kFreeze = Symbol('freeze');
|
|
45
|
+
const kGetDollarZero = Symbol('getDollarZero');
|
|
46
|
+
const kGetParserConfiguration = Symbol('getParserConfiguration');
|
|
47
|
+
const kGetUsageConfiguration = Symbol('getUsageConfiguration');
|
|
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 kIsGlobalContext = Symbol('isGlobalContext');
|
|
69
|
+
const kPostProcess = Symbol('postProcess');
|
|
70
|
+
const kRebase = Symbol('rebase');
|
|
71
|
+
const kReset = Symbol('reset');
|
|
72
|
+
const kRunYargsParserAndExecuteCommands = Symbol('runYargsParserAndExecuteCommands');
|
|
73
|
+
const kRunValidation = Symbol('runValidation');
|
|
74
|
+
const kSetHasOutput = Symbol('setHasOutput');
|
|
75
|
+
const kTrackManuallySetKeys = Symbol('kTrackManuallySetKeys');
|
|
76
|
+
const DEFAULT_LOCALE = 'en_US';
|
|
77
|
+
export class YargsInstance {
|
|
78
|
+
constructor(processArgs = [], cwd, parentRequire, shim) {
|
|
79
|
+
this.customScriptName = false;
|
|
80
|
+
this.parsed = false;
|
|
81
|
+
_YargsInstance_command.set(this, void 0);
|
|
82
|
+
_YargsInstance_cwd.set(this, void 0);
|
|
83
|
+
_YargsInstance_context.set(this, { commands: [], fullCommands: [] });
|
|
84
|
+
_YargsInstance_completion.set(this, null);
|
|
85
|
+
_YargsInstance_completionCommand.set(this, null);
|
|
86
|
+
_YargsInstance_defaultShowHiddenOpt.set(this, 'show-hidden');
|
|
87
|
+
_YargsInstance_exitError.set(this, null);
|
|
88
|
+
_YargsInstance_detectLocale.set(this, true);
|
|
89
|
+
_YargsInstance_emittedWarnings.set(this, {});
|
|
90
|
+
_YargsInstance_exitProcess.set(this, true);
|
|
91
|
+
_YargsInstance_frozens.set(this, []);
|
|
92
|
+
_YargsInstance_globalMiddleware.set(this, void 0);
|
|
93
|
+
_YargsInstance_groups.set(this, {});
|
|
94
|
+
_YargsInstance_hasOutput.set(this, false);
|
|
95
|
+
_YargsInstance_helpOpt.set(this, null);
|
|
96
|
+
_YargsInstance_isGlobalContext.set(this, true);
|
|
97
|
+
_YargsInstance_logger.set(this, void 0);
|
|
98
|
+
_YargsInstance_output.set(this, '');
|
|
99
|
+
_YargsInstance_options.set(this, void 0);
|
|
100
|
+
_YargsInstance_parentRequire.set(this, void 0);
|
|
101
|
+
_YargsInstance_parserConfig.set(this, {});
|
|
102
|
+
_YargsInstance_parseFn.set(this, null);
|
|
103
|
+
_YargsInstance_parseContext.set(this, null);
|
|
104
|
+
_YargsInstance_pkgs.set(this, {});
|
|
105
|
+
_YargsInstance_preservedGroups.set(this, {});
|
|
106
|
+
_YargsInstance_processArgs.set(this, void 0);
|
|
107
|
+
_YargsInstance_recommendCommands.set(this, false);
|
|
108
|
+
_YargsInstance_shim.set(this, void 0);
|
|
109
|
+
_YargsInstance_strict.set(this, false);
|
|
110
|
+
_YargsInstance_strictCommands.set(this, false);
|
|
111
|
+
_YargsInstance_strictOptions.set(this, false);
|
|
112
|
+
_YargsInstance_usage.set(this, void 0);
|
|
113
|
+
_YargsInstance_usageConfig.set(this, {});
|
|
114
|
+
_YargsInstance_versionOpt.set(this, null);
|
|
115
|
+
_YargsInstance_validation.set(this, void 0);
|
|
116
|
+
__classPrivateFieldSet(this, _YargsInstance_shim, shim, "f");
|
|
117
|
+
__classPrivateFieldSet(this, _YargsInstance_processArgs, processArgs, "f");
|
|
118
|
+
__classPrivateFieldSet(this, _YargsInstance_cwd, cwd, "f");
|
|
119
|
+
__classPrivateFieldSet(this, _YargsInstance_parentRequire, parentRequire, "f");
|
|
120
|
+
__classPrivateFieldSet(this, _YargsInstance_globalMiddleware, new GlobalMiddleware(this), "f");
|
|
121
|
+
this.$0 = this[kGetDollarZero]();
|
|
122
|
+
this[kReset]();
|
|
123
|
+
__classPrivateFieldSet(this, _YargsInstance_command, __classPrivateFieldGet(this, _YargsInstance_command, "f"), "f");
|
|
124
|
+
__classPrivateFieldSet(this, _YargsInstance_usage, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), "f");
|
|
125
|
+
__classPrivateFieldSet(this, _YargsInstance_validation, __classPrivateFieldGet(this, _YargsInstance_validation, "f"), "f");
|
|
126
|
+
__classPrivateFieldSet(this, _YargsInstance_options, __classPrivateFieldGet(this, _YargsInstance_options, "f"), "f");
|
|
127
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").showHiddenOpt = __classPrivateFieldGet(this, _YargsInstance_defaultShowHiddenOpt, "f");
|
|
128
|
+
__classPrivateFieldSet(this, _YargsInstance_logger, this[kCreateLogger](), "f");
|
|
129
|
+
__classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.setLocale(DEFAULT_LOCALE);
|
|
201
130
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
argsert('<array|string>', [keys], arguments.length);
|
|
209
|
-
populateParserHintArray('array', keys);
|
|
210
|
-
return self;
|
|
211
|
-
};
|
|
212
|
-
self.number = function (keys) {
|
|
213
|
-
argsert('<array|string>', [keys], arguments.length);
|
|
214
|
-
populateParserHintArray('number', keys);
|
|
215
|
-
return self;
|
|
216
|
-
};
|
|
217
|
-
self.normalize = function (keys) {
|
|
218
|
-
argsert('<array|string>', [keys], arguments.length);
|
|
219
|
-
populateParserHintArray('normalize', keys);
|
|
220
|
-
return self;
|
|
221
|
-
};
|
|
222
|
-
self.count = function (keys) {
|
|
223
|
-
argsert('<array|string>', [keys], arguments.length);
|
|
224
|
-
populateParserHintArray('count', keys);
|
|
225
|
-
return self;
|
|
226
|
-
};
|
|
227
|
-
self.string = function (keys) {
|
|
228
|
-
argsert('<array|string>', [keys], arguments.length);
|
|
229
|
-
populateParserHintArray('string', keys);
|
|
230
|
-
return self;
|
|
231
|
-
};
|
|
232
|
-
self.requiresArg = function (keys) {
|
|
233
|
-
argsert('<array|string|object> [number]', [keys], arguments.length);
|
|
234
|
-
if (typeof keys === 'string' && options.narg[keys]) {
|
|
235
|
-
return self;
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
populateParserHintSingleValueDictionary(self.requiresArg, 'narg', keys, NaN);
|
|
131
|
+
addHelpOpt(opt, msg) {
|
|
132
|
+
const defaultHelpOpt = 'help';
|
|
133
|
+
argsert('[string|boolean] [string]', [opt, msg], arguments.length);
|
|
134
|
+
if (__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")) {
|
|
135
|
+
this[kDeleteFromParserHintObject](__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f"));
|
|
136
|
+
__classPrivateFieldSet(this, _YargsInstance_helpOpt, null, "f");
|
|
239
137
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
return
|
|
246
|
-
};
|
|
247
|
-
function populateParserHintArray(type, keys) {
|
|
248
|
-
keys = [].concat(keys);
|
|
249
|
-
keys.forEach(key => {
|
|
250
|
-
key = sanitizeKey(key);
|
|
251
|
-
options[type].push(key);
|
|
252
|
-
});
|
|
138
|
+
if (opt === false && msg === undefined)
|
|
139
|
+
return this;
|
|
140
|
+
__classPrivateFieldSet(this, _YargsInstance_helpOpt, typeof opt === 'string' ? opt : defaultHelpOpt, "f");
|
|
141
|
+
this.boolean(__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f"));
|
|
142
|
+
this.describe(__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f"), msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup('Show help'));
|
|
143
|
+
return this;
|
|
253
144
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
populateParserHintSingleValueDictionary(self.nargs, 'narg', key, value);
|
|
257
|
-
return self;
|
|
258
|
-
};
|
|
259
|
-
self.choices = function (key, value) {
|
|
260
|
-
argsert('<object|string|array> [string|array]', [key, value], arguments.length);
|
|
261
|
-
populateParserHintArrayDictionary(self.choices, 'choices', key, value);
|
|
262
|
-
return self;
|
|
263
|
-
};
|
|
264
|
-
self.alias = function (key, value) {
|
|
265
|
-
argsert('<object|string|array> [string|array]', [key, value], arguments.length);
|
|
266
|
-
populateParserHintArrayDictionary(self.alias, 'alias', key, value);
|
|
267
|
-
return self;
|
|
268
|
-
};
|
|
269
|
-
self.default = self.defaults = function (key, value, defaultDescription) {
|
|
270
|
-
argsert('<object|string|array> [*] [string]', [key, value, defaultDescription], arguments.length);
|
|
271
|
-
if (defaultDescription) {
|
|
272
|
-
assertSingleKey(key, shim);
|
|
273
|
-
options.defaultDescription[key] = defaultDescription;
|
|
274
|
-
}
|
|
275
|
-
if (typeof value === 'function') {
|
|
276
|
-
assertSingleKey(key, shim);
|
|
277
|
-
if (!options.defaultDescription[key])
|
|
278
|
-
options.defaultDescription[key] = usage.functionDescription(value);
|
|
279
|
-
value = value.call();
|
|
280
|
-
}
|
|
281
|
-
populateParserHintSingleValueDictionary(self.default, 'default', key, value);
|
|
282
|
-
return self;
|
|
283
|
-
};
|
|
284
|
-
self.describe = function (key, desc) {
|
|
285
|
-
argsert('<object|string|array> [string]', [key, desc], arguments.length);
|
|
286
|
-
setKey(key, true);
|
|
287
|
-
usage.describe(key, desc);
|
|
288
|
-
return self;
|
|
289
|
-
};
|
|
290
|
-
function setKey(key, set) {
|
|
291
|
-
populateParserHintSingleValueDictionary(setKey, 'key', key, set);
|
|
292
|
-
return self;
|
|
145
|
+
help(opt, msg) {
|
|
146
|
+
return this.addHelpOpt(opt, msg);
|
|
293
147
|
}
|
|
294
|
-
|
|
295
|
-
argsert('
|
|
296
|
-
|
|
297
|
-
|
|
148
|
+
addShowHiddenOpt(opt, msg) {
|
|
149
|
+
argsert('[string|boolean] [string]', [opt, msg], arguments.length);
|
|
150
|
+
if (opt === false && msg === undefined)
|
|
151
|
+
return this;
|
|
152
|
+
const showHiddenOpt = typeof opt === 'string' ? opt : __classPrivateFieldGet(this, _YargsInstance_defaultShowHiddenOpt, "f");
|
|
153
|
+
this.boolean(showHiddenOpt);
|
|
154
|
+
this.describe(showHiddenOpt, msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup('Show hidden options'));
|
|
155
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").showHiddenOpt = showHiddenOpt;
|
|
156
|
+
return this;
|
|
298
157
|
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
argsert('<object|string|array> [function]', [keys, value], arguments.length);
|
|
302
|
-
populateParserHintSingleValueDictionary(self.coerce, 'coerce', keys, value);
|
|
303
|
-
return self;
|
|
304
|
-
};
|
|
305
|
-
function populateParserHintSingleValueDictionary(builder, type, key, value) {
|
|
306
|
-
populateParserHintDictionary(builder, type, key, value, (type, key, value) => {
|
|
307
|
-
options[type][key] = value;
|
|
308
|
-
});
|
|
158
|
+
showHidden(opt, msg) {
|
|
159
|
+
return this.addShowHiddenOpt(opt, msg);
|
|
309
160
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
161
|
+
alias(key, value) {
|
|
162
|
+
argsert('<object|string|array> [string|array]', [key, value], arguments.length);
|
|
163
|
+
this[kPopulateParserHintArrayDictionary](this.alias.bind(this), 'alias', key, value);
|
|
164
|
+
return this;
|
|
314
165
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
166
|
+
array(keys) {
|
|
167
|
+
argsert('<array|string>', [keys], arguments.length);
|
|
168
|
+
this[kPopulateParserHintArray]('array', keys);
|
|
169
|
+
this[kTrackManuallySetKeys](keys);
|
|
170
|
+
return this;
|
|
171
|
+
}
|
|
172
|
+
boolean(keys) {
|
|
173
|
+
argsert('<array|string>', [keys], arguments.length);
|
|
174
|
+
this[kPopulateParserHintArray]('boolean', keys);
|
|
175
|
+
this[kTrackManuallySetKeys](keys);
|
|
176
|
+
return this;
|
|
177
|
+
}
|
|
178
|
+
check(f, global) {
|
|
179
|
+
argsert('<function> [boolean]', [f, global], arguments.length);
|
|
180
|
+
this.middleware((argv, _yargs) => {
|
|
181
|
+
return maybeAsyncResult(() => {
|
|
182
|
+
return f(argv, _yargs.getOptions());
|
|
183
|
+
}, (result) => {
|
|
184
|
+
if (!result) {
|
|
185
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(__classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__('Argument check failed: %s', f.toString()));
|
|
186
|
+
}
|
|
187
|
+
else if (typeof result === 'string' || result instanceof Error) {
|
|
188
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(result.toString(), result);
|
|
189
|
+
}
|
|
190
|
+
return argv;
|
|
191
|
+
}, (err) => {
|
|
192
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message ? err.message : err.toString(), err);
|
|
193
|
+
return argv;
|
|
319
194
|
});
|
|
195
|
+
}, false, global);
|
|
196
|
+
return this;
|
|
197
|
+
}
|
|
198
|
+
choices(key, value) {
|
|
199
|
+
argsert('<object|string|array> [string|array]', [key, value], arguments.length);
|
|
200
|
+
this[kPopulateParserHintArrayDictionary](this.choices.bind(this), 'choices', key, value);
|
|
201
|
+
return this;
|
|
202
|
+
}
|
|
203
|
+
coerce(keys, value) {
|
|
204
|
+
argsert('<object|string|array> [function]', [keys, value], arguments.length);
|
|
205
|
+
if (Array.isArray(keys)) {
|
|
206
|
+
if (!value) {
|
|
207
|
+
throw new YError('coerce callback must be provided');
|
|
208
|
+
}
|
|
209
|
+
for (const key of keys) {
|
|
210
|
+
this.coerce(key, value);
|
|
211
|
+
}
|
|
212
|
+
return this;
|
|
320
213
|
}
|
|
321
|
-
else if (
|
|
322
|
-
for (const
|
|
323
|
-
|
|
214
|
+
else if (typeof keys === 'object') {
|
|
215
|
+
for (const key of Object.keys(keys)) {
|
|
216
|
+
this.coerce(key, keys[key]);
|
|
324
217
|
}
|
|
218
|
+
return this;
|
|
325
219
|
}
|
|
326
|
-
|
|
327
|
-
|
|
220
|
+
if (!value) {
|
|
221
|
+
throw new YError('coerce callback must be provided');
|
|
328
222
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
if (((key) => key === 'configObjects')(hintKey))
|
|
338
|
-
return;
|
|
339
|
-
const hint = options[hintKey];
|
|
340
|
-
if (Array.isArray(hint)) {
|
|
341
|
-
if (~hint.indexOf(optionKey))
|
|
342
|
-
hint.splice(hint.indexOf(optionKey), 1);
|
|
223
|
+
const coerceKey = keys;
|
|
224
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").key[coerceKey] = true;
|
|
225
|
+
__classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addCoerceMiddleware((argv, yargs) => {
|
|
226
|
+
var _a;
|
|
227
|
+
const coerceKeyAliases = (_a = yargs.getAliases()[coerceKey]) !== null && _a !== void 0 ? _a : [];
|
|
228
|
+
const argvKeys = [coerceKey, ...coerceKeyAliases].filter(key => Object.prototype.hasOwnProperty.call(argv, key));
|
|
229
|
+
if (argvKeys.length === 0) {
|
|
230
|
+
return argv;
|
|
343
231
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
|
|
232
|
+
return maybeAsyncResult(() => {
|
|
233
|
+
return value(argv[argvKeys[0]]);
|
|
234
|
+
}, (result) => {
|
|
235
|
+
argvKeys.forEach(key => {
|
|
236
|
+
argv[key] = result;
|
|
237
|
+
});
|
|
238
|
+
return argv;
|
|
239
|
+
}, (err) => {
|
|
240
|
+
throw new YError(err.message);
|
|
241
|
+
});
|
|
242
|
+
}, coerceKey);
|
|
243
|
+
return this;
|
|
349
244
|
}
|
|
350
|
-
|
|
245
|
+
conflicts(key1, key2) {
|
|
246
|
+
argsert('<string|object> [string|array]', [key1, key2], arguments.length);
|
|
247
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").conflicts(key1, key2);
|
|
248
|
+
return this;
|
|
249
|
+
}
|
|
250
|
+
config(key = 'config', msg, parseFn) {
|
|
351
251
|
argsert('[object|string] [string|function] [function]', [key, msg, parseFn], arguments.length);
|
|
352
252
|
if (typeof key === 'object' && !Array.isArray(key)) {
|
|
353
|
-
key = applyExtends(key,
|
|
354
|
-
|
|
355
|
-
return
|
|
253
|
+
key = applyExtends(key, __classPrivateFieldGet(this, _YargsInstance_cwd, "f"), this[kGetParserConfiguration]()['deep-merge-config'] || false, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
|
|
254
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = (__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []).concat(key);
|
|
255
|
+
return this;
|
|
356
256
|
}
|
|
357
257
|
if (typeof msg === 'function') {
|
|
358
258
|
parseFn = msg;
|
|
359
259
|
msg = undefined;
|
|
360
260
|
}
|
|
361
|
-
|
|
261
|
+
this.describe(key, msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup('Path to JSON config file'));
|
|
362
262
|
(Array.isArray(key) ? key : [key]).forEach(k => {
|
|
363
|
-
|
|
263
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").config[k] = parseFn || true;
|
|
364
264
|
});
|
|
365
|
-
return
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
argsert('
|
|
369
|
-
if (
|
|
370
|
-
|
|
265
|
+
return this;
|
|
266
|
+
}
|
|
267
|
+
completion(cmd, desc, fn) {
|
|
268
|
+
argsert('[string] [string|boolean|function] [function]', [cmd, desc, fn], arguments.length);
|
|
269
|
+
if (typeof desc === 'function') {
|
|
270
|
+
fn = desc;
|
|
271
|
+
desc = undefined;
|
|
371
272
|
}
|
|
372
|
-
|
|
373
|
-
|
|
273
|
+
__classPrivateFieldSet(this, _YargsInstance_completionCommand, cmd || __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") || 'completion', "f");
|
|
274
|
+
if (!desc && desc !== false) {
|
|
275
|
+
desc = 'generate completion script';
|
|
374
276
|
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
277
|
+
this.command(__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f"), desc);
|
|
278
|
+
if (fn)
|
|
279
|
+
__classPrivateFieldGet(this, _YargsInstance_completion, "f").registerFunction(fn);
|
|
280
|
+
return this;
|
|
281
|
+
}
|
|
282
|
+
command(cmd, description, builder, handler, middlewares, deprecated) {
|
|
378
283
|
argsert('<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]', [cmd, description, builder, handler, middlewares, deprecated], arguments.length);
|
|
379
|
-
|
|
380
|
-
return
|
|
381
|
-
}
|
|
382
|
-
|
|
284
|
+
__classPrivateFieldGet(this, _YargsInstance_command, "f").addHandler(cmd, description, builder, handler, middlewares, deprecated);
|
|
285
|
+
return this;
|
|
286
|
+
}
|
|
287
|
+
commands(cmd, description, builder, handler, middlewares, deprecated) {
|
|
288
|
+
return this.command(cmd, description, builder, handler, middlewares, deprecated);
|
|
289
|
+
}
|
|
290
|
+
commandDir(dir, opts) {
|
|
383
291
|
argsert('<string> [object]', [dir, opts], arguments.length);
|
|
384
|
-
const req =
|
|
385
|
-
|
|
386
|
-
return
|
|
387
|
-
}
|
|
388
|
-
|
|
292
|
+
const req = __classPrivateFieldGet(this, _YargsInstance_parentRequire, "f") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").require;
|
|
293
|
+
__classPrivateFieldGet(this, _YargsInstance_command, "f").addDirectory(dir, req, __classPrivateFieldGet(this, _YargsInstance_shim, "f").getCallerFile(), opts);
|
|
294
|
+
return this;
|
|
295
|
+
}
|
|
296
|
+
count(keys) {
|
|
297
|
+
argsert('<array|string>', [keys], arguments.length);
|
|
298
|
+
this[kPopulateParserHintArray]('count', keys);
|
|
299
|
+
this[kTrackManuallySetKeys](keys);
|
|
300
|
+
return this;
|
|
301
|
+
}
|
|
302
|
+
default(key, value, defaultDescription) {
|
|
303
|
+
argsert('<object|string|array> [*] [string]', [key, value, defaultDescription], arguments.length);
|
|
304
|
+
if (defaultDescription) {
|
|
305
|
+
assertSingleKey(key, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
|
|
306
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = defaultDescription;
|
|
307
|
+
}
|
|
308
|
+
if (typeof value === 'function') {
|
|
309
|
+
assertSingleKey(key, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
|
|
310
|
+
if (!__classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key])
|
|
311
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] =
|
|
312
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").functionDescription(value);
|
|
313
|
+
value = value.call();
|
|
314
|
+
}
|
|
315
|
+
this[kPopulateParserHintSingleValueDictionary](this.default.bind(this), 'default', key, value);
|
|
316
|
+
return this;
|
|
317
|
+
}
|
|
318
|
+
defaults(key, value, defaultDescription) {
|
|
319
|
+
return this.default(key, value, defaultDescription);
|
|
320
|
+
}
|
|
321
|
+
demandCommand(min = 1, max, minMsg, maxMsg) {
|
|
322
|
+
argsert('[number] [number|string] [string|null|undefined] [string|null|undefined]', [min, max, minMsg, maxMsg], arguments.length);
|
|
323
|
+
if (typeof max !== 'number') {
|
|
324
|
+
minMsg = max;
|
|
325
|
+
max = Infinity;
|
|
326
|
+
}
|
|
327
|
+
this.global('_', false);
|
|
328
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").demandedCommands._ = {
|
|
329
|
+
min,
|
|
330
|
+
max,
|
|
331
|
+
minMsg,
|
|
332
|
+
maxMsg,
|
|
333
|
+
};
|
|
334
|
+
return this;
|
|
335
|
+
}
|
|
336
|
+
demand(keys, max, msg) {
|
|
389
337
|
if (Array.isArray(max)) {
|
|
390
338
|
max.forEach(key => {
|
|
391
|
-
assertNotStrictEqual(msg, true,
|
|
392
|
-
demandOption(key, msg);
|
|
339
|
+
assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
|
|
340
|
+
this.demandOption(key, msg);
|
|
393
341
|
});
|
|
394
342
|
max = Infinity;
|
|
395
343
|
}
|
|
@@ -398,288 +346,420 @@ function Yargs(processArgs = [], cwd = shim.process.cwd(), parentRequire) {
|
|
|
398
346
|
max = Infinity;
|
|
399
347
|
}
|
|
400
348
|
if (typeof keys === 'number') {
|
|
401
|
-
assertNotStrictEqual(msg, true,
|
|
402
|
-
|
|
349
|
+
assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
|
|
350
|
+
this.demandCommand(keys, max, msg, msg);
|
|
403
351
|
}
|
|
404
352
|
else if (Array.isArray(keys)) {
|
|
405
353
|
keys.forEach(key => {
|
|
406
|
-
assertNotStrictEqual(msg, true,
|
|
407
|
-
demandOption(key, msg);
|
|
354
|
+
assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
|
|
355
|
+
this.demandOption(key, msg);
|
|
408
356
|
});
|
|
409
357
|
}
|
|
410
358
|
else {
|
|
411
359
|
if (typeof msg === 'string') {
|
|
412
|
-
demandOption(keys, msg);
|
|
360
|
+
this.demandOption(keys, msg);
|
|
413
361
|
}
|
|
414
362
|
else if (msg === true || typeof msg === 'undefined') {
|
|
415
|
-
demandOption(keys);
|
|
363
|
+
this.demandOption(keys);
|
|
416
364
|
}
|
|
417
365
|
}
|
|
418
|
-
return
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
argsert('
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
366
|
+
return this;
|
|
367
|
+
}
|
|
368
|
+
demandOption(keys, msg) {
|
|
369
|
+
argsert('<object|string|array> [string]', [keys, msg], arguments.length);
|
|
370
|
+
this[kPopulateParserHintSingleValueDictionary](this.demandOption.bind(this), 'demandedOptions', keys, msg);
|
|
371
|
+
return this;
|
|
372
|
+
}
|
|
373
|
+
deprecateOption(option, message) {
|
|
374
|
+
argsert('<string> [string|boolean]', [option, message], arguments.length);
|
|
375
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").deprecatedOptions[option] = message;
|
|
376
|
+
return this;
|
|
377
|
+
}
|
|
378
|
+
describe(keys, description) {
|
|
379
|
+
argsert('<object|string|array> [string]', [keys, description], arguments.length);
|
|
380
|
+
this[kSetKey](keys, true);
|
|
381
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").describe(keys, description);
|
|
382
|
+
return this;
|
|
383
|
+
}
|
|
384
|
+
detectLocale(detect) {
|
|
385
|
+
argsert('<boolean>', [detect], arguments.length);
|
|
386
|
+
__classPrivateFieldSet(this, _YargsInstance_detectLocale, detect, "f");
|
|
387
|
+
return this;
|
|
388
|
+
}
|
|
389
|
+
env(prefix) {
|
|
390
|
+
argsert('[string|boolean]', [prefix], arguments.length);
|
|
391
|
+
if (prefix === false)
|
|
392
|
+
delete __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix;
|
|
393
|
+
else
|
|
394
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix = prefix || '';
|
|
395
|
+
return this;
|
|
396
|
+
}
|
|
397
|
+
epilogue(msg) {
|
|
398
|
+
argsert('<string>', [msg], arguments.length);
|
|
399
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").epilog(msg);
|
|
400
|
+
return this;
|
|
401
|
+
}
|
|
402
|
+
epilog(msg) {
|
|
403
|
+
return this.epilogue(msg);
|
|
404
|
+
}
|
|
405
|
+
example(cmd, description) {
|
|
406
|
+
argsert('<string|array> [string]', [cmd, description], arguments.length);
|
|
407
|
+
if (Array.isArray(cmd)) {
|
|
408
|
+
cmd.forEach(exampleParams => this.example(...exampleParams));
|
|
425
409
|
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
410
|
+
else {
|
|
411
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").example(cmd, description);
|
|
412
|
+
}
|
|
413
|
+
return this;
|
|
414
|
+
}
|
|
415
|
+
exit(code, err) {
|
|
416
|
+
__classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
|
|
417
|
+
__classPrivateFieldSet(this, _YargsInstance_exitError, err, "f");
|
|
418
|
+
if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"))
|
|
419
|
+
__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.exit(code);
|
|
420
|
+
}
|
|
421
|
+
exitProcess(enabled = true) {
|
|
422
|
+
argsert('[boolean]', [enabled], arguments.length);
|
|
423
|
+
__classPrivateFieldSet(this, _YargsInstance_exitProcess, enabled, "f");
|
|
424
|
+
return this;
|
|
425
|
+
}
|
|
426
|
+
fail(f) {
|
|
427
|
+
argsert('<function|boolean>', [f], arguments.length);
|
|
428
|
+
if (typeof f === 'boolean' && f !== false) {
|
|
429
|
+
throw new YError("Invalid first argument. Expected function or boolean 'false'");
|
|
430
|
+
}
|
|
431
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").failFn(f);
|
|
432
|
+
return this;
|
|
433
|
+
}
|
|
434
|
+
getAliases() {
|
|
435
|
+
return this.parsed ? this.parsed.aliases : {};
|
|
436
|
+
}
|
|
437
|
+
async getCompletion(args, done) {
|
|
438
|
+
argsert('<array> [function]', [args, done], arguments.length);
|
|
439
|
+
if (!done) {
|
|
440
|
+
return new Promise((resolve, reject) => {
|
|
441
|
+
__classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, (err, completions) => {
|
|
442
|
+
if (err)
|
|
443
|
+
reject(err);
|
|
444
|
+
else
|
|
445
|
+
resolve(completions);
|
|
446
|
+
});
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
return __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, done);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
getDemandedOptions() {
|
|
436
454
|
argsert([], 0);
|
|
437
|
-
return
|
|
438
|
-
}
|
|
439
|
-
|
|
455
|
+
return __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedOptions;
|
|
456
|
+
}
|
|
457
|
+
getDemandedCommands() {
|
|
440
458
|
argsert([], 0);
|
|
441
|
-
return
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
argsert('<string> [string|boolean]', [option, message], arguments.length);
|
|
445
|
-
options.deprecatedOptions[option] = message;
|
|
446
|
-
return self;
|
|
447
|
-
};
|
|
448
|
-
self.getDeprecatedOptions = () => {
|
|
459
|
+
return __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedCommands;
|
|
460
|
+
}
|
|
461
|
+
getDeprecatedOptions() {
|
|
449
462
|
argsert([], 0);
|
|
450
|
-
return
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
463
|
+
return __classPrivateFieldGet(this, _YargsInstance_options, "f").deprecatedOptions;
|
|
464
|
+
}
|
|
465
|
+
getDetectLocale() {
|
|
466
|
+
return __classPrivateFieldGet(this, _YargsInstance_detectLocale, "f");
|
|
467
|
+
}
|
|
468
|
+
getExitProcess() {
|
|
469
|
+
return __classPrivateFieldGet(this, _YargsInstance_exitProcess, "f");
|
|
470
|
+
}
|
|
471
|
+
getGroups() {
|
|
472
|
+
return Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_groups, "f"), __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f"));
|
|
473
|
+
}
|
|
474
|
+
getHelp() {
|
|
475
|
+
__classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
|
|
476
|
+
if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) {
|
|
477
|
+
if (!this.parsed) {
|
|
478
|
+
const parse = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), undefined, undefined, 0, true);
|
|
479
|
+
if (isPromise(parse)) {
|
|
480
|
+
return parse.then(() => {
|
|
481
|
+
return __classPrivateFieldGet(this, _YargsInstance_usage, "f").help();
|
|
482
|
+
});
|
|
483
|
+
}
|
|
468
484
|
}
|
|
469
|
-
|
|
470
|
-
|
|
485
|
+
const builderResponse = __classPrivateFieldGet(this, _YargsInstance_command, "f").runDefaultBuilderOn(this);
|
|
486
|
+
if (isPromise(builderResponse)) {
|
|
487
|
+
return builderResponse.then(() => {
|
|
488
|
+
return __classPrivateFieldGet(this, _YargsInstance_usage, "f").help();
|
|
489
|
+
});
|
|
471
490
|
}
|
|
472
491
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
self.onFinishCommand = function (f) {
|
|
489
|
-
argsert('<function>', [f], arguments.length);
|
|
490
|
-
handlerFinishCommand = f;
|
|
491
|
-
return self;
|
|
492
|
-
};
|
|
493
|
-
self.getHandlerFinishCommand = () => handlerFinishCommand;
|
|
494
|
-
self.check = function (f, _global) {
|
|
495
|
-
argsert('<function> [boolean]', [f, _global], arguments.length);
|
|
496
|
-
validation.check(f, _global !== false);
|
|
497
|
-
return self;
|
|
498
|
-
};
|
|
499
|
-
self.global = function global(globals, global) {
|
|
492
|
+
return Promise.resolve(__classPrivateFieldGet(this, _YargsInstance_usage, "f").help());
|
|
493
|
+
}
|
|
494
|
+
getOptions() {
|
|
495
|
+
return __classPrivateFieldGet(this, _YargsInstance_options, "f");
|
|
496
|
+
}
|
|
497
|
+
getStrict() {
|
|
498
|
+
return __classPrivateFieldGet(this, _YargsInstance_strict, "f");
|
|
499
|
+
}
|
|
500
|
+
getStrictCommands() {
|
|
501
|
+
return __classPrivateFieldGet(this, _YargsInstance_strictCommands, "f");
|
|
502
|
+
}
|
|
503
|
+
getStrictOptions() {
|
|
504
|
+
return __classPrivateFieldGet(this, _YargsInstance_strictOptions, "f");
|
|
505
|
+
}
|
|
506
|
+
global(globals, global) {
|
|
500
507
|
argsert('<string|array> [boolean]', [globals, global], arguments.length);
|
|
501
508
|
globals = [].concat(globals);
|
|
502
509
|
if (global !== false) {
|
|
503
|
-
|
|
510
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").local = __classPrivateFieldGet(this, _YargsInstance_options, "f").local.filter(l => globals.indexOf(l) === -1);
|
|
504
511
|
}
|
|
505
512
|
else {
|
|
506
513
|
globals.forEach(g => {
|
|
507
|
-
if (
|
|
508
|
-
|
|
514
|
+
if (!__classPrivateFieldGet(this, _YargsInstance_options, "f").local.includes(g))
|
|
515
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").local.push(g);
|
|
509
516
|
});
|
|
510
517
|
}
|
|
511
|
-
return
|
|
512
|
-
};
|
|
513
|
-
self.pkgConf = function pkgConf(key, rootPath) {
|
|
514
|
-
argsert('<string> [string]', [key, rootPath], arguments.length);
|
|
515
|
-
let conf = null;
|
|
516
|
-
const obj = pkgUp(rootPath || cwd);
|
|
517
|
-
if (obj[key] && typeof obj[key] === 'object') {
|
|
518
|
-
conf = applyExtends(obj[key], rootPath || cwd, self.getParserConfiguration()['deep-merge-config'] || false, shim);
|
|
519
|
-
options.configObjects = (options.configObjects || []).concat(conf);
|
|
520
|
-
}
|
|
521
|
-
return self;
|
|
522
|
-
};
|
|
523
|
-
const pkgs = {};
|
|
524
|
-
function pkgUp(rootPath) {
|
|
525
|
-
const npath = rootPath || '*';
|
|
526
|
-
if (pkgs[npath])
|
|
527
|
-
return pkgs[npath];
|
|
528
|
-
let obj = {};
|
|
529
|
-
try {
|
|
530
|
-
let startDir = rootPath || shim.mainFilename;
|
|
531
|
-
if (!rootPath && shim.path.extname(startDir)) {
|
|
532
|
-
startDir = shim.path.dirname(startDir);
|
|
533
|
-
}
|
|
534
|
-
const pkgJsonPath = shim.findUp(startDir, (dir, names) => {
|
|
535
|
-
if (names.includes('package.json')) {
|
|
536
|
-
return 'package.json';
|
|
537
|
-
}
|
|
538
|
-
else {
|
|
539
|
-
return undefined;
|
|
540
|
-
}
|
|
541
|
-
});
|
|
542
|
-
assertNotStrictEqual(pkgJsonPath, undefined, shim);
|
|
543
|
-
obj = JSON.parse(shim.readFileSync(pkgJsonPath, 'utf8'));
|
|
544
|
-
}
|
|
545
|
-
catch (_noop) { }
|
|
546
|
-
pkgs[npath] = obj || {};
|
|
547
|
-
return pkgs[npath];
|
|
518
|
+
return this;
|
|
548
519
|
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
if (typeof args === 'undefined') {
|
|
555
|
-
const argv = self._parseArgs(processArgs);
|
|
556
|
-
const tmpParsed = self.parsed;
|
|
557
|
-
unfreeze();
|
|
558
|
-
self.parsed = tmpParsed;
|
|
559
|
-
return argv;
|
|
560
|
-
}
|
|
561
|
-
if (typeof shortCircuit === 'object') {
|
|
562
|
-
parseContext = shortCircuit;
|
|
563
|
-
shortCircuit = _parseFn;
|
|
520
|
+
group(opts, groupName) {
|
|
521
|
+
argsert('<string|array> <string>', [opts, groupName], arguments.length);
|
|
522
|
+
const existing = __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName] || __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName];
|
|
523
|
+
if (__classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName]) {
|
|
524
|
+
delete __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName];
|
|
564
525
|
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
526
|
+
const seen = {};
|
|
527
|
+
__classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName] = (existing || []).concat(opts).filter(key => {
|
|
528
|
+
if (seen[key])
|
|
529
|
+
return false;
|
|
530
|
+
return (seen[key] = true);
|
|
531
|
+
});
|
|
532
|
+
return this;
|
|
533
|
+
}
|
|
534
|
+
hide(key) {
|
|
535
|
+
argsert('<string>', [key], arguments.length);
|
|
536
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").hiddenOptions.push(key);
|
|
537
|
+
return this;
|
|
538
|
+
}
|
|
539
|
+
implies(key, value) {
|
|
540
|
+
argsert('<string|object> [number|string|array]', [key, value], arguments.length);
|
|
541
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").implies(key, value);
|
|
542
|
+
return this;
|
|
543
|
+
}
|
|
544
|
+
locale(locale) {
|
|
545
|
+
argsert('[string]', [locale], arguments.length);
|
|
546
|
+
if (locale === undefined) {
|
|
547
|
+
this[kGuessLocale]();
|
|
548
|
+
return __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.getLocale();
|
|
568
549
|
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
550
|
+
__classPrivateFieldSet(this, _YargsInstance_detectLocale, false, "f");
|
|
551
|
+
__classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.setLocale(locale);
|
|
552
|
+
return this;
|
|
553
|
+
}
|
|
554
|
+
middleware(callback, applyBeforeValidation, global) {
|
|
555
|
+
return __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addMiddleware(callback, !!applyBeforeValidation, global);
|
|
556
|
+
}
|
|
557
|
+
nargs(key, value) {
|
|
558
|
+
argsert('<string|object|array> [number]', [key, value], arguments.length);
|
|
559
|
+
this[kPopulateParserHintSingleValueDictionary](this.nargs.bind(this), 'narg', key, value);
|
|
560
|
+
return this;
|
|
561
|
+
}
|
|
562
|
+
normalize(keys) {
|
|
563
|
+
argsert('<array|string>', [keys], arguments.length);
|
|
564
|
+
this[kPopulateParserHintArray]('normalize', keys);
|
|
565
|
+
return this;
|
|
566
|
+
}
|
|
567
|
+
number(keys) {
|
|
568
|
+
argsert('<array|string>', [keys], arguments.length);
|
|
569
|
+
this[kPopulateParserHintArray]('number', keys);
|
|
570
|
+
this[kTrackManuallySetKeys](keys);
|
|
571
|
+
return this;
|
|
572
|
+
}
|
|
573
|
+
option(key, opt) {
|
|
583
574
|
argsert('<string|object> [object]', [key, opt], arguments.length);
|
|
584
575
|
if (typeof key === 'object') {
|
|
585
576
|
Object.keys(key).forEach(k => {
|
|
586
|
-
|
|
577
|
+
this.options(k, key[k]);
|
|
587
578
|
});
|
|
588
579
|
}
|
|
589
580
|
else {
|
|
590
581
|
if (typeof opt !== 'object') {
|
|
591
582
|
opt = {};
|
|
592
583
|
}
|
|
593
|
-
|
|
584
|
+
this[kTrackManuallySetKeys](key);
|
|
585
|
+
if (__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f") && (key === 'version' || (opt === null || opt === void 0 ? void 0 : opt.alias) === 'version')) {
|
|
586
|
+
this[kEmitWarning]([
|
|
587
|
+
'"version" is a reserved word.',
|
|
588
|
+
'Please do one of the following:',
|
|
589
|
+
'- Disable version with `yargs.version(false)` if using "version" as an option',
|
|
590
|
+
'- Use the built-in `yargs.version` method instead (if applicable)',
|
|
591
|
+
'- Use a different option key',
|
|
592
|
+
'https://yargs.js.org/docs/#api-reference-version',
|
|
593
|
+
].join('\n'), undefined, 'versionWarning');
|
|
594
|
+
}
|
|
595
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").key[key] = true;
|
|
594
596
|
if (opt.alias)
|
|
595
|
-
|
|
597
|
+
this.alias(key, opt.alias);
|
|
596
598
|
const deprecate = opt.deprecate || opt.deprecated;
|
|
597
599
|
if (deprecate) {
|
|
598
|
-
|
|
600
|
+
this.deprecateOption(key, deprecate);
|
|
599
601
|
}
|
|
600
602
|
const demand = opt.demand || opt.required || opt.require;
|
|
601
603
|
if (demand) {
|
|
602
|
-
|
|
604
|
+
this.demand(key, demand);
|
|
603
605
|
}
|
|
604
606
|
if (opt.demandOption) {
|
|
605
|
-
|
|
607
|
+
this.demandOption(key, typeof opt.demandOption === 'string' ? opt.demandOption : undefined);
|
|
606
608
|
}
|
|
607
609
|
if (opt.conflicts) {
|
|
608
|
-
|
|
610
|
+
this.conflicts(key, opt.conflicts);
|
|
609
611
|
}
|
|
610
612
|
if ('default' in opt) {
|
|
611
|
-
|
|
613
|
+
this.default(key, opt.default);
|
|
612
614
|
}
|
|
613
615
|
if (opt.implies !== undefined) {
|
|
614
|
-
|
|
616
|
+
this.implies(key, opt.implies);
|
|
615
617
|
}
|
|
616
618
|
if (opt.nargs !== undefined) {
|
|
617
|
-
|
|
619
|
+
this.nargs(key, opt.nargs);
|
|
618
620
|
}
|
|
619
621
|
if (opt.config) {
|
|
620
|
-
|
|
622
|
+
this.config(key, opt.configParser);
|
|
621
623
|
}
|
|
622
624
|
if (opt.normalize) {
|
|
623
|
-
|
|
625
|
+
this.normalize(key);
|
|
624
626
|
}
|
|
625
627
|
if (opt.choices) {
|
|
626
|
-
|
|
628
|
+
this.choices(key, opt.choices);
|
|
627
629
|
}
|
|
628
630
|
if (opt.coerce) {
|
|
629
|
-
|
|
631
|
+
this.coerce(key, opt.coerce);
|
|
630
632
|
}
|
|
631
633
|
if (opt.group) {
|
|
632
|
-
|
|
634
|
+
this.group(key, opt.group);
|
|
633
635
|
}
|
|
634
636
|
if (opt.boolean || opt.type === 'boolean') {
|
|
635
|
-
|
|
637
|
+
this.boolean(key);
|
|
636
638
|
if (opt.alias)
|
|
637
|
-
|
|
639
|
+
this.boolean(opt.alias);
|
|
638
640
|
}
|
|
639
641
|
if (opt.array || opt.type === 'array') {
|
|
640
|
-
|
|
642
|
+
this.array(key);
|
|
641
643
|
if (opt.alias)
|
|
642
|
-
|
|
644
|
+
this.array(opt.alias);
|
|
643
645
|
}
|
|
644
646
|
if (opt.number || opt.type === 'number') {
|
|
645
|
-
|
|
647
|
+
this.number(key);
|
|
646
648
|
if (opt.alias)
|
|
647
|
-
|
|
649
|
+
this.number(opt.alias);
|
|
648
650
|
}
|
|
649
651
|
if (opt.string || opt.type === 'string') {
|
|
650
|
-
|
|
652
|
+
this.string(key);
|
|
651
653
|
if (opt.alias)
|
|
652
|
-
|
|
654
|
+
this.string(opt.alias);
|
|
653
655
|
}
|
|
654
656
|
if (opt.count || opt.type === 'count') {
|
|
655
|
-
|
|
657
|
+
this.count(key);
|
|
656
658
|
}
|
|
657
659
|
if (typeof opt.global === 'boolean') {
|
|
658
|
-
|
|
660
|
+
this.global(key, opt.global);
|
|
659
661
|
}
|
|
660
662
|
if (opt.defaultDescription) {
|
|
661
|
-
|
|
663
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = opt.defaultDescription;
|
|
662
664
|
}
|
|
663
665
|
if (opt.skipValidation) {
|
|
664
|
-
|
|
666
|
+
this.skipValidation(key);
|
|
665
667
|
}
|
|
666
668
|
const desc = opt.describe || opt.description || opt.desc;
|
|
667
|
-
|
|
669
|
+
const descriptions = __classPrivateFieldGet(this, _YargsInstance_usage, "f").getDescriptions();
|
|
670
|
+
if (!Object.prototype.hasOwnProperty.call(descriptions, key) ||
|
|
671
|
+
typeof desc === 'string') {
|
|
672
|
+
this.describe(key, desc);
|
|
673
|
+
}
|
|
668
674
|
if (opt.hidden) {
|
|
669
|
-
|
|
675
|
+
this.hide(key);
|
|
670
676
|
}
|
|
671
677
|
if (opt.requiresArg) {
|
|
672
|
-
|
|
678
|
+
this.requiresArg(key);
|
|
673
679
|
}
|
|
674
680
|
}
|
|
675
|
-
return
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
681
|
+
return this;
|
|
682
|
+
}
|
|
683
|
+
options(key, opt) {
|
|
684
|
+
return this.option(key, opt);
|
|
685
|
+
}
|
|
686
|
+
parse(args, shortCircuit, _parseFn) {
|
|
687
|
+
argsert('[string|array] [function|boolean|object] [function]', [args, shortCircuit, _parseFn], arguments.length);
|
|
688
|
+
this[kFreeze]();
|
|
689
|
+
if (typeof args === 'undefined') {
|
|
690
|
+
args = __classPrivateFieldGet(this, _YargsInstance_processArgs, "f");
|
|
691
|
+
}
|
|
692
|
+
if (typeof shortCircuit === 'object') {
|
|
693
|
+
__classPrivateFieldSet(this, _YargsInstance_parseContext, shortCircuit, "f");
|
|
694
|
+
shortCircuit = _parseFn;
|
|
682
695
|
}
|
|
696
|
+
if (typeof shortCircuit === 'function') {
|
|
697
|
+
__classPrivateFieldSet(this, _YargsInstance_parseFn, shortCircuit, "f");
|
|
698
|
+
shortCircuit = false;
|
|
699
|
+
}
|
|
700
|
+
if (!shortCircuit)
|
|
701
|
+
__classPrivateFieldSet(this, _YargsInstance_processArgs, args, "f");
|
|
702
|
+
if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f"))
|
|
703
|
+
__classPrivateFieldSet(this, _YargsInstance_exitProcess, false, "f");
|
|
704
|
+
const parsed = this[kRunYargsParserAndExecuteCommands](args, !!shortCircuit);
|
|
705
|
+
const tmpParsed = this.parsed;
|
|
706
|
+
__classPrivateFieldGet(this, _YargsInstance_completion, "f").setParsed(this.parsed);
|
|
707
|
+
if (isPromise(parsed)) {
|
|
708
|
+
return parsed
|
|
709
|
+
.then(argv => {
|
|
710
|
+
if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f"))
|
|
711
|
+
__classPrivateFieldGet(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), argv, __classPrivateFieldGet(this, _YargsInstance_output, "f"));
|
|
712
|
+
return argv;
|
|
713
|
+
})
|
|
714
|
+
.catch(err => {
|
|
715
|
+
if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) {
|
|
716
|
+
__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")(err, this.parsed.argv, __classPrivateFieldGet(this, _YargsInstance_output, "f"));
|
|
717
|
+
}
|
|
718
|
+
throw err;
|
|
719
|
+
})
|
|
720
|
+
.finally(() => {
|
|
721
|
+
this[kUnfreeze]();
|
|
722
|
+
this.parsed = tmpParsed;
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
else {
|
|
726
|
+
if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f"))
|
|
727
|
+
__classPrivateFieldGet(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), parsed, __classPrivateFieldGet(this, _YargsInstance_output, "f"));
|
|
728
|
+
this[kUnfreeze]();
|
|
729
|
+
this.parsed = tmpParsed;
|
|
730
|
+
}
|
|
731
|
+
return parsed;
|
|
732
|
+
}
|
|
733
|
+
parseAsync(args, shortCircuit, _parseFn) {
|
|
734
|
+
const maybePromise = this.parse(args, shortCircuit, _parseFn);
|
|
735
|
+
return !isPromise(maybePromise)
|
|
736
|
+
? Promise.resolve(maybePromise)
|
|
737
|
+
: maybePromise;
|
|
738
|
+
}
|
|
739
|
+
parseSync(args, shortCircuit, _parseFn) {
|
|
740
|
+
const maybePromise = this.parse(args, shortCircuit, _parseFn);
|
|
741
|
+
if (isPromise(maybePromise)) {
|
|
742
|
+
throw new YError('.parseSync() must not be used with asynchronous builders, handlers, or middleware');
|
|
743
|
+
}
|
|
744
|
+
return maybePromise;
|
|
745
|
+
}
|
|
746
|
+
parserConfiguration(config) {
|
|
747
|
+
argsert('<object>', [config], arguments.length);
|
|
748
|
+
__classPrivateFieldSet(this, _YargsInstance_parserConfig, config, "f");
|
|
749
|
+
return this;
|
|
750
|
+
}
|
|
751
|
+
pkgConf(key, rootPath) {
|
|
752
|
+
argsert('<string> [string]', [key, rootPath], arguments.length);
|
|
753
|
+
let conf = null;
|
|
754
|
+
const obj = this[kPkgUp](rootPath || __classPrivateFieldGet(this, _YargsInstance_cwd, "f"));
|
|
755
|
+
if (obj[key] && typeof obj[key] === 'object') {
|
|
756
|
+
conf = applyExtends(obj[key], rootPath || __classPrivateFieldGet(this, _YargsInstance_cwd, "f"), this[kGetParserConfiguration]()['deep-merge-config'] || false, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
|
|
757
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = (__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []).concat(conf);
|
|
758
|
+
}
|
|
759
|
+
return this;
|
|
760
|
+
}
|
|
761
|
+
positional(key, opts) {
|
|
762
|
+
argsert('<string> <object>', [key, opts], arguments.length);
|
|
683
763
|
const supportedOpts = [
|
|
684
764
|
'default',
|
|
685
765
|
'defaultDescription',
|
|
@@ -695,14 +775,13 @@ function Yargs(processArgs = [], cwd = shim.process.cwd(), parentRequire) {
|
|
|
695
775
|
'alias',
|
|
696
776
|
];
|
|
697
777
|
opts = objFilter(opts, (k, v) => {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
return accept;
|
|
778
|
+
if (k === 'type' && !['string', 'number', 'boolean'].includes(v))
|
|
779
|
+
return false;
|
|
780
|
+
return supportedOpts.includes(k);
|
|
702
781
|
});
|
|
703
|
-
const fullCommand =
|
|
782
|
+
const fullCommand = __classPrivateFieldGet(this, _YargsInstance_context, "f").fullCommands[__classPrivateFieldGet(this, _YargsInstance_context, "f").fullCommands.length - 1];
|
|
704
783
|
const parseOptions = fullCommand
|
|
705
|
-
?
|
|
784
|
+
? __classPrivateFieldGet(this, _YargsInstance_command, "f").cmdToParseOptions(fullCommand)
|
|
706
785
|
: {
|
|
707
786
|
array: [],
|
|
708
787
|
alias: {},
|
|
@@ -720,92 +799,150 @@ function Yargs(processArgs = [], cwd = shim.process.cwd(), parentRequire) {
|
|
|
720
799
|
opts[pk] = parseOption[key];
|
|
721
800
|
}
|
|
722
801
|
});
|
|
723
|
-
|
|
724
|
-
return
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
argsert('
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
802
|
+
this.group(key, __classPrivateFieldGet(this, _YargsInstance_usage, "f").getPositionalGroupName());
|
|
803
|
+
return this.option(key, opts);
|
|
804
|
+
}
|
|
805
|
+
recommendCommands(recommend = true) {
|
|
806
|
+
argsert('[boolean]', [recommend], arguments.length);
|
|
807
|
+
__classPrivateFieldSet(this, _YargsInstance_recommendCommands, recommend, "f");
|
|
808
|
+
return this;
|
|
809
|
+
}
|
|
810
|
+
required(keys, max, msg) {
|
|
811
|
+
return this.demand(keys, max, msg);
|
|
812
|
+
}
|
|
813
|
+
require(keys, max, msg) {
|
|
814
|
+
return this.demand(keys, max, msg);
|
|
815
|
+
}
|
|
816
|
+
requiresArg(keys) {
|
|
817
|
+
argsert('<array|string|object> [number]', [keys], arguments.length);
|
|
818
|
+
if (typeof keys === 'string' && __classPrivateFieldGet(this, _YargsInstance_options, "f").narg[keys]) {
|
|
819
|
+
return this;
|
|
820
|
+
}
|
|
821
|
+
else {
|
|
822
|
+
this[kPopulateParserHintSingleValueDictionary](this.requiresArg.bind(this), 'narg', keys, NaN);
|
|
823
|
+
}
|
|
824
|
+
return this;
|
|
825
|
+
}
|
|
826
|
+
showCompletionScript($0, cmd) {
|
|
827
|
+
argsert('[string] [string]', [$0, cmd], arguments.length);
|
|
828
|
+
$0 = $0 || this.$0;
|
|
829
|
+
__classPrivateFieldGet(this, _YargsInstance_logger, "f").log(__classPrivateFieldGet(this, _YargsInstance_completion, "f").generateCompletionScript($0, cmd || __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") || 'completion'));
|
|
830
|
+
return this;
|
|
831
|
+
}
|
|
832
|
+
showHelp(level) {
|
|
833
|
+
argsert('[string|function]', [level], arguments.length);
|
|
834
|
+
__classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
|
|
835
|
+
if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) {
|
|
836
|
+
if (!this.parsed) {
|
|
837
|
+
const parse = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), undefined, undefined, 0, true);
|
|
838
|
+
if (isPromise(parse)) {
|
|
839
|
+
parse.then(() => {
|
|
840
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level);
|
|
841
|
+
});
|
|
842
|
+
return this;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
const builderResponse = __classPrivateFieldGet(this, _YargsInstance_command, "f").runDefaultBuilderOn(this);
|
|
846
|
+
if (isPromise(builderResponse)) {
|
|
847
|
+
builderResponse.then(() => {
|
|
848
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level);
|
|
849
|
+
});
|
|
850
|
+
return this;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level);
|
|
854
|
+
return this;
|
|
855
|
+
}
|
|
856
|
+
scriptName(scriptName) {
|
|
857
|
+
this.customScriptName = true;
|
|
858
|
+
this.$0 = scriptName;
|
|
859
|
+
return this;
|
|
860
|
+
}
|
|
861
|
+
showHelpOnFail(enabled, message) {
|
|
862
|
+
argsert('[boolean|string] [string]', [enabled, message], arguments.length);
|
|
863
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelpOnFail(enabled, message);
|
|
864
|
+
return this;
|
|
865
|
+
}
|
|
866
|
+
showVersion(level) {
|
|
867
|
+
argsert('[string|function]', [level], arguments.length);
|
|
868
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").showVersion(level);
|
|
869
|
+
return this;
|
|
870
|
+
}
|
|
871
|
+
skipValidation(keys) {
|
|
872
|
+
argsert('<array|string>', [keys], arguments.length);
|
|
873
|
+
this[kPopulateParserHintArray]('skipValidation', keys);
|
|
874
|
+
return this;
|
|
875
|
+
}
|
|
876
|
+
strict(enabled) {
|
|
877
|
+
argsert('[boolean]', [enabled], arguments.length);
|
|
878
|
+
__classPrivateFieldSet(this, _YargsInstance_strict, enabled !== false, "f");
|
|
879
|
+
return this;
|
|
880
|
+
}
|
|
881
|
+
strictCommands(enabled) {
|
|
882
|
+
argsert('[boolean]', [enabled], arguments.length);
|
|
883
|
+
__classPrivateFieldSet(this, _YargsInstance_strictCommands, enabled !== false, "f");
|
|
884
|
+
return this;
|
|
885
|
+
}
|
|
886
|
+
strictOptions(enabled) {
|
|
887
|
+
argsert('[boolean]', [enabled], arguments.length);
|
|
888
|
+
__classPrivateFieldSet(this, _YargsInstance_strictOptions, enabled !== false, "f");
|
|
889
|
+
return this;
|
|
890
|
+
}
|
|
891
|
+
string(keys) {
|
|
892
|
+
argsert('<array|string>', [keys], arguments.length);
|
|
893
|
+
this[kPopulateParserHintArray]('string', keys);
|
|
894
|
+
this[kTrackManuallySetKeys](keys);
|
|
895
|
+
return this;
|
|
896
|
+
}
|
|
897
|
+
terminalWidth() {
|
|
898
|
+
argsert([], 0);
|
|
899
|
+
return __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.stdColumns;
|
|
900
|
+
}
|
|
901
|
+
updateLocale(obj) {
|
|
902
|
+
return this.updateStrings(obj);
|
|
903
|
+
}
|
|
904
|
+
updateStrings(obj) {
|
|
905
|
+
argsert('<object>', [obj], arguments.length);
|
|
906
|
+
__classPrivateFieldSet(this, _YargsInstance_detectLocale, false, "f");
|
|
907
|
+
__classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.updateLocale(obj);
|
|
908
|
+
return this;
|
|
909
|
+
}
|
|
910
|
+
usage(msg, description, builder, handler) {
|
|
911
|
+
argsert('<string|null|undefined> [string|boolean] [function|object] [function]', [msg, description, builder, handler], arguments.length);
|
|
912
|
+
if (description !== undefined) {
|
|
913
|
+
assertNotStrictEqual(msg, null, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
|
|
914
|
+
if ((msg || '').match(/^\$0( |$)/)) {
|
|
915
|
+
return this.command(msg, description, builder, handler);
|
|
916
|
+
}
|
|
917
|
+
else {
|
|
918
|
+
throw new YError('.usage() description must start with $0 if being used as alias for .command()');
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
else {
|
|
922
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").usage(msg);
|
|
923
|
+
return this;
|
|
731
924
|
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
if (seen[key])
|
|
735
|
-
return false;
|
|
736
|
-
return (seen[key] = true);
|
|
737
|
-
});
|
|
738
|
-
return self;
|
|
739
|
-
};
|
|
740
|
-
self.getGroups = () => Object.assign({}, groups, preservedGroups);
|
|
741
|
-
self.env = function (prefix) {
|
|
742
|
-
argsert('[string|boolean]', [prefix], arguments.length);
|
|
743
|
-
if (prefix === false)
|
|
744
|
-
delete options.envPrefix;
|
|
745
|
-
else
|
|
746
|
-
options.envPrefix = prefix || '';
|
|
747
|
-
return self;
|
|
748
|
-
};
|
|
749
|
-
self.wrap = function (cols) {
|
|
750
|
-
argsert('<number|null|undefined>', [cols], arguments.length);
|
|
751
|
-
usage.wrap(cols);
|
|
752
|
-
return self;
|
|
753
|
-
};
|
|
754
|
-
let strict = false;
|
|
755
|
-
self.strict = function (enabled) {
|
|
756
|
-
argsert('[boolean]', [enabled], arguments.length);
|
|
757
|
-
strict = enabled !== false;
|
|
758
|
-
return self;
|
|
759
|
-
};
|
|
760
|
-
self.getStrict = () => strict;
|
|
761
|
-
let strictCommands = false;
|
|
762
|
-
self.strictCommands = function (enabled) {
|
|
763
|
-
argsert('[boolean]', [enabled], arguments.length);
|
|
764
|
-
strictCommands = enabled !== false;
|
|
765
|
-
return self;
|
|
766
|
-
};
|
|
767
|
-
self.getStrictCommands = () => strictCommands;
|
|
768
|
-
let strictOptions = false;
|
|
769
|
-
self.strictOptions = function (enabled) {
|
|
770
|
-
argsert('[boolean]', [enabled], arguments.length);
|
|
771
|
-
strictOptions = enabled !== false;
|
|
772
|
-
return self;
|
|
773
|
-
};
|
|
774
|
-
self.getStrictOptions = () => strictOptions;
|
|
775
|
-
let parserConfig = {};
|
|
776
|
-
self.parserConfiguration = function parserConfiguration(config) {
|
|
925
|
+
}
|
|
926
|
+
usageConfiguration(config) {
|
|
777
927
|
argsert('<object>', [config], arguments.length);
|
|
778
|
-
|
|
779
|
-
return
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
self.showHelp = function (level) {
|
|
783
|
-
argsert('[string|function]', [level], arguments.length);
|
|
784
|
-
if (!self.parsed)
|
|
785
|
-
self._parseArgs(processArgs);
|
|
786
|
-
if (command.hasDefaultCommand()) {
|
|
787
|
-
context.resets++;
|
|
788
|
-
command.runDefaultBuilderOn(self);
|
|
789
|
-
}
|
|
790
|
-
usage.showHelp(level);
|
|
791
|
-
return self;
|
|
792
|
-
};
|
|
793
|
-
let versionOpt = null;
|
|
794
|
-
self.version = function version(opt, msg, ver) {
|
|
928
|
+
__classPrivateFieldSet(this, _YargsInstance_usageConfig, config, "f");
|
|
929
|
+
return this;
|
|
930
|
+
}
|
|
931
|
+
version(opt, msg, ver) {
|
|
795
932
|
const defaultVersionOpt = 'version';
|
|
796
933
|
argsert('[boolean|string] [string] [string]', [opt, msg, ver], arguments.length);
|
|
797
|
-
if (
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
934
|
+
if (__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f")) {
|
|
935
|
+
this[kDeleteFromParserHintObject](__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f"));
|
|
936
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").version(undefined);
|
|
937
|
+
__classPrivateFieldSet(this, _YargsInstance_versionOpt, null, "f");
|
|
801
938
|
}
|
|
802
939
|
if (arguments.length === 0) {
|
|
803
|
-
ver =
|
|
940
|
+
ver = this[kGuessVersion]();
|
|
804
941
|
opt = defaultVersionOpt;
|
|
805
942
|
}
|
|
806
943
|
else if (arguments.length === 1) {
|
|
807
944
|
if (opt === false) {
|
|
808
|
-
return
|
|
945
|
+
return this;
|
|
809
946
|
}
|
|
810
947
|
ver = opt;
|
|
811
948
|
opt = defaultVersionOpt;
|
|
@@ -814,330 +951,567 @@ function Yargs(processArgs = [], cwd = shim.process.cwd(), parentRequire) {
|
|
|
814
951
|
ver = msg;
|
|
815
952
|
msg = undefined;
|
|
816
953
|
}
|
|
817
|
-
|
|
818
|
-
msg = msg ||
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
return
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
|
|
954
|
+
__classPrivateFieldSet(this, _YargsInstance_versionOpt, typeof opt === 'string' ? opt : defaultVersionOpt, "f");
|
|
955
|
+
msg = msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup('Show version number');
|
|
956
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").version(ver || undefined);
|
|
957
|
+
this.boolean(__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f"));
|
|
958
|
+
this.describe(__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f"), msg);
|
|
959
|
+
return this;
|
|
960
|
+
}
|
|
961
|
+
wrap(cols) {
|
|
962
|
+
argsert('<number|null|undefined>', [cols], arguments.length);
|
|
963
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").wrap(cols);
|
|
964
|
+
return this;
|
|
965
|
+
}
|
|
966
|
+
[(_YargsInstance_command = new WeakMap(), _YargsInstance_cwd = new WeakMap(), _YargsInstance_context = new WeakMap(), _YargsInstance_completion = new WeakMap(), _YargsInstance_completionCommand = new WeakMap(), _YargsInstance_defaultShowHiddenOpt = new WeakMap(), _YargsInstance_exitError = new WeakMap(), _YargsInstance_detectLocale = new WeakMap(), _YargsInstance_emittedWarnings = new WeakMap(), _YargsInstance_exitProcess = new WeakMap(), _YargsInstance_frozens = new WeakMap(), _YargsInstance_globalMiddleware = new WeakMap(), _YargsInstance_groups = new WeakMap(), _YargsInstance_hasOutput = new WeakMap(), _YargsInstance_helpOpt = new WeakMap(), _YargsInstance_isGlobalContext = new WeakMap(), _YargsInstance_logger = new WeakMap(), _YargsInstance_output = new WeakMap(), _YargsInstance_options = new WeakMap(), _YargsInstance_parentRequire = new WeakMap(), _YargsInstance_parserConfig = new WeakMap(), _YargsInstance_parseFn = new WeakMap(), _YargsInstance_parseContext = new WeakMap(), _YargsInstance_pkgs = new WeakMap(), _YargsInstance_preservedGroups = new WeakMap(), _YargsInstance_processArgs = new WeakMap(), _YargsInstance_recommendCommands = new WeakMap(), _YargsInstance_shim = new WeakMap(), _YargsInstance_strict = new WeakMap(), _YargsInstance_strictCommands = new WeakMap(), _YargsInstance_strictOptions = new WeakMap(), _YargsInstance_usage = new WeakMap(), _YargsInstance_usageConfig = new WeakMap(), _YargsInstance_versionOpt = new WeakMap(), _YargsInstance_validation = new WeakMap(), kCopyDoubleDash)](argv) {
|
|
967
|
+
if (!argv._ || !argv['--'])
|
|
968
|
+
return argv;
|
|
969
|
+
argv._.push.apply(argv._, argv['--']);
|
|
970
|
+
try {
|
|
971
|
+
delete argv['--'];
|
|
972
|
+
}
|
|
973
|
+
catch (_err) { }
|
|
974
|
+
return argv;
|
|
975
|
+
}
|
|
976
|
+
[kCreateLogger]() {
|
|
977
|
+
return {
|
|
978
|
+
log: (...args) => {
|
|
979
|
+
if (!this[kHasParseCallback]())
|
|
980
|
+
console.log(...args);
|
|
981
|
+
__classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
|
|
982
|
+
if (__classPrivateFieldGet(this, _YargsInstance_output, "f").length)
|
|
983
|
+
__classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + '\n', "f");
|
|
984
|
+
__classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + args.join(' '), "f");
|
|
985
|
+
},
|
|
986
|
+
error: (...args) => {
|
|
987
|
+
if (!this[kHasParseCallback]())
|
|
988
|
+
console.error(...args);
|
|
989
|
+
__classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
|
|
990
|
+
if (__classPrivateFieldGet(this, _YargsInstance_output, "f").length)
|
|
991
|
+
__classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + '\n', "f");
|
|
992
|
+
__classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + args.join(' '), "f");
|
|
993
|
+
},
|
|
994
|
+
};
|
|
995
|
+
}
|
|
996
|
+
[kDeleteFromParserHintObject](optionKey) {
|
|
997
|
+
objectKeys(__classPrivateFieldGet(this, _YargsInstance_options, "f")).forEach((hintKey) => {
|
|
998
|
+
if (((key) => key === 'configObjects')(hintKey))
|
|
999
|
+
return;
|
|
1000
|
+
const hint = __classPrivateFieldGet(this, _YargsInstance_options, "f")[hintKey];
|
|
1001
|
+
if (Array.isArray(hint)) {
|
|
1002
|
+
if (hint.includes(optionKey))
|
|
1003
|
+
hint.splice(hint.indexOf(optionKey), 1);
|
|
1004
|
+
}
|
|
1005
|
+
else if (typeof hint === 'object') {
|
|
1006
|
+
delete hint[optionKey];
|
|
1007
|
+
}
|
|
1008
|
+
});
|
|
1009
|
+
delete __classPrivateFieldGet(this, _YargsInstance_usage, "f").getDescriptions()[optionKey];
|
|
1010
|
+
}
|
|
1011
|
+
[kEmitWarning](warning, type, deduplicationId) {
|
|
1012
|
+
if (!__classPrivateFieldGet(this, _YargsInstance_emittedWarnings, "f")[deduplicationId]) {
|
|
1013
|
+
__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.emitWarning(warning, type);
|
|
1014
|
+
__classPrivateFieldGet(this, _YargsInstance_emittedWarnings, "f")[deduplicationId] = true;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
[kFreeze]() {
|
|
1018
|
+
__classPrivateFieldGet(this, _YargsInstance_frozens, "f").push({
|
|
1019
|
+
options: __classPrivateFieldGet(this, _YargsInstance_options, "f"),
|
|
1020
|
+
configObjects: __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects.slice(0),
|
|
1021
|
+
exitProcess: __classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"),
|
|
1022
|
+
groups: __classPrivateFieldGet(this, _YargsInstance_groups, "f"),
|
|
1023
|
+
strict: __classPrivateFieldGet(this, _YargsInstance_strict, "f"),
|
|
1024
|
+
strictCommands: __classPrivateFieldGet(this, _YargsInstance_strictCommands, "f"),
|
|
1025
|
+
strictOptions: __classPrivateFieldGet(this, _YargsInstance_strictOptions, "f"),
|
|
1026
|
+
completionCommand: __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f"),
|
|
1027
|
+
output: __classPrivateFieldGet(this, _YargsInstance_output, "f"),
|
|
1028
|
+
exitError: __classPrivateFieldGet(this, _YargsInstance_exitError, "f"),
|
|
1029
|
+
hasOutput: __classPrivateFieldGet(this, _YargsInstance_hasOutput, "f"),
|
|
1030
|
+
parsed: this.parsed,
|
|
1031
|
+
parseFn: __classPrivateFieldGet(this, _YargsInstance_parseFn, "f"),
|
|
1032
|
+
parseContext: __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"),
|
|
1033
|
+
});
|
|
1034
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").freeze();
|
|
1035
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").freeze();
|
|
1036
|
+
__classPrivateFieldGet(this, _YargsInstance_command, "f").freeze();
|
|
1037
|
+
__classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").freeze();
|
|
1038
|
+
}
|
|
1039
|
+
[kGetDollarZero]() {
|
|
1040
|
+
let $0 = '';
|
|
1041
|
+
let default$0;
|
|
1042
|
+
if (/\b(node|iojs|electron|bun)(\.exe)?$/.test(__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv()[0])) {
|
|
1043
|
+
default$0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv().slice(1, 2);
|
|
1044
|
+
}
|
|
1045
|
+
else {
|
|
1046
|
+
default$0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv().slice(0, 1);
|
|
1047
|
+
}
|
|
1048
|
+
$0 = default$0
|
|
1049
|
+
.map(x => {
|
|
1050
|
+
const b = this[kRebase](__classPrivateFieldGet(this, _YargsInstance_cwd, "f"), x);
|
|
1051
|
+
return x.match(/^(\/|([a-zA-Z]:)?\\)/) && b.length < x.length ? b : x;
|
|
1052
|
+
})
|
|
1053
|
+
.join(' ')
|
|
1054
|
+
.trim();
|
|
1055
|
+
if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('_') &&
|
|
1056
|
+
__classPrivateFieldGet(this, _YargsInstance_shim, "f").getProcessArgvBin() === __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('_')) {
|
|
1057
|
+
$0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f")
|
|
1058
|
+
.getEnv('_')
|
|
1059
|
+
.replace(`${__classPrivateFieldGet(this, _YargsInstance_shim, "f").path.dirname(__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.execPath())}/`, '');
|
|
1060
|
+
}
|
|
1061
|
+
return $0;
|
|
1062
|
+
}
|
|
1063
|
+
[kGetParserConfiguration]() {
|
|
1064
|
+
return __classPrivateFieldGet(this, _YargsInstance_parserConfig, "f");
|
|
1065
|
+
}
|
|
1066
|
+
[kGetUsageConfiguration]() {
|
|
1067
|
+
return __classPrivateFieldGet(this, _YargsInstance_usageConfig, "f");
|
|
1068
|
+
}
|
|
1069
|
+
[kGuessLocale]() {
|
|
1070
|
+
if (!__classPrivateFieldGet(this, _YargsInstance_detectLocale, "f"))
|
|
1071
|
+
return;
|
|
1072
|
+
const locale = __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('LC_ALL') ||
|
|
1073
|
+
__classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('LC_MESSAGES') ||
|
|
1074
|
+
__classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('LANG') ||
|
|
1075
|
+
__classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('LANGUAGE') ||
|
|
1076
|
+
'en_US';
|
|
1077
|
+
this.locale(locale.replace(/[.:].*/, ''));
|
|
1078
|
+
}
|
|
1079
|
+
[kGuessVersion]() {
|
|
1080
|
+
const obj = this[kPkgUp]();
|
|
826
1081
|
return obj.version || 'unknown';
|
|
827
1082
|
}
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
1083
|
+
[kParsePositionalNumbers](argv) {
|
|
1084
|
+
const args = argv['--'] ? argv['--'] : argv._;
|
|
1085
|
+
for (let i = 0, arg; (arg = args[i]) !== undefined; i++) {
|
|
1086
|
+
if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.looksLikeNumber(arg) &&
|
|
1087
|
+
Number.isSafeInteger(Math.floor(parseFloat(`${arg}`)))) {
|
|
1088
|
+
args[i] = Number(arg);
|
|
1089
|
+
}
|
|
835
1090
|
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
1091
|
+
return argv;
|
|
1092
|
+
}
|
|
1093
|
+
[kPkgUp](rootPath) {
|
|
1094
|
+
const npath = rootPath || '*';
|
|
1095
|
+
if (__classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath])
|
|
1096
|
+
return __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath];
|
|
1097
|
+
let obj = {};
|
|
1098
|
+
try {
|
|
1099
|
+
let startDir = rootPath || __classPrivateFieldGet(this, _YargsInstance_shim, "f").mainFilename;
|
|
1100
|
+
if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").path.extname(startDir)) {
|
|
1101
|
+
startDir = __classPrivateFieldGet(this, _YargsInstance_shim, "f").path.dirname(startDir);
|
|
1102
|
+
}
|
|
1103
|
+
const pkgJsonPath = __classPrivateFieldGet(this, _YargsInstance_shim, "f").findUp(startDir, (dir, names) => {
|
|
1104
|
+
if (names.includes('package.json')) {
|
|
1105
|
+
return 'package.json';
|
|
1106
|
+
}
|
|
1107
|
+
else {
|
|
1108
|
+
return undefined;
|
|
1109
|
+
}
|
|
1110
|
+
});
|
|
1111
|
+
assertNotStrictEqual(pkgJsonPath, undefined, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
|
|
1112
|
+
obj = JSON.parse(__classPrivateFieldGet(this, _YargsInstance_shim, "f").readFileSync(pkgJsonPath, 'utf8'));
|
|
839
1113
|
}
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
1114
|
+
catch (_noop) { }
|
|
1115
|
+
__classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath] = obj || {};
|
|
1116
|
+
return __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath];
|
|
1117
|
+
}
|
|
1118
|
+
[kPopulateParserHintArray](type, keys) {
|
|
1119
|
+
keys = [].concat(keys);
|
|
1120
|
+
keys.forEach(key => {
|
|
1121
|
+
key = this[kSanitizeKey](key);
|
|
1122
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f")[type].push(key);
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
[kPopulateParserHintSingleValueDictionary](builder, type, key, value) {
|
|
1126
|
+
this[kPopulateParserHintDictionary](builder, type, key, value, (type, key, value) => {
|
|
1127
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f")[type][key] = value;
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
[kPopulateParserHintArrayDictionary](builder, type, key, value) {
|
|
1131
|
+
this[kPopulateParserHintDictionary](builder, type, key, value, (type, key, value) => {
|
|
1132
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f")[type][key] = (__classPrivateFieldGet(this, _YargsInstance_options, "f")[type][key] || []).concat(value);
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
[kPopulateParserHintDictionary](builder, type, key, value, singleKeyHandler) {
|
|
1136
|
+
if (Array.isArray(key)) {
|
|
1137
|
+
key.forEach(k => {
|
|
1138
|
+
builder(k, value);
|
|
1139
|
+
});
|
|
852
1140
|
}
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
return self;
|
|
858
|
-
};
|
|
859
|
-
self.hide = function hide(key) {
|
|
860
|
-
argsert('<string>', [key], arguments.length);
|
|
861
|
-
options.hiddenOptions.push(key);
|
|
862
|
-
return self;
|
|
863
|
-
};
|
|
864
|
-
self.showHelpOnFail = function showHelpOnFail(enabled, message) {
|
|
865
|
-
argsert('[boolean|string] [string]', [enabled, message], arguments.length);
|
|
866
|
-
usage.showHelpOnFail(enabled, message);
|
|
867
|
-
return self;
|
|
868
|
-
};
|
|
869
|
-
let exitProcess = true;
|
|
870
|
-
self.exitProcess = function (enabled = true) {
|
|
871
|
-
argsert('[boolean]', [enabled], arguments.length);
|
|
872
|
-
exitProcess = enabled;
|
|
873
|
-
return self;
|
|
874
|
-
};
|
|
875
|
-
self.getExitProcess = () => exitProcess;
|
|
876
|
-
self.showCompletionScript = function ($0, cmd) {
|
|
877
|
-
argsert('[string] [string]', [$0, cmd], arguments.length);
|
|
878
|
-
$0 = $0 || self.$0;
|
|
879
|
-
_logger.log(completion.generateCompletionScript($0, cmd || completionCommand || 'completion'));
|
|
880
|
-
return self;
|
|
881
|
-
};
|
|
882
|
-
self.getCompletion = function (args, done) {
|
|
883
|
-
argsert('<array> <function>', [args, done], arguments.length);
|
|
884
|
-
completion.getCompletion(args, done);
|
|
885
|
-
};
|
|
886
|
-
self.locale = function (locale) {
|
|
887
|
-
argsert('[string]', [locale], arguments.length);
|
|
888
|
-
if (!locale) {
|
|
889
|
-
guessLocale();
|
|
890
|
-
return y18n.getLocale();
|
|
1141
|
+
else if (((key) => typeof key === 'object')(key)) {
|
|
1142
|
+
for (const k of objectKeys(key)) {
|
|
1143
|
+
builder(k, key[k]);
|
|
1144
|
+
}
|
|
891
1145
|
}
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
1146
|
+
else {
|
|
1147
|
+
singleKeyHandler(type, this[kSanitizeKey](key), value);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
[kSanitizeKey](key) {
|
|
1151
|
+
if (key === '__proto__')
|
|
1152
|
+
return '___proto___';
|
|
1153
|
+
return key;
|
|
1154
|
+
}
|
|
1155
|
+
[kSetKey](key, set) {
|
|
1156
|
+
this[kPopulateParserHintSingleValueDictionary](this[kSetKey].bind(this), 'key', key, set);
|
|
1157
|
+
return this;
|
|
1158
|
+
}
|
|
1159
|
+
[kUnfreeze]() {
|
|
1160
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1161
|
+
const frozen = __classPrivateFieldGet(this, _YargsInstance_frozens, "f").pop();
|
|
1162
|
+
assertNotStrictEqual(frozen, undefined, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
|
|
1163
|
+
let configObjects;
|
|
1164
|
+
(_a = this, _b = this, _c = this, _d = this, _e = this, _f = this, _g = this, _h = this, _j = this, _k = this, _l = this, _m = this, {
|
|
1165
|
+
options: ({ set value(_o) { __classPrivateFieldSet(_a, _YargsInstance_options, _o, "f"); } }).value,
|
|
1166
|
+
configObjects,
|
|
1167
|
+
exitProcess: ({ set value(_o) { __classPrivateFieldSet(_b, _YargsInstance_exitProcess, _o, "f"); } }).value,
|
|
1168
|
+
groups: ({ set value(_o) { __classPrivateFieldSet(_c, _YargsInstance_groups, _o, "f"); } }).value,
|
|
1169
|
+
output: ({ set value(_o) { __classPrivateFieldSet(_d, _YargsInstance_output, _o, "f"); } }).value,
|
|
1170
|
+
exitError: ({ set value(_o) { __classPrivateFieldSet(_e, _YargsInstance_exitError, _o, "f"); } }).value,
|
|
1171
|
+
hasOutput: ({ set value(_o) { __classPrivateFieldSet(_f, _YargsInstance_hasOutput, _o, "f"); } }).value,
|
|
1172
|
+
parsed: this.parsed,
|
|
1173
|
+
strict: ({ set value(_o) { __classPrivateFieldSet(_g, _YargsInstance_strict, _o, "f"); } }).value,
|
|
1174
|
+
strictCommands: ({ set value(_o) { __classPrivateFieldSet(_h, _YargsInstance_strictCommands, _o, "f"); } }).value,
|
|
1175
|
+
strictOptions: ({ set value(_o) { __classPrivateFieldSet(_j, _YargsInstance_strictOptions, _o, "f"); } }).value,
|
|
1176
|
+
completionCommand: ({ set value(_o) { __classPrivateFieldSet(_k, _YargsInstance_completionCommand, _o, "f"); } }).value,
|
|
1177
|
+
parseFn: ({ set value(_o) { __classPrivateFieldSet(_l, _YargsInstance_parseFn, _o, "f"); } }).value,
|
|
1178
|
+
parseContext: ({ set value(_o) { __classPrivateFieldSet(_m, _YargsInstance_parseContext, _o, "f"); } }).value,
|
|
1179
|
+
} = frozen);
|
|
1180
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = configObjects;
|
|
1181
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").unfreeze();
|
|
1182
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").unfreeze();
|
|
1183
|
+
__classPrivateFieldGet(this, _YargsInstance_command, "f").unfreeze();
|
|
1184
|
+
__classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").unfreeze();
|
|
1185
|
+
}
|
|
1186
|
+
[kValidateAsync](validation, argv) {
|
|
1187
|
+
return maybeAsyncResult(argv, result => {
|
|
1188
|
+
validation(result);
|
|
1189
|
+
return result;
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
getInternalMethods() {
|
|
1193
|
+
return {
|
|
1194
|
+
getCommandInstance: this[kGetCommandInstance].bind(this),
|
|
1195
|
+
getContext: this[kGetContext].bind(this),
|
|
1196
|
+
getHasOutput: this[kGetHasOutput].bind(this),
|
|
1197
|
+
getLoggerInstance: this[kGetLoggerInstance].bind(this),
|
|
1198
|
+
getParseContext: this[kGetParseContext].bind(this),
|
|
1199
|
+
getParserConfiguration: this[kGetParserConfiguration].bind(this),
|
|
1200
|
+
getUsageConfiguration: this[kGetUsageConfiguration].bind(this),
|
|
1201
|
+
getUsageInstance: this[kGetUsageInstance].bind(this),
|
|
1202
|
+
getValidationInstance: this[kGetValidationInstance].bind(this),
|
|
1203
|
+
hasParseCallback: this[kHasParseCallback].bind(this),
|
|
1204
|
+
isGlobalContext: this[kIsGlobalContext].bind(this),
|
|
1205
|
+
postProcess: this[kPostProcess].bind(this),
|
|
1206
|
+
reset: this[kReset].bind(this),
|
|
1207
|
+
runValidation: this[kRunValidation].bind(this),
|
|
1208
|
+
runYargsParserAndExecuteCommands: this[kRunYargsParserAndExecuteCommands].bind(this),
|
|
1209
|
+
setHasOutput: this[kSetHasOutput].bind(this),
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
[kGetCommandInstance]() {
|
|
1213
|
+
return __classPrivateFieldGet(this, _YargsInstance_command, "f");
|
|
1214
|
+
}
|
|
1215
|
+
[kGetContext]() {
|
|
1216
|
+
return __classPrivateFieldGet(this, _YargsInstance_context, "f");
|
|
1217
|
+
}
|
|
1218
|
+
[kGetHasOutput]() {
|
|
1219
|
+
return __classPrivateFieldGet(this, _YargsInstance_hasOutput, "f");
|
|
1220
|
+
}
|
|
1221
|
+
[kGetLoggerInstance]() {
|
|
1222
|
+
return __classPrivateFieldGet(this, _YargsInstance_logger, "f");
|
|
1223
|
+
}
|
|
1224
|
+
[kGetParseContext]() {
|
|
1225
|
+
return __classPrivateFieldGet(this, _YargsInstance_parseContext, "f") || {};
|
|
1226
|
+
}
|
|
1227
|
+
[kGetUsageInstance]() {
|
|
1228
|
+
return __classPrivateFieldGet(this, _YargsInstance_usage, "f");
|
|
1229
|
+
}
|
|
1230
|
+
[kGetValidationInstance]() {
|
|
1231
|
+
return __classPrivateFieldGet(this, _YargsInstance_validation, "f");
|
|
1232
|
+
}
|
|
1233
|
+
[kHasParseCallback]() {
|
|
1234
|
+
return !!__classPrivateFieldGet(this, _YargsInstance_parseFn, "f");
|
|
1235
|
+
}
|
|
1236
|
+
[kIsGlobalContext]() {
|
|
1237
|
+
return __classPrivateFieldGet(this, _YargsInstance_isGlobalContext, "f");
|
|
1238
|
+
}
|
|
1239
|
+
[kPostProcess](argv, populateDoubleDash, calledFromCommand, runGlobalMiddleware) {
|
|
1240
|
+
if (calledFromCommand)
|
|
1241
|
+
return argv;
|
|
1242
|
+
if (isPromise(argv))
|
|
1243
|
+
return argv;
|
|
1244
|
+
if (!populateDoubleDash) {
|
|
1245
|
+
argv = this[kCopyDoubleDash](argv);
|
|
1246
|
+
}
|
|
1247
|
+
const parsePositionalNumbers = this[kGetParserConfiguration]()['parse-positional-numbers'] ||
|
|
1248
|
+
this[kGetParserConfiguration]()['parse-positional-numbers'] === undefined;
|
|
1249
|
+
if (parsePositionalNumbers) {
|
|
1250
|
+
argv = this[kParsePositionalNumbers](argv);
|
|
1251
|
+
}
|
|
1252
|
+
if (runGlobalMiddleware) {
|
|
1253
|
+
argv = applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false);
|
|
1254
|
+
}
|
|
1255
|
+
return argv;
|
|
1256
|
+
}
|
|
1257
|
+
[kReset](aliases = {}) {
|
|
1258
|
+
__classPrivateFieldSet(this, _YargsInstance_options, __classPrivateFieldGet(this, _YargsInstance_options, "f") || {}, "f");
|
|
1259
|
+
const tmpOptions = {};
|
|
1260
|
+
tmpOptions.local = __classPrivateFieldGet(this, _YargsInstance_options, "f").local || [];
|
|
1261
|
+
tmpOptions.configObjects = __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || [];
|
|
1262
|
+
const localLookup = {};
|
|
1263
|
+
tmpOptions.local.forEach(l => {
|
|
1264
|
+
localLookup[l] = true;
|
|
1265
|
+
(aliases[l] || []).forEach(a => {
|
|
1266
|
+
localLookup[a] = true;
|
|
1267
|
+
});
|
|
1268
|
+
});
|
|
1269
|
+
Object.assign(__classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f"), Object.keys(__classPrivateFieldGet(this, _YargsInstance_groups, "f")).reduce((acc, groupName) => {
|
|
1270
|
+
const keys = __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName].filter(key => !(key in localLookup));
|
|
1271
|
+
if (keys.length > 0) {
|
|
1272
|
+
acc[groupName] = keys;
|
|
1273
|
+
}
|
|
1274
|
+
return acc;
|
|
1275
|
+
}, {}));
|
|
1276
|
+
__classPrivateFieldSet(this, _YargsInstance_groups, {}, "f");
|
|
1277
|
+
const arrayOptions = [
|
|
1278
|
+
'array',
|
|
1279
|
+
'boolean',
|
|
1280
|
+
'string',
|
|
1281
|
+
'skipValidation',
|
|
1282
|
+
'count',
|
|
1283
|
+
'normalize',
|
|
1284
|
+
'number',
|
|
1285
|
+
'hiddenOptions',
|
|
1286
|
+
];
|
|
1287
|
+
const objectOptions = [
|
|
1288
|
+
'narg',
|
|
1289
|
+
'key',
|
|
1290
|
+
'alias',
|
|
1291
|
+
'default',
|
|
1292
|
+
'defaultDescription',
|
|
1293
|
+
'config',
|
|
1294
|
+
'choices',
|
|
1295
|
+
'demandedOptions',
|
|
1296
|
+
'demandedCommands',
|
|
1297
|
+
'deprecatedOptions',
|
|
1298
|
+
];
|
|
1299
|
+
arrayOptions.forEach(k => {
|
|
1300
|
+
tmpOptions[k] = (__classPrivateFieldGet(this, _YargsInstance_options, "f")[k] || []).filter((k) => !localLookup[k]);
|
|
1301
|
+
});
|
|
1302
|
+
objectOptions.forEach((k) => {
|
|
1303
|
+
tmpOptions[k] = objFilter(__classPrivateFieldGet(this, _YargsInstance_options, "f")[k], k => !localLookup[k]);
|
|
1304
|
+
});
|
|
1305
|
+
tmpOptions.envPrefix = __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix;
|
|
1306
|
+
__classPrivateFieldSet(this, _YargsInstance_options, tmpOptions, "f");
|
|
1307
|
+
__classPrivateFieldSet(this, _YargsInstance_usage, __classPrivateFieldGet(this, _YargsInstance_usage, "f")
|
|
1308
|
+
? __classPrivateFieldGet(this, _YargsInstance_usage, "f").reset(localLookup)
|
|
1309
|
+
: Usage(this, __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f");
|
|
1310
|
+
__classPrivateFieldSet(this, _YargsInstance_validation, __classPrivateFieldGet(this, _YargsInstance_validation, "f")
|
|
1311
|
+
? __classPrivateFieldGet(this, _YargsInstance_validation, "f").reset(localLookup)
|
|
1312
|
+
: Validation(this, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f");
|
|
1313
|
+
__classPrivateFieldSet(this, _YargsInstance_command, __classPrivateFieldGet(this, _YargsInstance_command, "f")
|
|
1314
|
+
? __classPrivateFieldGet(this, _YargsInstance_command, "f").reset()
|
|
1315
|
+
: Command(__classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_validation, "f"), __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f");
|
|
1316
|
+
if (!__classPrivateFieldGet(this, _YargsInstance_completion, "f"))
|
|
1317
|
+
__classPrivateFieldSet(this, _YargsInstance_completion, Completion(this, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_command, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f");
|
|
1318
|
+
__classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").reset();
|
|
1319
|
+
__classPrivateFieldSet(this, _YargsInstance_completionCommand, null, "f");
|
|
1320
|
+
__classPrivateFieldSet(this, _YargsInstance_output, '', "f");
|
|
1321
|
+
__classPrivateFieldSet(this, _YargsInstance_exitError, null, "f");
|
|
1322
|
+
__classPrivateFieldSet(this, _YargsInstance_hasOutput, false, "f");
|
|
1323
|
+
this.parsed = false;
|
|
1324
|
+
return this;
|
|
1325
|
+
}
|
|
1326
|
+
[kRebase](base, dir) {
|
|
1327
|
+
return __classPrivateFieldGet(this, _YargsInstance_shim, "f").path.relative(base, dir);
|
|
1328
|
+
}
|
|
1329
|
+
[kRunYargsParserAndExecuteCommands](args, shortCircuit, calledFromCommand, commandIndex = 0, helpOnly = false) {
|
|
1330
|
+
var _a, _b, _c, _d;
|
|
1331
|
+
let skipValidation = !!calledFromCommand || helpOnly;
|
|
1332
|
+
args = args || __classPrivateFieldGet(this, _YargsInstance_processArgs, "f");
|
|
1333
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__;
|
|
1334
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration]();
|
|
1335
|
+
const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration['populate--'];
|
|
1336
|
+
const config = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
|
|
956
1337
|
'populate--': true,
|
|
957
1338
|
});
|
|
958
|
-
const parsed =
|
|
959
|
-
configuration:
|
|
1339
|
+
const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), {
|
|
1340
|
+
configuration: { 'parse-positional-numbers': false, ...config },
|
|
960
1341
|
}));
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
argv = Object.assign({}, argv, parseContext);
|
|
1342
|
+
const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
|
|
1343
|
+
let argvPromise = undefined;
|
|
964
1344
|
const aliases = parsed.aliases;
|
|
965
|
-
|
|
966
|
-
|
|
1345
|
+
let helpOptSet = false;
|
|
1346
|
+
let versionOptSet = false;
|
|
1347
|
+
Object.keys(argv).forEach(key => {
|
|
1348
|
+
if (key === __classPrivateFieldGet(this, _YargsInstance_helpOpt, "f") && argv[key]) {
|
|
1349
|
+
helpOptSet = true;
|
|
1350
|
+
}
|
|
1351
|
+
else if (key === __classPrivateFieldGet(this, _YargsInstance_versionOpt, "f") && argv[key]) {
|
|
1352
|
+
versionOptSet = true;
|
|
1353
|
+
}
|
|
1354
|
+
});
|
|
1355
|
+
argv.$0 = this.$0;
|
|
1356
|
+
this.parsed = parsed;
|
|
1357
|
+
if (commandIndex === 0) {
|
|
1358
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").clearCachedHelpMessage();
|
|
1359
|
+
}
|
|
967
1360
|
try {
|
|
968
|
-
|
|
1361
|
+
this[kGuessLocale]();
|
|
969
1362
|
if (shortCircuit) {
|
|
970
|
-
return
|
|
1363
|
+
return this[kPostProcess](argv, populateDoubleDash, !!calledFromCommand, false);
|
|
971
1364
|
}
|
|
972
|
-
if (
|
|
973
|
-
const helpCmds = [
|
|
974
|
-
.concat(aliases[
|
|
1365
|
+
if (__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")) {
|
|
1366
|
+
const helpCmds = [__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")]
|
|
1367
|
+
.concat(aliases[__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")] || [])
|
|
975
1368
|
.filter(k => k.length > 1);
|
|
976
|
-
if (
|
|
1369
|
+
if (helpCmds.includes('' + argv._[argv._.length - 1])) {
|
|
977
1370
|
argv._.pop();
|
|
978
|
-
|
|
1371
|
+
helpOptSet = true;
|
|
979
1372
|
}
|
|
980
1373
|
}
|
|
981
|
-
|
|
982
|
-
const
|
|
983
|
-
const
|
|
984
|
-
|
|
985
|
-
|
|
1374
|
+
__classPrivateFieldSet(this, _YargsInstance_isGlobalContext, false, "f");
|
|
1375
|
+
const handlerKeys = __classPrivateFieldGet(this, _YargsInstance_command, "f").getCommands();
|
|
1376
|
+
const requestCompletions = ((_a = __classPrivateFieldGet(this, _YargsInstance_completion, "f")) === null || _a === void 0 ? void 0 : _a.completionKey)
|
|
1377
|
+
? [
|
|
1378
|
+
(_b = __classPrivateFieldGet(this, _YargsInstance_completion, "f")) === null || _b === void 0 ? void 0 : _b.completionKey,
|
|
1379
|
+
...((_d = this.getAliases()[(_c = __classPrivateFieldGet(this, _YargsInstance_completion, "f")) === null || _c === void 0 ? void 0 : _c.completionKey]) !== null && _d !== void 0 ? _d : []),
|
|
1380
|
+
].some((key) => Object.prototype.hasOwnProperty.call(argv, key))
|
|
1381
|
+
: false;
|
|
1382
|
+
const skipRecommendation = helpOptSet || requestCompletions || helpOnly;
|
|
986
1383
|
if (argv._.length) {
|
|
987
1384
|
if (handlerKeys.length) {
|
|
988
1385
|
let firstUnknownCommand;
|
|
989
1386
|
for (let i = commandIndex || 0, cmd; argv._[i] !== undefined; i++) {
|
|
990
1387
|
cmd = String(argv._[i]);
|
|
991
|
-
if (
|
|
992
|
-
const innerArgv =
|
|
993
|
-
return
|
|
1388
|
+
if (handlerKeys.includes(cmd) && cmd !== __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) {
|
|
1389
|
+
const innerArgv = __classPrivateFieldGet(this, _YargsInstance_command, "f").runCommand(cmd, this, parsed, i + 1, helpOnly, helpOptSet || versionOptSet || helpOnly);
|
|
1390
|
+
return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false);
|
|
994
1391
|
}
|
|
995
|
-
else if (!firstUnknownCommand &&
|
|
1392
|
+
else if (!firstUnknownCommand &&
|
|
1393
|
+
cmd !== __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) {
|
|
996
1394
|
firstUnknownCommand = cmd;
|
|
997
1395
|
break;
|
|
998
1396
|
}
|
|
999
1397
|
}
|
|
1000
|
-
if (
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
validation.recommendCommands(firstUnknownCommand, handlerKeys);
|
|
1398
|
+
if (!__classPrivateFieldGet(this, _YargsInstance_command, "f").hasDefaultCommand() &&
|
|
1399
|
+
__classPrivateFieldGet(this, _YargsInstance_recommendCommands, "f") &&
|
|
1400
|
+
firstUnknownCommand &&
|
|
1401
|
+
!skipRecommendation) {
|
|
1402
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").recommendCommands(firstUnknownCommand, handlerKeys);
|
|
1006
1403
|
}
|
|
1007
1404
|
}
|
|
1008
|
-
if (
|
|
1009
|
-
|
|
1405
|
+
if (__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") &&
|
|
1406
|
+
argv._.includes(__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) &&
|
|
1010
1407
|
!requestCompletions) {
|
|
1011
|
-
if (
|
|
1408
|
+
if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"))
|
|
1012
1409
|
setBlocking(true);
|
|
1013
|
-
|
|
1014
|
-
|
|
1410
|
+
this.showCompletionScript();
|
|
1411
|
+
this.exit(0);
|
|
1015
1412
|
}
|
|
1016
1413
|
}
|
|
1017
|
-
|
|
1018
|
-
const innerArgv =
|
|
1019
|
-
return
|
|
1414
|
+
if (__classPrivateFieldGet(this, _YargsInstance_command, "f").hasDefaultCommand() && !skipRecommendation) {
|
|
1415
|
+
const innerArgv = __classPrivateFieldGet(this, _YargsInstance_command, "f").runCommand(null, this, parsed, 0, helpOnly, helpOptSet || versionOptSet || helpOnly);
|
|
1416
|
+
return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false);
|
|
1020
1417
|
}
|
|
1021
1418
|
if (requestCompletions) {
|
|
1022
|
-
if (
|
|
1419
|
+
if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"))
|
|
1023
1420
|
setBlocking(true);
|
|
1024
1421
|
args = [].concat(args);
|
|
1025
|
-
const completionArgs = args.slice(args.indexOf(`--${
|
|
1026
|
-
|
|
1422
|
+
const completionArgs = args.slice(args.indexOf(`--${__classPrivateFieldGet(this, _YargsInstance_completion, "f").completionKey}`) + 1);
|
|
1423
|
+
__classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(completionArgs, (err, completions) => {
|
|
1424
|
+
if (err)
|
|
1425
|
+
throw new YError(err.message);
|
|
1027
1426
|
(completions || []).forEach(completion => {
|
|
1028
|
-
|
|
1427
|
+
__classPrivateFieldGet(this, _YargsInstance_logger, "f").log(completion);
|
|
1029
1428
|
});
|
|
1030
|
-
|
|
1429
|
+
this.exit(0);
|
|
1031
1430
|
});
|
|
1032
|
-
return
|
|
1431
|
+
return this[kPostProcess](argv, !populateDoubleDash, !!calledFromCommand, false);
|
|
1033
1432
|
}
|
|
1034
|
-
if (!
|
|
1035
|
-
|
|
1036
|
-
if (
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
}
|
|
1433
|
+
if (!__classPrivateFieldGet(this, _YargsInstance_hasOutput, "f")) {
|
|
1434
|
+
if (helpOptSet) {
|
|
1435
|
+
if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"))
|
|
1436
|
+
setBlocking(true);
|
|
1437
|
+
skipValidation = true;
|
|
1438
|
+
this.showHelp(message => {
|
|
1439
|
+
__classPrivateFieldGet(this, _YargsInstance_logger, "f").log(message);
|
|
1440
|
+
this.exit(0);
|
|
1441
|
+
});
|
|
1442
|
+
}
|
|
1443
|
+
else if (versionOptSet) {
|
|
1444
|
+
if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"))
|
|
1445
|
+
setBlocking(true);
|
|
1446
|
+
skipValidation = true;
|
|
1447
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").showVersion('log');
|
|
1448
|
+
this.exit(0);
|
|
1449
|
+
}
|
|
1051
1450
|
}
|
|
1052
|
-
if (!skipValidation &&
|
|
1053
|
-
skipValidation = Object.keys(argv).some(key =>
|
|
1451
|
+
if (!skipValidation && __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.length > 0) {
|
|
1452
|
+
skipValidation = Object.keys(argv).some(key => __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.indexOf(key) >= 0 && argv[key] === true);
|
|
1054
1453
|
}
|
|
1055
1454
|
if (!skipValidation) {
|
|
1056
1455
|
if (parsed.error)
|
|
1057
1456
|
throw new YError(parsed.error.message);
|
|
1058
1457
|
if (!requestCompletions) {
|
|
1059
|
-
|
|
1458
|
+
const validation = this[kRunValidation](aliases, {}, parsed.error);
|
|
1459
|
+
if (!calledFromCommand) {
|
|
1460
|
+
argvPromise = applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), true);
|
|
1461
|
+
}
|
|
1462
|
+
argvPromise = this[kValidateAsync](validation, argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv);
|
|
1463
|
+
if (isPromise(argvPromise) && !calledFromCommand) {
|
|
1464
|
+
argvPromise = argvPromise.then(() => {
|
|
1465
|
+
return applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false);
|
|
1466
|
+
});
|
|
1467
|
+
}
|
|
1060
1468
|
}
|
|
1061
1469
|
}
|
|
1062
1470
|
}
|
|
1063
1471
|
catch (err) {
|
|
1064
1472
|
if (err instanceof YError)
|
|
1065
|
-
|
|
1473
|
+
__classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message, err);
|
|
1066
1474
|
else
|
|
1067
1475
|
throw err;
|
|
1068
1476
|
}
|
|
1069
|
-
return
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
if (parsePositionalNumbers) {
|
|
1082
|
-
argv = self._parsePositionalNumbers(argv);
|
|
1083
|
-
}
|
|
1084
|
-
return argv;
|
|
1085
|
-
};
|
|
1086
|
-
self._copyDoubleDash = function (argv) {
|
|
1087
|
-
if (!argv._ || !argv['--'])
|
|
1088
|
-
return argv;
|
|
1089
|
-
argv._.push.apply(argv._, argv['--']);
|
|
1090
|
-
try {
|
|
1091
|
-
delete argv['--'];
|
|
1092
|
-
}
|
|
1093
|
-
catch (_err) { }
|
|
1094
|
-
return argv;
|
|
1095
|
-
};
|
|
1096
|
-
self._parsePositionalNumbers = function (argv) {
|
|
1097
|
-
const args = argv['--'] ? argv['--'] : argv._;
|
|
1098
|
-
for (let i = 0, arg; (arg = args[i]) !== undefined; i++) {
|
|
1099
|
-
if (shim.Parser.looksLikeNumber(arg) &&
|
|
1100
|
-
Number.isSafeInteger(Math.floor(parseFloat(`${arg}`)))) {
|
|
1101
|
-
args[i] = Number(arg);
|
|
1477
|
+
return this[kPostProcess](argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv, populateDoubleDash, !!calledFromCommand, true);
|
|
1478
|
+
}
|
|
1479
|
+
[kRunValidation](aliases, positionalMap, parseErrors, isDefaultCommand) {
|
|
1480
|
+
const demandedOptions = { ...this.getDemandedOptions() };
|
|
1481
|
+
return (argv) => {
|
|
1482
|
+
if (parseErrors)
|
|
1483
|
+
throw new YError(parseErrors.message);
|
|
1484
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").nonOptionCount(argv);
|
|
1485
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").requiredArguments(argv, demandedOptions);
|
|
1486
|
+
let failedStrictCommands = false;
|
|
1487
|
+
if (__classPrivateFieldGet(this, _YargsInstance_strictCommands, "f")) {
|
|
1488
|
+
failedStrictCommands = __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownCommands(argv);
|
|
1102
1489
|
}
|
|
1490
|
+
if (__classPrivateFieldGet(this, _YargsInstance_strict, "f") && !failedStrictCommands) {
|
|
1491
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases, positionalMap, !!isDefaultCommand);
|
|
1492
|
+
}
|
|
1493
|
+
else if (__classPrivateFieldGet(this, _YargsInstance_strictOptions, "f")) {
|
|
1494
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases, {}, false, false);
|
|
1495
|
+
}
|
|
1496
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").limitedChoices(argv);
|
|
1497
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").implications(argv);
|
|
1498
|
+
__classPrivateFieldGet(this, _YargsInstance_validation, "f").conflicting(argv);
|
|
1499
|
+
};
|
|
1500
|
+
}
|
|
1501
|
+
[kSetHasOutput]() {
|
|
1502
|
+
__classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
|
|
1503
|
+
}
|
|
1504
|
+
[kTrackManuallySetKeys](keys) {
|
|
1505
|
+
if (typeof keys === 'string') {
|
|
1506
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").key[keys] = true;
|
|
1103
1507
|
}
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
throw new YError(parseErrors.message);
|
|
1109
|
-
validation.nonOptionCount(argv);
|
|
1110
|
-
validation.requiredArguments(argv);
|
|
1111
|
-
let failedStrictCommands = false;
|
|
1112
|
-
if (strictCommands) {
|
|
1113
|
-
failedStrictCommands = validation.unknownCommands(argv);
|
|
1114
|
-
}
|
|
1115
|
-
if (strict && !failedStrictCommands) {
|
|
1116
|
-
validation.unknownArguments(argv, aliases, positionalMap, isDefaultCommand);
|
|
1117
|
-
}
|
|
1118
|
-
else if (strictOptions) {
|
|
1119
|
-
validation.unknownArguments(argv, aliases, {}, false, false);
|
|
1508
|
+
else {
|
|
1509
|
+
for (const k of keys) {
|
|
1510
|
+
__classPrivateFieldGet(this, _YargsInstance_options, "f").key[k] = true;
|
|
1511
|
+
}
|
|
1120
1512
|
}
|
|
1121
|
-
validation.customChecks(argv, aliases);
|
|
1122
|
-
validation.limitedChoices(argv);
|
|
1123
|
-
validation.implications(argv);
|
|
1124
|
-
validation.conflicting(argv);
|
|
1125
|
-
};
|
|
1126
|
-
function guessLocale() {
|
|
1127
|
-
if (!detectLocale)
|
|
1128
|
-
return;
|
|
1129
|
-
const locale = shim.getEnv('LC_ALL') ||
|
|
1130
|
-
shim.getEnv('LC_MESSAGES') ||
|
|
1131
|
-
shim.getEnv('LANG') ||
|
|
1132
|
-
shim.getEnv('LANGUAGE') ||
|
|
1133
|
-
'en_US';
|
|
1134
|
-
self.locale(locale.replace(/[.:].*/, ''));
|
|
1135
1513
|
}
|
|
1136
|
-
self.help();
|
|
1137
|
-
self.version();
|
|
1138
|
-
return self;
|
|
1139
1514
|
}
|
|
1140
|
-
export const rebase = (base, dir) => shim.path.relative(base, dir);
|
|
1141
1515
|
export function isYargsInstance(y) {
|
|
1142
|
-
return !!y && typeof y.
|
|
1516
|
+
return !!y && typeof y.getInternalMethods === 'function';
|
|
1143
1517
|
}
|