@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.
Files changed (463) hide show
  1. package/esm/helpers/createFolderStructure.d.ts.map +1 -1
  2. package/esm/helpers/createFolderStructure.js +1 -15
  3. package/esm/helpers/ensureAgents.d.ts.map +1 -1
  4. package/esm/helpers/ensureAgents.js +2 -8
  5. package/esm/helpers/ensureEnvFile.d.ts.map +1 -1
  6. package/esm/helpers/ensureEnvFile.js +1 -7
  7. package/esm/helpers/ensureGitignore.d.ts.map +1 -1
  8. package/esm/helpers/ensureGitignore.js +0 -6
  9. package/esm/helpers/ensureReadme.d.ts.map +1 -1
  10. package/esm/helpers/ensureReadme.js +1 -7
  11. package/esm/main.js +7 -17
  12. package/package.json +5 -2
  13. package/script/helpers/createFolderStructure.d.ts.map +1 -1
  14. package/script/helpers/createFolderStructure.js +1 -15
  15. package/script/helpers/ensureAgents.d.ts.map +1 -1
  16. package/script/helpers/ensureAgents.js +2 -8
  17. package/script/helpers/ensureEnvFile.d.ts.map +1 -1
  18. package/script/helpers/ensureEnvFile.js +1 -7
  19. package/script/helpers/ensureGitignore.d.ts.map +1 -1
  20. package/script/helpers/ensureGitignore.js +0 -6
  21. package/script/helpers/ensureReadme.d.ts.map +1 -1
  22. package/script/helpers/ensureReadme.js +1 -7
  23. package/script/main.js +7 -17
  24. package/npm/LICENSE +0 -21
  25. package/npm/README.md +0 -25
  26. package/npm/esm/_dnt.shims.d.ts +0 -8
  27. package/npm/esm/_dnt.shims.d.ts.map +0 -1
  28. package/npm/esm/_dnt.shims.js +0 -62
  29. package/npm/esm/_dnt_2.shims.d.ts +0 -6
  30. package/npm/esm/_dnt_2.shims.d.ts.map +0 -1
  31. package/npm/esm/_dnt_2.shims.js +0 -61
  32. package/npm/esm/helpers/createFolderStructure.d.ts +0 -2
  33. package/npm/esm/helpers/createFolderStructure.d.ts.map +0 -1
  34. package/npm/esm/helpers/createFolderStructure.js +0 -49
  35. package/npm/esm/helpers/ensureAgents.d.ts +0 -2
  36. package/npm/esm/helpers/ensureAgents.d.ts.map +0 -1
  37. package/npm/esm/helpers/ensureAgents.js +0 -92
  38. package/npm/esm/helpers/ensureEnvFile.d.ts +0 -2
  39. package/npm/esm/helpers/ensureEnvFile.d.ts.map +0 -1
  40. package/npm/esm/helpers/ensureEnvFile.js +0 -14
  41. package/npm/esm/helpers/ensureGitignore.d.ts +0 -2
  42. package/npm/esm/helpers/ensureGitignore.d.ts.map +0 -1
  43. package/npm/esm/helpers/ensureGitignore.js +0 -29
  44. package/npm/esm/helpers/ensureReadme.d.ts +0 -2
  45. package/npm/esm/helpers/ensureReadme.d.ts.map +0 -1
  46. package/npm/esm/helpers/ensureReadme.js +0 -37
  47. package/npm/esm/helpers/getInstalledPackages.d.ts +0 -2
  48. package/npm/esm/helpers/getInstalledPackages.d.ts.map +0 -1
  49. package/npm/esm/helpers/getInstalledPackages.js +0 -29
  50. package/npm/esm/helpers/getProjectTasks.d.ts +0 -5
  51. package/npm/esm/helpers/getProjectTasks.d.ts.map +0 -1
  52. package/npm/esm/helpers/getProjectTasks.js +0 -12
  53. package/npm/esm/helpers/getRuntime.d.ts +0 -5
  54. package/npm/esm/helpers/getRuntime.d.ts.map +0 -1
  55. package/npm/esm/helpers/getRuntime.js +0 -17
  56. package/npm/esm/helpers/gitignoreEntries.d.ts +0 -2
  57. package/npm/esm/helpers/gitignoreEntries.d.ts.map +0 -1
  58. package/npm/esm/helpers/gitignoreEntries.js +0 -9
  59. package/npm/esm/helpers/handleFileConflict.d.ts +0 -5
  60. package/npm/esm/helpers/handleFileConflict.d.ts.map +0 -1
  61. package/npm/esm/helpers/handleFileConflict.js +0 -51
  62. package/npm/esm/helpers/installPackagesAndFetchDocs.d.ts +0 -8
  63. package/npm/esm/helpers/installPackagesAndFetchDocs.d.ts.map +0 -1
  64. package/npm/esm/helpers/installPackagesAndFetchDocs.js +0 -61
  65. package/npm/esm/helpers/packageOptions.d.ts +0 -5
  66. package/npm/esm/helpers/packageOptions.d.ts.map +0 -1
  67. package/npm/esm/helpers/packageOptions.js +0 -5
  68. package/npm/esm/helpers/packageRegistry.d.ts +0 -7
  69. package/npm/esm/helpers/packageRegistry.d.ts.map +0 -1
  70. package/npm/esm/helpers/packageRegistry.js +0 -62
  71. package/npm/esm/helpers/updateProjectConfig.d.ts +0 -2
  72. package/npm/esm/helpers/updateProjectConfig.d.ts.map +0 -1
  73. package/npm/esm/helpers/updateProjectConfig.js +0 -36
  74. package/npm/esm/main.d.ts +0 -3
  75. package/npm/esm/main.d.ts.map +0 -1
  76. package/npm/esm/main.js +0 -93
  77. package/npm/esm/package.json +0 -3
  78. package/npm/node_modules/.package-lock.json +0 -123
  79. package/npm/node_modules/@clack/core/CHANGELOG.md +0 -348
  80. package/npm/node_modules/@clack/core/LICENSE +0 -9
  81. package/npm/node_modules/@clack/core/README.md +0 -22
  82. package/npm/node_modules/@clack/core/dist/index.d.mts +0 -363
  83. package/npm/node_modules/@clack/core/dist/index.mjs +0 -17
  84. package/npm/node_modules/@clack/core/dist/index.mjs.map +0 -1
  85. package/npm/node_modules/@clack/core/package.json +0 -63
  86. package/npm/node_modules/@clack/prompts/CHANGELOG.md +0 -591
  87. package/npm/node_modules/@clack/prompts/LICENSE +0 -9
  88. package/npm/node_modules/@clack/prompts/README.md +0 -375
  89. package/npm/node_modules/@clack/prompts/dist/index.d.mts +0 -396
  90. package/npm/node_modules/@clack/prompts/dist/index.mjs +0 -144
  91. package/npm/node_modules/@clack/prompts/dist/index.mjs.map +0 -1
  92. package/npm/node_modules/@clack/prompts/package.json +0 -68
  93. package/npm/node_modules/@deno/shim-deno/LICENSE +0 -20
  94. package/npm/node_modules/@deno/shim-deno/README.md +0 -30
  95. package/npm/node_modules/@deno/shim-deno/dist/deno/internal/Conn.js +0 -56
  96. package/npm/node_modules/@deno/shim-deno/dist/deno/internal/Listener.js +0 -92
  97. package/npm/node_modules/@deno/shim-deno/dist/deno/internal/consts.js +0 -4
  98. package/npm/node_modules/@deno/shim-deno/dist/deno/internal/errorMap.js +0 -44
  99. package/npm/node_modules/@deno/shim-deno/dist/deno/internal/fs_flags.js +0 -91
  100. package/npm/node_modules/@deno/shim-deno/dist/deno/internal/iterutil.js +0 -37
  101. package/npm/node_modules/@deno/shim-deno/dist/deno/internal/random_id.js +0 -8
  102. package/npm/node_modules/@deno/shim-deno/dist/deno/internal/streams.js +0 -122
  103. package/npm/node_modules/@deno/shim-deno/dist/deno/internal/test.d.ts +0 -1
  104. package/npm/node_modules/@deno/shim-deno/dist/deno/internal/test.js +0 -5
  105. package/npm/node_modules/@deno/shim-deno/dist/deno/internal/version.js +0 -5
  106. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/classes/FsFile.js +0 -143
  107. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/classes/PermissionStatus.js +0 -19
  108. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/classes/Permissions.js +0 -26
  109. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/classes.js +0 -10
  110. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/enums/SeekMode.js +0 -9
  111. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/enums.js +0 -5
  112. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/addSignalListener.js +0 -18
  113. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/chdir.js +0 -22
  114. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/chmod.js +0 -29
  115. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/chmodSync.js +0 -29
  116. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/chown.js +0 -30
  117. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/chownSync.js +0 -30
  118. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/close.js +0 -29
  119. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/connect.js +0 -37
  120. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/connectTls.js +0 -31
  121. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/consoleSize.js +0 -17
  122. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/copy.js +0 -27
  123. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/copyFile.js +0 -45
  124. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/copyFileSync.js +0 -45
  125. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/create.js +0 -9
  126. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/createSync.js +0 -14
  127. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/cwd.js +0 -5
  128. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/execPath.js +0 -10
  129. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/exit.js +0 -8
  130. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fdatasync.js +0 -8
  131. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fdatasyncSync.js +0 -6
  132. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fstat.js +0 -44
  133. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fstatSync.js +0 -19
  134. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fsync.js +0 -10
  135. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fsyncSync.js +0 -9
  136. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/ftruncate.js +0 -8
  137. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/ftruncateSync.js +0 -6
  138. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/gid.js +0 -10
  139. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/hostname.js +0 -32
  140. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/inspect.js +0 -30
  141. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/kill.js +0 -16
  142. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/link.js +0 -29
  143. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/linkSync.js +0 -29
  144. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/listen.js +0 -51
  145. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/listenTls.js +0 -49
  146. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/loadavg.js +0 -32
  147. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/lstat.js +0 -42
  148. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/lstatSync.js +0 -42
  149. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/makeTempDir.js +0 -11
  150. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/makeTempDirSync.js +0 -11
  151. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/makeTempFile.js +0 -14
  152. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/makeTempFileSync.js +0 -14
  153. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/memoryUsage.js +0 -5
  154. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/mkdir.js +0 -22
  155. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/mkdirSync.js +0 -45
  156. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/open.js +0 -33
  157. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/openSync.js +0 -31
  158. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/osRelease.js +0 -9
  159. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/osUptime.js +0 -9
  160. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/read.js +0 -19
  161. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readDir.js +0 -26
  162. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readDirSync.js +0 -26
  163. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readFile.js +0 -19
  164. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readFileSync.js +0 -19
  165. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readLink.js +0 -29
  166. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readLinkSync.js +0 -29
  167. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readSync.js +0 -34
  168. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readTextFile.js +0 -18
  169. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readTextFileSync.js +0 -41
  170. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/realPath.js +0 -29
  171. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/realPathSync.js +0 -29
  172. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/remove.js +0 -22
  173. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/removeSignalListener.js +0 -12
  174. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/removeSync.js +0 -45
  175. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/rename.js +0 -9
  176. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/renameSync.js +0 -29
  177. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/resolveDns.js +0 -41
  178. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/run.js +0 -276
  179. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/shutdown.js +0 -9
  180. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/stat.js +0 -68
  181. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/statSync.js +0 -42
  182. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/symlink.js +0 -30
  183. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/symlinkSync.js +0 -30
  184. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/test.js +0 -5
  185. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/truncate.js +0 -45
  186. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/truncateSync.js +0 -45
  187. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/uid.js +0 -10
  188. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/watchFs.js +0 -27
  189. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/write.js +0 -35
  190. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/writeFile.js +0 -46
  191. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/writeFileSync.js +0 -45
  192. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/writeSync.js +0 -29
  193. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/writeTextFile.js +0 -52
  194. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/writeTextFileSync.js +0 -44
  195. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions.js +0 -234
  196. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/main.js +0 -21
  197. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/types.js +0 -3
  198. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/args.js +0 -5
  199. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/build.js +0 -38
  200. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/customInspect.js +0 -4
  201. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/env.js +0 -47
  202. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/errors.js +0 -63
  203. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/mainModule.js +0 -8
  204. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/metrics.js +0 -21
  205. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/noColor.js +0 -5
  206. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/permissions.js +0 -6
  207. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/pid.js +0 -5
  208. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/ppid.js +0 -5
  209. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/resources.js +0 -12
  210. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/std.js +0 -132
  211. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/version.js +0 -10
  212. package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables.js +0 -53
  213. package/npm/node_modules/@deno/shim-deno/dist/deno/unstable/main.js +0 -62
  214. package/npm/node_modules/@deno/shim-deno/dist/deno.js +0 -17
  215. package/npm/node_modules/@deno/shim-deno/dist/index.d.ts +0 -4762
  216. package/npm/node_modules/@deno/shim-deno/dist/index.js +0 -27
  217. package/npm/node_modules/@deno/shim-deno/package.json +0 -50
  218. package/npm/node_modules/@deno/shim-deno-test/LICENSE +0 -20
  219. package/npm/node_modules/@deno/shim-deno-test/README.md +0 -28
  220. package/npm/node_modules/@deno/shim-deno-test/dist/definitions.d.ts +0 -3
  221. package/npm/node_modules/@deno/shim-deno-test/dist/definitions.js +0 -5
  222. package/npm/node_modules/@deno/shim-deno-test/dist/deno.types.gen.d.ts +0 -626
  223. package/npm/node_modules/@deno/shim-deno-test/dist/deno.types.gen.js +0 -2
  224. package/npm/node_modules/@deno/shim-deno-test/dist/index.d.ts +0 -3
  225. package/npm/node_modules/@deno/shim-deno-test/dist/index.js +0 -21
  226. package/npm/node_modules/@deno/shim-deno-test/dist/test.d.ts +0 -3
  227. package/npm/node_modules/@deno/shim-deno-test/dist/test.js +0 -87
  228. package/npm/node_modules/@deno/shim-deno-test/package.json +0 -34
  229. package/npm/node_modules/@types/node/LICENSE +0 -21
  230. package/npm/node_modules/@types/node/README.md +0 -15
  231. package/npm/node_modules/@types/node/assert/strict.d.ts +0 -8
  232. package/npm/node_modules/@types/node/assert.d.ts +0 -1062
  233. package/npm/node_modules/@types/node/async_hooks.d.ts +0 -605
  234. package/npm/node_modules/@types/node/buffer.buffer.d.ts +0 -471
  235. package/npm/node_modules/@types/node/buffer.d.ts +0 -1936
  236. package/npm/node_modules/@types/node/child_process.d.ts +0 -1475
  237. package/npm/node_modules/@types/node/cluster.d.ts +0 -577
  238. package/npm/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
  239. package/npm/node_modules/@types/node/compatibility/index.d.ts +0 -9
  240. package/npm/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  241. package/npm/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  242. package/npm/node_modules/@types/node/console.d.ts +0 -452
  243. package/npm/node_modules/@types/node/constants.d.ts +0 -21
  244. package/npm/node_modules/@types/node/crypto.d.ts +0 -4590
  245. package/npm/node_modules/@types/node/dgram.d.ts +0 -597
  246. package/npm/node_modules/@types/node/diagnostics_channel.d.ts +0 -578
  247. package/npm/node_modules/@types/node/dns/promises.d.ts +0 -479
  248. package/npm/node_modules/@types/node/dns.d.ts +0 -871
  249. package/npm/node_modules/@types/node/domain.d.ts +0 -170
  250. package/npm/node_modules/@types/node/events.d.ts +0 -977
  251. package/npm/node_modules/@types/node/fs/promises.d.ts +0 -1270
  252. package/npm/node_modules/@types/node/fs.d.ts +0 -4375
  253. package/npm/node_modules/@types/node/globals.d.ts +0 -172
  254. package/npm/node_modules/@types/node/globals.typedarray.d.ts +0 -38
  255. package/npm/node_modules/@types/node/http.d.ts +0 -2049
  256. package/npm/node_modules/@types/node/http2.d.ts +0 -2631
  257. package/npm/node_modules/@types/node/https.d.ts +0 -578
  258. package/npm/node_modules/@types/node/index.d.ts +0 -93
  259. package/npm/node_modules/@types/node/inspector.generated.d.ts +0 -3966
  260. package/npm/node_modules/@types/node/module.d.ts +0 -539
  261. package/npm/node_modules/@types/node/net.d.ts +0 -1031
  262. package/npm/node_modules/@types/node/os.d.ts +0 -506
  263. package/npm/node_modules/@types/node/package.json +0 -140
  264. package/npm/node_modules/@types/node/path.d.ts +0 -200
  265. package/npm/node_modules/@types/node/perf_hooks.d.ts +0 -961
  266. package/npm/node_modules/@types/node/process.d.ts +0 -1961
  267. package/npm/node_modules/@types/node/punycode.d.ts +0 -117
  268. package/npm/node_modules/@types/node/querystring.d.ts +0 -152
  269. package/npm/node_modules/@types/node/readline/promises.d.ts +0 -162
  270. package/npm/node_modules/@types/node/readline.d.ts +0 -589
  271. package/npm/node_modules/@types/node/repl.d.ts +0 -430
  272. package/npm/node_modules/@types/node/sea.d.ts +0 -153
  273. package/npm/node_modules/@types/node/stream/consumers.d.ts +0 -38
  274. package/npm/node_modules/@types/node/stream/promises.d.ts +0 -90
  275. package/npm/node_modules/@types/node/stream/web.d.ts +0 -533
  276. package/npm/node_modules/@types/node/stream.d.ts +0 -1698
  277. package/npm/node_modules/@types/node/string_decoder.d.ts +0 -67
  278. package/npm/node_modules/@types/node/test.d.ts +0 -1787
  279. package/npm/node_modules/@types/node/timers/promises.d.ts +0 -108
  280. package/npm/node_modules/@types/node/timers.d.ts +0 -286
  281. package/npm/node_modules/@types/node/tls.d.ts +0 -1259
  282. package/npm/node_modules/@types/node/trace_events.d.ts +0 -197
  283. package/npm/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -468
  284. package/npm/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -34
  285. package/npm/node_modules/@types/node/ts5.6/index.d.ts +0 -93
  286. package/npm/node_modules/@types/node/tty.d.ts +0 -208
  287. package/npm/node_modules/@types/node/url.d.ts +0 -964
  288. package/npm/node_modules/@types/node/util.d.ts +0 -2331
  289. package/npm/node_modules/@types/node/v8.d.ts +0 -809
  290. package/npm/node_modules/@types/node/vm.d.ts +0 -1001
  291. package/npm/node_modules/@types/node/wasi.d.ts +0 -181
  292. package/npm/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -34
  293. package/npm/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
  294. package/npm/node_modules/@types/node/web-globals/events.d.ts +0 -97
  295. package/npm/node_modules/@types/node/web-globals/fetch.d.ts +0 -55
  296. package/npm/node_modules/@types/node/worker_threads.d.ts +0 -715
  297. package/npm/node_modules/@types/node/zlib.d.ts +0 -598
  298. package/npm/node_modules/fast-string-truncated-width/dist/index.d.ts +0 -4
  299. package/npm/node_modules/fast-string-truncated-width/dist/index.js +0 -111
  300. package/npm/node_modules/fast-string-truncated-width/dist/types.d.ts +0 -19
  301. package/npm/node_modules/fast-string-truncated-width/dist/types.js +0 -2
  302. package/npm/node_modules/fast-string-truncated-width/dist/utils.d.ts +0 -4
  303. package/npm/node_modules/fast-string-truncated-width/dist/utils.js +0 -20
  304. package/npm/node_modules/fast-string-truncated-width/license +0 -21
  305. package/npm/node_modules/fast-string-truncated-width/package.json +0 -35
  306. package/npm/node_modules/fast-string-truncated-width/readme.md +0 -59
  307. package/npm/node_modules/fast-string-width/dist/index.d.ts +0 -4
  308. package/npm/node_modules/fast-string-width/dist/index.js +0 -14
  309. package/npm/node_modules/fast-string-width/license +0 -21
  310. package/npm/node_modules/fast-string-width/package.json +0 -34
  311. package/npm/node_modules/fast-string-width/readme.md +0 -42
  312. package/npm/node_modules/fast-wrap-ansi/LICENSE +0 -23
  313. package/npm/node_modules/fast-wrap-ansi/README.md +0 -26
  314. package/npm/node_modules/fast-wrap-ansi/lib/main.d.ts +0 -6
  315. package/npm/node_modules/fast-wrap-ansi/lib/main.js +0 -219
  316. package/npm/node_modules/fast-wrap-ansi/lib/main.js.map +0 -1
  317. package/npm/node_modules/fast-wrap-ansi/package.json +0 -51
  318. package/npm/node_modules/isexe/LICENSE.md +0 -55
  319. package/npm/node_modules/isexe/README.md +0 -80
  320. package/npm/node_modules/isexe/dist/commonjs/index.d.ts +0 -14
  321. package/npm/node_modules/isexe/dist/commonjs/index.d.ts.map +0 -1
  322. package/npm/node_modules/isexe/dist/commonjs/index.js +0 -56
  323. package/npm/node_modules/isexe/dist/commonjs/index.js.map +0 -1
  324. package/npm/node_modules/isexe/dist/commonjs/index.min.js +0 -2
  325. package/npm/node_modules/isexe/dist/commonjs/index.min.js.map +0 -7
  326. package/npm/node_modules/isexe/dist/commonjs/options.d.ts +0 -32
  327. package/npm/node_modules/isexe/dist/commonjs/options.d.ts.map +0 -1
  328. package/npm/node_modules/isexe/dist/commonjs/options.js +0 -3
  329. package/npm/node_modules/isexe/dist/commonjs/options.js.map +0 -1
  330. package/npm/node_modules/isexe/dist/commonjs/package.json +0 -3
  331. package/npm/node_modules/isexe/dist/commonjs/posix.d.ts +0 -18
  332. package/npm/node_modules/isexe/dist/commonjs/posix.d.ts.map +0 -1
  333. package/npm/node_modules/isexe/dist/commonjs/posix.js +0 -67
  334. package/npm/node_modules/isexe/dist/commonjs/posix.js.map +0 -1
  335. package/npm/node_modules/isexe/dist/commonjs/win32.d.ts +0 -18
  336. package/npm/node_modules/isexe/dist/commonjs/win32.d.ts.map +0 -1
  337. package/npm/node_modules/isexe/dist/commonjs/win32.js +0 -63
  338. package/npm/node_modules/isexe/dist/commonjs/win32.js.map +0 -1
  339. package/npm/node_modules/isexe/dist/esm/index.d.ts +0 -14
  340. package/npm/node_modules/isexe/dist/esm/index.d.ts.map +0 -1
  341. package/npm/node_modules/isexe/dist/esm/index.js +0 -16
  342. package/npm/node_modules/isexe/dist/esm/index.js.map +0 -1
  343. package/npm/node_modules/isexe/dist/esm/index.min.js +0 -2
  344. package/npm/node_modules/isexe/dist/esm/index.min.js.map +0 -7
  345. package/npm/node_modules/isexe/dist/esm/options.d.ts +0 -32
  346. package/npm/node_modules/isexe/dist/esm/options.d.ts.map +0 -1
  347. package/npm/node_modules/isexe/dist/esm/options.js +0 -2
  348. package/npm/node_modules/isexe/dist/esm/options.js.map +0 -1
  349. package/npm/node_modules/isexe/dist/esm/package.json +0 -3
  350. package/npm/node_modules/isexe/dist/esm/posix.d.ts +0 -18
  351. package/npm/node_modules/isexe/dist/esm/posix.d.ts.map +0 -1
  352. package/npm/node_modules/isexe/dist/esm/posix.js +0 -62
  353. package/npm/node_modules/isexe/dist/esm/posix.js.map +0 -1
  354. package/npm/node_modules/isexe/dist/esm/win32.d.ts +0 -18
  355. package/npm/node_modules/isexe/dist/esm/win32.d.ts.map +0 -1
  356. package/npm/node_modules/isexe/dist/esm/win32.js +0 -58
  357. package/npm/node_modules/isexe/dist/esm/win32.js.map +0 -1
  358. package/npm/node_modules/isexe/package.json +0 -78
  359. package/npm/node_modules/sisteransi/license +0 -21
  360. package/npm/node_modules/sisteransi/package.json +0 -34
  361. package/npm/node_modules/sisteransi/readme.md +0 -113
  362. package/npm/node_modules/sisteransi/src/index.js +0 -58
  363. package/npm/node_modules/sisteransi/src/sisteransi.d.ts +0 -35
  364. package/npm/node_modules/undici-types/LICENSE +0 -21
  365. package/npm/node_modules/undici-types/README.md +0 -6
  366. package/npm/node_modules/undici-types/agent.d.ts +0 -31
  367. package/npm/node_modules/undici-types/api.d.ts +0 -43
  368. package/npm/node_modules/undici-types/balanced-pool.d.ts +0 -29
  369. package/npm/node_modules/undici-types/cache.d.ts +0 -36
  370. package/npm/node_modules/undici-types/client.d.ts +0 -108
  371. package/npm/node_modules/undici-types/connector.d.ts +0 -34
  372. package/npm/node_modules/undici-types/content-type.d.ts +0 -21
  373. package/npm/node_modules/undici-types/cookies.d.ts +0 -28
  374. package/npm/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  375. package/npm/node_modules/undici-types/dispatcher.d.ts +0 -256
  376. package/npm/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  377. package/npm/node_modules/undici-types/errors.d.ts +0 -149
  378. package/npm/node_modules/undici-types/eventsource.d.ts +0 -61
  379. package/npm/node_modules/undici-types/fetch.d.ts +0 -209
  380. package/npm/node_modules/undici-types/file.d.ts +0 -39
  381. package/npm/node_modules/undici-types/filereader.d.ts +0 -54
  382. package/npm/node_modules/undici-types/formdata.d.ts +0 -108
  383. package/npm/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  384. package/npm/node_modules/undici-types/global-origin.d.ts +0 -7
  385. package/npm/node_modules/undici-types/handlers.d.ts +0 -15
  386. package/npm/node_modules/undici-types/header.d.ts +0 -4
  387. package/npm/node_modules/undici-types/index.d.ts +0 -71
  388. package/npm/node_modules/undici-types/interceptors.d.ts +0 -17
  389. package/npm/node_modules/undici-types/mock-agent.d.ts +0 -50
  390. package/npm/node_modules/undici-types/mock-client.d.ts +0 -25
  391. package/npm/node_modules/undici-types/mock-errors.d.ts +0 -12
  392. package/npm/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  393. package/npm/node_modules/undici-types/mock-pool.d.ts +0 -25
  394. package/npm/node_modules/undici-types/package.json +0 -55
  395. package/npm/node_modules/undici-types/patch.d.ts +0 -33
  396. package/npm/node_modules/undici-types/pool-stats.d.ts +0 -19
  397. package/npm/node_modules/undici-types/pool.d.ts +0 -39
  398. package/npm/node_modules/undici-types/proxy-agent.d.ts +0 -28
  399. package/npm/node_modules/undici-types/readable.d.ts +0 -65
  400. package/npm/node_modules/undici-types/retry-agent.d.ts +0 -8
  401. package/npm/node_modules/undici-types/retry-handler.d.ts +0 -116
  402. package/npm/node_modules/undici-types/util.d.ts +0 -18
  403. package/npm/node_modules/undici-types/webidl.d.ts +0 -228
  404. package/npm/node_modules/undici-types/websocket.d.ts +0 -150
  405. package/npm/node_modules/which/LICENSE +0 -15
  406. package/npm/node_modules/which/README.md +0 -51
  407. package/npm/node_modules/which/bin/which.js +0 -52
  408. package/npm/node_modules/which/lib/index.js +0 -111
  409. package/npm/node_modules/which/package.json +0 -57
  410. package/npm/package-lock.json +0 -135
  411. package/npm/package.json +0 -30
  412. package/npm/script/_dnt.shims.d.ts +0 -8
  413. package/npm/script/_dnt.shims.d.ts.map +0 -1
  414. package/npm/script/_dnt.shims.js +0 -99
  415. package/npm/script/_dnt_2.shims.d.ts +0 -6
  416. package/npm/script/_dnt_2.shims.d.ts.map +0 -1
  417. package/npm/script/_dnt_2.shims.js +0 -65
  418. package/npm/script/helpers/createFolderStructure.d.ts +0 -2
  419. package/npm/script/helpers/createFolderStructure.d.ts.map +0 -1
  420. package/npm/script/helpers/createFolderStructure.js +0 -52
  421. package/npm/script/helpers/ensureAgents.d.ts +0 -2
  422. package/npm/script/helpers/ensureAgents.d.ts.map +0 -1
  423. package/npm/script/helpers/ensureAgents.js +0 -95
  424. package/npm/script/helpers/ensureEnvFile.d.ts +0 -2
  425. package/npm/script/helpers/ensureEnvFile.d.ts.map +0 -1
  426. package/npm/script/helpers/ensureEnvFile.js +0 -17
  427. package/npm/script/helpers/ensureGitignore.d.ts +0 -2
  428. package/npm/script/helpers/ensureGitignore.d.ts.map +0 -1
  429. package/npm/script/helpers/ensureGitignore.js +0 -32
  430. package/npm/script/helpers/ensureReadme.d.ts +0 -2
  431. package/npm/script/helpers/ensureReadme.d.ts.map +0 -1
  432. package/npm/script/helpers/ensureReadme.js +0 -40
  433. package/npm/script/helpers/getInstalledPackages.d.ts +0 -2
  434. package/npm/script/helpers/getInstalledPackages.d.ts.map +0 -1
  435. package/npm/script/helpers/getInstalledPackages.js +0 -32
  436. package/npm/script/helpers/getProjectTasks.d.ts +0 -5
  437. package/npm/script/helpers/getProjectTasks.d.ts.map +0 -1
  438. package/npm/script/helpers/getProjectTasks.js +0 -15
  439. package/npm/script/helpers/getRuntime.d.ts +0 -5
  440. package/npm/script/helpers/getRuntime.d.ts.map +0 -1
  441. package/npm/script/helpers/getRuntime.js +0 -57
  442. package/npm/script/helpers/gitignoreEntries.d.ts +0 -2
  443. package/npm/script/helpers/gitignoreEntries.d.ts.map +0 -1
  444. package/npm/script/helpers/gitignoreEntries.js +0 -12
  445. package/npm/script/helpers/handleFileConflict.d.ts +0 -5
  446. package/npm/script/helpers/handleFileConflict.d.ts.map +0 -1
  447. package/npm/script/helpers/handleFileConflict.js +0 -91
  448. package/npm/script/helpers/installPackagesAndFetchDocs.d.ts +0 -8
  449. package/npm/script/helpers/installPackagesAndFetchDocs.d.ts.map +0 -1
  450. package/npm/script/helpers/installPackagesAndFetchDocs.js +0 -98
  451. package/npm/script/helpers/packageOptions.d.ts +0 -5
  452. package/npm/script/helpers/packageOptions.d.ts.map +0 -1
  453. package/npm/script/helpers/packageOptions.js +0 -8
  454. package/npm/script/helpers/packageRegistry.d.ts +0 -7
  455. package/npm/script/helpers/packageRegistry.d.ts.map +0 -1
  456. package/npm/script/helpers/packageRegistry.js +0 -65
  457. package/npm/script/helpers/updateProjectConfig.d.ts +0 -2
  458. package/npm/script/helpers/updateProjectConfig.d.ts.map +0 -1
  459. package/npm/script/helpers/updateProjectConfig.js +0 -39
  460. package/npm/script/main.d.ts +0 -3
  461. package/npm/script/main.d.ts.map +0 -1
  462. package/npm/script/main.js +0 -98
  463. package/npm/script/package.json +0 -3
@@ -1,363 +0,0 @@
1
- import { Key } from 'node:readline';
2
- import { Readable, Writable } from 'node:stream';
3
-
4
- declare const actions: readonly ["up", "down", "left", "right", "space", "enter", "cancel"];
5
- type Action = (typeof actions)[number];
6
- /** Global settings for Clack programs, stored in memory */
7
- interface InternalClackSettings {
8
- actions: Set<Action>;
9
- aliases: Map<string, Action>;
10
- messages: {
11
- cancel: string;
12
- error: string;
13
- };
14
- withGuide: boolean;
15
- date: {
16
- monthNames: string[];
17
- messages: {
18
- invalidMonth: string;
19
- required: string;
20
- invalidDay: (days: number, month: string) => string;
21
- afterMin: (min: Date) => string;
22
- beforeMax: (max: Date) => string;
23
- };
24
- };
25
- }
26
- declare const settings: InternalClackSettings;
27
- interface ClackSettings {
28
- /**
29
- * Set custom global aliases for the default actions.
30
- * This will not overwrite existing aliases, it will only add new ones!
31
- *
32
- * @param aliases - An object that maps aliases to actions
33
- * @default { k: 'up', j: 'down', h: 'left', l: 'right', '\x03': 'cancel', 'escape': 'cancel' }
34
- */
35
- aliases?: Record<string, Action>;
36
- /**
37
- * Custom messages for prompts
38
- */
39
- messages?: {
40
- /**
41
- * Custom message to display when a spinner is cancelled
42
- * @default "Canceled"
43
- */
44
- cancel?: string;
45
- /**
46
- * Custom message to display when a spinner encounters an error
47
- * @default "Something went wrong"
48
- */
49
- error?: string;
50
- };
51
- withGuide?: boolean;
52
- /**
53
- * Date prompt localization
54
- */
55
- date?: {
56
- /** Month names for validation messages (January, February, ...) */
57
- monthNames?: string[];
58
- messages?: {
59
- /** Shown when date is missing */
60
- required?: string;
61
- /** Shown when month > 12 */
62
- invalidMonth?: string;
63
- /** (days, monthName) => message for invalid day */
64
- invalidDay?: (days: number, month: string) => string;
65
- /** (min) => message when date is before minDate */
66
- afterMin?: (min: Date) => string;
67
- /** (max) => message when date is after maxDate */
68
- beforeMax?: (max: Date) => string;
69
- };
70
- };
71
- }
72
- declare function updateSettings(updates: ClackSettings): void;
73
-
74
- /**
75
- * The state of the prompt
76
- */
77
- type ClackState = 'initial' | 'active' | 'cancel' | 'submit' | 'error';
78
- /**
79
- * Typed event emitter for clack
80
- */
81
- interface ClackEvents<TValue> {
82
- initial: (value?: any) => void;
83
- active: (value?: any) => void;
84
- cancel: (value?: any) => void;
85
- submit: (value?: any) => void;
86
- error: (value?: any) => void;
87
- cursor: (key?: Action) => void;
88
- key: (key: string | undefined, info: Key) => void;
89
- value: (value?: TValue) => void;
90
- userInput: (value: string) => void;
91
- confirm: (value?: boolean) => void;
92
- finalize: () => void;
93
- beforePrompt: () => void;
94
- }
95
-
96
- interface PromptOptions<TValue, Self extends Prompt<TValue>> {
97
- render(this: Omit<Self, 'prompt'>): string | undefined;
98
- initialValue?: any;
99
- initialUserInput?: string;
100
- validate?: ((value: TValue | undefined) => string | Error | undefined) | undefined;
101
- input?: Readable;
102
- output?: Writable;
103
- signal?: AbortSignal;
104
- }
105
- declare class Prompt<TValue> {
106
- protected input: Readable;
107
- protected output: Writable;
108
- private _abortSignal?;
109
- private rl;
110
- private opts;
111
- private _render;
112
- private _track;
113
- private _prevFrame;
114
- private _subscribers;
115
- protected _cursor: number;
116
- state: ClackState;
117
- error: string;
118
- value: TValue | undefined;
119
- userInput: string;
120
- constructor(options: PromptOptions<TValue, Prompt<TValue>>, trackValue?: boolean);
121
- /**
122
- * Unsubscribe all listeners
123
- */
124
- protected unsubscribe(): void;
125
- /**
126
- * Set a subscriber with opts
127
- * @param event - The event name
128
- */
129
- private setSubscriber;
130
- /**
131
- * Subscribe to an event
132
- * @param event - The event name
133
- * @param cb - The callback
134
- */
135
- on<T extends keyof ClackEvents<TValue>>(event: T, cb: ClackEvents<TValue>[T]): void;
136
- /**
137
- * Subscribe to an event once
138
- * @param event - The event name
139
- * @param cb - The callback
140
- */
141
- once<T extends keyof ClackEvents<TValue>>(event: T, cb: ClackEvents<TValue>[T]): void;
142
- /**
143
- * Emit an event with data
144
- * @param event - The event name
145
- * @param data - The data to pass to the callback
146
- */
147
- emit<T extends keyof ClackEvents<TValue>>(event: T, ...data: Parameters<ClackEvents<TValue>[T]>): void;
148
- prompt(): Promise<symbol | TValue | undefined>;
149
- protected _isActionKey(char: string | undefined, _key: Key): boolean;
150
- protected _shouldSubmit(_char: string | undefined, _key: Key): boolean;
151
- protected _setValue(value: TValue | undefined): void;
152
- protected _setUserInput(value: string | undefined, write?: boolean): void;
153
- protected _clearUserInput(): void;
154
- private onKeypress;
155
- protected close(): void;
156
- private restoreCursor;
157
- private render;
158
- }
159
-
160
- interface OptionLike$1 {
161
- value: unknown;
162
- label?: string;
163
- disabled?: boolean;
164
- }
165
- type FilterFunction<T extends OptionLike$1> = (search: string, opt: T) => boolean;
166
- interface AutocompleteOptions<T extends OptionLike$1> extends PromptOptions<T['value'] | T['value'][], AutocompletePrompt<T>> {
167
- options: T[] | ((this: AutocompletePrompt<T>) => T[]);
168
- filter?: FilterFunction<T>;
169
- multiple?: boolean;
170
- /**
171
- * When set (non-empty), pressing Tab with no input fills the field with this value
172
- * and runs the normal filter/selection logic so the user can confirm with Enter.
173
- * Tab only fills the input when the placeholder matches at least one option under
174
- * the prompt's filter (so the value remains selectable).
175
- */
176
- placeholder?: string;
177
- }
178
- declare class AutocompletePrompt<T extends OptionLike$1> extends Prompt<T['value'] | T['value'][]> {
179
- #private;
180
- filteredOptions: T[];
181
- multiple: boolean;
182
- isNavigating: boolean;
183
- selectedValues: Array<T['value']>;
184
- focusedValue: T['value'] | undefined;
185
- get cursor(): number;
186
- get userInputWithCursor(): string;
187
- get options(): T[];
188
- constructor(opts: AutocompleteOptions<T>);
189
- protected _isActionKey(char: string | undefined, key: Key): boolean;
190
- deselectAll(): void;
191
- toggleSelected(value: T['value']): void;
192
- }
193
-
194
- interface ConfirmOptions extends PromptOptions<boolean, ConfirmPrompt> {
195
- active: string;
196
- inactive: string;
197
- initialValue?: boolean;
198
- }
199
- declare class ConfirmPrompt extends Prompt<boolean> {
200
- get cursor(): 0 | 1;
201
- private get _value();
202
- constructor(opts: ConfirmOptions);
203
- }
204
-
205
- interface SegmentConfig {
206
- type: 'year' | 'month' | 'day';
207
- len: number;
208
- }
209
- interface DateParts {
210
- year: string;
211
- month: string;
212
- day: string;
213
- }
214
- type DateFormat = 'YMD' | 'MDY' | 'DMY';
215
- interface DateOptions extends PromptOptions<Date, DatePrompt> {
216
- format?: DateFormat;
217
- locale?: string;
218
- separator?: string;
219
- defaultValue?: Date;
220
- initialValue?: Date;
221
- minDate?: Date;
222
- maxDate?: Date;
223
- }
224
- declare class DatePrompt extends Prompt<Date> {
225
- #private;
226
- inlineError: string;
227
- get segmentCursor(): {
228
- segmentIndex: number;
229
- positionInSegment: number;
230
- };
231
- get segmentValues(): DateParts;
232
- get segments(): readonly SegmentConfig[];
233
- get separator(): string;
234
- get formattedValue(): string;
235
- constructor(opts: DateOptions);
236
- }
237
-
238
- interface GroupMultiSelectOptions<T extends {
239
- value: any;
240
- }> extends PromptOptions<T['value'][], GroupMultiSelectPrompt<T>> {
241
- options: Record<string, T[]>;
242
- initialValues?: T['value'][];
243
- required?: boolean;
244
- cursorAt?: T['value'];
245
- selectableGroups?: boolean;
246
- }
247
- declare class GroupMultiSelectPrompt<T extends {
248
- value: any;
249
- }> extends Prompt<T['value'][]> {
250
- #private;
251
- options: (T & {
252
- group: string | boolean;
253
- })[];
254
- cursor: number;
255
- getGroupItems(group: string): T[];
256
- isGroupSelected(group: string): boolean;
257
- private toggleValue;
258
- constructor(opts: GroupMultiSelectOptions<T>);
259
- }
260
-
261
- interface MultiLineOptions extends PromptOptions<string, MultiLinePrompt> {
262
- placeholder?: string;
263
- defaultValue?: string;
264
- showSubmit?: boolean;
265
- }
266
- declare class MultiLinePrompt extends Prompt<string> {
267
- #private;
268
- focused: 'editor' | 'submit';
269
- get userInputWithCursor(): string;
270
- get cursor(): number;
271
- protected _shouldSubmit(_char: string | undefined, _key: Key): boolean;
272
- constructor(opts: MultiLineOptions);
273
- }
274
-
275
- interface OptionLike {
276
- value: any;
277
- disabled?: boolean;
278
- }
279
- interface MultiSelectOptions<T extends OptionLike> extends PromptOptions<T['value'][], MultiSelectPrompt<T>> {
280
- options: T[];
281
- initialValues?: T['value'][];
282
- required?: boolean;
283
- cursorAt?: T['value'];
284
- }
285
- declare class MultiSelectPrompt<T extends OptionLike> extends Prompt<T['value'][]> {
286
- options: T[];
287
- cursor: number;
288
- private get _value();
289
- private get _enabledOptions();
290
- private toggleAll;
291
- private toggleInvert;
292
- private toggleValue;
293
- constructor(opts: MultiSelectOptions<T>);
294
- }
295
-
296
- interface PasswordOptions extends PromptOptions<string, PasswordPrompt> {
297
- mask?: string;
298
- }
299
- declare class PasswordPrompt extends Prompt<string> {
300
- private _mask;
301
- get cursor(): number;
302
- get masked(): string;
303
- get userInputWithCursor(): string;
304
- clear(): void;
305
- constructor({ mask, ...opts }: PasswordOptions);
306
- }
307
-
308
- interface SelectOptions<T extends {
309
- value: any;
310
- disabled?: boolean;
311
- }> extends PromptOptions<T['value'], SelectPrompt<T>> {
312
- options: T[];
313
- initialValue?: T['value'];
314
- }
315
- declare class SelectPrompt<T extends {
316
- value: any;
317
- disabled?: boolean;
318
- }> extends Prompt<T['value']> {
319
- options: T[];
320
- cursor: number;
321
- private get _selectedValue();
322
- private changeValue;
323
- constructor(opts: SelectOptions<T>);
324
- }
325
-
326
- interface SelectKeyOptions<T extends {
327
- value: string;
328
- }> extends PromptOptions<T['value'], SelectKeyPrompt<T>> {
329
- options: T[];
330
- caseSensitive?: boolean;
331
- }
332
- declare class SelectKeyPrompt<T extends {
333
- value: string;
334
- }> extends Prompt<T['value']> {
335
- options: T[];
336
- cursor: number;
337
- constructor(opts: SelectKeyOptions<T>);
338
- }
339
-
340
- interface TextOptions extends PromptOptions<string, TextPrompt> {
341
- placeholder?: string;
342
- defaultValue?: string;
343
- }
344
- declare class TextPrompt extends Prompt<string> {
345
- get userInputWithCursor(): string;
346
- get cursor(): number;
347
- constructor(opts: TextOptions);
348
- }
349
-
350
- declare function isCancel(value: unknown): value is symbol;
351
- interface BlockOptions {
352
- input?: Readable;
353
- output?: Writable;
354
- overwrite?: boolean;
355
- hideCursor?: boolean;
356
- }
357
- declare function block({ input, output, overwrite, hideCursor, }?: BlockOptions): () => void;
358
- declare const getColumns: (output: Writable) => number;
359
- declare const getRows: (output: Writable) => number;
360
- declare function wrapTextWithPrefix(output: Writable | undefined, text: string, prefix: string, startPrefix?: string, lineFormatter?: (line: string, index: number) => string): string;
361
-
362
- export { AutocompletePrompt, ConfirmPrompt, DatePrompt, GroupMultiSelectPrompt, MultiLinePrompt, MultiSelectPrompt, PasswordPrompt, Prompt, SelectKeyPrompt, SelectPrompt, TextPrompt, block, getColumns, getRows, isCancel, settings, updateSettings, wrapTextWithPrefix };
363
- export type { AutocompleteOptions, ClackSettings, ConfirmOptions, DateFormat, DateOptions, DateParts, GroupMultiSelectOptions, MultiLineOptions, MultiSelectOptions, PasswordOptions, PromptOptions, SelectKeyOptions, SelectOptions, ClackState as State, TextOptions };
@@ -1,17 +0,0 @@
1
- import{styleText as v}from"node:util";import{stdout as S,stdin as D}from"node:process";import*as b from"node:readline";import E from"node:readline";import{wrapAnsi as M}from"fast-wrap-ansi";import{cursor as c,erase as V}from"sisteransi";import{ReadStream as O}from"node:tty";function d(r,t,s){if(!s.some(o=>!o.disabled))return r;const e=r+t,i=Math.max(s.length-1,0),n=e<0?i:e>i?0:e;return s[n].disabled?d(n,t<0?-1:1,s):n}function I(r,t,s,e){const i=e.split(`
2
- `);let n=0,o=r;for(const a of i){if(o<=a.length)break;o-=a.length+1,n++}for(n=Math.max(0,Math.min(i.length-1,n+s)),o=Math.min(o,i[n].length)+t;o<0&&n>0;)n--,o+=i[n].length+1;for(;o>i[n].length&&n<i.length-1;)o-=i[n].length+1,n++;o=Math.max(0,Math.min(i[n].length,o));let u=0;for(let a=0;a<n;a++)u+=i[a].length+1;return u+o}const G=["up","down","left","right","space","enter","cancel"],K=["January","February","March","April","May","June","July","August","September","October","November","December"],h={actions:new Set(G),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...K],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(r,t)=>`There are only ${r} days in ${t}`,afterMin:r=>`Date must be on or after ${r.toISOString().slice(0,10)}`,beforeMax:r=>`Date must be on or before ${r.toISOString().slice(0,10)}`}}};function j(r){if(r.aliases!==void 0){const t=r.aliases;for(const s in t){if(!Object.hasOwn(t,s))continue;const e=t[s];h.actions.has(e)&&(h.aliases.has(s)||h.aliases.set(s,e))}}if(r.messages!==void 0){const t=r.messages;t.cancel!==void 0&&(h.messages.cancel=t.cancel),t.error!==void 0&&(h.messages.error=t.error)}if(r.withGuide!==void 0&&(h.withGuide=r.withGuide!==!1),r.date!==void 0){const t=r.date;t.monthNames!==void 0&&(h.date.monthNames=[...t.monthNames]),t.messages!==void 0&&(t.messages.required!==void 0&&(h.date.messages.required=t.messages.required),t.messages.invalidMonth!==void 0&&(h.date.messages.invalidMonth=t.messages.invalidMonth),t.messages.invalidDay!==void 0&&(h.date.messages.invalidDay=t.messages.invalidDay),t.messages.afterMin!==void 0&&(h.date.messages.afterMin=t.messages.afterMin),t.messages.beforeMax!==void 0&&(h.date.messages.beforeMax=t.messages.beforeMax))}}function C(r,t){if(typeof r=="string")return h.aliases.get(r)===t;for(const s of r)if(s!==void 0&&C(s,t))return!0;return!1}function z(r,t){if(r===t)return;const s=r.split(`
3
- `),e=t.split(`
4
- `),i=Math.max(s.length,e.length),n=[];for(let o=0;o<i;o++)s[o]!==e[o]&&n.push(o);return{lines:n,numLinesBefore:s.length,numLinesAfter:e.length,numLines:i}}const Y=globalThis.process.platform.startsWith("win"),k=Symbol("clack:cancel");function q(r){return r===k}function w(r,t){const s=r;s.isTTY&&s.setRawMode(t)}function R({input:r=D,output:t=S,overwrite:s=!0,hideCursor:e=!0}={}){const i=b.createInterface({input:r,output:t,prompt:"",tabSize:1});b.emitKeypressEvents(r,i),r instanceof O&&r.isTTY&&r.setRawMode(!0);const n=(o,{name:u,sequence:a})=>{const l=String(o);if(C([l,u,a],"cancel")){e&&t.write(c.show),process.exit(0);return}if(!s)return;const f=u==="return"?0:-1,y=u==="return"?-1:0;b.moveCursor(t,f,y,()=>{b.clearLine(t,1,()=>{r.once("keypress",n)})})};return e&&t.write(c.hide),r.once("keypress",n),()=>{r.off("keypress",n),e&&t.write(c.show),r instanceof O&&r.isTTY&&!Y&&r.setRawMode(!1),i.terminal=!1,i.close()}}const A=r=>"columns"in r&&typeof r.columns=="number"?r.columns:80,L=r=>"rows"in r&&typeof r.rows=="number"?r.rows:20;function W(r,t,s,e=s,i){const n=A(r??S);return M(t,n-s.length,{hard:!0,trim:!1}).split(`
5
- `).map((o,u)=>{const a=i?i(o,u):o;return`${u===0?e:s}${a}`}).join(`
6
- `)}let p=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(t,s=!0){const{input:e=D,output:i=S,render:n,signal:o,...u}=t;this.opts=u,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=n.bind(this),this._track=s,this._abortSignal=o,this.input=e,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(t,s){const e=this._subscribers.get(t)??[];e.push(s),this._subscribers.set(t,e)}on(t,s){this.setSubscriber(t,{cb:s})}once(t,s){this.setSubscriber(t,{cb:s,once:!0})}emit(t,...s){const e=this._subscribers.get(t)??[],i=[];for(const n of e)n.cb(...s),n.once&&i.push(()=>e.splice(e.indexOf(n),1));for(const n of i)n()}prompt(){return new Promise(t=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(k);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=E.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),w(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(c.show),this.output.off("resize",this.render),w(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(c.show),this.output.off("resize",this.render),w(this.input,!1),t(k)})})}_isActionKey(t,s){return t===" "}_shouldSubmit(t,s){return!0}_setValue(t){this.value=t,this.emit("value",this.value)}_setUserInput(t,s){this.userInput=t??"",this.emit("userInput",this.userInput),s&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(t,s){if(this._track&&s.name!=="return"&&(s.name&&this._isActionKey(t,s)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),s?.name&&(!this._track&&h.aliases.has(s.name)&&this.emit("cursor",h.aliases.get(s.name)),h.actions.has(s.name)&&this.emit("cursor",s.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),this.emit("key",t?.toLowerCase(),s),s?.name==="return"&&this._shouldSubmit(t,s)){if(this.opts.validate){const e=this.opts.validate(this.value);e&&(this.error=e instanceof Error?e.message:e,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}C([t,s?.name,s?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
7
- `),w(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const t=M(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
8
- `).length-1;this.output.write(c.move(-999,t*-1))}render(){const t=M(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(c.hide);else{const s=z(this._prevFrame,t),e=L(this.output);if(this.restoreCursor(),s){const i=Math.max(0,s.numLinesAfter-e),n=Math.max(0,s.numLinesBefore-e);let o=s.lines.find(u=>u>=i);if(o===void 0){this._prevFrame=t;return}if(s.lines.length===1){this.output.write(c.move(0,o-n)),this.output.write(V.lines(1));const u=t.split(`
9
- `);this.output.write(u[o]),this._prevFrame=t,this.output.write(c.move(0,u.length-o-1));return}else if(s.lines.length>1){if(i<n)o=i;else{const a=o-n;a>0&&this.output.write(c.move(0,a))}this.output.write(V.down());const u=t.split(`
10
- `).slice(o);this.output.write(u.join(`
11
- `)),this._prevFrame=t;return}}this.output.write(V.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}};function B(r,t){if(r===void 0||t.length===0)return 0;const s=t.findIndex(e=>e.value===r);return s!==-1?s:0}function J(r,t){return(t.label??String(t.value)).toLowerCase().includes(r.toLowerCase())}function H(r,t){if(t)return r?t:t[0]}let Q=class extends p{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#s=0;#r="";#t;#n;#u;get cursor(){return this.#s}get userInputWithCursor(){if(!this.userInput)return v(["inverse","hidden"],"_");if(this._cursor>=this.userInput.length)return`${this.userInput}\u2588`;const t=this.userInput.slice(0,this._cursor),[s,...e]=this.userInput.slice(this._cursor);return`${t}${v("inverse",s)}${e.join("")}`}get options(){return typeof this.#n=="function"?this.#n():this.#n}constructor(t){super(t),this.#n=t.options,this.#u=t.placeholder;const s=this.options;this.filteredOptions=[...s],this.multiple=t.multiple===!0,this.#t=typeof t.options=="function"?t.filter:t.filter??J;let e;if(t.initialValue&&Array.isArray(t.initialValue)?this.multiple?e=t.initialValue:e=t.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(e=[this.options[0].value]),e)for(const i of e){const n=s.findIndex(o=>o.value===i);n!==-1&&(this.toggleSelected(i),this.#s=n)}this.focusedValue=this.options[this.#s]?.value,this.on("key",(i,n)=>this.#e(i,n)),this.on("userInput",i=>this.#i(i))}_isActionKey(t,s){return t===" "||this.multiple&&this.isNavigating&&s.name==="space"&&t!==void 0&&t!==""}#e(t,s){const e=s.name==="up",i=s.name==="down",n=s.name==="return",o=this.userInput===""||this.userInput===" ",u=this.#u,a=this.options,l=u!==void 0&&u!==""&&a.some(f=>!f.disabled&&(this.#t?this.#t(u,f):!0));if(s.name==="tab"&&o&&l){this.userInput===" "&&this._clearUserInput(),this._setUserInput(u,!0),this.isNavigating=!1;return}e||i?(this.#s=d(this.#s,e?-1:1,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#s]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):n?this.value=H(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(s.name==="tab"||this.isNavigating&&s.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected(t){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(t)?this.selectedValues=this.selectedValues.filter(s=>s!==t):this.selectedValues=[...this.selectedValues,t]:this.selectedValues=[t])}#i(t){if(t!==this.#r){this.#r=t;const s=this.options;t&&this.#t?this.filteredOptions=s.filter(n=>this.#t?.(t,n)):this.filteredOptions=[...s];const e=B(this.focusedValue,this.filteredOptions);this.#s=d(e,0,this.filteredOptions);const i=this.filteredOptions[this.#s];i&&!i.disabled?this.focusedValue=i.value:this.focusedValue=void 0,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}};class X extends p{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",s=>{this.output.write(c.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}const Z={Y:{type:"year",len:4},M:{type:"month",len:2},D:{type:"day",len:2}};function P(r){return[...r].map(t=>Z[t])}function tt(r){const t=new Intl.DateTimeFormat(r,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date(2e3,0,15)),s=[];let e="/";for(const i of t)i.type==="literal"?e=i.value.trim()||i.value:(i.type==="year"||i.type==="month"||i.type==="day")&&s.push({type:i.type,len:i.type==="year"?4:2});return{segments:s,separator:e}}function U(r){return Number.parseInt((r||"0").replace(/_/g,"0"),10)||0}function x(r){return{year:U(r.year),month:U(r.month),day:U(r.day)}}function $(r,t){return new Date(r||2001,t||1,0).getDate()}function F(r){const{year:t,month:s,day:e}=x(r);if(!t||t<0||t>9999||!s||s<1||s>12||!e||e<1)return;const i=new Date(Date.UTC(t,s-1,e));if(!(i.getUTCFullYear()!==t||i.getUTCMonth()!==s-1||i.getUTCDate()!==e))return{year:t,month:s,day:e}}function N(r){const t=F(r);return t?new Date(Date.UTC(t.year,t.month-1,t.day)):void 0}function st(r,t,s,e){const i=s?{year:s.getUTCFullYear(),month:s.getUTCMonth()+1,day:s.getUTCDate()}:null,n=e?{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate()}:null;return r==="year"?{min:i?.year??1,max:n?.year??9999}:r==="month"?{min:i&&t.year===i.year?i.month:1,max:n&&t.year===n.year?n.month:12}:{min:i&&t.year===i.year&&t.month===i.month?i.day:1,max:n&&t.year===n.year&&t.month===n.month?n.day:$(t.year,t.month)}}class et extends p{#s;#r;#t;#n;#u;#e={segmentIndex:0,positionInSegment:0};#i=!0;#o=null;inlineError="";get segmentCursor(){return{...this.#e}}get segmentValues(){return{...this.#t}}get segments(){return this.#s}get separator(){return this.#r}get formattedValue(){return this.#c(this.#t)}#c(t){return this.#s.map(s=>t[s.type]).join(this.#r)}#a(){this._setUserInput(this.#c(this.#t)),this._setValue(N(this.#t)??void 0)}constructor(t){const s=t.format?{segments:P(t.format),separator:t.separator??"/"}:tt(t.locale),e=t.separator??s.separator,i=t.format?P(t.format):s.segments,n=t.initialValue??t.defaultValue,o=n?{year:String(n.getUTCFullYear()).padStart(4,"0"),month:String(n.getUTCMonth()+1).padStart(2,"0"),day:String(n.getUTCDate()).padStart(2,"0")}:{year:"____",month:"__",day:"__"},u=i.map(a=>o[a.type]).join(e);super({...t,initialUserInput:u},!1),this.#s=i,this.#r=e,this.#t=o,this.#n=t.minDate,this.#u=t.maxDate,this.#a(),this.on("cursor",a=>this.#d(a)),this.on("key",(a,l)=>this.#f(a,l)),this.on("finalize",()=>this.#g(t))}#h(){const t=Math.max(0,Math.min(this.#e.segmentIndex,this.#s.length-1)),s=this.#s[t];if(s)return this.#e.positionInSegment=Math.max(0,Math.min(this.#e.positionInSegment,s.len-1)),{segment:s,index:t}}#l(t){this.inlineError="",this.#o=null;const s=this.#h();s&&(this.#e.segmentIndex=Math.max(0,Math.min(this.#s.length-1,s.index+t)),this.#e.positionInSegment=0,this.#i=!0)}#p(t){const s=this.#h();if(!s)return;const{segment:e}=s,i=this.#t[e.type],n=!i||i.replace(/_/g,"")==="",o=Number.parseInt((i||"0").replace(/_/g,"0"),10)||0,u=st(e.type,x(this.#t),this.#n,this.#u);let a;n?a=t===1?u.min:u.max:a=Math.max(Math.min(u.max,o+t),u.min),this.#t={...this.#t,[e.type]:a.toString().padStart(e.len,"0")},this.#i=!0,this.#o=null,this.#a()}#d(t){if(t)switch(t){case"right":return this.#l(1);case"left":return this.#l(-1);case"up":return this.#p(1);case"down":return this.#p(-1)}}#f(t,s){if(s?.name==="backspace"||s?.sequence==="\x7F"||s?.sequence==="\b"||t==="\x7F"||t==="\b"){this.inlineError="";const e=this.#h();if(!e)return;if(!this.#t[e.segment.type].replace(/_/g,"")){this.#l(-1);return}this.#t[e.segment.type]="_".repeat(e.segment.len),this.#i=!0,this.#e.positionInSegment=0,this.#a();return}if(s?.name==="tab"){this.inlineError="";const e=this.#h();if(!e)return;const i=s.shift?-1:1,n=e.index+i;n>=0&&n<this.#s.length&&(this.#e.segmentIndex=n,this.#e.positionInSegment=0,this.#i=!0);return}if(t&&/^[0-9]$/.test(t)){const e=this.#h();if(!e)return;const{segment:i}=e,n=!this.#t[i.type].replace(/_/g,"");if(this.#i&&this.#o!==null&&!n){const m=this.#o+t,g={...this.#t,[i.type]:m},_=this.#m(g,i);if(_){this.inlineError=_,this.#o=null,this.#i=!1;return}this.inlineError="",this.#t[i.type]=m,this.#o=null,this.#i=!1,this.#a(),e.index<this.#s.length-1&&(this.#e.segmentIndex=e.index+1,this.#e.positionInSegment=0,this.#i=!0);return}this.#i&&!n&&(this.#t[i.type]="_".repeat(i.len),this.#e.positionInSegment=0),this.#i=!1,this.#o=null;const o=this.#t[i.type],u=o.indexOf("_"),a=u>=0?u:Math.min(this.#e.positionInSegment,i.len-1);if(a<0||a>=i.len)return;let l=o.slice(0,a)+t+o.slice(a+1),f=!1;if(a===0&&o==="__"&&(i.type==="month"||i.type==="day")){const m=Number.parseInt(t,10);l=`0${t}`,f=m<=(i.type==="month"?1:2)}if(i.type==="year"&&(l=(o.replace(/_/g,"")+t).padStart(i.len,"_")),!l.includes("_")){const m={...this.#t,[i.type]:l},g=this.#m(m,i);if(g){this.inlineError=g;return}}this.inlineError="",this.#t[i.type]=l;const y=l.includes("_")?void 0:F(this.#t);if(y){const{year:m,month:g}=y,_=$(m,g);this.#t={year:String(Math.max(0,Math.min(9999,m))).padStart(4,"0"),month:String(Math.max(1,Math.min(12,g))).padStart(2,"0"),day:String(Math.max(1,Math.min(_,y.day))).padStart(2,"0")}}this.#a();const T=l.indexOf("_");f?(this.#i=!0,this.#o=t):T>=0?this.#e.positionInSegment=T:u>=0&&e.index<this.#s.length-1?(this.#e.segmentIndex=e.index+1,this.#e.positionInSegment=0,this.#i=!0):this.#e.positionInSegment=Math.min(a+1,i.len-1)}}#m(t,s){const{month:e,day:i}=x(t);if(s.type==="month"&&(e<0||e>12))return h.date.messages.invalidMonth;if(s.type==="day"&&(i<0||i>31))return h.date.messages.invalidDay(31,"any month")}#g(t){const{year:s,month:e,day:i}=x(this.#t);if(s&&e&&i){const n=$(s,e);this.#t={...this.#t,day:String(Math.min(i,n)).padStart(2,"0")}}this.value=N(this.#t)??t.defaultValue??void 0}}class it extends p{options;cursor=0;#s;getGroupItems(t){return this.options.filter(s=>s.group===t)}isGroupSelected(t){const s=this.getGroupItems(t),e=this.value;return e===void 0?!1:s.every(i=>e.includes(i.value))}toggleValue(){const t=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),t.group===!0){const s=t.value,e=this.getGroupItems(s);this.isGroupSelected(s)?this.value=this.value.filter(i=>e.findIndex(n=>n.value===i)===-1):this.value=[...this.value,...e.map(i=>i.value)],this.value=Array.from(new Set(this.value))}else{const s=this.value.includes(t.value);this.value=s?this.value.filter(e=>e!==t.value):[...this.value,t.value]}}constructor(t){super(t,!1);const{options:s}=t;this.#s=t.selectableGroups!==!1,this.options=Object.entries(s).flatMap(([e,i])=>[{value:e,group:!0,label:e},...i.map(n=>({...n,group:e}))]),this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:e})=>e===t.cursorAt),this.#s?0:1),this.on("cursor",e=>{switch(e){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;const i=this.options[this.cursor]?.group===!0;!this.#s&&i&&(this.cursor=this.cursor===0?this.options.length-1:this.cursor-1);break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;const i=this.options[this.cursor]?.group===!0;!this.#s&&i&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}}class rt extends p{#s=!1;#r;focused="editor";get userInputWithCursor(){if(this.state==="submit")return this.userInput;const t=this.userInput;if(this.cursor>=t.length)return`${t}\u2588`;const s=t.slice(0,this.cursor),e=t[this.cursor],i=t.slice(this.cursor+1);return e===`
12
- `?`${s}\u2588
13
- ${i}`:`${s}${v("inverse",e)}${i}`}get cursor(){return this._cursor}#t(t){if(this.userInput.length===0){this._setUserInput(t);return}this._setUserInput(this.userInput.slice(0,this.cursor)+t+this.userInput.slice(this.cursor))}#n(t){const s=this.value??"";switch(t){case"up":this._cursor=I(this._cursor,0,-1,s);return;case"down":this._cursor=I(this._cursor,0,1,s);return;case"left":this._cursor=I(this._cursor,-1,0,s);return;case"right":this._cursor=I(this._cursor,1,0,s);return}}_shouldSubmit(t,s){if(this.#r)return this.focused==="submit"?!0:(this.#t(`
14
- `),this._cursor++,!1);const e=this.#s;return this.#s=!0,e?(this.userInput[this.cursor-1]===`
15
- `&&(this._setUserInput(this.userInput.slice(0,this.cursor-1)+this.userInput.slice(this.cursor)),this._cursor--),!0):(this.#t(`
16
- `),this._cursor++,!1)}constructor(t){super(t,!1),this.#r=t.showSubmit??!1,this.on("key",(s,e)=>{if(e?.name&&h.actions.has(e.name)){this.#n(e.name);return}if(s===" "&&this.#r){this.focused=this.focused==="editor"?"submit":"editor";return}if(e?.name!=="return"){if(this.#s=!1,e?.name==="backspace"&&this.cursor>0){this._setUserInput(this.userInput.slice(0,this.cursor-1)+this.userInput.slice(this.cursor)),this._cursor--;return}if(e?.name==="delete"&&this.cursor<this.userInput.length){this._setUserInput(this.userInput.slice(0,this.cursor)+this.userInput.slice(this.cursor+1));return}s&&(this.#r&&this.focused==="submit"&&(this.focused="editor"),this.#t(s??""),this._cursor++)}}),this.on("userInput",s=>{this._setValue(s)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}}let nt=class extends p{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(t=>t.disabled!==!0)}toggleAll(){const t=this._enabledOptions,s=this.value!==void 0&&this.value.length===t.length;this.value=s?[]:t.map(e=>e.value)}toggleInvert(){const t=this.value;if(!t)return;const s=this._enabledOptions.filter(e=>!t.includes(e.value));this.value=s.map(e=>e.value)}toggleValue(){this.value===void 0&&(this.value=[]);const t=this.value.includes(this._value);this.value=t?this.value.filter(s=>s!==this._value):[...this.value,this._value]}constructor(t){super(t,!1),this.options=t.options,this.value=[...t.initialValues??[]];const s=Math.max(this.options.findIndex(({value:e})=>e===t.cursorAt),0);this.cursor=this.options[s].disabled?d(s,1,this.options):s,this.on("key",e=>{e==="a"&&this.toggleAll(),e==="i"&&this.toggleInvert()}),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=d(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=d(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}};class ot extends p{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;const t=this.userInput;if(this.cursor>=t.length)return`${this.masked}${v(["inverse","hidden"],"_")}`;const s=this.masked,e=s.slice(0,this.cursor),i=s.slice(this.cursor);return`${e}${v("inverse",i[0])}${i.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:t,...s}){super(s),this._mask=t??"\u2022",this.on("userInput",e=>{this._setValue(e)})}}class ut extends p{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(t){super(t,!1),this.options=t.options;const s=this.options.findIndex(({value:i})=>i===t.initialValue),e=s===-1?0:s;this.cursor=this.options[e].disabled?d(e,1,this.options):e,this.changeValue(),this.on("cursor",i=>{switch(i){case"left":case"up":this.cursor=d(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=d(this.cursor,1,this.options);break}this.changeValue()})}}class at extends p{options;cursor=0;constructor(t){super(t,!1),this.options=t.options;const s=t.caseSensitive===!0,e=this.options.map(({value:[i]})=>s?i:i?.toLowerCase());this.cursor=Math.max(e.indexOf(t.initialValue),0),this.on("key",(i,n)=>{if(!i)return;const o=s&&n.shift?i.toUpperCase():i;if(!e.includes(o))return;const u=this.options.find(({value:[a]})=>s?a===o:a?.toLowerCase()===i);u&&(this.value=u.value,this.state="submit",this.emit("submit"))})}}class ht extends p{get userInputWithCursor(){if(this.state==="submit")return this.userInput;const t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;const s=t.slice(0,this.cursor),[e,...i]=t.slice(this.cursor);return`${s}${v("inverse",e)}${i.join("")}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",s=>{this._setValue(s)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}}export{Q as AutocompletePrompt,X as ConfirmPrompt,et as DatePrompt,it as GroupMultiSelectPrompt,rt as MultiLinePrompt,nt as MultiSelectPrompt,ot as PasswordPrompt,p as Prompt,at as SelectKeyPrompt,ut as SelectPrompt,ht as TextPrompt,R as block,A as getColumns,L as getRows,q as isCancel,h as settings,j as updateSettings,W as wrapTextWithPrefix};
17
- //# sourceMappingURL=index.mjs.map