@pavlos-samaras/react-cli 2.0.1 → 2.1.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 (147) hide show
  1. package/dist/bin/ct.js +2 -2
  2. package/dist/bin/ct.js.map +1 -1
  3. package/dist/commands/generate/generate.constants.d.ts +5 -0
  4. package/dist/commands/generate/generate.constants.d.ts.map +1 -0
  5. package/dist/commands/generate/generate.constants.js +5 -0
  6. package/dist/commands/generate/generate.constants.js.map +1 -0
  7. package/dist/commands/generate/generate.d.ts +3 -0
  8. package/dist/commands/generate/generate.d.ts.map +1 -0
  9. package/dist/commands/generate/generate.js +34 -0
  10. package/dist/commands/generate/generate.js.map +1 -0
  11. package/dist/commands/generate/generate.types.d.ts +22 -0
  12. package/dist/commands/generate/generate.types.d.ts.map +1 -0
  13. package/dist/commands/generate/generate.types.js +2 -0
  14. package/dist/commands/generate/generate.types.js.map +1 -0
  15. package/dist/commands/generate/utils/general.d.ts +4 -0
  16. package/dist/commands/generate/utils/general.d.ts.map +1 -0
  17. package/dist/commands/generate/utils/general.js +23 -0
  18. package/dist/commands/generate/utils/general.js.map +1 -0
  19. package/dist/commands/generate/utils/generateComponent.d.ts +3 -0
  20. package/dist/commands/generate/utils/generateComponent.d.ts.map +1 -0
  21. package/dist/{utils/generate/component.js → commands/generate/utils/generateComponent.js} +10 -9
  22. package/dist/commands/generate/utils/generateComponent.js.map +1 -0
  23. package/dist/{utils/generate/hook.d.ts → commands/generate/utils/generateHook.d.ts} +2 -2
  24. package/dist/commands/generate/utils/generateHook.d.ts.map +1 -0
  25. package/dist/{utils/generate/hook.js → commands/generate/utils/generateHook.js} +6 -5
  26. package/dist/commands/generate/utils/generateHook.js.map +1 -0
  27. package/dist/commands/generate/utils/runGenerateComponent.d.ts +3 -0
  28. package/dist/commands/generate/utils/runGenerateComponent.d.ts.map +1 -0
  29. package/dist/commands/generate/utils/runGenerateComponent.js +25 -0
  30. package/dist/commands/generate/utils/runGenerateComponent.js.map +1 -0
  31. package/dist/commands/generate/utils/runGenerateHook.d.ts +3 -0
  32. package/dist/commands/generate/utils/runGenerateHook.d.ts.map +1 -0
  33. package/dist/commands/generate/utils/runGenerateHook.js +23 -0
  34. package/dist/commands/generate/utils/runGenerateHook.js.map +1 -0
  35. package/dist/commands/new/new.constants.d.ts +4 -0
  36. package/dist/commands/new/new.constants.d.ts.map +1 -0
  37. package/dist/commands/new/new.constants.js +4 -0
  38. package/dist/commands/new/new.constants.js.map +1 -0
  39. package/dist/commands/new/new.d.ts.map +1 -0
  40. package/dist/commands/new/new.js +39 -0
  41. package/dist/commands/new/new.js.map +1 -0
  42. package/dist/commands/new/new.types.d.ts +7 -0
  43. package/dist/commands/new/new.types.d.ts.map +1 -0
  44. package/dist/commands/new/new.types.js +2 -0
  45. package/dist/commands/new/new.types.js.map +1 -0
  46. package/dist/commands/new/utils/general.d.ts +3 -0
  47. package/dist/commands/new/utils/general.d.ts.map +1 -0
  48. package/dist/commands/new/utils/general.js +6 -0
  49. package/dist/commands/new/utils/general.js.map +1 -0
  50. package/dist/commands/new/utils/runCommand.d.ts +2 -0
  51. package/dist/commands/new/utils/runCommand.d.ts.map +1 -0
  52. package/dist/commands/new/utils/runCommand.js +7 -0
  53. package/dist/commands/new/utils/runCommand.js.map +1 -0
  54. package/dist/commands/new/utils/runCreateVite.d.ts +2 -0
  55. package/dist/commands/new/utils/runCreateVite.d.ts.map +1 -0
  56. package/dist/commands/new/utils/runCreateVite.js +32 -0
  57. package/dist/commands/new/utils/runCreateVite.js.map +1 -0
  58. package/dist/commands/new/utils/runCustomTemplate.d.ts +3 -0
  59. package/dist/commands/new/utils/runCustomTemplate.d.ts.map +1 -0
  60. package/dist/commands/new/utils/runCustomTemplate.js +25 -0
  61. package/dist/commands/new/utils/runCustomTemplate.js.map +1 -0
  62. package/dist/constants/config.constants.d.ts +3 -0
  63. package/dist/constants/config.constants.d.ts.map +1 -0
  64. package/dist/constants/config.constants.js +5 -0
  65. package/dist/constants/config.constants.js.map +1 -0
  66. package/dist/types/config.types.d.ts +11 -0
  67. package/dist/types/config.types.d.ts.map +1 -0
  68. package/dist/types/config.types.js +2 -0
  69. package/dist/types/config.types.js.map +1 -0
  70. package/dist/utils/general.d.ts +4 -0
  71. package/dist/utils/general.d.ts.map +1 -0
  72. package/dist/utils/general.js +3 -0
  73. package/dist/utils/general.js.map +1 -0
  74. package/dist/utils/loadConfig.d.ts +2 -5
  75. package/dist/utils/loadConfig.d.ts.map +1 -1
  76. package/dist/utils/loadConfig.js +19 -4
  77. package/dist/utils/loadConfig.js.map +1 -1
  78. package/package.json +3 -2
  79. package/templates/component.tpl +9 -0
  80. package/templates/hook.tpl +3 -0
  81. package/templates/react/README.md +12 -0
  82. package/templates/react/eslint.config.js +29 -0
  83. package/templates/react/index.html +13 -0
  84. package/templates/react/jsconfig.json +13 -0
  85. package/templates/react/package.json +30 -0
  86. package/templates/react/public/favicon.svg +1 -0
  87. package/templates/react/src/app/App.jsx +12 -0
  88. package/templates/react/src/app/providers.jsx +13 -0
  89. package/templates/react/src/app/routes.jsx +19 -0
  90. package/templates/react/src/config/queryClient.config.js +12 -0
  91. package/templates/react/src/lib/queryClient.jsx +6 -0
  92. package/templates/react/src/main.jsx +13 -0
  93. package/templates/react/src/pages/home/Home.jsx +11 -0
  94. package/templates/react/src/pages/home/Home.module.scss +0 -0
  95. package/templates/react/vite.config.js +18 -0
  96. package/templates/react-ts/README.md +75 -0
  97. package/templates/react-ts/eslint.config.js +22 -0
  98. package/templates/react-ts/index.html +13 -0
  99. package/templates/react-ts/package-lock.json +3221 -0
  100. package/templates/react-ts/package.json +33 -0
  101. package/templates/react-ts/public/favicon.svg +1 -0
  102. package/templates/react-ts/src/app/App.tsx +12 -0
  103. package/templates/react-ts/src/app/providers.tsx +16 -0
  104. package/templates/react-ts/src/app/routes.tsx +19 -0
  105. package/templates/react-ts/src/config/queryClient.config.ts +14 -0
  106. package/templates/react-ts/src/lib/queryClient.tsx +6 -0
  107. package/templates/react-ts/src/main.tsx +13 -0
  108. package/templates/react-ts/src/pages/home/Home.module.scss +0 -0
  109. package/templates/react-ts/src/pages/home/Home.tsx +11 -0
  110. package/templates/react-ts/tsconfig.app.json +29 -0
  111. package/templates/react-ts/tsconfig.json +7 -0
  112. package/templates/react-ts/tsconfig.node.json +23 -0
  113. package/templates/react-ts/vite.config.ts +18 -0
  114. package/templates/stylesheet.tpl +3 -0
  115. package/dist/commands/generate.d.ts +0 -12
  116. package/dist/commands/generate.d.ts.map +0 -1
  117. package/dist/commands/generate.js +0 -88
  118. package/dist/commands/generate.js.map +0 -1
  119. package/dist/commands/new.d.ts.map +0 -1
  120. package/dist/commands/new.js +0 -53
  121. package/dist/commands/new.js.map +0 -1
  122. package/dist/constants/ct.config.d.ts +0 -5
  123. package/dist/constants/ct.config.d.ts.map +0 -1
  124. package/dist/constants/ct.config.js +0 -5
  125. package/dist/constants/ct.config.js.map +0 -1
  126. package/dist/templates/component.d.ts +0 -3
  127. package/dist/templates/component.d.ts.map +0 -1
  128. package/dist/templates/component.js +0 -11
  129. package/dist/templates/component.js.map +0 -1
  130. package/dist/templates/hook.d.ts +0 -3
  131. package/dist/templates/hook.d.ts.map +0 -1
  132. package/dist/templates/hook.js +0 -5
  133. package/dist/templates/hook.js.map +0 -1
  134. package/dist/templates/stylesheet.d.ts +0 -3
  135. package/dist/templates/stylesheet.d.ts.map +0 -1
  136. package/dist/templates/stylesheet.js +0 -7
  137. package/dist/templates/stylesheet.js.map +0 -1
  138. package/dist/types/generator.d.ts +0 -7
  139. package/dist/types/generator.d.ts.map +0 -1
  140. package/dist/types/generator.js +0 -2
  141. package/dist/types/generator.js.map +0 -1
  142. package/dist/utils/generate/component.d.ts +0 -11
  143. package/dist/utils/generate/component.d.ts.map +0 -1
  144. package/dist/utils/generate/component.js.map +0 -1
  145. package/dist/utils/generate/hook.d.ts.map +0 -1
  146. package/dist/utils/generate/hook.js.map +0 -1
  147. /package/dist/commands/{new.d.ts → new/new.d.ts} +0 -0
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "my-app",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "tsc -b && vite build",
9
+ "lint": "eslint .",
10
+ "preview": "vite preview"
11
+ },
12
+ "dependencies": {
13
+ "@tanstack/react-query": "^5.106.1",
14
+ "react": "^19.3.1",
15
+ "react-dom": "^19.3.1",
16
+ "react-router": "^8.5.1",
17
+ "sass": "^1.107.1"
18
+ },
19
+ "devDependencies": {
20
+ "@eslint/js": "^10.0.1",
21
+ "@types/node": "^24.19.2",
22
+ "@types/react": "^19.3.0",
23
+ "@types/react-dom": "^19.3.0",
24
+ "@vitejs/plugin-react": "^6.1.2",
25
+ "eslint": "^10.14.0",
26
+ "eslint-plugin-react-hooks": "^7.1.1",
27
+ "eslint-plugin-react-refresh": "^0.5.7",
28
+ "globals": "^17.13.0",
29
+ "typescript": "~6.0.3",
30
+ "typescript-eslint": "^8.72.1",
31
+ "vite": "^8.3.6"
32
+ }
33
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="46" fill="none" viewBox="0 0 48 46"><path fill="#863bff" d="M25.946 44.938c-.664.845-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.287c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.497 0-3.578-1.842-3.578H1.237c-.92 0-1.456-1.04-.92-1.788L10.013.474c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.579 1.842 3.579h11.377c.943 0 1.473 1.088.89 1.83L25.947 44.94z" style="fill:#863bff;fill:color(display-p3 .5252 .23 1);fill-opacity:1"/><mask id="a" width="48" height="46" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M25.842 44.938c-.664.844-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.183c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.498 0-3.579-1.842-3.579H1.133c-.92 0-1.456-1.04-.92-1.787L9.91.473c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.578 1.842 3.578h11.377c.943 0 1.473 1.088.89 1.832L25.843 44.94z" style="fill:#000;fill-opacity:1"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#ede6ff" rx="5.508" ry="14.704" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -4.47 31.516)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#ede6ff" rx="10.399" ry="29.851" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -39.328 7.883)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#7e14ff" rx="5.508" ry="30.487" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -25.913 -14.639)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -32.644 -3.334)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -34.34 30.47)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#ede6ff" rx="14.072" ry="22.078" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="rotate(93.35 24.506 48.493)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx=".387" cy="8.972" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(39.51 .387 8.972)"/></g><g filter="url(#k)"><ellipse cx="47.523" cy="-6.092" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 47.523 -6.092)"/></g><g filter="url(#l)"><ellipse cx="41.412" cy="6.333" fill="#47bfff" rx="5.971" ry="9.665" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 41.412 6.333)"/></g><g filter="url(#m)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#n)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#o)"><ellipse cx="35.651" cy="29.907" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 35.651 29.907)"/></g><g filter="url(#p)"><ellipse cx="38.418" cy="32.4" fill="#47bfff" rx="5.971" ry="15.297" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 38.418 32.4)"/></g></g><defs><filter id="b" width="60.045" height="41.654" x="-19.77" y="16.149" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-54.613" y="-7.533" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="d" width="79.355" height="29.4" x="-49.64" y="2.03" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="e" width="79.579" height="29.4" x="-45.045" y="20.029" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="f" width="79.579" height="29.4" x="-43.513" y="21.178" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="g" width="74.749" height="58.852" x="15.756" y="-17.901" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="h" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="i" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="j" width="56.045" height="63.649" x="-27.636" y="-22.853" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="k" width="54.814" height="64.646" x="20.116" y="-38.415" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="l" width="33.541" height="35.313" x="24.641" y="-11.323" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="m" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="n" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="o" width="54.814" height="64.646" x="8.244" y="-2.416" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="p" width="39.409" height="43.623" x="18.713" y="10.588" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter></defs></svg>
@@ -0,0 +1,12 @@
1
+ import Providers from "./providers";
2
+ import AppRoutes from "./routes";
3
+
4
+ const App = () => {
5
+ return (
6
+ <Providers>
7
+ <AppRoutes />
8
+ </Providers>
9
+ );
10
+ };
11
+
12
+ export default App;
@@ -0,0 +1,16 @@
1
+ import { BrowserRouter } from "react-router";
2
+ import { QueryClientProvider } from "@tanstack/react-query";
3
+ import queryClient from "@/lib/queryClient";
4
+ import type { PropsWithChildren } from "react";
5
+
6
+ type ProvidersProps = {} & PropsWithChildren;
7
+
8
+ const Providers = ({ children }: ProvidersProps) => {
9
+ return (
10
+ <QueryClientProvider client={queryClient}>
11
+ <BrowserRouter>{children}</BrowserRouter>
12
+ </QueryClientProvider>
13
+ );
14
+ };
15
+
16
+ export default Providers;
@@ -0,0 +1,19 @@
1
+ import { Suspense, lazy } from "react";
2
+ import { Routes, Route } from "react-router";
3
+
4
+ const HomePage = lazy(() => import("@/pages/home/Home"));
5
+
6
+ const AppRoutes = () => {
7
+ return (
8
+ <Suspense fallback={<div>Loading...</div>}>
9
+ <Routes>
10
+ <Route path="/" element={<HomePage />} />
11
+
12
+ {/* Fallback route, must be last */}
13
+ <Route path="*" element={<div>404 Page Not Found</div>} />
14
+ </Routes>
15
+ </Suspense>
16
+ );
17
+ };
18
+
19
+ export default AppRoutes;
@@ -0,0 +1,14 @@
1
+ import type { QueryClientConfig } from "@tanstack/react-query";
2
+
3
+ const STALE_TIME_MINS = 5;
4
+ const STALE_TIME_MILLISECONDS = STALE_TIME_MINS * 60 * 1000;
5
+
6
+ export const queryClientConfig: QueryClientConfig= {
7
+ defaultOptions: {
8
+ queries: {
9
+ refetchOnWindowFocus: false,
10
+ retry: 1,
11
+ staleTime: STALE_TIME_MILLISECONDS,
12
+ },
13
+ },
14
+ }
@@ -0,0 +1,6 @@
1
+ import { QueryClient } from "@tanstack/react-query";
2
+ import { queryClientConfig } from "../config/queryClient.config";
3
+
4
+ const queryClient = new QueryClient(queryClientConfig);
5
+
6
+ export default queryClient;
@@ -0,0 +1,13 @@
1
+ import { StrictMode } from "react";
2
+ import { createRoot } from "react-dom/client";
3
+ import App from "./app/App.tsx";
4
+
5
+ const rootEl = document.getElementById("root");
6
+ if (!rootEl) throw new Error("root element wasn't found");
7
+ const root = createRoot(rootEl);
8
+
9
+ root.render(
10
+ <StrictMode>
11
+ <App />
12
+ </StrictMode>,
13
+ );
@@ -0,0 +1,11 @@
1
+ import styles from "./Home.module.scss";
2
+
3
+ const HomePage = () => {
4
+ return (
5
+ <div className={styles.home}>
6
+ <h1>Home Page</h1>
7
+ </div>
8
+ );
9
+ };
10
+
11
+ export default HomePage;
@@ -0,0 +1,29 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
+ "target": "es2023",
5
+ "lib": ["ES2023", "DOM"],
6
+ "module": "esnext",
7
+ "types": ["vite/client"],
8
+ "allowArbitraryExtensions": true,
9
+ "skipLibCheck": true,
10
+ "paths": {
11
+ "@/*": ["./src/*"]
12
+ },
13
+
14
+ /* Bundler mode */
15
+ "moduleResolution": "bundler",
16
+ "allowImportingTsExtensions": true,
17
+ "verbatimModuleSyntax": true,
18
+ "moduleDetection": "force",
19
+ "noEmit": true,
20
+ "jsx": "react-jsx",
21
+
22
+ /* Linting */
23
+ "noUnusedLocals": true,
24
+ "noUnusedParameters": true,
25
+ "erasableSyntaxOnly": true,
26
+ "noFallthroughCasesInSwitch": true
27
+ },
28
+ "include": ["src"]
29
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ { "path": "./tsconfig.app.json" },
5
+ { "path": "./tsconfig.node.json" }
6
+ ]
7
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
+ "target": "es2023",
5
+ "lib": ["ES2023"],
6
+ "types": ["node"],
7
+ "skipLibCheck": true,
8
+
9
+ /* Bundler mode */
10
+ "module": "nodenext",
11
+ "allowImportingTsExtensions": true,
12
+ "verbatimModuleSyntax": true,
13
+ "moduleDetection": "force",
14
+ "noEmit": true,
15
+
16
+ /* Linting */
17
+ "noUnusedLocals": true,
18
+ "noUnusedParameters": true,
19
+ "erasableSyntaxOnly": true,
20
+ "noFallthroughCasesInSwitch": true
21
+ },
22
+ "include": ["vite.config.ts"]
23
+ }
@@ -0,0 +1,18 @@
1
+ import react from "@vitejs/plugin-react";
2
+ import path from "path";
3
+ import { defineConfig } from "vite";
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react()],
8
+ resolve: {
9
+ alias: {
10
+ "@": path.resolve(import.meta.dirname, "src"),
11
+ },
12
+ },
13
+ css: {
14
+ modules: {
15
+ localsConvention: "camelCase",
16
+ },
17
+ },
18
+ });
@@ -0,0 +1,3 @@
1
+ .__CLASSNAME__ {
2
+ // scss code
3
+ }
@@ -1,12 +0,0 @@
1
- import { Command } from "commander";
2
- declare const STYLES: readonly ["css", "scss"];
3
- export type Style = (typeof STYLES)[number];
4
- export interface Options {
5
- feature?: string;
6
- style?: Style;
7
- ts?: boolean;
8
- force?: boolean;
9
- }
10
- export declare const registerGenerateCommand: (program: Command) => void;
11
- export {};
12
- //# sourceMappingURL=generate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,QAAA,MAAM,MAAM,YAAI,KAAK,EAAE,MAAM,CAAU,CAAC;AAGxC,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5C,MAAM,WAAW,OAAO;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAkBD,eAAO,MAAM,uBAAuB,YAAa,OAAO,SA0EvD,CAAC"}
@@ -1,88 +0,0 @@
1
- import path from "path";
2
- import fs from "fs";
3
- import chalk from "chalk";
4
- import { Command } from "commander";
5
- import { error, info, warning } from "../utils/console.js";
6
- import { isReactProject } from "../utils/validators.js";
7
- import { generateHook } from "../utils/generate/hook.js";
8
- import { generateComponent } from "../utils/generate/component.js";
9
- const TYPES = ["component", "hook"];
10
- const STYLES = ["css", "scss"];
11
- // Utilities
12
- const createDir = (pathToFolder) => {
13
- const folder = path.join(process.cwd(), pathToFolder);
14
- if (fs.existsSync(folder))
15
- return;
16
- fs.mkdirSync(folder, { recursive: true });
17
- return folder;
18
- };
19
- const createComponentFiles = (component) => {
20
- const { JSX, stylesheet, hook, test } = component;
21
- fs.writeFileSync(JSX.path, JSX.content);
22
- fs.writeFileSync(stylesheet.path, stylesheet.content);
23
- fs.writeFileSync(hook.path, hook.content);
24
- fs.writeFileSync(test.path, test.content);
25
- };
26
- export const registerGenerateCommand = (program) => {
27
- program
28
- .command("generate <type> <name>")
29
- .alias("g")
30
- .description("generate the given <type> content")
31
- .option("-f, --feature <feature>", "generate the given <type> inside a feature", (value) => value.replace(/=/, ""))
32
- .option("-s, --style <style>", "use the specified stylesheet style", (value) => value.replace(/=/, ""))
33
- .option("--ts", "Use typescript")
34
- .option("--force", "skip safety checks and overwrite")
35
- .action(async (type, name, options) => {
36
- if (!isReactProject() && !options.force) {
37
- error("This is not a React project\ncreate one or use 'ct new <name>'");
38
- process.exitCode = 1;
39
- return;
40
- }
41
- if (!TYPES.includes(type)) {
42
- error(`Invalid type: ${type}`);
43
- process.exitCode = 1;
44
- return;
45
- }
46
- if (options.style && !STYLES.includes(options.style)) {
47
- error(`Invalid style: ${options.style}`);
48
- process.exitCode = 1;
49
- return;
50
- }
51
- const rootDir = options.feature
52
- ? `src/features/${options.feature}`
53
- : "src";
54
- if (type === "component") {
55
- if (!/^[A-Z][a-zA-Z]*$/.test(name)) {
56
- warning(`Invalid component name ${name}`);
57
- process.exitCode = 1;
58
- return;
59
- }
60
- const folder = createDir(`${rootDir}/components/${name}`);
61
- if (!folder) {
62
- warning(`Folder ${name} already exists!`);
63
- process.exitCode = 1;
64
- return;
65
- }
66
- const component = await generateComponent(folder, name, options);
67
- createComponentFiles(component);
68
- info(`${name} created at ${chalk.gray(folder)}`);
69
- }
70
- if (type === "hook") {
71
- if (!/^use[A-Z][a-zA-Z]*$/.test(name)) {
72
- warning(`Invalid hook name ${name}`);
73
- process.exitCode = 1;
74
- return;
75
- }
76
- const folder = createDir(`${rootDir}/hooks/${name}`);
77
- if (!folder) {
78
- warning(`Folder ${name} already exists!`);
79
- process.exitCode = 1;
80
- return;
81
- }
82
- const hook = await generateHook(folder, name, options);
83
- fs.writeFileSync(hook.path, hook.content);
84
- info(`${name} created at ${chalk.gray(folder)}`);
85
- }
86
- });
87
- };
88
- //# sourceMappingURL=generate.js.map
@@ -1 +0,0 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AAO,UAAU,IAAI,EAAE,CAAC,CAAC;YACrD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,CAAC,UAAU,IAAI,kBAAkB,CAAC,CAAC;gBAC1C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;gBACrB,OAAO;YACT,CAAC;YACD,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YACvD,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YAC1C,IAAI,CAAC,GAAG,IAAI,eAAe,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACnD,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"new.d.ts","sourceRoot":"","sources":["../../src/commands/new.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,eAAO,MAAM,kBAAkB,YAAa,OAAO,SAiElD,CAAC"}
@@ -1,53 +0,0 @@
1
- import path from "path";
2
- import fs from "fs";
3
- import chalk from "chalk";
4
- import { spawnSync } from "child_process";
5
- import { DEFAULT_CONFIG } from "../constants/ct.config.js";
6
- export const registerNewCommand = (program) => {
7
- program
8
- .command("new <name>")
9
- .description("Create a new React project with Vite")
10
- .action((name) => {
11
- if (!/^[a-z0-9][a-z0-9-_]*$/i.test(name)) {
12
- console.log(chalk.red(`Invalid name ${name}`));
13
- process.exitCode = 1;
14
- return;
15
- }
16
- const target = path.join(process.cwd(), name);
17
- if (fs.existsSync(target)) {
18
- console.log(chalk.yellow(`Folder ${name} already exists!`));
19
- process.exitCode = 1;
20
- return;
21
- }
22
- const result = spawnSync(`npm create vite@latest ${name} -- --no-install`, {
23
- stdio: "inherit",
24
- shell: true,
25
- });
26
- const vitePassed = result.status === 0;
27
- if (!vitePassed && !fs.existsSync(target)) {
28
- console.log(chalk.red("Vite failed before creating the project."));
29
- process.exitCode = 1;
30
- return;
31
- }
32
- fs.writeFileSync(path.join(target, "ct.config.json"), JSON.stringify(DEFAULT_CONFIG, null, 2));
33
- if (!vitePassed) {
34
- console.log(chalk.yellow("Install failed (dependency conflict). Retrying with --legacy-peer-deps..."));
35
- const retry = spawnSync("npm install --legacy-peer-deps", {
36
- cwd: target,
37
- stdio: "inherit",
38
- shell: true,
39
- });
40
- if (retry.status !== 0) {
41
- console.log(chalk.red("Install failed again. Finish it manually:"));
42
- console.log(chalk.green(`cd ${name}`));
43
- console.log(chalk.green("npm install --legacy-peer-deps"));
44
- process.exitCode = 1;
45
- return;
46
- }
47
- }
48
- console.log(`\nDone! Next steps:\n`);
49
- console.log(chalk.green(`cd ${name}`));
50
- console.log(chalk.green("npm run dev"));
51
- });
52
- };
53
- //# sourceMappingURL=new.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new.js","sourceRoot":"","sources":["../../src/commands/new.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAgB,EAAE,EAAE;IACrD,OAAO;SACJ,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CAAC,sCAAsC,CAAC;SACnD,MAAM,CAAC,CAAC,IAAY,EAAE,EAAE;QACvB,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACzC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC,CAAC;YAC/C,OAAO,CAAC,QAAQ,GAAG,CA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,CAAC;gBACvB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC,CAAC;gBACpE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC;gBACvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC,CAAC;gBAC3D,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;gBACrB,OAAO;YACT,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const DEFAULT_CONFIG: {
2
- typescript: boolean;
3
- stylesheet: string;
4
- };
5
- //# sourceMappingURL=ct.config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ct.config.d.ts","sourceRoot":"","sources":["../../src/constants/ct.config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;IACzB,UAAU;IACV,UAAU;CACX,CAAC"}
@@ -1,5 +0,0 @@
1
- export const DEFAULT_CONFIG = {
2
- typescript: false,
3
- stylesheet: "css",
4
- };
5
- //# sourceMappingURL=ct.config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ct.config.js","sourceRoot":"","sources":["../../src/constants/ct.config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,KAAK;CAClB,CAAC"}
@@ -1,3 +0,0 @@
1
- declare const buildComponentTemplate: (name: string, stylesheetExt: string, componentExt: string) => string;
2
- export default buildComponentTemplate;
3
- //# sourceMappingURL=component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/templates/component.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,sBAAsB,SACpB,MAAM,iBACG,MAAM,gBACP,MAAM,WASrB,CAAC;eAEa,sBAAsB"}
@@ -1,11 +0,0 @@
1
- const buildComponentTemplate = (name, stylesheetExt, componentExt) => {
2
- return `import styles from "./${name}.module.${stylesheetExt}"
3
- import { use${name} } from "./use${name}.${componentExt}"
4
-
5
- export const ${name} = () => {
6
- const hook = use${name}();
7
- return <div className={styles.${name.toLowerCase()}></div>
8
- }`;
9
- };
10
- export default buildComponentTemplate;
11
- //# sourceMappingURL=component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/templates/component.ts"],"names":[],"mappings":"AAAA,MAAM,sBAAsB,GAAG,CAC7B,IAAY,EACZ,aAAqB,EACrB,YAAoB,EACpB,EAAE;IACF,OAAO,yBAAyB,IAAI,WAAW,aAAa;cAChD,IAAI,iBAAiB,IAAI,IAAI,YAAY;;eAExC,IAAI;oBACC,IAAI;kCACU,IAAI,CAAC,WAAW,EAAE;EAClD,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -1,3 +0,0 @@
1
- declare const buildHookTemplate: (name: string) => string;
2
- export default buildHookTemplate;
3
- //# sourceMappingURL=hook.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/templates/hook.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,iBAAiB,SAAU,MAAM,WAEtC,CAAC;eAEa,iBAAiB"}
@@ -1,5 +0,0 @@
1
- const buildHookTemplate = (name) => {
2
- return `export const use${name} = () => {}`;
3
- };
4
- export default buildHookTemplate;
5
- //# sourceMappingURL=hook.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hook.js","sourceRoot":"","sources":["../../src/templates/hook.ts"],"names":[],"mappings":"AAAA,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,EAAE;IACzC,OAAO,mBAAmB,IAAI,aAAa,CAAC;AAC9C,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -1,3 +0,0 @@
1
- declare const buildStylesheetTemplate: (name: string) => string;
2
- export default buildStylesheetTemplate;
3
- //# sourceMappingURL=stylesheet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stylesheet.d.ts","sourceRoot":"","sources":["../../src/templates/stylesheet.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,uBAAuB,SAAU,MAAM,WAI5C,CAAC;eAEa,uBAAuB"}
@@ -1,7 +0,0 @@
1
- const buildStylesheetTemplate = (name) => {
2
- return `.${name.toLowerCase()} {
3
- // Styles go here
4
- }`;
5
- };
6
- export default buildStylesheetTemplate;
7
- //# sourceMappingURL=stylesheet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stylesheet.js","sourceRoot":"","sources":["../../src/templates/stylesheet.ts"],"names":[],"mappings":"AAAA,MAAM,uBAAuB,GAAG,CAAC,IAAY,EAAE,EAAE;IAC/C,OAAO,IAAI,IAAI,CAAC,WAAW,EAAE;;EAE7B,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -1,7 +0,0 @@
1
- export type GeneratorOptions = {
2
- dir?: string;
3
- feature?: string;
4
- ts?: boolean;
5
- force?: boolean;
6
- };
7
- //# sourceMappingURL=generator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/types/generator.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=generator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../src/types/generator.ts"],"names":[],"mappings":""}
@@ -1,11 +0,0 @@
1
- import type { Options } from "../../commands/generate.js";
2
- type ComponentFile = "JSX" | "stylesheet" | "hook" | "test";
3
- export type Component = {
4
- [K in ComponentFile]: {
5
- path: string;
6
- content: string;
7
- };
8
- };
9
- export declare const generateComponent: (folder: string, name: string, options: Options) => Promise<Component>;
10
- export {};
11
- //# sourceMappingURL=component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/utils/generate/component.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAG1D,KAAK,aAAa,GAAG,KAAK,GAAG,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5D,MAAM,MAAM,SAAS,GAAG;KACrB,CAAC,IAAI,aAAa,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;CACxD,CAAC;AAiBF,eAAO,MAAM,iBAAiB,WACpB,MAAM,QACR,MAAM,WACH,OAAO,KACf,OAAO,CAAC,SAAS,CAyBnB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/utils/generate/component.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,sBAAsB,MAAM,8BAA8B,CAAC;AAClE,OAAO,uBAAuB,MAAM,+BAA+B,CAAC;AACpE,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAQ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AI,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;YAChD,OAAO,EAAE,iBAAiB,CAAC,IAAI,CAAC;SACjC;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,SAAS,OAAO,EAAE,CAAC;YAClD,OAAO,EAAE,EAAE;SACZ;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/utils/generate/hook.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAG1D,eAAO,MAAM,YAAY,WACf,MAAM,QACR,MAAM,WACH,OAAO;;;EAUjB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"hook.js","sourceRoot":"","sources":["../../../src/utils/generate/hook.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAC/B,MAAc,EACd,IAAY,EACZ,OAAgB,EAChB,EAAE;IACF,MAAM,MAAM,GAAG,UAAU,EAAE,IAAI,EAAE,CAAC;IAClC,MAAM,KAAK,GAAG,OAAO,CAAC,EAAE,IAAI,MAAM,CAAC,UAAU,IAAI,gBAAgB,EAAE,CAAC;IACpE,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAEpC,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC;QAC7C,OAAO,EAAE,iBAAiB,CAAC,IAAI,CAAC;KACjC,CAAC;AACJ,CAAC,CAAC"}
File without changes