commandkit 1.2.0-rc.9 → 1.2.0

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 (420) hide show
  1. package/LICENSE +19 -3
  2. package/README.md +45 -26
  3. package/bin/index.mjs +1 -1
  4. package/cli.d.ts +19 -0
  5. package/config.cjs +3 -0
  6. package/config.d.ts +1 -0
  7. package/dist/{ActionRow-DKnFVDME.d.ts → ActionRow-Bt9qi0Mb.d.ts} +4 -5
  8. package/dist/{Button-4ZUXdA56.d.ts → Button-DxJLcZIU.d.ts} +7 -8
  9. package/dist/{ButtonKit-C7r7RPNf.d.ts → ButtonKit-BfcyvWfj.d.ts} +4 -5
  10. package/dist/{ChannelSelectMenuKit-BrXvBYNH.d.ts → ChannelSelectMenuKit-DYkudikb.d.ts} +5 -6
  11. package/dist/{CommandsRouter-CoOA7hkf.d.ts → CommandsRouter-DiNoF0dq.d.ts} +2 -3
  12. package/dist/{EventInterceptor-x-R2qshQ.d.ts → EventInterceptor-D9JKMcfi.d.ts} +2 -2
  13. package/dist/{EventsRouter-BacqK6z3.d.ts → EventsRouter-EuuSu6NH.d.ts} +2 -2
  14. package/dist/{MentionableSelectMenuKit-CPTKqx-O.d.ts → MentionableSelectMenuKit-Mu4xqP6B.d.ts} +5 -6
  15. package/dist/{MessageCommandParser-ROLibZPX.d.ts → MessageCommandParser-DPCbHXCS.d.ts} +4 -5
  16. package/dist/{Modal-C6UTRdYQ.d.ts → Modal-v9rrcMl-.d.ts} +25 -12
  17. package/dist/{ModalKit-Btz58KYn.d.ts → ModalKit-XJSM65SV.d.ts} +4 -5
  18. package/dist/{RoleSelectMenuKit-C26lU3sN.d.ts → RoleSelectMenuKit-CCjcp3HY.d.ts} +5 -6
  19. package/dist/{SelectMenu-Diy87_ba.d.ts → SelectMenu-CY0vvoSu.d.ts} +17 -14
  20. package/dist/{StringSelectMenuKit-Bhs8U6WI.d.ts → StringSelectMenuKit-G5nBTicX.d.ts} +5 -6
  21. package/dist/{UserSelectMenuKit-CfqFJdxz.d.ts → UserSelectMenuKit-D3SO_fXA.d.ts} +5 -6
  22. package/dist/analytics/analytics-engine.d.ts +1 -31
  23. package/dist/analytics/analytics-engine.js +2 -36
  24. package/dist/analytics/analytics-provider.d.ts +1 -31
  25. package/dist/analytics/analytics-provider.js +1 -0
  26. package/dist/analytics/constants.js +26 -3
  27. package/dist/analytics/constants.js.map +1 -0
  28. package/dist/analytics/utils.js +2 -36
  29. package/dist/{analytics-engine-B7JNRnEN.d.ts → analytics-engine-DnRsHBId.d.ts} +48 -34
  30. package/dist/app/commands/AppCommandRunner.d.ts +1 -31
  31. package/dist/app/commands/AppCommandRunner.js +2 -36
  32. package/dist/app/commands/Context.d.ts +1 -31
  33. package/dist/app/commands/Context.js +2 -36
  34. package/dist/app/commands/MessageCommandParser.d.ts +1 -1
  35. package/dist/app/commands/MessageCommandParser.js +261 -4
  36. package/dist/app/commands/MessageCommandParser.js.map +1 -0
  37. package/dist/app/commands/helpers.d.ts +1 -1
  38. package/dist/app/commands/helpers.js +25 -3
  39. package/dist/app/commands/helpers.js.map +1 -0
  40. package/dist/app/events/EventWorkerContext.d.ts +42 -33
  41. package/dist/app/events/EventWorkerContext.js +48 -5
  42. package/dist/app/events/EventWorkerContext.js.map +1 -0
  43. package/dist/app/handlers/AppCommandHandler.d.ts +1 -31
  44. package/dist/app/handlers/AppCommandHandler.js +2 -36
  45. package/dist/app/handlers/AppEventsHandler.d.ts +1 -31
  46. package/dist/app/handlers/AppEventsHandler.js +2 -36
  47. package/dist/app/index.d.ts +4 -31
  48. package/dist/app/index.js +13 -45
  49. package/dist/app/interrupt/signals.d.ts +1 -1
  50. package/dist/app/interrupt/signals.js +54 -7
  51. package/dist/app/interrupt/signals.js.map +1 -0
  52. package/dist/app/middlewares/permissions.d.ts +1 -31
  53. package/dist/app/middlewares/permissions.js +2 -36
  54. package/dist/app/register/CommandRegistrar.d.ts +1 -31
  55. package/dist/app/register/CommandRegistrar.js +2 -36
  56. package/dist/app/router/CommandsRouter.d.ts +1 -1
  57. package/dist/app/router/CommandsRouter.js +210 -2
  58. package/dist/app/router/CommandsRouter.js.map +1 -0
  59. package/dist/app/router/EventsRouter.d.ts +1 -1
  60. package/dist/app/router/EventsRouter.js +128 -2
  61. package/dist/app/router/EventsRouter.js.map +1 -0
  62. package/dist/app/router/index.d.ts +2 -3
  63. package/dist/app/router/index.js +5 -5
  64. package/dist/{chunk-nOFOJqeH.js → chunk-BE-pF4vm.js} +11 -7
  65. package/dist/cli/app-process.d.ts +2 -3
  66. package/dist/cli/app-process.js +60 -7
  67. package/dist/cli/app-process.js.map +1 -0
  68. package/dist/cli/build.d.ts +2 -31
  69. package/dist/cli/build.js +171 -41
  70. package/dist/cli/build.js.map +1 -0
  71. package/dist/cli/common.d.ts +10 -34
  72. package/dist/cli/common.js +182 -11
  73. package/dist/cli/common.js.map +1 -0
  74. package/dist/cli/development.d.ts +18 -1
  75. package/dist/cli/development.js +52 -78
  76. package/dist/cli/development.js.map +1 -1
  77. package/dist/cli/env.d.ts +4 -0
  78. package/dist/cli/env.js +73 -9
  79. package/dist/cli/env.js.map +1 -0
  80. package/dist/cli/generators.js +10 -13
  81. package/dist/cli/generators.js.map +1 -1
  82. package/dist/cli/information.js +11 -10
  83. package/dist/cli/information.js.map +1 -1
  84. package/dist/cli/init.d.ts +12 -2
  85. package/dist/cli/init.js +83 -38
  86. package/dist/cli/init.js.map +1 -0
  87. package/dist/cli/production.d.ts +2 -3
  88. package/dist/cli/production.js +19 -52
  89. package/dist/cli/production.js.map +1 -1
  90. package/dist/cli/type-checker.js +83 -6
  91. package/dist/cli/type-checker.js.map +1 -0
  92. package/dist/cli/utils.d.ts +0 -1
  93. package/dist/cli/utils.js +18 -2
  94. package/dist/cli/utils.js.map +1 -0
  95. package/dist/{commandkit-Bm0gLN8i.js → commandkit--k6yDJEr.js} +3219 -2616
  96. package/dist/commandkit--k6yDJEr.js.map +1 -0
  97. package/dist/commandkit.d.ts +1 -31
  98. package/dist/commandkit.js +2 -36
  99. package/dist/{common-DOCvOVC4.d.ts → common-CCvvgnxi.d.ts} +4 -5
  100. package/dist/components/common/EventInterceptor.d.ts +1 -1
  101. package/dist/components/common/EventInterceptor.js +137 -2
  102. package/dist/components/common/EventInterceptor.js.map +1 -0
  103. package/dist/components/common/element.d.ts +2 -5
  104. package/dist/components/common/element.js +10 -8
  105. package/dist/components/common/types.d.ts +1 -1
  106. package/dist/components/common/types.js +1 -1
  107. package/dist/components/{v2 → display}/common.d.ts +1 -2
  108. package/dist/components/display/common.js +4 -0
  109. package/dist/components/display/container.d.ts +2 -0
  110. package/dist/components/display/container.js +4 -0
  111. package/dist/components/display/file.d.ts +2 -0
  112. package/dist/{file-DVOELoNv.js → components/display/file.js} +5 -10
  113. package/dist/components/display/file.js.map +1 -0
  114. package/dist/components/display/index.d.ts +9 -0
  115. package/dist/components/display/index.js +19 -0
  116. package/dist/components/display/label.d.ts +2 -0
  117. package/dist/components/display/label.js +4 -0
  118. package/dist/components/display/media-gallery.d.ts +2 -0
  119. package/dist/components/display/media-gallery.js +5 -0
  120. package/dist/components/display/poll.d.ts +2 -0
  121. package/dist/components/display/poll.js +86 -0
  122. package/dist/components/display/poll.js.map +1 -0
  123. package/dist/components/display/section.d.ts +2 -0
  124. package/dist/components/display/section.js +5 -0
  125. package/dist/components/display/separator.d.ts +2 -0
  126. package/dist/{separator-DL6QH5H1.js → components/display/separator.js} +5 -10
  127. package/dist/components/display/separator.js.map +1 -0
  128. package/dist/components/display/text-display.d.ts +2 -0
  129. package/dist/{text-display-DbMumig_.js → components/display/text-display.js} +5 -10
  130. package/dist/components/display/text-display.js.map +1 -0
  131. package/dist/components/index.d.ts +23 -24
  132. package/dist/components/index.js +29 -53
  133. package/dist/components/interactive/action-row/ActionRow.d.ts +2 -0
  134. package/dist/{ActionRow-CbdGFWMT.js → components/interactive/action-row/ActionRow.js} +5 -10
  135. package/dist/components/interactive/action-row/ActionRow.js.map +1 -0
  136. package/dist/components/interactive/button/Button.d.ts +2 -0
  137. package/dist/components/interactive/button/Button.js +4 -0
  138. package/dist/components/interactive/button/ButtonKit.d.ts +2 -0
  139. package/dist/components/interactive/button/ButtonKit.js +4 -0
  140. package/dist/components/interactive/modal/Modal.d.ts +2 -0
  141. package/dist/components/interactive/modal/Modal.js +8 -0
  142. package/dist/components/interactive/modal/ModalKit.d.ts +2 -0
  143. package/dist/components/interactive/modal/ModalKit.js +4 -0
  144. package/dist/components/interactive/select-menu/ChannelSelectMenuKit.d.ts +2 -0
  145. package/dist/components/interactive/select-menu/ChannelSelectMenuKit.js +4 -0
  146. package/dist/components/interactive/select-menu/MentionableSelectMenuKit.d.ts +2 -0
  147. package/dist/components/interactive/select-menu/MentionableSelectMenuKit.js +4 -0
  148. package/dist/components/interactive/select-menu/RoleSelectMenuKit.d.ts +2 -0
  149. package/dist/components/interactive/select-menu/RoleSelectMenuKit.js +4 -0
  150. package/dist/components/interactive/select-menu/SelectMenu.d.ts +2 -0
  151. package/dist/components/interactive/select-menu/SelectMenu.js +9 -0
  152. package/dist/components/interactive/select-menu/StringSelectMenuKit.d.ts +2 -0
  153. package/dist/components/interactive/select-menu/StringSelectMenuKit.js +4 -0
  154. package/dist/components/interactive/select-menu/UserSelectMenuKit.d.ts +2 -0
  155. package/dist/components/interactive/select-menu/UserSelectMenuKit.js +4 -0
  156. package/dist/components/interactive/select-menu/common.d.ts +2 -0
  157. package/dist/components/interactive/select-menu/common.js +1 -0
  158. package/dist/config/config.d.ts +15 -33
  159. package/dist/config/config.js +2 -36
  160. package/dist/config/default.d.ts +1 -31
  161. package/dist/config/default.js +2 -36
  162. package/dist/config/loader.d.ts +1 -31
  163. package/dist/config/loader.js +2 -36
  164. package/dist/config/types.d.ts +1 -31
  165. package/dist/config/types.js +1 -0
  166. package/dist/config/utils.d.ts +1 -31
  167. package/dist/config/utils.js +29 -2
  168. package/dist/config/utils.js.map +1 -0
  169. package/dist/{constants-D8PMA9on.d.ts → constants-DqtJY0t-.d.ts} +3 -3
  170. package/dist/{constants-MKu-Q1jh.d.ts → constants-DwxpkIeH.d.ts} +8 -2
  171. package/dist/{container-DHBELeJ3.d.ts → container-CYojOA9d.d.ts} +3 -4
  172. package/dist/context/async-context.d.ts +1 -31
  173. package/dist/context/async-context.js +2 -36
  174. package/dist/context/environment.d.ts +1 -31
  175. package/dist/context/environment.js +2 -36
  176. package/dist/{element-CAXu1XtK.d.ts → element-DeLvTMfZ.d.ts} +5 -5
  177. package/dist/events/CommandKitEventsChannel.d.ts +1 -31
  178. package/dist/events/CommandKitEventsChannel.js +83 -2
  179. package/dist/events/CommandKitEventsChannel.js.map +1 -0
  180. package/dist/{file-DTrr-p09.d.ts → file-DLO1zEcH.d.ts} +3 -4
  181. package/dist/flags/FlagProvider.d.ts +1 -31
  182. package/dist/flags/FlagProvider.js +1 -0
  183. package/dist/flags/FlagProvider.js.map +1 -1
  184. package/dist/flags/feature-flags.d.ts +1 -31
  185. package/dist/flags/feature-flags.js +5 -40
  186. package/dist/flags/store.d.ts +1 -31
  187. package/dist/flags/store.js +13 -2
  188. package/dist/flags/store.js.map +1 -0
  189. package/dist/{helpers-Wg6P5fRQ.d.ts → helpers-zmC44Mcu.d.ts} +2 -3
  190. package/dist/index-BIsCUWAs.d.ts +1 -0
  191. package/dist/index-CwHYpK-f.d.ts +1 -0
  192. package/dist/index-DHrsNvX1.d.ts +1 -0
  193. package/dist/index.d.ts +41 -42
  194. package/dist/index.js +80 -98
  195. package/dist/kv/constants.d.ts +1 -1
  196. package/dist/kv/constants.js +22 -2
  197. package/dist/kv/constants.js.map +1 -0
  198. package/dist/kv/dotprops.js +26 -3
  199. package/dist/kv/dotprops.js.map +1 -0
  200. package/dist/kv/kv.d.ts +1 -2
  201. package/dist/kv/kv.js +15 -18
  202. package/dist/kv/kv.js.map +1 -1
  203. package/dist/kv/serde.d.ts +12 -3
  204. package/dist/kv/serde.js +87 -4
  205. package/dist/kv/serde.js.map +1 -0
  206. package/dist/label-DqGRqodo.d.ts +28 -0
  207. package/dist/logger/DefaultLogger.d.ts +66 -3
  208. package/dist/logger/DefaultLogger.js +2 -36
  209. package/dist/logger/ILogger.d.ts +64 -2
  210. package/dist/logger/ILogger.js +1 -1
  211. package/dist/logger/Logger.d.ts +36 -3
  212. package/dist/logger/Logger.js +2 -36
  213. package/dist/logger/NoopLogger.d.ts +1 -2
  214. package/dist/logger/NoopLogger.js +1 -0
  215. package/dist/logger/NoopLogger.js.map +1 -1
  216. package/dist/{media-gallery-BMsXSot3.d.ts → media-gallery-Ca8es-eB.d.ts} +3 -4
  217. package/dist/plugins/CompilerPlugin.d.ts +1 -31
  218. package/dist/plugins/CompilerPlugin.js +33 -4
  219. package/dist/plugins/CompilerPlugin.js.map +1 -0
  220. package/dist/plugins/PluginCommon.d.ts +1 -31
  221. package/dist/plugins/PluginCommon.js +55 -4
  222. package/dist/plugins/PluginCommon.js.map +1 -0
  223. package/dist/plugins/RuntimePlugin.d.ts +1 -31
  224. package/dist/plugins/RuntimePlugin.js +124 -4
  225. package/dist/plugins/RuntimePlugin.js.map +1 -0
  226. package/dist/plugins/index.d.ts +1 -31
  227. package/dist/plugins/index.js +8 -40
  228. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +1 -31
  229. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +2 -36
  230. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +1 -31
  231. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +2 -36
  232. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +1 -31
  233. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +2 -36
  234. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +1 -31
  235. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +2 -36
  236. package/dist/plugins/plugin-runtime/runtime.d.ts +1 -31
  237. package/dist/plugins/plugin-runtime/runtime.js +1 -1
  238. package/dist/plugins/types.d.ts +1 -31
  239. package/dist/plugins/types.js +1 -1
  240. package/dist/poll-DQ6DX_Tt.d.ts +88 -0
  241. package/dist/{section-Dh_FhPeC.d.ts → section-Q8nwx_-q.d.ts} +3 -4
  242. package/dist/{separator-CMf6Cyy5.d.ts → separator-B8P-kdIK.d.ts} +3 -4
  243. package/dist/{signals-SHg7J1U_.d.ts → signals-CBXwugBW.d.ts} +2 -2
  244. package/dist/{text-display-DRw3r_lK.d.ts → text-display-CL9C2yMc.d.ts} +3 -4
  245. package/dist/{types-CJ-XvOFN.d.ts → types-DZy7U-Ld.d.ts} +2 -2
  246. package/dist/types.d.ts +2 -32
  247. package/dist/types.js +1 -0
  248. package/dist/utils/colors.js +9 -3
  249. package/dist/utils/colors.js.map +1 -0
  250. package/dist/utils/constants.d.ts +2 -2
  251. package/dist/utils/constants.js +50 -7
  252. package/dist/utils/constants.js.map +1 -0
  253. package/dist/utils/dev-hooks.d.ts +1 -31
  254. package/dist/utils/dev-hooks.js +2 -36
  255. package/dist/utils/error-codes.d.ts +54 -2
  256. package/dist/utils/error-codes.js +53 -5
  257. package/dist/utils/error-codes.js.map +1 -0
  258. package/dist/utils/resolve-file-url.d.ts +11 -2
  259. package/dist/utils/resolve-file-url.js +18 -2
  260. package/dist/utils/resolve-file-url.js.map +1 -0
  261. package/dist/utils/types-package.js +61 -4
  262. package/dist/utils/types-package.js.map +1 -0
  263. package/dist/utils/useful-stuff/async-queue.js +2 -2
  264. package/dist/utils/useful-stuff/async-queue.js.map +1 -1
  265. package/dist/utils/useful-stuff/mutex.js +1 -0
  266. package/dist/utils/useful-stuff/mutex.js.map +1 -1
  267. package/dist/utils/useful-stuff/ratelimiter.js +2 -2
  268. package/dist/utils/useful-stuff/ratelimiter.js.map +1 -1
  269. package/dist/utils/useful-stuff/semaphore.js +2 -3
  270. package/dist/utils/useful-stuff/semaphore.js.map +1 -1
  271. package/dist/utils/utilities.d.ts +113 -2
  272. package/dist/utils/utilities.js +5 -37
  273. package/dist/utils/{warn-unstable.d.ts → warning.d.ts} +12 -3
  274. package/dist/utils/{warn-unstable.js → warning.js} +15 -2
  275. package/dist/utils/warning.js.map +1 -0
  276. package/dist/version.d.ts +8 -2
  277. package/dist/version.js +13 -2
  278. package/dist/version.js.map +1 -0
  279. package/hooks.cjs +11 -4
  280. package/package.json +22 -18
  281. package/dist/ActionRow-CbdGFWMT.js.map +0 -1
  282. package/dist/CommandKitEventsChannel-BtRzr3Tz.js +0 -88
  283. package/dist/CommandKitEventsChannel-BtRzr3Tz.js.map +0 -1
  284. package/dist/CommandsRouter-Cgcy6cK9.js +0 -220
  285. package/dist/CommandsRouter-Cgcy6cK9.js.map +0 -1
  286. package/dist/CompilerPlugin-M8r3yNAl.js +0 -43
  287. package/dist/CompilerPlugin-M8r3yNAl.js.map +0 -1
  288. package/dist/DefaultLogger-XCOl5nLd.d.ts +0 -67
  289. package/dist/EventInterceptor-CQEXyUTp.js +0 -142
  290. package/dist/EventInterceptor-CQEXyUTp.js.map +0 -1
  291. package/dist/EventWorkerContext-BMk7IXpC.d.ts +0 -43
  292. package/dist/EventWorkerContext-Dq29tieI.js +0 -69
  293. package/dist/EventWorkerContext-Dq29tieI.js.map +0 -1
  294. package/dist/EventsRouter-3Gygh-km.js +0 -137
  295. package/dist/EventsRouter-3Gygh-km.js.map +0 -1
  296. package/dist/ILogger-BW8GM-YZ.d.ts +0 -64
  297. package/dist/ILogger-dQ7Y9X1f.js +0 -0
  298. package/dist/Logger-DyfkPk7u.d.ts +0 -37
  299. package/dist/MessageCommandParser-CEuO6Ex3.js +0 -269
  300. package/dist/MessageCommandParser-CEuO6Ex3.js.map +0 -1
  301. package/dist/PluginCommon-Cvl5yYM_.js +0 -71
  302. package/dist/PluginCommon-Cvl5yYM_.js.map +0 -1
  303. package/dist/RuntimePlugin-BUecuBIU.js +0 -134
  304. package/dist/RuntimePlugin-BUecuBIU.js.map +0 -1
  305. package/dist/app-HN1cVg8J.js +0 -0
  306. package/dist/app-process-DoG6Spkf.js +0 -68
  307. package/dist/app-process-DoG6Spkf.js.map +0 -1
  308. package/dist/build-C9ltqPmn.js +0 -175
  309. package/dist/build-C9ltqPmn.js.map +0 -1
  310. package/dist/colors-DL3ucTiT.js +0 -15
  311. package/dist/colors-DL3ucTiT.js.map +0 -1
  312. package/dist/commandkit-Bm0gLN8i.js.map +0 -1
  313. package/dist/common-CcfjYnPG.js +0 -0
  314. package/dist/common-Dxr9-XPa.js +0 -211
  315. package/dist/common-Dxr9-XPa.js.map +0 -1
  316. package/dist/common-vnMIelAE.js +0 -17
  317. package/dist/common-vnMIelAE.js.map +0 -1
  318. package/dist/components/v1/action-row/ActionRow.d.ts +0 -6
  319. package/dist/components/v1/action-row/ActionRow.js +0 -3
  320. package/dist/components/v1/button/Button.d.ts +0 -7
  321. package/dist/components/v1/button/Button.js +0 -38
  322. package/dist/components/v1/button/ButtonKit.d.ts +0 -3
  323. package/dist/components/v1/button/ButtonKit.js +0 -38
  324. package/dist/components/v1/modal/Modal.d.ts +0 -7
  325. package/dist/components/v1/modal/Modal.js +0 -41
  326. package/dist/components/v1/modal/ModalKit.d.ts +0 -3
  327. package/dist/components/v1/modal/ModalKit.js +0 -38
  328. package/dist/components/v1/select-menu/ChannelSelectMenuKit.d.ts +0 -4
  329. package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +0 -38
  330. package/dist/components/v1/select-menu/MentionableSelectMenuKit.d.ts +0 -4
  331. package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +0 -38
  332. package/dist/components/v1/select-menu/RoleSelectMenuKit.d.ts +0 -4
  333. package/dist/components/v1/select-menu/RoleSelectMenuKit.js +0 -38
  334. package/dist/components/v1/select-menu/SelectMenu.d.ts +0 -10
  335. package/dist/components/v1/select-menu/SelectMenu.js +0 -43
  336. package/dist/components/v1/select-menu/StringSelectMenuKit.d.ts +0 -4
  337. package/dist/components/v1/select-menu/StringSelectMenuKit.js +0 -38
  338. package/dist/components/v1/select-menu/UserSelectMenuKit.d.ts +0 -4
  339. package/dist/components/v1/select-menu/UserSelectMenuKit.js +0 -38
  340. package/dist/components/v1/select-menu/common.d.ts +0 -3
  341. package/dist/components/v1/select-menu/common.js +0 -1
  342. package/dist/components/v2/common.js +0 -3
  343. package/dist/components/v2/container.d.ts +0 -2
  344. package/dist/components/v2/container.js +0 -4
  345. package/dist/components/v2/file.d.ts +0 -2
  346. package/dist/components/v2/file.js +0 -3
  347. package/dist/components/v2/index.d.ts +0 -8
  348. package/dist/components/v2/index.js +0 -17
  349. package/dist/components/v2/media-gallery.d.ts +0 -2
  350. package/dist/components/v2/media-gallery.js +0 -5
  351. package/dist/components/v2/section.d.ts +0 -2
  352. package/dist/components/v2/section.js +0 -5
  353. package/dist/components/v2/separator.d.ts +0 -2
  354. package/dist/components/v2/separator.js +0 -3
  355. package/dist/components/v2/text-display.d.ts +0 -2
  356. package/dist/components/v2/text-display.js +0 -3
  357. package/dist/config-BhVxyjmZ.d.ts +0 -16
  358. package/dist/constants-4oxxvaJA.js +0 -27
  359. package/dist/constants-4oxxvaJA.js.map +0 -1
  360. package/dist/constants-B5_Ta7PR.js +0 -70
  361. package/dist/constants-B5_Ta7PR.js.map +0 -1
  362. package/dist/constants-BOOGN85p.js +0 -37
  363. package/dist/constants-BOOGN85p.js.map +0 -1
  364. package/dist/container-C6GtfAPW.js +0 -44
  365. package/dist/container-C6GtfAPW.js.map +0 -1
  366. package/dist/dotprops-tnhpnszJ.js +0 -36
  367. package/dist/dotprops-tnhpnszJ.js.map +0 -1
  368. package/dist/element-Bak9llw_.js +0 -84
  369. package/dist/element-Bak9llw_.js.map +0 -1
  370. package/dist/env-_68PRRoA.js +0 -109
  371. package/dist/env-_68PRRoA.js.map +0 -1
  372. package/dist/error-codes-B4TyW4Ct.d.ts +0 -54
  373. package/dist/error-codes-Ds0bnPvT.js +0 -73
  374. package/dist/error-codes-Ds0bnPvT.js.map +0 -1
  375. package/dist/feature-flags-nZJB7-e5.js +0 -160
  376. package/dist/feature-flags-nZJB7-e5.js.map +0 -1
  377. package/dist/file-DVOELoNv.js.map +0 -1
  378. package/dist/helpers-BSwwrKJW.js +0 -36
  379. package/dist/helpers-BSwwrKJW.js.map +0 -1
  380. package/dist/index-DKcmsWXw.d.ts +0 -1
  381. package/dist/index-DSBMRX9A.d.ts +0 -1
  382. package/dist/index-DdqikUQD.d.ts +0 -1
  383. package/dist/index.js.map +0 -1
  384. package/dist/init-Cy_bcUt4.js +0 -95
  385. package/dist/init-Cy_bcUt4.js.map +0 -1
  386. package/dist/init-DOr-Y3GQ.d.ts +0 -13
  387. package/dist/media-gallery-zDtJ3kxb.js +0 -62
  388. package/dist/media-gallery-zDtJ3kxb.js.map +0 -1
  389. package/dist/resolve-file-url-ChIyw-Vf.js +0 -23
  390. package/dist/resolve-file-url-ChIyw-Vf.js.map +0 -1
  391. package/dist/resolve-file-url-yO8bUxok.d.ts +0 -11
  392. package/dist/router-Dn35v30f.js +0 -0
  393. package/dist/runtime-DB9CiPfe.js +0 -0
  394. package/dist/section-DlvrDoJK.js +0 -60
  395. package/dist/section-DlvrDoJK.js.map +0 -1
  396. package/dist/separator-DL6QH5H1.js.map +0 -1
  397. package/dist/serde-BYaKrsOV.d.ts +0 -12
  398. package/dist/serde-Cc8iUa9J.js +0 -97
  399. package/dist/serde-Cc8iUa9J.js.map +0 -1
  400. package/dist/signals-ChFMD7mB.js +0 -74
  401. package/dist/signals-ChFMD7mB.js.map +0 -1
  402. package/dist/store-CM6pWVZh.js +0 -19
  403. package/dist/store-CM6pWVZh.js.map +0 -1
  404. package/dist/text-display-DbMumig_.js.map +0 -1
  405. package/dist/type-checker-DR7RZFs5.js +0 -90
  406. package/dist/type-checker-DR7RZFs5.js.map +0 -1
  407. package/dist/types-CUZOquUl.js +0 -0
  408. package/dist/types-package-BWArjyBF.js +0 -75
  409. package/dist/types-package-BWArjyBF.js.map +0 -1
  410. package/dist/types-q0Nm882H.js +0 -0
  411. package/dist/utilities-DtdPlr4c.d.ts +0 -87
  412. package/dist/utils/warn-unstable.js.map +0 -1
  413. package/dist/utils-DCSnVAZ6.js +0 -23
  414. package/dist/utils-DCSnVAZ6.js.map +0 -1
  415. package/dist/utils-KsNof0Xz.js +0 -34
  416. package/dist/utils-KsNof0Xz.js.map +0 -1
  417. package/dist/v2-DofkPKHs.js +0 -0
  418. package/dist/version-CtJtBJXI.d.ts +0 -8
  419. package/dist/version-DRSQMx0w.js +0 -18
  420. package/dist/version-DRSQMx0w.js.map +0 -1
@@ -1,62 +0,0 @@
1
- const require_chunk = require('./chunk-nOFOJqeH.js');
2
- const require_common = require('./common-vnMIelAE.js');
3
- let discord_js = require("discord.js");
4
- discord_js = require_chunk.__toESM(discord_js);
5
-
6
- //#region src/components/v2/media-gallery.ts
7
- /**
8
- * The media gallery component
9
- * @param props The properties for the media gallery component.
10
- * @returns The media gallery builder instance.
11
- * @example ```tsx
12
- * import { MediaGallery } from 'commandkit';
13
- *
14
- * const gallery = (
15
- * <MediaGallery>
16
- * <MediaGalleryItem url="https://example.com/image1.png" description="Image 1" />
17
- * <MediaGalleryItem url="https://example.com/image2.png" description="Image 2" />
18
- * </MediaGallery>
19
- * );
20
- * ```
21
- */
22
- function MediaGallery(props) {
23
- const gallery = new discord_js.MediaGalleryBuilder();
24
- require_common.applyId(props, gallery);
25
- if (props.children != null) {
26
- if (!Array.isArray(props.children)) props.children = [props.children];
27
- gallery.addItems(props.children.flat());
28
- }
29
- return gallery;
30
- }
31
- /**
32
- * The media gallery item component
33
- * @param props The properties for the media gallery item component.
34
- * @returns The media gallery item builder instance.
35
- * @example ```tsx
36
- * import { MediaGalleryItem } from 'commandkit';
37
- *
38
- * const item = <MediaGalleryItem url="https://example.com/image.png" description="An image" />;
39
- * ```
40
- */
41
- function MediaGalleryItem(props) {
42
- const item = new discord_js.MediaGalleryItemBuilder();
43
- if (props.description != null) item.setDescription(props.description);
44
- if (props.spoiler != null) item.setSpoiler(props.spoiler);
45
- if (props.url != null) item.setURL(props.url);
46
- return item;
47
- }
48
-
49
- //#endregion
50
- Object.defineProperty(exports, 'MediaGallery', {
51
- enumerable: true,
52
- get: function () {
53
- return MediaGallery;
54
- }
55
- });
56
- Object.defineProperty(exports, 'MediaGalleryItem', {
57
- enumerable: true,
58
- get: function () {
59
- return MediaGalleryItem;
60
- }
61
- });
62
- //# sourceMappingURL=media-gallery-zDtJ3kxb.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"media-gallery-zDtJ3kxb.js","names":[],"sources":["../src/components/v2/media-gallery.ts"],"sourcesContent":["import { MediaGalleryBuilder, MediaGalleryItemBuilder } from 'discord.js';\nimport { applyId } from './common';\n\n/**\n * Represents the properties for a media gallery component.\n */\nexport interface MediaGalleryProps {\n id?: number;\n children?: MediaGalleryItemBuilder[];\n}\n\n/**\n * The media gallery component\n * @param props The properties for the media gallery component.\n * @returns The media gallery builder instance.\n * @example ```tsx\n * import { MediaGallery } from 'commandkit';\n *\n * const gallery = (\n * <MediaGallery>\n * <MediaGalleryItem url=\"https://example.com/image1.png\" description=\"Image 1\" />\n * <MediaGalleryItem url=\"https://example.com/image2.png\" description=\"Image 2\" />\n * </MediaGallery>\n * );\n * ```\n */\nexport function MediaGallery(props: MediaGalleryProps) {\n const gallery = new MediaGalleryBuilder();\n\n applyId(props, gallery);\n\n if (props.children != null) {\n if (!Array.isArray(props.children)) props.children = [props.children];\n gallery.addItems(props.children.flat());\n }\n\n return gallery;\n}\n\n/**\n * Represents the properties for a media gallery item component.\n */\nexport interface MediaGalleryItemProps {\n description?: string;\n spoiler?: boolean;\n url?: string;\n}\n\n/**\n * The media gallery item component\n * @param props The properties for the media gallery item component.\n * @returns The media gallery item builder instance.\n * @example ```tsx\n * import { MediaGalleryItem } from 'commandkit';\n *\n * const item = <MediaGalleryItem url=\"https://example.com/image.png\" description=\"An image\" />;\n * ```\n */\nexport function MediaGalleryItem(props: MediaGalleryItemProps) {\n const item = new MediaGalleryItemBuilder();\n\n if (props.description != null) {\n item.setDescription(props.description);\n }\n\n if (props.spoiler != null) {\n item.setSpoiler(props.spoiler);\n }\n\n if (props.url != null) {\n item.setURL(props.url);\n }\n\n return item;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0BA,SAAgB,aAAa,OAA0B;CACrD,MAAM,UAAU,IAAI,gCAAqB;AAEzC,wBAAQ,OAAO,QAAQ;AAEvB,KAAI,MAAM,YAAY,MAAM;AAC1B,MAAI,CAAC,MAAM,QAAQ,MAAM,SAAS,CAAE,OAAM,WAAW,CAAC,MAAM,SAAS;AACrE,UAAQ,SAAS,MAAM,SAAS,MAAM,CAAC;;AAGzC,QAAO;;;;;;;;;;;;AAsBT,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,OAAO,IAAI,oCAAyB;AAE1C,KAAI,MAAM,eAAe,KACvB,MAAK,eAAe,MAAM,YAAY;AAGxC,KAAI,MAAM,WAAW,KACnB,MAAK,WAAW,MAAM,QAAQ;AAGhC,KAAI,MAAM,OAAO,KACf,MAAK,OAAO,MAAM,IAAI;AAGxB,QAAO"}
@@ -1,23 +0,0 @@
1
- const require_chunk = require('./chunk-nOFOJqeH.js');
2
- let path = require("path");
3
- path = require_chunk.__toESM(path);
4
-
5
- //#region src/utils/resolve-file-url.ts
6
- /**
7
- * Convert a local file path to a file URL.
8
- * @param filePath - The local file's path.
9
- * @param withTs - Whether to append a timestamp to the URL.
10
- * @returns - The converted file URL.
11
- */
12
- function toFileURL(filePath, withTs = false) {
13
- return `${"file://" + path.default.resolve(filePath).replace(/\\\\|\\/g, "/")}${withTs ? `?ts=${Date.now()}` : ""}`;
14
- }
15
-
16
- //#endregion
17
- Object.defineProperty(exports, 'toFileURL', {
18
- enumerable: true,
19
- get: function () {
20
- return toFileURL;
21
- }
22
- });
23
- //# sourceMappingURL=resolve-file-url-ChIyw-Vf.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-file-url-ChIyw-Vf.js","names":[],"sources":["../src/utils/resolve-file-url.ts"],"sourcesContent":["import path from 'path';\n\n/**\n * Convert a local file path to a file URL.\n * @param filePath - The local file's path.\n * @param withTs - Whether to append a timestamp to the URL.\n * @returns - The converted file URL.\n */\nexport function toFileURL(filePath: string, withTs = false) {\n const resolvedPath = path.resolve(filePath);\n return `${'file://' + resolvedPath.replace(/\\\\\\\\|\\\\/g, '/')}${withTs ? `?ts=${Date.now()}` : ''}`;\n}\n"],"mappings":";;;;;;;;;;;AAQA,SAAgB,UAAU,UAAkB,SAAS,OAAO;AAE1D,QAAO,GAAG,YADW,aAAK,QAAQ,SAAS,CACR,QAAQ,YAAY,IAAI,GAAG,SAAS,OAAO,KAAK,KAAK,KAAK"}
@@ -1,11 +0,0 @@
1
- //#region src/utils/resolve-file-url.d.ts
2
- /**
3
- * Convert a local file path to a file URL.
4
- * @param filePath - The local file's path.
5
- * @param withTs - Whether to append a timestamp to the URL.
6
- * @returns - The converted file URL.
7
- */
8
- declare function toFileURL(filePath: string, withTs?: boolean): string;
9
- //#endregion
10
- export { toFileURL };
11
- //# sourceMappingURL=resolve-file-url-yO8bUxok.d.ts.map
File without changes
File without changes
@@ -1,60 +0,0 @@
1
- const require_chunk = require('./chunk-nOFOJqeH.js');
2
- const require_common = require('./common-vnMIelAE.js');
3
- let discord_js = require("discord.js");
4
- discord_js = require_chunk.__toESM(discord_js);
5
-
6
- //#region src/components/v2/section.ts
7
- /**
8
- * The components v2 section component
9
- * @param props The properties for the section component.
10
- * @returns The section builder instance.
11
- * @example ```tsx
12
- * import { Section } from 'commandkit';
13
- *
14
- * const section = <Section>...</Section>;
15
- * ```
16
- */
17
- function Section(props) {
18
- const section = new discord_js.SectionBuilder();
19
- require_common.applyId(props, section);
20
- if (props.children != null) {
21
- if (!Array.isArray(props.children)) props.children = [props.children];
22
- for (const accessory of props.children.flat()) if (accessory instanceof discord_js.ThumbnailBuilder) section.setThumbnailAccessory(accessory);
23
- else if (accessory instanceof discord_js.ButtonBuilder) section.setButtonAccessory(accessory);
24
- else if (accessory instanceof discord_js.TextDisplayBuilder) section.addTextDisplayComponents(accessory);
25
- }
26
- return section;
27
- }
28
- /**
29
- * The thumbnail component
30
- * @param props The properties for the thumbnail component.
31
- * @returns The thumbnail builder instance.
32
- * @example ```tsx
33
- * import { Thumbnail } from 'commandkit';
34
- *
35
- * const thumbnail = <Thumbnail url="https://example.com/image.png" description="An image" />;
36
- * ```
37
- */
38
- function Thumbnail(props) {
39
- return new discord_js.ThumbnailBuilder({
40
- description: props.description,
41
- spoiler: props.spoiler,
42
- id: props.id,
43
- media: { url: props.url }
44
- });
45
- }
46
-
47
- //#endregion
48
- Object.defineProperty(exports, 'Section', {
49
- enumerable: true,
50
- get: function () {
51
- return Section;
52
- }
53
- });
54
- Object.defineProperty(exports, 'Thumbnail', {
55
- enumerable: true,
56
- get: function () {
57
- return Thumbnail;
58
- }
59
- });
60
- //# sourceMappingURL=section-DlvrDoJK.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"section-DlvrDoJK.js","names":[],"sources":["../src/components/v2/section.ts"],"sourcesContent":["import {\n ButtonBuilder,\n SectionBuilder,\n TextDisplayBuilder,\n ThumbnailBuilder,\n} from 'discord.js';\nimport { applyId } from './common';\n\n/**\n * Represents the properties for a section component.\n */\nexport interface SectionProps {\n children?: (ThumbnailBuilder | ButtonBuilder | TextDisplayBuilder)[];\n id?: number;\n}\n\n/**\n * The components v2 section component\n * @param props The properties for the section component.\n * @returns The section builder instance.\n * @example ```tsx\n * import { Section } from 'commandkit';\n *\n * const section = <Section>...</Section>;\n * ```\n */\nexport function Section(props: SectionProps): SectionBuilder {\n const section = new SectionBuilder();\n\n applyId(props, section);\n\n if (props.children != null) {\n if (!Array.isArray(props.children)) props.children = [props.children];\n for (const accessory of props.children.flat()) {\n if (accessory instanceof ThumbnailBuilder) {\n section.setThumbnailAccessory(accessory);\n } else if (accessory instanceof ButtonBuilder) {\n section.setButtonAccessory(accessory);\n } else if (accessory instanceof TextDisplayBuilder) {\n section.addTextDisplayComponents(accessory);\n }\n }\n }\n\n return section;\n}\n\n/**\n * Represents the properties for a thumbnail component.\n */\nexport interface ThumbnailProps {\n id?: number;\n description?: string;\n spoiler?: boolean;\n url: string;\n}\n\n/**\n * The thumbnail component\n * @param props The properties for the thumbnail component.\n * @returns The thumbnail builder instance.\n * @example ```tsx\n * import { Thumbnail } from 'commandkit';\n *\n * const thumbnail = <Thumbnail url=\"https://example.com/image.png\" description=\"An image\" />;\n * ```\n */\nexport function Thumbnail(props: ThumbnailProps) {\n const thumbnail = new ThumbnailBuilder({\n description: props.description,\n spoiler: props.spoiler,\n id: props.id,\n media: { url: props.url },\n });\n\n return thumbnail;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA0BA,SAAgB,QAAQ,OAAqC;CAC3D,MAAM,UAAU,IAAI,2BAAgB;AAEpC,wBAAQ,OAAO,QAAQ;AAEvB,KAAI,MAAM,YAAY,MAAM;AAC1B,MAAI,CAAC,MAAM,QAAQ,MAAM,SAAS,CAAE,OAAM,WAAW,CAAC,MAAM,SAAS;AACrE,OAAK,MAAM,aAAa,MAAM,SAAS,MAAM,CAC3C,KAAI,qBAAqB,4BACvB,SAAQ,sBAAsB,UAAU;WAC/B,qBAAqB,yBAC9B,SAAQ,mBAAmB,UAAU;WAC5B,qBAAqB,8BAC9B,SAAQ,yBAAyB,UAAU;;AAKjD,QAAO;;;;;;;;;;;;AAuBT,SAAgB,UAAU,OAAuB;AAQ/C,QAPkB,IAAI,4BAAiB;EACrC,aAAa,MAAM;EACnB,SAAS,MAAM;EACf,IAAI,MAAM;EACV,OAAO,EAAE,KAAK,MAAM,KAAK;EAC1B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"separator-DL6QH5H1.js","names":[],"sources":["../src/components/v2/separator.ts"],"sourcesContent":["import { SeparatorBuilder, SeparatorComponentData } from 'discord.js';\n\n/**\n * Represents the properties for a separator component.\n */\nexport interface SeparatorProps extends Omit<SeparatorComponentData, 'type'> {}\n\n/**\n * The components v2 separator component\n * @param props The properties for the separator component.\n * @returns The separator builder instance.\n * @example ```tsx\n * import { Separator } from 'commandkit';\n *\n * const separator = <Separator />;\n * ```\n */\nexport function Separator(props: SeparatorProps) {\n const separator = new SeparatorBuilder(props);\n return separator;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,SAAgB,UAAU,OAAuB;AAE/C,QADkB,IAAI,4BAAiB,MAAM"}
@@ -1,12 +0,0 @@
1
- import { SerializerType } from "./constants-D8PMA9on.js";
2
-
3
- //#region src/kv/serde.d.ts
4
- interface SerializedValue {
5
- t: SerializerType;
6
- v: any;
7
- }
8
- declare function serializer(value: any): SerializedValue;
9
- declare function deserializer(serialized: SerializedValue): any;
10
- //#endregion
11
- export { SerializedValue, deserializer, serializer };
12
- //# sourceMappingURL=serde-BYaKrsOV.d.ts.map
@@ -1,97 +0,0 @@
1
- const require_constants = require('./constants-4oxxvaJA.js');
2
-
3
- //#region src/kv/serde.ts
4
- function serializer(value) {
5
- if (value === null) return {
6
- t: require_constants.SerializerType.Null,
7
- v: null
8
- };
9
- if (value === void 0) return {
10
- t: require_constants.SerializerType.Undefined,
11
- v: void 0
12
- };
13
- if (typeof value === "string") return {
14
- t: require_constants.SerializerType.String,
15
- v: value
16
- };
17
- if (typeof value === "number") return {
18
- t: require_constants.SerializerType.Number,
19
- v: value
20
- };
21
- if (typeof value === "boolean") return {
22
- t: require_constants.SerializerType.Boolean,
23
- v: value
24
- };
25
- if (typeof value === "bigint") return {
26
- t: require_constants.SerializerType.BigInt,
27
- v: value.toString()
28
- };
29
- if (value instanceof Date) return {
30
- t: require_constants.SerializerType.Date,
31
- v: value.toISOString()
32
- };
33
- if (Array.isArray(value)) return {
34
- t: require_constants.SerializerType.Array,
35
- v: value
36
- };
37
- if (value instanceof Map) return {
38
- t: require_constants.SerializerType.Map,
39
- v: Array.from(value.entries())
40
- };
41
- if (value instanceof Set) return {
42
- t: require_constants.SerializerType.Set,
43
- v: Array.from(value)
44
- };
45
- if (Buffer.isBuffer(value)) return {
46
- t: require_constants.SerializerType.Buffer,
47
- v: value.toString("base64")
48
- };
49
- if (value instanceof RegExp) return {
50
- t: require_constants.SerializerType.RegExp,
51
- v: {
52
- source: value.source,
53
- flags: value.flags
54
- }
55
- };
56
- if (typeof value === "object") return {
57
- t: require_constants.SerializerType.Object,
58
- v: value
59
- };
60
- return {
61
- t: require_constants.SerializerType.String,
62
- v: String(value)
63
- };
64
- }
65
- function deserializer(serialized) {
66
- switch (serialized.t) {
67
- case require_constants.SerializerType.Null: return null;
68
- case require_constants.SerializerType.Undefined: return;
69
- case require_constants.SerializerType.String: return serialized.v;
70
- case require_constants.SerializerType.Number: return serialized.v;
71
- case require_constants.SerializerType.Boolean: return serialized.v;
72
- case require_constants.SerializerType.BigInt: return BigInt(serialized.v);
73
- case require_constants.SerializerType.Date: return new Date(serialized.v);
74
- case require_constants.SerializerType.Array: return serialized.v;
75
- case require_constants.SerializerType.Map: return new Map(serialized.v);
76
- case require_constants.SerializerType.Set: return new Set(serialized.v);
77
- case require_constants.SerializerType.Buffer: return Buffer.from(serialized.v, "base64");
78
- case require_constants.SerializerType.RegExp: return new RegExp(serialized.v.source, serialized.v.flags);
79
- case require_constants.SerializerType.Object: return serialized.v;
80
- default: return serialized.v;
81
- }
82
- }
83
-
84
- //#endregion
85
- Object.defineProperty(exports, 'deserializer', {
86
- enumerable: true,
87
- get: function () {
88
- return deserializer;
89
- }
90
- });
91
- Object.defineProperty(exports, 'serializer', {
92
- enumerable: true,
93
- get: function () {
94
- return serializer;
95
- }
96
- });
97
- //# sourceMappingURL=serde-Cc8iUa9J.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serde-Cc8iUa9J.js","names":[],"sources":["../src/kv/serde.ts"],"sourcesContent":["import { SerializerType } from './constants';\n\nexport interface SerializedValue {\n t: SerializerType;\n v: any;\n}\n\nexport function serializer(value: any): SerializedValue {\n if (value === null) {\n return { t: SerializerType.Null, v: null };\n }\n\n if (value === undefined) {\n return { t: SerializerType.Undefined, v: undefined };\n }\n\n if (typeof value === 'string') {\n return { t: SerializerType.String, v: value };\n }\n\n if (typeof value === 'number') {\n return { t: SerializerType.Number, v: value };\n }\n\n if (typeof value === 'boolean') {\n return { t: SerializerType.Boolean, v: value };\n }\n\n if (typeof value === 'bigint') {\n return { t: SerializerType.BigInt, v: value.toString() };\n }\n\n if (value instanceof Date) {\n return { t: SerializerType.Date, v: value.toISOString() };\n }\n\n if (Array.isArray(value)) {\n return { t: SerializerType.Array, v: value };\n }\n\n if (value instanceof Map) {\n return { t: SerializerType.Map, v: Array.from(value.entries()) };\n }\n\n if (value instanceof Set) {\n return { t: SerializerType.Set, v: Array.from(value) };\n }\n\n if (Buffer.isBuffer(value)) {\n return { t: SerializerType.Buffer, v: value.toString('base64') };\n }\n\n if (value instanceof RegExp) {\n return {\n t: SerializerType.RegExp,\n v: { source: value.source, flags: value.flags },\n };\n }\n\n if (typeof value === 'object') {\n return { t: SerializerType.Object, v: value };\n }\n\n // Fallback to string\n return { t: SerializerType.String, v: String(value) };\n}\n\nexport function deserializer(serialized: SerializedValue): any {\n switch (serialized.t) {\n case SerializerType.Null:\n return null;\n case SerializerType.Undefined:\n return undefined;\n case SerializerType.String:\n return serialized.v;\n case SerializerType.Number:\n return serialized.v;\n case SerializerType.Boolean:\n return serialized.v;\n case SerializerType.BigInt:\n return BigInt(serialized.v);\n case SerializerType.Date:\n return new Date(serialized.v);\n case SerializerType.Array:\n return serialized.v;\n case SerializerType.Map:\n return new Map(serialized.v);\n case SerializerType.Set:\n return new Set(serialized.v);\n case SerializerType.Buffer:\n return Buffer.from(serialized.v, 'base64');\n case SerializerType.RegExp:\n return new RegExp(serialized.v.source, serialized.v.flags);\n case SerializerType.Object:\n return serialized.v;\n default:\n return serialized.v;\n }\n}\n"],"mappings":";;;AAOA,SAAgB,WAAW,OAA6B;AACtD,KAAI,UAAU,KACZ,QAAO;EAAE,GAAG,iCAAe;EAAM,GAAG;EAAM;AAG5C,KAAI,UAAU,OACZ,QAAO;EAAE,GAAG,iCAAe;EAAW,GAAG;EAAW;AAGtD,KAAI,OAAO,UAAU,SACnB,QAAO;EAAE,GAAG,iCAAe;EAAQ,GAAG;EAAO;AAG/C,KAAI,OAAO,UAAU,SACnB,QAAO;EAAE,GAAG,iCAAe;EAAQ,GAAG;EAAO;AAG/C,KAAI,OAAO,UAAU,UACnB,QAAO;EAAE,GAAG,iCAAe;EAAS,GAAG;EAAO;AAGhD,KAAI,OAAO,UAAU,SACnB,QAAO;EAAE,GAAG,iCAAe;EAAQ,GAAG,MAAM,UAAU;EAAE;AAG1D,KAAI,iBAAiB,KACnB,QAAO;EAAE,GAAG,iCAAe;EAAM,GAAG,MAAM,aAAa;EAAE;AAG3D,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO;EAAE,GAAG,iCAAe;EAAO,GAAG;EAAO;AAG9C,KAAI,iBAAiB,IACnB,QAAO;EAAE,GAAG,iCAAe;EAAK,GAAG,MAAM,KAAK,MAAM,SAAS,CAAC;EAAE;AAGlE,KAAI,iBAAiB,IACnB,QAAO;EAAE,GAAG,iCAAe;EAAK,GAAG,MAAM,KAAK,MAAM;EAAE;AAGxD,KAAI,OAAO,SAAS,MAAM,CACxB,QAAO;EAAE,GAAG,iCAAe;EAAQ,GAAG,MAAM,SAAS,SAAS;EAAE;AAGlE,KAAI,iBAAiB,OACnB,QAAO;EACL,GAAG,iCAAe;EAClB,GAAG;GAAE,QAAQ,MAAM;GAAQ,OAAO,MAAM;GAAO;EAChD;AAGH,KAAI,OAAO,UAAU,SACnB,QAAO;EAAE,GAAG,iCAAe;EAAQ,GAAG;EAAO;AAI/C,QAAO;EAAE,GAAG,iCAAe;EAAQ,GAAG,OAAO,MAAM;EAAE;;AAGvD,SAAgB,aAAa,YAAkC;AAC7D,SAAQ,WAAW,GAAnB;EACE,KAAK,iCAAe,KAClB,QAAO;EACT,KAAK,iCAAe,UAClB;EACF,KAAK,iCAAe,OAClB,QAAO,WAAW;EACpB,KAAK,iCAAe,OAClB,QAAO,WAAW;EACpB,KAAK,iCAAe,QAClB,QAAO,WAAW;EACpB,KAAK,iCAAe,OAClB,QAAO,OAAO,WAAW,EAAE;EAC7B,KAAK,iCAAe,KAClB,QAAO,IAAI,KAAK,WAAW,EAAE;EAC/B,KAAK,iCAAe,MAClB,QAAO,WAAW;EACpB,KAAK,iCAAe,IAClB,QAAO,IAAI,IAAI,WAAW,EAAE;EAC9B,KAAK,iCAAe,IAClB,QAAO,IAAI,IAAI,WAAW,EAAE;EAC9B,KAAK,iCAAe,OAClB,QAAO,OAAO,KAAK,WAAW,GAAG,SAAS;EAC5C,KAAK,iCAAe,OAClB,QAAO,IAAI,OAAO,WAAW,EAAE,QAAQ,WAAW,EAAE,MAAM;EAC5D,KAAK,iCAAe,OAClB,QAAO,WAAW;EACpB,QACE,QAAO,WAAW"}
@@ -1,74 +0,0 @@
1
- const require_error_codes = require('./error-codes-Ds0bnPvT.js');
2
- const require_EventWorkerContext = require('./EventWorkerContext-Dq29tieI.js');
3
-
4
- //#region src/app/interrupt/signals.ts
5
- /**
6
- * Stop upcoming middlewares and command execution.
7
- */
8
- function stopMiddlewares() {
9
- throw require_error_codes.createCommandKitError(require_error_codes.CommandKitErrorCodes.StopMiddlewares);
10
- }
11
- /**
12
- * Rethrow the error if it is a CommandKit error.
13
- * @param error The error to rethrow.
14
- * @example try {
15
- * doSomething();
16
- * } catch(e) {
17
- * // do something
18
- *
19
- * // throw the error if it's a commandkit error
20
- * rethrow(e)
21
- * }
22
- */
23
- function rethrow(error) {
24
- if (require_error_codes.isCommandKitError(error)) throw error;
25
- }
26
- /**
27
- * Stops current command assuming it has been redirected to another command.
28
- */
29
- function redirect() {
30
- throw require_error_codes.createCommandKitError(require_error_codes.CommandKitErrorCodes.ForwardedCommand);
31
- }
32
- /**
33
- * Stops event propagation. This function should be called inside an event handler
34
- * to prevent further event handling.
35
- * @example // src/app/events/messageCreate/handler.ts
36
- * import { stopEvents } from 'commandkit';
37
- *
38
- * export default async function messageCreateHandler() {
39
- * console.log('Message created');
40
- * // Stop further event propagation
41
- * stopEvents();
42
- * }
43
- */
44
- function stopEvents() {
45
- if (!require_EventWorkerContext.eventWorkerContext.getStore()) throw new Error("stopEvents() may only be called inside an event handler");
46
- throw require_error_codes.createCommandKitError(require_error_codes.CommandKitErrorCodes.StopEvents);
47
- }
48
-
49
- //#endregion
50
- Object.defineProperty(exports, 'redirect', {
51
- enumerable: true,
52
- get: function () {
53
- return redirect;
54
- }
55
- });
56
- Object.defineProperty(exports, 'rethrow', {
57
- enumerable: true,
58
- get: function () {
59
- return rethrow;
60
- }
61
- });
62
- Object.defineProperty(exports, 'stopEvents', {
63
- enumerable: true,
64
- get: function () {
65
- return stopEvents;
66
- }
67
- });
68
- Object.defineProperty(exports, 'stopMiddlewares', {
69
- enumerable: true,
70
- get: function () {
71
- return stopMiddlewares;
72
- }
73
- });
74
- //# sourceMappingURL=signals-ChFMD7mB.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"signals-ChFMD7mB.js","names":[],"sources":["../src/app/interrupt/signals.ts"],"sourcesContent":["import {\n CommandKitErrorCodes,\n createCommandKitError,\n isCommandKitError,\n} from '../../utils/error-codes';\nimport { eventWorkerContext } from '../events/EventWorkerContext';\n\n/**\n * Stop upcoming middlewares and command execution.\n */\nexport function stopMiddlewares(): never {\n throw createCommandKitError(CommandKitErrorCodes.StopMiddlewares);\n}\n\n/**\n * Rethrow the error if it is a CommandKit error.\n * @param error The error to rethrow.\n * @example try {\n * doSomething();\n * } catch(e) {\n * // do something\n *\n * // throw the error if it's a commandkit error\n * rethrow(e)\n * }\n */\nexport function rethrow(error: unknown): void {\n if (isCommandKitError(error)) throw error;\n}\n\n/**\n * Stops current command assuming it has been redirected to another command.\n */\nexport function redirect(): never {\n throw createCommandKitError(CommandKitErrorCodes.ForwardedCommand);\n}\n\n/**\n * Stops event propagation. This function should be called inside an event handler\n * to prevent further event handling.\n * @example // src/app/events/messageCreate/handler.ts\n * import { stopEvents } from 'commandkit';\n *\n * export default async function messageCreateHandler() {\n * console.log('Message created');\n * // Stop further event propagation\n * stopEvents();\n * }\n */\nexport function stopEvents(): never {\n if (!eventWorkerContext.getStore()) {\n throw new Error('stopEvents() may only be called inside an event handler');\n }\n\n throw createCommandKitError(CommandKitErrorCodes.StopEvents);\n}\n"],"mappings":";;;;;;;AAUA,SAAgB,kBAAyB;AACvC,OAAM,0CAAsB,yCAAqB,gBAAgB;;;;;;;;;;;;;;AAenE,SAAgB,QAAQ,OAAsB;AAC5C,KAAI,sCAAkB,MAAM,CAAE,OAAM;;;;;AAMtC,SAAgB,WAAkB;AAChC,OAAM,0CAAsB,yCAAqB,iBAAiB;;;;;;;;;;;;;;AAepE,SAAgB,aAAoB;AAClC,KAAI,CAAC,8CAAmB,UAAU,CAChC,OAAM,IAAI,MAAM,0DAA0D;AAG5E,OAAM,0CAAsB,yCAAqB,WAAW"}
@@ -1,19 +0,0 @@
1
- const require_chunk = require('./chunk-nOFOJqeH.js');
2
- let discord_js = require("discord.js");
3
- discord_js = require_chunk.__toESM(discord_js);
4
-
5
- //#region src/flags/store.ts
6
- /**
7
- * Represents a store for feature flags.
8
- * This store extends the Collection class to manage feature flags by their keys.
9
- */
10
- var FlagStore = class extends discord_js.Collection {};
11
-
12
- //#endregion
13
- Object.defineProperty(exports, 'FlagStore', {
14
- enumerable: true,
15
- get: function () {
16
- return FlagStore;
17
- }
18
- });
19
- //# sourceMappingURL=store-CM6pWVZh.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store-CM6pWVZh.js","names":[],"sources":["../src/flags/store.ts"],"sourcesContent":["import type { FeatureFlag } from './feature-flags';\nimport { Collection } from 'discord.js';\n\n/**\n * Represents a store for feature flags.\n * This store extends the Collection class to manage feature flags by their keys.\n */\nexport class FlagStore extends Collection<string, FeatureFlag<any, any>> {}\n"],"mappings":";;;;;;;;;AAOA,IAAa,YAAb,cAA+B,sBAA0C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"text-display-DbMumig_.js","names":[],"sources":["../src/components/v2/text-display.ts"],"sourcesContent":["import { TextDisplayBuilder, TextDisplayComponentData } from 'discord.js';\n\n/**\n * Represents a type that can be encoded as a string.\n */\nexport type StringEncodable = string | number | boolean;\n\n/**\n * Represents the properties for a text display component.\n * This interface extends the TextDisplayComponentData type from discord.js,\n * excluding the 'type' and 'content' properties.\n */\nexport interface TextDisplayProps\n extends Omit<TextDisplayComponentData, 'type' | 'content'> {\n children?: StringEncodable | StringEncodable[];\n content?: string;\n}\n\n/**\n * The components v2 text display component\n * @param props The properties for the text display component.\n * @returns The text display builder instance.\n * @example ```tsx\n * import { TextDisplay } from 'commandkit';\n *\n * const textDisplay = <TextDisplay content=\"Hello, world!\" />;\n * // or\n * const textDisplay = <TextDisplay>Some text content</TextDisplay>;\n * ```\n */\nexport function TextDisplay(props: TextDisplayProps) {\n const textDisplay = new TextDisplayBuilder(props);\n\n if (!props.content && props.children) {\n if (Array.isArray(props.children)) {\n textDisplay.setContent(props.children.join(' '));\n } else {\n textDisplay.setContent(\n typeof props.children === 'string'\n ? props.children\n : String(props.children),\n );\n }\n }\n\n return textDisplay;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA8BA,SAAgB,YAAY,OAAyB;CACnD,MAAM,cAAc,IAAI,8BAAmB,MAAM;AAEjD,KAAI,CAAC,MAAM,WAAW,MAAM,SAC1B,KAAI,MAAM,QAAQ,MAAM,SAAS,CAC/B,aAAY,WAAW,MAAM,SAAS,KAAK,IAAI,CAAC;KAEhD,aAAY,WACV,OAAO,MAAM,aAAa,WAC1B,MAAM,WACN,OAAO,MAAM,SAAS,CACvB;AAIL,QAAO"}
@@ -1,90 +0,0 @@
1
- const require_chunk = require('./chunk-nOFOJqeH.js');
2
- const require_colors = require('./colors-DL3ucTiT.js');
3
- const require_common = require('./common-Dxr9-XPa.js');
4
- let node_fs = require("node:fs");
5
- node_fs = require_chunk.__toESM(node_fs);
6
- let node_path = require("node:path");
7
- node_path = require_chunk.__toESM(node_path);
8
-
9
- //#region src/cli/type-checker.ts
10
- const TS_NOT_FOUND_ERR = `TypeScript must be installed in order to use the type checker. Please install it using \`npm install typescript\` or \`yarn add typescript\``;
11
- /**
12
- * Formats a TypeScript diagnostic message in a pretty, readable format
13
- * @private
14
- * @internal
15
- */
16
- function formatDiagnostic(ts, diagnostic, cwd) {
17
- const messageText = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
18
- if (!diagnostic.file) return `${require_colors.colors_default.red("error")}: ${messageText}`;
19
- const { line, character } = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
20
- const fileName = (0, node_path.relative)(cwd, diagnostic.file.fileName);
21
- const position = `${line + 1}:${character + 1}`;
22
- const errorCode = diagnostic.code ? `TS${diagnostic.code}` : "";
23
- return [`${require_colors.colors_default.bold(require_colors.colors_default.cyan(fileName))}:${require_colors.colors_default.bold(require_colors.colors_default.yellow(position))} - ${require_colors.colors_default.red("error")} ${require_colors.colors_default.gray(errorCode)}`, `${messageText}`].join("\n");
24
- }
25
- /**
26
- * Performs a type check on the project using TypeScript.
27
- * @param path The project root or cwd
28
- * @private
29
- * @internal
30
- */
31
- async function performTypeCheck(path) {
32
- const tsconfigPath = (0, node_path.join)(path, "tsconfig.json");
33
- if (!(0, node_fs.existsSync)(tsconfigPath)) return;
34
- const ts = await require_common.loadTypeScript(TS_NOT_FOUND_ERR);
35
- const formatHost = {
36
- getCanonicalFileName: (path$1) => path$1,
37
- getCurrentDirectory: ts.sys.getCurrentDirectory,
38
- getNewLine: () => ts.sys.newLine
39
- };
40
- const configFile = ts.readConfigFile(tsconfigPath, ts.sys.readFile);
41
- if (configFile.error) {
42
- console.error(require_colors.colors_default.red(`Error reading tsconfig.json: ${ts.formatDiagnostic(configFile.error, formatHost)}`));
43
- process.exit(1);
44
- }
45
- const parsedConfig = ts.parseJsonConfigFileContent(configFile.config, ts.sys, path);
46
- parsedConfig.options.noEmit = true;
47
- const program = ts.createProgram({
48
- rootNames: parsedConfig.fileNames,
49
- options: parsedConfig.options,
50
- projectReferences: parsedConfig.projectReferences
51
- });
52
- const diagnostics = [
53
- ...program.getOptionsDiagnostics(),
54
- ...program.getGlobalDiagnostics(),
55
- ...program.getSyntacticDiagnostics(),
56
- ...program.getSemanticDiagnostics()
57
- ];
58
- if (diagnostics.length > 0) {
59
- console.log("");
60
- console.error(require_colors.colors_default.bold(require_colors.colors_default.red("Type checking failed with the following errors:")));
61
- console.log("");
62
- const byFile = /* @__PURE__ */ new Map();
63
- for (const diagnostic of diagnostics) {
64
- const fileName = diagnostic.file ? diagnostic.file.fileName : "Global";
65
- if (!byFile.has(fileName)) byFile.set(fileName, []);
66
- byFile.get(fileName).push(diagnostic);
67
- }
68
- const totalErrors = diagnostics.length;
69
- let counter = 0;
70
- for (const [_, fileDiags] of byFile) for (const diagnostic of fileDiags) {
71
- counter++;
72
- console.log(formatDiagnostic(ts, diagnostic, path));
73
- if (counter < totalErrors) console.log("");
74
- }
75
- console.log("");
76
- console.error(require_colors.colors_default.bold(require_colors.colors_default.red(`Found ${totalErrors} error${totalErrors > 1 ? "s" : ""}`)));
77
- console.log("");
78
- process.exit(1);
79
- }
80
- console.log(require_colors.colors_default.green("✓ Type checking completed successfully."));
81
- }
82
-
83
- //#endregion
84
- Object.defineProperty(exports, 'performTypeCheck', {
85
- enumerable: true,
86
- get: function () {
87
- return performTypeCheck;
88
- }
89
- });
90
- //# sourceMappingURL=type-checker-DR7RZFs5.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"type-checker-DR7RZFs5.js","names":[],"sources":["../src/cli/type-checker.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { loadTypeScript } from './common';\nimport { join, relative } from 'node:path';\nimport colors from '../utils/colors';\n\nconst TS_NOT_FOUND_ERR = `TypeScript must be installed in order to use the type checker. Please install it using \\`npm install typescript\\` or \\`yarn add typescript\\``;\n\n/**\n * Formats a TypeScript diagnostic message in a pretty, readable format\n * @private\n * @internal\n */\nfunction formatDiagnostic(\n ts: typeof import('typescript'),\n diagnostic: import('typescript').Diagnostic,\n cwd: string,\n): string {\n const messageText = ts.flattenDiagnosticMessageText(\n diagnostic.messageText,\n '\\n',\n );\n\n if (!diagnostic.file) {\n return `${colors.red('error')}: ${messageText}`;\n }\n\n const { line, character } = ts.getLineAndCharacterOfPosition(\n diagnostic.file,\n diagnostic.start!,\n );\n const fileName = relative(cwd, diagnostic.file.fileName);\n const position = `${line + 1}:${character + 1}`;\n const errorCode = diagnostic.code ? `TS${diagnostic.code}` : '';\n\n // Format the error message nicely\n return [\n `${colors.bold(colors.cyan(fileName))}:${colors.bold(colors.yellow(position))} - ${colors.red('error')} ${colors.gray(errorCode)}`,\n `${messageText}`,\n ].join('\\n');\n}\n\n/**\n * Performs a type check on the project using TypeScript.\n * @param path The project root or cwd\n * @private\n * @internal\n */\nexport async function performTypeCheck(path: string) {\n const tsconfigPath = join(path, 'tsconfig.json');\n\n if (!existsSync(tsconfigPath)) return;\n\n const ts = await loadTypeScript(TS_NOT_FOUND_ERR);\n\n // Format host for error reporting\n const formatHost = {\n getCanonicalFileName: (path: string) => path,\n getCurrentDirectory: ts.sys.getCurrentDirectory,\n getNewLine: () => ts.sys.newLine,\n };\n\n // Read tsconfig.json\n const configFile = ts.readConfigFile(tsconfigPath, ts.sys.readFile);\n\n if (configFile.error) {\n console.error(\n colors.red(\n `Error reading tsconfig.json: ${ts.formatDiagnostic(configFile.error, formatHost)}`,\n ),\n );\n process.exit(1);\n }\n\n // Parse the config file\n const parsedConfig = ts.parseJsonConfigFileContent(\n configFile.config,\n ts.sys,\n path,\n );\n\n // Force noEmit to true as we only want type checking\n parsedConfig.options.noEmit = true;\n\n // Create a program\n const program = ts.createProgram({\n rootNames: parsedConfig.fileNames,\n options: parsedConfig.options,\n projectReferences: parsedConfig.projectReferences,\n });\n\n // Get the diagnostics\n const diagnostics = [\n ...program.getOptionsDiagnostics(),\n ...program.getGlobalDiagnostics(),\n ...program.getSyntacticDiagnostics(),\n ...program.getSemanticDiagnostics(),\n ];\n\n // Report any errors\n if (diagnostics.length > 0) {\n console.log('');\n console.error(\n colors.bold(\n colors.red('Type checking failed with the following errors:'),\n ),\n );\n console.log('');\n\n // Group diagnostics by file for better readability\n const byFile = new Map<string, import('typescript').Diagnostic[]>();\n\n for (const diagnostic of diagnostics) {\n const fileName = diagnostic.file ? diagnostic.file.fileName : 'Global';\n if (!byFile.has(fileName)) {\n byFile.set(fileName, []);\n }\n byFile.get(fileName)!.push(diagnostic);\n }\n\n // Pretty-print each diagnostic\n const totalErrors = diagnostics.length;\n let counter = 0;\n\n for (const [_, fileDiags] of byFile) {\n for (const diagnostic of fileDiags) {\n counter++;\n console.log(formatDiagnostic(ts, diagnostic, path));\n // Add separator between errors for better readability, except for the last one\n if (counter < totalErrors) {\n console.log('');\n }\n }\n }\n\n console.log('');\n console.error(\n colors.bold(\n colors.red(`Found ${totalErrors} error${totalErrors > 1 ? 's' : ''}`),\n ),\n );\n console.log('');\n\n process.exit(1);\n }\n\n console.log(colors.green('✓ Type checking completed successfully.'));\n}\n"],"mappings":";;;;;;;;;AAKA,MAAM,mBAAmB;;;;;;AAOzB,SAAS,iBACT,IACA,YACA,KACS;CACP,MAAM,cAAc,GAAG,6BACrB,WAAW,aACX,KACD;AAED,KAAI,CAAC,WAAW,KACd,QAAO,GAAG,8BAAO,IAAI,QAAQ,CAAC,IAAI;CAGpC,MAAM,EAAE,MAAM,cAAc,GAAG,8BAC7B,WAAW,MACX,WAAW,MACZ;CACD,MAAM,mCAAoB,KAAK,WAAW,KAAK,SAAS;CACxD,MAAM,WAAW,GAAG,OAAO,EAAE,GAAG,YAAY;CAC5C,MAAM,YAAY,WAAW,OAAO,KAAK,WAAW,SAAS;AAG7D,QAAO,CACP,GAAG,8BAAO,KAAK,8BAAO,KAAK,SAAS,CAAC,CAAC,GAAG,8BAAO,KAAK,8BAAO,OAAO,SAAS,CAAC,CAAC,KAAK,8BAAO,IAAI,QAAQ,CAAC,GAAG,8BAAO,KAAK,UAAU,IAChI,GAAG,cAAc,CACjB,KAAK,KAAK;;;;;;;;AASZ,eAAsB,iBAAiB,MAAc;CACnD,MAAM,mCAAoB,MAAM,gBAAgB;AAEhD,KAAI,yBAAY,aAAa,CAAE;CAE/B,MAAM,KAAK,MAAM,8BAAe,iBAAiB;CAGjD,MAAM,aAAa;EACjB,uBAAuB,WAAiB;EACxC,qBAAqB,GAAG,IAAI;EAC5B,kBAAkB,GAAG,IAAI;EAC1B;CAGD,MAAM,aAAa,GAAG,eAAe,cAAc,GAAG,IAAI,SAAS;AAEnE,KAAI,WAAW,OAAO;AACpB,UAAQ,MACN,8BAAO,IACL,gCAAgC,GAAG,iBAAiB,WAAW,OAAO,WAAW,GAClF,CACF;AACD,UAAQ,KAAK,EAAE;;CAIjB,MAAM,eAAe,GAAG,2BACtB,WAAW,QACX,GAAG,KACH,KACD;AAGD,cAAa,QAAQ,SAAS;CAG9B,MAAM,UAAU,GAAG,cAAc;EAC/B,WAAW,aAAa;EACxB,SAAS,aAAa;EACtB,mBAAmB,aAAa;EACjC,CAAC;CAGF,MAAM,cAAc;EACpB,GAAG,QAAQ,uBAAuB;EAClC,GAAG,QAAQ,sBAAsB;EACjC,GAAG,QAAQ,yBAAyB;EACpC,GAAG,QAAQ,wBAAwB;EAAC;AAIpC,KAAI,YAAY,SAAS,GAAG;AAC1B,UAAQ,IAAI,GAAG;AACf,UAAQ,MACN,8BAAO,KACL,8BAAO,IAAI,kDAAkD,CAC9D,CACF;AACD,UAAQ,IAAI,GAAG;EAGf,MAAM,yBAAS,IAAI,KAAgD;AAEnE,OAAK,MAAM,cAAc,aAAa;GACpC,MAAM,WAAW,WAAW,OAAO,WAAW,KAAK,WAAW;AAC9D,OAAI,CAAC,OAAO,IAAI,SAAS,CACvB,QAAO,IAAI,UAAU,EAAE,CAAC;AAE1B,UAAO,IAAI,SAAS,CAAE,KAAK,WAAW;;EAIxC,MAAM,cAAc,YAAY;EAChC,IAAI,UAAU;AAEd,OAAK,MAAM,CAAC,GAAG,cAAc,OAC3B,MAAK,MAAM,cAAc,WAAW;AAClC;AACA,WAAQ,IAAI,iBAAiB,IAAI,YAAY,KAAK,CAAC;AAEnD,OAAI,UAAU,YACZ,SAAQ,IAAI,GAAG;;AAKrB,UAAQ,IAAI,GAAG;AACf,UAAQ,MACN,8BAAO,KACL,8BAAO,IAAI,SAAS,YAAY,QAAQ,cAAc,IAAI,MAAM,KAAK,CACtE,CACF;AACD,UAAQ,IAAI,GAAG;AAEf,UAAQ,KAAK,EAAE;;AAGjB,SAAQ,IAAI,8BAAO,MAAM,0CAA0C,CAAC"}
File without changes
@@ -1,75 +0,0 @@
1
- const require_chunk = require('./chunk-nOFOJqeH.js');
2
- const require_constants = require('./constants-B5_Ta7PR.js');
3
- let node_fs = require("node:fs");
4
- node_fs = require_chunk.__toESM(node_fs);
5
- let node_path = require("node:path");
6
- node_path = require_chunk.__toESM(node_path);
7
- let node_fs_promises = require("node:fs/promises");
8
- node_fs_promises = require_chunk.__toESM(node_fs_promises);
9
-
10
- //#region src/utils/types-package.ts
11
- /**
12
- * @private
13
- */
14
- async function generateTypesPackage(force = false) {
15
- const location = (0, node_path.join)(require_constants.COMMANDKIT_CWD, "node_modules", "commandkit-types");
16
- if (!require_constants.COMMANDKIT_IS_DEV && !force) return location;
17
- const packageJSON = (0, node_path.join)(location, "package.json");
18
- const index = (0, node_path.join)(location, "index.js");
19
- const types = (0, node_path.join)(location, "index.d.ts");
20
- const command = (0, node_path.join)(location, "command.d.ts");
21
- const packageJSONContent = {
22
- name: "commandkit-types",
23
- version: "1.0.0",
24
- description: "CommandKit types package",
25
- type: "commonjs",
26
- main: "index.js",
27
- types: "index.d.ts"
28
- };
29
- const indexContent = `module.exports = {};`;
30
- const typesContent = `// Main types index file - imports all type declarations
31
- import './command';
32
- export {};
33
- `;
34
- const commandTypesContent = `// Auto-generated command types
35
- export {};
36
- declare module 'commandkit' {
37
- type CommandTypeData = string
38
- }`;
39
- await (0, node_fs_promises.mkdir)(location, { recursive: true }).catch(() => {});
40
- await (0, node_fs_promises.writeFile)(packageJSON, JSON.stringify(packageJSONContent, null, 2));
41
- await (0, node_fs_promises.writeFile)(index, indexContent);
42
- await (0, node_fs_promises.writeFile)(types, typesContent);
43
- await (0, node_fs_promises.writeFile)(command, commandTypesContent);
44
- return location;
45
- }
46
- /**
47
- * @private
48
- */
49
- async function rewriteCommandDeclaration(data) {
50
- const commandTypesContent = `// Auto-generated command types
51
- declare module 'commandkit' {
52
- ${data}
53
- }
54
- export {};
55
- `;
56
- const location = (0, node_path.join)(require_constants.COMMANDKIT_CWD, "node_modules", "commandkit-types");
57
- if (!(0, node_fs.existsSync)(location)) return;
58
- const type = (0, node_path.join)(location, "command.d.ts");
59
- await (0, node_fs_promises.writeFile)(type, commandTypesContent, { encoding: "utf-8" });
60
- }
61
-
62
- //#endregion
63
- Object.defineProperty(exports, 'generateTypesPackage', {
64
- enumerable: true,
65
- get: function () {
66
- return generateTypesPackage;
67
- }
68
- });
69
- Object.defineProperty(exports, 'rewriteCommandDeclaration', {
70
- enumerable: true,
71
- get: function () {
72
- return rewriteCommandDeclaration;
73
- }
74
- });
75
- //# sourceMappingURL=types-package-BWArjyBF.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-package-BWArjyBF.js","names":[],"sources":["../src/utils/types-package.ts"],"sourcesContent":["import { mkdir, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { COMMANDKIT_CWD, COMMANDKIT_IS_DEV } from './constants';\nimport { existsSync } from 'node:fs';\n\n/**\n * @private\n */\nexport async function generateTypesPackage(force = false) {\n const location = join(COMMANDKIT_CWD, 'node_modules', 'commandkit-types');\n if (!COMMANDKIT_IS_DEV && !force) return location;\n const packageJSON = join(location, 'package.json');\n const index = join(location, 'index.js');\n const types = join(location, 'index.d.ts');\n const command = join(location, 'command.d.ts');\n\n const packageJSONContent = {\n name: 'commandkit-types',\n version: '1.0.0',\n description: 'CommandKit types package',\n type: 'commonjs',\n main: 'index.js',\n types: 'index.d.ts',\n };\n\n const indexContent = `module.exports = {};`;\n\n // Restructuring the type declarations to properly extend rather than replace types\n const typesContent = `// Main types index file - imports all type declarations\nimport './command';\nexport {};\n`;\n\n // Properly set up command types to extend the CommandTypeData interface\n const commandTypesContent = `// Auto-generated command types\n export {};\ndeclare module 'commandkit' {\n type CommandTypeData = string\n}`;\n\n await mkdir(location, { recursive: true }).catch(() => {});\n await writeFile(packageJSON, JSON.stringify(packageJSONContent, null, 2));\n await writeFile(index, indexContent);\n await writeFile(types, typesContent);\n await writeFile(command, commandTypesContent);\n\n return location;\n}\n\n/**\n * @private\n */\nexport async function rewriteCommandDeclaration(data: string) {\n const commandTypesContent = `// Auto-generated command types\n declare module 'commandkit' {\n ${data}\n}\n export {};\n`;\n\n const location = join(COMMANDKIT_CWD, 'node_modules', 'commandkit-types');\n\n if (!existsSync(location)) return;\n\n const type = join(location, 'command.d.ts');\n\n await writeFile(type, commandTypesContent, { encoding: 'utf-8' });\n}\n"],"mappings":";;;;;;;;;;;;;AAQA,eAAsB,qBAAqB,QAAQ,OAAO;CACxD,MAAM,+BAAgB,kCAAgB,gBAAgB,mBAAmB;AACzE,KAAI,CAAC,uCAAqB,CAAC,MAAO,QAAO;CACzC,MAAM,kCAAmB,UAAU,eAAe;CAClD,MAAM,4BAAa,UAAU,WAAW;CACxC,MAAM,4BAAa,UAAU,aAAa;CAC1C,MAAM,8BAAe,UAAU,eAAe;CAE9C,MAAM,qBAAqB;EACzB,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;EACN,MAAM;EACN,OAAO;EACR;CAED,MAAM,eAAe;CAGrB,MAAM,eAAe;;;;CAMrB,MAAM,sBAAsB;;;;;AAM5B,mCAAY,UAAU,EAAE,WAAW,MAAM,CAAC,CAAC,YAAY,GAAG;AAC1D,uCAAgB,aAAa,KAAK,UAAU,oBAAoB,MAAM,EAAE,CAAC;AACzE,uCAAgB,OAAO,aAAa;AACpC,uCAAgB,OAAO,aAAa;AACpC,uCAAgB,SAAS,oBAAoB;AAE7C,QAAO;;;;;AAMT,eAAsB,0BAA0B,MAAc;CAC5D,MAAM,sBAAsB;;MAExB,KAAI;;;;CAKR,MAAM,+BAAgB,kCAAgB,gBAAgB,mBAAmB;AAEzE,KAAI,yBAAY,SAAS,CAAE;CAE3B,MAAM,2BAAY,UAAU,eAAe;AAE3C,uCAAgB,MAAM,qBAAqB,EAAE,UAAU,SAAS,CAAC"}
File without changes