From 55e8053e078fb726edc3d15f95ddee0e74e31fea Mon Sep 17 00:00:00 2001 From: wwweww <2646787260@qq.com> Date: Sat, 21 Feb 2026 22:48:40 +0800 Subject: [PATCH] firest commit --- Dockerfile | 30 + Herebyfile.mjs | 183 ++ app/user/api/etc/user-api.yaml | 6 + app/user/api/internal/config/config.go | 14 + app/user/api/internal/handler/routes.go | 25 + .../api/internal/handler/userInfoHandler.go | 32 + app/user/api/internal/logic/userInfoLogic.go | 43 + app/user/api/internal/svc/serviceContext.go | 23 + app/user/api/internal/types/types.go | 13 + app/user/api/user.go | 34 + app/user/rpc/etc/pb.yaml | 6 + app/user/rpc/internal/config/config.go | 10 + .../rpc/internal/logic/getUserInfoLogic.go | 41 + .../rpc/internal/server/usercenterServer.go | 29 + app/user/rpc/internal/svc/serviceContext.go | 13 + app/user/rpc/pb.go | 39 + app/user/rpc/pb/user.pb.go | 184 ++ app/user/rpc/pb/user_grpc.pb.go | 121 + app/user/rpc/usercenter/usercenter.go | 38 + deploy/k8s/base/pg-dx-configmap.yaml | 11 + deploy/k8s/base/postgreSql.yaml | 22 + deploy/k8s/base/service-discovery.yaml | 38 + deploy/k8s/user-api.yaml | 110 + deploy/k8s/user-rpc.yaml | 153 ++ desc/api/order.api | 0 desc/api/user.api | 26 + desc/rpc/user.proto | 18 + desc/sql/users.sql | 13 + go.mod | 93 + go.sum | 274 +++ node_modules/.bin/hereby | 16 + node_modules/.bin/hereby.cmd | 17 + node_modules/.bin/hereby.ps1 | 28 + node_modules/.bin/node-which | 16 + node_modules/.bin/node-which.cmd | 17 + node_modules/.bin/node-which.ps1 | 28 + node_modules/.package-lock.json | 1126 +++++++++ node_modules/@inquirer/ansi/LICENSE | 22 + node_modules/@inquirer/ansi/README.md | 89 + node_modules/@inquirer/ansi/dist/index.d.ts | 14 + node_modules/@inquirer/ansi/dist/index.js | 21 + node_modules/@inquirer/ansi/package.json | 78 + node_modules/@inquirer/checkbox/LICENSE | 22 + node_modules/@inquirer/checkbox/README.md | 188 ++ .../@inquirer/checkbox/dist/index.d.ts | 52 + node_modules/@inquirer/checkbox/dist/index.js | 190 ++ node_modules/@inquirer/checkbox/package.json | 93 + node_modules/@inquirer/confirm/LICENSE | 22 + node_modules/@inquirer/confirm/README.md | 92 + .../@inquirer/confirm/dist/index.d.ts | 10 + node_modules/@inquirer/confirm/dist/index.js | 48 + node_modules/@inquirer/confirm/package.json | 91 + node_modules/@inquirer/core/LICENSE | 22 + node_modules/@inquirer/core/README.md | 383 ++++ node_modules/@inquirer/core/dist/index.d.ts | 13 + node_modules/@inquirer/core/dist/index.js | 12 + .../@inquirer/core/dist/lib/Separator.d.ts | 10 + .../@inquirer/core/dist/lib/Separator.js | 21 + .../core/dist/lib/create-prompt.d.ts | 4 + .../@inquirer/core/dist/lib/create-prompt.js | 117 + .../@inquirer/core/dist/lib/errors.d.ts | 20 + .../@inquirer/core/dist/lib/errors.js | 21 + .../@inquirer/core/dist/lib/hook-engine.d.ts | 23 + .../@inquirer/core/dist/lib/hook-engine.js | 110 + node_modules/@inquirer/core/dist/lib/key.d.ts | 14 + node_modules/@inquirer/core/dist/lib/key.js | 20 + .../@inquirer/core/dist/lib/make-theme.d.ts | 3 + .../@inquirer/core/dist/lib/make-theme.js | 30 + .../dist/lib/pagination/use-pagination.d.ts | 16 + .../dist/lib/pagination/use-pagination.js | 121 + .../core/dist/lib/promise-polyfill.d.ts | 7 + .../core/dist/lib/promise-polyfill.js | 14 + .../core/dist/lib/screen-manager.d.ts | 14 + .../@inquirer/core/dist/lib/screen-manager.js | 79 + .../@inquirer/core/dist/lib/theme.d.ts | 155 ++ node_modules/@inquirer/core/dist/lib/theme.js | 21 + .../@inquirer/core/dist/lib/use-effect.d.ts | 2 + .../@inquirer/core/dist/lib/use-effect.js | 11 + .../@inquirer/core/dist/lib/use-keypress.d.ts | 3 + .../@inquirer/core/dist/lib/use-keypress.js | 20 + .../@inquirer/core/dist/lib/use-memo.d.ts | 1 + .../@inquirer/core/dist/lib/use-memo.js | 14 + .../@inquirer/core/dist/lib/use-prefix.d.ts | 5 + .../@inquirer/core/dist/lib/use-prefix.js | 35 + .../@inquirer/core/dist/lib/use-ref.d.ts | 6 + .../@inquirer/core/dist/lib/use-ref.js | 4 + .../@inquirer/core/dist/lib/use-state.d.ts | 4 + .../@inquirer/core/dist/lib/use-state.js | 20 + .../@inquirer/core/dist/lib/utils.d.ts | 13 + node_modules/@inquirer/core/dist/lib/utils.js | 25 + node_modules/@inquirer/core/package.json | 98 + node_modules/@inquirer/editor/LICENSE | 22 + node_modules/@inquirer/editor/README.md | 101 + node_modules/@inquirer/editor/dist/index.d.ts | 17 + node_modules/@inquirer/editor/dist/index.js | 74 + node_modules/@inquirer/editor/package.json | 92 + node_modules/@inquirer/expand/LICENSE | 22 + node_modules/@inquirer/expand/README.md | 141 ++ node_modules/@inquirer/expand/dist/index.d.ts | 23 + node_modules/@inquirer/expand/dist/index.js | 108 + node_modules/@inquirer/expand/package.json | 91 + .../@inquirer/external-editor/LICENSE | 22 + .../@inquirer/external-editor/README.md | 154 ++ .../dist/errors/CreateFileError.d.ts | 10 + .../dist/errors/CreateFileError.js | 13 + .../dist/errors/LaunchEditorError.d.ts | 10 + .../dist/errors/LaunchEditorError.js | 13 + .../dist/errors/ReadFileError.d.ts | 10 + .../dist/errors/ReadFileError.js | 13 + .../dist/errors/RemoveFileError.d.ts | 10 + .../dist/errors/RemoveFileError.js | 13 + .../@inquirer/external-editor/dist/index.d.ts | 39 + .../@inquirer/external-editor/dist/index.js | 191 ++ .../@inquirer/external-editor/package.json | 96 + node_modules/@inquirer/figures/LICENSE | 22 + .../@inquirer/figures/dist/index.d.ts | 275 +++ node_modules/@inquirer/figures/dist/index.js | 314 +++ node_modules/@inquirer/figures/package.json | 79 + node_modules/@inquirer/input/LICENSE | 22 + node_modules/@inquirer/input/README.md | 101 + node_modules/@inquirer/input/dist/index.d.ts | 20 + node_modules/@inquirer/input/dist/index.js | 97 + node_modules/@inquirer/input/package.json | 91 + node_modules/@inquirer/number/LICENSE | 22 + node_modules/@inquirer/number/README.md | 95 + node_modules/@inquirer/number/dist/index.d.ts | 13 + node_modules/@inquirer/number/dist/index.js | 94 + node_modules/@inquirer/number/package.json | 91 + node_modules/@inquirer/password/LICENSE | 22 + node_modules/@inquirer/password/README.md | 93 + .../@inquirer/password/dist/index.d.ts | 10 + node_modules/@inquirer/password/dist/index.js | 55 + node_modules/@inquirer/password/package.json | 92 + node_modules/@inquirer/prompts/LICENSE | 22 + node_modules/@inquirer/prompts/README.md | 528 +++++ .../@inquirer/prompts/dist/index.d.ts | 10 + node_modules/@inquirer/prompts/dist/index.js | 10 + node_modules/@inquirer/prompts/package.json | 101 + node_modules/@inquirer/rawlist/LICENSE | 22 + node_modules/@inquirer/rawlist/README.md | 128 ++ .../@inquirer/rawlist/dist/index.d.ts | 23 + node_modules/@inquirer/rawlist/dist/index.js | 142 ++ node_modules/@inquirer/rawlist/package.json | 91 + node_modules/@inquirer/search/LICENSE | 22 + node_modules/@inquirer/search/README.md | 213 ++ node_modules/@inquirer/search/dist/index.d.ts | 33 + node_modules/@inquirer/search/dist/index.js | 193 ++ node_modules/@inquirer/search/package.json | 92 + node_modules/@inquirer/select/LICENSE | 22 + node_modules/@inquirer/select/README.md | 181 ++ node_modules/@inquirer/select/dist/index.d.ts | 32 + node_modules/@inquirer/select/dist/index.js | 176 ++ node_modules/@inquirer/select/package.json | 93 + node_modules/@inquirer/type/LICENSE | 22 + node_modules/@inquirer/type/dist/index.d.ts | 2 + node_modules/@inquirer/type/dist/index.js | 2 + .../@inquirer/type/dist/inquirer.d.ts | 35 + node_modules/@inquirer/type/dist/inquirer.js | 1 + node_modules/@inquirer/type/dist/utils.d.ts | 29 + node_modules/@inquirer/type/dist/utils.js | 2 + node_modules/@inquirer/type/package.json | 87 + .../@isaacs/balanced-match/LICENSE.md | 23 + node_modules/@isaacs/balanced-match/README.md | 60 + .../balanced-match/dist/commonjs/index.d.ts | 9 + .../dist/commonjs/index.d.ts.map | 1 + .../balanced-match/dist/commonjs/index.js | 59 + .../balanced-match/dist/commonjs/index.js.map | 1 + .../balanced-match/dist/commonjs/package.json | 3 + .../balanced-match/dist/esm/index.d.ts | 9 + .../balanced-match/dist/esm/index.d.ts.map | 1 + .../@isaacs/balanced-match/dist/esm/index.js | 54 + .../balanced-match/dist/esm/index.js.map | 1 + .../balanced-match/dist/esm/package.json | 3 + .../@isaacs/balanced-match/package.json | 79 + node_modules/@isaacs/brace-expansion/LICENSE | 23 + .../@isaacs/brace-expansion/README.md | 97 + .../brace-expansion/dist/commonjs/index.d.ts | 6 + .../dist/commonjs/index.d.ts.map | 1 + .../brace-expansion/dist/commonjs/index.js | 199 ++ .../dist/commonjs/index.js.map | 1 + .../dist/commonjs/package.json | 3 + .../brace-expansion/dist/esm/index.d.ts | 6 + .../brace-expansion/dist/esm/index.d.ts.map | 1 + .../@isaacs/brace-expansion/dist/esm/index.js | 195 ++ .../brace-expansion/dist/esm/index.js.map | 1 + .../brace-expansion/dist/esm/package.json | 3 + .../@isaacs/brace-expansion/package.json | 60 + node_modules/@sec-ant/readable-stream/LICENSE | 21 + .../@sec-ant/readable-stream/README.md | 230 ++ .../dist/core/asyncIterablePrototype.d.ts | 1 + .../dist/core/asyncIterator.d.ts | 27 + .../dist/core/fromAnyIterable.d.ts | 6 + .../dist/index/asyncIterator.d.ts | 2 + .../dist/index/asyncIterator.js | 5 + .../dist/index/fromAnyIterable.d.ts | 2 + .../dist/index/fromAnyIterable.js | 5 + .../readable-stream/dist/index/index.d.ts | 2 + .../readable-stream/dist/index/index.js | 8 + .../dist/polyfill/asyncIterator.d.ts | 1 + .../dist/polyfill/asyncIterator.js | 3 + .../dist/polyfill/fromAnyIterable.d.ts | 1 + .../dist/polyfill/fromAnyIterable.js | 2 + .../readable-stream/dist/polyfill/index.d.ts | 2 + .../readable-stream/dist/polyfill/index.js | 4 + .../dist/ponyfill/asyncIterator.d.ts | 1 + .../dist/ponyfill/asyncIterator.js | 89 + .../dist/ponyfill/fromAnyIterable.d.ts | 1 + .../dist/ponyfill/fromAnyIterable.js | 34 + .../readable-stream/dist/ponyfill/index.d.ts | 2 + .../readable-stream/dist/ponyfill/index.js | 6 + .../dist/types/async-iterator.d.ts | 11 + .../@sec-ant/readable-stream/package.json | 96 + .../@sindresorhus/merge-streams/index.d.ts | 44 + .../@sindresorhus/merge-streams/index.js | 265 +++ .../@sindresorhus/merge-streams/license | 9 + .../@sindresorhus/merge-streams/package.json | 49 + .../@sindresorhus/merge-streams/readme.md | 53 + node_modules/ansi-regex/index.d.ts | 33 + node_modules/ansi-regex/index.js | 14 + node_modules/ansi-regex/license | 9 + node_modules/ansi-regex/package.json | 61 + node_modules/ansi-regex/readme.md | 66 + node_modules/ansi-styles/index.js | 165 ++ node_modules/ansi-styles/license | 9 + node_modules/ansi-styles/package.json | 56 + node_modules/ansi-styles/readme.md | 147 ++ node_modules/array-back/LICENSE | 21 + node_modules/array-back/README.hbs | 40 + node_modules/array-back/README.md | 81 + node_modules/array-back/dist/index.js | 70 + node_modules/array-back/index.mjs | 62 + node_modules/array-back/package.json | 46 + node_modules/chalk/index.js | 228 ++ node_modules/chalk/index.js.flow | 93 + node_modules/chalk/license | 9 + node_modules/chalk/package.json | 71 + node_modules/chalk/readme.md | 314 +++ node_modules/chalk/templates.js | 128 ++ node_modules/chalk/types/index.d.ts | 97 + node_modules/chardet/LICENSE | 19 + node_modules/chardet/README.md | 121 + node_modules/chardet/lib/encoding/ascii.d.ts | 6 + node_modules/chardet/lib/encoding/ascii.js | 23 + .../chardet/lib/encoding/ascii.js.map | 1 + node_modules/chardet/lib/encoding/index.d.ts | 14 + node_modules/chardet/lib/encoding/index.js | 3 + .../chardet/lib/encoding/index.js.map | 1 + .../chardet/lib/encoding/iso2022.d.ts | 23 + node_modules/chardet/lib/encoding/iso2022.js | 114 + .../chardet/lib/encoding/iso2022.js.map | 1 + node_modules/chardet/lib/encoding/mbcs.d.ts | 50 + node_modules/chardet/lib/encoding/mbcs.js | 347 +++ node_modules/chardet/lib/encoding/mbcs.js.map | 1 + node_modules/chardet/lib/encoding/sbcs.d.ts | 75 + node_modules/chardet/lib/encoding/sbcs.js | 764 +++++++ node_modules/chardet/lib/encoding/sbcs.js.map | 1 + .../chardet/lib/encoding/unicode.d.ts | 27 + node_modules/chardet/lib/encoding/unicode.js | 109 + .../chardet/lib/encoding/unicode.js.map | 1 + node_modules/chardet/lib/encoding/utf8.d.ts | 6 + node_modules/chardet/lib/encoding/utf8.js | 72 + node_modules/chardet/lib/encoding/utf8.js.map | 1 + node_modules/chardet/lib/fs/browser.d.ts | 2 + node_modules/chardet/lib/fs/browser.js | 6 + node_modules/chardet/lib/fs/browser.js.map | 1 + node_modules/chardet/lib/fs/node.d.ts | 2 + node_modules/chardet/lib/fs/node.js | 11 + node_modules/chardet/lib/fs/node.js.map | 1 + node_modules/chardet/lib/index.d.ts | 20 + node_modules/chardet/lib/index.js | 174 ++ node_modules/chardet/lib/index.js.map | 1 + node_modules/chardet/lib/match.d.ts | 9 + node_modules/chardet/lib/match.js | 8 + node_modules/chardet/lib/match.js.map | 1 + node_modules/chardet/lib/utils.d.ts | 1 + node_modules/chardet/lib/utils.js | 10 + node_modules/chardet/lib/utils.js.map | 1 + node_modules/chardet/package.json | 96 + node_modules/cli-width/LICENSE | 13 + node_modules/cli-width/README.md | 71 + node_modules/cli-width/index.d.ts | 13 + node_modules/cli-width/index.js | 49 + node_modules/cli-width/package.json | 40 + node_modules/color-convert/CHANGELOG.md | 54 + node_modules/color-convert/LICENSE | 21 + node_modules/color-convert/README.md | 68 + node_modules/color-convert/conversions.js | 868 +++++++ node_modules/color-convert/index.js | 78 + node_modules/color-convert/package.json | 46 + node_modules/color-convert/route.js | 97 + node_modules/color-name/.eslintrc.json | 43 + node_modules/color-name/.npmignore | 107 + node_modules/color-name/LICENSE | 8 + node_modules/color-name/README.md | 11 + node_modules/color-name/index.js | 152 ++ node_modules/color-name/package.json | 25 + node_modules/color-name/test.js | 7 + node_modules/command-line-usage/LICENSE | 21 + node_modules/command-line-usage/README.md | 120 + node_modules/command-line-usage/index.js | 30 + .../command-line-usage/lib/chalk-format.js | 11 + .../command-line-usage/lib/section.js | 29 + .../command-line-usage/lib/section/content.js | 154 ++ .../lib/section/option-list.js | 128 ++ node_modules/command-line-usage/package.json | 41 + node_modules/cross-spawn/LICENSE | 21 + node_modules/cross-spawn/README.md | 89 + node_modules/cross-spawn/index.js | 39 + node_modules/cross-spawn/lib/enoent.js | 59 + node_modules/cross-spawn/lib/parse.js | 91 + node_modules/cross-spawn/lib/util/escape.js | 47 + .../cross-spawn/lib/util/readShebang.js | 23 + .../cross-spawn/lib/util/resolveCommand.js | 52 + node_modules/cross-spawn/package.json | 73 + node_modules/deep-extend/CHANGELOG.md | 46 + node_modules/deep-extend/LICENSE | 20 + node_modules/deep-extend/README.md | 91 + node_modules/deep-extend/index.js | 1 + node_modules/deep-extend/lib/deep-extend.js | 150 ++ node_modules/deep-extend/package.json | 62 + node_modules/emoji-regex/LICENSE-MIT.txt | 20 + node_modules/emoji-regex/README.md | 107 + node_modules/emoji-regex/index.d.ts | 3 + node_modules/emoji-regex/index.js | 4 + node_modules/emoji-regex/index.mjs | 4 + node_modules/emoji-regex/package.json | 45 + node_modules/escape-string-regexp/index.js | 11 + node_modules/escape-string-regexp/license | 21 + .../escape-string-regexp/package.json | 41 + node_modules/escape-string-regexp/readme.md | 27 + node_modules/execa/index.d.ts | 27 + node_modules/execa/index.js | 28 + node_modules/execa/lib/arguments/command.js | 20 + node_modules/execa/lib/arguments/cwd.js | 39 + .../execa/lib/arguments/encoding-option.js | 50 + node_modules/execa/lib/arguments/escape.js | 88 + .../execa/lib/arguments/fd-options.js | 108 + node_modules/execa/lib/arguments/file-url.js | 25 + node_modules/execa/lib/arguments/options.js | 96 + node_modules/execa/lib/arguments/shell.js | 11 + node_modules/execa/lib/arguments/specific.js | 111 + node_modules/execa/lib/convert/add.js | 15 + node_modules/execa/lib/convert/concurrent.js | 33 + node_modules/execa/lib/convert/duplex.js | 69 + node_modules/execa/lib/convert/iterable.js | 34 + node_modules/execa/lib/convert/readable.js | 113 + node_modules/execa/lib/convert/shared.js | 46 + node_modules/execa/lib/convert/writable.js | 90 + node_modules/execa/lib/io/contents.js | 116 + node_modules/execa/lib/io/input-sync.js | 44 + node_modules/execa/lib/io/iterate.js | 110 + node_modules/execa/lib/io/max-buffer.js | 89 + node_modules/execa/lib/io/output-async.js | 80 + node_modules/execa/lib/io/output-sync.js | 135 ++ node_modules/execa/lib/io/pipeline.js | 48 + node_modules/execa/lib/io/strip-newline.js | 12 + node_modules/execa/lib/ipc/array.js | 4 + node_modules/execa/lib/ipc/buffer-messages.js | 47 + node_modules/execa/lib/ipc/forward.js | 56 + node_modules/execa/lib/ipc/get-each.js | 89 + node_modules/execa/lib/ipc/get-one.js | 69 + node_modules/execa/lib/ipc/graceful.js | 72 + node_modules/execa/lib/ipc/incoming.js | 79 + node_modules/execa/lib/ipc/ipc-input.js | 44 + node_modules/execa/lib/ipc/methods.js | 49 + node_modules/execa/lib/ipc/outgoing.js | 47 + node_modules/execa/lib/ipc/reference.js | 44 + node_modules/execa/lib/ipc/send.js | 91 + node_modules/execa/lib/ipc/strict.js | 113 + node_modules/execa/lib/ipc/validation.js | 111 + node_modules/execa/lib/methods/bind.js | 23 + node_modules/execa/lib/methods/command.js | 43 + node_modules/execa/lib/methods/create.js | 65 + node_modules/execa/lib/methods/main-async.js | 194 ++ node_modules/execa/lib/methods/main-sync.js | 163 ++ node_modules/execa/lib/methods/node.js | 51 + node_modules/execa/lib/methods/parameters.js | 31 + node_modules/execa/lib/methods/promise.js | 15 + node_modules/execa/lib/methods/script.js | 22 + node_modules/execa/lib/methods/template.js | 153 ++ node_modules/execa/lib/pipe/abort.js | 20 + node_modules/execa/lib/pipe/pipe-arguments.js | 91 + node_modules/execa/lib/pipe/sequence.js | 24 + node_modules/execa/lib/pipe/setup.js | 72 + node_modules/execa/lib/pipe/streaming.js | 51 + node_modules/execa/lib/pipe/throw.js | 58 + node_modules/execa/lib/resolve/all-async.js | 46 + node_modules/execa/lib/resolve/all-sync.js | 33 + node_modules/execa/lib/resolve/exit-async.js | 54 + node_modules/execa/lib/resolve/exit-sync.js | 25 + node_modules/execa/lib/resolve/stdio.js | 47 + node_modules/execa/lib/resolve/wait-stream.js | 96 + .../execa/lib/resolve/wait-subprocess.js | 146 ++ node_modules/execa/lib/return/duration.js | 8 + node_modules/execa/lib/return/early-error.js | 60 + node_modules/execa/lib/return/final-error.js | 40 + node_modules/execa/lib/return/message.js | 157 ++ node_modules/execa/lib/return/reject.js | 13 + node_modules/execa/lib/return/result.js | 186 ++ node_modules/execa/lib/stdio/direction.js | 76 + node_modules/execa/lib/stdio/duplicate.js | 116 + node_modules/execa/lib/stdio/handle-async.js | 52 + node_modules/execa/lib/stdio/handle-sync.js | 57 + node_modules/execa/lib/stdio/handle.js | 214 ++ node_modules/execa/lib/stdio/input-option.js | 50 + node_modules/execa/lib/stdio/native.js | 106 + node_modules/execa/lib/stdio/stdio-option.js | 60 + node_modules/execa/lib/stdio/type.js | 173 ++ node_modules/execa/lib/terminate/cancel.js | 20 + node_modules/execa/lib/terminate/cleanup.js | 16 + node_modules/execa/lib/terminate/graceful.js | 71 + node_modules/execa/lib/terminate/kill.js | 93 + node_modules/execa/lib/terminate/signal.js | 70 + node_modules/execa/lib/terminate/timeout.js | 21 + .../execa/lib/transform/encoding-transform.js | 51 + node_modules/execa/lib/transform/generator.js | 107 + node_modules/execa/lib/transform/normalize.js | 111 + .../execa/lib/transform/object-mode.js | 41 + node_modules/execa/lib/transform/run-async.js | 60 + node_modules/execa/lib/transform/run-sync.js | 50 + node_modules/execa/lib/transform/split.js | 110 + node_modules/execa/lib/transform/validate.js | 43 + node_modules/execa/lib/utils/abort-signal.js | 8 + node_modules/execa/lib/utils/deferred.js | 7 + node_modules/execa/lib/utils/max-listeners.js | 14 + .../execa/lib/utils/standard-stream.js | 6 + node_modules/execa/lib/utils/uint-array.js | 69 + node_modules/execa/lib/verbose/complete.js | 24 + node_modules/execa/lib/verbose/custom.js | 26 + node_modules/execa/lib/verbose/default.js | 54 + node_modules/execa/lib/verbose/error.js | 13 + node_modules/execa/lib/verbose/info.js | 39 + node_modules/execa/lib/verbose/ipc.js | 15 + node_modules/execa/lib/verbose/log.js | 54 + node_modules/execa/lib/verbose/output.js | 60 + node_modules/execa/lib/verbose/start.js | 15 + node_modules/execa/lib/verbose/values.js | 33 + node_modules/execa/license | 9 + .../execa/node_modules/parse-ms/index.d.ts | 30 + .../execa/node_modules/parse-ms/index.js | 45 + .../execa/node_modules/parse-ms/license | 9 + .../execa/node_modules/parse-ms/package.json | 47 + .../execa/node_modules/parse-ms/readme.md | 46 + .../execa/node_modules/pretty-ms/index.d.ts | 157 ++ .../execa/node_modules/pretty-ms/index.js | 149 ++ .../execa/node_modules/pretty-ms/license | 9 + .../execa/node_modules/pretty-ms/package.json | 55 + .../execa/node_modules/pretty-ms/readme.md | 179 ++ node_modules/execa/package.json | 105 + node_modules/execa/readme.md | 461 ++++ .../types/arguments/encoding-option.d.ts | 19 + .../execa/types/arguments/fd-options.d.ts | 8 + .../execa/types/arguments/options.d.ts | 400 ++++ .../execa/types/arguments/specific.d.ts | 52 + node_modules/execa/types/convert.d.ts | 58 + node_modules/execa/types/ipc.d.ts | 156 ++ node_modules/execa/types/methods/command.d.ts | 114 + .../execa/types/methods/main-async.d.ts | 379 +++ .../execa/types/methods/main-sync.d.ts | 59 + node_modules/execa/types/methods/node.d.ts | 62 + node_modules/execa/types/methods/script.d.ts | 115 + .../execa/types/methods/template.d.ts | 18 + node_modules/execa/types/pipe.d.ts | 58 + .../execa/types/return/final-error.d.ts | 51 + node_modules/execa/types/return/ignore.d.ts | 26 + .../execa/types/return/result-all.d.ts | 30 + .../execa/types/return/result-ipc.d.ts | 27 + .../execa/types/return/result-stdio.d.ts | 17 + .../execa/types/return/result-stdout.d.ts | 50 + node_modules/execa/types/return/result.d.ts | 203 ++ node_modules/execa/types/stdio/array.d.ts | 16 + node_modules/execa/types/stdio/direction.d.ts | 12 + node_modules/execa/types/stdio/option.d.ts | 40 + node_modules/execa/types/stdio/type.d.ts | 170 ++ node_modules/execa/types/subprocess/all.d.ts | 17 + .../execa/types/subprocess/stdio.d.ts | 18 + .../execa/types/subprocess/stdout.d.ts | 22 + .../execa/types/subprocess/subprocess.d.ts | 117 + .../execa/types/transform/normalize.d.ts | 57 + .../execa/types/transform/object-mode.d.ts | 21 + node_modules/execa/types/utils.d.ts | 13 + node_modules/execa/types/verbose.d.ts | 98 + .../fastest-levenshtein/.eslintrc.json | 30 + node_modules/fastest-levenshtein/.prettierrc | 4 + node_modules/fastest-levenshtein/.travis.yml | 21 + node_modules/fastest-levenshtein/LICENSE.md | 21 + node_modules/fastest-levenshtein/README.md | 57 + node_modules/fastest-levenshtein/bench.js | 96 + node_modules/fastest-levenshtein/esm/mod.d.ts | 4 + .../fastest-levenshtein/esm/mod.d.ts.map | 1 + node_modules/fastest-levenshtein/esm/mod.js | 138 ++ node_modules/fastest-levenshtein/mod.d.ts | 3 + node_modules/fastest-levenshtein/mod.js | 142 ++ node_modules/fastest-levenshtein/package.json | 72 + node_modules/fastest-levenshtein/test.js | 55 + node_modules/fastest-levenshtein/test.ts | 67 + node_modules/figures/index.d.ts | 279 +++ node_modules/figures/index.js | 292 +++ node_modules/figures/license | 9 + node_modules/figures/package.json | 49 + node_modules/figures/readme.md | 337 +++ node_modules/fuse.js/LICENSE | 201 ++ node_modules/fuse.js/README.md | 64 + node_modules/fuse.js/dist/fuse.basic.cjs | 1342 +++++++++++ node_modules/fuse.js/dist/fuse.basic.js | 1348 +++++++++++ node_modules/fuse.js/dist/fuse.basic.min.cjs | 9 + node_modules/fuse.js/dist/fuse.basic.min.js | 9 + node_modules/fuse.js/dist/fuse.basic.min.mjs | 9 + node_modules/fuse.js/dist/fuse.basic.mjs | 1268 ++++++++++ node_modules/fuse.js/dist/fuse.cjs | 2027 ++++++++++++++++ node_modules/fuse.js/dist/fuse.d.ts | 373 +++ node_modules/fuse.js/dist/fuse.js | 2033 +++++++++++++++++ node_modules/fuse.js/dist/fuse.min.cjs | 9 + node_modules/fuse.js/dist/fuse.min.js | 9 + node_modules/fuse.js/dist/fuse.min.mjs | 9 + node_modules/fuse.js/dist/fuse.mjs | 1794 +++++++++++++++ node_modules/fuse.js/package.json | 118 + node_modules/get-east-asian-width/index.d.ts | 60 + node_modules/get-east-asian-width/index.js | 30 + node_modules/get-east-asian-width/license | 9 + node_modules/get-east-asian-width/lookup.js | 403 ++++ .../get-east-asian-width/package.json | 70 + node_modules/get-east-asian-width/readme.md | 65 + node_modules/get-stream/license | 9 + node_modules/get-stream/package.json | 60 + node_modules/get-stream/readme.md | 303 +++ .../get-stream/source/array-buffer.js | 84 + node_modules/get-stream/source/array.js | 32 + node_modules/get-stream/source/buffer.js | 19 + node_modules/get-stream/source/contents.js | 121 + node_modules/get-stream/source/exports.js | 5 + node_modules/get-stream/source/index.d.ts | 121 + node_modules/get-stream/source/index.js | 13 + node_modules/get-stream/source/stream.js | 65 + node_modules/get-stream/source/string.js | 41 + node_modules/get-stream/source/utils.js | 11 + node_modules/glob/LICENSE.md | 63 + node_modules/glob/README.md | 1177 ++++++++++ node_modules/glob/dist/commonjs/glob.d.ts | 388 ++++ node_modules/glob/dist/commonjs/glob.d.ts.map | 1 + node_modules/glob/dist/commonjs/glob.js | 247 ++ node_modules/glob/dist/commonjs/glob.js.map | 1 + .../glob/dist/commonjs/has-magic.d.ts | 14 + .../glob/dist/commonjs/has-magic.d.ts.map | 1 + node_modules/glob/dist/commonjs/has-magic.js | 27 + .../glob/dist/commonjs/has-magic.js.map | 1 + node_modules/glob/dist/commonjs/ignore.d.ts | 24 + .../glob/dist/commonjs/ignore.d.ts.map | 1 + node_modules/glob/dist/commonjs/ignore.js | 119 + node_modules/glob/dist/commonjs/ignore.js.map | 1 + node_modules/glob/dist/commonjs/index.d.ts | 97 + .../glob/dist/commonjs/index.d.ts.map | 1 + node_modules/glob/dist/commonjs/index.js | 68 + node_modules/glob/dist/commonjs/index.js.map | 1 + node_modules/glob/dist/commonjs/package.json | 3 + node_modules/glob/dist/commonjs/pattern.d.ts | 76 + .../glob/dist/commonjs/pattern.d.ts.map | 1 + node_modules/glob/dist/commonjs/pattern.js | 219 ++ .../glob/dist/commonjs/pattern.js.map | 1 + .../glob/dist/commonjs/processor.d.ts | 59 + .../glob/dist/commonjs/processor.d.ts.map | 1 + node_modules/glob/dist/commonjs/processor.js | 301 +++ .../glob/dist/commonjs/processor.js.map | 1 + node_modules/glob/dist/commonjs/walker.d.ts | 97 + .../glob/dist/commonjs/walker.d.ts.map | 1 + node_modules/glob/dist/commonjs/walker.js | 387 ++++ node_modules/glob/dist/commonjs/walker.js.map | 1 + node_modules/glob/dist/esm/glob.d.ts | 388 ++++ node_modules/glob/dist/esm/glob.d.ts.map | 1 + node_modules/glob/dist/esm/glob.js | 243 ++ node_modules/glob/dist/esm/glob.js.map | 1 + node_modules/glob/dist/esm/has-magic.d.ts | 14 + node_modules/glob/dist/esm/has-magic.d.ts.map | 1 + node_modules/glob/dist/esm/has-magic.js | 23 + node_modules/glob/dist/esm/has-magic.js.map | 1 + node_modules/glob/dist/esm/ignore.d.ts | 24 + node_modules/glob/dist/esm/ignore.d.ts.map | 1 + node_modules/glob/dist/esm/ignore.js | 115 + node_modules/glob/dist/esm/ignore.js.map | 1 + node_modules/glob/dist/esm/index.d.ts | 97 + node_modules/glob/dist/esm/index.d.ts.map | 1 + node_modules/glob/dist/esm/index.js | 55 + node_modules/glob/dist/esm/index.js.map | 1 + node_modules/glob/dist/esm/package.json | 3 + node_modules/glob/dist/esm/pattern.d.ts | 76 + node_modules/glob/dist/esm/pattern.d.ts.map | 1 + node_modules/glob/dist/esm/pattern.js | 215 ++ node_modules/glob/dist/esm/pattern.js.map | 1 + node_modules/glob/dist/esm/processor.d.ts | 59 + node_modules/glob/dist/esm/processor.d.ts.map | 1 + node_modules/glob/dist/esm/processor.js | 294 +++ node_modules/glob/dist/esm/processor.js.map | 1 + node_modules/glob/dist/esm/walker.d.ts | 97 + node_modules/glob/dist/esm/walker.d.ts.map | 1 + node_modules/glob/dist/esm/walker.js | 381 +++ node_modules/glob/dist/esm/walker.js.map | 1 + node_modules/glob/package.json | 81 + node_modules/has-flag/index.js | 8 + node_modules/has-flag/license | 9 + node_modules/has-flag/package.json | 44 + node_modules/has-flag/readme.md | 70 + node_modules/hereby/LICENSE | 21 + node_modules/hereby/README.md | 139 ++ node_modules/hereby/bin/hereby.js | 2 + node_modules/hereby/dist/cli.js | 12 + node_modules/hereby/dist/cli/formatTasks.js | 29 + node_modules/hereby/dist/cli/index.js | 95 + .../hereby/dist/cli/loadHerebyfile.js | 89 + node_modules/hereby/dist/cli/parseArgs.js | 74 + node_modules/hereby/dist/cli/reexec.js | 58 + node_modules/hereby/dist/cli/runner.js | 65 + node_modules/hereby/dist/cli/utils.js | 61 + node_modules/hereby/dist/index.d.ts | 39 + node_modules/hereby/dist/index.js | 53 + node_modules/hereby/package.json | 113 + node_modules/human-signals/LICENSE | 201 ++ node_modules/human-signals/README.md | 171 ++ node_modules/human-signals/build/src/core.js | 273 +++ .../human-signals/build/src/main.d.ts | 206 ++ node_modules/human-signals/build/src/main.js | 70 + .../human-signals/build/src/realtime.js | 16 + .../human-signals/build/src/signals.js | 34 + node_modules/human-signals/package.json | 66 + node_modules/iconv-lite/LICENSE | 21 + node_modules/iconv-lite/README.md | 138 ++ .../iconv-lite/encodings/dbcs-codec.js | 532 +++++ .../iconv-lite/encodings/dbcs-data.js | 185 ++ node_modules/iconv-lite/encodings/index.js | 23 + node_modules/iconv-lite/encodings/internal.js | 218 ++ .../iconv-lite/encodings/sbcs-codec.js | 75 + .../encodings/sbcs-data-generated.js | 451 ++++ .../iconv-lite/encodings/sbcs-data.js | 178 ++ .../encodings/tables/big5-added.json | 122 + .../iconv-lite/encodings/tables/cp936.json | 264 +++ .../iconv-lite/encodings/tables/cp949.json | 273 +++ .../iconv-lite/encodings/tables/cp950.json | 177 ++ .../iconv-lite/encodings/tables/eucjp.json | 182 ++ .../encodings/tables/gb18030-ranges.json | 1 + .../encodings/tables/gbk-added.json | 56 + .../iconv-lite/encodings/tables/shiftjis.json | 125 + node_modules/iconv-lite/encodings/utf16.js | 187 ++ node_modules/iconv-lite/encodings/utf32.js | 307 +++ node_modules/iconv-lite/encodings/utf7.js | 283 +++ node_modules/iconv-lite/lib/bom-handling.js | 48 + .../iconv-lite/lib/helpers/merge-exports.js | 13 + node_modules/iconv-lite/lib/index.d.ts | 129 ++ node_modules/iconv-lite/lib/index.js | 182 ++ node_modules/iconv-lite/lib/streams.js | 105 + node_modules/iconv-lite/package.json | 70 + node_modules/iconv-lite/types/encodings.d.ts | 423 ++++ node_modules/is-plain-obj/index.d.ts | 35 + node_modules/is-plain-obj/index.js | 8 + node_modules/is-plain-obj/license | 9 + node_modules/is-plain-obj/package.json | 41 + node_modules/is-plain-obj/readme.md | 58 + node_modules/is-stream/index.d.ts | 90 + node_modules/is-stream/index.js | 37 + node_modules/is-stream/license | 9 + node_modules/is-stream/package.json | 48 + node_modules/is-stream/readme.md | 57 + node_modules/is-unicode-supported/index.d.ts | 12 + node_modules/is-unicode-supported/index.js | 21 + node_modules/is-unicode-supported/license | 9 + .../is-unicode-supported/package.json | 47 + node_modules/is-unicode-supported/readme.md | 35 + node_modules/isexe/.npmignore | 2 + node_modules/isexe/LICENSE | 15 + node_modules/isexe/README.md | 51 + node_modules/isexe/index.js | 57 + node_modules/isexe/mode.js | 41 + node_modules/isexe/package.json | 31 + node_modules/isexe/test/basic.js | 221 ++ node_modules/isexe/windows.js | 42 + node_modules/kleur/index.js | 104 + node_modules/kleur/kleur.d.ts | 45 + node_modules/kleur/license | 21 + node_modules/kleur/package.json | 35 + node_modules/kleur/readme.md | 172 ++ node_modules/lru-cache/LICENSE.md | 55 + node_modules/lru-cache/README.md | 383 ++++ .../lru-cache/dist/commonjs/index.d.ts | 1323 +++++++++++ .../lru-cache/dist/commonjs/index.d.ts.map | 1 + node_modules/lru-cache/dist/commonjs/index.js | 1589 +++++++++++++ .../lru-cache/dist/commonjs/index.js.map | 1 + .../lru-cache/dist/commonjs/index.min.js | 2 + .../lru-cache/dist/commonjs/index.min.js.map | 7 + .../lru-cache/dist/commonjs/package.json | 3 + node_modules/lru-cache/dist/esm/index.d.ts | 1323 +++++++++++ .../lru-cache/dist/esm/index.d.ts.map | 1 + node_modules/lru-cache/dist/esm/index.js | 1585 +++++++++++++ node_modules/lru-cache/dist/esm/index.js.map | 1 + node_modules/lru-cache/dist/esm/index.min.js | 2 + .../lru-cache/dist/esm/index.min.js.map | 7 + node_modules/lru-cache/dist/esm/package.json | 3 + node_modules/lru-cache/package.json | 101 + node_modules/minimatch/LICENSE.md | 55 + node_modules/minimatch/README.md | 453 ++++ .../dist/commonjs/assert-valid-pattern.d.ts | 2 + .../commonjs/assert-valid-pattern.d.ts.map | 1 + .../dist/commonjs/assert-valid-pattern.js | 14 + .../dist/commonjs/assert-valid-pattern.js.map | 1 + node_modules/minimatch/dist/commonjs/ast.d.ts | 20 + .../minimatch/dist/commonjs/ast.d.ts.map | 1 + node_modules/minimatch/dist/commonjs/ast.js | 591 +++++ .../minimatch/dist/commonjs/ast.js.map | 1 + .../dist/commonjs/brace-expressions.d.ts | 8 + .../dist/commonjs/brace-expressions.d.ts.map | 1 + .../dist/commonjs/brace-expressions.js | 152 ++ .../dist/commonjs/brace-expressions.js.map | 1 + .../minimatch/dist/commonjs/escape.d.ts | 15 + .../minimatch/dist/commonjs/escape.d.ts.map | 1 + .../minimatch/dist/commonjs/escape.js | 30 + .../minimatch/dist/commonjs/escape.js.map | 1 + .../minimatch/dist/commonjs/index.d.ts | 94 + .../minimatch/dist/commonjs/index.d.ts.map | 1 + node_modules/minimatch/dist/commonjs/index.js | 1029 +++++++++ .../minimatch/dist/commonjs/index.js.map | 1 + .../minimatch/dist/commonjs/package.json | 3 + .../minimatch/dist/commonjs/unescape.d.ts | 22 + .../minimatch/dist/commonjs/unescape.d.ts.map | 1 + .../minimatch/dist/commonjs/unescape.js | 38 + .../minimatch/dist/commonjs/unescape.js.map | 1 + .../dist/esm/assert-valid-pattern.d.ts | 2 + .../dist/esm/assert-valid-pattern.d.ts.map | 1 + .../dist/esm/assert-valid-pattern.js | 10 + .../dist/esm/assert-valid-pattern.js.map | 1 + node_modules/minimatch/dist/esm/ast.d.ts | 20 + node_modules/minimatch/dist/esm/ast.d.ts.map | 1 + node_modules/minimatch/dist/esm/ast.js | 587 +++++ node_modules/minimatch/dist/esm/ast.js.map | 1 + .../minimatch/dist/esm/brace-expressions.d.ts | 8 + .../dist/esm/brace-expressions.d.ts.map | 1 + .../minimatch/dist/esm/brace-expressions.js | 148 ++ .../dist/esm/brace-expressions.js.map | 1 + node_modules/minimatch/dist/esm/escape.d.ts | 15 + .../minimatch/dist/esm/escape.d.ts.map | 1 + node_modules/minimatch/dist/esm/escape.js | 26 + node_modules/minimatch/dist/esm/escape.js.map | 1 + node_modules/minimatch/dist/esm/index.d.ts | 94 + .../minimatch/dist/esm/index.d.ts.map | 1 + node_modules/minimatch/dist/esm/index.js | 1016 ++++++++ node_modules/minimatch/dist/esm/index.js.map | 1 + node_modules/minimatch/dist/esm/package.json | 3 + node_modules/minimatch/dist/esm/unescape.d.ts | 22 + .../minimatch/dist/esm/unescape.d.ts.map | 1 + node_modules/minimatch/dist/esm/unescape.js | 34 + .../minimatch/dist/esm/unescape.js.map | 1 + node_modules/minimatch/package.json | 67 + node_modules/minimist/.eslintrc | 29 + node_modules/minimist/.github/FUNDING.yml | 12 + node_modules/minimist/.nycrc | 14 + node_modules/minimist/CHANGELOG.md | 298 +++ node_modules/minimist/LICENSE | 18 + node_modules/minimist/README.md | 121 + node_modules/minimist/example/parse.js | 4 + node_modules/minimist/index.js | 263 +++ node_modules/minimist/package.json | 75 + node_modules/minimist/test/all_bool.js | 34 + node_modules/minimist/test/bool.js | 177 ++ node_modules/minimist/test/dash.js | 43 + node_modules/minimist/test/default_bool.js | 37 + node_modules/minimist/test/dotted.js | 24 + node_modules/minimist/test/kv_short.js | 32 + node_modules/minimist/test/long.js | 33 + node_modules/minimist/test/num.js | 38 + node_modules/minimist/test/parse.js | 209 ++ node_modules/minimist/test/parse_modified.js | 11 + node_modules/minimist/test/proto.js | 64 + node_modules/minimist/test/short.js | 69 + node_modules/minimist/test/stop_early.js | 17 + node_modules/minimist/test/unknown.js | 104 + node_modules/minimist/test/whitespace.js | 10 + node_modules/minipass/LICENSE | 15 + node_modules/minipass/README.md | 825 +++++++ .../minipass/dist/commonjs/index.d.ts | 549 +++++ .../minipass/dist/commonjs/index.d.ts.map | 1 + node_modules/minipass/dist/commonjs/index.js | 1028 +++++++++ .../minipass/dist/commonjs/index.js.map | 1 + .../minipass/dist/commonjs/package.json | 3 + node_modules/minipass/dist/esm/index.d.ts | 549 +++++ node_modules/minipass/dist/esm/index.d.ts.map | 1 + node_modules/minipass/dist/esm/index.js | 1018 +++++++++ node_modules/minipass/dist/esm/index.js.map | 1 + node_modules/minipass/dist/esm/package.json | 3 + node_modules/minipass/package.json | 82 + node_modules/mute-stream/LICENSE | 15 + node_modules/mute-stream/README.md | 68 + node_modules/mute-stream/lib/index.js | 142 ++ node_modules/mute-stream/package.json | 54 + node_modules/npm-run-path/index.d.ts | 90 + node_modules/npm-run-path/index.js | 55 + node_modules/npm-run-path/license | 9 + .../node_modules/path-key/index.d.ts | 31 + .../node_modules/path-key/index.js | 12 + .../node_modules/path-key/license | 9 + .../node_modules/path-key/package.json | 41 + .../node_modules/path-key/readme.md | 57 + node_modules/npm-run-path/package.json | 52 + node_modules/npm-run-path/readme.md | 104 + node_modules/parse-ms/index.d.ts | 30 + node_modules/parse-ms/index.js | 17 + node_modules/parse-ms/license | 9 + node_modules/parse-ms/package.json | 43 + node_modules/parse-ms/readme.md | 33 + node_modules/path-key/index.d.ts | 40 + node_modules/path-key/index.js | 16 + node_modules/path-key/license | 9 + node_modules/path-key/package.json | 39 + node_modules/path-key/readme.md | 61 + node_modules/path-scurry/LICENSE.md | 55 + node_modules/path-scurry/README.md | 636 ++++++ .../path-scurry/dist/commonjs/index.d.ts | 1115 +++++++++ .../path-scurry/dist/commonjs/index.d.ts.map | 1 + .../path-scurry/dist/commonjs/index.js | 2018 ++++++++++++++++ .../path-scurry/dist/commonjs/index.js.map | 1 + .../path-scurry/dist/commonjs/package.json | 3 + node_modules/path-scurry/dist/esm/index.d.ts | 1115 +++++++++ .../path-scurry/dist/esm/index.d.ts.map | 1 + node_modules/path-scurry/dist/esm/index.js | 1983 ++++++++++++++++ .../path-scurry/dist/esm/index.js.map | 1 + .../path-scurry/dist/esm/package.json | 3 + node_modules/path-scurry/package.json | 88 + node_modules/picocolors/LICENSE | 15 + node_modules/picocolors/README.md | 21 + node_modules/picocolors/package.json | 25 + node_modules/picocolors/picocolors.browser.js | 4 + node_modules/picocolors/picocolors.d.ts | 5 + node_modules/picocolors/picocolors.js | 75 + node_modules/picocolors/types.d.ts | 51 + node_modules/pretty-ms/index.d.ts | 123 + node_modules/pretty-ms/index.js | 124 + node_modules/pretty-ms/license | 9 + node_modules/pretty-ms/package.json | 52 + node_modules/pretty-ms/readme.md | 142 ++ .../prompts/dist/dateparts/datepart.js | 39 + node_modules/prompts/dist/dateparts/day.js | 35 + node_modules/prompts/dist/dateparts/hours.js | 30 + node_modules/prompts/dist/dateparts/index.js | 13 + .../prompts/dist/dateparts/meridiem.js | 25 + .../prompts/dist/dateparts/milliseconds.js | 28 + .../prompts/dist/dateparts/minutes.js | 29 + node_modules/prompts/dist/dateparts/month.js | 31 + .../prompts/dist/dateparts/seconds.js | 29 + node_modules/prompts/dist/dateparts/year.js | 29 + .../prompts/dist/elements/autocomplete.js | 285 +++ .../dist/elements/autocompleteMultiselect.js | 201 ++ node_modules/prompts/dist/elements/confirm.js | 93 + node_modules/prompts/dist/elements/date.js | 250 ++ node_modules/prompts/dist/elements/index.js | 13 + .../prompts/dist/elements/multiselect.js | 289 +++ node_modules/prompts/dist/elements/number.js | 250 ++ node_modules/prompts/dist/elements/prompt.js | 82 + node_modules/prompts/dist/elements/select.js | 190 ++ node_modules/prompts/dist/elements/text.js | 245 ++ node_modules/prompts/dist/elements/toggle.js | 124 + node_modules/prompts/dist/index.js | 154 ++ node_modules/prompts/dist/prompts.js | 222 ++ node_modules/prompts/dist/util/action.js | 38 + node_modules/prompts/dist/util/clear.js | 42 + .../prompts/dist/util/entriesToDisplay.js | 21 + node_modules/prompts/dist/util/figures.js | 32 + node_modules/prompts/dist/util/index.js | 12 + node_modules/prompts/dist/util/lines.js | 14 + node_modules/prompts/dist/util/strip.js | 7 + node_modules/prompts/dist/util/style.js | 51 + node_modules/prompts/dist/util/wrap.js | 16 + node_modules/prompts/index.js | 14 + .../prompts/lib/dateparts/datepart.js | 35 + node_modules/prompts/lib/dateparts/day.js | 42 + node_modules/prompts/lib/dateparts/hours.js | 30 + node_modules/prompts/lib/dateparts/index.js | 13 + .../prompts/lib/dateparts/meridiem.js | 24 + .../prompts/lib/dateparts/milliseconds.js | 28 + node_modules/prompts/lib/dateparts/minutes.js | 28 + node_modules/prompts/lib/dateparts/month.js | 33 + node_modules/prompts/lib/dateparts/seconds.js | 28 + node_modules/prompts/lib/dateparts/year.js | 28 + .../prompts/lib/elements/autocomplete.js | 264 +++ .../lib/elements/autocompleteMultiselect.js | 194 ++ node_modules/prompts/lib/elements/confirm.js | 89 + node_modules/prompts/lib/elements/date.js | 209 ++ node_modules/prompts/lib/elements/index.js | 13 + .../prompts/lib/elements/multiselect.js | 271 +++ node_modules/prompts/lib/elements/number.js | 213 ++ node_modules/prompts/lib/elements/prompt.js | 68 + node_modules/prompts/lib/elements/select.js | 175 ++ node_modules/prompts/lib/elements/text.js | 208 ++ node_modules/prompts/lib/elements/toggle.js | 118 + node_modules/prompts/lib/index.js | 98 + node_modules/prompts/lib/prompts.js | 206 ++ node_modules/prompts/lib/util/action.js | 39 + node_modules/prompts/lib/util/clear.js | 22 + .../prompts/lib/util/entriesToDisplay.js | 21 + node_modules/prompts/lib/util/figures.js | 33 + node_modules/prompts/lib/util/index.js | 12 + node_modules/prompts/lib/util/lines.js | 15 + node_modules/prompts/lib/util/strip.js | 11 + node_modules/prompts/lib/util/style.js | 40 + node_modules/prompts/lib/util/wrap.js | 27 + node_modules/prompts/license | 21 + node_modules/prompts/package.json | 53 + node_modules/prompts/readme.md | 882 +++++++ node_modules/reduce-flatten/.travis.yml | 7 + node_modules/reduce-flatten/LICENSE | 21 + node_modules/reduce-flatten/README.hbs | 11 + node_modules/reduce-flatten/README.md | 29 + node_modules/reduce-flatten/index.js | 19 + node_modules/reduce-flatten/package.json | 24 + node_modules/reduce-flatten/test.js | 11 + node_modules/safer-buffer/LICENSE | 21 + node_modules/safer-buffer/Porting-Buffer.md | 268 +++ node_modules/safer-buffer/Readme.md | 156 ++ node_modules/safer-buffer/dangerous.js | 58 + node_modules/safer-buffer/package.json | 34 + node_modules/safer-buffer/safer.js | 77 + node_modules/safer-buffer/tests.js | 406 ++++ node_modules/shebang-command/index.js | 19 + node_modules/shebang-command/license | 9 + node_modules/shebang-command/package.json | 34 + node_modules/shebang-command/readme.md | 34 + node_modules/shebang-regex/index.d.ts | 22 + node_modules/shebang-regex/index.js | 2 + node_modules/shebang-regex/license | 9 + node_modules/shebang-regex/package.json | 35 + node_modules/shebang-regex/readme.md | 33 + node_modules/signal-exit/LICENSE.txt | 16 + node_modules/signal-exit/README.md | 74 + .../signal-exit/dist/cjs/browser.d.ts | 12 + .../signal-exit/dist/cjs/browser.d.ts.map | 1 + node_modules/signal-exit/dist/cjs/browser.js | 10 + .../signal-exit/dist/cjs/browser.js.map | 1 + node_modules/signal-exit/dist/cjs/index.d.ts | 48 + .../signal-exit/dist/cjs/index.d.ts.map | 1 + node_modules/signal-exit/dist/cjs/index.js | 279 +++ .../signal-exit/dist/cjs/index.js.map | 1 + .../signal-exit/dist/cjs/package.json | 3 + .../signal-exit/dist/cjs/signals.d.ts | 29 + .../signal-exit/dist/cjs/signals.d.ts.map | 1 + node_modules/signal-exit/dist/cjs/signals.js | 42 + .../signal-exit/dist/cjs/signals.js.map | 1 + .../signal-exit/dist/mjs/browser.d.ts | 12 + .../signal-exit/dist/mjs/browser.d.ts.map | 1 + node_modules/signal-exit/dist/mjs/browser.js | 4 + .../signal-exit/dist/mjs/browser.js.map | 1 + node_modules/signal-exit/dist/mjs/index.d.ts | 48 + .../signal-exit/dist/mjs/index.d.ts.map | 1 + node_modules/signal-exit/dist/mjs/index.js | 275 +++ .../signal-exit/dist/mjs/index.js.map | 1 + .../signal-exit/dist/mjs/package.json | 3 + .../signal-exit/dist/mjs/signals.d.ts | 29 + .../signal-exit/dist/mjs/signals.d.ts.map | 1 + node_modules/signal-exit/dist/mjs/signals.js | 39 + .../signal-exit/dist/mjs/signals.js.map | 1 + node_modules/signal-exit/package.json | 106 + node_modules/sisteransi/license | 21 + node_modules/sisteransi/package.json | 34 + node_modules/sisteransi/readme.md | 113 + node_modules/sisteransi/src/index.js | 58 + node_modules/sisteransi/src/sisteransi.d.ts | 35 + node_modules/string-width/index.d.ts | 39 + node_modules/string-width/index.js | 82 + node_modules/string-width/license | 9 + node_modules/string-width/package.json | 64 + node_modules/string-width/readme.md | 66 + node_modules/strip-ansi/index.d.ts | 15 + node_modules/strip-ansi/index.js | 14 + node_modules/strip-ansi/license | 9 + node_modules/strip-ansi/package.json | 59 + node_modules/strip-ansi/readme.md | 37 + node_modules/strip-final-newline/index.d.ts | 18 + node_modules/strip-final-newline/index.js | 26 + node_modules/strip-final-newline/license | 9 + node_modules/strip-final-newline/package.json | 49 + node_modules/strip-final-newline/readme.md | 34 + node_modules/supports-color/browser.js | 5 + node_modules/supports-color/index.js | 131 ++ node_modules/supports-color/license | 9 + node_modules/supports-color/package.json | 53 + node_modules/supports-color/readme.md | 66 + node_modules/table-layout/LICENSE | 21 + node_modules/table-layout/README.hbs | 84 + node_modules/table-layout/README.md | 154 ++ node_modules/table-layout/index.js | 197 ++ node_modules/table-layout/lib/ansi.js | 15 + node_modules/table-layout/lib/cell.js | 28 + node_modules/table-layout/lib/column.js | 67 + node_modules/table-layout/lib/columns.js | 156 ++ node_modules/table-layout/lib/padding.js | 14 + node_modules/table-layout/lib/rows.js | 52 + node_modules/table-layout/package.json | 41 + node_modules/typical/LICENSE | 22 + node_modules/typical/README.hbs | 40 + node_modules/typical/README.md | 302 +++ node_modules/typical/dist/index.js | 295 +++ node_modules/typical/index.mjs | 269 +++ node_modules/typical/package.json | 63 + node_modules/unicorn-magic/default.d.ts | 13 + node_modules/unicorn-magic/default.js | 14 + node_modules/unicorn-magic/license | 9 + node_modules/unicorn-magic/node.d.ts | 125 + node_modules/unicorn-magic/node.js | 49 + node_modules/unicorn-magic/package.json | 62 + node_modules/unicorn-magic/readme.md | 25 + node_modules/which/CHANGELOG.md | 166 ++ node_modules/which/LICENSE | 15 + node_modules/which/README.md | 54 + node_modules/which/bin/node-which | 52 + node_modules/which/package.json | 43 + node_modules/which/which.js | 125 + node_modules/wordwrapjs/LICENSE | 21 + node_modules/wordwrapjs/README.hbs | 61 + node_modules/wordwrapjs/README.md | 115 + node_modules/wordwrapjs/index.js | 148 ++ node_modules/wordwrapjs/package.json | 34 + node_modules/wrap-ansi/index.d.ts | 41 + node_modules/wrap-ansi/index.js | 222 ++ node_modules/wrap-ansi/license | 9 + .../node_modules/ansi-styles/index.d.ts | 236 ++ .../node_modules/ansi-styles/index.js | 223 ++ .../node_modules/ansi-styles/license | 9 + .../node_modules/ansi-styles/package.json | 54 + .../node_modules/ansi-styles/readme.md | 173 ++ node_modules/wrap-ansi/package.json | 69 + node_modules/wrap-ansi/readme.md | 75 + node_modules/yoctocolors/base.d.ts | 47 + node_modules/yoctocolors/base.js | 94 + node_modules/yoctocolors/index.d.ts | 2 + node_modules/yoctocolors/index.js | 2 + node_modules/yoctocolors/license | 9 + node_modules/yoctocolors/package.json | 69 + node_modules/yoctocolors/readme.md | 138 ++ package-lock.json | 1139 +++++++++ package.json | 15 + test.js | 27 + 1034 files changed, 99049 insertions(+) create mode 100644 Dockerfile create mode 100644 Herebyfile.mjs create mode 100644 app/user/api/etc/user-api.yaml create mode 100644 app/user/api/internal/config/config.go create mode 100644 app/user/api/internal/handler/routes.go create mode 100644 app/user/api/internal/handler/userInfoHandler.go create mode 100644 app/user/api/internal/logic/userInfoLogic.go create mode 100644 app/user/api/internal/svc/serviceContext.go create mode 100644 app/user/api/internal/types/types.go create mode 100644 app/user/api/user.go create mode 100644 app/user/rpc/etc/pb.yaml create mode 100644 app/user/rpc/internal/config/config.go create mode 100644 app/user/rpc/internal/logic/getUserInfoLogic.go create mode 100644 app/user/rpc/internal/server/usercenterServer.go create mode 100644 app/user/rpc/internal/svc/serviceContext.go create mode 100644 app/user/rpc/pb.go create mode 100644 app/user/rpc/pb/user.pb.go create mode 100644 app/user/rpc/pb/user_grpc.pb.go create mode 100644 app/user/rpc/usercenter/usercenter.go create mode 100644 deploy/k8s/base/pg-dx-configmap.yaml create mode 100644 deploy/k8s/base/postgreSql.yaml create mode 100644 deploy/k8s/base/service-discovery.yaml create mode 100644 deploy/k8s/user-api.yaml create mode 100644 deploy/k8s/user-rpc.yaml create mode 100644 desc/api/order.api create mode 100644 desc/api/user.api create mode 100644 desc/rpc/user.proto create mode 100644 desc/sql/users.sql create mode 100644 go.mod create mode 100644 go.sum create mode 100644 node_modules/.bin/hereby create mode 100644 node_modules/.bin/hereby.cmd create mode 100644 node_modules/.bin/hereby.ps1 create mode 100644 node_modules/.bin/node-which create mode 100644 node_modules/.bin/node-which.cmd create mode 100644 node_modules/.bin/node-which.ps1 create mode 100644 node_modules/.package-lock.json create mode 100644 node_modules/@inquirer/ansi/LICENSE create mode 100644 node_modules/@inquirer/ansi/README.md create mode 100644 node_modules/@inquirer/ansi/dist/index.d.ts create mode 100644 node_modules/@inquirer/ansi/dist/index.js create mode 100644 node_modules/@inquirer/ansi/package.json create mode 100644 node_modules/@inquirer/checkbox/LICENSE create mode 100644 node_modules/@inquirer/checkbox/README.md create mode 100644 node_modules/@inquirer/checkbox/dist/index.d.ts create mode 100644 node_modules/@inquirer/checkbox/dist/index.js create mode 100644 node_modules/@inquirer/checkbox/package.json create mode 100644 node_modules/@inquirer/confirm/LICENSE create mode 100644 node_modules/@inquirer/confirm/README.md create mode 100644 node_modules/@inquirer/confirm/dist/index.d.ts create mode 100644 node_modules/@inquirer/confirm/dist/index.js create mode 100644 node_modules/@inquirer/confirm/package.json create mode 100644 node_modules/@inquirer/core/LICENSE create mode 100644 node_modules/@inquirer/core/README.md create mode 100644 node_modules/@inquirer/core/dist/index.d.ts create mode 100644 node_modules/@inquirer/core/dist/index.js create mode 100644 node_modules/@inquirer/core/dist/lib/Separator.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/Separator.js create mode 100644 node_modules/@inquirer/core/dist/lib/create-prompt.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/create-prompt.js create mode 100644 node_modules/@inquirer/core/dist/lib/errors.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/errors.js create mode 100644 node_modules/@inquirer/core/dist/lib/hook-engine.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/hook-engine.js create mode 100644 node_modules/@inquirer/core/dist/lib/key.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/key.js create mode 100644 node_modules/@inquirer/core/dist/lib/make-theme.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/make-theme.js create mode 100644 node_modules/@inquirer/core/dist/lib/pagination/use-pagination.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js create mode 100644 node_modules/@inquirer/core/dist/lib/promise-polyfill.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/promise-polyfill.js create mode 100644 node_modules/@inquirer/core/dist/lib/screen-manager.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/screen-manager.js create mode 100644 node_modules/@inquirer/core/dist/lib/theme.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/theme.js create mode 100644 node_modules/@inquirer/core/dist/lib/use-effect.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/use-effect.js create mode 100644 node_modules/@inquirer/core/dist/lib/use-keypress.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/use-keypress.js create mode 100644 node_modules/@inquirer/core/dist/lib/use-memo.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/use-memo.js create mode 100644 node_modules/@inquirer/core/dist/lib/use-prefix.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/use-prefix.js create mode 100644 node_modules/@inquirer/core/dist/lib/use-ref.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/use-ref.js create mode 100644 node_modules/@inquirer/core/dist/lib/use-state.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/use-state.js create mode 100644 node_modules/@inquirer/core/dist/lib/utils.d.ts create mode 100644 node_modules/@inquirer/core/dist/lib/utils.js create mode 100644 node_modules/@inquirer/core/package.json create mode 100644 node_modules/@inquirer/editor/LICENSE create mode 100644 node_modules/@inquirer/editor/README.md create mode 100644 node_modules/@inquirer/editor/dist/index.d.ts create mode 100644 node_modules/@inquirer/editor/dist/index.js create mode 100644 node_modules/@inquirer/editor/package.json create mode 100644 node_modules/@inquirer/expand/LICENSE create mode 100644 node_modules/@inquirer/expand/README.md create mode 100644 node_modules/@inquirer/expand/dist/index.d.ts create mode 100644 node_modules/@inquirer/expand/dist/index.js create mode 100644 node_modules/@inquirer/expand/package.json create mode 100644 node_modules/@inquirer/external-editor/LICENSE create mode 100644 node_modules/@inquirer/external-editor/README.md create mode 100644 node_modules/@inquirer/external-editor/dist/errors/CreateFileError.d.ts create mode 100644 node_modules/@inquirer/external-editor/dist/errors/CreateFileError.js create mode 100644 node_modules/@inquirer/external-editor/dist/errors/LaunchEditorError.d.ts create mode 100644 node_modules/@inquirer/external-editor/dist/errors/LaunchEditorError.js create mode 100644 node_modules/@inquirer/external-editor/dist/errors/ReadFileError.d.ts create mode 100644 node_modules/@inquirer/external-editor/dist/errors/ReadFileError.js create mode 100644 node_modules/@inquirer/external-editor/dist/errors/RemoveFileError.d.ts create mode 100644 node_modules/@inquirer/external-editor/dist/errors/RemoveFileError.js create mode 100644 node_modules/@inquirer/external-editor/dist/index.d.ts create mode 100644 node_modules/@inquirer/external-editor/dist/index.js create mode 100644 node_modules/@inquirer/external-editor/package.json create mode 100644 node_modules/@inquirer/figures/LICENSE create mode 100644 node_modules/@inquirer/figures/dist/index.d.ts create mode 100644 node_modules/@inquirer/figures/dist/index.js create mode 100644 node_modules/@inquirer/figures/package.json create mode 100644 node_modules/@inquirer/input/LICENSE create mode 100644 node_modules/@inquirer/input/README.md create mode 100644 node_modules/@inquirer/input/dist/index.d.ts create mode 100644 node_modules/@inquirer/input/dist/index.js create mode 100644 node_modules/@inquirer/input/package.json create mode 100644 node_modules/@inquirer/number/LICENSE create mode 100644 node_modules/@inquirer/number/README.md create mode 100644 node_modules/@inquirer/number/dist/index.d.ts create mode 100644 node_modules/@inquirer/number/dist/index.js create mode 100644 node_modules/@inquirer/number/package.json create mode 100644 node_modules/@inquirer/password/LICENSE create mode 100644 node_modules/@inquirer/password/README.md create mode 100644 node_modules/@inquirer/password/dist/index.d.ts create mode 100644 node_modules/@inquirer/password/dist/index.js create mode 100644 node_modules/@inquirer/password/package.json create mode 100644 node_modules/@inquirer/prompts/LICENSE create mode 100644 node_modules/@inquirer/prompts/README.md create mode 100644 node_modules/@inquirer/prompts/dist/index.d.ts create mode 100644 node_modules/@inquirer/prompts/dist/index.js create mode 100644 node_modules/@inquirer/prompts/package.json create mode 100644 node_modules/@inquirer/rawlist/LICENSE create mode 100644 node_modules/@inquirer/rawlist/README.md create mode 100644 node_modules/@inquirer/rawlist/dist/index.d.ts create mode 100644 node_modules/@inquirer/rawlist/dist/index.js create mode 100644 node_modules/@inquirer/rawlist/package.json create mode 100644 node_modules/@inquirer/search/LICENSE create mode 100644 node_modules/@inquirer/search/README.md create mode 100644 node_modules/@inquirer/search/dist/index.d.ts create mode 100644 node_modules/@inquirer/search/dist/index.js create mode 100644 node_modules/@inquirer/search/package.json create mode 100644 node_modules/@inquirer/select/LICENSE create mode 100644 node_modules/@inquirer/select/README.md create mode 100644 node_modules/@inquirer/select/dist/index.d.ts create mode 100644 node_modules/@inquirer/select/dist/index.js create mode 100644 node_modules/@inquirer/select/package.json create mode 100644 node_modules/@inquirer/type/LICENSE create mode 100644 node_modules/@inquirer/type/dist/index.d.ts create mode 100644 node_modules/@inquirer/type/dist/index.js create mode 100644 node_modules/@inquirer/type/dist/inquirer.d.ts create mode 100644 node_modules/@inquirer/type/dist/inquirer.js create mode 100644 node_modules/@inquirer/type/dist/utils.d.ts create mode 100644 node_modules/@inquirer/type/dist/utils.js create mode 100644 node_modules/@inquirer/type/package.json create mode 100644 node_modules/@isaacs/balanced-match/LICENSE.md create mode 100644 node_modules/@isaacs/balanced-match/README.md create mode 100644 node_modules/@isaacs/balanced-match/dist/commonjs/index.d.ts create mode 100644 node_modules/@isaacs/balanced-match/dist/commonjs/index.d.ts.map create mode 100644 node_modules/@isaacs/balanced-match/dist/commonjs/index.js create mode 100644 node_modules/@isaacs/balanced-match/dist/commonjs/index.js.map create mode 100644 node_modules/@isaacs/balanced-match/dist/commonjs/package.json create mode 100644 node_modules/@isaacs/balanced-match/dist/esm/index.d.ts create mode 100644 node_modules/@isaacs/balanced-match/dist/esm/index.d.ts.map create mode 100644 node_modules/@isaacs/balanced-match/dist/esm/index.js create mode 100644 node_modules/@isaacs/balanced-match/dist/esm/index.js.map create mode 100644 node_modules/@isaacs/balanced-match/dist/esm/package.json create mode 100644 node_modules/@isaacs/balanced-match/package.json create mode 100644 node_modules/@isaacs/brace-expansion/LICENSE create mode 100644 node_modules/@isaacs/brace-expansion/README.md create mode 100644 node_modules/@isaacs/brace-expansion/dist/commonjs/index.d.ts create mode 100644 node_modules/@isaacs/brace-expansion/dist/commonjs/index.d.ts.map create mode 100644 node_modules/@isaacs/brace-expansion/dist/commonjs/index.js create mode 100644 node_modules/@isaacs/brace-expansion/dist/commonjs/index.js.map create mode 100644 node_modules/@isaacs/brace-expansion/dist/commonjs/package.json create mode 100644 node_modules/@isaacs/brace-expansion/dist/esm/index.d.ts create mode 100644 node_modules/@isaacs/brace-expansion/dist/esm/index.d.ts.map create mode 100644 node_modules/@isaacs/brace-expansion/dist/esm/index.js create mode 100644 node_modules/@isaacs/brace-expansion/dist/esm/index.js.map create mode 100644 node_modules/@isaacs/brace-expansion/dist/esm/package.json create mode 100644 node_modules/@isaacs/brace-expansion/package.json create mode 100644 node_modules/@sec-ant/readable-stream/LICENSE create mode 100644 node_modules/@sec-ant/readable-stream/README.md create mode 100644 node_modules/@sec-ant/readable-stream/dist/core/asyncIterablePrototype.d.ts create mode 100644 node_modules/@sec-ant/readable-stream/dist/core/asyncIterator.d.ts create mode 100644 node_modules/@sec-ant/readable-stream/dist/core/fromAnyIterable.d.ts create mode 100644 node_modules/@sec-ant/readable-stream/dist/index/asyncIterator.d.ts create mode 100644 node_modules/@sec-ant/readable-stream/dist/index/asyncIterator.js create mode 100644 node_modules/@sec-ant/readable-stream/dist/index/fromAnyIterable.d.ts create mode 100644 node_modules/@sec-ant/readable-stream/dist/index/fromAnyIterable.js create mode 100644 node_modules/@sec-ant/readable-stream/dist/index/index.d.ts create mode 100644 node_modules/@sec-ant/readable-stream/dist/index/index.js create mode 100644 node_modules/@sec-ant/readable-stream/dist/polyfill/asyncIterator.d.ts create mode 100644 node_modules/@sec-ant/readable-stream/dist/polyfill/asyncIterator.js create mode 100644 node_modules/@sec-ant/readable-stream/dist/polyfill/fromAnyIterable.d.ts create mode 100644 node_modules/@sec-ant/readable-stream/dist/polyfill/fromAnyIterable.js create mode 100644 node_modules/@sec-ant/readable-stream/dist/polyfill/index.d.ts create mode 100644 node_modules/@sec-ant/readable-stream/dist/polyfill/index.js create mode 100644 node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.d.ts create mode 100644 node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js create mode 100644 node_modules/@sec-ant/readable-stream/dist/ponyfill/fromAnyIterable.d.ts create mode 100644 node_modules/@sec-ant/readable-stream/dist/ponyfill/fromAnyIterable.js create mode 100644 node_modules/@sec-ant/readable-stream/dist/ponyfill/index.d.ts create mode 100644 node_modules/@sec-ant/readable-stream/dist/ponyfill/index.js create mode 100644 node_modules/@sec-ant/readable-stream/dist/types/async-iterator.d.ts create mode 100644 node_modules/@sec-ant/readable-stream/package.json create mode 100644 node_modules/@sindresorhus/merge-streams/index.d.ts create mode 100644 node_modules/@sindresorhus/merge-streams/index.js create mode 100644 node_modules/@sindresorhus/merge-streams/license create mode 100644 node_modules/@sindresorhus/merge-streams/package.json create mode 100644 node_modules/@sindresorhus/merge-streams/readme.md create mode 100644 node_modules/ansi-regex/index.d.ts create mode 100644 node_modules/ansi-regex/index.js create mode 100644 node_modules/ansi-regex/license create mode 100644 node_modules/ansi-regex/package.json create mode 100644 node_modules/ansi-regex/readme.md create mode 100644 node_modules/ansi-styles/index.js create mode 100644 node_modules/ansi-styles/license create mode 100644 node_modules/ansi-styles/package.json create mode 100644 node_modules/ansi-styles/readme.md create mode 100644 node_modules/array-back/LICENSE create mode 100644 node_modules/array-back/README.hbs create mode 100644 node_modules/array-back/README.md create mode 100644 node_modules/array-back/dist/index.js create mode 100644 node_modules/array-back/index.mjs create mode 100644 node_modules/array-back/package.json create mode 100644 node_modules/chalk/index.js create mode 100644 node_modules/chalk/index.js.flow create mode 100644 node_modules/chalk/license create mode 100644 node_modules/chalk/package.json create mode 100644 node_modules/chalk/readme.md create mode 100644 node_modules/chalk/templates.js create mode 100644 node_modules/chalk/types/index.d.ts create mode 100644 node_modules/chardet/LICENSE create mode 100644 node_modules/chardet/README.md create mode 100644 node_modules/chardet/lib/encoding/ascii.d.ts create mode 100644 node_modules/chardet/lib/encoding/ascii.js create mode 100644 node_modules/chardet/lib/encoding/ascii.js.map create mode 100644 node_modules/chardet/lib/encoding/index.d.ts create mode 100644 node_modules/chardet/lib/encoding/index.js create mode 100644 node_modules/chardet/lib/encoding/index.js.map create mode 100644 node_modules/chardet/lib/encoding/iso2022.d.ts create mode 100644 node_modules/chardet/lib/encoding/iso2022.js create mode 100644 node_modules/chardet/lib/encoding/iso2022.js.map create mode 100644 node_modules/chardet/lib/encoding/mbcs.d.ts create mode 100644 node_modules/chardet/lib/encoding/mbcs.js create mode 100644 node_modules/chardet/lib/encoding/mbcs.js.map create mode 100644 node_modules/chardet/lib/encoding/sbcs.d.ts create mode 100644 node_modules/chardet/lib/encoding/sbcs.js create mode 100644 node_modules/chardet/lib/encoding/sbcs.js.map create mode 100644 node_modules/chardet/lib/encoding/unicode.d.ts create mode 100644 node_modules/chardet/lib/encoding/unicode.js create mode 100644 node_modules/chardet/lib/encoding/unicode.js.map create mode 100644 node_modules/chardet/lib/encoding/utf8.d.ts create mode 100644 node_modules/chardet/lib/encoding/utf8.js create mode 100644 node_modules/chardet/lib/encoding/utf8.js.map create mode 100644 node_modules/chardet/lib/fs/browser.d.ts create mode 100644 node_modules/chardet/lib/fs/browser.js create mode 100644 node_modules/chardet/lib/fs/browser.js.map create mode 100644 node_modules/chardet/lib/fs/node.d.ts create mode 100644 node_modules/chardet/lib/fs/node.js create mode 100644 node_modules/chardet/lib/fs/node.js.map create mode 100644 node_modules/chardet/lib/index.d.ts create mode 100644 node_modules/chardet/lib/index.js create mode 100644 node_modules/chardet/lib/index.js.map create mode 100644 node_modules/chardet/lib/match.d.ts create mode 100644 node_modules/chardet/lib/match.js create mode 100644 node_modules/chardet/lib/match.js.map create mode 100644 node_modules/chardet/lib/utils.d.ts create mode 100644 node_modules/chardet/lib/utils.js create mode 100644 node_modules/chardet/lib/utils.js.map create mode 100644 node_modules/chardet/package.json create mode 100644 node_modules/cli-width/LICENSE create mode 100644 node_modules/cli-width/README.md create mode 100644 node_modules/cli-width/index.d.ts create mode 100644 node_modules/cli-width/index.js create mode 100644 node_modules/cli-width/package.json create mode 100644 node_modules/color-convert/CHANGELOG.md create mode 100644 node_modules/color-convert/LICENSE create mode 100644 node_modules/color-convert/README.md create mode 100644 node_modules/color-convert/conversions.js create mode 100644 node_modules/color-convert/index.js create mode 100644 node_modules/color-convert/package.json create mode 100644 node_modules/color-convert/route.js create mode 100644 node_modules/color-name/.eslintrc.json create mode 100644 node_modules/color-name/.npmignore create mode 100644 node_modules/color-name/LICENSE create mode 100644 node_modules/color-name/README.md create mode 100644 node_modules/color-name/index.js create mode 100644 node_modules/color-name/package.json create mode 100644 node_modules/color-name/test.js create mode 100644 node_modules/command-line-usage/LICENSE create mode 100644 node_modules/command-line-usage/README.md create mode 100644 node_modules/command-line-usage/index.js create mode 100644 node_modules/command-line-usage/lib/chalk-format.js create mode 100644 node_modules/command-line-usage/lib/section.js create mode 100644 node_modules/command-line-usage/lib/section/content.js create mode 100644 node_modules/command-line-usage/lib/section/option-list.js create mode 100644 node_modules/command-line-usage/package.json create mode 100644 node_modules/cross-spawn/LICENSE create mode 100644 node_modules/cross-spawn/README.md create mode 100644 node_modules/cross-spawn/index.js create mode 100644 node_modules/cross-spawn/lib/enoent.js create mode 100644 node_modules/cross-spawn/lib/parse.js create mode 100644 node_modules/cross-spawn/lib/util/escape.js create mode 100644 node_modules/cross-spawn/lib/util/readShebang.js create mode 100644 node_modules/cross-spawn/lib/util/resolveCommand.js create mode 100644 node_modules/cross-spawn/package.json create mode 100644 node_modules/deep-extend/CHANGELOG.md create mode 100644 node_modules/deep-extend/LICENSE create mode 100644 node_modules/deep-extend/README.md create mode 100644 node_modules/deep-extend/index.js create mode 100644 node_modules/deep-extend/lib/deep-extend.js create mode 100644 node_modules/deep-extend/package.json create mode 100644 node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 node_modules/emoji-regex/README.md create mode 100644 node_modules/emoji-regex/index.d.ts create mode 100644 node_modules/emoji-regex/index.js create mode 100644 node_modules/emoji-regex/index.mjs create mode 100644 node_modules/emoji-regex/package.json create mode 100644 node_modules/escape-string-regexp/index.js create mode 100644 node_modules/escape-string-regexp/license create mode 100644 node_modules/escape-string-regexp/package.json create mode 100644 node_modules/escape-string-regexp/readme.md create mode 100644 node_modules/execa/index.d.ts create mode 100644 node_modules/execa/index.js create mode 100644 node_modules/execa/lib/arguments/command.js create mode 100644 node_modules/execa/lib/arguments/cwd.js create mode 100644 node_modules/execa/lib/arguments/encoding-option.js create mode 100644 node_modules/execa/lib/arguments/escape.js create mode 100644 node_modules/execa/lib/arguments/fd-options.js create mode 100644 node_modules/execa/lib/arguments/file-url.js create mode 100644 node_modules/execa/lib/arguments/options.js create mode 100644 node_modules/execa/lib/arguments/shell.js create mode 100644 node_modules/execa/lib/arguments/specific.js create mode 100644 node_modules/execa/lib/convert/add.js create mode 100644 node_modules/execa/lib/convert/concurrent.js create mode 100644 node_modules/execa/lib/convert/duplex.js create mode 100644 node_modules/execa/lib/convert/iterable.js create mode 100644 node_modules/execa/lib/convert/readable.js create mode 100644 node_modules/execa/lib/convert/shared.js create mode 100644 node_modules/execa/lib/convert/writable.js create mode 100644 node_modules/execa/lib/io/contents.js create mode 100644 node_modules/execa/lib/io/input-sync.js create mode 100644 node_modules/execa/lib/io/iterate.js create mode 100644 node_modules/execa/lib/io/max-buffer.js create mode 100644 node_modules/execa/lib/io/output-async.js create mode 100644 node_modules/execa/lib/io/output-sync.js create mode 100644 node_modules/execa/lib/io/pipeline.js create mode 100644 node_modules/execa/lib/io/strip-newline.js create mode 100644 node_modules/execa/lib/ipc/array.js create mode 100644 node_modules/execa/lib/ipc/buffer-messages.js create mode 100644 node_modules/execa/lib/ipc/forward.js create mode 100644 node_modules/execa/lib/ipc/get-each.js create mode 100644 node_modules/execa/lib/ipc/get-one.js create mode 100644 node_modules/execa/lib/ipc/graceful.js create mode 100644 node_modules/execa/lib/ipc/incoming.js create mode 100644 node_modules/execa/lib/ipc/ipc-input.js create mode 100644 node_modules/execa/lib/ipc/methods.js create mode 100644 node_modules/execa/lib/ipc/outgoing.js create mode 100644 node_modules/execa/lib/ipc/reference.js create mode 100644 node_modules/execa/lib/ipc/send.js create mode 100644 node_modules/execa/lib/ipc/strict.js create mode 100644 node_modules/execa/lib/ipc/validation.js create mode 100644 node_modules/execa/lib/methods/bind.js create mode 100644 node_modules/execa/lib/methods/command.js create mode 100644 node_modules/execa/lib/methods/create.js create mode 100644 node_modules/execa/lib/methods/main-async.js create mode 100644 node_modules/execa/lib/methods/main-sync.js create mode 100644 node_modules/execa/lib/methods/node.js create mode 100644 node_modules/execa/lib/methods/parameters.js create mode 100644 node_modules/execa/lib/methods/promise.js create mode 100644 node_modules/execa/lib/methods/script.js create mode 100644 node_modules/execa/lib/methods/template.js create mode 100644 node_modules/execa/lib/pipe/abort.js create mode 100644 node_modules/execa/lib/pipe/pipe-arguments.js create mode 100644 node_modules/execa/lib/pipe/sequence.js create mode 100644 node_modules/execa/lib/pipe/setup.js create mode 100644 node_modules/execa/lib/pipe/streaming.js create mode 100644 node_modules/execa/lib/pipe/throw.js create mode 100644 node_modules/execa/lib/resolve/all-async.js create mode 100644 node_modules/execa/lib/resolve/all-sync.js create mode 100644 node_modules/execa/lib/resolve/exit-async.js create mode 100644 node_modules/execa/lib/resolve/exit-sync.js create mode 100644 node_modules/execa/lib/resolve/stdio.js create mode 100644 node_modules/execa/lib/resolve/wait-stream.js create mode 100644 node_modules/execa/lib/resolve/wait-subprocess.js create mode 100644 node_modules/execa/lib/return/duration.js create mode 100644 node_modules/execa/lib/return/early-error.js create mode 100644 node_modules/execa/lib/return/final-error.js create mode 100644 node_modules/execa/lib/return/message.js create mode 100644 node_modules/execa/lib/return/reject.js create mode 100644 node_modules/execa/lib/return/result.js create mode 100644 node_modules/execa/lib/stdio/direction.js create mode 100644 node_modules/execa/lib/stdio/duplicate.js create mode 100644 node_modules/execa/lib/stdio/handle-async.js create mode 100644 node_modules/execa/lib/stdio/handle-sync.js create mode 100644 node_modules/execa/lib/stdio/handle.js create mode 100644 node_modules/execa/lib/stdio/input-option.js create mode 100644 node_modules/execa/lib/stdio/native.js create mode 100644 node_modules/execa/lib/stdio/stdio-option.js create mode 100644 node_modules/execa/lib/stdio/type.js create mode 100644 node_modules/execa/lib/terminate/cancel.js create mode 100644 node_modules/execa/lib/terminate/cleanup.js create mode 100644 node_modules/execa/lib/terminate/graceful.js create mode 100644 node_modules/execa/lib/terminate/kill.js create mode 100644 node_modules/execa/lib/terminate/signal.js create mode 100644 node_modules/execa/lib/terminate/timeout.js create mode 100644 node_modules/execa/lib/transform/encoding-transform.js create mode 100644 node_modules/execa/lib/transform/generator.js create mode 100644 node_modules/execa/lib/transform/normalize.js create mode 100644 node_modules/execa/lib/transform/object-mode.js create mode 100644 node_modules/execa/lib/transform/run-async.js create mode 100644 node_modules/execa/lib/transform/run-sync.js create mode 100644 node_modules/execa/lib/transform/split.js create mode 100644 node_modules/execa/lib/transform/validate.js create mode 100644 node_modules/execa/lib/utils/abort-signal.js create mode 100644 node_modules/execa/lib/utils/deferred.js create mode 100644 node_modules/execa/lib/utils/max-listeners.js create mode 100644 node_modules/execa/lib/utils/standard-stream.js create mode 100644 node_modules/execa/lib/utils/uint-array.js create mode 100644 node_modules/execa/lib/verbose/complete.js create mode 100644 node_modules/execa/lib/verbose/custom.js create mode 100644 node_modules/execa/lib/verbose/default.js create mode 100644 node_modules/execa/lib/verbose/error.js create mode 100644 node_modules/execa/lib/verbose/info.js create mode 100644 node_modules/execa/lib/verbose/ipc.js create mode 100644 node_modules/execa/lib/verbose/log.js create mode 100644 node_modules/execa/lib/verbose/output.js create mode 100644 node_modules/execa/lib/verbose/start.js create mode 100644 node_modules/execa/lib/verbose/values.js create mode 100644 node_modules/execa/license create mode 100644 node_modules/execa/node_modules/parse-ms/index.d.ts create mode 100644 node_modules/execa/node_modules/parse-ms/index.js create mode 100644 node_modules/execa/node_modules/parse-ms/license create mode 100644 node_modules/execa/node_modules/parse-ms/package.json create mode 100644 node_modules/execa/node_modules/parse-ms/readme.md create mode 100644 node_modules/execa/node_modules/pretty-ms/index.d.ts create mode 100644 node_modules/execa/node_modules/pretty-ms/index.js create mode 100644 node_modules/execa/node_modules/pretty-ms/license create mode 100644 node_modules/execa/node_modules/pretty-ms/package.json create mode 100644 node_modules/execa/node_modules/pretty-ms/readme.md create mode 100644 node_modules/execa/package.json create mode 100644 node_modules/execa/readme.md create mode 100644 node_modules/execa/types/arguments/encoding-option.d.ts create mode 100644 node_modules/execa/types/arguments/fd-options.d.ts create mode 100644 node_modules/execa/types/arguments/options.d.ts create mode 100644 node_modules/execa/types/arguments/specific.d.ts create mode 100644 node_modules/execa/types/convert.d.ts create mode 100644 node_modules/execa/types/ipc.d.ts create mode 100644 node_modules/execa/types/methods/command.d.ts create mode 100644 node_modules/execa/types/methods/main-async.d.ts create mode 100644 node_modules/execa/types/methods/main-sync.d.ts create mode 100644 node_modules/execa/types/methods/node.d.ts create mode 100644 node_modules/execa/types/methods/script.d.ts create mode 100644 node_modules/execa/types/methods/template.d.ts create mode 100644 node_modules/execa/types/pipe.d.ts create mode 100644 node_modules/execa/types/return/final-error.d.ts create mode 100644 node_modules/execa/types/return/ignore.d.ts create mode 100644 node_modules/execa/types/return/result-all.d.ts create mode 100644 node_modules/execa/types/return/result-ipc.d.ts create mode 100644 node_modules/execa/types/return/result-stdio.d.ts create mode 100644 node_modules/execa/types/return/result-stdout.d.ts create mode 100644 node_modules/execa/types/return/result.d.ts create mode 100644 node_modules/execa/types/stdio/array.d.ts create mode 100644 node_modules/execa/types/stdio/direction.d.ts create mode 100644 node_modules/execa/types/stdio/option.d.ts create mode 100644 node_modules/execa/types/stdio/type.d.ts create mode 100644 node_modules/execa/types/subprocess/all.d.ts create mode 100644 node_modules/execa/types/subprocess/stdio.d.ts create mode 100644 node_modules/execa/types/subprocess/stdout.d.ts create mode 100644 node_modules/execa/types/subprocess/subprocess.d.ts create mode 100644 node_modules/execa/types/transform/normalize.d.ts create mode 100644 node_modules/execa/types/transform/object-mode.d.ts create mode 100644 node_modules/execa/types/utils.d.ts create mode 100644 node_modules/execa/types/verbose.d.ts create mode 100644 node_modules/fastest-levenshtein/.eslintrc.json create mode 100644 node_modules/fastest-levenshtein/.prettierrc create mode 100644 node_modules/fastest-levenshtein/.travis.yml create mode 100644 node_modules/fastest-levenshtein/LICENSE.md create mode 100644 node_modules/fastest-levenshtein/README.md create mode 100644 node_modules/fastest-levenshtein/bench.js create mode 100644 node_modules/fastest-levenshtein/esm/mod.d.ts create mode 100644 node_modules/fastest-levenshtein/esm/mod.d.ts.map create mode 100644 node_modules/fastest-levenshtein/esm/mod.js create mode 100644 node_modules/fastest-levenshtein/mod.d.ts create mode 100644 node_modules/fastest-levenshtein/mod.js create mode 100644 node_modules/fastest-levenshtein/package.json create mode 100644 node_modules/fastest-levenshtein/test.js create mode 100644 node_modules/fastest-levenshtein/test.ts create mode 100644 node_modules/figures/index.d.ts create mode 100644 node_modules/figures/index.js create mode 100644 node_modules/figures/license create mode 100644 node_modules/figures/package.json create mode 100644 node_modules/figures/readme.md create mode 100644 node_modules/fuse.js/LICENSE create mode 100644 node_modules/fuse.js/README.md create mode 100644 node_modules/fuse.js/dist/fuse.basic.cjs create mode 100644 node_modules/fuse.js/dist/fuse.basic.js create mode 100644 node_modules/fuse.js/dist/fuse.basic.min.cjs create mode 100644 node_modules/fuse.js/dist/fuse.basic.min.js create mode 100644 node_modules/fuse.js/dist/fuse.basic.min.mjs create mode 100644 node_modules/fuse.js/dist/fuse.basic.mjs create mode 100644 node_modules/fuse.js/dist/fuse.cjs create mode 100644 node_modules/fuse.js/dist/fuse.d.ts create mode 100644 node_modules/fuse.js/dist/fuse.js create mode 100644 node_modules/fuse.js/dist/fuse.min.cjs create mode 100644 node_modules/fuse.js/dist/fuse.min.js create mode 100644 node_modules/fuse.js/dist/fuse.min.mjs create mode 100644 node_modules/fuse.js/dist/fuse.mjs create mode 100644 node_modules/fuse.js/package.json create mode 100644 node_modules/get-east-asian-width/index.d.ts create mode 100644 node_modules/get-east-asian-width/index.js create mode 100644 node_modules/get-east-asian-width/license create mode 100644 node_modules/get-east-asian-width/lookup.js create mode 100644 node_modules/get-east-asian-width/package.json create mode 100644 node_modules/get-east-asian-width/readme.md create mode 100644 node_modules/get-stream/license create mode 100644 node_modules/get-stream/package.json create mode 100644 node_modules/get-stream/readme.md create mode 100644 node_modules/get-stream/source/array-buffer.js create mode 100644 node_modules/get-stream/source/array.js create mode 100644 node_modules/get-stream/source/buffer.js create mode 100644 node_modules/get-stream/source/contents.js create mode 100644 node_modules/get-stream/source/exports.js create mode 100644 node_modules/get-stream/source/index.d.ts create mode 100644 node_modules/get-stream/source/index.js create mode 100644 node_modules/get-stream/source/stream.js create mode 100644 node_modules/get-stream/source/string.js create mode 100644 node_modules/get-stream/source/utils.js create mode 100644 node_modules/glob/LICENSE.md create mode 100644 node_modules/glob/README.md create mode 100644 node_modules/glob/dist/commonjs/glob.d.ts create mode 100644 node_modules/glob/dist/commonjs/glob.d.ts.map create mode 100644 node_modules/glob/dist/commonjs/glob.js create mode 100644 node_modules/glob/dist/commonjs/glob.js.map create mode 100644 node_modules/glob/dist/commonjs/has-magic.d.ts create mode 100644 node_modules/glob/dist/commonjs/has-magic.d.ts.map create mode 100644 node_modules/glob/dist/commonjs/has-magic.js create mode 100644 node_modules/glob/dist/commonjs/has-magic.js.map create mode 100644 node_modules/glob/dist/commonjs/ignore.d.ts create mode 100644 node_modules/glob/dist/commonjs/ignore.d.ts.map create mode 100644 node_modules/glob/dist/commonjs/ignore.js create mode 100644 node_modules/glob/dist/commonjs/ignore.js.map create mode 100644 node_modules/glob/dist/commonjs/index.d.ts create mode 100644 node_modules/glob/dist/commonjs/index.d.ts.map create mode 100644 node_modules/glob/dist/commonjs/index.js create mode 100644 node_modules/glob/dist/commonjs/index.js.map create mode 100644 node_modules/glob/dist/commonjs/package.json create mode 100644 node_modules/glob/dist/commonjs/pattern.d.ts create mode 100644 node_modules/glob/dist/commonjs/pattern.d.ts.map create mode 100644 node_modules/glob/dist/commonjs/pattern.js create mode 100644 node_modules/glob/dist/commonjs/pattern.js.map create mode 100644 node_modules/glob/dist/commonjs/processor.d.ts create mode 100644 node_modules/glob/dist/commonjs/processor.d.ts.map create mode 100644 node_modules/glob/dist/commonjs/processor.js create mode 100644 node_modules/glob/dist/commonjs/processor.js.map create mode 100644 node_modules/glob/dist/commonjs/walker.d.ts create mode 100644 node_modules/glob/dist/commonjs/walker.d.ts.map create mode 100644 node_modules/glob/dist/commonjs/walker.js create mode 100644 node_modules/glob/dist/commonjs/walker.js.map create mode 100644 node_modules/glob/dist/esm/glob.d.ts create mode 100644 node_modules/glob/dist/esm/glob.d.ts.map create mode 100644 node_modules/glob/dist/esm/glob.js create mode 100644 node_modules/glob/dist/esm/glob.js.map create mode 100644 node_modules/glob/dist/esm/has-magic.d.ts create mode 100644 node_modules/glob/dist/esm/has-magic.d.ts.map create mode 100644 node_modules/glob/dist/esm/has-magic.js create mode 100644 node_modules/glob/dist/esm/has-magic.js.map create mode 100644 node_modules/glob/dist/esm/ignore.d.ts create mode 100644 node_modules/glob/dist/esm/ignore.d.ts.map create mode 100644 node_modules/glob/dist/esm/ignore.js create mode 100644 node_modules/glob/dist/esm/ignore.js.map create mode 100644 node_modules/glob/dist/esm/index.d.ts create mode 100644 node_modules/glob/dist/esm/index.d.ts.map create mode 100644 node_modules/glob/dist/esm/index.js create mode 100644 node_modules/glob/dist/esm/index.js.map create mode 100644 node_modules/glob/dist/esm/package.json create mode 100644 node_modules/glob/dist/esm/pattern.d.ts create mode 100644 node_modules/glob/dist/esm/pattern.d.ts.map create mode 100644 node_modules/glob/dist/esm/pattern.js create mode 100644 node_modules/glob/dist/esm/pattern.js.map create mode 100644 node_modules/glob/dist/esm/processor.d.ts create mode 100644 node_modules/glob/dist/esm/processor.d.ts.map create mode 100644 node_modules/glob/dist/esm/processor.js create mode 100644 node_modules/glob/dist/esm/processor.js.map create mode 100644 node_modules/glob/dist/esm/walker.d.ts create mode 100644 node_modules/glob/dist/esm/walker.d.ts.map create mode 100644 node_modules/glob/dist/esm/walker.js create mode 100644 node_modules/glob/dist/esm/walker.js.map create mode 100644 node_modules/glob/package.json create mode 100644 node_modules/has-flag/index.js create mode 100644 node_modules/has-flag/license create mode 100644 node_modules/has-flag/package.json create mode 100644 node_modules/has-flag/readme.md create mode 100644 node_modules/hereby/LICENSE create mode 100644 node_modules/hereby/README.md create mode 100644 node_modules/hereby/bin/hereby.js create mode 100644 node_modules/hereby/dist/cli.js create mode 100644 node_modules/hereby/dist/cli/formatTasks.js create mode 100644 node_modules/hereby/dist/cli/index.js create mode 100644 node_modules/hereby/dist/cli/loadHerebyfile.js create mode 100644 node_modules/hereby/dist/cli/parseArgs.js create mode 100644 node_modules/hereby/dist/cli/reexec.js create mode 100644 node_modules/hereby/dist/cli/runner.js create mode 100644 node_modules/hereby/dist/cli/utils.js create mode 100644 node_modules/hereby/dist/index.d.ts create mode 100644 node_modules/hereby/dist/index.js create mode 100644 node_modules/hereby/package.json create mode 100644 node_modules/human-signals/LICENSE create mode 100644 node_modules/human-signals/README.md create mode 100644 node_modules/human-signals/build/src/core.js create mode 100644 node_modules/human-signals/build/src/main.d.ts create mode 100644 node_modules/human-signals/build/src/main.js create mode 100644 node_modules/human-signals/build/src/realtime.js create mode 100644 node_modules/human-signals/build/src/signals.js create mode 100644 node_modules/human-signals/package.json create mode 100644 node_modules/iconv-lite/LICENSE create mode 100644 node_modules/iconv-lite/README.md create mode 100644 node_modules/iconv-lite/encodings/dbcs-codec.js create mode 100644 node_modules/iconv-lite/encodings/dbcs-data.js create mode 100644 node_modules/iconv-lite/encodings/index.js create mode 100644 node_modules/iconv-lite/encodings/internal.js create mode 100644 node_modules/iconv-lite/encodings/sbcs-codec.js create mode 100644 node_modules/iconv-lite/encodings/sbcs-data-generated.js create mode 100644 node_modules/iconv-lite/encodings/sbcs-data.js create mode 100644 node_modules/iconv-lite/encodings/tables/big5-added.json create mode 100644 node_modules/iconv-lite/encodings/tables/cp936.json create mode 100644 node_modules/iconv-lite/encodings/tables/cp949.json create mode 100644 node_modules/iconv-lite/encodings/tables/cp950.json create mode 100644 node_modules/iconv-lite/encodings/tables/eucjp.json create mode 100644 node_modules/iconv-lite/encodings/tables/gb18030-ranges.json create mode 100644 node_modules/iconv-lite/encodings/tables/gbk-added.json create mode 100644 node_modules/iconv-lite/encodings/tables/shiftjis.json create mode 100644 node_modules/iconv-lite/encodings/utf16.js create mode 100644 node_modules/iconv-lite/encodings/utf32.js create mode 100644 node_modules/iconv-lite/encodings/utf7.js create mode 100644 node_modules/iconv-lite/lib/bom-handling.js create mode 100644 node_modules/iconv-lite/lib/helpers/merge-exports.js create mode 100644 node_modules/iconv-lite/lib/index.d.ts create mode 100644 node_modules/iconv-lite/lib/index.js create mode 100644 node_modules/iconv-lite/lib/streams.js create mode 100644 node_modules/iconv-lite/package.json create mode 100644 node_modules/iconv-lite/types/encodings.d.ts create mode 100644 node_modules/is-plain-obj/index.d.ts create mode 100644 node_modules/is-plain-obj/index.js create mode 100644 node_modules/is-plain-obj/license create mode 100644 node_modules/is-plain-obj/package.json create mode 100644 node_modules/is-plain-obj/readme.md create mode 100644 node_modules/is-stream/index.d.ts create mode 100644 node_modules/is-stream/index.js create mode 100644 node_modules/is-stream/license create mode 100644 node_modules/is-stream/package.json create mode 100644 node_modules/is-stream/readme.md create mode 100644 node_modules/is-unicode-supported/index.d.ts create mode 100644 node_modules/is-unicode-supported/index.js create mode 100644 node_modules/is-unicode-supported/license create mode 100644 node_modules/is-unicode-supported/package.json create mode 100644 node_modules/is-unicode-supported/readme.md create mode 100644 node_modules/isexe/.npmignore create mode 100644 node_modules/isexe/LICENSE create mode 100644 node_modules/isexe/README.md create mode 100644 node_modules/isexe/index.js create mode 100644 node_modules/isexe/mode.js create mode 100644 node_modules/isexe/package.json create mode 100644 node_modules/isexe/test/basic.js create mode 100644 node_modules/isexe/windows.js create mode 100644 node_modules/kleur/index.js create mode 100644 node_modules/kleur/kleur.d.ts create mode 100644 node_modules/kleur/license create mode 100644 node_modules/kleur/package.json create mode 100644 node_modules/kleur/readme.md create mode 100644 node_modules/lru-cache/LICENSE.md create mode 100644 node_modules/lru-cache/README.md create mode 100644 node_modules/lru-cache/dist/commonjs/index.d.ts create mode 100644 node_modules/lru-cache/dist/commonjs/index.d.ts.map create mode 100644 node_modules/lru-cache/dist/commonjs/index.js create mode 100644 node_modules/lru-cache/dist/commonjs/index.js.map create mode 100644 node_modules/lru-cache/dist/commonjs/index.min.js create mode 100644 node_modules/lru-cache/dist/commonjs/index.min.js.map create mode 100644 node_modules/lru-cache/dist/commonjs/package.json create mode 100644 node_modules/lru-cache/dist/esm/index.d.ts create mode 100644 node_modules/lru-cache/dist/esm/index.d.ts.map create mode 100644 node_modules/lru-cache/dist/esm/index.js create mode 100644 node_modules/lru-cache/dist/esm/index.js.map create mode 100644 node_modules/lru-cache/dist/esm/index.min.js create mode 100644 node_modules/lru-cache/dist/esm/index.min.js.map create mode 100644 node_modules/lru-cache/dist/esm/package.json create mode 100644 node_modules/lru-cache/package.json create mode 100644 node_modules/minimatch/LICENSE.md create mode 100644 node_modules/minimatch/README.md create mode 100644 node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts create mode 100644 node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map create mode 100644 node_modules/minimatch/dist/commonjs/assert-valid-pattern.js create mode 100644 node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map create mode 100644 node_modules/minimatch/dist/commonjs/ast.d.ts create mode 100644 node_modules/minimatch/dist/commonjs/ast.d.ts.map create mode 100644 node_modules/minimatch/dist/commonjs/ast.js create mode 100644 node_modules/minimatch/dist/commonjs/ast.js.map create mode 100644 node_modules/minimatch/dist/commonjs/brace-expressions.d.ts create mode 100644 node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map create mode 100644 node_modules/minimatch/dist/commonjs/brace-expressions.js create mode 100644 node_modules/minimatch/dist/commonjs/brace-expressions.js.map create mode 100644 node_modules/minimatch/dist/commonjs/escape.d.ts create mode 100644 node_modules/minimatch/dist/commonjs/escape.d.ts.map create mode 100644 node_modules/minimatch/dist/commonjs/escape.js create mode 100644 node_modules/minimatch/dist/commonjs/escape.js.map create mode 100644 node_modules/minimatch/dist/commonjs/index.d.ts create mode 100644 node_modules/minimatch/dist/commonjs/index.d.ts.map create mode 100644 node_modules/minimatch/dist/commonjs/index.js create mode 100644 node_modules/minimatch/dist/commonjs/index.js.map create mode 100644 node_modules/minimatch/dist/commonjs/package.json create mode 100644 node_modules/minimatch/dist/commonjs/unescape.d.ts create mode 100644 node_modules/minimatch/dist/commonjs/unescape.d.ts.map create mode 100644 node_modules/minimatch/dist/commonjs/unescape.js create mode 100644 node_modules/minimatch/dist/commonjs/unescape.js.map create mode 100644 node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts create mode 100644 node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map create mode 100644 node_modules/minimatch/dist/esm/assert-valid-pattern.js create mode 100644 node_modules/minimatch/dist/esm/assert-valid-pattern.js.map create mode 100644 node_modules/minimatch/dist/esm/ast.d.ts create mode 100644 node_modules/minimatch/dist/esm/ast.d.ts.map create mode 100644 node_modules/minimatch/dist/esm/ast.js create mode 100644 node_modules/minimatch/dist/esm/ast.js.map create mode 100644 node_modules/minimatch/dist/esm/brace-expressions.d.ts create mode 100644 node_modules/minimatch/dist/esm/brace-expressions.d.ts.map create mode 100644 node_modules/minimatch/dist/esm/brace-expressions.js create mode 100644 node_modules/minimatch/dist/esm/brace-expressions.js.map create mode 100644 node_modules/minimatch/dist/esm/escape.d.ts create mode 100644 node_modules/minimatch/dist/esm/escape.d.ts.map create mode 100644 node_modules/minimatch/dist/esm/escape.js create mode 100644 node_modules/minimatch/dist/esm/escape.js.map create mode 100644 node_modules/minimatch/dist/esm/index.d.ts create mode 100644 node_modules/minimatch/dist/esm/index.d.ts.map create mode 100644 node_modules/minimatch/dist/esm/index.js create mode 100644 node_modules/minimatch/dist/esm/index.js.map create mode 100644 node_modules/minimatch/dist/esm/package.json create mode 100644 node_modules/minimatch/dist/esm/unescape.d.ts create mode 100644 node_modules/minimatch/dist/esm/unescape.d.ts.map create mode 100644 node_modules/minimatch/dist/esm/unescape.js create mode 100644 node_modules/minimatch/dist/esm/unescape.js.map create mode 100644 node_modules/minimatch/package.json create mode 100644 node_modules/minimist/.eslintrc create mode 100644 node_modules/minimist/.github/FUNDING.yml create mode 100644 node_modules/minimist/.nycrc create mode 100644 node_modules/minimist/CHANGELOG.md create mode 100644 node_modules/minimist/LICENSE create mode 100644 node_modules/minimist/README.md create mode 100644 node_modules/minimist/example/parse.js create mode 100644 node_modules/minimist/index.js create mode 100644 node_modules/minimist/package.json create mode 100644 node_modules/minimist/test/all_bool.js create mode 100644 node_modules/minimist/test/bool.js create mode 100644 node_modules/minimist/test/dash.js create mode 100644 node_modules/minimist/test/default_bool.js create mode 100644 node_modules/minimist/test/dotted.js create mode 100644 node_modules/minimist/test/kv_short.js create mode 100644 node_modules/minimist/test/long.js create mode 100644 node_modules/minimist/test/num.js create mode 100644 node_modules/minimist/test/parse.js create mode 100644 node_modules/minimist/test/parse_modified.js create mode 100644 node_modules/minimist/test/proto.js create mode 100644 node_modules/minimist/test/short.js create mode 100644 node_modules/minimist/test/stop_early.js create mode 100644 node_modules/minimist/test/unknown.js create mode 100644 node_modules/minimist/test/whitespace.js create mode 100644 node_modules/minipass/LICENSE create mode 100644 node_modules/minipass/README.md create mode 100644 node_modules/minipass/dist/commonjs/index.d.ts create mode 100644 node_modules/minipass/dist/commonjs/index.d.ts.map create mode 100644 node_modules/minipass/dist/commonjs/index.js create mode 100644 node_modules/minipass/dist/commonjs/index.js.map create mode 100644 node_modules/minipass/dist/commonjs/package.json create mode 100644 node_modules/minipass/dist/esm/index.d.ts create mode 100644 node_modules/minipass/dist/esm/index.d.ts.map create mode 100644 node_modules/minipass/dist/esm/index.js create mode 100644 node_modules/minipass/dist/esm/index.js.map create mode 100644 node_modules/minipass/dist/esm/package.json create mode 100644 node_modules/minipass/package.json create mode 100644 node_modules/mute-stream/LICENSE create mode 100644 node_modules/mute-stream/README.md create mode 100644 node_modules/mute-stream/lib/index.js create mode 100644 node_modules/mute-stream/package.json create mode 100644 node_modules/npm-run-path/index.d.ts create mode 100644 node_modules/npm-run-path/index.js create mode 100644 node_modules/npm-run-path/license create mode 100644 node_modules/npm-run-path/node_modules/path-key/index.d.ts create mode 100644 node_modules/npm-run-path/node_modules/path-key/index.js create mode 100644 node_modules/npm-run-path/node_modules/path-key/license create mode 100644 node_modules/npm-run-path/node_modules/path-key/package.json create mode 100644 node_modules/npm-run-path/node_modules/path-key/readme.md create mode 100644 node_modules/npm-run-path/package.json create mode 100644 node_modules/npm-run-path/readme.md create mode 100644 node_modules/parse-ms/index.d.ts create mode 100644 node_modules/parse-ms/index.js create mode 100644 node_modules/parse-ms/license create mode 100644 node_modules/parse-ms/package.json create mode 100644 node_modules/parse-ms/readme.md create mode 100644 node_modules/path-key/index.d.ts create mode 100644 node_modules/path-key/index.js create mode 100644 node_modules/path-key/license create mode 100644 node_modules/path-key/package.json create mode 100644 node_modules/path-key/readme.md create mode 100644 node_modules/path-scurry/LICENSE.md create mode 100644 node_modules/path-scurry/README.md create mode 100644 node_modules/path-scurry/dist/commonjs/index.d.ts create mode 100644 node_modules/path-scurry/dist/commonjs/index.d.ts.map create mode 100644 node_modules/path-scurry/dist/commonjs/index.js create mode 100644 node_modules/path-scurry/dist/commonjs/index.js.map create mode 100644 node_modules/path-scurry/dist/commonjs/package.json create mode 100644 node_modules/path-scurry/dist/esm/index.d.ts create mode 100644 node_modules/path-scurry/dist/esm/index.d.ts.map create mode 100644 node_modules/path-scurry/dist/esm/index.js create mode 100644 node_modules/path-scurry/dist/esm/index.js.map create mode 100644 node_modules/path-scurry/dist/esm/package.json create mode 100644 node_modules/path-scurry/package.json create mode 100644 node_modules/picocolors/LICENSE create mode 100644 node_modules/picocolors/README.md create mode 100644 node_modules/picocolors/package.json create mode 100644 node_modules/picocolors/picocolors.browser.js create mode 100644 node_modules/picocolors/picocolors.d.ts create mode 100644 node_modules/picocolors/picocolors.js create mode 100644 node_modules/picocolors/types.d.ts create mode 100644 node_modules/pretty-ms/index.d.ts create mode 100644 node_modules/pretty-ms/index.js create mode 100644 node_modules/pretty-ms/license create mode 100644 node_modules/pretty-ms/package.json create mode 100644 node_modules/pretty-ms/readme.md create mode 100644 node_modules/prompts/dist/dateparts/datepart.js create mode 100644 node_modules/prompts/dist/dateparts/day.js create mode 100644 node_modules/prompts/dist/dateparts/hours.js create mode 100644 node_modules/prompts/dist/dateparts/index.js create mode 100644 node_modules/prompts/dist/dateparts/meridiem.js create mode 100644 node_modules/prompts/dist/dateparts/milliseconds.js create mode 100644 node_modules/prompts/dist/dateparts/minutes.js create mode 100644 node_modules/prompts/dist/dateparts/month.js create mode 100644 node_modules/prompts/dist/dateparts/seconds.js create mode 100644 node_modules/prompts/dist/dateparts/year.js create mode 100644 node_modules/prompts/dist/elements/autocomplete.js create mode 100644 node_modules/prompts/dist/elements/autocompleteMultiselect.js create mode 100644 node_modules/prompts/dist/elements/confirm.js create mode 100644 node_modules/prompts/dist/elements/date.js create mode 100644 node_modules/prompts/dist/elements/index.js create mode 100644 node_modules/prompts/dist/elements/multiselect.js create mode 100644 node_modules/prompts/dist/elements/number.js create mode 100644 node_modules/prompts/dist/elements/prompt.js create mode 100644 node_modules/prompts/dist/elements/select.js create mode 100644 node_modules/prompts/dist/elements/text.js create mode 100644 node_modules/prompts/dist/elements/toggle.js create mode 100644 node_modules/prompts/dist/index.js create mode 100644 node_modules/prompts/dist/prompts.js create mode 100644 node_modules/prompts/dist/util/action.js create mode 100644 node_modules/prompts/dist/util/clear.js create mode 100644 node_modules/prompts/dist/util/entriesToDisplay.js create mode 100644 node_modules/prompts/dist/util/figures.js create mode 100644 node_modules/prompts/dist/util/index.js create mode 100644 node_modules/prompts/dist/util/lines.js create mode 100644 node_modules/prompts/dist/util/strip.js create mode 100644 node_modules/prompts/dist/util/style.js create mode 100644 node_modules/prompts/dist/util/wrap.js create mode 100644 node_modules/prompts/index.js create mode 100644 node_modules/prompts/lib/dateparts/datepart.js create mode 100644 node_modules/prompts/lib/dateparts/day.js create mode 100644 node_modules/prompts/lib/dateparts/hours.js create mode 100644 node_modules/prompts/lib/dateparts/index.js create mode 100644 node_modules/prompts/lib/dateparts/meridiem.js create mode 100644 node_modules/prompts/lib/dateparts/milliseconds.js create mode 100644 node_modules/prompts/lib/dateparts/minutes.js create mode 100644 node_modules/prompts/lib/dateparts/month.js create mode 100644 node_modules/prompts/lib/dateparts/seconds.js create mode 100644 node_modules/prompts/lib/dateparts/year.js create mode 100644 node_modules/prompts/lib/elements/autocomplete.js create mode 100644 node_modules/prompts/lib/elements/autocompleteMultiselect.js create mode 100644 node_modules/prompts/lib/elements/confirm.js create mode 100644 node_modules/prompts/lib/elements/date.js create mode 100644 node_modules/prompts/lib/elements/index.js create mode 100644 node_modules/prompts/lib/elements/multiselect.js create mode 100644 node_modules/prompts/lib/elements/number.js create mode 100644 node_modules/prompts/lib/elements/prompt.js create mode 100644 node_modules/prompts/lib/elements/select.js create mode 100644 node_modules/prompts/lib/elements/text.js create mode 100644 node_modules/prompts/lib/elements/toggle.js create mode 100644 node_modules/prompts/lib/index.js create mode 100644 node_modules/prompts/lib/prompts.js create mode 100644 node_modules/prompts/lib/util/action.js create mode 100644 node_modules/prompts/lib/util/clear.js create mode 100644 node_modules/prompts/lib/util/entriesToDisplay.js create mode 100644 node_modules/prompts/lib/util/figures.js create mode 100644 node_modules/prompts/lib/util/index.js create mode 100644 node_modules/prompts/lib/util/lines.js create mode 100644 node_modules/prompts/lib/util/strip.js create mode 100644 node_modules/prompts/lib/util/style.js create mode 100644 node_modules/prompts/lib/util/wrap.js create mode 100644 node_modules/prompts/license create mode 100644 node_modules/prompts/package.json create mode 100644 node_modules/prompts/readme.md create mode 100644 node_modules/reduce-flatten/.travis.yml create mode 100644 node_modules/reduce-flatten/LICENSE create mode 100644 node_modules/reduce-flatten/README.hbs create mode 100644 node_modules/reduce-flatten/README.md create mode 100644 node_modules/reduce-flatten/index.js create mode 100644 node_modules/reduce-flatten/package.json create mode 100644 node_modules/reduce-flatten/test.js create mode 100644 node_modules/safer-buffer/LICENSE create mode 100644 node_modules/safer-buffer/Porting-Buffer.md create mode 100644 node_modules/safer-buffer/Readme.md create mode 100644 node_modules/safer-buffer/dangerous.js create mode 100644 node_modules/safer-buffer/package.json create mode 100644 node_modules/safer-buffer/safer.js create mode 100644 node_modules/safer-buffer/tests.js create mode 100644 node_modules/shebang-command/index.js create mode 100644 node_modules/shebang-command/license create mode 100644 node_modules/shebang-command/package.json create mode 100644 node_modules/shebang-command/readme.md create mode 100644 node_modules/shebang-regex/index.d.ts create mode 100644 node_modules/shebang-regex/index.js create mode 100644 node_modules/shebang-regex/license create mode 100644 node_modules/shebang-regex/package.json create mode 100644 node_modules/shebang-regex/readme.md create mode 100644 node_modules/signal-exit/LICENSE.txt create mode 100644 node_modules/signal-exit/README.md create mode 100644 node_modules/signal-exit/dist/cjs/browser.d.ts create mode 100644 node_modules/signal-exit/dist/cjs/browser.d.ts.map create mode 100644 node_modules/signal-exit/dist/cjs/browser.js create mode 100644 node_modules/signal-exit/dist/cjs/browser.js.map create mode 100644 node_modules/signal-exit/dist/cjs/index.d.ts create mode 100644 node_modules/signal-exit/dist/cjs/index.d.ts.map create mode 100644 node_modules/signal-exit/dist/cjs/index.js create mode 100644 node_modules/signal-exit/dist/cjs/index.js.map create mode 100644 node_modules/signal-exit/dist/cjs/package.json create mode 100644 node_modules/signal-exit/dist/cjs/signals.d.ts create mode 100644 node_modules/signal-exit/dist/cjs/signals.d.ts.map create mode 100644 node_modules/signal-exit/dist/cjs/signals.js create mode 100644 node_modules/signal-exit/dist/cjs/signals.js.map create mode 100644 node_modules/signal-exit/dist/mjs/browser.d.ts create mode 100644 node_modules/signal-exit/dist/mjs/browser.d.ts.map create mode 100644 node_modules/signal-exit/dist/mjs/browser.js create mode 100644 node_modules/signal-exit/dist/mjs/browser.js.map create mode 100644 node_modules/signal-exit/dist/mjs/index.d.ts create mode 100644 node_modules/signal-exit/dist/mjs/index.d.ts.map create mode 100644 node_modules/signal-exit/dist/mjs/index.js create mode 100644 node_modules/signal-exit/dist/mjs/index.js.map create mode 100644 node_modules/signal-exit/dist/mjs/package.json create mode 100644 node_modules/signal-exit/dist/mjs/signals.d.ts create mode 100644 node_modules/signal-exit/dist/mjs/signals.d.ts.map create mode 100644 node_modules/signal-exit/dist/mjs/signals.js create mode 100644 node_modules/signal-exit/dist/mjs/signals.js.map create mode 100644 node_modules/signal-exit/package.json create mode 100644 node_modules/sisteransi/license create mode 100644 node_modules/sisteransi/package.json create mode 100644 node_modules/sisteransi/readme.md create mode 100644 node_modules/sisteransi/src/index.js create mode 100644 node_modules/sisteransi/src/sisteransi.d.ts create mode 100644 node_modules/string-width/index.d.ts create mode 100644 node_modules/string-width/index.js create mode 100644 node_modules/string-width/license create mode 100644 node_modules/string-width/package.json create mode 100644 node_modules/string-width/readme.md create mode 100644 node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/strip-ansi/index.js create mode 100644 node_modules/strip-ansi/license create mode 100644 node_modules/strip-ansi/package.json create mode 100644 node_modules/strip-ansi/readme.md create mode 100644 node_modules/strip-final-newline/index.d.ts create mode 100644 node_modules/strip-final-newline/index.js create mode 100644 node_modules/strip-final-newline/license create mode 100644 node_modules/strip-final-newline/package.json create mode 100644 node_modules/strip-final-newline/readme.md create mode 100644 node_modules/supports-color/browser.js create mode 100644 node_modules/supports-color/index.js create mode 100644 node_modules/supports-color/license create mode 100644 node_modules/supports-color/package.json create mode 100644 node_modules/supports-color/readme.md create mode 100644 node_modules/table-layout/LICENSE create mode 100644 node_modules/table-layout/README.hbs create mode 100644 node_modules/table-layout/README.md create mode 100644 node_modules/table-layout/index.js create mode 100644 node_modules/table-layout/lib/ansi.js create mode 100644 node_modules/table-layout/lib/cell.js create mode 100644 node_modules/table-layout/lib/column.js create mode 100644 node_modules/table-layout/lib/columns.js create mode 100644 node_modules/table-layout/lib/padding.js create mode 100644 node_modules/table-layout/lib/rows.js create mode 100644 node_modules/table-layout/package.json create mode 100644 node_modules/typical/LICENSE create mode 100644 node_modules/typical/README.hbs create mode 100644 node_modules/typical/README.md create mode 100644 node_modules/typical/dist/index.js create mode 100644 node_modules/typical/index.mjs create mode 100644 node_modules/typical/package.json create mode 100644 node_modules/unicorn-magic/default.d.ts create mode 100644 node_modules/unicorn-magic/default.js create mode 100644 node_modules/unicorn-magic/license create mode 100644 node_modules/unicorn-magic/node.d.ts create mode 100644 node_modules/unicorn-magic/node.js create mode 100644 node_modules/unicorn-magic/package.json create mode 100644 node_modules/unicorn-magic/readme.md create mode 100644 node_modules/which/CHANGELOG.md create mode 100644 node_modules/which/LICENSE create mode 100644 node_modules/which/README.md create mode 100644 node_modules/which/bin/node-which create mode 100644 node_modules/which/package.json create mode 100644 node_modules/which/which.js create mode 100644 node_modules/wordwrapjs/LICENSE create mode 100644 node_modules/wordwrapjs/README.hbs create mode 100644 node_modules/wordwrapjs/README.md create mode 100644 node_modules/wordwrapjs/index.js create mode 100644 node_modules/wordwrapjs/package.json create mode 100644 node_modules/wrap-ansi/index.d.ts create mode 100644 node_modules/wrap-ansi/index.js create mode 100644 node_modules/wrap-ansi/license create mode 100644 node_modules/wrap-ansi/node_modules/ansi-styles/index.d.ts create mode 100644 node_modules/wrap-ansi/node_modules/ansi-styles/index.js create mode 100644 node_modules/wrap-ansi/node_modules/ansi-styles/license create mode 100644 node_modules/wrap-ansi/node_modules/ansi-styles/package.json create mode 100644 node_modules/wrap-ansi/node_modules/ansi-styles/readme.md create mode 100644 node_modules/wrap-ansi/package.json create mode 100644 node_modules/wrap-ansi/readme.md create mode 100644 node_modules/yoctocolors/base.d.ts create mode 100644 node_modules/yoctocolors/base.js create mode 100644 node_modules/yoctocolors/index.d.ts create mode 100644 node_modules/yoctocolors/index.js create mode 100644 node_modules/yoctocolors/license create mode 100644 node_modules/yoctocolors/package.json create mode 100644 node_modules/yoctocolors/readme.md create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 test.js diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9571f6f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM golang:alpine AS builder + +LABEL stage=gobuilder + +ENV CGO_ENABLED 0 + + +RUN apk update --no-cache && apk add --no-cache tzdata + +WORKDIR /build + +ADD go.mod . +ADD go.sum . +RUN go mod download +COPY . . + +RUN go build -ldflags="-s -w" -o /app/user app/user/api/user.go + + +FROM scratch + +COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/Shanghai +ENV TZ Asia/Shanghai + +WORKDIR /app +COPY --from=builder /app/user /app/user +COPY app/user/api/etc /app/etc + +CMD ["./user", "-f", "etc/user-api.yaml"] diff --git a/Herebyfile.mjs b/Herebyfile.mjs new file mode 100644 index 0000000..526694b --- /dev/null +++ b/Herebyfile.mjs @@ -0,0 +1,183 @@ +import { search } from "@inquirer/prompts"; +import { execa } from "execa"; +import Fuse from "fuse.js"; +import { glob } from "glob"; +import { task } from "hereby"; +import path from "node:path"; +import fs from "node:fs/promises"; +import { fileURLToPath } from "node:url"; +import { parseArgs } from "node:util"; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +const { values } = parseArgs({ + args: process.argv.slice(3), + options: { + server: { type: "string", short: "s", multiple: true }, + type: { type: "string", short: "t" }, + } +}) + + +const Paths = { + root: __dirname, + desc: path.join(__dirname, "desc"), + app: path.join(__dirname, "app"), + getServiceName: (filePath) => path.basename(filePath, path.extname(filePath)), + getOutputDir: (serviceName) => path.join(__dirname, "app", serviceName), + pathlistToChoices: (filePaths) => filePaths.map(filePath => ({ + title: Paths.getServiceName(filePath), + value: filePath, + })), + getDescFiles: async (pattern) => { + return await glob(pattern, { cwd: Paths.desc, absolute: true }); + }, + getAllApi: async () => { + const apiPattern = "api/*.api"; + return Paths.pathlistToChoices(await Paths.getDescFiles(apiPattern)); + }, + getAllProto: async () => { + const protoPattern = "rpc/*.proto"; + return Paths.pathlistToChoices(await Paths.getDescFiles(protoPattern)); + }, + getAllservice: async () => { + let all = []; + const services = await fs.readdir(Paths.app); + for (const service of services) { + const servicePath = path.join(Paths.app, service); + const svcTypes = await fs.readdir(servicePath); + svcTypes.map(svcType => all.push({ + title: `${service} - ${svcType}`, + value: path.join(servicePath, svcType, svcType === "api" ? `${service}.go` : "pb.go"), + })); + } + return all; + }, +} + + +const Generators = { + async api(apiFile) { + const serviceName = Paths.getServiceName(apiFile); + const outputDir = path.join(Paths.getOutputDir(serviceName), 'api'); + + await fs.mkdir(outputDir, { recursive: true }); + await run('goctl', [ + 'api', 'go', + '--api', apiFile, + '--dir', outputDir, + '--style', 'goZero' + ]); + }, + async rpc(protoFile) { + const serviceName = Paths.getServiceName(protoFile); + const outputDir = path.join(Paths.getOutputDir(serviceName), 'rpc'); + + await fs.mkdir(outputDir, { recursive: true }); + await run('goctl', [ + 'rpc', 'protoc', protoFile, + `--proto_path=${path.join(Paths.desc, "rpc",)}`, + `--go_out=${outputDir}`, + `--go-grpc_out=${outputDir}`, + `--zrpc_out=${outputDir}`, + '--style=goZero', + ]); + }, + async docker(servicePath) { + const dockerFiles = await glob("DockerFile", { cwd: __dirname, absolute: true }); + if (dockerFiles.length !== 0) { + fs.rm(dockerFiles[0], { force: true }); + } + await run('goctl', [ + "docker", "--go", path.relative(__dirname, servicePath) + ]) + } +}; + + +const GenerateConfig = { + api: { + getChoices: () => Paths.getAllApi(), + prompt: "Select an API description file", + generate: (path) => Generators.api(path), + }, + rpc: { + getChoices: () => Paths.getAllProto(), + prompt: "Select a proto file", + generate: (path) => Generators.rpc(path), + }, + docker: { + getChoices: () => Paths.getAllservice(), + prompt: "Select a service to generate Dockerfile", + generate: (path) => Generators.docker(path), + } +}; + + + +async function run(cmd, args, opts = {}) { + console.log(`>> ${cmd} ${args.join(' ')}`); + return execa(cmd, args, { + stdio: 'inherit', + ...opts + }); +} + + +async function searchSelector(chooses, message) { + const fuse = new Fuse(chooses, { + keys: ['title'], + threshold: 0.4, + }) + return search({ + message, + source: async (term) => { + if (!term) { + return chooses.map(s => ({ name: s.title, value: s.value })); + } + const result = fuse.search(term); + return result.map(s => ({ name: s.item.title, value: s.item.value })); + } + }) +} + + +async function generateHandle() { + const type = values.type; + if (!type || !GenerateConfig[type]) { + console.log("Please specify valid -t "); + return; + } + const config = GenerateConfig[type]; + + const input = values.server + ? (Array.isArray(values.server) ? values.server[0] : values.server) + : await searchSelector(await config.getChoices(), config.prompt); + + await config.generate(input); +} + + +export const init = task({ + name: "init", + desc: "initialize the project", + run: async () => { + await run("go", ["install", "github.com/zeromicro/go-zero/tools/goctl@latest"]); + } +}) + + +export const tidy = task({ + name: "tidy", + desc: "tidy go.mod and go.sum", + run: async () => { run("go", ["mod", "tidy"]) }, +}) + + +export const gen = task({ + name: "gen", + desc: "generate API/RPC service code", + run: generateHandle, +}); + + diff --git a/app/user/api/etc/user-api.yaml b/app/user/api/etc/user-api.yaml new file mode 100644 index 0000000..c208de4 --- /dev/null +++ b/app/user/api/etc/user-api.yaml @@ -0,0 +1,6 @@ +Name: user-api +Host: 0.0.0.0 +Port: 8888 + +UsercenterRpcConf: + Target: k8s://juwan/user-rpc-svc:9001 diff --git a/app/user/api/internal/config/config.go b/app/user/api/internal/config/config.go new file mode 100644 index 0000000..33dfe0b --- /dev/null +++ b/app/user/api/internal/config/config.go @@ -0,0 +1,14 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.9.2 + +package config + +import ( + "github.com/zeromicro/go-zero/rest" + "github.com/zeromicro/go-zero/zrpc" +) + +type Config struct { + rest.RestConf + UsercenterRpcConf zrpc.RpcClientConf +} diff --git a/app/user/api/internal/handler/routes.go b/app/user/api/internal/handler/routes.go new file mode 100644 index 0000000..a6b807a --- /dev/null +++ b/app/user/api/internal/handler/routes.go @@ -0,0 +1,25 @@ +// Code generated by goctl. DO NOT EDIT. +// goctl 1.9.2 + +package handler + +import ( + "net/http" + + "juwan-backend/app/user/api/internal/svc" + + "github.com/zeromicro/go-zero/rest" +) + +func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { + server.AddRoutes( + []rest.Route{ + { + // Get user infomaction by user id + Method: http.MethodPost, + Path: "/user/info", + Handler: userInfoHandler(serverCtx), + }, + }, + ) +} diff --git a/app/user/api/internal/handler/userInfoHandler.go b/app/user/api/internal/handler/userInfoHandler.go new file mode 100644 index 0000000..a0603d7 --- /dev/null +++ b/app/user/api/internal/handler/userInfoHandler.go @@ -0,0 +1,32 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.9.2 + +package handler + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "juwan-backend/app/user/api/internal/logic" + "juwan-backend/app/user/api/internal/svc" + "juwan-backend/app/user/api/internal/types" +) + +// Get user infomaction by user id +func userInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UserInfoReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := logic.NewUserInfoLogic(r.Context(), svcCtx) + resp, err := l.UserInfo(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/app/user/api/internal/logic/userInfoLogic.go b/app/user/api/internal/logic/userInfoLogic.go new file mode 100644 index 0000000..5a3e5ce --- /dev/null +++ b/app/user/api/internal/logic/userInfoLogic.go @@ -0,0 +1,43 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.9.2 + +package logic + +import ( + "context" + + "juwan-backend/app/user/api/internal/svc" + "juwan-backend/app/user/api/internal/types" + "juwan-backend/app/user/rpc/usercenter" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UserInfoLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +// Get user infomaction by user id +func NewUserInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserInfoLogic { + return &UserInfoLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *UserInfoLogic) UserInfo(req *types.UserInfoReq) (resp *types.UserInfoResp, err error) { + logx.Infof("Request user info, user id: %d", req.UserId) + res, err := l.svcCtx.Usercenter.GetUserInfo(l.ctx, &usercenter.GetUserInfoReq{ + Id: req.UserId, + }) + if err != nil { + return nil, err + } + return &types.UserInfoResp{ + UserId: res.Id, + Nickname: res.Nickname, + }, nil +} diff --git a/app/user/api/internal/svc/serviceContext.go b/app/user/api/internal/svc/serviceContext.go new file mode 100644 index 0000000..0f28d14 --- /dev/null +++ b/app/user/api/internal/svc/serviceContext.go @@ -0,0 +1,23 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.9.2 + +package svc + +import ( + "juwan-backend/app/user/api/internal/config" + "juwan-backend/app/user/rpc/usercenter" + + "github.com/zeromicro/go-zero/zrpc" +) + +type ServiceContext struct { + Config config.Config + Usercenter usercenter.Usercenter +} + +func NewServiceContext(c config.Config) *ServiceContext { + return &ServiceContext{ + Config: c, + Usercenter: usercenter.NewUsercenter(zrpc.MustNewClient(c.UsercenterRpcConf)), + } +} diff --git a/app/user/api/internal/types/types.go b/app/user/api/internal/types/types.go new file mode 100644 index 0000000..043a1f8 --- /dev/null +++ b/app/user/api/internal/types/types.go @@ -0,0 +1,13 @@ +// Code generated by goctl. DO NOT EDIT. +// goctl 1.9.2 + +package types + +type UserInfoReq struct { + UserId int64 `json:"userId"` +} + +type UserInfoResp struct { + UserId int64 `json:"userId"` + Nickname string `json:"nickname"` +} diff --git a/app/user/api/user.go b/app/user/api/user.go new file mode 100644 index 0000000..d618a53 --- /dev/null +++ b/app/user/api/user.go @@ -0,0 +1,34 @@ +// Code scaffolded by goctl. Safe to edit. +// goctl 1.9.2 + +package main + +import ( + "flag" + "fmt" + + "juwan-backend/app/user/api/internal/config" + "juwan-backend/app/user/api/internal/handler" + "juwan-backend/app/user/api/internal/svc" + + "github.com/zeromicro/go-zero/core/conf" + "github.com/zeromicro/go-zero/rest" +) + +var configFile = flag.String("f", "etc/user-api.yaml", "the config file") + +func main() { + flag.Parse() + + var c config.Config + conf.MustLoad(*configFile, &c) + + server := rest.MustNewServer(c.RestConf) + defer server.Stop() + + ctx := svc.NewServiceContext(c) + handler.RegisterHandlers(server, ctx) + + fmt.Printf("Starting server at %s:%d...\n", c.Host, c.Port) + server.Start() +} diff --git a/app/user/rpc/etc/pb.yaml b/app/user/rpc/etc/pb.yaml new file mode 100644 index 0000000..de73da4 --- /dev/null +++ b/app/user/rpc/etc/pb.yaml @@ -0,0 +1,6 @@ +Name: pb.rpc +ListenOn: 0.0.0.0:9001 + +# UserDB: "${DB_URI}?sslmode=disable" +DB: + UserDB: "${DB_URI}?sslmode=disable" diff --git a/app/user/rpc/internal/config/config.go b/app/user/rpc/internal/config/config.go new file mode 100644 index 0000000..98e5d8d --- /dev/null +++ b/app/user/rpc/internal/config/config.go @@ -0,0 +1,10 @@ +package config + +import "github.com/zeromicro/go-zero/zrpc" + +type Config struct { + zrpc.RpcServerConf + DB struct { + UserDB string + } +} diff --git a/app/user/rpc/internal/logic/getUserInfoLogic.go b/app/user/rpc/internal/logic/getUserInfoLogic.go new file mode 100644 index 0000000..ac4144f --- /dev/null +++ b/app/user/rpc/internal/logic/getUserInfoLogic.go @@ -0,0 +1,41 @@ +package logic + +import ( + "context" + + "juwan-backend/app/user/rpc/internal/svc" + "juwan-backend/app/user/rpc/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetUserInfoLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetUserInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserInfoLogic { + return &GetUserInfoLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *GetUserInfoLogic) GetUserInfo(in *pb.GetUserInfoReq) (*pb.GetUserInfoResp, error) { + users := map[int64]string{ + 1: "WangHuahua", + 2: "LiKunkun", + } + + nikename := "Unknow" + if name, ok := users[in.Id]; ok { + nikename = name + } + + return &pb.GetUserInfoResp{ + Id: in.Id, + Nickname: nikename, + }, nil +} diff --git a/app/user/rpc/internal/server/usercenterServer.go b/app/user/rpc/internal/server/usercenterServer.go new file mode 100644 index 0000000..5cdf98c --- /dev/null +++ b/app/user/rpc/internal/server/usercenterServer.go @@ -0,0 +1,29 @@ +// Code generated by goctl. DO NOT EDIT. +// goctl 1.9.2 +// Source: user.proto + +package server + +import ( + "context" + + "juwan-backend/app/user/rpc/internal/logic" + "juwan-backend/app/user/rpc/internal/svc" + "juwan-backend/app/user/rpc/pb" +) + +type UsercenterServer struct { + svcCtx *svc.ServiceContext + pb.UnimplementedUsercenterServer +} + +func NewUsercenterServer(svcCtx *svc.ServiceContext) *UsercenterServer { + return &UsercenterServer{ + svcCtx: svcCtx, + } +} + +func (s *UsercenterServer) GetUserInfo(ctx context.Context, in *pb.GetUserInfoReq) (*pb.GetUserInfoResp, error) { + l := logic.NewGetUserInfoLogic(ctx, s.svcCtx) + return l.GetUserInfo(in) +} diff --git a/app/user/rpc/internal/svc/serviceContext.go b/app/user/rpc/internal/svc/serviceContext.go new file mode 100644 index 0000000..3b889b6 --- /dev/null +++ b/app/user/rpc/internal/svc/serviceContext.go @@ -0,0 +1,13 @@ +package svc + +import "juwan-backend/app/user/rpc/internal/config" + +type ServiceContext struct { + Config config.Config +} + +func NewServiceContext(c config.Config) *ServiceContext { + return &ServiceContext{ + Config: c, + } +} diff --git a/app/user/rpc/pb.go b/app/user/rpc/pb.go new file mode 100644 index 0000000..c4bc5eb --- /dev/null +++ b/app/user/rpc/pb.go @@ -0,0 +1,39 @@ +package main + +import ( + "flag" + "fmt" + + "juwan-backend/app/user/rpc/internal/config" + "juwan-backend/app/user/rpc/internal/server" + "juwan-backend/app/user/rpc/internal/svc" + "juwan-backend/app/user/rpc/pb" + + "github.com/zeromicro/go-zero/core/conf" + "github.com/zeromicro/go-zero/core/service" + "github.com/zeromicro/go-zero/zrpc" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" +) + +var configFile = flag.String("f", "etc/pb.yaml", "the config file") + +func main() { + flag.Parse() + + var c config.Config + conf.MustLoad(*configFile, &c) + ctx := svc.NewServiceContext(c) + + s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { + pb.RegisterUsercenterServer(grpcServer, server.NewUsercenterServer(ctx)) + + if c.Mode == service.DevMode || c.Mode == service.TestMode { + reflection.Register(grpcServer) + } + }) + defer s.Stop() + + fmt.Printf("Starting rpc server at %s...\n", c.ListenOn) + s.Start() +} diff --git a/app/user/rpc/pb/user.pb.go b/app/user/rpc/pb/user.pb.go new file mode 100644 index 0000000..bb5eedf --- /dev/null +++ b/app/user/rpc/pb/user.pb.go @@ -0,0 +1,184 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.9 +// protoc v6.32.0 +// source: user.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GetUserInfoReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetUserInfoReq) Reset() { + *x = GetUserInfoReq{} + mi := &file_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetUserInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserInfoReq) ProtoMessage() {} + +func (x *GetUserInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserInfoReq.ProtoReflect.Descriptor instead. +func (*GetUserInfoReq) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{0} +} + +func (x *GetUserInfoReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type GetUserInfoResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetUserInfoResp) Reset() { + *x = GetUserInfoResp{} + mi := &file_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetUserInfoResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserInfoResp) ProtoMessage() {} + +func (x *GetUserInfoResp) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserInfoResp.ProtoReflect.Descriptor instead. +func (*GetUserInfoResp) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{1} +} + +func (x *GetUserInfoResp) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *GetUserInfoResp) GetNickname() string { + if x != nil { + return x.Nickname + } + return "" +} + +var File_user_proto protoreflect.FileDescriptor + +const file_user_proto_rawDesc = "" + + "\n" + + "\n" + + "user.proto\x12\x02pb\" \n" + + "\x0eGetUserInfoReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"=\n" + + "\x0fGetUserInfoResp\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" + + "\bnickname\x18\x02 \x01(\tR\bnickname2D\n" + + "\n" + + "Usercenter\x126\n" + + "\vGetUserInfo\x12\x12.pb.GetUserInfoReq\x1a\x13.pb.GetUserInfoRespB\x06Z\x04./pbb\x06proto3" + +var ( + file_user_proto_rawDescOnce sync.Once + file_user_proto_rawDescData []byte +) + +func file_user_proto_rawDescGZIP() []byte { + file_user_proto_rawDescOnce.Do(func() { + file_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_user_proto_rawDesc), len(file_user_proto_rawDesc))) + }) + return file_user_proto_rawDescData +} + +var file_user_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_user_proto_goTypes = []any{ + (*GetUserInfoReq)(nil), // 0: pb.GetUserInfoReq + (*GetUserInfoResp)(nil), // 1: pb.GetUserInfoResp +} +var file_user_proto_depIdxs = []int32{ + 0, // 0: pb.Usercenter.GetUserInfo:input_type -> pb.GetUserInfoReq + 1, // 1: pb.Usercenter.GetUserInfo:output_type -> pb.GetUserInfoResp + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_user_proto_init() } +func file_user_proto_init() { + if File_user_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_user_proto_rawDesc), len(file_user_proto_rawDesc)), + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_user_proto_goTypes, + DependencyIndexes: file_user_proto_depIdxs, + MessageInfos: file_user_proto_msgTypes, + }.Build() + File_user_proto = out.File + file_user_proto_goTypes = nil + file_user_proto_depIdxs = nil +} diff --git a/app/user/rpc/pb/user_grpc.pb.go b/app/user/rpc/pb/user_grpc.pb.go new file mode 100644 index 0000000..bd44062 --- /dev/null +++ b/app/user/rpc/pb/user_grpc.pb.go @@ -0,0 +1,121 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v6.32.0 +// source: user.proto + +package pb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Usercenter_GetUserInfo_FullMethodName = "/pb.Usercenter/GetUserInfo" +) + +// UsercenterClient is the client API for Usercenter service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type UsercenterClient interface { + GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) +} + +type usercenterClient struct { + cc grpc.ClientConnInterface +} + +func NewUsercenterClient(cc grpc.ClientConnInterface) UsercenterClient { + return &usercenterClient{cc} +} + +func (c *usercenterClient) GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetUserInfoResp) + err := c.cc.Invoke(ctx, Usercenter_GetUserInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UsercenterServer is the server API for Usercenter service. +// All implementations must embed UnimplementedUsercenterServer +// for forward compatibility. +type UsercenterServer interface { + GetUserInfo(context.Context, *GetUserInfoReq) (*GetUserInfoResp, error) + mustEmbedUnimplementedUsercenterServer() +} + +// UnimplementedUsercenterServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedUsercenterServer struct{} + +func (UnimplementedUsercenterServer) GetUserInfo(context.Context, *GetUserInfoReq) (*GetUserInfoResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserInfo not implemented") +} +func (UnimplementedUsercenterServer) mustEmbedUnimplementedUsercenterServer() {} +func (UnimplementedUsercenterServer) testEmbeddedByValue() {} + +// UnsafeUsercenterServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UsercenterServer will +// result in compilation errors. +type UnsafeUsercenterServer interface { + mustEmbedUnimplementedUsercenterServer() +} + +func RegisterUsercenterServer(s grpc.ServiceRegistrar, srv UsercenterServer) { + // If the following call pancis, it indicates UnimplementedUsercenterServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Usercenter_ServiceDesc, srv) +} + +func _Usercenter_GetUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsercenterServer).GetUserInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Usercenter_GetUserInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsercenterServer).GetUserInfo(ctx, req.(*GetUserInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +// Usercenter_ServiceDesc is the grpc.ServiceDesc for Usercenter service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Usercenter_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pb.Usercenter", + HandlerType: (*UsercenterServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetUserInfo", + Handler: _Usercenter_GetUserInfo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "user.proto", +} diff --git a/app/user/rpc/usercenter/usercenter.go b/app/user/rpc/usercenter/usercenter.go new file mode 100644 index 0000000..9159075 --- /dev/null +++ b/app/user/rpc/usercenter/usercenter.go @@ -0,0 +1,38 @@ +// Code generated by goctl. DO NOT EDIT. +// goctl 1.9.2 +// Source: user.proto + +package usercenter + +import ( + "context" + + "juwan-backend/app/user/rpc/pb" + + "github.com/zeromicro/go-zero/zrpc" + "google.golang.org/grpc" +) + +type ( + GetUserInfoReq = pb.GetUserInfoReq + GetUserInfoResp = pb.GetUserInfoResp + + Usercenter interface { + GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) + } + + defaultUsercenter struct { + cli zrpc.Client + } +) + +func NewUsercenter(cli zrpc.Client) Usercenter { + return &defaultUsercenter{ + cli: cli, + } +} + +func (m *defaultUsercenter) GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) { + client := pb.NewUsercenterClient(m.cli.Conn()) + return client.GetUserInfo(ctx, in, opts...) +} diff --git a/deploy/k8s/base/pg-dx-configmap.yaml b/deploy/k8s/base/pg-dx-configmap.yaml new file mode 100644 index 0000000..807df03 --- /dev/null +++ b/deploy/k8s/base/pg-dx-configmap.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: db-dx-init-script + namespace: juwan + labels: + app: db-dx-init-script +data: + init-extensions-sql: | + create extension if not exists "uuid-ossp"; + create extension if not exists "pg_trgm"; diff --git a/deploy/k8s/base/postgreSql.yaml b/deploy/k8s/base/postgreSql.yaml new file mode 100644 index 0000000..7db9703 --- /dev/null +++ b/deploy/k8s/base/postgreSql.yaml @@ -0,0 +1,22 @@ +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster +metadata: + namespace: juwan + name: cluster-example +spec: + instances: 3 + backup: + barmanObjectStore: + destinationPath: s3://juwan-dev-pg-backups-zj/pg-data/ + endpointURL: https://cn-nb1.rains3.com + s3Credentials: + accessKeyId: + name: rc-creds + key: SOucqRaJr4OyfcIu + secretAccessKey: + name: rc-creds + key: tn2Agj9EowMwuPA9y7TdSL0AXKsMEz + wal: + compression: gzip + storage: + size: 1Gi diff --git a/deploy/k8s/base/service-discovery.yaml b/deploy/k8s/base/service-discovery.yaml new file mode 100644 index 0000000..76800d2 --- /dev/null +++ b/deploy/k8s/base/service-discovery.yaml @@ -0,0 +1,38 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: juwan + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + namespace: juwan + name: find-endpoints + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: discov-endpoints +rules: + - apiGroups: [""] + resources: ["endpoints"] + verbs: ["get", "list", "watch"] + - apiGroups: ["discovery.k8s.io"] + resources: ["endpointslices"] + verbs: ["get", "list", "watch"] + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: find-endpoints-discov-endpoints +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: discov-endpoints +subjects: + - kind: ServiceAccount + name: find-endpoints + namespace: juwan diff --git a/deploy/k8s/user-api.yaml b/deploy/k8s/user-api.yaml new file mode 100644 index 0000000..e4daa78 --- /dev/null +++ b/deploy/k8s/user-api.yaml @@ -0,0 +1,110 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: user-api + namespace: juwan + labels: + app: user-api +spec: + replicas: 3 + revisionHistoryLimit: 5 + selector: + matchLabels: + app: user-api + template: + metadata: + labels: + app: user-api + spec: + serviceAccountName: find-endpoints + containers: + - name: user-api + image: user-api:v1 + ports: + - containerPort: 8888 + readinessProbe: + tcpSocket: + port: 8888 + initialDelaySeconds: 5 + periodSeconds: 10 + livenessProbe: + tcpSocket: + port: 8888 + initialDelaySeconds: 15 + periodSeconds: 20 + resources: + requests: + cpu: 500m + memory: 512Mi + limits: + cpu: 1000m + memory: 1024Mi + volumeMounts: + - name: timezone + mountPath: /etc/localtime + volumes: + - name: timezone + hostPath: + path: /usr/share/zoneinfo/Asia/Shanghai + +--- + +apiVersion: v1 +kind: Service +metadata: + name: user-api-svc + namespace: juwan +spec: + ports: + - port: 8888 + targetPort: 8888 + selector: + app: user-api + +--- + +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: user-api-hpa-c + namespace: juwan + labels: + app: user-api-hpa-c +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: user-api + minReplicas: 3 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 + +--- + +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: user-api-hpa-m + namespace: juwan + labels: + app: user-api-hpa-m +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: user-api + minReplicas: 3 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: 80 diff --git a/deploy/k8s/user-rpc.yaml b/deploy/k8s/user-rpc.yaml new file mode 100644 index 0000000..fb47d5a --- /dev/null +++ b/deploy/k8s/user-rpc.yaml @@ -0,0 +1,153 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: user-rpc + namespace: juwan + labels: + app: user-rpc +spec: + replicas: 3 + revisionHistoryLimit: 5 + selector: + matchLabels: + app: user-rpc + template: + metadata: + labels: + app: user-rpc + spec: + serviceAccountName: find-endpoints + initContainers: + - name: wait-for-db + image: busybox:1.36 + command: + [ + "sh", + "-c", + 'until nc -z -v -w5 user-db-rw 5432; do echo "Waiting for database..."; sleep 2; done;', + ] + containers: + - name: user-rpc + image: user-rpc:v1 + ports: + - containerPort: 9001 + env: + - name: DB_URI + valueFrom: + secretKeyRef: + name: user-db-app + key: uri + readinessProbe: + tcpSocket: + port: 9001 + initialDelaySeconds: 5 + periodSeconds: 10 + livenessProbe: + tcpSocket: + port: 9001 + initialDelaySeconds: 15 + periodSeconds: 20 + resources: + requests: + cpu: 500m + memory: 512Mi + limits: + cpu: 1000m + memory: 1024Mi + volumeMounts: + - name: timezone + mountPath: /etc/localtime + volumes: + - name: timezone + hostPath: + path: /usr/share/zoneinfo/Asia/Shanghai + +--- +apiVersion: v1 +kind: Service +metadata: + name: user-rpc-svc + namespace: juwan +spec: + ports: + - port: 9001 + targetPort: 9001 + selector: + app: user-rpc + +--- +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: user-rpc-hpa-c + namespace: juwan + labels: + app: user-rpc-hpa-c +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: user-rpc + minReplicas: 3 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 + +--- +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: user-rpc-hpa-m + namespace: juwan + labels: + app: user-rpc-hpa-m +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: user-rpc + minReplicas: 3 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: 80 + +--- +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster +metadata: + namespace: juwan + name: user-db +spec: + instances: 3 + postInitSQLRefs: + configMapRefs: + - name: db-dx-init-script + key: init-extensions-sql + optional: false + backup: + barmanObjectStore: + destinationPath: s3://juwan-dev-pg-backups-zj/pg-data/ + endpointURL: https://cn-nb1.rains3.com + s3Credentials: + accessKeyId: + name: rc-creds + key: SOucqRaJr4OyfcIu + secretAccessKey: + name: rc-creds + key: tn2Agj9EowMwuPA9y7TdSL0AXKsMEz + wal: + compression: gzip + storage: + size: 1Gi + monitoring: + enablePodMonitor: true diff --git a/desc/api/order.api b/desc/api/order.api new file mode 100644 index 0000000..e69de29 diff --git a/desc/api/user.api b/desc/api/user.api new file mode 100644 index 0000000..91de8b7 --- /dev/null +++ b/desc/api/user.api @@ -0,0 +1,26 @@ +syntax = "v1" + +info ( + author: "Asadz" + date: "2024-06-19" + version: "1.0" +) + +type ( + UserInfoReq { + UserId int64 `json:"userId"` + } + UserInfoResp { + UserId int64 `json:"userId"` + Nickname string `json:"nickname"` + } +) + +service user-api { + @doc ( + summary: "Get user infomaction by user id" + ) + @handler userInfo + post /user/info (UserInfoReq) returns (UserInfoResp) +} + diff --git a/desc/rpc/user.proto b/desc/rpc/user.proto new file mode 100644 index 0000000..a8973ac --- /dev/null +++ b/desc/rpc/user.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +option go_package = "./pb"; + +package pb; + +message GetUserInfoReq { + int64 id = 1; +} + +message GetUserInfoResp { + int64 id = 1; + string nickname = 2; +} + +service Usercenter { + rpc GetUserInfo(GetUserInfoReq) returns (GetUserInfoResp); +} \ No newline at end of file diff --git a/desc/sql/users.sql b/desc/sql/users.sql new file mode 100644 index 0000000..d7a4226 --- /dev/null +++ b/desc/sql/users.sql @@ -0,0 +1,13 @@ +create extension if not exists "uuid-ossp"; +create extension if not exists "pg_trgm"; + +CREATE TABLE users ( + user_id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + username VARCHAR(50) UNIQUE NOT NULL, + passwd VARCHAR(255) NOT NULL, + nikename VARCHAR(50) NOT NULL, + phone VARCHAR(20) UNIQUE NOT NULL, + role_type SMALLINT NOT NULL, -- 1:玩家, 2:打手, 3:店长 + is_verified BOOLEAN DEFAULT false, + created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP +); \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..9183c94 --- /dev/null +++ b/go.mod @@ -0,0 +1,93 @@ +module juwan-backend + +go 1.25.1 + +require ( + github.com/zeromicro/go-zero v1.10.0 + google.golang.org/grpc v1.79.1 + google.golang.org/protobuf v1.36.11 +) + +require ( + github.com/beorn7/perks v1.0.1 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/coreos/go-semver v0.3.1 // indirect + github.com/coreos/go-systemd/v22 v22.5.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/fatih/color v1.18.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.22.4 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt/v4 v4.5.2 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/google/gofuzz v1.2.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/grafana/pyroscope-go v1.2.7 // indirect + github.com/grafana/pyroscope-go/godeltaprof v0.1.9 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.18.0 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/openzipkin/zipkin-go v0.4.3 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/prometheus/client_golang v1.23.2 // indirect + github.com/prometheus/client_model v0.6.2 // indirect + github.com/prometheus/common v0.66.1 // indirect + github.com/prometheus/procfs v0.16.1 // indirect + github.com/redis/go-redis/v9 v9.17.3 // indirect + github.com/spaolacci/murmur3 v1.1.0 // indirect + go.etcd.io/etcd/api/v3 v3.5.15 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.15 // indirect + go.etcd.io/etcd/client/v3 v3.5.15 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0 // indirect + go.opentelemetry.io/otel/exporters/zipkin v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.39.0 // indirect + go.opentelemetry.io/otel/sdk v1.39.0 // indirect + go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/proto/otlp v1.3.1 // indirect + go.uber.org/atomic v1.10.0 // indirect + go.uber.org/automaxprocs v1.6.0 // indirect + go.uber.org/mock v0.6.0 // indirect + go.uber.org/multierr v1.9.0 // indirect + go.uber.org/zap v1.24.0 // indirect + go.yaml.in/yaml/v2 v2.4.2 // indirect + golang.org/x/net v0.48.0 // indirect + golang.org/x/oauth2 v0.34.0 // indirect + golang.org/x/sys v0.39.0 // indirect + golang.org/x/term v0.38.0 // indirect + golang.org/x/text v0.32.0 // indirect + golang.org/x/time v0.10.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/api v0.29.3 // indirect + k8s.io/apimachinery v0.29.4 // indirect + k8s.io/client-go v0.29.3 // indirect + k8s.io/klog/v2 v2.110.1 // indirect + k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect + k8s.io/utils v0.0.0-20251222233032-718f0e51e6d2 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..8046f95 --- /dev/null +++ b/go.sum @@ -0,0 +1,274 @@ +github.com/alicebob/miniredis/v2 v2.36.1 h1:Dvc5oAnNOr7BIfPn7tF269U8DvRW1dBG2D5n0WrfYMI= +github.com/alicebob/miniredis/v2 v2.36.1/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= +github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= +github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= +github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= +github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= +github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI= +github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grafana/pyroscope-go v1.2.7 h1:VWBBlqxjyR0Cwk2W6UrE8CdcdD80GOFNutj0Kb1T8ac= +github.com/grafana/pyroscope-go v1.2.7/go.mod h1:o/bpSLiJYYP6HQtvcoVKiE9s5RiNgjYTj1DhiddP2Pc= +github.com/grafana/pyroscope-go/godeltaprof v0.1.9 h1:c1Us8i6eSmkW+Ez05d3co8kasnuOY813tbMN8i/a3Og= +github.com/grafana/pyroscope-go/godeltaprof v0.1.9/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= +github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= +github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= +github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= +github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7sjsSdg= +github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= +github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= +github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= +github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= +github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= +github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= +github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs= +github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA= +github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg= +github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= +github.com/redis/go-redis/v9 v9.17.3 h1:fN29NdNrE17KttK5Ndf20buqfDZwGNgoUr9qjl1DQx4= +github.com/redis/go-redis/v9 v9.17.3/go.mod h1:u410H11HMLoB+TP67dz8rL9s6QW2j76l0//kSOd3370= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= +github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= +github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= +github.com/zeromicro/go-zero v1.10.0 h1:+qfAqj+BGt0qjW1PQk2VO5WLwIQBh60CA3OTLsBosS8= +github.com/zeromicro/go-zero v1.10.0/go.mod h1:qAModWGsfkrBl0JP9oS7K7k6dgucExOuQdpzHyXVKLg= +go.etcd.io/etcd/api/v3 v3.5.15 h1:3KpLJir1ZEBrYuV2v+Twaa/e2MdDCEZ/70H+lzEiwsk= +go.etcd.io/etcd/api/v3 v3.5.15/go.mod h1:N9EhGzXq58WuMllgH9ZvnEr7SI9pS0k0+DHZezGp7jM= +go.etcd.io/etcd/client/pkg/v3 v3.5.15 h1:fo0HpWz/KlHGMCC+YejpiCmyWDEuIpnTDzpJLB5fWlA= +go.etcd.io/etcd/client/pkg/v3 v3.5.15/go.mod h1:mXDI4NAOwEiszrHCb0aqfAYNCrZP4e9hRca3d1YK8EU= +go.etcd.io/etcd/client/v3 v3.5.15 h1:23M0eY4Fd/inNv1ZfU3AxrbbOdW79r9V9Rl62Nm6ip4= +go.etcd.io/etcd/client/v3 v3.5.15/go.mod h1:CLSJxrYjvLtHsrPKsy7LmZEE+DK2ktfd2bN4RhBMwlU= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 h1:Mw5xcxMwlqoJd97vwPxA8isEaIoxsta9/Q51+TTJLGE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0/go.mod h1:CQNu9bj7o7mC6U7+CA/schKEYakYXWr79ucDHTMGhCM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 h1:Xw8U6u2f8DK2XAkGRFV7BBLENgnTGX9i4rQRxJf+/vs= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0/go.mod h1:6KW1Fm6R/s6Z3PGXwSJN2K4eT6wQB3vXX6CVnYX9NmM= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0 h1:s0PHtIkN+3xrbDOpt2M8OTG92cWqUESvzh2MxiR5xY8= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0/go.mod h1:hZlFbDbRt++MMPCCfSJfmhkGIWnX1h3XjkfxZUjLrIA= +go.opentelemetry.io/otel/exporters/zipkin v1.24.0 h1:3evrL5poBuh1KF51D9gO/S+N/1msnm4DaBqs/rpXUqY= +go.opentelemetry.io/otel/exporters/zipkin v1.24.0/go.mod h1:0EHgD8R0+8yRhUYJOGR8Hfg2dpiJQxDOszd5smVO9wM= +go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= +go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= +go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= +go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= +go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= +go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= +go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y= +go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= +go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= +go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= +golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= +golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= +golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= +golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q= +golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU= +golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= +golang.org/x/time v0.10.0 h1:3usCWA8tQn0L8+hFJQNgzpWbd89begxN66o1Ojdn5L4= +golang.org/x/time v0.10.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ= +golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= +gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls= +google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= +google.golang.org/grpc v1.79.1 h1:zGhSi45ODB9/p3VAawt9a+O/MULLl9dpizzNNpq7flY= +google.golang.org/grpc v1.79.1/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= +gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +k8s.io/api v0.29.3 h1:2ORfZ7+bGC3YJqGpV0KSDDEVf8hdGQ6A03/50vj8pmw= +k8s.io/api v0.29.3/go.mod h1:y2yg2NTyHUUkIoTC+phinTnEa3KFM6RZ3szxt014a80= +k8s.io/apimachinery v0.29.4 h1:RaFdJiDmuKs/8cm1M6Dh1Kvyh59YQFDcFuFTSmXes6Q= +k8s.io/apimachinery v0.29.4/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y= +k8s.io/client-go v0.29.3 h1:R/zaZbEAxqComZ9FHeQwOh3Y1ZUs7FaHKZdQtIc2WZg= +k8s.io/client-go v0.29.3/go.mod h1:tkDisCvgPfiRpxGnOORfkljmS+UrW+WtXAy2fTvXJB0= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= +k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/utils v0.0.0-20251222233032-718f0e51e6d2 h1:OfgiEo21hGiwx1oJUU5MpEaeOEg6coWndBkZF/lkFuE= +k8s.io/utils v0.0.0-20251222233032-718f0e51e6d2/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/node_modules/.bin/hereby b/node_modules/.bin/hereby new file mode 100644 index 0000000..56956e7 --- /dev/null +++ b/node_modules/.bin/hereby @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../hereby/bin/hereby.js" "$@" +else + exec node "$basedir/../hereby/bin/hereby.js" "$@" +fi diff --git a/node_modules/.bin/hereby.cmd b/node_modules/.bin/hereby.cmd new file mode 100644 index 0000000..7e8044c --- /dev/null +++ b/node_modules/.bin/hereby.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\hereby\bin\hereby.js" %* diff --git a/node_modules/.bin/hereby.ps1 b/node_modules/.bin/hereby.ps1 new file mode 100644 index 0000000..b5b57a4 --- /dev/null +++ b/node_modules/.bin/hereby.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../hereby/bin/hereby.js" $args + } else { + & "$basedir/node$exe" "$basedir/../hereby/bin/hereby.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../hereby/bin/hereby.js" $args + } else { + & "node$exe" "$basedir/../hereby/bin/hereby.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/node-which b/node_modules/.bin/node-which new file mode 100644 index 0000000..b49b03f --- /dev/null +++ b/node_modules/.bin/node-which @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../which/bin/node-which" "$@" +else + exec node "$basedir/../which/bin/node-which" "$@" +fi diff --git a/node_modules/.bin/node-which.cmd b/node_modules/.bin/node-which.cmd new file mode 100644 index 0000000..7eeb316 --- /dev/null +++ b/node_modules/.bin/node-which.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\which\bin\node-which" %* diff --git a/node_modules/.bin/node-which.ps1 b/node_modules/.bin/node-which.ps1 new file mode 100644 index 0000000..cfb09e8 --- /dev/null +++ b/node_modules/.bin/node-which.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../which/bin/node-which" $args + } else { + & "$basedir/node$exe" "$basedir/../which/bin/node-which" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../which/bin/node-which" $args + } else { + & "node$exe" "$basedir/../which/bin/node-which" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..e5dde95 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,1126 @@ +{ + "name": "st-1-example", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@inquirer/ansi": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/ansi/-/ansi-2.0.3.tgz", + "integrity": "sha512-g44zhR3NIKVs0zUesa4iMzExmZpLUdTLRMCStqX3GE5NT6VkPcxQGJ+uC8tDgBUC/vB1rUhUd55cOf++4NZcmw==", + "license": "MIT", + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + } + }, + "node_modules/@inquirer/checkbox": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-5.0.4.tgz", + "integrity": "sha512-DrAMU3YBGMUAp6ArwTIp/25CNDtDbxk7UjIrrtM25JVVrlVYlVzHh5HR1BDFu9JMyUoZ4ZanzeaHqNDttf3gVg==", + "license": "MIT", + "dependencies": { + "@inquirer/ansi": "^2.0.3", + "@inquirer/core": "^11.1.1", + "@inquirer/figures": "^2.0.3", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/confirm": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-6.0.4.tgz", + "integrity": "sha512-WdaPe7foUnoGYvXzH4jp4wH/3l+dBhZ3uwhKjXjwdrq5tEIFaANxj6zrGHxLdsIA0yKM0kFPVcEalOZXBB5ISA==", + "license": "MIT", + "dependencies": { + "@inquirer/core": "^11.1.1", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/core": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-11.1.1.tgz", + "integrity": "sha512-hV9o15UxX46OyQAtaoMqAOxGR8RVl1aZtDx1jHbCtSJy1tBdTfKxLPKf7utsE4cRy4tcmCQ4+vdV+ca+oNxqNA==", + "license": "MIT", + "dependencies": { + "@inquirer/ansi": "^2.0.3", + "@inquirer/figures": "^2.0.3", + "@inquirer/type": "^4.0.3", + "cli-width": "^4.1.0", + "mute-stream": "^3.0.0", + "signal-exit": "^4.1.0", + "wrap-ansi": "^9.0.2" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/editor": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-5.0.4.tgz", + "integrity": "sha512-QI3Jfqcv6UO2/VJaEFONH8Im1ll++Xn/AJTBn9Xf+qx2M+H8KZAdQ5sAe2vtYlo+mLW+d7JaMJB4qWtK4BG3pw==", + "license": "MIT", + "dependencies": { + "@inquirer/core": "^11.1.1", + "@inquirer/external-editor": "^2.0.3", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/expand": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-5.0.4.tgz", + "integrity": "sha512-0I/16YwPPP0Co7a5MsomlZLpch48NzYfToyqYAOWtBmaXSB80RiNQ1J+0xx2eG+Wfxt0nHtpEWSRr6CzNVnOGg==", + "license": "MIT", + "dependencies": { + "@inquirer/core": "^11.1.1", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/external-editor": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-2.0.3.tgz", + "integrity": "sha512-LgyI7Agbda74/cL5MvA88iDpvdXI2KuMBCGRkbCl2Dg1vzHeOgs+s0SDcXV7b+WZJrv2+ERpWSM65Fpi9VfY3w==", + "license": "MIT", + "dependencies": { + "chardet": "^2.1.1", + "iconv-lite": "^0.7.2" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/figures": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-2.0.3.tgz", + "integrity": "sha512-y09iGt3JKoOCBQ3w4YrSJdokcD8ciSlMIWsD+auPu+OZpfxLuyz+gICAQ6GCBOmJJt4KEQGHuZSVff2jiNOy7g==", + "license": "MIT", + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + } + }, + "node_modules/@inquirer/input": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-5.0.4.tgz", + "integrity": "sha512-4B3s3jvTREDFvXWit92Yc6jF1RJMDy2VpSqKtm4We2oVU65YOh2szY5/G14h4fHlyQdpUmazU5MPCFZPRJ0AOw==", + "license": "MIT", + "dependencies": { + "@inquirer/core": "^11.1.1", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/number": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-4.0.4.tgz", + "integrity": "sha512-CmMp9LF5HwE+G/xWsC333TlCzYYbXMkcADkKzcawh49fg2a1ryLc7JL1NJYYt1lJ+8f4slikNjJM9TEL/AljYQ==", + "license": "MIT", + "dependencies": { + "@inquirer/core": "^11.1.1", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/password": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-5.0.4.tgz", + "integrity": "sha512-ZCEPyVYvHK4W4p2Gy6sTp9nqsdHQCfiPXIP9LbJVW4yCinnxL/dDDmPaEZVysGrj8vxVReRnpfS2fOeODe9zjg==", + "license": "MIT", + "dependencies": { + "@inquirer/ansi": "^2.0.3", + "@inquirer/core": "^11.1.1", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/prompts": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-8.2.0.tgz", + "integrity": "sha512-rqTzOprAj55a27jctS3vhvDDJzYXsr33WXTjODgVOru21NvBo9yIgLIAf7SBdSV0WERVly3dR6TWyp7ZHkvKFA==", + "license": "MIT", + "dependencies": { + "@inquirer/checkbox": "^5.0.4", + "@inquirer/confirm": "^6.0.4", + "@inquirer/editor": "^5.0.4", + "@inquirer/expand": "^5.0.4", + "@inquirer/input": "^5.0.4", + "@inquirer/number": "^4.0.4", + "@inquirer/password": "^5.0.4", + "@inquirer/rawlist": "^5.2.0", + "@inquirer/search": "^4.1.0", + "@inquirer/select": "^5.0.4" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/rawlist": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-5.2.0.tgz", + "integrity": "sha512-CciqGoOUMrFo6HxvOtU5uL8fkjCmzyeB6fG7O1vdVAZVSopUBYECOwevDBlqNLyyYmzpm2Gsn/7nLrpruy9RFg==", + "license": "MIT", + "dependencies": { + "@inquirer/core": "^11.1.1", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/search": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-4.1.0.tgz", + "integrity": "sha512-EAzemfiP4IFvIuWnrHpgZs9lAhWDA0GM3l9F4t4mTQ22IFtzfrk8xbkMLcAN7gmVML9O/i+Hzu8yOUyAaL6BKA==", + "license": "MIT", + "dependencies": { + "@inquirer/core": "^11.1.1", + "@inquirer/figures": "^2.0.3", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/select": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-5.0.4.tgz", + "integrity": "sha512-s8KoGpPYMEQ6WXc0dT9blX2NtIulMdLOO3LA1UKOiv7KFWzlJ6eLkEYTDBIi+JkyKXyn8t/CD6TinxGjyLt57g==", + "license": "MIT", + "dependencies": { + "@inquirer/ansi": "^2.0.3", + "@inquirer/core": "^11.1.1", + "@inquirer/figures": "^2.0.3", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/type": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-4.0.3.tgz", + "integrity": "sha512-cKZN7qcXOpj1h+1eTTcGDVLaBIHNMT1Rz9JqJP5MnEJ0JhgVWllx7H/tahUp5YEK1qaByH2Itb8wLG/iScD5kw==", + "license": "MIT", + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@isaacs/balanced-match": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", + "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", + "license": "MIT", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@isaacs/brace-expansion": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.1.tgz", + "integrity": "sha512-WMz71T1JS624nWj2n2fnYAuPovhv7EUhk69R6i9dsVyzxt5eM3bjwvgk9L+APE1TRscGysAVMANkB0jh0LQZrQ==", + "license": "MIT", + "dependencies": { + "@isaacs/balanced-match": "^4.0.1" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@sec-ant/readable-stream": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz", + "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sindresorhus/merge-streams": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz", + "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/array-back": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chardet": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-2.1.1.tgz", + "integrity": "sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==", + "license": "MIT" + }, + "node_modules/cli-width": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", + "license": "ISC", + "engines": { + "node": ">= 12" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/command-line-usage": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", + "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", + "license": "MIT", + "dependencies": { + "array-back": "^4.0.2", + "chalk": "^2.4.2", + "table-layout": "^1.0.2", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/execa": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-9.6.1.tgz", + "integrity": "sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sindresorhus/merge-streams": "^4.0.0", + "cross-spawn": "^7.0.6", + "figures": "^6.1.0", + "get-stream": "^9.0.0", + "human-signals": "^8.0.1", + "is-plain-obj": "^4.1.0", + "is-stream": "^4.0.1", + "npm-run-path": "^6.0.0", + "pretty-ms": "^9.2.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^4.0.0", + "yoctocolors": "^2.1.1" + }, + "engines": { + "node": "^18.19.0 || >=20.5.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/execa/node_modules/parse-ms": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-4.0.0.tgz", + "integrity": "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/execa/node_modules/pretty-ms": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.3.0.tgz", + "integrity": "sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parse-ms": "^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "license": "MIT", + "engines": { + "node": ">= 4.9.1" + } + }, + "node_modules/figures": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", + "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-unicode-supported": "^2.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/fuse.js": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-7.1.0.tgz", + "integrity": "sha512-trLf4SzuuUxfusZADLINj+dE8clK1frKdmqiJNb1Es75fmI5oY6X2mxLVUciLLjxqw/xr72Dhy+lER6dGd02FQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=10" + } + }, + "node_modules/get-east-asian-width": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.4.0.tgz", + "integrity": "sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-stream": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz", + "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sec-ant/readable-stream": "^0.4.1", + "is-stream": "^4.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.1.tgz", + "integrity": "sha512-B7U/vJpE3DkJ5WXTgTpTRN63uV42DseiXXKMwG14LQBXmsdeIoHAPbU/MEo6II0k5ED74uc2ZGTC6MwHFQhF6w==", + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.1.2", + "minipass": "^7.1.2", + "path-scurry": "^2.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/hereby": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/hereby/-/hereby-1.11.1.tgz", + "integrity": "sha512-3tcp92aUN6mSmWslo/EIoz3AAKa9GPmiJ3g0ZgXC8NGZPyh4J3T+JoGfD4JTiL31SW+pFliKKHu1uxa7nwDv0g==", + "license": "MIT", + "dependencies": { + "command-line-usage": "^6.1.3", + "fastest-levenshtein": "^1.0.16", + "minimist": "^1.2.8", + "picocolors": "^1.1.0", + "pretty-ms": "^8.0.0" + }, + "bin": { + "hereby": "bin/hereby.js" + }, + "engines": { + "node": ">= 12.20" + } + }, + "node_modules/human-signals": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.1.tgz", + "integrity": "sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-stream": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", + "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-unicode-supported": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", + "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/lru-cache": { + "version": "11.2.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.5.tgz", + "integrity": "sha512-vFrFJkWtJvJnD5hg+hJvVE8Lh/TcMzKnTgCWmtBipwI5yLX/iX+5UB2tfuyODF5E7k9xEzMdYgGqaSb1c0c5Yw==", + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/minimatch": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.2.tgz", + "integrity": "sha512-fu656aJ0n2kcXwsnwnv9g24tkU5uSmOlTjd6WyyaKm2Z+h1qmY6bAjrcaIxF/BslFqbZ8UBtbJi7KgQOZD2PTw==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/brace-expansion": "^5.0.1" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mute-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-3.0.0.tgz", + "integrity": "sha512-dkEJPVvun4FryqBmZ5KhDo0K9iDXAwn08tMLDinNdRBNPcYEDiWYysLcc6k3mjTMlbP9KyylvRpd4wFtwrT9rw==", + "license": "ISC", + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/npm-run-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz", + "integrity": "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^4.0.0", + "unicorn-magic": "^0.3.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse-ms": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-3.0.0.tgz", + "integrity": "sha512-Tpb8Z7r7XbbtBTrM9UhpkzzaMrqA2VXMT3YChzYltwV3P3pM6t8wl7TvpMnSTosz1aQAdVib7kdoys7vYOPerw==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.1.tgz", + "integrity": "sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/pretty-ms": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-8.0.0.tgz", + "integrity": "sha512-ASJqOugUF1bbzI35STMBUpZqdfYKlJugy6JBziGi2EE+AL5JPJGSzvpeVXojxrr0ViUYoToUjb5kjSEGf7Y83Q==", + "license": "MIT", + "dependencies": { + "parse-ms": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "license": "MIT", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "license": "MIT" + }, + "node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-final-newline": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz", + "integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/table-layout": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", + "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", + "license": "MIT", + "dependencies": { + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/unicorn-magic": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz", + "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wordwrapjs": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", + "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", + "license": "MIT", + "dependencies": { + "reduce-flatten": "^2.0.0", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/yoctocolors": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.2.tgz", + "integrity": "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/node_modules/@inquirer/ansi/LICENSE b/node_modules/@inquirer/ansi/LICENSE new file mode 100644 index 0000000..f718698 --- /dev/null +++ b/node_modules/@inquirer/ansi/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2025 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@inquirer/ansi/README.md b/node_modules/@inquirer/ansi/README.md new file mode 100644 index 0000000..ba2e266 --- /dev/null +++ b/node_modules/@inquirer/ansi/README.md @@ -0,0 +1,89 @@ +# @inquirer/ansi + +A lightweight package providing ANSI escape sequences for terminal cursor manipulation and screen clearing. + +# Installation + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/ansi +``` + + + +```sh +yarn add @inquirer/ansi +``` + +
+ +## Usage + +```js +import { + cursorUp, + cursorDown, + cursorTo, + cursorLeft, + cursorHide, + cursorShow, + eraseLines, +} from '@inquirer/ansi'; + +// Move cursor up 3 lines +process.stdout.write(cursorUp(3)); + +// Move cursor to specific position (x: 10, y: 5) +process.stdout.write(cursorTo(10, 5)); + +// Hide/show cursor +process.stdout.write(cursorHide); +process.stdout.write(cursorShow); + +// Clear 5 lines +process.stdout.write(eraseLines(5)); +``` + +Or when used inside an inquirer prompt: + +```js +import { cursorHide } from '@inquirer/ansi'; +import { createPrompt } from '@inquirer/core'; + +export default createPrompt((config, done: (value: void) => void) => { + return `Choose an option${cursorHide}`; +}); +``` + +## API + +### Cursor Movement + +- **`cursorUp(count?: number)`** - Move cursor up by `count` lines (default: 1) +- **`cursorDown(count?: number)`** - Move cursor down by `count` lines (default: 1) +- **`cursorTo(x: number, y?: number)`** - Move cursor to position (x, y). If y is omitted, only moves horizontally +- **`cursorLeft`** - Move cursor to beginning of line + +### Cursor Visibility + +- **`cursorHide`** - Hide the cursor +- **`cursorShow`** - Show the cursor + +### Screen Manipulation + +- **`eraseLines(count: number)`** - Clear `count` lines and position cursor at the beginning of the first cleared line + +# License + +Copyright (c) 2025 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/node_modules/@inquirer/ansi/dist/index.d.ts b/node_modules/@inquirer/ansi/dist/index.d.ts new file mode 100644 index 0000000..f607ad6 --- /dev/null +++ b/node_modules/@inquirer/ansi/dist/index.d.ts @@ -0,0 +1,14 @@ +/** Move cursor to first column */ +export declare const cursorLeft: string; +/** Hide the cursor */ +export declare const cursorHide: string; +/** Show the cursor */ +export declare const cursorShow: string; +/** Move cursor up by count rows */ +export declare const cursorUp: (rows?: number) => string; +/** Move cursor down by count rows */ +export declare const cursorDown: (rows?: number) => string; +/** Move cursor to position (x, y) */ +export declare const cursorTo: (x: number, y?: number) => string; +/** Erase the specified number of lines above the cursor */ +export declare const eraseLines: (lines: number) => string; diff --git a/node_modules/@inquirer/ansi/dist/index.js b/node_modules/@inquirer/ansi/dist/index.js new file mode 100644 index 0000000..2e69a44 --- /dev/null +++ b/node_modules/@inquirer/ansi/dist/index.js @@ -0,0 +1,21 @@ +const ESC = '\u001B['; +/** Move cursor to first column */ +export const cursorLeft = ESC + 'G'; +/** Hide the cursor */ +export const cursorHide = ESC + '?25l'; +/** Show the cursor */ +export const cursorShow = ESC + '?25h'; +/** Move cursor up by count rows */ +export const cursorUp = (rows = 1) => (rows > 0 ? `${ESC}${rows}A` : ''); +/** Move cursor down by count rows */ +export const cursorDown = (rows = 1) => rows > 0 ? `${ESC}${rows}B` : ''; +/** Move cursor to position (x, y) */ +export const cursorTo = (x, y) => { + if (typeof y === 'number' && !Number.isNaN(y)) { + return `${ESC}${y + 1};${x + 1}H`; + } + return `${ESC}${x + 1}G`; +}; +const eraseLine = ESC + '2K'; +/** Erase the specified number of lines above the cursor */ +export const eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : ''; diff --git a/node_modules/@inquirer/ansi/package.json b/node_modules/@inquirer/ansi/package.json new file mode 100644 index 0000000..3044cbc --- /dev/null +++ b/node_modules/@inquirer/ansi/package.json @@ -0,0 +1,78 @@ +{ + "name": "@inquirer/ansi", + "version": "2.0.3", + "keywords": [ + "ansi", + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/ansi/README.md", + "license": "MIT", + "author": "Simon Boudrias ", + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "tsc": "tsc" + }, + "devDependencies": { + "typescript": "^5.9.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "gitHead": "99d00a9adc53be8b7edf5926b2ec4ba0b792f68f" +} diff --git a/node_modules/@inquirer/checkbox/LICENSE b/node_modules/@inquirer/checkbox/LICENSE new file mode 100644 index 0000000..f718698 --- /dev/null +++ b/node_modules/@inquirer/checkbox/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2025 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@inquirer/checkbox/README.md b/node_modules/@inquirer/checkbox/README.md new file mode 100644 index 0000000..e182d63 --- /dev/null +++ b/node_modules/@inquirer/checkbox/README.md @@ -0,0 +1,188 @@ +# `@inquirer/checkbox` + +Simple interactive command line prompt to display a list of checkboxes (multi select). + +![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg) + +# Installation + + + + + + + + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/prompts +``` + + + +```sh +yarn add @inquirer/prompts +``` + +
Or
+ +```sh +npm install @inquirer/checkbox +``` + + + +```sh +yarn add @inquirer/checkbox +``` + +
+ +# Usage + +```js +import { checkbox, Separator } from '@inquirer/prompts'; +// Or +// import checkbox, { Separator } from '@inquirer/checkbox'; + +const answer = await checkbox({ + message: 'Select a package manager', + choices: [ + { name: 'npm', value: 'npm' }, + { name: 'yarn', value: 'yarn' }, + new Separator(), + { name: 'pnpm', value: 'pnpm', disabled: true }, + { + name: 'pnpm', + value: 'pnpm', + disabled: '(pnpm is not available)', + }, + ], +}); +``` + +## Options + +| Property | Type | Required | Description | +| --------- | --------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| choices | `Choice[]` | yes | List of the available choices. | +| pageSize | `number` | no | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. | +| loop | `boolean` | no | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping. | +| required | `boolean` | no | When set to `true`, ensures at least one choice must be selected. | +| validate | `async (Choice[]) => boolean \| string` | no | On submit, validate the choices. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. | +| shortcuts | [See Shortcuts](#Shortcuts) | no | Customize shortcut keys for `all` and `invert`. | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options. + +### `Choice` object + +The `Choice` object is typed as + +```ts +type Choice = { + value: Value; + name?: string; + checkedName?: string; + description?: string; + short?: string; + checked?: boolean; + disabled?: boolean | string; +}; +``` + +Here's each property: + +- `value`: The value is what will be returned by `await checkbox()`. +- `name`: This is the string displayed in the choice list. +- `checkedName`: Alternative `name` (or format) displayed when the choice is checked. +- `description`: Option for a longer description string that'll appear under the list when the cursor highlight a given choice. +- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`. +- `checked`: If `true`, the option will be checked by default. +- `disabled`: Disallow the option from being selected. If `disabled` is a string, it'll be used as a help tip explaining why the choice isn't available. + +Also note the `choices` array can contain `Separator`s to help organize long lists. + +`choices` can also be an array of string, in which case the string will be used both as the `value` and the `name`. + +## Shortcuts + +You can customize the shortcut keys for `all` and `invert` or disable them by setting them to `null`. + +```ts +type Shortcuts = { + all?: string | null; // default: 'a' + invert?: string | null; // default: 'i' +}; +``` + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string | { idle: string; done: string }; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string, status: 'idle' | 'done' | 'loading') => string; + error: (text: string) => string; + defaultAnswer: (text: string) => string; + help: (text: string) => string; + highlight: (text: string) => string; + key: (text: string) => string; + disabledChoice: (text: string) => string; + description: (text: string) => string; + renderSelectedChoices: ( + selectedChoices: ReadonlyArray>, + allChoices: ReadonlyArray | Separator>, + ) => string; + keysHelpTip: (keys: [key: string, action: string][]) => string | undefined; + }; + icon: { + checked: string; + unchecked: string; + cursor: string; + }; +}; +``` + +### `theme.style.keysHelpTip` + +This function allows you to customize the keyboard shortcuts help tip displayed below the prompt. It receives an array of key-action pairs and should return a formatted string. You can also hook here to localize the labels to different languages. + +It can also returns `undefined` to hide the help tip entirely. + +```js +theme: { + style: { + keysHelpTip: (keys) => { + // Return undefined to hide the help tip completely + return undefined; + + // Or customize the formatting. Or localize the labels. + return keys.map(([key, action]) => `${key}: ${action}`).join(' | '); + }; + } +} +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/node_modules/@inquirer/checkbox/dist/index.d.ts b/node_modules/@inquirer/checkbox/dist/index.d.ts new file mode 100644 index 0000000..cdb6505 --- /dev/null +++ b/node_modules/@inquirer/checkbox/dist/index.d.ts @@ -0,0 +1,52 @@ +import { Separator, type Theme, type Keybinding } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type CheckboxTheme = { + icon: { + checked: string; + unchecked: string; + cursor: string; + }; + style: { + disabledChoice: (text: string) => string; + renderSelectedChoices: (selectedChoices: ReadonlyArray>, allChoices: ReadonlyArray | Separator>) => string; + description: (text: string) => string; + keysHelpTip: (keys: [key: string, action: string][]) => string | undefined; + }; + keybindings: ReadonlyArray; +}; +type CheckboxShortcuts = { + all?: string | null; + invert?: string | null; +}; +type Choice = { + value: Value; + name?: string; + checkedName?: string; + description?: string; + short?: string; + disabled?: boolean | string; + checked?: boolean; + type?: never; +}; +type NormalizedChoice = { + value: Value; + name: string; + checkedName: string; + description?: string; + short: string; + disabled: boolean | string; + checked: boolean; +}; +declare const _default: (config: { + message: string; + prefix?: string | undefined; + pageSize?: number | undefined; + choices: readonly (string | Separator)[] | readonly (Separator | Choice)[]; + loop?: boolean | undefined; + required?: boolean | undefined; + validate?: ((choices: readonly NormalizedChoice[]) => boolean | string | Promise) | undefined; + theme?: PartialDeep> | undefined; + shortcuts?: CheckboxShortcuts | undefined; +}, context?: import("@inquirer/type").Context) => Promise; +export default _default; +export { Separator } from '@inquirer/core'; diff --git a/node_modules/@inquirer/checkbox/dist/index.js b/node_modules/@inquirer/checkbox/dist/index.js new file mode 100644 index 0000000..f668bf1 --- /dev/null +++ b/node_modules/@inquirer/checkbox/dist/index.js @@ -0,0 +1,190 @@ +import { createPrompt, useState, useKeypress, usePrefix, usePagination, useMemo, makeTheme, isUpKey, isDownKey, isSpaceKey, isNumberKey, isEnterKey, ValidationError, Separator, } from '@inquirer/core'; +import { cursorHide } from '@inquirer/ansi'; +import { styleText } from 'node:util'; +import figures from '@inquirer/figures'; +const checkboxTheme = { + icon: { + checked: styleText('green', figures.circleFilled), + unchecked: figures.circle, + cursor: figures.pointer, + }, + style: { + disabledChoice: (text) => styleText('dim', `- ${text}`), + renderSelectedChoices: (selectedChoices) => selectedChoices.map((choice) => choice.short).join(', '), + description: (text) => styleText('cyan', text), + keysHelpTip: (keys) => keys + .map(([key, action]) => `${styleText('bold', key)} ${styleText('dim', action)}`) + .join(styleText('dim', ' • ')), + }, + keybindings: [], +}; +function isSelectable(item) { + return !Separator.isSeparator(item) && !item.disabled; +} +function isChecked(item) { + return isSelectable(item) && item.checked; +} +function toggle(item) { + return isSelectable(item) ? { ...item, checked: !item.checked } : item; +} +function check(checked) { + return function (item) { + return isSelectable(item) ? { ...item, checked } : item; + }; +} +function normalizeChoices(choices) { + return choices.map((choice) => { + if (Separator.isSeparator(choice)) + return choice; + if (typeof choice === 'string') { + return { + value: choice, + name: choice, + short: choice, + checkedName: choice, + disabled: false, + checked: false, + }; + } + const name = choice.name ?? String(choice.value); + const normalizedChoice = { + value: choice.value, + name, + short: choice.short ?? name, + checkedName: choice.checkedName ?? name, + disabled: choice.disabled ?? false, + checked: choice.checked ?? false, + }; + if (choice.description) { + normalizedChoice.description = choice.description; + } + return normalizedChoice; + }); +} +export default createPrompt((config, done) => { + const { pageSize = 7, loop = true, required, validate = () => true } = config; + const shortcuts = { all: 'a', invert: 'i', ...config.shortcuts }; + const theme = makeTheme(checkboxTheme, config.theme); + const { keybindings } = theme; + const [status, setStatus] = useState('idle'); + const prefix = usePrefix({ status, theme }); + const [items, setItems] = useState(normalizeChoices(config.choices)); + const bounds = useMemo(() => { + const first = items.findIndex(isSelectable); + const last = items.findLastIndex(isSelectable); + if (first === -1) { + throw new ValidationError('[checkbox prompt] No selectable choices. All choices are disabled.'); + } + return { first, last }; + }, [items]); + const [active, setActive] = useState(bounds.first); + const [errorMsg, setError] = useState(); + useKeypress(async (key) => { + if (isEnterKey(key)) { + const selection = items.filter(isChecked); + const isValid = await validate([...selection]); + if (required && !items.some(isChecked)) { + setError('At least one choice must be selected'); + } + else if (isValid === true) { + setStatus('done'); + done(selection.map((choice) => choice.value)); + } + else { + setError(isValid || 'You must select a valid value'); + } + } + else if (isUpKey(key, keybindings) || isDownKey(key, keybindings)) { + if (loop || + (isUpKey(key, keybindings) && active !== bounds.first) || + (isDownKey(key, keybindings) && active !== bounds.last)) { + const offset = isUpKey(key, keybindings) ? -1 : 1; + let next = active; + do { + next = (next + offset + items.length) % items.length; + } while (!isSelectable(items[next])); + setActive(next); + } + } + else if (isSpaceKey(key)) { + setError(undefined); + setItems(items.map((choice, i) => (i === active ? toggle(choice) : choice))); + } + else if (key.name === shortcuts.all) { + const selectAll = items.some((choice) => isSelectable(choice) && !choice.checked); + setItems(items.map(check(selectAll))); + } + else if (key.name === shortcuts.invert) { + setItems(items.map(toggle)); + } + else if (isNumberKey(key)) { + const selectedIndex = Number(key.name) - 1; + // Find the nth item (ignoring separators) + let selectableIndex = -1; + const position = items.findIndex((item) => { + if (Separator.isSeparator(item)) + return false; + selectableIndex++; + return selectableIndex === selectedIndex; + }); + const selectedItem = items[position]; + if (selectedItem && isSelectable(selectedItem)) { + setActive(position); + setItems(items.map((choice, i) => (i === position ? toggle(choice) : choice))); + } + } + }); + const message = theme.style.message(config.message, status); + let description; + const page = usePagination({ + items, + active, + renderItem({ item, isActive }) { + if (Separator.isSeparator(item)) { + return ` ${item.separator}`; + } + if (item.disabled) { + const disabledLabel = typeof item.disabled === 'string' ? item.disabled : '(disabled)'; + return theme.style.disabledChoice(`${item.name} ${disabledLabel}`); + } + if (isActive) { + description = item.description; + } + const checkbox = item.checked ? theme.icon.checked : theme.icon.unchecked; + const name = item.checked ? item.checkedName : item.name; + const color = isActive ? theme.style.highlight : (x) => x; + const cursor = isActive ? theme.icon.cursor : ' '; + return color(`${cursor}${checkbox} ${name}`); + }, + pageSize, + loop, + }); + if (status === 'done') { + const selection = items.filter(isChecked); + const answer = theme.style.answer(theme.style.renderSelectedChoices(selection, items)); + return [prefix, message, answer].filter(Boolean).join(' '); + } + const keys = [ + ['↑↓', 'navigate'], + ['space', 'select'], + ]; + if (shortcuts.all) + keys.push([shortcuts.all, 'all']); + if (shortcuts.invert) + keys.push([shortcuts.invert, 'invert']); + keys.push(['⏎', 'submit']); + const helpLine = theme.style.keysHelpTip(keys); + const lines = [ + [prefix, message].filter(Boolean).join(' '), + page, + ' ', + description ? theme.style.description(description) : '', + errorMsg ? theme.style.error(errorMsg) : '', + helpLine, + ] + .filter(Boolean) + .join('\n') + .trimEnd(); + return `${lines}${cursorHide}`; +}); +export { Separator } from '@inquirer/core'; diff --git a/node_modules/@inquirer/checkbox/package.json b/node_modules/@inquirer/checkbox/package.json new file mode 100644 index 0000000..fdf2438 --- /dev/null +++ b/node_modules/@inquirer/checkbox/package.json @@ -0,0 +1,93 @@ +{ + "name": "@inquirer/checkbox", + "version": "5.0.4", + "description": "Inquirer checkbox prompt", + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/checkbox/README.md", + "license": "MIT", + "author": "Simon Boudrias ", + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "tsc": "tsc" + }, + "dependencies": { + "@inquirer/ansi": "^2.0.3", + "@inquirer/core": "^11.1.1", + "@inquirer/figures": "^2.0.3", + "@inquirer/type": "^4.0.3" + }, + "devDependencies": { + "@inquirer/testing": "^3.0.4", + "typescript": "^5.9.3" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "gitHead": "99d00a9adc53be8b7edf5926b2ec4ba0b792f68f" +} diff --git a/node_modules/@inquirer/confirm/LICENSE b/node_modules/@inquirer/confirm/LICENSE new file mode 100644 index 0000000..f718698 --- /dev/null +++ b/node_modules/@inquirer/confirm/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2025 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@inquirer/confirm/README.md b/node_modules/@inquirer/confirm/README.md new file mode 100644 index 0000000..fe2e5f0 --- /dev/null +++ b/node_modules/@inquirer/confirm/README.md @@ -0,0 +1,92 @@ +# `@inquirer/confirm` + +Simple interactive command line prompt to gather boolean input from users. + +![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg) + +# Installation + + + + + + + + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/prompts +``` + + + +```sh +yarn add @inquirer/prompts +``` + +
Or
+ +```sh +npm install @inquirer/confirm +``` + + + +```sh +yarn add @inquirer/confirm +``` + +
+ +# Usage + +```js +import { confirm } from '@inquirer/prompts'; +// Or +// import confirm from '@inquirer/confirm'; + +const answer = await confirm({ message: 'Continue?' }); +``` + +## Options + +| Property | Type | Required | Description | +| ----------- | ----------------------- | -------- | ------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| default | `boolean` | no | Default answer (true or false) | +| transformer | `(boolean) => string` | no | Transform the prompt printed message to a custom string | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string | { idle: string; done: string }; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string, status: 'idle' | 'done' | 'loading') => string; + defaultAnswer: (text: string) => string; + }; +}; +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/node_modules/@inquirer/confirm/dist/index.d.ts b/node_modules/@inquirer/confirm/dist/index.d.ts new file mode 100644 index 0000000..d3d323a --- /dev/null +++ b/node_modules/@inquirer/confirm/dist/index.d.ts @@ -0,0 +1,10 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type ConfirmConfig = { + message: string; + default?: boolean; + transformer?: (value: boolean) => string; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/node_modules/@inquirer/confirm/dist/index.js b/node_modules/@inquirer/confirm/dist/index.js new file mode 100644 index 0000000..44f3a5f --- /dev/null +++ b/node_modules/@inquirer/confirm/dist/index.js @@ -0,0 +1,48 @@ +import { createPrompt, useState, useKeypress, isEnterKey, isTabKey, usePrefix, makeTheme, } from '@inquirer/core'; +function getBooleanValue(value, defaultValue) { + let answer = defaultValue !== false; + if (/^(y|yes)/i.test(value)) + answer = true; + else if (/^(n|no)/i.test(value)) + answer = false; + return answer; +} +function boolToString(value) { + return value ? 'Yes' : 'No'; +} +export default createPrompt((config, done) => { + const { transformer = boolToString } = config; + const [status, setStatus] = useState('idle'); + const [value, setValue] = useState(''); + const theme = makeTheme(config.theme); + const prefix = usePrefix({ status, theme }); + useKeypress((key, rl) => { + if (status !== 'idle') + return; + if (isEnterKey(key)) { + const answer = getBooleanValue(value, config.default); + setValue(transformer(answer)); + setStatus('done'); + done(answer); + } + else if (isTabKey(key)) { + const answer = boolToString(!getBooleanValue(value, config.default)); + rl.clearLine(0); // Remove the tab character. + rl.write(answer); + setValue(answer); + } + else { + setValue(rl.line); + } + }); + let formattedValue = value; + let defaultValue = ''; + if (status === 'done') { + formattedValue = theme.style.answer(value); + } + else { + defaultValue = ` ${theme.style.defaultAnswer(config.default === false ? 'y/N' : 'Y/n')}`; + } + const message = theme.style.message(config.message, status); + return `${prefix} ${message}${defaultValue} ${formattedValue}`; +}); diff --git a/node_modules/@inquirer/confirm/package.json b/node_modules/@inquirer/confirm/package.json new file mode 100644 index 0000000..c951942 --- /dev/null +++ b/node_modules/@inquirer/confirm/package.json @@ -0,0 +1,91 @@ +{ + "name": "@inquirer/confirm", + "version": "6.0.4", + "description": "Inquirer confirm prompt", + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/confirm/README.md", + "license": "MIT", + "author": "Simon Boudrias ", + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "tsc": "tsc" + }, + "dependencies": { + "@inquirer/core": "^11.1.1", + "@inquirer/type": "^4.0.3" + }, + "devDependencies": { + "@inquirer/testing": "^3.0.4", + "typescript": "^5.9.3" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "gitHead": "99d00a9adc53be8b7edf5926b2ec4ba0b792f68f" +} diff --git a/node_modules/@inquirer/core/LICENSE b/node_modules/@inquirer/core/LICENSE new file mode 100644 index 0000000..f718698 --- /dev/null +++ b/node_modules/@inquirer/core/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2025 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@inquirer/core/README.md b/node_modules/@inquirer/core/README.md new file mode 100644 index 0000000..a54b150 --- /dev/null +++ b/node_modules/@inquirer/core/README.md @@ -0,0 +1,383 @@ +# `@inquirer/core` + +The `@inquirer/core` package is the library enabling the creation of Inquirer prompts. + +It aims to implements a lightweight API similar to React hooks - but without JSX. + +# Installation + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/core +``` + + + +```sh +yarn add @inquirer/core +``` + +
+ +# Usage + +## Basic concept + +Visual terminal apps are at their core strings rendered onto the terminal. + +The most basic prompt is a function returning a string that'll be rendered in the terminal. This function will run every time the prompt state change, and the new returned string will replace the previously rendered one. The prompt cursor appears after the string. + +Wrapping the rendering function with `createPrompt()` will setup the rendering layer, inject the state management utilities, and wait until the `done` callback is called. + +```ts +import { createPrompt } from '@inquirer/core'; + +const input = createPrompt((config, done) => { + // Implement logic + + return '? My question'; +}); + +// And it is then called as +const answer = await input({ + /* config */ +}); +``` + +## Hooks + +State management and user interactions are handled through hooks. Hooks are common [within the React ecosystem](https://react.dev/reference/react/hooks), and Inquirer reimplement the common ones. + +### State hook + +State lets a component “remember” information like user input. For example, an input prompt can use state to store the input value, while a list prompt can use state to track the cursor index. + +`useState` declares a state variable that you can update directly. + +```ts +import { createPrompt, useState } from '@inquirer/core'; + +const input = createPrompt((config, done) => { + const [index, setIndex] = useState(0); + + // ... +``` + +### Keypress hook + +Almost all prompts need to react to user actions. In a terminal, this is done through typing. + +`useKeypress` allows you to react to keypress events, and access the prompt line. + +```ts +const input = createPrompt((config, done) => { + useKeypress((key) => { + if (key.name === 'enter') { + done(answer); + } + }); + + // ... +``` + +Behind the scenes, Inquirer prompts are wrappers around [readlines](https://nodejs.org/api/readline.html). Aside the keypress event object, the hook also pass the active readline instance to the event handler. + +```ts +const input = createPrompt((config, done) => { + useKeypress((key, readline) => { + setValue(readline.line); + }); + + // ... +``` + +### Ref hook + +Refs let a prompt hold some information that isn’t used for rendering, like a class instance or a timeout ID. Unlike with state, updating a ref does not re-render your prompt. Refs are an “escape hatch” from the rendering paradigm. + +`useRef` declares a ref. You can hold any value in it, but most often it’s used to hold a timeout ID. + +```ts +const input = createPrompt((config, done) => { + const timeout = useRef(null); + + // ... +``` + +### Effect Hook + +Effects let a prompt connect to and synchronize with external systems. This includes dealing with network or animations. + +`useEffect` connects a component to an external system. + +```ts +const chat = createPrompt((config, done) => { + useEffect(() => { + const connection = createConnection(roomId); + connection.connect(); + return () => connection.disconnect(); + }, [roomId]); + + // ... +``` + +### Performance hook + +A common way to optimize re-rendering performance is to skip unnecessary work. For example, you can tell Inquirer to reuse a cached calculation or to skip a re-render if the data has not changed since the previous render. + +`useMemo` lets you cache the result of an expensive calculation. + +```ts +const todoSelect = createPrompt((config, done) => { + const visibleTodos = useMemo(() => filterTodos(todos, tab), [todos, tab]); + + // ... +``` + +### Rendering hooks + +#### Prefix / loading + +All default prompts, and most custom ones, uses a prefix at the beginning of the prompt line. This helps visually delineate different questions, and provides a convenient area to render a loading spinner. + +`usePrefix` is a built-in hook to do this. + +```ts +const input = createPrompt((config, done) => { + const prefix = usePrefix({ status }); + + return `${prefix} My question`; +}); +``` + +#### Pagination + +When looping through a long list of options (like in the `select` prompt), paginating the results appearing on the screen at once can be necessary. The `usePagination` hook is the utility used within the `select` and `checkbox` prompts to cycle through the list of options. + +Pagination works by taking in the list of options and returning a subset of the rendered items that fit within the page. The hook takes in a few options. It needs a list of options (`items`), and a `pageSize` which is the number of lines to be rendered. The `active` index is the index of the currently selected/selectable item. The `loop` option is a boolean that indicates if the list should loop around when reaching the end: this is the default behavior. The pagination hook renders items only as necessary, so it takes a function that can render an item at an index, including an `active` state, called `renderItem`. + +```js +export default createPrompt((config, done) => { + const [active, setActive] = useState(0); + + const allChoices = config.choices.map((choice) => choice.name); + + const page = usePagination({ + items: allChoices, + active: active, + renderItem: ({ item, index, isActive }) => `${isActive ? ">" : " "}${index}. ${item.toString()}` + pageSize: config.pageSize, + loop: config.loop, + }); + + return `... ${page}`; +}); +``` + +## `createPrompt()` API + +As we saw earlier, the rendering function should return a string, and eventually call `done` to close the prompt and return the answer. + +```ts +const input = createPrompt((config, done) => { + const [value, setValue] = useState(); + + useKeypress((key, readline) => { + if (key.name === 'enter') { + done(answer); + } else { + setValue(readline.line); + } + }); + + return `? ${config.message} ${value}`; +}); +``` + +The rendering function can also return a tuple of 2 string (`[string, string]`.) The first string represents the prompt. The second one is content to render under the prompt, like an error message. The text input cursor will appear after the first string. + +```ts +const number = createPrompt((config, done) => { + // Add some logic here + + return [`? My question ${input}`, `! The input must be a number`]; +}); +``` + +### Typescript + +If using typescript, `createPrompt` takes 2 generic arguments. + +```ts +// createPrompt +const input = createPrompt(// ... +``` + +The first one is the type of the resolved value + +```ts +const answer: string = await input(); +``` + +The second one is the type of the prompt config; in other words the interface the created prompt will provide to users. + +```ts +const answer = await input({ + message: 'My question', +}); +``` + +## Key utilities + +Listening for keypress events inside an inquirer prompt is a very common pattern. To ease this, we export a few utility functions taking in the keypress event object and return a boolean: + +- `isEnterKey()` +- `isBackspaceKey()` +- `isSpaceKey()` +- `isUpKey()` - Note: this utility will handle vim and emacs keybindings (up, `k`, and `ctrl+p`) +- `isDownKey()` - Note: this utility will handle vim and emacs keybindings (down, `j`, and `ctrl+n`) +- `isNumberKey()` one of 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 + +## Theming + +Theming utilities will allow you to expose customization of the prompt style. Inquirer also has a few standard theme values shared across all the official prompts. + +To allow standard customization: + +```ts +import { createPrompt, usePrefix, makeTheme, type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; + +type PromptConfig = { + theme?: PartialDeep; +}; + +export default createPrompt((config, done) => { + const theme = makeTheme(config.theme); + + const prefix = usePrefix({ status, theme }); + + return `${prefix} ${theme.style.highlight('hello')}`; +}); +``` + +To setup a custom theme: + +```ts +import { createPrompt, makeTheme, type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; + +type PromptTheme = {}; + +const promptTheme: PromptTheme = { + icon: '!', +}; + +type PromptConfig = { + theme?: PartialDeep>; +}; + +export default createPrompt((config, done) => { + const theme = makeTheme(promptTheme, config.theme); + + const prefix = usePrefix({ status, theme }); + + return `${prefix} ${theme.icon}`; +}); +``` + +The [default theme keys cover](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/core/src/lib/theme.ts): + +```ts +type DefaultTheme = { + prefix: string | { idle: string; done: string }; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string, status: 'idle' | 'done' | 'loading') => string; + error: (text: string) => string; + defaultAnswer: (text: string) => string; + help: (text: string) => string; + highlight: (text: string) => string; + key: (text: string) => string; + }; +}; +``` + +# Examples + +You can refer to any `@inquirer/prompts` prompts for real examples: + +- [Confirm Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/confirm/src/index.ts) +- [Input Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/input/src/index.ts) +- [Password Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/password/src/index.ts) +- [Editor Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/editor/src/index.ts) +- [Select Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/select/src/index.ts) +- [Checkbox Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/checkbox/src/index.ts) +- [Rawlist Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/rawlist/src/index.ts) +- [Expand Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/expand/src/index.ts) + +```ts +import { styleText } from 'node:util'; +import { + createPrompt, + useState, + useKeypress, + isEnterKey, + usePrefix, + type Status, +} from '@inquirer/core'; + +const confirm = createPrompt( + (config, done) => { + const [status, setStatus] = useState('idle'); + const [value, setValue] = useState(''); + const prefix = usePrefix({}); + + useKeypress((key, rl) => { + if (isEnterKey(key)) { + const answer = value ? /^y(es)?/i.test(value) : config.default !== false; + setValue(answer ? 'yes' : 'no'); + setStatus('done'); + done(answer); + } else { + setValue(rl.line); + } + }); + + let formattedValue = value; + let defaultValue = ''; + if (status === 'done') { + formattedValue = styleText('cyan', value); + } else { + defaultValue = styleText('dim', config.default === false ? ' (y/N)' : ' (Y/n)'); + } + + const message = styleText('bold', config.message); + return `${prefix} ${message}${defaultValue} ${formattedValue}`; + }, +); + +/** + * Which then can be used like this: + */ +const answer = await confirm({ message: 'Do you want to continue?' }); +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/node_modules/@inquirer/core/dist/index.d.ts b/node_modules/@inquirer/core/dist/index.d.ts new file mode 100644 index 0000000..615b010 --- /dev/null +++ b/node_modules/@inquirer/core/dist/index.d.ts @@ -0,0 +1,13 @@ +export { isUpKey, isDownKey, isSpaceKey, isBackspaceKey, isTabKey, isNumberKey, isEnterKey, isShiftKey, type KeypressEvent, type Keybinding, } from './lib/key.ts'; +export * from './lib/errors.ts'; +export { usePrefix } from './lib/use-prefix.ts'; +export { useState } from './lib/use-state.ts'; +export { useEffect } from './lib/use-effect.ts'; +export { useMemo } from './lib/use-memo.ts'; +export { useRef } from './lib/use-ref.ts'; +export { useKeypress } from './lib/use-keypress.ts'; +export { makeTheme } from './lib/make-theme.ts'; +export type { Theme, Status } from './lib/theme.ts'; +export { usePagination } from './lib/pagination/use-pagination.ts'; +export { createPrompt } from './lib/create-prompt.ts'; +export { Separator } from './lib/Separator.ts'; diff --git a/node_modules/@inquirer/core/dist/index.js b/node_modules/@inquirer/core/dist/index.js new file mode 100644 index 0000000..0dbfb03 --- /dev/null +++ b/node_modules/@inquirer/core/dist/index.js @@ -0,0 +1,12 @@ +export { isUpKey, isDownKey, isSpaceKey, isBackspaceKey, isTabKey, isNumberKey, isEnterKey, isShiftKey, } from "./lib/key.js"; +export * from "./lib/errors.js"; +export { usePrefix } from "./lib/use-prefix.js"; +export { useState } from "./lib/use-state.js"; +export { useEffect } from "./lib/use-effect.js"; +export { useMemo } from "./lib/use-memo.js"; +export { useRef } from "./lib/use-ref.js"; +export { useKeypress } from "./lib/use-keypress.js"; +export { makeTheme } from "./lib/make-theme.js"; +export { usePagination } from "./lib/pagination/use-pagination.js"; +export { createPrompt } from "./lib/create-prompt.js"; +export { Separator } from "./lib/Separator.js"; diff --git a/node_modules/@inquirer/core/dist/lib/Separator.d.ts b/node_modules/@inquirer/core/dist/lib/Separator.d.ts new file mode 100644 index 0000000..0283555 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/Separator.d.ts @@ -0,0 +1,10 @@ +/** + * Separator object + * Used to space/separate choices group + */ +export declare class Separator { + readonly separator: string; + readonly type: string; + constructor(separator?: string); + static isSeparator(choice: unknown): choice is Separator; +} diff --git a/node_modules/@inquirer/core/dist/lib/Separator.js b/node_modules/@inquirer/core/dist/lib/Separator.js new file mode 100644 index 0000000..562e928 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/Separator.js @@ -0,0 +1,21 @@ +import { styleText } from 'node:util'; +import figures from '@inquirer/figures'; +/** + * Separator object + * Used to space/separate choices group + */ +export class Separator { + separator = styleText('dim', Array.from({ length: 15 }).join(figures.line)); + type = 'separator'; + constructor(separator) { + if (separator) { + this.separator = separator; + } + } + static isSeparator(choice) { + return Boolean(choice && + typeof choice === 'object' && + 'type' in choice && + choice.type === 'separator'); + } +} diff --git a/node_modules/@inquirer/core/dist/lib/create-prompt.d.ts b/node_modules/@inquirer/core/dist/lib/create-prompt.d.ts new file mode 100644 index 0000000..4414db4 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/create-prompt.d.ts @@ -0,0 +1,4 @@ +import { type Prompt, type Prettify } from '@inquirer/type'; +type ViewFunction = (config: Prettify, done: (value: Value) => void) => string | [string, string | undefined]; +export declare function createPrompt(view: ViewFunction): Prompt; +export {}; diff --git a/node_modules/@inquirer/core/dist/lib/create-prompt.js b/node_modules/@inquirer/core/dist/lib/create-prompt.js new file mode 100644 index 0000000..f6e88aa --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/create-prompt.js @@ -0,0 +1,117 @@ +import * as readline from 'node:readline'; +import { AsyncResource } from 'node:async_hooks'; +import MuteStream from 'mute-stream'; +import { onExit as onSignalExit } from 'signal-exit'; +import ScreenManager from "./screen-manager.js"; +import { PromisePolyfill } from "./promise-polyfill.js"; +import { withHooks, effectScheduler } from "./hook-engine.js"; +import { AbortPromptError, CancelPromptError, ExitPromptError } from "./errors.js"; +function getCallSites() { + // eslint-disable-next-line @typescript-eslint/unbound-method + const _prepareStackTrace = Error.prepareStackTrace; + let result = []; + try { + Error.prepareStackTrace = (_, callSites) => { + const callSitesWithoutCurrent = callSites.slice(1); + result = callSitesWithoutCurrent; + return callSitesWithoutCurrent; + }; + // oxlint-disable-next-line no-unused-expressions + new Error().stack; + } + catch { + // An error will occur if the Node flag --frozen-intrinsics is used. + // https://nodejs.org/api/cli.html#--frozen-intrinsics + return result; + } + Error.prepareStackTrace = _prepareStackTrace; + return result; +} +export function createPrompt(view) { + const callSites = getCallSites(); + const prompt = (config, context = {}) => { + // Default `input` to stdin + const { input = process.stdin, signal } = context; + const cleanups = new Set(); + // Add mute capabilities to the output + const output = new MuteStream(); + output.pipe(context.output ?? process.stdout); + const rl = readline.createInterface({ + terminal: true, + input, + output, + }); + const screen = new ScreenManager(rl); + const { promise, resolve, reject } = PromisePolyfill.withResolver(); + const cancel = () => reject(new CancelPromptError()); + if (signal) { + const abort = () => reject(new AbortPromptError({ cause: signal.reason })); + if (signal.aborted) { + abort(); + return Object.assign(promise, { cancel }); + } + signal.addEventListener('abort', abort); + cleanups.add(() => signal.removeEventListener('abort', abort)); + } + cleanups.add(onSignalExit((code, signal) => { + reject(new ExitPromptError(`User force closed the prompt with ${code} ${signal}`)); + })); + // SIGINT must be explicitly handled by the prompt so the ExitPromptError can be handled. + // Otherwise, the prompt will stop and in some scenarios never resolve. + // Ref issue #1741 + const sigint = () => reject(new ExitPromptError(`User force closed the prompt with SIGINT`)); + rl.on('SIGINT', sigint); + cleanups.add(() => rl.removeListener('SIGINT', sigint)); + // Re-renders only happen when the state change; but the readline cursor could change position + // and that also requires a re-render (and a manual one because we mute the streams). + // We set the listener after the initial workLoop to avoid a double render if render triggered + // by a state change sets the cursor to the right position. + const checkCursorPos = () => screen.checkCursorPos(); + rl.input.on('keypress', checkCursorPos); + cleanups.add(() => rl.input.removeListener('keypress', checkCursorPos)); + return withHooks(rl, (cycle) => { + // The close event triggers immediately when the user press ctrl+c. SignalExit on the other hand + // triggers after the process is done (which happens after timeouts are done triggering.) + // We triggers the hooks cleanup phase on rl `close` so active timeouts can be cleared. + const hooksCleanup = AsyncResource.bind(() => effectScheduler.clearAll()); + rl.on('close', hooksCleanup); + cleanups.add(() => rl.removeListener('close', hooksCleanup)); + cycle(() => { + try { + const nextView = view(config, (value) => { + setImmediate(() => resolve(value)); + }); + // Typescript won't allow this, but not all users rely on typescript. + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (nextView === undefined) { + const callerFilename = callSites[1]?.getFileName(); + throw new Error(`Prompt functions must return a string.\n at ${callerFilename}`); + } + const [content, bottomContent] = typeof nextView === 'string' ? [nextView] : nextView; + screen.render(content, bottomContent); + effectScheduler.run(); + } + catch (error) { + reject(error); + } + }); + return Object.assign(promise + .then((answer) => { + effectScheduler.clearAll(); + return answer; + }, (error) => { + effectScheduler.clearAll(); + throw error; + }) + // Wait for the promise to settle, then cleanup. + .finally(() => { + cleanups.forEach((cleanup) => cleanup()); + screen.done({ clearContent: Boolean(context.clearPromptOnDone) }); + output.end(); + }) + // Once cleanup is done, let the expose promise resolve/reject to the internal one. + .then(() => promise), { cancel }); + }); + }; + return prompt; +} diff --git a/node_modules/@inquirer/core/dist/lib/errors.d.ts b/node_modules/@inquirer/core/dist/lib/errors.d.ts new file mode 100644 index 0000000..b9df681 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/errors.d.ts @@ -0,0 +1,20 @@ +export declare class AbortPromptError extends Error { + name: string; + message: string; + constructor(options?: { + cause?: unknown; + }); +} +export declare class CancelPromptError extends Error { + name: string; + message: string; +} +export declare class ExitPromptError extends Error { + name: string; +} +export declare class HookError extends Error { + name: string; +} +export declare class ValidationError extends Error { + name: string; +} diff --git a/node_modules/@inquirer/core/dist/lib/errors.js b/node_modules/@inquirer/core/dist/lib/errors.js new file mode 100644 index 0000000..153a936 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/errors.js @@ -0,0 +1,21 @@ +export class AbortPromptError extends Error { + name = 'AbortPromptError'; + message = 'Prompt was aborted'; + constructor(options) { + super(); + this.cause = options?.cause; + } +} +export class CancelPromptError extends Error { + name = 'CancelPromptError'; + message = 'Prompt was canceled'; +} +export class ExitPromptError extends Error { + name = 'ExitPromptError'; +} +export class HookError extends Error { + name = 'HookError'; +} +export class ValidationError extends Error { + name = 'ValidationError'; +} diff --git a/node_modules/@inquirer/core/dist/lib/hook-engine.d.ts b/node_modules/@inquirer/core/dist/lib/hook-engine.d.ts new file mode 100644 index 0000000..edfc61c --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/hook-engine.d.ts @@ -0,0 +1,23 @@ +import type { InquirerReadline } from '@inquirer/type'; +export declare function withHooks(rl: InquirerReadline, cb: (cycle: (render: () => void) => void) => T): T; +export declare function readline(): InquirerReadline; +export declare function withUpdates(fn: (...args: Args) => R): (...args: Args) => R; +type SetPointer = { + get(): Value; + set(value: Value): void; + initialized: true; +}; +type UnsetPointer = { + get(): void; + set(value: Value): void; + initialized: false; +}; +type Pointer = SetPointer | UnsetPointer; +export declare function withPointer(cb: (pointer: Pointer) => ReturnValue): ReturnValue; +export declare function handleChange(): void; +export declare const effectScheduler: { + queue(cb: (readline: InquirerReadline) => void | (() => void)): void; + run(): void; + clearAll(): void; +}; +export {}; diff --git a/node_modules/@inquirer/core/dist/lib/hook-engine.js b/node_modules/@inquirer/core/dist/lib/hook-engine.js new file mode 100644 index 0000000..3ed0432 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/hook-engine.js @@ -0,0 +1,110 @@ +/* eslint @typescript-eslint/no-explicit-any: ["off"] */ +import { AsyncLocalStorage, AsyncResource } from 'node:async_hooks'; +import { HookError, ValidationError } from "./errors.js"; +const hookStorage = new AsyncLocalStorage(); +function createStore(rl) { + const store = { + rl, + hooks: [], + hooksCleanup: [], + hooksEffect: [], + index: 0, + handleChange() { }, + }; + return store; +} +// Run callback in with the hook engine setup. +export function withHooks(rl, cb) { + const store = createStore(rl); + return hookStorage.run(store, () => { + function cycle(render) { + store.handleChange = () => { + store.index = 0; + render(); + }; + store.handleChange(); + } + return cb(cycle); + }); +} +// Safe getStore utility that'll return the store or throw if undefined. +function getStore() { + const store = hookStorage.getStore(); + if (!store) { + throw new HookError('[Inquirer] Hook functions can only be called from within a prompt'); + } + return store; +} +export function readline() { + return getStore().rl; +} +// Merge state updates happening within the callback function to avoid multiple renders. +export function withUpdates(fn) { + const wrapped = (...args) => { + const store = getStore(); + let shouldUpdate = false; + const oldHandleChange = store.handleChange; + store.handleChange = () => { + shouldUpdate = true; + }; + const returnValue = fn(...args); + if (shouldUpdate) { + oldHandleChange(); + } + store.handleChange = oldHandleChange; + return returnValue; + }; + return AsyncResource.bind(wrapped); +} +export function withPointer(cb) { + const store = getStore(); + const { index } = store; + const pointer = { + get() { + return store.hooks[index]; + }, + set(value) { + store.hooks[index] = value; + }, + initialized: index in store.hooks, + }; + const returnValue = cb(pointer); + store.index++; + return returnValue; +} +export function handleChange() { + getStore().handleChange(); +} +export const effectScheduler = { + queue(cb) { + const store = getStore(); + const { index } = store; + store.hooksEffect.push(() => { + store.hooksCleanup[index]?.(); + const cleanFn = cb(readline()); + if (cleanFn != null && typeof cleanFn !== 'function') { + throw new ValidationError('useEffect return value must be a cleanup function or nothing.'); + } + store.hooksCleanup[index] = cleanFn; + }); + }, + run() { + const store = getStore(); + withUpdates(() => { + store.hooksEffect.forEach((effect) => { + effect(); + }); + // Warning: Clean the hooks before exiting the `withUpdates` block. + // Failure to do so means an updates would hit the same effects again. + store.hooksEffect.length = 0; + })(); + }, + clearAll() { + const store = getStore(); + store.hooksCleanup.forEach((cleanFn) => { + cleanFn?.(); + }); + store.hooksEffect.length = 0; + store.hooksCleanup.length = 0; + }, +}; diff --git a/node_modules/@inquirer/core/dist/lib/key.d.ts b/node_modules/@inquirer/core/dist/lib/key.d.ts new file mode 100644 index 0000000..ef28f5b --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/key.d.ts @@ -0,0 +1,14 @@ +export type KeypressEvent = { + name: string; + ctrl: boolean; + shift: boolean; +}; +export type Keybinding = 'emacs' | 'vim'; +export declare const isUpKey: (key: KeypressEvent, keybindings?: ReadonlyArray) => boolean; +export declare const isDownKey: (key: KeypressEvent, keybindings?: ReadonlyArray) => boolean; +export declare const isSpaceKey: (key: KeypressEvent) => boolean; +export declare const isBackspaceKey: (key: KeypressEvent) => boolean; +export declare const isTabKey: (key: KeypressEvent) => boolean; +export declare const isNumberKey: (key: KeypressEvent) => boolean; +export declare const isEnterKey: (key: KeypressEvent) => boolean; +export declare const isShiftKey: (key: KeypressEvent) => boolean; diff --git a/node_modules/@inquirer/core/dist/lib/key.js b/node_modules/@inquirer/core/dist/lib/key.js new file mode 100644 index 0000000..3bdf740 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/key.js @@ -0,0 +1,20 @@ +export const isUpKey = (key, keybindings = []) => +// The up key +key.name === 'up' || + // Vim keybinding: hjkl keys map to left/down/up/right + (keybindings.includes('vim') && key.name === 'k') || + // Emacs keybinding: Ctrl+P means "previous" in Emacs navigation conventions + (keybindings.includes('emacs') && key.ctrl && key.name === 'p'); +export const isDownKey = (key, keybindings = []) => +// The down key +key.name === 'down' || + // Vim keybinding: hjkl keys map to left/down/up/right + (keybindings.includes('vim') && key.name === 'j') || + // Emacs keybinding: Ctrl+N means "next" in Emacs navigation conventions + (keybindings.includes('emacs') && key.ctrl && key.name === 'n'); +export const isSpaceKey = (key) => key.name === 'space'; +export const isBackspaceKey = (key) => key.name === 'backspace'; +export const isTabKey = (key) => key.name === 'tab'; +export const isNumberKey = (key) => '1234567890'.includes(key.name); +export const isEnterKey = (key) => key.name === 'enter' || key.name === 'return'; +export const isShiftKey = (key) => key.shift; diff --git a/node_modules/@inquirer/core/dist/lib/make-theme.d.ts b/node_modules/@inquirer/core/dist/lib/make-theme.d.ts new file mode 100644 index 0000000..c7aae8b --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/make-theme.d.ts @@ -0,0 +1,3 @@ +import type { Prettify, PartialDeep } from '@inquirer/type'; +import { type Theme } from './theme.ts'; +export declare function makeTheme(...themes: ReadonlyArray>>): Prettify>; diff --git a/node_modules/@inquirer/core/dist/lib/make-theme.js b/node_modules/@inquirer/core/dist/lib/make-theme.js new file mode 100644 index 0000000..8086da6 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/make-theme.js @@ -0,0 +1,30 @@ +import { defaultTheme } from "./theme.js"; +function isPlainObject(value) { + if (typeof value !== 'object' || value === null) + return false; + let proto = value; + while (Object.getPrototypeOf(proto) !== null) { + proto = Object.getPrototypeOf(proto); + } + return Object.getPrototypeOf(value) === proto; +} +function deepMerge(...objects) { + const output = {}; + for (const obj of objects) { + for (const [key, value] of Object.entries(obj)) { + const prevValue = output[key]; + output[key] = + isPlainObject(prevValue) && isPlainObject(value) + ? deepMerge(prevValue, value) + : value; + } + } + return output; +} +export function makeTheme(...themes) { + const themesToMerge = [ + defaultTheme, + ...themes.filter((theme) => theme != null), + ]; + return deepMerge(...themesToMerge); +} diff --git a/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.d.ts b/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.d.ts new file mode 100644 index 0000000..47467c3 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.d.ts @@ -0,0 +1,16 @@ +import type { Prettify } from '@inquirer/type'; +export declare function usePagination({ items, active, renderItem, pageSize, loop, }: { + items: ReadonlyArray; + /** The index of the active item. */ + active: number; + /** Renders an item as part of a page. */ + renderItem: (layout: Prettify<{ + item: T; + index: number; + isActive: boolean; + }>) => string; + /** The size of the page. */ + pageSize: number; + /** Allows creating an infinitely looping list. `true` if unspecified. */ + loop?: boolean; +}): string; diff --git a/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js b/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js new file mode 100644 index 0000000..f3883d5 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js @@ -0,0 +1,121 @@ +import { useRef } from "../use-ref.js"; +import { readlineWidth, breakLines } from "../utils.js"; +function usePointerPosition({ active, renderedItems, pageSize, loop, }) { + const state = useRef({ + lastPointer: active, + lastActive: undefined, + }); + const { lastPointer, lastActive } = state.current; + const middle = Math.floor(pageSize / 2); + const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0); + const defaultPointerPosition = renderedItems + .slice(0, active) + .reduce((acc, item) => acc + item.length, 0); + let pointer = defaultPointerPosition; + if (renderedLength > pageSize) { + if (loop) { + /** + * Creates the next position for the pointer considering an infinitely + * looping list of items to be rendered on the page. + * + * The goal is to progressively move the cursor to the middle position as the user move down, and then keep + * the cursor there. When the user move up, maintain the cursor position. + */ + // By default, keep the cursor position as-is. + pointer = lastPointer; + if ( + // First render, skip this logic. + lastActive != null && + // Only move the pointer down when the user moves down. + lastActive < active && + // Check user didn't move up across page boundary. + active - lastActive < pageSize) { + pointer = Math.min( + // Furthest allowed position for the pointer is the middle of the list + middle, Math.abs(active - lastActive) === 1 + ? Math.min( + // Move the pointer at most the height of the last active item. + lastPointer + (renderedItems[lastActive]?.length ?? 0), + // If the user moved by one item, move the pointer to the natural position of the active item as + // long as it doesn't move the cursor up. + Math.max(defaultPointerPosition, lastPointer)) + : // Otherwise, move the pointer down by the difference between the active and last active item. + lastPointer + active - lastActive); + } + } + else { + /** + * Creates the next position for the pointer considering a finite list of + * items to be rendered on a page. + * + * The goal is to keep the pointer in the middle of the page whenever possible, until + * we reach the bounds of the list (top or bottom). In which case, the cursor moves progressively + * to the bottom or top of the list. + */ + const spaceUnderActive = renderedItems + .slice(active) + .reduce((acc, item) => acc + item.length, 0); + pointer = + spaceUnderActive < pageSize - middle + ? // If the active item is near the end of the list, progressively move the cursor towards the end. + pageSize - spaceUnderActive + : // Otherwise, progressively move the pointer to the middle of the list. + Math.min(defaultPointerPosition, middle); + } + } + // Save state for the next render + state.current.lastPointer = pointer; + state.current.lastActive = active; + return pointer; +} +export function usePagination({ items, active, renderItem, pageSize, loop = true, }) { + const width = readlineWidth(); + const bound = (num) => ((num % items.length) + items.length) % items.length; + const renderedItems = items.map((item, index) => { + if (item == null) + return []; + return breakLines(renderItem({ item, index, isActive: index === active }), width).split('\n'); + }); + const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0); + const renderItemAtIndex = (index) => renderedItems[index] ?? []; + const pointer = usePointerPosition({ active, renderedItems, pageSize, loop }); + // Render the active item to decide the position. + // If the active item fits under the pointer, we render it there. + // Otherwise, we need to render it to fit at the bottom of the page; moving the pointer up. + const activeItem = renderItemAtIndex(active).slice(0, pageSize); + const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length; + // Create an array of lines for the page, and add the lines of the active item into the page + const pageBuffer = Array.from({ length: pageSize }); + pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem); + // Store to prevent rendering the same item twice + const itemVisited = new Set([active]); + // Fill the page under the active item + let bufferPointer = activeItemPosition + activeItem.length; + let itemPointer = bound(active + 1); + while (bufferPointer < pageSize && + !itemVisited.has(itemPointer) && + (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) { + const lines = renderItemAtIndex(itemPointer); + const linesToAdd = lines.slice(0, pageSize - bufferPointer); + pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd); + // Move pointers for next iteration + itemVisited.add(itemPointer); + bufferPointer += linesToAdd.length; + itemPointer = bound(itemPointer + 1); + } + // Fill the page over the active item + bufferPointer = activeItemPosition - 1; + itemPointer = bound(active - 1); + while (bufferPointer >= 0 && + !itemVisited.has(itemPointer) && + (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) { + const lines = renderItemAtIndex(itemPointer); + const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1)); + pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd); + // Move pointers for next iteration + itemVisited.add(itemPointer); + bufferPointer -= linesToAdd.length; + itemPointer = bound(itemPointer - 1); + } + return pageBuffer.filter((line) => typeof line === 'string').join('\n'); +} diff --git a/node_modules/@inquirer/core/dist/lib/promise-polyfill.d.ts b/node_modules/@inquirer/core/dist/lib/promise-polyfill.d.ts new file mode 100644 index 0000000..0e4f74c --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/promise-polyfill.d.ts @@ -0,0 +1,7 @@ +export declare class PromisePolyfill extends Promise { + static withResolver(): { + promise: Promise; + resolve: (value: T) => void; + reject: (error: unknown) => void; + }; +} diff --git a/node_modules/@inquirer/core/dist/lib/promise-polyfill.js b/node_modules/@inquirer/core/dist/lib/promise-polyfill.js new file mode 100644 index 0000000..621708e --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/promise-polyfill.js @@ -0,0 +1,14 @@ +// TODO: Remove this class once Node 22 becomes the minimum supported version. +export class PromisePolyfill extends Promise { + // Available starting from Node 22 + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers + static withResolver() { + let resolve; + let reject; + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + return { promise, resolve: resolve, reject: reject }; + } +} diff --git a/node_modules/@inquirer/core/dist/lib/screen-manager.d.ts b/node_modules/@inquirer/core/dist/lib/screen-manager.d.ts new file mode 100644 index 0000000..de4c1e0 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/screen-manager.d.ts @@ -0,0 +1,14 @@ +import type { InquirerReadline } from '@inquirer/type'; +export default class ScreenManager { + private height; + private extraLinesUnderPrompt; + private cursorPos; + private readonly rl; + constructor(rl: InquirerReadline); + write(content: string): void; + render(content: string, bottomContent?: string): void; + checkCursorPos(): void; + done({ clearContent }: { + clearContent: boolean; + }): void; +} diff --git a/node_modules/@inquirer/core/dist/lib/screen-manager.js b/node_modules/@inquirer/core/dist/lib/screen-manager.js new file mode 100644 index 0000000..9d40f14 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/screen-manager.js @@ -0,0 +1,79 @@ +import { stripVTControlCharacters } from 'node:util'; +import { breakLines, readlineWidth } from "./utils.js"; +import { cursorDown, cursorUp, cursorTo, cursorShow, eraseLines } from '@inquirer/ansi'; +const height = (content) => content.split('\n').length; +const lastLine = (content) => content.split('\n').pop() ?? ''; +export default class ScreenManager { + // These variables are keeping information to allow correct prompt re-rendering + height = 0; + extraLinesUnderPrompt = 0; + cursorPos; + rl; + constructor(rl) { + this.rl = rl; + this.cursorPos = rl.getCursorPos(); + } + write(content) { + this.rl.output.unmute(); + this.rl.output.write(content); + this.rl.output.mute(); + } + render(content, bottomContent = '') { + // Write message to screen and setPrompt to control backspace + const promptLine = lastLine(content); + const rawPromptLine = stripVTControlCharacters(promptLine); + // Remove the rl.line from our prompt. We can't rely on the content of + // rl.line (mainly because of the password prompt), so just rely on it's + // length. + let prompt = rawPromptLine; + if (this.rl.line.length > 0) { + prompt = prompt.slice(0, -this.rl.line.length); + } + this.rl.setPrompt(prompt); + // SetPrompt will change cursor position, now we can get correct value + this.cursorPos = this.rl.getCursorPos(); + const width = readlineWidth(); + content = breakLines(content, width); + bottomContent = breakLines(bottomContent, width); + // Manually insert an extra line if we're at the end of the line. + // This prevent the cursor from appearing at the beginning of the + // current line. + if (rawPromptLine.length % width === 0) { + content += '\n'; + } + let output = content + (bottomContent ? '\n' + bottomContent : ''); + /** + * Re-adjust the cursor at the correct position. + */ + // We need to consider parts of the prompt under the cursor as part of the bottom + // content in order to correctly cleanup and re-render. + const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows; + const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0); + // Return cursor to the input position (on top of the bottomContent) + if (bottomContentHeight > 0) + output += cursorUp(bottomContentHeight); + // Return cursor to the initial left offset. + output += cursorTo(this.cursorPos.cols); + /** + * Render and store state for future re-rendering + */ + this.write(cursorDown(this.extraLinesUnderPrompt) + eraseLines(this.height) + output); + this.extraLinesUnderPrompt = bottomContentHeight; + this.height = height(output); + } + checkCursorPos() { + const cursorPos = this.rl.getCursorPos(); + if (cursorPos.cols !== this.cursorPos.cols) { + this.write(cursorTo(cursorPos.cols)); + this.cursorPos = cursorPos; + } + } + done({ clearContent }) { + this.rl.setPrompt(''); + let output = cursorDown(this.extraLinesUnderPrompt); + output += clearContent ? eraseLines(this.height) : '\n'; + output += cursorShow; + this.write(output); + this.rl.close(); + } +} diff --git a/node_modules/@inquirer/core/dist/lib/theme.d.ts b/node_modules/@inquirer/core/dist/lib/theme.d.ts new file mode 100644 index 0000000..d963437 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/theme.d.ts @@ -0,0 +1,155 @@ +import type { Prettify } from '@inquirer/type'; +/** + * Union type representing the possible statuses of a prompt. + * + * - `'loading'`: The prompt is currently loading. + * - `'idle'`: The prompt is loaded and currently waiting for the user to + * submit an answer. + * - `'done'`: The user has submitted an answer and the prompt is finished. + * - `string`: Any other string: The prompt is in a custom state. + */ +export type Status = 'loading' | 'idle' | 'done' | (string & {}); +type DefaultTheme = { + /** + * Prefix to prepend to the message. If a function is provided, it will be + * called with the current status of the prompt, and the return value will be + * used as the prefix. + * + * @remarks + * If `status === 'loading'`, this property is ignored and the spinner (styled + * by the `spinner` property) will be displayed instead. + * + * @defaultValue + * ```ts + * // import { styleText } from 'node:util'; + * (status) => status === 'done' ? styleText('green', '✔') : styleText('blue', '?') + * ``` + */ + prefix: string | Prettify, 'loading'>>; + /** + * Configuration for the spinner that is displayed when the prompt is in the + * `'loading'` state. + * + * We recommend the use of {@link https://github.com/sindresorhus/cli-spinners|cli-spinners} for a list of available spinners. + */ + spinner: { + /** + * The time interval between frames, in milliseconds. + * + * @defaultValue + * ```ts + * 80 + * ``` + */ + interval: number; + /** + * A list of frames to show for the spinner. + * + * @defaultValue + * ```ts + * ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'] + * ``` + */ + frames: string[]; + }; + /** + * Object containing functions to style different parts of the prompt. + */ + style: { + /** + * Style to apply to the user's answer once it has been submitted. + * + * @param text - The user's answer. + * @returns The styled answer. + * + * @defaultValue + * ```ts + * // import { styleText } from 'node:util'; + * (text) => styleText('cyan', text) + * ``` + */ + answer: (text: string) => string; + /** + * Style to apply to the message displayed to the user. + * + * @param text - The message to style. + * @param status - The current status of the prompt. + * @returns The styled message. + * + * @defaultValue + * ```ts + * // import { styleText } from 'node:util'; + * (text, status) => styleText('bold', text) + * ``` + */ + message: (text: string, status: Status) => string; + /** + * Style to apply to error messages. + * + * @param text - The error message. + * @returns The styled error message. + * + * @defaultValue + * ```ts + * // import { styleText } from 'node:util'; + * (text) => styleText('red', `> ${text}`) + * ``` + */ + error: (text: string) => string; + /** + * Style to apply to the default answer when one is provided. + * + * @param text - The default answer. + * @returns The styled default answer. + * + * @defaultValue + * ```ts + * // import { styleText } from 'node:util'; + * (text) => styleText('dim', `(${text})`) + * ``` + */ + defaultAnswer: (text: string) => string; + /** + * Style to apply to help text. + * + * @param text - The help text. + * @returns The styled help text. + * + * @defaultValue + * ```ts + * // import { styleText } from 'node:util'; + * (text) => styleText('dim', text) + * ``` + */ + help: (text: string) => string; + /** + * Style to apply to highlighted text. + * + * @param text - The text to highlight. + * @returns The highlighted text. + * + * @defaultValue + * ```ts + * // import { styleText } from 'node:util'; + * (text) => styleText('cyan', text) + * ``` + */ + highlight: (text: string) => string; + /** + * Style to apply to keyboard keys referred to in help texts. + * + * @param text - The key to style. + * @returns The styled key. + * + * @defaultValue + * ```ts + * // import { styleText } from 'node:util'; + * (text) => styleText('cyan', styleText('bold', `<${text}>`)) + * ``` + */ + key: (text: string) => string; + }; +}; +export type Theme = Prettify; +export declare const defaultTheme: DefaultTheme; +export {}; diff --git a/node_modules/@inquirer/core/dist/lib/theme.js b/node_modules/@inquirer/core/dist/lib/theme.js new file mode 100644 index 0000000..216fe91 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/theme.js @@ -0,0 +1,21 @@ +import { styleText } from 'node:util'; +import figures from '@inquirer/figures'; +export const defaultTheme = { + prefix: { + idle: styleText('blue', '?'), + done: styleText('green', figures.tick), + }, + spinner: { + interval: 80, + frames: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'].map((frame) => styleText('yellow', frame)), + }, + style: { + answer: (text) => styleText('cyan', text), + message: (text) => styleText('bold', text), + error: (text) => styleText('red', `> ${text}`), + defaultAnswer: (text) => styleText('dim', `(${text})`), + help: (text) => styleText('dim', text), + highlight: (text) => styleText('cyan', text), + key: (text) => styleText('cyan', styleText('bold', `<${text}>`)), + }, +}; diff --git a/node_modules/@inquirer/core/dist/lib/use-effect.d.ts b/node_modules/@inquirer/core/dist/lib/use-effect.d.ts new file mode 100644 index 0000000..abee906 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/use-effect.d.ts @@ -0,0 +1,2 @@ +import type { InquirerReadline } from '@inquirer/type'; +export declare function useEffect(cb: (rl: InquirerReadline) => void | (() => void), depArray: ReadonlyArray): void; diff --git a/node_modules/@inquirer/core/dist/lib/use-effect.js b/node_modules/@inquirer/core/dist/lib/use-effect.js new file mode 100644 index 0000000..1c1a9ca --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/use-effect.js @@ -0,0 +1,11 @@ +import { withPointer, effectScheduler } from "./hook-engine.js"; +export function useEffect(cb, depArray) { + withPointer((pointer) => { + const oldDeps = pointer.get(); + const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i])); + if (hasChanged) { + effectScheduler.queue(cb); + } + pointer.set(depArray); + }); +} diff --git a/node_modules/@inquirer/core/dist/lib/use-keypress.d.ts b/node_modules/@inquirer/core/dist/lib/use-keypress.d.ts new file mode 100644 index 0000000..ccdeefa --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/use-keypress.d.ts @@ -0,0 +1,3 @@ +import { type InquirerReadline } from '@inquirer/type'; +import { type KeypressEvent } from './key.ts'; +export declare function useKeypress(userHandler: (event: KeypressEvent, rl: InquirerReadline) => void | Promise): void; diff --git a/node_modules/@inquirer/core/dist/lib/use-keypress.js b/node_modules/@inquirer/core/dist/lib/use-keypress.js new file mode 100644 index 0000000..4ff9b89 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/use-keypress.js @@ -0,0 +1,20 @@ +import { useRef } from "./use-ref.js"; +import { useEffect } from "./use-effect.js"; +import { withUpdates } from "./hook-engine.js"; +export function useKeypress(userHandler) { + const signal = useRef(userHandler); + signal.current = userHandler; + useEffect((rl) => { + let ignore = false; + const handler = withUpdates((_input, event) => { + if (ignore) + return; + void signal.current(event, rl); + }); + rl.input.on('keypress', handler); + return () => { + ignore = true; + rl.input.removeListener('keypress', handler); + }; + }, []); +} diff --git a/node_modules/@inquirer/core/dist/lib/use-memo.d.ts b/node_modules/@inquirer/core/dist/lib/use-memo.d.ts new file mode 100644 index 0000000..19d1644 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/use-memo.d.ts @@ -0,0 +1 @@ +export declare function useMemo(fn: () => Value, dependencies: ReadonlyArray): Value; diff --git a/node_modules/@inquirer/core/dist/lib/use-memo.js b/node_modules/@inquirer/core/dist/lib/use-memo.js new file mode 100644 index 0000000..0395f4e --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/use-memo.js @@ -0,0 +1,14 @@ +import { withPointer } from "./hook-engine.js"; +export function useMemo(fn, dependencies) { + return withPointer((pointer) => { + const prev = pointer.get(); + if (!prev || + prev.dependencies.length !== dependencies.length || + prev.dependencies.some((dep, i) => dep !== dependencies[i])) { + const value = fn(); + pointer.set({ value, dependencies }); + return value; + } + return prev.value; + }); +} diff --git a/node_modules/@inquirer/core/dist/lib/use-prefix.d.ts b/node_modules/@inquirer/core/dist/lib/use-prefix.d.ts new file mode 100644 index 0000000..db1dabb --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/use-prefix.d.ts @@ -0,0 +1,5 @@ +import type { Theme, Status } from './theme.ts'; +export declare function usePrefix({ status, theme, }: { + status?: Status; + theme?: Theme; +}): string; diff --git a/node_modules/@inquirer/core/dist/lib/use-prefix.js b/node_modules/@inquirer/core/dist/lib/use-prefix.js new file mode 100644 index 0000000..d334a50 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/use-prefix.js @@ -0,0 +1,35 @@ +import { useState } from "./use-state.js"; +import { useEffect } from "./use-effect.js"; +import { makeTheme } from "./make-theme.js"; +export function usePrefix({ status = 'idle', theme, }) { + const [showLoader, setShowLoader] = useState(false); + const [tick, setTick] = useState(0); + const { prefix, spinner } = makeTheme(theme); + useEffect(() => { + if (status === 'loading') { + let tickInterval; + let inc = -1; + // Delay displaying spinner by 300ms, to avoid flickering + const delayTimeout = setTimeout(() => { + setShowLoader(true); + tickInterval = setInterval(() => { + inc = inc + 1; + setTick(inc % spinner.frames.length); + }, spinner.interval); + }, 300); + return () => { + clearTimeout(delayTimeout); + clearInterval(tickInterval); + }; + } + else { + setShowLoader(false); + } + }, [status]); + if (showLoader) { + return spinner.frames[tick]; + } + // There's a delay before we show the loader. So we want to ignore `loading` here, and pass idle instead. + const iconName = status === 'loading' ? 'idle' : status; + return typeof prefix === 'string' ? prefix : (prefix[iconName] ?? prefix['idle']); +} diff --git a/node_modules/@inquirer/core/dist/lib/use-ref.d.ts b/node_modules/@inquirer/core/dist/lib/use-ref.d.ts new file mode 100644 index 0000000..be7126b --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/use-ref.d.ts @@ -0,0 +1,6 @@ +export declare function useRef(val: Value): { + current: Value; +}; +export declare function useRef(val?: Value): { + current: Value | undefined; +}; diff --git a/node_modules/@inquirer/core/dist/lib/use-ref.js b/node_modules/@inquirer/core/dist/lib/use-ref.js new file mode 100644 index 0000000..a025561 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/use-ref.js @@ -0,0 +1,4 @@ +import { useState } from "./use-state.js"; +export function useRef(val) { + return useState({ current: val })[0]; +} diff --git a/node_modules/@inquirer/core/dist/lib/use-state.d.ts b/node_modules/@inquirer/core/dist/lib/use-state.d.ts new file mode 100644 index 0000000..fba0b62 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/use-state.d.ts @@ -0,0 +1,4 @@ +type NotFunction = T extends (...args: never) => unknown ? never : T; +export declare function useState(defaultValue: NotFunction | (() => Value)): [Value, (newValue: Value) => void]; +export declare function useState(defaultValue?: NotFunction | (() => Value)): [Value | undefined, (newValue?: Value) => void]; +export {}; diff --git a/node_modules/@inquirer/core/dist/lib/use-state.js b/node_modules/@inquirer/core/dist/lib/use-state.js new file mode 100644 index 0000000..c6b928d --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/use-state.js @@ -0,0 +1,20 @@ +import { AsyncResource } from 'node:async_hooks'; +import { withPointer, handleChange } from "./hook-engine.js"; +export function useState(defaultValue) { + return withPointer((pointer) => { + const setState = AsyncResource.bind(function setState(newValue) { + // Noop if the value is still the same. + if (pointer.get() !== newValue) { + pointer.set(newValue); + // Trigger re-render + handleChange(); + } + }); + if (pointer.initialized) { + return [pointer.get(), setState]; + } + const value = typeof defaultValue === 'function' ? defaultValue() : defaultValue; + pointer.set(value); + return [value, setState]; + }); +} diff --git a/node_modules/@inquirer/core/dist/lib/utils.d.ts b/node_modules/@inquirer/core/dist/lib/utils.d.ts new file mode 100644 index 0000000..14f8fc4 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/utils.d.ts @@ -0,0 +1,13 @@ +/** + * Force line returns at specific width. This function is ANSI code friendly and it'll + * ignore invisible codes during width calculation. + * @param {string} content + * @param {number} width + * @return {string} + */ +export declare function breakLines(content: string, width: number): string; +/** + * Returns the width of the active readline, or 80 as default value. + * @returns {number} + */ +export declare function readlineWidth(): number; diff --git a/node_modules/@inquirer/core/dist/lib/utils.js b/node_modules/@inquirer/core/dist/lib/utils.js new file mode 100644 index 0000000..259eb07 --- /dev/null +++ b/node_modules/@inquirer/core/dist/lib/utils.js @@ -0,0 +1,25 @@ +import cliWidth from 'cli-width'; +import wrapAnsi from 'wrap-ansi'; +import { readline } from "./hook-engine.js"; +/** + * Force line returns at specific width. This function is ANSI code friendly and it'll + * ignore invisible codes during width calculation. + * @param {string} content + * @param {number} width + * @return {string} + */ +export function breakLines(content, width) { + return content + .split('\n') + .flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }) + .split('\n') + .map((str) => str.trimEnd())) + .join('\n'); +} +/** + * Returns the width of the active readline, or 80 as default value. + * @returns {number} + */ +export function readlineWidth() { + return cliWidth({ defaultWidth: 80, output: readline().output }); +} diff --git a/node_modules/@inquirer/core/package.json b/node_modules/@inquirer/core/package.json new file mode 100644 index 0000000..437ebf7 --- /dev/null +++ b/node_modules/@inquirer/core/package.json @@ -0,0 +1,98 @@ +{ + "name": "@inquirer/core", + "version": "11.1.1", + "description": "Core Inquirer prompt API", + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/core/README.md", + "license": "MIT", + "author": "Simon Boudrias ", + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "tsc": "tsc" + }, + "dependencies": { + "@inquirer/ansi": "^2.0.3", + "@inquirer/figures": "^2.0.3", + "@inquirer/type": "^4.0.3", + "cli-width": "^4.1.0", + "mute-stream": "^3.0.0", + "signal-exit": "^4.1.0", + "wrap-ansi": "^9.0.2" + }, + "devDependencies": { + "@inquirer/testing": "^3.0.4", + "@types/mute-stream": "^0.0.4", + "@types/node": "^25.0.2", + "typescript": "^5.9.3" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "gitHead": "99d00a9adc53be8b7edf5926b2ec4ba0b792f68f" +} diff --git a/node_modules/@inquirer/editor/LICENSE b/node_modules/@inquirer/editor/LICENSE new file mode 100644 index 0000000..f718698 --- /dev/null +++ b/node_modules/@inquirer/editor/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2025 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@inquirer/editor/README.md b/node_modules/@inquirer/editor/README.md new file mode 100644 index 0000000..b7be322 --- /dev/null +++ b/node_modules/@inquirer/editor/README.md @@ -0,0 +1,101 @@ +# `@inquirer/editor` + +Prompt that'll open the user preferred editor with default content and allow for a convenient multi-line input controlled through the command line. + +The editor launched is the one [defined by the user's `EDITOR` environment variable](https://dev.to/jonasbn/til-integrate-visual-studio-code-with-shell--cli-2l1l). + +# Installation + + + + + + + + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/prompts +``` + + + +```sh +yarn add @inquirer/prompts +``` + +
Or
+ +```sh +npm install @inquirer/editor +``` + + + +```sh +yarn add @inquirer/editor +``` + +
+ +# Usage + +```js +import { editor } from '@inquirer/prompts'; +// Or +// import editor from '@inquirer/editor'; + +const answer = await editor({ + message: 'Enter a description', +}); +``` + +## Options + +| Property | Type | Required | Description | +| ---------------- | ------------------------------------------------------------------------------ | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| default | `string` | no | Default value which will automatically be present in the editor | +| validate | `string => boolean \| string \| Promise` | no | On submit, validate the content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. | +| postfix | `string` | no (default to `.txt`) | The postfix of the file being edited. Adding this will add color highlighting to the file content in most editors. | +| file | [`IFileOptions`](https://github.com/mrkmg/node-external-editor#config-options) | no | Exposes the [`external-editor` package options](https://github.com/mrkmg/node-external-editor#config-options) to configure the temporary file. | +| waitForUserInput | `boolean` | no (default to `true`) | Open the editor automatically without waiting for the user to press enter. Note that this mean the user will not see the question! So make sure you have a default value that provide guidance if it's unclear what input is expected. | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string | { idle: string; done: string }; + spinner: { + interval: number; + frames: string[]; + }; + style: { + message: (text: string, status: 'idle' | 'done' | 'loading') => string; + error: (text: string) => string; + help: (text: string) => string; + key: (text: string) => string; + }; + validationFailureMode: 'keep' | 'clear'; +}; +``` + +`validationFailureMode` defines the behavior of the prompt when the value submitted is invalid. By default, we'll keep the value allowing the user to edit it. When the theme option is set to `clear`, we'll remove and reset to the default value or empty string. + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/node_modules/@inquirer/editor/dist/index.d.ts b/node_modules/@inquirer/editor/dist/index.d.ts new file mode 100644 index 0000000..6d9d763 --- /dev/null +++ b/node_modules/@inquirer/editor/dist/index.d.ts @@ -0,0 +1,17 @@ +import { type IFileOptions } from '@inquirer/external-editor'; +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type EditorTheme = { + validationFailureMode: 'keep' | 'clear'; +}; +type EditorConfig = { + message: string; + default?: string; + postfix?: string; + waitForUserInput?: boolean; + validate?: (value: string) => boolean | string | Promise; + file?: IFileOptions; + theme?: PartialDeep>; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/node_modules/@inquirer/editor/dist/index.js b/node_modules/@inquirer/editor/dist/index.js new file mode 100644 index 0000000..9f08d59 --- /dev/null +++ b/node_modules/@inquirer/editor/dist/index.js @@ -0,0 +1,74 @@ +import { editAsync } from '@inquirer/external-editor'; +import { createPrompt, useEffect, useState, useKeypress, usePrefix, isEnterKey, makeTheme, } from '@inquirer/core'; +const editorTheme = { + validationFailureMode: 'keep', +}; +export default createPrompt((config, done) => { + const { waitForUserInput = true, file: { postfix = config.postfix ?? '.txt', ...fileProps } = {}, validate = () => true, } = config; + const theme = makeTheme(editorTheme, config.theme); + const [status, setStatus] = useState('idle'); + const [value = '', setValue] = useState(config.default); + const [errorMsg, setError] = useState(); + const prefix = usePrefix({ status, theme }); + function startEditor(rl) { + rl.pause(); + const editCallback = async (error, answer) => { + rl.resume(); + if (error) { + setError(error.toString()); + } + else { + setStatus('loading'); + const finalAnswer = answer ?? ''; + const isValid = await validate(finalAnswer); + if (isValid === true) { + setError(undefined); + setStatus('done'); + done(finalAnswer); + } + else { + if (theme.validationFailureMode === 'clear') { + setValue(config.default); + } + else { + setValue(finalAnswer); + } + setError(isValid || 'You must provide a valid value'); + setStatus('idle'); + } + } + }; + editAsync(value, (error, answer) => void editCallback(error, answer), { + postfix, + ...fileProps, + }); + } + useEffect((rl) => { + if (!waitForUserInput) { + startEditor(rl); + } + }, []); + useKeypress((key, rl) => { + // Ignore keypress while our prompt is doing other processing. + if (status !== 'idle') { + return; + } + if (isEnterKey(key)) { + startEditor(rl); + } + }); + const message = theme.style.message(config.message, status); + let helpTip = ''; + if (status === 'loading') { + helpTip = theme.style.help('Received'); + } + else if (status === 'idle') { + const enterKey = theme.style.key('enter'); + helpTip = theme.style.help(`Press ${enterKey} to launch your preferred editor.`); + } + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [[prefix, message, helpTip].filter(Boolean).join(' '), error]; +}); diff --git a/node_modules/@inquirer/editor/package.json b/node_modules/@inquirer/editor/package.json new file mode 100644 index 0000000..96212c3 --- /dev/null +++ b/node_modules/@inquirer/editor/package.json @@ -0,0 +1,92 @@ +{ + "name": "@inquirer/editor", + "version": "5.0.4", + "description": "Inquirer multiline editor prompt", + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/editor/README.md", + "license": "MIT", + "author": "Simon Boudrias ", + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "tsc": "tsc" + }, + "dependencies": { + "@inquirer/core": "^11.1.1", + "@inquirer/external-editor": "^2.0.3", + "@inquirer/type": "^4.0.3" + }, + "devDependencies": { + "@inquirer/testing": "^3.0.4", + "typescript": "^5.9.3" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "gitHead": "99d00a9adc53be8b7edf5926b2ec4ba0b792f68f" +} diff --git a/node_modules/@inquirer/expand/LICENSE b/node_modules/@inquirer/expand/LICENSE new file mode 100644 index 0000000..f718698 --- /dev/null +++ b/node_modules/@inquirer/expand/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2025 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@inquirer/expand/README.md b/node_modules/@inquirer/expand/README.md new file mode 100644 index 0000000..8e17971 --- /dev/null +++ b/node_modules/@inquirer/expand/README.md @@ -0,0 +1,141 @@ +# `@inquirer/expand` + +Compact single select prompt. Every option is assigned a shortcut key, and selecting `h` will expand all the choices and their descriptions. + +![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg) +![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg) + +# Installation + + + + + + + + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/prompts +``` + + + +```sh +yarn add @inquirer/prompts +``` + +
Or
+ +```sh +npm install @inquirer/expand +``` + + + +```sh +yarn add @inquirer/expand +``` + +
+ +# Usage + +```js +import { expand } from '@inquirer/prompts'; +// Or +// import expand from '@inquirer/expand'; + +const answer = await expand({ + message: 'Conflict on file.js', + default: 'y', + choices: [ + { + key: 'y', + name: 'Overwrite', + value: 'overwrite', + }, + { + key: 'a', + name: 'Overwrite this one and all next', + value: 'overwrite_all', + }, + { + key: 'd', + name: 'Show diff', + value: 'diff', + }, + { + key: 'x', + name: 'Abort', + value: 'abort', + }, + ], +}); +``` + +## Options + +| Property | Type | Required | Description | +| -------- | ----------------------- | -------- | ----------------------------------------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| choices | `Choice[]` | yes | Array of the different allowed choices. The `h`/help option is always provided by default | +| default | `string` | no | Default choices to be selected. (value must be one of the choices `key`) | +| expanded | `boolean` | no | Expand the choices by default | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options. + +### `Choice` object + +The `Choice` object is typed as + +```ts +type Choice = { + value: Value; + name?: string; + key: string; +}; +``` + +Here's each property: + +- `value`: The value is what will be returned by `await expand()`. +- `name`: The string displayed in the choice list. It'll default to the stringify `value`. +- `key`: The input the use must provide to select the choice. Must be a lowercase single alpha-numeric character string. + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string | { idle: string; done: string }; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string, status: 'idle' | 'done' | 'loading') => string; + error: (text: string) => string; + defaultAnswer: (text: string) => string; + highlight: (text: string) => string; + }; +}; +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/node_modules/@inquirer/expand/dist/index.d.ts b/node_modules/@inquirer/expand/dist/index.d.ts new file mode 100644 index 0000000..464cf21 --- /dev/null +++ b/node_modules/@inquirer/expand/dist/index.d.ts @@ -0,0 +1,23 @@ +import { Separator, type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type Key = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'; +type Choice = { + key: Key; + value: Value; +} | { + key: Key; + name: string; + value: Value; +}; +declare const _default: (config: { + message: string; + choices: readonly { + key: Key; + name: string; + }[] | readonly (Separator | Choice)[]; + default?: (Key | "h") | undefined; + expanded?: boolean | undefined; + theme?: PartialDeep | undefined; +}, context?: import("@inquirer/type").Context) => Promise; +export default _default; +export { Separator } from '@inquirer/core'; diff --git a/node_modules/@inquirer/expand/dist/index.js b/node_modules/@inquirer/expand/dist/index.js new file mode 100644 index 0000000..6b04fea --- /dev/null +++ b/node_modules/@inquirer/expand/dist/index.js @@ -0,0 +1,108 @@ +import { createPrompt, useMemo, useState, useKeypress, usePrefix, isEnterKey, makeTheme, Separator, } from '@inquirer/core'; +import { styleText } from 'node:util'; +function normalizeChoices(choices) { + return choices.map((choice) => { + if (Separator.isSeparator(choice)) { + return choice; + } + const name = 'name' in choice ? choice.name : String(choice.value); + const value = 'value' in choice ? choice.value : name; + return { + value: value, + name, + key: choice.key.toLowerCase(), + }; + }); +} +const helpChoice = { + key: 'h', + name: 'Help, list all options', + value: undefined, +}; +export default createPrompt((config, done) => { + const { default: defaultKey = 'h' } = config; + const choices = useMemo(() => normalizeChoices(config.choices), [config.choices]); + const [status, setStatus] = useState('idle'); + const [value, setValue] = useState(''); + const [expanded, setExpanded] = useState(config.expanded ?? false); + const [errorMsg, setError] = useState(); + const theme = makeTheme(config.theme); + const prefix = usePrefix({ theme, status }); + useKeypress((event, rl) => { + if (isEnterKey(event)) { + const answer = (value || defaultKey).toLowerCase(); + if (answer === 'h' && !expanded) { + setExpanded(true); + } + else { + const selectedChoice = choices.find((choice) => !Separator.isSeparator(choice) && choice.key === answer); + if (selectedChoice) { + setStatus('done'); + // Set the value as we might've selected the default one. + setValue(answer); + done(selectedChoice.value); + } + else if (value === '') { + setError('Please input a value'); + } + else { + setError(`"${styleText('red', value)}" isn't an available option`); + } + } + } + else { + setValue(rl.line); + setError(undefined); + } + }); + const message = theme.style.message(config.message, status); + if (status === 'done') { + // If the prompt is done, it's safe to assume there is a selected value. + const selectedChoice = choices.find((choice) => !Separator.isSeparator(choice) && choice.key === value.toLowerCase()); + return `${prefix} ${message} ${theme.style.answer(selectedChoice.name)}`; + } + const allChoices = expanded ? choices : [...choices, helpChoice]; + // Collapsed display style + let longChoices = ''; + let shortChoices = allChoices + .map((choice) => { + if (Separator.isSeparator(choice)) + return ''; + if (choice.key === defaultKey) { + return choice.key.toUpperCase(); + } + return choice.key; + }) + .join(''); + shortChoices = ` ${theme.style.defaultAnswer(shortChoices)}`; + // Expanded display style + if (expanded) { + shortChoices = ''; + longChoices = allChoices + .map((choice) => { + if (Separator.isSeparator(choice)) { + return ` ${choice.separator}`; + } + const line = ` ${choice.key}) ${choice.name}`; + if (choice.key === value.toLowerCase()) { + return theme.style.highlight(line); + } + return line; + }) + .join('\n'); + } + let helpTip = ''; + const currentOption = choices.find((choice) => !Separator.isSeparator(choice) && choice.key === value.toLowerCase()); + if (currentOption) { + helpTip = `${styleText('cyan', '>>')} ${currentOption.name}`; + } + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [ + `${prefix} ${message}${shortChoices} ${value}`, + [longChoices, helpTip, error].filter(Boolean).join('\n'), + ]; +}); +export { Separator } from '@inquirer/core'; diff --git a/node_modules/@inquirer/expand/package.json b/node_modules/@inquirer/expand/package.json new file mode 100644 index 0000000..eb22ff3 --- /dev/null +++ b/node_modules/@inquirer/expand/package.json @@ -0,0 +1,91 @@ +{ + "name": "@inquirer/expand", + "version": "5.0.4", + "description": "Inquirer checkbox prompt", + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/expand/README.md", + "license": "MIT", + "author": "Simon Boudrias ", + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "tsc": "tsc" + }, + "dependencies": { + "@inquirer/core": "^11.1.1", + "@inquirer/type": "^4.0.3" + }, + "devDependencies": { + "@inquirer/testing": "^3.0.4", + "typescript": "^5.9.3" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "gitHead": "99d00a9adc53be8b7edf5926b2ec4ba0b792f68f" +} diff --git a/node_modules/@inquirer/external-editor/LICENSE b/node_modules/@inquirer/external-editor/LICENSE new file mode 100644 index 0000000..f718698 --- /dev/null +++ b/node_modules/@inquirer/external-editor/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2025 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@inquirer/external-editor/README.md b/node_modules/@inquirer/external-editor/README.md new file mode 100644 index 0000000..980df00 --- /dev/null +++ b/node_modules/@inquirer/external-editor/README.md @@ -0,0 +1,154 @@ +# `@inquirer/external-editor` + +A Node.js module to edit a string with the user's preferred text editor using $VISUAL or $EDITOR. + +> [!NOTE] +> This package is a replacement for the unmaintained `external-editor`. It includes security fixes. + +# Installation + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/external-editor +``` + + + +```sh +yarn add @inquirer/external-editor +``` + +
+ +## Usage + +A simple example using the `edit` function + +```ts +import { edit } from '@inquirer/external-editor'; + +const data = edit('\n\n# Please write your text above'); +console.log(data); +``` + +Example relying on the class construct + +```ts +import { + ExternalEditor, + CreateFileError, + ReadFileError, + RemoveFileError, + LaunchEditorError, +} from '@inquirer/external-editor'; + +try { + const editor = new ExternalEditor(); + const text = editor.run(); // the text is also available in editor.text + + if (editor.lastExitStatus !== 0) { + console.log('The editor exited with a non-zero code'); + } + + // Do things with the text + editor.cleanup(); +} catch (err) { + if (err instanceof CreateFileError) { + console.log('Failed to create the temporary file'); + } else if (err instanceof ReadFileError) { + console.log('Failed to read the temporary file'); + } else if (err instanceof LaunchEditorError) { + console.log('Failed to launch your editor'); + } else if (err instanceof RemoveFileError) { + console.log('Failed to remove the temporary file'); + } else { + throw err; + } +} +``` + +#### API + +**Convenience Functions** + +- `edit(text, config)` + - `text` (string) _Optional_ Defaults to empty string + - `config` (Config) _Optional_ Options for temporary file creation + - **Returns** (string) The contents of the file + - Could throw `CreateFileError`, `ReadFileError`, or `LaunchEditorError`, or `RemoveFileError` +- `editAsync(text, callback, config)` + - `text` (string) _Optional_ Defaults to empty string + - `callback` (function (error?, text?)) + - `error` could be of type `CreateFileError`, `ReadFileError`, `LaunchEditorError`, or `RemoveFileError` + - `text` (string) The contents of the file + - `config` (Config) _Optional_ Options for temporary file creation + +**Errors** + +- `CreateFileError` Error thrown if the temporary file could not be created. +- `ReadFileError` Error thrown if the temporary file could not be read. +- `RemoveFileError` Error thrown if the temporary file could not be removed during cleanup. +- `LaunchEditorError` Error thrown if the editor could not be launched. + +**External Editor Public Methods** + +- `new ExternalEditor(text, config)` + - `text` (string) _Optional_ Defaults to empty string + - `config` (Config) _Optional_ Options for temporary file creation + - Could throw `CreateFileError` +- `run()` Launches the editor. + - **Returns** (string) The contents of the file + - Could throw `LaunchEditorError` or `ReadFileError` +- `runAsync(callback)` Launches the editor in an async way + - `callback` (function (error?, text?)) + - `error` could be of type `ReadFileError` or `LaunchEditorError` + - `text` (string) The contents of the file +- `cleanup()` Removes the temporary file. + - Could throw `RemoveFileError` + +**External Editor Public Properties** + +- `text` (string) _readonly_ The text in the temporary file. +- `editor.bin` (string) The editor determined from the environment. +- `editor.args` (array) Default arguments for the bin +- `tempFile` (string) Path to temporary file. Can be changed, but be careful as the temporary file probably already + exists and would need be removed manually. +- `lastExitStatus` (number) The last exit code emitted from the editor. + +**Config Options** + +- `prefix` (string) _Optional_ A prefix for the file name. +- `postfix` (string) _Optional_ A postfix for the file name. Useful if you want to provide an extension. +- `mode` (number) _Optional_ Which mode to create the file with. e.g. 644 +- `dir` (string) _Optional_ Which path to store the file. + +## Why Synchronous? + +Everything is synchronous to make sure the editor has complete control of the stdin and stdout. Testing has shown +async launching of the editor can lead to issues when using readline or other packages which try to read from stdin or +write to stdout. Seeing as this will be used in an interactive CLI environment, I made the decision to force the package +to be synchronous. If you know a reliable way to force all stdin and stdout to be limited only to the child_process, +please submit a PR. + +If async is really needed, you can use `editAsync` or `runAsync`. If you are using readline or have anything else +listening to the stdin or you write to stdout, you will most likely have problem, so make sure to remove any other +listeners on stdin, stdout, or stderr. + +## Demo + +[![asciicast](https://asciinema.org/a/a1qh9lypbe65mj0ivfuoslz2s.png)](https://asciinema.org/a/a1qh9lypbe65mj0ivfuoslz2s) + +# License + +Copyright (c) 2025 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/node_modules/@inquirer/external-editor/dist/errors/CreateFileError.d.ts b/node_modules/@inquirer/external-editor/dist/errors/CreateFileError.d.ts new file mode 100644 index 0000000..0df1b3d --- /dev/null +++ b/node_modules/@inquirer/external-editor/dist/errors/CreateFileError.d.ts @@ -0,0 +1,10 @@ +/*** + * Node External Editor + * + * Kevin Gravier + * MIT 2018 + */ +export declare class CreateFileError extends Error { + originalError: Error; + constructor(originalError: Error); +} diff --git a/node_modules/@inquirer/external-editor/dist/errors/CreateFileError.js b/node_modules/@inquirer/external-editor/dist/errors/CreateFileError.js new file mode 100644 index 0000000..6f52e5f --- /dev/null +++ b/node_modules/@inquirer/external-editor/dist/errors/CreateFileError.js @@ -0,0 +1,13 @@ +/*** + * Node External Editor + * + * Kevin Gravier + * MIT 2018 + */ +export class CreateFileError extends Error { + originalError; + constructor(originalError) { + super(`Failed to create temporary file. ${originalError.message}`); + this.originalError = originalError; + } +} diff --git a/node_modules/@inquirer/external-editor/dist/errors/LaunchEditorError.d.ts b/node_modules/@inquirer/external-editor/dist/errors/LaunchEditorError.d.ts new file mode 100644 index 0000000..105077c --- /dev/null +++ b/node_modules/@inquirer/external-editor/dist/errors/LaunchEditorError.d.ts @@ -0,0 +1,10 @@ +/*** + * Node External Editor + * + * Kevin Gravier + * MIT 2018 + */ +export declare class LaunchEditorError extends Error { + originalError: Error; + constructor(originalError: Error); +} diff --git a/node_modules/@inquirer/external-editor/dist/errors/LaunchEditorError.js b/node_modules/@inquirer/external-editor/dist/errors/LaunchEditorError.js new file mode 100644 index 0000000..43d7441 --- /dev/null +++ b/node_modules/@inquirer/external-editor/dist/errors/LaunchEditorError.js @@ -0,0 +1,13 @@ +/*** + * Node External Editor + * + * Kevin Gravier + * MIT 2018 + */ +export class LaunchEditorError extends Error { + originalError; + constructor(originalError) { + super(`Failed to launch editor. ${originalError.message}`); + this.originalError = originalError; + } +} diff --git a/node_modules/@inquirer/external-editor/dist/errors/ReadFileError.d.ts b/node_modules/@inquirer/external-editor/dist/errors/ReadFileError.d.ts new file mode 100644 index 0000000..438eae1 --- /dev/null +++ b/node_modules/@inquirer/external-editor/dist/errors/ReadFileError.d.ts @@ -0,0 +1,10 @@ +/*** + * Node External Editor + * + * Kevin Gravier + * MIT 2018 + */ +export declare class ReadFileError extends Error { + originalError: Error; + constructor(originalError: Error); +} diff --git a/node_modules/@inquirer/external-editor/dist/errors/ReadFileError.js b/node_modules/@inquirer/external-editor/dist/errors/ReadFileError.js new file mode 100644 index 0000000..fe2307e --- /dev/null +++ b/node_modules/@inquirer/external-editor/dist/errors/ReadFileError.js @@ -0,0 +1,13 @@ +/*** + * Node External Editor + * + * Kevin Gravier + * MIT 2018 + */ +export class ReadFileError extends Error { + originalError; + constructor(originalError) { + super(`Failed to read temporary file. ${originalError.message}`); + this.originalError = originalError; + } +} diff --git a/node_modules/@inquirer/external-editor/dist/errors/RemoveFileError.d.ts b/node_modules/@inquirer/external-editor/dist/errors/RemoveFileError.d.ts new file mode 100644 index 0000000..a6402e4 --- /dev/null +++ b/node_modules/@inquirer/external-editor/dist/errors/RemoveFileError.d.ts @@ -0,0 +1,10 @@ +/*** + * Node External Editor + * + * Kevin Gravier + * MIT 2018 + */ +export declare class RemoveFileError extends Error { + originalError: Error; + constructor(originalError: Error); +} diff --git a/node_modules/@inquirer/external-editor/dist/errors/RemoveFileError.js b/node_modules/@inquirer/external-editor/dist/errors/RemoveFileError.js new file mode 100644 index 0000000..4fe6313 --- /dev/null +++ b/node_modules/@inquirer/external-editor/dist/errors/RemoveFileError.js @@ -0,0 +1,13 @@ +/*** + * Node External Editor + * + * Kevin Gravier + * MIT 2018 + */ +export class RemoveFileError extends Error { + originalError; + constructor(originalError) { + super(`Failed to remove temporary file. ${originalError.message}`); + this.originalError = originalError; + } +} diff --git a/node_modules/@inquirer/external-editor/dist/index.d.ts b/node_modules/@inquirer/external-editor/dist/index.d.ts new file mode 100644 index 0000000..47b7c4b --- /dev/null +++ b/node_modules/@inquirer/external-editor/dist/index.d.ts @@ -0,0 +1,39 @@ +import { CreateFileError } from './errors/CreateFileError.ts'; +import { LaunchEditorError } from './errors/LaunchEditorError.ts'; +import { ReadFileError } from './errors/ReadFileError.ts'; +import { RemoveFileError } from './errors/RemoveFileError.ts'; +export interface IEditorParams { + args: string[]; + bin: string; +} +export interface IFileOptions { + prefix?: string; + postfix?: string; + mode?: number; + template?: string; + dir?: string; +} +export type StringCallback = (err: Error | undefined, result: string | undefined) => void; +export type VoidCallback = () => void; +export { CreateFileError, LaunchEditorError, ReadFileError, RemoveFileError }; +export declare function edit(text?: string, fileOptions?: IFileOptions): string; +export declare function editAsync(text: string | undefined, callback: StringCallback, fileOptions?: IFileOptions): void; +export declare class ExternalEditor { + text: string; + tempFile: string; + editor: IEditorParams; + lastExitStatus: number; + private fileOptions; + get temp_file(): string; + get last_exit_status(): number; + constructor(text?: string, fileOptions?: IFileOptions); + run(): string; + runAsync(callback: StringCallback): void; + cleanup(): void; + private determineEditor; + private createTemporaryFile; + private readTemporaryFile; + private removeTemporaryFile; + private launchEditor; + private launchEditorAsync; +} diff --git a/node_modules/@inquirer/external-editor/dist/index.js b/node_modules/@inquirer/external-editor/dist/index.js new file mode 100644 index 0000000..263244a --- /dev/null +++ b/node_modules/@inquirer/external-editor/dist/index.js @@ -0,0 +1,191 @@ +import { detect } from 'chardet'; +import { spawn, spawnSync } from 'child_process'; +import { readFileSync, unlinkSync, writeFileSync } from 'fs'; +import path from 'node:path'; +import os from 'node:os'; +import { randomUUID } from 'node:crypto'; +import iconv from 'iconv-lite'; +import { CreateFileError } from "./errors/CreateFileError.js"; +import { LaunchEditorError } from "./errors/LaunchEditorError.js"; +import { ReadFileError } from "./errors/ReadFileError.js"; +import { RemoveFileError } from "./errors/RemoveFileError.js"; +export { CreateFileError, LaunchEditorError, ReadFileError, RemoveFileError }; +export function edit(text = '', fileOptions) { + const editor = new ExternalEditor(text, fileOptions); + editor.run(); + editor.cleanup(); + return editor.text; +} +export function editAsync(text = '', callback, fileOptions) { + const editor = new ExternalEditor(text, fileOptions); + editor.runAsync((err, result) => { + if (err) { + setImmediate(callback, err, undefined); + } + else { + try { + editor.cleanup(); + setImmediate(callback, undefined, result); + } + catch (cleanupError) { + setImmediate(callback, cleanupError, undefined); + } + } + }); +} +function sanitizeAffix(affix) { + if (!affix) + return ''; + return affix.replace(/[^a-zA-Z0-9_.-]/g, '_'); +} +function splitStringBySpace(str) { + const pieces = []; + let currentString = ''; + for (let strIndex = 0; strIndex < str.length; strIndex++) { + const currentLetter = str.charAt(strIndex); + if (strIndex > 0 && + currentLetter === ' ' && + str[strIndex - 1] !== '\\' && + currentString.length > 0) { + pieces.push(currentString); + currentString = ''; + } + else { + currentString = `${currentString}${currentLetter}`; + } + } + if (currentString.length > 0) { + pieces.push(currentString); + } + return pieces; +} +export class ExternalEditor { + text = ''; + tempFile; + editor; + lastExitStatus = 0; + fileOptions = {}; + get temp_file() { + console.log('DEPRECATED: temp_file. Use tempFile moving forward.'); + return this.tempFile; + } + get last_exit_status() { + console.log('DEPRECATED: last_exit_status. Use lastExitStatus moving forward.'); + return this.lastExitStatus; + } + constructor(text = '', fileOptions) { + this.text = text; + if (fileOptions) { + this.fileOptions = fileOptions; + } + this.determineEditor(); + this.createTemporaryFile(); + } + run() { + this.launchEditor(); + this.readTemporaryFile(); + return this.text; + } + runAsync(callback) { + try { + this.launchEditorAsync(() => { + try { + this.readTemporaryFile(); + setImmediate(callback, undefined, this.text); + } + catch (readError) { + setImmediate(callback, readError, undefined); + } + }); + } + catch (launchError) { + setImmediate(callback, launchError, undefined); + } + } + cleanup() { + this.removeTemporaryFile(); + } + determineEditor() { + const editor = process.env['VISUAL'] + ? process.env['VISUAL'] + : process.env['EDITOR'] + ? process.env['EDITOR'] + : process.platform.startsWith('win') + ? 'notepad' + : 'vim'; + const editorOpts = splitStringBySpace(editor).map((piece) => piece.replace('\\ ', ' ')); + const bin = editorOpts.shift(); + this.editor = { args: editorOpts, bin }; + } + createTemporaryFile() { + try { + const baseDir = this.fileOptions.dir ?? os.tmpdir(); + const id = randomUUID(); + const prefix = sanitizeAffix(this.fileOptions.prefix); + const postfix = sanitizeAffix(this.fileOptions.postfix); + const filename = `${prefix}${id}${postfix}`; + const candidate = path.resolve(baseDir, filename); + const baseResolved = path.resolve(baseDir) + path.sep; + if (!candidate.startsWith(baseResolved)) { + throw new Error('Resolved temporary file escaped the base directory'); + } + this.tempFile = candidate; + const opt = { encoding: 'utf8', flag: 'wx' }; + if (Object.prototype.hasOwnProperty.call(this.fileOptions, 'mode')) { + opt.mode = this.fileOptions.mode; + } + writeFileSync(this.tempFile, this.text, opt); + } + catch (createFileError) { + throw new CreateFileError(createFileError); + } + } + readTemporaryFile() { + try { + const tempFileBuffer = readFileSync(this.tempFile); + if (tempFileBuffer.length === 0) { + this.text = ''; + } + else { + let encoding = detect(tempFileBuffer) ?? 'utf8'; + if (!iconv.encodingExists(encoding)) { + // Probably a bad idea, but will at least prevent crashing + encoding = 'utf8'; + } + this.text = iconv.decode(tempFileBuffer, encoding); + } + } + catch (readFileError) { + throw new ReadFileError(readFileError); + } + } + removeTemporaryFile() { + try { + unlinkSync(this.tempFile); + } + catch (removeFileError) { + throw new RemoveFileError(removeFileError); + } + } + launchEditor() { + try { + const editorProcess = spawnSync(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: 'inherit' }); + this.lastExitStatus = editorProcess.status ?? 0; + } + catch (launchError) { + throw new LaunchEditorError(launchError); + } + } + launchEditorAsync(callback) { + try { + const editorProcess = spawn(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: 'inherit' }); + editorProcess.on('exit', (code) => { + this.lastExitStatus = code; + setImmediate(callback); + }); + } + catch (launchError) { + throw new LaunchEditorError(launchError); + } + } +} diff --git a/node_modules/@inquirer/external-editor/package.json b/node_modules/@inquirer/external-editor/package.json new file mode 100644 index 0000000..5d60dd9 --- /dev/null +++ b/node_modules/@inquirer/external-editor/package.json @@ -0,0 +1,96 @@ +{ + "name": "@inquirer/external-editor", + "version": "2.0.3", + "description": "Edit a string with the users preferred text editor using $VISUAL or $ENVIRONMENT", + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "editor", + "enquirer", + "external", + "external-editor", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "user", + "visual", + "yeoman", + "yo", + "zsh" + ], + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/external-editor/README.md", + "license": "MIT", + "author": "Simon Boudrias ", + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "tsc": "tsc" + }, + "dependencies": { + "chardet": "^2.1.1", + "iconv-lite": "^0.7.2" + }, + "devDependencies": { + "@types/chardet": "^1.0.0", + "typescript": "^5.9.3" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "gitHead": "99d00a9adc53be8b7edf5926b2ec4ba0b792f68f" +} diff --git a/node_modules/@inquirer/figures/LICENSE b/node_modules/@inquirer/figures/LICENSE new file mode 100644 index 0000000..f718698 --- /dev/null +++ b/node_modules/@inquirer/figures/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2025 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@inquirer/figures/dist/index.d.ts b/node_modules/@inquirer/figures/dist/index.d.ts new file mode 100644 index 0000000..f9e48b5 --- /dev/null +++ b/node_modules/@inquirer/figures/dist/index.d.ts @@ -0,0 +1,275 @@ +declare const common: { + circleQuestionMark: string; + questionMarkPrefix: string; + square: string; + squareDarkShade: string; + squareMediumShade: string; + squareLightShade: string; + squareTop: string; + squareBottom: string; + squareLeft: string; + squareRight: string; + squareCenter: string; + bullet: string; + dot: string; + ellipsis: string; + pointerSmall: string; + triangleUp: string; + triangleUpSmall: string; + triangleDown: string; + triangleDownSmall: string; + triangleLeftSmall: string; + triangleRightSmall: string; + home: string; + heart: string; + musicNote: string; + musicNoteBeamed: string; + arrowUp: string; + arrowDown: string; + arrowLeft: string; + arrowRight: string; + arrowLeftRight: string; + arrowUpDown: string; + almostEqual: string; + notEqual: string; + lessOrEqual: string; + greaterOrEqual: string; + identical: string; + infinity: string; + subscriptZero: string; + subscriptOne: string; + subscriptTwo: string; + subscriptThree: string; + subscriptFour: string; + subscriptFive: string; + subscriptSix: string; + subscriptSeven: string; + subscriptEight: string; + subscriptNine: string; + oneHalf: string; + oneThird: string; + oneQuarter: string; + oneFifth: string; + oneSixth: string; + oneEighth: string; + twoThirds: string; + twoFifths: string; + threeQuarters: string; + threeFifths: string; + threeEighths: string; + fourFifths: string; + fiveSixths: string; + fiveEighths: string; + sevenEighths: string; + line: string; + lineBold: string; + lineDouble: string; + lineDashed0: string; + lineDashed1: string; + lineDashed2: string; + lineDashed3: string; + lineDashed4: string; + lineDashed5: string; + lineDashed6: string; + lineDashed7: string; + lineDashed8: string; + lineDashed9: string; + lineDashed10: string; + lineDashed11: string; + lineDashed12: string; + lineDashed13: string; + lineDashed14: string; + lineDashed15: string; + lineVertical: string; + lineVerticalBold: string; + lineVerticalDouble: string; + lineVerticalDashed0: string; + lineVerticalDashed1: string; + lineVerticalDashed2: string; + lineVerticalDashed3: string; + lineVerticalDashed4: string; + lineVerticalDashed5: string; + lineVerticalDashed6: string; + lineVerticalDashed7: string; + lineVerticalDashed8: string; + lineVerticalDashed9: string; + lineVerticalDashed10: string; + lineVerticalDashed11: string; + lineDownLeft: string; + lineDownLeftArc: string; + lineDownBoldLeftBold: string; + lineDownBoldLeft: string; + lineDownLeftBold: string; + lineDownDoubleLeftDouble: string; + lineDownDoubleLeft: string; + lineDownLeftDouble: string; + lineDownRight: string; + lineDownRightArc: string; + lineDownBoldRightBold: string; + lineDownBoldRight: string; + lineDownRightBold: string; + lineDownDoubleRightDouble: string; + lineDownDoubleRight: string; + lineDownRightDouble: string; + lineUpLeft: string; + lineUpLeftArc: string; + lineUpBoldLeftBold: string; + lineUpBoldLeft: string; + lineUpLeftBold: string; + lineUpDoubleLeftDouble: string; + lineUpDoubleLeft: string; + lineUpLeftDouble: string; + lineUpRight: string; + lineUpRightArc: string; + lineUpBoldRightBold: string; + lineUpBoldRight: string; + lineUpRightBold: string; + lineUpDoubleRightDouble: string; + lineUpDoubleRight: string; + lineUpRightDouble: string; + lineUpDownLeft: string; + lineUpBoldDownBoldLeftBold: string; + lineUpBoldDownBoldLeft: string; + lineUpDownLeftBold: string; + lineUpBoldDownLeftBold: string; + lineUpDownBoldLeftBold: string; + lineUpDownBoldLeft: string; + lineUpBoldDownLeft: string; + lineUpDoubleDownDoubleLeftDouble: string; + lineUpDoubleDownDoubleLeft: string; + lineUpDownLeftDouble: string; + lineUpDownRight: string; + lineUpBoldDownBoldRightBold: string; + lineUpBoldDownBoldRight: string; + lineUpDownRightBold: string; + lineUpBoldDownRightBold: string; + lineUpDownBoldRightBold: string; + lineUpDownBoldRight: string; + lineUpBoldDownRight: string; + lineUpDoubleDownDoubleRightDouble: string; + lineUpDoubleDownDoubleRight: string; + lineUpDownRightDouble: string; + lineDownLeftRight: string; + lineDownBoldLeftBoldRightBold: string; + lineDownLeftBoldRightBold: string; + lineDownBoldLeftRight: string; + lineDownBoldLeftBoldRight: string; + lineDownBoldLeftRightBold: string; + lineDownLeftRightBold: string; + lineDownLeftBoldRight: string; + lineDownDoubleLeftDoubleRightDouble: string; + lineDownDoubleLeftRight: string; + lineDownLeftDoubleRightDouble: string; + lineUpLeftRight: string; + lineUpBoldLeftBoldRightBold: string; + lineUpLeftBoldRightBold: string; + lineUpBoldLeftRight: string; + lineUpBoldLeftBoldRight: string; + lineUpBoldLeftRightBold: string; + lineUpLeftRightBold: string; + lineUpLeftBoldRight: string; + lineUpDoubleLeftDoubleRightDouble: string; + lineUpDoubleLeftRight: string; + lineUpLeftDoubleRightDouble: string; + lineUpDownLeftRight: string; + lineUpBoldDownBoldLeftBoldRightBold: string; + lineUpDownBoldLeftBoldRightBold: string; + lineUpBoldDownLeftBoldRightBold: string; + lineUpBoldDownBoldLeftRightBold: string; + lineUpBoldDownBoldLeftBoldRight: string; + lineUpBoldDownLeftRight: string; + lineUpDownBoldLeftRight: string; + lineUpDownLeftBoldRight: string; + lineUpDownLeftRightBold: string; + lineUpBoldDownBoldLeftRight: string; + lineUpDownLeftBoldRightBold: string; + lineUpBoldDownLeftBoldRight: string; + lineUpBoldDownLeftRightBold: string; + lineUpDownBoldLeftBoldRight: string; + lineUpDownBoldLeftRightBold: string; + lineUpDoubleDownDoubleLeftDoubleRightDouble: string; + lineUpDoubleDownDoubleLeftRight: string; + lineUpDownLeftDoubleRightDouble: string; + lineCross: string; + lineBackslash: string; + lineSlash: string; +}; +declare const specialMainSymbols: { + tick: string; + info: string; + warning: string; + cross: string; + squareSmall: string; + squareSmallFilled: string; + circle: string; + circleFilled: string; + circleDotted: string; + circleDouble: string; + circleCircle: string; + circleCross: string; + circlePipe: string; + radioOn: string; + radioOff: string; + checkboxOn: string; + checkboxOff: string; + checkboxCircleOn: string; + checkboxCircleOff: string; + pointer: string; + triangleUpOutline: string; + triangleLeft: string; + triangleRight: string; + lozenge: string; + lozengeOutline: string; + hamburger: string; + smiley: string; + mustache: string; + star: string; + play: string; + nodejs: string; + oneSeventh: string; + oneNinth: string; + oneTenth: string; +}; +declare const specialFallbackSymbols: { + tick: string; + info: string; + warning: string; + cross: string; + squareSmall: string; + squareSmallFilled: string; + circle: string; + circleFilled: string; + circleDotted: string; + circleDouble: string; + circleCircle: string; + circleCross: string; + circlePipe: string; + radioOn: string; + radioOff: string; + checkboxOn: string; + checkboxOff: string; + checkboxCircleOn: string; + checkboxCircleOff: string; + pointer: string; + triangleUpOutline: string; + triangleLeft: string; + triangleRight: string; + lozenge: string; + lozengeOutline: string; + hamburger: string; + smiley: string; + mustache: string; + star: string; + play: string; + nodejs: string; + oneSeventh: string; + oneNinth: string; + oneTenth: string; +}; +export declare const mainSymbols: typeof common & typeof specialMainSymbols; +export declare const fallbackSymbols: (typeof common & typeof specialFallbackSymbols) & Record; +declare const figures: typeof mainSymbols | typeof fallbackSymbols; +export default figures; +export declare const replaceSymbols: (string: string, { useFallback }?: { + useFallback?: boolean; +}) => string; diff --git a/node_modules/@inquirer/figures/dist/index.js b/node_modules/@inquirer/figures/dist/index.js new file mode 100644 index 0000000..d81e664 --- /dev/null +++ b/node_modules/@inquirer/figures/dist/index.js @@ -0,0 +1,314 @@ +// process.env dot-notation access prints: +// Property 'TERM' comes from an index signature, so it must be accessed with ['TERM'].ts(4111) +/* eslint dot-notation: ["off"] */ +import process from 'node:process'; +// Ported from is-unicode-supported +function isUnicodeSupported() { + if (process.platform !== 'win32') { + return process.env['TERM'] !== 'linux'; // Linux console (kernel) + } + return (Boolean(process.env['WT_SESSION']) || // Windows Terminal + Boolean(process.env['TERMINUS_SUBLIME']) || // Terminus (<0.2.27) + process.env['ConEmuTask'] === '{cmd::Cmder}' || // ConEmu and cmder + process.env['TERM_PROGRAM'] === 'Terminus-Sublime' || + process.env['TERM_PROGRAM'] === 'vscode' || + process.env['TERM'] === 'xterm-256color' || + process.env['TERM'] === 'alacritty' || + process.env['TERMINAL_EMULATOR'] === 'JetBrains-JediTerm'); +} +// Ported from figures +const common = { + circleQuestionMark: '(?)', + questionMarkPrefix: '(?)', + square: '█', + squareDarkShade: '▓', + squareMediumShade: '▒', + squareLightShade: '░', + squareTop: '▀', + squareBottom: '▄', + squareLeft: '▌', + squareRight: '▐', + squareCenter: '■', + bullet: '●', + dot: '․', + ellipsis: '…', + pointerSmall: '›', + triangleUp: '▲', + triangleUpSmall: '▴', + triangleDown: '▼', + triangleDownSmall: '▾', + triangleLeftSmall: '◂', + triangleRightSmall: '▸', + home: '⌂', + heart: '♥', + musicNote: '♪', + musicNoteBeamed: '♫', + arrowUp: '↑', + arrowDown: '↓', + arrowLeft: '←', + arrowRight: '→', + arrowLeftRight: '↔', + arrowUpDown: '↕', + almostEqual: '≈', + notEqual: '≠', + lessOrEqual: '≤', + greaterOrEqual: '≥', + identical: '≡', + infinity: '∞', + subscriptZero: '₀', + subscriptOne: '₁', + subscriptTwo: '₂', + subscriptThree: '₃', + subscriptFour: '₄', + subscriptFive: '₅', + subscriptSix: '₆', + subscriptSeven: '₇', + subscriptEight: '₈', + subscriptNine: '₉', + oneHalf: '½', + oneThird: '⅓', + oneQuarter: '¼', + oneFifth: '⅕', + oneSixth: '⅙', + oneEighth: '⅛', + twoThirds: '⅔', + twoFifths: '⅖', + threeQuarters: '¾', + threeFifths: '⅗', + threeEighths: '⅜', + fourFifths: '⅘', + fiveSixths: '⅚', + fiveEighths: '⅝', + sevenEighths: '⅞', + line: '─', + lineBold: '━', + lineDouble: '═', + lineDashed0: '┄', + lineDashed1: '┅', + lineDashed2: '┈', + lineDashed3: '┉', + lineDashed4: '╌', + lineDashed5: '╍', + lineDashed6: '╴', + lineDashed7: '╶', + lineDashed8: '╸', + lineDashed9: '╺', + lineDashed10: '╼', + lineDashed11: '╾', + lineDashed12: '−', + lineDashed13: '–', + lineDashed14: '‐', + lineDashed15: '⁃', + lineVertical: '│', + lineVerticalBold: '┃', + lineVerticalDouble: '║', + lineVerticalDashed0: '┆', + lineVerticalDashed1: '┇', + lineVerticalDashed2: '┊', + lineVerticalDashed3: '┋', + lineVerticalDashed4: '╎', + lineVerticalDashed5: '╏', + lineVerticalDashed6: '╵', + lineVerticalDashed7: '╷', + lineVerticalDashed8: '╹', + lineVerticalDashed9: '╻', + lineVerticalDashed10: '╽', + lineVerticalDashed11: '╿', + lineDownLeft: '┐', + lineDownLeftArc: '╮', + lineDownBoldLeftBold: '┓', + lineDownBoldLeft: '┒', + lineDownLeftBold: '┑', + lineDownDoubleLeftDouble: '╗', + lineDownDoubleLeft: '╖', + lineDownLeftDouble: '╕', + lineDownRight: '┌', + lineDownRightArc: '╭', + lineDownBoldRightBold: '┏', + lineDownBoldRight: '┎', + lineDownRightBold: '┍', + lineDownDoubleRightDouble: '╔', + lineDownDoubleRight: '╓', + lineDownRightDouble: '╒', + lineUpLeft: '┘', + lineUpLeftArc: '╯', + lineUpBoldLeftBold: '┛', + lineUpBoldLeft: '┚', + lineUpLeftBold: '┙', + lineUpDoubleLeftDouble: '╝', + lineUpDoubleLeft: '╜', + lineUpLeftDouble: '╛', + lineUpRight: '└', + lineUpRightArc: '╰', + lineUpBoldRightBold: '┗', + lineUpBoldRight: '┖', + lineUpRightBold: '┕', + lineUpDoubleRightDouble: '╚', + lineUpDoubleRight: '╙', + lineUpRightDouble: '╘', + lineUpDownLeft: '┤', + lineUpBoldDownBoldLeftBold: '┫', + lineUpBoldDownBoldLeft: '┨', + lineUpDownLeftBold: '┥', + lineUpBoldDownLeftBold: '┩', + lineUpDownBoldLeftBold: '┪', + lineUpDownBoldLeft: '┧', + lineUpBoldDownLeft: '┦', + lineUpDoubleDownDoubleLeftDouble: '╣', + lineUpDoubleDownDoubleLeft: '╢', + lineUpDownLeftDouble: '╡', + lineUpDownRight: '├', + lineUpBoldDownBoldRightBold: '┣', + lineUpBoldDownBoldRight: '┠', + lineUpDownRightBold: '┝', + lineUpBoldDownRightBold: '┡', + lineUpDownBoldRightBold: '┢', + lineUpDownBoldRight: '┟', + lineUpBoldDownRight: '┞', + lineUpDoubleDownDoubleRightDouble: '╠', + lineUpDoubleDownDoubleRight: '╟', + lineUpDownRightDouble: '╞', + lineDownLeftRight: '┬', + lineDownBoldLeftBoldRightBold: '┳', + lineDownLeftBoldRightBold: '┯', + lineDownBoldLeftRight: '┰', + lineDownBoldLeftBoldRight: '┱', + lineDownBoldLeftRightBold: '┲', + lineDownLeftRightBold: '┮', + lineDownLeftBoldRight: '┭', + lineDownDoubleLeftDoubleRightDouble: '╦', + lineDownDoubleLeftRight: '╥', + lineDownLeftDoubleRightDouble: '╤', + lineUpLeftRight: '┴', + lineUpBoldLeftBoldRightBold: '┻', + lineUpLeftBoldRightBold: '┷', + lineUpBoldLeftRight: '┸', + lineUpBoldLeftBoldRight: '┹', + lineUpBoldLeftRightBold: '┺', + lineUpLeftRightBold: '┶', + lineUpLeftBoldRight: '┵', + lineUpDoubleLeftDoubleRightDouble: '╩', + lineUpDoubleLeftRight: '╨', + lineUpLeftDoubleRightDouble: '╧', + lineUpDownLeftRight: '┼', + lineUpBoldDownBoldLeftBoldRightBold: '╋', + lineUpDownBoldLeftBoldRightBold: '╈', + lineUpBoldDownLeftBoldRightBold: '╇', + lineUpBoldDownBoldLeftRightBold: '╊', + lineUpBoldDownBoldLeftBoldRight: '╉', + lineUpBoldDownLeftRight: '╀', + lineUpDownBoldLeftRight: '╁', + lineUpDownLeftBoldRight: '┽', + lineUpDownLeftRightBold: '┾', + lineUpBoldDownBoldLeftRight: '╂', + lineUpDownLeftBoldRightBold: '┿', + lineUpBoldDownLeftBoldRight: '╃', + lineUpBoldDownLeftRightBold: '╄', + lineUpDownBoldLeftBoldRight: '╅', + lineUpDownBoldLeftRightBold: '╆', + lineUpDoubleDownDoubleLeftDoubleRightDouble: '╬', + lineUpDoubleDownDoubleLeftRight: '╫', + lineUpDownLeftDoubleRightDouble: '╪', + lineCross: '╳', + lineBackslash: '╲', + lineSlash: '╱', +}; +const specialMainSymbols = { + tick: '✔', + info: 'ℹ', + warning: '⚠', + cross: '✘', + squareSmall: '◻', + squareSmallFilled: '◼', + circle: '◯', + circleFilled: '◉', + circleDotted: '◌', + circleDouble: '◎', + circleCircle: 'ⓞ', + circleCross: 'ⓧ', + circlePipe: 'Ⓘ', + radioOn: '◉', + radioOff: '◯', + checkboxOn: '☒', + checkboxOff: '☐', + checkboxCircleOn: 'ⓧ', + checkboxCircleOff: 'Ⓘ', + pointer: '❯', + triangleUpOutline: '△', + triangleLeft: '◀', + triangleRight: '▶', + lozenge: '◆', + lozengeOutline: '◇', + hamburger: '☰', + smiley: '㋡', + mustache: '෴', + star: '★', + play: '▶', + nodejs: '⬢', + oneSeventh: '⅐', + oneNinth: '⅑', + oneTenth: '⅒', +}; +const specialFallbackSymbols = { + tick: '√', + info: 'i', + warning: '‼', + cross: '×', + squareSmall: '□', + squareSmallFilled: '■', + circle: '( )', + circleFilled: '(*)', + circleDotted: '( )', + circleDouble: '( )', + circleCircle: '(○)', + circleCross: '(×)', + circlePipe: '(│)', + radioOn: '(*)', + radioOff: '( )', + checkboxOn: '[×]', + checkboxOff: '[ ]', + checkboxCircleOn: '(×)', + checkboxCircleOff: '( )', + pointer: '>', + triangleUpOutline: '∆', + triangleLeft: '◄', + triangleRight: '►', + lozenge: '♦', + lozengeOutline: '◊', + hamburger: '≡', + smiley: '☺', + mustache: '┌─┐', + star: '✶', + play: '►', + nodejs: '♦', + oneSeventh: '1/7', + oneNinth: '1/9', + oneTenth: '1/10', +}; +export const mainSymbols = { + ...common, + ...specialMainSymbols, +}; +export const fallbackSymbols = { + ...common, + ...specialFallbackSymbols, +}; +const shouldUseMain = isUnicodeSupported(); +const figures = shouldUseMain + ? mainSymbols + : fallbackSymbols; +export default figures; +const replacements = Object.entries(specialMainSymbols); +// On terminals which do not support Unicode symbols, substitute them to other symbols +export const replaceSymbols = (string, { useFallback = !shouldUseMain } = {}) => { + if (useFallback) { + for (const [key, mainSymbol] of replacements) { + const fallbackSymbol = fallbackSymbols[key]; + if (!fallbackSymbol) { + throw new Error(`Unable to find fallback for ${key}`); + } + string = string.replaceAll(mainSymbol, fallbackSymbol); + } + } + return string; +}; diff --git a/node_modules/@inquirer/figures/package.json b/node_modules/@inquirer/figures/package.json new file mode 100644 index 0000000..910c7e6 --- /dev/null +++ b/node_modules/@inquirer/figures/package.json @@ -0,0 +1,79 @@ +{ + "name": "@inquirer/figures", + "version": "2.0.3", + "description": "Vendored version of figures, for CJS compatibility", + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "types", + "typescript", + "ui", + "yeoman", + "yo", + "zsh" + ], + "license": "MIT", + "author": "Simon Boudrias ", + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "tsc": "tsc" + }, + "devDependencies": { + "typescript": "^5.9.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "gitHead": "99d00a9adc53be8b7edf5926b2ec4ba0b792f68f" +} diff --git a/node_modules/@inquirer/input/LICENSE b/node_modules/@inquirer/input/LICENSE new file mode 100644 index 0000000..f718698 --- /dev/null +++ b/node_modules/@inquirer/input/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2025 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@inquirer/input/README.md b/node_modules/@inquirer/input/README.md new file mode 100644 index 0000000..4abb749 --- /dev/null +++ b/node_modules/@inquirer/input/README.md @@ -0,0 +1,101 @@ +# `@inquirer/input` + +Interactive free text input component for command line interfaces. Supports validation, filtering, transformation, etc. + +![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg) + +# Installation + + + + + + + + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/prompts +``` + + + +```sh +yarn add @inquirer/prompts +``` + +
Or
+ +```sh +npm install @inquirer/input +``` + + + +```sh +yarn add @inquirer/input +``` + +
+ +# Usage + +```js +import { input } from '@inquirer/prompts'; +// Or +// import input from '@inquirer/input'; + +const answer = await input({ message: 'Enter your name' }); +``` + +## Options + +| Property | Type | Required | Description | +| ------------ | ----------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| default | `string` | no | Default value if no answer is provided; see the prefill option below for governing it's behaviour. | +| prefill | `'tab' \| 'editable'` | no | Defaults to `'tab'`. If set to `'tab'`, pressing `backspace` will clear the default and pressing `tab` will inline the value for edits; If set to `'editable'`, the default value will already be inlined to edit. | +| required | `boolean` | no | Defaults to `false`. If set to true, `undefined` (empty) will not be accepted for this. | +| transformer | `(string, { isFinal: boolean }) => string` | no | Transform/Format the raw value entered by the user. Once the prompt is completed, `isFinal` will be `true`. This function is purely visual, modify the answer in your code if needed. | +| validate | `string => boolean \| string \| Promise` | no | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. | +| pattern | `RegExp` | no | Regular expression to validate the input against. If the input doesn't match the pattern, validation will fail with the error message specified in `patternError`. | +| patternError | `string` | no | Error message to display when the input doesn't match the `pattern`. Defaults to `'Invalid input'`. | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string | { idle: string; done: string }; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string, status: 'idle' | 'done' | 'loading') => string; + error: (text: string) => string; + defaultAnswer: (text: string) => string; + }; + validationFailureMode: 'keep' | 'clear'; +}; +``` + +`validationFailureMode` defines the behavior of the prompt when the value submitted is invalid. By default, we'll keep the value allowing the user to edit it. When the theme option is set to `clear`, we'll remove and reset to an empty string. + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/node_modules/@inquirer/input/dist/index.d.ts b/node_modules/@inquirer/input/dist/index.d.ts new file mode 100644 index 0000000..a7c4e39 --- /dev/null +++ b/node_modules/@inquirer/input/dist/index.d.ts @@ -0,0 +1,20 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type InputTheme = { + validationFailureMode: 'keep' | 'clear'; +}; +type InputConfig = { + message: string; + default?: string; + prefill?: 'tab' | 'editable'; + required?: boolean; + transformer?: (value: string, { isFinal }: { + isFinal: boolean; + }) => string; + validate?: (value: string) => boolean | string | Promise; + theme?: PartialDeep>; + pattern?: RegExp; + patternError?: string; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/node_modules/@inquirer/input/dist/index.js b/node_modules/@inquirer/input/dist/index.js new file mode 100644 index 0000000..83f05a9 --- /dev/null +++ b/node_modules/@inquirer/input/dist/index.js @@ -0,0 +1,97 @@ +import { createPrompt, useState, useKeypress, useEffect, usePrefix, isBackspaceKey, isEnterKey, isTabKey, makeTheme, } from '@inquirer/core'; +const inputTheme = { + validationFailureMode: 'keep', +}; +export default createPrompt((config, done) => { + const { prefill = 'tab' } = config; + const theme = makeTheme(inputTheme, config.theme); + const [status, setStatus] = useState('idle'); + const [defaultValue = '', setDefaultValue] = useState(config.default); + const [errorMsg, setError] = useState(); + const [value, setValue] = useState(''); + const prefix = usePrefix({ status, theme }); + async function validate(value) { + const { required, pattern, patternError = 'Invalid input' } = config; + if (required && !value) { + return 'You must provide a value'; + } + if (pattern && !pattern.test(value)) { + return patternError; + } + if (typeof config.validate === 'function') { + return (await config.validate(value)) || 'You must provide a valid value'; + } + return true; + } + useKeypress(async (key, rl) => { + // Ignore keypress while our prompt is doing other processing. + if (status !== 'idle') { + return; + } + if (isEnterKey(key)) { + const answer = value || defaultValue; + setStatus('loading'); + const isValid = await validate(answer); + if (isValid === true) { + setValue(answer); + setStatus('done'); + done(answer); + } + else { + if (theme.validationFailureMode === 'clear') { + setValue(''); + } + else { + // Reset the readline line value to the previous value. On line event, the value + // get cleared, forcing the user to re-enter the value instead of fixing it. + rl.write(value); + } + setError(isValid); + setStatus('idle'); + } + } + else if (isBackspaceKey(key) && !value) { + setDefaultValue(undefined); + } + else if (isTabKey(key) && !value) { + setDefaultValue(undefined); + rl.clearLine(0); // Remove the tab character. + rl.write(defaultValue); + setValue(defaultValue); + } + else { + setValue(rl.line); + setError(undefined); + } + }); + // If prefill is set to 'editable' cut out the default value and paste into current state and the user's cli buffer + // They can edit the value immediately instead of needing to press 'tab' + useEffect((rl) => { + if (prefill === 'editable' && defaultValue) { + rl.write(defaultValue); + setValue(defaultValue); + } + }, []); + const message = theme.style.message(config.message, status); + let formattedValue = value; + if (typeof config.transformer === 'function') { + formattedValue = config.transformer(value, { isFinal: status === 'done' }); + } + else if (status === 'done') { + formattedValue = theme.style.answer(value); + } + let defaultStr; + if (defaultValue && status !== 'done' && !value) { + defaultStr = theme.style.defaultAnswer(defaultValue); + } + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [ + [prefix, message, defaultStr, formattedValue] + .filter((v) => v !== undefined) + .join(' '), + error, + ]; +}); diff --git a/node_modules/@inquirer/input/package.json b/node_modules/@inquirer/input/package.json new file mode 100644 index 0000000..d2da0bf --- /dev/null +++ b/node_modules/@inquirer/input/package.json @@ -0,0 +1,91 @@ +{ + "name": "@inquirer/input", + "version": "5.0.4", + "description": "Inquirer input text prompt", + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/input/README.md", + "license": "MIT", + "author": "Simon Boudrias ", + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "tsc": "tsc" + }, + "dependencies": { + "@inquirer/core": "^11.1.1", + "@inquirer/type": "^4.0.3" + }, + "devDependencies": { + "@inquirer/testing": "^3.0.4", + "typescript": "^5.9.3" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "gitHead": "99d00a9adc53be8b7edf5926b2ec4ba0b792f68f" +} diff --git a/node_modules/@inquirer/number/LICENSE b/node_modules/@inquirer/number/LICENSE new file mode 100644 index 0000000..f718698 --- /dev/null +++ b/node_modules/@inquirer/number/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2025 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@inquirer/number/README.md b/node_modules/@inquirer/number/README.md new file mode 100644 index 0000000..f303e36 --- /dev/null +++ b/node_modules/@inquirer/number/README.md @@ -0,0 +1,95 @@ +# `@inquirer/number` + +Interactive free number input component for command line interfaces. Supports validation, filtering, transformation, etc. + +# Installation + + + + + + + + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/prompts +``` + + + +```sh +yarn add @inquirer/prompts +``` + +
Or
+ +```sh +npm install @inquirer/number +``` + + + +```sh +yarn add @inquirer/number +``` + +
+ +# Usage + +```js +import { number } from '@inquirer/prompts'; +// Or +// import number from '@inquirer/number'; + +const answer = await number({ message: 'Enter your age' }); +``` + +## Options + +| Property | Type | Required | Description | +| -------- | -------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| default | `number` | no | Default value if no answer is provided (clear it by pressing backspace) | +| min | `number` | no | The minimum value to accept for this input. | +| max | `number` | no | The maximum value to accept for this input. | +| step | `number \| 'any'` | no | The step option is a number that specifies the granularity that the value must adhere to. Only values which are equal to the basis for stepping (min if specified) are valid. This value defaults to 1, meaning by default the prompt will only allow integers. | +| required | `boolean` | no | Defaults to `false`. If set to true, `undefined` (empty) will not be accepted for this. | +| validate | `(number \| undefined) => boolean \| string \| Promise` | no | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string | { idle: string; done: string }; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string, status: 'idle' | 'done' | 'loading') => string; + error: (text: string) => string; + defaultAnswer: (text: string) => string; + }; +}; +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/node_modules/@inquirer/number/dist/index.d.ts b/node_modules/@inquirer/number/dist/index.d.ts new file mode 100644 index 0000000..663a9cb --- /dev/null +++ b/node_modules/@inquirer/number/dist/index.d.ts @@ -0,0 +1,13 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +declare const _default: (config: { + message: string; + default?: number | undefined; + min?: number | undefined; + max?: number | undefined; + step?: number | "any" | undefined; + required?: Required | undefined; + validate?: ((value: Required extends true ? number : number | undefined) => boolean | string | Promise) | undefined; + theme?: PartialDeep | undefined; +}, context?: import("@inquirer/type").Context) => Promise; +export default _default; diff --git a/node_modules/@inquirer/number/dist/index.js b/node_modules/@inquirer/number/dist/index.js new file mode 100644 index 0000000..2bb83c5 --- /dev/null +++ b/node_modules/@inquirer/number/dist/index.js @@ -0,0 +1,94 @@ +import { createPrompt, useState, useKeypress, usePrefix, isBackspaceKey, isEnterKey, isTabKey, makeTheme, } from '@inquirer/core'; +function isStepOf(value, step, min) { + const valuePow = value * Math.pow(10, 6); + const stepPow = step * Math.pow(10, 6); + const minPow = min * Math.pow(10, 6); + return (valuePow - (Number.isFinite(min) ? minPow : 0)) % stepPow === 0; +} +function validateNumber(value, { min, max, step, }) { + if (value == null || Number.isNaN(value)) { + return false; + } + else if (value < min || value > max) { + return `Value must be between ${min} and ${max}`; + } + else if (step !== 'any' && !isStepOf(value, step, min)) { + return `Value must be a multiple of ${step}${Number.isFinite(min) ? ` starting from ${min}` : ''}`; + } + return true; +} +export default createPrompt((config, done) => { + const { validate = () => true, min = -Infinity, max = Infinity, step = 1, required = false, } = config; + const theme = makeTheme(config.theme); + const [status, setStatus] = useState('idle'); + const [value, setValue] = useState(''); // store the input value as string and convert to number on "Enter" + // Ignore default if not valid. + const validDefault = validateNumber(config.default, { min, max, step }) === true + ? config.default?.toString() + : undefined; + const [defaultValue = '', setDefaultValue] = useState(validDefault); + const [errorMsg, setError] = useState(); + const prefix = usePrefix({ status, theme }); + useKeypress(async (key, rl) => { + // Ignore keypress while our prompt is doing other processing. + if (status !== 'idle') { + return; + } + if (isEnterKey(key)) { + const input = value || defaultValue; + const answer = input === '' ? undefined : Number(input); + setStatus('loading'); + let isValid = true; + if (required || answer != null) { + isValid = validateNumber(answer, { min, max, step }); + } + if (isValid === true) { + isValid = await validate(answer); + } + if (isValid === true) { + setValue(String(answer ?? '')); + setStatus('done'); + done(answer); + } + else { + // Reset the readline line value to the previous value. On line event, the value + // get cleared, forcing the user to re-enter the value instead of fixing it. + rl.write(value); + setError(isValid || 'You must provide a valid numeric value'); + setStatus('idle'); + } + } + else if (isBackspaceKey(key) && !value) { + setDefaultValue(undefined); + } + else if (isTabKey(key) && !value) { + setDefaultValue(undefined); + rl.clearLine(0); // Remove the tab character. + rl.write(defaultValue); + setValue(defaultValue); + } + else { + setValue(rl.line); + setError(undefined); + } + }); + const message = theme.style.message(config.message, status); + let formattedValue = value; + if (status === 'done') { + formattedValue = theme.style.answer(value); + } + let defaultStr; + if (defaultValue && status !== 'done' && !value) { + defaultStr = theme.style.defaultAnswer(defaultValue); + } + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [ + [prefix, message, defaultStr, formattedValue] + .filter((v) => v !== undefined) + .join(' '), + error, + ]; +}); diff --git a/node_modules/@inquirer/number/package.json b/node_modules/@inquirer/number/package.json new file mode 100644 index 0000000..391d875 --- /dev/null +++ b/node_modules/@inquirer/number/package.json @@ -0,0 +1,91 @@ +{ + "name": "@inquirer/number", + "version": "4.0.4", + "description": "Inquirer number prompt", + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/number/README.md", + "license": "MIT", + "author": "Simon Boudrias ", + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "tsc": "tsc" + }, + "dependencies": { + "@inquirer/core": "^11.1.1", + "@inquirer/type": "^4.0.3" + }, + "devDependencies": { + "@inquirer/testing": "^3.0.4", + "typescript": "^5.9.3" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "gitHead": "99d00a9adc53be8b7edf5926b2ec4ba0b792f68f" +} diff --git a/node_modules/@inquirer/password/LICENSE b/node_modules/@inquirer/password/LICENSE new file mode 100644 index 0000000..f718698 --- /dev/null +++ b/node_modules/@inquirer/password/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2025 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@inquirer/password/README.md b/node_modules/@inquirer/password/README.md new file mode 100644 index 0000000..b265ad5 --- /dev/null +++ b/node_modules/@inquirer/password/README.md @@ -0,0 +1,93 @@ +# `@inquirer/password` + +Interactive password input component for command line interfaces. Supports input validation and masked or transparent modes. + +![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg) + +# Installation + + + + + + + + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/prompts +``` + + + +```sh +yarn add @inquirer/prompts +``` + +
Or
+ +```sh +npm install @inquirer/password +``` + + + +```sh +yarn add @inquirer/password +``` + +
+ +# Usage + +```js +import { password } from '@inquirer/prompts'; +// Or +// import password from '@inquirer/password'; + +const answer = await password({ message: 'Enter your name' }); +``` + +## Options + +| Property | Type | Required | Description | +| -------- | ----------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| mask | `boolean` | no | Show a `*` mask over the input or keep it transparent | +| validate | `string => boolean \| string \| Promise` | no | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string | { idle: string; done: string }; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string, status: 'idle' | 'done' | 'loading') => string; + error: (text: string) => string; + help: (text: string) => string; + }; +}; +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/node_modules/@inquirer/password/dist/index.d.ts b/node_modules/@inquirer/password/dist/index.d.ts new file mode 100644 index 0000000..897bcea --- /dev/null +++ b/node_modules/@inquirer/password/dist/index.d.ts @@ -0,0 +1,10 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type PasswordConfig = { + message: string; + mask?: boolean | string; + validate?: (value: string) => boolean | string | Promise; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/node_modules/@inquirer/password/dist/index.js b/node_modules/@inquirer/password/dist/index.js new file mode 100644 index 0000000..736f657 --- /dev/null +++ b/node_modules/@inquirer/password/dist/index.js @@ -0,0 +1,55 @@ +import { createPrompt, useState, useKeypress, usePrefix, isEnterKey, makeTheme, } from '@inquirer/core'; +import { cursorHide } from '@inquirer/ansi'; +export default createPrompt((config, done) => { + const { validate = () => true } = config; + const theme = makeTheme(config.theme); + const [status, setStatus] = useState('idle'); + const [errorMsg, setError] = useState(); + const [value, setValue] = useState(''); + const prefix = usePrefix({ status, theme }); + useKeypress(async (key, rl) => { + // Ignore keypress while our prompt is doing other processing. + if (status !== 'idle') { + return; + } + if (isEnterKey(key)) { + const answer = value; + setStatus('loading'); + const isValid = await validate(answer); + if (isValid === true) { + setValue(answer); + setStatus('done'); + done(answer); + } + else { + // Reset the readline line value to the previous value. On line event, the value + // get cleared, forcing the user to re-enter the value instead of fixing it. + rl.write(value); + setError(isValid || 'You must provide a valid value'); + setStatus('idle'); + } + } + else { + setValue(rl.line); + setError(undefined); + } + }); + const message = theme.style.message(config.message, status); + let formattedValue = ''; + let helpTip; + if (config.mask) { + const maskChar = typeof config.mask === 'string' ? config.mask : '*'; + formattedValue = maskChar.repeat(value.length); + } + else if (status !== 'done') { + helpTip = `${theme.style.help('[input is masked]')}${cursorHide}`; + } + if (status === 'done') { + formattedValue = theme.style.answer(formattedValue); + } + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [[prefix, message, config.mask ? formattedValue : helpTip].join(' '), error]; +}); diff --git a/node_modules/@inquirer/password/package.json b/node_modules/@inquirer/password/package.json new file mode 100644 index 0000000..8c0e4e0 --- /dev/null +++ b/node_modules/@inquirer/password/package.json @@ -0,0 +1,92 @@ +{ + "name": "@inquirer/password", + "version": "5.0.4", + "description": "Inquirer password prompt", + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/password/README.md", + "license": "MIT", + "author": "Simon Boudrias ", + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "tsc": "tsc" + }, + "dependencies": { + "@inquirer/ansi": "^2.0.3", + "@inquirer/core": "^11.1.1", + "@inquirer/type": "^4.0.3" + }, + "devDependencies": { + "@inquirer/testing": "^3.0.4", + "typescript": "^5.9.3" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "gitHead": "99d00a9adc53be8b7edf5926b2ec4ba0b792f68f" +} diff --git a/node_modules/@inquirer/prompts/LICENSE b/node_modules/@inquirer/prompts/LICENSE new file mode 100644 index 0000000..f718698 --- /dev/null +++ b/node_modules/@inquirer/prompts/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2025 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@inquirer/prompts/README.md b/node_modules/@inquirer/prompts/README.md new file mode 100644 index 0000000..b7f8ae7 --- /dev/null +++ b/node_modules/@inquirer/prompts/README.md @@ -0,0 +1,528 @@ +Inquirer Logo + +# Inquirer + +[![npm](https://badge.fury.io/js/@inquirer%2Fprompts.svg)](https://www.npmjs.com/package/@inquirer/prompts) +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js?ref=badge_shield) + +A collection of common interactive command line user interfaces. + +![List prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg) + +Give it a try in your own terminal! + +```sh +npx @inquirer/demo@latest +``` + +# Installation + + + + + + + + + + + + + + +
npmyarnpnpmbun
+ +```sh +npm install @inquirer/prompts +``` + + + +```sh +yarn add @inquirer/prompts +``` + + + +```sh +pnpm add @inquirer/prompts +``` + + + +```sh +bun add @inquirer/prompts +``` + +
+ +> [!NOTE] +> Inquirer recently underwent a rewrite from the ground up to reduce the package size and improve performance. The previous version of the package is still maintained (though not actively developed), and offered hundreds of community contributed prompts that might not have been migrated to the latest API. If this is what you're looking for, the [previous package is over here](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/inquirer). + +# Usage + +```js +import { input } from '@inquirer/prompts'; + +const answer = await input({ message: 'Enter your name' }); +``` + +# Prompts + +## [Input](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/input) + +![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg) + +```js +import { input } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/input) for usage example and options documentation. + +## [Select](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/select) + +![Select prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg) + +```js +import { select } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/select) for usage example and options documentation. + +## [Checkbox](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/checkbox) + +![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg) + +```js +import { checkbox } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/checkbox) for usage example and options documentation. + +## [Confirm](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/confirm) + +![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg) + +```js +import { confirm } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/confirm) for usage example and options documentation. + +## [Search](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/search) + +![search prompt](https://raw.githubusercontent.com/SBoudrias/Inquirer.js/f459199e679aec7676cecc0fc12ef8a4cd3dda0b/assets/screenshots/search.png) + +```js +import { search } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/search) for usage example and options documentation. + +## [Password](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/password) + +![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg) + +```js +import { password } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/password) for usage example and options documentation. + +## [Expand](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/expand) + +![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg) +![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg) + +```js +import { expand } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/expand) for usage example and options documentation. + +## [Editor](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/editor) + +Launches an instance of the users preferred editor on a temporary file. Once the user exits their editor, the content of the temporary file is read as the answer. The editor used is determined by reading the $VISUAL or $EDITOR environment variables. If neither of those are present, the OS default is used (notepad on Windows, vim on Mac or Linux.) + +```js +import { editor } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/editor) for usage example and options documentation. + +## [Number](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/number) + +Very similar to the `input` prompt, but with built-in number validation configuration option. + +```js +import { number } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/number) for usage example and options documentation. + +## [Raw List](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/rawlist) + +![Raw list prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg) + +```js +import { rawlist } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/rawlist) for usage example and options documentation. + +# Create your own prompts + +The [API documentation is over here](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/core), and our [testing utilities here](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/testing). + +# Advanced usage + +All inquirer prompts are a function taking 2 arguments. The first argument is the prompt configuration (unique to each prompt). The second is providing contextual or runtime configuration. + +The context options are: + +| Property | Type | Required | Description | +| ----------------- | ----------------------- | -------- | ------------------------------------------------------------ | +| input | `NodeJS.ReadableStream` | no | The stdin stream (defaults to `process.stdin`) | +| output | `NodeJS.WritableStream` | no | The stdout stream (defaults to `process.stdout`) | +| clearPromptOnDone | `boolean` | no | If true, we'll clear the screen after the prompt is answered | +| signal | `AbortSignal` | no | An AbortSignal to cancel prompts asynchronously | + +> [!WARNING] +> When providing an input stream or piping `process.stdin`, it's very likely you need to call `process.stdin.setRawMode(true)` +> before calling inquirer functions. Node.js usually does it automatically, but when we shadow the stdin, Node can loss track +> and not know it has to. If the prompt isn't interactive (arrows don't work, etc), it's likely due to this. + +Example: + +```js +import { confirm } from '@inquirer/prompts'; + +const allowEmail = await confirm( + { message: 'Do you allow us to send you email?' }, + { + output: new Stream.Writable({ + write(chunk, _encoding, next) { + // Do something + next(); + }, + }), + clearPromptOnDone: true, + }, +); +``` + +## Canceling prompt + +This can be done with either an `AbortController` or `AbortSignal`. + +```js +// Example 1: using built-in AbortSignal utilities +import { confirm } from '@inquirer/prompts'; + +const answer = await confirm({ ... }, { signal: AbortSignal.timeout(5000) }); +``` + +```js +// Example 2: implementing custom cancellation with an AbortController +import { confirm } from '@inquirer/prompts'; + +const controller = new AbortController(); +setTimeout(() => { + controller.abort(); // This will reject the promise +}, 5000); + +const answer = await confirm({ ... }, { signal: controller.signal }); +``` + +# Recipes + +## Handling `ctrl+c` gracefully + +When a user press `ctrl+c` to exit a prompt, Inquirer rejects the prompt promise. This is the expected behavior in order to allow your program to teardown/cleanup its environment. When using `async/await`, rejected promises throw their error. When unhandled, those errors print their stack trace in your user's terminal. + +``` +ExitPromptError: User force closed the prompt with 0 null + at file://example/packages/core/dist/esm/lib/create-prompt.js:55:20 + at Emitter.emit (file://example/node_modules/signal-exit/dist/mjs/index.js:67:19) + at #processEmit (file://example/node_modules/signal-exit/dist/mjs/index.js:236:27) + at #process.emit (file://example/node_modules/signal-exit/dist/mjs/index.js:187:37) + at process.callbackTrampoline (node:internal/async_hooks:130:17) +``` + +This isn't a great UX, which is why we highly recommend you to handle those errors gracefully. + +First option is to wrap your scripts in `try/catch`; like [we do in our demo program](https://github.com/SBoudrias/Inquirer.js/blob/649e78147cbb6390a162ff842d4b21d53a233472/packages/demo/src/index.ts#L89-L95). Or handle the error in your CLI framework mechanism; for example [`Clipanion catch` method](https://mael.dev/clipanion/docs/errors#custom-error-handling). + +Lastly, you could handle the error globally with an event listener and silence it. + +```ts +process.on('uncaughtException', (error) => { + if (error instanceof Error && error.name === 'ExitPromptError') { + console.log('👋 until next time!'); + } else { + // Rethrow unknown errors + throw error; + } +}); +``` + +## Get answers in an object + +When asking many questions, you might not want to keep one variable per answer everywhere. In which case, you can put the answer inside an object. + +```js +import { input, confirm } from '@inquirer/prompts'; + +const answers = { + firstName: await input({ message: "What's your first name?" }), + allowEmail: await confirm({ message: 'Do you allow us to send you email?' }), +}; + +console.log(answers.firstName); +``` + +## Ask a question conditionally + +Maybe some questions depend on some other question's answer. + +```js +import { input, confirm } from '@inquirer/prompts'; + +const allowEmail = await confirm({ message: 'Do you allow us to send you email?' }); + +let email; +if (allowEmail) { + email = await input({ message: 'What is your email address' }); +} +``` + +## Get default value after timeout + +```js +import { input } from '@inquirer/prompts'; + +const answer = await input( + { message: 'Enter a value (timing out in 5 seconds)' }, + { signal: AbortSignal.timeout(5000) }, +).catch((error) => { + if (error.name === 'AbortPromptError') { + return 'Default value'; + } + + throw error; +}); +``` + +## Using as pre-commit/git hooks, or scripts + +By default scripts ran from tools like `husky`/`lint-staged` might not run inside an interactive shell. In non-interactive shell, Inquirer cannot run, and users cannot send keypress events to the process. + +For it to work, you must make sure you start a `tty` (or "interactive" input stream.) + +If those scripts are set within your `package.json`, you can define the stream like so: + +```json + "precommit": "my-script < /dev/tty" +``` + +Or if in a shell script file, you'll do it like so: (on Windows that's likely your only option) + +```sh +#!/bin/sh +exec < /dev/tty + +node my-script.js +``` + +## Using with nodemon + +When using inquirer prompts with nodemon, you need to pass the `--no-stdin` flag for everything to work as expected. + +```sh +npx nodemon ./packages/demo/demos/password.mjs --no-stdin +``` + +Note that for most of you, you'll be able to use the new watch-mode built-in Node. This mode works out of the box with inquirer. + +```sh +# One of depending on your need +node --watch script.js +node --watch-path=packages/ packages/demo/ +``` + +## Wait for config + +Maybe some question configuration require to await a value. + +```js +import { confirm } from '@inquirer/prompts'; + +const answer = await confirm({ message: await getMessage() }); +``` + +## Usage with `npx` within bash scripts + +You can use Inquirer prompts directly in the shell via [`npx`](https://docs.npmjs.com/cli/v8/commands/npx), which is useful for quick scripts or `package.json` commands. + +A community library, [@inquirer-cli](https://github.com/fishballapp/inquirer-cli), exposes each prompt as a standalone CLI. + +For example, to prompt for input: + +```bash +name=$(npx -y @inquirer-cli/input -r "What is your name?") +echo "Hello, $name!" +``` + +Or to create an interactive version bump: + +```bash +$ npm version $(npx -y @inquirer-cli/select -c patch -c minor -c major 'Select Version') +``` + +Find out more: [@inquirer-cli](https://github.com/fishballapp/inquirer-cli). + +# Community prompts + +If you created a cool prompt, [send us a PR adding it](https://github.com/SBoudrias/Inquirer.js/edit/main/packages/prompts/README.md) to the list below! + +[**Interactive List Prompt**](https://github.com/pgibler/inquirer-interactive-list-prompt)
+Select a choice either with arrow keys + Enter or by pressing a key associated with a choice. + +``` +? Choose an option: +> Run command (D) + Quit (Q) +``` + +[**Action Select Prompt**](https://github.com/zenithlight/inquirer-action-select)
+Choose an item from a list and choose an action to take by pressing a key. + +``` +? Choose a file Open Edit Delete +❯ image.png + audio.mp3 + code.py +``` + +[**Table Multiple Prompt**](https://github.com/Bartheleway/inquirer-table-multiple)
+Select multiple answer from a table display. + +```sh +Choose between choices? (Press to select, to move rows, + to move columns) + +┌──────────┬───────┬───────┐ +│ 1-2 of 2 │ Yes? │ No? | +├──────────┼───────┼───────┤ +│ Choice 1 │ [ ◯ ] │ ◯ | +├──────────┼───────┼───────┤ +│ Choice 2 │ ◯ │ ◯ | +└──────────┴───────┴───────┘ + +``` + +[**Toggle Prompt**](https://github.com/skarahoda/inquirer-toggle)
+Confirm with a toggle. Select a choice with arrow keys + Enter. + +``` +? Do you want to continue? no / yes +``` + +[**Sortable Checkbox Prompt**](https://github.com/th0r/inquirer-sortable-checkbox)
+The same as built-in checkbox prompt, but also allowing to reorder choices using ctrl+up/down. + +``` +? Which PRs and in what order would you like to merge? (Press to select, to toggle all, to invert selection, to move item up, to move item down, and to proceed) +❯ ◯ PR 1 + ◯ PR 2 + ◯ PR 3 +``` + +[**Multi Select Prompt**](https://github.com/jeffwcx/inquirer-select-pro) + +An inquirer select that supports multiple selections and filtering/searching. + +``` +? Choose your OS, IDE, PL, etc. (Press to select/deselect, to remove selected +option, to select option) +>> vue +>[ ] vue + [ ] vuejs + [ ] fuelphp + [ ] venv + [ ] vercel + (Use arrow keys to reveal more options) +``` + +[**File Selector Prompt**](https://github.com/br14n-sol/inquirer-file-selector)
+A file selector, you can navigate freely between directories, choose what type of files you want to allow and it is fully customizable. + +```sh +? Select a file: +/main/path/ +├── folder1/ +├── folder2/ +├── folder3/ +├── file1.txt +├── file2.pdf +└── file3.jpg (not allowed) +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +Use ↑↓ to navigate through the list +Press to navigate to the parent directory +Press to select a file or navigate to a directory +``` + +[**Select Prompt with Stateful Banner**](https://github.com/patik/inquirer-select-with-state)
+The same as built-in select prompt, but it also displays a banner above the prompt which can be updated with a `setState` function. For example, it can display the results of a long-running command without making the user wait to see the prompt. + +Initial display: + +``` +Directory size: loading... +? Choose an option +❯ Rename + Copy + Delete +``` + +A moment later: + +``` +Directory size: 123M +? Choose an option +❯ Rename + Copy + Delete +``` + +[**Ordered Checkbox Prompt**](https://github.com/kyou-izumi/inquirer-ordered-checkbox)
+A sortable checkbox prompt that maintains the order of selection. Perfect for prioritizing tasks or ranking options. + +``` +? Configure your development workflow: + [1] Set up CI/CD pipeline +❯ [3] Code quality tools + [ ] Documentation + [2] Performance monitoring + ────────────── +- Legacy system (disabled) +(Linting, formatting, and analysis) +``` + +[**Checkbox Plus Plus Prompt**](https://github.com/behnamazimi/inquirer-checkbox-plus-plus)
+A modern multiselect checkbox prompt with search and filter capabilities, highlighting, autocomplete, and improved UX. Supports both ESM and CommonJS and is compatible with @inquirer/core v10+. + +``` +? Select colors [searching: "re"] +❯ ◉ The red color + ◯ The green color + ◉ The purple color + ◯ The orange color + +↑↓ navigate • space de/select • type search • 2 selected • ⏎ submit +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/node_modules/@inquirer/prompts/dist/index.d.ts b/node_modules/@inquirer/prompts/dist/index.d.ts new file mode 100644 index 0000000..1926375 --- /dev/null +++ b/node_modules/@inquirer/prompts/dist/index.d.ts @@ -0,0 +1,10 @@ +export { default as checkbox, Separator } from '@inquirer/checkbox'; +export { default as editor } from '@inquirer/editor'; +export { default as confirm } from '@inquirer/confirm'; +export { default as input } from '@inquirer/input'; +export { default as number } from '@inquirer/number'; +export { default as expand } from '@inquirer/expand'; +export { default as rawlist } from '@inquirer/rawlist'; +export { default as password } from '@inquirer/password'; +export { default as search } from '@inquirer/search'; +export { default as select } from '@inquirer/select'; diff --git a/node_modules/@inquirer/prompts/dist/index.js b/node_modules/@inquirer/prompts/dist/index.js new file mode 100644 index 0000000..1926375 --- /dev/null +++ b/node_modules/@inquirer/prompts/dist/index.js @@ -0,0 +1,10 @@ +export { default as checkbox, Separator } from '@inquirer/checkbox'; +export { default as editor } from '@inquirer/editor'; +export { default as confirm } from '@inquirer/confirm'; +export { default as input } from '@inquirer/input'; +export { default as number } from '@inquirer/number'; +export { default as expand } from '@inquirer/expand'; +export { default as rawlist } from '@inquirer/rawlist'; +export { default as password } from '@inquirer/password'; +export { default as search } from '@inquirer/search'; +export { default as select } from '@inquirer/select'; diff --git a/node_modules/@inquirer/prompts/package.json b/node_modules/@inquirer/prompts/package.json new file mode 100644 index 0000000..f1a8310 --- /dev/null +++ b/node_modules/@inquirer/prompts/package.json @@ -0,0 +1,101 @@ +{ + "name": "@inquirer/prompts", + "version": "8.2.0", + "description": "Inquirer prompts, combined in a single package", + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "types", + "typescript", + "ui", + "yeoman", + "yo", + "zsh" + ], + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/prompts/README.md", + "license": "MIT", + "author": "Simon Boudrias ", + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "tsc": "tsc" + }, + "dependencies": { + "@inquirer/checkbox": "^5.0.4", + "@inquirer/confirm": "^6.0.4", + "@inquirer/editor": "^5.0.4", + "@inquirer/expand": "^5.0.4", + "@inquirer/input": "^5.0.4", + "@inquirer/number": "^4.0.4", + "@inquirer/password": "^5.0.4", + "@inquirer/rawlist": "^5.2.0", + "@inquirer/search": "^4.1.0", + "@inquirer/select": "^5.0.4" + }, + "devDependencies": { + "@inquirer/type": "^4.0.3", + "typescript": "^5.9.3" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "gitHead": "99d00a9adc53be8b7edf5926b2ec4ba0b792f68f" +} diff --git a/node_modules/@inquirer/rawlist/LICENSE b/node_modules/@inquirer/rawlist/LICENSE new file mode 100644 index 0000000..f718698 --- /dev/null +++ b/node_modules/@inquirer/rawlist/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2025 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@inquirer/rawlist/README.md b/node_modules/@inquirer/rawlist/README.md new file mode 100644 index 0000000..d5a1a36 --- /dev/null +++ b/node_modules/@inquirer/rawlist/README.md @@ -0,0 +1,128 @@ +# `@inquirer/rawlist` + +Simple interactive command line prompt to display a raw list of choices (single value select) with minimal interaction. + +![rawlist prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg) + +# Installation + + + + + + + + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/prompts +``` + + + +```sh +yarn add @inquirer/prompts +``` + +
Or
+ +```sh +npm install @inquirer/rawlist +``` + + + +```sh +yarn add @inquirer/rawlist +``` + +
+ +# Usage + +```js +import { rawlist } from '@inquirer/prompts'; +// Or +// import rawlist from '@inquirer/rawlist'; + +const answer = await rawlist({ + message: 'Select a package manager', + choices: [ + { name: 'npm', value: 'npm' }, + { name: 'yarn', value: 'yarn' }, + { name: 'pnpm', value: 'pnpm' }, + ], +}); +``` + +## Options + +| Property | Type | Required | Description | +| -------- | ----------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| choices | `Choice[]` | yes | List of the available choices. | +| loop | `boolean` | no | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping. | +| default | `Value` | no | The value of the choice to preselect. If the value is not found, no choice is preselected. | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options. + +### `Choice` object + +The `Choice` object is typed as + +```ts +type Choice = { + value: Value; + name?: string; + short?: string; + key?: string; + description?: string; +}; +``` + +Here's each property: + +- `value`: The value is what will be returned by `await rawlist()`. +- `name`: This is the string displayed in the choice list. +- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`. +- `key`: The key of the choice. Displayed as `key) name`. +- `description`: Option description which appears below the list when the choice is selected. + +`choices` can also be an array of string, in which case the string will be used both as the `value` and the `name`. + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string | { idle: string; done: string }; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string, status: 'idle' | 'done' | 'loading') => string; + error: (text: string) => string; + highlight: (text: string) => string; + description: (text: string) => string; + }; +}; +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/node_modules/@inquirer/rawlist/dist/index.d.ts b/node_modules/@inquirer/rawlist/dist/index.d.ts new file mode 100644 index 0000000..6dc7275 --- /dev/null +++ b/node_modules/@inquirer/rawlist/dist/index.d.ts @@ -0,0 +1,23 @@ +import { Separator, type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type RawlistTheme = { + style: { + description: (text: string) => string; + }; +}; +type Choice = { + value: Value; + name?: string; + short?: string; + key?: string; + description?: string; +}; +declare const _default: (config: { + message: string; + choices: readonly (Separator | Value | Choice)[]; + loop?: boolean | undefined; + theme?: PartialDeep> | undefined; + default?: NoInfer | undefined; +}, context?: import("@inquirer/type").Context) => Promise; +export default _default; +export { Separator } from '@inquirer/core'; diff --git a/node_modules/@inquirer/rawlist/dist/index.js b/node_modules/@inquirer/rawlist/dist/index.js new file mode 100644 index 0000000..eb7d661 --- /dev/null +++ b/node_modules/@inquirer/rawlist/dist/index.js @@ -0,0 +1,142 @@ +import { createPrompt, useMemo, useState, useKeypress, usePrefix, isDownKey, isEnterKey, isUpKey, Separator, makeTheme, ValidationError, } from '@inquirer/core'; +import { styleText } from 'node:util'; +const numberRegex = /\d+/; +const rawlistTheme = { + style: { + description: (text) => styleText('cyan', text), + }, +}; +function isSelectableChoice(choice) { + return choice != null && !Separator.isSeparator(choice); +} +function normalizeChoices(choices) { + let index = 0; + return choices.map((choice) => { + if (Separator.isSeparator(choice)) + return choice; + index += 1; + if (typeof choice !== 'object' || choice === null || !('value' in choice)) { + const name = String(choice); + return { + value: choice, + name, + short: name, + key: String(index), + }; + } + const name = choice.name ?? String(choice.value); + return { + value: choice.value, + name, + short: choice.short ?? name, + key: choice.key ?? String(index), + description: choice.description, + }; + }); +} +function getSelectedChoice(input, choices) { + let selectedChoice; + const selectableChoices = choices.filter(isSelectableChoice); + // First, try to match by custom key (exact match) + selectedChoice = selectableChoices.find((choice) => choice.key === input); + // If no custom key match and input is numeric, try 1-based index + if (!selectedChoice && numberRegex.test(input)) { + const answer = Number.parseInt(input, 10) - 1; + selectedChoice = selectableChoices[answer]; + } + return selectedChoice + ? [selectedChoice, choices.indexOf(selectedChoice)] + : [undefined, undefined]; +} +export default createPrompt((config, done) => { + const { loop = true } = config; + const choices = useMemo(() => normalizeChoices(config.choices), [config.choices]); + const [status, setStatus] = useState('idle'); + const [value, setValue] = useState(() => { + const defaultChoice = config.default == null + ? undefined + : choices.find((choice) => isSelectableChoice(choice) && choice.value === config.default); + return defaultChoice?.key ?? ''; + }); + const [errorMsg, setError] = useState(); + const theme = makeTheme(rawlistTheme, config.theme); + const prefix = usePrefix({ status, theme }); + const bounds = useMemo(() => { + const first = choices.findIndex(isSelectableChoice); + const last = choices.findLastIndex(isSelectableChoice); + if (first === -1) { + throw new ValidationError('[select prompt] No selectable choices. All choices are disabled.'); + } + return { first, last }; + }, [choices]); + useKeypress((key, rl) => { + if (isEnterKey(key)) { + const [selectedChoice] = getSelectedChoice(value, choices); + if (isSelectableChoice(selectedChoice)) { + setValue(selectedChoice.short); + setStatus('done'); + done(selectedChoice.value); + } + else if (value === '') { + setError('Please input a value'); + } + else { + setError(`"${styleText('red', value)}" isn't an available option`); + } + } + else if (isUpKey(key) || isDownKey(key)) { + rl.clearLine(0); + const [selectedChoice, active] = getSelectedChoice(value, choices); + if (!selectedChoice) { + const firstChoice = isDownKey(key) + ? choices.find(isSelectableChoice) + : choices.findLast(isSelectableChoice); + setValue(firstChoice.key); + } + else if (loop || + (isUpKey(key) && active !== bounds.first) || + (isDownKey(key) && active !== bounds.last)) { + const offset = isUpKey(key) ? -1 : 1; + let next = active; + do { + next = (next + offset + choices.length) % choices.length; + } while (!isSelectableChoice(choices[next])); + setValue(choices[next].key); + } + } + else { + setValue(rl.line); + setError(undefined); + } + }); + const message = theme.style.message(config.message, status); + if (status === 'done') { + return `${prefix} ${message} ${theme.style.answer(value)}`; + } + const choicesStr = choices + .map((choice) => { + if (Separator.isSeparator(choice)) { + return ` ${choice.separator}`; + } + const line = ` ${choice.key}) ${choice.name}`; + if (choice.key === value) { + return theme.style.highlight(line); + } + return line; + }) + .join('\n'); + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + const [selectedChoice] = getSelectedChoice(value, choices); + let description = ''; + if (!errorMsg && selectedChoice?.description) { + description = theme.style.description(selectedChoice.description); + } + return [ + `${prefix} ${message} ${value}`, + [choicesStr, error, description].filter(Boolean).join('\n'), + ]; +}); +export { Separator } from '@inquirer/core'; diff --git a/node_modules/@inquirer/rawlist/package.json b/node_modules/@inquirer/rawlist/package.json new file mode 100644 index 0000000..46e5075 --- /dev/null +++ b/node_modules/@inquirer/rawlist/package.json @@ -0,0 +1,91 @@ +{ + "name": "@inquirer/rawlist", + "version": "5.2.0", + "description": "Inquirer rawlist prompt", + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/rawlist/README.md", + "license": "MIT", + "author": "Simon Boudrias ", + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "tsc": "tsc" + }, + "dependencies": { + "@inquirer/core": "^11.1.1", + "@inquirer/type": "^4.0.3" + }, + "devDependencies": { + "@inquirer/testing": "^3.0.4", + "typescript": "^5.9.3" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "gitHead": "99d00a9adc53be8b7edf5926b2ec4ba0b792f68f" +} diff --git a/node_modules/@inquirer/search/LICENSE b/node_modules/@inquirer/search/LICENSE new file mode 100644 index 0000000..f718698 --- /dev/null +++ b/node_modules/@inquirer/search/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2025 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@inquirer/search/README.md b/node_modules/@inquirer/search/README.md new file mode 100644 index 0000000..f124758 --- /dev/null +++ b/node_modules/@inquirer/search/README.md @@ -0,0 +1,213 @@ +# `@inquirer/search` + +Interactive search prompt component for command line interfaces. + +![search prompt](https://raw.githubusercontent.com/SBoudrias/Inquirer.js/f459199e679aec7676cecc0fc12ef8a4cd3dda0b/assets/screenshots/search.png) + +# Installation + + + + + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/prompts +``` + + + +```sh +yarn add @inquirer/prompts +``` + +
+ +```sh +npm install @inquirer/search +``` + + + +```sh +yarn add @inquirer/search +``` + +
+ +# Usage + +```js +import { search, Separator } from '@inquirer/prompts'; +// Or +// import search, { Separator } from '@inquirer/search'; + +const answer = await search({ + message: 'Select an npm package', + source: async (input, { signal }) => { + if (!input) { + return []; + } + + const response = await fetch( + `https://registry.npmjs.org/-/v1/search?text=${encodeURIComponent(input)}&size=20`, + { signal }, + ); + const data = await response.json(); + + return data.objects.map((pkg) => ({ + name: pkg.package.name, + value: pkg.package.name, + description: pkg.package.description, + })); + }, +}); +``` + +## Options + +| Property | Type | Required | Description | +| -------- | ---------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| source | `(term: string \| void) => Promise` | yes | This function returns the choices relevant to the search term. | +| pageSize | `number` | no | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. | +| default | `Value` | no | Defines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item. | +| validate | `Value => boolean \| string \| Promise` | no | On submit, validate the answer. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +### `source` function + +The full signature type of `source` is as follow: + +```ts +function( + term: string | void, + opt: { signal: AbortSignal }, +): Promise | Separator>>; +``` + +When `term` is `undefined`, it means the search term input is empty. You can use this to return default choices, or return an empty array. + +Aside from returning the choices: + +1. An `AbortSignal` is passed in to cancel ongoing network calls when the search term change. +2. `Separator`s can be used to organize the list. + +### `Choice` object + +The `Choice` object is typed as + +```ts +type Choice = { + value: Value; + name?: string; + description?: string; + short?: string; + disabled?: boolean | string; +}; +``` + +Here's each property: + +- `value`: The value is what will be returned by `await search()`. +- `name`: This is the string displayed in the choice list. +- `description`: Option for a longer description string that'll appear under the list when the cursor highlight a given choice. +- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`. +- `disabled`: Disallow the option from being selected. If `disabled` is a string, it'll be used as a help tip explaining why the choice isn't available. + +Choices can also be an array of string, in which case the string will be used both as the `value` and the `name`. + +### Validation & autocomplete interaction + +The validation within the search prompt acts as a signal for the autocomplete feature. + +When a list value is submitted and fail validation, the prompt will compare it to the search term. If they're the same, the prompt display the error. If they're not the same, we'll autocomplete the search term to match the value. Doing this will trigger a new search. + +You can rely on this behavior to implement progressive autocomplete searches. Where you want the user to narrow the search in a progressive manner. + +Pressing `tab` also triggers the term autocomplete. + +You can see this behavior in action in [our search demo](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/demo/src/demos/search.ts). + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string | { idle: string; done: string }; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string, status: 'idle' | 'done' | 'loading') => string; + error: (text: string) => string; + help: (text: string) => string; + highlight: (text: string) => string; + description: (text: string) => string; + disabled: (text: string) => string; + searchTerm: (text: string) => string; + keysHelpTip: (keys: [key: string, action: string][]) => string | undefined; + }; + icon: { + cursor: string; + }; +}; +``` + +### `theme.style.keysHelpTip` + +This function allows you to customize the keyboard shortcuts help tip displayed below the prompt. It receives an array of key-action pairs and should return a formatted string. You can also hook here to localize the labels to different languages. + +It can also returns `undefined` to hide the help tip entirely. + +```js +theme: { + style: { + keysHelpTip: (keys) => { + // Return undefined to hide the help tip completely. + return undefined; + + // Or customize the formatting. Or localize the labels. + return keys.map(([key, action]) => `${key}: ${action}`).join(' | '); + }; + } +} +``` + +## Recipes + +### Debounce search + +```js +import { setTimeout } from 'node:timers/promises'; +import { search } from '@inquirer/prompts'; + +const answer = await search({ + message: 'Select an npm package', + source: async (input, { signal }) => { + await setTimeout(300); + if (signal.aborted) return []; + + // Do the search + fetch(...) + }, +}); +``` + +# License + +Copyright (c) 2024 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/node_modules/@inquirer/search/dist/index.d.ts b/node_modules/@inquirer/search/dist/index.d.ts new file mode 100644 index 0000000..dfaa70b --- /dev/null +++ b/node_modules/@inquirer/search/dist/index.d.ts @@ -0,0 +1,33 @@ +import { Separator, type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type SearchTheme = { + icon: { + cursor: string; + }; + style: { + disabled: (text: string) => string; + searchTerm: (text: string) => string; + description: (text: string) => string; + keysHelpTip: (keys: [key: string, action: string][]) => string | undefined; + }; +}; +type Choice = { + value: Value; + name?: string; + description?: string; + short?: string; + disabled?: boolean | string; + type?: never; +}; +declare const _default: (config: { + message: string; + source: (term: string | undefined, opt: { + signal: AbortSignal; + }) => readonly (string | Separator)[] | readonly (Separator | Choice)[] | Promise | Promise)[]>; + validate?: ((value: Value) => boolean | string | Promise) | undefined; + pageSize?: number | undefined; + default?: NoInfer | undefined; + theme?: PartialDeep> | undefined; +}, context?: import("@inquirer/type").Context) => Promise; +export default _default; +export { Separator } from '@inquirer/core'; diff --git a/node_modules/@inquirer/search/dist/index.js b/node_modules/@inquirer/search/dist/index.js new file mode 100644 index 0000000..b231bf3 --- /dev/null +++ b/node_modules/@inquirer/search/dist/index.js @@ -0,0 +1,193 @@ +import { createPrompt, useState, useKeypress, usePrefix, usePagination, useEffect, useMemo, useRef, isDownKey, isEnterKey, isTabKey, isUpKey, Separator, makeTheme, } from '@inquirer/core'; +import { styleText } from 'node:util'; +import figures from '@inquirer/figures'; +const searchTheme = { + icon: { cursor: figures.pointer }, + style: { + disabled: (text) => styleText('dim', `- ${text}`), + searchTerm: (text) => styleText('cyan', text), + description: (text) => styleText('cyan', text), + keysHelpTip: (keys) => keys + .map(([key, action]) => `${styleText('bold', key)} ${styleText('dim', action)}`) + .join(styleText('dim', ' • ')), + }, +}; +function isSelectable(item) { + return !Separator.isSeparator(item) && !item.disabled; +} +function normalizeChoices(choices) { + return choices.map((choice) => { + if (Separator.isSeparator(choice)) + return choice; + if (typeof choice === 'string') { + return { + value: choice, + name: choice, + short: choice, + disabled: false, + }; + } + const name = choice.name ?? String(choice.value); + const normalizedChoice = { + value: choice.value, + name, + short: choice.short ?? name, + disabled: choice.disabled ?? false, + }; + if (choice.description) { + normalizedChoice.description = choice.description; + } + return normalizedChoice; + }); +} +export default createPrompt((config, done) => { + const { pageSize = 7, validate = () => true } = config; + const theme = makeTheme(searchTheme, config.theme); + const [status, setStatus] = useState('loading'); + const [searchTerm, setSearchTerm] = useState(''); + const [searchResults, setSearchResults] = useState([]); + const [searchError, setSearchError] = useState(); + const defaultApplied = useRef(false); + const prefix = usePrefix({ status, theme }); + const bounds = useMemo(() => { + const first = searchResults.findIndex(isSelectable); + const last = searchResults.findLastIndex(isSelectable); + return { first, last }; + }, [searchResults]); + const [active = bounds.first, setActive] = useState(); + useEffect(() => { + const controller = new AbortController(); + setStatus('loading'); + setSearchError(undefined); + const fetchResults = async () => { + try { + const results = await config.source(searchTerm || undefined, { + signal: controller.signal, + }); + if (!controller.signal.aborted) { + const normalized = normalizeChoices(results); + let initialActive; + if (!defaultApplied.current && 'default' in config) { + const defaultIndex = normalized.findIndex((item) => isSelectable(item) && item.value === config.default); + initialActive = defaultIndex === -1 ? undefined : defaultIndex; + defaultApplied.current = true; + } + setActive(initialActive); + setSearchError(undefined); + setSearchResults(normalized); + setStatus('idle'); + } + } + catch (error) { + if (!controller.signal.aborted && error instanceof Error) { + setSearchError(error.message); + } + } + }; + void fetchResults(); + return () => { + controller.abort(); + }; + }, [searchTerm]); + // Safe to assume the cursor position never points to a Separator. + const selectedChoice = searchResults[active]; + useKeypress(async (key, rl) => { + if (isEnterKey(key)) { + if (selectedChoice) { + setStatus('loading'); + const isValid = await validate(selectedChoice.value); + setStatus('idle'); + if (isValid === true) { + setStatus('done'); + done(selectedChoice.value); + } + else if (selectedChoice.name === searchTerm) { + setSearchError(isValid || 'You must provide a valid value'); + } + else { + // Reset line with new search term + rl.write(selectedChoice.name); + setSearchTerm(selectedChoice.name); + } + } + else { + // Reset the readline line value to the previous value. On line event, the value + // get cleared, forcing the user to re-enter the value instead of fixing it. + rl.write(searchTerm); + } + } + else if (isTabKey(key) && selectedChoice) { + rl.clearLine(0); // Remove the tab character. + rl.write(selectedChoice.name); + setSearchTerm(selectedChoice.name); + } + else if (status !== 'loading' && (isUpKey(key) || isDownKey(key))) { + rl.clearLine(0); + if ((isUpKey(key) && active !== bounds.first) || + (isDownKey(key) && active !== bounds.last)) { + const offset = isUpKey(key) ? -1 : 1; + let next = active; + do { + next = (next + offset + searchResults.length) % searchResults.length; + } while (!isSelectable(searchResults[next])); + setActive(next); + } + } + else { + setSearchTerm(rl.line); + } + }); + const message = theme.style.message(config.message, status); + const helpLine = theme.style.keysHelpTip([ + ['↑↓', 'navigate'], + ['⏎', 'select'], + ]); + const page = usePagination({ + items: searchResults, + active, + renderItem({ item, isActive }) { + if (Separator.isSeparator(item)) { + return ` ${item.separator}`; + } + if (item.disabled) { + const disabledLabel = typeof item.disabled === 'string' ? item.disabled : '(disabled)'; + return theme.style.disabled(`${item.name} ${disabledLabel}`); + } + const color = isActive ? theme.style.highlight : (x) => x; + const cursor = isActive ? theme.icon.cursor : ` `; + return color(`${cursor} ${item.name}`); + }, + pageSize, + loop: false, + }); + let error; + if (searchError) { + error = theme.style.error(searchError); + } + else if (searchResults.length === 0 && searchTerm !== '' && status === 'idle') { + error = theme.style.error('No results found'); + } + let searchStr; + if (status === 'done' && selectedChoice) { + return [prefix, message, theme.style.answer(selectedChoice.short)] + .filter(Boolean) + .join(' ') + .trimEnd(); + } + else { + searchStr = theme.style.searchTerm(searchTerm); + } + const description = selectedChoice?.description; + const header = [prefix, message, searchStr].filter(Boolean).join(' ').trimEnd(); + const body = [ + error ?? page, + ' ', + description ? theme.style.description(description) : '', + helpLine, + ] + .filter(Boolean) + .join('\n') + .trimEnd(); + return [header, body]; +}); +export { Separator } from '@inquirer/core'; diff --git a/node_modules/@inquirer/search/package.json b/node_modules/@inquirer/search/package.json new file mode 100644 index 0000000..1747009 --- /dev/null +++ b/node_modules/@inquirer/search/package.json @@ -0,0 +1,92 @@ +{ + "name": "@inquirer/search", + "version": "4.1.0", + "description": "Inquirer search prompt", + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/search/README.md", + "license": "MIT", + "author": "Simon Boudrias ", + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "tsc": "tsc" + }, + "dependencies": { + "@inquirer/core": "^11.1.1", + "@inquirer/figures": "^2.0.3", + "@inquirer/type": "^4.0.3" + }, + "devDependencies": { + "@inquirer/testing": "^3.0.4", + "typescript": "^5.9.3" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "gitHead": "99d00a9adc53be8b7edf5926b2ec4ba0b792f68f" +} diff --git a/node_modules/@inquirer/select/LICENSE b/node_modules/@inquirer/select/LICENSE new file mode 100644 index 0000000..f718698 --- /dev/null +++ b/node_modules/@inquirer/select/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2025 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@inquirer/select/README.md b/node_modules/@inquirer/select/README.md new file mode 100644 index 0000000..55f99f8 --- /dev/null +++ b/node_modules/@inquirer/select/README.md @@ -0,0 +1,181 @@ +# `@inquirer/select` + +Simple interactive command line prompt to display a list of choices (single select.) + +![select prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg) + +# Installation + + + + + + + + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/prompts +``` + + + +```sh +yarn add @inquirer/prompts +``` + +
Or
+ +```sh +npm install @inquirer/select +``` + + + +```sh +yarn add @inquirer/select +``` + +
+ +# Usage + +```js +import { select, Separator } from '@inquirer/prompts'; +// Or +// import select, { Separator } from '@inquirer/select'; + +const answer = await select({ + message: 'Select a package manager', + choices: [ + { + name: 'npm', + value: 'npm', + description: 'npm is the most popular package manager', + }, + { + name: 'yarn', + value: 'yarn', + description: 'yarn is an awesome package manager', + }, + new Separator(), + { + name: 'jspm', + value: 'jspm', + disabled: true, + }, + { + name: 'pnpm', + value: 'pnpm', + disabled: '(pnpm is not available)', + }, + ], +}); +``` + +## Options + +| Property | Type | Required | Description | +| -------- | ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| choices | `Choice[]` | yes | List of the available choices. | +| default | `string` | no | Defines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item. | +| pageSize | `number` | no | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. | +| loop | `boolean` | no | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping. | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options. + +### `Choice` object + +The `Choice` object is typed as + +```ts +type Choice = { + value: Value; + name?: string; + description?: string; + short?: string; + disabled?: boolean | string; +}; +``` + +Here's each property: + +- `value`: The value is what will be returned by `await select()`. +- `name`: This is the string displayed in the choice list. +- `description`: Option for a longer description string that'll appear under the list when the cursor highlight a given choice. +- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`. +- `disabled`: Disallow the option from being selected. If `disabled` is a string, it'll be used as a help tip explaining why the choice isn't available. + +`choices` can also be an array of string, in which case the string will be used both as the `value` and the `name`. + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string | { idle: string; done: string }; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string, status: 'idle' | 'done' | 'loading') => string; + error: (text: string) => string; + help: (text: string) => string; + highlight: (text: string) => string; + description: (text: string) => string; + disabled: (text: string) => string; + keysHelpTip: (keys: [key: string, action: string][]) => string | undefined; + }; + icon: { + cursor: string; + }; + indexMode: 'hidden' | 'number'; +}; +``` + +### `theme.style.keysHelpTip` + +This function allows you to customize the keyboard shortcuts help tip displayed below the prompt. It receives an array of key-action pairs and should return a formatted string. You can also hook here to localize the labels to different languages. + +It can also returns `undefined` to hide the help tip entirely. + +```js +theme: { + style: { + keysHelpTip: (keys) => { + // Return undefined to hide the help tip completely. + return undefined; + + // Or customize the formatting. Or localize the labels. + return keys.map(([key, action]) => `${key}: ${action}`).join(' | '); + }; + } +} +``` + +### `theme.indexMode` + +Controls how indices are displayed before each choice: + +- `hidden` (default): No indices are shown +- `number`: Display a number before each choice (e.g. "1. Option A") + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/node_modules/@inquirer/select/dist/index.d.ts b/node_modules/@inquirer/select/dist/index.d.ts new file mode 100644 index 0000000..832a751 --- /dev/null +++ b/node_modules/@inquirer/select/dist/index.d.ts @@ -0,0 +1,32 @@ +import { Separator, type Theme, type Keybinding } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type SelectTheme = { + icon: { + cursor: string; + }; + style: { + disabled: (text: string) => string; + description: (text: string) => string; + keysHelpTip: (keys: [key: string, action: string][]) => string | undefined; + }; + indexMode: 'hidden' | 'number'; + keybindings: ReadonlyArray; +}; +type Choice = { + value: Value; + name?: string; + description?: string; + short?: string; + disabled?: boolean | string; + type?: never; +}; +declare const _default: (config: { + message: string; + choices: readonly (Separator | Value | Choice)[]; + pageSize?: number | undefined; + loop?: boolean | undefined; + default?: NoInfer | undefined; + theme?: PartialDeep> | undefined; +}, context?: import("@inquirer/type").Context) => Promise; +export default _default; +export { Separator } from '@inquirer/core'; diff --git a/node_modules/@inquirer/select/dist/index.js b/node_modules/@inquirer/select/dist/index.js new file mode 100644 index 0000000..33a13b1 --- /dev/null +++ b/node_modules/@inquirer/select/dist/index.js @@ -0,0 +1,176 @@ +import { createPrompt, useState, useKeypress, usePrefix, usePagination, useRef, useMemo, useEffect, isBackspaceKey, isEnterKey, isUpKey, isDownKey, isNumberKey, Separator, ValidationError, makeTheme, } from '@inquirer/core'; +import { cursorHide } from '@inquirer/ansi'; +import { styleText } from 'node:util'; +import figures from '@inquirer/figures'; +const selectTheme = { + icon: { cursor: figures.pointer }, + style: { + disabled: (text) => styleText('dim', `- ${text}`), + description: (text) => styleText('cyan', text), + keysHelpTip: (keys) => keys + .map(([key, action]) => `${styleText('bold', key)} ${styleText('dim', action)}`) + .join(styleText('dim', ' • ')), + }, + indexMode: 'hidden', + keybindings: [], +}; +function isSelectable(item) { + return !Separator.isSeparator(item) && !item.disabled; +} +function normalizeChoices(choices) { + return choices.map((choice) => { + if (Separator.isSeparator(choice)) + return choice; + if (typeof choice !== 'object' || choice === null || !('value' in choice)) { + // It's a raw value (string, number, etc.) + const name = String(choice); + return { + value: choice, + name, + short: name, + disabled: false, + }; + } + const name = choice.name ?? String(choice.value); + const normalizedChoice = { + value: choice.value, + name, + short: choice.short ?? name, + disabled: choice.disabled ?? false, + }; + if (choice.description) { + normalizedChoice.description = choice.description; + } + return normalizedChoice; + }); +} +export default createPrompt((config, done) => { + const { loop = true, pageSize = 7 } = config; + const theme = makeTheme(selectTheme, config.theme); + const { keybindings } = theme; + const [status, setStatus] = useState('idle'); + const prefix = usePrefix({ status, theme }); + const searchTimeoutRef = useRef(); + // Vim keybindings (j/k) conflict with typing those letters in search, + // so search must be disabled when vim bindings are enabled + const searchEnabled = !keybindings.includes('vim'); + const items = useMemo(() => normalizeChoices(config.choices), [config.choices]); + const bounds = useMemo(() => { + const first = items.findIndex(isSelectable); + const last = items.findLastIndex(isSelectable); + if (first === -1) { + throw new ValidationError('[select prompt] No selectable choices. All choices are disabled.'); + } + return { first, last }; + }, [items]); + const defaultItemIndex = useMemo(() => { + if (!('default' in config)) + return -1; + return items.findIndex((item) => isSelectable(item) && item.value === config.default); + }, [config.default, items]); + const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex); + // Safe to assume the cursor position always point to a Choice. + const selectedChoice = items[active]; + useKeypress((key, rl) => { + clearTimeout(searchTimeoutRef.current); + if (isEnterKey(key)) { + setStatus('done'); + done(selectedChoice.value); + } + else if (isUpKey(key, keybindings) || isDownKey(key, keybindings)) { + rl.clearLine(0); + if (loop || + (isUpKey(key, keybindings) && active !== bounds.first) || + (isDownKey(key, keybindings) && active !== bounds.last)) { + const offset = isUpKey(key, keybindings) ? -1 : 1; + let next = active; + do { + next = (next + offset + items.length) % items.length; + } while (!isSelectable(items[next])); + setActive(next); + } + } + else if (isNumberKey(key) && !Number.isNaN(Number(rl.line))) { + const selectedIndex = Number(rl.line) - 1; + // Find the nth item (ignoring separators) + let selectableIndex = -1; + const position = items.findIndex((item) => { + if (Separator.isSeparator(item)) + return false; + selectableIndex++; + return selectableIndex === selectedIndex; + }); + const item = items[position]; + if (item != null && isSelectable(item)) { + setActive(position); + } + searchTimeoutRef.current = setTimeout(() => { + rl.clearLine(0); + }, 700); + } + else if (isBackspaceKey(key)) { + rl.clearLine(0); + } + else if (searchEnabled) { + const searchTerm = rl.line.toLowerCase(); + const matchIndex = items.findIndex((item) => { + if (Separator.isSeparator(item) || !isSelectable(item)) + return false; + return item.name.toLowerCase().startsWith(searchTerm); + }); + if (matchIndex !== -1) { + setActive(matchIndex); + } + searchTimeoutRef.current = setTimeout(() => { + rl.clearLine(0); + }, 700); + } + }); + useEffect(() => () => { + clearTimeout(searchTimeoutRef.current); + }, []); + const message = theme.style.message(config.message, status); + const helpLine = theme.style.keysHelpTip([ + ['↑↓', 'navigate'], + ['⏎', 'select'], + ]); + let separatorCount = 0; + const page = usePagination({ + items, + active, + renderItem({ item, isActive, index }) { + if (Separator.isSeparator(item)) { + separatorCount++; + return ` ${item.separator}`; + } + const indexLabel = theme.indexMode === 'number' ? `${index + 1 - separatorCount}. ` : ''; + if (item.disabled) { + const disabledLabel = typeof item.disabled === 'string' ? item.disabled : '(disabled)'; + return theme.style.disabled(`${indexLabel}${item.name} ${disabledLabel}`); + } + const color = isActive ? theme.style.highlight : (x) => x; + const cursor = isActive ? theme.icon.cursor : ` `; + return color(`${cursor} ${indexLabel}${item.name}`); + }, + pageSize, + loop, + }); + if (status === 'done') { + return [prefix, message, theme.style.answer(selectedChoice.short)] + .filter(Boolean) + .join(' '); + } + const { description } = selectedChoice; + const lines = [ + [prefix, message].filter(Boolean).join(' '), + page, + ' ', + description ? theme.style.description(description) : '', + helpLine, + ] + .filter(Boolean) + .join('\n') + .trimEnd(); + return `${lines}${cursorHide}`; +}); +export { Separator } from '@inquirer/core'; diff --git a/node_modules/@inquirer/select/package.json b/node_modules/@inquirer/select/package.json new file mode 100644 index 0000000..5210587 --- /dev/null +++ b/node_modules/@inquirer/select/package.json @@ -0,0 +1,93 @@ +{ + "name": "@inquirer/select", + "version": "5.0.4", + "description": "Inquirer select/list prompt", + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/select/README.md", + "license": "MIT", + "author": "Simon Boudrias ", + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "tsc": "tsc" + }, + "dependencies": { + "@inquirer/ansi": "^2.0.3", + "@inquirer/core": "^11.1.1", + "@inquirer/figures": "^2.0.3", + "@inquirer/type": "^4.0.3" + }, + "devDependencies": { + "@inquirer/testing": "^3.0.4", + "typescript": "^5.9.3" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "gitHead": "99d00a9adc53be8b7edf5926b2ec4ba0b792f68f" +} diff --git a/node_modules/@inquirer/type/LICENSE b/node_modules/@inquirer/type/LICENSE new file mode 100644 index 0000000..f718698 --- /dev/null +++ b/node_modules/@inquirer/type/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2025 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@inquirer/type/dist/index.d.ts b/node_modules/@inquirer/type/dist/index.d.ts new file mode 100644 index 0000000..611714b --- /dev/null +++ b/node_modules/@inquirer/type/dist/index.d.ts @@ -0,0 +1,2 @@ +export * from './inquirer.ts'; +export * from './utils.ts'; diff --git a/node_modules/@inquirer/type/dist/index.js b/node_modules/@inquirer/type/dist/index.js new file mode 100644 index 0000000..e5adf2c --- /dev/null +++ b/node_modules/@inquirer/type/dist/index.js @@ -0,0 +1,2 @@ +export * from "./inquirer.js"; +export * from "./utils.js"; diff --git a/node_modules/@inquirer/type/dist/inquirer.d.ts b/node_modules/@inquirer/type/dist/inquirer.d.ts new file mode 100644 index 0000000..354329b --- /dev/null +++ b/node_modules/@inquirer/type/dist/inquirer.d.ts @@ -0,0 +1,35 @@ +import { Duplex } from 'node:stream'; +/** + * `InquirerReadline` is a re-implementation of `readline.Interface` from Node.js. + * We're reimplementing it because of 3 reasons: + * 1. The `readline.Interface` API is not complete; it's missing for example `clearLine`. + * 2. The input/output streams are not generics, meaning they're inexact. + * 3. Since ReadLine isn't built-in Typescript Global NodeJS type, it'd force us to ship `@types/node` as a dependency to all users. + */ +export type InquirerReadline = { + output: Duplex & { + mute: () => void; + unmute: () => void; + }; + input: NodeJS.ReadableStream; + clearLine: (dir: 0 | 1 | -1) => void; + getCursorPos: () => { + rows: number; + cols: number; + }; + setPrompt: (prompt: string) => void; + line: string; + write: (data: string) => void; + on: (event: string, listener: (...args: unknown[]) => void) => void; + removeListener: (event: string, listener: (...args: unknown[]) => void) => void; + pause: () => void; + resume: () => void; + close: () => void; +}; +export type Context = { + input?: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + clearPromptOnDone?: boolean; + signal?: AbortSignal; +}; +export type Prompt = (config: Config, context?: Context) => Promise; diff --git a/node_modules/@inquirer/type/dist/inquirer.js b/node_modules/@inquirer/type/dist/inquirer.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@inquirer/type/dist/inquirer.js @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@inquirer/type/dist/utils.d.ts b/node_modules/@inquirer/type/dist/utils.d.ts new file mode 100644 index 0000000..c37eb73 --- /dev/null +++ b/node_modules/@inquirer/type/dist/utils.d.ts @@ -0,0 +1,29 @@ +type Key = string | number | symbol; +export type Prettify = { + [K in keyof T]: T[K]; +} & {}; +export type PartialDeep = T extends object ? { + [P in keyof T]?: PartialDeep; +} : T; +export type LiteralUnion = T | (F & {}); +export type KeyUnion = LiteralUnion>; +export type DistributiveMerge = A extends any ? Prettify & B> : never; +export type UnionToIntersection = (T extends any ? (input: T) => void : never) extends (input: infer Intersection) => void ? Intersection : never; +/** + * @hidden + */ +type __Pick = { + [P in K]: O[P]; +} & {}; +/** + * @hidden + */ +export type _Pick = __Pick; +/** + * Extract out of `O` the fields of key `K` + * @param O to extract from + * @param K to chose fields + * @returns [[Object]] + */ +export type Pick = O extends unknown ? _Pick : never; +export {}; diff --git a/node_modules/@inquirer/type/dist/utils.js b/node_modules/@inquirer/type/dist/utils.js new file mode 100644 index 0000000..7941332 --- /dev/null +++ b/node_modules/@inquirer/type/dist/utils.js @@ -0,0 +1,2 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +export {}; diff --git a/node_modules/@inquirer/type/package.json b/node_modules/@inquirer/type/package.json new file mode 100644 index 0000000..4a63b52 --- /dev/null +++ b/node_modules/@inquirer/type/package.json @@ -0,0 +1,87 @@ +{ + "name": "@inquirer/type", + "version": "4.0.3", + "description": "Inquirer core TS types", + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "types", + "typescript", + "ui", + "yeoman", + "yo", + "zsh" + ], + "license": "MIT", + "author": "Simon Boudrias ", + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "tsc": "tsc" + }, + "devDependencies": { + "typescript": "^5.9.3" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "gitHead": "99d00a9adc53be8b7edf5926b2ec4ba0b792f68f" +} diff --git a/node_modules/@isaacs/balanced-match/LICENSE.md b/node_modules/@isaacs/balanced-match/LICENSE.md new file mode 100644 index 0000000..61ece8c --- /dev/null +++ b/node_modules/@isaacs/balanced-match/LICENSE.md @@ -0,0 +1,23 @@ +(MIT) + +Original code Copyright Julian Gruber + +Port to TypeScript Copyright Isaac Z. Schlueter + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@isaacs/balanced-match/README.md b/node_modules/@isaacs/balanced-match/README.md new file mode 100644 index 0000000..ed10c70 --- /dev/null +++ b/node_modules/@isaacs/balanced-match/README.md @@ -0,0 +1,60 @@ +# @isaacs/balanced-match + +A hybrid CJS/ESM TypeScript fork of +[balanced-match](http://npm.im/balanced-match). + +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! + +[![CI](https://github.com/juliangruber/balanced-match/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/balanced-match/actions/workflows/ci.yml) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +import { balanced } from '@isaacs/balanced-match' + +console.log(balanced('{', '}', 'pre{in{nested}}post')) +console.log(balanced('{', '}', 'pre{first}between{second}post')) +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')) +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } +``` + +## API + +### const m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +- **start** the index of the first match of `a` +- **end** the index of the matching `b` +- **pre** the preamble, `a` and `b` not included +- **body** the match, `a` and `b` not included +- **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. + +### const r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[
, ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. diff --git a/node_modules/@isaacs/balanced-match/dist/commonjs/index.d.ts b/node_modules/@isaacs/balanced-match/dist/commonjs/index.d.ts new file mode 100644 index 0000000..f819cfd --- /dev/null +++ b/node_modules/@isaacs/balanced-match/dist/commonjs/index.d.ts @@ -0,0 +1,9 @@ +export declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | { + start: number; + end: number; + pre: string; + body: string; + post: string; +} | undefined; +export declare const range: (a: string, b: string, str: string) => undefined | [number, number]; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@isaacs/balanced-match/dist/commonjs/index.d.ts.map b/node_modules/@isaacs/balanced-match/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000..6306762 --- /dev/null +++ b/node_modules/@isaacs/balanced-match/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"} \ No newline at end of file diff --git a/node_modules/@isaacs/balanced-match/dist/commonjs/index.js b/node_modules/@isaacs/balanced-match/dist/commonjs/index.js new file mode 100644 index 0000000..0c9014b --- /dev/null +++ b/node_modules/@isaacs/balanced-match/dist/commonjs/index.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.range = exports.balanced = void 0; +const balanced = (a, b, str) => { + const ma = a instanceof RegExp ? maybeMatch(a, str) : a; + const mb = b instanceof RegExp ? maybeMatch(b, str) : b; + const r = ma !== null && mb != null && (0, exports.range)(ma, mb, str); + return (r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + ma.length, r[1]), + post: str.slice(r[1] + mb.length), + }); +}; +exports.balanced = balanced; +const maybeMatch = (reg, str) => { + const m = str.match(reg); + return m ? m[0] : null; +}; +const range = (a, b, str) => { + let begs, beg, left, right = undefined, result; + let ai = str.indexOf(a); + let bi = str.indexOf(b, ai + 1); + let i = ai; + if (ai >= 0 && bi > 0) { + if (a === b) { + return [ai, bi]; + } + begs = []; + left = str.length; + while (i >= 0 && !result) { + if (i === ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } + else if (begs.length === 1) { + const r = begs.pop(); + if (r !== undefined) + result = [r, bi]; + } + else { + beg = begs.pop(); + if (beg !== undefined && beg < left) { + left = beg; + right = bi; + } + bi = str.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length && right !== undefined) { + result = [left, right]; + } + } + return result; +}; +exports.range = range; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@isaacs/balanced-match/dist/commonjs/index.js.map b/node_modules/@isaacs/balanced-match/dist/commonjs/index.js.map new file mode 100644 index 0000000..83f547c --- /dev/null +++ b/node_modules/@isaacs/balanced-match/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAO,MAAM,QAAQ,GAAG,CACtB,CAAkB,EAClB,CAAkB,EAClB,GAAW,EACX,EAAE;IACF,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEvD,MAAM,CAAC,GAAG,EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,IAAA,aAAK,EAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;IAEzD,OAAO,CACL,CAAC,IAAI;QACH,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;QACX,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACT,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;KAClC,CACF,CAAA;AACH,CAAC,CAAA;AAnBY,QAAA,QAAQ,YAmBpB;AAED,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,EAAE;IAC9C,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACxB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AACxB,CAAC,CAAA;AAEM,MAAM,KAAK,GAAG,CACnB,CAAS,EACT,CAAS,EACT,GAAW,EACmB,EAAE;IAChC,IAAI,IAAc,EAChB,GAAuB,EACvB,IAAY,EACZ,KAAK,GAAuB,SAAS,EACrC,MAAoC,CAAA;IACtC,IAAI,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACvB,IAAI,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAA;IAC/B,IAAI,CAAC,GAAG,EAAE,CAAA;IAEV,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QACtB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACZ,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QACjB,CAAC;QACD,IAAI,GAAG,EAAE,CAAA;QACT,IAAI,GAAG,GAAG,CAAC,MAAM,CAAA;QAEjB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACzB,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;gBACb,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;gBACZ,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC5B,CAAC;iBAAM,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBACpB,IAAI,CAAC,KAAK,SAAS;oBAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;YACvC,CAAC;iBAAM,CAAC;gBACN,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBAChB,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;oBACpC,IAAI,GAAG,GAAG,CAAA;oBACV,KAAK,GAAG,EAAE,CAAA;gBACZ,CAAC;gBAED,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC5B,CAAC;YAED,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AA/CY,QAAA,KAAK,SA+CjB","sourcesContent":["export const balanced = (\n a: string | RegExp,\n b: string | RegExp,\n str: string,\n) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]} \ No newline at end of file diff --git a/node_modules/@isaacs/balanced-match/dist/commonjs/package.json b/node_modules/@isaacs/balanced-match/dist/commonjs/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/node_modules/@isaacs/balanced-match/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/@isaacs/balanced-match/dist/esm/index.d.ts b/node_modules/@isaacs/balanced-match/dist/esm/index.d.ts new file mode 100644 index 0000000..f819cfd --- /dev/null +++ b/node_modules/@isaacs/balanced-match/dist/esm/index.d.ts @@ -0,0 +1,9 @@ +export declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | { + start: number; + end: number; + pre: string; + body: string; + post: string; +} | undefined; +export declare const range: (a: string, b: string, str: string) => undefined | [number, number]; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@isaacs/balanced-match/dist/esm/index.d.ts.map b/node_modules/@isaacs/balanced-match/dist/esm/index.d.ts.map new file mode 100644 index 0000000..6306762 --- /dev/null +++ b/node_modules/@isaacs/balanced-match/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"} \ No newline at end of file diff --git a/node_modules/@isaacs/balanced-match/dist/esm/index.js b/node_modules/@isaacs/balanced-match/dist/esm/index.js new file mode 100644 index 0000000..fe81200 --- /dev/null +++ b/node_modules/@isaacs/balanced-match/dist/esm/index.js @@ -0,0 +1,54 @@ +export const balanced = (a, b, str) => { + const ma = a instanceof RegExp ? maybeMatch(a, str) : a; + const mb = b instanceof RegExp ? maybeMatch(b, str) : b; + const r = ma !== null && mb != null && range(ma, mb, str); + return (r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + ma.length, r[1]), + post: str.slice(r[1] + mb.length), + }); +}; +const maybeMatch = (reg, str) => { + const m = str.match(reg); + return m ? m[0] : null; +}; +export const range = (a, b, str) => { + let begs, beg, left, right = undefined, result; + let ai = str.indexOf(a); + let bi = str.indexOf(b, ai + 1); + let i = ai; + if (ai >= 0 && bi > 0) { + if (a === b) { + return [ai, bi]; + } + begs = []; + left = str.length; + while (i >= 0 && !result) { + if (i === ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } + else if (begs.length === 1) { + const r = begs.pop(); + if (r !== undefined) + result = [r, bi]; + } + else { + beg = begs.pop(); + if (beg !== undefined && beg < left) { + left = beg; + right = bi; + } + bi = str.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length && right !== undefined) { + result = [left, right]; + } + } + return result; +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@isaacs/balanced-match/dist/esm/index.js.map b/node_modules/@isaacs/balanced-match/dist/esm/index.js.map new file mode 100644 index 0000000..b476cae --- /dev/null +++ b/node_modules/@isaacs/balanced-match/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAkB,EAClB,CAAkB,EAClB,GAAW,EACX,EAAE;IACF,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEvD,MAAM,CAAC,GAAG,EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;IAEzD,OAAO,CACL,CAAC,IAAI;QACH,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;QACX,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACT,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;KAClC,CACF,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,EAAE;IAC9C,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACxB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AACxB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,CACnB,CAAS,EACT,CAAS,EACT,GAAW,EACmB,EAAE;IAChC,IAAI,IAAc,EAChB,GAAuB,EACvB,IAAY,EACZ,KAAK,GAAuB,SAAS,EACrC,MAAoC,CAAA;IACtC,IAAI,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACvB,IAAI,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAA;IAC/B,IAAI,CAAC,GAAG,EAAE,CAAA;IAEV,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QACtB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACZ,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QACjB,CAAC;QACD,IAAI,GAAG,EAAE,CAAA;QACT,IAAI,GAAG,GAAG,CAAC,MAAM,CAAA;QAEjB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACzB,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;gBACb,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;gBACZ,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC5B,CAAC;iBAAM,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBACpB,IAAI,CAAC,KAAK,SAAS;oBAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;YACvC,CAAC;iBAAM,CAAC;gBACN,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBAChB,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;oBACpC,IAAI,GAAG,GAAG,CAAA;oBACV,KAAK,GAAG,EAAE,CAAA;gBACZ,CAAC;gBAED,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC5B,CAAC;YAED,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA","sourcesContent":["export const balanced = (\n a: string | RegExp,\n b: string | RegExp,\n str: string,\n) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]} \ No newline at end of file diff --git a/node_modules/@isaacs/balanced-match/dist/esm/package.json b/node_modules/@isaacs/balanced-match/dist/esm/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/node_modules/@isaacs/balanced-match/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@isaacs/balanced-match/package.json b/node_modules/@isaacs/balanced-match/package.json new file mode 100644 index 0000000..49296e6 --- /dev/null +++ b/node_modules/@isaacs/balanced-match/package.json @@ -0,0 +1,79 @@ +{ + "name": "@isaacs/balanced-match", + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "version": "4.0.1", + "files": [ + "dist" + ], + "repository": { + "type": "git", + "url": "git://github.com/isaacs/balanced-match.git" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "type": "module", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write . --loglevel warn", + "benchmark": "node benchmark/index.js", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "prettier": { + "semi": false, + "printWidth": 80, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "devDependencies": { + "@types/brace-expansion": "^1.1.2", + "@types/node": "^24.0.0", + "mkdirp": "^3.0.1", + "prettier": "^3.3.2", + "tap": "^21.1.0", + "tshy": "^3.0.2", + "typedoc": "^0.28.5" + }, + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "license": "MIT", + "engines": { + "node": "20 || >=22" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" +} diff --git a/node_modules/@isaacs/brace-expansion/LICENSE b/node_modules/@isaacs/brace-expansion/LICENSE new file mode 100644 index 0000000..46e7b75 --- /dev/null +++ b/node_modules/@isaacs/brace-expansion/LICENSE @@ -0,0 +1,23 @@ +MIT License + +Copyright Julian Gruber + +TypeScript port Copyright Isaac Z. Schlueter + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@isaacs/brace-expansion/README.md b/node_modules/@isaacs/brace-expansion/README.md new file mode 100644 index 0000000..e782af7 --- /dev/null +++ b/node_modules/@isaacs/brace-expansion/README.md @@ -0,0 +1,97 @@ +# @isaacs/brace-expansion + +A hybrid CJS/ESM TypeScript fork of +[brace-expansion](http://npm.im/brace-expansion). + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![CI](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) + +## Example + +```js +import { expand } from '@isaacs/brace-expansion' + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +import { expand } from '@isaacs/brace-expansion' +``` + +### const expanded = expand(str, [options]) + +Return an array of all possible and valid expansions of `str`. If +none are found, `[str]` is returned. + +The `options` object can provide a `max` value to cap the number +of expansions allowed. This is limited to `100_000` by default, +to prevent DoS attacks. + +```js +const expansions = expand('{1..100}'.repeat(5), { + max: 100, +}) +// expansions.length will be 100, not 100^5 +``` + +Valid expansions are: + +```js +;/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +;/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +;/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. diff --git a/node_modules/@isaacs/brace-expansion/dist/commonjs/index.d.ts b/node_modules/@isaacs/brace-expansion/dist/commonjs/index.d.ts new file mode 100644 index 0000000..92b7a7f --- /dev/null +++ b/node_modules/@isaacs/brace-expansion/dist/commonjs/index.d.ts @@ -0,0 +1,6 @@ +export declare const EXPANSION_MAX = 100000; +export type BraceExpansionOptions = { + max?: number; +}; +export declare function expand(str: string, options?: BraceExpansionOptions): string[]; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@isaacs/brace-expansion/dist/commonjs/index.d.ts.map b/node_modules/@isaacs/brace-expansion/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000..a4f36ae --- /dev/null +++ b/node_modules/@isaacs/brace-expansion/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAwDpC,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"} \ No newline at end of file diff --git a/node_modules/@isaacs/brace-expansion/dist/commonjs/index.js b/node_modules/@isaacs/brace-expansion/dist/commonjs/index.js new file mode 100644 index 0000000..fafdb4b --- /dev/null +++ b/node_modules/@isaacs/brace-expansion/dist/commonjs/index.js @@ -0,0 +1,199 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EXPANSION_MAX = void 0; +exports.expand = expand; +const balanced_match_1 = require("@isaacs/balanced-match"); +const escSlash = '\0SLASH' + Math.random() + '\0'; +const escOpen = '\0OPEN' + Math.random() + '\0'; +const escClose = '\0CLOSE' + Math.random() + '\0'; +const escComma = '\0COMMA' + Math.random() + '\0'; +const escPeriod = '\0PERIOD' + Math.random() + '\0'; +const escSlashPattern = new RegExp(escSlash, 'g'); +const escOpenPattern = new RegExp(escOpen, 'g'); +const escClosePattern = new RegExp(escClose, 'g'); +const escCommaPattern = new RegExp(escComma, 'g'); +const escPeriodPattern = new RegExp(escPeriod, 'g'); +const slashPattern = /\\\\/g; +const openPattern = /\\{/g; +const closePattern = /\\}/g; +const commaPattern = /\\,/g; +const periodPattern = /\\./g; +exports.EXPANSION_MAX = 100_000; +function numeric(str) { + return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); +} +function escapeBraces(str) { + return str + .replace(slashPattern, escSlash) + .replace(openPattern, escOpen) + .replace(closePattern, escClose) + .replace(commaPattern, escComma) + .replace(periodPattern, escPeriod); +} +function unescapeBraces(str) { + return str + .replace(escSlashPattern, '\\') + .replace(escOpenPattern, '{') + .replace(escClosePattern, '}') + .replace(escCommaPattern, ',') + .replace(escPeriodPattern, '.'); +} +/** + * Basically just str.split(","), but handling cases + * where we have nested braced sections, which should be + * treated as individual members, like {a,{b,c},d} + */ +function parseCommaParts(str) { + if (!str) { + return ['']; + } + const parts = []; + const m = (0, balanced_match_1.balanced)('{', '}', str); + if (!m) { + return str.split(','); + } + const { pre, body, post } = m; + const p = pre.split(','); + p[p.length - 1] += '{' + body + '}'; + const postParts = parseCommaParts(post); + if (post.length) { + ; + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); + } + parts.push.apply(parts, p); + return parts; +} +function expand(str, options = {}) { + if (!str) { + return []; + } + const { max = exports.EXPANSION_MAX } = options; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.slice(0, 2) === '{}') { + str = '\\{\\}' + str.slice(2); + } + return expand_(escapeBraces(str), max, true).map(unescapeBraces); +} +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} +function expand_(str, max, isTop) { + /** @type {string[]} */ + const expansions = []; + const m = (0, balanced_match_1.balanced)('{', '}', str); + if (!m) + return [str]; + // no need to expand pre, since it is guaranteed to be free of brace-sets + const pre = m.pre; + const post = m.post.length ? expand_(m.post, max, false) : ['']; + if (/\$$/.test(m.pre)) { + for (let k = 0; k < post.length && k < max; k++) { + const expansion = pre + '{' + m.body + '}' + post[k]; + expansions.push(expansion); + } + } + else { + const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + const isSequence = isNumericSequence || isAlphaSequence; + const isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,(?!,).*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand_(str, max, true); + } + return [str]; + } + let n; + if (isSequence) { + n = m.body.split(/\.\./); + } + else { + n = parseCommaParts(m.body); + if (n.length === 1 && n[0] !== undefined) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand_(n[0], max, false).map(embrace); + //XXX is this necessary? Can't seem to hit it in tests. + /* c8 ignore start */ + if (n.length === 1) { + return post.map(p => m.pre + n[0] + p); + } + /* c8 ignore stop */ + } + } + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + let N; + if (isSequence && n[0] !== undefined && n[1] !== undefined) { + const x = numeric(n[0]); + const y = numeric(n[1]); + const width = Math.max(n[0].length, n[1].length); + let incr = n.length === 3 && n[2] !== undefined ? Math.abs(numeric(n[2])) : 1; + let test = lte; + const reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + const pad = n.some(isPadded); + N = []; + for (let i = x; test(i, y); i += incr) { + let c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') { + c = ''; + } + } + else { + c = String(i); + if (pad) { + const need = width - c.length; + if (need > 0) { + const z = new Array(need + 1).join('0'); + if (i < 0) { + c = '-' + z + c.slice(1); + } + else { + c = z + c; + } + } + } + } + N.push(c); + } + } + else { + N = []; + for (let j = 0; j < n.length; j++) { + N.push.apply(N, expand_(n[j], max, false)); + } + } + for (let j = 0; j < N.length; j++) { + for (let k = 0; k < post.length && expansions.length < max; k++) { + const expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) { + expansions.push(expansion); + } + } + } + } + return expansions; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@isaacs/brace-expansion/dist/commonjs/index.js.map b/node_modules/@isaacs/brace-expansion/dist/commonjs/index.js.map new file mode 100644 index 0000000..7bdf62d --- /dev/null +++ b/node_modules/@isaacs/brace-expansion/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AA8EA,wBAkBC;AAhGD,2DAAiD;AAEjD,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AAC/C,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACnD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAC/C,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,gBAAgB,GAAG,IAAI,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;AACnD,MAAM,YAAY,GAAG,OAAO,CAAA;AAC5B,MAAM,WAAW,GAAG,MAAM,CAAA;AAC1B,MAAM,YAAY,GAAG,MAAM,CAAA;AAC3B,MAAM,YAAY,GAAG,MAAM,CAAA;AAC3B,MAAM,aAAa,GAAG,MAAM,CAAA;AAEf,QAAA,aAAa,GAAG,OAAO,CAAA;AAEpC,SAAS,OAAO,CAAC,GAAW;IAC1B,OAAO,CAAC,KAAK,CAAC,GAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AACnE,CAAC;AAED,SAAS,YAAY,CAAC,GAAW;IAC/B,OAAO,GAAG;SACP,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC;SAC/B,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC;SAC7B,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC;SAC/B,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC;SAC/B,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,CAAA;AACtC,CAAC;AAED,SAAS,cAAc,CAAC,GAAW;IACjC,OAAO,GAAG;SACP,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;SAC9B,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;SAC5B,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC;SAC7B,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC;SAC7B,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAA;AACnC,CAAC;AAED;;;;GAIG;AACH,SAAS,eAAe,CAAC,GAAW;IAClC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,CAAC,EAAE,CAAC,CAAA;IACb,CAAC;IAED,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,MAAM,CAAC,GAAG,IAAA,yBAAQ,EAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IAEjC,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACvB,CAAC;IAED,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;IAC7B,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAExB,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,GAAG,GAAG,IAAI,GAAG,GAAG,CAAA;IACnC,MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC,CAAA;IACvC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC;QAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAY,IAAI,SAAS,CAAC,KAAK,EAAE,CAAA;QACjD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;IAC5B,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IAE1B,OAAO,KAAK,CAAA;AACd,CAAC;AAMD,SAAgB,MAAM,CAAC,GAAW,EAAE,UAAiC,EAAE;IACrE,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,EAAE,CAAA;IACX,CAAC;IAED,MAAM,EAAE,GAAG,GAAG,qBAAa,EAAE,GAAG,OAAO,CAAA;IAEvC,oDAAoD;IACpD,oEAAoE;IACpE,sEAAsE;IACtE,6CAA6C;IAC7C,oEAAoE;IACpE,+DAA+D;IAC/D,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC7B,GAAG,GAAG,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC/B,CAAC;IAED,OAAO,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;AAClE,CAAC;AAED,SAAS,OAAO,CAAC,GAAW;IAC1B,OAAO,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AACxB,CAAC;AAED,SAAS,QAAQ,CAAC,EAAU;IAC1B,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,GAAG,CAAC,CAAS,EAAE,CAAS;IAC/B,OAAO,CAAC,IAAI,CAAC,CAAA;AACf,CAAC;AAED,SAAS,GAAG,CAAC,CAAS,EAAE,CAAS;IAC/B,OAAO,CAAC,IAAI,CAAC,CAAA;AACf,CAAC;AAED,SAAS,OAAO,CAAC,GAAW,EAAE,GAAW,EAAE,KAAc;IACvD,uBAAuB;IACvB,MAAM,UAAU,GAAa,EAAE,CAAA;IAE/B,MAAM,CAAC,GAAG,IAAA,yBAAQ,EAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IACjC,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,CAAA;IAEpB,yEAAyE;IACzE,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAA;IACjB,MAAM,IAAI,GAAa,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAEzE,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YAChD,MAAM,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;YACpD,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,iBAAiB,GAAG,gCAAgC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QACvE,MAAM,eAAe,GAAG,sCAAsC,CAAC,IAAI,CACjE,CAAC,CAAC,IAAI,CACP,CAAA;QACD,MAAM,UAAU,GAAG,iBAAiB,IAAI,eAAe,CAAA;QACvD,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC1C,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,EAAE,CAAC;YAC9B,SAAS;YACT,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC/B,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,IAAI,GAAG,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAA;gBAC9C,OAAO,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;YAChC,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,CAAA;QACd,CAAC;QAED,IAAI,CAAW,CAAA;QACf,IAAI,UAAU,EAAE,CAAC;YACf,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAC1B,CAAC;aAAM,CAAC;YACN,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;YAC3B,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;gBACzC,4BAA4B;gBAC5B,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;gBAC1C,uDAAuD;gBACvD,qBAAqB;gBACrB,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACnB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;gBACxC,CAAC;gBACD,oBAAoB;YACtB,CAAC;QACH,CAAC;QAED,kEAAkE;QAClE,uBAAuB;QACvB,IAAI,CAAW,CAAA;QAEf,IAAI,UAAU,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;YAC3D,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACvB,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACvB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;YAChD,IAAI,IAAI,GACN,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACpE,IAAI,IAAI,GAAG,GAAG,CAAA;YACd,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,CAAA;YACrB,IAAI,OAAO,EAAE,CAAC;gBACZ,IAAI,IAAI,CAAC,CAAC,CAAA;gBACV,IAAI,GAAG,GAAG,CAAA;YACZ,CAAC;YACD,MAAM,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YAE5B,CAAC,GAAG,EAAE,CAAA;YAEN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;gBACtC,IAAI,CAAC,CAAA;gBACL,IAAI,eAAe,EAAE,CAAC;oBACpB,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;oBAC1B,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;wBACf,CAAC,GAAG,EAAE,CAAA;oBACR,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;oBACb,IAAI,GAAG,EAAE,CAAC;wBACR,MAAM,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC,MAAM,CAAA;wBAC7B,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;4BACb,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;4BACvC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gCACV,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;4BAC1B,CAAC;iCAAM,CAAC;gCACN,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;4BACX,CAAC;wBACH,CAAC;oBACH,CAAC;gBACH,CAAC;gBACD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACX,CAAC;QACH,CAAC;aAAM,CAAC;YACN,CAAC,GAAG,EAAE,CAAA;YAEN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAClC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAW,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;YACtD,CAAC;QACH,CAAC;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;gBAChE,MAAM,SAAS,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;gBACtC,IAAI,CAAC,KAAK,IAAI,UAAU,IAAI,SAAS,EAAE,CAAC;oBACtC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import { balanced } from '@isaacs/balanced-match'\n\nconst escSlash = '\\0SLASH' + Math.random() + '\\0'\nconst escOpen = '\\0OPEN' + Math.random() + '\\0'\nconst escClose = '\\0CLOSE' + Math.random() + '\\0'\nconst escComma = '\\0COMMA' + Math.random() + '\\0'\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0'\nconst escSlashPattern = new RegExp(escSlash, 'g')\nconst escOpenPattern = new RegExp(escOpen, 'g')\nconst escClosePattern = new RegExp(escClose, 'g')\nconst escCommaPattern = new RegExp(escComma, 'g')\nconst escPeriodPattern = new RegExp(escPeriod, 'g')\nconst slashPattern = /\\\\\\\\/g\nconst openPattern = /\\\\{/g\nconst closePattern = /\\\\}/g\nconst commaPattern = /\\\\,/g\nconst periodPattern = /\\\\./g\n\nexport const EXPANSION_MAX = 100_000\n\nfunction numeric(str: string) {\n return !isNaN(str as any) ? parseInt(str, 10) : str.charCodeAt(0)\n}\n\nfunction escapeBraces(str: string) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod)\n}\n\nfunction unescapeBraces(str: string) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.')\n}\n\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str: string) {\n if (!str) {\n return ['']\n }\n\n const parts: string[] = []\n const m = balanced('{', '}', str)\n\n if (!m) {\n return str.split(',')\n }\n\n const { pre, body, post } = m\n const p = pre.split(',')\n\n p[p.length - 1] += '{' + body + '}'\n const postParts = parseCommaParts(post)\n if (post.length) {\n ;(p[p.length - 1] as string) += postParts.shift()\n p.push.apply(p, postParts)\n }\n\n parts.push.apply(parts, p)\n\n return parts\n}\n\nexport type BraceExpansionOptions = {\n max?: number\n}\n\nexport function expand(str: string, options: BraceExpansionOptions = {}) {\n if (!str) {\n return []\n }\n\n const { max = EXPANSION_MAX } = options\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2)\n }\n\n return expand_(escapeBraces(str), max, true).map(unescapeBraces)\n}\n\nfunction embrace(str: string) {\n return '{' + str + '}'\n}\n\nfunction isPadded(el: string) {\n return /^-?0\\d/.test(el)\n}\n\nfunction lte(i: number, y: number) {\n return i <= y\n}\n\nfunction gte(i: number, y: number) {\n return i >= y\n}\n\nfunction expand_(str: string, max: number, isTop: boolean): string[] {\n /** @type {string[]} */\n const expansions: string[] = []\n\n const m = balanced('{', '}', str)\n if (!m) return [str]\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre\n const post: string[] = m.post.length ? expand_(m.post, max, false) : ['']\n\n if (/\\$$/.test(m.pre)) {\n for (let k = 0; k < post.length && k < max; k++) {\n const expansion = pre + '{' + m.body + '}' + post[k]\n expansions.push(expansion)\n }\n } else {\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body)\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(\n m.body,\n )\n const isSequence = isNumericSequence || isAlphaSequence\n const isOptions = m.body.indexOf(',') >= 0\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post\n return expand_(str, max, true)\n }\n return [str]\n }\n\n let n: string[]\n if (isSequence) {\n n = m.body.split(/\\.\\./)\n } else {\n n = parseCommaParts(m.body)\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, false).map(embrace)\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n return post.map(p => m.pre + n[0] + p)\n }\n /* c8 ignore stop */\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n let N: string[]\n\n if (isSequence && n[0] !== undefined && n[1] !== undefined) {\n const x = numeric(n[0])\n const y = numeric(n[1])\n const width = Math.max(n[0].length, n[1].length)\n let incr =\n n.length === 3 && n[2] !== undefined ? Math.abs(numeric(n[2])) : 1\n let test = lte\n const reverse = y < x\n if (reverse) {\n incr *= -1\n test = gte\n }\n const pad = n.some(isPadded)\n\n N = []\n\n for (let i = x; test(i, y); i += incr) {\n let c\n if (isAlphaSequence) {\n c = String.fromCharCode(i)\n if (c === '\\\\') {\n c = ''\n }\n } else {\n c = String(i)\n if (pad) {\n const need = width - c.length\n if (need > 0) {\n const z = new Array(need + 1).join('0')\n if (i < 0) {\n c = '-' + z + c.slice(1)\n } else {\n c = z + c\n }\n }\n }\n }\n N.push(c)\n }\n } else {\n N = []\n\n for (let j = 0; j < n.length; j++) {\n N.push.apply(N, expand_(n[j] as string, max, false))\n }\n }\n\n for (let j = 0; j < N.length; j++) {\n for (let k = 0; k < post.length && expansions.length < max; k++) {\n const expansion = pre + N[j] + post[k]\n if (!isTop || isSequence || expansion) {\n expansions.push(expansion)\n }\n }\n }\n }\n\n return expansions\n}\n"]} \ No newline at end of file diff --git a/node_modules/@isaacs/brace-expansion/dist/commonjs/package.json b/node_modules/@isaacs/brace-expansion/dist/commonjs/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/node_modules/@isaacs/brace-expansion/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/@isaacs/brace-expansion/dist/esm/index.d.ts b/node_modules/@isaacs/brace-expansion/dist/esm/index.d.ts new file mode 100644 index 0000000..92b7a7f --- /dev/null +++ b/node_modules/@isaacs/brace-expansion/dist/esm/index.d.ts @@ -0,0 +1,6 @@ +export declare const EXPANSION_MAX = 100000; +export type BraceExpansionOptions = { + max?: number; +}; +export declare function expand(str: string, options?: BraceExpansionOptions): string[]; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@isaacs/brace-expansion/dist/esm/index.d.ts.map b/node_modules/@isaacs/brace-expansion/dist/esm/index.d.ts.map new file mode 100644 index 0000000..a4f36ae --- /dev/null +++ b/node_modules/@isaacs/brace-expansion/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAwDpC,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"} \ No newline at end of file diff --git a/node_modules/@isaacs/brace-expansion/dist/esm/index.js b/node_modules/@isaacs/brace-expansion/dist/esm/index.js new file mode 100644 index 0000000..5c67f51 --- /dev/null +++ b/node_modules/@isaacs/brace-expansion/dist/esm/index.js @@ -0,0 +1,195 @@ +import { balanced } from '@isaacs/balanced-match'; +const escSlash = '\0SLASH' + Math.random() + '\0'; +const escOpen = '\0OPEN' + Math.random() + '\0'; +const escClose = '\0CLOSE' + Math.random() + '\0'; +const escComma = '\0COMMA' + Math.random() + '\0'; +const escPeriod = '\0PERIOD' + Math.random() + '\0'; +const escSlashPattern = new RegExp(escSlash, 'g'); +const escOpenPattern = new RegExp(escOpen, 'g'); +const escClosePattern = new RegExp(escClose, 'g'); +const escCommaPattern = new RegExp(escComma, 'g'); +const escPeriodPattern = new RegExp(escPeriod, 'g'); +const slashPattern = /\\\\/g; +const openPattern = /\\{/g; +const closePattern = /\\}/g; +const commaPattern = /\\,/g; +const periodPattern = /\\./g; +export const EXPANSION_MAX = 100_000; +function numeric(str) { + return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); +} +function escapeBraces(str) { + return str + .replace(slashPattern, escSlash) + .replace(openPattern, escOpen) + .replace(closePattern, escClose) + .replace(commaPattern, escComma) + .replace(periodPattern, escPeriod); +} +function unescapeBraces(str) { + return str + .replace(escSlashPattern, '\\') + .replace(escOpenPattern, '{') + .replace(escClosePattern, '}') + .replace(escCommaPattern, ',') + .replace(escPeriodPattern, '.'); +} +/** + * Basically just str.split(","), but handling cases + * where we have nested braced sections, which should be + * treated as individual members, like {a,{b,c},d} + */ +function parseCommaParts(str) { + if (!str) { + return ['']; + } + const parts = []; + const m = balanced('{', '}', str); + if (!m) { + return str.split(','); + } + const { pre, body, post } = m; + const p = pre.split(','); + p[p.length - 1] += '{' + body + '}'; + const postParts = parseCommaParts(post); + if (post.length) { + ; + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); + } + parts.push.apply(parts, p); + return parts; +} +export function expand(str, options = {}) { + if (!str) { + return []; + } + const { max = EXPANSION_MAX } = options; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.slice(0, 2) === '{}') { + str = '\\{\\}' + str.slice(2); + } + return expand_(escapeBraces(str), max, true).map(unescapeBraces); +} +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} +function expand_(str, max, isTop) { + /** @type {string[]} */ + const expansions = []; + const m = balanced('{', '}', str); + if (!m) + return [str]; + // no need to expand pre, since it is guaranteed to be free of brace-sets + const pre = m.pre; + const post = m.post.length ? expand_(m.post, max, false) : ['']; + if (/\$$/.test(m.pre)) { + for (let k = 0; k < post.length && k < max; k++) { + const expansion = pre + '{' + m.body + '}' + post[k]; + expansions.push(expansion); + } + } + else { + const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + const isSequence = isNumericSequence || isAlphaSequence; + const isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,(?!,).*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand_(str, max, true); + } + return [str]; + } + let n; + if (isSequence) { + n = m.body.split(/\.\./); + } + else { + n = parseCommaParts(m.body); + if (n.length === 1 && n[0] !== undefined) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand_(n[0], max, false).map(embrace); + //XXX is this necessary? Can't seem to hit it in tests. + /* c8 ignore start */ + if (n.length === 1) { + return post.map(p => m.pre + n[0] + p); + } + /* c8 ignore stop */ + } + } + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + let N; + if (isSequence && n[0] !== undefined && n[1] !== undefined) { + const x = numeric(n[0]); + const y = numeric(n[1]); + const width = Math.max(n[0].length, n[1].length); + let incr = n.length === 3 && n[2] !== undefined ? Math.abs(numeric(n[2])) : 1; + let test = lte; + const reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + const pad = n.some(isPadded); + N = []; + for (let i = x; test(i, y); i += incr) { + let c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') { + c = ''; + } + } + else { + c = String(i); + if (pad) { + const need = width - c.length; + if (need > 0) { + const z = new Array(need + 1).join('0'); + if (i < 0) { + c = '-' + z + c.slice(1); + } + else { + c = z + c; + } + } + } + } + N.push(c); + } + } + else { + N = []; + for (let j = 0; j < n.length; j++) { + N.push.apply(N, expand_(n[j], max, false)); + } + } + for (let j = 0; j < N.length; j++) { + for (let k = 0; k < post.length && expansions.length < max; k++) { + const expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) { + expansions.push(expansion); + } + } + } + } + return expansions; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@isaacs/brace-expansion/dist/esm/index.js.map b/node_modules/@isaacs/brace-expansion/dist/esm/index.js.map new file mode 100644 index 0000000..747e995 --- /dev/null +++ b/node_modules/@isaacs/brace-expansion/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAEjD,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AAC/C,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACnD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAC/C,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,gBAAgB,GAAG,IAAI,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;AACnD,MAAM,YAAY,GAAG,OAAO,CAAA;AAC5B,MAAM,WAAW,GAAG,MAAM,CAAA;AAC1B,MAAM,YAAY,GAAG,MAAM,CAAA;AAC3B,MAAM,YAAY,GAAG,MAAM,CAAA;AAC3B,MAAM,aAAa,GAAG,MAAM,CAAA;AAE5B,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAA;AAEpC,SAAS,OAAO,CAAC,GAAW;IAC1B,OAAO,CAAC,KAAK,CAAC,GAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AACnE,CAAC;AAED,SAAS,YAAY,CAAC,GAAW;IAC/B,OAAO,GAAG;SACP,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC;SAC/B,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC;SAC7B,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC;SAC/B,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC;SAC/B,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,CAAA;AACtC,CAAC;AAED,SAAS,cAAc,CAAC,GAAW;IACjC,OAAO,GAAG;SACP,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;SAC9B,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;SAC5B,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC;SAC7B,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC;SAC7B,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAA;AACnC,CAAC;AAED;;;;GAIG;AACH,SAAS,eAAe,CAAC,GAAW;IAClC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,CAAC,EAAE,CAAC,CAAA;IACb,CAAC;IAED,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IAEjC,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACvB,CAAC;IAED,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;IAC7B,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAExB,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,GAAG,GAAG,IAAI,GAAG,GAAG,CAAA;IACnC,MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC,CAAA;IACvC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC;QAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAY,IAAI,SAAS,CAAC,KAAK,EAAE,CAAA;QACjD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;IAC5B,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IAE1B,OAAO,KAAK,CAAA;AACd,CAAC;AAMD,MAAM,UAAU,MAAM,CAAC,GAAW,EAAE,UAAiC,EAAE;IACrE,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,EAAE,CAAA;IACX,CAAC;IAED,MAAM,EAAE,GAAG,GAAG,aAAa,EAAE,GAAG,OAAO,CAAA;IAEvC,oDAAoD;IACpD,oEAAoE;IACpE,sEAAsE;IACtE,6CAA6C;IAC7C,oEAAoE;IACpE,+DAA+D;IAC/D,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC7B,GAAG,GAAG,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC/B,CAAC;IAED,OAAO,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;AAClE,CAAC;AAED,SAAS,OAAO,CAAC,GAAW;IAC1B,OAAO,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AACxB,CAAC;AAED,SAAS,QAAQ,CAAC,EAAU;IAC1B,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,GAAG,CAAC,CAAS,EAAE,CAAS;IAC/B,OAAO,CAAC,IAAI,CAAC,CAAA;AACf,CAAC;AAED,SAAS,GAAG,CAAC,CAAS,EAAE,CAAS;IAC/B,OAAO,CAAC,IAAI,CAAC,CAAA;AACf,CAAC;AAED,SAAS,OAAO,CAAC,GAAW,EAAE,GAAW,EAAE,KAAc;IACvD,uBAAuB;IACvB,MAAM,UAAU,GAAa,EAAE,CAAA;IAE/B,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IACjC,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,CAAA;IAEpB,yEAAyE;IACzE,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAA;IACjB,MAAM,IAAI,GAAa,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAEzE,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YAChD,MAAM,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;YACpD,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,iBAAiB,GAAG,gCAAgC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QACvE,MAAM,eAAe,GAAG,sCAAsC,CAAC,IAAI,CACjE,CAAC,CAAC,IAAI,CACP,CAAA;QACD,MAAM,UAAU,GAAG,iBAAiB,IAAI,eAAe,CAAA;QACvD,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC1C,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,EAAE,CAAC;YAC9B,SAAS;YACT,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC/B,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,IAAI,GAAG,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAA;gBAC9C,OAAO,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;YAChC,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,CAAA;QACd,CAAC;QAED,IAAI,CAAW,CAAA;QACf,IAAI,UAAU,EAAE,CAAC;YACf,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAC1B,CAAC;aAAM,CAAC;YACN,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;YAC3B,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;gBACzC,4BAA4B;gBAC5B,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;gBAC1C,uDAAuD;gBACvD,qBAAqB;gBACrB,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACnB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;gBACxC,CAAC;gBACD,oBAAoB;YACtB,CAAC;QACH,CAAC;QAED,kEAAkE;QAClE,uBAAuB;QACvB,IAAI,CAAW,CAAA;QAEf,IAAI,UAAU,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;YAC3D,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACvB,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACvB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;YAChD,IAAI,IAAI,GACN,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACpE,IAAI,IAAI,GAAG,GAAG,CAAA;YACd,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,CAAA;YACrB,IAAI,OAAO,EAAE,CAAC;gBACZ,IAAI,IAAI,CAAC,CAAC,CAAA;gBACV,IAAI,GAAG,GAAG,CAAA;YACZ,CAAC;YACD,MAAM,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YAE5B,CAAC,GAAG,EAAE,CAAA;YAEN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;gBACtC,IAAI,CAAC,CAAA;gBACL,IAAI,eAAe,EAAE,CAAC;oBACpB,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;oBAC1B,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;wBACf,CAAC,GAAG,EAAE,CAAA;oBACR,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;oBACb,IAAI,GAAG,EAAE,CAAC;wBACR,MAAM,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC,MAAM,CAAA;wBAC7B,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;4BACb,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;4BACvC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gCACV,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;4BAC1B,CAAC;iCAAM,CAAC;gCACN,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;4BACX,CAAC;wBACH,CAAC;oBACH,CAAC;gBACH,CAAC;gBACD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACX,CAAC;QACH,CAAC;aAAM,CAAC;YACN,CAAC,GAAG,EAAE,CAAA;YAEN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAClC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAW,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;YACtD,CAAC;QACH,CAAC;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;gBAChE,MAAM,SAAS,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;gBACtC,IAAI,CAAC,KAAK,IAAI,UAAU,IAAI,SAAS,EAAE,CAAC;oBACtC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import { balanced } from '@isaacs/balanced-match'\n\nconst escSlash = '\\0SLASH' + Math.random() + '\\0'\nconst escOpen = '\\0OPEN' + Math.random() + '\\0'\nconst escClose = '\\0CLOSE' + Math.random() + '\\0'\nconst escComma = '\\0COMMA' + Math.random() + '\\0'\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0'\nconst escSlashPattern = new RegExp(escSlash, 'g')\nconst escOpenPattern = new RegExp(escOpen, 'g')\nconst escClosePattern = new RegExp(escClose, 'g')\nconst escCommaPattern = new RegExp(escComma, 'g')\nconst escPeriodPattern = new RegExp(escPeriod, 'g')\nconst slashPattern = /\\\\\\\\/g\nconst openPattern = /\\\\{/g\nconst closePattern = /\\\\}/g\nconst commaPattern = /\\\\,/g\nconst periodPattern = /\\\\./g\n\nexport const EXPANSION_MAX = 100_000\n\nfunction numeric(str: string) {\n return !isNaN(str as any) ? parseInt(str, 10) : str.charCodeAt(0)\n}\n\nfunction escapeBraces(str: string) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod)\n}\n\nfunction unescapeBraces(str: string) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.')\n}\n\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str: string) {\n if (!str) {\n return ['']\n }\n\n const parts: string[] = []\n const m = balanced('{', '}', str)\n\n if (!m) {\n return str.split(',')\n }\n\n const { pre, body, post } = m\n const p = pre.split(',')\n\n p[p.length - 1] += '{' + body + '}'\n const postParts = parseCommaParts(post)\n if (post.length) {\n ;(p[p.length - 1] as string) += postParts.shift()\n p.push.apply(p, postParts)\n }\n\n parts.push.apply(parts, p)\n\n return parts\n}\n\nexport type BraceExpansionOptions = {\n max?: number\n}\n\nexport function expand(str: string, options: BraceExpansionOptions = {}) {\n if (!str) {\n return []\n }\n\n const { max = EXPANSION_MAX } = options\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2)\n }\n\n return expand_(escapeBraces(str), max, true).map(unescapeBraces)\n}\n\nfunction embrace(str: string) {\n return '{' + str + '}'\n}\n\nfunction isPadded(el: string) {\n return /^-?0\\d/.test(el)\n}\n\nfunction lte(i: number, y: number) {\n return i <= y\n}\n\nfunction gte(i: number, y: number) {\n return i >= y\n}\n\nfunction expand_(str: string, max: number, isTop: boolean): string[] {\n /** @type {string[]} */\n const expansions: string[] = []\n\n const m = balanced('{', '}', str)\n if (!m) return [str]\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre\n const post: string[] = m.post.length ? expand_(m.post, max, false) : ['']\n\n if (/\\$$/.test(m.pre)) {\n for (let k = 0; k < post.length && k < max; k++) {\n const expansion = pre + '{' + m.body + '}' + post[k]\n expansions.push(expansion)\n }\n } else {\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body)\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(\n m.body,\n )\n const isSequence = isNumericSequence || isAlphaSequence\n const isOptions = m.body.indexOf(',') >= 0\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post\n return expand_(str, max, true)\n }\n return [str]\n }\n\n let n: string[]\n if (isSequence) {\n n = m.body.split(/\\.\\./)\n } else {\n n = parseCommaParts(m.body)\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, false).map(embrace)\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n return post.map(p => m.pre + n[0] + p)\n }\n /* c8 ignore stop */\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n let N: string[]\n\n if (isSequence && n[0] !== undefined && n[1] !== undefined) {\n const x = numeric(n[0])\n const y = numeric(n[1])\n const width = Math.max(n[0].length, n[1].length)\n let incr =\n n.length === 3 && n[2] !== undefined ? Math.abs(numeric(n[2])) : 1\n let test = lte\n const reverse = y < x\n if (reverse) {\n incr *= -1\n test = gte\n }\n const pad = n.some(isPadded)\n\n N = []\n\n for (let i = x; test(i, y); i += incr) {\n let c\n if (isAlphaSequence) {\n c = String.fromCharCode(i)\n if (c === '\\\\') {\n c = ''\n }\n } else {\n c = String(i)\n if (pad) {\n const need = width - c.length\n if (need > 0) {\n const z = new Array(need + 1).join('0')\n if (i < 0) {\n c = '-' + z + c.slice(1)\n } else {\n c = z + c\n }\n }\n }\n }\n N.push(c)\n }\n } else {\n N = []\n\n for (let j = 0; j < n.length; j++) {\n N.push.apply(N, expand_(n[j] as string, max, false))\n }\n }\n\n for (let j = 0; j < N.length; j++) {\n for (let k = 0; k < post.length && expansions.length < max; k++) {\n const expansion = pre + N[j] + post[k]\n if (!isTop || isSequence || expansion) {\n expansions.push(expansion)\n }\n }\n }\n }\n\n return expansions\n}\n"]} \ No newline at end of file diff --git a/node_modules/@isaacs/brace-expansion/dist/esm/package.json b/node_modules/@isaacs/brace-expansion/dist/esm/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/node_modules/@isaacs/brace-expansion/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@isaacs/brace-expansion/package.json b/node_modules/@isaacs/brace-expansion/package.json new file mode 100644 index 0000000..0356a29 --- /dev/null +++ b/node_modules/@isaacs/brace-expansion/package.json @@ -0,0 +1,60 @@ +{ + "name": "@isaacs/brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "5.0.1", + "files": [ + "dist" + ], + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "type": "module", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write .", + "benchmark": "node benchmark/index.js", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "devDependencies": { + "@types/brace-expansion": "^1.1.2", + "@types/node": "^24.0.0", + "mkdirp": "^3.0.1", + "prettier": "^3.3.2", + "tap": "^21.5.0", + "tshy": "^3.0.2", + "typedoc": "^0.28.5" + }, + "dependencies": { + "@isaacs/balanced-match": "^4.0.1" + }, + "license": "MIT", + "engines": { + "node": "20 || >=22" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" +} diff --git a/node_modules/@sec-ant/readable-stream/LICENSE b/node_modules/@sec-ant/readable-stream/LICENSE new file mode 100644 index 0000000..6c4c768 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Ze-Zheng Wu + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@sec-ant/readable-stream/README.md b/node_modules/@sec-ant/readable-stream/README.md new file mode 100644 index 0000000..7fa7a29 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/README.md @@ -0,0 +1,230 @@ +# @sec-ant/readable-stream + +[![npm version](https://img.shields.io/npm/v/@sec-ant/readable-stream?cacheSeconds=300)](https://www.npmjs.com/package/@sec-ant/readable-stream/v/latest) [![npm downloads](https://img.shields.io/npm/dm/@sec-ant/readable-stream?cacheSeconds=300)](https://www.npmjs.com/package/@sec-ant/readable-stream/v/latest) [![](https://img.shields.io/jsdelivr/npm/hm/@sec-ant/readable-stream?cacheSeconds=300&color=ff5627)](https://www.jsdelivr.com/package/npm/@sec-ant/readable-stream) [![bundlephobia minzipped](https://img.shields.io/bundlephobia/minzip/@sec-ant/readable-stream?cacheSeconds=300)](https://bundlephobia.com/package/@sec-ant/readable-stream@latest) [![npm license](https://img.shields.io/npm/l/@sec-ant/readable-stream?cacheSeconds=300)](https://www.npmjs.com/package/@sec-ant/readable-stream/v/latest) + +A tiny, zero-dependency yet spec-compliant asynchronous iterator polyfill/ponyfill for [`ReadableStream`](https://developer.mozilla.org/docs/Web/API/ReadableStream)s. + +## Features + +### Asynchronously iterate a `ReadableStream` + +With this package, you can consume a `ReadableStream` as an `AsyncIterable`. + +- spec: https://streams.spec.whatwg.org/#rs-asynciterator +- tests: https://github.com/Sec-ant/readable-stream/blob/main/tests/asyncIterator.spec.ts (copied from [wpt](https://github.com/web-platform-tests/wpt/blob/309231a7f3e900d04914bc4963b016efd9989a00/streams/readable-streams/async-iterator.any.js)) + +### Convert an `AsyncIterable` or an `Iterable` into a `ReadableStream` + +With this package, you can construct a `ReadableStream` from an `AsyncIterable` or an `Iterable`. + +- spec: https://streams.spec.whatwg.org/#rs-from +- tests: https://github.com/Sec-ant/readable-stream/blob/main/tests/fromAnyIterable.spec.ts (copied from [wpt](https://github.com/web-platform-tests/wpt/blob/309231a7f3e900d04914bc4963b016efd9989a00/streams/readable-streams/from.any.js)) + +This package passes all the aforementioned tests. + +## Install + +```bash +npm i @sec-ant/readable-stream +``` + +## Usage + +### Ponyfill + +This package can be imported as a _ponyfill_ to avoid side effects: + +#### `asyncIterator` + +Path: + +``` +@sec-ant/readable-stream/ponyfill/asyncIterator +``` + +Example: + +```ts +import { + asyncIterator, + type ReadableStreamIteratorOptions, +} from "@sec-ant/readable-stream/ponyfill/asyncIterator"; + +const readableStream = (await fetch("https://www.example.org/")).body; + +let total = 0; +for await (const chunk of asyncIterator.call(readableStream)) { + total += chunk.length; +} + +console.log(total); +``` + +Check https://streams.spec.whatwg.org/#rs-class-definition and https://streams.spec.whatwg.org/#rs-asynciterator for further explanation on `ReadableStreamIteratorOptions`. + +#### `fromAnyIterable` + +Path: + +``` +@sec-ant/readable-stream/ponyfill/fromAnyIterable +``` + +Example: + +```ts +import { fromAnyIterable } from "@sec-ant/readable-stream/ponyfill/fromAnyIterable"; + +const readableStream = fromAnyIterable(["a", "b"]); +``` + +#### All-in-One + +Path: + +``` +@sec-ant/readable-stream/ponyfill +``` + +Example: + +```ts +import { + fromAnyIterable, + asyncIterator, + type ReadableStreamIteratorOptions, +} from "@sec-ant/readable-stream/ponyfill"; +``` + +### Polyfill + +This package can be imported as a drop-in _polyfill_ with side effects. + +#### `ReadableStream.prototype[Symbol.asyncIterator]` and `ReadableStream.prototype.values` + +Path: + +``` +@sec-ant/readable-stream/polyfill/asyncIterator +``` + +Example: + +```ts +import "@sec-ant/readable-stream/polyfill/asyncIterator"; + +const readableStream = (await fetch("https://www.example.org/")).body; + +let total = 0; +for await (const chunk of readableStream) { + total += chunk.length; +} + +console.log(total); +``` + +#### `ReadableStream.from` + +Path: + +``` +@sec-ant/readable-stream/polyfill/fromAnyIterable +``` + +Example: + +```js +import "@sec-ant/readable-stream/polyfill/fromAnyIterable"; + +const readableStream = ReadableStream.from(["a", "b"]); +``` + +Note that `ReadableStream.from` is not typed because [declared vars cannot be overridden](https://github.com/microsoft/TypeScript/issues/36146). + +#### All-in-One + +Path: + +``` +@sec-ant/readable-stream/polyfill +``` + +Example: + +```ts +import "@sec-ant/readable-stream/polyfill"; +``` + +### Ponyfill + Polyfill + +#### `asyncIterator` + +Path: + +``` +@sec-ant/readable-stream/asyncIterator +``` + +Example: + +```ts +import { + asyncIterator, + type ReadableStreamIteratorOptions, +} from "@sec-ant/readable-stream/asyncIterator"; +// also with side effects +``` + +#### `fromAnyIterable` + +Path: + +``` +@sec-ant/readable-stream/fromAnyIterable +``` + +Example: + +```ts +import { fromAnyIterable } from "@sec-ant/readable-stream/fromAnyIterable"; +// also with side effects +``` + +#### All-in-One + +Path: + +``` +@sec-ant/readable-stream +``` + +Example: + +```ts +import { + fromAnyIterable, + asyncIterator, + type ReadableStreamIteratorOptions, +} from "@sec-ant/readable-stream"; +// also with side effects +``` + +### Types + +You can also use this package to augment the `ReadableStream` type for async iteration if the runtime already supports it but the type system does not. + +Path: + +``` +@sec-ant/readable-stream/async-iterator +``` + +Example: + +```ts +/// +``` + +## License + +MIT diff --git a/node_modules/@sec-ant/readable-stream/dist/core/asyncIterablePrototype.d.ts b/node_modules/@sec-ant/readable-stream/dist/core/asyncIterablePrototype.d.ts new file mode 100644 index 0000000..98d20c2 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/core/asyncIterablePrototype.d.ts @@ -0,0 +1 @@ +export declare const AsyncIterablePrototype: object; diff --git a/node_modules/@sec-ant/readable-stream/dist/core/asyncIterator.d.ts b/node_modules/@sec-ant/readable-stream/dist/core/asyncIterator.d.ts new file mode 100644 index 0000000..658d943 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/core/asyncIterator.d.ts @@ -0,0 +1,27 @@ +/** + * the implementer that does all the heavy works + */ +declare class ReadableStreamAsyncIterableIteratorImpl implements AsyncIterator { + #private; + constructor(reader: ReadableStreamDefaultReader, preventCancel: boolean); + next(): Promise>; + return(value?: TReturn): Promise>; +} +declare const implementSymbol: unique symbol; +/** + * declare `ReadableStreamAsyncIterableIterator` interaface + */ +interface ReadableStreamAsyncIterableIterator extends AsyncIterableIterator { + [implementSymbol]: ReadableStreamAsyncIterableIteratorImpl; +} +export interface ReadableStreamIteratorOptions { + preventCancel?: boolean; +} +/** + * Get an async iterable iterator from a readable stream + * @param this + * @param readableStreamIteratorOptions + * @returns + */ +export declare function asyncIterator(this: ReadableStream, { preventCancel }?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterableIterator; +export {}; diff --git a/node_modules/@sec-ant/readable-stream/dist/core/fromAnyIterable.d.ts b/node_modules/@sec-ant/readable-stream/dist/core/fromAnyIterable.d.ts new file mode 100644 index 0000000..1d5bafb --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/core/fromAnyIterable.d.ts @@ -0,0 +1,6 @@ +/** + * Create a new readable stream from an async iterable or a sync iterable + * @param iterable + * @returns a readable stream + */ +export declare function fromAnyIterable(iterable: Iterable | AsyncIterable): ReadableStream; diff --git a/node_modules/@sec-ant/readable-stream/dist/index/asyncIterator.d.ts b/node_modules/@sec-ant/readable-stream/dist/index/asyncIterator.d.ts new file mode 100644 index 0000000..e10ed79 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/index/asyncIterator.d.ts @@ -0,0 +1,2 @@ +import "../polyfill/asyncIterator.js"; +export * from "../ponyfill/asyncIterator.js"; diff --git a/node_modules/@sec-ant/readable-stream/dist/index/asyncIterator.js b/node_modules/@sec-ant/readable-stream/dist/index/asyncIterator.js new file mode 100644 index 0000000..240ad00 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/index/asyncIterator.js @@ -0,0 +1,5 @@ +import "../polyfill/asyncIterator.js"; +import { asyncIterator as a } from "../ponyfill/asyncIterator.js"; +export { + a as asyncIterator +}; diff --git a/node_modules/@sec-ant/readable-stream/dist/index/fromAnyIterable.d.ts b/node_modules/@sec-ant/readable-stream/dist/index/fromAnyIterable.d.ts new file mode 100644 index 0000000..35eb64b --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/index/fromAnyIterable.d.ts @@ -0,0 +1,2 @@ +import "../polyfill/fromAnyIterable.js"; +export * from "../ponyfill/fromAnyIterable.js"; diff --git a/node_modules/@sec-ant/readable-stream/dist/index/fromAnyIterable.js b/node_modules/@sec-ant/readable-stream/dist/index/fromAnyIterable.js new file mode 100644 index 0000000..a908087 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/index/fromAnyIterable.js @@ -0,0 +1,5 @@ +import "../polyfill/fromAnyIterable.js"; +import { fromAnyIterable as m } from "../ponyfill/fromAnyIterable.js"; +export { + m as fromAnyIterable +}; diff --git a/node_modules/@sec-ant/readable-stream/dist/index/index.d.ts b/node_modules/@sec-ant/readable-stream/dist/index/index.d.ts new file mode 100644 index 0000000..f7aa235 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/index/index.d.ts @@ -0,0 +1,2 @@ +export * from "./asyncIterator.js"; +export * from "./fromAnyIterable.js"; diff --git a/node_modules/@sec-ant/readable-stream/dist/index/index.js b/node_modules/@sec-ant/readable-stream/dist/index/index.js new file mode 100644 index 0000000..92a4b56 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/index/index.js @@ -0,0 +1,8 @@ +import "../polyfill/asyncIterator.js"; +import { asyncIterator as m } from "../ponyfill/asyncIterator.js"; +import "../polyfill/fromAnyIterable.js"; +import { fromAnyIterable as a } from "../ponyfill/fromAnyIterable.js"; +export { + m as asyncIterator, + a as fromAnyIterable +}; diff --git a/node_modules/@sec-ant/readable-stream/dist/polyfill/asyncIterator.d.ts b/node_modules/@sec-ant/readable-stream/dist/polyfill/asyncIterator.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/polyfill/asyncIterator.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@sec-ant/readable-stream/dist/polyfill/asyncIterator.js b/node_modules/@sec-ant/readable-stream/dist/polyfill/asyncIterator.js new file mode 100644 index 0000000..32eeb3a --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/polyfill/asyncIterator.js @@ -0,0 +1,3 @@ +import { asyncIterator as e } from "../ponyfill/asyncIterator.js"; +ReadableStream.prototype.values ??= ReadableStream.prototype[Symbol.asyncIterator] ??= e; +ReadableStream.prototype[Symbol.asyncIterator] ??= ReadableStream.prototype.values; diff --git a/node_modules/@sec-ant/readable-stream/dist/polyfill/fromAnyIterable.d.ts b/node_modules/@sec-ant/readable-stream/dist/polyfill/fromAnyIterable.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/polyfill/fromAnyIterable.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@sec-ant/readable-stream/dist/polyfill/fromAnyIterable.js b/node_modules/@sec-ant/readable-stream/dist/polyfill/fromAnyIterable.js new file mode 100644 index 0000000..b66554a --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/polyfill/fromAnyIterable.js @@ -0,0 +1,2 @@ +import { fromAnyIterable as r } from "../ponyfill/fromAnyIterable.js"; +ReadableStream.from ??= r; diff --git a/node_modules/@sec-ant/readable-stream/dist/polyfill/index.d.ts b/node_modules/@sec-ant/readable-stream/dist/polyfill/index.d.ts new file mode 100644 index 0000000..2397cf8 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/polyfill/index.d.ts @@ -0,0 +1,2 @@ +import "./asyncIterator.js"; +import "./fromAnyIterable.js"; diff --git a/node_modules/@sec-ant/readable-stream/dist/polyfill/index.js b/node_modules/@sec-ant/readable-stream/dist/polyfill/index.js new file mode 100644 index 0000000..115aff1 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/polyfill/index.js @@ -0,0 +1,4 @@ +import "./asyncIterator.js"; +import "./fromAnyIterable.js"; +import "../ponyfill/asyncIterator.js"; +import "../ponyfill/fromAnyIterable.js"; diff --git a/node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.d.ts b/node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.d.ts new file mode 100644 index 0000000..a7228ed --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.d.ts @@ -0,0 +1 @@ +export { asyncIterator, type ReadableStreamIteratorOptions, } from "../core/asyncIterator.js"; diff --git a/node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js b/node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js new file mode 100644 index 0000000..374fb09 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js @@ -0,0 +1,89 @@ +const a = Object.getPrototypeOf( + Object.getPrototypeOf( + /* istanbul ignore next */ + async function* () { + } + ).prototype +); +class c { + #t; + #n; + #r = !1; + #e = void 0; + constructor(e, t) { + this.#t = e, this.#n = t; + } + next() { + const e = () => this.#s(); + return this.#e = this.#e ? this.#e.then(e, e) : e(), this.#e; + } + return(e) { + const t = () => this.#i(e); + return this.#e ? this.#e.then(t, t) : t(); + } + async #s() { + if (this.#r) + return { + done: !0, + value: void 0 + }; + let e; + try { + e = await this.#t.read(); + } catch (t) { + throw this.#e = void 0, this.#r = !0, this.#t.releaseLock(), t; + } + return e.done && (this.#e = void 0, this.#r = !0, this.#t.releaseLock()), e; + } + async #i(e) { + if (this.#r) + return { + done: !0, + value: e + }; + if (this.#r = !0, !this.#n) { + const t = this.#t.cancel(e); + return this.#t.releaseLock(), await t, { + done: !0, + value: e + }; + } + return this.#t.releaseLock(), { + done: !0, + value: e + }; + } +} +const n = Symbol(); +function i() { + return this[n].next(); +} +Object.defineProperty(i, "name", { value: "next" }); +function o(r) { + return this[n].return(r); +} +Object.defineProperty(o, "name", { value: "return" }); +const u = Object.create(a, { + next: { + enumerable: !0, + configurable: !0, + writable: !0, + value: i + }, + return: { + enumerable: !0, + configurable: !0, + writable: !0, + value: o + } +}); +function h({ preventCancel: r = !1 } = {}) { + const e = this.getReader(), t = new c( + e, + r + ), s = Object.create(u); + return s[n] = t, s; +} +export { + h as asyncIterator +}; diff --git a/node_modules/@sec-ant/readable-stream/dist/ponyfill/fromAnyIterable.d.ts b/node_modules/@sec-ant/readable-stream/dist/ponyfill/fromAnyIterable.d.ts new file mode 100644 index 0000000..6cc0332 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/ponyfill/fromAnyIterable.d.ts @@ -0,0 +1 @@ +export { fromAnyIterable } from "../core/fromAnyIterable.js"; diff --git a/node_modules/@sec-ant/readable-stream/dist/ponyfill/fromAnyIterable.js b/node_modules/@sec-ant/readable-stream/dist/ponyfill/fromAnyIterable.js new file mode 100644 index 0000000..1d9e5d5 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/ponyfill/fromAnyIterable.js @@ -0,0 +1,34 @@ +function c(n) { + const t = a(n); + return new ReadableStream( + { + async pull(e) { + const { value: r, done: o } = await t.next(); + o ? e.close() : e.enqueue(r); + }, + async cancel(e) { + if (typeof t.return == "function" && typeof await t.return(e) != "object") + throw new TypeError("return() fulfills with a non-object."); + return e; + } + }, + new CountQueuingStrategy({ + highWaterMark: 0 + }) + ); +} +function a(n) { + let t = n[Symbol.asyncIterator]?.bind(n); + if (t === void 0) { + const r = n[Symbol.iterator](), o = { + [Symbol.iterator]: () => r + }; + t = async function* () { + return yield* o; + }; + } + return t(); +} +export { + c as fromAnyIterable +}; diff --git a/node_modules/@sec-ant/readable-stream/dist/ponyfill/index.d.ts b/node_modules/@sec-ant/readable-stream/dist/ponyfill/index.d.ts new file mode 100644 index 0000000..f7aa235 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/ponyfill/index.d.ts @@ -0,0 +1,2 @@ +export * from "./asyncIterator.js"; +export * from "./fromAnyIterable.js"; diff --git a/node_modules/@sec-ant/readable-stream/dist/ponyfill/index.js b/node_modules/@sec-ant/readable-stream/dist/ponyfill/index.js new file mode 100644 index 0000000..0d6779a --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/ponyfill/index.js @@ -0,0 +1,6 @@ +import { asyncIterator as e } from "./asyncIterator.js"; +import { fromAnyIterable as a } from "./fromAnyIterable.js"; +export { + e as asyncIterator, + a as fromAnyIterable +}; diff --git a/node_modules/@sec-ant/readable-stream/dist/types/async-iterator.d.ts b/node_modules/@sec-ant/readable-stream/dist/types/async-iterator.d.ts new file mode 100644 index 0000000..0a92fc4 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/dist/types/async-iterator.d.ts @@ -0,0 +1,11 @@ +import type { ReadableStreamIteratorOptions } from "../core/asyncIterator.js"; +/** + * augment global readable stream interface + */ +declare global { + // biome-ignore lint/suspicious/noExplicitAny: to be compatible with lib.dom.d.ts + interface ReadableStream { + [Symbol.asyncIterator](): AsyncIterableIterator; + values(options?: ReadableStreamIteratorOptions): AsyncIterableIterator; + } +} diff --git a/node_modules/@sec-ant/readable-stream/package.json b/node_modules/@sec-ant/readable-stream/package.json new file mode 100644 index 0000000..caaab33 --- /dev/null +++ b/node_modules/@sec-ant/readable-stream/package.json @@ -0,0 +1,96 @@ +{ + "name": "@sec-ant/readable-stream", + "description": "A tiny, zero-dependency yet spec-compliant asynchronous iterator polyfill/ponyfill for ReadableStreams.", + "private": false, + "version": "0.4.1", + "type": "module", + "files": ["./dist"], + "main": "./dist/index/index.js", + "module": "./dist/index/index.js", + "exports": { + ".": "./dist/index/index.js", + "./asyncIterator": "./dist/index/asyncIterator.js", + "./fromAnyIterable": "./dist/index/fromAnyIterable.js", + "./ponyfill": "./dist/ponyfill/index.js", + "./ponyfill/asyncIterator": "./dist/ponyfill/asyncIterator.js", + "./ponyfill/fromAnyIterable": "./dist/ponyfill/fromAnyIterable.js", + "./polyfill": "./dist/polyfill/index.js", + "./polyfill/asyncIterator": "./dist/polyfill/asyncIterator.js", + "./polyfill/fromAnyIterable": "./dist/polyfill/fromAnyIterable.js", + "./async-iterator": { + "types": "./dist/types/async-iterator.d.ts" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Sec-ant/readable-stream.git" + }, + "homepage": "https://github.com/Sec-ant/readable-stream", + "bugs": { + "url": "https://github.com/Sec-ant/readable-stream/issues", + "email": "zezhengwu@proton.me" + }, + "keywords": [ + "stream", + "web-streams", + "readablestream", + "async", + "asynchronous", + "iterator", + "iteration", + "async-iterator", + "polyfill", + "esm", + "from-iterable" + ], + "author": { + "name": "Ze-Zheng Wu" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "scripts": { + "install:ci": "npm ci && npx playwright install --with-deps", + "install:codesandbox": "npm ci && ./scripts/prepare.sh", + "update-hooks": "simple-git-hooks", + "changeset": "changeset", + "bump": "changeset version 2>/dev/null | grep . && npm i; exit 0", + "type-check": "tsc --noEmit --emitDeclarationOnly false", + "format:prettier": "prettier . --write", + "format:biome": "biome format . --write", + "format": "conc \"npm:format:prettier\" \"npm:format:biome\"", + "check:biome": "biome check --apply .", + "check": "conc \"npm:format:prettier\" \"npm:check:biome\"", + "prebuild": "npm run check && npm run type-check", + "build": "vite build", + "copy": "copy-files-from-to", + "postbuild": "tsc && npm run copy", + "test:chromium": "vitest run --browser.name=chromium", + "test:firefox": "vitest run --browser.name=firefox", + "test": "npm run test:chromium && npm run test:firefox", + "test:coverage": "vitest run --coverage", + "test:ui": "vitest --ui --coverage", + "prepublishOnly": "npm run build", + "bump-biome:latest": "npm i -DE @biomejs/biome@latest", + "bump-biome:nightly": "npm i -DE @biomejs/biome@nightly" + }, + "devDependencies": { + "@biomejs/biome": "1.6.1", + "@changesets/cli": "^2.27.1", + "@commitlint/cli": "^19.1.0", + "@commitlint/config-conventional": "^19.1.0", + "@vitest/browser": "^1.3.1", + "@vitest/coverage-istanbul": "^1.3.1", + "@vitest/ui": "^1.3.1", + "concurrently": "^8.2.2", + "copy-files-from-to": "^3.9.1", + "lint-staged": "^15.2.2", + "playwright": "^1.42.1", + "prettier": "^3.2.5", + "simple-git-hooks": "^2.10.0", + "typescript": "^5.4.2", + "vite": "^5.1.6", + "vitest": "^1.3.1" + } +} diff --git a/node_modules/@sindresorhus/merge-streams/index.d.ts b/node_modules/@sindresorhus/merge-streams/index.d.ts new file mode 100644 index 0000000..359623f --- /dev/null +++ b/node_modules/@sindresorhus/merge-streams/index.d.ts @@ -0,0 +1,44 @@ +import {type Readable} from 'node:stream'; + +/** +Merges an array of [readable streams](https://nodejs.org/api/stream.html#readable-streams) and returns a new readable stream that emits data from the individual streams as it arrives. + +If you provide an empty array, the stream remains open but can be [manually ended](https://nodejs.org/api/stream.html#writableendchunk-encoding-callback). + +@example +``` +import mergeStreams from '@sindresorhus/merge-streams'; + +const stream = mergeStreams([streamA, streamB]); + +for await (const chunk of stream) { + console.log(chunk); + //=> 'A1' + //=> 'B1' + //=> 'A2' + //=> 'B2' +} +``` +*/ +export default function mergeStreams(streams: Readable[]): MergedStream; + +/** +A single stream combining the output of multiple streams. +*/ +export class MergedStream extends Readable { + /** + Pipe a new readable stream. + + Throws if `MergedStream` has already ended. + */ + add(stream: Readable): void; + + /** + Unpipe a stream previously added using either `mergeStreams(streams)` or `MergedStream.add(stream)`. + + Returns `false` if the stream was not previously added, or if it was already removed by `MergedStream.remove(stream)`. + + The removed stream is not automatically ended. + */ + remove(stream: Readable): Promise; +} diff --git a/node_modules/@sindresorhus/merge-streams/index.js b/node_modules/@sindresorhus/merge-streams/index.js new file mode 100644 index 0000000..5201922 --- /dev/null +++ b/node_modules/@sindresorhus/merge-streams/index.js @@ -0,0 +1,265 @@ +import {on, once} from 'node:events'; +import {PassThrough as PassThroughStream, getDefaultHighWaterMark} from 'node:stream'; +import {finished} from 'node:stream/promises'; + +export default function mergeStreams(streams) { + if (!Array.isArray(streams)) { + throw new TypeError(`Expected an array, got \`${typeof streams}\`.`); + } + + for (const stream of streams) { + validateStream(stream); + } + + const objectMode = streams.some(({readableObjectMode}) => readableObjectMode); + const highWaterMark = getHighWaterMark(streams, objectMode); + const passThroughStream = new MergedStream({ + objectMode, + writableHighWaterMark: highWaterMark, + readableHighWaterMark: highWaterMark, + }); + + for (const stream of streams) { + passThroughStream.add(stream); + } + + return passThroughStream; +} + +const getHighWaterMark = (streams, objectMode) => { + if (streams.length === 0) { + return getDefaultHighWaterMark(objectMode); + } + + const highWaterMarks = streams + .filter(({readableObjectMode}) => readableObjectMode === objectMode) + .map(({readableHighWaterMark}) => readableHighWaterMark); + return Math.max(...highWaterMarks); +}; + +class MergedStream extends PassThroughStream { + #streams = new Set([]); + #ended = new Set([]); + #aborted = new Set([]); + #onFinished; + #unpipeEvent = Symbol('unpipe'); + #streamPromises = new WeakMap(); + + add(stream) { + validateStream(stream); + + if (this.#streams.has(stream)) { + return; + } + + this.#streams.add(stream); + + this.#onFinished ??= onMergedStreamFinished(this, this.#streams, this.#unpipeEvent); + const streamPromise = endWhenStreamsDone({ + passThroughStream: this, + stream, + streams: this.#streams, + ended: this.#ended, + aborted: this.#aborted, + onFinished: this.#onFinished, + unpipeEvent: this.#unpipeEvent, + }); + this.#streamPromises.set(stream, streamPromise); + + stream.pipe(this, {end: false}); + } + + async remove(stream) { + validateStream(stream); + + if (!this.#streams.has(stream)) { + return false; + } + + const streamPromise = this.#streamPromises.get(stream); + if (streamPromise === undefined) { + return false; + } + + this.#streamPromises.delete(stream); + + stream.unpipe(this); + await streamPromise; + return true; + } +} + +const onMergedStreamFinished = async (passThroughStream, streams, unpipeEvent) => { + updateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_COUNT); + const controller = new AbortController(); + + try { + await Promise.race([ + onMergedStreamEnd(passThroughStream, controller), + onInputStreamsUnpipe(passThroughStream, streams, unpipeEvent, controller), + ]); + } finally { + controller.abort(); + updateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_COUNT); + } +}; + +const onMergedStreamEnd = async (passThroughStream, {signal}) => { + try { + await finished(passThroughStream, {signal, cleanup: true}); + } catch (error) { + errorOrAbortStream(passThroughStream, error); + throw error; + } +}; + +const onInputStreamsUnpipe = async (passThroughStream, streams, unpipeEvent, {signal}) => { + for await (const [unpipedStream] of on(passThroughStream, 'unpipe', {signal})) { + if (streams.has(unpipedStream)) { + unpipedStream.emit(unpipeEvent); + } + } +}; + +const validateStream = stream => { + if (typeof stream?.pipe !== 'function') { + throw new TypeError(`Expected a readable stream, got: \`${typeof stream}\`.`); + } +}; + +const endWhenStreamsDone = async ({passThroughStream, stream, streams, ended, aborted, onFinished, unpipeEvent}) => { + updateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_PER_STREAM); + const controller = new AbortController(); + + try { + await Promise.race([ + afterMergedStreamFinished(onFinished, stream, controller), + onInputStreamEnd({ + passThroughStream, + stream, + streams, + ended, + aborted, + controller, + }), + onInputStreamUnpipe({ + stream, + streams, + ended, + aborted, + unpipeEvent, + controller, + }), + ]); + } finally { + controller.abort(); + updateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_PER_STREAM); + } + + if (streams.size > 0 && streams.size === ended.size + aborted.size) { + if (ended.size === 0 && aborted.size > 0) { + abortStream(passThroughStream); + } else { + endStream(passThroughStream); + } + } +}; + +const afterMergedStreamFinished = async (onFinished, stream, {signal}) => { + try { + await onFinished; + if (!signal.aborted) { + abortStream(stream); + } + } catch (error) { + if (!signal.aborted) { + errorOrAbortStream(stream, error); + } + } +}; + +const onInputStreamEnd = async ({passThroughStream, stream, streams, ended, aborted, controller: {signal}}) => { + try { + await finished(stream, { + signal, + cleanup: true, + readable: true, + writable: false, + }); + if (streams.has(stream)) { + ended.add(stream); + } + } catch (error) { + if (signal.aborted || !streams.has(stream)) { + return; + } + + if (isAbortError(error)) { + aborted.add(stream); + } else { + errorStream(passThroughStream, error); + } + } +}; + +const onInputStreamUnpipe = async ({stream, streams, ended, aborted, unpipeEvent, controller: {signal}}) => { + await once(stream, unpipeEvent, {signal}); + + if (!stream.readable) { + return once(signal, 'abort', {signal}); + } + + streams.delete(stream); + ended.delete(stream); + aborted.delete(stream); +}; + +const endStream = stream => { + if (stream.writable) { + stream.end(); + } +}; + +const errorOrAbortStream = (stream, error) => { + if (isAbortError(error)) { + abortStream(stream); + } else { + errorStream(stream, error); + } +}; + +// This is the error thrown by `finished()` on `stream.destroy()` +const isAbortError = error => error?.code === 'ERR_STREAM_PREMATURE_CLOSE'; + +const abortStream = stream => { + if (stream.readable || stream.writable) { + stream.destroy(); + } +}; + +// `stream.destroy(error)` crashes the process with `uncaughtException` if no `error` event listener exists on `stream`. +// We take care of error handling on user behalf, so we do not want this to happen. +const errorStream = (stream, error) => { + if (!stream.destroyed) { + stream.once('error', noop); + stream.destroy(error); + } +}; + +const noop = () => {}; + +const updateMaxListeners = (passThroughStream, increment) => { + const maxListeners = passThroughStream.getMaxListeners(); + if (maxListeners !== 0 && maxListeners !== Number.POSITIVE_INFINITY) { + passThroughStream.setMaxListeners(maxListeners + increment); + } +}; + +// Number of times `passThroughStream.on()` is called regardless of streams: +// - once due to `finished(passThroughStream)` +// - once due to `on(passThroughStream)` +const PASSTHROUGH_LISTENERS_COUNT = 2; + +// Number of times `passThroughStream.on()` is called per stream: +// - once due to `stream.pipe(passThroughStream)` +const PASSTHROUGH_LISTENERS_PER_STREAM = 1; diff --git a/node_modules/@sindresorhus/merge-streams/license b/node_modules/@sindresorhus/merge-streams/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/@sindresorhus/merge-streams/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@sindresorhus/merge-streams/package.json b/node_modules/@sindresorhus/merge-streams/package.json new file mode 100644 index 0000000..36ac5a9 --- /dev/null +++ b/node_modules/@sindresorhus/merge-streams/package.json @@ -0,0 +1,49 @@ +{ + "name": "@sindresorhus/merge-streams", + "version": "4.0.0", + "description": "Merge multiple streams into a unified stream", + "license": "MIT", + "repository": "sindresorhus/merge-streams", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": { + "types": "./index.d.ts", + "default": "./index.js" + }, + "sideEffects": false, + "engines": { + "node": ">=18" + }, + "scripts": { + "test": "xo && c8 ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "merge", + "stream", + "streams", + "readable", + "passthrough", + "interleave", + "interleaved", + "unify", + "unified" + ], + "devDependencies": { + "@types/node": "^20.8.9", + "ava": "^6.1.0", + "c8": "^9.1.0", + "tempfile": "^5.0.0", + "tsd": "^0.31.0", + "typescript": "^5.2.2", + "xo": "^0.58.0" + } +} diff --git a/node_modules/@sindresorhus/merge-streams/readme.md b/node_modules/@sindresorhus/merge-streams/readme.md new file mode 100644 index 0000000..d00e50c --- /dev/null +++ b/node_modules/@sindresorhus/merge-streams/readme.md @@ -0,0 +1,53 @@ +# merge-streams + +> Merge multiple streams into a unified stream + +## Install + +```sh +npm install @sindresorhus/merge-streams +``` + +## Usage + +```js +import mergeStreams from '@sindresorhus/merge-streams'; + +const stream = mergeStreams([streamA, streamB]); + +for await (const chunk of stream) { + console.log(chunk); + //=> 'A1' + //=> 'B1' + //=> 'A2' + //=> 'B2' +} +``` + +## API + +### `mergeStreams(streams: stream.Readable[]): MergedStream` + +Merges an array of [readable streams](https://nodejs.org/api/stream.html#readable-streams) and returns a new readable stream that emits data from the individual streams as it arrives. + +If you provide an empty array, the stream remains open but can be [manually ended](https://nodejs.org/api/stream.html#writableendchunk-encoding-callback). + +#### `MergedStream` + +_Type_: `stream.Readable` + +A single stream combining the output of multiple streams. + +##### `MergedStream.add(stream: stream.Readable): void` + +Pipe a new readable stream. + +Throws if `MergedStream` has already ended. + +##### `MergedStream.remove(stream: stream.Readable): Promise` + +Unpipe a stream previously added using either [`mergeStreams(streams)`](#mergestreamsstreams-streamreadable-mergedstream) or [`MergedStream.add(stream)`](#mergedstreamaddstream-streamreadable-void). + +Returns `false` if the stream was not previously added, or if it was already removed by `MergedStream.remove(stream)`. + +The removed stream is not automatically ended. diff --git a/node_modules/ansi-regex/index.d.ts b/node_modules/ansi-regex/index.d.ts new file mode 100644 index 0000000..7d562e9 --- /dev/null +++ b/node_modules/ansi-regex/index.d.ts @@ -0,0 +1,33 @@ +export type Options = { + /** + Match only the first ANSI escape. + + @default false + */ + readonly onlyFirst: boolean; +}; + +/** +Regular expression for matching ANSI escape codes. + +@example +``` +import ansiRegex from 'ansi-regex'; + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` +*/ +export default function ansiRegex(options?: Options): RegExp; diff --git a/node_modules/ansi-regex/index.js b/node_modules/ansi-regex/index.js new file mode 100644 index 0000000..2cc5ca2 --- /dev/null +++ b/node_modules/ansi-regex/index.js @@ -0,0 +1,14 @@ +export default function ansiRegex({onlyFirst = false} = {}) { + // Valid string terminator sequences are BEL, ESC\, and 0x9c + const ST = '(?:\\u0007|\\u001B\\u005C|\\u009C)'; + + // OSC sequences only: ESC ] ... ST (non-greedy until the first ST) + const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`; + + // CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte + const csi = '[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]'; + + const pattern = `${osc}|${csi}`; + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +} diff --git a/node_modules/ansi-regex/license b/node_modules/ansi-regex/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/ansi-regex/package.json b/node_modules/ansi-regex/package.json new file mode 100644 index 0000000..2efe9eb --- /dev/null +++ b/node_modules/ansi-regex/package.json @@ -0,0 +1,61 @@ +{ + "name": "ansi-regex", + "version": "6.2.2", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "funding": "https://github.com/chalk/ansi-regex?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "types": "./index.d.ts", + "sideEffects": false, + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ansi-escapes": "^5.0.0", + "ava": "^3.15.0", + "tsd": "^0.21.0", + "xo": "^0.54.2" + } +} diff --git a/node_modules/ansi-regex/readme.md b/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000..4d3c415 --- /dev/null +++ b/node_modules/ansi-regex/readme.md @@ -0,0 +1,66 @@ +# ansi-regex + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + +## Install + +```sh +npm install ansi-regex +``` + +## Usage + +```js +import ansiRegex from 'ansi-regex'; + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + +## API + +### ansiRegex(options?) + +Returns a regex for matching ANSI escape codes. + +#### options + +Type: `object` + +##### onlyFirst + +Type: `boolean`\ +Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + +## Important + +If you run the regex against untrusted user input in a server context, you should [give it a timeout](https://github.com/sindresorhus/super-regex). + +**I do not consider [ReDoS](https://blog.yossarian.net/2022/12/28/ReDoS-vulnerabilities-and-misaligned-incentives) a valid vulnerability for this package.** + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) diff --git a/node_modules/ansi-styles/index.js b/node_modules/ansi-styles/index.js new file mode 100644 index 0000000..90a871c --- /dev/null +++ b/node_modules/ansi-styles/index.js @@ -0,0 +1,165 @@ +'use strict'; +const colorConvert = require('color-convert'); + +const wrapAnsi16 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => function () { + const rgb = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39], + + // Bright color + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Fix humans + styles.color.grey = styles.color.gray; + + for (const groupName of Object.keys(styles)) { + const group = styles[groupName]; + + for (const styleName of Object.keys(group)) { + const style = group[styleName]; + + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + } + + const ansi2ansi = n => n; + const rgb2rgb = (r, g, b) => [r, g, b]; + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + styles.color.ansi = { + ansi: wrapAnsi16(ansi2ansi, 0) + }; + styles.color.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 0) + }; + styles.color.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 0) + }; + + styles.bgColor.ansi = { + ansi: wrapAnsi16(ansi2ansi, 10) + }; + styles.bgColor.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 10) + }; + styles.bgColor.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 10) + }; + + for (let key of Object.keys(colorConvert)) { + if (typeof colorConvert[key] !== 'object') { + continue; + } + + const suite = colorConvert[key]; + + if (key === 'ansi16') { + key = 'ansi'; + } + + if ('ansi16' in suite) { + styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); + styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); + } + + if ('ansi256' in suite) { + styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); + styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); + } + + if ('rgb' in suite) { + styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); + styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); + } + } + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/node_modules/ansi-styles/license b/node_modules/ansi-styles/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/ansi-styles/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/ansi-styles/package.json b/node_modules/ansi-styles/package.json new file mode 100644 index 0000000..65edb48 --- /dev/null +++ b/node_modules/ansi-styles/package.json @@ -0,0 +1,56 @@ +{ + "name": "ansi-styles", + "version": "3.2.1", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": "chalk/ansi-styles", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava", + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "color-convert": "^1.9.0" + }, + "devDependencies": { + "ava": "*", + "babel-polyfill": "^6.23.0", + "svg-term-cli": "^2.1.1", + "xo": "*" + }, + "ava": { + "require": "babel-polyfill" + } +} diff --git a/node_modules/ansi-styles/readme.md b/node_modules/ansi-styles/readme.md new file mode 100644 index 0000000..3158e2d --- /dev/null +++ b/node_modules/ansi-styles/readme.md @@ -0,0 +1,147 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + + + + +## Install + +``` +$ npm install ansi-styles +``` + + +## Usage + +```js +const style = require('ansi-styles'); + +console.log(`${style.green.open}Hello world!${style.green.close}`); + + +// Color conversion between 16/256/truecolor +// NOTE: If conversion goes to 16 colors or 256 colors, the original color +// may be degraded to fit that color palette. This means terminals +// that do not support 16 million colors will best-match the +// original color. +console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); +console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close); +``` + +## API + +Each style has an `open` and `close` property. + + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(Not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(Not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `gray` ("bright black") +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgBlackBright` +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + + +## Advanced usage + +By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `style.modifier` +- `style.color` +- `style.bgColor` + +###### Example + +```js +console.log(style.color.green.open); +``` + +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. + +###### Example + +```js +console.log(style.codes.get(36)); +//=> 39 +``` + + +## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) + +`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. + +To use these, call the associated conversion function with the intended output, for example: + +```js +style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code +style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code + +style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code +style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code + +style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code +style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code +``` + + +## Related + +- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/node_modules/array-back/LICENSE b/node_modules/array-back/LICENSE new file mode 100644 index 0000000..203018f --- /dev/null +++ b/node_modules/array-back/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-19 Lloyd Brookes <75pound@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/array-back/README.hbs b/node_modules/array-back/README.hbs new file mode 100644 index 0000000..7d84bd2 --- /dev/null +++ b/node_modules/array-back/README.hbs @@ -0,0 +1,40 @@ +[![view on npm](https://img.shields.io/npm/v/array-back.svg)](https://www.npmjs.org/package/array-back) +[![npm module downloads](https://img.shields.io/npm/dt/array-back.svg)](https://www.npmjs.org/package/array-back) +[![Build Status](https://travis-ci.org/75lb/array-back.svg?branch=master)](https://travis-ci.org/75lb/array-back) +[![Coverage Status](https://coveralls.io/repos/github/75lb/array-back/badge.svg?branch=master)](https://coveralls.io/github/75lb/array-back?branch=master) +[![Dependency Status](https://badgen.net/david/dep/75lb/array-back)](https://david-dm.org/75lb/array-back) +[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard) + +{{>main}} + +### Load anywhere + +This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation. + +Node.js: + +```js +const arrayify = require('array-back') +``` + +Within Node.js with ECMAScript Module support enabled: + +```js +import arrayify from 'array-back' +``` + +Within an modern browser ECMAScript Module: + +```js +import arrayify from './node_modules/array-back/index.mjs' +``` + +Old browser (adds `window.arrayBack`): + +```html + +``` + +* * * + +© 2015-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown). diff --git a/node_modules/array-back/README.md b/node_modules/array-back/README.md new file mode 100644 index 0000000..431339e --- /dev/null +++ b/node_modules/array-back/README.md @@ -0,0 +1,81 @@ +[![view on npm](https://img.shields.io/npm/v/array-back.svg)](https://www.npmjs.org/package/array-back) +[![npm module downloads](https://img.shields.io/npm/dt/array-back.svg)](https://www.npmjs.org/package/array-back) +[![Build Status](https://travis-ci.org/75lb/array-back.svg?branch=master)](https://travis-ci.org/75lb/array-back) +[![Coverage Status](https://coveralls.io/repos/github/75lb/array-back/badge.svg?branch=master)](https://coveralls.io/github/75lb/array-back?branch=master) +[![Dependency Status](https://badgen.net/david/dep/75lb/array-back)](https://david-dm.org/75lb/array-back) +[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard) + + + +## array-back +Takes any input and guarantees an array back. + +- Converts array-like objects (e.g. `arguments`, `Set`) to a real array. +- Converts `undefined` to an empty array. +- Converts any another other, singular value (including `null`, objects and iterables other than `Set`) into an array containing that value. +- Ignores input which is already an array. + +**Example** +```js +> const arrayify = require('array-back') + +> arrayify(undefined) +[] + +> arrayify(null) +[ null ] + +> arrayify(0) +[ 0 ] + +> arrayify([ 1, 2 ]) +[ 1, 2 ] + +> arrayify(new Set([ 1, 2 ])) +[ 1, 2 ] + +> function f(){ return arrayify(arguments); } +> f(1,2,3) +[ 1, 2, 3 ] +``` + + +### arrayify(input) ⇒ Array ⏏ +**Kind**: Exported function + +| Param | Type | Description | +| --- | --- | --- | +| input | \* | The input value to convert to an array | + + +### Load anywhere + +This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation. + +Node.js: + +```js +const arrayify = require('array-back') +``` + +Within Node.js with ECMAScript Module support enabled: + +```js +import arrayify from 'array-back' +``` + +Within an modern browser ECMAScript Module: + +```js +import arrayify from './node_modules/array-back/index.mjs' +``` + +Old browser (adds `window.arrayBack`): + +```html + +``` + +* * * + +© 2015-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown). diff --git a/node_modules/array-back/dist/index.js b/node_modules/array-back/dist/index.js new file mode 100644 index 0000000..3b97b84 --- /dev/null +++ b/node_modules/array-back/dist/index.js @@ -0,0 +1,70 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.arrayBack = factory()); +}(this, (function () { 'use strict'; + + /** + * Takes any input and guarantees an array back. + * + * - Converts array-like objects (e.g. `arguments`, `Set`) to a real array. + * - Converts `undefined` to an empty array. + * - Converts any another other, singular value (including `null`, objects and iterables other than `Set`) into an array containing that value. + * - Ignores input which is already an array. + * + * @module array-back + * @example + * > const arrayify = require('array-back') + * + * > arrayify(undefined) + * [] + * + * > arrayify(null) + * [ null ] + * + * > arrayify(0) + * [ 0 ] + * + * > arrayify([ 1, 2 ]) + * [ 1, 2 ] + * + * > arrayify(new Set([ 1, 2 ])) + * [ 1, 2 ] + * + * > function f(){ return arrayify(arguments); } + * > f(1,2,3) + * [ 1, 2, 3 ] + */ + + function isObject (input) { + return typeof input === 'object' && input !== null + } + + function isArrayLike (input) { + return isObject(input) && typeof input.length === 'number' + } + + /** + * @param {*} - The input value to convert to an array + * @returns {Array} + * @alias module:array-back + */ + function arrayify (input) { + if (Array.isArray(input)) { + return input + } + + if (input === undefined) { + return [] + } + + if (isArrayLike(input) || input instanceof Set) { + return Array.from(input) + } + + return [input] + } + + return arrayify; + +}))); diff --git a/node_modules/array-back/index.mjs b/node_modules/array-back/index.mjs new file mode 100644 index 0000000..1090399 --- /dev/null +++ b/node_modules/array-back/index.mjs @@ -0,0 +1,62 @@ +/** + * Takes any input and guarantees an array back. + * + * - Converts array-like objects (e.g. `arguments`, `Set`) to a real array. + * - Converts `undefined` to an empty array. + * - Converts any another other, singular value (including `null`, objects and iterables other than `Set`) into an array containing that value. + * - Ignores input which is already an array. + * + * @module array-back + * @example + * > const arrayify = require('array-back') + * + * > arrayify(undefined) + * [] + * + * > arrayify(null) + * [ null ] + * + * > arrayify(0) + * [ 0 ] + * + * > arrayify([ 1, 2 ]) + * [ 1, 2 ] + * + * > arrayify(new Set([ 1, 2 ])) + * [ 1, 2 ] + * + * > function f(){ return arrayify(arguments); } + * > f(1,2,3) + * [ 1, 2, 3 ] + */ + +function isObject (input) { + return typeof input === 'object' && input !== null +} + +function isArrayLike (input) { + return isObject(input) && typeof input.length === 'number' +} + +/** + * @param {*} - The input value to convert to an array + * @returns {Array} + * @alias module:array-back + */ +function arrayify (input) { + if (Array.isArray(input)) { + return input + } + + if (input === undefined) { + return [] + } + + if (isArrayLike(input) || input instanceof Set) { + return Array.from(input) + } + + return [input] +} + +export default arrayify diff --git a/node_modules/array-back/package.json b/node_modules/array-back/package.json new file mode 100644 index 0000000..a677a10 --- /dev/null +++ b/node_modules/array-back/package.json @@ -0,0 +1,46 @@ +{ + "name": "array-back", + "author": "Lloyd Brookes <75pound@gmail.com>", + "version": "4.0.2", + "description": "Guarantees an array back", + "repository": "https://github.com/75lb/array-back.git", + "license": "MIT", + "main": "dist/index.js", + "keywords": [ + "to", + "convert", + "return", + "array", + "arrayify" + ], + "engines": { + "node": ">=8" + }, + "files": [ + "index.mjs", + "dist/index.js" + ], + "scripts": { + "test": "npm run dist && npm run test:esm && npm run test:web", + "test:esm": "esm-runner test.mjs", + "test:web": "web-runner test.mjs", + "docs": "jsdoc2md -t README.hbs index.mjs -c jsdoc.conf > README.md", + "dist": "rollup -f umd -n arrayBack -o dist/index.js index.mjs", + "cover": "c8 npm run test:esm && c8 report --reporter=text-lcov | coveralls" + }, + "dependencies": {}, + "devDependencies": { + "@test-runner/web": "^0.2.1", + "c8": "^6.0.1", + "coveralls": "^3.0.7", + "esm-runner": "^0.2.0", + "isomorphic-assert": "^0.1.1", + "jsdoc-to-markdown": "^5.0.2", + "rollup": "^1.26.5" + }, + "standard": { + "ignore": [ + "dist" + ] + } +} diff --git a/node_modules/chalk/index.js b/node_modules/chalk/index.js new file mode 100644 index 0000000..1cc5fa8 --- /dev/null +++ b/node_modules/chalk/index.js @@ -0,0 +1,228 @@ +'use strict'; +const escapeStringRegexp = require('escape-string-regexp'); +const ansiStyles = require('ansi-styles'); +const stdoutColor = require('supports-color').stdout; + +const template = require('./templates.js'); + +const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); + +// `supportsColor.level` → `ansiStyles.color[name]` mapping +const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; + +// `color-convert` models to exclude from the Chalk API due to conflicts and such +const skipModels = new Set(['gray']); + +const styles = Object.create(null); + +function applyOptions(obj, options) { + options = options || {}; + + // Detect level if not set manually + const scLevel = stdoutColor ? stdoutColor.level : 0; + obj.level = options.level === undefined ? scLevel : options.level; + obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; +} + +function Chalk(options) { + // We check for this.template here since calling `chalk.constructor()` + // by itself will have a `this` of a previously constructed chalk object + if (!this || !(this instanceof Chalk) || this.template) { + const chalk = {}; + applyOptions(chalk, options); + + chalk.template = function () { + const args = [].slice.call(arguments); + return chalkTag.apply(null, [chalk.template].concat(args)); + }; + + Object.setPrototypeOf(chalk, Chalk.prototype); + Object.setPrototypeOf(chalk.template, chalk); + + chalk.template.constructor = Chalk; + + return chalk.template; + } + + applyOptions(this, options); +} + +// Use bright blue on Windows as the normal blue color is illegible +if (isSimpleWindowsTerm) { + ansiStyles.blue.open = '\u001B[94m'; +} + +for (const key of Object.keys(ansiStyles)) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + + styles[key] = { + get() { + const codes = ansiStyles[key]; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); + } + }; +} + +styles.visible = { + get() { + return build.call(this, this._styles || [], true, 'visible'); + } +}; + +ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); +for (const model of Object.keys(ansiStyles.color.ansi)) { + if (skipModels.has(model)) { + continue; + } + + styles[model] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.color.close, + closeRe: ansiStyles.color.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); + }; + } + }; +} + +ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); +for (const model of Object.keys(ansiStyles.bgColor.ansi)) { + if (skipModels.has(model)) { + continue; + } + + const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); + styles[bgModel] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.bgColor.close, + closeRe: ansiStyles.bgColor.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); + }; + } + }; +} + +const proto = Object.defineProperties(() => {}, styles); + +function build(_styles, _empty, key) { + const builder = function () { + return applyStyle.apply(builder, arguments); + }; + + builder._styles = _styles; + builder._empty = _empty; + + const self = this; + + Object.defineProperty(builder, 'level', { + enumerable: true, + get() { + return self.level; + }, + set(level) { + self.level = level; + } + }); + + Object.defineProperty(builder, 'enabled', { + enumerable: true, + get() { + return self.enabled; + }, + set(enabled) { + self.enabled = enabled; + } + }); + + // See below for fix regarding invisible grey/dim combination on Windows + builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; + + // `__proto__` is used because we must return a function, but there is + // no way to create a function with a different prototype + builder.__proto__ = proto; // eslint-disable-line no-proto + + return builder; +} + +function applyStyle() { + // Support varags, but simply cast to string in case there's only one arg + const args = arguments; + const argsLen = args.length; + let str = String(arguments[0]); + + if (argsLen === 0) { + return ''; + } + + if (argsLen > 1) { + // Don't slice `arguments`, it prevents V8 optimizations + for (let a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } + + if (!this.enabled || this.level <= 0 || !str) { + return this._empty ? '' : str; + } + + // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, + // see https://github.com/chalk/chalk/issues/58 + // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. + const originalDim = ansiStyles.dim.open; + if (isSimpleWindowsTerm && this.hasGrey) { + ansiStyles.dim.open = ''; + } + + for (const code of this._styles.slice().reverse()) { + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + str = code.open + str.replace(code.closeRe, code.open) + code.close; + + // Close the styling before a linebreak and reopen + // after next line to fix a bleed issue on macOS + // https://github.com/chalk/chalk/pull/92 + str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); + } + + // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue + ansiStyles.dim.open = originalDim; + + return str; +} + +function chalkTag(chalk, strings) { + if (!Array.isArray(strings)) { + // If chalk() was called by itself or with a string, + // return the string itself as a string. + return [].slice.call(arguments, 1).join(' '); + } + + const args = [].slice.call(arguments, 2); + const parts = [strings.raw[0]]; + + for (let i = 1; i < strings.length; i++) { + parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); + parts.push(String(strings.raw[i])); + } + + return template(chalk, parts.join('')); +} + +Object.defineProperties(Chalk.prototype, styles); + +module.exports = Chalk(); // eslint-disable-line new-cap +module.exports.supportsColor = stdoutColor; +module.exports.default = module.exports; // For TypeScript diff --git a/node_modules/chalk/index.js.flow b/node_modules/chalk/index.js.flow new file mode 100644 index 0000000..622caaa --- /dev/null +++ b/node_modules/chalk/index.js.flow @@ -0,0 +1,93 @@ +// @flow strict + +type TemplateStringsArray = $ReadOnlyArray; + +export type Level = $Values<{ + None: 0, + Basic: 1, + Ansi256: 2, + TrueColor: 3 +}>; + +export type ChalkOptions = {| + enabled?: boolean, + level?: Level +|}; + +export type ColorSupport = {| + level: Level, + hasBasic: boolean, + has256: boolean, + has16m: boolean +|}; + +export interface Chalk { + (...text: string[]): string, + (text: TemplateStringsArray, ...placeholders: string[]): string, + constructor(options?: ChalkOptions): Chalk, + enabled: boolean, + level: Level, + rgb(r: number, g: number, b: number): Chalk, + hsl(h: number, s: number, l: number): Chalk, + hsv(h: number, s: number, v: number): Chalk, + hwb(h: number, w: number, b: number): Chalk, + bgHex(color: string): Chalk, + bgKeyword(color: string): Chalk, + bgRgb(r: number, g: number, b: number): Chalk, + bgHsl(h: number, s: number, l: number): Chalk, + bgHsv(h: number, s: number, v: number): Chalk, + bgHwb(h: number, w: number, b: number): Chalk, + hex(color: string): Chalk, + keyword(color: string): Chalk, + + +reset: Chalk, + +bold: Chalk, + +dim: Chalk, + +italic: Chalk, + +underline: Chalk, + +inverse: Chalk, + +hidden: Chalk, + +strikethrough: Chalk, + + +visible: Chalk, + + +black: Chalk, + +red: Chalk, + +green: Chalk, + +yellow: Chalk, + +blue: Chalk, + +magenta: Chalk, + +cyan: Chalk, + +white: Chalk, + +gray: Chalk, + +grey: Chalk, + +blackBright: Chalk, + +redBright: Chalk, + +greenBright: Chalk, + +yellowBright: Chalk, + +blueBright: Chalk, + +magentaBright: Chalk, + +cyanBright: Chalk, + +whiteBright: Chalk, + + +bgBlack: Chalk, + +bgRed: Chalk, + +bgGreen: Chalk, + +bgYellow: Chalk, + +bgBlue: Chalk, + +bgMagenta: Chalk, + +bgCyan: Chalk, + +bgWhite: Chalk, + +bgBlackBright: Chalk, + +bgRedBright: Chalk, + +bgGreenBright: Chalk, + +bgYellowBright: Chalk, + +bgBlueBright: Chalk, + +bgMagentaBright: Chalk, + +bgCyanBright: Chalk, + +bgWhiteBrigh: Chalk, + + supportsColor: ColorSupport +}; + +declare module.exports: Chalk; diff --git a/node_modules/chalk/license b/node_modules/chalk/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/chalk/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/chalk/package.json b/node_modules/chalk/package.json new file mode 100644 index 0000000..bc32468 --- /dev/null +++ b/node_modules/chalk/package.json @@ -0,0 +1,71 @@ +{ + "name": "chalk", + "version": "2.4.2", + "description": "Terminal string styling done right", + "license": "MIT", + "repository": "chalk/chalk", + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava", + "bench": "matcha benchmark.js", + "coveralls": "nyc report --reporter=text-lcov | coveralls" + }, + "files": [ + "index.js", + "templates.js", + "types/index.d.ts", + "index.js.flow" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "devDependencies": { + "ava": "*", + "coveralls": "^3.0.0", + "execa": "^0.9.0", + "flow-bin": "^0.68.0", + "import-fresh": "^2.0.0", + "matcha": "^0.7.0", + "nyc": "^11.0.2", + "resolve-from": "^4.0.0", + "typescript": "^2.5.3", + "xo": "*" + }, + "types": "types/index.d.ts", + "xo": { + "envs": [ + "node", + "mocha" + ], + "ignores": [ + "test/_flow.js" + ] + } +} diff --git a/node_modules/chalk/readme.md b/node_modules/chalk/readme.md new file mode 100644 index 0000000..d298e2c --- /dev/null +++ b/node_modules/chalk/readme.md @@ -0,0 +1,314 @@ +

+
+
+ Chalk +
+
+
+

+ +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs) + +### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0) + + + + +## Highlights + +- Expressive API +- Highly performant +- Ability to nest styles +- [256/Truecolor color support](#256-and-truecolor-color-support) +- Auto-detects color support +- Doesn't extend `String.prototype` +- Clean and focused +- Actively maintained +- [Used by ~23,000 packages](https://www.npmjs.com/browse/depended/chalk) as of December 31, 2017 + + +## Install + +```console +$ npm install chalk +``` + + + + + + +## Usage + +```js +const chalk = require('chalk'); + +console.log(chalk.blue('Hello world!')); +``` + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +const chalk = require('chalk'); +const log = console.log; + +// Combine styled and normal strings +log(chalk.blue('Hello') + ' World' + chalk.red('!')); + +// Compose multiple styles using the chainable API +log(chalk.blue.bgRed.bold('Hello world!')); + +// Pass in multiple arguments +log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); + +// Nest styles +log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); + +// Nest styles of the same type even (color, underline, background) +log(chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +)); + +// ES2015 template literal +log(` +CPU: ${chalk.red('90%')} +RAM: ${chalk.green('40%')} +DISK: ${chalk.yellow('70%')} +`); + +// ES2015 tagged template literal +log(chalk` +CPU: {red ${cpu.totalPercent}%} +RAM: {green ${ram.used / ram.total * 100}%} +DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} +`); + +// Use RGB colors in terminal emulators that support it. +log(chalk.keyword('orange')('Yay for orange colored text!')); +log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); +log(chalk.hex('#DEADED').bold('Bold gray!')); +``` + +Easily define your own themes: + +```js +const chalk = require('chalk'); + +const error = chalk.bold.red; +const warning = chalk.keyword('orange'); + +console.log(error('Error!')); +console.log(warning('Warning!')); +``` + +Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): + +```js +const name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> 'Hello Sindre' +``` + + +## API + +### chalk.`