@akanjs/cli 0.0.149 → 0.0.150

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 (258) hide show
  1. package/cjs/index.js +17 -11
  2. package/cjs/src/guidelines/componentRule/componentRule.generate.json +131 -0
  3. package/cjs/src/guidelines/cssRule/cssRule.generate.json +93 -0
  4. package/cjs/src/guidelines/databaseModule/databaseModule.generate.json +51 -0
  5. package/cjs/src/guidelines/docPageRule/docPageRule.generate.json +72 -0
  6. package/cjs/src/guidelines/enumConstant/enumConstant.generate.json +24 -0
  7. package/cjs/src/guidelines/fieldDecorator/fieldDecorator.generate.json +135 -0
  8. package/cjs/src/guidelines/framework/framework.generate.json +119 -0
  9. package/cjs/src/guidelines/howToUseStore/howToUseStore.generate.json +0 -0
  10. package/cjs/src/guidelines/modelConstant/modelConstant.generate.json +135 -0
  11. package/cjs/src/guidelines/modelDictionary/modelDictionary.generate.json +115 -0
  12. package/cjs/src/guidelines/modelDocument/modelDocument.generate.json +129 -0
  13. package/cjs/src/guidelines/modelService/modelService.generate.json +179 -0
  14. package/cjs/src/guidelines/modelSignal/modelSignal.generate.json +202 -0
  15. package/cjs/src/guidelines/modelStore/modelStore.generate.json +130 -0
  16. package/cjs/src/guidelines/modelTemplate/modelTemplate.generate.json +104 -0
  17. package/cjs/src/guidelines/modelUnit/modelUnit.generate.json +92 -0
  18. package/cjs/src/guidelines/modelUtil/modelUtil.generate.json +93 -0
  19. package/cjs/src/guidelines/modelView/modelView.generate.json +80 -0
  20. package/cjs/src/guidelines/modelZone/modelZone.generate.json +126 -0
  21. package/cjs/src/guidelines/scalarConstant/scalarConstant.generate.json +102 -0
  22. package/cjs/src/guidelines/scalarDictionary/scalarDictionary.generate.json +83 -0
  23. package/cjs/src/guidelines/scalarModule/scalarModule.generate.json +35 -0
  24. package/cjs/src/guidelines/sharedUiUsage/sharedUiUsage.generate.json +115 -0
  25. package/cjs/src/guidelines/utilUiUsage/utilUiUsage.generate.json +140 -0
  26. package/cjs/src/templates/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.js +47 -0
  27. package/cjs/src/templates/app/app/[lang]/(__appName__)/(public)/page.js +128 -0
  28. package/cjs/src/templates/app/app/[lang]/(__appName__)/(public)/privacy/page.js +42 -0
  29. package/cjs/src/templates/app/app/[lang]/(__appName__)/(public)/signin/page.js +50 -0
  30. package/cjs/src/templates/app/app/[lang]/(__appName__)/(public)/termsofservice/page.js +41 -0
  31. package/cjs/src/templates/app/app/[lang]/(__appName__)/(public)/unknown/page.js +51 -0
  32. package/cjs/src/templates/app/app/[lang]/(__appName__)/(user)/layout.js +43 -0
  33. package/cjs/src/templates/app/app/[lang]/(__appName__)/(user)/self/page.js +60 -0
  34. package/cjs/src/templates/app/app/[lang]/(__appName__)/layout.js +54 -0
  35. package/cjs/src/templates/app/app/[lang]/admin/layout.js +54 -0
  36. package/cjs/src/templates/app/app/[lang]/admin/page.js +63 -0
  37. package/cjs/src/templates/app/app/csr.js +34 -0
  38. package/cjs/src/templates/app/app/layout.js +38 -0
  39. package/cjs/src/templates/app/lib/setting/Setting.Template.js +57 -0
  40. package/cjs/src/templates/app/lib/setting/Setting.Unit.js +38 -0
  41. package/cjs/src/templates/app/lib/setting/Setting.Util.js +34 -0
  42. package/cjs/src/templates/app/lib/setting/Setting.View.js +51 -0
  43. package/cjs/src/templates/app/lib/setting/Setting.Zone.js +80 -0
  44. package/cjs/src/templates/app/lib/setting/index.js +61 -0
  45. package/cjs/src/templates/app/lib/summary/Summary.Template.js +43 -0
  46. package/cjs/src/templates/app/lib/summary/Summary.Unit.js +38 -0
  47. package/cjs/src/templates/app/lib/summary/Summary.Util.js +33 -0
  48. package/cjs/src/templates/app/lib/summary/Summary.View.js +51 -0
  49. package/cjs/src/templates/app/lib/summary/Summary.Zone.js +62 -0
  50. package/cjs/src/templates/app/lib/summary/index.js +67 -0
  51. package/cjs/src/templates/app/lib/user/User.Template.js +65 -0
  52. package/cjs/src/templates/app/lib/user/User.Unit.js +38 -0
  53. package/cjs/src/templates/app/lib/user/User.Util.js +94 -0
  54. package/cjs/src/templates/app/lib/user/User.View.js +66 -0
  55. package/cjs/src/templates/app/lib/user/User.Zone.js +74 -0
  56. package/cjs/src/templates/app/lib/user/index.js +61 -0
  57. package/cjs/src/templates/app/public/favicon.ico +0 -0
  58. package/cjs/src/templates/app/public/icons/icon-128x128.png +0 -0
  59. package/cjs/src/templates/app/public/icons/icon-144x144.png +0 -0
  60. package/cjs/src/templates/app/public/icons/icon-152x152.png +0 -0
  61. package/cjs/src/templates/app/public/icons/icon-192x192.png +0 -0
  62. package/cjs/src/templates/app/public/icons/icon-256x256.png +0 -0
  63. package/cjs/src/templates/app/public/icons/icon-384x384.png +0 -0
  64. package/cjs/src/templates/app/public/icons/icon-48x48.png +0 -0
  65. package/cjs/src/templates/app/public/icons/icon-512x512.png +0 -0
  66. package/cjs/src/templates/app/public/icons/icon-72x72.png +0 -0
  67. package/cjs/src/templates/app/public/icons/icon-96x96.png +0 -0
  68. package/cjs/src/templates/app/public/logo.svg +70 -0
  69. package/cjs/src/templates/app/ui/Footer.js +67 -0
  70. package/cjs/src/templates/app/ui/MainHeader.js +131 -0
  71. package/cjs/src/templates/crudPages/[__model__Id]/edit/page.js +73 -0
  72. package/cjs/src/templates/crudPages/[__model__Id]/page.js +83 -0
  73. package/cjs/src/templates/crudPages/new/page.js +70 -0
  74. package/cjs/src/templates/crudPages/page.js +71 -0
  75. package/cjs/src/templates/libRoot/lib/setting/Setting.Template.js +57 -0
  76. package/cjs/src/templates/libRoot/lib/setting/Setting.Unit.js +38 -0
  77. package/cjs/src/templates/libRoot/lib/setting/Setting.Util.js +34 -0
  78. package/cjs/src/templates/libRoot/lib/setting/Setting.View.js +51 -0
  79. package/cjs/src/templates/libRoot/lib/setting/Setting.Zone.js +80 -0
  80. package/cjs/src/templates/libRoot/lib/setting/index.js +61 -0
  81. package/cjs/src/templates/libRoot/lib/summary/Summary.Template.js +43 -0
  82. package/cjs/src/templates/libRoot/lib/summary/Summary.Unit.js +38 -0
  83. package/cjs/src/templates/libRoot/lib/summary/Summary.Util.js +33 -0
  84. package/cjs/src/templates/libRoot/lib/summary/Summary.View.js +51 -0
  85. package/cjs/src/templates/libRoot/lib/summary/Summary.Zone.js +62 -0
  86. package/cjs/src/templates/libRoot/lib/summary/index.js +67 -0
  87. package/cjs/src/templates/libRoot/lib/user/User.Template.js +65 -0
  88. package/cjs/src/templates/libRoot/lib/user/User.Unit.js +38 -0
  89. package/cjs/src/templates/libRoot/lib/user/User.Util.js +94 -0
  90. package/cjs/src/templates/libRoot/lib/user/User.View.js +66 -0
  91. package/cjs/src/templates/libRoot/lib/user/User.Zone.js +74 -0
  92. package/cjs/src/templates/libRoot/lib/user/index.js +61 -0
  93. package/cjs/src/templates/module/__Model__.Template.js +54 -0
  94. package/cjs/src/templates/module/__Model__.Unit.js +42 -0
  95. package/cjs/src/templates/module/__Model__.Util.js +70 -0
  96. package/cjs/src/templates/module/__Model__.View.js +48 -0
  97. package/cjs/src/templates/module/__Model__.Zone.js +83 -0
  98. package/cjs/src/templates/module/index.js +61 -0
  99. package/esm/index.js +17 -11
  100. package/esm/src/guidelines/componentRule/componentRule.generate.json +131 -0
  101. package/esm/src/guidelines/cssRule/cssRule.generate.json +93 -0
  102. package/esm/src/guidelines/databaseModule/databaseModule.generate.json +51 -0
  103. package/esm/src/guidelines/docPageRule/docPageRule.generate.json +72 -0
  104. package/esm/src/guidelines/enumConstant/enumConstant.generate.json +24 -0
  105. package/esm/src/guidelines/fieldDecorator/fieldDecorator.generate.json +135 -0
  106. package/esm/src/guidelines/framework/framework.generate.json +119 -0
  107. package/esm/src/guidelines/howToUseStore/howToUseStore.generate.json +0 -0
  108. package/esm/src/guidelines/modelConstant/modelConstant.generate.json +135 -0
  109. package/esm/src/guidelines/modelDictionary/modelDictionary.generate.json +115 -0
  110. package/esm/src/guidelines/modelDocument/modelDocument.generate.json +129 -0
  111. package/esm/src/guidelines/modelService/modelService.generate.json +179 -0
  112. package/esm/src/guidelines/modelSignal/modelSignal.generate.json +202 -0
  113. package/esm/src/guidelines/modelStore/modelStore.generate.json +130 -0
  114. package/esm/src/guidelines/modelTemplate/modelTemplate.generate.json +104 -0
  115. package/esm/src/guidelines/modelUnit/modelUnit.generate.json +92 -0
  116. package/esm/src/guidelines/modelUtil/modelUtil.generate.json +93 -0
  117. package/esm/src/guidelines/modelView/modelView.generate.json +80 -0
  118. package/esm/src/guidelines/modelZone/modelZone.generate.json +126 -0
  119. package/esm/src/guidelines/scalarConstant/scalarConstant.generate.json +102 -0
  120. package/esm/src/guidelines/scalarDictionary/scalarDictionary.generate.json +83 -0
  121. package/esm/src/guidelines/scalarModule/scalarModule.generate.json +35 -0
  122. package/esm/src/guidelines/sharedUiUsage/sharedUiUsage.generate.json +115 -0
  123. package/esm/src/guidelines/utilUiUsage/utilUiUsage.generate.json +140 -0
  124. package/esm/src/templates/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.js +27 -0
  125. package/esm/src/templates/app/app/[lang]/(__appName__)/(public)/page.js +108 -0
  126. package/esm/src/templates/app/app/[lang]/(__appName__)/(public)/privacy/page.js +22 -0
  127. package/esm/src/templates/app/app/[lang]/(__appName__)/(public)/signin/page.js +30 -0
  128. package/esm/src/templates/app/app/[lang]/(__appName__)/(public)/termsofservice/page.js +21 -0
  129. package/esm/src/templates/app/app/[lang]/(__appName__)/(public)/unknown/page.js +31 -0
  130. package/esm/src/templates/app/app/[lang]/(__appName__)/(user)/layout.js +23 -0
  131. package/esm/src/templates/app/app/[lang]/(__appName__)/(user)/self/page.js +40 -0
  132. package/esm/src/templates/app/app/[lang]/(__appName__)/layout.js +34 -0
  133. package/esm/src/templates/app/app/[lang]/admin/layout.js +34 -0
  134. package/esm/src/templates/app/app/[lang]/admin/page.js +43 -0
  135. package/esm/src/templates/app/app/csr.js +14 -0
  136. package/esm/src/templates/app/app/layout.js +18 -0
  137. package/esm/src/templates/app/lib/setting/Setting.Template.js +37 -0
  138. package/esm/src/templates/app/lib/setting/Setting.Unit.js +18 -0
  139. package/esm/src/templates/app/lib/setting/Setting.Util.js +14 -0
  140. package/esm/src/templates/app/lib/setting/Setting.View.js +31 -0
  141. package/esm/src/templates/app/lib/setting/Setting.Zone.js +60 -0
  142. package/esm/src/templates/app/lib/setting/index.js +41 -0
  143. package/esm/src/templates/app/lib/summary/Summary.Template.js +23 -0
  144. package/esm/src/templates/app/lib/summary/Summary.Unit.js +18 -0
  145. package/esm/src/templates/app/lib/summary/Summary.Util.js +13 -0
  146. package/esm/src/templates/app/lib/summary/Summary.View.js +31 -0
  147. package/esm/src/templates/app/lib/summary/Summary.Zone.js +42 -0
  148. package/esm/src/templates/app/lib/summary/index.js +47 -0
  149. package/esm/src/templates/app/lib/user/User.Template.js +45 -0
  150. package/esm/src/templates/app/lib/user/User.Unit.js +18 -0
  151. package/esm/src/templates/app/lib/user/User.Util.js +74 -0
  152. package/esm/src/templates/app/lib/user/User.View.js +46 -0
  153. package/esm/src/templates/app/lib/user/User.Zone.js +54 -0
  154. package/esm/src/templates/app/lib/user/index.js +41 -0
  155. package/esm/src/templates/app/public/favicon.ico +0 -0
  156. package/esm/src/templates/app/public/icons/icon-128x128.png +0 -0
  157. package/esm/src/templates/app/public/icons/icon-144x144.png +0 -0
  158. package/esm/src/templates/app/public/icons/icon-152x152.png +0 -0
  159. package/esm/src/templates/app/public/icons/icon-192x192.png +0 -0
  160. package/esm/src/templates/app/public/icons/icon-256x256.png +0 -0
  161. package/esm/src/templates/app/public/icons/icon-384x384.png +0 -0
  162. package/esm/src/templates/app/public/icons/icon-48x48.png +0 -0
  163. package/esm/src/templates/app/public/icons/icon-512x512.png +0 -0
  164. package/esm/src/templates/app/public/icons/icon-72x72.png +0 -0
  165. package/esm/src/templates/app/public/icons/icon-96x96.png +0 -0
  166. package/esm/src/templates/app/public/logo.svg +70 -0
  167. package/esm/src/templates/app/ui/Footer.js +47 -0
  168. package/esm/src/templates/app/ui/MainHeader.js +111 -0
  169. package/esm/src/templates/crudPages/[__model__Id]/edit/page.js +53 -0
  170. package/esm/src/templates/crudPages/[__model__Id]/page.js +63 -0
  171. package/esm/src/templates/crudPages/new/page.js +50 -0
  172. package/esm/src/templates/crudPages/page.js +51 -0
  173. package/esm/src/templates/libRoot/lib/setting/Setting.Template.js +37 -0
  174. package/esm/src/templates/libRoot/lib/setting/Setting.Unit.js +18 -0
  175. package/esm/src/templates/libRoot/lib/setting/Setting.Util.js +14 -0
  176. package/esm/src/templates/libRoot/lib/setting/Setting.View.js +31 -0
  177. package/esm/src/templates/libRoot/lib/setting/Setting.Zone.js +60 -0
  178. package/esm/src/templates/libRoot/lib/setting/index.js +41 -0
  179. package/esm/src/templates/libRoot/lib/summary/Summary.Template.js +23 -0
  180. package/esm/src/templates/libRoot/lib/summary/Summary.Unit.js +18 -0
  181. package/esm/src/templates/libRoot/lib/summary/Summary.Util.js +13 -0
  182. package/esm/src/templates/libRoot/lib/summary/Summary.View.js +31 -0
  183. package/esm/src/templates/libRoot/lib/summary/Summary.Zone.js +42 -0
  184. package/esm/src/templates/libRoot/lib/summary/index.js +47 -0
  185. package/esm/src/templates/libRoot/lib/user/User.Template.js +45 -0
  186. package/esm/src/templates/libRoot/lib/user/User.Unit.js +18 -0
  187. package/esm/src/templates/libRoot/lib/user/User.Util.js +74 -0
  188. package/esm/src/templates/libRoot/lib/user/User.View.js +46 -0
  189. package/esm/src/templates/libRoot/lib/user/User.Zone.js +54 -0
  190. package/esm/src/templates/libRoot/lib/user/index.js +41 -0
  191. package/esm/src/templates/module/__Model__.Template.js +34 -0
  192. package/esm/src/templates/module/__Model__.Unit.js +22 -0
  193. package/esm/src/templates/module/__Model__.Util.js +50 -0
  194. package/esm/src/templates/module/__Model__.View.js +28 -0
  195. package/esm/src/templates/module/__Model__.Zone.js +63 -0
  196. package/esm/src/templates/module/index.js +41 -0
  197. package/package.json +1 -1
  198. package/src/templates/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.d.ts +9 -0
  199. package/src/templates/app/app/[lang]/(__appName__)/(public)/page.d.ts +9 -0
  200. package/src/templates/app/app/[lang]/(__appName__)/(public)/privacy/page.d.ts +9 -0
  201. package/src/templates/app/app/[lang]/(__appName__)/(public)/signin/page.d.ts +9 -0
  202. package/src/templates/app/app/[lang]/(__appName__)/(public)/termsofservice/page.d.ts +10 -0
  203. package/src/templates/app/app/[lang]/(__appName__)/(public)/unknown/page.d.ts +9 -0
  204. package/src/templates/app/app/[lang]/(__appName__)/(user)/layout.d.ts +9 -0
  205. package/src/templates/app/app/[lang]/(__appName__)/(user)/self/page.d.ts +9 -0
  206. package/src/templates/app/app/[lang]/(__appName__)/layout.d.ts +9 -0
  207. package/src/templates/app/app/[lang]/admin/layout.d.ts +9 -0
  208. package/src/templates/app/app/[lang]/admin/page.d.ts +9 -0
  209. package/src/templates/app/app/csr.d.ts +9 -0
  210. package/src/templates/app/app/layout.d.ts +9 -0
  211. package/src/templates/app/lib/setting/Setting.Template.d.ts +9 -0
  212. package/src/templates/app/lib/setting/Setting.Unit.d.ts +9 -0
  213. package/src/templates/app/lib/setting/Setting.Util.d.ts +9 -0
  214. package/src/templates/app/lib/setting/Setting.View.d.ts +9 -0
  215. package/src/templates/app/lib/setting/Setting.Zone.d.ts +9 -0
  216. package/src/templates/app/lib/setting/index.d.ts +9 -0
  217. package/src/templates/app/lib/summary/Summary.Template.d.ts +9 -0
  218. package/src/templates/app/lib/summary/Summary.Unit.d.ts +9 -0
  219. package/src/templates/app/lib/summary/Summary.Util.d.ts +9 -0
  220. package/src/templates/app/lib/summary/Summary.View.d.ts +9 -0
  221. package/src/templates/app/lib/summary/Summary.Zone.d.ts +9 -0
  222. package/src/templates/app/lib/summary/index.d.ts +9 -0
  223. package/src/templates/app/lib/user/User.Template.d.ts +9 -0
  224. package/src/templates/app/lib/user/User.Unit.d.ts +9 -0
  225. package/src/templates/app/lib/user/User.Util.d.ts +9 -0
  226. package/src/templates/app/lib/user/User.View.d.ts +9 -0
  227. package/src/templates/app/lib/user/User.Zone.d.ts +9 -0
  228. package/src/templates/app/lib/user/index.d.ts +9 -0
  229. package/src/templates/app/ui/Footer.d.ts +9 -0
  230. package/src/templates/app/ui/MainHeader.d.ts +10 -0
  231. package/src/templates/crudPages/[__model__Id]/edit/page.d.ts +11 -0
  232. package/src/templates/crudPages/[__model__Id]/page.d.ts +11 -0
  233. package/src/templates/crudPages/new/page.d.ts +11 -0
  234. package/src/templates/crudPages/page.d.ts +11 -0
  235. package/src/templates/libRoot/lib/setting/Setting.Template.d.ts +9 -0
  236. package/src/templates/libRoot/lib/setting/Setting.Unit.d.ts +9 -0
  237. package/src/templates/libRoot/lib/setting/Setting.Util.d.ts +9 -0
  238. package/src/templates/libRoot/lib/setting/Setting.View.d.ts +9 -0
  239. package/src/templates/libRoot/lib/setting/Setting.Zone.d.ts +9 -0
  240. package/src/templates/libRoot/lib/setting/index.d.ts +9 -0
  241. package/src/templates/libRoot/lib/summary/Summary.Template.d.ts +9 -0
  242. package/src/templates/libRoot/lib/summary/Summary.Unit.d.ts +9 -0
  243. package/src/templates/libRoot/lib/summary/Summary.Util.d.ts +9 -0
  244. package/src/templates/libRoot/lib/summary/Summary.View.d.ts +9 -0
  245. package/src/templates/libRoot/lib/summary/Summary.Zone.d.ts +9 -0
  246. package/src/templates/libRoot/lib/summary/index.d.ts +9 -0
  247. package/src/templates/libRoot/lib/user/User.Template.d.ts +9 -0
  248. package/src/templates/libRoot/lib/user/User.Unit.d.ts +9 -0
  249. package/src/templates/libRoot/lib/user/User.Util.d.ts +9 -0
  250. package/src/templates/libRoot/lib/user/User.View.d.ts +9 -0
  251. package/src/templates/libRoot/lib/user/User.Zone.d.ts +9 -0
  252. package/src/templates/libRoot/lib/user/index.d.ts +9 -0
  253. package/src/templates/module/__Model__.Template.d.ts +11 -0
  254. package/src/templates/module/__Model__.Unit.d.ts +11 -0
  255. package/src/templates/module/__Model__.Util.d.ts +11 -0
  256. package/src/templates/module/__Model__.View.d.ts +11 -0
  257. package/src/templates/module/__Model__.Zone.d.ts +11 -0
  258. package/src/templates/module/index.d.ts +11 -0
@@ -0,0 +1,23 @@
1
+ // pkgs/@akanjs/cli/src/templates/libRoot/lib/summary/Summary.Template.tsx
2
+ function getContent(scanResult, dict) {
3
+ return {
4
+ filename: "Summary.Template.tsx",
5
+ content: `
6
+ "use client";
7
+ import { st, usePage } from "@${dict.appName}/client";
8
+
9
+ interface SummaryEditProps {
10
+ summaryId?: string | null;
11
+ }
12
+
13
+ export const General = ({ summaryId = undefined }: SummaryEditProps) => {
14
+ const summaryForm = st.use.summaryForm();
15
+ const { l } = usePage();
16
+ return <div className="flex items-center mb-4"></div>;
17
+ };
18
+ `
19
+ };
20
+ }
21
+ export {
22
+ getContent as default
23
+ };
@@ -0,0 +1,18 @@
1
+ // pkgs/@akanjs/cli/src/templates/libRoot/lib/summary/Summary.Unit.tsx
2
+ function getContent(scanResult, dict = {}) {
3
+ return {
4
+ filename: "Summary.Unit.tsx",
5
+ content: `
6
+ import { ModelProps } from "@akanjs/client";
7
+
8
+ import { cnst } from "../cnst";
9
+
10
+ export const Card = ({ className, summary }: ModelProps<"summary", cnst.LightSummary>) => {
11
+ return <div>{summary.id}</div>;
12
+ };
13
+ `
14
+ };
15
+ }
16
+ export {
17
+ getContent as default
18
+ };
@@ -0,0 +1,13 @@
1
+ // pkgs/@akanjs/cli/src/templates/libRoot/lib/summary/Summary.Util.tsx
2
+ function getContent(scanResult, dict = {}) {
3
+ return {
4
+ filename: "Summary.Util.tsx",
5
+ content: `
6
+ "use client";
7
+ export const noData = 1;
8
+ `
9
+ };
10
+ }
11
+ export {
12
+ getContent as default
13
+ };
@@ -0,0 +1,31 @@
1
+ // pkgs/@akanjs/cli/src/templates/libRoot/lib/summary/Summary.View.tsx
2
+ function getContent(scanResult, dict) {
3
+ return {
4
+ filename: "Summary.View.tsx",
5
+ content: `
6
+ import { User, usePage } from "@${dict.libName}/client";
7
+ import { clsx } from "@akanjs/client";
8
+
9
+ import { cnst } from "../cnst";
10
+
11
+ interface SummaryViewProps {
12
+ className?: string;
13
+ summary: cnst.Summary;
14
+ }
15
+
16
+ export const General = ({ className, summary }: SummaryViewProps) => {
17
+ const { l } = usePage();
18
+ return (
19
+ <div className={clsx(className, "mr-12")}>
20
+ <div className="grid grid-cols-5 gap-4">
21
+ <User.Util.Stat className="col-span-2 " summary={summary} />
22
+ </div>
23
+ </div>
24
+ );
25
+ };
26
+ `
27
+ };
28
+ }
29
+ export {
30
+ getContent as default
31
+ };
@@ -0,0 +1,42 @@
1
+ // pkgs/@akanjs/cli/src/templates/libRoot/lib/summary/Summary.Zone.tsx
2
+ function getContent(scanResult, dict) {
3
+ return {
4
+ filename: "Summary.Zone.tsx",
5
+ content: `
6
+ "use client";
7
+ import { ModelsProps } from "@akanjs/client";
8
+ import { DefaultOf } from "@akanjs/signal";
9
+ import { st, Summary } from "@${dict.libName}/client";
10
+ import { Data } from "@shared/ui";
11
+ import { Loading } from "@util/ui";
12
+
13
+ import { cnst } from "../cnst";
14
+
15
+ export const Admin = ({ sliceName = "summary", init, query }: ModelsProps<cnst.Summary>) => {
16
+ return (
17
+ <Data.ListContainer
18
+ init={init}
19
+ query={query}
20
+ sliceName={sliceName}
21
+ renderItem={Summary.Unit.Card}
22
+ renderTemplate={Summary.Template.General}
23
+ renderTitle={(summary: DefaultOf<cnst.Summary>) => \`\${summary.at}\`}
24
+ renderView={(summary: cnst.Summary) => <Summary.View.General summary={summary} />}
25
+ type="list"
26
+ columns={["type", "status", "createdAt"]}
27
+ actions={(summary: cnst.LightSummary, idx) => ["remove", "edit"]}
28
+ />
29
+ );
30
+ };
31
+
32
+ export const Dashboard = () => {
33
+ const summary = st.use.summary();
34
+ if (!summary) return <Loading.Skeleton active />;
35
+ return <Summary.View.General summary={summary} />;
36
+ };
37
+ `
38
+ };
39
+ }
40
+ export {
41
+ getContent as default
42
+ };
@@ -0,0 +1,47 @@
1
+ // pkgs/@akanjs/cli/src/templates/libRoot/lib/summary/index.tsx
2
+ function getContent(scanResult, dict = {}) {
3
+ return {
4
+ filename: "index.tsx",
5
+ content: `
6
+ import { Signal } from "@util/ui";
7
+ import { AiOutlineLineChart } from "react-icons/ai";
8
+
9
+ import * as Template from "./Summary.Template";
10
+ import * as Unit from "./Summary.Unit";
11
+ import * as Util from "./Summary.Util";
12
+ import * as View from "./Summary.View";
13
+ import * as Zone from "./Summary.Zone";
14
+
15
+ export const Summary = {
16
+ Menu: {
17
+ Admin: {
18
+ key: "summary",
19
+ label: "Summary",
20
+ icon: <AiOutlineLineChart />,
21
+ render: () => <Zone.Admin />,
22
+ },
23
+ Doc: {
24
+ key: "summary",
25
+ label: "Summary",
26
+ icon: <AiOutlineLineChart />,
27
+ render: () => <Signal.Doc.Zone refName="summary" />,
28
+ },
29
+ Dashboard: {
30
+ key: "summary",
31
+ label: "Summary",
32
+ icon: <AiOutlineLineChart />,
33
+ render: () => <Zone.Dashboard />,
34
+ },
35
+ },
36
+ Template,
37
+ Unit,
38
+ Util,
39
+ View,
40
+ Zone,
41
+ };
42
+ `
43
+ };
44
+ }
45
+ export {
46
+ getContent as default
47
+ };
@@ -0,0 +1,45 @@
1
+ // pkgs/@akanjs/cli/src/templates/libRoot/lib/user/User.Template.tsx
2
+ function getContent(scanResult, dict) {
3
+ return {
4
+ filename: "User.Template.tsx",
5
+ content: `
6
+ "use client";
7
+ import { clsx } from "@akanjs/client";
8
+ import { Field } from "@shared/ui";
9
+ import { Layout } from "@util/ui";
10
+ import { st, usePage } from "@${dict.libName}/client";
11
+
12
+ interface UserEditProps {
13
+ className?: string;
14
+ userId?: string | null;
15
+ }
16
+
17
+ export const General = ({ className, userId = undefined }: UserEditProps) => {
18
+ const userForm = st.use.userForm();
19
+ const { l } = usePage();
20
+ return (
21
+ <Layout.Template className={clsx("flex flex-col gap-4", className)}>
22
+ <div className="w-[150px] flex mt-10 md:mt-0">
23
+ <Field.Img
24
+ label={l.field("user", "image")}
25
+ desc={l.desc("user", "image")}
26
+ sliceName="user"
27
+ value={userForm.image}
28
+ onChange={st.do.setImageOnUser}
29
+ />
30
+ </div>
31
+ <Field.Text
32
+ label={l.field("user", "nickname")}
33
+ desc={l.desc("user", "nickname")}
34
+ value={userForm.nickname}
35
+ onChange={st.do.setNicknameOnUser}
36
+ />
37
+ </Layout.Template>
38
+ );
39
+ };
40
+ `
41
+ };
42
+ }
43
+ export {
44
+ getContent as default
45
+ };
@@ -0,0 +1,18 @@
1
+ // pkgs/@akanjs/cli/src/templates/libRoot/lib/user/User.Unit.tsx
2
+ function getContent(scanResult, dict = {}) {
3
+ return {
4
+ filename: "User.Unit.tsx",
5
+ content: `
6
+ import { ModelProps } from "@akanjs/client";
7
+
8
+ import { cnst } from "../cnst";
9
+
10
+ export const Card = ({ className, user }: ModelProps<"user", cnst.LightUser>) => {
11
+ return <div>{user.id}</div>;
12
+ };
13
+ `
14
+ };
15
+ }
16
+ export {
17
+ getContent as default
18
+ };
@@ -0,0 +1,74 @@
1
+ // pkgs/@akanjs/cli/src/templates/libRoot/lib/user/User.Util.tsx
2
+ function getContent(scanResult, dict) {
3
+ return {
4
+ filename: "User.Util.tsx",
5
+ content: `
6
+ "use client";
7
+ import { ModelDashboardProps, ModelInsightProps } from "@akanjs/client";
8
+ import { getQueryMap } from "@akanjs/constant";
9
+ import { cnst, st } from "@${dict.libName}/client";
10
+ import { Data } from "@shared/ui";
11
+ import { AiOutlineEdit, AiOutlineLock, AiOutlineUnlock } from "react-icons/ai";
12
+
13
+ export const Stat = ({
14
+ className,
15
+ summary,
16
+ sliceName = "user",
17
+ queryMap = getQueryMap(cnst.UserSummary),
18
+ hidePresents,
19
+ }: ModelDashboardProps<cnst.Summary>) => {
20
+ return (
21
+ <Data.Dashboard
22
+ className={className}
23
+ summary={summary}
24
+ sliceName={sliceName}
25
+ queryMap={queryMap}
26
+ columns={["totalUser", "dau"]}
27
+ hidePresents={hidePresents}
28
+ />
29
+ );
30
+ };
31
+ export const Insight = ({ className, insight, sliceName = "user" }: ModelInsightProps<cnst.UserInsight>) => {
32
+ return <Data.Insight className={className} insight={insight} sliceName={sliceName} columns={["count"]} />;
33
+ };
34
+
35
+ interface RestrictProps {
36
+ id: string;
37
+ }
38
+ export const Restrict = ({ id }: RestrictProps) => {
39
+ return (
40
+ <button className="gap-2 btn btn-sm" onClick={() => st.do.restrictUser(id, "Violated Community Guidelines")}>
41
+ <AiOutlineLock />
42
+ Restrict
43
+ </button>
44
+ );
45
+ };
46
+
47
+ interface ReleaseProps {
48
+ id: string;
49
+ }
50
+ export const Release = ({ id }: ReleaseProps) => {
51
+ return (
52
+ <button className="gap-2 border-dashed btn btn-sm btn-outline" onClick={() => st.do.releaseUser(id)}>
53
+ <AiOutlineUnlock />
54
+ Release
55
+ </button>
56
+ );
57
+ };
58
+
59
+ export const EditSelf = () => {
60
+ const self = st.use.self();
61
+ const userModal = st.use.userModal();
62
+ return userModal !== "edit" ? (
63
+ <button className="gap-2 btn" onClick={() => st.do.editUser(self)}>
64
+ <AiOutlineEdit />
65
+ Edit
66
+ </button>
67
+ ) : null;
68
+ };
69
+ `
70
+ };
71
+ }
72
+ export {
73
+ getContent as default
74
+ };
@@ -0,0 +1,46 @@
1
+ // pkgs/@akanjs/cli/src/templates/libRoot/lib/user/User.View.tsx
2
+ function getContent(scanResult, dict) {
3
+ return {
4
+ filename: "User.View.tsx",
5
+ content: `
6
+ import { clsx } from "@akanjs/client";
7
+ import { usePage } from "@${dict.libName}/client";
8
+ import { Avatar } from "@util/ui";
9
+ import { AiOutlineUser } from "react-icons/ai";
10
+
11
+ import { cnst } from "../cnst";
12
+
13
+ interface UserViewProps {
14
+ className?: string;
15
+ user: cnst.User;
16
+ }
17
+
18
+ export const General = ({ className, user }: UserViewProps) => {
19
+ const { l } = usePage();
20
+ return (
21
+ <div className={clsx("flex flex-col gap-4", className)}>
22
+ <div>
23
+ <div className="font-bold">Profile</div>
24
+ <div className="text-base">
25
+ <Avatar
26
+ className="flex items-center justify-center w-24 h-24"
27
+ icon={<AiOutlineUser className="text-4xl" />}
28
+ src={user.image?.url}
29
+ />
30
+ </div>
31
+ </div>
32
+ <div>
33
+ <div className="flex gap-2 items-center">
34
+ <div className="font-bold">Nickname</div>
35
+ </div>
36
+ <p className="text-base">{user.nickname}</p>
37
+ </div>
38
+ </div>
39
+ );
40
+ };
41
+ `
42
+ };
43
+ }
44
+ export {
45
+ getContent as default
46
+ };
@@ -0,0 +1,54 @@
1
+ // pkgs/@akanjs/cli/src/templates/libRoot/lib/user/User.Zone.tsx
2
+ function getContent(scanResult, dict) {
3
+ return {
4
+ filename: "User.Zone.tsx",
5
+ content: `
6
+ "use client";
7
+ import { ModelsProps } from "@akanjs/client";
8
+ import { DefaultOf } from "@akanjs/signal";
9
+ import { cnst, st, User } from "@${dict.libName}/client";
10
+ import { Data, Model } from "@shared/ui";
11
+
12
+ export const Admin = ({ sliceName = "user", init, query }: ModelsProps<cnst.User>) => {
13
+ return (
14
+ <Data.ListContainer
15
+ init={init}
16
+ query={query}
17
+ sliceName={sliceName}
18
+ renderItem={User.Unit.Card}
19
+ renderDashboard={User.Util.Stat}
20
+ renderInsight={User.Util.Insight}
21
+ renderTemplate={User.Template.General}
22
+ renderTitle={(user: DefaultOf<cnst.User>) => \`\${user.nickname}\`}
23
+ renderView={(user: cnst.User) => <User.View.General user={user} />}
24
+ type="list"
25
+ columns={["nickname", "status", "lastLoginAt", "createdAt"]}
26
+ actions={(user: cnst.LightUser, idx) => [
27
+ "remove",
28
+ "edit",
29
+ "view",
30
+ user.status === "active"
31
+ ? { type: "restrict", render: () => <User.Util.Restrict id={user.id} /> }
32
+ : { type: "release", render: () => <User.Util.Release id={user.id} /> },
33
+ ]}
34
+ />
35
+ );
36
+ };
37
+
38
+ export const Self = () => {
39
+ const self = st.use.self();
40
+ const userModal = st.use.userModal();
41
+ return userModal === "edit" ? (
42
+ <Model.EditModal type="form" sliceName="user" submitOption={{ path: "self" }}>
43
+ <User.Template.General />
44
+ </Model.EditModal>
45
+ ) : (
46
+ <User.View.General user={self} />
47
+ );
48
+ };
49
+ `
50
+ };
51
+ }
52
+ export {
53
+ getContent as default
54
+ };
@@ -0,0 +1,41 @@
1
+ // pkgs/@akanjs/cli/src/templates/libRoot/lib/user/index.tsx
2
+ function getContent(scanResult, dict = {}) {
3
+ return {
4
+ filename: "index.tsx",
5
+ content: `
6
+ import { Signal } from "@util/ui";
7
+ import { AiOutlineUser } from "react-icons/ai";
8
+
9
+ import * as Template from "./User.Template";
10
+ import * as Unit from "./User.Unit";
11
+ import * as Util from "./User.Util";
12
+ import * as View from "./User.View";
13
+ import * as Zone from "./User.Zone";
14
+
15
+ export const User = {
16
+ Menu: {
17
+ Admin: {
18
+ key: "user",
19
+ label: "User",
20
+ icon: <AiOutlineUser />,
21
+ render: () => <Zone.Admin />,
22
+ },
23
+ Doc: {
24
+ key: "user",
25
+ label: "User",
26
+ icon: <AiOutlineUser />,
27
+ render: () => <Signal.Doc.Zone refName="user" />,
28
+ },
29
+ },
30
+ Template,
31
+ Unit,
32
+ Util,
33
+ View,
34
+ Zone,
35
+ };
36
+ `
37
+ };
38
+ }
39
+ export {
40
+ getContent as default
41
+ };
@@ -0,0 +1,34 @@
1
+ // pkgs/@akanjs/cli/src/templates/module/__Model__.Template.tsx
2
+ function getContent(scanResult, dict) {
3
+ return {
4
+ filename: `${dict.Model}.Template.tsx`,
5
+ content: `
6
+ "use client";
7
+ import { cnst, st, usePage } from "@${dict.sysName}/client";
8
+ import { Field } from "@shared/ui";
9
+ import { Layout } from "@util/ui";
10
+
11
+ interface ${dict.Model}EditProps {
12
+ ${dict.model}Id?: string | null;
13
+ }
14
+
15
+ export const General = ({ ${dict.model}Id = undefined }: ${dict.Model}EditProps) => {
16
+ const ${dict.model}Form = st.use.${dict.model}Form();
17
+ const { l } = usePage();
18
+ return (
19
+ <Layout.Template>
20
+ <Field.Text
21
+ label={l.field("${dict.model}", "id")}
22
+ desc={l.desc("${dict.model}", "id")}
23
+ value={${dict.model}Form.id}
24
+ onChange={st.do.setIdOn${dict.Model}}
25
+ />
26
+ </Layout.Template>
27
+ );
28
+ };
29
+ `
30
+ };
31
+ }
32
+ export {
33
+ getContent as default
34
+ };
@@ -0,0 +1,22 @@
1
+ // pkgs/@akanjs/cli/src/templates/module/__Model__.Unit.tsx
2
+ function getContent(scanResult, dict) {
3
+ return {
4
+ filename: `${dict.Model}.Unit.tsx`,
5
+ content: `
6
+ import { ModelProps } from "@akanjs/client";
7
+ import { cnst, ${dict.Model} } from "@${dict.sysName}/client";
8
+ import { Link } from "@util/ui";
9
+
10
+ export const Card = ({ ${dict.model}, href }: ModelProps<"${dict.model}", cnst.Light${dict.Model}>) => {
11
+ return (
12
+ <Link href={href} className="animate-fadeIn w-full h-36 flex rounded-lg shadow-sm hover:shadow-lg duration-300">
13
+ <div>{${dict.model}.id}</div>
14
+ </Link>
15
+ );
16
+ };
17
+ `
18
+ };
19
+ }
20
+ export {
21
+ getContent as default
22
+ };
@@ -0,0 +1,50 @@
1
+ // pkgs/@akanjs/cli/src/templates/module/__Model__.Util.tsx
2
+ function getContent(scanResult, dict) {
3
+ return {
4
+ filename: `${dict.Model}.Util.tsx`,
5
+ content: `
6
+ "use client";
7
+ import { ModelDashboardProps, ModelInsightProps } from "@akanjs/client";
8
+ import { getQueryMap } from "@akanjs/constant";
9
+ import { cnst } from "@${dict.sysName}/client";
10
+ import { Data } from "@shared/ui";
11
+
12
+ export const Stat = ({
13
+ className,
14
+ summary,
15
+ sliceName = "${dict.model}",
16
+ queryMap = getQueryMap(cnst.${dict.Model}Summary),
17
+ hidePresents,
18
+ }: ModelDashboardProps<cnst.Summary>) => {
19
+ return (
20
+ <Data.Dashboard
21
+ className={className}
22
+ summary={summary}
23
+ sliceName={sliceName}
24
+ queryMap={queryMap}
25
+ columns={["total${dict.Model}"]}
26
+ hidePresents={hidePresents}
27
+ />
28
+ );
29
+ };
30
+
31
+ export const Insight = ({
32
+ className,
33
+ insight,
34
+ sliceName = "${dict.model}",
35
+ }: ModelInsightProps<cnst.${dict.Model}Insight>) => {
36
+ return (
37
+ <Data.Insight
38
+ className={className}
39
+ insight={insight}
40
+ sliceName={sliceName}
41
+ columns={["count"]}
42
+ />
43
+ );
44
+ };
45
+ `
46
+ };
47
+ }
48
+ export {
49
+ getContent as default
50
+ };
@@ -0,0 +1,28 @@
1
+ // pkgs/@akanjs/cli/src/templates/module/__Model__.View.tsx
2
+ function getContent(scanResult, dict) {
3
+ return {
4
+ filename: `${dict.Model}.View.tsx`,
5
+ content: `
6
+ import { clsx } from "@akanjs/client";
7
+ import { cnst } from "@${dict.sysName}/client";
8
+ import { Image } from "@util/ui";
9
+
10
+ interface ${dict.Model}ViewProps {
11
+ className?: string;
12
+ ${dict.model}: cnst.${dict.Model};
13
+ self?: { id?: string } | null;
14
+ }
15
+
16
+ export const General = ({ className, ${dict.model}, self }: ${dict.Model}ViewProps) => {
17
+ return (
18
+ <div className={clsx(className, "animate-fadeIn w-full")}>
19
+ <div>{${dict.model}.id}</div>
20
+ </div>
21
+ );
22
+ };
23
+ `
24
+ };
25
+ }
26
+ export {
27
+ getContent as default
28
+ };
@@ -0,0 +1,63 @@
1
+ // pkgs/@akanjs/cli/src/templates/module/__Model__.Zone.tsx
2
+ function getContent(scanResult, dict) {
3
+ return {
4
+ filename: `${dict.Model}.Zone.tsx`,
5
+ content: `
6
+ "use client";
7
+ import { Data, Load } from "@shared/ui";
8
+ import { ModelsProps } from "@akanjs/client";
9
+ import { cnst, ${dict.Model} } from "@${dict.sysName}/client";
10
+ import { ClientInit, ClientView, DefaultOf } from "@akanjs/signal";
11
+
12
+ export const Admin = ({ sliceName = "${dict.model}", init, query }: ModelsProps<cnst.${dict.Model}>) => {
13
+ return (
14
+ <Data.ListContainer
15
+ init={init}
16
+ query={query}
17
+ sliceName={sliceName}
18
+ renderItem={${dict.Model}.Unit.Card}
19
+ renderDashboard={${dict.Model}.Util.Stat}
20
+ renderInsight={${dict.Model}.Util.Insight}
21
+ renderTemplate={${dict.Model}.Template.General}
22
+ renderTitle={(${dict.model}: DefaultOf<cnst.${dict.Model}>) => \`${dict.Model} - \${${dict.model}.id ? ${dict.model}.id : "New"}\`}
23
+ renderView={(${dict.model}: cnst.${dict.Model}) => <${dict.Model}.View.General ${dict.model}={${dict.model}} />}
24
+ columns={[
25
+ "id",
26
+ "status",
27
+ "createdAt",
28
+ "updatedAt",
29
+ ]}
30
+ actions={(${dict.model}: cnst.Light${dict.Model}, idx) => ["remove", "edit", "view"]}
31
+ />
32
+ );
33
+ };
34
+
35
+ interface CardProps {
36
+ className?: string;
37
+ init: ClientInit<"${dict.model}", cnst.Light${dict.Model}>;
38
+ }
39
+ export const Card = ({ className, init }: CardProps) => {
40
+ return (
41
+ <Load.Units
42
+ className={className}
43
+ init={init}
44
+ renderItem={(${dict.model}: cnst.Light${dict.Model}) => (
45
+ <${dict.Model}.Unit.Card key={${dict.model}.id} href={\`/${dict.model}/\${${dict.model}.id}\`} ${dict.model}={${dict.model}} />
46
+ )}
47
+ />
48
+ );
49
+ };
50
+
51
+ interface ViewProps {
52
+ className?: string;
53
+ view: ClientView<"${dict.model}", cnst.${dict.Model}>;
54
+ }
55
+ export const View = ({ view }: ViewProps) => {
56
+ return <Load.View view={view} renderView={(${dict.model}) => <${dict.Model}.View.General ${dict.model}={${dict.model}} />} />;
57
+ };
58
+ `
59
+ };
60
+ }
61
+ export {
62
+ getContent as default
63
+ };