@akanjs/cli 3.1.1-rc.9 → 3.1.2-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/.build-stamp +1 -1
  2. package/CodeAgent-dyc45f5w.js +11 -0
  3. package/{CodeAgentRpcHost-9g27hmer.js → CodeAgentRpcHost-6dzfkvsc.js} +1 -1
  4. package/CodeAgentRpcListener-tcwrdvst.js +182 -0
  5. package/{CodeTui-z5vkm9ea.js → CodeTui-q55b2zrn.js} +25 -8
  6. package/TunnelShare-hdq9h1hr.js +14 -0
  7. package/agent.command-20zaqe60.js +49 -0
  8. package/akanCode.js +13 -8
  9. package/{application.command-wthg8nn9.js → application.command-nd0fshsk.js} +45 -12
  10. package/{applicationBuildRunner-t2r84sz6.js → applicationBuildRunner-s13x3zqb.js} +14 -10
  11. package/buildBatch.proc.js +7 -7
  12. package/{cloud.command-sz11hpre.js → cloud.command-8kbddsz9.js} +28 -19
  13. package/cloud.script-hgvvajm3.js +27 -0
  14. package/code.command-625bg8s8.js +345 -0
  15. package/commandManifest.json +1 -1
  16. package/{context.command-15j9b7c0.js → context.command-p6haqjay.js} +20 -18
  17. package/context.runner-rsnqnk9j.js +27 -0
  18. package/{dependencyScanner-3afj2vt1.js → dependencyScanner-78sq8m4q.js} +2 -2
  19. package/{devTui-q7k7bakd.js → devTui-evr3b35y.js} +1 -1
  20. package/{fileSys-wzzrntkw.js → fileSys-zpvt5gtf.js} +1 -1
  21. package/{guideline.command-snh85ctf.js → guideline.command-195g0h9a.js} +4 -4
  22. package/guidelines/agentRule/agentRule.instruction.md +22 -8
  23. package/guidelines/conventions/core.md +106 -0
  24. package/guidelines/conventions/rules/app.md +83 -0
  25. package/guidelines/conventions/rules/auth.md +46 -0
  26. package/guidelines/conventions/rules/config.md +60 -0
  27. package/guidelines/conventions/rules/constant.md +24 -0
  28. package/guidelines/conventions/rules/gates.md +32 -0
  29. package/guidelines/conventions/rules/layer.md +25 -0
  30. package/guidelines/conventions/rules/migration.md +27 -0
  31. package/guidelines/conventions/rules/module.md +90 -0
  32. package/guidelines/conventions/rules/page.md +56 -0
  33. package/guidelines/conventions/rules/sensitive.md +16 -0
  34. package/guidelines/conventions/rules/server.md +91 -0
  35. package/guidelines/conventions/rules/ssr.md +47 -0
  36. package/guidelines/conventions/rules/style.md +43 -0
  37. package/guidelines/conventions/rules/test.md +34 -0
  38. package/guidelines/conventions/rules/ts.md +95 -0
  39. package/guidelines/conventions/rules/tsx.md +76 -0
  40. package/guidelines/mcpRule/mcpRule.instruction.md +1 -1
  41. package/guidelines/pageRule/pageRule.instruction.md +8 -7
  42. package/guidelines/queryRule/queryRule.instruction.md +4 -0
  43. package/guidelines/runtimeRule/runtimeRule.instruction.md +35 -25
  44. package/guidelines/ssrRule/ssrRule.instruction.md +11 -10
  45. package/guidelines/transportRule/transportRule.instruction.md +5 -4
  46. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +4 -4
  47. package/incrementalBuilder.proc.js +7 -7
  48. package/{index-301pdbzz.js → index-00a7j05x.js} +7 -7
  49. package/{index-js6geqjn.js → index-0j1t1h2b.js} +3 -1
  50. package/{index-6txx6a9p.js → index-1h2jc0x3.js} +154 -88
  51. package/{index-55j120r8.js → index-1qsd8ft1.js} +65 -145
  52. package/{index-9th4gszy.js → index-2mwjshz5.js} +233 -1271
  53. package/index-2nxk8wgs.js +266 -0
  54. package/{index-j9vyj3dj.js → index-2phm56a1.js} +49 -8
  55. package/index-35j83zkd.js +61 -0
  56. package/index-4am4dvmf.js +29 -0
  57. package/index-75y7bcz4.js +28 -0
  58. package/index-7apsdr5g.js +487 -0
  59. package/{index-42j4a8zq.js → index-84h43kg6.js} +8 -6
  60. package/index-9bv479q5.js +1 -0
  61. package/{index-3wypz6xj.js → index-9zy8479y.js} +11 -5
  62. package/{index-a5dhqkdr.js → index-a1vb3x7t.js} +273 -259
  63. package/{index-52w0fvh8.js → index-bns3wcpc.js} +15 -0
  64. package/index-cjmjvg4r.js +3622 -0
  65. package/{index-pcwzkdqb.js → index-defp4gmb.js} +1 -1
  66. package/index-ewbmfarf.js +1606 -0
  67. package/index-fbewhg4g.js +590 -0
  68. package/index-fhw7yq2d.js +653 -0
  69. package/{index-wcej7g4z.js → index-g500c5j9.js} +271 -105
  70. package/{index-74tjjsnc.js → index-g841cap9.js} +33 -37
  71. package/{index-2azahjaw.js → index-gr9thy79.js} +5 -5
  72. package/{index-4pf8g7ff.js → index-h7hehkw6.js} +3 -0
  73. package/{index-xjf5j657.js → index-hm0tn7qv.js} +1001 -91
  74. package/index-j6eeh5d7.js +138 -0
  75. package/{index-31es1yev.js → index-j7hwy56s.js} +108 -7
  76. package/{index-skk9zc1x.js → index-jc2zbwra.js} +2 -2
  77. package/{index-905qdgqp.js → index-khk05tsf.js} +1 -1
  78. package/{index-5nd1wtkv.js → index-p6x5b7hr.js} +1 -1
  79. package/{index-tvehn2sp.js → index-qd7xn2bk.js} +1 -1
  80. package/{index-a58emady.js → index-qw6814m4.js} +55 -17
  81. package/index-raz588b3.js +445 -0
  82. package/{index-at7bz0xq.js → index-s4nvxpzm.js} +2 -0
  83. package/{index-bt438yxm.js → index-sp0qsr7a.js} +116 -13
  84. package/{index-xb8809yb.js → index-sveq36gh.js} +40 -43
  85. package/{index-hmt54t45.js → index-t1t9wq9a.js} +4 -4
  86. package/index-t78230d7.js +191 -0
  87. package/index-tenw3mah.js +225 -0
  88. package/{index-qfp55x1y.js → index-tgqameyb.js} +4 -4
  89. package/{index-espk51ah.js → index-tp56652m.js} +6 -6
  90. package/index-w15mg3km.js +389 -0
  91. package/{index-dy0jx9ay.js → index-wwe9rsrx.js} +14 -0
  92. package/{index-2xcc2ax5.js → index-y4kcmbt2.js} +2 -2
  93. package/index-yf9wc28h.js +52 -0
  94. package/{index-0fz95kxe.js → index-zbrwnmf1.js} +9 -7
  95. package/{index-40brg4px.js → index-zttm13c3.js} +5 -5
  96. package/index.js +24 -23
  97. package/{library.command-gycrwhf1.js → library.command-63hgt9te.js} +4 -4
  98. package/{localRegistry.command-jtd8gaes.js → localRegistry.command-g3f8k25t.js} +46 -22
  99. package/{module.command-v6hgs1bc.js → module.command-r4sa2khp.js} +7 -6
  100. package/{package.command-shzpcfph.js → package.command-96eheyvd.js} +5 -5
  101. package/package.json +2 -2
  102. package/{page.command-ptxn5kqk.js → page.command-gs6d841d.js} +4 -4
  103. package/{pipeline.command-zz31pgax.js → pipeline.command-wdfvdbfj.js} +3 -3
  104. package/{primitive.command-a1vse91z.js → primitive.command-dfsv4mpe.js} +8 -7
  105. package/{projectTypecheck-2ztky9cf.js → projectTypecheck-kqj1t6hb.js} +1 -1
  106. package/{prompter-76k56b37.js → prompter-qrwx1p17.js} +2 -2
  107. package/quality.command-webzxee2.js +78 -0
  108. package/{repair.command-cvazbz99.js → repair.command-3r3j1xre.js} +7 -6
  109. package/{routeSourceValidator-6jd0q6r6.js → routeSourceValidator-4h947v7c.js} +13 -3
  110. package/{scalar.command-0acvyp26.js → scalar.command-e8y47j6d.js} +6 -5
  111. package/skills/akan-agent/SKILL.md +43 -0
  112. package/skills/akan-code/SKILL.md +38 -11
  113. package/skills/akan-debug/SKILL.md +41 -6
  114. package/skills/akan-deps/SKILL.md +1 -2
  115. package/skills/akan-err/SKILL.md +2 -1
  116. package/skills/akan-mcp/SKILL.md +40 -0
  117. package/skills/akan-page/SKILL.md +44 -0
  118. package/skills/akan-query/SKILL.md +39 -0
  119. package/skills/akan-runtime/SKILL.md +43 -0
  120. package/skills/akan-scaffold/SKILL.md +16 -6
  121. package/skills/akan-transport/SKILL.md +40 -0
  122. package/skills/akan-validate/SKILL.md +13 -11
  123. package/{subspace.command-822qx2bx.js → subspace.command-a1sf9n5a.js} +12 -10
  124. package/templates/__scalar/__model__/__model__.constant.ts +3 -5
  125. package/templates/__scalar/__model__/__model__.dictionary.ts +6 -5
  126. package/templates/__scalar/__model__/__model__.document.ts +3 -3
  127. package/templates/app/akan.config.ts +2 -3
  128. package/templates/app/env/env.client.ts +2 -4
  129. package/templates/app/env/env.client.type.ts +2 -3
  130. package/templates/app/env/env.server.ts +2 -3
  131. package/templates/app/lib/___appName__/__appName__.dictionary.ts +1 -2
  132. package/templates/app/lib/___appName__/__appName__.service.ts +3 -3
  133. package/templates/app/lib/___appName__/__appName__.signal.ts +5 -5
  134. package/templates/app/lib/___appName__/__appName__.store.ts +4 -6
  135. package/templates/app/lib/option.ts +2 -3
  136. package/templates/app/main.ts +2 -4
  137. package/templates/app/page/_index.tsx +3 -3
  138. package/templates/app/page/_layout.tsx +13 -10
  139. package/templates/appSample/lib/__scalar/workHistory/workHistory.constant.ts +1 -5
  140. package/templates/appSample/lib/__scalar/workHistory/workHistory.dictionary.ts +1 -1
  141. package/templates/appSample/lib/_noti/noti.signal.ts +1 -1
  142. package/templates/appSample/lib/task/Task.Template.tsx +2 -1
  143. package/templates/appSample/lib/task/Task.Unit.tsx +3 -2
  144. package/templates/appSample/lib/task/Task.Util.tsx +16 -4
  145. package/templates/appSample/lib/task/task.constant.ts +1 -5
  146. package/templates/appSample/lib/task/task.dictionary.ts +2 -8
  147. package/templates/appSample/lib/task/task.document.ts +1 -1
  148. package/templates/appSample/lib/task/task.signal.ts +14 -9
  149. package/templates/appSample/page/task/_index.tsx +2 -1
  150. package/templates/appSample/page/task/new.tsx +2 -1
  151. package/templates/appSample/srvkit/guards.ts +11 -0
  152. package/templates/appSample/ui/QuantityControl.tsx +5 -9
  153. package/templates/biomeForm.ts +144 -0
  154. package/templates/crudPages/[__model__Id]/edit/page.tsx +3 -3
  155. package/templates/crudPages/[__model__Id]/page.tsx +5 -5
  156. package/templates/crudPages/new/page.tsx +4 -3
  157. package/templates/crudPages/page.tsx +3 -3
  158. package/templates/crudSinglePage/page.tsx +9 -5
  159. package/templates/libRoot/akan.config.ts +2 -3
  160. package/templates/libRoot/lib/___libName__/__libName__.dictionary.ts +1 -2
  161. package/templates/libRoot/lib/___libName__/__libName__.service.ts +5 -4
  162. package/templates/libRoot/lib/___libName__/__libName__.signal.ts +6 -5
  163. package/templates/libRoot/lib/___libName__/__libName__.store.ts +5 -6
  164. package/templates/libRoot/lib/option.ts +1 -2
  165. package/templates/module/__Model__.Template.tsx +11 -10
  166. package/templates/module/__Model__.Unit.tsx +18 -5
  167. package/templates/module/__Model__.Util.tsx +9 -7
  168. package/templates/module/__Model__.View.tsx +9 -6
  169. package/templates/module/__Model__.Zone.tsx +25 -17
  170. package/templates/module/__model__.constant.ts +8 -9
  171. package/templates/module/__model__.dictionary.ts +16 -17
  172. package/templates/module/__model__.document.ts +6 -8
  173. package/templates/module/__model__.service.ts +3 -3
  174. package/templates/module/__model__.signal.ts +11 -10
  175. package/templates/module/__model__.store.ts +3 -5
  176. package/templates/service/__model__.dictionary.ts +5 -6
  177. package/templates/service/__model__.service.ts +3 -3
  178. package/templates/service/__model__.signal.ts +5 -4
  179. package/templates/service/__model__.store.ts +3 -5
  180. package/templates/workspaceRoot/.gitignore.template +4 -0
  181. package/templates/workspaceRoot/.vscode/settings.json.template +21 -21
  182. package/templates/workspaceRoot/AGENTS.md.template +4 -10
  183. package/{tunnel.command-ycmja19q.js → tunnel.command-dcb0wg93.js} +25 -13
  184. package/{typeChecker-px49mezc.js → typeChecker-j2jdnqsr.js} +1 -1
  185. package/typecheck.proc.js +6 -1
  186. package/verify.command-yyepccbh.js +93 -0
  187. package/{workflow.command-abb1d5xy.js → workflow.command-z5pg9ay0.js} +49 -14
  188. package/workspace.command-d7x5jttw.js +290 -0
  189. package/CodeAgent-8d5qs787.js +0 -9
  190. package/CodeAgentRpcListener-7p7z5dd7.js +0 -97
  191. package/TunnelShare-qkm8zp03.js +0 -14
  192. package/agent.command-ydftceda.js +0 -25
  193. package/cloud.script-nqevg5qw.js +0 -24
  194. package/code.command-9h3yrzhe.js +0 -167
  195. package/context.runner-8gg030b0.js +0 -25
  196. package/guidelines/conventions/conventions.instruction.md +0 -617
  197. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +0 -291
  198. package/index-2mwc0g0d.js +0 -49
  199. package/index-4vgbysa0.js +0 -279
  200. package/index-7md2g9vw.js +0 -6
  201. package/index-b70zct19.js +0 -856
  202. package/index-c6eggbee.js +0 -123
  203. package/index-zzvvc845.js +0 -74
  204. package/quality.command-ah8qcakd.js +0 -1478
  205. package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +0 -69
  206. package/templates/workspaceRoot/docs/GENERATED.md.template +0 -55
  207. package/workspace.command-qm7cw29v.js +0 -521
@@ -1,15 +1,16 @@
1
+ import { BiomeForm } from "../../../biomeForm";
2
+
1
3
  interface Dict {
2
4
  libName: string;
3
5
  LibName: string;
4
6
  }
5
7
  export default function getContent(scanInfo: null, dict: Dict) {
6
- return `
7
- import { endpoint, internal } from "akanjs/signal";
8
+ return `import { endpoint, internal } from "akanjs/signal";
8
9
 
9
10
  import * as srv from "../srv";
10
11
 
11
- export class ${dict.LibName}Internal extends internal(srv.${dict.libName}, () => ({})) {}
12
+ ${BiomeForm.callArgs("", `export class ${dict.LibName}Internal extends internal`, [`srv.${dict.libName}`, "() => ({})"], " {}")}
12
13
 
13
- export class ${dict.LibName}Endpoint extends endpoint(srv.${dict.libName}, () => ({})) {}
14
- `;
14
+ ${BiomeForm.callArgs("", `export class ${dict.LibName}Endpoint extends endpoint`, [`srv.${dict.libName}`, "() => ({})"], " {}")}
15
+ `;
15
16
  }
@@ -1,15 +1,14 @@
1
+ import { BiomeForm } from "../../../biomeForm";
2
+
1
3
  interface Dict {
2
4
  libName: string;
3
5
  LibName: string;
4
6
  }
5
7
  export default function getContent(scanInfo: null, dict: Dict) {
6
- return `
7
- import { store } from "akanjs/store";
8
+ return `import { store } from "akanjs/store";
8
9
 
9
- export class ${dict.LibName}Store extends store("${dict.libName}" as const, () => ({
10
- // state
11
- })) {
10
+ ${BiomeForm.callArgs("", `export class ${dict.LibName}Store extends store`, [`"${dict.libName}" as const`, "() => ({\n // state\n})"], " {")}
12
11
  // action
13
12
  }
14
- `;
13
+ `;
15
14
  }
@@ -4,8 +4,7 @@ interface Dict {
4
4
  [key: string]: string;
5
5
  }
6
6
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict = {}) {
7
- return `
8
- import { AkanOption } from "akanjs/server";
7
+ return `import { AkanOption } from "akanjs/server";
9
8
 
10
9
  import type { LibOptions } from "./srv";
11
10
 
@@ -1,4 +1,5 @@
1
1
  import type { AppInfo, LibInfo } from "akanjs";
2
+ import { BiomeForm } from "../biomeForm";
2
3
 
3
4
  interface Dict {
4
5
  Model: string;
@@ -7,12 +8,16 @@ interface Dict {
7
8
  sysType: string;
8
9
  }
9
10
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
11
+ const { Model, model } = dict;
12
+ const field = {
13
+ tag: "Field.Text",
14
+ attrs: [`label={l("${model}.name")}`, `value={${model}Form.name}`, `onChange={st.do.setNameOn${Model}}`],
15
+ };
10
16
  return {
11
- filename: `${dict.Model}.Template.tsx`,
12
- content: `
13
- "use client";
17
+ filename: `${Model}.Template.tsx`,
18
+ content: `"use client";
19
+ ${BiomeForm.importFrom(["st", "usePage"], `@${dict.sysType}s/${dict.sysName}/client`)}
14
20
  import { Field, Layout } from "akanjs/ui";
15
- import { st, usePage } from "@${dict.sysType}s/${dict.sysName}/client";
16
21
 
17
22
  interface GeneralProps {
18
23
  className?: string;
@@ -20,14 +25,10 @@ interface GeneralProps {
20
25
 
21
26
  export const General = ({ className }: GeneralProps) => {
22
27
  const { l } = usePage();
23
- const ${dict.model}Form = st.use.${dict.model}Form();
28
+ ${BiomeForm.assign(" ", `const ${model}Form`, `st.use.${model}Form`, [], ";")}
24
29
  return (
25
30
  <Layout.Template className={className}>
26
- <Field.Text
27
- label={l("${dict.model}.name")}
28
- value={${dict.model}Form.name}
29
- onChange={st.do.setNameOn${dict.Model}}
30
- />
31
+ ${BiomeForm.element(field, " ")}
31
32
  </Layout.Template>
32
33
  );
33
34
  };
@@ -1,4 +1,5 @@
1
1
  import type { AppInfo, LibInfo } from "akanjs";
2
+ import { BiomeForm } from "../biomeForm";
2
3
 
3
4
  interface Dict {
4
5
  Model: string;
@@ -7,18 +8,30 @@ interface Dict {
7
8
  sysType: string;
8
9
  }
9
10
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
11
+ const { Model, model } = dict;
12
+ const propsType = [`"${model}"`, `cnst.Light${Model}`];
13
+ const flatSignature = BiomeForm.typeArgs(
14
+ "",
15
+ `export const Card = ({ ${model}, href }: ModelProps`,
16
+ propsType,
17
+ ") => {",
18
+ );
19
+ const signature = flatSignature.includes("\n")
20
+ ? `export const Card = ({\n ${model},\n href,\n${BiomeForm.typeArgs("", "}: ModelProps", propsType, ") => {")}`
21
+ : flatSignature;
10
22
  return {
11
- filename: `${dict.Model}.Unit.tsx`,
12
- content: `
23
+ filename: `${Model}.Unit.tsx`,
24
+ content: `${BiomeForm.importFrom(["type cnst", "usePage"], `@${dict.sysType}s/${dict.sysName}/client`)}
13
25
  import type { ModelProps } from "akanjs/client";
14
- import { cnst, usePage } from "@${dict.sysType}s/${dict.sysName}/client";
15
26
  import { Link } from "akanjs/ui";
16
27
 
17
- export const Card = ({ ${dict.model}, href }: ModelProps<"${dict.model}", cnst.Light${dict.Model}>) => {
28
+ ${signature}
18
29
  const { l } = usePage();
19
30
  return (
20
31
  <Link href={href} className="w-full">
21
- <div>{l("${dict.model}.name")}: {${dict.model}.name}</div>
32
+ <div>
33
+ ${BiomeForm.jsxSpaced(" ", `{l("${model}.name")}:`, `{${model}.name}`)}
34
+ </div>
22
35
  </Link>
23
36
  );
24
37
  };
@@ -1,4 +1,5 @@
1
1
  import type { AppInfo, LibInfo } from "akanjs";
2
+ import { BiomeForm } from "../biomeForm";
2
3
 
3
4
  interface Dict {
4
5
  Model: string;
@@ -7,21 +8,22 @@ interface Dict {
7
8
  sysType: string;
8
9
  }
9
10
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
11
+ const { Model, model } = dict;
12
+ const remove = { tag: "Model.Remove", attrs: [`modelId={${model}Id}`, `slice={fetch.slice.${model}}`] };
10
13
  return {
11
- filename: `${dict.Model}.Util.tsx`,
12
- content: `
13
- "use client";
14
+ filename: `${Model}.Util.tsx`,
15
+ content: `"use client";
16
+ ${BiomeForm.importFrom(["fetch", "usePage"], `@${dict.sysType}s/${dict.sysName}/client`)}
14
17
  import { Model } from "akanjs/ui";
15
- import { fetch, usePage } from "@${dict.sysType}s/${dict.sysName}/client";
16
18
  import { BiTrash } from "react-icons/bi";
17
19
 
18
20
  interface RemoveProps {
19
- ${dict.model}Id: string;
21
+ ${model}Id: string;
20
22
  }
21
- export const Remove = ({ ${dict.model}Id }: RemoveProps) => {
23
+ export const Remove = ({ ${model}Id }: RemoveProps) => {
22
24
  const { l } = usePage();
23
25
  return (
24
- <Model.Remove modelId={${dict.model}Id} slice={fetch.slice.${dict.model}}>
26
+ ${BiomeForm.openingTag(remove, " ")}
25
27
  <BiTrash /> {l("base.remove")}
26
28
  </Model.Remove>
27
29
  );
@@ -1,4 +1,5 @@
1
1
  import type { AppInfo, LibInfo } from "akanjs";
2
+ import { BiomeForm } from "../biomeForm";
2
3
 
3
4
  interface Dict {
4
5
  Model: string;
@@ -7,21 +8,23 @@ interface Dict {
7
8
  sysType: string;
8
9
  }
9
10
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
11
+ const { Model, model } = dict;
10
12
  return {
11
- filename: `${dict.Model}.View.tsx`,
12
- content: `
13
+ filename: `${Model}.View.tsx`,
14
+ content: `${BiomeForm.importFrom(["type cnst", "usePage"], `@${dict.sysType}s/${dict.sysName}/client`)}
13
15
  import { cn } from "akanjs/client";
14
- import { cnst, usePage } from "@${dict.sysType}s/${dict.sysName}/client";
15
16
 
16
17
  interface GeneralProps {
17
18
  className?: string;
18
- ${dict.model}: cnst.${dict.Model};
19
+ ${model}: cnst.${Model};
19
20
  }
20
- export const General = ({ className, ${dict.model} }: GeneralProps) => {
21
+ export const General = ({ className, ${model} }: GeneralProps) => {
21
22
  const { l } = usePage();
22
23
  return (
23
24
  <div className={cn("w-full", className)}>
24
- <div>{l("${dict.model}.name")}: {${dict.model}.name}</div>
25
+ <div>
26
+ ${BiomeForm.jsxSpaced(" ", `{l("${model}.name")}:`, `{${model}.name}`)}
27
+ </div>
25
28
  </div>
26
29
  );
27
30
  };
@@ -1,4 +1,5 @@
1
1
  import type { AppInfo, LibInfo } from "akanjs";
2
+ import { BiomeForm } from "../biomeForm";
2
3
 
3
4
  interface Dict {
4
5
  Model: string;
@@ -7,37 +8,44 @@ interface Dict {
7
8
  sysType: string;
8
9
  }
9
10
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
11
+ const { Model, model } = dict;
12
+ const card = {
13
+ tag: `${Model}.Unit.Card`,
14
+ attrs: [`key={${model}.id}`, `href={\`/${model}/\${${model}.id}\`}`, `${model}={${model}}`],
15
+ };
16
+ const units = {
17
+ tag: "Load.Units",
18
+ attrs: ["className={className}", "init={init}", { name: "renderItem", param: model, body: card }],
19
+ };
20
+ const view = {
21
+ tag: "Load.View",
22
+ attrs: [
23
+ "view={view}",
24
+ { name: "renderView", param: model, body: { tag: `${Model}.View.General`, attrs: [`${model}={${model}}`] } },
25
+ ],
26
+ };
10
27
  return {
11
- filename: `${dict.Model}.Zone.tsx`,
12
- content: `
13
- "use client";
14
- import { Load } from "akanjs/ui";
15
- import { type cnst, ${dict.Model} as ${dict.Model} } from "@${dict.sysType}s/${dict.sysName}/client";
28
+ filename: `${Model}.Zone.tsx`,
29
+ content: `"use client";
30
+ ${BiomeForm.importFrom(["type cnst", Model], `@${dict.sysType}s/${dict.sysName}/client`)}
16
31
  import type { ClientInit, ClientView, SliceMeta } from "akanjs/fetch";
32
+ import { Load } from "akanjs/ui";
17
33
 
18
34
  interface CardProps {
19
35
  className?: string;
20
- init: ClientInit<"${dict.model}", cnst.Light${dict.Model}>;
36
+ ${BiomeForm.typeArgs(" ", "init: ClientInit", [`"${model}"`, `cnst.Light${Model}`], ";")}
21
37
  slice?: SliceMeta;
22
38
  }
23
39
  export const Card = ({ className, init, slice }: CardProps) => {
24
- return (
25
- <Load.Units
26
- className={className}
27
- init={init}
28
- renderItem={(${dict.model}) => (
29
- <${dict.Model}.Unit.Card key={${dict.model}.id} href={\`/${dict.model}/\${${dict.model}.id}\`} ${dict.model}={${dict.model}} />
30
- )}
31
- />
32
- );
40
+ ${BiomeForm.returnElement(units, " ")}
33
41
  };
34
42
 
35
43
  interface ViewProps {
36
44
  className?: string;
37
- view: ClientView<"${dict.model}", cnst.${dict.Model}>;
45
+ ${BiomeForm.typeArgs(" ", "view: ClientView", [`"${model}"`, `cnst.${Model}`], ";")}
38
46
  }
39
47
  export const View = ({ view }: ViewProps) => {
40
- return <Load.View view={view} renderView={(${dict.model}) => <${dict.Model}.View.General ${dict.model}={${dict.model}} />} />;
48
+ ${BiomeForm.returnElement(view, " ")}
41
49
  };
42
50
  `,
43
51
  };
@@ -1,4 +1,5 @@
1
1
  import type { AppInfo, LibInfo } from "akanjs";
2
+ import { BiomeForm } from "../biomeForm";
2
3
 
3
4
  interface Dict {
4
5
  Model: string;
@@ -6,19 +7,17 @@ interface Dict {
6
7
  sysName: string;
7
8
  }
8
9
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
9
- return `
10
- import { via } from "akanjs/constant";
10
+ const { Model } = dict;
11
+ return `import { via } from "akanjs/constant";
11
12
 
12
- export class ${dict.Model}Input extends via((field) => ({
13
- name: field(String),
14
- })) {}
13
+ ${BiomeForm.callArgs("", `export class ${Model}Input extends via`, ["(field) => ({\n name: field(String),\n})"], " {}")}
15
14
 
16
- export class ${dict.Model}Object extends via(${dict.Model}Input, (field) => ({})) {}
15
+ ${BiomeForm.callArgs("", `export class ${Model}Object extends via`, [`${Model}Input`, "(field) => ({})"], " {}")}
17
16
 
18
- export class Light${dict.Model} extends via(${dict.Model}Object, ["name"] as const, (resolve) => ({})) {}
17
+ ${BiomeForm.callArgs("", `export class Light${Model} extends via`, [`${Model}Object`, '["name"] as const', "(resolve) => ({})"], " {}")}
19
18
 
20
- export class ${dict.Model} extends via(${dict.Model}Object, Light${dict.Model}, (resolve) => ({})) {}
19
+ ${BiomeForm.callArgs("", `export class ${Model} extends via`, [`${Model}Object`, `Light${Model}`, "(resolve) => ({})"], " {}")}
21
20
 
22
- export class ${dict.Model}Insight extends via(${dict.Model}, (field) => ({})) {}
21
+ ${BiomeForm.callArgs("", `export class ${Model}Insight extends via`, [Model, "(field) => ({})"], " {}")}
23
22
  `;
24
23
  }
@@ -1,4 +1,5 @@
1
1
  import type { AppInfo, LibInfo } from "akanjs";
2
+ import { BiomeForm } from "../biomeForm";
2
3
 
3
4
  interface Dict {
4
5
  Model: string;
@@ -10,31 +11,29 @@ interface Dict {
10
11
  sysName: string;
11
12
  }
12
13
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
13
- const modelLabelEn = dict.modelLabelEn ?? dict.Model;
14
- const modelLabelKo = dict.modelLabelKo ?? dict.Model;
14
+ const { Model, model } = dict;
15
+ const modelLabelEn = dict.modelLabelEn ?? Model;
16
+ const modelLabelKo = dict.modelLabelKo ?? Model;
15
17
  const modelDescEn = dict.modelDescEn ?? `Manage ${modelLabelEn.toLowerCase()}.`;
16
18
  const modelDescKo = dict.modelDescKo ?? `${modelLabelKo}을 관리합니다.`;
17
- return `
18
- import { modelDictionary } from "akanjs/dictionary";
19
+ return `import { modelDictionary } from "akanjs/dictionary";
19
20
 
20
- import type { ${dict.Model}, ${dict.Model}Insight } from "./${dict.model}.constant";
21
- import type { ${dict.Model}Filter } from "./${dict.model}.document";
22
- import type { ${dict.Model}Endpoint, ${dict.Model}Slice } from "./${dict.model}.signal";
21
+ ${BiomeForm.importFrom([Model, `${Model}Insight`], `./${model}.constant`, { typeOnly: true })}
22
+ ${BiomeForm.importFrom([`${Model}Filter`], `./${model}.document`, { typeOnly: true })}
23
+ ${BiomeForm.importFrom([`${Model}Endpoint`, `${Model}Slice`], `./${model}.signal`, { typeOnly: true })}
23
24
 
24
25
  export const dictionary = modelDictionary(["en", "ko"])
25
- .of((t) =>
26
- t(["${modelLabelEn}", "${modelLabelKo}"]).desc(["${modelDescEn}", "${modelDescKo}"])
27
- )
28
- .model<${dict.Model}>((t) => ({
26
+ ${BiomeForm.dictionaryOf([modelLabelEn, modelLabelKo], [modelDescEn, modelDescKo])}
27
+ .model<${Model}>((t) => ({
29
28
  name: t(["Name", "이름"]).desc(["Name", "이름"]),
30
29
  }))
31
- .insight<${dict.Model}Insight>((t) => ({}))
32
- .query<${dict.Model}Filter>((fn) => ({}))
33
- .sort<${dict.Model}Filter>((t) => ({}))
34
- .slice<${dict.Model}Slice>((fn) => ({
35
- inPublic: fn(["${dict.Model} In Public", "${dict.Model} 공개"]).arg((t) => ({})),
30
+ .insight<${Model}Insight>((t) => ({}))
31
+ .query<${Model}Filter>((fn) => ({}))
32
+ .sort<${Model}Filter>((t) => ({}))
33
+ .slice<${Model}Slice>((fn) => ({
34
+ ${BiomeForm.dictionarySlice("inPublic", [`${Model} In Public`, `${Model} 공개`])}
36
35
  }))
37
- .endpoint<${dict.Model}Endpoint>((fn) => ({}))
36
+ .endpoint<${Model}Endpoint>((fn) => ({}))
38
37
  .error({})
39
38
  .translate({});
40
39
  `;
@@ -1,4 +1,5 @@
1
1
  import type { AppInfo, LibInfo } from "akanjs";
2
+ import { BiomeForm } from "../biomeForm";
2
3
 
3
4
  interface Dict {
4
5
  Model: string;
@@ -6,18 +7,15 @@ interface Dict {
6
7
  appName: string;
7
8
  }
8
9
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
9
- return `
10
- import { by, from, into } from "akanjs/document";
10
+ const { Model, model } = dict;
11
+ return `import { by, from, into } from "akanjs/document";
11
12
 
12
13
  import * as cnst from "../cnst";
13
14
 
14
- export class ${dict.Model}Filter extends from(cnst.${dict.Model}, (filter) => ({
15
- query: {},
16
- sort: {},
17
- })) {}
15
+ ${BiomeForm.callArgs("", `export class ${Model}Filter extends from`, [`cnst.${Model}`, "(filter) => ({\n query: {},\n sort: {},\n})"], " {}")}
18
16
 
19
- export class ${dict.Model} extends by(cnst.${dict.Model}) {}
17
+ ${BiomeForm.callArgs("", `export class ${Model} extends by`, [`cnst.${Model}`], " {}")}
20
18
 
21
- export class ${dict.Model}Model extends into(${dict.Model}, ${dict.Model}Filter, cnst.${dict.model}, () => ({})) {}
19
+ ${BiomeForm.callArgs("", `export class ${Model}Model extends into`, [Model, `${Model}Filter`, `cnst.${model}`, "() => ({})"], " {}")}
22
20
  `;
23
21
  }
@@ -1,4 +1,5 @@
1
1
  import type { AppInfo, LibInfo } from "akanjs";
2
+ import { BiomeForm } from "../biomeForm";
2
3
 
3
4
  interface Dict {
4
5
  Model: string;
@@ -6,11 +7,10 @@ interface Dict {
6
7
  appName: string;
7
8
  }
8
9
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
9
- return `
10
- import { serve } from "akanjs/service";
10
+ return `import { serve } from "akanjs/service";
11
11
 
12
12
  import * as db from "../db";
13
13
 
14
- export class ${dict.Model}Service extends serve(db.${dict.model}, ({ use, service }) => ({})) {}
14
+ ${BiomeForm.callArgs("", `export class ${dict.Model}Service extends serve`, [`db.${dict.model}`, "({ use, service }) => ({})"], " {}")}
15
15
  `;
16
16
  }
@@ -1,4 +1,5 @@
1
1
  import type { AppInfo, LibInfo } from "akanjs";
2
+ import { BiomeForm } from "../biomeForm";
2
3
 
3
4
  interface Dict {
4
5
  Model: string;
@@ -10,25 +11,25 @@ interface Options {
10
11
  sharedGuards?: boolean;
11
12
  }
12
13
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict, options: Options = {}) {
14
+ const { Model, model } = dict;
13
15
  // Admin lives in libs/shared; without it root and cru stay None, shut until the app names a guard of its own.
14
16
  const guardImports = options.sharedGuards
15
17
  ? `import { Admin } from "@libs/shared/srvkit";\nimport { endpoint, internal, Public, slice } from "akanjs/signal";`
16
18
  : `import { endpoint, internal, None, Public, slice } from "akanjs/signal";`;
17
19
  const writeGuard = options.sharedGuards ? "Admin" : "None";
18
- return `
19
- ${guardImports}
20
+ const sliceBody = `(init) => ({
21
+ inPublic: init({ guards: [Public] }).exec(function () {
22
+ return this.${model}Service.queryAny();
23
+ }),
24
+ })`;
25
+ return `${guardImports}
20
26
 
21
27
  import * as srv from "../srv";
22
28
 
23
- export class ${dict.Model}Internal extends internal(srv.${dict.model}, ({ interval }) => ({})) {}
29
+ ${BiomeForm.callArgs("", `export class ${Model}Internal extends internal`, [`srv.${model}`, "({ interval }) => ({})"], " {}")}
24
30
 
25
- export class ${dict.Model}Slice extends slice(srv.${dict.model}, { guards: { root: ${writeGuard}, get: Public, cru: ${writeGuard} } }, (init) => ({
26
- inPublic: init({ guards: [Public] })
27
- .exec(function () {
28
- return this.${dict.model}Service.queryAny();
29
- }),
30
- })) {}
31
+ ${BiomeForm.callArgs("", `export class ${Model}Slice extends slice`, [`srv.${model}`, `{ guards: { root: ${writeGuard}, get: Public, cru: ${writeGuard} } }`, sliceBody], " {}")}
31
32
 
32
- export class ${dict.Model}Endpoint extends endpoint(srv.${dict.model}, ({ query, mutation }) => ({})) {}
33
+ ${BiomeForm.callArgs("", `export class ${Model}Endpoint extends endpoint`, [`srv.${model}`, "({ query, mutation }) => ({})"], " {}")}
33
34
  `;
34
35
  }
@@ -1,4 +1,5 @@
1
1
  import type { AppInfo, LibInfo } from "akanjs";
2
+ import { BiomeForm } from "../biomeForm";
2
3
 
3
4
  interface Dict {
4
5
  Model: string;
@@ -6,14 +7,11 @@ interface Dict {
6
7
  sysName: string;
7
8
  }
8
9
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
9
- return `
10
- import { store } from "akanjs/store";
10
+ return `import { store } from "akanjs/store";
11
11
 
12
12
  import { sig } from "../useClient";
13
13
 
14
- export class ${dict.Model}Store extends store(sig.${dict.model}, () => ({
15
- // state
16
- })) {
14
+ ${BiomeForm.callArgs("", `export class ${dict.Model}Store extends store`, [`sig.${dict.model}`, "() => ({\n // state\n})"], " {")}
17
15
  // action
18
16
  }
19
17
  `;
@@ -5,14 +5,13 @@ interface Dict {
5
5
  model: string;
6
6
  }
7
7
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
8
- return `
9
- import { modelDictionary } from "akanjs/dictionary";
8
+ const { Model } = dict;
9
+ return `import { serviceDictionary } from "akanjs/dictionary";
10
10
 
11
- import type { ${dict.Model}Endpoint } from "../sig";
11
+ import type { ${Model}Endpoint } from "../sig";
12
12
 
13
- export const dictionary = modelDictionary(["en", "ko"])
14
- .of((t) => t(["${dict.model}", "${dict.model}"]).desc(["${dict.model} description", "${dict.model} 설명"]))
15
- .endpoint<${dict.Model}Endpoint>((fn) => ({}))
13
+ export const dictionary = serviceDictionary(["en", "ko"])
14
+ .endpoint<${Model}Endpoint>((fn) => ({}))
16
15
  .error({})
17
16
  .translate({});
18
17
  `;
@@ -1,13 +1,13 @@
1
1
  import type { AppInfo, LibInfo } from "akanjs";
2
+ import { BiomeForm } from "../biomeForm";
2
3
 
3
4
  interface Dict {
4
5
  Model: string;
5
6
  model: string;
6
7
  }
7
8
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
8
- return `
9
- import { serve } from "akanjs/service";
9
+ return `import { serve } from "akanjs/service";
10
10
 
11
- export class ${dict.Model}Service extends serve("${dict.model}" as const, ({ use, service, env, signal }) => ({})) {}
11
+ ${BiomeForm.callArgs("", `export class ${dict.Model}Service extends serve`, [`"${dict.model}" as const`, "({ use, service, env, signal }) => ({})"], " {}")}
12
12
  `;
13
13
  }
@@ -1,17 +1,18 @@
1
1
  import type { AppInfo, LibInfo } from "akanjs";
2
+ import { BiomeForm } from "../biomeForm";
2
3
 
3
4
  interface Dict {
4
5
  Model: string;
5
6
  model: string;
6
7
  }
7
8
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
8
- return `
9
- import { endpoint, internal } from "akanjs/signal";
9
+ const { Model, model } = dict;
10
+ return `import { endpoint, internal } from "akanjs/signal";
10
11
 
11
12
  import * as srv from "../srv";
12
13
 
13
- export class ${dict.Model}Internal extends internal(srv.${dict.model}, () => ({})) {}
14
+ ${BiomeForm.callArgs("", `export class ${Model}Internal extends internal`, [`srv.${model}`, "() => ({})"], " {}")}
14
15
 
15
- export class ${dict.Model}Endpoint extends endpoint(srv.${dict.model}, ({ query, mutation }) => ({})) {}
16
+ ${BiomeForm.callArgs("", `export class ${Model}Endpoint extends endpoint`, [`srv.${model}`, "({ query, mutation }) => ({})"], " {}")}
16
17
  `;
17
18
  }
@@ -1,16 +1,14 @@
1
1
  import type { AppInfo, LibInfo } from "akanjs";
2
+ import { BiomeForm } from "../biomeForm";
2
3
 
3
4
  interface Dict {
4
5
  Model: string;
5
6
  model: string;
6
7
  }
7
8
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
8
- return `
9
- import { store } from "akanjs/store";
9
+ return `import { store } from "akanjs/store";
10
10
 
11
- export class ${dict.Model}Store extends store("${dict.model}" as const, () => ({
12
- // state
13
- })) {
11
+ ${BiomeForm.callArgs("", `export class ${dict.Model}Store extends store`, [`"${dict.model}" as const`, "() => ({\n // state\n})"], " {")}
14
12
  // action
15
13
  }
16
14
  `;
@@ -11,6 +11,7 @@ apps/*/data
11
11
  apps/*/scripts
12
12
  **/env.client.*.ts
13
13
  !**/env.client.type.ts
14
+ !**/env.client.example.ts
14
15
  **/env.server.*.ts
15
16
  !**/env.server.example.ts
16
17
  **/*secrets.yaml
@@ -18,6 +19,9 @@ apps/*/scripts
18
19
  **/secrets.*
19
20
  dump
20
21
  local
22
+ .claude/worktrees/
23
+ .claude/settings.local.json
24
+ .claude/scheduled_tasks.lock
21
25
 
22
26
  # Xcode
23
27
  build/
@@ -1,23 +1,23 @@
1
1
  {
2
- "typescript.tsdk": "node_modules/typescript/lib",
3
- "editor.defaultFormatter": "biomejs.biome",
4
- "editor.formatOnSave": true,
5
- "editor.codeActionsOnSave": {
6
- "source.fixAll.biome": "always"
7
- },
8
- "[typescript]": {
9
- "editor.defaultFormatter": "biomejs.biome"
10
- },
11
- "[typescriptreact]": {
12
- "editor.defaultFormatter": "biomejs.biome"
13
- },
14
- "[javascript]": {
15
- "editor.defaultFormatter": "biomejs.biome"
16
- },
17
- "[javascriptreact]": {
18
- "editor.defaultFormatter": "biomejs.biome"
19
- },
20
- "[json]": {
21
- "editor.defaultFormatter": "biomejs.biome"
22
- }
2
+ "typescript.tsdk": "node_modules/typescript/lib",
3
+ "editor.defaultFormatter": "biomejs.biome",
4
+ "editor.formatOnSave": true,
5
+ "editor.codeActionsOnSave": {
6
+ "source.fixAll.biome": "always"
7
+ },
8
+ "[typescript]": {
9
+ "editor.defaultFormatter": "biomejs.biome"
10
+ },
11
+ "[typescriptreact]": {
12
+ "editor.defaultFormatter": "biomejs.biome"
13
+ },
14
+ "[javascript]": {
15
+ "editor.defaultFormatter": "biomejs.biome"
16
+ },
17
+ "[javascriptreact]": {
18
+ "editor.defaultFormatter": "biomejs.biome"
19
+ },
20
+ "[json]": {
21
+ "editor.defaultFormatter": "biomejs.biome"
22
+ }
23
23
  }