@akanjs/cli 3.1.1-rc.9 → 3.1.1
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.
- package/.build-stamp +1 -1
- package/CodeAgent-35wnb7w5.js +9 -0
- package/{CodeTui-z5vkm9ea.js → CodeTui-h6yz2kvq.js} +1 -1
- package/TunnelShare-xyjpa7gx.js +14 -0
- package/agent.command-3r4jsck8.js +46 -0
- package/akanCode.js +10 -6
- package/{application.command-wthg8nn9.js → application.command-g7xv6ad0.js} +44 -11
- package/{applicationBuildRunner-t2r84sz6.js → applicationBuildRunner-qvjnhr9j.js} +9 -6
- package/buildBatch.proc.js +6 -6
- package/{cloud.command-sz11hpre.js → cloud.command-6ebygmhw.js} +17 -15
- package/cloud.script-0s1jybd5.js +26 -0
- package/{code.command-9h3yrzhe.js → code.command-mpkm2emr.js} +6 -6
- package/commandManifest.json +1 -1
- package/{context.command-15j9b7c0.js → context.command-svdh6b2w.js} +18 -17
- package/context.runner-ch0z3a8g.js +26 -0
- package/{devTui-q7k7bakd.js → devTui-evr3b35y.js} +1 -1
- package/{guideline.command-snh85ctf.js → guideline.command-qwp3tnjx.js} +3 -3
- package/guidelines/conventions/core.md +106 -0
- package/guidelines/conventions/rules/app.md +83 -0
- package/guidelines/conventions/rules/auth.md +45 -0
- package/guidelines/conventions/rules/config.md +56 -0
- package/guidelines/conventions/rules/constant.md +24 -0
- package/guidelines/conventions/rules/gates.md +31 -0
- package/guidelines/conventions/rules/layer.md +25 -0
- package/guidelines/conventions/rules/migration.md +27 -0
- package/guidelines/conventions/rules/module.md +90 -0
- package/guidelines/conventions/rules/page.md +56 -0
- package/guidelines/conventions/rules/sensitive.md +16 -0
- package/guidelines/conventions/rules/server.md +86 -0
- package/guidelines/conventions/rules/ssr.md +47 -0
- package/guidelines/conventions/rules/style.md +43 -0
- package/guidelines/conventions/rules/test.md +34 -0
- package/guidelines/conventions/rules/ts.md +95 -0
- package/guidelines/conventions/rules/tsx.md +75 -0
- package/guidelines/mcpRule/mcpRule.instruction.md +1 -1
- package/guidelines/pageRule/pageRule.instruction.md +4 -3
- package/guidelines/queryRule/queryRule.instruction.md +4 -0
- package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +3 -3
- package/incrementalBuilder.proc.js +6 -6
- package/{index-pcwzkdqb.js → index-1p0qbq3m.js} +1 -1
- package/{index-xb8809yb.js → index-1shvxzt0.js} +3 -3
- package/{index-a58emady.js → index-266dewjs.js} +11 -11
- package/{index-bt438yxm.js → index-3yz30c07.js} +5 -4
- package/{index-xjf5j657.js → index-4mj92tsh.js} +952 -47
- package/index-4pdts00b.js +1604 -0
- package/{index-42j4a8zq.js → index-8559hsz4.js} +4 -3
- package/{index-wcej7g4z.js → index-8scw1pjk.js} +93 -23
- package/{index-a5dhqkdr.js → index-96wzdhfh.js} +74 -233
- package/index-9bv479q5.js +1 -0
- package/index-9rvcs76p.js +653 -0
- package/index-am36s3jh.js +3582 -0
- package/index-b8c289dx.js +444 -0
- package/{index-espk51ah.js → index-dd44g6vz.js} +3 -3
- package/{index-3wypz6xj.js → index-eja64h28.js} +7 -3
- package/index-fbewhg4g.js +590 -0
- package/index-jje9qzyq.js +27 -0
- package/{index-j9vyj3dj.js → index-k5jbcxyh.js} +3 -3
- package/{index-2mwc0g0d.js → index-ksfgqq1x.js} +1 -1
- package/index-m5n3ka0p.js +18 -0
- package/{index-5nd1wtkv.js → index-p6x5b7hr.js} +1 -1
- package/{index-6txx6a9p.js → index-payhwt51.js} +21 -29
- package/{index-2azahjaw.js → index-qkkdhjm6.js} +2 -2
- package/{index-74tjjsnc.js → index-qxzrp5xt.js} +33 -37
- package/{index-qfp55x1y.js → index-r0k3ham2.js} +4 -4
- package/{index-hmt54t45.js → index-r2w2eh93.js} +4 -4
- package/index-r2wedvqn.js +138 -0
- package/{index-skk9zc1x.js → index-rnphv731.js} +2 -2
- package/{index-9th4gszy.js → index-s6da8ta9.js} +82 -1227
- package/index-tenw3mah.js +225 -0
- package/{index-31es1yev.js → index-tgt2fnd6.js} +107 -6
- package/{index-55j120r8.js → index-vxmy1p4f.js} +16 -36
- package/{index-301pdbzz.js → index-w4k2ragk.js} +7 -7
- package/{index-js6geqjn.js → index-w7q6h97v.js} +1 -1
- package/{index-dy0jx9ay.js → index-wwe9rsrx.js} +14 -0
- package/{index-2xcc2ax5.js → index-xq543a5y.js} +2 -2
- package/{index-0fz95kxe.js → index-xqgwjz7a.js} +1 -1
- package/{index-40brg4px.js → index-xxfy1jp2.js} +4 -4
- package/{index-905qdgqp.js → index-z4b84y6k.js} +1 -1
- package/index-zcf6k8a5.js +410 -0
- package/index.js +23 -22
- package/{library.command-gycrwhf1.js → library.command-2853y6mk.js} +3 -3
- package/{localRegistry.command-jtd8gaes.js → localRegistry.command-76ds31p4.js} +19 -15
- package/{module.command-v6hgs1bc.js → module.command-yfnb0abs.js} +5 -5
- package/{package.command-shzpcfph.js → package.command-d9s86hp9.js} +3 -3
- package/package.json +2 -2
- package/{page.command-ptxn5kqk.js → page.command-6a8a8rd1.js} +3 -3
- package/{pipeline.command-zz31pgax.js → pipeline.command-rt3rwd2z.js} +2 -2
- package/{primitive.command-a1vse91z.js → primitive.command-emcebgrq.js} +6 -6
- package/{projectTypecheck-2ztky9cf.js → projectTypecheck-51m7eh1f.js} +1 -1
- package/{prompter-76k56b37.js → prompter-hgcta8pb.js} +1 -1
- package/quality.command-xtrk0n3x.js +76 -0
- package/{repair.command-cvazbz99.js → repair.command-51szxnxx.js} +5 -5
- package/{routeSourceValidator-6jd0q6r6.js → routeSourceValidator-4h947v7c.js} +13 -3
- package/{scalar.command-0acvyp26.js → scalar.command-8qv27t82.js} +4 -4
- package/skills/akan-agent/SKILL.md +36 -0
- package/skills/akan-code/SKILL.md +1 -0
- package/skills/akan-debug/SKILL.md +40 -6
- package/skills/akan-deps/SKILL.md +1 -2
- package/skills/akan-mcp/SKILL.md +40 -0
- package/skills/akan-page/SKILL.md +44 -0
- package/skills/akan-query/SKILL.md +38 -0
- package/skills/akan-runtime/SKILL.md +40 -0
- package/skills/akan-scaffold/SKILL.md +16 -6
- package/skills/akan-transport/SKILL.md +40 -0
- package/skills/akan-validate/SKILL.md +13 -11
- package/{subspace.command-822qx2bx.js → subspace.command-pn56pnh8.js} +8 -8
- package/templates/__scalar/__model__/__model__.constant.ts +3 -5
- package/templates/__scalar/__model__/__model__.dictionary.ts +6 -5
- package/templates/__scalar/__model__/__model__.document.ts +3 -3
- package/templates/app/akan.config.ts +2 -3
- package/templates/app/env/env.client.ts +2 -4
- package/templates/app/env/env.client.type.ts +2 -3
- package/templates/app/env/env.server.ts +2 -3
- package/templates/app/lib/___appName__/__appName__.dictionary.ts +1 -2
- package/templates/app/lib/___appName__/__appName__.service.ts +3 -3
- package/templates/app/lib/___appName__/__appName__.signal.ts +5 -5
- package/templates/app/lib/___appName__/__appName__.store.ts +4 -6
- package/templates/app/lib/option.ts +2 -3
- package/templates/app/main.ts +2 -4
- package/templates/app/page/_index.tsx +3 -3
- package/templates/app/page/_layout.tsx +13 -10
- package/templates/appSample/lib/__scalar/workHistory/workHistory.constant.ts +1 -5
- package/templates/appSample/lib/__scalar/workHistory/workHistory.dictionary.ts +1 -1
- package/templates/appSample/lib/_noti/noti.signal.ts +1 -1
- package/templates/appSample/lib/task/Task.Template.tsx +2 -1
- package/templates/appSample/lib/task/Task.Unit.tsx +3 -2
- package/templates/appSample/lib/task/Task.Util.tsx +16 -4
- package/templates/appSample/lib/task/task.constant.ts +1 -5
- package/templates/appSample/lib/task/task.dictionary.ts +2 -8
- package/templates/appSample/lib/task/task.document.ts +1 -1
- package/templates/appSample/page/task/_index.tsx +2 -1
- package/templates/appSample/page/task/new.tsx +2 -1
- package/templates/appSample/ui/QuantityControl.tsx +5 -9
- package/templates/biomeForm.ts +144 -0
- package/templates/crudPages/[__model__Id]/edit/page.tsx +3 -3
- package/templates/crudPages/[__model__Id]/page.tsx +5 -5
- package/templates/crudPages/new/page.tsx +4 -3
- package/templates/crudPages/page.tsx +3 -3
- package/templates/crudSinglePage/page.tsx +9 -5
- package/templates/libRoot/akan.config.ts +2 -3
- package/templates/libRoot/lib/___libName__/__libName__.dictionary.ts +1 -2
- package/templates/libRoot/lib/___libName__/__libName__.service.ts +5 -4
- package/templates/libRoot/lib/___libName__/__libName__.signal.ts +6 -5
- package/templates/libRoot/lib/___libName__/__libName__.store.ts +5 -6
- package/templates/libRoot/lib/option.ts +1 -2
- package/templates/module/__Model__.Template.tsx +11 -10
- package/templates/module/__Model__.Unit.tsx +18 -5
- package/templates/module/__Model__.Util.tsx +9 -7
- package/templates/module/__Model__.View.tsx +9 -6
- package/templates/module/__Model__.Zone.tsx +25 -17
- package/templates/module/__model__.constant.ts +8 -9
- package/templates/module/__model__.dictionary.ts +16 -17
- package/templates/module/__model__.document.ts +6 -8
- package/templates/module/__model__.service.ts +3 -3
- package/templates/module/__model__.signal.ts +11 -10
- package/templates/module/__model__.store.ts +3 -5
- package/templates/service/__model__.dictionary.ts +6 -5
- package/templates/service/__model__.service.ts +3 -3
- package/templates/service/__model__.signal.ts +5 -4
- package/templates/service/__model__.store.ts +3 -5
- package/templates/workspaceRoot/.gitignore.template +3 -0
- package/templates/workspaceRoot/.vscode/settings.json.template +21 -21
- package/templates/workspaceRoot/AGENTS.md.template +4 -10
- package/{tunnel.command-ycmja19q.js → tunnel.command-q2h0j2en.js} +7 -7
- package/{typeChecker-px49mezc.js → typeChecker-j2jdnqsr.js} +1 -1
- package/typecheck.proc.js +6 -1
- package/verify.command-z1dsbmrt.js +91 -0
- package/{workflow.command-abb1d5xy.js → workflow.command-r3y67jeq.js} +47 -13
- package/workspace.command-t2f0xsrw.js +263 -0
- package/CodeAgent-8d5qs787.js +0 -9
- package/TunnelShare-qkm8zp03.js +0 -14
- package/agent.command-ydftceda.js +0 -25
- package/cloud.script-nqevg5qw.js +0 -24
- package/context.runner-8gg030b0.js +0 -25
- package/guidelines/conventions/conventions.instruction.md +0 -617
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +0 -291
- package/index-4vgbysa0.js +0 -279
- package/index-7md2g9vw.js +0 -6
- package/index-b70zct19.js +0 -856
- package/index-zzvvc845.js +0 -74
- package/quality.command-ah8qcakd.js +0 -1478
- package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +0 -69
- package/templates/workspaceRoot/docs/GENERATED.md.template +0 -55
- package/workspace.command-qm7cw29v.js +0 -521
|
@@ -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;
|
|
@@ -9,8 +10,7 @@ interface Dict {
|
|
|
9
10
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
|
|
10
11
|
return {
|
|
11
12
|
filename: "_index.tsx",
|
|
12
|
-
content:
|
|
13
|
-
import { ${dict.Model}, fetch, usePage } from "${dict.clientPath}";
|
|
13
|
+
content: `${BiomeForm.importFrom([dict.Model, "fetch", "usePage"], dict.clientPath)}
|
|
14
14
|
import { ID } from "akanjs/base";
|
|
15
15
|
import { page } from "akanjs/client";
|
|
16
16
|
import { Load } from "akanjs/ui";
|
|
@@ -20,7 +20,7 @@ export default page()
|
|
|
20
20
|
.config({ transition: "none" })
|
|
21
21
|
.render(({ ${dict.model}Id }) => {
|
|
22
22
|
const { l } = usePage();
|
|
23
|
-
const { ${dict.model}Edit }
|
|
23
|
+
${BiomeForm.assign(" ", `const { ${dict.model}Edit }`, `fetch.edit${dict.Model}`, [`${dict.model}Id`], ";")}
|
|
24
24
|
return (
|
|
25
25
|
<div className="container">
|
|
26
26
|
<div className="m-4 mt-8 flex justify-between">
|
|
@@ -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;
|
|
@@ -9,8 +10,7 @@ interface Dict {
|
|
|
9
10
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
|
|
10
11
|
return {
|
|
11
12
|
filename: "_index.tsx",
|
|
12
|
-
content:
|
|
13
|
-
import { ${dict.Model}, fetch, usePage } from "${dict.clientPath}";
|
|
13
|
+
content: `${BiomeForm.importFrom([dict.Model, "fetch", "usePage"], dict.clientPath)}
|
|
14
14
|
import { ID } from "akanjs/base";
|
|
15
15
|
import { page } from "akanjs/client";
|
|
16
16
|
import { buttonRecipe, Link } from "akanjs/ui";
|
|
@@ -28,12 +28,12 @@ export default page()
|
|
|
28
28
|
))
|
|
29
29
|
.render(({ ${dict.model}Id }) => {
|
|
30
30
|
const { l } = usePage();
|
|
31
|
-
const { ${dict.model}View }
|
|
31
|
+
${BiomeForm.assign(" ", `const { ${dict.model}View }`, `fetch.view${dict.Model}`, [`${dict.model}Id`], ";")}
|
|
32
32
|
return (
|
|
33
33
|
<div className="container flex flex-col gap-4">
|
|
34
34
|
<div className="flex items-center gap-4 font-bold text-lg">
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
${BiomeForm.element({ tag: `${dict.Model}.Zone.View`, attrs: [`view={${dict.model}View}`] }, " ")}
|
|
36
|
+
${BiomeForm.openingTag({ tag: "Link", attrs: ["className={buttonRecipe()}", `href={\`/${dict.model}/\${${dict.model}Id}/edit\`}`] }, " ")}
|
|
37
37
|
{l("base.updateModel", { model: l("${dict.model}.modelName") })}
|
|
38
38
|
</Link>
|
|
39
39
|
</div>
|
|
@@ -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,10 +8,10 @@ interface Dict {
|
|
|
7
8
|
clientPath: string;
|
|
8
9
|
}
|
|
9
10
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
|
|
11
|
+
const form = ` const ${dict.model}Form: Partial<cnst.${dict.Model}> =`;
|
|
10
12
|
return {
|
|
11
13
|
filename: "_index.tsx",
|
|
12
|
-
content:
|
|
13
|
-
import { type cnst, fetch, usePage, ${dict.Model} } from "${dict.clientPath}";
|
|
14
|
+
content: `${BiomeForm.importFrom(["type cnst", "fetch", "usePage", dict.Model], dict.clientPath)}
|
|
14
15
|
import { page } from "akanjs/client";
|
|
15
16
|
import { Load } from "akanjs/ui";
|
|
16
17
|
|
|
@@ -18,7 +19,7 @@ export default page()
|
|
|
18
19
|
.config({ transition: "none" })
|
|
19
20
|
.render(() => {
|
|
20
21
|
const { l } = usePage();
|
|
21
|
-
|
|
22
|
+
${BiomeForm.fits(`${form} {};`) ? `${form} {};` : `${form}\n {};`}
|
|
22
23
|
return (
|
|
23
24
|
<div className="container">
|
|
24
25
|
<div className="m-4 mt-8 flex justify-between">
|
|
@@ -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;
|
|
@@ -9,8 +10,7 @@ interface Dict {
|
|
|
9
10
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
|
|
10
11
|
return {
|
|
11
12
|
filename: "_index.tsx",
|
|
12
|
-
content:
|
|
13
|
-
import { ${dict.Model}, fetch, usePage } from "${dict.clientPath}";
|
|
13
|
+
content: `${BiomeForm.importFrom([dict.Model, "fetch", "usePage"], dict.clientPath)}
|
|
14
14
|
import { page } from "akanjs/client";
|
|
15
15
|
import { buttonRecipe, Link } from "akanjs/ui";
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ export default page()
|
|
|
18
18
|
.config({ transition: "none" })
|
|
19
19
|
.render(() => {
|
|
20
20
|
const { l } = usePage();
|
|
21
|
-
const { ${dict.model}InitInPublic }
|
|
21
|
+
${BiomeForm.assign(" ", `const { ${dict.model}InitInPublic }`, `fetch.init${dict.Model}InPublic`, [], ";")}
|
|
22
22
|
return (
|
|
23
23
|
<div className="container flex flex-col gap-4">
|
|
24
24
|
<div className="mt-5 h-full w-full px-5">
|
|
@@ -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;
|
|
@@ -9,8 +10,7 @@ interface Dict {
|
|
|
9
10
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
|
|
10
11
|
return {
|
|
11
12
|
filename: "_index.tsx",
|
|
12
|
-
content:
|
|
13
|
-
import { ${dict.Model}, fetch, usePage } from "${dict.clientPath}";
|
|
13
|
+
content: `${BiomeForm.importFrom([dict.Model, "fetch", "usePage"], dict.clientPath)}
|
|
14
14
|
import { page } from "akanjs/client";
|
|
15
15
|
import { buttonRecipe, Model } from "akanjs/ui";
|
|
16
16
|
|
|
@@ -18,13 +18,17 @@ export default page()
|
|
|
18
18
|
.config({ transition: "none" })
|
|
19
19
|
.render(() => {
|
|
20
20
|
const { l } = usePage();
|
|
21
|
-
const { ${dict.model}InitInPublic }
|
|
21
|
+
${BiomeForm.assign(" ", `const { ${dict.model}InitInPublic }`, `fetch.init${dict.Model}InPublic`, [], ";")}
|
|
22
22
|
return (
|
|
23
23
|
<>
|
|
24
24
|
<div className="flex animate-fadeIn items-center gap-4 px-4 pt-4">
|
|
25
|
-
<div className="font-bold text-lg md:text-4xl">{l("${dict.model}.modelName")}</div>
|
|
25
|
+
${BiomeForm.wrap(" ", '<div className="font-bold text-lg md:text-4xl">', `{l("${dict.model}.modelName")}`, "</div>")}
|
|
26
26
|
<Model.New
|
|
27
|
-
trigger={
|
|
27
|
+
trigger={
|
|
28
|
+
<button type="button" className={buttonRecipe({ size: "sm", variant: "ghost" })}>
|
|
29
|
+
{l("base.new")}
|
|
30
|
+
</button>
|
|
31
|
+
}
|
|
28
32
|
slice={fetch.slice.${dict.model}InPublic}
|
|
29
33
|
renderTitle="id"
|
|
30
34
|
>
|
|
@@ -2,11 +2,10 @@ interface Dict {
|
|
|
2
2
|
libName: string;
|
|
3
3
|
}
|
|
4
4
|
export default function getContent(scanInfo: null, dict: Dict) {
|
|
5
|
-
return `
|
|
6
|
-
import type { LibConfig } from "akanjs";
|
|
5
|
+
return `import type { LibConfig } from "akanjs";
|
|
7
6
|
|
|
8
7
|
const config: LibConfig = {};
|
|
9
8
|
|
|
10
9
|
export default config;
|
|
11
|
-
|
|
10
|
+
`;
|
|
12
11
|
}
|
|
@@ -3,8 +3,7 @@ interface Dict {
|
|
|
3
3
|
LibName: string;
|
|
4
4
|
}
|
|
5
5
|
export default function getContent(scanInfo: null, dict: Dict) {
|
|
6
|
-
return `
|
|
7
|
-
import { serviceDictionary } from "akanjs/dictionary";
|
|
6
|
+
return `import { serviceDictionary } from "akanjs/dictionary";
|
|
8
7
|
|
|
9
8
|
import type { ${dict.LibName}Endpoint } from "./${dict.libName}.signal";
|
|
10
9
|
|
|
@@ -1,13 +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 { serve } from "akanjs/service";
|
|
8
|
+
return `import { serve } from "akanjs/service";
|
|
8
9
|
|
|
9
10
|
// import type * as srv from "../srv";
|
|
10
11
|
|
|
11
|
-
export class ${dict.LibName}Service extends serve
|
|
12
|
-
|
|
12
|
+
${BiomeForm.callArgs("", `export class ${dict.LibName}Service extends serve`, [`"${dict.libName}" as const`, '{ serverMode: "batch" }', "() => ({})"], " {}")}
|
|
13
|
+
`;
|
|
13
14
|
}
|
|
@@ -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
|
|
12
|
+
${BiomeForm.callArgs("", `export class ${dict.LibName}Internal extends internal`, [`srv.${dict.libName}`, "() => ({})"], " {}")}
|
|
12
13
|
|
|
13
|
-
export class ${dict.LibName}Endpoint extends endpoint
|
|
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
|
|
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: `${
|
|
12
|
-
content: `
|
|
13
|
-
"
|
|
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 ${
|
|
28
|
+
${BiomeForm.assign(" ", `const ${model}Form`, `st.use.${model}Form`, [], ";")}
|
|
24
29
|
return (
|
|
25
30
|
<Layout.Template className={className}>
|
|
26
|
-
|
|
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: `${
|
|
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
|
-
|
|
28
|
+
${signature}
|
|
18
29
|
const { l } = usePage();
|
|
19
30
|
return (
|
|
20
31
|
<Link href={href} className="w-full">
|
|
21
|
-
<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: `${
|
|
12
|
-
content: `
|
|
13
|
-
"
|
|
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
|
-
${
|
|
21
|
+
${model}Id: string;
|
|
20
22
|
}
|
|
21
|
-
export const Remove = ({ ${
|
|
23
|
+
export const Remove = ({ ${model}Id }: RemoveProps) => {
|
|
22
24
|
const { l } = usePage();
|
|
23
25
|
return (
|
|
24
|
-
|
|
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: `${
|
|
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
|
-
${
|
|
19
|
+
${model}: cnst.${Model};
|
|
19
20
|
}
|
|
20
|
-
export const General = ({ className, ${
|
|
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>
|
|
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: `${
|
|
12
|
-
content: `
|
|
13
|
-
"
|
|
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
|
|
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
|
-
|
|
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
|
|
45
|
+
${BiomeForm.typeArgs(" ", "view: ClientView", [`"${model}"`, `cnst.${Model}`], ";")}
|
|
38
46
|
}
|
|
39
47
|
export const View = ({ view }: ViewProps) => {
|
|
40
|
-
|
|
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
|
-
|
|
10
|
-
import { via } from "akanjs/constant";
|
|
10
|
+
const { Model } = dict;
|
|
11
|
+
return `import { via } from "akanjs/constant";
|
|
11
12
|
|
|
12
|
-
export class ${
|
|
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 ${
|
|
15
|
+
${BiomeForm.callArgs("", `export class ${Model}Object extends via`, [`${Model}Input`, "(field) => ({})"], " {}")}
|
|
17
16
|
|
|
18
|
-
export class Light${
|
|
17
|
+
${BiomeForm.callArgs("", `export class Light${Model} extends via`, [`${Model}Object`, '["name"] as const', "(resolve) => ({})"], " {}")}
|
|
19
18
|
|
|
20
|
-
export class ${
|
|
19
|
+
${BiomeForm.callArgs("", `export class ${Model} extends via`, [`${Model}Object`, `Light${Model}`, "(resolve) => ({})"], " {}")}
|
|
21
20
|
|
|
22
|
-
export class ${
|
|
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
|
|
14
|
-
const
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
26
|
-
|
|
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<${
|
|
32
|
-
.query<${
|
|
33
|
-
.sort<${
|
|
34
|
-
.slice<${
|
|
35
|
-
|
|
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<${
|
|
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
|
-
|
|
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 ${
|
|
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 ${
|
|
17
|
+
${BiomeForm.callArgs("", `export class ${Model} extends by`, [`cnst.${Model}`], " {}")}
|
|
20
18
|
|
|
21
|
-
export class ${
|
|
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
|
|
14
|
+
${BiomeForm.callArgs("", `export class ${dict.Model}Service extends serve`, [`db.${dict.model}`, "({ use, service }) => ({})"], " {}")}
|
|
15
15
|
`;
|
|
16
16
|
}
|