@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
package/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
baed8b96dcb1b721166e9b494e8ccfc8d2748a0a4220b6e96628ca5f271663bd
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
TunnelShare2
|
|
4
|
+
} from "./index-ksfgqq1x.js";
|
|
5
|
+
import"./index-qkkdhjm6.js";
|
|
6
|
+
import"./index-3yz30c07.js";
|
|
7
|
+
import"./index-m9jj544v.js";
|
|
8
|
+
import"./index-1shvxzt0.js";
|
|
9
|
+
import"./index-xqgwjz7a.js";
|
|
10
|
+
import"./index-8scw1pjk.js";
|
|
11
|
+
import"./index-52w0fvh8.js";
|
|
12
|
+
export {
|
|
13
|
+
TunnelShare2 as TunnelShare
|
|
14
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
Workspace,
|
|
4
|
+
command
|
|
5
|
+
} from "./index-eja64h28.js";
|
|
6
|
+
import"./index-52w0fvh8.js";
|
|
7
|
+
import"./index-8scw1pjk.js";
|
|
8
|
+
import"./index-r2wedvqn.js";
|
|
9
|
+
import"./index-hj6w4ka1.js";
|
|
10
|
+
import"./index-4mj92tsh.js";
|
|
11
|
+
import"./index-tgt2fnd6.js";
|
|
12
|
+
import"./index-s6da8ta9.js";
|
|
13
|
+
import"./index-p6x5b7hr.js";
|
|
14
|
+
import"./index-3yz30c07.js";
|
|
15
|
+
import"./index-w7q6h97v.js";
|
|
16
|
+
import"./index-m9jj544v.js";
|
|
17
|
+
import"./index-1shvxzt0.js";
|
|
18
|
+
import"./index-xqgwjz7a.js";
|
|
19
|
+
import"./index-am36s3jh.js";
|
|
20
|
+
import"./index-62md4dwy.js";
|
|
21
|
+
import"./index-fbewhg4g.js";
|
|
22
|
+
import {
|
|
23
|
+
AgentScript
|
|
24
|
+
} from "./index-9rvcs76p.js";
|
|
25
|
+
import"./index-b8c289dx.js";
|
|
26
|
+
import"./index-1p0qbq3m.js";
|
|
27
|
+
|
|
28
|
+
// pkgs/@akanjs/cli/agent/agent.command.ts
|
|
29
|
+
class AgentCommand extends command("agent", [AgentScript], ({ public: target }) => ({
|
|
30
|
+
agent: target({ desc: "Install Akan agent rules for editors and coding agents", stdio: true }).arg("action", String, { desc: "install, or hook (run by Claude Code hooks)" }).arg("target", String, {
|
|
31
|
+
desc: "install: cursor, agents-md, claude, rules, skills, hooks, or all; hook: pre-edit, post-edit, stop",
|
|
32
|
+
nullable: true
|
|
33
|
+
}).option("force", Boolean, {
|
|
34
|
+
desc: "overwrite existing pointer files and generated files you took over",
|
|
35
|
+
default: false
|
|
36
|
+
}).option("check", Boolean, {
|
|
37
|
+
desc: "write nothing; exit 1 when install would create, change or remove a file",
|
|
38
|
+
default: false
|
|
39
|
+
}).with(Workspace).exec(async function(action, targetName, force, check, workspace) {
|
|
40
|
+
await this.agentScript.agent(workspace, action, targetName, { force, check });
|
|
41
|
+
})
|
|
42
|
+
})) {
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
AgentCommand
|
|
46
|
+
};
|
package/akanCode.js
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
import {
|
|
3
3
|
AkanEditScope2,
|
|
4
4
|
DevLogFeedback2,
|
|
5
|
-
PreviewChrome2,
|
|
6
|
-
PreviewView2,
|
|
7
5
|
PreviewFeedback2,
|
|
8
6
|
TurnFeedback2,
|
|
9
7
|
AkanCli2,
|
|
@@ -28,7 +26,7 @@ import {
|
|
|
28
26
|
CodeMailbox2,
|
|
29
27
|
CodeSessionFork2,
|
|
30
28
|
CodeAgent2
|
|
31
|
-
} from "./index-
|
|
29
|
+
} from "./index-96wzdhfh.js";
|
|
32
30
|
import {
|
|
33
31
|
akanCodeDefaultModel2,
|
|
34
32
|
akanCodeModel2,
|
|
@@ -38,10 +36,12 @@ import {
|
|
|
38
36
|
} from "./index-c6eggbee.js";
|
|
39
37
|
import {
|
|
40
38
|
SubagentPool2,
|
|
41
|
-
akanCodePaths2,
|
|
42
39
|
AkanCodeCompaction2
|
|
43
|
-
} from "./index-
|
|
44
|
-
import
|
|
40
|
+
} from "./index-vxmy1p4f.js";
|
|
41
|
+
import {
|
|
42
|
+
PreviewChrome2,
|
|
43
|
+
PreviewView2
|
|
44
|
+
} from "./index-tenw3mah.js";
|
|
45
45
|
import {
|
|
46
46
|
CodeAgentRpcHost2
|
|
47
47
|
} from "./index-at7bz0xq.js";
|
|
@@ -55,6 +55,10 @@ import {
|
|
|
55
55
|
CodeTuiMarkdown2,
|
|
56
56
|
CodeTuiParts2
|
|
57
57
|
} from "./index-2mrn1mrg.js";
|
|
58
|
+
import"./index-9bv479q5.js";
|
|
59
|
+
import {
|
|
60
|
+
akanCodePaths2
|
|
61
|
+
} from "./index-jje9qzyq.js";
|
|
58
62
|
export {
|
|
59
63
|
AkanCli2 as AkanCli,
|
|
60
64
|
AkanCodeCompaction2 as AkanCodeCompaction,
|
|
@@ -7,20 +7,21 @@ import {
|
|
|
7
7
|
Exec,
|
|
8
8
|
Workspace,
|
|
9
9
|
command
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-eja64h28.js";
|
|
11
11
|
import"./index-52w0fvh8.js";
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
12
|
+
import"./index-8scw1pjk.js";
|
|
13
|
+
import"./index-p6x5b7hr.js";
|
|
14
|
+
import"./index-3yz30c07.js";
|
|
15
|
+
import"./index-w7q6h97v.js";
|
|
16
16
|
import"./index-m9jj544v.js";
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
17
|
+
import"./index-1shvxzt0.js";
|
|
18
|
+
import"./index-xqgwjz7a.js";
|
|
19
|
+
import"./index-xq543a5y.js";
|
|
20
|
+
import"./index-s6da8ta9.js";
|
|
20
21
|
import {
|
|
21
22
|
ApplicationScript
|
|
22
|
-
} from "./index-
|
|
23
|
-
import"./index-
|
|
23
|
+
} from "./index-4pdts00b.js";
|
|
24
|
+
import"./index-tenw3mah.js";
|
|
24
25
|
import {
|
|
25
26
|
writeOption,
|
|
26
27
|
nativeTargetOption,
|
|
@@ -28,7 +29,8 @@ import {
|
|
|
28
29
|
allowLocalOption,
|
|
29
30
|
publicEnvOption
|
|
30
31
|
} from "./index-mdjc93e1.js";
|
|
31
|
-
import"./index-
|
|
32
|
+
import"./index-1p0qbq3m.js";
|
|
33
|
+
import"./index-9bv479q5.js";
|
|
32
34
|
|
|
33
35
|
// pkgs/@akanjs/cli/application/application.command.ts
|
|
34
36
|
import { MigrationCommand } from "akanjs/server/migration/migrationCommand";
|
|
@@ -88,6 +90,37 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
|
|
|
88
90
|
createMigration: target({ desc: "Create a data migration in the app's script/migration" }).arg("migrationName", String, { desc: "what it does, in camelCase", example: "bizLicenseOwnership" }).with(App).exec(async function(migrationName, app) {
|
|
89
91
|
await this.applicationScript.createMigration(app, migrationName);
|
|
90
92
|
}),
|
|
93
|
+
preview: target({
|
|
94
|
+
desc: "Open pages of the app's dev server in a headless browser and print what broke, starting a server if none runs",
|
|
95
|
+
stdio: true
|
|
96
|
+
}).with(App).arg("paths", String, {
|
|
97
|
+
desc: "page paths, comma-separated; the default locale is added when missing (default: /)",
|
|
98
|
+
example: "/board,/board/new",
|
|
99
|
+
nullable: true
|
|
100
|
+
}).option("changed", Boolean, {
|
|
101
|
+
flag: "C",
|
|
102
|
+
desc: "also open the pages the uncommitted page and layout changes reach (/ when no route changed)",
|
|
103
|
+
default: false
|
|
104
|
+
}).option("csr", Boolean, { desc: "load each page as a native app does, in its CSR boot", default: false }).option("engine", String, {
|
|
105
|
+
desc: "browser engine (default: webkit on macOS, chrome elsewhere)",
|
|
106
|
+
enum: ["webkit", "chrome"],
|
|
107
|
+
nullable: true
|
|
108
|
+
}).option("screenshot", Boolean, {
|
|
109
|
+
desc: "save a screenshot per page under local/apps/<app>/runtime/preview",
|
|
110
|
+
default: false
|
|
111
|
+
}).option("desktop", Boolean, { desc: "a 1280x800 viewport instead of the 390x844 phone one", default: false }).option("keep", Boolean, { desc: "leave a server this command started running", default: false }).option("timeout", Number, { desc: "seconds a page may take to load", default: 60 }).option("format", String, { desc: "output format", default: "text", enum: ["text", "json"] }).exec(async function(app, paths, changed, csr, engine, screenshot, desktop, keep, timeout, format) {
|
|
112
|
+
await this.applicationScript.preview(app, {
|
|
113
|
+
paths: (paths ?? "").split(",").map((entry) => entry.trim()).filter(Boolean),
|
|
114
|
+
changed,
|
|
115
|
+
csr,
|
|
116
|
+
engine: engine === "webkit" || engine === "chrome" ? engine : null,
|
|
117
|
+
screenshot,
|
|
118
|
+
desktop,
|
|
119
|
+
keep,
|
|
120
|
+
timeoutMs: timeout * 1000,
|
|
121
|
+
format: format === "json" ? "json" : "text"
|
|
122
|
+
});
|
|
123
|
+
}),
|
|
91
124
|
console: target({ desc: "Open an interactive server console for the application" }).with(App).exec(async function(app) {
|
|
92
125
|
await this.applicationScript.console(app);
|
|
93
126
|
}),
|
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
Spinner,
|
|
5
5
|
ProjectTypecheck2,
|
|
6
6
|
WorkspaceExecutor
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-8scw1pjk.js";
|
|
8
8
|
import"./index-52w0fvh8.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
import"./index-dd44g6vz.js";
|
|
10
|
+
import"./index-xqgwjz7a.js";
|
|
11
11
|
import {
|
|
12
12
|
AllRoutesBuilder,
|
|
13
13
|
FontPruner,
|
|
14
14
|
precompressArtifacts,
|
|
15
15
|
SsrBaseArtifactBuilder
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-xxfy1jp2.js";
|
|
17
17
|
import {
|
|
18
18
|
CsrArtifactBuilder
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-1shvxzt0.js";
|
|
20
20
|
import"./index-62md4dwy.js";
|
|
21
21
|
|
|
22
22
|
// pkgs/@akanjs/devkit/applicationBuildRunner.ts
|
|
@@ -36,9 +36,11 @@ class ProductionLockfile {
|
|
|
36
36
|
throw new Error(`the workspace root has no ${ProductionLockfile.fileName}`);
|
|
37
37
|
const dir = await mkdtemp(path.join(os.tmpdir(), "akan-production-lock-"));
|
|
38
38
|
try {
|
|
39
|
+
const npmrc = Bun.file(path.join(workspaceRoot, ".npmrc"));
|
|
39
40
|
await Promise.all([
|
|
40
41
|
Bun.write(path.join(dir, "package.json"), JSON.stringify(packageJson, null, 2)),
|
|
41
|
-
Bun.write(path.join(dir, ProductionLockfile.fileName), workspaceLock)
|
|
42
|
+
Bun.write(path.join(dir, ProductionLockfile.fileName), workspaceLock),
|
|
43
|
+
...await npmrc.exists() ? [Bun.write(path.join(dir, ".npmrc"), npmrc)] : []
|
|
42
44
|
]);
|
|
43
45
|
const install = Bun.spawn([process.execPath, "install", "--lockfile-only", "--no-progress"], {
|
|
44
46
|
cwd: dir,
|
|
@@ -209,6 +211,7 @@ class ApplicationBuildRunner {
|
|
|
209
211
|
"../../page/**/*.ts",
|
|
210
212
|
"../../page/**/*.tsx",
|
|
211
213
|
...libPageIncludes,
|
|
214
|
+
...options.tests ? ["../../script/**/*.ts"] : [],
|
|
212
215
|
"../../../../pkgs/akanjs/*/types/**/*.d.ts"
|
|
213
216
|
], options);
|
|
214
217
|
}
|
package/buildBatch.proc.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ApplicationBuildReporter
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-p6x5b7hr.js";
|
|
5
5
|
import {
|
|
6
6
|
resolveSsrPageEntriesForApp,
|
|
7
7
|
WorkspaceExecutor,
|
|
8
8
|
AppExecutor
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-8scw1pjk.js";
|
|
10
10
|
import {
|
|
11
11
|
computeRouteSeedIndex,
|
|
12
12
|
saveRouteSeedIndex,
|
|
13
13
|
CsrDevBundler,
|
|
14
14
|
SsrDevBundler
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-dd44g6vz.js";
|
|
16
16
|
import"./index-52w0fvh8.js";
|
|
17
17
|
import {
|
|
18
18
|
ServerGraphFile,
|
|
19
19
|
PagesBundleBuilder
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-xqgwjz7a.js";
|
|
21
21
|
import {
|
|
22
22
|
CssCompiler,
|
|
23
23
|
FontOptimizer,
|
|
24
24
|
SsrBaseArtifactBuilder
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-xxfy1jp2.js";
|
|
26
26
|
import {
|
|
27
27
|
CsrArtifactBuilder
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-1shvxzt0.js";
|
|
29
29
|
import"./index-62md4dwy.js";
|
|
30
30
|
|
|
31
31
|
// pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
|
|
@@ -3,27 +3,28 @@ import {
|
|
|
3
3
|
App,
|
|
4
4
|
Workspace,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-eja64h28.js";
|
|
7
7
|
import"./index-52w0fvh8.js";
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
8
|
+
import"./index-8scw1pjk.js";
|
|
9
|
+
import"./index-qkkdhjm6.js";
|
|
10
10
|
import {
|
|
11
11
|
PlatformTestRun
|
|
12
|
-
} from "./index-
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-
|
|
12
|
+
} from "./index-payhwt51.js";
|
|
13
|
+
import"./index-3yz30c07.js";
|
|
14
|
+
import"./index-w7q6h97v.js";
|
|
15
15
|
import"./index-m9jj544v.js";
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-
|
|
16
|
+
import"./index-1shvxzt0.js";
|
|
17
|
+
import"./index-xqgwjz7a.js";
|
|
18
|
+
import"./index-p6x5b7hr.js";
|
|
19
|
+
import"./index-xq543a5y.js";
|
|
20
|
+
import"./index-s6da8ta9.js";
|
|
21
|
+
import"./index-4pdts00b.js";
|
|
22
|
+
import"./index-tenw3mah.js";
|
|
22
23
|
import"./index-tvehn2sp.js";
|
|
23
|
-
import"./index-
|
|
24
|
+
import"./index-8559hsz4.js";
|
|
24
25
|
import {
|
|
25
26
|
CloudScript2
|
|
26
|
-
} from "./index-
|
|
27
|
+
} from "./index-w4k2ragk.js";
|
|
27
28
|
import {
|
|
28
29
|
writeOption,
|
|
29
30
|
oneNativeTargetOption,
|
|
@@ -34,7 +35,8 @@ import {
|
|
|
34
35
|
hostOption,
|
|
35
36
|
subspaceOption
|
|
36
37
|
} from "./index-mdjc93e1.js";
|
|
37
|
-
import"./index-
|
|
38
|
+
import"./index-1p0qbq3m.js";
|
|
39
|
+
import"./index-9bv479q5.js";
|
|
38
40
|
|
|
39
41
|
// pkgs/@akanjs/cli/cloud/cloud.command.ts
|
|
40
42
|
var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
CloudScript2
|
|
4
|
+
} from "./index-w4k2ragk.js";
|
|
5
|
+
import"./index-payhwt51.js";
|
|
6
|
+
import"./index-4pdts00b.js";
|
|
7
|
+
import"./index-xq543a5y.js";
|
|
8
|
+
import"./index-8559hsz4.js";
|
|
9
|
+
import"./index-qkkdhjm6.js";
|
|
10
|
+
import"./index-s6da8ta9.js";
|
|
11
|
+
import"./index-1p0qbq3m.js";
|
|
12
|
+
import"./index-w7q6h97v.js";
|
|
13
|
+
import"./index-3yz30c07.js";
|
|
14
|
+
import"./index-m9jj544v.js";
|
|
15
|
+
import"./index-eja64h28.js";
|
|
16
|
+
import"./index-9bv479q5.js";
|
|
17
|
+
import"./index-tenw3mah.js";
|
|
18
|
+
import"./index-1shvxzt0.js";
|
|
19
|
+
import"./index-p6x5b7hr.js";
|
|
20
|
+
import"./index-xqgwjz7a.js";
|
|
21
|
+
import"./index-8scw1pjk.js";
|
|
22
|
+
import"./index-tvehn2sp.js";
|
|
23
|
+
import"./index-52w0fvh8.js";
|
|
24
|
+
export {
|
|
25
|
+
CloudScript2 as CloudScript
|
|
26
|
+
};
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
runner,
|
|
5
5
|
script,
|
|
6
6
|
command
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-eja64h28.js";
|
|
8
8
|
import"./index-52w0fvh8.js";
|
|
9
|
-
import"./index-
|
|
9
|
+
import"./index-8scw1pjk.js";
|
|
10
10
|
import {
|
|
11
11
|
akanCodeDefaultModel2,
|
|
12
12
|
CodeAgentStreamPrinter2
|
|
@@ -19,7 +19,7 @@ class CodeRunner extends runner("code") {
|
|
|
19
19
|
async serve(options, listen) {
|
|
20
20
|
await import("./consoleToStderr-h5bryj94.js");
|
|
21
21
|
const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
|
|
22
|
-
import("./CodeAgent-
|
|
22
|
+
import("./CodeAgent-35wnb7w5.js"),
|
|
23
23
|
import("./CodeAgentRpcHost-9g27hmer.js"),
|
|
24
24
|
import("./CodeAgentRpcListener-7p7z5dd7.js")
|
|
25
25
|
]);
|
|
@@ -34,8 +34,8 @@ class CodeRunner extends runner("code") {
|
|
|
34
34
|
}
|
|
35
35
|
async tui(options, seed) {
|
|
36
36
|
const [{ CodeAgent }, { CodeTui }] = await Promise.all([
|
|
37
|
-
import("./CodeAgent-
|
|
38
|
-
import("./CodeTui-
|
|
37
|
+
import("./CodeAgent-35wnb7w5.js"),
|
|
38
|
+
import("./CodeTui-h6yz2kvq.js")
|
|
39
39
|
]);
|
|
40
40
|
const agentOptions = await CodeRunner.#agentOptions(options, false);
|
|
41
41
|
let resume = options.resume;
|
|
@@ -67,7 +67,7 @@ class CodeRunner extends runner("code") {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
async run(prompt, options) {
|
|
70
|
-
const { CodeAgent } = await import("./CodeAgent-
|
|
70
|
+
const { CodeAgent } = await import("./CodeAgent-35wnb7w5.js");
|
|
71
71
|
const agent = await CodeAgent.create(await CodeRunner.#agentOptions(options, false));
|
|
72
72
|
const printer = new CodeAgentStreamPrinter2({ json: options.json, thinking: options.thinking });
|
|
73
73
|
agent.on((event) => printer.print(event));
|
package/commandManifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","machine-keygen":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","code":"code","create-application":"application","remove-application":"application","plan-slice":"application","sync":"application","script":"application","migrate":"application","create-migration":"application","console":"application","logs":"application","build":"application","b":"application","typecheck":"application","t":"application","test":"application","build-ios":"application","bi":"application","build-android":"application","ba":"application","build-desktop":"application","bd":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","start-desktop":"application","sd":"application","release-ios":"application","release-android":"application","pack-update":"application","update-keygen":"application","publish-update":"application","dbup":"application","db-export":"application","db-import":"application","dbdown":"application","create-library":"library","remove-library":"library","sync-library":"library","library-status":"library","install-library":"library","start-registry":"localRegistry","reset-registry":"localRegistry","smoke-registry":"localRegistry","version":"package","create-package":"package","remove-package":"package","sync-package":"package","build-package":"package","verify-dist-package":"package","verify-akan-publish-packages":"package","create-module":"module","remove-module":"module","create-service":"module","create-view":"module","create-unit":"module","create-template":"module","create-crud-page":"page","context":"context","doctor":"context","mcp-install":"context","mcp":"context","mcp-call":"context","login":"cloud","logout":"cloud","deploy-akan":"cloud","test-platforms":"cloud","update":"cloud","push-update":"cloud","register-binary":"cloud","upload-secret":"cloud","list-secrets":"cloud","remove-secret":"cloud","download-env":"cloud","upload-env":"cloud","subspace":"subspace","guideline":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","repair":"repair","workflow":"workflow","pipeline":"pipeline","tunnel":"tunnel"}}
|
|
1
|
+
{"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","machine-keygen":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","code":"code","create-application":"application","remove-application":"application","plan-slice":"application","sync":"application","script":"application","migrate":"application","create-migration":"application","preview":"application","console":"application","logs":"application","build":"application","b":"application","typecheck":"application","t":"application","test":"application","build-ios":"application","bi":"application","build-android":"application","ba":"application","build-desktop":"application","bd":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","start-desktop":"application","sd":"application","release-ios":"application","release-android":"application","pack-update":"application","update-keygen":"application","publish-update":"application","dbup":"application","db-export":"application","db-import":"application","dbdown":"application","create-library":"library","remove-library":"library","sync-library":"library","library-status":"library","install-library":"library","start-registry":"localRegistry","reset-registry":"localRegistry","smoke-registry":"localRegistry","version":"package","create-package":"package","remove-package":"package","sync-package":"package","build-package":"package","verify-dist-package":"package","verify-akan-publish-packages":"package","create-module":"module","remove-module":"module","create-service":"module","create-view":"module","create-unit":"module","create-template":"module","create-crud-page":"page","context":"context","doctor":"context","mcp-install":"context","mcp":"context","mcp-call":"context","login":"cloud","logout":"cloud","deploy-akan":"cloud","test-platforms":"cloud","update":"cloud","push-update":"cloud","register-binary":"cloud","upload-secret":"cloud","list-secrets":"cloud","remove-secret":"cloud","download-env":"cloud","upload-env":"cloud","subspace":"subspace","guideline":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","verify":"verify","repair":"repair","workflow":"workflow","pipeline":"pipeline","tunnel":"tunnel"}}
|
|
@@ -2,28 +2,29 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Workspace,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-eja64h28.js";
|
|
6
6
|
import"./index-52w0fvh8.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-8scw1pjk.js";
|
|
8
8
|
import"./index-hj6w4ka1.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
9
|
+
import"./index-4mj92tsh.js";
|
|
10
|
+
import"./index-tgt2fnd6.js";
|
|
11
|
+
import"./index-266dewjs.js";
|
|
12
|
+
import"./index-3yz30c07.js";
|
|
13
|
+
import"./index-w7q6h97v.js";
|
|
14
14
|
import"./index-m9jj544v.js";
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-
|
|
22
|
-
import"./index-
|
|
23
|
-
import"./index-
|
|
15
|
+
import"./index-1shvxzt0.js";
|
|
16
|
+
import"./index-xqgwjz7a.js";
|
|
17
|
+
import"./index-r2wedvqn.js";
|
|
18
|
+
import"./index-k5jbcxyh.js";
|
|
19
|
+
import"./index-z4b84y6k.js";
|
|
20
|
+
import"./index-r2w2eh93.js";
|
|
21
|
+
import"./index-qxzrp5xt.js";
|
|
22
|
+
import"./index-rnphv731.js";
|
|
23
|
+
import"./index-fbewhg4g.js";
|
|
24
|
+
import"./index-zcf6k8a5.js";
|
|
24
25
|
import {
|
|
25
26
|
ContextScript
|
|
26
|
-
} from "./index-
|
|
27
|
+
} from "./index-r0k3ham2.js";
|
|
27
28
|
|
|
28
29
|
// pkgs/@akanjs/cli/context/context.command.ts
|
|
29
30
|
class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
ContextRunner2
|
|
4
|
+
} from "./index-266dewjs.js";
|
|
5
|
+
import"./index-zcf6k8a5.js";
|
|
6
|
+
import"./index-rnphv731.js";
|
|
7
|
+
import"./index-qxzrp5xt.js";
|
|
8
|
+
import"./index-k5jbcxyh.js";
|
|
9
|
+
import"./index-r2w2eh93.js";
|
|
10
|
+
import"./index-z4b84y6k.js";
|
|
11
|
+
import"./index-fbewhg4g.js";
|
|
12
|
+
import"./index-tgt2fnd6.js";
|
|
13
|
+
import"./index-4mj92tsh.js";
|
|
14
|
+
import"./index-w7q6h97v.js";
|
|
15
|
+
import"./index-r2wedvqn.js";
|
|
16
|
+
import"./index-3yz30c07.js";
|
|
17
|
+
import"./index-m9jj544v.js";
|
|
18
|
+
import"./index-eja64h28.js";
|
|
19
|
+
import"./index-1shvxzt0.js";
|
|
20
|
+
import"./index-xqgwjz7a.js";
|
|
21
|
+
import"./index-8scw1pjk.js";
|
|
22
|
+
import"./index-hj6w4ka1.js";
|
|
23
|
+
import"./index-52w0fvh8.js";
|
|
24
|
+
export {
|
|
25
|
+
ContextRunner2 as ContextRunner
|
|
26
|
+
};
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
script,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-eja64h28.js";
|
|
6
6
|
import"./index-52w0fvh8.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-8scw1pjk.js";
|
|
8
8
|
import {
|
|
9
9
|
Prompter2
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-r2wedvqn.js";
|
|
11
11
|
|
|
12
12
|
// pkgs/@akanjs/cli/guideline/guideline.script.ts
|
|
13
13
|
import { Logger } from "akanjs/common";
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
## Akan.js
|
|
2
|
+
|
|
3
|
+
Akan.js is a full-stack TypeScript framework: business code written once reaches web, native apps, server, database
|
|
4
|
+
and infrastructure. A workspace is Bun-first: `apps/<app>` holds pages, domain modules, UI, env files and
|
|
5
|
+
`akan.config.ts`; `libs/<lib>` holds shared domain and utility code apps reuse.
|
|
6
|
+
|
|
7
|
+
## Work Loop
|
|
8
|
+
|
|
9
|
+
1. Read the module's `*.abstract.md` and its neighbours before changing it. Update the abstract when an invariant, a
|
|
10
|
+
workflow or public behaviour changes, never for a style-only edit.
|
|
11
|
+
2. Prefer an Akan workflow to a hand edit: `akan workflow list` / `explain <name>` / `plan <name> … --out <plan>` /
|
|
12
|
+
`apply <plan>`, or the `list_workflows` / `plan_workflow` / `apply_workflow` tools of `akan mcp`. Split a
|
|
13
|
+
compound request into workflows applied in order (`create-module`, then `add-field`). Hand-edit only the owning
|
|
14
|
+
source file, and only when no workflow fits or apply reports manual action.
|
|
15
|
+
3. Never hand-edit a generated file (listed below). After adding, renaming or deleting a file, run
|
|
16
|
+
`akan sync <app-or-lib>`.
|
|
17
|
+
4. After editing, run `akan verify [<app-or-lib>]` once. It syncs, lints with fixes, typechecks, fast-builds and
|
|
18
|
+
checks SSR over what changed, and prints only what failed. Fix and rerun until it prints `verify ok`; never run
|
|
19
|
+
`akan lint`, `akan typecheck` and `akan build` one by one.
|
|
20
|
+
5. After a page, UI or runtime change, run `akan preview <app> --changed` (or name the paths) and quote its verdict
|
|
21
|
+
lines; it reuses the running dev server. Name any platform you could not open.
|
|
22
|
+
6. Check an endpoint with a signal test (`akan test <app> [files]`), never raw HTTP against the dev server.
|
|
23
|
+
7. Scaffolds take the target positionally (`akan create-module photo <app>`, `akan sync <app>`); only `add-field` and
|
|
24
|
+
`add-enum-field` take `--app` / `--module`.
|
|
25
|
+
|
|
26
|
+
## Change Scope
|
|
27
|
+
|
|
28
|
+
- Change what the task needs and the files directly tied to it — no formatting-only diffs, no style rewrites nearby.
|
|
29
|
+
- Never revert or overwrite someone else's change in a dirty working tree.
|
|
30
|
+
- Follow the nearest established pattern; when two shapes disagree, follow the newer neighbour. A new abstraction must
|
|
31
|
+
remove real duplication — near-identical sibling modules are copied with changed literals, not parameterised.
|
|
32
|
+
|
|
33
|
+
## Looks Wrong, Is Right — Do Not "Fix"
|
|
34
|
+
|
|
35
|
+
- Tailwind class order (`font-bold text-2xl text-foreground`) — Biome sorts it, `cn()` arguments included.
|
|
36
|
+
- `static name = "User";` on a guard class — `fetch` serializes it and the API explorer filters on it.
|
|
37
|
+
- `(this as unknown as RootStore).logout()` in a store — the sanctioned way to reach another store.
|
|
38
|
+
- `key={idx}` and short dependency arrays — `noArrayIndexKey` and `useExhaustiveDependencies` are off on purpose.
|
|
39
|
+
- Empty scaffold files, empty dictionary stages, the `// state` / `// action` markers — they mark where code goes.
|
|
40
|
+
- One-line re-export shims in a lib's `common/`, `webkit/`, `ui/` — the only legal path for a third-party package.
|
|
41
|
+
- `return await …save()` in a service; `as const` on every `enumOf(...)` array.
|
|
42
|
+
- Typos and transliterated terms in domain vocabulary — callers match on the name.
|
|
43
|
+
|
|
44
|
+
## Rules That Break The Build
|
|
45
|
+
|
|
46
|
+
`akan verify` reports each through the check named in parentheses, and the bracketed path rule carries the full
|
|
47
|
+
contract. Path rules name their checks the same way.
|
|
48
|
+
|
|
49
|
+
- Throw `new Err("<module>.error.<key>")` with the key in the module dictionary's `.error({})`; never a raw `Error`
|
|
50
|
+
(`no-throw-raw-error`) [app].
|
|
51
|
+
- A third-party package reaches `page/**`, a barrel or a module file only through a lib re-export
|
|
52
|
+
(`no-import-external-library`) [app].
|
|
53
|
+
- Colors only from the semantic vocabulary (`bg-primary`, `text-foreground/70`) — no palette, arbitrary, daisyUI or
|
|
54
|
+
`style={{}}` colors (`no-raw-palette-class`, `no-arbitrary-color`, `no-daisyui-legacy-class`, `no-inline-color`)
|
|
55
|
+
[style].
|
|
56
|
+
- No `console.log` / `console.debug`, never `logger.log()` (`noConsole`, `no-deprecated-log-level`); server code logs
|
|
57
|
+
through `this.logger` [app].
|
|
58
|
+
- No `document.cookie`, `localStorage` or `sessionStorage` (`no-document-cookie`, `no-web-storage`) — `getCookie`,
|
|
59
|
+
`setCookie`, `storage`, `secretStorage` from `akanjs/client` [app].
|
|
60
|
+
- Client files never import server files and the reverse (`no-import-server-in-client`, `no-import-client-in-server`);
|
|
61
|
+
`import type` is legal everywhere [ssr].
|
|
62
|
+
- A server write leaves the browser only through a store action, one write per action or handler
|
|
63
|
+
(`akan.write.placement`, `akan.store.multi-write`, `akan.component.write-chain`); chained writes become one service
|
|
64
|
+
method behind one endpoint [gates].
|
|
65
|
+
- Every endpoint and named slice names its `guards`, `[Public]` when anonymous is the intent (`no-unguarded-endpoint`)
|
|
66
|
+
[auth].
|
|
67
|
+
- Never ask a list for more than 500 rows (`no-oversized-list-limit`) [module]; never call a hook conditionally, `st.*`
|
|
68
|
+
hooks included (`useHookAtTopLevel`, `no-conditional-st-hook`) [tsx].
|
|
69
|
+
- A file or component past its size limit fails (`akan.size.file`, `akan.size.component`), and `akan.baseline.json`
|
|
70
|
+
only shrinks (`akan.baseline.growth`) — never add or raise an entry [gates].
|
|
71
|
+
- Suppress a plugin diagnostic as `// biome-ignore lint/plugin: <reason>`; every suppression carries a reason [app].
|
|
72
|
+
|
|
73
|
+
## Code Style
|
|
74
|
+
|
|
75
|
+
- `const` arrow functions over `function`; `interface` for shapes, `type` for unions; no non-null assertions
|
|
76
|
+
(`as unknown as T`, never `as any`); `#private`, but `private` in `*.{constant,document,service,store}.ts`.
|
|
77
|
+
- One class per file, named after it; TypeScript files are camelCase, component and convention files excepted.
|
|
78
|
+
- Identifiers, endpoint names and logs are English; everything a user reads goes through `l("model.field")` or
|
|
79
|
+
`l.trans({ en, ko })`, and dictionary entries are `[en, ko]` pairs.
|
|
80
|
+
- Comment only what the code cannot say (`akan verify` flags each new one as `akan.comment.added`) — a vendor quirk,
|
|
81
|
+
an infrastructure constraint, security reasoning, a domain field's meaning, a state transition, a rejected
|
|
82
|
+
alternative. Never restate code, label a section or add JSDoc; retire a symbol with
|
|
83
|
+
`/** @deprecated <what instead> */`.
|
|
84
|
+
- Server rendering is the default: `"use client"` only for a hook, an event handler, the store, a browser global or
|
|
85
|
+
a client-only package.
|
|
86
|
+
|
|
87
|
+
## Where Code Goes
|
|
88
|
+
|
|
89
|
+
| Code | Place |
|
|
90
|
+
|---|---|
|
|
91
|
+
| A database-backed noun (User, Product) | `lib/<model>/` — `akan create-module <model> <app>` |
|
|
92
|
+
| A workflow or integration with no stored model | `lib/_<service>/` — `akan create-service <service> <app>` |
|
|
93
|
+
| An embedded value type (Address) | `lib/__scalar/<scalar>/` — `akan create-scalar <scalar> <app>` |
|
|
94
|
+
| A route | `page/` — `<route>.tsx`, `_index.tsx`, `_layout.tsx`, `[param]/` |
|
|
95
|
+
| A pure, isomorphic helper | `common/<name>.ts` (imports `akanjs/base` only, never throws) |
|
|
96
|
+
| A React hook, browser or native-bridge code | `webkit/use<Thing>.tsx` |
|
|
97
|
+
| An adapter, guard, or code touching `node:*`, `Bun`, env or a secret | `srvkit/<name>.ts` |
|
|
98
|
+
| JSX or a look not bound to one model | `ui/<Component>.tsx`, `ui/Recipe/<name>.ts` |
|
|
99
|
+
| The color theme | semantic token values in `page/styles.css` |
|
|
100
|
+
| An iOS, Android or desktop app | `native: { … }` in `akan.config.ts`; an owned plugin in `native/<id>/` |
|
|
101
|
+
| A change to the stored document shape | `akan create-migration <name> <app>` |
|
|
102
|
+
|
|
103
|
+
## Secrets
|
|
104
|
+
|
|
105
|
+
Never print, summarise or commit secret values, credentials, tokens, private keys or `.env` contents; name env keys
|
|
106
|
+
with placeholders only. `AKAN_PUBLIC_*` values ship to the browser — never put a secret in one.
|