@akanjs/cli 3.2.0-rc.9 → 3.2.1-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 (145) hide show
  1. package/.build-stamp +2 -2
  2. package/CodeAgent-xdw73nbz.js +11 -0
  3. package/{CodeTui-qstk5vpj.js → CodeTui-0gewm71c.js} +822 -666
  4. package/README.ko.md +7 -0
  5. package/README.md +7 -0
  6. package/TunnelShare-cccfdgbm.js +16 -0
  7. package/agent.command-g1mj34wz.js +59 -0
  8. package/akanCode.js +12 -12
  9. package/appExecutor-rrx10jya.js +11 -0
  10. package/{application.command-m4rq4wc2.js → application.command-3w4v7t40.js} +84 -40
  11. package/{applicationBuildRunner-df7rx3ra.js → applicationBuildRunner-y5xbetyz.js} +51 -20
  12. package/buildBatch.proc.js +31 -16
  13. package/{cloud.command-a0gy0qq2.js → cloud.command-ph0rz6sw.js} +28 -29
  14. package/cloud.script-8bs9tp4j.js +30 -0
  15. package/{code.command-5rsdqw8s.js → code.command-9b967qpg.js} +13 -9
  16. package/context.command-ndzs5rbf.js +62 -0
  17. package/context.runner-bmstpng2.js +32 -0
  18. package/csrArtifactBuilder-gtvff6k7.js +10 -0
  19. package/{index-qd7xn2bk.js → dependencyScanner-93g8tk0r.js} +7 -6
  20. package/{devTui-h77zrjv5.js → devTui-rf374y2w.js} +1 -1
  21. package/{fileSys-zpvt5gtf.js → fileSys-e5mwt73x.js} +1 -1
  22. package/frameworkGraph-aneq2nwy.js +8 -0
  23. package/{guideline.command-mffxknbr.js → guideline.command-y8qz9kxy.js} +9 -5
  24. package/guidelines/agentRule/agentRule.instruction.md +25 -9
  25. package/guidelines/akanApi/akanApi.instruction.md +6 -4
  26. package/guidelines/conventions/core.md +23 -5
  27. package/guidelines/conventions/rules/app.md +4 -1
  28. package/guidelines/conventions/rules/page.md +5 -4
  29. package/guidelines/conventions/rules/ts.md +3 -3
  30. package/guidelines/errorCodes/errorCodes.instruction.md +165 -0
  31. package/guidelines/fieldRule/fieldRule.instruction.md +2 -1
  32. package/guidelines/mcpRule/mcpRule.instruction.md +225 -5
  33. package/guidelines/pageRule/pageRule.instruction.md +10 -1
  34. package/guidelines/queryRule/queryRule.instruction.md +3 -1
  35. package/guidelines/runtimeRule/runtimeRule.instruction.md +14 -8
  36. package/guidelines/transportRule/transportRule.instruction.md +31 -1
  37. package/incrementalBuilder.proc.js +609 -437
  38. package/{index-skmtj8rm.js → index-02v45hh9.js} +27 -10
  39. package/{index-j6gc8n14.js → index-0csk6jqm.js} +11 -9
  40. package/{index-2r9ff9qm.js → index-0wa5z6rm.js} +2 -2
  41. package/{index-nmvhjn8c.js → index-0z8sbdme.js} +93 -82
  42. package/{index-2vgv7fs7.js → index-1c2807kg.js} +727 -693
  43. package/{index-hj6w4ka1.js → index-1p81ecbz.js} +1 -1
  44. package/{index-2mf1aen9.js → index-1p9bxjmt.js} +2 -2
  45. package/{index-an76bdrv.js → index-2kh4xj3m.js} +1 -1
  46. package/{index-99qvtff2.js → index-2vn0m9z5.js} +5 -5
  47. package/{index-rp4yf32g.js → index-3569fr49.js} +36 -29
  48. package/{index-xvk2a75m.js → index-38x8ynrx.js} +25 -25
  49. package/{index-cmg5ngqa.js → index-3fmzz9sf.js} +20 -20
  50. package/{index-rfzp4pqs.js → index-45aprybg.js} +3 -3
  51. package/{index-k92x3vne.js → index-4a1n0nym.js} +1 -1
  52. package/{index-ra9fvn7s.js → index-4zgm54wf.js} +76 -40
  53. package/{index-exn38bzx.js → index-652f3bs8.js} +116 -54
  54. package/{index-grxs6fts.js → index-6gepp8yn.js} +57 -31
  55. package/{index-vm0dn0mt.js → index-6j351de4.js} +294 -157
  56. package/{index-w15mg3km.js → index-7ssr7wq4.js} +1 -1
  57. package/{index-gxav1bjz.js → index-82cmbpxc.js} +9 -9
  58. package/{index-2mrn1mrg.js → index-9f3reh2y.js} +1 -1
  59. package/{index-gcx48get.js → index-9rymt8d6.js} +2 -2
  60. package/{index-swwjakt0.js → index-ankyx6dj.js} +14 -18
  61. package/{index-28x1aszt.js → index-b0t92k71.js} +154 -58
  62. package/index-b372rck5.js +799 -0
  63. package/{index-yf9wc28h.js → index-bejy9zyc.js} +1 -1
  64. package/{index-r0a604h4.js → index-c669pbyb.js} +5 -4
  65. package/{index-xyn02k0w.js → index-cm9rb480.js} +662 -433
  66. package/{index-j9790rhk.js → index-d0n78fzc.js} +1635 -1139
  67. package/{index-hqv34wzq.js → index-dr1carpr.js} +10 -10
  68. package/index-f2arv0mv.js +30 -0
  69. package/{index-5radqwn2.js → index-gtydr9qc.js} +12 -12
  70. package/{index-j6eeh5d7.js → index-j3fqs8rc.js} +5 -5
  71. package/{index-yckz5t8b.js → index-jdw9m5c4.js} +516 -434
  72. package/{index-ny2k80mv.js → index-jf4vk1s0.js} +9 -2
  73. package/{index-x40bdsca.js → index-jg5rwrf7.js} +77 -115
  74. package/{index-5zwr4n6k.js → index-ktxdfqg5.js} +65 -8
  75. package/index-mnhrqjjq.js +127 -0
  76. package/{index-3ghdb7p5.js → index-pc42gxa5.js} +2777 -3676
  77. package/{index-0hbtve0a.js → index-q8h4eg5y.js} +32 -28
  78. package/{index-j3v29pq7.js → index-qh81drde.js} +219 -175
  79. package/{index-b4qq3rq0.js → index-rwgqba9p.js} +1 -1
  80. package/{index-w8yasvpc.js → index-scfsqen7.js} +2136 -2175
  81. package/{index-9p260r4e.js → index-trffs83s.js} +538 -250
  82. package/{index-0gg15zwa.js → index-twjgmryg.js} +6 -6
  83. package/index-whvhsb5f.js +80 -0
  84. package/{index-h7hehkw6.js → index-xczjdng6.js} +3 -1
  85. package/{index-39jz41jb.js → index-xs9a3ddt.js} +3 -3
  86. package/{index-35j83zkd.js → index-xv3pvdw4.js} +2 -2
  87. package/{index-34792nh7.js → index-y2g0s9tn.js} +1 -1
  88. package/{index-43f4h4cm.js → index-ymgsvhc5.js} +7 -8
  89. package/{index-ygdbn9jn.js → index-zyb0ebm4.js} +1 -1
  90. package/{index-bns3wcpc.js → index-zyjztrvc.js} +2 -2
  91. package/index.js +30 -24
  92. package/libExecutor-nstr00s7.js +10 -0
  93. package/{library.command-bmd7zc5m.js → library.command-b02aw1hm.js} +12 -5
  94. package/{localRegistry.command-y6en1599.js → localRegistry.command-3hg1p4aj.js} +24 -24
  95. package/{module.command-7exfffqw.js → module.command-bd9gz6cv.js} +11 -7
  96. package/{package.command-adskw2rj.js → package.command-xmr0mxze.js} +11 -10
  97. package/package.json +8 -8
  98. package/{page.command-dw01272p.js → page.command-x94qf58g.js} +8 -4
  99. package/{pipeline.command-0b1r3y5r.js → pipeline.command-n2843k6t.js} +15 -9
  100. package/pkgExecutor-cka27e3c.js +10 -0
  101. package/{primitive.command-byw6vc04.js → primitive.command-cs7v376h.js} +12 -8
  102. package/{projectTypecheck-kkrpq60a.js → projectTypecheck-za2n3nbr.js} +1 -1
  103. package/{prompter-qrwx1p17.js → prompter-d33wmdpa.js} +2 -2
  104. package/{quality.command-6rqnhzct.js → quality.command-nqngh1jd.js} +25 -16
  105. package/{recipeScanner-4b69ybe0.js → recipeScanner-rrx69awy.js} +1 -1
  106. package/{repair.command-rw5zymak.js → repair.command-v2medwsm.js} +12 -8
  107. package/{routeSourceValidator-4h947v7c.js → routeSourceValidator-8n6j1vn7.js} +4 -2
  108. package/{scalar.command-2dyp9nh9.js → scalar.command-61cjmxn1.js} +10 -6
  109. package/skills/akan-debug/SKILL.md +8 -5
  110. package/skills/akan-err/SKILL.md +7 -0
  111. package/skills/akan-mcp/SKILL.md +19 -1
  112. package/skills/akan-scaffold/SKILL.md +1 -1
  113. package/skills/akan-validate/SKILL.md +3 -3
  114. package/{subspace.command-111ynwv1.js → subspace.command-dtv8nfh7.js} +30 -24
  115. package/templates/app/page/_layout.tsx +13 -0
  116. package/templates/app/page/styles.css.template +40 -0
  117. package/templates/appSample/page/_index.tsx +9 -9
  118. package/templates/appSample/page/_layout.tsx +1 -0
  119. package/templates/appSample/page/styles.css.template +40 -5
  120. package/templates/appSample/ui/Recipe/jellyButton.ts +1 -1
  121. package/templates/biomeForm.ts +1 -1
  122. package/templates/env/_env.server.type.ts +1 -1
  123. package/templates/facetIndex/index.ts +2 -37
  124. package/templates/lib/sig.ts +0 -4
  125. package/templates/lib/useClient.ts +1 -1
  126. package/templates/workspaceRoot/.devcontainer/devcontainer.json.template +1 -1
  127. package/templates/workspaceRoot/AGENTS.md.template +2 -1
  128. package/templates/workspaceRoot/README.ts +4 -2
  129. package/{tunnel.command-2gcpfbdj.js → tunnel.command-fmwm5fgb.js} +15 -13
  130. package/{typeChecker-s640r6c0.js → typeChecker-7jt6abrs.js} +1 -1
  131. package/typecheck.proc.js +3 -2
  132. package/{verify.command-djgs86ma.js → verify.command-4f260t53.js} +19 -17
  133. package/{workflow.command-n0k2mxr5.js → workflow.command-tm5q9xsm.js} +21 -14
  134. package/{workspace.command-fh1qwxfx.js → workspace.command-75gc280j.js} +56 -54
  135. package/CodeAgent-x2p3a3e0.js +0 -11
  136. package/TunnelShare-c4xsfzg5.js +0 -15
  137. package/agent.command-9et2e27p.js +0 -52
  138. package/cloud.script-xze4zh7n.js +0 -31
  139. package/context.command-rk1dwrg4.js +0 -57
  140. package/context.runner-83ky5m1b.js +0 -30
  141. package/dependencyScanner-78sq8m4q.js +0 -8
  142. /package/templates/{appSample → app}/public/fonts/Pretendard-Bold.woff2 +0 -0
  143. /package/templates/{appSample → app}/public/fonts/Pretendard-Medium.woff2 +0 -0
  144. /package/templates/{appSample → app}/public/fonts/Pretendard-Regular.woff2 +0 -0
  145. /package/templates/{appSample → app}/public/fonts/Pretendard-SemiBold.woff2 +0 -0
package/README.ko.md CHANGED
@@ -26,6 +26,13 @@ bun install -g @akanjs/cli
26
26
  akan --help
27
27
  ```
28
28
 
29
+ 이미 있는 워크스페이스에서는 그 워크스페이스가 의존하는 `akanjs`와 같은 버전으로 CLI를 설치합니다. major나 minor
30
+ 버전이 다른 CLI는 `akan update`로 둘을 함께 옮기기 전까지 워크스페이스에 쓰기를 거부합니다.
31
+
32
+ ```bash
33
+ v="$(bun -e "const p=require('./package.json'),v=p.dependencies?.akanjs??p.devDependencies?.akanjs;if(!v){console.error('package.json lists no akanjs in dependencies or devDependencies');process.exit(1)}console.log(v)")" && bun install -g "@akanjs/cli@$v"
34
+ ```
35
+
29
36
  ## 자주 쓰는 명령
30
37
 
31
38
  ```bash
package/README.md CHANGED
@@ -26,6 +26,13 @@ bun install -g @akanjs/cli
26
26
  akan --help
27
27
  ```
28
28
 
29
+ For a workspace that already exists, install the CLI at the version of `akanjs` it depends on. A CLI of another
30
+ major or minor version refuses to write to it until `akan update` moves both:
31
+
32
+ ```bash
33
+ v="$(bun -e "const p=require('./package.json'),v=p.dependencies?.akanjs??p.devDependencies?.akanjs;if(!v){console.error('package.json lists no akanjs in dependencies or devDependencies');process.exit(1)}console.log(v)")" && bun install -g "@akanjs/cli@$v"
34
+ ```
35
+
29
36
  ## Everyday Commands
30
37
 
31
38
  ```bash
@@ -0,0 +1,16 @@
1
+ // @bun
2
+ import {
3
+ TunnelShare2
4
+ } from "./index-4a1n0nym.js";
5
+ import"./index-45aprybg.js";
6
+ import"./index-ymgsvhc5.js";
7
+ import"./index-m9jj544v.js";
8
+ import"./index-f2arv0mv.js";
9
+ import"./index-mnhrqjjq.js";
10
+ import"./index-pc42gxa5.js";
11
+ import"./index-b372rck5.js";
12
+ import"./index-j4yvgfhr.js";
13
+ import"./index-zyjztrvc.js";
14
+ export {
15
+ TunnelShare2 as TunnelShare
16
+ };
@@ -0,0 +1,59 @@
1
+ // @bun
2
+ import {
3
+ Workspace,
4
+ command
5
+ } from "./index-652f3bs8.js";
6
+ import"./index-j4yvgfhr.js";
7
+ import"./index-pc42gxa5.js";
8
+ import"./index-zyjztrvc.js";
9
+ import"./index-b372rck5.js";
10
+ import"./index-f2arv0mv.js";
11
+ import"./index-mnhrqjjq.js";
12
+ import"./index-1c2807kg.js";
13
+ import"./index-trffs83s.js";
14
+ import"./index-jdw9m5c4.js";
15
+ import"./index-1p81ecbz.js";
16
+ import"./index-xv3pvdw4.js";
17
+ import"./index-j3fqs8rc.js";
18
+ import"./index-d0n78fzc.js";
19
+ import"./index-6j351de4.js";
20
+ import"./index-ymgsvhc5.js";
21
+ import"./index-2kh4xj3m.js";
22
+ import"./index-m9jj544v.js";
23
+ import"./index-cm9rb480.js";
24
+ import"./index-ktxdfqg5.js";
25
+ import"./index-62md4dwy.js";
26
+ import"./index-zyb0ebm4.js";
27
+ import"./index-jf4vk1s0.js";
28
+ import"./index-t4d0ckde.js";
29
+ import"./index-4zgm54wf.js";
30
+ import {
31
+ AgentScript
32
+ } from "./index-6gepp8yn.js";
33
+ import"./index-9rymt8d6.js";
34
+ import"./index-whvhsb5f.js";
35
+
36
+ // pkgs/@akanjs/cli/agent/agent.command.ts
37
+ class AgentCommand extends command("agent", [AgentScript], ({ public: target }) => ({
38
+ agent: target({
39
+ desc: "Install Akan agent rules for editors and coding agents",
40
+ stdio: true,
41
+ usageExitCode: 1,
42
+ readOnly: ({ action, check }) => action === "hook" || check === true
43
+ }).arg("action", String, { desc: "install, or hook (run by Claude Code hooks)" }).arg("target", String, {
44
+ desc: "install: cursor, agents-md, claude, rules, skills, hooks, or all; hook: pre-edit, post-edit, stop",
45
+ nullable: true
46
+ }).option("force", Boolean, {
47
+ desc: "overwrite existing pointer files and generated files you took over",
48
+ default: false
49
+ }).option("check", Boolean, {
50
+ desc: "write nothing; exit 3 when install would create, change or remove a file",
51
+ default: false
52
+ }).with(Workspace).exec(async function(action, targetName, force, check, workspace) {
53
+ await this.agentScript.agent(workspace, action, targetName, { force, check });
54
+ })
55
+ })) {
56
+ }
57
+ export {
58
+ AgentCommand
59
+ };
package/akanCode.js CHANGED
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  PreviewChrome2,
4
4
  PreviewView2
5
- } from "./index-b4qq3rq0.js";
6
- import"./index-bns3wcpc.js";
5
+ } from "./index-rwgqba9p.js";
6
+ import"./index-zyjztrvc.js";
7
7
  import {
8
8
  akanCodePaths2
9
- } from "./index-35j83zkd.js";
9
+ } from "./index-xv3pvdw4.js";
10
10
  import {
11
11
  AkanEditScope2,
12
12
  DevLogFeedback2,
@@ -34,31 +34,31 @@ import {
34
34
  CodeMailbox2,
35
35
  CodeSessionFork2,
36
36
  CodeAgent2
37
- } from "./index-skmtj8rm.js";
37
+ } from "./index-02v45hh9.js";
38
38
  import {
39
39
  akanCodeDefaultModel2,
40
40
  akanCodeModel2,
41
41
  akanCodeModelSupportsImages2,
42
42
  akanCodeModelWarnings2,
43
43
  CodeAgentStreamPrinter2
44
- } from "./index-w15mg3km.js";
44
+ } from "./index-7ssr7wq4.js";
45
45
  import {
46
46
  SubagentPool2,
47
47
  AkanCodeCompaction2
48
- } from "./index-2r9ff9qm.js";
48
+ } from "./index-0wa5z6rm.js";
49
49
  import {
50
50
  CodeAgentRpcHost2
51
51
  } from "./index-s4nvxpzm.js";
52
52
  import {
53
- CodeTuiLines2,
54
- CodeTuiAgents2,
55
- CodeTuiClipboard2,
56
53
  CodeTuiCommands2,
54
+ CodeTuiLines2,
57
55
  CodeTuiEditor2,
58
- CodeTuiFiles2,
56
+ CodeTuiAgents2,
59
57
  CodeTuiMarkdown2,
60
- CodeTuiParts2
61
- } from "./index-2mrn1mrg.js";
58
+ CodeTuiParts2,
59
+ CodeTuiClipboard2,
60
+ CodeTuiFiles2
61
+ } from "./index-9f3reh2y.js";
62
62
  import"./index-9bv479q5.js";
63
63
  export {
64
64
  AkanCli2 as AkanCli,
@@ -0,0 +1,11 @@
1
+ // @bun
2
+ import"./index-f2arv0mv.js";
3
+ import"./index-pc42gxa5.js";
4
+ import {
5
+ AppExecutor2
6
+ } from "./index-b372rck5.js";
7
+ import"./index-j4yvgfhr.js";
8
+ import"./index-zyjztrvc.js";
9
+ export {
10
+ AppExecutor2 as AppExecutor
11
+ };
@@ -1,4 +1,12 @@
1
1
  // @bun
2
+ import"./index-zyjztrvc.js";
3
+ import"./index-pc42gxa5.js";
4
+ import {
5
+ CliError
6
+ } from "./index-j4yvgfhr.js";
7
+ import {
8
+ RouteJsBudget
9
+ } from "./index-6j351de4.js";
2
10
  import {
3
11
  App,
4
12
  Apps,
@@ -7,26 +15,19 @@ import {
7
15
  Exec,
8
16
  Workspace,
9
17
  command
10
- } from "./index-exn38bzx.js";
11
- import {
12
- CliError
13
- } from "./index-j4yvgfhr.js";
14
- import"./index-bns3wcpc.js";
15
- import"./index-3ghdb7p5.js";
16
- import {
17
- RouteJsBudget
18
- } from "./index-vm0dn0mt.js";
19
- import"./index-43f4h4cm.js";
20
- import"./index-an76bdrv.js";
18
+ } from "./index-652f3bs8.js";
19
+ import"./index-b372rck5.js";
20
+ import"./index-f2arv0mv.js";
21
+ import"./index-mnhrqjjq.js";
22
+ import"./index-ymgsvhc5.js";
23
+ import"./index-2kh4xj3m.js";
21
24
  import"./index-m9jj544v.js";
22
- import"./index-nmvhjn8c.js";
23
- import"./index-xvk2a75m.js";
24
- import"./index-j6gc8n14.js";
25
- import"./index-j9790rhk.js";
26
- import"./index-b4qq3rq0.js";
25
+ import"./index-0csk6jqm.js";
26
+ import"./index-d0n78fzc.js";
27
+ import"./index-rwgqba9p.js";
27
28
  import {
28
29
  ApplicationScript
29
- } from "./index-28x1aszt.js";
30
+ } from "./index-b0t92k71.js";
30
31
  import {
31
32
  writeOption,
32
33
  nativeTargetOption,
@@ -34,8 +35,9 @@ import {
34
35
  allowLocalOption,
35
36
  publicEnvOption
36
37
  } from "./index-mdjc93e1.js";
37
- import"./index-gcx48get.js";
38
+ import"./index-9rymt8d6.js";
38
39
  import"./index-9bv479q5.js";
40
+ import"./index-whvhsb5f.js";
39
41
 
40
42
  // pkgs/@akanjs/cli/application/application.command.ts
41
43
  import { MigrationCommand } from "akanjs/server/migration/migrationCommand";
@@ -63,15 +65,14 @@ var startEnvOption = {
63
65
  default: "local"
64
66
  };
65
67
  var listOf = (value) => (value ?? "").split(",").map((entry) => entry.trim()).filter(Boolean);
66
-
67
- class ApplicationCommand extends command("application", [ApplicationScript], ({ public: target }) => ({
68
+ var workspaceTargets = ({ public: target }) => ({
68
69
  createApplication: target({ desc: "Create a new application in the workspace" }).arg("appName", String, { desc: "name of application" }).option("start", Boolean, { desc: "start application", default: false }).with(Workspace).exec(async function(appName, start, workspace) {
69
70
  await this.applicationScript.createApplication(appName.toLowerCase().replace(/ /g, "-"), workspace, { start });
70
71
  }),
71
72
  removeApplication: target({ desc: "Remove an application from the workspace", destructive: true }).with(App).exec(async function(app) {
72
73
  await this.applicationScript.removeApplication(app);
73
74
  }),
74
- planSlice: target({ desc: "List the exact files an app needs to live in a workspace of its own" }).with(App).option("format", String, { desc: "output format", default: "text", enum: ["text", "json"] }).exec(async function(app, format) {
75
+ planSlice: target({ desc: "List the exact files an app needs to live in a workspace of its own", readOnly: true }).with(App).option("format", String, { desc: "output format", default: "text", enum: ["text", "json"] }).exec(async function(app, format) {
75
76
  await this.applicationScript.planSlice(app, format);
76
77
  }),
77
78
  sync: target({ desc: "Sync dependencies and configuration for an app or library" }).with(Sys).exec(async function(sys) {
@@ -79,17 +80,23 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
79
80
  }),
80
81
  script: target({ desc: "Run a custom script in the application" }).with(App).arg("filename", String, { desc: "name of script", nullable: true }).exec(async function(app, filename) {
81
82
  await this.applicationScript.script(app, filename);
82
- }),
83
+ })
84
+ });
85
+ var migrationTargets = ({ public: target }) => ({
83
86
  migrate: target({
84
- desc: "List, plan, apply, verify or roll back the app's data migrations in script/migration",
87
+ desc: "List, plan, apply, verify or roll back the app's data migrations in script/migration, or list and prune the indexes it no longer declares",
85
88
  stdio: true,
86
89
  usageExitCode: 2,
90
+ readOnly: ({ action }) => ["list", "plan", "verify", "indexes"].includes(String(action)),
87
91
  onFailure: async (error, { usage, given }) => {
88
92
  if (given.json !== true)
89
93
  return;
90
94
  await MigrationCommand.print(MigrationCommand.failure(null, migrationFailureOf(error, usage)), true);
91
95
  }
92
- }).with(App).arg("action", String, { desc: "list, plan, apply, verify or rollback", default: "list" }).arg("target", String, { desc: "migration id; for rollback, an apply's run id too", nullable: true }).option("param", String, { desc: "a param the migration declares, as name=value", multiple: true }).option("expect", String, { desc: "the plan hash an apply must still match", nullable: true }).option("items", Number, { desc: "how many planned decisions to print", nullable: true }).option("actor", String, { desc: "who runs it, as the ledger records", nullable: true }).option("json", Boolean, { desc: "print the result as one JSON line", default: false }).exec(async function(app, action, target, param, expect, items, actor, json) {
96
+ }).with(App).arg("action", String, {
97
+ desc: "list, plan, apply, verify, rollback, indexes or prune-indexes",
98
+ default: "list"
99
+ }).arg("target", String, { desc: "migration id; for rollback, an apply's run id too", nullable: true }).option("param", String, { desc: "a param the migration declares, as name=value", multiple: true }).option("expect", String, { desc: "the plan hash an apply must still match", nullable: true }).option("items", Number, { desc: "how many planned decisions to print", nullable: true }).option("actor", String, { desc: "who runs it, as the ledger records", nullable: true }).option("json", Boolean, { desc: "print the result as one JSON line", default: false }).exec(async function(app, action, target, param, expect, items, actor, json) {
93
100
  await this.applicationScript.migrate(app, [
94
101
  action,
95
102
  ...target ? [target] : [],
@@ -102,12 +109,14 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
102
109
  }),
103
110
  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) {
104
111
  await this.applicationScript.createMigration(app, migrationName);
105
- }),
112
+ })
113
+ });
114
+ var inspectTargets = ({ public: target }) => ({
106
115
  preview: target({
107
116
  desc: "Open pages of the app's dev server in a headless browser and print what broke, starting a server if none runs",
108
117
  stdio: true
109
118
  }).with(App).arg("paths", String, {
110
- desc: "page paths, comma-separated; the default locale is added when missing, except to a path the server answers outside a locale (/_akan, the API prefix, /__csr, /__rsc, /.well-known, /openapi.json, the default /mcp, the server's own files, public/ files) or a full URL, which opens as written (default: /)",
119
+ desc: "page paths, comma-separated; the default locale is added when missing, except to a path the server answers outside a locale (/_akan, the API prefix, /__csr, /__rsc, /.well-known, /openapi.json, /mcp, the server's own files, public/ files), which opens as written; a full URL opens its path on the dev server (default: /)",
111
120
  example: "/board,/board/new",
112
121
  nullable: true
113
122
  }).option("changed", Boolean, {
@@ -135,7 +144,8 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
135
144
  });
136
145
  }),
137
146
  studio: target({
138
- desc: "Print the Akan Studio URL of the app's running dev server: its ERD, each module's signals, the Change Map, the live DI graph and jobs, and the framework map"
147
+ desc: "Print the Akan Studio URL of the app's running dev server: its ERD, each module's signals, the Change Map, the live DI graph and jobs, and the framework map",
148
+ readOnly: true
139
149
  }).with(App).option("module", String, { desc: "the module to show", nullable: true }).option("view", String, {
140
150
  flag: "w",
141
151
  desc: "the view to open",
@@ -161,7 +171,10 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
161
171
  console: target({ desc: "Open an interactive server console for the application" }).with(App).exec(async function(app) {
162
172
  await this.applicationScript.console(app);
163
173
  }),
164
- logs: target({ desc: "Tail the running application's logs, filtered (attaches to akan-control.sock)" }).with(App).option("level", String, { desc: "minimum level: trace, verbose, debug, info, warn, error", nullable: true }).option("grep", String, { desc: "substring the message must contain", nullable: true }).option("endpoint", String, {
174
+ logs: target({
175
+ desc: "Tail the running application's logs, filtered (attaches to akan-control.sock)",
176
+ readOnly: true
177
+ }).with(App).option("level", String, { desc: "minimum level: trace, verbose, debug, info, warn, error", nullable: true }).option("grep", String, { desc: "substring the message must contain", nullable: true }).option("endpoint", String, {
165
178
  desc: "endpoint glob(s), comma-separated: mutation:*, query:userList",
166
179
  nullable: true
167
180
  }).option("trace", String, { desc: "one request's traceId", nullable: true }).option("child", String, { desc: "replica index(es), comma-separated", nullable: true }).option("role", String, {
@@ -190,7 +203,9 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
190
203
  follow,
191
204
  runtimeDir
192
205
  });
193
- }),
206
+ })
207
+ });
208
+ var buildAndTestTargets = ({ public: target }) => ({
194
209
  build: target({ short: true, desc: "Build the application for production (frontend + backend)" }).with(App).option("write", Boolean, writeOption).option("fast", Boolean, { desc: "fast build", default: false }).option("quiet", Boolean, { desc: "hide build progress output", default: false }).option("profile", String, {
195
210
  desc: "server env profile: bundle env/env.server.<env>.<profile>.ts in place of the environment's own file",
196
211
  nullable: true
@@ -208,16 +223,25 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
208
223
  budget: RouteJsBudget.modeOf({ checkBudget, updateBudget, raiseBudget })
209
224
  });
210
225
  }),
211
- typecheck: target({ short: true, desc: "Typecheck an app or a library, its tests and specs included" }).with(SysOrOnlyApp).option("write", Boolean, writeOption).option("clean", Boolean, { desc: "clear typecheck cache before running", default: false }).option("incremental", Boolean, { desc: "reuse TypeScript incremental cache", default: true }).option("tests", Boolean, { desc: "check its *.test.ts / *.spec.ts too, which nothing imports", default: true }).exec(async function(sys, write, clean, incremental, tests) {
226
+ typecheck: target({
227
+ short: true,
228
+ desc: "Typecheck an app or a library, its tests and specs included",
229
+ readOnly: ({ write }) => write === false
230
+ }).with(SysOrOnlyApp).option("write", Boolean, writeOption).option("clean", Boolean, { desc: "clear typecheck cache before running", default: false }).option("incremental", Boolean, { desc: "reuse TypeScript incremental cache", default: true }).option("tests", Boolean, { desc: "check its *.test.ts / *.spec.ts too, which nothing imports", default: true }).exec(async function(sys, write, clean, incremental, tests) {
212
231
  await this.applicationScript.typecheck(sys, { write, clean, incremental, tests });
213
232
  }),
214
- test: target({ desc: "Prepare and test an app, library, or package" }).with(Exec).arg("files", String, {
233
+ test: target({ desc: "Prepare and test an app, library, or package", readOnly: ({ write }) => write === false }).with(Exec).arg("files", String, {
215
234
  desc: "test files or folders to run, relative to the target or the workspace root, comma-separated (default: all)",
216
235
  example: "lib/user/user.signal.test.ts",
217
236
  nullable: true
218
- }).option("write", Boolean, writeOption).option("coverage", Boolean, { desc: "measure coverage; lcov goes under local/coverage/<target>", default: false }).exec(async function(exec, files, write, coverage) {
219
- await this.applicationScript.test(exec, { write, files: listOf(files), coverage });
220
- }),
237
+ }).option("write", Boolean, writeOption).option("coverage", Boolean, { desc: "measure coverage; lcov goes under local/coverage/<target>", default: false }).option("parallel", Number, {
238
+ desc: "bun processes to spread the test files over, balanced by the timings under local/test-timings/<target>",
239
+ default: 1
240
+ }).option("junit", String, { desc: "also write a JUnit XML report to this path", nullable: true }).exec(async function(exec, files, write, coverage, parallel, junit) {
241
+ await this.applicationScript.test(exec, { write, files: listOf(files), coverage, parallel, junit });
242
+ })
243
+ });
244
+ var nativeBuildTargets = ({ public: target }) => ({
221
245
  buildIos: target({ short: true, desc: "Build the iOS app on the native runtime" }).with(App).option("target", String, nativeTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("write", Boolean, writeOption).exec(async function(app, target, env, debug, write) {
222
246
  await this.applicationScript.buildIos(app, { target, env, profile: debug ? "debug" : "release", write });
223
247
  }),
@@ -242,7 +266,9 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
242
266
  ...notarize ? { notarize } : {},
243
267
  ...arch ? { arch } : {}
244
268
  });
245
- }),
269
+ })
270
+ });
271
+ var startTargets = ({ public: target }) => ({
246
272
  start: target({ short: true, desc: "Start development server(s) (frontend SSR + backend)" }).with(Apps).option("plain", Boolean, { desc: "print prefixed lines instead of the full-screen view", default: false }).option("kill", Boolean, { flag: "k", desc: "free the dev ports first, whoever is holding them", default: false }).option("concurrency", Number, {
247
273
  desc: "apps to boot at a time (default: what this machine's memory and cores allow)",
248
274
  nullable: true
@@ -281,7 +307,9 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
281
307
  operation: release ? "release" : "local",
282
308
  write
283
309
  });
284
- }),
310
+ })
311
+ });
312
+ var releaseTargets = ({ public: target }) => ({
285
313
  releaseIos: target({ desc: "Build and sign the iOS app for the App Store (.ipa)" }).with(App).option("target", String, nativeTargetOption).option("env", String, releaseEnvOption).option("team", String, teamOption).option("adHoc", Boolean, { desc: "sign with an ad-hoc profile instead of app-store", default: false }).option("write", Boolean, writeOption).option("allowLocalRelease", Boolean, allowLocalOption("release")).option("publicEnv", String, publicEnvOption("the release")).exec(async function(app, target, env, team, adHoc, write, allowLocalRelease, publicEnv) {
286
314
  await this.applicationScript.releaseIos(app, {
287
315
  target,
@@ -301,7 +329,9 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
301
329
  allowLocalRelease,
302
330
  publicEnv: publicEnv ?? undefined
303
331
  });
304
- }),
332
+ })
333
+ });
334
+ var updateTargets = ({ public: target }) => ({
305
335
  packUpdate: target({ desc: packUpdateDesc, usageExitCode: 1 }).with(App).option("platform", String, { enum: ["ios", "android"], desc: "the app it updates" }).option("target", String, nativeTargetOption).option("env", String, releaseEnvOption).option("out", String, {
306
336
  desc: "output folder (default: dist/native/<app>/<target>/updates/<platform>)",
307
337
  nullable: true
@@ -365,8 +395,10 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
365
395
  write,
366
396
  allowLocalRelease
367
397
  });
368
- }),
369
- dbup: target({ desc: "Start local database services for a database mode" }).with(Workspace).option("mode", String, {
398
+ })
399
+ });
400
+ var databaseTargets = ({ public: target }) => ({
401
+ dbup: target({ desc: "Start local database services for a database mode", readOnly: true }).with(Workspace).option("mode", String, {
370
402
  desc: "database mode; left out, every mode the workspace's apps declare",
371
403
  enum: ["single", "multiple", "cluster"],
372
404
  nullable: true
@@ -379,9 +411,21 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
379
411
  dbImport: target({ desc: "Read files db-export wrote into an app's database, in the mode the shell names" }).with(App).option("dir", String, { desc: "directory under the workspace to read", default: "local/transfer" }).exec(async function(app, dir) {
380
412
  await this.applicationScript.transferDatabase(app, "import", dir);
381
413
  }),
382
- dbdown: target({ desc: "Stop local database services" }).with(Workspace).exec(async function(workspace) {
414
+ dbdown: target({ desc: "Stop local database services", readOnly: true }).with(Workspace).exec(async function(workspace) {
383
415
  await this.applicationScript.dbdown(workspace);
384
416
  })
417
+ });
418
+
419
+ class ApplicationCommand extends command("application", [ApplicationScript], (context) => ({
420
+ ...workspaceTargets(context),
421
+ ...migrationTargets(context),
422
+ ...inspectTargets(context),
423
+ ...buildAndTestTargets(context),
424
+ ...nativeBuildTargets(context),
425
+ ...startTargets(context),
426
+ ...releaseTargets(context),
427
+ ...updateTargets(context),
428
+ ...databaseTargets(context)
385
429
  })) {
386
430
  }
387
431
  export {
@@ -1,33 +1,36 @@
1
1
  // @bun
2
2
  import {
3
- ServerEnvProfile,
4
- Spinner,
5
3
  ProjectTypecheck2,
4
+ Spinner,
6
5
  parseEnvFile,
7
- WorkspaceExecutor
8
- } from "./index-3ghdb7p5.js";
9
- import"./index-bns3wcpc.js";
6
+ WorkspaceExecutor,
7
+ ServerEnvProfile
8
+ } from "./index-pc42gxa5.js";
9
+ import"./index-zyjztrvc.js";
10
10
  import"./index-j4yvgfhr.js";
11
+ import"./index-b372rck5.js";
12
+ import"./index-f2arv0mv.js";
13
+ import"./index-mnhrqjjq.js";
11
14
  import {
12
15
  NARROWABLE_VENDOR_SPECIFIERS
13
- } from "./index-w8yasvpc.js";
16
+ } from "./index-scfsqen7.js";
14
17
  import {
15
18
  FontPruner,
19
+ precompressArtifacts,
16
20
  RouteJsBudget
17
- } from "./index-vm0dn0mt.js";
18
- import"./index-nmvhjn8c.js";
21
+ } from "./index-6j351de4.js";
22
+ import"./index-0z8sbdme.js";
19
23
  import {
20
24
  AllRoutesBuilder,
21
- precompressArtifacts,
22
25
  SsrBaseArtifactBuilder,
23
26
  VendorImportScanner
24
- } from "./index-x40bdsca.js";
27
+ } from "./index-jg5rwrf7.js";
25
28
  import {
26
- CsrArtifactBuilder
27
- } from "./index-xvk2a75m.js";
29
+ CsrArtifactBuilder2
30
+ } from "./index-38x8ynrx.js";
28
31
  import"./index-62md4dwy.js";
29
32
 
30
- // pkgs/@akanjs/devkit/applicationBuildRunner.ts
33
+ // pkgs/@akanjs/devkit/app/applicationBuildRunner.ts
31
34
  import path3 from "path";
32
35
  import { toError } from "akanjs/common";
33
36
  import { BUILD_ENV_FILE } from "akanjs/server/lifecycle/buildEnv";
@@ -124,7 +127,7 @@ var createServerEnvPlugin = ({
124
127
  };
125
128
  };
126
129
 
127
- // pkgs/@akanjs/devkit/applicationBuildRunner.ts
130
+ // pkgs/@akanjs/devkit/app/applicationBuildRunner.ts
128
131
  var BUILD_PHASE_EMOJIS = {
129
132
  prepare: "\uD83E\uDDF9",
130
133
  typecheck: "\uD83D\uDD0E",
@@ -153,6 +156,7 @@ var AKAN_OPTIONAL_BACKEND_EXTERNALS = ["bullmq", "ioredis", "postgres", "protobu
153
156
  class ApplicationBuildRunner {
154
157
  #app;
155
158
  #fast;
159
+ #verify;
156
160
  #reporter;
157
161
  #environment;
158
162
  #profile;
@@ -161,9 +165,17 @@ class ApplicationBuildRunner {
161
165
  #spinner;
162
166
  #startedAt = Date.now();
163
167
  #phases = [];
164
- constructor(app, { fast = false, reporter, environment, profile, budget = "report" } = {}) {
168
+ constructor(app, {
169
+ fast = false,
170
+ verify = false,
171
+ reporter,
172
+ environment,
173
+ profile,
174
+ budget = "report"
175
+ } = {}) {
165
176
  this.#app = app;
166
- this.#fast = fast;
177
+ this.#fast = fast || verify;
178
+ this.#verify = verify;
167
179
  this.#reporter = reporter;
168
180
  this.#environment = environment;
169
181
  this.#profile = profile;
@@ -201,11 +213,22 @@ class ApplicationBuildRunner {
201
213
  await this.#runPhase("typecheck", "Typechecking", () => this.typecheck());
202
214
  await this.#runPhase("backend", "Compiling backend", () => this.#buildBackend(), (result) => `${result.entrypoints} entrypoints, ${result.outputs} outputs`);
203
215
  await this.#runPhase("ssr", "Building SSR route artifacts", async () => web.ssr ? await this.#buildSsr() : null, (result) => result ? `${result.allRoutes.manifest.routeIds.length} routes, ${result.allRoutes.manifest.knownEntries.length} entries` : web.ssr ? "skipped" : "disabled by akan.config.ts web.ssr");
204
- await this.#runPhase("csr", "Building CSR assets", async () => web.csr ? await new CsrArtifactBuilder(this.#app, "build").build() : null, (result) => result?.outputDir ?? (web.csr ? "skipped" : "disabled by akan.config.ts web.csr"));
216
+ if (this.#verify) {
217
+ const routeJs = await this.#runBudgetPhase(environment);
218
+ await this.#app.dist.writeJson("akan.build.json", { profile: "verify", builtAt: new Date().toISOString() });
219
+ return this.#resultOf(environment, routeJs);
220
+ }
221
+ await this.#runPhase("csr", "Building CSR assets", async () => web.csr ? await new CsrArtifactBuilder2(this.#app, "build").build() : null, (result) => result?.outputDir ?? (web.csr ? "skipped" : "disabled by akan.config.ts web.csr"));
205
222
  await this.#runPhase("assets", "Trimming unread static assets", async () => assets.pruneFonts ? await new FontPruner(this.#app, assets).prune() : null, (result) => result ? `${result.removed.length} font file(s) dropped, ${ApplicationBuildRunner.formatBytes(result.freedBytes)} freed; ${result.kept.length} kept` : "disabled by akan.config.ts assets.pruneFonts");
206
223
  await this.#runPhase("compress", "Compressing static assets", () => precompressArtifacts(this.#app), (result) => result.files > 0 ? `${result.files} files, ${ApplicationBuildRunner.formatBytes(result.inputBytes)} -> gzip ${ApplicationBuildRunner.formatBytes(result.outputBytes)} / br ${ApplicationBuildRunner.formatBytes(result.brotliBytes)}` : "no files");
207
- const routeJs = await this.#runPhase("budget", "Measuring route JS", () => this.#measureRouteJs(environment), (result) => result?.summary ?? (this.#budget === "off" ? "off for this build" : "no server pages"));
224
+ const routeJs = await this.#runBudgetPhase(environment);
208
225
  await this.#runPhase("metadata", "Writing production metadata", () => this.buildAppMeta());
226
+ return this.#resultOf(environment, routeJs);
227
+ }
228
+ #runBudgetPhase(environment) {
229
+ return this.#runPhase("budget", "Measuring route JS", () => this.#measureRouteJs(environment), (result) => result?.summary ?? (this.#budget === "off" ? "off for this build" : "no server pages"));
230
+ }
231
+ #resultOf(environment, routeJs) {
209
232
  return {
210
233
  phases: this.#phases,
211
234
  ...routeJs ? { routeJs: routeJs.sizes } : {},
@@ -310,6 +333,10 @@ class ApplicationBuildRunner {
310
333
  });
311
334
  return this.#serverEnv;
312
335
  }
336
+ #verifyBanner() {
337
+ const message = `dist/apps/${this.#app.name} holds the partial output of akan verify, not a build. Run \`akan build ${this.#app.name}\` first.`;
338
+ return `console.error(${JSON.stringify(message)});process.exit(1);`;
339
+ }
313
340
  async#buildBackend() {
314
341
  const { externalLibs, web, baseDevEnv, branches } = await this.#app.getConfig();
315
342
  const backendEntryPoints = [`${this.#app.cwdPath}/main.ts`, `${this.#app.cwdPath}/server.ts`];
@@ -330,7 +357,11 @@ class ApplicationBuildRunner {
330
357
  plugins: [this.#createExternalSpecifiersPlugin(externalLibs), serverEnvPlugin]
331
358
  };
332
359
  const [mainResult, serverResult] = [
333
- await this.#buildOrThrow("backend", { ...backendConfig, entrypoints: [backendEntryPoints[0]] }),
360
+ await this.#buildOrThrow("backend", {
361
+ ...backendConfig,
362
+ entrypoints: [backendEntryPoints[0]],
363
+ ...this.#verify ? { banner: this.#verifyBanner() } : {}
364
+ }),
334
365
  await this.#buildOrThrow("backend", { ...backendConfig, entrypoints: [backendEntryPoints[1]], splitting: true })
335
366
  ];
336
367
  const rscWorkerResult = web.ssr ? await this.#buildOrThrow("rsc-worker", {
@@ -405,7 +436,7 @@ void run().catch((error) => {
405
436
  async#measureRouteJs(environment) {
406
437
  if (this.#budget === "off" || !this.#modulesByRoute)
407
438
  return null;
408
- const sizes = await RouteJsBudget.measure(path3.join(this.#app.dist.cwdPath, ".akan/artifact"), this.#modulesByRoute);
439
+ const sizes = await RouteJsBudget.measure(path3.join(this.#app.dist.cwdPath, ".akan/artifact"), this.#modulesByRoute, { precompressed: !this.#verify });
409
440
  const budgetPath = path3.join(this.#app.cwdPath, RouteJsBudget.fileName);
410
441
  const { summary: status, warnings } = await RouteJsBudget.check(sizes, {
411
442
  mode: this.#budget,