@akanjs/cli 0.0.118 → 0.0.119

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 (178) hide show
  1. package/cjs/index.js +15 -1
  2. package/cjs/src/templates/libRoot/akan.config.js +36 -0
  3. package/cjs/src/templates/libRoot/base/baseLogic.js +35 -0
  4. package/cjs/src/templates/libRoot/base/index.js +29 -0
  5. package/cjs/src/templates/libRoot/common/commonLogic.js +35 -0
  6. package/cjs/src/templates/libRoot/common/index.js +29 -0
  7. package/cjs/src/templates/libRoot/jest.config.js +1 -1
  8. package/cjs/src/templates/libRoot/lib/___libName__/__libName__.dictionary.js +31 -0
  9. package/cjs/src/templates/libRoot/lib/___libName__/__libName__.service.js +42 -0
  10. package/cjs/src/templates/libRoot/lib/___libName__/__libName__.store.js +36 -0
  11. package/cjs/src/templates/libRoot/lib/___libName__/_server.js +34 -0
  12. package/cjs/src/templates/libRoot/lib/option.js +42 -0
  13. package/cjs/src/templates/libRoot/lib/setting/Setting.Template.js +57 -0
  14. package/cjs/src/templates/libRoot/lib/setting/Setting.Unit.js +38 -0
  15. package/cjs/src/templates/libRoot/lib/setting/Setting.Util.js +34 -0
  16. package/cjs/src/templates/libRoot/lib/setting/Setting.View.js +51 -0
  17. package/cjs/src/templates/libRoot/lib/setting/Setting.Zone.js +80 -0
  18. package/cjs/src/templates/libRoot/lib/setting/_server.js +48 -0
  19. package/cjs/src/templates/libRoot/lib/setting/index.js +61 -0
  20. package/cjs/src/templates/libRoot/lib/setting/setting.constant.js +46 -0
  21. package/cjs/src/templates/libRoot/lib/setting/setting.dictionary.js +46 -0
  22. package/cjs/src/templates/libRoot/lib/setting/setting.document.js +48 -0
  23. package/cjs/src/templates/libRoot/lib/setting/setting.service.js +37 -0
  24. package/cjs/src/templates/libRoot/lib/setting/setting.signal.js +34 -0
  25. package/cjs/src/templates/libRoot/lib/setting/setting.store.js +41 -0
  26. package/cjs/src/templates/libRoot/lib/summary/Summary.Template.js +43 -0
  27. package/cjs/src/templates/libRoot/lib/summary/Summary.Unit.js +38 -0
  28. package/cjs/src/templates/libRoot/lib/summary/Summary.Util.js +33 -0
  29. package/cjs/src/templates/libRoot/lib/summary/Summary.View.js +51 -0
  30. package/cjs/src/templates/libRoot/lib/summary/Summary.Zone.js +62 -0
  31. package/cjs/src/templates/libRoot/lib/summary/_server.js +48 -0
  32. package/cjs/src/templates/libRoot/lib/summary/index.js +67 -0
  33. package/cjs/src/templates/libRoot/lib/summary/summary.constant.js +44 -0
  34. package/cjs/src/templates/libRoot/lib/summary/summary.dictionary.js +49 -0
  35. package/cjs/src/templates/libRoot/lib/summary/summary.document.js +48 -0
  36. package/cjs/src/templates/libRoot/lib/summary/summary.service.js +34 -0
  37. package/cjs/src/templates/libRoot/lib/summary/summary.signal.js +34 -0
  38. package/cjs/src/templates/libRoot/lib/summary/summary.store.js +41 -0
  39. package/cjs/src/templates/libRoot/lib/user/User.Template.js +65 -0
  40. package/cjs/src/templates/libRoot/lib/user/User.Unit.js +38 -0
  41. package/cjs/src/templates/libRoot/lib/user/User.Util.js +94 -0
  42. package/cjs/src/templates/libRoot/lib/user/User.View.js +66 -0
  43. package/cjs/src/templates/libRoot/lib/user/User.Zone.js +74 -0
  44. package/cjs/src/templates/libRoot/lib/user/_server.js +48 -0
  45. package/cjs/src/templates/libRoot/lib/user/index.js +61 -0
  46. package/cjs/src/templates/libRoot/lib/user/user.constant.js +67 -0
  47. package/cjs/src/templates/libRoot/lib/user/user.dictionary.js +52 -0
  48. package/cjs/src/templates/libRoot/lib/user/user.document.js +54 -0
  49. package/cjs/src/templates/libRoot/lib/user/user.service.js +42 -0
  50. package/cjs/src/templates/libRoot/lib/user/user.signal.js +34 -0
  51. package/cjs/src/templates/libRoot/lib/user/user.signal.spec.js +37 -0
  52. package/cjs/src/templates/libRoot/lib/user/user.signal.test.js +39 -0
  53. package/cjs/src/templates/libRoot/lib/user/user.store.js +39 -0
  54. package/cjs/src/templates/libRoot/nest/backendLogic.js +34 -0
  55. package/cjs/src/templates/libRoot/nest/index.js +29 -0
  56. package/cjs/src/templates/libRoot/next/frontendLogic.js +34 -0
  57. package/cjs/src/templates/libRoot/next/index.js +29 -0
  58. package/cjs/src/templates/libRoot/ui/index.js +29 -0
  59. package/esm/index.js +15 -1
  60. package/esm/src/templates/libRoot/akan.config.js +16 -0
  61. package/esm/src/templates/libRoot/base/baseLogic.js +15 -0
  62. package/esm/src/templates/libRoot/base/index.js +9 -0
  63. package/esm/src/templates/libRoot/common/commonLogic.js +15 -0
  64. package/esm/src/templates/libRoot/common/index.js +9 -0
  65. package/esm/src/templates/libRoot/jest.config.js +1 -1
  66. package/esm/src/templates/libRoot/lib/___libName__/__libName__.dictionary.js +11 -0
  67. package/esm/src/templates/libRoot/lib/___libName__/__libName__.service.js +22 -0
  68. package/esm/src/templates/libRoot/lib/___libName__/__libName__.store.js +16 -0
  69. package/esm/src/templates/libRoot/lib/___libName__/_server.js +14 -0
  70. package/esm/src/templates/libRoot/lib/option.js +22 -0
  71. package/esm/src/templates/libRoot/lib/setting/Setting.Template.js +37 -0
  72. package/esm/src/templates/libRoot/lib/setting/Setting.Unit.js +18 -0
  73. package/esm/src/templates/libRoot/lib/setting/Setting.Util.js +14 -0
  74. package/esm/src/templates/libRoot/lib/setting/Setting.View.js +31 -0
  75. package/esm/src/templates/libRoot/lib/setting/Setting.Zone.js +60 -0
  76. package/esm/src/templates/libRoot/lib/setting/_server.js +28 -0
  77. package/esm/src/templates/libRoot/lib/setting/index.js +41 -0
  78. package/esm/src/templates/libRoot/lib/setting/setting.constant.js +26 -0
  79. package/esm/src/templates/libRoot/lib/setting/setting.dictionary.js +26 -0
  80. package/esm/src/templates/libRoot/lib/setting/setting.document.js +28 -0
  81. package/esm/src/templates/libRoot/lib/setting/setting.service.js +17 -0
  82. package/esm/src/templates/libRoot/lib/setting/setting.signal.js +14 -0
  83. package/esm/src/templates/libRoot/lib/setting/setting.store.js +21 -0
  84. package/esm/src/templates/libRoot/lib/summary/Summary.Template.js +23 -0
  85. package/esm/src/templates/libRoot/lib/summary/Summary.Unit.js +18 -0
  86. package/esm/src/templates/libRoot/lib/summary/Summary.Util.js +13 -0
  87. package/esm/src/templates/libRoot/lib/summary/Summary.View.js +31 -0
  88. package/esm/src/templates/libRoot/lib/summary/Summary.Zone.js +42 -0
  89. package/esm/src/templates/libRoot/lib/summary/_server.js +28 -0
  90. package/esm/src/templates/libRoot/lib/summary/index.js +47 -0
  91. package/esm/src/templates/libRoot/lib/summary/summary.constant.js +24 -0
  92. package/esm/src/templates/libRoot/lib/summary/summary.dictionary.js +29 -0
  93. package/esm/src/templates/libRoot/lib/summary/summary.document.js +28 -0
  94. package/esm/src/templates/libRoot/lib/summary/summary.service.js +14 -0
  95. package/esm/src/templates/libRoot/lib/summary/summary.signal.js +14 -0
  96. package/esm/src/templates/libRoot/lib/summary/summary.store.js +21 -0
  97. package/esm/src/templates/libRoot/lib/user/User.Template.js +45 -0
  98. package/esm/src/templates/libRoot/lib/user/User.Unit.js +18 -0
  99. package/esm/src/templates/libRoot/lib/user/User.Util.js +74 -0
  100. package/esm/src/templates/libRoot/lib/user/User.View.js +46 -0
  101. package/esm/src/templates/libRoot/lib/user/User.Zone.js +54 -0
  102. package/esm/src/templates/libRoot/lib/user/_server.js +28 -0
  103. package/esm/src/templates/libRoot/lib/user/index.js +41 -0
  104. package/esm/src/templates/libRoot/lib/user/user.constant.js +47 -0
  105. package/esm/src/templates/libRoot/lib/user/user.dictionary.js +32 -0
  106. package/esm/src/templates/libRoot/lib/user/user.document.js +34 -0
  107. package/esm/src/templates/libRoot/lib/user/user.service.js +22 -0
  108. package/esm/src/templates/libRoot/lib/user/user.signal.js +14 -0
  109. package/esm/src/templates/libRoot/lib/user/user.signal.spec.js +17 -0
  110. package/esm/src/templates/libRoot/lib/user/user.signal.test.js +19 -0
  111. package/esm/src/templates/libRoot/lib/user/user.store.js +19 -0
  112. package/esm/src/templates/libRoot/nest/backendLogic.js +14 -0
  113. package/esm/src/templates/libRoot/nest/index.js +9 -0
  114. package/esm/src/templates/libRoot/next/frontendLogic.js +14 -0
  115. package/esm/src/templates/libRoot/next/index.js +9 -0
  116. package/esm/src/templates/libRoot/ui/index.js +9 -0
  117. package/package.json +1 -1
  118. package/src/library/library.runner.d.ts +1 -1
  119. package/src/templates/libRoot/akan.config.d.ts +5 -0
  120. package/src/templates/libRoot/base/baseLogic.d.ts +5 -0
  121. package/src/templates/libRoot/base/index.d.ts +5 -0
  122. package/src/templates/libRoot/common/commonLogic.d.ts +5 -0
  123. package/src/templates/libRoot/common/index.d.ts +5 -0
  124. package/src/templates/libRoot/env/env.server.example.ts.template +7 -0
  125. package/src/templates/libRoot/env/env.server.testing.ts.template +7 -0
  126. package/src/templates/libRoot/jest.config.d.ts +1 -1
  127. package/src/templates/libRoot/lib/___libName__/__libName__.dictionary.d.ts +6 -0
  128. package/src/templates/libRoot/lib/___libName__/__libName__.service.d.ts +6 -0
  129. package/src/templates/libRoot/lib/___libName__/__libName__.store.d.ts +6 -0
  130. package/src/templates/libRoot/lib/___libName__/_server.d.ts +7 -0
  131. package/src/templates/libRoot/lib/option.d.ts +6 -0
  132. package/src/templates/libRoot/lib/setting/Setting.Template.d.ts +9 -0
  133. package/src/templates/libRoot/lib/setting/Setting.Unit.d.ts +9 -0
  134. package/src/templates/libRoot/lib/setting/Setting.Util.d.ts +9 -0
  135. package/src/templates/libRoot/lib/setting/Setting.View.d.ts +9 -0
  136. package/src/templates/libRoot/lib/setting/Setting.Zone.d.ts +9 -0
  137. package/src/templates/libRoot/lib/setting/_server.d.ts +6 -0
  138. package/src/templates/libRoot/lib/setting/index.d.ts +9 -0
  139. package/src/templates/libRoot/lib/setting/setting.constant.d.ts +7 -0
  140. package/src/templates/libRoot/lib/setting/setting.dictionary.d.ts +7 -0
  141. package/src/templates/libRoot/lib/setting/setting.document.d.ts +6 -0
  142. package/src/templates/libRoot/lib/setting/setting.service.d.ts +7 -0
  143. package/src/templates/libRoot/lib/setting/setting.signal.d.ts +6 -0
  144. package/src/templates/libRoot/lib/setting/setting.store.d.ts +6 -0
  145. package/src/templates/libRoot/lib/summary/Summary.Template.d.ts +9 -0
  146. package/src/templates/libRoot/lib/summary/Summary.Unit.d.ts +9 -0
  147. package/src/templates/libRoot/lib/summary/Summary.Util.d.ts +9 -0
  148. package/src/templates/libRoot/lib/summary/Summary.View.d.ts +9 -0
  149. package/src/templates/libRoot/lib/summary/Summary.Zone.d.ts +9 -0
  150. package/src/templates/libRoot/lib/summary/_server.d.ts +6 -0
  151. package/src/templates/libRoot/lib/summary/index.d.ts +9 -0
  152. package/src/templates/libRoot/lib/summary/summary.constant.d.ts +7 -0
  153. package/src/templates/libRoot/lib/summary/summary.dictionary.d.ts +7 -0
  154. package/src/templates/libRoot/lib/summary/summary.document.d.ts +6 -0
  155. package/src/templates/libRoot/lib/summary/summary.service.d.ts +7 -0
  156. package/src/templates/libRoot/lib/summary/summary.signal.d.ts +6 -0
  157. package/src/templates/libRoot/lib/summary/summary.store.d.ts +6 -0
  158. package/src/templates/libRoot/lib/user/User.Template.d.ts +9 -0
  159. package/src/templates/libRoot/lib/user/User.Unit.d.ts +9 -0
  160. package/src/templates/libRoot/lib/user/User.Util.d.ts +9 -0
  161. package/src/templates/libRoot/lib/user/User.View.d.ts +9 -0
  162. package/src/templates/libRoot/lib/user/User.Zone.d.ts +9 -0
  163. package/src/templates/libRoot/lib/user/_server.d.ts +6 -0
  164. package/src/templates/libRoot/lib/user/index.d.ts +9 -0
  165. package/src/templates/libRoot/lib/user/user.constant.d.ts +7 -0
  166. package/src/templates/libRoot/lib/user/user.dictionary.d.ts +7 -0
  167. package/src/templates/libRoot/lib/user/user.document.d.ts +7 -0
  168. package/src/templates/libRoot/lib/user/user.service.d.ts +7 -0
  169. package/src/templates/libRoot/lib/user/user.signal.d.ts +6 -0
  170. package/src/templates/libRoot/lib/user/user.signal.spec.d.ts +6 -0
  171. package/src/templates/libRoot/lib/user/user.signal.test.d.ts +6 -0
  172. package/src/templates/libRoot/lib/user/user.store.d.ts +6 -0
  173. package/src/templates/libRoot/nest/backendLogic.d.ts +5 -0
  174. package/src/templates/libRoot/nest/index.d.ts +5 -0
  175. package/src/templates/libRoot/next/frontendLogic.d.ts +5 -0
  176. package/src/templates/libRoot/next/index.d.ts +5 -0
  177. package/src/templates/libRoot/package.json.template +2 -3
  178. package/src/templates/libRoot/ui/index.d.ts +5 -0
package/cjs/index.js CHANGED
@@ -2040,6 +2040,7 @@ var runCommands = async (...commands) => {
2040
2040
  } catch (e) {
2041
2041
  const errMsg = e instanceof Error ? e.message : typeof e === "string" ? e : JSON.stringify(e);
2042
2042
  Logger.error(`Command Error: ${import_chalk2.default.red(errMsg)}`);
2043
+ console.error(e);
2043
2044
  }
2044
2045
  });
2045
2046
  }
@@ -2254,6 +2255,18 @@ var LibraryRunner = class {
2254
2255
  return scanResult;
2255
2256
  }
2256
2257
  async createLibrary(libName, workspace) {
2258
+ await workspace.exec(`mkdir -p libs/${libName}`);
2259
+ const lib = LibExecutor.from(workspace, libName);
2260
+ await lib.applyTemplate({ basePath: ".", template: "libRoot", dict: { libName, Libname: capitalize(libName) } });
2261
+ const rootTsConfig = workspace.readJson("tsconfig.json");
2262
+ rootTsConfig.compilerOptions.paths[`@${libName}`] = [`libs/${libName}/index.ts`];
2263
+ rootTsConfig.compilerOptions.paths[`@${libName}/*`] = [`libs/${libName}/*`];
2264
+ if (rootTsConfig.references) {
2265
+ if (!rootTsConfig.references.some((ref) => ref.path === `./libs/${libName}/tsconfig.json`))
2266
+ rootTsConfig.references.push({ path: `./libs/${libName}/tsconfig.json` });
2267
+ }
2268
+ workspace.writeJson("tsconfig.json", rootTsConfig);
2269
+ return lib;
2257
2270
  }
2258
2271
  async removeLibrary(lib) {
2259
2272
  await lib.workspace.exec(`rm -rf libs/${lib.name}`);
@@ -2349,7 +2362,8 @@ var LibraryScript = class {
2349
2362
  await this.syncLibrary(LibExecutor.from(lib.workspace, libName), { recursive: false });
2350
2363
  }
2351
2364
  async createLibrary(libName, workspace) {
2352
- await this.#runner.createLibrary(libName, workspace);
2365
+ const lib = await this.#runner.createLibrary(libName, workspace);
2366
+ await this.syncLibrary(lib);
2353
2367
  }
2354
2368
  async removeLibrary(lib) {
2355
2369
  await this.#runner.removeLibrary(lib);
@@ -0,0 +1,36 @@
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/libRoot/akan.config.ts
20
+ var akan_config_exports = {};
21
+ __export(akan_config_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(akan_config_exports);
25
+ function getContent(scanResult, dict) {
26
+ return `
27
+ import type { LibConfig } from "@akanjs/config";
28
+
29
+ const config: LibConfig = {
30
+ rootLib: "shared",
31
+ libs: ["util", "shared"],
32
+ };
33
+
34
+ export default config;
35
+ `;
36
+ }
@@ -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/libRoot/base/baseLogic.ts
20
+ var baseLogic_exports = {};
21
+ __export(baseLogic_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(baseLogic_exports);
25
+ function getContent(scanResult, dict) {
26
+ return `
27
+ // \uD604 \uB514\uB809\uD1A0\uB9AC\uC5D0\uC11C\uB294 \uD504\uB85C\uC81D\uD2B8 \uB0B4 \uC804\uCCB4\uC801\uC73C\uB85C \uC0AC\uC6A9\uB418\uB294 \uB85C\uC9C1\uC744 \uAD6C\uD604\uD558\uBA70, \uB530\uB77C\uC11C \uBC31/\uD504\uB860\uD2B8 \uBE44\uC758\uC874\uC801\uC778 pure js \uCF54\uB4DC\uB9CC \uAD6C\uD604 \uAC00\uB2A5\uD569\uB2C8\uB2E4.
28
+ // common\uD3F4\uB354\uC640 \uB2E4\uB978\uC810\uC740, base \uCF54\uB4DC\uB294 \uC2DC\uC2A4\uD15C \uC804\uCCB4\uC5D0\uC11C import\uB418\uC5B4 \uC0AC\uC6A9\uB418\uBBC0\uB85C, \uAC00\uC7A5 \uD575\uC2EC\uC801\uC778 \uB85C\uC9C1\uACFC \uCD94\uC0C1\uD654\uB41C \uAE30\uB2A5\uB9CC \uAD6C\uD604\uD574\uC57C\uD569\uB2C8\uB2E4.
29
+ // @${dict.libName}/base\uC5D0\uC11C\uB294 \uC11C\uBC84/\uD074\uB77C\uC774\uC5B8\uD2B8 \uAD00\uB828 \uB77C\uC774\uBE0C\uB7EC\uB9AC(@*/server, @*/nest, @*/client, @*/next)\uB97C \uBAA8\uB450 import\uD560 \uC218 \uC5C6\uC73C\uBA70, @*/base \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB9CC import \uAC00\uB2A5\uD569\uB2C8\uB2E4.
30
+
31
+ export const someBaseLogic = () => {
32
+ //
33
+ };
34
+ `;
35
+ }
@@ -0,0 +1,29 @@
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/libRoot/base/index.ts
20
+ var base_exports = {};
21
+ __export(base_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(base_exports);
25
+ function getContent(scanResult, dict = {}) {
26
+ return `
27
+ export * from "./baseLogic";
28
+ `;
29
+ }
@@ -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/libRoot/common/commonLogic.ts
20
+ var commonLogic_exports = {};
21
+ __export(commonLogic_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(commonLogic_exports);
25
+ function getContent(scanResult, dict) {
26
+ return `
27
+ // \uD604 \uB514\uB809\uD1A0\uB9AC\uC5D0\uC11C\uB294 \uD504\uB85C\uC81D\uD2B8 \uB0B4 \uC804\uCCB4\uC801\uC73C\uB85C \uC0AC\uC6A9\uB418\uB294 \uC138\uBD80\uC801\uC778 \uB85C\uC9C1\uC744 \uAD6C\uD604\uD558\uBA70, \uB530\uB77C\uC11C \uBC31/\uD504\uB860\uD2B8 \uBE44\uC758\uC874\uC801\uC778 pure js \uCF54\uB4DC\uB9CC \uAD6C\uD604 \uAC00\uB2A5\uD569\uB2C8\uB2E4.
28
+ // base\uD3F4\uB354\uC640 \uB2E4\uB978\uC810\uC740, common \uCF54\uB4DC\uB294 \uC0AC\uC6A9\uD558\uB294 \uD30C\uC77C\uC5D0\uC11C\uB9CC import\uB418\uAE30 \uB54C\uBB38\uC5D0, \uC678\uBD80\uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C import\uD574\uC11C \uC0AC\uC6A9\uD558\uAC70\uB098 \uC0C1\uC138\uD55C \uB85C\uC9C1\uC744 \uAD6C\uD604\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
29
+ // @${dict.libName}/common\uC5D0\uC11C\uB294 \uC11C\uBC84/\uD074\uB77C\uC774\uC5B8\uD2B8 \uAD00\uB828 \uB77C\uC774\uBE0C\uB7EC\uB9AC(@*/server, @*/nest, @*/client, @*/next)\uB97C \uBAA8\uB450 import\uD560 \uC218 \uC5C6\uC73C\uBA70, @*/base\uC640 @*/common \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB9CC import \uAC00\uB2A5\uD569\uB2C8\uB2E4.
30
+
31
+ export const someCommonLogic = () => {
32
+ //
33
+ };
34
+ `;
35
+ }
@@ -0,0 +1,29 @@
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/libRoot/common/index.ts
20
+ var common_exports = {};
21
+ __export(common_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(common_exports);
25
+ function getContent(scanResult, dict = {}) {
26
+ return `
27
+ export * from "./commonLogic";
28
+ `;
29
+ }
@@ -29,7 +29,7 @@ import "tsconfig-paths/register";
29
29
 
30
30
  import { withBase } from "@akanjs/test/jest.config.base";
31
31
 
32
- const config = withBase("${dict.appName}");
32
+ const config = withBase("${dict.libName}");
33
33
 
34
34
  export default config;
35
35
  `;
@@ -0,0 +1,31 @@
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/libRoot/lib/___libName__/__libName__.dictionary.ts
20
+ var libName_dictionary_exports = {};
21
+ __export(libName_dictionary_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(libName_dictionary_exports);
25
+ function getContent(scanResult, dict) {
26
+ return `
27
+ const dictionary = {} as const;
28
+
29
+ export const ${dict.libName}Dictionary = dictionary;
30
+ `;
31
+ }
@@ -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/libRoot/lib/___libName__/__libName__.service.ts
20
+ var libName_service_exports = {};
21
+ __export(libName_service_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(libName_service_exports);
25
+ function getContent(scanResult, dict) {
26
+ return `
27
+ import { Cron } from "@akanjs/nest";
28
+ import { LogService, Service, Srv } from "@akanjs/service";
29
+
30
+ import type * as srv from "../srv";
31
+
32
+ @Service("${dict.libName}Service", { serverMode: "batch" })
33
+ export class ${dict.LibName}Service extends LogService("${dict.libName}Service") {
34
+ @Srv() protected readonly summaryService: srv.SummaryService;
35
+
36
+ @Cron("0 * * * *")
37
+ async takePeriodicSnapshot() {
38
+ await this.summaryService.makeSummary();
39
+ }
40
+ }
41
+ `;
42
+ }
@@ -0,0 +1,36 @@
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/libRoot/lib/___libName__/__libName__.store.ts
20
+ var libName_store_exports = {};
21
+ __export(libName_store_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(libName_store_exports);
25
+ function getContent(scanResult, dict) {
26
+ return `
27
+ import { scalarStateOf, Store } from "@akanjs/store";
28
+
29
+ @Store({ name: "${dict.libName}" })
30
+ export class ${dict.LibName}Store extends scalarStateOf("${dict.libName}" as const, {
31
+ // state
32
+ }) {
33
+ // action
34
+ }
35
+ `;
36
+ }
@@ -0,0 +1,34 @@
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/libRoot/lib/___libName__/_server.ts
20
+ var server_exports = {};
21
+ __export(server_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(server_exports);
25
+ function getContent(scanResult, dict) {
26
+ return `
27
+ import { batchModuleOf } from "@akanjs/server";
28
+
29
+ import type { ModulesOptions } from "../option";
30
+ import { ${dict.AppName}Service } from "./${dict.appName}.service";
31
+
32
+ export const register${dict.AppName}Module = (option: ModulesOptions) => batchModuleOf({ service: ${dict.AppName}Service, uses: {} });
33
+ `;
34
+ }
@@ -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/libRoot/lib/option.ts
20
+ var option_exports = {};
21
+ __export(option_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(option_exports);
25
+ function getContent(scanResult, dict = {}) {
26
+ return `
27
+ import { useGlobals } from "@akanjs/server";
28
+
29
+ import type { LibOptions } from "./__lib/lib.service";
30
+
31
+ export type ModulesOptions = LibOptions & {
32
+ //
33
+ };
34
+
35
+ export const registerGlobalModule = (options: ModulesOptions) => {
36
+ return useGlobals({
37
+ uses: {},
38
+ useAsyncs: {},
39
+ });
40
+ };
41
+ `;
42
+ }
@@ -0,0 +1,57 @@
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/libRoot/lib/setting/Setting.Template.tsx
20
+ var Setting_Template_exports = {};
21
+ __export(Setting_Template_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(Setting_Template_exports);
25
+ function getContent(scanResult, dict) {
26
+ return {
27
+ filename: "Setting.Template.tsx",
28
+ content: `
29
+ "use client";
30
+ import { st, usePage } from "@${dict.libName}/client";
31
+
32
+ interface GeneralProps {
33
+ settingId?: string | null;
34
+ }
35
+
36
+ export const General = ({ settingId = undefined }: GeneralProps) => {
37
+ const settingForm = st.use.settingForm();
38
+ const { l } = usePage();
39
+ return (
40
+ <div className="mb-4 flex items-center">
41
+ <div className="flex items-center gap-2">
42
+ <div className="w-32">{l("setting.resignupDays")}</div>
43
+ <input
44
+ type="number"
45
+ className="input"
46
+ value={settingForm.resignupDays}
47
+ onChange={(e) => {
48
+ st.do.setResignupDaysOnSetting(e.target.valueAsNumber);
49
+ }}
50
+ />
51
+ </div>
52
+ </div>
53
+ );
54
+ };
55
+ `
56
+ };
57
+ }
@@ -0,0 +1,38 @@
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/libRoot/lib/setting/Setting.Unit.tsx
20
+ var Setting_Unit_exports = {};
21
+ __export(Setting_Unit_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(Setting_Unit_exports);
25
+ function getContent(scanResult, dict = {}) {
26
+ return {
27
+ filename: "Setting.Unit.tsx",
28
+ content: `
29
+ import { ModelProps } from "@akanjs/client";
30
+
31
+ import { cnst } from "../cnst";
32
+
33
+ export const Card = ({ className, setting }: ModelProps<"setting", cnst.LightSetting>) => {
34
+ return <div>{setting.id}</div>;
35
+ };
36
+ `
37
+ };
38
+ }
@@ -0,0 +1,34 @@
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/libRoot/lib/setting/Setting.Util.tsx
20
+ var Setting_Util_exports = {};
21
+ __export(Setting_Util_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(Setting_Util_exports);
25
+ function getContent(scanResult, dict = {}) {
26
+ return {
27
+ filename: "Setting.Util.tsx",
28
+ content: `
29
+ "use client";
30
+
31
+ export const aaa = 1;
32
+ `
33
+ };
34
+ }
@@ -0,0 +1,51 @@
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/libRoot/lib/setting/Setting.View.tsx
20
+ var Setting_View_exports = {};
21
+ __export(Setting_View_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(Setting_View_exports);
25
+ function getContent(scanResult, dict) {
26
+ return {
27
+ filename: "Setting.View.tsx",
28
+ content: `
29
+ import { clsx } from "@akanjs/client";
30
+ import { usePage } from "@${dict.libName}/client";
31
+
32
+ import { cnst } from "../cnst";
33
+
34
+ interface SettingViewProps {
35
+ className?: string;
36
+ setting: cnst.Setting;
37
+ }
38
+
39
+ export const General = ({ className, setting }: SettingViewProps) => {
40
+ const { l } = usePage();
41
+ return (
42
+ <div className={clsx(className, "mr-12")}>
43
+ <div>
44
+ {l("setting.resignupDays")}: {setting.resignupDays}
45
+ </div>
46
+ </div>
47
+ );
48
+ };
49
+ `
50
+ };
51
+ }
@@ -0,0 +1,80 @@
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/libRoot/lib/setting/Setting.Zone.tsx
20
+ var Setting_Zone_exports = {};
21
+ __export(Setting_Zone_exports, {
22
+ default: () => getContent
23
+ });
24
+ module.exports = __toCommonJS(Setting_Zone_exports);
25
+ function getContent(scanResult, dict) {
26
+ return {
27
+ filename: "Setting.Zone.tsx",
28
+ content: `
29
+ "use client";
30
+ import { ModelsProps } from "@akanjs/client";
31
+ import { Setting, st, usePage } from "@${dict.libName}/client";
32
+ import { Model } from "@shared/ui";
33
+ import { Loading } from "@util/ui";
34
+ import { useEffect } from "react";
35
+ import { AiOutlineEdit } from "react-icons/ai";
36
+
37
+ import { cnst } from "../cnst";
38
+ import { msg } from "../dict";
39
+
40
+ export const Admin = ({ sliceName = "setting" }: ModelsProps<cnst.Setting>) => {
41
+ const { l } = usePage();
42
+ const setting = st.use.setting();
43
+ const settingModal = st.use.settingModal();
44
+ useEffect(() => {
45
+ void st.do.getActiveSetting();
46
+ }, []);
47
+ if (!setting) return <Loading.Skeleton active />;
48
+
49
+ return (
50
+ <div>
51
+ <div className="my-2 flex items-center gap-4 text-3xl">
52
+ {l("setting.modelName")}
53
+ {settingModal ? null : (
54
+ <button className="btn btn-sm" onClick={() => st.do.editSetting(setting.id)}>
55
+ <AiOutlineEdit /> {l("shared.edit")}
56
+ </button>
57
+ )}
58
+ </div>
59
+ {settingModal === "edit" ? (
60
+ <Model.EditModal
61
+ sliceName="setting"
62
+ type="form"
63
+ onSubmit={() => {
64
+ msg.success("setting.updateSuccessMsg");
65
+ }}
66
+ onCancel={() => {
67
+ st.do.resetSetting(setting);
68
+ }}
69
+ >
70
+ <Setting.Template.General />
71
+ </Model.EditModal>
72
+ ) : (
73
+ <Setting.View.General setting={setting} />
74
+ )}
75
+ </div>
76
+ );
77
+ };
78
+ `
79
+ };
80
+ }