@modern-js/utils 2.12.1-alpha.3 → 2.13.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +4 -0
- package/dist/{cjs/alias.js → alias.js} +15 -4
- package/dist/{cjs/analyzeProject.js → analyzeProject.js} +25 -5
- package/dist/{cjs/babel.js → babel.js} +16 -9
- package/dist/{cjs/compatRequire.js → compatRequire.js} +17 -4
- package/dist/compiled.d.ts +43 -0
- package/dist/{types/debug.d.ts → debug.d.ts} +1 -1
- package/dist/{cjs/emptyDir.js → emptyDir.js} +24 -4
- package/dist/{cjs/getEntryOptions.js → getEntryOptions.js} +15 -1
- package/dist/{cjs/getPackageManager.js → getPackageManager.js} +41 -19
- package/dist/{cjs/getPort.js → getPort.js} +24 -4
- package/dist/{cjs/getServerConfig.js → getServerConfig.js} +22 -2
- package/dist/{types/logger.d.ts → logger.d.ts} +1 -1
- package/dist/{cjs/logger.js → logger.js} +16 -5
- package/dist/{cjs/monorepo.js → monorepo.js} +15 -4
- package/dist/nodeEnv.js +81 -0
- package/dist/{cjs/path.js → path.js} +1 -1
- package/dist/{cjs/pathSerializer.js → pathSerializer.js} +1 -1
- package/dist/{cjs/react.js → react.js} +15 -4
- package/dist/{cjs/runtimeExports.js → runtimeExports.js} +1 -1
- package/dist/{cjs/universal → universal}/nestedRoutes.js +19 -2
- package/dist/{cjs/version.js → version.js} +40 -7
- package/dist/{cjs/watch.js → watch.js} +29 -9
- package/package.json +23 -55
- package/dist/cjs/nodeEnv.js +0 -55
- package/dist/compiled/address/index.js +0 -1
- package/dist/compiled/address/lib/address.d.ts +0 -28
- package/dist/compiled/address/package.json +0 -1
- package/dist/compiled/ajv/codegen.js +0 -1
- package/dist/compiled/ajv/index.js +0 -9
- package/dist/compiled/ajv/license +0 -22
- package/dist/compiled/ajv/package.json +0 -1
- package/dist/compiled/ajv/types/ajv.d.ts +0 -16
- package/dist/compiled/ajv/types/compile/codegen/code.d.ts +0 -40
- package/dist/compiled/ajv/types/compile/codegen/index.d.ts +0 -79
- package/dist/compiled/ajv/types/compile/codegen/scope.d.ts +0 -79
- package/dist/compiled/ajv/types/compile/errors.d.ts +0 -13
- package/dist/compiled/ajv/types/compile/index.d.ts +0 -80
- package/dist/compiled/ajv/types/compile/ref_error.d.ts +0 -6
- package/dist/compiled/ajv/types/compile/resolve.d.ts +0 -12
- package/dist/compiled/ajv/types/compile/rules.d.ts +0 -28
- package/dist/compiled/ajv/types/compile/util.d.ts +0 -40
- package/dist/compiled/ajv/types/compile/validate/index.d.ts +0 -42
- package/dist/compiled/ajv/types/compile/validate/subschema.d.ts +0 -47
- package/dist/compiled/ajv/types/core.d.ts +0 -173
- package/dist/compiled/ajv/types/runtime/validation_error.d.ts +0 -7
- package/dist/compiled/ajv/types/types/index.d.ts +0 -183
- package/dist/compiled/ajv/types/types/json-schema.d.ts +0 -124
- package/dist/compiled/ajv/types/types/jtd-schema.d.ts +0 -169
- package/dist/compiled/ajv/types/vocabularies/errors.d.ts +0 -1
- package/dist/compiled/ajv/uri-js.d.ts +0 -59
- package/dist/compiled/ajv-keywords/index.d.ts +0 -1
- package/dist/compiled/ajv-keywords/index.js +0 -1
- package/dist/compiled/ajv-keywords/license +0 -21
- package/dist/compiled/ajv-keywords/package.json +0 -1
- package/dist/compiled/better-ajv-errors/index.d.ts +0 -1
- package/dist/compiled/better-ajv-errors/index.js +0 -1
- package/dist/compiled/better-ajv-errors/license +0 -13
- package/dist/compiled/better-ajv-errors/package.json +0 -1
- package/dist/compiled/browserslist/index.d.ts +0 -178
- package/dist/compiled/browserslist/index.js +0 -1
- package/dist/compiled/browserslist/license +0 -20
- package/dist/compiled/browserslist/package.json +0 -1
- package/dist/compiled/chalk/index.d.ts +0 -415
- package/dist/compiled/chalk/index.js +0 -1
- package/dist/compiled/chalk/license +0 -9
- package/dist/compiled/chalk/package.json +0 -1
- package/dist/compiled/chokidar/anymatch/index.d.ts +0 -19
- package/dist/compiled/chokidar/fsevents.node +0 -0
- package/dist/compiled/chokidar/index.js +0 -40
- package/dist/compiled/chokidar/license +0 -21
- package/dist/compiled/chokidar/package.json +0 -1
- package/dist/compiled/chokidar/types/index.d.ts +0 -188
- package/dist/compiled/commander/index.js +0 -1
- package/dist/compiled/commander/license +0 -22
- package/dist/compiled/commander/package.json +0 -1
- package/dist/compiled/commander/typings/index.d.ts +0 -890
- package/dist/compiled/debug/index.d.ts +0 -54
- package/dist/compiled/debug/index.js +0 -1
- package/dist/compiled/debug/license +0 -20
- package/dist/compiled/debug/ms/index.d.ts +0 -25
- package/dist/compiled/debug/package.json +0 -1
- package/dist/compiled/dotenv/index.js +0 -1
- package/dist/compiled/dotenv/license +0 -23
- package/dist/compiled/dotenv/package.json +0 -1
- package/dist/compiled/dotenv/types/index.d.ts +0 -59
- package/dist/compiled/dotenv-expand/index.d.ts +0 -15
- package/dist/compiled/dotenv-expand/index.js +0 -1
- package/dist/compiled/dotenv-expand/license +0 -24
- package/dist/compiled/dotenv-expand/package.json +0 -1
- package/dist/compiled/execa/index.d.ts +0 -564
- package/dist/compiled/execa/index.js +0 -1
- package/dist/compiled/execa/license +0 -9
- package/dist/compiled/execa/package.json +0 -1
- package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/adapters/fs.d.ts +0 -20
- package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/index.d.ts +0 -12
- package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/providers/async.d.ts +0 -7
- package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/settings.d.ts +0 -20
- package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/types/index.d.ts +0 -20
- package/dist/compiled/fast-glob/@nodelib/fs.stat/out/adapters/fs.d.ts +0 -13
- package/dist/compiled/fast-glob/@nodelib/fs.stat/out/index.d.ts +0 -12
- package/dist/compiled/fast-glob/@nodelib/fs.stat/out/providers/async.d.ts +0 -4
- package/dist/compiled/fast-glob/@nodelib/fs.stat/out/settings.d.ts +0 -16
- package/dist/compiled/fast-glob/@nodelib/fs.stat/out/types/index.d.ts +0 -4
- package/dist/compiled/fast-glob/@nodelib/fs.walk/out/index.d.ts +0 -14
- package/dist/compiled/fast-glob/@nodelib/fs.walk/out/providers/async.d.ts +0 -12
- package/dist/compiled/fast-glob/@nodelib/fs.walk/out/readers/async.d.ts +0 -30
- package/dist/compiled/fast-glob/@nodelib/fs.walk/out/readers/reader.d.ts +0 -6
- package/dist/compiled/fast-glob/@nodelib/fs.walk/out/settings.d.ts +0 -30
- package/dist/compiled/fast-glob/@nodelib/fs.walk/out/types/index.d.ts +0 -8
- package/dist/compiled/fast-glob/index.js +0 -37
- package/dist/compiled/fast-glob/license +0 -21
- package/dist/compiled/fast-glob/out/index.d.ts +0 -27
- package/dist/compiled/fast-glob/out/managers/tasks.d.ts +0 -22
- package/dist/compiled/fast-glob/out/settings.d.ts +0 -164
- package/dist/compiled/fast-glob/out/types/index.d.ts +0 -31
- package/dist/compiled/fast-glob/package.json +0 -1
- package/dist/compiled/filesize/filesize.d.ts +0 -131
- package/dist/compiled/filesize/index.js +0 -9
- package/dist/compiled/filesize/license +0 -28
- package/dist/compiled/filesize/package.json +0 -1
- package/dist/compiled/fs-extra/index.d.ts +0 -563
- package/dist/compiled/fs-extra/index.js +0 -1
- package/dist/compiled/fs-extra/license +0 -15
- package/dist/compiled/fs-extra/package.json +0 -1
- package/dist/compiled/glob/index.d.ts +0 -91
- package/dist/compiled/glob/index.js +0 -1
- package/dist/compiled/glob/license +0 -21
- package/dist/compiled/glob/minimatch/index.d.ts +0 -204
- package/dist/compiled/glob/package.json +0 -1
- package/dist/compiled/globby/index.d.ts +0 -186
- package/dist/compiled/globby/index.js +0 -1
- package/dist/compiled/globby/license +0 -9
- package/dist/compiled/globby/package.json +0 -1
- package/dist/compiled/gzip-size/index.d.ts +0 -96
- package/dist/compiled/gzip-size/index.js +0 -1
- package/dist/compiled/gzip-size/license +0 -9
- package/dist/compiled/gzip-size/package.json +0 -1
- package/dist/compiled/import-lazy/index.d.ts +0 -26
- package/dist/compiled/import-lazy/index.js +0 -1
- package/dist/compiled/import-lazy/license +0 -9
- package/dist/compiled/import-lazy/package.json +0 -1
- package/dist/compiled/inquirer/index.d.ts +0 -997
- package/dist/compiled/inquirer/index.js +0 -9
- package/dist/compiled/inquirer/lib/objects/choice.d.ts +0 -65
- package/dist/compiled/inquirer/lib/objects/choices.d.ts +0 -206
- package/dist/compiled/inquirer/lib/objects/separator.d.ts +0 -37
- package/dist/compiled/inquirer/lib/ui/baseUI.d.ts +0 -37
- package/dist/compiled/inquirer/lib/ui/bottom-bar.d.ts +0 -65
- package/dist/compiled/inquirer/lib/ui/prompt.d.ts +0 -104
- package/dist/compiled/inquirer/license +0 -22
- package/dist/compiled/inquirer/package.json +0 -1
- package/dist/compiled/inquirer/through/index.d.ts +0 -25
- package/dist/compiled/js-yaml/index.d.ts +0 -154
- package/dist/compiled/js-yaml/index.js +0 -1
- package/dist/compiled/js-yaml/license +0 -21
- package/dist/compiled/js-yaml/package.json +0 -1
- package/dist/compiled/json5/index.js +0 -1
- package/dist/compiled/json5/lib/index.d.ts +0 -4
- package/dist/compiled/json5/lib/parse.d.ts +0 -15
- package/dist/compiled/json5/lib/stringify.d.ts +0 -89
- package/dist/compiled/json5/package.json +0 -1
- package/dist/compiled/lodash/common/array.d.ts +0 -2126
- package/dist/compiled/lodash/common/collection.d.ts +0 -1930
- package/dist/compiled/lodash/common/common.d.ts +0 -280
- package/dist/compiled/lodash/common/date.d.ts +0 -23
- package/dist/compiled/lodash/common/function.d.ts +0 -1446
- package/dist/compiled/lodash/common/lang.d.ts +0 -1693
- package/dist/compiled/lodash/common/math.d.ts +0 -405
- package/dist/compiled/lodash/common/number.d.ts +0 -131
- package/dist/compiled/lodash/common/object.d.ts +0 -2519
- package/dist/compiled/lodash/common/seq.d.ts +0 -210
- package/dist/compiled/lodash/common/string.d.ts +0 -788
- package/dist/compiled/lodash/common/util.d.ts +0 -1220
- package/dist/compiled/lodash/index.d.ts +0 -46
- package/dist/compiled/lodash/index.js +0 -5
- package/dist/compiled/lodash/license +0 -47
- package/dist/compiled/lodash/package.json +0 -1
- package/dist/compiled/mime-types/index.d.ts +0 -14
- package/dist/compiled/mime-types/index.js +0 -14
- package/dist/compiled/mime-types/license +0 -23
- package/dist/compiled/mime-types/package.json +0 -1
- package/dist/compiled/minimist/index.d.ts +0 -95
- package/dist/compiled/minimist/index.js +0 -1
- package/dist/compiled/minimist/license +0 -18
- package/dist/compiled/minimist/package.json +0 -1
- package/dist/compiled/nanoid/index.d.ts +0 -91
- package/dist/compiled/nanoid/index.js +0 -1
- package/dist/compiled/nanoid/license +0 -20
- package/dist/compiled/nanoid/package.json +0 -1
- package/dist/compiled/ora/cli-spinners/index.d.ts +0 -125
- package/dist/compiled/ora/index.d.ts +0 -277
- package/dist/compiled/ora/index.js +0 -3
- package/dist/compiled/ora/license +0 -9
- package/dist/compiled/ora/package.json +0 -1
- package/dist/compiled/pkg-up/index.d.ts +0 -48
- package/dist/compiled/pkg-up/index.js +0 -1
- package/dist/compiled/pkg-up/license +0 -9
- package/dist/compiled/pkg-up/package.json +0 -1
- package/dist/compiled/recursive-readdir/index.d.ts +0 -21
- package/dist/compiled/recursive-readdir/index.js +0 -1
- package/dist/compiled/recursive-readdir/license +0 -21
- package/dist/compiled/recursive-readdir/package.json +0 -1
- package/dist/compiled/schema-utils3/index.d.ts +0 -1
- package/dist/compiled/schema-utils3/index.js +0 -3
- package/dist/compiled/schema-utils3/license +0 -20
- package/dist/compiled/schema-utils3/package.json +0 -1
- package/dist/compiled/semver/classes/comparator.d.ts +0 -17
- package/dist/compiled/semver/classes/range.d.ts +0 -21
- package/dist/compiled/semver/classes/semver.d.ts +0 -62
- package/dist/compiled/semver/functions/clean.d.ts +0 -8
- package/dist/compiled/semver/functions/cmp.d.ts +0 -16
- package/dist/compiled/semver/functions/coerce.d.ts +0 -12
- package/dist/compiled/semver/functions/compare-build.d.ts +0 -16
- package/dist/compiled/semver/functions/compare-loose.d.ts +0 -5
- package/dist/compiled/semver/functions/compare.d.ts +0 -20
- package/dist/compiled/semver/functions/diff.d.ts +0 -13
- package/dist/compiled/semver/functions/eq.d.ts +0 -9
- package/dist/compiled/semver/functions/gt.d.ts +0 -9
- package/dist/compiled/semver/functions/gte.d.ts +0 -9
- package/dist/compiled/semver/functions/inc.d.ts +0 -15
- package/dist/compiled/semver/functions/lt.d.ts +0 -9
- package/dist/compiled/semver/functions/lte.d.ts +0 -8
- package/dist/compiled/semver/functions/major.d.ts +0 -9
- package/dist/compiled/semver/functions/minor.d.ts +0 -9
- package/dist/compiled/semver/functions/neq.d.ts +0 -9
- package/dist/compiled/semver/functions/parse.d.ts +0 -12
- package/dist/compiled/semver/functions/patch.d.ts +0 -9
- package/dist/compiled/semver/functions/prerelease.d.ts +0 -12
- package/dist/compiled/semver/functions/rcompare.d.ts +0 -15
- package/dist/compiled/semver/functions/rsort.d.ts +0 -9
- package/dist/compiled/semver/functions/satisfies.d.ts +0 -14
- package/dist/compiled/semver/functions/sort.d.ts +0 -9
- package/dist/compiled/semver/functions/valid.d.ts +0 -11
- package/dist/compiled/semver/index.d.ts +0 -133
- package/dist/compiled/semver/index.js +0 -1
- package/dist/compiled/semver/internals/identifiers.d.ts +0 -13
- package/dist/compiled/semver/license +0 -15
- package/dist/compiled/semver/package.json +0 -1
- package/dist/compiled/semver/ranges/gtr.d.ts +0 -14
- package/dist/compiled/semver/ranges/intersects.d.ts +0 -13
- package/dist/compiled/semver/ranges/ltr.d.ts +0 -14
- package/dist/compiled/semver/ranges/max-satisfying.d.ts +0 -14
- package/dist/compiled/semver/ranges/min-satisfying.d.ts +0 -14
- package/dist/compiled/semver/ranges/min-version.d.ts +0 -10
- package/dist/compiled/semver/ranges/outside.d.ts +0 -15
- package/dist/compiled/semver/ranges/simplify.d.ts +0 -14
- package/dist/compiled/semver/ranges/subset.d.ts +0 -13
- package/dist/compiled/semver/ranges/to-comparators.d.ts +0 -9
- package/dist/compiled/semver/ranges/valid.d.ts +0 -12
- package/dist/compiled/signale/index.d.ts +0 -162
- package/dist/compiled/signale/index.js +0 -1
- package/dist/compiled/signale/package.json +0 -1
- package/dist/compiled/slash/index.d.ts +0 -25
- package/dist/compiled/slash/index.js +0 -1
- package/dist/compiled/slash/license +0 -9
- package/dist/compiled/slash/package.json +0 -1
- package/dist/compiled/strip-ansi/index.d.ts +0 -17
- package/dist/compiled/strip-ansi/index.js +0 -1
- package/dist/compiled/strip-ansi/license +0 -9
- package/dist/compiled/strip-ansi/package.json +0 -1
- package/dist/compiled/tsconfig-paths/index.js +0 -1
- package/dist/compiled/tsconfig-paths/lib/config-loader.d.ts +0 -33
- package/dist/compiled/tsconfig-paths/lib/filesystem.d.ts +0 -34
- package/dist/compiled/tsconfig-paths/lib/index.d.ts +0 -5
- package/dist/compiled/tsconfig-paths/lib/mapping-entry.d.ts +0 -18
- package/dist/compiled/tsconfig-paths/lib/match-path-async.d.ts +0 -21
- package/dist/compiled/tsconfig-paths/lib/match-path-sync.d.ts +0 -32
- package/dist/compiled/tsconfig-paths/lib/register.d.ts +0 -12
- package/dist/compiled/tsconfig-paths/lib/try-path.d.ts +0 -15
- package/dist/compiled/tsconfig-paths/lib/tsconfig-loader.d.ts +0 -28
- package/dist/compiled/tsconfig-paths/license +0 -21
- package/dist/compiled/tsconfig-paths/package.json +0 -1
- package/dist/compiled/upath/index.js +0 -1
- package/dist/compiled/upath/license +0 -22
- package/dist/compiled/upath/package.json +0 -1
- package/dist/compiled/upath/upath.d.ts +0 -241
- package/dist/compiled/url-join/index.d.ts +0 -17
- package/dist/compiled/url-join/index.js +0 -1
- package/dist/compiled/url-join/license +0 -21
- package/dist/compiled/url-join/package.json +0 -1
- package/dist/compiled/webpack-chain/index.js +0 -1
- package/dist/compiled/webpack-chain/license +0 -373
- package/dist/compiled/webpack-chain/package.json +0 -1
- package/dist/compiled/webpack-chain/types/index.d.ts +0 -388
- package/dist/compiled/webpack-dev-middleware/index.js +0 -7
- package/dist/compiled/webpack-dev-middleware/license +0 -20
- package/dist/compiled/webpack-dev-middleware/package.json +0 -1
- package/dist/compiled/webpack-dev-middleware/types/index.d.ts +0 -262
- package/dist/esm/FileSizeReporter.js +0 -180
- package/dist/esm/alias.js +0 -83
- package/dist/esm/analyzeProject.js +0 -168
- package/dist/esm/applyOptionsChain.js +0 -26
- package/dist/esm/babel.js +0 -169
- package/dist/esm/chainId.js +0 -92
- package/dist/esm/clearConsole.js +0 -6
- package/dist/esm/commands.js +0 -17
- package/dist/esm/compatRequire.js +0 -68
- package/dist/esm/compiled.js +0 -34
- package/dist/esm/constants.js +0 -317
- package/dist/esm/debug.js +0 -5
- package/dist/esm/emptyDir.js +0 -158
- package/dist/esm/ensureAbsolutePath.js +0 -5
- package/dist/esm/ensureArray.js +0 -9
- package/dist/esm/findExists.js +0 -27
- package/dist/esm/generateMetaTags.js +0 -40
- package/dist/esm/getBrowserslist.js +0 -12
- package/dist/esm/getCoreJsVersion.js +0 -57
- package/dist/esm/getEntryOptions.js +0 -45
- package/dist/esm/getPackageManager.js +0 -187
- package/dist/esm/getPort.js +0 -215
- package/dist/esm/getServerConfig.js +0 -145
- package/dist/esm/getTargetDir.js +0 -6
- package/dist/esm/import.js +0 -8
- package/dist/esm/index.js +0 -44
- package/dist/esm/is/index.js +0 -85
- package/dist/esm/is/nodeEnv.js +0 -16
- package/dist/esm/is/platform.js +0 -7
- package/dist/esm/is/type.js +0 -25
- package/dist/esm/logger.js +0 -207
- package/dist/esm/monorepo.js +0 -109
- package/dist/esm/nodeEnv.js +0 -258
- package/dist/esm/path.js +0 -85
- package/dist/esm/pathSerializer.js +0 -85
- package/dist/esm/plugin.js +0 -45
- package/dist/esm/prettyInstructions.js +0 -96
- package/dist/esm/printBuildError.js +0 -24
- package/dist/esm/react.js +0 -43
- package/dist/esm/readTsConfig.js +0 -10
- package/dist/esm/removeSlash.js +0 -10
- package/dist/esm/resolve.js +0 -42
- package/dist/esm/routes.js +0 -19
- package/dist/esm/runtimeExports.js +0 -65
- package/dist/esm/ssr.js +0 -3
- package/dist/esm/storage.js +0 -36
- package/dist/esm/testUtils.js +0 -13
- package/dist/esm/types.js +0 -1
- package/dist/esm/universal/constants.js +0 -3
- package/dist/esm/universal/formatWebpack.js +0 -108
- package/dist/esm/universal/nestedRoutes.js +0 -174
- package/dist/esm/universal/remixRouter.js +0 -1
- package/dist/esm/universal/serialize.js +0 -7
- package/dist/esm/version.js +0 -193
- package/dist/esm/wait.js +0 -7
- package/dist/esm/watch.js +0 -230
- package/dist/esm-node/FileSizeReporter.js +0 -133
- package/dist/esm-node/alias.js +0 -61
- package/dist/esm-node/analyzeProject.js +0 -17
- package/dist/esm-node/applyOptionsChain.js +0 -35
- package/dist/esm-node/babel.js +0 -105
- package/dist/esm-node/chainId.js +0 -173
- package/dist/esm-node/clearConsole.js +0 -8
- package/dist/esm-node/commands.js +0 -22
- package/dist/esm-node/compatRequire.js +0 -42
- package/dist/esm-node/compiled.js +0 -77
- package/dist/esm-node/constants.js +0 -264
- package/dist/esm-node/debug.js +0 -5
- package/dist/esm-node/emptyDir.js +0 -9
- package/dist/esm-node/ensureAbsolutePath.js +0 -5
- package/dist/esm-node/ensureArray.js +0 -9
- package/dist/esm-node/findExists.js +0 -12
- package/dist/esm-node/generateMetaTags.js +0 -38
- package/dist/esm-node/getBrowserslist.js +0 -7
- package/dist/esm-node/getCoreJsVersion.js +0 -13
- package/dist/esm-node/getEntryOptions.js +0 -17
- package/dist/esm-node/getPackageManager.js +0 -32
- package/dist/esm-node/getPort.js +0 -59
- package/dist/esm-node/getServerConfig.js +0 -14
- package/dist/esm-node/getTargetDir.js +0 -8
- package/dist/esm-node/import.js +0 -9
- package/dist/esm-node/index.js +0 -44
- package/dist/esm-node/is/index.js +0 -71
- package/dist/esm-node/is/nodeEnv.js +0 -12
- package/dist/esm-node/is/platform.js +0 -6
- package/dist/esm-node/is/type.js +0 -34
- package/dist/esm-node/logger.js +0 -100
- package/dist/esm-node/monorepo.js +0 -87
- package/dist/esm-node/nodeEnv.js +0 -30
- package/dist/esm-node/path.js +0 -50
- package/dist/esm-node/pathSerializer.js +0 -46
- package/dist/esm-node/plugin.js +0 -23
- package/dist/esm-node/prettyInstructions.js +0 -77
- package/dist/esm-node/printBuildError.js +0 -34
- package/dist/esm-node/react.js +0 -20
- package/dist/esm-node/readTsConfig.js +0 -13
- package/dist/esm-node/removeSlash.js +0 -8
- package/dist/esm-node/resolve.js +0 -38
- package/dist/esm-node/routes.js +0 -24
- package/dist/esm-node/runtimeExports.js +0 -40
- package/dist/esm-node/ssr.js +0 -6
- package/dist/esm-node/storage.js +0 -42
- package/dist/esm-node/testUtils.js +0 -15
- package/dist/esm-node/types.js +0 -0
- package/dist/esm-node/universal/constants.js +0 -6
- package/dist/esm-node/universal/formatWebpack.js +0 -77
- package/dist/esm-node/universal/nestedRoutes.js +0 -93
- package/dist/esm-node/universal/remixRouter.js +0 -1
- package/dist/esm-node/universal/serialize.js +0 -7
- package/dist/esm-node/version.js +0 -25
- package/dist/esm-node/wait.js +0 -6
- package/dist/esm-node/watch.js +0 -36
- package/dist/types/compiled.d.ts +0 -43
- /package/dist/{types/FileSizeReporter.d.ts → FileSizeReporter.d.ts} +0 -0
- /package/dist/{cjs/FileSizeReporter.js → FileSizeReporter.js} +0 -0
- /package/dist/{types/alias.d.ts → alias.d.ts} +0 -0
- /package/dist/{types/analyzeProject.d.ts → analyzeProject.d.ts} +0 -0
- /package/dist/{types/applyOptionsChain.d.ts → applyOptionsChain.d.ts} +0 -0
- /package/dist/{cjs/applyOptionsChain.js → applyOptionsChain.js} +0 -0
- /package/dist/{types/babel.d.ts → babel.d.ts} +0 -0
- /package/dist/{types/chainId.d.ts → chainId.d.ts} +0 -0
- /package/dist/{cjs/chainId.js → chainId.js} +0 -0
- /package/dist/{types/clearConsole.d.ts → clearConsole.d.ts} +0 -0
- /package/dist/{cjs/clearConsole.js → clearConsole.js} +0 -0
- /package/dist/{types/commands.d.ts → commands.d.ts} +0 -0
- /package/dist/{cjs/commands.js → commands.js} +0 -0
- /package/dist/{types/compatRequire.d.ts → compatRequire.d.ts} +0 -0
- /package/dist/{cjs/compiled.js → compiled.js} +0 -0
- /package/dist/{types/constants.d.ts → constants.d.ts} +0 -0
- /package/dist/{cjs/constants.js → constants.js} +0 -0
- /package/dist/{cjs/debug.js → debug.js} +0 -0
- /package/dist/{types/emptyDir.d.ts → emptyDir.d.ts} +0 -0
- /package/dist/{types/ensureAbsolutePath.d.ts → ensureAbsolutePath.d.ts} +0 -0
- /package/dist/{cjs/ensureAbsolutePath.js → ensureAbsolutePath.js} +0 -0
- /package/dist/{types/ensureArray.d.ts → ensureArray.d.ts} +0 -0
- /package/dist/{cjs/ensureArray.js → ensureArray.js} +0 -0
- /package/dist/{types/findExists.d.ts → findExists.d.ts} +0 -0
- /package/dist/{cjs/findExists.js → findExists.js} +0 -0
- /package/dist/{types/generateMetaTags.d.ts → generateMetaTags.d.ts} +0 -0
- /package/dist/{cjs/generateMetaTags.js → generateMetaTags.js} +0 -0
- /package/dist/{types/getBrowserslist.d.ts → getBrowserslist.d.ts} +0 -0
- /package/dist/{cjs/getBrowserslist.js → getBrowserslist.js} +0 -0
- /package/dist/{types/getCoreJsVersion.d.ts → getCoreJsVersion.d.ts} +0 -0
- /package/dist/{cjs/getCoreJsVersion.js → getCoreJsVersion.js} +0 -0
- /package/dist/{types/getEntryOptions.d.ts → getEntryOptions.d.ts} +0 -0
- /package/dist/{types/getPackageManager.d.ts → getPackageManager.d.ts} +0 -0
- /package/dist/{types/getPort.d.ts → getPort.d.ts} +0 -0
- /package/dist/{types/getServerConfig.d.ts → getServerConfig.d.ts} +0 -0
- /package/dist/{types/getTargetDir.d.ts → getTargetDir.d.ts} +0 -0
- /package/dist/{cjs/getTargetDir.js → getTargetDir.js} +0 -0
- /package/dist/{types/import.d.ts → import.d.ts} +0 -0
- /package/dist/{cjs/import.js → import.js} +0 -0
- /package/dist/{types/index.d.ts → index.d.ts} +0 -0
- /package/dist/{cjs/index.js → index.js} +0 -0
- /package/dist/{types/is → is}/index.d.ts +0 -0
- /package/dist/{cjs/is → is}/index.js +0 -0
- /package/dist/{types/is → is}/nodeEnv.d.ts +0 -0
- /package/dist/{cjs/is → is}/nodeEnv.js +0 -0
- /package/dist/{types/is → is}/platform.d.ts +0 -0
- /package/dist/{cjs/is → is}/platform.js +0 -0
- /package/dist/{types/is → is}/type.d.ts +0 -0
- /package/dist/{cjs/is → is}/type.js +0 -0
- /package/dist/{types/monorepo.d.ts → monorepo.d.ts} +0 -0
- /package/dist/{types/nodeEnv.d.ts → nodeEnv.d.ts} +0 -0
- /package/dist/{types/path.d.ts → path.d.ts} +0 -0
- /package/dist/{types/pathSerializer.d.ts → pathSerializer.d.ts} +0 -0
- /package/dist/{types/plugin.d.ts → plugin.d.ts} +0 -0
- /package/dist/{cjs/plugin.js → plugin.js} +0 -0
- /package/dist/{types/prettyInstructions.d.ts → prettyInstructions.d.ts} +0 -0
- /package/dist/{cjs/prettyInstructions.js → prettyInstructions.js} +0 -0
- /package/dist/{types/printBuildError.d.ts → printBuildError.d.ts} +0 -0
- /package/dist/{cjs/printBuildError.js → printBuildError.js} +0 -0
- /package/dist/{types/react.d.ts → react.d.ts} +0 -0
- /package/dist/{types/readTsConfig.d.ts → readTsConfig.d.ts} +0 -0
- /package/dist/{cjs/readTsConfig.js → readTsConfig.js} +0 -0
- /package/dist/{types/removeSlash.d.ts → removeSlash.d.ts} +0 -0
- /package/dist/{cjs/removeSlash.js → removeSlash.js} +0 -0
- /package/dist/{types/resolve.d.ts → resolve.d.ts} +0 -0
- /package/dist/{cjs/resolve.js → resolve.js} +0 -0
- /package/dist/{types/routes.d.ts → routes.d.ts} +0 -0
- /package/dist/{cjs/routes.js → routes.js} +0 -0
- /package/dist/{types/runtimeExports.d.ts → runtimeExports.d.ts} +0 -0
- /package/dist/{types/ssr.d.ts → ssr.d.ts} +0 -0
- /package/dist/{cjs/ssr.js → ssr.js} +0 -0
- /package/dist/{types/storage.d.ts → storage.d.ts} +0 -0
- /package/dist/{cjs/storage.js → storage.js} +0 -0
- /package/dist/{types/testUtils.d.ts → testUtils.d.ts} +0 -0
- /package/dist/{cjs/testUtils.js → testUtils.js} +0 -0
- /package/dist/{types/types.d.ts → types.d.ts} +0 -0
- /package/dist/{cjs/types.js → types.js} +0 -0
- /package/dist/{types/universal → universal}/constants.d.ts +0 -0
- /package/dist/{cjs/universal → universal}/constants.js +0 -0
- /package/dist/{types/universal → universal}/formatWebpack.d.ts +0 -0
- /package/dist/{cjs/universal → universal}/formatWebpack.js +0 -0
- /package/dist/{types/universal → universal}/nestedRoutes.d.ts +0 -0
- /package/dist/{types/universal → universal}/remixRouter.d.ts +0 -0
- /package/dist/{cjs/universal → universal}/remixRouter.js +0 -0
- /package/dist/{types/universal → universal}/serialize.d.ts +0 -0
- /package/dist/{cjs/universal → universal}/serialize.js +0 -0
- /package/dist/{types/version.d.ts → version.d.ts} +0 -0
- /package/dist/{types/wait.d.ts → wait.d.ts} +0 -0
- /package/dist/{cjs/wait.js → wait.js} +0 -0
- /package/dist/{types/watch.d.ts → watch.d.ts} +0 -0
@@ -1,997 +0,0 @@
|
|
1
|
-
// Type definitions for inquirer 8.2
|
2
|
-
// Project: https://github.com/SBoudrias/Inquirer.js
|
3
|
-
// Definitions by: Qubo <https://github.com/tkQubo>
|
4
|
-
// Parvez <https://github.com/ppathan>
|
5
|
-
// Jouderian <https://github.com/jouderianjr>
|
6
|
-
// Qibang <https://github.com/bang88>
|
7
|
-
// Jason Dreyzehner <https://github.com/bitjson>
|
8
|
-
// Synarque <https://github.com/synarque>
|
9
|
-
// Justin Rockwood <https://github.com/jrockwood>
|
10
|
-
// Keith Kelly <https://github.com/kwkelly>
|
11
|
-
// Richard Lea <https://github.com/chigix>
|
12
|
-
// Jed Mao <https://github.com/jedmao>
|
13
|
-
// Manuel Thalmann <https://github.com/manuth>
|
14
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
15
|
-
// TypeScript Version: 4.2
|
16
|
-
import { Interface as ReadlineInterface } from 'readline';
|
17
|
-
import { Observable } from './rxjs';
|
18
|
-
import Choice = require('./lib/objects/choice');
|
19
|
-
import Choices = require('./lib/objects/choices');
|
20
|
-
import Separator = require('./lib/objects/separator');
|
21
|
-
import './lib/prompts/base';
|
22
|
-
import './lib/prompts/checkbox';
|
23
|
-
import './lib/prompts/confirm';
|
24
|
-
import './lib/prompts/editor';
|
25
|
-
import './lib/prompts/expand';
|
26
|
-
import './lib/prompts/input';
|
27
|
-
import './lib/prompts/list';
|
28
|
-
import './lib/prompts/number';
|
29
|
-
import './lib/prompts/password';
|
30
|
-
import './lib/prompts/rawlist';
|
31
|
-
import './lib/utils/events';
|
32
|
-
import './lib/utils/paginator';
|
33
|
-
import './lib/utils/readline';
|
34
|
-
import './lib/utils/screen-manager';
|
35
|
-
import './lib/utils/utils';
|
36
|
-
import BottomBar = require('./lib/ui/bottom-bar');
|
37
|
-
import PromptUI = require('./lib/ui/prompt');
|
38
|
-
|
39
|
-
/**
|
40
|
-
* Represents a union which preserves autocompletion.
|
41
|
-
*
|
42
|
-
* @template T
|
43
|
-
* The keys which are available for autocompletion.
|
44
|
-
*
|
45
|
-
* @template F
|
46
|
-
* The fallback-type.
|
47
|
-
*/
|
48
|
-
type LiteralUnion<T extends F, F = string> = T | (F & {});
|
49
|
-
|
50
|
-
/**
|
51
|
-
* Provides prompts for answering questions.
|
52
|
-
*/
|
53
|
-
interface PromptModuleBase {
|
54
|
-
/**
|
55
|
-
* Registers a new prompt-type.
|
56
|
-
*
|
57
|
-
* @param name
|
58
|
-
* The name of the prompt.
|
59
|
-
*
|
60
|
-
* @param prompt
|
61
|
-
* The constructor of the prompt.
|
62
|
-
*/
|
63
|
-
registerPrompt(name: string, prompt: inquirer.prompts.PromptConstructor): void;
|
64
|
-
|
65
|
-
/**
|
66
|
-
* Registers the default prompts.
|
67
|
-
*/
|
68
|
-
restoreDefaultPrompts(): void;
|
69
|
-
}
|
70
|
-
|
71
|
-
/**
|
72
|
-
* Represents a list-based question.
|
73
|
-
*
|
74
|
-
* @template T
|
75
|
-
* The type of the answers.
|
76
|
-
*
|
77
|
-
* @template TChoiceMap
|
78
|
-
* The valid choices for the question.
|
79
|
-
*/
|
80
|
-
interface ListQuestionOptionsBase<T extends inquirer.Answers, TChoiceMap extends inquirer.Answers> extends inquirer.Question<T> {
|
81
|
-
/**
|
82
|
-
* The choices of the prompt.
|
83
|
-
*/
|
84
|
-
choices?: inquirer.AsyncDynamicQuestionProperty<ReadonlyArray<inquirer.DistinctChoice<TChoiceMap>>, T> | undefined;
|
85
|
-
|
86
|
-
/**
|
87
|
-
* The number of elements to show on each page.
|
88
|
-
*/
|
89
|
-
pageSize?: number | undefined;
|
90
|
-
}
|
91
|
-
|
92
|
-
/**
|
93
|
-
* Provides components for the module.
|
94
|
-
*/
|
95
|
-
declare namespace inquirer {
|
96
|
-
/**
|
97
|
-
* Represents either a key of `T` or a `string`.
|
98
|
-
*
|
99
|
-
* @template T
|
100
|
-
* The type of the keys to suggest.
|
101
|
-
*/
|
102
|
-
type KeyUnion<T> = LiteralUnion<Extract<keyof T, string>>;
|
103
|
-
|
104
|
-
/**
|
105
|
-
* Converts the specified union-type `U` to an intersection-type.
|
106
|
-
*
|
107
|
-
* @template U
|
108
|
-
* The union to convert to an intersection.
|
109
|
-
*/
|
110
|
-
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
111
|
-
|
112
|
-
/**
|
113
|
-
* Provides an input and an output-stream.
|
114
|
-
*/
|
115
|
-
interface StreamOptions {
|
116
|
-
/**
|
117
|
-
* A stream to read the input from.
|
118
|
-
*/
|
119
|
-
input?: NodeJS.ReadStream | undefined;
|
120
|
-
|
121
|
-
/**
|
122
|
-
* A stream to write the output to.
|
123
|
-
*/
|
124
|
-
output?: NodeJS.WriteStream | undefined;
|
125
|
-
}
|
126
|
-
|
127
|
-
/**
|
128
|
-
* Provides the functionality to prompt questions to the user.
|
129
|
-
*/
|
130
|
-
interface PromptModule extends PromptModuleBase {
|
131
|
-
/**
|
132
|
-
* The prompts of the prompt-module.
|
133
|
-
*/
|
134
|
-
prompts: prompts.PromptCollection;
|
135
|
-
|
136
|
-
/**
|
137
|
-
* Prompts the questions to the user.
|
138
|
-
*/
|
139
|
-
<T extends Answers = Answers>(questions: QuestionCollection<T>, initialAnswers?: Partial<T>): Promise<T> & { ui: PromptUI<T> };
|
140
|
-
|
141
|
-
/**
|
142
|
-
* Registers a new prompt-type.
|
143
|
-
*
|
144
|
-
* @param name
|
145
|
-
* The name of the prompt.
|
146
|
-
*
|
147
|
-
* @param prompt
|
148
|
-
* The constructor of the prompt.
|
149
|
-
*/
|
150
|
-
registerPrompt(name: string, prompt: prompts.PromptConstructor): this;
|
151
|
-
}
|
152
|
-
|
153
|
-
interface Inquirer extends PromptModuleBase {
|
154
|
-
/**
|
155
|
-
* Registers a new prompt-type.
|
156
|
-
*
|
157
|
-
* @param name
|
158
|
-
* The name of the prompt.
|
159
|
-
*
|
160
|
-
* @param prompt
|
161
|
-
* The constructor of the prompt.
|
162
|
-
*/
|
163
|
-
registerPrompt(name: string, prompt: prompts.PromptConstructor): void;
|
164
|
-
|
165
|
-
/**
|
166
|
-
* Creates a prompt-module.
|
167
|
-
*
|
168
|
-
* @param opt
|
169
|
-
* The streams for the prompt-module.
|
170
|
-
*
|
171
|
-
* @returns
|
172
|
-
* The new prompt-module.
|
173
|
-
*/
|
174
|
-
createPromptModule(opt?: StreamOptions): PromptModule;
|
175
|
-
|
176
|
-
/**
|
177
|
-
* The default prompt-module.
|
178
|
-
*/
|
179
|
-
prompt: PromptModule;
|
180
|
-
|
181
|
-
/**
|
182
|
-
* The prompts of the default prompt-module.
|
183
|
-
*
|
184
|
-
* @deprecated
|
185
|
-
*/
|
186
|
-
prompts: {};
|
187
|
-
|
188
|
-
/**
|
189
|
-
* Represents a choice-item separator.
|
190
|
-
*/
|
191
|
-
Separator: typeof Separator;
|
192
|
-
|
193
|
-
/**
|
194
|
-
* Provides ui-components.
|
195
|
-
*/
|
196
|
-
ui: {
|
197
|
-
/**
|
198
|
-
* Represents the bottom-bar UI.
|
199
|
-
*/
|
200
|
-
BottomBar: typeof BottomBar;
|
201
|
-
|
202
|
-
/**
|
203
|
-
* Represents the prompt ui.
|
204
|
-
*/
|
205
|
-
Prompt: typeof PromptUI;
|
206
|
-
};
|
207
|
-
}
|
208
|
-
|
209
|
-
/**
|
210
|
-
* A set of answers.
|
211
|
-
*/
|
212
|
-
interface Answers extends Record<string, any> {}
|
213
|
-
|
214
|
-
/**
|
215
|
-
* Provides the functionality to validate answers.
|
216
|
-
*
|
217
|
-
* @template T
|
218
|
-
* The type of the answers.
|
219
|
-
*/
|
220
|
-
type Validator<T extends Answers = Answers> = Question<T>['validate'];
|
221
|
-
|
222
|
-
/**
|
223
|
-
* Provides the functionality to transform an answer.
|
224
|
-
*
|
225
|
-
* @template T
|
226
|
-
* The type of the answers.
|
227
|
-
*/
|
228
|
-
type Transformer<T extends Answers = Answers> = InputQuestionOptions<T>['transformer'];
|
229
|
-
|
230
|
-
/**
|
231
|
-
* Represents a dynamic property for a question.
|
232
|
-
*
|
233
|
-
* @template T
|
234
|
-
* The type of the property.
|
235
|
-
*
|
236
|
-
* @template TAnswers
|
237
|
-
* The type of the answers.
|
238
|
-
*/
|
239
|
-
type DynamicQuestionProperty<T, TAnswers extends Answers = Answers> = T | ((answers: TAnswers) => T);
|
240
|
-
|
241
|
-
/**
|
242
|
-
* Represents a dynamic property for a question which can be fetched asynchronously.
|
243
|
-
*
|
244
|
-
* @template T
|
245
|
-
* The type of the property.
|
246
|
-
*
|
247
|
-
* @template TAnswers
|
248
|
-
* The type of the answers.
|
249
|
-
*/
|
250
|
-
type AsyncDynamicQuestionProperty<T, TAnswers extends Answers = Answers> = DynamicQuestionProperty<
|
251
|
-
T | Promise<T>,
|
252
|
-
TAnswers
|
253
|
-
>;
|
254
|
-
|
255
|
-
/**
|
256
|
-
* Provides options for a question.
|
257
|
-
*
|
258
|
-
* @template T
|
259
|
-
* The type of the answers.
|
260
|
-
*/
|
261
|
-
interface Question<T extends Answers = Answers> {
|
262
|
-
/**
|
263
|
-
* The type of the question.
|
264
|
-
*/
|
265
|
-
type?: string | undefined;
|
266
|
-
|
267
|
-
/**
|
268
|
-
* The key to save the answer to the answers-hash.
|
269
|
-
*/
|
270
|
-
name?: KeyUnion<T> | undefined;
|
271
|
-
|
272
|
-
/**
|
273
|
-
* The message to show to the user.
|
274
|
-
*/
|
275
|
-
message?: AsyncDynamicQuestionProperty<string, T> | undefined;
|
276
|
-
|
277
|
-
/**
|
278
|
-
* The default value of the question.
|
279
|
-
*/
|
280
|
-
default?: AsyncDynamicQuestionProperty<any, T> | undefined;
|
281
|
-
|
282
|
-
/**
|
283
|
-
* The prefix of the `message`.
|
284
|
-
*/
|
285
|
-
prefix?: string | undefined;
|
286
|
-
|
287
|
-
/**
|
288
|
-
* The suffix of the `message`.
|
289
|
-
*/
|
290
|
-
suffix?: string | undefined;
|
291
|
-
|
292
|
-
/**
|
293
|
-
* Post-processes the answer.
|
294
|
-
*
|
295
|
-
* @param input
|
296
|
-
* The answer provided by the user.
|
297
|
-
*
|
298
|
-
* @param answers
|
299
|
-
* The answers provided by the user.
|
300
|
-
*/
|
301
|
-
filter?(input: any, answers: T): any;
|
302
|
-
|
303
|
-
/**
|
304
|
-
* A value indicating whether the question should be prompted.
|
305
|
-
*/
|
306
|
-
when?: AsyncDynamicQuestionProperty<boolean, T> | undefined;
|
307
|
-
|
308
|
-
/**
|
309
|
-
* Validates the integrity of the answer.
|
310
|
-
*
|
311
|
-
* @param input
|
312
|
-
* The answer provided by the user.
|
313
|
-
*
|
314
|
-
* @param answers
|
315
|
-
* The answers provided by the user.
|
316
|
-
*
|
317
|
-
* @returns
|
318
|
-
* Either a value indicating whether the answer is valid or a `string` which describes the error.
|
319
|
-
*/
|
320
|
-
validate?(input: any, answers?: T): boolean | string | Promise<boolean | string>;
|
321
|
-
|
322
|
-
/**
|
323
|
-
* Force to prompt the question if the answer already exists.
|
324
|
-
*/
|
325
|
-
askAnswered?: boolean;
|
326
|
-
}
|
327
|
-
|
328
|
-
/**
|
329
|
-
* Represents the possible answers of each question in the prompt
|
330
|
-
*/
|
331
|
-
type QuestionAnswer<T extends Answers = Answers> = {
|
332
|
-
[K in keyof T]: {
|
333
|
-
name: K;
|
334
|
-
answer: T[K]
|
335
|
-
}
|
336
|
-
}[keyof T];
|
337
|
-
|
338
|
-
/**
|
339
|
-
* Represents a choice-item.
|
340
|
-
*/
|
341
|
-
interface ChoiceBase {
|
342
|
-
/**
|
343
|
-
* The type of the choice.
|
344
|
-
*/
|
345
|
-
type?: string | undefined;
|
346
|
-
}
|
347
|
-
|
348
|
-
/**
|
349
|
-
* Provides options for a choice.
|
350
|
-
*/
|
351
|
-
interface ChoiceOptions extends ChoiceBase {
|
352
|
-
/**
|
353
|
-
* @inheritdoc
|
354
|
-
*/
|
355
|
-
type?: 'choice' | undefined;
|
356
|
-
|
357
|
-
/**
|
358
|
-
* The name of the choice to show to the user.
|
359
|
-
*/
|
360
|
-
name?: string | undefined;
|
361
|
-
|
362
|
-
/**
|
363
|
-
* The value of the choice.
|
364
|
-
*/
|
365
|
-
value?: any;
|
366
|
-
|
367
|
-
/**
|
368
|
-
* The short form of the name of the choice.
|
369
|
-
*/
|
370
|
-
short?: string | undefined;
|
371
|
-
|
372
|
-
/**
|
373
|
-
* The extra properties of the choice.
|
374
|
-
*/
|
375
|
-
extra?: any;
|
376
|
-
}
|
377
|
-
|
378
|
-
/**
|
379
|
-
* Provides options for a choice of the `ListPrompt`.
|
380
|
-
*
|
381
|
-
* @template T
|
382
|
-
* The type of the answers.
|
383
|
-
*/
|
384
|
-
interface ListChoiceOptions<T extends Answers = Answers> extends ChoiceOptions {
|
385
|
-
/**
|
386
|
-
* A value indicating whether the choice is disabled.
|
387
|
-
*/
|
388
|
-
disabled?: DynamicQuestionProperty<boolean | string, T> | undefined;
|
389
|
-
}
|
390
|
-
|
391
|
-
/**
|
392
|
-
* Provides options for a choice of the `CheckboxPrompt`.
|
393
|
-
*
|
394
|
-
* @template T
|
395
|
-
* The type of the answers.
|
396
|
-
*/
|
397
|
-
interface CheckboxChoiceOptions<T extends Answers = Answers> extends ListChoiceOptions<T> {
|
398
|
-
/**
|
399
|
-
* A value indicating whether the choice should be initially checked.
|
400
|
-
*/
|
401
|
-
checked?: boolean | undefined;
|
402
|
-
}
|
403
|
-
|
404
|
-
/**
|
405
|
-
* Provides options for a choice of the `ExpandPrompt`.
|
406
|
-
*/
|
407
|
-
interface ExpandChoiceOptions extends ChoiceOptions {
|
408
|
-
/**
|
409
|
-
* The key to press for selecting the choice.
|
410
|
-
*/
|
411
|
-
key?: string | undefined;
|
412
|
-
}
|
413
|
-
|
414
|
-
/**
|
415
|
-
* Represents a separator.
|
416
|
-
*/
|
417
|
-
interface SeparatorOptions extends ChoiceBase {
|
418
|
-
/**
|
419
|
-
* Gets the type of the choice.
|
420
|
-
*/
|
421
|
-
type: 'separator';
|
422
|
-
|
423
|
-
/**
|
424
|
-
* Gets or sets the text of the separator.
|
425
|
-
*/
|
426
|
-
line?: string | undefined;
|
427
|
-
}
|
428
|
-
|
429
|
-
/**
|
430
|
-
* Provides all valid choice-types for any kind of question.
|
431
|
-
*
|
432
|
-
* @template T
|
433
|
-
* The type of the answers.
|
434
|
-
*/
|
435
|
-
interface BaseChoiceMap<T extends Answers = Answers> {
|
436
|
-
Choice: Choice<T>;
|
437
|
-
ChoiceOptions: ChoiceOptions;
|
438
|
-
SeparatorOptions: SeparatorOptions;
|
439
|
-
Separator: Separator;
|
440
|
-
}
|
441
|
-
|
442
|
-
/**
|
443
|
-
* Provides all valid choice-types for the `ListQuestion`.
|
444
|
-
*
|
445
|
-
* @template T
|
446
|
-
* The type of the answers.
|
447
|
-
*/
|
448
|
-
interface ListChoiceMap<T extends Answers = Answers> extends BaseChoiceMap<T> {
|
449
|
-
ListChoiceOptions: ListChoiceOptions<T>;
|
450
|
-
}
|
451
|
-
|
452
|
-
/**
|
453
|
-
* Provides all valid choice-types for the `CheckboxQuestion`.
|
454
|
-
*
|
455
|
-
* @template T
|
456
|
-
* The type of the answers.
|
457
|
-
*/
|
458
|
-
interface CheckboxChoiceMap<T extends Answers = Answers> extends BaseChoiceMap<T> {
|
459
|
-
CheckboxChoiceOptions: CheckboxChoiceOptions<T>;
|
460
|
-
}
|
461
|
-
|
462
|
-
/**
|
463
|
-
* Provides all valid choice-types for the `ExpandQuestion`.
|
464
|
-
*
|
465
|
-
* @template T
|
466
|
-
* The type of the answers.
|
467
|
-
*/
|
468
|
-
interface ExpandChoiceMap<T extends Answers = Answers> extends BaseChoiceMap<T> {
|
469
|
-
ExpandChoiceOptions: ExpandChoiceOptions;
|
470
|
-
}
|
471
|
-
|
472
|
-
/**
|
473
|
-
* Provides all valid choice-types.
|
474
|
-
*
|
475
|
-
* @template T
|
476
|
-
* The type of the answers.
|
477
|
-
*/
|
478
|
-
interface AllChoiceMap<T extends Answers = Answers> {
|
479
|
-
BaseChoiceMap: BaseChoiceMap<T>[keyof BaseChoiceMap<T>];
|
480
|
-
ListChoiceMap: ListChoiceMap<T>[keyof ListChoiceMap<T>];
|
481
|
-
CheckboxChoiceMap: CheckboxChoiceMap<T>[keyof CheckboxChoiceMap<T>];
|
482
|
-
ExpandChoiceMap: ExpandChoiceMap<T>[keyof ExpandChoiceMap<T>];
|
483
|
-
}
|
484
|
-
|
485
|
-
/**
|
486
|
-
* Provides valid choices for the question of the `TChoiceMap`.
|
487
|
-
*
|
488
|
-
* @template TAnswers
|
489
|
-
* The type of the answers.
|
490
|
-
*
|
491
|
-
* @template TChoiceMap
|
492
|
-
* The choice-types to provide.
|
493
|
-
*/
|
494
|
-
type DistinctChoice<TAnswers extends Answers = Answers, TChoiceMap = AllChoiceMap<TAnswers>> =
|
495
|
-
| string
|
496
|
-
| TChoiceMap[keyof TChoiceMap];
|
497
|
-
|
498
|
-
/**
|
499
|
-
* Represents a set of choices.
|
500
|
-
*
|
501
|
-
* @template T
|
502
|
-
* The type of the answers.
|
503
|
-
*/
|
504
|
-
type ChoiceCollection<T extends Answers = Answers> = Array<DistinctChoice<AllChoiceMap<T>>>;
|
505
|
-
|
506
|
-
/**
|
507
|
-
* Provides options for a question for the `InputPrompt`.
|
508
|
-
*
|
509
|
-
* @template T
|
510
|
-
* The type of the answers.
|
511
|
-
*/
|
512
|
-
interface InputQuestionOptions<T extends Answers = Answers> extends Question<T> {
|
513
|
-
/**
|
514
|
-
* Transforms the value to display to the user.
|
515
|
-
*
|
516
|
-
* @param input
|
517
|
-
* The input provided by the user.
|
518
|
-
*
|
519
|
-
* @param answers
|
520
|
-
* The answers provided by the users.
|
521
|
-
*
|
522
|
-
* @param flags
|
523
|
-
* Additional information about the value.
|
524
|
-
*
|
525
|
-
* @returns
|
526
|
-
* The value to display to the user.
|
527
|
-
*/
|
528
|
-
transformer?(input: any, answers: T, flags: { isFinal?: boolean | undefined }): string | Promise<string>;
|
529
|
-
}
|
530
|
-
|
531
|
-
/**
|
532
|
-
* Provides options for a question for the `InputPrompt`.
|
533
|
-
*
|
534
|
-
* @template T
|
535
|
-
* The type of the answers.
|
536
|
-
*/
|
537
|
-
interface InputQuestion<T extends Answers = Answers> extends InputQuestionOptions<T> {
|
538
|
-
/**
|
539
|
-
* @inheritdoc
|
540
|
-
*/
|
541
|
-
type?: 'input' | undefined;
|
542
|
-
}
|
543
|
-
|
544
|
-
/**
|
545
|
-
* Provides options for a question for the `NumberPrompt`.
|
546
|
-
*
|
547
|
-
* @template T
|
548
|
-
* The type of the answers.
|
549
|
-
*/
|
550
|
-
interface NumberQuestionOptions<T extends Answers = Answers> extends InputQuestionOptions<T> {}
|
551
|
-
|
552
|
-
/**
|
553
|
-
* Provides options for a question for the `NumberPrompt`.
|
554
|
-
*
|
555
|
-
* @template T
|
556
|
-
* The type of the answers.
|
557
|
-
*/
|
558
|
-
interface NumberQuestion<T extends Answers = Answers> extends NumberQuestionOptions<T> {
|
559
|
-
/**
|
560
|
-
* @inheritdoc
|
561
|
-
*/
|
562
|
-
type: 'number';
|
563
|
-
}
|
564
|
-
|
565
|
-
/**
|
566
|
-
* Provides options for a question for the `PasswordPrompt`.
|
567
|
-
*
|
568
|
-
* @template T
|
569
|
-
* The type of the answers.
|
570
|
-
*/
|
571
|
-
interface PasswordQuestionOptions<T extends Answers = Answers> extends InputQuestionOptions<T> {
|
572
|
-
/**
|
573
|
-
* The character to replace the user-input.
|
574
|
-
*/
|
575
|
-
mask?: string | undefined;
|
576
|
-
}
|
577
|
-
|
578
|
-
/**
|
579
|
-
* Provides options for a question for the `PasswordPrompt`.
|
580
|
-
*
|
581
|
-
* @template T
|
582
|
-
* The type of the answers.
|
583
|
-
*/
|
584
|
-
interface PasswordQuestion<T extends Answers = Answers> extends PasswordQuestionOptions<T> {
|
585
|
-
/**
|
586
|
-
* @inheritdoc
|
587
|
-
*/
|
588
|
-
type: 'password';
|
589
|
-
}
|
590
|
-
|
591
|
-
/**
|
592
|
-
* Represents a list-based question that can loop.
|
593
|
-
*
|
594
|
-
* @template T
|
595
|
-
* The type of the answers.
|
596
|
-
*
|
597
|
-
* @template TChoiceMap
|
598
|
-
* The valid choices for the question.
|
599
|
-
*/
|
600
|
-
interface LoopableListQuestionOptionsBase<T extends Answers, TChoiceMap extends Answers> extends ListQuestionOptionsBase<T, TChoiceMap> {
|
601
|
-
/**
|
602
|
-
* A value indicating whether choices in a list should be looped.
|
603
|
-
*/
|
604
|
-
loop?: boolean | undefined;
|
605
|
-
}
|
606
|
-
|
607
|
-
/**
|
608
|
-
* Provides options for a question for the `ListPrompt`.
|
609
|
-
*
|
610
|
-
* @template T
|
611
|
-
* The type of the answers.
|
612
|
-
*/
|
613
|
-
interface ListQuestionOptions<T extends Answers = Answers>
|
614
|
-
extends LoopableListQuestionOptionsBase<T, ListChoiceMap<T>> {}
|
615
|
-
|
616
|
-
/**
|
617
|
-
* Provides options for a question for the `ListPrompt`.
|
618
|
-
*
|
619
|
-
* @template T
|
620
|
-
* The type of the answers.
|
621
|
-
*/
|
622
|
-
interface ListQuestion<T extends Answers = Answers> extends ListQuestionOptions<T> {
|
623
|
-
/**
|
624
|
-
* @inheritdoc
|
625
|
-
*/
|
626
|
-
type: 'list';
|
627
|
-
}
|
628
|
-
|
629
|
-
/**
|
630
|
-
* Provides options for a question for the `RawListPrompt`.
|
631
|
-
*
|
632
|
-
* @template T
|
633
|
-
* The type of the answers.
|
634
|
-
*/
|
635
|
-
interface RawListQuestionOptions<T extends Answers = Answers> extends ListQuestionOptions<T> {}
|
636
|
-
|
637
|
-
/**
|
638
|
-
* Provides options for a question for the `RawListPrompt`.
|
639
|
-
*
|
640
|
-
* @template T
|
641
|
-
* The type of the answers.
|
642
|
-
*/
|
643
|
-
interface RawListQuestion<T extends Answers = Answers> extends RawListQuestionOptions<T> {
|
644
|
-
/**
|
645
|
-
* @inheritdoc
|
646
|
-
*/
|
647
|
-
type: 'rawlist';
|
648
|
-
}
|
649
|
-
|
650
|
-
/**
|
651
|
-
* Provides options for a question for the `ExpandPrompt`.
|
652
|
-
*
|
653
|
-
* @template T
|
654
|
-
* The type of the answers.
|
655
|
-
*/
|
656
|
-
interface ExpandQuestionOptions<T extends Answers = Answers>
|
657
|
-
extends ListQuestionOptionsBase<T, ExpandChoiceMap<T>> {}
|
658
|
-
|
659
|
-
/**
|
660
|
-
* Provides options for a question for the `ExpandPrompt`.
|
661
|
-
*
|
662
|
-
* @template T
|
663
|
-
* The type of the answers.
|
664
|
-
*/
|
665
|
-
interface ExpandQuestion<T extends Answers = Answers> extends ExpandQuestionOptions<T> {
|
666
|
-
/**
|
667
|
-
* @inheritdoc
|
668
|
-
*/
|
669
|
-
type: 'expand';
|
670
|
-
}
|
671
|
-
|
672
|
-
/**
|
673
|
-
* Provides options for a question for the `CheckboxPrompt`.
|
674
|
-
*
|
675
|
-
* @template T
|
676
|
-
* The type of the answers.
|
677
|
-
*/
|
678
|
-
interface CheckboxQuestionOptions<T extends Answers = Answers>
|
679
|
-
extends LoopableListQuestionOptionsBase<T, CheckboxChoiceMap<T>> {}
|
680
|
-
|
681
|
-
/**
|
682
|
-
* Provides options for a question for the `CheckboxPrompt`.
|
683
|
-
*
|
684
|
-
* @template T
|
685
|
-
* The type of the answers.
|
686
|
-
*/
|
687
|
-
interface CheckboxQuestion<T extends Answers = Answers> extends CheckboxQuestionOptions<T> {
|
688
|
-
/**
|
689
|
-
* @inheritdoc
|
690
|
-
*/
|
691
|
-
type: 'checkbox';
|
692
|
-
}
|
693
|
-
|
694
|
-
/**
|
695
|
-
* Provides options for a question for the `ConfirmPrompt`.
|
696
|
-
*
|
697
|
-
* @template T
|
698
|
-
* The type of the answers.
|
699
|
-
*/
|
700
|
-
interface ConfirmQuestionOptions<T extends Answers = Answers> extends Question<T> {}
|
701
|
-
|
702
|
-
/**
|
703
|
-
* Provides options for a question for the `ConfirmPrompt`.
|
704
|
-
*
|
705
|
-
* @template T
|
706
|
-
* The type of the answers.
|
707
|
-
*/
|
708
|
-
interface ConfirmQuestion<T extends Answers = Answers> extends ConfirmQuestionOptions<T> {
|
709
|
-
/**
|
710
|
-
* @inheritdoc
|
711
|
-
*/
|
712
|
-
type: 'confirm';
|
713
|
-
}
|
714
|
-
|
715
|
-
/**
|
716
|
-
* Provides options for a question for the `EditorPrompt`.
|
717
|
-
*
|
718
|
-
* @template T
|
719
|
-
* The type of the answers.
|
720
|
-
*/
|
721
|
-
interface EditorQuestionOptions<T extends Answers = Answers> extends Question<T> {}
|
722
|
-
|
723
|
-
/**
|
724
|
-
* Provides options for a question for the `EditorPrompt`.
|
725
|
-
*
|
726
|
-
* @template T
|
727
|
-
* The type of the answers.
|
728
|
-
*/
|
729
|
-
interface EditorQuestion<T extends Answers = Answers> extends EditorQuestionOptions<T> {
|
730
|
-
/**
|
731
|
-
* @inheritdoc
|
732
|
-
*/
|
733
|
-
type: 'editor';
|
734
|
-
}
|
735
|
-
|
736
|
-
/**
|
737
|
-
* Provides the available question-types.
|
738
|
-
*
|
739
|
-
* @template T
|
740
|
-
* The type of the answers.
|
741
|
-
*/
|
742
|
-
interface QuestionMap<T extends Answers = Answers> {
|
743
|
-
/**
|
744
|
-
* The `InputQuestion` type.
|
745
|
-
*/
|
746
|
-
input: InputQuestion<T>;
|
747
|
-
|
748
|
-
/**
|
749
|
-
* The `NumberQuestion` type.
|
750
|
-
*/
|
751
|
-
number: NumberQuestion<T>;
|
752
|
-
|
753
|
-
/**
|
754
|
-
* The `PasswordQuestion` type.
|
755
|
-
*/
|
756
|
-
password: PasswordQuestion<T>;
|
757
|
-
|
758
|
-
/**
|
759
|
-
* The `ListQuestion` type.
|
760
|
-
*/
|
761
|
-
list: ListQuestion<T>;
|
762
|
-
|
763
|
-
/**
|
764
|
-
* The `RawListQuestion` type.
|
765
|
-
*/
|
766
|
-
rawList: RawListQuestion<T>;
|
767
|
-
|
768
|
-
/**
|
769
|
-
* The `ExpandQuestion` type.
|
770
|
-
*/
|
771
|
-
expand: ExpandQuestion<T>;
|
772
|
-
|
773
|
-
/**
|
774
|
-
* The `CheckboxQuestion` type.
|
775
|
-
*/
|
776
|
-
checkbox: CheckboxQuestion<T>;
|
777
|
-
|
778
|
-
/**
|
779
|
-
* The `ConfirmQuestion` type.
|
780
|
-
*/
|
781
|
-
confirm: ConfirmQuestion<T>;
|
782
|
-
|
783
|
-
/**
|
784
|
-
* The `EditorQuestion` type.
|
785
|
-
*/
|
786
|
-
editor: EditorQuestion<T>;
|
787
|
-
}
|
788
|
-
|
789
|
-
/**
|
790
|
-
* Represents one of the available questions.
|
791
|
-
*
|
792
|
-
* @template T
|
793
|
-
* The type of the answers.
|
794
|
-
*/
|
795
|
-
type DistinctQuestion<T extends Answers = Answers> = QuestionMap<T>[keyof QuestionMap<T>];
|
796
|
-
|
797
|
-
/**
|
798
|
-
* Indicates the type of a question
|
799
|
-
*/
|
800
|
-
type QuestionTypeName = DistinctQuestion['type'];
|
801
|
-
|
802
|
-
/**
|
803
|
-
* Represents a collection of questions.
|
804
|
-
*
|
805
|
-
* @template T
|
806
|
-
* The type of the answers.
|
807
|
-
*/
|
808
|
-
type QuestionCollection<T extends Answers = Answers> =
|
809
|
-
| DistinctQuestion<T>
|
810
|
-
| ReadonlyArray<DistinctQuestion<T>>
|
811
|
-
| Observable<DistinctQuestion<T>>;
|
812
|
-
|
813
|
-
/**
|
814
|
-
* Provides components for the prompts.
|
815
|
-
*/
|
816
|
-
namespace prompts {
|
817
|
-
/**
|
818
|
-
* Provides a base for and prompt-options.
|
819
|
-
*
|
820
|
-
* @template T
|
821
|
-
* The type of the answers.
|
822
|
-
*/
|
823
|
-
type PromptOptions<T extends Question = Question> = T & {
|
824
|
-
/**
|
825
|
-
* The choices of the prompt.
|
826
|
-
*/
|
827
|
-
choices: Choices;
|
828
|
-
};
|
829
|
-
|
830
|
-
/**
|
831
|
-
* Represents the state of a prompt.
|
832
|
-
*/
|
833
|
-
type PromptState = LiteralUnion<'pending' | 'idle' | 'loading' | 'answered' | 'done'>;
|
834
|
-
|
835
|
-
/**
|
836
|
-
* Represents a prompt.
|
837
|
-
*/
|
838
|
-
interface PromptBase {
|
839
|
-
/**
|
840
|
-
* Gets or sets a string which represents the state of the prompt.
|
841
|
-
*/
|
842
|
-
status: PromptState;
|
843
|
-
|
844
|
-
/**
|
845
|
-
* Runs the prompt.
|
846
|
-
*
|
847
|
-
* @returns
|
848
|
-
* The result of the prompt.
|
849
|
-
*/
|
850
|
-
run(): Promise<any>;
|
851
|
-
}
|
852
|
-
|
853
|
-
/**
|
854
|
-
* Provides the functionality to initialize new prompts.
|
855
|
-
*/
|
856
|
-
interface PromptConstructor {
|
857
|
-
/**
|
858
|
-
* Initializes a new instance of a prompt.
|
859
|
-
*
|
860
|
-
* @param question
|
861
|
-
* The question to prompt.
|
862
|
-
*
|
863
|
-
* @param readLine
|
864
|
-
* An object for reading from the command-line.
|
865
|
-
*
|
866
|
-
* @param answers
|
867
|
-
* The answers provided by the user.
|
868
|
-
*/
|
869
|
-
new (question: any, readLine: ReadlineInterface, answers: Answers): PromptBase;
|
870
|
-
}
|
871
|
-
|
872
|
-
/**
|
873
|
-
* Provides a set of prompt-constructors.
|
874
|
-
*/
|
875
|
-
type PromptCollection = Record<string, PromptConstructor>;
|
876
|
-
|
877
|
-
/**
|
878
|
-
* Provides data about the state of a prompt.
|
879
|
-
*/
|
880
|
-
interface PromptStateData {
|
881
|
-
/**
|
882
|
-
* Either a string which describes the error of the prompt or a boolean indicating whether the prompt-value is valid.
|
883
|
-
*/
|
884
|
-
isValid: string | boolean;
|
885
|
-
}
|
886
|
-
|
887
|
-
/**
|
888
|
-
* Provides data about the successful state of a prompt.
|
889
|
-
*
|
890
|
-
* @param T
|
891
|
-
* The type of the answer.
|
892
|
-
*/
|
893
|
-
interface SuccessfulPromptStateData<T = any> extends PromptStateData {
|
894
|
-
/**
|
895
|
-
* @inheritdoc
|
896
|
-
*/
|
897
|
-
isValid: true;
|
898
|
-
|
899
|
-
/**
|
900
|
-
* The value of the prompt.
|
901
|
-
*/
|
902
|
-
value: T;
|
903
|
-
}
|
904
|
-
|
905
|
-
/**
|
906
|
-
* Provides data about the failed state of a prompt.
|
907
|
-
*/
|
908
|
-
interface FailedPromptStateData extends PromptStateData {
|
909
|
-
/**
|
910
|
-
* @inheritdoc
|
911
|
-
*/
|
912
|
-
isValid: false | string;
|
913
|
-
}
|
914
|
-
|
915
|
-
/**
|
916
|
-
* Provides pipes for handling events of a prompt.
|
917
|
-
*
|
918
|
-
* @param T
|
919
|
-
* The type of the answer.
|
920
|
-
*/
|
921
|
-
interface PromptEventPipes<T = any> {
|
922
|
-
/**
|
923
|
-
* A pypeline for succesful inputs.
|
924
|
-
*/
|
925
|
-
success: Observable<SuccessfulPromptStateData<T>>;
|
926
|
-
|
927
|
-
/**
|
928
|
-
* An object representing an error.
|
929
|
-
*/
|
930
|
-
error: Observable<FailedPromptStateData>;
|
931
|
-
}
|
932
|
-
}
|
933
|
-
|
934
|
-
/**
|
935
|
-
* Provides components for the ui.
|
936
|
-
*/
|
937
|
-
namespace ui {
|
938
|
-
/**
|
939
|
-
* Provides options for the bottom-bar UI.
|
940
|
-
*/
|
941
|
-
interface BottomBarOptions extends StreamOptions {
|
942
|
-
/**
|
943
|
-
* The initial text to display.
|
944
|
-
*/
|
945
|
-
bottomBar?: string | undefined;
|
946
|
-
}
|
947
|
-
|
948
|
-
/**
|
949
|
-
* Represents a fetched answer.
|
950
|
-
*
|
951
|
-
* @template T
|
952
|
-
* The type of the answers.
|
953
|
-
*/
|
954
|
-
type FetchedQuestion<T extends Answers = Answers> = DistinctQuestion<T> & {
|
955
|
-
/**
|
956
|
-
* The type of the question.
|
957
|
-
*/
|
958
|
-
type: string;
|
959
|
-
|
960
|
-
/**
|
961
|
-
* The message to show to the user.
|
962
|
-
*/
|
963
|
-
message: string;
|
964
|
-
|
965
|
-
/**
|
966
|
-
* The default value of the question.
|
967
|
-
*/
|
968
|
-
default: any;
|
969
|
-
|
970
|
-
/**
|
971
|
-
* The choices of the question.
|
972
|
-
*/
|
973
|
-
choices: ChoiceCollection<T>;
|
974
|
-
};
|
975
|
-
|
976
|
-
/**
|
977
|
-
* Represents a fetched answer.
|
978
|
-
*/
|
979
|
-
interface FetchedAnswer {
|
980
|
-
/**
|
981
|
-
* The name of the answer.
|
982
|
-
*/
|
983
|
-
name: string;
|
984
|
-
|
985
|
-
/**
|
986
|
-
* The value of the answer.
|
987
|
-
*/
|
988
|
-
answer: any;
|
989
|
-
}
|
990
|
-
}
|
991
|
-
}
|
992
|
-
|
993
|
-
/**
|
994
|
-
* Provides the functionality to prompt questions.
|
995
|
-
*/
|
996
|
-
declare var inquirer: inquirer.Inquirer;
|
997
|
-
export = inquirer;
|