@nshiab/setup-data-project 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/helpers/createFolderStructure.d.ts.map +1 -1
- package/esm/helpers/createFolderStructure.js +1 -15
- package/esm/helpers/ensureAgents.d.ts.map +1 -1
- package/esm/helpers/ensureAgents.js +2 -8
- package/esm/helpers/ensureEnvFile.d.ts.map +1 -1
- package/esm/helpers/ensureEnvFile.js +1 -7
- package/esm/helpers/ensureGitignore.d.ts.map +1 -1
- package/esm/helpers/ensureGitignore.js +0 -6
- package/esm/helpers/ensureReadme.d.ts.map +1 -1
- package/esm/helpers/ensureReadme.js +1 -7
- package/esm/main.js +7 -17
- package/package.json +5 -2
- package/script/helpers/createFolderStructure.d.ts.map +1 -1
- package/script/helpers/createFolderStructure.js +1 -15
- package/script/helpers/ensureAgents.d.ts.map +1 -1
- package/script/helpers/ensureAgents.js +2 -8
- package/script/helpers/ensureEnvFile.d.ts.map +1 -1
- package/script/helpers/ensureEnvFile.js +1 -7
- package/script/helpers/ensureGitignore.d.ts.map +1 -1
- package/script/helpers/ensureGitignore.js +0 -6
- package/script/helpers/ensureReadme.d.ts.map +1 -1
- package/script/helpers/ensureReadme.js +1 -7
- package/script/main.js +7 -17
- package/npm/LICENSE +0 -21
- package/npm/README.md +0 -25
- package/npm/esm/_dnt.shims.d.ts +0 -8
- package/npm/esm/_dnt.shims.d.ts.map +0 -1
- package/npm/esm/_dnt.shims.js +0 -62
- package/npm/esm/_dnt_2.shims.d.ts +0 -6
- package/npm/esm/_dnt_2.shims.d.ts.map +0 -1
- package/npm/esm/_dnt_2.shims.js +0 -61
- package/npm/esm/helpers/createFolderStructure.d.ts +0 -2
- package/npm/esm/helpers/createFolderStructure.d.ts.map +0 -1
- package/npm/esm/helpers/createFolderStructure.js +0 -49
- package/npm/esm/helpers/ensureAgents.d.ts +0 -2
- package/npm/esm/helpers/ensureAgents.d.ts.map +0 -1
- package/npm/esm/helpers/ensureAgents.js +0 -92
- package/npm/esm/helpers/ensureEnvFile.d.ts +0 -2
- package/npm/esm/helpers/ensureEnvFile.d.ts.map +0 -1
- package/npm/esm/helpers/ensureEnvFile.js +0 -14
- package/npm/esm/helpers/ensureGitignore.d.ts +0 -2
- package/npm/esm/helpers/ensureGitignore.d.ts.map +0 -1
- package/npm/esm/helpers/ensureGitignore.js +0 -29
- package/npm/esm/helpers/ensureReadme.d.ts +0 -2
- package/npm/esm/helpers/ensureReadme.d.ts.map +0 -1
- package/npm/esm/helpers/ensureReadme.js +0 -37
- package/npm/esm/helpers/getInstalledPackages.d.ts +0 -2
- package/npm/esm/helpers/getInstalledPackages.d.ts.map +0 -1
- package/npm/esm/helpers/getInstalledPackages.js +0 -29
- package/npm/esm/helpers/getProjectTasks.d.ts +0 -5
- package/npm/esm/helpers/getProjectTasks.d.ts.map +0 -1
- package/npm/esm/helpers/getProjectTasks.js +0 -12
- package/npm/esm/helpers/getRuntime.d.ts +0 -5
- package/npm/esm/helpers/getRuntime.d.ts.map +0 -1
- package/npm/esm/helpers/getRuntime.js +0 -17
- package/npm/esm/helpers/gitignoreEntries.d.ts +0 -2
- package/npm/esm/helpers/gitignoreEntries.d.ts.map +0 -1
- package/npm/esm/helpers/gitignoreEntries.js +0 -9
- package/npm/esm/helpers/handleFileConflict.d.ts +0 -5
- package/npm/esm/helpers/handleFileConflict.d.ts.map +0 -1
- package/npm/esm/helpers/handleFileConflict.js +0 -51
- package/npm/esm/helpers/installPackagesAndFetchDocs.d.ts +0 -8
- package/npm/esm/helpers/installPackagesAndFetchDocs.d.ts.map +0 -1
- package/npm/esm/helpers/installPackagesAndFetchDocs.js +0 -61
- package/npm/esm/helpers/packageOptions.d.ts +0 -5
- package/npm/esm/helpers/packageOptions.d.ts.map +0 -1
- package/npm/esm/helpers/packageOptions.js +0 -5
- package/npm/esm/helpers/packageRegistry.d.ts +0 -7
- package/npm/esm/helpers/packageRegistry.d.ts.map +0 -1
- package/npm/esm/helpers/packageRegistry.js +0 -62
- package/npm/esm/helpers/updateProjectConfig.d.ts +0 -2
- package/npm/esm/helpers/updateProjectConfig.d.ts.map +0 -1
- package/npm/esm/helpers/updateProjectConfig.js +0 -36
- package/npm/esm/main.d.ts +0 -3
- package/npm/esm/main.d.ts.map +0 -1
- package/npm/esm/main.js +0 -93
- package/npm/esm/package.json +0 -3
- package/npm/node_modules/.package-lock.json +0 -123
- package/npm/node_modules/@clack/core/CHANGELOG.md +0 -348
- package/npm/node_modules/@clack/core/LICENSE +0 -9
- package/npm/node_modules/@clack/core/README.md +0 -22
- package/npm/node_modules/@clack/core/dist/index.d.mts +0 -363
- package/npm/node_modules/@clack/core/dist/index.mjs +0 -17
- package/npm/node_modules/@clack/core/dist/index.mjs.map +0 -1
- package/npm/node_modules/@clack/core/package.json +0 -63
- package/npm/node_modules/@clack/prompts/CHANGELOG.md +0 -591
- package/npm/node_modules/@clack/prompts/LICENSE +0 -9
- package/npm/node_modules/@clack/prompts/README.md +0 -375
- package/npm/node_modules/@clack/prompts/dist/index.d.mts +0 -396
- package/npm/node_modules/@clack/prompts/dist/index.mjs +0 -144
- package/npm/node_modules/@clack/prompts/dist/index.mjs.map +0 -1
- package/npm/node_modules/@clack/prompts/package.json +0 -68
- package/npm/node_modules/@deno/shim-deno/LICENSE +0 -20
- package/npm/node_modules/@deno/shim-deno/README.md +0 -30
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/Conn.js +0 -56
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/Listener.js +0 -92
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/consts.js +0 -4
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/errorMap.js +0 -44
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/fs_flags.js +0 -91
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/iterutil.js +0 -37
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/random_id.js +0 -8
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/streams.js +0 -122
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/test.d.ts +0 -1
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/test.js +0 -5
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/version.js +0 -5
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/classes/FsFile.js +0 -143
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/classes/PermissionStatus.js +0 -19
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/classes/Permissions.js +0 -26
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/classes.js +0 -10
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/enums/SeekMode.js +0 -9
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/enums.js +0 -5
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/addSignalListener.js +0 -18
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/chdir.js +0 -22
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/chmod.js +0 -29
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/chmodSync.js +0 -29
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/chown.js +0 -30
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/chownSync.js +0 -30
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/close.js +0 -29
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/connect.js +0 -37
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/connectTls.js +0 -31
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/consoleSize.js +0 -17
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/copy.js +0 -27
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/copyFile.js +0 -45
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/copyFileSync.js +0 -45
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/create.js +0 -9
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/createSync.js +0 -14
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/cwd.js +0 -5
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/execPath.js +0 -10
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/exit.js +0 -8
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fdatasync.js +0 -8
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fdatasyncSync.js +0 -6
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fstat.js +0 -44
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fstatSync.js +0 -19
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fsync.js +0 -10
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fsyncSync.js +0 -9
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/ftruncate.js +0 -8
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/ftruncateSync.js +0 -6
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/gid.js +0 -10
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/hostname.js +0 -32
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/inspect.js +0 -30
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/kill.js +0 -16
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/link.js +0 -29
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/linkSync.js +0 -29
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/listen.js +0 -51
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/listenTls.js +0 -49
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/loadavg.js +0 -32
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/lstat.js +0 -42
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/lstatSync.js +0 -42
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/makeTempDir.js +0 -11
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/makeTempDirSync.js +0 -11
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/makeTempFile.js +0 -14
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/makeTempFileSync.js +0 -14
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/memoryUsage.js +0 -5
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/mkdir.js +0 -22
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/mkdirSync.js +0 -45
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/open.js +0 -33
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/openSync.js +0 -31
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/osRelease.js +0 -9
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/osUptime.js +0 -9
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/read.js +0 -19
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readDir.js +0 -26
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readDirSync.js +0 -26
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readFile.js +0 -19
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readFileSync.js +0 -19
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readLink.js +0 -29
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readLinkSync.js +0 -29
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readSync.js +0 -34
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readTextFile.js +0 -18
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readTextFileSync.js +0 -41
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/realPath.js +0 -29
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/realPathSync.js +0 -29
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/remove.js +0 -22
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/removeSignalListener.js +0 -12
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/removeSync.js +0 -45
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/rename.js +0 -9
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/renameSync.js +0 -29
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/resolveDns.js +0 -41
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/run.js +0 -276
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/shutdown.js +0 -9
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/stat.js +0 -68
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/statSync.js +0 -42
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/symlink.js +0 -30
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/symlinkSync.js +0 -30
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/test.js +0 -5
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/truncate.js +0 -45
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/truncateSync.js +0 -45
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/uid.js +0 -10
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/watchFs.js +0 -27
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/write.js +0 -35
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/writeFile.js +0 -46
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/writeFileSync.js +0 -45
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/writeSync.js +0 -29
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/writeTextFile.js +0 -52
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/writeTextFileSync.js +0 -44
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions.js +0 -234
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/main.js +0 -21
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/types.js +0 -3
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/args.js +0 -5
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/build.js +0 -38
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/customInspect.js +0 -4
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/env.js +0 -47
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/errors.js +0 -63
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/mainModule.js +0 -8
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/metrics.js +0 -21
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/noColor.js +0 -5
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/permissions.js +0 -6
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/pid.js +0 -5
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/ppid.js +0 -5
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/resources.js +0 -12
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/std.js +0 -132
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/version.js +0 -10
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables.js +0 -53
- package/npm/node_modules/@deno/shim-deno/dist/deno/unstable/main.js +0 -62
- package/npm/node_modules/@deno/shim-deno/dist/deno.js +0 -17
- package/npm/node_modules/@deno/shim-deno/dist/index.d.ts +0 -4762
- package/npm/node_modules/@deno/shim-deno/dist/index.js +0 -27
- package/npm/node_modules/@deno/shim-deno/package.json +0 -50
- package/npm/node_modules/@deno/shim-deno-test/LICENSE +0 -20
- package/npm/node_modules/@deno/shim-deno-test/README.md +0 -28
- package/npm/node_modules/@deno/shim-deno-test/dist/definitions.d.ts +0 -3
- package/npm/node_modules/@deno/shim-deno-test/dist/definitions.js +0 -5
- package/npm/node_modules/@deno/shim-deno-test/dist/deno.types.gen.d.ts +0 -626
- package/npm/node_modules/@deno/shim-deno-test/dist/deno.types.gen.js +0 -2
- package/npm/node_modules/@deno/shim-deno-test/dist/index.d.ts +0 -3
- package/npm/node_modules/@deno/shim-deno-test/dist/index.js +0 -21
- package/npm/node_modules/@deno/shim-deno-test/dist/test.d.ts +0 -3
- package/npm/node_modules/@deno/shim-deno-test/dist/test.js +0 -87
- package/npm/node_modules/@deno/shim-deno-test/package.json +0 -34
- package/npm/node_modules/@types/node/LICENSE +0 -21
- package/npm/node_modules/@types/node/README.md +0 -15
- package/npm/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/npm/node_modules/@types/node/assert.d.ts +0 -1062
- package/npm/node_modules/@types/node/async_hooks.d.ts +0 -605
- package/npm/node_modules/@types/node/buffer.buffer.d.ts +0 -471
- package/npm/node_modules/@types/node/buffer.d.ts +0 -1936
- package/npm/node_modules/@types/node/child_process.d.ts +0 -1475
- package/npm/node_modules/@types/node/cluster.d.ts +0 -577
- package/npm/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
- package/npm/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/npm/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
- package/npm/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
- package/npm/node_modules/@types/node/console.d.ts +0 -452
- package/npm/node_modules/@types/node/constants.d.ts +0 -21
- package/npm/node_modules/@types/node/crypto.d.ts +0 -4590
- package/npm/node_modules/@types/node/dgram.d.ts +0 -597
- package/npm/node_modules/@types/node/diagnostics_channel.d.ts +0 -578
- package/npm/node_modules/@types/node/dns/promises.d.ts +0 -479
- package/npm/node_modules/@types/node/dns.d.ts +0 -871
- package/npm/node_modules/@types/node/domain.d.ts +0 -170
- package/npm/node_modules/@types/node/events.d.ts +0 -977
- package/npm/node_modules/@types/node/fs/promises.d.ts +0 -1270
- package/npm/node_modules/@types/node/fs.d.ts +0 -4375
- package/npm/node_modules/@types/node/globals.d.ts +0 -172
- package/npm/node_modules/@types/node/globals.typedarray.d.ts +0 -38
- package/npm/node_modules/@types/node/http.d.ts +0 -2049
- package/npm/node_modules/@types/node/http2.d.ts +0 -2631
- package/npm/node_modules/@types/node/https.d.ts +0 -578
- package/npm/node_modules/@types/node/index.d.ts +0 -93
- package/npm/node_modules/@types/node/inspector.generated.d.ts +0 -3966
- package/npm/node_modules/@types/node/module.d.ts +0 -539
- package/npm/node_modules/@types/node/net.d.ts +0 -1031
- package/npm/node_modules/@types/node/os.d.ts +0 -506
- package/npm/node_modules/@types/node/package.json +0 -140
- package/npm/node_modules/@types/node/path.d.ts +0 -200
- package/npm/node_modules/@types/node/perf_hooks.d.ts +0 -961
- package/npm/node_modules/@types/node/process.d.ts +0 -1961
- package/npm/node_modules/@types/node/punycode.d.ts +0 -117
- package/npm/node_modules/@types/node/querystring.d.ts +0 -152
- package/npm/node_modules/@types/node/readline/promises.d.ts +0 -162
- package/npm/node_modules/@types/node/readline.d.ts +0 -589
- package/npm/node_modules/@types/node/repl.d.ts +0 -430
- package/npm/node_modules/@types/node/sea.d.ts +0 -153
- package/npm/node_modules/@types/node/stream/consumers.d.ts +0 -38
- package/npm/node_modules/@types/node/stream/promises.d.ts +0 -90
- package/npm/node_modules/@types/node/stream/web.d.ts +0 -533
- package/npm/node_modules/@types/node/stream.d.ts +0 -1698
- package/npm/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/npm/node_modules/@types/node/test.d.ts +0 -1787
- package/npm/node_modules/@types/node/timers/promises.d.ts +0 -108
- package/npm/node_modules/@types/node/timers.d.ts +0 -286
- package/npm/node_modules/@types/node/tls.d.ts +0 -1259
- package/npm/node_modules/@types/node/trace_events.d.ts +0 -197
- package/npm/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -468
- package/npm/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -34
- package/npm/node_modules/@types/node/ts5.6/index.d.ts +0 -93
- package/npm/node_modules/@types/node/tty.d.ts +0 -208
- package/npm/node_modules/@types/node/url.d.ts +0 -964
- package/npm/node_modules/@types/node/util.d.ts +0 -2331
- package/npm/node_modules/@types/node/v8.d.ts +0 -809
- package/npm/node_modules/@types/node/vm.d.ts +0 -1001
- package/npm/node_modules/@types/node/wasi.d.ts +0 -181
- package/npm/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -34
- package/npm/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
- package/npm/node_modules/@types/node/web-globals/events.d.ts +0 -97
- package/npm/node_modules/@types/node/web-globals/fetch.d.ts +0 -55
- package/npm/node_modules/@types/node/worker_threads.d.ts +0 -715
- package/npm/node_modules/@types/node/zlib.d.ts +0 -598
- package/npm/node_modules/fast-string-truncated-width/dist/index.d.ts +0 -4
- package/npm/node_modules/fast-string-truncated-width/dist/index.js +0 -111
- package/npm/node_modules/fast-string-truncated-width/dist/types.d.ts +0 -19
- package/npm/node_modules/fast-string-truncated-width/dist/types.js +0 -2
- package/npm/node_modules/fast-string-truncated-width/dist/utils.d.ts +0 -4
- package/npm/node_modules/fast-string-truncated-width/dist/utils.js +0 -20
- package/npm/node_modules/fast-string-truncated-width/license +0 -21
- package/npm/node_modules/fast-string-truncated-width/package.json +0 -35
- package/npm/node_modules/fast-string-truncated-width/readme.md +0 -59
- package/npm/node_modules/fast-string-width/dist/index.d.ts +0 -4
- package/npm/node_modules/fast-string-width/dist/index.js +0 -14
- package/npm/node_modules/fast-string-width/license +0 -21
- package/npm/node_modules/fast-string-width/package.json +0 -34
- package/npm/node_modules/fast-string-width/readme.md +0 -42
- package/npm/node_modules/fast-wrap-ansi/LICENSE +0 -23
- package/npm/node_modules/fast-wrap-ansi/README.md +0 -26
- package/npm/node_modules/fast-wrap-ansi/lib/main.d.ts +0 -6
- package/npm/node_modules/fast-wrap-ansi/lib/main.js +0 -219
- package/npm/node_modules/fast-wrap-ansi/lib/main.js.map +0 -1
- package/npm/node_modules/fast-wrap-ansi/package.json +0 -51
- package/npm/node_modules/isexe/LICENSE.md +0 -55
- package/npm/node_modules/isexe/README.md +0 -80
- package/npm/node_modules/isexe/dist/commonjs/index.d.ts +0 -14
- package/npm/node_modules/isexe/dist/commonjs/index.d.ts.map +0 -1
- package/npm/node_modules/isexe/dist/commonjs/index.js +0 -56
- package/npm/node_modules/isexe/dist/commonjs/index.js.map +0 -1
- package/npm/node_modules/isexe/dist/commonjs/index.min.js +0 -2
- package/npm/node_modules/isexe/dist/commonjs/index.min.js.map +0 -7
- package/npm/node_modules/isexe/dist/commonjs/options.d.ts +0 -32
- package/npm/node_modules/isexe/dist/commonjs/options.d.ts.map +0 -1
- package/npm/node_modules/isexe/dist/commonjs/options.js +0 -3
- package/npm/node_modules/isexe/dist/commonjs/options.js.map +0 -1
- package/npm/node_modules/isexe/dist/commonjs/package.json +0 -3
- package/npm/node_modules/isexe/dist/commonjs/posix.d.ts +0 -18
- package/npm/node_modules/isexe/dist/commonjs/posix.d.ts.map +0 -1
- package/npm/node_modules/isexe/dist/commonjs/posix.js +0 -67
- package/npm/node_modules/isexe/dist/commonjs/posix.js.map +0 -1
- package/npm/node_modules/isexe/dist/commonjs/win32.d.ts +0 -18
- package/npm/node_modules/isexe/dist/commonjs/win32.d.ts.map +0 -1
- package/npm/node_modules/isexe/dist/commonjs/win32.js +0 -63
- package/npm/node_modules/isexe/dist/commonjs/win32.js.map +0 -1
- package/npm/node_modules/isexe/dist/esm/index.d.ts +0 -14
- package/npm/node_modules/isexe/dist/esm/index.d.ts.map +0 -1
- package/npm/node_modules/isexe/dist/esm/index.js +0 -16
- package/npm/node_modules/isexe/dist/esm/index.js.map +0 -1
- package/npm/node_modules/isexe/dist/esm/index.min.js +0 -2
- package/npm/node_modules/isexe/dist/esm/index.min.js.map +0 -7
- package/npm/node_modules/isexe/dist/esm/options.d.ts +0 -32
- package/npm/node_modules/isexe/dist/esm/options.d.ts.map +0 -1
- package/npm/node_modules/isexe/dist/esm/options.js +0 -2
- package/npm/node_modules/isexe/dist/esm/options.js.map +0 -1
- package/npm/node_modules/isexe/dist/esm/package.json +0 -3
- package/npm/node_modules/isexe/dist/esm/posix.d.ts +0 -18
- package/npm/node_modules/isexe/dist/esm/posix.d.ts.map +0 -1
- package/npm/node_modules/isexe/dist/esm/posix.js +0 -62
- package/npm/node_modules/isexe/dist/esm/posix.js.map +0 -1
- package/npm/node_modules/isexe/dist/esm/win32.d.ts +0 -18
- package/npm/node_modules/isexe/dist/esm/win32.d.ts.map +0 -1
- package/npm/node_modules/isexe/dist/esm/win32.js +0 -58
- package/npm/node_modules/isexe/dist/esm/win32.js.map +0 -1
- package/npm/node_modules/isexe/package.json +0 -78
- package/npm/node_modules/sisteransi/license +0 -21
- package/npm/node_modules/sisteransi/package.json +0 -34
- package/npm/node_modules/sisteransi/readme.md +0 -113
- package/npm/node_modules/sisteransi/src/index.js +0 -58
- package/npm/node_modules/sisteransi/src/sisteransi.d.ts +0 -35
- package/npm/node_modules/undici-types/LICENSE +0 -21
- package/npm/node_modules/undici-types/README.md +0 -6
- package/npm/node_modules/undici-types/agent.d.ts +0 -31
- package/npm/node_modules/undici-types/api.d.ts +0 -43
- package/npm/node_modules/undici-types/balanced-pool.d.ts +0 -29
- package/npm/node_modules/undici-types/cache.d.ts +0 -36
- package/npm/node_modules/undici-types/client.d.ts +0 -108
- package/npm/node_modules/undici-types/connector.d.ts +0 -34
- package/npm/node_modules/undici-types/content-type.d.ts +0 -21
- package/npm/node_modules/undici-types/cookies.d.ts +0 -28
- package/npm/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
- package/npm/node_modules/undici-types/dispatcher.d.ts +0 -256
- package/npm/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
- package/npm/node_modules/undici-types/errors.d.ts +0 -149
- package/npm/node_modules/undici-types/eventsource.d.ts +0 -61
- package/npm/node_modules/undici-types/fetch.d.ts +0 -209
- package/npm/node_modules/undici-types/file.d.ts +0 -39
- package/npm/node_modules/undici-types/filereader.d.ts +0 -54
- package/npm/node_modules/undici-types/formdata.d.ts +0 -108
- package/npm/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- package/npm/node_modules/undici-types/global-origin.d.ts +0 -7
- package/npm/node_modules/undici-types/handlers.d.ts +0 -15
- package/npm/node_modules/undici-types/header.d.ts +0 -4
- package/npm/node_modules/undici-types/index.d.ts +0 -71
- package/npm/node_modules/undici-types/interceptors.d.ts +0 -17
- package/npm/node_modules/undici-types/mock-agent.d.ts +0 -50
- package/npm/node_modules/undici-types/mock-client.d.ts +0 -25
- package/npm/node_modules/undici-types/mock-errors.d.ts +0 -12
- package/npm/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- package/npm/node_modules/undici-types/mock-pool.d.ts +0 -25
- package/npm/node_modules/undici-types/package.json +0 -55
- package/npm/node_modules/undici-types/patch.d.ts +0 -33
- package/npm/node_modules/undici-types/pool-stats.d.ts +0 -19
- package/npm/node_modules/undici-types/pool.d.ts +0 -39
- package/npm/node_modules/undici-types/proxy-agent.d.ts +0 -28
- package/npm/node_modules/undici-types/readable.d.ts +0 -65
- package/npm/node_modules/undici-types/retry-agent.d.ts +0 -8
- package/npm/node_modules/undici-types/retry-handler.d.ts +0 -116
- package/npm/node_modules/undici-types/util.d.ts +0 -18
- package/npm/node_modules/undici-types/webidl.d.ts +0 -228
- package/npm/node_modules/undici-types/websocket.d.ts +0 -150
- package/npm/node_modules/which/LICENSE +0 -15
- package/npm/node_modules/which/README.md +0 -51
- package/npm/node_modules/which/bin/which.js +0 -52
- package/npm/node_modules/which/lib/index.js +0 -111
- package/npm/node_modules/which/package.json +0 -57
- package/npm/package-lock.json +0 -135
- package/npm/package.json +0 -30
- package/npm/script/_dnt.shims.d.ts +0 -8
- package/npm/script/_dnt.shims.d.ts.map +0 -1
- package/npm/script/_dnt.shims.js +0 -99
- package/npm/script/_dnt_2.shims.d.ts +0 -6
- package/npm/script/_dnt_2.shims.d.ts.map +0 -1
- package/npm/script/_dnt_2.shims.js +0 -65
- package/npm/script/helpers/createFolderStructure.d.ts +0 -2
- package/npm/script/helpers/createFolderStructure.d.ts.map +0 -1
- package/npm/script/helpers/createFolderStructure.js +0 -52
- package/npm/script/helpers/ensureAgents.d.ts +0 -2
- package/npm/script/helpers/ensureAgents.d.ts.map +0 -1
- package/npm/script/helpers/ensureAgents.js +0 -95
- package/npm/script/helpers/ensureEnvFile.d.ts +0 -2
- package/npm/script/helpers/ensureEnvFile.d.ts.map +0 -1
- package/npm/script/helpers/ensureEnvFile.js +0 -17
- package/npm/script/helpers/ensureGitignore.d.ts +0 -2
- package/npm/script/helpers/ensureGitignore.d.ts.map +0 -1
- package/npm/script/helpers/ensureGitignore.js +0 -32
- package/npm/script/helpers/ensureReadme.d.ts +0 -2
- package/npm/script/helpers/ensureReadme.d.ts.map +0 -1
- package/npm/script/helpers/ensureReadme.js +0 -40
- package/npm/script/helpers/getInstalledPackages.d.ts +0 -2
- package/npm/script/helpers/getInstalledPackages.d.ts.map +0 -1
- package/npm/script/helpers/getInstalledPackages.js +0 -32
- package/npm/script/helpers/getProjectTasks.d.ts +0 -5
- package/npm/script/helpers/getProjectTasks.d.ts.map +0 -1
- package/npm/script/helpers/getProjectTasks.js +0 -15
- package/npm/script/helpers/getRuntime.d.ts +0 -5
- package/npm/script/helpers/getRuntime.d.ts.map +0 -1
- package/npm/script/helpers/getRuntime.js +0 -57
- package/npm/script/helpers/gitignoreEntries.d.ts +0 -2
- package/npm/script/helpers/gitignoreEntries.d.ts.map +0 -1
- package/npm/script/helpers/gitignoreEntries.js +0 -12
- package/npm/script/helpers/handleFileConflict.d.ts +0 -5
- package/npm/script/helpers/handleFileConflict.d.ts.map +0 -1
- package/npm/script/helpers/handleFileConflict.js +0 -91
- package/npm/script/helpers/installPackagesAndFetchDocs.d.ts +0 -8
- package/npm/script/helpers/installPackagesAndFetchDocs.d.ts.map +0 -1
- package/npm/script/helpers/installPackagesAndFetchDocs.js +0 -98
- package/npm/script/helpers/packageOptions.d.ts +0 -5
- package/npm/script/helpers/packageOptions.d.ts.map +0 -1
- package/npm/script/helpers/packageOptions.js +0 -8
- package/npm/script/helpers/packageRegistry.d.ts +0 -7
- package/npm/script/helpers/packageRegistry.d.ts.map +0 -1
- package/npm/script/helpers/packageRegistry.js +0 -65
- package/npm/script/helpers/updateProjectConfig.d.ts +0 -2
- package/npm/script/helpers/updateProjectConfig.d.ts.map +0 -1
- package/npm/script/helpers/updateProjectConfig.js +0 -39
- package/npm/script/main.d.ts +0 -3
- package/npm/script/main.d.ts.map +0 -1
- package/npm/script/main.js +0 -98
- package/npm/script/package.json +0 -3
|
@@ -1,375 +0,0 @@
|
|
|
1
|
-
# `@clack/prompts`
|
|
2
|
-
|
|
3
|
-
Effortlessly build beautiful command-line apps 🪄 [Try the demo](https://stackblitz.com/edit/clack-prompts?file=index.js)
|
|
4
|
-
|
|
5
|
-

|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
`@clack/prompts` is an opinionated, pre-styled wrapper around [`@clack/core`](https://www.npmjs.com/package/@clack/core).
|
|
10
|
-
|
|
11
|
-
- 🤏 80% smaller than other options
|
|
12
|
-
- 💎 Beautiful, minimal UI
|
|
13
|
-
- ✅ Simple API
|
|
14
|
-
- 🧱 Comes with `text`, `password`, `confirm`, `date`, `select`, `autocomplete`, `selectKey`, `multiselect`, `path`, and `spinner` components
|
|
15
|
-
|
|
16
|
-
## Basics
|
|
17
|
-
|
|
18
|
-
### Setup
|
|
19
|
-
|
|
20
|
-
The `intro` and `outro` functions will print a message to begin or end a prompt session, respectively.
|
|
21
|
-
|
|
22
|
-
```js
|
|
23
|
-
import { intro, outro } from '@clack/prompts';
|
|
24
|
-
|
|
25
|
-
intro(`create-my-app`);
|
|
26
|
-
// Do stuff
|
|
27
|
-
outro(`You're all set!`);
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### Cancellation
|
|
31
|
-
|
|
32
|
-
The `isCancel` function is a guard that detects when a user cancels a question with `CTRL + C`. You should handle this situation for each prompt, optionally providing a nice cancellation message with the `cancel` utility.
|
|
33
|
-
|
|
34
|
-
```js
|
|
35
|
-
import { isCancel, cancel, text } from '@clack/prompts';
|
|
36
|
-
|
|
37
|
-
const value = await text({
|
|
38
|
-
message: 'What is the meaning of life?',
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
if (isCancel(value)) {
|
|
42
|
-
cancel('Operation cancelled.');
|
|
43
|
-
process.exit(0);
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Components
|
|
48
|
-
|
|
49
|
-
### Text
|
|
50
|
-
|
|
51
|
-
The text component accepts a single line of text.
|
|
52
|
-
|
|
53
|
-
```js
|
|
54
|
-
import { text } from '@clack/prompts';
|
|
55
|
-
|
|
56
|
-
const meaning = await text({
|
|
57
|
-
message: 'What is the meaning of life?',
|
|
58
|
-
placeholder: 'Not sure',
|
|
59
|
-
initialValue: '42',
|
|
60
|
-
validate(value) {
|
|
61
|
-
if (value.length === 0) return `Value is required!`;
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Password
|
|
67
|
-
|
|
68
|
-
The password component behaves like `text`, but masks the input as the user types.
|
|
69
|
-
|
|
70
|
-
```js
|
|
71
|
-
import { password } from '@clack/prompts';
|
|
72
|
-
|
|
73
|
-
const secret = await password({
|
|
74
|
-
message: 'Set a password.',
|
|
75
|
-
mask: '*',
|
|
76
|
-
validate(value) {
|
|
77
|
-
if (!value || value.length < 8) return 'Password must be at least 8 characters.';
|
|
78
|
-
},
|
|
79
|
-
});
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### Confirm
|
|
83
|
-
|
|
84
|
-
The confirm component accepts a yes or no answer. The result is a boolean value of `true` or `false`.
|
|
85
|
-
|
|
86
|
-
```js
|
|
87
|
-
import { confirm } from '@clack/prompts';
|
|
88
|
-
|
|
89
|
-
const shouldContinue = await confirm({
|
|
90
|
-
message: 'Do you want to continue?',
|
|
91
|
-
});
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### Date
|
|
95
|
-
|
|
96
|
-
The date component accepts a calendar date and returns a `Date` value.
|
|
97
|
-
|
|
98
|
-
```js
|
|
99
|
-
import { date } from '@clack/prompts';
|
|
100
|
-
|
|
101
|
-
const dueDate = await date({
|
|
102
|
-
message: 'Pick a due date.',
|
|
103
|
-
format: 'YMD',
|
|
104
|
-
minDate: new Date(Date.UTC(2026, 0, 1)),
|
|
105
|
-
maxDate: new Date(Date.UTC(2026, 11, 31)),
|
|
106
|
-
});
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Select
|
|
110
|
-
|
|
111
|
-
The select component allows a user to choose one value from a list of options. The result is the `value` prop of a given option.
|
|
112
|
-
|
|
113
|
-
```js
|
|
114
|
-
import { select } from '@clack/prompts';
|
|
115
|
-
|
|
116
|
-
const projectType = await select({
|
|
117
|
-
message: 'Pick a project type.',
|
|
118
|
-
options: [
|
|
119
|
-
{ value: 'ts', label: 'TypeScript' },
|
|
120
|
-
{ value: 'js', label: 'JavaScript', disabled: true },
|
|
121
|
-
{ value: 'coffee', label: 'CoffeeScript', hint: 'oh no' },
|
|
122
|
-
],
|
|
123
|
-
});
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
### Autocomplete
|
|
127
|
-
|
|
128
|
-
The autocomplete component lets a user filter a list by typing, then choose one option from the matching results. By default, matching uses each option's `label`, `hint`, and `value`. The result is the selected option's `value`.
|
|
129
|
-
|
|
130
|
-
```js
|
|
131
|
-
import { autocomplete } from '@clack/prompts';
|
|
132
|
-
|
|
133
|
-
const framework = await autocomplete({
|
|
134
|
-
message: 'Pick a framework.',
|
|
135
|
-
placeholder: 'Type to search...',
|
|
136
|
-
options: [
|
|
137
|
-
{ value: 'next', label: 'Next.js' },
|
|
138
|
-
{ value: 'nuxt', label: 'Nuxt' },
|
|
139
|
-
{ value: 'sveltekit', label: 'SvelteKit' },
|
|
140
|
-
{ value: 'remix', label: 'Remix' },
|
|
141
|
-
],
|
|
142
|
-
});
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Select Key
|
|
146
|
-
|
|
147
|
-
The `selectKey` component lets a user choose an option by pressing its single-character string `value` key directly.
|
|
148
|
-
|
|
149
|
-
```js
|
|
150
|
-
import { selectKey } from '@clack/prompts';
|
|
151
|
-
|
|
152
|
-
const action = await selectKey({
|
|
153
|
-
message: 'Pick an action.',
|
|
154
|
-
options: [
|
|
155
|
-
{ value: 'd', label: 'Deploy' },
|
|
156
|
-
{ value: 't', label: 'Run tests' },
|
|
157
|
-
{ value: 'q', label: 'Quit' },
|
|
158
|
-
],
|
|
159
|
-
});
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### Multi-Select
|
|
163
|
-
|
|
164
|
-
The `multiselect` component allows a user to choose many values from a list of options. The result is an array with all selected `value` props.
|
|
165
|
-
|
|
166
|
-
```js
|
|
167
|
-
import { multiselect } from '@clack/prompts';
|
|
168
|
-
|
|
169
|
-
const additionalTools = await multiselect({
|
|
170
|
-
message: 'Select additional tools.',
|
|
171
|
-
options: [
|
|
172
|
-
{ value: 'eslint', label: 'ESLint', hint: 'recommended' },
|
|
173
|
-
{ value: 'prettier', label: 'Prettier', disabled: true },
|
|
174
|
-
{ value: 'gh-action', label: 'GitHub Action' },
|
|
175
|
-
],
|
|
176
|
-
required: false,
|
|
177
|
-
});
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
It is also possible to select multiple items arranged into hierarchy by using `groupMultiselect`:
|
|
181
|
-
|
|
182
|
-
```js
|
|
183
|
-
import { groupMultiselect } from '@clack/prompts';
|
|
184
|
-
|
|
185
|
-
const basket = await groupMultiselect({
|
|
186
|
-
message: 'Select your favorite fruits and vegetables:',
|
|
187
|
-
options: {
|
|
188
|
-
fruits: [
|
|
189
|
-
{ value: 'apple', label: 'apple' },
|
|
190
|
-
{ value: 'banana', label: 'banana' },
|
|
191
|
-
{ value: 'cherry', label: 'cherry' },
|
|
192
|
-
],
|
|
193
|
-
vegetables: [
|
|
194
|
-
{ value: 'carrot', label: 'carrot' },
|
|
195
|
-
{ value: 'spinach', label: 'spinach' },
|
|
196
|
-
{ value: 'potato', label: 'potato' },
|
|
197
|
-
]
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
### Multi-Line Text
|
|
203
|
-
|
|
204
|
-
The multi-line text component accepts multiple lines of text input. By default, pressing `Enter` twice submits the input.
|
|
205
|
-
|
|
206
|
-
```js
|
|
207
|
-
import { multiline } from '@clack/prompts';
|
|
208
|
-
|
|
209
|
-
const bio = await multiline({
|
|
210
|
-
message: 'Tell us about yourself.',
|
|
211
|
-
placeholder: 'Start typing...',
|
|
212
|
-
validate(value) {
|
|
213
|
-
if (value.length === 0) return `value is required`;
|
|
214
|
-
},
|
|
215
|
-
});
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
Set `showSubmit` to display an explicit submit button instead of double `Enter` submission:
|
|
219
|
-
|
|
220
|
-
```js
|
|
221
|
-
const bio = await multiline({
|
|
222
|
-
message: 'Tell us about yourself.',
|
|
223
|
-
showSubmit: true,
|
|
224
|
-
});
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
### Path
|
|
228
|
-
|
|
229
|
-
The path component offers filesystem path suggestions and returns the selected path as a string. When `directory: true` is set, only directories can be selected.
|
|
230
|
-
|
|
231
|
-
```js
|
|
232
|
-
import { path } from '@clack/prompts';
|
|
233
|
-
|
|
234
|
-
const targetDir = await path({
|
|
235
|
-
message: 'Select an existing directory.',
|
|
236
|
-
directory: true,
|
|
237
|
-
});
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
### Spinner
|
|
241
|
-
|
|
242
|
-
The spinner component surfaces a pending action, such as a long-running download or dependency installation.
|
|
243
|
-
|
|
244
|
-
```js
|
|
245
|
-
import { spinner } from '@clack/prompts';
|
|
246
|
-
|
|
247
|
-
const s = spinner();
|
|
248
|
-
s.start('Installing via npm');
|
|
249
|
-
// Do installation here
|
|
250
|
-
s.stop('Installed via npm');
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
### Progress
|
|
254
|
-
|
|
255
|
-
The progress component extends the spinner component to add a progress bar to visualize the progression of an action.
|
|
256
|
-
|
|
257
|
-
```js
|
|
258
|
-
import { progress } from '@clack/prompts';
|
|
259
|
-
|
|
260
|
-
const p = progress({ max: 10 });
|
|
261
|
-
p.start('Downloading archive');
|
|
262
|
-
// Do download here
|
|
263
|
-
p.advance(3, 'Downloading (30%)');
|
|
264
|
-
// ...
|
|
265
|
-
p.advance(5, 'Downloading (80%)');
|
|
266
|
-
// ...
|
|
267
|
-
p.stop('Archive downloaded');
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
## Utilities
|
|
271
|
-
|
|
272
|
-
### Grouping
|
|
273
|
-
|
|
274
|
-
Grouping prompts together is a great way to keep your code organized. This accepts a JSON object with a name that can be used to reference the group later. The second argument is an optional but has a `onCancel` callback that will be called if the user cancels one of the prompts in the group.
|
|
275
|
-
|
|
276
|
-
```js
|
|
277
|
-
import * as p from '@clack/prompts';
|
|
278
|
-
|
|
279
|
-
const group = await p.group(
|
|
280
|
-
{
|
|
281
|
-
name: () => p.text({ message: 'What is your name?' }),
|
|
282
|
-
age: () => p.text({ message: 'What is your age?' }),
|
|
283
|
-
color: ({ results }) =>
|
|
284
|
-
p.multiselect({
|
|
285
|
-
message: `What is your favorite color ${results.name}?`,
|
|
286
|
-
options: [
|
|
287
|
-
{ value: 'red', label: 'Red' },
|
|
288
|
-
{ value: 'green', label: 'Green' },
|
|
289
|
-
{ value: 'blue', label: 'Blue' },
|
|
290
|
-
],
|
|
291
|
-
}),
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
// On Cancel callback that wraps the group
|
|
295
|
-
// So if the user cancels one of the prompts in the group this function will be called
|
|
296
|
-
onCancel: ({ results }) => {
|
|
297
|
-
p.cancel('Operation cancelled.');
|
|
298
|
-
process.exit(0);
|
|
299
|
-
},
|
|
300
|
-
}
|
|
301
|
-
);
|
|
302
|
-
|
|
303
|
-
console.log(group.name, group.age, group.color);
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
### Tasks
|
|
307
|
-
|
|
308
|
-
Execute multiple tasks in spinners.
|
|
309
|
-
|
|
310
|
-
```js
|
|
311
|
-
import { tasks } from '@clack/prompts';
|
|
312
|
-
|
|
313
|
-
await tasks([
|
|
314
|
-
{
|
|
315
|
-
title: 'Installing via npm',
|
|
316
|
-
task: async (message) => {
|
|
317
|
-
// Do installation here
|
|
318
|
-
return 'Installed via npm';
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
]);
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
### Logs
|
|
325
|
-
|
|
326
|
-
```js
|
|
327
|
-
import { log } from '@clack/prompts';
|
|
328
|
-
|
|
329
|
-
log.info('Info!');
|
|
330
|
-
log.success('Success!');
|
|
331
|
-
log.step('Step!');
|
|
332
|
-
log.warn('Warn!');
|
|
333
|
-
log.error('Error!');
|
|
334
|
-
log.message('Hello, World', { symbol: color.cyan('~') });
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
### Stream
|
|
339
|
-
|
|
340
|
-
When interacting with dynamic LLMs or other streaming message providers, use the `stream` APIs to log messages from an iterable, even an async one.
|
|
341
|
-
|
|
342
|
-
```js
|
|
343
|
-
import { stream } from '@clack/prompts';
|
|
344
|
-
|
|
345
|
-
stream.info((function *() { yield 'Info!'; })());
|
|
346
|
-
stream.success((function *() { yield 'Success!'; })());
|
|
347
|
-
stream.step((function *() { yield 'Step!'; })());
|
|
348
|
-
stream.warn((function *() { yield 'Warn!'; })());
|
|
349
|
-
stream.error((function *() { yield 'Error!'; })());
|
|
350
|
-
stream.message((function *() { yield 'Hello'; yield ", World" })(), { symbol: color.cyan('~') });
|
|
351
|
-
```
|
|
352
|
-
|
|
353
|
-

|
|
354
|
-
|
|
355
|
-
### Task Log
|
|
356
|
-
|
|
357
|
-
When executing a sub-process or a similar sub-task, `taskLog` can be used to render the output continuously and clear it at the end if it was successful.
|
|
358
|
-
|
|
359
|
-
```js
|
|
360
|
-
import { taskLog } from '@clack/prompts';
|
|
361
|
-
|
|
362
|
-
const log = taskLog({
|
|
363
|
-
title: 'Running npm install'
|
|
364
|
-
});
|
|
365
|
-
|
|
366
|
-
for await (const line of npmInstall()) {
|
|
367
|
-
log.message(line);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
if (success) {
|
|
371
|
-
log.success('Done!');
|
|
372
|
-
} else {
|
|
373
|
-
log.error('Failed!');
|
|
374
|
-
}
|
|
375
|
-
```
|