commandkit 1.2.0-dev.20260130122631 → 1.2.0-dev.20260130130954

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 (212) hide show
  1. package/dist/{ActionRow-B-CGmjDp.d.ts → ActionRow-CT-uyxW0.d.ts} +2 -2
  2. package/dist/{Button-C-GPeFA3.d.ts → Button-oMnlpF6W.d.ts} +2 -2
  3. package/dist/{CommandKitEventsChannel-CnT5ymYe.js → CommandKitEventsChannel-DDI0UVh9.js} +1 -1
  4. package/dist/{CommandKitEventsChannel-CnT5ymYe.js.map → CommandKitEventsChannel-DDI0UVh9.js.map} +1 -1
  5. package/dist/{CommandsRouter-C_HLsrGX.js → CommandsRouter-D5mGRFEr.js} +1 -1
  6. package/dist/{CommandsRouter-C_HLsrGX.js.map → CommandsRouter-D5mGRFEr.js.map} +1 -1
  7. package/dist/{CompilerPlugin-CUsGAfgl.js → CompilerPlugin-DZidFuHJ.js} +2 -2
  8. package/dist/{CompilerPlugin-CUsGAfgl.js.map → CompilerPlugin-DZidFuHJ.js.map} +1 -1
  9. package/dist/{EventInterceptor-BWoEJMHZ.js → EventInterceptor-CxA95XYA.js} +1 -1
  10. package/dist/{EventInterceptor-BWoEJMHZ.js.map → EventInterceptor-CxA95XYA.js.map} +1 -1
  11. package/dist/{EventWorkerContext-Dfhgv329.js → EventWorkerContext-CfqamFWu.js} +1 -1
  12. package/dist/{EventWorkerContext-Dfhgv329.js.map → EventWorkerContext-CfqamFWu.js.map} +1 -1
  13. package/dist/{EventsRouter-DZYIha6m.js → EventsRouter-Be5NDOX4.js} +1 -1
  14. package/dist/{EventsRouter-DZYIha6m.js.map → EventsRouter-Be5NDOX4.js.map} +1 -1
  15. package/dist/{MessageCommandParser-Bs9fimmd.js → MessageCommandParser-VMFFGs0R.js} +1 -1
  16. package/dist/{MessageCommandParser-Bs9fimmd.js.map → MessageCommandParser-VMFFGs0R.js.map} +1 -1
  17. package/dist/{Modal-CZT9MZsy.d.ts → Modal--iMEUqSm.d.ts} +2 -2
  18. package/dist/{PluginCommon-BLxWww5u.js → PluginCommon-Bfs8d9s7.js} +1 -1
  19. package/dist/{PluginCommon-BLxWww5u.js.map → PluginCommon-Bfs8d9s7.js.map} +1 -1
  20. package/dist/{RuntimePlugin-CtobluSU.js → RuntimePlugin-BYQXQO8w.js} +2 -2
  21. package/dist/{RuntimePlugin-CtobluSU.js.map → RuntimePlugin-BYQXQO8w.js.map} +1 -1
  22. package/dist/{SelectMenu-q_b3Mjv9.d.ts → SelectMenu-DQbmOp1Y.d.ts} +8 -4
  23. package/dist/analytics/analytics-engine.d.ts +1 -1
  24. package/dist/analytics/analytics-engine.js +17 -22
  25. package/dist/analytics/analytics-provider.d.ts +1 -1
  26. package/dist/analytics/constants.js +1 -1
  27. package/dist/analytics/utils.js +17 -22
  28. package/dist/{analytics-engine-WQhXmx3H.d.ts → analytics-engine-_urJ5QTH.d.ts} +8 -3
  29. package/dist/app/commands/AppCommandRunner.d.ts +1 -1
  30. package/dist/app/commands/AppCommandRunner.js +17 -22
  31. package/dist/app/commands/Context.d.ts +1 -1
  32. package/dist/app/commands/Context.js +17 -22
  33. package/dist/app/commands/MessageCommandParser.js +1 -1
  34. package/dist/app/commands/helpers.js +1 -1
  35. package/dist/app/events/EventWorkerContext.d.ts +1 -1
  36. package/dist/app/events/EventWorkerContext.js +1 -1
  37. package/dist/app/handlers/AppCommandHandler.d.ts +1 -1
  38. package/dist/app/handlers/AppCommandHandler.js +17 -22
  39. package/dist/app/handlers/AppEventsHandler.d.ts +1 -1
  40. package/dist/app/handlers/AppEventsHandler.js +17 -22
  41. package/dist/app/index.d.ts +1 -1
  42. package/dist/app/index.js +17 -22
  43. package/dist/app/interrupt/signals.js +2 -2
  44. package/dist/app/middlewares/permissions.d.ts +1 -1
  45. package/dist/app/middlewares/permissions.js +17 -22
  46. package/dist/app/register/CommandRegistrar.d.ts +1 -1
  47. package/dist/app/register/CommandRegistrar.js +17 -22
  48. package/dist/app/router/CommandsRouter.js +1 -1
  49. package/dist/app/router/EventsRouter.js +1 -1
  50. package/dist/app/router/index.js +3 -3
  51. package/dist/cli/app-process.js +4 -4
  52. package/dist/cli/build.d.ts +1 -1
  53. package/dist/cli/build.js +20 -25
  54. package/dist/cli/build.js.map +1 -1
  55. package/dist/cli/common.d.ts +1 -1
  56. package/dist/cli/common.js +3 -3
  57. package/dist/cli/development.js +20 -25
  58. package/dist/cli/development.js.map +1 -1
  59. package/dist/cli/env.js +1 -1
  60. package/dist/cli/generators.js +3 -3
  61. package/dist/cli/information.js +2 -2
  62. package/dist/cli/init.js +18 -23
  63. package/dist/cli/init.js.map +1 -1
  64. package/dist/cli/production.js +20 -25
  65. package/dist/cli/production.js.map +1 -1
  66. package/dist/cli/type-checker.js +4 -4
  67. package/dist/{commandkit-a_lLZW59.js → commandkit-BUkbAdid.js} +2645 -2190
  68. package/dist/commandkit-BUkbAdid.js.map +1 -0
  69. package/dist/commandkit.d.ts +1 -1
  70. package/dist/commandkit.js +17 -22
  71. package/dist/{common-DSRs_mfw.js → common-zQwj90Nz.js} +3 -3
  72. package/dist/{common-DSRs_mfw.js.map → common-zQwj90Nz.js.map} +1 -1
  73. package/dist/components/common/EventInterceptor.js +1 -1
  74. package/dist/components/common/element.d.ts +2 -2
  75. package/dist/components/common/element.js +27 -8
  76. package/dist/components/display/common.js +20 -2
  77. package/dist/components/display/container.js +20 -2
  78. package/dist/components/display/file.js +1 -1
  79. package/dist/components/display/index.js +25 -15
  80. package/dist/components/display/label.js +20 -2
  81. package/dist/components/display/media-gallery.js +21 -3
  82. package/dist/components/display/poll.js +1 -1
  83. package/dist/components/display/section.js +21 -3
  84. package/dist/components/display/separator.js +1 -1
  85. package/dist/components/display/text-display.js +1 -1
  86. package/dist/components/index.d.ts +6 -6
  87. package/dist/components/index.js +31 -36
  88. package/dist/components/interactive/action-row/ActionRow.d.ts +1 -1
  89. package/dist/components/interactive/button/Button.d.ts +1 -1
  90. package/dist/components/interactive/button/Button.js +17 -22
  91. package/dist/components/interactive/button/ButtonKit.js +17 -22
  92. package/dist/components/interactive/modal/Modal.d.ts +1 -1
  93. package/dist/components/interactive/modal/Modal.js +17 -22
  94. package/dist/components/interactive/modal/ModalKit.js +17 -22
  95. package/dist/components/interactive/select-menu/ChannelSelectMenuKit.js +17 -22
  96. package/dist/components/interactive/select-menu/MentionableSelectMenuKit.js +17 -22
  97. package/dist/components/interactive/select-menu/RoleSelectMenuKit.js +17 -22
  98. package/dist/components/interactive/select-menu/SelectMenu.d.ts +1 -1
  99. package/dist/components/interactive/select-menu/SelectMenu.js +17 -22
  100. package/dist/components/interactive/select-menu/StringSelectMenuKit.js +17 -22
  101. package/dist/components/interactive/select-menu/UserSelectMenuKit.js +17 -22
  102. package/dist/config/config.d.ts +1 -1
  103. package/dist/config/config.js +17 -22
  104. package/dist/config/default.d.ts +1 -1
  105. package/dist/config/default.js +17 -22
  106. package/dist/config/loader.d.ts +1 -1
  107. package/dist/config/loader.js +17 -22
  108. package/dist/config/types.d.ts +1 -1
  109. package/dist/config/utils.d.ts +1 -1
  110. package/dist/config/utils.js +1 -1
  111. package/dist/{constants-Cw8VjCVz.js → constants-BA0TJU6e.js} +1 -1
  112. package/dist/{constants-Cw8VjCVz.js.map → constants-BA0TJU6e.js.map} +1 -1
  113. package/dist/{constants-BFFK-hfP.js → constants-BS9N2avz.js} +1 -1
  114. package/dist/{constants-BFFK-hfP.js.map → constants-BS9N2avz.js.map} +1 -1
  115. package/dist/{constants-CxkFFZ7p.js → constants-CeIMhMD0.js} +1 -1
  116. package/dist/{constants-CxkFFZ7p.js.map → constants-CeIMhMD0.js.map} +1 -1
  117. package/dist/context/async-context.d.ts +1 -1
  118. package/dist/context/async-context.js +17 -22
  119. package/dist/context/environment.d.ts +1 -1
  120. package/dist/context/environment.js +17 -22
  121. package/dist/{element-wQo0heGj.d.ts → element-DZeqbSTk.d.ts} +3 -2
  122. package/dist/{env-CmspDhHy.js → env-FxaiNasU.js} +1 -1
  123. package/dist/{env-CmspDhHy.js.map → env-FxaiNasU.js.map} +1 -1
  124. package/dist/events/CommandKitEventsChannel.d.ts +1 -1
  125. package/dist/events/CommandKitEventsChannel.js +1 -1
  126. package/dist/{file-Ca1kpEtE.js → file-DqI3v90P.js} +1 -1
  127. package/dist/{file-Ca1kpEtE.js.map → file-DqI3v90P.js.map} +1 -1
  128. package/dist/flags/FlagProvider.d.ts +1 -1
  129. package/dist/flags/feature-flags.d.ts +1 -1
  130. package/dist/flags/feature-flags.js +20 -163
  131. package/dist/flags/store.d.ts +1 -1
  132. package/dist/flags/store.js +1 -1
  133. package/dist/{helpers-Btx1FSZx.js → helpers-DSy7EjzP.js} +1 -1
  134. package/dist/{helpers-Btx1FSZx.js.map → helpers-DSy7EjzP.js.map} +1 -1
  135. package/dist/index.d.ts +7 -7
  136. package/dist/index.js +42 -55
  137. package/dist/kv/constants.js +1 -1
  138. package/dist/kv/serde.js +1 -1
  139. package/dist/logger/DefaultLogger.js +17 -22
  140. package/dist/logger/Logger.js +17 -22
  141. package/dist/plugins/CompilerPlugin.d.ts +1 -1
  142. package/dist/plugins/CompilerPlugin.js +1 -1
  143. package/dist/plugins/PluginCommon.d.ts +1 -1
  144. package/dist/plugins/PluginCommon.js +1 -1
  145. package/dist/plugins/RuntimePlugin.d.ts +1 -1
  146. package/dist/plugins/RuntimePlugin.js +1 -1
  147. package/dist/plugins/index.d.ts +1 -1
  148. package/dist/plugins/index.js +19 -24
  149. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +1 -1
  150. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +17 -22
  151. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +1 -1
  152. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +17 -22
  153. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +1 -1
  154. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +17 -22
  155. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +1 -1
  156. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +17 -22
  157. package/dist/plugins/plugin-runtime/runtime.d.ts +1 -1
  158. package/dist/plugins/types.d.ts +1 -1
  159. package/dist/{poll-CFe8yvoJ.js → poll-ziQQQbMU.js} +1 -1
  160. package/dist/{poll-CFe8yvoJ.js.map → poll-ziQQQbMU.js.map} +1 -1
  161. package/dist/{resolve-file-url-CdHqwWs3.js → resolve-file-url-BmjHzIKe.js} +1 -1
  162. package/dist/{resolve-file-url-CdHqwWs3.js.map → resolve-file-url-BmjHzIKe.js.map} +1 -1
  163. package/dist/{separator-BUTiW7uz.js → separator-DGwA_b1J.js} +1 -1
  164. package/dist/{separator-BUTiW7uz.js.map → separator-DGwA_b1J.js.map} +1 -1
  165. package/dist/{signals-B8z1wJ6W.js → signals-ewEPW2cO.js} +2 -2
  166. package/dist/{signals-B8z1wJ6W.js.map → signals-ewEPW2cO.js.map} +1 -1
  167. package/dist/{store-D8r_hryO.js → store-DK4JA-fQ.js} +1 -1
  168. package/dist/{store-D8r_hryO.js.map → store-DK4JA-fQ.js.map} +1 -1
  169. package/dist/{text-display-DANahMN3.js → text-display-BVuG7dT-.js} +1 -1
  170. package/dist/{text-display-DANahMN3.js.map → text-display-BVuG7dT-.js.map} +1 -1
  171. package/dist/{type-checker-cVd3Hpnh.js → type-checker-CFpKDDs8.js} +2 -2
  172. package/dist/{type-checker-cVd3Hpnh.js.map → type-checker-CFpKDDs8.js.map} +1 -1
  173. package/dist/{types-package-CsTNfvv2.js → types-package-Bjh_ap0V.js} +2 -2
  174. package/dist/{types-package-CsTNfvv2.js.map → types-package-Bjh_ap0V.js.map} +1 -1
  175. package/dist/types.d.ts +1 -1
  176. package/dist/utils/constants.js +1 -1
  177. package/dist/utils/dev-hooks.d.ts +1 -1
  178. package/dist/utils/dev-hooks.js +17 -22
  179. package/dist/utils/resolve-file-url.js +1 -1
  180. package/dist/utils/types-package.js +2 -2
  181. package/dist/utils/utilities.js +17 -22
  182. package/dist/utils/warning.js +1 -1
  183. package/dist/{utils-Br3eenD1.js → utils-CVaVycsK.js} +1 -1
  184. package/dist/{utils-Br3eenD1.js.map → utils-CVaVycsK.js.map} +1 -1
  185. package/dist/version-CdkD798u.js +18 -0
  186. package/dist/version-CdkD798u.js.map +1 -0
  187. package/dist/version.js +2 -12
  188. package/dist/{warning-CszH8HeS.js → warning-BWiQltHE.js} +1 -1
  189. package/dist/{warning-CszH8HeS.js.map → warning-BWiQltHE.js.map} +1 -1
  190. package/package.json +3 -3
  191. package/dist/commandkit-a_lLZW59.js.map +0 -1
  192. package/dist/common-CEordwf3.js +0 -17
  193. package/dist/common-CEordwf3.js.map +0 -1
  194. package/dist/container-DCPljKVH.js +0 -43
  195. package/dist/container-DCPljKVH.js.map +0 -1
  196. package/dist/element-DibzzA5L.js +0 -84
  197. package/dist/element-DibzzA5L.js.map +0 -1
  198. package/dist/flags/feature-flags.js.map +0 -1
  199. package/dist/index.js.map +0 -1
  200. package/dist/label-B6vXvwLM.js +0 -35
  201. package/dist/label-B6vXvwLM.js.map +0 -1
  202. package/dist/media-gallery-u3gjX7yD.js +0 -61
  203. package/dist/media-gallery-u3gjX7yD.js.map +0 -1
  204. package/dist/section-BC8LF-B2.js +0 -59
  205. package/dist/section-BC8LF-B2.js.map +0 -1
  206. package/dist/version.js.map +0 -1
  207. /package/dist/{common-C2jAjX4U.js → ILogger-JI8VGyJf.js} +0 -0
  208. /package/dist/{display-WDb9wMCv.js → common-vGj3fpz3.js} +0 -0
  209. /package/dist/{router-BvamdzoF.js → router-CtcApqrw.js} +0 -0
  210. /package/dist/{runtime-Skt5NiOc.js → runtime-UJIpkNww.js} +0 -0
  211. /package/dist/{types-Cdh4uaFR.js → types-Bx1EKe0v.js} +0 -0
  212. /package/dist/{types-TC4g3w91.js → types-CAwOz52q.js} +0 -0
@@ -1,3 +1,3 @@
1
- const require_constants = require('../constants-BFFK-hfP.js');
1
+ const require_constants = require('../constants-BS9N2avz.js');
2
2
 
3
3
  exports.SerializerType = require_constants.SerializerType;
package/dist/kv/serde.js CHANGED
@@ -1,4 +1,4 @@
1
- const require_constants = require('../constants-BFFK-hfP.js');
1
+ const require_constants = require('../constants-BS9N2avz.js');
2
2
 
3
3
  //#region src/kv/serde.ts
4
4
  function serializer(value) {
@@ -1,26 +1,21 @@
1
1
  require('../colors-Csc0X4QJ.js');
2
2
  require('../ActionRow-CSN_UKmM.js');
3
- const require_commandkit = require('../commandkit-a_lLZW59.js');
4
- require('../container-DCPljKVH.js');
5
- require('../file-Ca1kpEtE.js');
6
- require('../media-gallery-u3gjX7yD.js');
7
- require('../section-BC8LF-B2.js');
8
- require('../separator-BUTiW7uz.js');
9
- require('../text-display-DANahMN3.js');
10
- require('../label-B6vXvwLM.js');
11
- require('../poll-CFe8yvoJ.js');
12
- require('../display-WDb9wMCv.js');
13
- require('../constants-CxkFFZ7p.js');
14
- require('../types-package-CsTNfvv2.js');
15
- require('../constants-Cw8VjCVz.js');
16
- require('../EventWorkerContext-Dfhgv329.js');
17
- require('../signals-B8z1wJ6W.js');
18
- require('../helpers-Btx1FSZx.js');
19
- require('../MessageCommandParser-Bs9fimmd.js');
20
- require('../CommandsRouter-C_HLsrGX.js');
21
- require('../EventsRouter-DZYIha6m.js');
22
- require('../router-BvamdzoF.js');
23
- require('../common-DSRs_mfw.js');
24
- require('../store-D8r_hryO.js');
3
+ const require_commandkit = require('../commandkit-BUkbAdid.js');
4
+ require('../constants-CeIMhMD0.js');
5
+ require('../types-package-Bjh_ap0V.js');
6
+ require('../constants-BA0TJU6e.js');
7
+ require('../EventWorkerContext-CfqamFWu.js');
8
+ require('../signals-ewEPW2cO.js');
9
+ require('../helpers-DSy7EjzP.js');
10
+ require('../MessageCommandParser-VMFFGs0R.js');
11
+ require('../CommandsRouter-D5mGRFEr.js');
12
+ require('../EventsRouter-Be5NDOX4.js');
13
+ require('../router-CtcApqrw.js');
14
+ require('../file-DqI3v90P.js');
15
+ require('../separator-DGwA_b1J.js');
16
+ require('../text-display-BVuG7dT-.js');
17
+ require('../poll-ziQQQbMU.js');
18
+ require('../common-zQwj90Nz.js');
19
+ require('../store-DK4JA-fQ.js');
25
20
 
26
21
  exports.DefaultLogger = require_commandkit.DefaultLogger;
@@ -1,27 +1,22 @@
1
1
  require('../colors-Csc0X4QJ.js');
2
2
  require('../ActionRow-CSN_UKmM.js');
3
- const require_commandkit = require('../commandkit-a_lLZW59.js');
4
- require('../container-DCPljKVH.js');
5
- require('../file-Ca1kpEtE.js');
6
- require('../media-gallery-u3gjX7yD.js');
7
- require('../section-BC8LF-B2.js');
8
- require('../separator-BUTiW7uz.js');
9
- require('../text-display-DANahMN3.js');
10
- require('../label-B6vXvwLM.js');
11
- require('../poll-CFe8yvoJ.js');
12
- require('../display-WDb9wMCv.js');
13
- require('../constants-CxkFFZ7p.js');
14
- require('../types-package-CsTNfvv2.js');
15
- require('../constants-Cw8VjCVz.js');
16
- require('../EventWorkerContext-Dfhgv329.js');
17
- require('../signals-B8z1wJ6W.js');
18
- require('../helpers-Btx1FSZx.js');
19
- require('../MessageCommandParser-Bs9fimmd.js');
20
- require('../CommandsRouter-C_HLsrGX.js');
21
- require('../EventsRouter-DZYIha6m.js');
22
- require('../router-BvamdzoF.js');
23
- require('../common-DSRs_mfw.js');
24
- require('../store-D8r_hryO.js');
3
+ const require_commandkit = require('../commandkit-BUkbAdid.js');
4
+ require('../constants-CeIMhMD0.js');
5
+ require('../types-package-Bjh_ap0V.js');
6
+ require('../constants-BA0TJU6e.js');
7
+ require('../EventWorkerContext-CfqamFWu.js');
8
+ require('../signals-ewEPW2cO.js');
9
+ require('../helpers-DSy7EjzP.js');
10
+ require('../MessageCommandParser-VMFFGs0R.js');
11
+ require('../CommandsRouter-D5mGRFEr.js');
12
+ require('../EventsRouter-Be5NDOX4.js');
13
+ require('../router-CtcApqrw.js');
14
+ require('../file-DqI3v90P.js');
15
+ require('../separator-DGwA_b1J.js');
16
+ require('../text-display-BVuG7dT-.js');
17
+ require('../poll-ziQQQbMU.js');
18
+ require('../common-zQwj90Nz.js');
19
+ require('../store-DK4JA-fQ.js');
25
20
 
26
21
  exports.Logger = require_commandkit.Logger;
27
22
  exports.createLogger = require_commandkit.createLogger;
@@ -1,2 +1,2 @@
1
- import { G as PluginTransformParameters, K as TransformedResult, W as CompilerPlugin, q as isCompilerPlugin } from "../analytics-engine-WQhXmx3H.js";
1
+ import { G as PluginTransformParameters, K as TransformedResult, W as CompilerPlugin, q as isCompilerPlugin } from "../analytics-engine-_urJ5QTH.js";
2
2
  export { CompilerPlugin, PluginTransformParameters, TransformedResult, isCompilerPlugin };
@@ -1,4 +1,4 @@
1
- const require_CompilerPlugin = require('../CompilerPlugin-CUsGAfgl.js');
1
+ const require_CompilerPlugin = require('../CompilerPlugin-DZidFuHJ.js');
2
2
 
3
3
  exports.CompilerPlugin = require_CompilerPlugin.CompilerPlugin;
4
4
  exports.isCompilerPlugin = require_CompilerPlugin.isCompilerPlugin;
@@ -1,2 +1,2 @@
1
- import { I as PluginCommon, L as PluginOptions, R as PluginType, z as isPlugin } from "../analytics-engine-WQhXmx3H.js";
1
+ import { I as PluginCommon, L as PluginOptions, R as PluginType, z as isPlugin } from "../analytics-engine-_urJ5QTH.js";
2
2
  export { PluginCommon, PluginOptions, PluginType, isPlugin };
@@ -1,4 +1,4 @@
1
- const require_PluginCommon = require('../PluginCommon-BLxWww5u.js');
1
+ const require_PluginCommon = require('../PluginCommon-Bfs8d9s7.js');
2
2
 
3
3
  exports.PluginCommon = require_PluginCommon.PluginCommon;
4
4
  exports.PluginType = require_PluginCommon.PluginType;
@@ -1,2 +1,2 @@
1
- import { $ as isRuntimePlugin, Q as RuntimePlugin } from "../analytics-engine-WQhXmx3H.js";
1
+ import { $ as isRuntimePlugin, Q as RuntimePlugin } from "../analytics-engine-_urJ5QTH.js";
2
2
  export { RuntimePlugin, isRuntimePlugin };
@@ -1,4 +1,4 @@
1
- const require_RuntimePlugin = require('../RuntimePlugin-CtobluSU.js');
1
+ const require_RuntimePlugin = require('../RuntimePlugin-BYQXQO8w.js');
2
2
 
3
3
  exports.RuntimePlugin = require_RuntimePlugin.RuntimePlugin;
4
4
  exports.isRuntimePlugin = require_RuntimePlugin.isRuntimePlugin;
@@ -1,2 +1,2 @@
1
- import { $ as isRuntimePlugin, B as CommonPluginRuntime, F as CommandKitPluginRuntime, G as PluginTransformParameters, H as CommonDirectiveTransformer, J as CommandKitEventDispatch, K as TransformedResult, Q as RuntimePlugin, U as CommonDirectiveTransformerOptions, V as CompilerPluginRuntime, W as CompilerPlugin, X as MaybeFalsey, Y as CommandKitPlugin, Z as TemplateHandler, q as isCompilerPlugin } from "../analytics-engine-WQhXmx3H.js";
1
+ import { $ as isRuntimePlugin, B as CommonPluginRuntime, F as CommandKitPluginRuntime, G as PluginTransformParameters, H as CommonDirectiveTransformer, J as CommandKitEventDispatch, K as TransformedResult, Q as RuntimePlugin, U as CommonDirectiveTransformerOptions, V as CompilerPluginRuntime, W as CompilerPlugin, X as MaybeFalsey, Y as CommandKitPlugin, Z as TemplateHandler, q as isCompilerPlugin } from "../analytics-engine-_urJ5QTH.js";
2
2
  export { CommandKitEventDispatch, CommandKitPlugin, CommandKitPluginRuntime, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, MaybeFalsey, PluginTransformParameters, RuntimePlugin, TemplateHandler, TransformedResult, isCompilerPlugin, isRuntimePlugin };
@@ -1,29 +1,24 @@
1
1
  require('../colors-Csc0X4QJ.js');
2
2
  require('../ActionRow-CSN_UKmM.js');
3
- const require_commandkit = require('../commandkit-a_lLZW59.js');
4
- require('../container-DCPljKVH.js');
5
- require('../file-Ca1kpEtE.js');
6
- require('../media-gallery-u3gjX7yD.js');
7
- require('../section-BC8LF-B2.js');
8
- require('../separator-BUTiW7uz.js');
9
- require('../text-display-DANahMN3.js');
10
- require('../label-B6vXvwLM.js');
11
- require('../poll-CFe8yvoJ.js');
12
- require('../display-WDb9wMCv.js');
13
- require('../constants-CxkFFZ7p.js');
14
- const require_CompilerPlugin = require('../CompilerPlugin-CUsGAfgl.js');
15
- const require_RuntimePlugin = require('../RuntimePlugin-CtobluSU.js');
16
- require('../types-package-CsTNfvv2.js');
17
- require('../constants-Cw8VjCVz.js');
18
- require('../EventWorkerContext-Dfhgv329.js');
19
- require('../signals-B8z1wJ6W.js');
20
- require('../helpers-Btx1FSZx.js');
21
- require('../MessageCommandParser-Bs9fimmd.js');
22
- require('../CommandsRouter-C_HLsrGX.js');
23
- require('../EventsRouter-DZYIha6m.js');
24
- require('../router-BvamdzoF.js');
25
- require('../common-DSRs_mfw.js');
26
- require('../store-D8r_hryO.js');
3
+ const require_commandkit = require('../commandkit-BUkbAdid.js');
4
+ const require_CompilerPlugin = require('../CompilerPlugin-DZidFuHJ.js');
5
+ const require_RuntimePlugin = require('../RuntimePlugin-BYQXQO8w.js');
6
+ require('../constants-CeIMhMD0.js');
7
+ require('../types-package-Bjh_ap0V.js');
8
+ require('../constants-BA0TJU6e.js');
9
+ require('../EventWorkerContext-CfqamFWu.js');
10
+ require('../signals-ewEPW2cO.js');
11
+ require('../helpers-DSy7EjzP.js');
12
+ require('../MessageCommandParser-VMFFGs0R.js');
13
+ require('../CommandsRouter-D5mGRFEr.js');
14
+ require('../EventsRouter-Be5NDOX4.js');
15
+ require('../router-CtcApqrw.js');
16
+ require('../file-DqI3v90P.js');
17
+ require('../separator-DGwA_b1J.js');
18
+ require('../text-display-BVuG7dT-.js');
19
+ require('../poll-ziQQQbMU.js');
20
+ require('../common-zQwj90Nz.js');
21
+ require('../store-DK4JA-fQ.js');
27
22
 
28
23
  exports.CommandKitPluginRuntime = require_commandkit.CommandKitPluginRuntime;
29
24
  exports.CommonDirectiveTransformer = require_commandkit.CommonDirectiveTransformer;
@@ -1,2 +1,2 @@
1
- import { F as CommandKitPluginRuntime } from "../../analytics-engine-WQhXmx3H.js";
1
+ import { F as CommandKitPluginRuntime } from "../../analytics-engine-_urJ5QTH.js";
2
2
  export { CommandKitPluginRuntime };
@@ -1,26 +1,21 @@
1
1
  require('../../colors-Csc0X4QJ.js');
2
2
  require('../../ActionRow-CSN_UKmM.js');
3
- const require_commandkit = require('../../commandkit-a_lLZW59.js');
4
- require('../../container-DCPljKVH.js');
5
- require('../../file-Ca1kpEtE.js');
6
- require('../../media-gallery-u3gjX7yD.js');
7
- require('../../section-BC8LF-B2.js');
8
- require('../../separator-BUTiW7uz.js');
9
- require('../../text-display-DANahMN3.js');
10
- require('../../label-B6vXvwLM.js');
11
- require('../../poll-CFe8yvoJ.js');
12
- require('../../display-WDb9wMCv.js');
13
- require('../../constants-CxkFFZ7p.js');
14
- require('../../types-package-CsTNfvv2.js');
15
- require('../../constants-Cw8VjCVz.js');
16
- require('../../EventWorkerContext-Dfhgv329.js');
17
- require('../../signals-B8z1wJ6W.js');
18
- require('../../helpers-Btx1FSZx.js');
19
- require('../../MessageCommandParser-Bs9fimmd.js');
20
- require('../../CommandsRouter-C_HLsrGX.js');
21
- require('../../EventsRouter-DZYIha6m.js');
22
- require('../../router-BvamdzoF.js');
23
- require('../../common-DSRs_mfw.js');
24
- require('../../store-D8r_hryO.js');
3
+ const require_commandkit = require('../../commandkit-BUkbAdid.js');
4
+ require('../../constants-CeIMhMD0.js');
5
+ require('../../types-package-Bjh_ap0V.js');
6
+ require('../../constants-BA0TJU6e.js');
7
+ require('../../EventWorkerContext-CfqamFWu.js');
8
+ require('../../signals-ewEPW2cO.js');
9
+ require('../../helpers-DSy7EjzP.js');
10
+ require('../../MessageCommandParser-VMFFGs0R.js');
11
+ require('../../CommandsRouter-D5mGRFEr.js');
12
+ require('../../EventsRouter-Be5NDOX4.js');
13
+ require('../../router-CtcApqrw.js');
14
+ require('../../file-DqI3v90P.js');
15
+ require('../../separator-DGwA_b1J.js');
16
+ require('../../text-display-BVuG7dT-.js');
17
+ require('../../poll-ziQQQbMU.js');
18
+ require('../../common-zQwj90Nz.js');
19
+ require('../../store-DK4JA-fQ.js');
25
20
 
26
21
  exports.CommandKitPluginRuntime = require_commandkit.CommandKitPluginRuntime;
@@ -1,2 +1,2 @@
1
- import { V as CompilerPluginRuntime } from "../../analytics-engine-WQhXmx3H.js";
1
+ import { V as CompilerPluginRuntime } from "../../analytics-engine-_urJ5QTH.js";
2
2
  export { CompilerPluginRuntime };
@@ -1,26 +1,21 @@
1
1
  require('../../colors-Csc0X4QJ.js');
2
2
  require('../../ActionRow-CSN_UKmM.js');
3
- const require_commandkit = require('../../commandkit-a_lLZW59.js');
4
- require('../../container-DCPljKVH.js');
5
- require('../../file-Ca1kpEtE.js');
6
- require('../../media-gallery-u3gjX7yD.js');
7
- require('../../section-BC8LF-B2.js');
8
- require('../../separator-BUTiW7uz.js');
9
- require('../../text-display-DANahMN3.js');
10
- require('../../label-B6vXvwLM.js');
11
- require('../../poll-CFe8yvoJ.js');
12
- require('../../display-WDb9wMCv.js');
13
- require('../../constants-CxkFFZ7p.js');
14
- require('../../types-package-CsTNfvv2.js');
15
- require('../../constants-Cw8VjCVz.js');
16
- require('../../EventWorkerContext-Dfhgv329.js');
17
- require('../../signals-B8z1wJ6W.js');
18
- require('../../helpers-Btx1FSZx.js');
19
- require('../../MessageCommandParser-Bs9fimmd.js');
20
- require('../../CommandsRouter-C_HLsrGX.js');
21
- require('../../EventsRouter-DZYIha6m.js');
22
- require('../../router-BvamdzoF.js');
23
- require('../../common-DSRs_mfw.js');
24
- require('../../store-D8r_hryO.js');
3
+ const require_commandkit = require('../../commandkit-BUkbAdid.js');
4
+ require('../../constants-CeIMhMD0.js');
5
+ require('../../types-package-Bjh_ap0V.js');
6
+ require('../../constants-BA0TJU6e.js');
7
+ require('../../EventWorkerContext-CfqamFWu.js');
8
+ require('../../signals-ewEPW2cO.js');
9
+ require('../../helpers-DSy7EjzP.js');
10
+ require('../../MessageCommandParser-VMFFGs0R.js');
11
+ require('../../CommandsRouter-D5mGRFEr.js');
12
+ require('../../EventsRouter-Be5NDOX4.js');
13
+ require('../../router-CtcApqrw.js');
14
+ require('../../file-DqI3v90P.js');
15
+ require('../../separator-DGwA_b1J.js');
16
+ require('../../text-display-BVuG7dT-.js');
17
+ require('../../poll-ziQQQbMU.js');
18
+ require('../../common-zQwj90Nz.js');
19
+ require('../../store-DK4JA-fQ.js');
25
20
 
26
21
  exports.CompilerPluginRuntime = require_commandkit.CompilerPluginRuntime;
@@ -1,2 +1,2 @@
1
- import { H as CommonDirectiveTransformer, U as CommonDirectiveTransformerOptions } from "../../../analytics-engine-WQhXmx3H.js";
1
+ import { H as CommonDirectiveTransformer, U as CommonDirectiveTransformerOptions } from "../../../analytics-engine-_urJ5QTH.js";
2
2
  export { CommonDirectiveTransformer, CommonDirectiveTransformerOptions };
@@ -1,26 +1,21 @@
1
1
  require('../../../colors-Csc0X4QJ.js');
2
2
  require('../../../ActionRow-CSN_UKmM.js');
3
- const require_commandkit = require('../../../commandkit-a_lLZW59.js');
4
- require('../../../container-DCPljKVH.js');
5
- require('../../../file-Ca1kpEtE.js');
6
- require('../../../media-gallery-u3gjX7yD.js');
7
- require('../../../section-BC8LF-B2.js');
8
- require('../../../separator-BUTiW7uz.js');
9
- require('../../../text-display-DANahMN3.js');
10
- require('../../../label-B6vXvwLM.js');
11
- require('../../../poll-CFe8yvoJ.js');
12
- require('../../../display-WDb9wMCv.js');
13
- require('../../../constants-CxkFFZ7p.js');
14
- require('../../../types-package-CsTNfvv2.js');
15
- require('../../../constants-Cw8VjCVz.js');
16
- require('../../../EventWorkerContext-Dfhgv329.js');
17
- require('../../../signals-B8z1wJ6W.js');
18
- require('../../../helpers-Btx1FSZx.js');
19
- require('../../../MessageCommandParser-Bs9fimmd.js');
20
- require('../../../CommandsRouter-C_HLsrGX.js');
21
- require('../../../EventsRouter-DZYIha6m.js');
22
- require('../../../router-BvamdzoF.js');
23
- require('../../../common-DSRs_mfw.js');
24
- require('../../../store-D8r_hryO.js');
3
+ const require_commandkit = require('../../../commandkit-BUkbAdid.js');
4
+ require('../../../constants-CeIMhMD0.js');
5
+ require('../../../types-package-Bjh_ap0V.js');
6
+ require('../../../constants-BA0TJU6e.js');
7
+ require('../../../EventWorkerContext-CfqamFWu.js');
8
+ require('../../../signals-ewEPW2cO.js');
9
+ require('../../../helpers-DSy7EjzP.js');
10
+ require('../../../MessageCommandParser-VMFFGs0R.js');
11
+ require('../../../CommandsRouter-D5mGRFEr.js');
12
+ require('../../../EventsRouter-Be5NDOX4.js');
13
+ require('../../../router-CtcApqrw.js');
14
+ require('../../../file-DqI3v90P.js');
15
+ require('../../../separator-DGwA_b1J.js');
16
+ require('../../../text-display-BVuG7dT-.js');
17
+ require('../../../poll-ziQQQbMU.js');
18
+ require('../../../common-zQwj90Nz.js');
19
+ require('../../../store-DK4JA-fQ.js');
25
20
 
26
21
  exports.CommonDirectiveTransformer = require_commandkit.CommonDirectiveTransformer;
@@ -1,4 +1,4 @@
1
- import { G as PluginTransformParameters, K as TransformedResult, W as CompilerPlugin, X as MaybeFalsey } from "../../../analytics-engine-WQhXmx3H.js";
1
+ import { G as PluginTransformParameters, K as TransformedResult, W as CompilerPlugin, X as MaybeFalsey } from "../../../analytics-engine-_urJ5QTH.js";
2
2
 
3
3
  //#region src/plugins/plugin-runtime/builtin/MacroPlugin.d.ts
4
4
  /**
@@ -1,26 +1,21 @@
1
1
  require('../../../colors-Csc0X4QJ.js');
2
2
  require('../../../ActionRow-CSN_UKmM.js');
3
- const require_commandkit = require('../../../commandkit-a_lLZW59.js');
4
- require('../../../container-DCPljKVH.js');
5
- require('../../../file-Ca1kpEtE.js');
6
- require('../../../media-gallery-u3gjX7yD.js');
7
- require('../../../section-BC8LF-B2.js');
8
- require('../../../separator-BUTiW7uz.js');
9
- require('../../../text-display-DANahMN3.js');
10
- require('../../../label-B6vXvwLM.js');
11
- require('../../../poll-CFe8yvoJ.js');
12
- require('../../../display-WDb9wMCv.js');
13
- require('../../../constants-CxkFFZ7p.js');
14
- require('../../../types-package-CsTNfvv2.js');
15
- require('../../../constants-Cw8VjCVz.js');
16
- require('../../../EventWorkerContext-Dfhgv329.js');
17
- require('../../../signals-B8z1wJ6W.js');
18
- require('../../../helpers-Btx1FSZx.js');
19
- require('../../../MessageCommandParser-Bs9fimmd.js');
20
- require('../../../CommandsRouter-C_HLsrGX.js');
21
- require('../../../EventsRouter-DZYIha6m.js');
22
- require('../../../router-BvamdzoF.js');
23
- require('../../../common-DSRs_mfw.js');
24
- require('../../../store-D8r_hryO.js');
3
+ const require_commandkit = require('../../../commandkit-BUkbAdid.js');
4
+ require('../../../constants-CeIMhMD0.js');
5
+ require('../../../types-package-Bjh_ap0V.js');
6
+ require('../../../constants-BA0TJU6e.js');
7
+ require('../../../EventWorkerContext-CfqamFWu.js');
8
+ require('../../../signals-ewEPW2cO.js');
9
+ require('../../../helpers-DSy7EjzP.js');
10
+ require('../../../MessageCommandParser-VMFFGs0R.js');
11
+ require('../../../CommandsRouter-D5mGRFEr.js');
12
+ require('../../../EventsRouter-Be5NDOX4.js');
13
+ require('../../../router-CtcApqrw.js');
14
+ require('../../../file-DqI3v90P.js');
15
+ require('../../../separator-DGwA_b1J.js');
16
+ require('../../../text-display-BVuG7dT-.js');
17
+ require('../../../poll-ziQQQbMU.js');
18
+ require('../../../common-zQwj90Nz.js');
19
+ require('../../../store-DK4JA-fQ.js');
25
20
 
26
21
  exports.MacroPlugin = require_commandkit.MacroPlugin;
@@ -1,2 +1,2 @@
1
- import { B as CommonPluginRuntime } from "../../analytics-engine-WQhXmx3H.js";
1
+ import { B as CommonPluginRuntime } from "../../analytics-engine-_urJ5QTH.js";
2
2
  export { CommonPluginRuntime };
@@ -1,2 +1,2 @@
1
- import { J as CommandKitEventDispatch, X as MaybeFalsey, Y as CommandKitPlugin, Z as TemplateHandler } from "../analytics-engine-WQhXmx3H.js";
1
+ import { J as CommandKitEventDispatch, X as MaybeFalsey, Y as CommandKitPlugin, Z as TemplateHandler } from "../analytics-engine-_urJ5QTH.js";
2
2
  export { CommandKitEventDispatch, CommandKitPlugin, MaybeFalsey, TemplateHandler };
@@ -97,4 +97,4 @@ Object.defineProperty(exports, 'PollQuestion', {
97
97
  return PollQuestion;
98
98
  }
99
99
  });
100
- //# sourceMappingURL=poll-CFe8yvoJ.js.map
100
+ //# sourceMappingURL=poll-ziQQQbMU.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"poll-CFe8yvoJ.js","names":[],"sources":["../src/components/display/poll.ts"],"sourcesContent":["import {\n PollLayoutType,\n type PollAnswerData,\n type PollData,\n type PollQuestionMedia,\n} from 'discord.js';\n\n/**\n * The poll properties for the poll component.\n */\nexport interface PollProps\n extends Partial<Omit<PollData, 'question' | 'answers'>> {\n /**\n * The poll children components (question and answers).\n */\n children: PollChildrenType[];\n}\n\nenum PollChildType {\n Answer,\n Question,\n}\n\ntype PollChild<T, Type extends PollChildType> = T & {\n $$typeof: Type;\n};\n\nexport type PollChildrenType =\n | PollChild<PollQuestionProps, PollChildType.Question>\n | PollChild<PollAnswerProps, PollChildType.Answer>;\n\n/**\n * The poll component creates a Discord poll with a question and multiple answer options.\n * @param props The poll properties.\n * @returns The poll data object.\n * @example ```tsx\n * import { Poll, PollQuestion, PollAnswer } from 'commandkit';\n *\n * const poll = <Poll duration={24} allowMultiselect={false}>\n * <PollQuestion>What's your favorite color?</PollQuestion>\n * <PollAnswer emoji=\"🟥\">Red</PollAnswer>\n * <PollAnswer emoji=\"🟦\">Blue</PollAnswer>\n * <PollAnswer emoji=\"🟩\">Green</PollAnswer>\n * </Poll>;\n * ```\n */\nexport function Poll({ children, ...props }: PollProps): PollData {\n const question = children.find(\n (child): child is PollChild<PollQuestionProps, PollChildType.Question> =>\n child.$$typeof === PollChildType.Question,\n );\n\n if (!question) {\n throw new Error('Poll question is required');\n }\n\n const answers = children.filter(\n (child): child is PollChild<PollAnswerProps, PollChildType.Answer> =>\n child.$$typeof === PollChildType.Answer,\n );\n\n const { children: questionChildren, ...questionProps } = question;\n const { duration, allowMultiselect, layoutType, ...restProps } = props;\n\n return {\n duration: duration ?? 24,\n allowMultiselect: allowMultiselect ?? false,\n layoutType: layoutType ?? PollLayoutType.Default,\n ...restProps,\n question: { text: questionChildren, ...questionProps },\n answers: answers.map(\n ({ children: answerChildren, $$typeof, ...answerProps }) => ({\n text: answerChildren,\n ...answerProps,\n }),\n ),\n };\n}\n\n/**\n * The poll question properties for the poll question component.\n */\nexport interface PollQuestionProps extends Omit<PollQuestionMedia, 'text'> {\n /**\n * The question text content.\n */\n children: PollQuestionMedia['text'];\n}\n\n/**\n * The poll question component defines the question text for a Discord poll.\n * @param props The poll question properties.\n * @returns The poll question media object.\n * @example ```tsx\n * import { PollQuestion } from 'commandkit';\n *\n * const question = <PollQuestion>What's your favorite programming language?</PollQuestion>;\n * ```\n */\nexport function PollQuestion({\n children,\n ...props\n}: PollQuestionProps): PollChild<PollQuestionMedia, PollChildType.Question> {\n return { ...props, text: children, $$typeof: PollChildType.Question };\n}\n\n/**\n * The poll answer properties for the poll answer component.\n */\nexport interface PollAnswerProps extends Omit<PollAnswerData, 'text'> {\n /**\n * The answer text content.\n */\n children: PollAnswerData['text'];\n}\n\n/**\n * The poll answer component defines an answer option for a Discord poll.\n * @param props The poll answer properties.\n * @returns The poll answer data object.\n * @example ```tsx\n * import { PollAnswer } from 'commandkit';\n *\n * const answer = <PollAnswer emoji=\"🟦\">TypeScript</PollAnswer>;\n * ```\n */\nexport function PollAnswer({\n children,\n ...props\n}: PollAnswerProps): PollChild<PollAnswerData, PollChildType.Answer> {\n return { ...props, text: children, $$typeof: PollChildType.Answer };\n}\n"],"mappings":";;;;AAkBA,IAAK,wDAAL;AACE;AACA;;EAFG;;;;;;;;;;;;;;;;AA4BL,SAAgB,KAAK,EAAE,UAAU,GAAG,SAA8B;CAChE,MAAM,WAAW,SAAS,MACvB,UACD,MAAE,aAAiB,cAAE,SACtB;AAED,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,4BAA4B;CAG9C,MAAM,UAAU,SAAS,QACtB,UACD,MAAE,aAAiB,cAAE,OACtB;CAED,MAAM,EAAE,UAAU,kBAAkB,GAAG,kBAAkB;CACzD,MAAM,EAAE,UAAU,kBAAkB,YAAY,GAAG,cAAc;AAEjE,QAAO;EACL,UAAU,YAAY;EACtB,kBAAkB,oBAAoB;EACtC,YAAY,cAAc,0BAAe;EACzC,GAAG;EACH,UAAU;GAAE,MAAM;GAAkB,GAAG;GAAe;EACtD,SAAS,QAAQ,KACd,EAAE,UAAU,gBAAgB,UAAU,GAAG,mBAAmB;GAC3D,MAAM;GACN,GAAG;GACJ,EACF;EACF;;;;;;;;;;;;AAuBH,SAAgB,aAAa,EAC3B,UACA,GAAG,SACuE;AAC1E,QAAO;EAAE,GAAG;EAAO,MAAM;EAAU,UAAU,cAAc;EAAU;;;;;;;;;;;;AAuBvE,SAAgB,WAAW,EACzB,UACA,GAAG,SACgE;AACnE,QAAO;EAAE,GAAG;EAAO,MAAM;EAAU,UAAU,cAAc;EAAQ"}
1
+ {"version":3,"file":"poll-ziQQQbMU.js","names":[],"sources":["../src/components/display/poll.ts"],"sourcesContent":["import {\n PollLayoutType,\n type PollAnswerData,\n type PollData,\n type PollQuestionMedia,\n} from 'discord.js';\n\n/**\n * The poll properties for the poll component.\n */\nexport interface PollProps\n extends Partial<Omit<PollData, 'question' | 'answers'>> {\n /**\n * The poll children components (question and answers).\n */\n children: PollChildrenType[];\n}\n\nenum PollChildType {\n Answer,\n Question,\n}\n\ntype PollChild<T, Type extends PollChildType> = T & {\n $$typeof: Type;\n};\n\nexport type PollChildrenType =\n | PollChild<PollQuestionProps, PollChildType.Question>\n | PollChild<PollAnswerProps, PollChildType.Answer>;\n\n/**\n * The poll component creates a Discord poll with a question and multiple answer options.\n * @param props The poll properties.\n * @returns The poll data object.\n * @example ```tsx\n * import { Poll, PollQuestion, PollAnswer } from 'commandkit';\n *\n * const poll = <Poll duration={24} allowMultiselect={false}>\n * <PollQuestion>What's your favorite color?</PollQuestion>\n * <PollAnswer emoji=\"🟥\">Red</PollAnswer>\n * <PollAnswer emoji=\"🟦\">Blue</PollAnswer>\n * <PollAnswer emoji=\"🟩\">Green</PollAnswer>\n * </Poll>;\n * ```\n */\nexport function Poll({ children, ...props }: PollProps): PollData {\n const question = children.find(\n (child): child is PollChild<PollQuestionProps, PollChildType.Question> =>\n child.$$typeof === PollChildType.Question,\n );\n\n if (!question) {\n throw new Error('Poll question is required');\n }\n\n const answers = children.filter(\n (child): child is PollChild<PollAnswerProps, PollChildType.Answer> =>\n child.$$typeof === PollChildType.Answer,\n );\n\n const { children: questionChildren, ...questionProps } = question;\n const { duration, allowMultiselect, layoutType, ...restProps } = props;\n\n return {\n duration: duration ?? 24,\n allowMultiselect: allowMultiselect ?? false,\n layoutType: layoutType ?? PollLayoutType.Default,\n ...restProps,\n question: { text: questionChildren, ...questionProps },\n answers: answers.map(\n ({ children: answerChildren, $$typeof, ...answerProps }) => ({\n text: answerChildren,\n ...answerProps,\n }),\n ),\n };\n}\n\n/**\n * The poll question properties for the poll question component.\n */\nexport interface PollQuestionProps extends Omit<PollQuestionMedia, 'text'> {\n /**\n * The question text content.\n */\n children: PollQuestionMedia['text'];\n}\n\n/**\n * The poll question component defines the question text for a Discord poll.\n * @param props The poll question properties.\n * @returns The poll question media object.\n * @example ```tsx\n * import { PollQuestion } from 'commandkit';\n *\n * const question = <PollQuestion>What's your favorite programming language?</PollQuestion>;\n * ```\n */\nexport function PollQuestion({\n children,\n ...props\n}: PollQuestionProps): PollChild<PollQuestionMedia, PollChildType.Question> {\n return { ...props, text: children, $$typeof: PollChildType.Question };\n}\n\n/**\n * The poll answer properties for the poll answer component.\n */\nexport interface PollAnswerProps extends Omit<PollAnswerData, 'text'> {\n /**\n * The answer text content.\n */\n children: PollAnswerData['text'];\n}\n\n/**\n * The poll answer component defines an answer option for a Discord poll.\n * @param props The poll answer properties.\n * @returns The poll answer data object.\n * @example ```tsx\n * import { PollAnswer } from 'commandkit';\n *\n * const answer = <PollAnswer emoji=\"🟦\">TypeScript</PollAnswer>;\n * ```\n */\nexport function PollAnswer({\n children,\n ...props\n}: PollAnswerProps): PollChild<PollAnswerData, PollChildType.Answer> {\n return { ...props, text: children, $$typeof: PollChildType.Answer };\n}\n"],"mappings":";;;;AAkBA,IAAK,wDAAL;AACE;AACA;;EAFG;;;;;;;;;;;;;;;;AA4BL,SAAgB,KAAK,EAAE,UAAU,GAAG,SAA8B;CAChE,MAAM,WAAW,SAAS,MACvB,UACD,MAAE,aAAiB,cAAE,SACtB;AAED,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,4BAA4B;CAG9C,MAAM,UAAU,SAAS,QACtB,UACD,MAAE,aAAiB,cAAE,OACtB;CAED,MAAM,EAAE,UAAU,kBAAkB,GAAG,kBAAkB;CACzD,MAAM,EAAE,UAAU,kBAAkB,YAAY,GAAG,cAAc;AAEjE,QAAO;EACL,UAAU,YAAY;EACtB,kBAAkB,oBAAoB;EACtC,YAAY,cAAc,0BAAe;EACzC,GAAG;EACH,UAAU;GAAE,MAAM;GAAkB,GAAG;GAAe;EACtD,SAAS,QAAQ,KACd,EAAE,UAAU,gBAAgB,UAAU,GAAG,mBAAmB;GAC3D,MAAM;GACN,GAAG;GACJ,EACF;EACF;;;;;;;;;;;;AAuBH,SAAgB,aAAa,EAC3B,UACA,GAAG,SACuE;AAC1E,QAAO;EAAE,GAAG;EAAO,MAAM;EAAU,UAAU,cAAc;EAAU;;;;;;;;;;;;AAuBvE,SAAgB,WAAW,EACzB,UACA,GAAG,SACgE;AACnE,QAAO;EAAE,GAAG;EAAO,MAAM;EAAU,UAAU,cAAc;EAAQ"}
@@ -20,4 +20,4 @@ Object.defineProperty(exports, 'toFileURL', {
20
20
  return toFileURL;
21
21
  }
22
22
  });
23
- //# sourceMappingURL=resolve-file-url-CdHqwWs3.js.map
23
+ //# sourceMappingURL=resolve-file-url-BmjHzIKe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-file-url-CdHqwWs3.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
+ {"version":3,"file":"resolve-file-url-BmjHzIKe.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"}
@@ -23,4 +23,4 @@ Object.defineProperty(exports, 'Separator', {
23
23
  return Separator;
24
24
  }
25
25
  });
26
- //# sourceMappingURL=separator-BUTiW7uz.js.map
26
+ //# sourceMappingURL=separator-DGwA_b1J.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"separator-BUTiW7uz.js","names":[],"sources":["../src/components/display/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
+ {"version":3,"file":"separator-DGwA_b1J.js","names":[],"sources":["../src/components/display/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,5 +1,5 @@
1
1
  const require_error_codes = require('./error-codes-Ds0bnPvT.js');
2
- const require_EventWorkerContext = require('./EventWorkerContext-Dfhgv329.js');
2
+ const require_EventWorkerContext = require('./EventWorkerContext-CfqamFWu.js');
3
3
 
4
4
  //#region src/app/interrupt/signals.ts
5
5
  /**
@@ -71,4 +71,4 @@ Object.defineProperty(exports, 'stopMiddlewares', {
71
71
  return stopMiddlewares;
72
72
  }
73
73
  });
74
- //# sourceMappingURL=signals-B8z1wJ6W.js.map
74
+ //# sourceMappingURL=signals-ewEPW2cO.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"signals-B8z1wJ6W.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
+ {"version":3,"file":"signals-ewEPW2cO.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"}
@@ -15,4 +15,4 @@ Object.defineProperty(exports, 'FlagStore', {
15
15
  return FlagStore;
16
16
  }
17
17
  });
18
- //# sourceMappingURL=store-D8r_hryO.js.map
18
+ //# sourceMappingURL=store-DK4JA-fQ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"store-D8r_hryO.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
+ {"version":3,"file":"store-DK4JA-fQ.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"}
@@ -28,4 +28,4 @@ Object.defineProperty(exports, 'TextDisplay', {
28
28
  return TextDisplay;
29
29
  }
30
30
  });
31
- //# sourceMappingURL=text-display-DANahMN3.js.map
31
+ //# sourceMappingURL=text-display-BVuG7dT-.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-display-DANahMN3.js","names":[],"sources":["../src/components/display/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,MAAI,WACJ,OAAI,MAAO,SAAM,CAClB;AAIL,QAAO"}
1
+ {"version":3,"file":"text-display-BVuG7dT-.js","names":[],"sources":["../src/components/display/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,MAAI,WACJ,OAAI,MAAO,SAAM,CAClB;AAIL,QAAO"}
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require('./chunk-kSYXY2_d.js');
2
2
  const require_colors = require('./colors-Csc0X4QJ.js');
3
- const require_common = require('./common-DSRs_mfw.js');
3
+ const require_common = require('./common-zQwj90Nz.js');
4
4
  let node_fs = require("node:fs");
5
5
  let node_path = require("node:path");
6
6
 
@@ -85,4 +85,4 @@ Object.defineProperty(exports, 'performTypeCheck', {
85
85
  return performTypeCheck;
86
86
  }
87
87
  });
88
- //# sourceMappingURL=type-checker-cVd3Hpnh.js.map
88
+ //# sourceMappingURL=type-checker-CFpKDDs8.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-checker-cVd3Hpnh.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,8BAAE,KAAO,8BAAK,KAAO,SAAK,CAAQ,CAAC,GAAG,8BAAE,KAAO,8BAAK,OAAO,SAAO,CAAQ,CAAC,KAAK,8BAAE,IAAO,QAAU,CAAC,GAAG,8BAAE,KAAO,UAAK,IACxH,GAAG,cAAc,CACjB,KAAE,KAAQ;;;;;;;;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,QAAE,uBAA6B;EAClC,GAAG,QAAE,sBAA4B;EACjC,GAAG,QAAE,yBAA+B;EACpC,GAAG,QAAE,wBAA8B;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"}
1
+ {"version":3,"file":"type-checker-CFpKDDs8.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,8BAAE,KAAO,8BAAK,KAAO,SAAK,CAAQ,CAAC,GAAG,8BAAE,KAAO,8BAAK,OAAO,SAAO,CAAQ,CAAC,KAAK,8BAAE,IAAO,QAAU,CAAC,GAAG,8BAAE,KAAO,UAAK,IACxH,GAAG,cAAc,CACjB,KAAE,KAAQ;;;;;;;;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,QAAE,uBAA6B;EAClC,GAAG,QAAE,sBAA4B;EACjC,GAAG,QAAE,yBAA+B;EACpC,GAAG,QAAE,wBAA8B;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"}