@akanjs/cli 3.1.2-rc.4 → 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 (118) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-z34p8m91.js → CodeAgent-h6g8dg3a.js} +2 -2
  3. package/{CodeTui-nvd9fk3g.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-962mp3kg.js → agent.command-2f657613.js} +19 -17
  8. package/akanCode.js +2 -2
  9. package/{application.command-1nr0bqq1.js → application.command-yb8v177e.js} +35 -21
  10. package/{applicationBuildRunner-xy7hnfzq.js → applicationBuildRunner-sctcmkyx.js} +55 -16
  11. package/buildBatch.proc.js +7 -7
  12. package/{cloud.command-cj7b3m6y.js → cloud.command-et06ja22.js} +35 -18
  13. package/cloud.script-s6rbrwer.js +30 -0
  14. package/{code.command-asq7xrr6.js → code.command-7m67c7zc.js} +6 -6
  15. package/commandManifest.json +1 -1
  16. package/{context.command-fw4g2pw1.js → context.command-569z0rqf.js} +20 -19
  17. package/context.runner-ms8v1rxy.js +29 -0
  18. package/{guideline.command-43gfjsjv.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/incrementalBuilder.proc.js +69 -39
  24. package/{index-0tkj05cz.js → index-0fb3cpbt.js} +3 -3
  25. package/{index-6t7fkx73.js → index-1q1cjn8s.js} +21 -11
  26. package/{index-90q0w90q.js → index-3wjbhj2n.js} +1 -1
  27. package/{index-6zgt7zmx.js → index-48d5qsj3.js} +4 -4
  28. package/{index-z47rw9ez.js → index-5w9my9qe.js} +8 -8
  29. package/{index-qwe079ww.js → index-6wpaq392.js} +61 -15
  30. package/{index-kc871vpc.js → index-7xdpww43.js} +69 -12
  31. package/index-7y5yghjg.js +2969 -0
  32. package/{index-38patcx6.js → index-8g7tdsk4.js} +249 -696
  33. package/{index-kdswbvys.js → index-8pb9yvp8.js} +63 -21
  34. package/{index-hmj94es2.js → index-8ts9774g.js} +4 -4
  35. package/{index-r0q2ka2b.js → index-93ewzmp6.js} +43 -14
  36. package/{index-y0y0pnx8.js → index-9tbgb4d8.js} +1 -1
  37. package/index-abgh0jve.js +126 -0
  38. package/{index-t0hk1kxq.js → index-aj3ehkcx.js} +1 -1
  39. package/{index-demt944k.js → index-d4n1wmrz.js} +37 -4
  40. package/{index-sra1a5f8.js → index-drz9e84d.js} +22 -8
  41. package/{index-gfh90r3t.js → index-e3vmjtph.js} +2 -2
  42. package/{index-k64mhwbw.js → index-eajbmk10.js} +2 -1
  43. package/{index-g0yds382.js → index-ed6ea0qp.js} +1 -1
  44. package/{index-ap6ac70m.js → index-fjr4d6yd.js} +444 -368
  45. package/index-hqrkqxx2.js +176 -0
  46. package/{index-jzpeny42.js → index-jdamtr7e.js} +3 -3
  47. package/{index-ampz4vgv.js → index-kpdv34rq.js} +4 -4
  48. package/{index-kc6ffq0s.js → index-ktb3wcqz.js} +73 -34
  49. package/{index-dcm66hss.js → index-mmym5xmb.js} +4 -2
  50. package/{index-8d9r465x.js → index-mqntfzv5.js} +2 -2
  51. package/{index-4am4dvmf.js → index-ny2k80mv.js} +15 -3
  52. package/index-p6hjwt2d.js +1668 -0
  53. package/{index-53h0053j.js → index-rc5fvqj2.js} +12 -14
  54. package/{index-r8t5sq7z.js → index-ryrm5z2c.js} +66 -19
  55. package/{index-jzz6ye8x.js → index-s2grpzef.js} +40 -8
  56. package/{index-38by07nw.js → index-sr5da35e.js} +32 -9
  57. package/{index-qev8p5wp.js → index-sy481q2x.js} +1 -1
  58. package/{index-ck64kxrn.js → index-thckcabc.js} +2 -2
  59. package/{index-wymcdsas.js → index-vkzfk7qt.js} +25 -23
  60. package/{index-vkpqe29t.js → index-w639tvkd.js} +24 -125
  61. package/index-ygdbn9jn.js +122 -0
  62. package/{index-w60zxxye.js → index-zpv14wpy.js} +3 -3
  63. package/{index-2yan1ajk.js → index-zxsygkda.js} +18 -9
  64. package/index.js +24 -23
  65. package/{library.command-zh29tjdd.js → library.command-1gp5qe3r.js} +3 -3
  66. package/{localRegistry.command-k9pn9ahj.js → localRegistry.command-v3g21rex.js} +25 -16
  67. package/{module.command-dgpqs9fz.js → module.command-4xz9he6h.js} +6 -6
  68. package/{package.command-1je4hsca.js → package.command-s7qpnn1g.js} +12 -3
  69. package/package.json +2 -2
  70. package/{page.command-cgsasanh.js → page.command-fan34c49.js} +3 -3
  71. package/{pipeline.command-tb46sa8v.js → pipeline.command-ph4fnn9w.js} +2 -2
  72. package/{primitive.command-bzsy23x5.js → primitive.command-3fqh8emf.js} +7 -7
  73. package/{projectTypecheck-h8rgaczy.js → projectTypecheck-vkb40hjc.js} +1 -1
  74. package/{quality.command-120m9h6v.js → quality.command-ecj6exsh.js} +15 -10
  75. package/{repair.command-6m4wd0qv.js → repair.command-fe9jw719.js} +6 -6
  76. package/{scalar.command-3dn5hsc6.js → scalar.command-cnvfhk0n.js} +5 -5
  77. package/skills/akan-debug/SKILL.md +2 -1
  78. package/skills/akan-page/SKILL.md +16 -7
  79. package/skills/akan-service/SKILL.md +48 -19
  80. package/{subspace.command-s8nyfqbn.js → subspace.command-yxtt3v3e.js} +8 -8
  81. package/templates/app/lib/___appName__/__appName__.abstract.md.template +6 -0
  82. package/templates/app/page/_index.tsx +4 -284
  83. package/templates/app/page/_layout.tsx +1 -26
  84. package/templates/app/page/styles.css.template +58 -318
  85. package/templates/appSample/page/_index.tsx +281 -0
  86. package/templates/appSample/page/_layout.tsx +55 -0
  87. package/templates/appSample/page/styles.css.template +327 -0
  88. package/templates/libRoot/lib/___libName__/__libName__.abstract.md.template +6 -0
  89. package/templates/workspaceRoot/package.json.template +1 -12
  90. package/{tunnel.command-8mwrqkr3.js → tunnel.command-ggj38mqf.js} +7 -7
  91. package/{verify.command-2pspfy7k.js → verify.command-w9ttxkdz.js} +16 -14
  92. package/{workflow.command-7sy5vnsj.js → workflow.command-ss8devj0.js} +12 -12
  93. package/{workspace.command-x518tdv4.js → workspace.command-rw1p0xeq.js} +50 -38
  94. package/TunnelShare-jwbb50kz.js +0 -14
  95. package/cloud.script-8kr7qgfa.js +0 -27
  96. package/context.runner-p6m5cxk3.js +0 -28
  97. package/index-d894868w.js +0 -842
  98. package/index-re2kfscb.js +0 -1363
  99. /package/templates/{app → appSample}/page/_overrides.tsx +0 -0
  100. /package/templates/{app → appSample}/public/fonts/Pretendard-Black.woff2 +0 -0
  101. /package/templates/{app → appSample}/public/fonts/Pretendard-Bold.woff2 +0 -0
  102. /package/templates/{app → appSample}/public/fonts/Pretendard-ExtraBold.woff2 +0 -0
  103. /package/templates/{app → appSample}/public/fonts/Pretendard-ExtraLight.woff2 +0 -0
  104. /package/templates/{app → appSample}/public/fonts/Pretendard-Light.woff2 +0 -0
  105. /package/templates/{app → appSample}/public/fonts/Pretendard-Medium.woff2 +0 -0
  106. /package/templates/{app → appSample}/public/fonts/Pretendard-Regular.woff2 +0 -0
  107. /package/templates/{app → appSample}/public/fonts/Pretendard-SemiBold.woff2 +0 -0
  108. /package/templates/{app → appSample}/public/fonts/Pretendard-Thin.woff2 +0 -0
  109. /package/templates/{app → appSample}/public/jelly/cloud.webp +0 -0
  110. /package/templates/{app → appSample}/public/jelly/comet.webp +0 -0
  111. /package/templates/{app → appSample}/public/jelly/moon.webp +0 -0
  112. /package/templates/{app → appSample}/public/jelly/planet.webp +0 -0
  113. /package/templates/{app → appSample}/public/jelly/rocket.webp +0 -0
  114. /package/templates/{app → appSample}/public/jelly/star.webp +0 -0
  115. /package/templates/{app → appSample}/public/jelly/sugar.webp +0 -0
  116. /package/templates/{app → appSample}/public/logo.png +0 -0
  117. /package/templates/{app → appSample}/ui/Recipe/index.ts +0 -0
  118. /package/templates/{app → appSample}/ui/Recipe/jellyButton.ts +0 -0
@@ -2,127 +2,10 @@
2
2
  import {
3
3
  AkanGraphDiff,
4
4
  AkanIndex
5
- } from "./index-re2kfscb.js";
6
-
7
- // pkgs/@akanjs/devkit/gitRevision.ts
8
- var systemPaths = ["apps", "libs"];
9
- var changeOfStatus = { A: "added", D: "removed" };
10
-
11
- class GitRevision {
12
- static #defaultBranches = ["upstream/HEAD", "upstream/main", "origin/HEAD", "origin/main", "main", "master"];
13
- static #env = { ...process.env, GIT_OPTIONAL_LOCKS: "0" };
14
- #root;
15
- constructor(root) {
16
- this.#root = root;
17
- }
18
- async forkPointOf(since) {
19
- if ((await this.#git(["rev-parse", "--is-inside-work-tree"]))?.trim() !== "true")
20
- return { error: "The Change Map compares with git history, and this workspace is not in a git repository." };
21
- if (since !== null) {
22
- const sha = /^[^-\s][^\s]*$/.test(since) ? (await this.#git(["rev-parse", "--verify", "--quiet", `${since}^{commit}`]))?.trim() : undefined;
23
- if (!sha)
24
- return { error: `${since} is not a commit in this repository.` };
25
- return await this.#mergeBase(since, sha);
26
- }
27
- for (const branch of GitRevision.#defaultBranches)
28
- if (await this.#git(["rev-parse", "--verify", "--quiet", `${branch}^{commit}`]) !== null)
29
- return await this.#mergeBase(branch, branch);
30
- const head = (await this.#git(["rev-parse", "--verify", "--quiet", "HEAD^{commit}"]))?.trim();
31
- return head ? { sha: head } : { error: "The repository has no commit to compare with yet." };
32
- }
33
- async#mergeBase(name, revision) {
34
- const sha = (await this.#git(["merge-base", "HEAD", revision]))?.trim();
35
- if (sha)
36
- return { sha };
37
- return {
38
- error: `HEAD shares no commit with ${name} here. In a shallow clone, \`git fetch --unshallow\` brings the history in.`
39
- };
40
- }
41
- async filesAt(sha, isWanted) {
42
- const listed = await this.#git(["ls-tree", "-r", "-z", "--name-only", sha, "--", ...systemPaths]);
43
- if (listed === null)
44
- throw new Error(`git ls-tree failed for ${sha}`);
45
- const files = listed.split("\x00").filter((file) => file && isWanted(file));
46
- const texts = new Map;
47
- if (!files.length)
48
- return texts;
49
- const proc = Bun.spawn(["git", "cat-file", "--batch"], {
50
- cwd: this.#root,
51
- env: GitRevision.#env,
52
- stdin: "pipe",
53
- stdout: "pipe",
54
- stderr: "ignore"
55
- });
56
- const output = new Response(proc.stdout).arrayBuffer();
57
- proc.stdin.write(files.map((file) => `${sha}:./${file}
58
- `).join(""));
59
- await proc.stdin.end();
60
- const bytes = new Uint8Array(await output);
61
- if (await proc.exited !== 0)
62
- throw new Error(`git cat-file failed for ${sha}`);
63
- const decoder = new TextDecoder;
64
- let offset = 0;
65
- for (const file of files) {
66
- const lineEnd = bytes.indexOf(10, offset);
67
- if (lineEnd < 0)
68
- throw new Error(`git cat-file ended before ${file} at ${sha}`);
69
- const header = decoder.decode(bytes.subarray(offset, lineEnd));
70
- offset = lineEnd + 1;
71
- if (header.endsWith(" missing"))
72
- continue;
73
- const [, type, size] = header.split(" ");
74
- const length = Number(size);
75
- if (type === "blob")
76
- texts.set(file, decoder.decode(bytes.subarray(offset, offset + length)));
77
- offset += length + 1;
78
- }
79
- return texts;
80
- }
81
- async changedFilesSince(sha) {
82
- const [tracked, untracked] = await Promise.all([
83
- this.#git(["diff", "--name-status", "--no-renames", "--relative", "-z", sha, "--", ...systemPaths]),
84
- this.#git(["ls-files", "-z", "--others", "--exclude-standard", "--", ...systemPaths])
85
- ]);
86
- if (tracked === null || untracked === null)
87
- throw new Error(`git could not list the changes since ${sha}`);
88
- const changes = new Map;
89
- const fields = tracked.split("\x00");
90
- for (let idx = 0;idx + 1 < fields.length; idx += 2)
91
- changes.set(fields[idx + 1], changeOfStatus[fields[idx]] ?? "changed");
92
- for (const file of untracked.split("\x00"))
93
- if (file)
94
- changes.set(file, "added");
95
- return [...changes].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([file, change]) => ({ file, change }));
96
- }
97
- async workingFiles() {
98
- const listed = await this.#git([
99
- "ls-files",
100
- "-z",
101
- "--cached",
102
- "--others",
103
- "--exclude-standard",
104
- "--",
105
- ...systemPaths
106
- ]);
107
- if (listed === null)
108
- throw new Error("git ls-files failed");
109
- return [...new Set(listed.split("\x00").filter(Boolean))];
110
- }
111
- async#git(args) {
112
- try {
113
- const proc = Bun.spawn(["git", ...args], {
114
- cwd: this.#root,
115
- env: GitRevision.#env,
116
- stdout: "pipe",
117
- stderr: "ignore"
118
- });
119
- const [text, exitCode] = await Promise.all([new Response(proc.stdout).text(), proc.exited]);
120
- return exitCode === 0 ? text : null;
121
- } catch {
122
- return null;
123
- }
124
- }
125
- }
5
+ } from "./index-7y5yghjg.js";
6
+ import {
7
+ GitRevision
8
+ } from "./index-ygdbn9jn.js";
126
9
 
127
10
  // pkgs/@akanjs/devkit/workspaceGraph.ts
128
11
  import { readFile } from "fs/promises";
@@ -131,6 +14,7 @@ import ts from "typescript";
131
14
  var indexedPath = /^(apps|libs)\/(?!(?:.*\/)?(?:node_modules|dist|\.akan|env)\/).*\.tsx?$/;
132
15
  var hiddenPath = /(?:^|\/)(?:node_modules|dist|\.akan|env)\//;
133
16
  var unscopedNodeLimit = 600;
17
+ var pageKinds = new Set(["route", "layout"]);
134
18
  var cachedBaseLimit = 4;
135
19
  var slashed = (fileName) => fileName.replace(/\\/g, "/");
136
20
 
@@ -198,10 +82,22 @@ ${sha}`;
198
82
  return graph;
199
83
  const owners = app ? new Set([`apps/${app}`, `libs/${app}`]) : null;
200
84
  const seeds = new Set(graph.nodes.filter((node) => (!owners || owners.has(node.owner ?? "")) && (!module || node.module === module)).map((node) => node.id));
201
- const edges = graph.edges.filter((edge) => seeds.has(edge.from) || seeds.has(edge.to));
85
+ const guards = new Set(graph.nodes.filter((node) => node.kind === "guard").map((node) => node.id));
86
+ const reaches = (id) => seeds.has(id) && !guards.has(id);
87
+ const edges = graph.edges.filter((edge) => reaches(edge.from) || reaches(edge.to));
202
88
  const ids = new Set([...seeds, ...edges.flatMap((edge) => [edge.from, edge.to])]);
203
89
  return { version: 1, nodes: graph.nodes.filter((node) => ids.has(node.id)), edges };
204
90
  }
91
+ static #withoutPages(graph) {
92
+ const changed = new Set(graph.nodes.filter((node) => node.change).map((node) => node.id));
93
+ const touching = new Set(graph.edges.filter((edge) => edge.kind !== "wraps" && (changed.has(edge.from) || changed.has(edge.to))).flatMap((edge) => [edge.from, edge.to]));
94
+ const dropped = new Set(graph.nodes.filter((node) => pageKinds.has(node.kind) && !node.change && !touching.has(node.id)).map((node) => node.id));
95
+ const edges = graph.edges.filter((edge) => !dropped.has(edge.from) && !dropped.has(edge.to));
96
+ const linked = new Set(edges.flatMap((edge) => [edge.from, edge.to]));
97
+ const isRouteOnly = (node) => node.kind === "guard" && node.detail.includes("route") && !node.change && !linked.has(node.id);
98
+ const nodes = graph.nodes.filter((node) => !dropped.has(node.id) && !isRouteOnly(node));
99
+ return { version: 1, nodes, edges };
100
+ }
205
101
  static visibleTo(graph, app) {
206
102
  const appOwner = `apps/${app}`;
207
103
  const isVisible = ({ owner }) => !owner || owner === appOwner || owner.startsWith("libs/");
@@ -246,16 +142,19 @@ ${sha}`;
246
142
  static answer(graph, scope, counted = graph.nodes) {
247
143
  if (scope.app || scope.module || graph.nodes.length <= unscopedNodeLimit)
248
144
  return WorkspaceGraph.scope(graph, scope);
145
+ const unscoped = WorkspaceGraph.#withoutPages(graph);
146
+ if (unscoped.nodes.length <= unscopedNodeLimit)
147
+ return unscoped;
249
148
  const owners = new Map;
250
149
  for (const node of counted)
251
- if (node.owner)
150
+ if (node.owner && !pageKinds.has(node.kind))
252
151
  owners.set(node.owner, (owners.get(node.owner) ?? 0) + 1);
253
152
  return {
254
153
  diagnostics: [
255
154
  {
256
155
  severity: "error",
257
156
  code: "graph-scope-required",
258
- message: `The graph has ${graph.nodes.length} nodes. Pass app, module or both to scope it.`,
157
+ message: `The graph has ${unscoped.nodes.length} nodes besides its pages. Pass app, module or both to scope it.`,
259
158
  input: "app"
260
159
  }
261
160
  ],
@@ -264,4 +163,4 @@ ${sha}`;
264
163
  }
265
164
  }
266
165
 
267
- export { GitRevision, WorkspaceGraph };
166
+ export { WorkspaceGraph };
@@ -0,0 +1,122 @@
1
+ // @bun
2
+ // pkgs/@akanjs/devkit/gitRevision.ts
3
+ var systemPaths = ["apps", "libs"];
4
+ var changeOfStatus = { A: "added", D: "removed" };
5
+
6
+ class GitRevision {
7
+ static #defaultBranches = ["upstream/HEAD", "upstream/main", "origin/HEAD", "origin/main", "main", "master"];
8
+ static #env = { ...process.env, GIT_OPTIONAL_LOCKS: "0" };
9
+ #root;
10
+ constructor(root) {
11
+ this.#root = root;
12
+ }
13
+ async forkPointOf(since) {
14
+ if ((await this.#git(["rev-parse", "--is-inside-work-tree"]))?.trim() !== "true")
15
+ return { error: "The Change Map compares with git history, and this workspace is not in a git repository." };
16
+ if (since !== null) {
17
+ const sha = /^[^-\s][^\s]*$/.test(since) ? (await this.#git(["rev-parse", "--verify", "--quiet", `${since}^{commit}`]))?.trim() : undefined;
18
+ if (!sha)
19
+ return { error: `${since} is not a commit in this repository.` };
20
+ return await this.#mergeBase(since, sha);
21
+ }
22
+ for (const branch of GitRevision.#defaultBranches)
23
+ if (await this.#git(["rev-parse", "--verify", "--quiet", `${branch}^{commit}`]) !== null)
24
+ return await this.#mergeBase(branch, branch);
25
+ const head = (await this.#git(["rev-parse", "--verify", "--quiet", "HEAD^{commit}"]))?.trim();
26
+ return head ? { sha: head } : { error: "The repository has no commit to compare with yet." };
27
+ }
28
+ async#mergeBase(name, revision) {
29
+ const sha = (await this.#git(["merge-base", "HEAD", revision]))?.trim();
30
+ if (sha)
31
+ return { sha };
32
+ return {
33
+ error: `HEAD shares no commit with ${name} here. In a shallow clone, \`git fetch --unshallow\` brings the history in.`
34
+ };
35
+ }
36
+ async filesAt(sha, isWanted, paths = systemPaths) {
37
+ const listed = await this.#git(["ls-tree", "-r", "-z", "--name-only", sha, "--", ...paths]);
38
+ if (listed === null)
39
+ throw new Error(`git ls-tree failed for ${sha}`);
40
+ const files = listed.split("\x00").filter((file) => file && isWanted(file));
41
+ const texts = new Map;
42
+ if (!files.length)
43
+ return texts;
44
+ const proc = Bun.spawn(["git", "cat-file", "--batch"], {
45
+ cwd: this.#root,
46
+ env: GitRevision.#env,
47
+ stdin: "pipe",
48
+ stdout: "pipe",
49
+ stderr: "ignore"
50
+ });
51
+ const output = new Response(proc.stdout).arrayBuffer();
52
+ proc.stdin.write(files.map((file) => `${sha}:./${file}
53
+ `).join(""));
54
+ await proc.stdin.end();
55
+ const bytes = new Uint8Array(await output);
56
+ if (await proc.exited !== 0)
57
+ throw new Error(`git cat-file failed for ${sha}`);
58
+ const decoder = new TextDecoder;
59
+ let offset = 0;
60
+ for (const file of files) {
61
+ const lineEnd = bytes.indexOf(10, offset);
62
+ if (lineEnd < 0)
63
+ throw new Error(`git cat-file ended before ${file} at ${sha}`);
64
+ const header = decoder.decode(bytes.subarray(offset, lineEnd));
65
+ offset = lineEnd + 1;
66
+ if (header.endsWith(" missing"))
67
+ continue;
68
+ const [, type, size] = header.split(" ");
69
+ const length = Number(size);
70
+ if (type === "blob")
71
+ texts.set(file, decoder.decode(bytes.subarray(offset, offset + length)));
72
+ offset += length + 1;
73
+ }
74
+ return texts;
75
+ }
76
+ async changedFilesSince(sha) {
77
+ const [tracked, untracked] = await Promise.all([
78
+ this.#git(["diff", "--name-status", "--no-renames", "--relative", "-z", sha, "--", ...systemPaths]),
79
+ this.#git(["ls-files", "-z", "--others", "--exclude-standard", "--", ...systemPaths])
80
+ ]);
81
+ if (tracked === null || untracked === null)
82
+ throw new Error(`git could not list the changes since ${sha}`);
83
+ const changes = new Map;
84
+ const fields = tracked.split("\x00");
85
+ for (let idx = 0;idx + 1 < fields.length; idx += 2)
86
+ changes.set(fields[idx + 1], changeOfStatus[fields[idx]] ?? "changed");
87
+ for (const file of untracked.split("\x00"))
88
+ if (file)
89
+ changes.set(file, "added");
90
+ return [...changes].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([file, change]) => ({ file, change }));
91
+ }
92
+ async workingFiles() {
93
+ const listed = await this.#git([
94
+ "ls-files",
95
+ "-z",
96
+ "--cached",
97
+ "--others",
98
+ "--exclude-standard",
99
+ "--",
100
+ ...systemPaths
101
+ ]);
102
+ if (listed === null)
103
+ throw new Error("git ls-files failed");
104
+ return [...new Set(listed.split("\x00").filter(Boolean))];
105
+ }
106
+ async#git(args) {
107
+ try {
108
+ const proc = Bun.spawn(["git", ...args], {
109
+ cwd: this.#root,
110
+ env: GitRevision.#env,
111
+ stdout: "pipe",
112
+ stderr: "ignore"
113
+ });
114
+ const [text, exitCode] = await Promise.all([new Response(proc.stdout).text(), proc.exited]);
115
+ return exitCode === 0 ? text : null;
116
+ } catch {
117
+ return null;
118
+ }
119
+ }
120
+ }
121
+
122
+ export { GitRevision };
@@ -5,17 +5,17 @@ import {
5
5
  AkanAppConfig,
6
6
  Executor,
7
7
  WorkspaceExecutor
8
- } from "./index-38by07nw.js";
8
+ } from "./index-sr5da35e.js";
9
9
  import {
10
10
  resolveAppId,
11
11
  targetHtmlFilename
12
12
  } from "./index-m9jj544v.js";
13
13
  import {
14
14
  CsrArtifactBuilder
15
- } from "./index-dcm66hss.js";
15
+ } from "./index-mmym5xmb.js";
16
16
  import {
17
17
  ExitCodeError
18
- } from "./index-r0q2ka2b.js";
18
+ } from "./index-93ewzmp6.js";
19
19
 
20
20
  // pkgs/@akanjs/devkit/mobile/desktopBin.ts
21
21
  import { chmod, mkdir, rename, rm, writeFile } from "fs/promises";
@@ -4,27 +4,27 @@ import {
4
4
  CloudApi,
5
5
  CloudUpdates,
6
6
  PipelineSecrets
7
- } from "./index-sra1a5f8.js";
7
+ } from "./index-drz9e84d.js";
8
8
  import {
9
9
  PkgExecutor
10
- } from "./index-38by07nw.js";
10
+ } from "./index-sr5da35e.js";
11
11
  import {
12
12
  UpdatePackFolder,
13
13
  NativePublicEnv,
14
14
  NativeApp
15
- } from "./index-w60zxxye.js";
15
+ } from "./index-zpv14wpy.js";
16
16
  import {
17
17
  script
18
- } from "./index-r0q2ka2b.js";
18
+ } from "./index-93ewzmp6.js";
19
19
  import {
20
20
  ApplicationScript
21
- } from "./index-r8t5sq7z.js";
21
+ } from "./index-ryrm5z2c.js";
22
22
  import {
23
23
  PackageScript
24
- } from "./index-demt944k.js";
24
+ } from "./index-d4n1wmrz.js";
25
25
  import {
26
26
  CloudRunner
27
- } from "./index-qwe079ww.js";
27
+ } from "./index-6wpaq392.js";
28
28
 
29
29
  // pkgs/@akanjs/cli/cloud/cloud.script.ts
30
30
  import { Logger } from "akanjs/common";
@@ -213,7 +213,10 @@ class CloudScript2 extends script("cloud", [CloudRunner, ApplicationScript, Pack
213
213
  async deployAkan(workspace, {
214
214
  test = true,
215
215
  registryUrl,
216
- platforms = []
216
+ platforms = [],
217
+ prerelease = null,
218
+ yes = false,
219
+ packTo = null
217
220
  } = {}) {
218
221
  const akanPkgs = await this.cloudRunner.getAkanPkgs(workspace);
219
222
  await this.packageScript.updateWorskpaceRootPackageJson(workspace);
@@ -239,7 +242,13 @@ class CloudScript2 extends script("cloud", [CloudRunner, ApplicationScript, Pack
239
242
  for (const pkg of pkgs)
240
243
  await this.packageScript.buildPackage(pkg);
241
244
  await this.packageScript.verifyAkanPublishPackages(workspace);
242
- await this.cloudRunner.deployAkan(workspace, akanPkgs, { registryUrl });
245
+ await this.cloudRunner.deployAkan(workspace, akanPkgs, {
246
+ registryUrl,
247
+ prerelease,
248
+ packTo,
249
+ confirmPublish: !yes,
250
+ npmLogin: !yes
251
+ });
243
252
  }
244
253
  async testPlatforms(workspace, { platforms, pkgs }) {
245
254
  if (!platforms.length)
package/index.js CHANGED
@@ -4,9 +4,9 @@ import {
4
4
  getTargetMetas,
5
5
  getTargetCommandNames,
6
6
  runCommands
7
- } from "./index-r0q2ka2b.js";
7
+ } from "./index-93ewzmp6.js";
8
8
  import"./index-bns3wcpc.js";
9
- import"./index-38by07nw.js";
9
+ import"./index-sr5da35e.js";
10
10
 
11
11
  // pkgs/@akanjs/cli/bunVersionGuard.ts
12
12
  class BunVersionGuard {
@@ -22,27 +22,27 @@ import path from "path";
22
22
 
23
23
  // pkgs/@akanjs/cli/commandModules.ts
24
24
  var commandModules = {
25
- workspace: async () => (await import("./workspace.command-x518tdv4.js")).WorkspaceCommand,
26
- agent: async () => (await import("./agent.command-962mp3kg.js")).AgentCommand,
27
- code: async () => (await import("./code.command-asq7xrr6.js")).CodeCommand,
28
- application: async () => (await import("./application.command-1nr0bqq1.js")).ApplicationCommand,
29
- library: async () => (await import("./library.command-zh29tjdd.js")).LibraryCommand,
30
- localRegistry: async () => (await import("./localRegistry.command-k9pn9ahj.js")).LocalRegistryCommand,
31
- package: async () => (await import("./package.command-1je4hsca.js")).PackageCommand,
32
- module: async () => (await import("./module.command-dgpqs9fz.js")).ModuleCommand,
33
- page: async () => (await import("./page.command-cgsasanh.js")).PageCommand,
34
- context: async () => (await import("./context.command-fw4g2pw1.js")).ContextCommand,
35
- cloud: async () => (await import("./cloud.command-cj7b3m6y.js")).CloudCommand,
36
- subspace: async () => (await import("./subspace.command-s8nyfqbn.js")).SubspaceCommand,
37
- guideline: async () => (await import("./guideline.command-43gfjsjv.js")).GuidelineCommand,
38
- scalar: async () => (await import("./scalar.command-3dn5hsc6.js")).ScalarCommand,
39
- primitive: async () => (await import("./primitive.command-bzsy23x5.js")).PrimitiveCommand,
40
- quality: async () => (await import("./quality.command-120m9h6v.js")).QualityCommand,
41
- verify: async () => (await import("./verify.command-2pspfy7k.js")).VerifyCommand,
42
- repair: async () => (await import("./repair.command-6m4wd0qv.js")).RepairCommand,
43
- workflow: async () => (await import("./workflow.command-7sy5vnsj.js")).WorkflowCommand,
44
- pipeline: async () => (await import("./pipeline.command-tb46sa8v.js")).PipelineCommand,
45
- tunnel: async () => (await import("./tunnel.command-8mwrqkr3.js")).TunnelCommand
25
+ workspace: async () => (await import("./workspace.command-rw1p0xeq.js")).WorkspaceCommand,
26
+ agent: async () => (await import("./agent.command-2f657613.js")).AgentCommand,
27
+ code: async () => (await import("./code.command-7m67c7zc.js")).CodeCommand,
28
+ application: async () => (await import("./application.command-yb8v177e.js")).ApplicationCommand,
29
+ library: async () => (await import("./library.command-1gp5qe3r.js")).LibraryCommand,
30
+ localRegistry: async () => (await import("./localRegistry.command-v3g21rex.js")).LocalRegistryCommand,
31
+ package: async () => (await import("./package.command-s7qpnn1g.js")).PackageCommand,
32
+ module: async () => (await import("./module.command-4xz9he6h.js")).ModuleCommand,
33
+ page: async () => (await import("./page.command-fan34c49.js")).PageCommand,
34
+ context: async () => (await import("./context.command-569z0rqf.js")).ContextCommand,
35
+ cloud: async () => (await import("./cloud.command-et06ja22.js")).CloudCommand,
36
+ subspace: async () => (await import("./subspace.command-yxtt3v3e.js")).SubspaceCommand,
37
+ guideline: async () => (await import("./guideline.command-gnv3e8p8.js")).GuidelineCommand,
38
+ scalar: async () => (await import("./scalar.command-cnvfhk0n.js")).ScalarCommand,
39
+ primitive: async () => (await import("./primitive.command-3fqh8emf.js")).PrimitiveCommand,
40
+ quality: async () => (await import("./quality.command-ecj6exsh.js")).QualityCommand,
41
+ verify: async () => (await import("./verify.command-w9ttxkdz.js")).VerifyCommand,
42
+ repair: async () => (await import("./repair.command-fe9jw719.js")).RepairCommand,
43
+ workflow: async () => (await import("./workflow.command-ss8devj0.js")).WorkflowCommand,
44
+ pipeline: async () => (await import("./pipeline.command-ph4fnn9w.js")).PipelineCommand,
45
+ tunnel: async () => (await import("./tunnel.command-ggj38mqf.js")).TunnelCommand
46
46
  };
47
47
  var commandModuleIds = Object.keys(commandModules);
48
48
 
@@ -87,6 +87,7 @@ if (bunRefusal) {
87
87
  console.error(bunRefusal);
88
88
  process.exit(1);
89
89
  }
90
+ delete process.env.AKAN_CLI_FORCE_BUILD;
90
91
  var ids = CommandManifest.resolve(await CommandManifest.read(), process.argv) ?? commandModuleIds;
91
92
  var commands = await Promise.all(ids.map(async (id) => await commandModules[id]()));
92
93
  await runCommands(...commands);
@@ -3,12 +3,12 @@ import {
3
3
  Lib,
4
4
  Workspace,
5
5
  command
6
- } from "./index-r0q2ka2b.js";
6
+ } from "./index-93ewzmp6.js";
7
7
  import"./index-bns3wcpc.js";
8
- import"./index-38by07nw.js";
8
+ import"./index-sr5da35e.js";
9
9
  import {
10
10
  LibraryScript
11
- } from "./index-8d9r465x.js";
11
+ } from "./index-mqntfzv5.js";
12
12
 
13
13
  // pkgs/@akanjs/cli/library/library.command.ts
14
14
  class LibraryCommand extends command("library", [LibraryScript], ({ public: target }) => ({
@@ -4,37 +4,41 @@ import {
4
4
  runner,
5
5
  script,
6
6
  command
7
- } from "./index-r0q2ka2b.js";
7
+ } from "./index-93ewzmp6.js";
8
8
  import"./index-bns3wcpc.js";
9
9
  import {
10
+ parseEnvFile,
10
11
  PkgExecutor
11
- } from "./index-38by07nw.js";
12
+ } from "./index-sr5da35e.js";
12
13
  import {
13
14
  npmRegistryFromEnv,
14
15
  warnIgnoredNpmRegistry,
15
16
  getNpmRegistryUrl
16
- } from "./index-4am4dvmf.js";
17
- import"./index-d894868w.js";
18
- import"./index-w60zxxye.js";
19
- import"./index-g0yds382.js";
17
+ } from "./index-ny2k80mv.js";
18
+ import"./index-p6hjwt2d.js";
19
+ import"./index-zpv14wpy.js";
20
+ import"./index-ed6ea0qp.js";
20
21
  import"./index-m9jj544v.js";
21
- import"./index-6t7fkx73.js";
22
- import"./index-dcm66hss.js";
23
- import"./index-8d9r465x.js";
24
- import"./index-kc6ffq0s.js";
22
+ import"./index-1q1cjn8s.js";
23
+ import"./index-mmym5xmb.js";
24
+ import"./index-mqntfzv5.js";
25
+ import"./index-ktb3wcqz.js";
25
26
  import {
26
27
  ApplicationScript
27
- } from "./index-r8t5sq7z.js";
28
+ } from "./index-ryrm5z2c.js";
28
29
  import"./index-tenw3mah.js";
29
- import"./index-sra1a5f8.js";
30
+ import"./index-drz9e84d.js";
30
31
  import {
31
32
  CloudRunner
32
- } from "./index-qwe079ww.js";
33
+ } from "./index-6wpaq392.js";
33
34
  import"./index-qd7xn2bk.js";
35
+ import"./index-7y5yghjg.js";
36
+ import"./index-abgh0jve.js";
37
+ import"./index-hqrkqxx2.js";
34
38
  import {
35
39
  PackageScript
36
- } from "./index-demt944k.js";
37
- import"./index-qev8p5wp.js";
40
+ } from "./index-d4n1wmrz.js";
41
+ import"./index-sy481q2x.js";
38
42
  import"./index-9bv479q5.js";
39
43
 
40
44
  // pkgs/@akanjs/cli/localRegistry/localRegistry.runner.ts
@@ -104,7 +108,12 @@ class LocalRegistryRunner extends runner("localRegistry") {
104
108
  const registry = this.getRegistryUrl(registryUrl);
105
109
  const smokeRoot = path.join(workspace.workspaceRoot, ".akan/e2e");
106
110
  await rm(path.join(smokeRoot, smokeRepoName), { recursive: true, force: true });
107
- const env = { ...process.env, AKAN_NPM_REGISTRY: registry, NPM_CONFIG_REGISTRY: registry };
111
+ const repoDotenv = parseEnvFile(path.join(workspace.workspaceRoot, ".env"));
112
+ const env = {
113
+ ...Object.fromEntries(Object.entries(process.env).filter(([key]) => !(key in repoDotenv))),
114
+ AKAN_NPM_REGISTRY: registry,
115
+ NPM_CONFIG_REGISTRY: registry
116
+ };
108
117
  await workspace.spawn(process.execPath, [
109
118
  "dist/pkgs/create-akan-workspace/index.js",
110
119
  smokeRepoName,
@@ -3,17 +3,17 @@ import {
3
3
  Sys,
4
4
  Module,
5
5
  command
6
- } from "./index-r0q2ka2b.js";
6
+ } from "./index-93ewzmp6.js";
7
7
  import"./index-bns3wcpc.js";
8
- import"./index-38by07nw.js";
8
+ import"./index-sr5da35e.js";
9
9
  import {
10
10
  renderPrimitiveReport
11
- } from "./index-kdswbvys.js";
12
- import"./index-re2kfscb.js";
13
- import"./index-t0hk1kxq.js";
11
+ } from "./index-8pb9yvp8.js";
12
+ import"./index-7y5yghjg.js";
13
+ import"./index-aj3ehkcx.js";
14
14
  import {
15
15
  ModuleScript
16
- } from "./index-hmj94es2.js";
16
+ } from "./index-8ts9774g.js";
17
17
 
18
18
  // pkgs/@akanjs/cli/module/module.command.ts
19
19
  import { Logger, lowerlize } from "akanjs/common";
@@ -3,13 +3,16 @@ import {
3
3
  Pkg,
4
4
  Workspace,
5
5
  command
6
- } from "./index-r0q2ka2b.js";
6
+ } from "./index-93ewzmp6.js";
7
7
  import"./index-bns3wcpc.js";
8
- import"./index-38by07nw.js";
8
+ import"./index-sr5da35e.js";
9
9
  import"./index-qd7xn2bk.js";
10
+ import"./index-7y5yghjg.js";
11
+ import"./index-abgh0jve.js";
12
+ import"./index-hqrkqxx2.js";
10
13
  import {
11
14
  PackageScript
12
- } from "./index-demt944k.js";
15
+ } from "./index-d4n1wmrz.js";
13
16
 
14
17
  // pkgs/@akanjs/cli/package/package.command.ts
15
18
  class PackageCommand extends command("package", [PackageScript], ({ public: target }) => ({
@@ -33,6 +36,12 @@ class PackageCommand extends command("package", [PackageScript], ({ public: targ
33
36
  }),
34
37
  verifyAkanPublishPackages: target({ devOnly: true, desc: "Verify all Akan publish dist packages" }).with(Workspace).exec(async function(workspace) {
35
38
  await this.packageScript.verifyAkanPublishPackages(workspace);
39
+ }),
40
+ syncArchitecture: target({
41
+ devOnly: true,
42
+ desc: "Regenerate the generated part of pkgs/akanjs/ARCHITECTURE.md from the framework source"
43
+ }).with(Workspace).exec(async function(workspace) {
44
+ await this.packageScript.syncArchitecture(workspace);
36
45
  })
37
46
  })) {
38
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "3.1.2-rc.4",
3
+ "version": "3.2.0-rc.0",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -39,7 +39,7 @@
39
39
  "@earendil-works/pi-tui": "1.3.0",
40
40
  "@inquirer/prompts": "^8.7.3",
41
41
  "@tailwindcss/node": "^4.3.3",
42
- "akanjs": "3.1.2-rc.4",
42
+ "akanjs": "3.2.0-rc.0",
43
43
  "chalk": "^6.0.1",
44
44
  "commander": "^15.0.0",
45
45
  "dayjs": "^1.11.23",
@@ -3,12 +3,12 @@ import {
3
3
  App,
4
4
  Module,
5
5
  command
6
- } from "./index-r0q2ka2b.js";
6
+ } from "./index-93ewzmp6.js";
7
7
  import"./index-bns3wcpc.js";
8
- import"./index-38by07nw.js";
8
+ import"./index-sr5da35e.js";
9
9
  import {
10
10
  PageScript
11
- } from "./index-t0hk1kxq.js";
11
+ } from "./index-aj3ehkcx.js";
12
12
 
13
13
  // pkgs/@akanjs/cli/page/page.command.ts
14
14
  class PageCommand extends command("page", [PageScript], ({ public: target }) => ({
@@ -4,7 +4,7 @@ import {
4
4
  runner,
5
5
  script,
6
6
  command
7
- } from "./index-r0q2ka2b.js";
7
+ } from "./index-93ewzmp6.js";
8
8
  import {
9
9
  FileSys2
10
10
  } from "./index-bns3wcpc.js";
@@ -12,7 +12,7 @@ import {
12
12
  AkanAppConfig,
13
13
  AkanWorkspaceConfig,
14
14
  AppExecutor
15
- } from "./index-38by07nw.js";
15
+ } from "./index-sr5da35e.js";
16
16
  import {
17
17
  resolveMobileTargets
18
18
  } from "./index-m9jj544v.js";