@pasosdejesus/m 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (324) hide show
  1. package/dist/blockchain/deployments.d.ts +40 -0
  2. package/dist/blockchain/deployments.d.ts.map +1 -0
  3. package/dist/blockchain/deployments.js +64 -0
  4. package/dist/debug/DebugConsole.d.ts +22 -0
  5. package/dist/debug/DebugConsole.d.ts.map +1 -0
  6. package/dist/debug/DebugConsole.js +79 -0
  7. package/dist/debug/Logger.d.ts +38 -0
  8. package/dist/debug/Logger.d.ts.map +1 -0
  9. package/dist/debug/Logger.js +94 -0
  10. package/dist/debug/index.d.ts +6 -0
  11. package/dist/debug/index.d.ts.map +1 -0
  12. package/dist/debug/index.js +4 -0
  13. package/dist/debug/useLogger.d.ts +14 -0
  14. package/dist/debug/useLogger.d.ts.map +1 -0
  15. package/dist/debug/useLogger.js +23 -0
  16. package/dist/debug/utils.d.ts +10 -0
  17. package/dist/debug/utils.d.ts.map +1 -0
  18. package/dist/debug/utils.js +53 -0
  19. package/dist/e2e/assertions.d.ts +5 -0
  20. package/dist/e2e/assertions.d.ts.map +1 -0
  21. package/dist/e2e/assertions.js +18 -0
  22. package/dist/e2e/browser.d.ts +37 -0
  23. package/dist/e2e/browser.d.ts.map +1 -0
  24. package/dist/e2e/browser.js +97 -0
  25. package/dist/e2e/env.d.ts +18 -0
  26. package/dist/e2e/env.d.ts.map +1 -0
  27. package/dist/e2e/env.js +57 -0
  28. package/dist/e2e/index.d.ts +11 -0
  29. package/dist/e2e/index.d.ts.map +1 -0
  30. package/dist/e2e/index.js +8 -0
  31. package/dist/e2e/navigation.d.ts +4 -0
  32. package/dist/e2e/navigation.d.ts.map +1 -0
  33. package/dist/e2e/navigation.js +32 -0
  34. package/dist/e2e/siwe-mock.d.ts +11 -0
  35. package/dist/e2e/siwe-mock.d.ts.map +1 -0
  36. package/dist/e2e/siwe-mock.js +112 -0
  37. package/dist/e2e/siwe.d.ts +15 -0
  38. package/dist/e2e/siwe.d.ts.map +1 -0
  39. package/dist/e2e/siwe.js +85 -0
  40. package/dist/e2e/wallet-mock.d.ts +13 -0
  41. package/dist/e2e/wallet-mock.d.ts.map +1 -0
  42. package/dist/e2e/wallet-mock.js +91 -0
  43. package/dist/i18n/common-cli.d.ts +11 -0
  44. package/dist/i18n/common-cli.d.ts.map +1 -0
  45. package/dist/i18n/common-cli.js +22 -0
  46. package/dist/i18n/createTranslator.d.ts +28 -0
  47. package/dist/i18n/createTranslator.d.ts.map +1 -0
  48. package/dist/i18n/createTranslator.js +48 -0
  49. package/dist/i18n/index.d.ts +4 -0
  50. package/dist/i18n/index.d.ts.map +1 -0
  51. package/dist/i18n/index.js +2 -0
  52. package/dist/i18n/locales/cli.d.ts +3 -0
  53. package/dist/i18n/locales/cli.d.ts.map +1 -0
  54. package/dist/i18n/locales/cli.js +180 -0
  55. package/dist/i18n/types.d.ts +3 -0
  56. package/dist/i18n/types.d.ts.map +1 -0
  57. package/dist/i18n/types.js +1 -0
  58. package/dist/index.d.ts +2 -0
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/index.js +15 -0
  61. package/dist/index.test.d.ts +2 -0
  62. package/dist/index.test.d.ts.map +1 -0
  63. package/dist/index.test.js +10 -0
  64. package/dist/m.d.ts +2 -0
  65. package/dist/m.d.ts.map +1 -0
  66. package/dist/m.js +334 -0
  67. package/dist/plugin.d.ts +10 -0
  68. package/dist/plugin.d.ts.map +1 -0
  69. package/dist/plugin.js +7 -0
  70. package/dist/shadcn_components/cn.d.ts +13 -0
  71. package/dist/shadcn_components/cn.d.ts.map +1 -0
  72. package/dist/shadcn_components/cn.js +15 -0
  73. package/dist/shadcn_components/ui/accordion.d.ts +8 -0
  74. package/dist/shadcn_components/ui/accordion.d.ts.map +1 -0
  75. package/dist/shadcn_components/ui/accordion.js +14 -0
  76. package/dist/shadcn_components/ui/alert-dialog.d.ts +21 -0
  77. package/dist/shadcn_components/ui/alert-dialog.d.ts.map +1 -0
  78. package/dist/shadcn_components/ui/alert-dialog.js +27 -0
  79. package/dist/shadcn_components/ui/alert.d.ts +9 -0
  80. package/dist/shadcn_components/ui/alert.d.ts.map +1 -0
  81. package/dist/shadcn_components/ui/alert.js +22 -0
  82. package/dist/shadcn_components/ui/avatar.d.ts +7 -0
  83. package/dist/shadcn_components/ui/avatar.d.ts.map +1 -0
  84. package/dist/shadcn_components/ui/avatar.js +12 -0
  85. package/dist/shadcn_components/ui/badge.d.ts +10 -0
  86. package/dist/shadcn_components/ui/badge.d.ts.map +1 -0
  87. package/dist/shadcn_components/ui/badge.js +22 -0
  88. package/dist/shadcn_components/ui/button.d.ts +11 -0
  89. package/dist/shadcn_components/ui/button.d.ts.map +1 -0
  90. package/dist/shadcn_components/ui/button.js +31 -0
  91. package/dist/shadcn_components/ui/card.d.ts +10 -0
  92. package/dist/shadcn_components/ui/card.d.ts.map +1 -0
  93. package/dist/shadcn_components/ui/card.js +24 -0
  94. package/dist/shadcn_components/ui/checkbox.d.ts +5 -0
  95. package/dist/shadcn_components/ui/checkbox.d.ts.map +1 -0
  96. package/dist/shadcn_components/ui/checkbox.js +9 -0
  97. package/dist/shadcn_components/ui/dialog.d.ts +20 -0
  98. package/dist/shadcn_components/ui/dialog.d.ts.map +1 -0
  99. package/dist/shadcn_components/ui/dialog.js +23 -0
  100. package/dist/shadcn_components/ui/dropdown-menu.d.ts +28 -0
  101. package/dist/shadcn_components/ui/dropdown-menu.d.ts.map +1 -0
  102. package/dist/shadcn_components/ui/dropdown-menu.js +36 -0
  103. package/dist/shadcn_components/ui/form.d.ts +24 -0
  104. package/dist/shadcn_components/ui/form.d.ts.map +1 -0
  105. package/dist/shadcn_components/ui/form.js +63 -0
  106. package/dist/shadcn_components/ui/input.d.ts +4 -0
  107. package/dist/shadcn_components/ui/input.d.ts.map +1 -0
  108. package/dist/shadcn_components/ui/input.js +6 -0
  109. package/dist/shadcn_components/ui/label.d.ts +6 -0
  110. package/dist/shadcn_components/ui/label.d.ts.map +1 -0
  111. package/dist/shadcn_components/ui/label.js +10 -0
  112. package/dist/shadcn_components/ui/menubar.d.ts +29 -0
  113. package/dist/shadcn_components/ui/menubar.d.ts.map +1 -0
  114. package/dist/shadcn_components/ui/menubar.js +46 -0
  115. package/dist/shadcn_components/ui/popover.d.ts +7 -0
  116. package/dist/shadcn_components/ui/popover.d.ts.map +1 -0
  117. package/dist/shadcn_components/ui/popover.js +10 -0
  118. package/dist/shadcn_components/ui/progress.d.ts +5 -0
  119. package/dist/shadcn_components/ui/progress.d.ts.map +1 -0
  120. package/dist/shadcn_components/ui/progress.js +8 -0
  121. package/dist/shadcn_components/ui/radio-group.d.ts +6 -0
  122. package/dist/shadcn_components/ui/radio-group.d.ts.map +1 -0
  123. package/dist/shadcn_components/ui/radio-group.js +15 -0
  124. package/dist/shadcn_components/ui/scroll-area.d.ts +6 -0
  125. package/dist/shadcn_components/ui/scroll-area.d.ts.map +1 -0
  126. package/dist/shadcn_components/ui/scroll-area.js +12 -0
  127. package/dist/shadcn_components/ui/select.d.ts +14 -0
  128. package/dist/shadcn_components/ui/select.d.ts.map +1 -0
  129. package/dist/shadcn_components/ui/select.js +27 -0
  130. package/dist/shadcn_components/ui/separator.d.ts +5 -0
  131. package/dist/shadcn_components/ui/separator.d.ts.map +1 -0
  132. package/dist/shadcn_components/ui/separator.js +8 -0
  133. package/dist/shadcn_components/ui/sheet.d.ts +26 -0
  134. package/dist/shadcn_components/ui/sheet.d.ts.map +1 -0
  135. package/dist/shadcn_components/ui/sheet.js +37 -0
  136. package/dist/shadcn_components/ui/skeleton.d.ts +3 -0
  137. package/dist/shadcn_components/ui/skeleton.d.ts.map +1 -0
  138. package/dist/shadcn_components/ui/skeleton.js +6 -0
  139. package/dist/shadcn_components/ui/slider.d.ts +5 -0
  140. package/dist/shadcn_components/ui/slider.d.ts.map +1 -0
  141. package/dist/shadcn_components/ui/slider.js +8 -0
  142. package/dist/shadcn_components/ui/switch.d.ts +5 -0
  143. package/dist/shadcn_components/ui/switch.d.ts.map +1 -0
  144. package/dist/shadcn_components/ui/switch.js +8 -0
  145. package/dist/shadcn_components/ui/table.d.ts +11 -0
  146. package/dist/shadcn_components/ui/table.d.ts.map +1 -0
  147. package/dist/shadcn_components/ui/table.js +20 -0
  148. package/dist/shadcn_components/ui/tabs.d.ts +8 -0
  149. package/dist/shadcn_components/ui/tabs.d.ts.map +1 -0
  150. package/dist/shadcn_components/ui/tabs.js +13 -0
  151. package/dist/shadcn_components/ui/textarea.d.ts +4 -0
  152. package/dist/shadcn_components/ui/textarea.d.ts.map +1 -0
  153. package/dist/shadcn_components/ui/textarea.js +8 -0
  154. package/dist/shadcn_components/ui/toast.d.ts +16 -0
  155. package/dist/shadcn_components/ui/toast.d.ts.map +1 -0
  156. package/dist/shadcn_components/ui/toast.js +34 -0
  157. package/dist/shadcn_components/ui/toaster.d.ts +2 -0
  158. package/dist/shadcn_components/ui/toaster.d.ts.map +1 -0
  159. package/dist/shadcn_components/ui/toaster.js +10 -0
  160. package/dist/shadcn_components/ui/tooltip.d.ts +8 -0
  161. package/dist/shadcn_components/ui/tooltip.d.ts.map +1 -0
  162. package/dist/shadcn_components/ui/tooltip.js +11 -0
  163. package/dist/shadcn_components/ui/use-toast.d.ts +45 -0
  164. package/dist/shadcn_components/ui/use-toast.d.ts.map +1 -0
  165. package/dist/shadcn_components/ui/use-toast.js +126 -0
  166. package/dist/tasks/context.d.ts +13 -0
  167. package/dist/tasks/context.d.ts.map +1 -0
  168. package/dist/tasks/context.js +310 -0
  169. package/dist/tasks/create.d.ts +2 -0
  170. package/dist/tasks/create.d.ts.map +1 -0
  171. package/dist/tasks/create.js +91 -0
  172. package/dist/tasks/db.d.ts +19 -0
  173. package/dist/tasks/db.d.ts.map +1 -0
  174. package/dist/tasks/db.js +791 -0
  175. package/dist/tasks/e2e.d.ts +2 -0
  176. package/dist/tasks/e2e.d.ts.map +1 -0
  177. package/dist/tasks/e2e.js +124 -0
  178. package/dist/tasks/edit.d.ts +7 -0
  179. package/dist/tasks/edit.d.ts.map +1 -0
  180. package/dist/tasks/edit.js +471 -0
  181. package/dist/tasks/engine.d.ts +2 -0
  182. package/dist/tasks/engine.d.ts.map +1 -0
  183. package/dist/tasks/engine.js +149 -0
  184. package/dist/tasks/env-diff.d.ts +2 -0
  185. package/dist/tasks/env-diff.d.ts.map +1 -0
  186. package/dist/tasks/env-diff.js +140 -0
  187. package/dist/tasks/fuzzy.d.ts +9 -0
  188. package/dist/tasks/fuzzy.d.ts.map +1 -0
  189. package/dist/tasks/fuzzy.js +153 -0
  190. package/dist/tasks/glob.d.ts +5 -0
  191. package/dist/tasks/glob.d.ts.map +1 -0
  192. package/dist/tasks/glob.js +57 -0
  193. package/dist/tasks/grep.d.ts +9 -0
  194. package/dist/tasks/grep.d.ts.map +1 -0
  195. package/dist/tasks/grep.js +93 -0
  196. package/dist/tasks/readfile.d.ts +2 -0
  197. package/dist/tasks/readfile.d.ts.map +1 -0
  198. package/dist/tasks/readfile.js +177 -0
  199. package/dist/tasks/update.d.ts +5 -0
  200. package/dist/tasks/update.d.ts.map +1 -0
  201. package/dist/tasks/update.js +200 -0
  202. package/dist/tasks/util.d.ts +12 -0
  203. package/dist/tasks/util.d.ts.map +1 -0
  204. package/dist/tasks/util.js +42 -0
  205. package/dist/tasks/wallet.d.ts +2 -0
  206. package/dist/tasks/wallet.d.ts.map +1 -0
  207. package/dist/tasks/wallet.js +697 -0
  208. package/dist/tasks/writefile.d.ts +2 -0
  209. package/dist/tasks/writefile.d.ts.map +1 -0
  210. package/dist/tasks/writefile.js +66 -0
  211. package/dist/templates/AGENTS.md.hbs +81 -0
  212. package/dist/templates/ARCHITECTURE.md.hbs +146 -0
  213. package/dist/templates/CONTRIBUTING.md.hbs +83 -0
  214. package/dist/templates/LICENCIA.md +21 -0
  215. package/dist/templates/LICENSE.md +15 -0
  216. package/dist/templates/Makefile +16 -0
  217. package/dist/templates/README.md.hbs +111 -0
  218. package/dist/templates/apps/.env.example.hbs +75 -0
  219. package/dist/templates/apps/hardhat/.prettierrc +16 -0
  220. package/dist/templates/apps/hardhat/MOCK_USDT_README.md +20 -0
  221. package/dist/templates/apps/hardhat/Makefile +13 -0
  222. package/dist/templates/apps/hardhat/README.md +129 -0
  223. package/dist/templates/apps/hardhat/bin/MusdtVerification +4 -0
  224. package/dist/templates/apps/hardhat/bin/approveDepositOwner +7 -0
  225. package/dist/templates/apps/hardhat/bin/contractVerification +9 -0
  226. package/dist/templates/apps/hardhat/bin/deployMockUSDT +7 -0
  227. package/dist/templates/apps/hardhat/bin/prepadJ.sh +14 -0
  228. package/dist/templates/apps/hardhat/bin/verifyMockUSDT +7 -0
  229. package/dist/templates/apps/hardhat/contracts/MockUSDT.sol +47 -0
  230. package/dist/templates/apps/hardhat/hardhat.config.ts +102 -0
  231. package/dist/templates/apps/hardhat/package.json +55 -0
  232. package/dist/templates/apps/hardhat/scripts/approveDepositOwner.ts +22 -0
  233. package/dist/templates/apps/hardhat/scripts/deployMockUSDT.ts +49 -0
  234. package/dist/templates/apps/hardhat/scripts/verifyDeployment.ts +93 -0
  235. package/dist/templates/apps/hardhat/scripts/verifyMockUSDT.ts +52 -0
  236. package/dist/templates/apps/hardhat/sync-abis.mjs +58 -0
  237. package/dist/templates/apps/hardhat/test/MockUSDT.test.ts +40 -0
  238. package/dist/templates/apps/hardhat/tsconfig.json +27 -0
  239. package/dist/templates/apps/nextjs/.config/kysely.config.ts +36 -0
  240. package/dist/templates/apps/nextjs/Makefile +24 -0
  241. package/dist/templates/apps/nextjs/README.md.hbs +76 -0
  242. package/dist/templates/apps/nextjs/abis/IERC20.json +74 -0
  243. package/dist/templates/apps/nextjs/abis/MockUSDT.json +242 -0
  244. package/dist/templates/apps/nextjs/abis/ReentrancyGuard.json +1 -0
  245. package/dist/templates/apps/nextjs/app/globals.css +3 -0
  246. package/dist/templates/apps/nextjs/app/layout.tsx.hbs +26 -0
  247. package/dist/templates/apps/nextjs/app/page.tsx.hbs +225 -0
  248. package/dist/templates/apps/nextjs/app/testui/page.tsx +371 -0
  249. package/dist/templates/apps/nextjs/bin/m +8 -0
  250. package/dist/templates/apps/nextjs/components.json +21 -0
  251. package/dist/templates/apps/nextjs/next-env.d.ts +5 -0
  252. package/dist/templates/apps/nextjs/next.config.ts +10 -0
  253. package/dist/templates/apps/nextjs/package.json.hbs +48 -0
  254. package/dist/templates/apps/nextjs/pnpm-workspace.yaml +13 -0
  255. package/dist/templates/apps/nextjs/postcss.config.mjs +6 -0
  256. package/dist/templates/apps/nextjs/tailwind.config.js +11 -0
  257. package/dist/templates/apps/nextjs/tests/helpers.ts +31 -0
  258. package/dist/templates/apps/nextjs/tests/index.test.ts +7 -0
  259. package/dist/templates/apps/nextjs/tests/setup-env.ts.hbs +8 -0
  260. package/dist/templates/apps/nextjs/tests/test-utils.example.test.ts +168 -0
  261. package/dist/templates/apps/nextjs/tsconfig.json +44 -0
  262. package/dist/templates/apps/nextjs/tsconfig.test.json +38 -0
  263. package/dist/templates/apps/nextjs/vitest.config.ts +13 -0
  264. package/dist/test-utils/fs-mocks.d.ts +32 -0
  265. package/dist/test-utils/fs-mocks.d.ts.map +1 -0
  266. package/dist/test-utils/fs-mocks.js +63 -0
  267. package/dist/test-utils/i18n-mock.d.ts +21 -0
  268. package/dist/test-utils/i18n-mock.d.ts.map +1 -0
  269. package/dist/test-utils/i18n-mock.js +29 -0
  270. package/dist/test-utils/index.d.ts +12 -0
  271. package/dist/test-utils/index.d.ts.map +1 -0
  272. package/dist/test-utils/index.js +11 -0
  273. package/dist/test-utils/kysely-mocks.d.ts +298 -0
  274. package/dist/test-utils/kysely-mocks.d.ts.map +1 -0
  275. package/dist/test-utils/kysely-mocks.js +173 -0
  276. package/dist/test-utils/radix-mocks.d.ts +134 -0
  277. package/dist/test-utils/radix-mocks.d.ts.map +1 -0
  278. package/dist/test-utils/radix-mocks.js +175 -0
  279. package/dist/test-utils/rainbowkit-mocks.d.ts +80 -0
  280. package/dist/test-utils/rainbowkit-mocks.d.ts.map +1 -0
  281. package/dist/test-utils/rainbowkit-mocks.js +247 -0
  282. package/dist/test-utils/viem-mocks.d.ts +86 -0
  283. package/dist/test-utils/viem-mocks.d.ts.map +1 -0
  284. package/dist/test-utils/viem-mocks.js +54 -0
  285. package/dist/util/cli-parser.d.ts +20 -0
  286. package/dist/util/cli-parser.d.ts.map +1 -0
  287. package/dist/util/cli-parser.js +38 -0
  288. package/dist/util/colors.d.ts +5 -0
  289. package/dist/util/colors.d.ts.map +1 -0
  290. package/dist/util/colors.js +5 -0
  291. package/dist/util/locale.d.ts +3 -0
  292. package/dist/util/locale.d.ts.map +1 -0
  293. package/dist/util/locale.js +10 -0
  294. package/dist/wba/client.d.ts +19 -0
  295. package/dist/wba/client.d.ts.map +1 -0
  296. package/dist/wba/client.js +31 -0
  297. package/dist/wba/index.d.ts +4 -0
  298. package/dist/wba/index.d.ts.map +1 -0
  299. package/dist/wba/index.js +2 -0
  300. package/dist/wba/routes/event.d.ts +32 -0
  301. package/dist/wba/routes/event.d.ts.map +1 -0
  302. package/dist/wba/routes/event.js +42 -0
  303. package/dist/wba/routes/index.d.ts +3 -0
  304. package/dist/wba/routes/index.d.ts.map +1 -0
  305. package/dist/wba/routes/index.js +2 -0
  306. package/dist/wba/routes/summary.d.ts +44 -0
  307. package/dist/wba/routes/summary.d.ts.map +1 -0
  308. package/dist/wba/routes/summary.js +146 -0
  309. package/dist/wba/server.d.ts +18 -0
  310. package/dist/wba/server.d.ts.map +1 -0
  311. package/dist/wba/server.js +29 -0
  312. package/dist/wba/types.d.ts +68 -0
  313. package/dist/wba/types.d.ts.map +1 -0
  314. package/dist/wba/types.js +6 -0
  315. package/package.json +223 -0
  316. package/src/blockchain/README.md +80 -0
  317. package/src/debug/README.md +94 -0
  318. package/src/e2e/README.md +105 -0
  319. package/src/i18n/README.md +143 -0
  320. package/src/shadcn_components/README.md +125 -0
  321. package/src/tasks/README.md +69 -0
  322. package/src/test-utils/README.md +638 -0
  323. package/src/util/README.md +18 -0
  324. package/src/wba/README.md +175 -0
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
3
+ declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
4
+ declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
5
+ declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
+ declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
8
+ //# sourceMappingURL=tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/shadcn_components/ui/tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAA;AAI3D,QAAA,MAAM,eAAe,iDAA4B,CAAA;AAEjD,QAAA,MAAM,OAAO,yCAAwB,CAAA;AAErC,QAAA,MAAM,cAAc,gHAA2B,CAAA;AAE/C,QAAA,MAAM,cAAc,gKAalB,CAAA;AAGF,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,CAAA"}
@@ -0,0 +1,11 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from 'react';
4
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
5
+ import { cn } from '../cn.js';
6
+ const TooltipProvider = TooltipPrimitive.Provider;
7
+ const Tooltip = TooltipPrimitive.Root;
8
+ const TooltipTrigger = TooltipPrimitive.Trigger;
9
+ const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(TooltipPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn('z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className), ...props })));
10
+ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
11
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
@@ -0,0 +1,45 @@
1
+ import * as React from 'react';
2
+ import type { ToastActionElement, ToastProps } from './toast.js';
3
+ type ToasterToast = ToastProps & {
4
+ id: string;
5
+ title?: React.ReactNode;
6
+ description?: React.ReactNode;
7
+ action?: ToastActionElement;
8
+ };
9
+ declare const actionTypes: {
10
+ readonly ADD_TOAST: "ADD_TOAST";
11
+ readonly UPDATE_TOAST: "UPDATE_TOAST";
12
+ readonly DISMISS_TOAST: "DISMISS_TOAST";
13
+ readonly REMOVE_TOAST: "REMOVE_TOAST";
14
+ };
15
+ type ActionType = typeof actionTypes;
16
+ type Action = {
17
+ type: ActionType['ADD_TOAST'];
18
+ toast: ToasterToast;
19
+ } | {
20
+ type: ActionType['UPDATE_TOAST'];
21
+ toast: Partial<ToasterToast>;
22
+ } | {
23
+ type: ActionType['DISMISS_TOAST'];
24
+ toastId?: ToasterToast['id'];
25
+ } | {
26
+ type: ActionType['REMOVE_TOAST'];
27
+ toastId?: ToasterToast['id'];
28
+ };
29
+ interface State {
30
+ toasts: ToasterToast[];
31
+ }
32
+ export declare const reducer: (state: State, action: Action) => State;
33
+ type Toast = Omit<ToasterToast, 'id'>;
34
+ declare function toast({ ...props }: Toast): {
35
+ id: string;
36
+ dismiss: () => void;
37
+ update: (props: ToasterToast) => void;
38
+ };
39
+ declare function useToast(): {
40
+ toast: typeof toast;
41
+ dismiss: (toastId?: string) => void;
42
+ toasts: ToasterToast[];
43
+ };
44
+ export { useToast, toast };
45
+ //# sourceMappingURL=use-toast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-toast.d.ts","sourceRoot":"","sources":["../../../src/shadcn_components/ui/use-toast.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAKhE,KAAK,YAAY,GAAG,UAAU,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,MAAM,CAAC,EAAE,kBAAkB,CAAA;CAC5B,CAAA;AAED,QAAA,MAAM,WAAW;;;;;CAKP,CAAA;AASV,KAAK,UAAU,GAAG,OAAO,WAAW,CAAA;AAEpC,KAAK,MAAM,GACP;IACE,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,CAAA;IAC7B,KAAK,EAAE,YAAY,CAAA;CACpB,GACD;IACE,IAAI,EAAE,UAAU,CAAC,cAAc,CAAC,CAAA;IAChC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;CAC7B,GACD;IACE,IAAI,EAAE,UAAU,CAAC,eAAe,CAAC,CAAA;IACjC,OAAO,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;CAC7B,GACD;IACE,IAAI,EAAE,UAAU,CAAC,cAAc,CAAC,CAAA;IAChC,OAAO,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;CAC7B,CAAA;AAEL,UAAU,KAAK;IACb,MAAM,EAAE,YAAY,EAAE,CAAA;CACvB;AAoBD,eAAO,MAAM,OAAO,GAAI,OAAO,KAAK,EAAE,QAAQ,MAAM,KAAG,KAmDtD,CAAA;AAaD,KAAK,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AAErC,iBAAS,KAAK,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK;;;oBAGT,YAAY;EAwBpC;AAED,iBAAS,QAAQ;;wBAgBO,MAAM;YApIpB,YAAY,EAAE;EAsIvB;AAED,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA"}
@@ -0,0 +1,126 @@
1
+ 'use client';
2
+ // Inspired by react-hot-toast library
3
+ import * as React from 'react';
4
+ const TOAST_LIMIT = 4;
5
+ const TOAST_REMOVE_DELAY = 1000000;
6
+ const actionTypes = {
7
+ ADD_TOAST: 'ADD_TOAST',
8
+ UPDATE_TOAST: 'UPDATE_TOAST',
9
+ DISMISS_TOAST: 'DISMISS_TOAST',
10
+ REMOVE_TOAST: 'REMOVE_TOAST',
11
+ };
12
+ let count = 0;
13
+ function genId() {
14
+ count = (count + 1) % Number.MAX_SAFE_INTEGER;
15
+ return count.toString();
16
+ }
17
+ const toastTimeouts = new Map();
18
+ const addToRemoveQueue = (toastId) => {
19
+ if (toastTimeouts.has(toastId)) {
20
+ return;
21
+ }
22
+ const timeout = setTimeout(() => {
23
+ toastTimeouts.delete(toastId);
24
+ dispatch({
25
+ type: 'REMOVE_TOAST',
26
+ toastId: toastId,
27
+ });
28
+ }, TOAST_REMOVE_DELAY);
29
+ toastTimeouts.set(toastId, timeout);
30
+ };
31
+ export const reducer = (state, action) => {
32
+ switch (action.type) {
33
+ case 'ADD_TOAST':
34
+ return {
35
+ ...state,
36
+ toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
37
+ };
38
+ case 'UPDATE_TOAST':
39
+ return {
40
+ ...state,
41
+ toasts: state.toasts.map((t) => t.id === action.toast.id ? { ...t, ...action.toast } : t),
42
+ };
43
+ case 'DISMISS_TOAST': {
44
+ const { toastId } = action;
45
+ if (toastId) {
46
+ addToRemoveQueue(toastId);
47
+ }
48
+ else {
49
+ state.toasts.forEach((toast) => {
50
+ addToRemoveQueue(toast.id);
51
+ });
52
+ }
53
+ return {
54
+ ...state,
55
+ toasts: state.toasts.map((t) => t.id === toastId || toastId === undefined
56
+ ? {
57
+ ...t,
58
+ open: false,
59
+ }
60
+ : t),
61
+ };
62
+ }
63
+ case 'REMOVE_TOAST':
64
+ if (action.toastId === undefined) {
65
+ return {
66
+ ...state,
67
+ toasts: [],
68
+ };
69
+ }
70
+ return {
71
+ ...state,
72
+ toasts: state.toasts.filter((t) => t.id !== action.toastId),
73
+ };
74
+ }
75
+ };
76
+ const listeners = [];
77
+ let memoryState = { toasts: [] };
78
+ function dispatch(action) {
79
+ memoryState = reducer(memoryState, action);
80
+ listeners.forEach((listener) => {
81
+ listener(memoryState);
82
+ });
83
+ }
84
+ function toast({ ...props }) {
85
+ const id = genId();
86
+ const update = (props) => dispatch({
87
+ type: 'UPDATE_TOAST',
88
+ toast: { ...props, id },
89
+ });
90
+ const dismiss = () => dispatch({ type: 'DISMISS_TOAST', toastId: id });
91
+ dispatch({
92
+ type: 'ADD_TOAST',
93
+ toast: {
94
+ ...props,
95
+ id,
96
+ open: true,
97
+ onOpenChange: (open) => {
98
+ if (!open)
99
+ dismiss();
100
+ },
101
+ },
102
+ });
103
+ return {
104
+ id: id,
105
+ dismiss,
106
+ update,
107
+ };
108
+ }
109
+ function useToast() {
110
+ const [state, setState] = React.useState(memoryState);
111
+ React.useEffect(() => {
112
+ listeners.push(setState);
113
+ return () => {
114
+ const index = listeners.indexOf(setState);
115
+ if (index > -1) {
116
+ listeners.splice(index, 1);
117
+ }
118
+ };
119
+ }, [state]);
120
+ return {
121
+ ...state,
122
+ toast,
123
+ dismiss: (toastId) => dispatch({ type: 'DISMISS_TOAST', toastId }),
124
+ };
125
+ }
126
+ export { useToast, toast };
@@ -0,0 +1,13 @@
1
+ interface ContextOptions {
2
+ output?: string;
3
+ branch?: string;
4
+ exclude?: string[];
5
+ maxSize?: number;
6
+ includePatterns?: string[];
7
+ noClipboard?: boolean;
8
+ full?: boolean;
9
+ limit?: number;
10
+ }
11
+ export declare function runAiContext(options?: ContextOptions): Promise<void>;
12
+ export {};
13
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/tasks/context.ts"],"names":[],"mappings":"AA0BA,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAmQD,wBAAsB,YAAY,CAAC,OAAO,GAAE,cAAmB,iBAoF5D"}
@@ -0,0 +1,310 @@
1
+ import { readFile, stat } from 'node:fs/promises';
2
+ import { join } from 'node:path';
3
+ import { spawnSync } from 'node:child_process';
4
+ import { createWriteStream, existsSync, readFileSync } from 'node:fs';
5
+ import { info, success, warn, problem } from '../util/colors.js';
6
+ import { createTranslator } from '../i18n/createTranslator.js';
7
+ import { detectLocale } from '../util/locale.js';
8
+ import commonCli from '../i18n/common-cli.js';
9
+ const t = createTranslator(detectLocale(), {
10
+ en: {
11
+ 'context.generating': '📁 Generating project context...',
12
+ 'context.not_git': '❌ Error: Not in a git repository',
13
+ 'context.git_hint': ' Run: git init (or clone a repository)',
14
+ 'context.branch': ' Branch: {{0}}',
15
+ 'context.output': ' Output: {{0}}',
16
+ },
17
+ es: {
18
+ 'context.generating': '📁 Generando contexto del proyecto...',
19
+ 'context.not_git': '❌ Error: No estás en un repositorio git',
20
+ 'context.git_hint': ' Ejecuta: git init (o clona un repositorio)',
21
+ 'context.branch': ' Branch: {{0}}',
22
+ 'context.output': ' Output: {{0}}',
23
+ },
24
+ }, commonCli);
25
+ const DEFAULT_EXCLUDES = [
26
+ 'dist', 'build', 'node_modules', 'coverage', '.next',
27
+ '__pycache__', '*.lock', '*.map', '*.min.js', '*.log',
28
+ '*.tmp', '.DS_Store', 'templates', 'tests'
29
+ ];
30
+ const MAX_FILE_SIZE = 30 * 1024; // 30KB por defecto
31
+ const DEFAULT_LIMIT_KB = 100; // 100KB por defecto para el contexto total
32
+ async function findGitRoot() {
33
+ const result = spawnSync('git', ['rev-parse', '--show-toplevel'], {
34
+ encoding: 'utf-8',
35
+ stdio: ['pipe', 'pipe', 'pipe']
36
+ });
37
+ if (result.status === 0) {
38
+ return result.stdout.trim();
39
+ }
40
+ return null;
41
+ }
42
+ async function getCurrentBranch() {
43
+ const result = spawnSync('git', ['branch', '--show-current'], {
44
+ encoding: 'utf-8',
45
+ stdio: ['pipe', 'pipe', 'pipe']
46
+ });
47
+ if (result.status === 0 && result.stdout.trim()) {
48
+ return result.stdout.trim();
49
+ }
50
+ return null;
51
+ }
52
+ async function getRemoteUrl() {
53
+ const result = spawnSync('git', ['config', '--get', 'remote.origin.url'], {
54
+ encoding: 'utf-8',
55
+ stdio: ['pipe', 'pipe', 'pipe']
56
+ });
57
+ if (result.status === 0 && result.stdout.trim()) {
58
+ // Sanitizar: eliminar credenciales
59
+ return result.stdout.trim().replace(/\/\/[^@]*@/, '//');
60
+ }
61
+ return 'local';
62
+ }
63
+ function isExcluded(filePath, excludes) {
64
+ for (const pattern of excludes) {
65
+ // Soporte para patrones glob simples
66
+ if (pattern.includes('*')) {
67
+ const regex = new RegExp(pattern.replace(/\*/g, '.*'));
68
+ if (regex.test(filePath))
69
+ return true;
70
+ }
71
+ else {
72
+ // Coincidencia exacta o de directorio
73
+ if (filePath === pattern ||
74
+ filePath.startsWith(`${pattern}/`) ||
75
+ filePath.includes(`/${pattern}/`)) {
76
+ return true;
77
+ }
78
+ }
79
+ }
80
+ return false;
81
+ }
82
+ function detectLanguage(filePath) {
83
+ const ext = filePath.split('.').pop()?.toLowerCase() || '';
84
+ const langMap = {
85
+ 'sh': 'bash', 'bash': 'bash', 'zsh': 'bash',
86
+ 'py': 'python',
87
+ 'js': 'javascript', 'ts': 'typescript',
88
+ 'jsx': 'jsx', 'tsx': 'tsx',
89
+ 'json': 'json',
90
+ 'md': 'markdown',
91
+ 'yml': 'yaml', 'yaml': 'yaml',
92
+ 'c': 'c', 'h': 'c',
93
+ 'cpp': 'cpp', 'hpp': 'cpp',
94
+ 'go': 'go',
95
+ 'rs': 'rust',
96
+ 'sql': 'sql',
97
+ 'html': 'html', 'css': 'css',
98
+ 'toml': 'toml',
99
+ 'tf': 'hcl', 'tfvars': 'hcl'
100
+ };
101
+ return langMap[ext] || '';
102
+ }
103
+ async function getFileList(branch) {
104
+ const branchArg = branch || await getCurrentBranch() || 'HEAD';
105
+ const result = spawnSync('git', ['ls-tree', '-r', '--name-only', branchArg], {
106
+ encoding: 'utf-8',
107
+ stdio: ['pipe', 'pipe', 'pipe']
108
+ });
109
+ if (result.status !== 0) {
110
+ return [];
111
+ }
112
+ return result.stdout.trim().split('\n').filter((f) => f);
113
+ }
114
+ async function getDirectoryTree(excludes = DEFAULT_EXCLUDES) {
115
+ // Construir patrones de exclusión para tree
116
+ const excludePatterns = excludes.filter(e => !e.includes('*')).join('|');
117
+ let treeCmd = ['tree', '-a', '--dirsfirst', '-L', '2'];
118
+ if (excludePatterns) {
119
+ treeCmd = treeCmd.concat(['-I', excludePatterns]);
120
+ }
121
+ const result = spawnSync('tree', treeCmd, {
122
+ encoding: 'utf-8',
123
+ stdio: ['pipe', 'pipe', 'pipe']
124
+ });
125
+ if (result.status !== 0) {
126
+ // Fallback a find si tree no está disponible
127
+ let findCmd = ['find', '.', '-type', 'd', '-maxdepth', '2'];
128
+ for (const pattern of excludes) {
129
+ if (!pattern.includes('*')) {
130
+ findCmd = findCmd.concat(['-not', '-path', `./${pattern}/*`, '-not', '-path', `./${pattern}`]);
131
+ }
132
+ }
133
+ const findResult = spawnSync('find', findCmd, {
134
+ encoding: 'utf-8',
135
+ stdio: ['pipe', 'pipe', 'pipe']
136
+ });
137
+ return findResult.stdout || 'tree command not available';
138
+ }
139
+ return result.stdout;
140
+ }
141
+ async function getGitLog(limit = 5) {
142
+ const result = spawnSync('git', ['log', `-${limit}`, '--stat', '--oneline'], {
143
+ encoding: 'utf-8',
144
+ stdio: ['pipe', 'pipe', 'pipe']
145
+ });
146
+ if (result.status !== 0) {
147
+ return 'git log not available';
148
+ }
149
+ return result.stdout;
150
+ }
151
+ async function writeContextFile(outputPath, files, excludes, maxSize, maxTotalBytes) {
152
+ const gitRoot = await findGitRoot();
153
+ const projectName = gitRoot ? gitRoot.split('/').pop() || 'proyecto' : 'proyecto';
154
+ const branch = await getCurrentBranch() || 'unknown';
155
+ const remoteUrl = await getRemoteUrl();
156
+ // Usar un array para acumular el contenido y escribirlo de una vez
157
+ const chunks = [];
158
+ // Cabecera del documento
159
+ chunks.push(`# Contexto del Proyecto: ${projectName}\n\n`);
160
+ chunks.push(`- **Branch:** ${branch}\n`);
161
+ chunks.push(`- **Repositorio:** ${remoteUrl}\n`);
162
+ chunks.push(`- **Fecha:** ${new Date().toISOString()}\n`);
163
+ chunks.push(`- **Ruta:** ${gitRoot || process.cwd()}\n\n`);
164
+ // Estructura de directorios
165
+ chunks.push(`## Estructura de Directorios\n\n`);
166
+ chunks.push(`\`\`\`\n`);
167
+ const tree = await getDirectoryTree(excludes);
168
+ chunks.push(tree);
169
+ chunks.push(`\`\`\`\n\n`);
170
+ // Historial de Git
171
+ chunks.push(`## Historial de Git (últimos 5 commits)\n\n`);
172
+ chunks.push(`\`\`\`\n`);
173
+ const gitLog = await getGitLog(5);
174
+ chunks.push(gitLog);
175
+ chunks.push(`\`\`\`\n\n`);
176
+ chunks.push(`---\n\n`);
177
+ let count = 0;
178
+ let totalSize = 0;
179
+ let skippedSize = 0;
180
+ let skippedExclude = 0;
181
+ let skippedLimit = 0;
182
+ for (const file of files) {
183
+ // Verificar exclusión
184
+ if (isExcluded(file, excludes)) {
185
+ skippedExclude++;
186
+ continue;
187
+ }
188
+ const fullPath = join(gitRoot || process.cwd(), file);
189
+ try {
190
+ const fileStat = await stat(fullPath);
191
+ // Verificar límite total antes de agregar
192
+ if (maxTotalBytes && totalSize + fileStat.size > maxTotalBytes) {
193
+ skippedLimit++;
194
+ continue;
195
+ }
196
+ if (fileStat.size > maxSize) {
197
+ warn(` ⚠️ Omitido (>${maxSize / 1024}KB): ${file} (${Math.round(fileStat.size / 1024)}KB)`);
198
+ skippedSize++;
199
+ continue;
200
+ }
201
+ const content = await readFile(fullPath, 'utf-8');
202
+ const lang = detectLanguage(file);
203
+ const timestamp = new Date().toISOString().replace(/[-:]/g, '').slice(0, 15);
204
+ chunks.push(`___INICIO_ARCHIVO_${timestamp}___ ${file}\n\n`);
205
+ chunks.push(`\`\`\`${lang}\n`);
206
+ chunks.push(content);
207
+ if (!content.endsWith('\n'))
208
+ chunks.push('\n');
209
+ chunks.push(`\`\`\`\n\n`);
210
+ count++;
211
+ totalSize += fileStat.size;
212
+ }
213
+ catch (err) {
214
+ warn(` ⚠️ No se pudo leer: ${file}`);
215
+ }
216
+ }
217
+ // Escribir todo de una vez
218
+ const writeStream = createWriteStream(outputPath);
219
+ writeStream.write(chunks.join(''));
220
+ writeStream.end();
221
+ // Esperar a que termine de escribir
222
+ await new Promise((resolve) => {
223
+ writeStream.on('close', () => resolve());
224
+ });
225
+ return { count, totalSize, skippedSize, skippedExclude, skippedLimit };
226
+ }
227
+ function loadExcludeFile(excludeFile) {
228
+ if (!excludeFile || !existsSync(excludeFile)) {
229
+ return DEFAULT_EXCLUDES;
230
+ }
231
+ const content = readFileSync(excludeFile, 'utf-8');
232
+ return content
233
+ .split('\n')
234
+ .map((line) => line.trim())
235
+ .filter((line) => line && !line.startsWith('#'));
236
+ }
237
+ export async function runAiContext(options = {}) {
238
+ const outputFile = options.output || 'contexto.md';
239
+ const branch = options.branch;
240
+ const maxSize = options.full ? Number.MAX_SAFE_INTEGER : (options.maxSize || MAX_FILE_SIZE);
241
+ const excludePatterns = options.exclude || loadExcludeFile('.contextignore');
242
+ info(t("context.generating"));
243
+ if (branch)
244
+ info(` Branch: ${branch}`);
245
+ info(` Output: ${outputFile}`);
246
+ info(` Excluyendo: ${excludePatterns.slice(0, 5).join(', ')}${excludePatterns.length > 5 ? '...' : ''}`);
247
+ console.log('');
248
+ // Verificar que estamos en un repositorio git
249
+ const gitRoot = await findGitRoot();
250
+ if (!gitRoot) {
251
+ problem(t("context.not_git"));
252
+ problem(t("context.git_hint"));
253
+ }
254
+ // Obtener lista de archivos
255
+ const files = await getFileList(branch);
256
+ if (files.length === 0) {
257
+ problem('❌ Error: No se encontraron archivos en el repositorio');
258
+ return;
259
+ }
260
+ // Aplicar límite de tamaño si se especificó
261
+ const limitKB = options.limit || DEFAULT_LIMIT_KB;
262
+ const maxTotalBytes = limitKB * 1024;
263
+ let currentTotalBytes = 0;
264
+ // Escribir archivo de contexto con límite
265
+ const result = await writeContextFile(outputFile, files, excludePatterns, maxSize, maxTotalBytes);
266
+ const outputStat = await stat(outputFile);
267
+ const outputSizeKB = Math.round(outputStat.size / 1024);
268
+ const totalSizeKB = Math.round(result.totalSize / 1024);
269
+ console.log('');
270
+ success(`✅ Contexto generado: ${outputFile}`);
271
+ info(` Archivos incluidos: ${result.count}`);
272
+ info(` Tamaño total contenido: ${totalSizeKB}KB`);
273
+ info(` Tamaño del archivo: ${outputSizeKB}KB`);
274
+ if (limitKB && result.skippedLimit > 0) {
275
+ info(` Limitado por --limit ${limitKB}KB: ${result.skippedLimit} archivos omitidos`);
276
+ }
277
+ if (result.skippedExclude > 0)
278
+ info(` Omitidos por patrón: ${result.skippedExclude}`);
279
+ if (result.skippedSize > 0)
280
+ info(` Omitidos por tamaño (>${maxSize / 1024}KB): ${result.skippedSize}`);
281
+ console.log('');
282
+ info(`📋 Para enviar a DeepSeek:`);
283
+ info(` 1. En chat.deepseek.com haz clic en "Adjuntar archivo"`);
284
+ info(` 2. Selecciona ${outputFile}`);
285
+ info(` 3. El archivo se cargará automáticamente`);
286
+ if (result.count === 0) {
287
+ warn(`\n⚠️ Advertencia: No se incluyó ningún archivo.`);
288
+ warn(` Revisa tus patrones de exclusión en .contextignore`);
289
+ }
290
+ const shouldCopy = !options.noClipboard; // Por defecto true
291
+ // Copiar al portapapeles si no es --no-clip
292
+ if (shouldCopy) {
293
+ try {
294
+ const content = await readFile(outputFile, 'utf-8');
295
+ const { execSync } = await import('node:child_process');
296
+ // Usar execSync con input - esto funciona bien en OpenBSD
297
+ execSync('xclip -selection clipboard', {
298
+ input: content,
299
+ encoding: 'utf-8',
300
+ stdio: ['pipe', 'ignore', 'ignore']
301
+ });
302
+ success(`📋 Contexto copiado al portapapeles (${outputSizeKB}KB)`);
303
+ }
304
+ catch (err) {
305
+ warn(`⚠️ No se pudo copiar al portapapeles: ${err.message}`);
306
+ warn(' El archivo se guardó como: ' + outputFile);
307
+ }
308
+ await new Promise(resolve => setTimeout(resolve, 100));
309
+ }
310
+ }
@@ -0,0 +1,2 @@
1
+ export declare function runCreateProject(name: string, description?: string): Promise<void>;
2
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/tasks/create.ts"],"names":[],"mappings":"AA4DA,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,iBAuCxE"}
@@ -0,0 +1,91 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import { dirname } from 'path';
5
+ import { problem, success } from '../util/colors.js';
6
+ import { createTranslator } from '../i18n/createTranslator.js';
7
+ import { detectLocale } from '../util/locale.js';
8
+ import commonCli from '../i18n/common-cli.js';
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = dirname(__filename);
11
+ const t = createTranslator(detectLocale(), {
12
+ en: {
13
+ 'create.generating': 'Generating project in {{0}}...',
14
+ 'create.file_added': 'Added {{0}}',
15
+ 'create.error': 'Error creating project: {{0}}',
16
+ 'create.done': 'Project created successfully.',
17
+ },
18
+ es: {
19
+ 'create.generating': 'Generando proyecto en {{0}}...',
20
+ 'create.file_added': 'Agregado {{0}}',
21
+ 'create.error': 'Error al crear el proyecto: {{0}}',
22
+ 'create.done': 'Proyecto creado exitosamente.',
23
+ },
24
+ }, commonCli);
25
+ function getTemplateDir() {
26
+ // __dirname is dist/tasks/ in the npm package; dist/templates/ is where build copies templates
27
+ const distTemplates = path.join(__dirname, '..', 'templates');
28
+ if (fs.existsSync(distTemplates))
29
+ return distTemplates;
30
+ // Fallback for development: source tree templates/
31
+ const srcTemplates = path.join(__dirname, '..', '..', 'templates');
32
+ if (fs.existsSync(srcTemplates))
33
+ return srcTemplates;
34
+ return path.join(__dirname, 'templates');
35
+ }
36
+ function render(content, name, description) {
37
+ const pkg = JSON.parse(fs.readFileSync(new URL('../../package.json', import.meta.url), 'utf-8'));
38
+ return content
39
+ .replace(/\{\{name\}\}/g, name)
40
+ .replace(/\{\{description\}\}/g, description)
41
+ .replace(/\{\{m_version\}\}/g, pkg.version);
42
+ }
43
+ function getAllFiles(dir) {
44
+ const files = [];
45
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
46
+ for (const entry of entries) {
47
+ const fullPath = path.join(dir, entry.name);
48
+ if (entry.name === 'pnpm-lock.yaml' || entry.name.startsWith('.env'))
49
+ continue;
50
+ if (entry.isDirectory()) {
51
+ files.push(...getAllFiles(fullPath));
52
+ }
53
+ else {
54
+ files.push(fullPath);
55
+ }
56
+ }
57
+ return files;
58
+ }
59
+ export async function runCreateProject(name, description) {
60
+ const desc = description || '';
61
+ const templateDir = getTemplateDir();
62
+ const cwd = process.cwd();
63
+ const destDir = path.resolve(cwd, name);
64
+ if (fs.existsSync(destDir)) {
65
+ problem(t('create.error', `Directory ${name} already exists`));
66
+ process.exit(1);
67
+ }
68
+ const allFiles = getAllFiles(templateDir);
69
+ const templateBase = templateDir.replace(/\/+$/, '');
70
+ for (const srcPath of allFiles) {
71
+ const destRelPath = path.relative(templateBase, srcPath).replace(/\.hbs$/, '');
72
+ const destPath = path.join(destDir, destRelPath);
73
+ fs.mkdirSync(path.dirname(destPath), { recursive: true });
74
+ if (srcPath.endsWith('.hbs')) {
75
+ const content = fs.readFileSync(srcPath, 'utf-8');
76
+ const rendered = render(content, name, desc);
77
+ fs.writeFileSync(destPath, rendered, 'utf-8');
78
+ }
79
+ else {
80
+ fs.copyFileSync(srcPath, destPath);
81
+ }
82
+ success(t('create.file_added', '/' + destRelPath));
83
+ }
84
+ // Make bin/m executable
85
+ const binM = path.join(destDir, 'apps', 'nextjs', 'bin', 'm');
86
+ if (fs.existsSync(binM)) {
87
+ fs.chmodSync(binM, 0o755);
88
+ success(`Made ${path.join(name, 'apps', 'nextjs', 'bin', 'm')} executable`);
89
+ }
90
+ success(t('create.done'));
91
+ }
@@ -0,0 +1,19 @@
1
+ export declare function runDbCreate(): Promise<void>;
2
+ export declare function runDbDrop(): Promise<void>;
3
+ export declare function runDbSuperCreateUser(): Promise<void>;
4
+ export declare function runDbConsole(query?: string): Promise<void>;
5
+ export declare function runDbTestConnection(): Promise<void>;
6
+ export declare function runDbStructureDump(): Promise<void>;
7
+ export declare function runDbStructureLoad(): Promise<void>;
8
+ export declare function runDbTypesGen(): Promise<void>;
9
+ export declare function runDbMigrate(): Promise<void>;
10
+ export declare function runDbMigMake(name: string): Promise<void>;
11
+ export declare function runDbRollback(): Promise<void>;
12
+ export declare function runDbDump(name?: string): Promise<void>;
13
+ export declare function runDbRestore(name?: string): Promise<void>;
14
+ export declare function runDbSeed(): Promise<void>;
15
+ /**
16
+ * db:check — verify expected DB schemas for installed modules.
17
+ */
18
+ export declare function runDbCheck(): Promise<void>;
19
+ //# sourceMappingURL=db.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/tasks/db.ts"],"names":[],"mappings":"AAyNA,wBAAsB,WAAW,kBAUhC;AAED,wBAAsB,SAAS,kBAU9B;AAED,wBAAsB,oBAAoB,kBAyIzC;AAED,wBAAsB,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,iBAyDhD;AAED,wBAAsB,mBAAmB,kBAkBxC;AAkBD,wBAAsB,kBAAkB,kBAyCvC;AAED,wBAAsB,kBAAkB,kBAgCvC;AAED,wBAAsB,aAAa,kBAclC;AAED,wBAAsB,YAAY,kBAwCjC;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,iBA4B9C;AAED,wBAAsB,aAAa,kBAuBlC;AAED,wBAAsB,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,iBA6B5C;AAED,wBAAsB,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,iBAmD/C;AAED,wBAAsB,SAAS,kBAAoD;AAEnF;;GAEG;AACH,wBAAsB,UAAU,kBAsF/B"}