@akanjs/cli 0.0.42 → 0.0.44

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 (157) hide show
  1. package/index.js +126 -95
  2. package/package.json +1 -1
  3. package/src/templates/__scalar/__model__/__model__.constant.js +36 -0
  4. package/src/templates/__scalar/__model__/__model__.dictionary.js +47 -0
  5. package/src/templates/__scalar/__model__/__model__.document.js +34 -0
  6. package/src/templates/app/akan.config.ts.template +5 -0
  7. package/src/templates/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.js +45 -0
  8. package/src/templates/app/app/[lang]/(__appName__)/(public)/page.js +46 -0
  9. package/src/templates/app/app/[lang]/(__appName__)/(public)/privacy/page.js +40 -0
  10. package/src/templates/app/app/[lang]/(__appName__)/(public)/signin/page.js +48 -0
  11. package/src/templates/app/app/[lang]/(__appName__)/(public)/termsofservice/page.js +39 -0
  12. package/src/templates/app/app/[lang]/(__appName__)/(user)/layout.js +41 -0
  13. package/src/templates/app/app/[lang]/(__appName__)/(user)/self/page.js +58 -0
  14. package/src/templates/app/app/[lang]/(__appName__)/layout.js +50 -0
  15. package/src/templates/app/app/[lang]/admin/layout.js +51 -0
  16. package/src/templates/app/app/[lang]/admin/page.js +61 -0
  17. package/src/templates/app/app/csr.js +32 -0
  18. package/src/templates/app/app/index.html.template +13 -0
  19. package/src/templates/app/app/layout.js +36 -0
  20. package/src/templates/app/app/robots.js +41 -0
  21. package/src/templates/app/app/sitemap.js +37 -0
  22. package/src/templates/app/base/baseLogic.js +36 -0
  23. package/src/templates/app/base/index.js +30 -0
  24. package/src/templates/app/capacitor.config.ts.template +8 -0
  25. package/src/templates/app/common/commonLogic.js +36 -0
  26. package/src/templates/app/common/index.js +30 -0
  27. package/src/templates/app/env/env.client.js +39 -0
  28. package/src/templates/app/env/env.client.type.js +36 -0
  29. package/src/templates/app/env/env.server.js +39 -0
  30. package/src/templates/app/jest.config.js +37 -0
  31. package/src/templates/app/lib/___appName__/__appName__.dictionary.js +32 -0
  32. package/src/templates/app/lib/___appName__/__appName__.service.js +43 -0
  33. package/src/templates/app/lib/___appName__/__appName__.store.js +37 -0
  34. package/src/templates/app/lib/___appName__/_server.js +35 -0
  35. package/src/templates/app/lib/option.js +43 -0
  36. package/src/templates/app/lib/setting/Setting.Template.js +55 -0
  37. package/src/templates/app/lib/setting/Setting.Unit.js +36 -0
  38. package/src/templates/app/lib/setting/Setting.Util.js +32 -0
  39. package/src/templates/app/lib/setting/Setting.View.js +49 -0
  40. package/src/templates/app/lib/setting/Setting.Zone.js +78 -0
  41. package/src/templates/app/lib/setting/_server.js +49 -0
  42. package/src/templates/app/lib/setting/index.js +59 -0
  43. package/src/templates/app/lib/setting/setting.constant.js +47 -0
  44. package/src/templates/app/lib/setting/setting.dictionary.js +47 -0
  45. package/src/templates/app/lib/setting/setting.document.js +49 -0
  46. package/src/templates/app/lib/setting/setting.service.js +38 -0
  47. package/src/templates/app/lib/setting/setting.signal.js +35 -0
  48. package/src/templates/app/lib/setting/setting.store.js +42 -0
  49. package/src/templates/app/lib/summary/Summary.Template.js +41 -0
  50. package/src/templates/app/lib/summary/Summary.Unit.js +36 -0
  51. package/src/templates/app/lib/summary/Summary.Util.js +31 -0
  52. package/src/templates/app/lib/summary/Summary.View.js +49 -0
  53. package/src/templates/app/lib/summary/Summary.Zone.js +60 -0
  54. package/src/templates/app/lib/summary/_server.js +49 -0
  55. package/src/templates/app/lib/summary/index.js +65 -0
  56. package/src/templates/app/lib/summary/summary.constant.js +45 -0
  57. package/src/templates/app/lib/summary/summary.dictionary.js +50 -0
  58. package/src/templates/app/lib/summary/summary.document.js +49 -0
  59. package/src/templates/app/lib/summary/summary.service.js +35 -0
  60. package/src/templates/app/lib/summary/summary.signal.js +35 -0
  61. package/src/templates/app/lib/summary/summary.store.js +42 -0
  62. package/src/templates/app/lib/user/User.Template.js +63 -0
  63. package/src/templates/app/lib/user/User.Unit.js +36 -0
  64. package/src/templates/app/lib/user/User.Util.js +92 -0
  65. package/src/templates/app/lib/user/User.View.js +64 -0
  66. package/src/templates/app/lib/user/User.Zone.js +72 -0
  67. package/src/templates/app/lib/user/_server.js +49 -0
  68. package/src/templates/app/lib/user/index.js +59 -0
  69. package/src/templates/app/lib/user/user.constant.js +68 -0
  70. package/src/templates/app/lib/user/user.dictionary.js +53 -0
  71. package/src/templates/app/lib/user/user.document.js +55 -0
  72. package/src/templates/app/lib/user/user.service.js +43 -0
  73. package/src/templates/app/lib/user/user.signal.js +35 -0
  74. package/src/templates/app/lib/user/user.signal.spec.js +38 -0
  75. package/src/templates/app/lib/user/user.signal.test.js +40 -0
  76. package/src/templates/app/lib/user/user.store.js +40 -0
  77. package/src/templates/app/main.js +41 -0
  78. package/src/templates/app/middleware.js +36 -0
  79. package/src/templates/app/nest/backendLogic.js +35 -0
  80. package/src/templates/app/nest/index.js +30 -0
  81. package/src/templates/app/next/frontendLogic.js +35 -0
  82. package/src/templates/app/next/index.js +30 -0
  83. package/src/templates/app/page.test.ts.template +10 -0
  84. package/src/templates/app/playwright.config.ts.template +6 -0
  85. package/src/templates/app/postcss.config.js.template +10 -0
  86. package/src/templates/app/public/favicon.ico +0 -0
  87. package/src/templates/app/public/icons/icon-128x128.png +0 -0
  88. package/src/templates/app/public/icons/icon-144x144.png +0 -0
  89. package/src/templates/app/public/icons/icon-152x152.png +0 -0
  90. package/src/templates/app/public/icons/icon-192x192.png +0 -0
  91. package/src/templates/app/public/icons/icon-256x256.png +0 -0
  92. package/src/templates/app/public/icons/icon-384x384.png +0 -0
  93. package/src/templates/app/public/icons/icon-48x48.png +0 -0
  94. package/src/templates/app/public/icons/icon-512x512.png +0 -0
  95. package/src/templates/app/public/icons/icon-72x72.png +0 -0
  96. package/src/templates/app/public/icons/icon-96x96.png +0 -0
  97. package/src/templates/app/public/logo.svg +70 -0
  98. package/src/templates/app/public/manifest.json.template +67 -0
  99. package/src/templates/app/tsconfig.json.template +22 -0
  100. package/src/templates/app/tsconfig.spec.json.template +7 -0
  101. package/src/templates/app/ui/Footer.js +65 -0
  102. package/src/templates/app/ui/MainHeader.js +129 -0
  103. package/src/templates/app/ui/index.js +31 -0
  104. package/src/templates/client.js +43 -0
  105. package/src/templates/crudPages/[__model__Id]/edit/page.js +71 -0
  106. package/src/templates/crudPages/[__model__Id]/page.js +81 -0
  107. package/src/templates/crudPages/new/page.js +68 -0
  108. package/src/templates/crudPages/page.js +69 -0
  109. package/src/templates/index.js +32 -0
  110. package/src/templates/lib/__lib/extends/summary.constant.js +44 -0
  111. package/src/templates/lib/__lib/lib.constant.js +54 -0
  112. package/src/templates/lib/__lib/lib.dictionary.js +43 -0
  113. package/src/templates/lib/__lib/lib.document.js +42 -0
  114. package/src/templates/lib/__lib/lib.service.js +84 -0
  115. package/src/templates/lib/__lib/lib.signal.js +37 -0
  116. package/src/templates/lib/__lib/lib.store.js +35 -0
  117. package/src/templates/lib/__scalar/_server.js +40 -0
  118. package/src/templates/lib/cnst.js +33 -0
  119. package/src/templates/lib/cnst_.js +52 -0
  120. package/src/templates/lib/db.js +54 -0
  121. package/src/templates/lib/dict.js +46 -0
  122. package/src/templates/lib/fetch.js +49 -0
  123. package/src/templates/lib/sig.js +38 -0
  124. package/src/templates/lib/srv.js +53 -0
  125. package/src/templates/lib/st.js +37 -0
  126. package/src/templates/lib/store.js +53 -0
  127. package/src/templates/lib/usePage.js +34 -0
  128. package/src/templates/libRoot/.gitignore.template +15 -0
  129. package/src/templates/libRoot/jest.config.js +37 -0
  130. package/src/templates/libRoot/package.json.template +5 -0
  131. package/src/templates/libRoot/tsconfig.json.template +11 -0
  132. package/src/templates/libRoot/tsconfig.spec.json.template +7 -0
  133. package/src/templates/module/__Model__.Template.js +52 -0
  134. package/src/templates/module/__Model__.Unit.js +40 -0
  135. package/src/templates/module/__Model__.Util.js +68 -0
  136. package/src/templates/module/__Model__.View.js +46 -0
  137. package/src/templates/module/__Model__.Zone.js +81 -0
  138. package/src/templates/module/__model__.constant.js +70 -0
  139. package/src/templates/module/__model__.dictionary.js +99 -0
  140. package/src/templates/module/__model__.document.js +54 -0
  141. package/src/templates/module/__model__.service.js +42 -0
  142. package/src/templates/module/__model__.signal.js +61 -0
  143. package/src/templates/module/__model__.signal.spec.js +40 -0
  144. package/src/templates/module/__model__.signal.test.js +49 -0
  145. package/src/templates/module/__model__.store.js +40 -0
  146. package/src/templates/module/_server.js +48 -0
  147. package/src/templates/module/index.js +59 -0
  148. package/src/templates/pkgRoot/tsconfig.json.template +12 -0
  149. package/src/templates/server.js +60 -0
  150. package/src/templates/workplaceRoot/.env.template +20 -0
  151. package/src/templates/workplaceRoot/.gitignore.template +195 -0
  152. package/src/templates/workplaceRoot/.prettierignore.template +10 -0
  153. package/src/templates/workplaceRoot/.prettierrc.json.template +5 -0
  154. package/src/templates/workplaceRoot/.swcrc.template +9 -0
  155. package/src/templates/workplaceRoot/README.md.template +37 -0
  156. package/src/templates/workplaceRoot/eslint.config.js.template +141 -0
  157. package/src/templates/workplaceRoot/tsconfig.json.template +29 -0
@@ -0,0 +1,71 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // pkgs/@akanjs/cli/src/templates/crudPages/[__model__Id]/edit/page.tsx
20
+ var page_exports = {};
21
+ __export(page_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(page_exports);
25
+ function getContent(scanResult, dict) {
26
+ return `
27
+ import { AiOutlineTeam } from "react-icons/ai";
28
+ import { Load } from "@shared/ui";
29
+ import { fetch, usePage, ${dict.Model} } from "${dict.appName}/client";
30
+ import type { CsrConfig } from "@akanjs/client";
31
+
32
+ interface PageProps {
33
+ params: { ${dict.model}Id: string };
34
+ }
35
+
36
+ export default function Page({ params }: PageProps) {
37
+ const { l } = usePage();
38
+ return (
39
+ <Load.Page
40
+ of={Page}
41
+ loader={async () => {
42
+ const { ${dict.model}Id } = await params;
43
+ const { ${dict.model}, ${dict.model}Edit } = await fetch.edit${dict.Model}(${dict.model}Id);
44
+ return { ${dict.model}, ${dict.model}Edit } as const;
45
+ }}
46
+ render={({ ${dict.model}, ${dict.model}Edit }) => (
47
+ <div className="container">
48
+ <div className="flex justify-between m-4 mt-8">
49
+ <div className="text-xl text-primary flex gap-2 items-center">
50
+ <AiOutlineTeam /> {l("shared.updateModel", { model: l("${dict.model}.modelName") })}
51
+ </div>
52
+ </div>
53
+ <Load.Edit
54
+ className="flex flex-col items-center"
55
+ sliceName="${dict.model}InPublic"
56
+ edit={${dict.model}Edit}
57
+ type="form"
58
+ onCancel="back"
59
+ onSubmit="/${dict.model}"
60
+ >
61
+ ${dict.Model}.Template.General
62
+ </Load.Edit>
63
+ </div>
64
+ )}
65
+ />
66
+ );
67
+ }
68
+ Page.csrConfig = { transition: "none" } satisfies CsrConfig;
69
+ `;
70
+ }
71
+ module.exports = module.exports.default;
@@ -0,0 +1,81 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // pkgs/@akanjs/cli/src/templates/crudPages/[__model__Id]/page.tsx
20
+ var page_exports = {};
21
+ __export(page_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(page_exports);
25
+ function getContent(scanResult, dict) {
26
+ return `
27
+ import { ${dict.Model}, fetch, usePage } from "${dict.appName}/client";
28
+ import { Link } from "@util/ui";
29
+ import { Load } from "@shared/ui";
30
+ import { getSelf } from "@akanjs/client";
31
+ import { AiOutlineEdit } from "react-icons/ai";
32
+ import type { CsrConfig } from "@akanjs/client";
33
+
34
+ interface PageProps {
35
+ params: { ${dict.model}Id: string };
36
+ }
37
+
38
+ export async function generateMetadata({ params }: PageProps) {
39
+ const { ${dict.model}Id } = await params;
40
+ const { ${dict.model} } = await fetch.view${dict.Model}(${dict.model}Id);
41
+ return {
42
+ title: ${dict.model}.id,
43
+ description: ${dict.model}.id,
44
+ openGraph: {
45
+ title: ${dict.model}.id,
46
+ description: ${dict.model}.id,
47
+ // images: ${dict.model}.thumbnails.map((i) => i.url),
48
+ },
49
+ };
50
+ }
51
+ export default function Page({ params }: PageProps) {
52
+ const { l } = usePage();
53
+ const self = getSelf({ unauthorize: "/signin" });
54
+ return (
55
+ <Load.Page
56
+ of={Page}
57
+ loader={async () => {
58
+ const { ${dict.model}Id } = await params;
59
+ const { ${dict.model}, ${dict.model}View } = await fetch.view${dict.Model}(${dict.model}Id);
60
+ return { ${dict.model}, ${dict.model}View } as const;
61
+ }}
62
+ render={({ ${dict.model}, ${dict.model}View }) => (
63
+ <div className="container flex flex-col gap-4">
64
+ <div className="flex gap-4 font-bold text-lg items-center">
65
+ ${dict.Model}.Zone.View view={${dict.model}View} />
66
+ <Link href={\`/${dict.model}/\${${dict.model}.id}/edit\`}>
67
+ <button className="btn">
68
+ <AiOutlineEdit />
69
+ {l("shared.updateModel", { model: l("${dict.model}.modelName") })}
70
+ </button>
71
+ </Link>
72
+ </div>
73
+ </div>
74
+ )}
75
+ />
76
+ );
77
+ }
78
+ Page.csrConfig = { transition: "none" } satisfies CsrConfig;
79
+ `;
80
+ }
81
+ module.exports = module.exports.default;
@@ -0,0 +1,68 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // pkgs/@akanjs/cli/src/templates/crudPages/new/page.tsx
20
+ var page_exports = {};
21
+ __export(page_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(page_exports);
25
+ function getContent(scanResult, dict) {
26
+ return `
27
+ import { AiOutlineTeam } from "react-icons/ai";
28
+ import { Load } from "@shared/ui";
29
+ import { cnst, fetch, usePage, ${dict.Model} } from "${dict.appName}/client";
30
+ import { getSelf } from "@akanjs/client";
31
+ import type { CsrConfig } from "@akanjs/client";
32
+
33
+ export default function Page() {
34
+ const { l } = usePage();
35
+ const self = getSelf({ unauthorize: "/signin" });
36
+ return (
37
+ <Load.Page
38
+ of={Page}
39
+ loader={async () => {
40
+ const ${dict.model}Form: Partial<cnst.${dict.Model}> = {};
41
+ return { ${dict.model}Form } as const;
42
+ }}
43
+ render={({ ${dict.model}Form }) => (
44
+ <div className="container">
45
+ <div className="flex justify-between m-4 mt-8">
46
+ <div className="text-xl text-primary flex gap-2 items-center">
47
+ <AiOutlineTeam /> {l("shared.createModel", { model: l("${dict.model}.modelName") })}
48
+ </div>
49
+ </div>
50
+ <Load.Edit
51
+ className="flex flex-col items-center"
52
+ sliceName="${dict.model}InPublic"
53
+ edit={${dict.model}Form}
54
+ type="form"
55
+ onCancel="back"
56
+ onSubmit="/${dict.model}"
57
+ >
58
+ ${dict.Model}.Template.General
59
+ </Load.Edit>
60
+ </div>
61
+ )}
62
+ />
63
+ );
64
+ }
65
+ Page.csrConfig = { transition: "none" } satisfies CsrConfig;
66
+ `;
67
+ }
68
+ module.exports = module.exports.default;
@@ -0,0 +1,69 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // pkgs/@akanjs/cli/src/templates/crudPages/page.tsx
20
+ var page_exports = {};
21
+ __export(page_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(page_exports);
25
+ function getContent(scanResult, dict) {
26
+ return `
27
+ import { ${dict.Model}, fetch, usePage } from "${dict.appName}/client";
28
+ import { Link } from "@util/ui";
29
+ import { Load } from "@shared/ui";
30
+ import { getSelf } from "@akanjs/client";
31
+ import type { CsrConfig } from "@akanjs/client";
32
+
33
+ export default function Page() {
34
+ const { l } = usePage();
35
+ const self = getSelf({ unauthorize: "/signin" });
36
+ return (
37
+ <Load.Page
38
+ of={Page}
39
+ loader={async () => {
40
+ const { ${dict.model}InitInPublic } = await fetch.init${dict.Model}InPublic();
41
+ return { ${dict.model}InitInPublic } as const;
42
+ }}
43
+ render={({ ${dict.model}InitInPublic }) => (
44
+ <div className="container flex flex-col gap-4">
45
+ <div className="w-full mt-5 px-5 h-full ">
46
+ <div>{l("${dict.model}.modelName")}</div>
47
+ <div className="animate-fadeIn px-4 pt-4 flex gap-4 items-center">
48
+ <div className="font-bold text-lg md:text-4xl">${dict.Model}s</div>
49
+ <Link href={\`/${dict.model}/new\`}>
50
+ <button className="btn">+ {l("shared.createModel", { model: l("${dict.model}.modelName") })}</button>
51
+ </Link>
52
+ </div>
53
+ <div>{l("${dict.model}.modelDesc")}</div>
54
+ <div className="flex px-6 mt-3 gap-4">
55
+ ${dict.Model}.Zone.Card
56
+ className="animate-fadeIn grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 justify-center gap-4 w-full"
57
+ init={${dict.model}InitInPublic}
58
+ />
59
+ </div>
60
+ </div>
61
+ </div>
62
+ )}
63
+ />
64
+ );
65
+ }
66
+ Page.csrConfig = { transition: "none" } satisfies CsrConfig;
67
+ `;
68
+ }
69
+ module.exports = module.exports.default;
@@ -0,0 +1,32 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // pkgs/@akanjs/cli/src/templates/index.ts
20
+ var templates_exports = {};
21
+ __export(templates_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(templates_exports);
25
+ function getContent(scanResult, dict = {}) {
26
+ return `
27
+ export { cnst } from "./lib/cnst";
28
+ export { fetch } from "./lib/fetch";
29
+ export * from "./lib/dict";
30
+ `;
31
+ }
32
+ module.exports = module.exports.default;
@@ -0,0 +1,44 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // pkgs/@akanjs/cli/src/templates/lib/__lib/extends/summary.constant.ts
20
+ var summary_constant_exports = {};
21
+ __export(summary_constant_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(summary_constant_exports);
25
+ var capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
26
+ function getContent(scanResult, dict = {}) {
27
+ if (!scanResult)
28
+ return null;
29
+ const databaseModulesExceptExtends = scanResult.files.constants.databases.filter(
30
+ (module2) => !["summary", "user", "setting"].includes(module2)
31
+ );
32
+ const hasUser = scanResult.files.constants.databases.includes("user");
33
+ const hasSummary = scanResult.files.constants.databases.includes("summary");
34
+ const isRootUserLib = !scanResult.akanConfig.rootLib;
35
+ if (!hasSummary)
36
+ return null;
37
+ return `
38
+ ${databaseModulesExceptExtends.map((module2) => `import { ${capitalize(module2)}Summary } from "../../${module2}/${module2}.constant";`).join("\n")}
39
+ ${hasUser ? `import { ${isRootUserLib ? "" : capitalize(scanResult.name)}UserSummary } from "../../user/user.constant";` : ""}
40
+
41
+ export const modelSummaries = [${[...databaseModulesExceptExtends, ...hasUser ? [`${isRootUserLib ? "" : scanResult.name}User`] : []].map((module2) => `${capitalize(module2)}Summary`).join(", ")}] as const;
42
+ `;
43
+ }
44
+ module.exports = module.exports.default;
@@ -0,0 +1,54 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // pkgs/@akanjs/cli/src/templates/lib/__lib/lib.constant.ts
20
+ var lib_constant_exports = {};
21
+ __export(lib_constant_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(lib_constant_exports);
25
+ function getContent(scanResult, dict = {}) {
26
+ if (!scanResult)
27
+ return null;
28
+ const libs = scanResult.akanConfig.libs;
29
+ const userLibs = scanResult.akanConfig.libs.filter(
30
+ (libName) => scanResult.libs[libName].files.constants.databases.includes("user")
31
+ );
32
+ const settingLibs = scanResult.akanConfig.libs.filter(
33
+ (libName) => scanResult.libs[libName].files.constants.databases.includes("setting")
34
+ );
35
+ const summaryLibs = scanResult.akanConfig.libs.filter(
36
+ (libName) => scanResult.libs[libName].files.constants.databases.includes("summary")
37
+ );
38
+ return `
39
+ ${libs.map((lib) => `import { cnst as ${lib} } from "@${lib}";`).join("\n")}
40
+
41
+ ${libs.map((lib) => `export { cnst as ${lib} } from "@${lib}";`).join("\n")}
42
+
43
+ ${scanResult.akanConfig.rootLib ? `export const root = ${scanResult.akanConfig.rootLib};` : ""}
44
+ export const libSummaries = [${summaryLibs.map((lib) => `${lib}.Summary`).join(", ")}] as const;
45
+ export const libSettings = [${settingLibs.map((lib) => `${lib}.Setting`).join(", ")}] as const;
46
+ export const libSettingInputs = [${settingLibs.map((lib) => `${lib}.SettingInput`).join(", ")}] as const;
47
+ export const libUserInputs = [${userLibs.map((lib) => `${lib}.UserInput`).join(", ")}] as const;
48
+ export const libUsers = [${userLibs.map((lib) => `${lib}.User`).join(", ")}] as const;
49
+ export const libUserInsights = [${userLibs.map((lib) => `${lib}.UserInsight`).join(", ")}] as const;
50
+ export const libUserSummaries = [${userLibs.map((lib) => `${lib}.UserSummary`).join(", ")}] as const;
51
+ export const libUserFilters = [${userLibs.map((lib) => `${lib}.UserFilter`).join(", ")}] as const;
52
+ `;
53
+ }
54
+ module.exports = module.exports.default;
@@ -0,0 +1,43 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // pkgs/@akanjs/cli/src/templates/lib/__lib/lib.dictionary.ts
20
+ var lib_dictionary_exports = {};
21
+ __export(lib_dictionary_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(lib_dictionary_exports);
25
+ function getContent(scanResult, dict = {}) {
26
+ if (!scanResult)
27
+ return null;
28
+ const libs = scanResult.akanConfig.libs;
29
+ const moduleDictionaries = scanResult.files.constants.databases.filter(
30
+ (module2) => module2 !== "summary" && module2 !== "setting"
31
+ );
32
+ return `
33
+ ${libs.length === 0 ? `import { rootDictionary } from "@akanjs/dictionary";` : ""}
34
+ ${libs.map((lib) => `import { dictionary as ${lib} } from "@${lib}";`).join("\n")}
35
+
36
+ ${moduleDictionaries.map((module2) => `import { ${module2}SummaryDictionary } from "../${module2}/${module2}.dictionary";`).join("\n")}
37
+
38
+ export const libDictionaries = [${libs.length === 0 ? "rootDictionary" : libs.join(", ")}] as const;
39
+
40
+ export const libSummaryDictionary = { ${moduleDictionaries.map((module2) => `...${module2}SummaryDictionary`).join(", ")} };
41
+ `;
42
+ }
43
+ module.exports = module.exports.default;
@@ -0,0 +1,42 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // pkgs/@akanjs/cli/src/templates/lib/__lib/lib.document.ts
20
+ var lib_document_exports = {};
21
+ __export(lib_document_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(lib_document_exports);
25
+ function getContent(scanResult, dict = {}) {
26
+ if (!scanResult)
27
+ return null;
28
+ const libs = scanResult.akanConfig.libs;
29
+ const rootLib = scanResult.akanConfig.rootLib;
30
+ return `
31
+ ${libs.map((lib) => `import { db as ${lib} } from "@${lib}/server";`).join("\n")}
32
+
33
+ ${libs.map((lib) => `export { db as ${lib} } from "@${lib}/server";`).join("\n")}
34
+
35
+ ${rootLib ? `export const root = ${rootLib};` : ""}
36
+ ${rootLib ? `export const rootUser = ${rootLib}.userDb;` : ""}
37
+ ${rootLib ? `export const rootSetting = ${rootLib}.settingDb;` : ""}
38
+ ${rootLib ? `export const rootSummary = ${rootLib}.summaryDb;` : ""}
39
+ export const libDbs = [${libs.join(", ")}] as const;
40
+ `;
41
+ }
42
+ module.exports = module.exports.default;
@@ -0,0 +1,84 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // pkgs/@akanjs/cli/src/templates/lib/__lib/lib.service.ts
20
+ var lib_service_exports = {};
21
+ __export(lib_service_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(lib_service_exports);
25
+ var capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
26
+ function getContent(scanResult, dict = {}) {
27
+ if (!scanResult)
28
+ return null;
29
+ const libs = scanResult.akanConfig.libs;
30
+ const libsHasSummary = libs.filter((lib) => scanResult.libs[lib].files.constants.databases.includes("summary"));
31
+ const databaseModules = scanResult.files.constants.databases;
32
+ const databaseModulesWithoutExtendModels = databaseModules.filter(
33
+ (module2) => !["summary", "setting", "user"].includes(module2)
34
+ );
35
+ const userLibs = scanResult.akanConfig.libs.filter(
36
+ (libName) => scanResult.libs[libName].files.constants.databases.includes("user")
37
+ );
38
+ const settingLibs = scanResult.akanConfig.libs.filter(
39
+ (libName) => scanResult.libs[libName].files.constants.databases.includes("setting")
40
+ );
41
+ const summaryLibs = scanResult.akanConfig.libs.filter(
42
+ (libName) => scanResult.libs[libName].files.constants.databases.includes("summary")
43
+ );
44
+ return `
45
+ ${libs.length ? libsHasSummary.length ? `import { ExtendedSummaryService, MixSrvs, Srv } from "@akanjs/service";` : `import { DbService, Srv } from "@akanjs/service";` : `import type { BackendEnv } from "@akanjs/base";`}
46
+ ${libs.map((lib) => `import { option as ${lib}Option, srv as ${lib} } from "@${lib}/server";`).join("\n")}
47
+
48
+ import * as db from "../db";
49
+ import type * as srv from "../srv";
50
+
51
+ ${libs.map((lib) => `export { srv as ${lib} } from "@${lib}/server";`).join("\n")}
52
+
53
+ ${summaryLibs.length > 0 ? `export const LibSummaryService = MixSrvs(${summaryLibs.map((lib) => `${lib}.SummaryService`).join(", ")});` : ""}
54
+ ${settingLibs.length > 0 ? `export const LibSettingService = MixSrvs(${settingLibs.map((lib) => `${lib}.SettingService`).join(", ")});` : ""}
55
+ ${userLibs.length > 0 ? `export const LibUserService = MixSrvs(${userLibs.map((lib) => `${lib}.UserService`).join(", ")});` : ""}
56
+
57
+ export const libAllSrvs = { ${libs.map((lib) => `...${lib}.allSrvs`).join(", ")} };
58
+
59
+ export type LibOptions = ${libs.length ? libs.map((lib) => `${lib}Option.ModulesOptions`).join(" & ") : "BackendEnv"};
60
+ ${libs.length ? `
61
+ export class ProtoSummaryService extends ${libsHasSummary.length ? "ExtendedSummaryService(db.summaryDb, LibSummaryService)" : "DbService(db.summaryDb)"} {
62
+ @Srv() protected readonly userService: srv.UserService;
63
+ ${databaseModulesWithoutExtendModels.map((module2) => ` @Srv() protected readonly ${module2}Service: srv.${capitalize(module2)}Service;`).join("\n")}
64
+
65
+ async get${capitalize(scanResult.name)}Summary() {
66
+ return {
67
+ ${databaseModulesWithoutExtendModels.map((module2) => ` ...(await this.${module2}Service.summarize()),`).join("\n")}
68
+ ...(await this.userService.summarize${capitalize(scanResult.name)}()),
69
+ };
70
+ }
71
+ ${scanResult.type === "app" ? `
72
+ async makeSummary(archiveType: "periodic" | "non-periodic" = "non-periodic"): Promise<db.Summary> {
73
+ const summary = {
74
+ ${libsHasSummary.map((lib) => ` ...(await this.get${capitalize(lib)}Summary()),`).join("\n")}
75
+ ...(await this.get${capitalize(scanResult.name)}Summary()),
76
+ };
77
+ return (await this.summaryModel.archive(archiveType, summary)) as unknown as db.Summary;
78
+ }
79
+ ` : ""}
80
+ }
81
+ ` : ""}
82
+ `;
83
+ }
84
+ module.exports = module.exports.default;
@@ -0,0 +1,37 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // pkgs/@akanjs/cli/src/templates/lib/__lib/lib.signal.ts
20
+ var lib_signal_exports = {};
21
+ __export(lib_signal_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(lib_signal_exports);
25
+ function getContent(scanResult, dict = {}) {
26
+ if (!scanResult)
27
+ return null;
28
+ const libs = scanResult.akanConfig.libs;
29
+ return `
30
+ ${libs.length > 0 ? "" : `import { baseFetch } from "@akanjs/signal";`}
31
+ ${libs.map((lib) => `import { fetch as ${lib} } from "@${lib}";`).join("\n")}
32
+
33
+ export const root = ${libs.length ? scanResult.akanConfig.rootLib ?? libs[0] : "baseFetch"};
34
+ export const libFetches = [${libs.length ? libs.join(", ") : "baseFetch"}] as const;
35
+ `;
36
+ }
37
+ module.exports = module.exports.default;
@@ -0,0 +1,35 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // pkgs/@akanjs/cli/src/templates/lib/__lib/lib.store.ts
20
+ var lib_store_exports = {};
21
+ __export(lib_store_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(lib_store_exports);
25
+ function getContent(scanResult, dict = {}) {
26
+ if (!scanResult)
27
+ return null;
28
+ const libs = scanResult.akanConfig.libs;
29
+ return `
30
+ ${libs.map((lib) => `import { store as ${lib} } from "@${lib}/client";`).join("\n")}
31
+
32
+ export const libStores = [${libs.join(", ")}] as const;
33
+ `;
34
+ }
35
+ module.exports = module.exports.default;