@akanjs/cli 3.1.2-rc.3 → 3.2.0-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 (130) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-n2tkg59z.js → CodeAgent-h6g8dg3a.js} +2 -2
  3. package/{CodeTui-9wsdx7ap.js → CodeTui-n9gacepn.js} +1 -1
  4. package/README.ko.md +9 -0
  5. package/README.md +9 -0
  6. package/TunnelShare-k3ja4w9x.js +14 -0
  7. package/{agent.command-tffz6wdn.js → agent.command-2f657613.js} +19 -17
  8. package/akanCode.js +2 -2
  9. package/{application.command-7bkxbrsp.js → application.command-yb8v177e.js} +45 -22
  10. package/{applicationBuildRunner-s13x3zqb.js → applicationBuildRunner-sctcmkyx.js} +57 -17
  11. package/buildBatch.proc.js +7 -7
  12. package/{cloud.command-a792bc10.js → cloud.command-et06ja22.js} +35 -18
  13. package/cloud.script-s6rbrwer.js +30 -0
  14. package/{code.command-ma8dtzww.js → code.command-7m67c7zc.js} +6 -6
  15. package/commandManifest.json +1 -1
  16. package/{context.command-80a1qhps.js → context.command-569z0rqf.js} +20 -19
  17. package/context.runner-ms8v1rxy.js +29 -0
  18. package/{guideline.command-195g0h9a.js → guideline.command-gnv3e8p8.js} +2 -2
  19. package/guidelines/akanApi/akanApi.instruction.md +317 -0
  20. package/guidelines/conventions/rules/app.md +5 -5
  21. package/guidelines/conventions/rules/config.md +1 -1
  22. package/guidelines/conventions/rules/gates.md +10 -5
  23. package/guidelines/conventions/rules/page.md +4 -2
  24. package/guidelines/conventions/rules/server.md +2 -0
  25. package/guidelines/conventions/rules/style.md +3 -1
  26. package/guidelines/conventions/rules/ts.md +2 -1
  27. package/guidelines/cssRule/cssRule.instruction.md +3 -1
  28. package/guidelines/pageRule/pageRule.instruction.md +3 -0
  29. package/incrementalBuilder.proc.js +70 -14
  30. package/{index-tns543wd.js → index-0fb3cpbt.js} +3 -3
  31. package/{index-zbrwnmf1.js → index-1q1cjn8s.js} +21 -11
  32. package/{index-wrmq92vk.js → index-3wjbhj2n.js} +1 -1
  33. package/{index-361ex3rb.js → index-48d5qsj3.js} +4 -4
  34. package/{index-aayg4dqf.js → index-5w9my9qe.js} +8 -8
  35. package/{index-1h2jc0x3.js → index-6wpaq392.js} +61 -15
  36. package/{index-tp56652m.js → index-7xdpww43.js} +69 -12
  37. package/index-7y5yghjg.js +2969 -0
  38. package/{index-zttm13c3.js → index-8g7tdsk4.js} +249 -696
  39. package/{index-m02tdq8a.js → index-8pb9yvp8.js} +63 -21
  40. package/{index-gbp1q1b5.js → index-8ts9774g.js} +4 -4
  41. package/{index-9zy8479y.js → index-93ewzmp6.js} +43 -14
  42. package/{index-zdpte1pj.js → index-9tbgb4d8.js} +1 -1
  43. package/index-abgh0jve.js +126 -0
  44. package/{index-khk05tsf.js → index-aj3ehkcx.js} +1 -1
  45. package/{index-84h43kg6.js → index-d4n1wmrz.js} +37 -4
  46. package/{index-gr9thy79.js → index-drz9e84d.js} +22 -8
  47. package/{index-hapx5myy.js → index-e3vmjtph.js} +2 -2
  48. package/{index-k64mhwbw.js → index-eajbmk10.js} +2 -1
  49. package/{index-0j1t1h2b.js → index-ed6ea0qp.js} +1 -1
  50. package/{index-sjabnf7j.js → index-fjr4d6yd.js} +444 -368
  51. package/index-hqrkqxx2.js +176 -0
  52. package/{index-z7kbxdqg.js → index-jdamtr7e.js} +3 -3
  53. package/{index-scck6h6d.js → index-kpdv34rq.js} +4 -4
  54. package/{index-ppvqy5bc.js → index-ktb3wcqz.js} +73 -34
  55. package/{index-sveq36gh.js → index-mmym5xmb.js} +4 -2
  56. package/{index-y4kcmbt2.js → index-mqntfzv5.js} +2 -2
  57. package/{index-4am4dvmf.js → index-ny2k80mv.js} +15 -3
  58. package/index-p6hjwt2d.js +1668 -0
  59. package/{index-wwe9rsrx.js → index-r0a604h4.js} +12 -2
  60. package/{index-jb2sreps.js → index-rc5fvqj2.js} +18 -18
  61. package/{index-db2nqrad.js → index-ryrm5z2c.js} +71 -19
  62. package/{index-eft5c2mp.js → index-s2grpzef.js} +331 -27
  63. package/{index-g500c5j9.js → index-sr5da35e.js} +33 -10
  64. package/{index-defp4gmb.js → index-sy481q2x.js} +1 -1
  65. package/{index-j9d3mjx1.js → index-thckcabc.js} +2 -2
  66. package/{index-9z3egsmg.js → index-vkzfk7qt.js} +25 -23
  67. package/index-w639tvkd.js +166 -0
  68. package/index-ygdbn9jn.js +122 -0
  69. package/{index-sp0qsr7a.js → index-zpv14wpy.js} +3 -3
  70. package/{index-sx91nf4z.js → index-zxsygkda.js} +18 -9
  71. package/index.js +24 -23
  72. package/{library.command-63hgt9te.js → library.command-1gp5qe3r.js} +3 -3
  73. package/{localRegistry.command-343ksmn9.js → localRegistry.command-v3g21rex.js} +25 -16
  74. package/{module.command-2hce9m6k.js → module.command-4xz9he6h.js} +6 -6
  75. package/{package.command-96eheyvd.js → package.command-s7qpnn1g.js} +12 -3
  76. package/package.json +2 -2
  77. package/{page.command-gs6d841d.js → page.command-fan34c49.js} +3 -3
  78. package/{pipeline.command-wdfvdbfj.js → pipeline.command-ph4fnn9w.js} +2 -2
  79. package/{primitive.command-7tdj12wn.js → primitive.command-3fqh8emf.js} +7 -7
  80. package/{projectTypecheck-kqj1t6hb.js → projectTypecheck-vkb40hjc.js} +1 -1
  81. package/{quality.command-29bgarh1.js → quality.command-ecj6exsh.js} +15 -10
  82. package/{repair.command-yng4rf5d.js → repair.command-fe9jw719.js} +6 -6
  83. package/{scalar.command-1nk4329t.js → scalar.command-cnvfhk0n.js} +5 -5
  84. package/skills/akan-debug/SKILL.md +2 -1
  85. package/skills/akan-page/SKILL.md +30 -2
  86. package/skills/akan-service/SKILL.md +77 -1
  87. package/{subspace.command-5cehmcdd.js → subspace.command-yxtt3v3e.js} +8 -8
  88. package/templates/app/lib/___appName__/__appName__.abstract.md.template +6 -0
  89. package/templates/app/page/_index.tsx +4 -284
  90. package/templates/app/page/_layout.tsx +1 -26
  91. package/templates/app/page/styles.css.template +58 -318
  92. package/templates/appSample/page/_index.tsx +281 -0
  93. package/templates/appSample/page/_layout.tsx +55 -0
  94. package/templates/appSample/page/styles.css.template +327 -0
  95. package/templates/libRoot/lib/___libName__/__libName__.abstract.md.template +6 -0
  96. package/templates/workspaceRoot/package.json.template +1 -12
  97. package/{tunnel.command-yrd4atqy.js → tunnel.command-ggj38mqf.js} +7 -7
  98. package/{typeChecker-j2jdnqsr.js → typeChecker-s640r6c0.js} +1 -1
  99. package/typecheck.proc.js +1 -1
  100. package/{verify.command-kbq0fcg8.js → verify.command-w9ttxkdz.js} +16 -14
  101. package/{workflow.command-274qfa8z.js → workflow.command-ss8devj0.js} +12 -12
  102. package/{workspace.command-r6hgmawy.js → workspace.command-rw1p0xeq.js} +50 -38
  103. package/TunnelShare-6d7z36sr.js +0 -14
  104. package/cloud.script-t2n13gv6.js +0 -27
  105. package/context.runner-wxqb3qcy.js +0 -28
  106. package/index-j2dgmzbj.js +0 -1259
  107. package/index-p6x5b7hr.js +0 -839
  108. package/index-vzpnr12w.js +0 -65
  109. package/templates/workspaceRoot/patches/zod@3.25.76.patch.template +0 -22
  110. package/templates/workspaceRoot/patches/zod@4.4.3.patch.template +0 -11
  111. /package/templates/{app → appSample}/page/_overrides.tsx +0 -0
  112. /package/templates/{app → appSample}/public/fonts/Pretendard-Black.woff2 +0 -0
  113. /package/templates/{app → appSample}/public/fonts/Pretendard-Bold.woff2 +0 -0
  114. /package/templates/{app → appSample}/public/fonts/Pretendard-ExtraBold.woff2 +0 -0
  115. /package/templates/{app → appSample}/public/fonts/Pretendard-ExtraLight.woff2 +0 -0
  116. /package/templates/{app → appSample}/public/fonts/Pretendard-Light.woff2 +0 -0
  117. /package/templates/{app → appSample}/public/fonts/Pretendard-Medium.woff2 +0 -0
  118. /package/templates/{app → appSample}/public/fonts/Pretendard-Regular.woff2 +0 -0
  119. /package/templates/{app → appSample}/public/fonts/Pretendard-SemiBold.woff2 +0 -0
  120. /package/templates/{app → appSample}/public/fonts/Pretendard-Thin.woff2 +0 -0
  121. /package/templates/{app → appSample}/public/jelly/cloud.webp +0 -0
  122. /package/templates/{app → appSample}/public/jelly/comet.webp +0 -0
  123. /package/templates/{app → appSample}/public/jelly/moon.webp +0 -0
  124. /package/templates/{app → appSample}/public/jelly/planet.webp +0 -0
  125. /package/templates/{app → appSample}/public/jelly/rocket.webp +0 -0
  126. /package/templates/{app → appSample}/public/jelly/star.webp +0 -0
  127. /package/templates/{app → appSample}/public/jelly/sugar.webp +0 -0
  128. /package/templates/{app → appSample}/public/logo.png +0 -0
  129. /package/templates/{app → appSample}/ui/Recipe/index.ts +0 -0
  130. /package/templates/{app → appSample}/ui/Recipe/jellyButton.ts +0 -0
package/.build-stamp CHANGED
@@ -1 +1 @@
1
- d8513e49255bf8543d57da33449af8ef9a0f8a5ffdca3bc7312299043ea77e58
1
+ 277283badfb3b546b17b9a48c252758f32a9629bd60791e3460ca1e04f4abfad
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  CodeAgent2
4
- } from "./index-z7kbxdqg.js";
5
- import"./index-wrmq92vk.js";
4
+ } from "./index-jdamtr7e.js";
5
+ import"./index-3wjbhj2n.js";
6
6
  import"./index-tenw3mah.js";
7
7
  import"./index-35j83zkd.js";
8
8
  import"./index-bns3wcpc.js";
@@ -4,7 +4,7 @@ import {
4
4
  McpTokenStore,
5
5
  McpSignIn,
6
6
  AkanCodeCompaction2
7
- } from "./index-wrmq92vk.js";
7
+ } from "./index-3wjbhj2n.js";
8
8
  import"./index-bns3wcpc.js";
9
9
  import"./index-35j83zkd.js";
10
10
  import {
package/README.ko.md CHANGED
@@ -108,6 +108,15 @@ Akan 프레임워크 패키지는 `dist/pkgs/*`에서만 배포합니다. `verif
108
108
  확인합니다. 저장소 릴리스에서는 `bun run release:build-packages && bun run release:verify-packages`를 쓰세요. CLI
109
109
  패키지 결과물이 마지막에 빌드되어 루트 `akan` 부트스트랩 스크립트가 덮어쓰지 않습니다.
110
110
 
111
+ 릴리스 후보(rc)는 CI가 배포합니다. `rc` 브랜치에 push될 때마다 CI 전체를 돌린 뒤, 대기 중인 changeset이
112
+ 릴리스할 버전의 다음 `<version>-rc.N`을 npm provenance와 함께 배포하고 그 커밋에 `v<version>-rc.N` 태그를 붙입니다.
113
+ 정식 릴리스는 지금처럼 수동입니다: `bun run changeset:version` 후 `akan deploy-akan --registry npm`.
114
+ `npm-publish` environment는 `rc`만 허용하므로 `rc`에 push할 수 있는 사람은 rc를 배포할 수 있습니다. 저장소 규칙에서
115
+ `rc` push 권한을 제한하세요.
116
+
117
+ `akan sync-architecture`는 `pkgs/akanjs/ARCHITECTURE.md`의 패싯 레이어와 프로세스 메시지 표를 프레임워크 소스에서
118
+ 다시 만들고, 손으로 쓴 부분이 소스에 더는 없는 클래스를 가리키면 실패합니다.
119
+
111
120
  ## 패키지 경계
112
121
 
113
122
  - 애플리케이션과 런타임 코드에서는 `akanjs`를 사용합니다.
package/README.md CHANGED
@@ -107,6 +107,15 @@ against the built packages and checks metadata that must be correct before `depl
107
107
  For repository releases, prefer `bun run release:build-packages && bun run release:verify-packages` so the CLI package
108
108
  artifact is built last and is not overwritten by the root `akan` bootstrap script.
109
109
 
110
+ Release candidates publish from CI: each push to the `rc` branch runs the CI suite, then publishes the next
111
+ `<version>-rc.N` of the version the pending changesets will release, with npm provenance, and tags that commit
112
+ `v<version>-rc.N`. Stable releases stay manual: `bun run changeset:version`, then `akan deploy-akan --registry npm`.
113
+ The `npm-publish` environment admits only `rc`, so whoever can push to `rc` can publish an rc: restrict pushes to
114
+ `rc` in the repository's rules.
115
+
116
+ `akan sync-architecture` regenerates the facet layers and process-message tables of `pkgs/akanjs/ARCHITECTURE.md`
117
+ from the framework source, and fails when the hand-kept part names a class the source no longer has.
118
+
110
119
  ## Package Boundary
111
120
 
112
121
  - Use `akanjs` from application and runtime code.
@@ -0,0 +1,14 @@
1
+ // @bun
2
+ import {
3
+ TunnelShare2
4
+ } from "./index-9tbgb4d8.js";
5
+ import"./index-drz9e84d.js";
6
+ import"./index-zpv14wpy.js";
7
+ import"./index-m9jj544v.js";
8
+ import"./index-mmym5xmb.js";
9
+ import"./index-1q1cjn8s.js";
10
+ import"./index-sr5da35e.js";
11
+ import"./index-bns3wcpc.js";
12
+ export {
13
+ TunnelShare2 as TunnelShare
14
+ };
@@ -2,31 +2,33 @@
2
2
  import {
3
3
  Workspace,
4
4
  command
5
- } from "./index-9zy8479y.js";
5
+ } from "./index-93ewzmp6.js";
6
6
  import"./index-bns3wcpc.js";
7
- import"./index-g500c5j9.js";
7
+ import"./index-sr5da35e.js";
8
8
  import"./index-35j83zkd.js";
9
9
  import"./index-j6eeh5d7.js";
10
10
  import"./index-hj6w4ka1.js";
11
- import"./index-m02tdq8a.js";
12
- import"./index-j2dgmzbj.js";
13
- import"./index-j9d3mjx1.js";
14
- import"./index-ppvqy5bc.js";
15
- import"./index-p6x5b7hr.js";
16
- import"./index-sp0qsr7a.js";
17
- import"./index-0j1t1h2b.js";
11
+ import"./index-8pb9yvp8.js";
12
+ import"./index-7y5yghjg.js";
13
+ import"./index-thckcabc.js";
14
+ import"./index-ktb3wcqz.js";
15
+ import"./index-p6hjwt2d.js";
16
+ import"./index-zpv14wpy.js";
17
+ import"./index-ed6ea0qp.js";
18
18
  import"./index-m9jj544v.js";
19
- import"./index-zbrwnmf1.js";
20
- import"./index-sveq36gh.js";
21
- import"./index-sjabnf7j.js";
19
+ import"./index-1q1cjn8s.js";
20
+ import"./index-mmym5xmb.js";
21
+ import"./index-fjr4d6yd.js";
22
+ import"./index-hqrkqxx2.js";
22
23
  import"./index-62md4dwy.js";
23
- import"./index-4am4dvmf.js";
24
- import"./index-k64mhwbw.js";
24
+ import"./index-ygdbn9jn.js";
25
+ import"./index-ny2k80mv.js";
26
+ import"./index-eajbmk10.js";
27
+ import"./index-s2grpzef.js";
25
28
  import {
26
29
  AgentScript
27
- } from "./index-aayg4dqf.js";
28
- import"./index-eft5c2mp.js";
29
- import"./index-defp4gmb.js";
30
+ } from "./index-5w9my9qe.js";
31
+ import"./index-sy481q2x.js";
30
32
 
31
33
  // pkgs/@akanjs/cli/agent/agent.command.ts
32
34
  class AgentCommand extends command("agent", [AgentScript], ({ public: target }) => ({
package/akanCode.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  CodeMailbox2,
31
31
  CodeSessionFork2,
32
32
  CodeAgent2
33
- } from "./index-z7kbxdqg.js";
33
+ } from "./index-jdamtr7e.js";
34
34
  import {
35
35
  akanCodeDefaultModel2,
36
36
  akanCodeModel2,
@@ -41,7 +41,7 @@ import {
41
41
  import {
42
42
  SubagentPool2,
43
43
  AkanCodeCompaction2
44
- } from "./index-wrmq92vk.js";
44
+ } from "./index-3wjbhj2n.js";
45
45
  import {
46
46
  PreviewChrome2,
47
47
  PreviewView2
@@ -7,20 +7,20 @@ import {
7
7
  Exec,
8
8
  Workspace,
9
9
  command
10
- } from "./index-9zy8479y.js";
10
+ } from "./index-93ewzmp6.js";
11
11
  import"./index-bns3wcpc.js";
12
- import"./index-g500c5j9.js";
13
- import"./index-p6x5b7hr.js";
14
- import"./index-sp0qsr7a.js";
15
- import"./index-0j1t1h2b.js";
12
+ import"./index-sr5da35e.js";
13
+ import"./index-p6hjwt2d.js";
14
+ import"./index-zpv14wpy.js";
15
+ import"./index-ed6ea0qp.js";
16
16
  import"./index-m9jj544v.js";
17
- import"./index-zbrwnmf1.js";
18
- import"./index-sveq36gh.js";
19
- import"./index-y4kcmbt2.js";
20
- import"./index-ppvqy5bc.js";
17
+ import"./index-1q1cjn8s.js";
18
+ import"./index-mmym5xmb.js";
19
+ import"./index-mqntfzv5.js";
20
+ import"./index-ktb3wcqz.js";
21
21
  import {
22
22
  ApplicationScript
23
- } from "./index-db2nqrad.js";
23
+ } from "./index-ryrm5z2c.js";
24
24
  import"./index-tenw3mah.js";
25
25
  import {
26
26
  writeOption,
@@ -29,7 +29,7 @@ import {
29
29
  allowLocalOption,
30
30
  publicEnvOption
31
31
  } from "./index-mdjc93e1.js";
32
- import"./index-defp4gmb.js";
32
+ import"./index-sy481q2x.js";
33
33
  import"./index-9bv479q5.js";
34
34
 
35
35
  // pkgs/@akanjs/cli/application/application.command.ts
@@ -49,6 +49,7 @@ var startEnvOption = {
49
49
  desc: "backend environment of a --release build; a dev build follows `akan start`, which keeps its own",
50
50
  default: "local"
51
51
  };
52
+ var listOf = (value) => (value ?? "").split(",").map((entry) => entry.trim()).filter(Boolean);
52
53
 
53
54
  class ApplicationCommand extends command("application", [ApplicationScript], ({ public: target }) => ({
54
55
  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) {
@@ -94,7 +95,7 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
94
95
  desc: "Open pages of the app's dev server in a headless browser and print what broke, starting a server if none runs",
95
96
  stdio: true
96
97
  }).with(App).arg("paths", String, {
97
- desc: "page paths, comma-separated; the default locale is added when missing (default: /)",
98
+ desc: "page paths, comma-separated; the default locale is added when missing, but not to /_akan routes such as Studio or to files (default: /)",
98
99
  example: "/board,/board/new",
99
100
  nullable: true
100
101
  }).option("changed", Boolean, {
@@ -110,7 +111,7 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
110
111
  default: false
111
112
  }).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
113
  await this.applicationScript.preview(app, {
113
- paths: (paths ?? "").split(",").map((entry) => entry.trim()).filter(Boolean),
114
+ paths: listOf(paths),
114
115
  changed,
115
116
  csr,
116
117
  engine: engine === "webkit" || engine === "chrome" ? engine : null,
@@ -122,15 +123,24 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
122
123
  });
123
124
  }),
124
125
  studio: target({
125
- desc: "Print the Akan Studio URL of the app's running dev server: its ERD and each module's signals"
126
- }).with(App).option("module", String, { desc: "the module to show", nullable: true }).option("view", String, { flag: "w", desc: "the view to open", default: "erd", enum: ["erd", "signals"] }).option("editor", String, {
126
+ 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"
127
+ }).with(App).option("module", String, { desc: "the module to show", nullable: true }).option("view", String, {
128
+ flag: "w",
129
+ desc: "the view to open",
130
+ default: "erd",
131
+ enum: ["erd", "signals", "changes", "runtime", "framework"]
132
+ }).option("since", String, {
133
+ desc: "the git revision the Change Map compares with (default: where HEAD forked from the default branch)",
134
+ nullable: true
135
+ }).option("editor", String, {
127
136
  desc: "the editor source links open in",
128
137
  default: "vscode",
129
138
  enum: ["vscode", "cursor"]
130
- }).option("open", Boolean, { desc: "also open it in the browser", default: false }).option("format", String, { desc: "output format", default: "text", enum: ["text", "json"] }).exec(async function(app, module, view, editor, open, format) {
139
+ }).option("open", Boolean, { desc: "also open it in the browser", default: false }).option("format", String, { desc: "output format", default: "text", enum: ["text", "json"] }).exec(async function(app, module, view, since, editor, open, format) {
131
140
  await this.applicationScript.studio(app, {
132
141
  module,
133
- view: view === "signals" ? "signals" : "erd",
142
+ view: view === "signals" || view === "changes" || view === "runtime" || view === "framework" ? view : "erd",
143
+ since,
134
144
  editor: editor === "cursor" ? "cursor" : "vscode",
135
145
  open,
136
146
  format: format === "json" ? "json" : "text"
@@ -172,8 +182,22 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
172
182
  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, {
173
183
  desc: "server env profile: bundle env/env.server.<env>.<profile>.ts in place of the environment's own file",
174
184
  nullable: true
175
- }).exec(async function(app, write, fast, quiet, profile) {
176
- await this.applicationScript.build(app, { write, fast, quiet, profile: profile ?? undefined });
185
+ }).option("env", String, {
186
+ enum: devEnvs,
187
+ desc: "environment the server runs in (default: AKAN_PUBLIC_ENV of the shell, else of the workspace .env)",
188
+ nullable: true
189
+ }).option("updateBudget", Boolean, {
190
+ desc: "write akan.budget.json: add each new route's JS and lower an entry a route now fits under, never raise one",
191
+ default: false
192
+ }).exec(async function(app, write, fast, quiet, profile, env, updateBudget) {
193
+ await this.applicationScript.build(app, {
194
+ write,
195
+ fast,
196
+ quiet,
197
+ profile: profile ?? undefined,
198
+ env: env ?? undefined,
199
+ updateBudget
200
+ });
177
201
  }),
178
202
  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) {
179
203
  await this.applicationScript.typecheck(sys, { write, clean, incremental, tests });
@@ -182,9 +206,8 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
182
206
  desc: "test files or folders to run, relative to the target or the workspace root, comma-separated (default: all)",
183
207
  example: "lib/user/user.signal.test.ts",
184
208
  nullable: true
185
- }).option("write", Boolean, writeOption).exec(async function(exec, files, write) {
186
- const testFiles = (files ?? "").split(",").map((file) => file.trim()).filter(Boolean);
187
- await this.applicationScript.test(exec, { write, files: testFiles });
209
+ }).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) {
210
+ await this.applicationScript.test(exec, { write, files: listOf(files), coverage });
188
211
  }),
189
212
  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) {
190
213
  await this.applicationScript.buildIos(app, { target, env, profile: debug ? "debug" : "release", write });
@@ -3,20 +3,27 @@ import {
3
3
  ServerEnvProfile,
4
4
  Spinner,
5
5
  ProjectTypecheck2,
6
+ parseEnvFile,
6
7
  WorkspaceExecutor
7
- } from "./index-g500c5j9.js";
8
+ } from "./index-sr5da35e.js";
8
9
  import"./index-bns3wcpc.js";
9
- import"./index-tp56652m.js";
10
- import"./index-zbrwnmf1.js";
11
10
  import {
12
- AllRoutesBuilder,
11
+ NARROWABLE_VENDOR_SPECIFIERS
12
+ } from "./index-7xdpww43.js";
13
+ import {
13
14
  FontPruner,
15
+ RouteJsBudget
16
+ } from "./index-p6hjwt2d.js";
17
+ import"./index-1q1cjn8s.js";
18
+ import {
19
+ AllRoutesBuilder,
14
20
  precompressArtifacts,
15
- SsrBaseArtifactBuilder
16
- } from "./index-zttm13c3.js";
21
+ SsrBaseArtifactBuilder,
22
+ VendorImportScanner
23
+ } from "./index-8g7tdsk4.js";
17
24
  import {
18
25
  CsrArtifactBuilder
19
- } from "./index-sveq36gh.js";
26
+ } from "./index-mmym5xmb.js";
20
27
  import"./index-62md4dwy.js";
21
28
 
22
29
  // pkgs/@akanjs/devkit/applicationBuildRunner.ts
@@ -92,7 +99,7 @@ var createServerEnvPlugin = ({
92
99
  build.onLoad({ filter }, async (args) => {
93
100
  const name = path2.basename(args.path, ".ts").slice("env.server.".length);
94
101
  const { exports } = new Bun.Transpiler({ loader: "ts" }).scan(await Bun.file(args.path).text());
95
- const message = `env/env.server.${name}.ts is not in this build: \`akan build\` bundles the server env of AKAN_PUBLIC_ENV=${environment} alone, the environment its image runs. To run ${name}, build for it: AKAN_PUBLIC_ENV=${name} in the workspace's .env, which outranks the shell, or --env ${name} on a desktop or mobile build.`;
102
+ const message = `env/env.server.${name}.ts is not in this build: \`akan build\` bundles the server env of AKAN_PUBLIC_ENV=${environment} alone, the environment its image runs. To run ${name}, build for it with \`--env ${name}\` (\`akan build\` or a desktop or mobile build), or AKAN_PUBLIC_ENV=${name} in the shell or the workspace's .env.`;
96
103
  return {
97
104
  loader: "js",
98
105
  contents: [
@@ -125,6 +132,7 @@ var BUILD_PHASE_EMOJIS = {
125
132
  csr: "\uD83C\uDFA8",
126
133
  assets: "\u2702\uFE0F",
127
134
  compress: "\uD83D\uDDDC\uFE0F",
135
+ budget: "\uD83D\uDCCF",
128
136
  metadata: "\uD83D\uDCDD"
129
137
  };
130
138
  var SSR_RENDER_EXTERNALS = [
@@ -147,15 +155,18 @@ class ApplicationBuildRunner {
147
155
  #reporter;
148
156
  #environment;
149
157
  #profile;
158
+ #budget;
159
+ #modulesByRoute;
150
160
  #spinner;
151
161
  #startedAt = Date.now();
152
162
  #phases = [];
153
- constructor(app, { fast = false, reporter, environment, profile } = {}) {
163
+ constructor(app, { fast = false, reporter, environment, profile, budget = "report" } = {}) {
154
164
  this.#app = app;
155
165
  this.#fast = fast;
156
166
  this.#reporter = reporter;
157
167
  this.#environment = environment;
158
168
  this.#profile = profile;
169
+ this.#budget = budget;
159
170
  }
160
171
  get #envDir() {
161
172
  return path3.join(this.#app.cwdPath, "env");
@@ -166,12 +177,14 @@ class ApplicationBuildRunner {
166
177
  AKAN_PUBLIC_REPO_NAME: baseDevEnv.repoName,
167
178
  AKAN_PUBLIC_SERVE_DOMAIN: baseDevEnv.serveDomain
168
179
  };
169
- const outranked = Object.entries(imageEnv).filter(([key, value]) => {
170
- const given = process.env[key];
171
- return !!given && given !== value && !(key === "AKAN_PUBLIC_ENV" && this.#environment);
180
+ const dotenv = parseEnvFile(path3.join(this.#app.workspace.workspaceRoot, ".env"));
181
+ const overridden = Object.entries(imageEnv).filter(([key, value]) => {
182
+ if (!dotenv[key] || dotenv[key] === value || WorkspaceExecutor.publicEnvPin?.[key])
183
+ return false;
184
+ return !(key === "AKAN_PUBLIC_ENV" && this.#environment);
172
185
  });
173
- if (outranked.length)
174
- this.#app.logger.warn(`The workspace .env outranks this process's environment: the bundles and the image take ${outranked.map(([key, value]) => `${key}=${value} (not ${process.env[key]})`).join(", ")}.`);
186
+ if (overridden.length)
187
+ this.#app.logger.warn(`The shell (or a .env.local) outranks the workspace .env: the bundles and the image take ${overridden.map(([key, value]) => `${key}=${value} (.env: ${dotenv[key]})`).join(", ")}. Unset it there to build what the .env says.`);
175
188
  Object.assign(process.env, imageEnv);
176
189
  }
177
190
  async build({ spinner = false } = {}) {
@@ -190,12 +203,16 @@ class ApplicationBuildRunner {
190
203
  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"));
191
204
  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");
192
205
  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");
206
+ 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"));
193
207
  await this.#runPhase("metadata", "Writing production metadata", () => this.buildAppMeta());
194
208
  return {
195
209
  phases: this.#phases,
210
+ ...routeJs ? { routeJs: routeJs.sizes } : {},
211
+ ...routeJs?.warnings ? { routeJsWarnings: routeJs.warnings } : {},
196
212
  durationMs: Date.now() - this.#startedAt,
197
213
  outputDir: this.#app.dist.cwdPath,
198
- artifactDir: path3.join(this.#app.dist.cwdPath, ".akan/artifact")
214
+ artifactDir: path3.join(this.#app.dist.cwdPath, ".akan/artifact"),
215
+ environment
199
216
  };
200
217
  }
201
218
  async typecheck(options = {}) {
@@ -374,12 +391,35 @@ void run().catch((error) => {
374
391
  return null;
375
392
  }
376
393
  const { baseDevEnv, branches } = await this.#app.getConfig();
394
+ const routes = new AllRoutesBuilder(this.#app, "build");
395
+ const allRoutes = await routes.build();
396
+ const vendorExports = await VendorImportScanner.exportsUsedIn(path3.join(this.#app.dist.cwdPath, ".akan/artifact/client"), NARROWABLE_VENDOR_SPECIFIERS);
377
397
  const base = await new SsrBaseArtifactBuilder(this.#app, "build", {
378
- serverEnv: this.#serverEnvPlugin(baseDevEnv.env, branches)
398
+ serverEnv: this.#serverEnvPlugin(baseDevEnv.env, branches),
399
+ vendorExports
379
400
  }).build();
380
- const allRoutes = await new AllRoutesBuilder(this.#app, base.artifact, "build").build();
401
+ this.#modulesByRoute = (await routes.writeModulePreloads(base.runtimeChunks)).modulesByRoute();
381
402
  return { base, allRoutes };
382
403
  }
404
+ async#measureRouteJs(environment) {
405
+ if (this.#budget === "off" || !this.#modulesByRoute)
406
+ return null;
407
+ const sizes = await RouteJsBudget.measure(path3.join(this.#app.dist.cwdPath, ".akan/artifact"), this.#modulesByRoute);
408
+ const budgetPath = path3.join(this.#app.cwdPath, RouteJsBudget.fileName);
409
+ const { summary: status, warnings } = await RouteJsBudget.check(sizes, {
410
+ mode: this.#budget,
411
+ budgetPath,
412
+ source: path3.relative(this.#app.workspace.workspaceRoot, budgetPath),
413
+ environment
414
+ });
415
+ const largest = sizes[0];
416
+ const { formatBytes } = ApplicationBuildRunner;
417
+ return {
418
+ sizes,
419
+ summary: largest ? `${sizes.length} routes, largest ${largest.routeId} ${formatBytes(largest.brotliBytes)} brotli (${formatBytes(largest.rawBytes)} raw); ${status}` : status,
420
+ ...warnings ? { warnings } : {}
421
+ };
422
+ }
383
423
  async#buildOrThrow(label, config) {
384
424
  const flag = process.env.AKAN_BUILD_METAFILE;
385
425
  const metafileDir = flag && flag !== "0" && flag !== "false" ? path3.join(this.#app.workspace.workspaceRoot, "local", "build-meta", path3.basename(this.#app.cwdPath)) : null;
@@ -1,31 +1,31 @@
1
1
  // @bun
2
2
  import {
3
+ FontOptimizer,
3
4
  ApplicationBuildReporter
4
- } from "./index-p6x5b7hr.js";
5
+ } from "./index-p6hjwt2d.js";
5
6
  import {
6
7
  resolveSsrPageEntriesForApp,
7
8
  WorkspaceExecutor,
8
9
  AppExecutor
9
- } from "./index-g500c5j9.js";
10
+ } from "./index-sr5da35e.js";
10
11
  import {
11
12
  computeRouteSeedIndex,
12
13
  saveRouteSeedIndex,
13
14
  CsrDevBundler,
14
15
  SsrDevBundler
15
- } from "./index-tp56652m.js";
16
+ } from "./index-7xdpww43.js";
16
17
  import"./index-bns3wcpc.js";
17
18
  import {
18
19
  ServerGraphFile,
19
20
  PagesBundleBuilder
20
- } from "./index-zbrwnmf1.js";
21
+ } from "./index-1q1cjn8s.js";
21
22
  import {
22
23
  CssCompiler,
23
- FontOptimizer,
24
24
  SsrBaseArtifactBuilder
25
- } from "./index-zttm13c3.js";
25
+ } from "./index-8g7tdsk4.js";
26
26
  import {
27
27
  CsrArtifactBuilder
28
- } from "./index-sveq36gh.js";
28
+ } from "./index-mmym5xmb.js";
29
29
  import"./index-62md4dwy.js";
30
30
 
31
31
  // pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
@@ -3,32 +3,35 @@ import {
3
3
  App,
4
4
  Workspace,
5
5
  command
6
- } from "./index-9zy8479y.js";
6
+ } from "./index-93ewzmp6.js";
7
7
  import"./index-bns3wcpc.js";
8
- import"./index-g500c5j9.js";
9
- import"./index-gr9thy79.js";
8
+ import"./index-sr5da35e.js";
9
+ import"./index-drz9e84d.js";
10
10
  import {
11
11
  PlatformTestRun
12
- } from "./index-1h2jc0x3.js";
13
- import"./index-sp0qsr7a.js";
14
- import"./index-0j1t1h2b.js";
12
+ } from "./index-6wpaq392.js";
13
+ import"./index-zpv14wpy.js";
14
+ import"./index-ed6ea0qp.js";
15
15
  import"./index-m9jj544v.js";
16
- import"./index-zbrwnmf1.js";
17
- import"./index-sveq36gh.js";
16
+ import"./index-1q1cjn8s.js";
17
+ import"./index-mmym5xmb.js";
18
18
  import {
19
19
  npmRegistryFromEnv,
20
20
  warnIgnoredNpmRegistry
21
- } from "./index-4am4dvmf.js";
22
- import"./index-p6x5b7hr.js";
23
- import"./index-y4kcmbt2.js";
24
- import"./index-ppvqy5bc.js";
25
- import"./index-db2nqrad.js";
21
+ } from "./index-ny2k80mv.js";
22
+ import"./index-p6hjwt2d.js";
23
+ import"./index-mqntfzv5.js";
24
+ import"./index-ktb3wcqz.js";
25
+ import"./index-ryrm5z2c.js";
26
26
  import"./index-tenw3mah.js";
27
27
  import"./index-qd7xn2bk.js";
28
- import"./index-84h43kg6.js";
28
+ import"./index-7y5yghjg.js";
29
+ import"./index-abgh0jve.js";
30
+ import"./index-hqrkqxx2.js";
31
+ import"./index-d4n1wmrz.js";
29
32
  import {
30
33
  CloudScript2
31
- } from "./index-sx91nf4z.js";
34
+ } from "./index-zxsygkda.js";
32
35
  import {
33
36
  writeOption,
34
37
  oneNativeTargetOption,
@@ -39,7 +42,7 @@ import {
39
42
  hostOption,
40
43
  subspaceOption
41
44
  } from "./index-mdjc93e1.js";
42
- import"./index-defp4gmb.js";
45
+ import"./index-sy481q2x.js";
43
46
  import"./index-9bv479q5.js";
44
47
 
45
48
  // pkgs/@akanjs/cli/cloud/cloud.command.ts
@@ -66,11 +69,25 @@ class CloudCommand extends command("cloud", [CloudScript2], ({ public: target })
66
69
  }).option("platforms", String, {
67
70
  desc: "platforms to test on besides this machine, comma-separated: linux, windows (none to skip)",
68
71
  default: "linux,windows"
69
- }).with(Workspace).exec(async function(test, registry, platforms, workspace) {
72
+ }).option("prerelease", String, {
73
+ flag: "P",
74
+ desc: "publish the next <version>-<prerelease>.N under that dist-tag, whatever the packages carry (example: rc)",
75
+ nullable: true
76
+ }).option("yes", Boolean, {
77
+ desc: "publish without the confirmation and `npm login`, with the credentials npm already has",
78
+ default: false
79
+ }).option("packTo", String, {
80
+ flag: "o",
81
+ desc: "pack the versioned tarballs and a publish.json (version, dist-tag, publish order) into this directory instead of publishing",
82
+ nullable: true
83
+ }).with(Workspace).exec(async function(test, registry, platforms, prerelease, yes, packTo, workspace) {
70
84
  await this.cloudScript.deployAkan(workspace, {
71
85
  test,
72
86
  registryUrl: resolveRegistryUrl(registry),
73
- platforms: PlatformTestRun.parsePlatforms(platforms)
87
+ platforms: PlatformTestRun.parsePlatforms(platforms),
88
+ prerelease,
89
+ yes,
90
+ packTo
74
91
  });
75
92
  }),
76
93
  testPlatforms: target({
@@ -0,0 +1,30 @@
1
+ // @bun
2
+ import {
3
+ CloudScript2
4
+ } from "./index-zxsygkda.js";
5
+ import"./index-6wpaq392.js";
6
+ import"./index-ryrm5z2c.js";
7
+ import"./index-mqntfzv5.js";
8
+ import"./index-d4n1wmrz.js";
9
+ import"./index-drz9e84d.js";
10
+ import"./index-ny2k80mv.js";
11
+ import"./index-ktb3wcqz.js";
12
+ import"./index-sy481q2x.js";
13
+ import"./index-hqrkqxx2.js";
14
+ import"./index-ed6ea0qp.js";
15
+ import"./index-zpv14wpy.js";
16
+ import"./index-m9jj544v.js";
17
+ import"./index-93ewzmp6.js";
18
+ import"./index-9bv479q5.js";
19
+ import"./index-tenw3mah.js";
20
+ import"./index-abgh0jve.js";
21
+ import"./index-7y5yghjg.js";
22
+ import"./index-mmym5xmb.js";
23
+ import"./index-p6hjwt2d.js";
24
+ import"./index-1q1cjn8s.js";
25
+ import"./index-sr5da35e.js";
26
+ import"./index-qd7xn2bk.js";
27
+ import"./index-bns3wcpc.js";
28
+ export {
29
+ CloudScript2 as CloudScript
30
+ };
@@ -4,9 +4,9 @@ import {
4
4
  runner,
5
5
  script,
6
6
  command
7
- } from "./index-9zy8479y.js";
7
+ } from "./index-93ewzmp6.js";
8
8
  import"./index-bns3wcpc.js";
9
- import"./index-g500c5j9.js";
9
+ import"./index-sr5da35e.js";
10
10
  import {
11
11
  AkanCodeEnv,
12
12
  akanCodePaths2
@@ -77,7 +77,7 @@ class CodeRunner extends runner("code") {
77
77
  async serve(options, listen) {
78
78
  await import("./consoleToStderr-h5bryj94.js");
79
79
  const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
80
- import("./CodeAgent-n2tkg59z.js"),
80
+ import("./CodeAgent-h6g8dg3a.js"),
81
81
  import("./CodeAgentRpcHost-6dzfkvsc.js"),
82
82
  import("./CodeAgentRpcListener-tcwrdvst.js")
83
83
  ]);
@@ -111,8 +111,8 @@ class CodeRunner extends runner("code") {
111
111
  }
112
112
  async tui(options, seed) {
113
113
  const [{ CodeAgent }, { CodeTui }] = await Promise.all([
114
- import("./CodeAgent-n2tkg59z.js"),
115
- import("./CodeTui-9wsdx7ap.js")
114
+ import("./CodeAgent-h6g8dg3a.js"),
115
+ import("./CodeTui-n9gacepn.js")
116
116
  ]);
117
117
  const start = await CodeRunner.#start(options, { hostAttached: false, interactive: true, ask: true });
118
118
  const agentOptions = start.agent;
@@ -148,7 +148,7 @@ class CodeRunner extends runner("code") {
148
148
  }
149
149
  }
150
150
  async run(prompt, options) {
151
- const { CodeAgent } = await import("./CodeAgent-n2tkg59z.js");
151
+ const { CodeAgent } = await import("./CodeAgent-h6g8dg3a.js");
152
152
  const ask = !!process.stdin.isTTY && !!process.stderr.isTTY;
153
153
  const start = await CodeRunner.#start(options, { hostAttached: false, interactive: false, ask });
154
154
  for (const warning of start.warnings)