commandkit 0.1.10-dev.20240128000000 → 0.1.10-dev.20240131174628

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 (328) hide show
  1. package/bin/index.cjs +3 -0
  2. package/dist/CommandKit--SA9LcIq.d.mts +452 -0
  3. package/dist/CommandKit-GIHMEeqf.d.ts +452 -0
  4. package/dist/CommandKit.d.mts +5 -0
  5. package/dist/CommandKit.d.ts +5 -0
  6. package/dist/CommandKit.js +11 -0
  7. package/dist/CommandKit.js.map +1 -0
  8. package/dist/CommandKit.mjs +2 -0
  9. package/dist/CommandKit.mjs.map +1 -0
  10. package/dist/bootstrap/client.d.mts +13 -0
  11. package/dist/bootstrap/client.d.ts +13 -0
  12. package/dist/bootstrap/client.js +2 -0
  13. package/dist/bootstrap/client.js.map +1 -0
  14. package/dist/bootstrap/client.mjs +2 -0
  15. package/dist/bootstrap/client.mjs.map +1 -0
  16. package/dist/bootstrap/loadEnv.d.mts +3 -0
  17. package/dist/bootstrap/loadEnv.d.ts +3 -0
  18. package/dist/bootstrap/loadEnv.js +2 -0
  19. package/dist/bootstrap/loadEnv.js.map +1 -0
  20. package/dist/bootstrap/loadEnv.mjs +2 -0
  21. package/dist/bootstrap/loadEnv.mjs.map +1 -0
  22. package/dist/chunk-3RMN5A5C.mjs +2 -0
  23. package/dist/chunk-3RMN5A5C.mjs.map +1 -0
  24. package/dist/chunk-47OCM32X.mjs +2 -0
  25. package/dist/chunk-47OCM32X.mjs.map +1 -0
  26. package/dist/chunk-4M5YKUGX.mjs +2 -0
  27. package/dist/chunk-4M5YKUGX.mjs.map +1 -0
  28. package/dist/chunk-5A7S2KUP.mjs +2 -0
  29. package/dist/chunk-5A7S2KUP.mjs.map +1 -0
  30. package/dist/chunk-5NCNVJD5.mjs +4 -0
  31. package/dist/chunk-5NCNVJD5.mjs.map +1 -0
  32. package/dist/chunk-67SR2RRV.mjs +2 -0
  33. package/dist/chunk-67SR2RRV.mjs.map +1 -0
  34. package/dist/chunk-6I5SY5IL.mjs +2 -0
  35. package/dist/chunk-6I5SY5IL.mjs.map +1 -0
  36. package/dist/chunk-7KD7ZCH6.mjs +2 -0
  37. package/dist/chunk-7KD7ZCH6.mjs.map +1 -0
  38. package/dist/chunk-BWCE2PU3.mjs +2 -0
  39. package/dist/chunk-BWCE2PU3.mjs.map +1 -0
  40. package/dist/chunk-CCTUTTKF.mjs +2 -0
  41. package/dist/chunk-CCTUTTKF.mjs.map +1 -0
  42. package/dist/chunk-DJGEQTVH.mjs +2 -0
  43. package/dist/chunk-DJGEQTVH.mjs.map +1 -0
  44. package/dist/chunk-GLH4FCGA.mjs +2 -0
  45. package/dist/chunk-GLH4FCGA.mjs.map +1 -0
  46. package/dist/chunk-KWPUAQ7H.mjs +2 -0
  47. package/dist/chunk-KWPUAQ7H.mjs.map +1 -0
  48. package/dist/chunk-LVMZYYYQ.mjs +2 -0
  49. package/dist/chunk-LVMZYYYQ.mjs.map +1 -0
  50. package/dist/chunk-M5FMJETI.mjs +1 -0
  51. package/dist/chunk-M5FMJETI.mjs.map +1 -0
  52. package/dist/chunk-NAGAOZDU.mjs +2 -0
  53. package/dist/chunk-NAGAOZDU.mjs.map +1 -0
  54. package/dist/chunk-P22KPISA.mjs +2 -0
  55. package/dist/chunk-P22KPISA.mjs.map +1 -0
  56. package/dist/chunk-PFU3PH6M.mjs +1 -0
  57. package/dist/chunk-PFU3PH6M.mjs.map +1 -0
  58. package/dist/chunk-QVM3SASI.mjs +2 -0
  59. package/dist/chunk-QVM3SASI.mjs.map +1 -0
  60. package/dist/chunk-R4SUPDLH.mjs +2 -0
  61. package/dist/chunk-R4SUPDLH.mjs.map +1 -0
  62. package/dist/chunk-RWJJP4OR.mjs +2 -0
  63. package/dist/chunk-RWJJP4OR.mjs.map +1 -0
  64. package/dist/chunk-UWPC5P4C.mjs +2 -0
  65. package/dist/chunk-UWPC5P4C.mjs.map +1 -0
  66. package/dist/chunk-VURGPMLB.mjs +2 -0
  67. package/dist/chunk-VURGPMLB.mjs.map +1 -0
  68. package/dist/chunk-WTRDOPQV.mjs +2 -0
  69. package/dist/chunk-WTRDOPQV.mjs.map +1 -0
  70. package/dist/chunk-XFI3OAJH.mjs +2 -0
  71. package/dist/chunk-XFI3OAJH.mjs.map +1 -0
  72. package/dist/chunk-YVVGY7EA.mjs +7 -0
  73. package/dist/chunk-YVVGY7EA.mjs.map +1 -0
  74. package/dist/chunk-ZBUBSPF6.mjs +4 -0
  75. package/dist/chunk-ZBUBSPF6.mjs.map +1 -0
  76. package/dist/components/ButtonKit.d.mts +55 -0
  77. package/dist/components/ButtonKit.d.ts +55 -0
  78. package/dist/components/ButtonKit.js +2 -0
  79. package/dist/components/ButtonKit.js.map +1 -0
  80. package/dist/components/ButtonKit.mjs +2 -0
  81. package/dist/components/ButtonKit.mjs.map +1 -0
  82. package/dist/components/index.d.mts +2 -0
  83. package/dist/components/index.d.ts +2 -0
  84. package/dist/components/index.js +2 -0
  85. package/dist/components/index.js.map +1 -0
  86. package/dist/components/index.mjs +2 -0
  87. package/dist/components/index.mjs.map +1 -0
  88. package/dist/config.d.mts +55 -0
  89. package/dist/config.d.ts +55 -0
  90. package/dist/config.js +2 -0
  91. package/dist/config.js.map +1 -0
  92. package/dist/config.mjs +2 -0
  93. package/dist/config.mjs.map +1 -0
  94. package/dist/environment/actions/development.d.mts +8 -0
  95. package/dist/environment/actions/development.d.ts +8 -0
  96. package/dist/environment/actions/development.js +2 -0
  97. package/dist/environment/actions/development.js.map +1 -0
  98. package/dist/environment/actions/development.mjs +2 -0
  99. package/dist/environment/actions/development.mjs.map +1 -0
  100. package/dist/environment/bundler/bundle.d.mts +3 -0
  101. package/dist/environment/bundler/bundle.d.ts +3 -0
  102. package/dist/environment/bundler/bundle.js +2 -0
  103. package/dist/environment/bundler/bundle.js.map +1 -0
  104. package/dist/environment/bundler/bundle.mjs +2 -0
  105. package/dist/environment/bundler/bundle.mjs.map +1 -0
  106. package/dist/environment/bundler/shims.d.mts +3 -0
  107. package/dist/environment/bundler/shims.d.ts +3 -0
  108. package/dist/environment/bundler/shims.js +11 -0
  109. package/dist/environment/bundler/shims.js.map +1 -0
  110. package/dist/environment/bundler/shims.mjs +11 -0
  111. package/dist/environment/bundler/shims.mjs.map +1 -0
  112. package/dist/environment/cli.d.mts +2 -0
  113. package/dist/environment/cli.d.ts +2 -0
  114. package/dist/environment/cli.js +2 -0
  115. package/dist/environment/cli.js.map +1 -0
  116. package/dist/environment/cli.mjs +2 -0
  117. package/dist/environment/cli.mjs.map +1 -0
  118. package/dist/environment/common/config.d.mts +7 -0
  119. package/dist/environment/common/config.d.ts +7 -0
  120. package/dist/environment/common/config.js +2 -0
  121. package/dist/environment/common/config.js.map +1 -0
  122. package/dist/environment/common/config.mjs +2 -0
  123. package/dist/environment/common/config.mjs.map +1 -0
  124. package/dist/environment/common/logger.d.mts +9 -0
  125. package/dist/environment/common/logger.d.ts +9 -0
  126. package/dist/environment/common/logger.js +2 -0
  127. package/dist/environment/common/logger.js.map +1 -0
  128. package/dist/environment/common/logger.mjs +2 -0
  129. package/dist/environment/common/logger.mjs.map +1 -0
  130. package/dist/handlers/command-handler/CommandHandler.d.mts +5 -0
  131. package/dist/handlers/command-handler/CommandHandler.d.ts +5 -0
  132. package/dist/handlers/command-handler/CommandHandler.js +11 -0
  133. package/dist/handlers/command-handler/CommandHandler.js.map +1 -0
  134. package/dist/handlers/command-handler/CommandHandler.mjs +2 -0
  135. package/dist/handlers/command-handler/CommandHandler.mjs.map +1 -0
  136. package/dist/handlers/command-handler/functions/loadCommandsWithRest.d.mts +35 -0
  137. package/dist/handlers/command-handler/functions/loadCommandsWithRest.d.ts +35 -0
  138. package/dist/handlers/command-handler/functions/loadCommandsWithRest.js +4 -0
  139. package/dist/handlers/command-handler/functions/loadCommandsWithRest.js.map +1 -0
  140. package/dist/handlers/command-handler/functions/loadCommandsWithRest.mjs +2 -0
  141. package/dist/handlers/command-handler/functions/loadCommandsWithRest.mjs.map +1 -0
  142. package/dist/handlers/command-handler/functions/registerCommands.d.mts +20 -0
  143. package/dist/handlers/command-handler/functions/registerCommands.d.ts +20 -0
  144. package/dist/handlers/command-handler/functions/registerCommands.js +7 -0
  145. package/dist/handlers/command-handler/functions/registerCommands.js.map +1 -0
  146. package/dist/handlers/command-handler/functions/registerCommands.mjs +2 -0
  147. package/dist/handlers/command-handler/functions/registerCommands.mjs.map +1 -0
  148. package/dist/handlers/command-handler/typings.d.mts +5 -0
  149. package/dist/handlers/command-handler/typings.d.ts +5 -0
  150. package/dist/handlers/command-handler/typings.js +2 -0
  151. package/dist/handlers/command-handler/typings.js.map +1 -0
  152. package/dist/handlers/command-handler/typings.mjs +1 -0
  153. package/dist/handlers/command-handler/typings.mjs.map +1 -0
  154. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.d.mts +9 -0
  155. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.d.ts +9 -0
  156. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.js +2 -0
  157. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.js.map +1 -0
  158. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.mjs +2 -0
  159. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.mjs.map +1 -0
  160. package/dist/handlers/command-handler/validations/devOnly.d.mts +9 -0
  161. package/dist/handlers/command-handler/validations/devOnly.d.ts +9 -0
  162. package/dist/handlers/command-handler/validations/devOnly.js +2 -0
  163. package/dist/handlers/command-handler/validations/devOnly.js.map +1 -0
  164. package/dist/handlers/command-handler/validations/devOnly.mjs +2 -0
  165. package/dist/handlers/command-handler/validations/devOnly.mjs.map +1 -0
  166. package/dist/handlers/command-handler/validations/index.d.mts +10 -0
  167. package/dist/handlers/command-handler/validations/index.d.ts +10 -0
  168. package/dist/handlers/command-handler/validations/index.js +4 -0
  169. package/dist/handlers/command-handler/validations/index.js.map +1 -0
  170. package/dist/handlers/command-handler/validations/index.mjs +2 -0
  171. package/dist/handlers/command-handler/validations/index.mjs.map +1 -0
  172. package/dist/handlers/command-handler/validations/permissions.d.mts +9 -0
  173. package/dist/handlers/command-handler/validations/permissions.d.ts +9 -0
  174. package/dist/handlers/command-handler/validations/permissions.js +4 -0
  175. package/dist/handlers/command-handler/validations/permissions.js.map +1 -0
  176. package/dist/handlers/command-handler/validations/permissions.mjs +2 -0
  177. package/dist/handlers/command-handler/validations/permissions.mjs.map +1 -0
  178. package/dist/handlers/event-handler/EventHandler.d.mts +5 -0
  179. package/dist/handlers/event-handler/EventHandler.d.ts +5 -0
  180. package/dist/handlers/event-handler/EventHandler.js +2 -0
  181. package/dist/handlers/event-handler/EventHandler.js.map +1 -0
  182. package/dist/handlers/event-handler/EventHandler.mjs +2 -0
  183. package/dist/handlers/event-handler/EventHandler.mjs.map +1 -0
  184. package/dist/handlers/event-handler/typings.d.mts +5 -0
  185. package/dist/handlers/event-handler/typings.d.ts +5 -0
  186. package/dist/handlers/event-handler/typings.js +2 -0
  187. package/dist/handlers/event-handler/typings.js.map +1 -0
  188. package/dist/handlers/event-handler/typings.mjs +1 -0
  189. package/dist/handlers/event-handler/typings.mjs.map +1 -0
  190. package/dist/handlers/index.d.mts +5 -0
  191. package/dist/handlers/index.d.ts +5 -0
  192. package/dist/handlers/index.js +11 -0
  193. package/dist/handlers/index.js.map +1 -0
  194. package/dist/handlers/index.mjs +2 -0
  195. package/dist/handlers/index.mjs.map +1 -0
  196. package/dist/handlers/validation-handler/ValidationHandler.d.mts +14 -0
  197. package/dist/handlers/validation-handler/ValidationHandler.d.ts +14 -0
  198. package/dist/handlers/validation-handler/ValidationHandler.js +2 -0
  199. package/dist/handlers/validation-handler/ValidationHandler.js.map +1 -0
  200. package/dist/handlers/validation-handler/ValidationHandler.mjs +2 -0
  201. package/dist/handlers/validation-handler/ValidationHandler.mjs.map +1 -0
  202. package/dist/handlers/validation-handler/typings.d.mts +14 -0
  203. package/dist/handlers/validation-handler/typings.d.ts +14 -0
  204. package/dist/handlers/validation-handler/typings.js +2 -0
  205. package/dist/handlers/validation-handler/typings.js.map +1 -0
  206. package/dist/handlers/validation-handler/typings.mjs +1 -0
  207. package/dist/handlers/validation-handler/typings.mjs.map +1 -0
  208. package/dist/hooks/common.d.mts +12 -0
  209. package/dist/hooks/common.d.ts +12 -0
  210. package/dist/hooks/common.js +11 -0
  211. package/dist/hooks/common.js.map +1 -0
  212. package/dist/hooks/common.mjs +2 -0
  213. package/dist/hooks/common.mjs.map +1 -0
  214. package/dist/hooks/index.d.mts +14 -0
  215. package/dist/hooks/index.d.ts +14 -0
  216. package/dist/hooks/index.js +11 -0
  217. package/dist/hooks/index.js.map +1 -0
  218. package/dist/hooks/index.mjs +2 -0
  219. package/dist/hooks/index.mjs.map +1 -0
  220. package/dist/hooks/response.d.mts +7 -0
  221. package/dist/hooks/response.d.ts +7 -0
  222. package/dist/hooks/response.js +11 -0
  223. package/dist/hooks/response.js.map +1 -0
  224. package/dist/hooks/response.mjs +2 -0
  225. package/dist/hooks/response.mjs.map +1 -0
  226. package/dist/hooks/useChannel.d.mts +5 -0
  227. package/dist/hooks/useChannel.d.ts +5 -0
  228. package/dist/hooks/useChannel.js +11 -0
  229. package/dist/hooks/useChannel.js.map +1 -0
  230. package/dist/hooks/useChannel.mjs +2 -0
  231. package/dist/hooks/useChannel.mjs.map +1 -0
  232. package/dist/hooks/useClient.d.mts +5 -0
  233. package/dist/hooks/useClient.d.ts +5 -0
  234. package/dist/hooks/useClient.js +11 -0
  235. package/dist/hooks/useClient.js.map +1 -0
  236. package/dist/hooks/useClient.mjs +2 -0
  237. package/dist/hooks/useClient.mjs.map +1 -0
  238. package/dist/hooks/useCommandData.d.mts +5 -0
  239. package/dist/hooks/useCommandData.d.ts +5 -0
  240. package/dist/hooks/useCommandData.js +11 -0
  241. package/dist/hooks/useCommandData.js.map +1 -0
  242. package/dist/hooks/useCommandData.mjs +2 -0
  243. package/dist/hooks/useCommandData.mjs.map +1 -0
  244. package/dist/hooks/useCommandKit.d.mts +9 -0
  245. package/dist/hooks/useCommandKit.d.ts +9 -0
  246. package/dist/hooks/useCommandKit.js +11 -0
  247. package/dist/hooks/useCommandKit.js.map +1 -0
  248. package/dist/hooks/useCommandKit.mjs +2 -0
  249. package/dist/hooks/useCommandKit.mjs.map +1 -0
  250. package/dist/hooks/useGuild.d.mts +5 -0
  251. package/dist/hooks/useGuild.d.ts +5 -0
  252. package/dist/hooks/useGuild.js +11 -0
  253. package/dist/hooks/useGuild.js.map +1 -0
  254. package/dist/hooks/useGuild.mjs +2 -0
  255. package/dist/hooks/useGuild.mjs.map +1 -0
  256. package/dist/hooks/useInteraction.d.mts +9 -0
  257. package/dist/hooks/useInteraction.d.ts +9 -0
  258. package/dist/hooks/useInteraction.js +11 -0
  259. package/dist/hooks/useInteraction.js.map +1 -0
  260. package/dist/hooks/useInteraction.mjs +2 -0
  261. package/dist/hooks/useInteraction.mjs.map +1 -0
  262. package/dist/hooks/useMember.d.mts +5 -0
  263. package/dist/hooks/useMember.d.ts +5 -0
  264. package/dist/hooks/useMember.js +11 -0
  265. package/dist/hooks/useMember.js.map +1 -0
  266. package/dist/hooks/useMember.mjs +2 -0
  267. package/dist/hooks/useMember.mjs.map +1 -0
  268. package/dist/hooks/useUser.d.mts +5 -0
  269. package/dist/hooks/useUser.d.ts +5 -0
  270. package/dist/hooks/useUser.js +11 -0
  271. package/dist/hooks/useUser.js.map +1 -0
  272. package/dist/hooks/useUser.mjs +2 -0
  273. package/dist/hooks/useUser.mjs.map +1 -0
  274. package/dist/index.d.mts +25 -535
  275. package/dist/index.d.ts +25 -535
  276. package/dist/index.js +6 -5
  277. package/dist/index.js.map +1 -0
  278. package/dist/index.mjs +2 -10
  279. package/dist/index.mjs.map +1 -0
  280. package/dist/types/index.d.mts +5 -0
  281. package/dist/types/index.d.ts +5 -0
  282. package/dist/types/index.js +2 -0
  283. package/dist/types/index.js.map +1 -0
  284. package/dist/types/index.mjs +2 -0
  285. package/dist/types/index.mjs.map +1 -0
  286. package/dist/typings.d.mts +5 -0
  287. package/dist/typings.d.ts +5 -0
  288. package/dist/typings.js +2 -0
  289. package/dist/typings.js.map +1 -0
  290. package/dist/typings.mjs +1 -0
  291. package/dist/typings.mjs.map +1 -0
  292. package/dist/utils/clone.d.mts +3 -0
  293. package/dist/utils/clone.d.ts +3 -0
  294. package/dist/utils/clone.js +2 -0
  295. package/dist/utils/clone.js.map +1 -0
  296. package/dist/utils/clone.mjs +2 -0
  297. package/dist/utils/clone.mjs.map +1 -0
  298. package/dist/utils/colors.d.mts +27 -0
  299. package/dist/utils/colors.d.ts +27 -0
  300. package/dist/utils/colors.js +2 -0
  301. package/dist/utils/colors.js.map +1 -0
  302. package/dist/utils/colors.mjs +2 -0
  303. package/dist/utils/colors.mjs.map +1 -0
  304. package/dist/utils/get-paths.d.mts +4 -0
  305. package/dist/utils/get-paths.d.ts +4 -0
  306. package/dist/utils/get-paths.js +2 -0
  307. package/dist/utils/get-paths.js.map +1 -0
  308. package/dist/utils/get-paths.mjs +2 -0
  309. package/dist/utils/get-paths.mjs.map +1 -0
  310. package/dist/utils/resolve-file-url.d.mts +8 -0
  311. package/dist/utils/resolve-file-url.d.ts +8 -0
  312. package/dist/utils/resolve-file-url.js +2 -0
  313. package/dist/utils/resolve-file-url.js.map +1 -0
  314. package/dist/utils/resolve-file-url.mjs +2 -0
  315. package/dist/utils/resolve-file-url.mjs.map +1 -0
  316. package/dist/utils/signal.d.mts +21 -0
  317. package/dist/utils/signal.d.ts +21 -0
  318. package/dist/utils/signal.js +2 -0
  319. package/dist/utils/signal.js.map +1 -0
  320. package/dist/utils/signal.mjs +2 -0
  321. package/dist/utils/signal.mjs.map +1 -0
  322. package/package.json +67 -57
  323. package/bin/build.mjs +0 -107
  324. package/bin/common.mjs +0 -102
  325. package/bin/development.mjs +0 -168
  326. package/bin/index.mjs +0 -39
  327. package/bin/parse-env.mjs +0 -61
  328. package/bin/production.mjs +0 -83
@@ -0,0 +1,27 @@
1
+ declare const _default: {
2
+ reset: (text: string) => string;
3
+ bright: (text: string) => string;
4
+ dim: (text: string) => string;
5
+ underscore: (text: string) => string;
6
+ blink: (text: string) => string;
7
+ reverse: (text: string) => string;
8
+ hidden: (text: string) => string;
9
+ black: (text: string) => string;
10
+ red: (text: string) => string;
11
+ green: (text: string) => string;
12
+ yellow: (text: string) => string;
13
+ blue: (text: string) => string;
14
+ magenta: (text: string) => string;
15
+ cyan: (text: string) => string;
16
+ white: (text: string) => string;
17
+ bgBlack: (text: string) => string;
18
+ bgRed: (text: string) => string;
19
+ bgGreen: (text: string) => string;
20
+ bgYellow: (text: string) => string;
21
+ bgBlue: (text: string) => string;
22
+ bgMagenta: (text: string) => string;
23
+ bgCyan: (text: string) => string;
24
+ bgWhite: (text: string) => string;
25
+ };
26
+
27
+ export { _default as default };
@@ -0,0 +1,27 @@
1
+ declare const _default: {
2
+ reset: (text: string) => string;
3
+ bright: (text: string) => string;
4
+ dim: (text: string) => string;
5
+ underscore: (text: string) => string;
6
+ blink: (text: string) => string;
7
+ reverse: (text: string) => string;
8
+ hidden: (text: string) => string;
9
+ black: (text: string) => string;
10
+ red: (text: string) => string;
11
+ green: (text: string) => string;
12
+ yellow: (text: string) => string;
13
+ blue: (text: string) => string;
14
+ magenta: (text: string) => string;
15
+ cyan: (text: string) => string;
16
+ white: (text: string) => string;
17
+ bgBlack: (text: string) => string;
18
+ bgRed: (text: string) => string;
19
+ bgGreen: (text: string) => string;
20
+ bgYellow: (text: string) => string;
21
+ bgBlue: (text: string) => string;
22
+ bgMagenta: (text: string) => string;
23
+ bgCyan: (text: string) => string;
24
+ bgWhite: (text: string) => string;
25
+ };
26
+
27
+ export { _default as default };
@@ -0,0 +1,2 @@
1
+ "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var colors_exports={};__export(colors_exports,{default:()=>colors_default});module.exports=__toCommonJS(colors_exports);var resetColor="\x1B[0m",colors_default={reset:text=>`${text}${resetColor}`,bright:text=>`\x1B[1m${text}${resetColor}`,dim:text=>`\x1B[2m${text}${resetColor}`,underscore:text=>`\x1B[4m${text}${resetColor}`,blink:text=>`\x1B[5m${text}${resetColor}`,reverse:text=>`\x1B[7m${text}${resetColor}`,hidden:text=>`\x1B[8m${text}${resetColor}`,black:text=>`\x1B[30m${text}${resetColor}`,red:text=>`\x1B[31m${text}${resetColor}`,green:text=>`\x1B[32m${text}${resetColor}`,yellow:text=>`\x1B[33m${text}${resetColor}`,blue:text=>`\x1B[34m${text}${resetColor}`,magenta:text=>`\x1B[35m${text}${resetColor}`,cyan:text=>`\x1B[36m${text}${resetColor}`,white:text=>`\x1B[37m${text}${resetColor}`,bgBlack:text=>`\x1B[40m${text}${resetColor}`,bgRed:text=>`\x1B[41m${text}${resetColor}`,bgGreen:text=>`\x1B[42m${text}${resetColor}`,bgYellow:text=>`\x1B[43m${text}${resetColor}`,bgBlue:text=>`\x1B[44m${text}${resetColor}`,bgMagenta:text=>`\x1B[45m${text}${resetColor}`,bgCyan:text=>`\x1B[46m${text}${resetColor}`,bgWhite:text=>`\x1B[47m${text}${resetColor}`};
2
+ //# sourceMappingURL=colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/colors.ts"],"sourcesContent":["const resetColor = '\\x1b[0m';\n\nexport default {\n reset: (text: string) => `${text}${resetColor}`,\n bright: (text: string) => `\\x1b[1m${text}${resetColor}`,\n dim: (text: string) => `\\x1b[2m${text}${resetColor}`,\n underscore: (text: string) => `\\x1b[4m${text}${resetColor}`,\n blink: (text: string) => `\\x1b[5m${text}${resetColor}`,\n reverse: (text: string) => `\\x1b[7m${text}${resetColor}`,\n hidden: (text: string) => `\\x1b[8m${text}${resetColor}`,\n\n black: (text: string) => `\\x1b[30m${text}${resetColor}`,\n red: (text: string) => `\\x1b[31m${text}${resetColor}`,\n green: (text: string) => `\\x1b[32m${text}${resetColor}`,\n yellow: (text: string) => `\\x1b[33m${text}${resetColor}`,\n blue: (text: string) => `\\x1b[34m${text}${resetColor}`,\n magenta: (text: string) => `\\x1b[35m${text}${resetColor}`,\n cyan: (text: string) => `\\x1b[36m${text}${resetColor}`,\n white: (text: string) => `\\x1b[37m${text}${resetColor}`,\n\n bgBlack: (text: string) => `\\x1b[40m${text}${resetColor}`,\n bgRed: (text: string) => `\\x1b[41m${text}${resetColor}`,\n bgGreen: (text: string) => `\\x1b[42m${text}${resetColor}`,\n bgYellow: (text: string) => `\\x1b[43m${text}${resetColor}`,\n bgBlue: (text: string) => `\\x1b[44m${text}${resetColor}`,\n bgMagenta: (text: string) => `\\x1b[45m${text}${resetColor}`,\n bgCyan: (text: string) => `\\x1b[46m${text}${resetColor}`,\n bgWhite: (text: string) => `\\x1b[47m${text}${resetColor}`,\n};\n"],"mappings":"wpBAAA,wHAAA,IAAM,WAAa,UAEZ,eAAQ,CACX,MAAQ,MAAiB,GAAG,IAAI,GAAG,UAAU,GAC7C,OAAS,MAAiB,UAAU,IAAI,GAAG,UAAU,GACrD,IAAM,MAAiB,UAAU,IAAI,GAAG,UAAU,GAClD,WAAa,MAAiB,UAAU,IAAI,GAAG,UAAU,GACzD,MAAQ,MAAiB,UAAU,IAAI,GAAG,UAAU,GACpD,QAAU,MAAiB,UAAU,IAAI,GAAG,UAAU,GACtD,OAAS,MAAiB,UAAU,IAAI,GAAG,UAAU,GAErD,MAAQ,MAAiB,WAAW,IAAI,GAAG,UAAU,GACrD,IAAM,MAAiB,WAAW,IAAI,GAAG,UAAU,GACnD,MAAQ,MAAiB,WAAW,IAAI,GAAG,UAAU,GACrD,OAAS,MAAiB,WAAW,IAAI,GAAG,UAAU,GACtD,KAAO,MAAiB,WAAW,IAAI,GAAG,UAAU,GACpD,QAAU,MAAiB,WAAW,IAAI,GAAG,UAAU,GACvD,KAAO,MAAiB,WAAW,IAAI,GAAG,UAAU,GACpD,MAAQ,MAAiB,WAAW,IAAI,GAAG,UAAU,GAErD,QAAU,MAAiB,WAAW,IAAI,GAAG,UAAU,GACvD,MAAQ,MAAiB,WAAW,IAAI,GAAG,UAAU,GACrD,QAAU,MAAiB,WAAW,IAAI,GAAG,UAAU,GACvD,SAAW,MAAiB,WAAW,IAAI,GAAG,UAAU,GACxD,OAAS,MAAiB,WAAW,IAAI,GAAG,UAAU,GACtD,UAAY,MAAiB,WAAW,IAAI,GAAG,UAAU,GACzD,OAAS,MAAiB,WAAW,IAAI,GAAG,UAAU,GACtD,QAAU,MAAiB,WAAW,IAAI,GAAG,UAAU,EAC3D","names":[]}
@@ -0,0 +1,2 @@
1
+ import{colors_default}from"../chunk-DJGEQTVH.mjs";import"../chunk-7KD7ZCH6.mjs";export{colors_default as default};
2
+ //# sourceMappingURL=colors.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,4 @@
1
+ declare function getFilePaths(directory: string, nesting?: boolean): Promise<string[]>;
2
+ declare function getFolderPaths(directory: string, nesting?: boolean): Promise<string[]>;
3
+
4
+ export { getFilePaths, getFolderPaths };
@@ -0,0 +1,4 @@
1
+ declare function getFilePaths(directory: string, nesting?: boolean): Promise<string[]>;
2
+ declare function getFolderPaths(directory: string, nesting?: boolean): Promise<string[]>;
3
+
4
+ export { getFilePaths, getFolderPaths };
@@ -0,0 +1,2 @@
1
+ "use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var get_paths_exports={};__export(get_paths_exports,{getFilePaths:()=>getFilePaths,getFolderPaths:()=>getFolderPaths});module.exports=__toCommonJS(get_paths_exports);var import_path=__toESM(require("path")),import_promises=__toESM(require("fs/promises"));async function getFilePaths(directory,nesting){let filePaths=[];if(!directory)return filePaths;let files=await import_promises.default.readdir(directory,{withFileTypes:!0});for(let file of files){let filePath=import_path.default.join(directory,file.name);file.isFile()&&filePaths.push(filePath),nesting&&file.isDirectory()&&(filePaths=[...filePaths,...await getFilePaths(filePath,!0)])}return filePaths}__name(getFilePaths,"getFilePaths");async function getFolderPaths(directory,nesting){let folderPaths=[];if(!directory)return folderPaths;let folders=await import_promises.default.readdir(directory,{withFileTypes:!0});for(let folder of folders){let folderPath=import_path.default.join(directory,folder.name);folder.isDirectory()&&(folderPaths.push(folderPath),nesting&&(folderPaths=[...folderPaths,...await getFolderPaths(folderPath,!0)]))}return folderPaths}__name(getFolderPaths,"getFolderPaths");0&&(module.exports={getFilePaths,getFolderPaths});
2
+ //# sourceMappingURL=get-paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/get-paths.ts"],"sourcesContent":["import path from 'path';\nimport fs from 'fs/promises';\n\nexport async function getFilePaths(directory: string, nesting?: boolean): Promise<string[]> {\n let filePaths: string[] = [];\n\n if (!directory) return filePaths;\n\n const files = await fs.readdir(directory, { withFileTypes: true });\n\n for (const file of files) {\n const filePath = path.join(directory, file.name);\n\n if (file.isFile()) {\n filePaths.push(filePath);\n }\n\n if (nesting && file.isDirectory()) {\n filePaths = [...filePaths, ...(await getFilePaths(filePath, true))];\n }\n }\n\n return filePaths;\n}\n\nexport async function getFolderPaths(directory: string, nesting?: boolean): Promise<string[]> {\n let folderPaths: string[] = [];\n\n if (!directory) return folderPaths;\n\n const folders = await fs.readdir(directory, { withFileTypes: true });\n\n for (const folder of folders) {\n const folderPath = path.join(directory, folder.name);\n\n if (folder.isDirectory()) {\n folderPaths.push(folderPath);\n\n if (nesting) {\n folderPaths = [...folderPaths, ...(await getFolderPaths(folderPath, true))];\n }\n }\n }\n\n return folderPaths;\n}\n"],"mappings":"q+BAAA,sKAAA,gBAAiB,yBACjB,gBAAe,gCAEf,eAAsB,aAAa,UAAmB,QAAsC,CACxF,IAAI,UAAsB,CAAC,EAE3B,GAAI,CAAC,UAAW,OAAO,UAEvB,IAAM,MAAQ,MAAM,gBAAAA,QAAG,QAAQ,UAAW,CAAE,cAAe,EAAK,CAAC,EAEjE,QAAW,QAAQ,MAAO,CACtB,IAAM,SAAW,YAAAC,QAAK,KAAK,UAAW,KAAK,IAAI,EAE3C,KAAK,OAAO,GACZ,UAAU,KAAK,QAAQ,EAGvB,SAAW,KAAK,YAAY,IAC5B,UAAY,CAAC,GAAG,UAAW,GAAI,MAAM,aAAa,SAAU,EAAI,CAAE,EAE1E,CAEA,OAAO,SACX,CApBsB,oCAsBtB,eAAsB,eAAe,UAAmB,QAAsC,CAC1F,IAAI,YAAwB,CAAC,EAE7B,GAAI,CAAC,UAAW,OAAO,YAEvB,IAAM,QAAU,MAAM,gBAAAD,QAAG,QAAQ,UAAW,CAAE,cAAe,EAAK,CAAC,EAEnE,QAAW,UAAU,QAAS,CAC1B,IAAM,WAAa,YAAAC,QAAK,KAAK,UAAW,OAAO,IAAI,EAE/C,OAAO,YAAY,IACnB,YAAY,KAAK,UAAU,EAEvB,UACA,YAAc,CAAC,GAAG,YAAa,GAAI,MAAM,eAAe,WAAY,EAAI,CAAE,GAGtF,CAEA,OAAO,WACX,CApBsB","names":["fs","path"]}
@@ -0,0 +1,2 @@
1
+ import{getFilePaths,getFolderPaths}from"../chunk-GLH4FCGA.mjs";import"../chunk-7KD7ZCH6.mjs";export{getFilePaths,getFolderPaths};
2
+ //# sourceMappingURL=get-paths.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Convert a local file path to a file URL.
3
+ * @param filePath - The local file's path.
4
+ * @returns - The converted file URL.
5
+ */
6
+ declare function toFileURL(filePath: string): string;
7
+
8
+ export { toFileURL };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Convert a local file path to a file URL.
3
+ * @param filePath - The local file's path.
4
+ * @returns - The converted file URL.
5
+ */
6
+ declare function toFileURL(filePath: string): string;
7
+
8
+ export { toFileURL };
@@ -0,0 +1,2 @@
1
+ "use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var resolve_file_url_exports={};__export(resolve_file_url_exports,{toFileURL:()=>toFileURL});module.exports=__toCommonJS(resolve_file_url_exports);var import_path=__toESM(require("path"));function toFileURL(filePath){return"file://"+import_path.default.resolve(filePath).replace(/\\\\|\\/g,"/")}__name(toFileURL,"toFileURL");0&&(module.exports={toFileURL});
2
+ //# sourceMappingURL=resolve-file-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"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 * @returns - The converted file URL.\n */\nexport function toFileURL(filePath: string) {\n const resolvedPath = path.resolve(filePath);\n return 'file://' + resolvedPath.replace(/\\\\\\\\|\\\\/g, '/');\n}\n"],"mappings":"q+BAAA,mJAAA,gBAAiB,yBAOV,SAAS,UAAU,SAAkB,CAExC,MAAO,UADc,YAAAA,QAAK,QAAQ,QAAQ,EACV,QAAQ,WAAY,GAAG,CAC3D,CAHgB","names":["path"]}
@@ -0,0 +1,2 @@
1
+ import{toFileURL}from"../chunk-3RMN5A5C.mjs";import"../chunk-7KD7ZCH6.mjs";export{toFileURL};
2
+ //# sourceMappingURL=resolve-file-url.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,21 @@
1
+ type CommandKitEffectCallback = () => void;
2
+ type CommandKitSignalInitializer<T> = T | (() => T);
3
+ type CommandKitSignalUpdater<T> = T | ((prev: T) => T);
4
+ type CommandKitSignal<T> = readonly [
5
+ () => T,
6
+ (value: CommandKitSignalUpdater<T>) => void,
7
+ () => void
8
+ ];
9
+ /**
10
+ * Creates a new signal.
11
+ * @param value - The initial value to use.
12
+ * @returns An array of functions: a getter, a setter, and a disposer.
13
+ */
14
+ declare function createSignal<T = unknown>(value?: CommandKitSignalInitializer<T>): CommandKitSignal<T>;
15
+ /**
16
+ * Creates a new effect.
17
+ * @param callback - The callback function to execute.
18
+ */
19
+ declare function createEffect(callback: CommandKitEffectCallback): void;
20
+
21
+ export { type CommandKitEffectCallback, type CommandKitSignal, type CommandKitSignalInitializer, type CommandKitSignalUpdater, createEffect, createSignal };
@@ -0,0 +1,21 @@
1
+ type CommandKitEffectCallback = () => void;
2
+ type CommandKitSignalInitializer<T> = T | (() => T);
3
+ type CommandKitSignalUpdater<T> = T | ((prev: T) => T);
4
+ type CommandKitSignal<T> = readonly [
5
+ () => T,
6
+ (value: CommandKitSignalUpdater<T>) => void,
7
+ () => void
8
+ ];
9
+ /**
10
+ * Creates a new signal.
11
+ * @param value - The initial value to use.
12
+ * @returns An array of functions: a getter, a setter, and a disposer.
13
+ */
14
+ declare function createSignal<T = unknown>(value?: CommandKitSignalInitializer<T>): CommandKitSignal<T>;
15
+ /**
16
+ * Creates a new effect.
17
+ * @param callback - The callback function to execute.
18
+ */
19
+ declare function createEffect(callback: CommandKitEffectCallback): void;
20
+
21
+ export { type CommandKitEffectCallback, type CommandKitSignal, type CommandKitSignalInitializer, type CommandKitSignalUpdater, createEffect, createSignal };
@@ -0,0 +1,2 @@
1
+ "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var signal_exports={};__export(signal_exports,{createEffect:()=>createEffect,createSignal:()=>createSignal});module.exports=__toCommonJS(signal_exports);var context=[];function createSignal(value){let subscribers=new Set,disposed=!1,val=value instanceof Function?value():value;return[__name(()=>{if(!disposed){let running=getCurrentObserver();running&&subscribers.add(running)}return val},"getter"),__name(newValue=>{if(!disposed){val=newValue instanceof Function?newValue(val):newValue;for(let subscriber of subscribers)subscriber()}},"setter"),__name(()=>{subscribers.clear(),disposed=!0},"dispose")]}__name(createSignal,"createSignal");function createEffect(callback){let execute=__name(()=>{context.push(execute);try{callback()}finally{context.pop()}},"execute");execute()}__name(createEffect,"createEffect");function getCurrentObserver(){return context[context.length-1]}__name(getCurrentObserver,"getCurrentObserver");0&&(module.exports={createEffect,createSignal});
2
+ //# sourceMappingURL=signal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/signal.ts"],"sourcesContent":["export type CommandKitEffectCallback = () => void;\nexport type CommandKitSignalInitializer<T> = T | (() => T);\nexport type CommandKitSignalUpdater<T> = T | ((prev: T) => T);\nexport type CommandKitSignal<T> = readonly [\n () => T,\n (value: CommandKitSignalUpdater<T>) => void,\n () => void,\n];\n\nconst context: CommandKitEffectCallback[] = [];\n\n/**\n * Creates a new signal.\n * @param value - The initial value to use.\n * @returns An array of functions: a getter, a setter, and a disposer.\n */\nexport function createSignal<T = unknown>(value?: CommandKitSignalInitializer<T>) {\n const subscribers = new Set<() => void>();\n\n let disposed = false;\n let val: T | undefined = value instanceof Function ? value() : value;\n\n const getter = () => {\n if (!disposed) {\n const running = getCurrentObserver();\n if (running) subscribers.add(running);\n }\n\n return val;\n };\n\n const setter = (newValue: CommandKitSignalUpdater<T>) => {\n if (disposed) return;\n val = newValue instanceof Function ? newValue(val!) : newValue;\n\n for (const subscriber of subscribers) {\n subscriber();\n }\n };\n\n const dispose = () => {\n subscribers.clear();\n disposed = true;\n };\n\n return [getter, setter, dispose] as CommandKitSignal<T>;\n}\n\n/**\n * Creates a new effect.\n * @param callback - The callback function to execute.\n */\nexport function createEffect(callback: CommandKitEffectCallback) {\n const execute = () => {\n context.push(execute);\n\n try {\n callback();\n } finally {\n context.pop();\n }\n };\n\n execute();\n}\n\n/**\n * Get the current observer.\n */\nfunction getCurrentObserver() {\n return context[context.length - 1];\n}\n"],"mappings":"ouBAAA,yJASA,IAAM,QAAsC,CAAC,EAOtC,SAAS,aAA0B,MAAwC,CAC9E,IAAM,YAAc,IAAI,IAEpB,SAAW,GACX,IAAqB,iBAAiB,SAAW,MAAM,EAAI,MAyB/D,MAAO,CAvBQ,WAAM,CACjB,GAAI,CAAC,SAAU,CACX,IAAM,QAAU,mBAAmB,EAC/B,SAAS,YAAY,IAAI,OAAO,CACxC,CAEA,OAAO,GACX,EAPe,UASA,OAAC,UAAyC,CACrD,GAAI,UACJ,KAAM,oBAAoB,SAAW,SAAS,GAAI,EAAI,SAEtD,QAAW,cAAc,YACrB,WAAW,EAEnB,EAPe,UASC,WAAM,CAClB,YAAY,MAAM,EAClB,SAAW,EACf,EAHgB,UAKe,CACnC,CA9BgB,oCAoCT,SAAS,aAAa,SAAoC,CAC7D,IAAM,QAAU,WAAM,CAClB,QAAQ,KAAK,OAAO,EAEpB,GAAI,CACA,SAAS,CACb,QAAE,CACE,QAAQ,IAAI,CAChB,CACJ,EARgB,WAUhB,QAAQ,CACZ,CAZgB,oCAiBhB,SAAS,oBAAqB,CAC1B,OAAO,QAAQ,QAAQ,OAAS,CAAC,CACrC,CAFS","names":[]}
@@ -0,0 +1,2 @@
1
+ import{createEffect,createSignal}from"../chunk-4M5YKUGX.mjs";import"../chunk-7KD7ZCH6.mjs";export{createEffect,createSignal};
2
+ //# sourceMappingURL=signal.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json CHANGED
@@ -1,60 +1,70 @@
1
1
  {
2
- "name": "commandkit",
3
- "description": "Beginner friendly command & event handler for Discord.js",
4
- "version": "0.1.10-dev.20240128000000",
5
- "license": "MIT",
6
- "main": "./dist/index.js",
7
- "module": "./dist/index.mjs",
8
- "types": "./dist/index.d.ts",
9
- "bin": "./bin/index.mjs",
10
- "exports": {
11
- ".": {
12
- "require": "./dist/index.js",
13
- "import": "./dist/index.mjs",
14
- "types": "./dist/index.d.ts"
15
- }
2
+ "name": "commandkit",
3
+ "description": "Beginner friendly command & event handler for Discord.js",
4
+ "version": "0.1.10-dev.20240131174628",
5
+ "license": "MIT",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.ts",
9
+ "bin": "./bin/index.mjs",
10
+ "exports": {
11
+ ".": {
12
+ "require": "./dist/index.js",
13
+ "import": "./dist/index.mjs",
14
+ "types": "./dist/index.d.ts"
16
15
  },
17
- "files": [
18
- "dist",
19
- "bin"
20
- ],
21
- "scripts": {
22
- "lint": "tsc",
23
- "dev": "tsup --watch",
24
- "build": "tsup",
25
- "deploy": "npm publish",
26
- "deploy-dev": "npm publish --access public --tag dev",
27
- "test": "cd ./tests && node ../bin/index.mjs dev",
28
- "test:build": "cd ./tests && node ../bin/index.mjs build",
29
- "test:prod": "cd ./tests && node ../bin/index.mjs start"
30
- },
31
- "repository": {
32
- "type": "git",
33
- "url": "https://github.com/underctrl-io/commandkit",
34
- "directory": "packages/commandkit"
35
- },
36
- "homepage": "https://commandkit.js.org",
37
- "keywords": [
38
- "discord.js",
39
- "command handler",
40
- "event handler"
41
- ],
42
- "dependencies": {
43
- "commander": "^11.1.0",
44
- "dotenv": "^16.4.1",
45
- "ora": "^8.0.1",
46
- "rfdc": "^1.3.1",
47
- "rimraf": "^5.0.5",
48
- "tsup": "^8.0.1"
49
- },
50
- "devDependencies": {
51
- "@types/node": "^20.11.6",
52
- "discord.js": "^14.14.1",
53
- "tsconfig": "workspace:*",
54
- "tsx": "^4.7.0",
55
- "typescript": "^5.3.3"
56
- },
57
- "peerDependencies": {
58
- "discord.js": "^14"
16
+ "./cli": {
17
+ "require": "./dist/environment/cli.js",
18
+ "import": "./dist/environment/cli.mjs",
19
+ "types": "./dist/environment/cli.d.ts"
59
20
  }
60
- }
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "bin"
25
+ ],
26
+ "scripts": {
27
+ "lint": "tsc --noEmit",
28
+ "dev": "tsup --watch",
29
+ "build": "tsup",
30
+ "deploy": "npm publish",
31
+ "deploy-dev": "npm publish --access public --tag dev",
32
+ "test": "vitest",
33
+ "test:dev": "cd ./tests && node ../bin/index.mjs dev",
34
+ "test:build": "cd ./tests && node ../bin/index.mjs build",
35
+ "test:prod": "cd ./tests && node ../bin/index.mjs start"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/underctrl-io/commandkit",
40
+ "directory": "packages/commandkit"
41
+ },
42
+ "homepage": "https://commandkit.js.org",
43
+ "keywords": [
44
+ "discord.js",
45
+ "command handler",
46
+ "event handler"
47
+ ],
48
+ "dependencies": {
49
+ "dotenv-cra": "^3.0.3",
50
+ "ora": "^8.0.1",
51
+ "rfdc": "^1.3.1",
52
+ "rimraf": "^5.0.5",
53
+ "source-map-support": "^0.5.21",
54
+ "tsup": "^8.0.1",
55
+ "yargs": "^17.7.2"
56
+ },
57
+ "devDependencies": {
58
+ "@types/node": "^20.11.6",
59
+ "@types/yargs": "^17.0.32",
60
+ "discord.js": "^14.14.1",
61
+ "esbuild-plugin-version-injector": "^1.2.1",
62
+ "tsconfig": "workspace:*",
63
+ "tsx": "^4.7.0",
64
+ "typescript": "^5.3.3",
65
+ "vitest": "^1.2.1"
66
+ },
67
+ "peerDependencies": {
68
+ "discord.js": "^14"
69
+ }
70
+ }
package/bin/build.mjs DELETED
@@ -1,107 +0,0 @@
1
- // @ts-check
2
-
3
- import { readFile, writeFile } from 'node:fs/promises';
4
- import { join } from 'node:path';
5
- import { build } from 'tsup';
6
- import { Colors, erase, findCommandKitConfig, panic, write } from './common.mjs';
7
- import ora from 'ora';
8
-
9
- export async function bootstrapProductionBuild(config) {
10
- const {
11
- sourcemap = false,
12
- minify = false,
13
- outDir = 'dist',
14
- antiCrash = true,
15
- src,
16
- main,
17
- requirePolyfill: polyfillRequire,
18
- } = await findCommandKitConfig(config);
19
-
20
- const status = ora('Creating optimized production build...\n').start();
21
- const start = performance.now();
22
-
23
- erase(outDir);
24
-
25
- try {
26
- await build({
27
- clean: true,
28
- format: ['esm'],
29
- dts: false,
30
- skipNodeModulesBundle: true,
31
- minify,
32
- shims: true,
33
- banner: {
34
- js: '/* Optimized production build generated by CommandKit */',
35
- },
36
- sourcemap,
37
- keepNames: true,
38
- outDir,
39
- silent: true,
40
- watch: false,
41
- entry: [src, '!dist', '!.commandkit', `!${outDir}`],
42
- });
43
-
44
- await injectShims(outDir, main, antiCrash, polyfillRequire);
45
-
46
- status.succeed(
47
- Colors.green(`Build completed in ${(performance.now() - start).toFixed(2)}ms!`),
48
- );
49
- write(
50
- Colors.green(
51
- `\nRun ${Colors.magenta(`commandkit start`)} ${Colors.green('to start your bot.')}`,
52
- ),
53
- );
54
- } catch (e) {
55
- status.fail(`Build failed after ${(performance.now() - start).toFixed(2)}ms!`);
56
- panic(e);
57
- }
58
- }
59
-
60
- export async function injectShims(outDir, main, antiCrash, polyfillRequire) {
61
- const path = join(process.cwd(), outDir, main);
62
-
63
- const head = ['\n\n;await (async()=>{', " 'use strict';"].join('\n');
64
- const tail = '\n})();';
65
- const requireScript = polyfillRequire
66
- ? [
67
- '// --- CommandKit require() polyfill ---',
68
- ' if (typeof require === "undefined") {',
69
- ' const { createRequire } = await import("node:module");',
70
- ' const __require = createRequire(import.meta.url);',
71
- ' Object.defineProperty(globalThis, "require", {',
72
- ' value: (id) => {',
73
- ' return __require(id);',
74
- ' },',
75
- ' configurable: true,',
76
- ' enumerable: false,',
77
- ' writable: true,',
78
- ' });',
79
- ' }',
80
- '// --- CommandKit require() polyfill ---',
81
- ].join('\n')
82
- : '';
83
-
84
- const antiCrashScript = antiCrash
85
- ? [
86
- '// --- CommandKit Anti-Crash Monitor ---',
87
- " // 'uncaughtException' event is supposed to be used to perform synchronous cleanup before shutting down the process",
88
- ' // instead of using it as a means to resume operation.',
89
- ' // But it exists here due to compatibility reasons with discord bot ecosystem.',
90
- " const p = (t) => `\\x1b[33m${t}\\x1b[0m`, b = '[CommandKit Anti-Crash Monitor]', l = console.log, e1 = 'uncaughtException', e2 = 'unhandledRejection';",
91
- ' if (!process.eventNames().includes(e1)) // skip if it is already handled',
92
- ' process.on(e1, (e) => {',
93
- ' l(p(`${b} Uncaught Exception`)); l(p(b), p(e.stack || e));',
94
- ' })',
95
- ' if (!process.eventNames().includes(e2)) // skip if it is already handled',
96
- ' process.on(e2, (r) => {',
97
- ' l(p(`${b} Unhandled promise rejection`)); l(p(`${b} ${r.stack || r}`));',
98
- ' });',
99
- '// --- CommandKit Anti-Crash Monitor ---',
100
- ].join('\n')
101
- : '';
102
-
103
- const contents = await readFile(path, 'utf-8');
104
- const finalScript = [head, requireScript, antiCrashScript, tail, '\n\n', contents].join('\n');
105
-
106
- return writeFile(path, finalScript);
107
- }
package/bin/common.mjs DELETED
@@ -1,102 +0,0 @@
1
- // @ts-check
2
-
3
- import { rimrafSync } from 'rimraf';
4
- import { join } from 'node:path';
5
- import fs from 'node:fs';
6
-
7
- const resetColor = '\x1b[0m';
8
-
9
- export const Colors = {
10
- reset: (text) => `${text}${resetColor}`,
11
- bright: (text) => `\x1b[1m${text}${resetColor}`,
12
- dim: (text) => `\x1b[2m${text}${resetColor}`,
13
- underscore: (text) => `\x1b[4m${text}${resetColor}`,
14
- blink: (text) => `\x1b[5m${text}${resetColor}`,
15
- reverse: (text) => `\x1b[7m${text}${resetColor}`,
16
- hidden: (text) => `\x1b[8m${text}${resetColor}`,
17
-
18
- black: (text) => `\x1b[30m${text}${resetColor}`,
19
- red: (text) => `\x1b[31m${text}${resetColor}`,
20
- green: (text) => `\x1b[32m${text}${resetColor}`,
21
- yellow: (text) => `\x1b[33m${text}${resetColor}`,
22
- blue: (text) => `\x1b[34m${text}${resetColor}`,
23
- magenta: (text) => `\x1b[35m${text}${resetColor}`,
24
- cyan: (text) => `\x1b[36m${text}${resetColor}`,
25
- white: (text) => `\x1b[37m${text}${resetColor}`,
26
-
27
- bgBlack: (text) => `\x1b[40m${text}${resetColor}`,
28
- bgRed: (text) => `\x1b[41m${text}${resetColor}`,
29
- bgGreen: (text) => `\x1b[42m${text}${resetColor}`,
30
- bgYellow: (text) => `\x1b[43m${text}${resetColor}`,
31
- bgBlue: (text) => `\x1b[44m${text}${resetColor}`,
32
- bgMagenta: (text) => `\x1b[45m${text}${resetColor}`,
33
- bgCyan: (text) => `\x1b[46m${text}${resetColor}`,
34
- bgWhite: (text) => `\x1b[47m${text}${resetColor}`,
35
- };
36
-
37
- export function write(message) {
38
- process.stdout.write(message);
39
- process.stdout.write('\n');
40
- }
41
-
42
- /**
43
- * @returns {never}
44
- */
45
- export function panic(message) {
46
- write(Colors.red(`Error: ${message}`));
47
- process.exit(1);
48
- }
49
-
50
- export function findPackageJSON() {
51
- const cwd = process.cwd();
52
- const target = join(cwd, 'package.json');
53
-
54
- if (!fs.existsSync(target)) {
55
- panic('Could not find package.json in current directory.');
56
- }
57
-
58
- return JSON.parse(fs.readFileSync(target, 'utf8'));
59
- }
60
-
61
- const possibleFileNames = [
62
- 'commandkit.json',
63
- 'commandkit.config.json',
64
- 'commandkit.js',
65
- 'commandkit.config.js',
66
- 'commandkit.mjs',
67
- 'commandkit.config.mjs',
68
- 'commandkit.cjs',
69
- 'commandkit.config.cjs',
70
- ];
71
-
72
- export async function findCommandKitConfig(src) {
73
- const cwd = process.cwd();
74
- const locations = src ? [join(cwd, src)] : possibleFileNames.map((name) => join(cwd, name));
75
-
76
- for (const location of locations) {
77
- try {
78
- return await loadConfigInner(location);
79
- } catch (e) {
80
- continue;
81
- }
82
- }
83
-
84
- panic('Could not locate commandkit config.');
85
- }
86
-
87
- async function loadConfigInner(target) {
88
- const isJSON = target.endsWith('.json');
89
-
90
- /**
91
- * @type {import('..').CommandKitConfig}
92
- */
93
- const config = await import(`file://${target}`, {
94
- assert: isJSON ? { type: 'json' } : undefined,
95
- }).then((conf) => conf.default || conf);
96
-
97
- return config;
98
- }
99
-
100
- export function erase(dir) {
101
- rimrafSync(dir);
102
- }