@akanjs/cli 2.4.1-rc.7 → 2.4.2-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 (55) hide show
  1. package/.build-stamp +1 -1
  2. package/{agent.command-t4346579.js → agent.command-ash7wabs.js} +7 -7
  3. package/{application.command-zkmeemdt.js → application.command-zm47j93m.js} +6 -6
  4. package/{applicationBuildRunner-5w8j9yp7.js → applicationBuildRunner-554a2vnk.js} +8 -2
  5. package/{applicationReleasePackager-brvth6rs.js → applicationReleasePackager-pjbxc793.js} +1 -1
  6. package/buildBatch.proc.js +5 -4
  7. package/{capacitorApp-wnxzrppx.js → capacitorApp-wc75rvfm.js} +3 -3
  8. package/{cloud.command-5ztqxppm.js → cloud.command-vwpzten0.js} +11 -11
  9. package/{context.command-smwxwgwf.js → context.command-j0kq87xa.js} +15 -15
  10. package/{dependencyScanner-m4x5maek.js → dependencyScanner-f6grrep3.js} +2 -2
  11. package/{guideline.command-1r0esdjs.js → guideline.command-1m4jwhv0.js} +5 -5
  12. package/incrementalBuilder.proc.js +25 -17
  13. package/{index-s9yajzkj.js → index-0wgpfp7t.js} +6 -6
  14. package/{index-3sd2vape.js → index-2nb022xv.js} +3 -3
  15. package/{index-n5y2gbf2.js → index-31183bxt.js} +203 -22
  16. package/{index-nv7et4t3.js → index-31e8cwjq.js} +5 -5
  17. package/{index-x53a5nya.js → index-46tjzh6s.js} +1 -1
  18. package/{index-61keag0s.js → index-67546d0j.js} +4 -1
  19. package/{index-pya1h7wx.js → index-79v9jwqe.js} +3 -3
  20. package/index-7k9sj7j5.js +2220 -0
  21. package/{index-0jwvs8vp.js → index-8dsjmcbp.js} +11 -11
  22. package/{index-0fn1r7gg.js → index-bjpxzr6s.js} +31 -4
  23. package/{index-2v10yr8g.js → index-ckywhpvp.js} +1 -1
  24. package/{index-ahpcr9ss.js → index-cp26p7qd.js} +4 -4
  25. package/{index-eqxmxan6.js → index-ehjhzg5y.js} +1 -1
  26. package/{index-qpz4csbs.js → index-en4zpzdm.js} +9 -3
  27. package/{index-y4kg682s.js → index-f1x6fe2e.js} +1 -1
  28. package/{index-2v6a4wd5.js → index-mpj63mbw.js} +4 -4
  29. package/{index-fh990y67.js → index-n08vr4hh.js} +2 -2
  30. package/{index-5vvwc0cz.js → index-nsj2ftxj.js} +1 -1
  31. package/index-rh16j3c7.js +2166 -0
  32. package/{index-0t7pwff2.js → index-s6nk9815.js} +182 -64
  33. package/{index-hk58kr1m.js → index-smt4re0s.js} +1 -1
  34. package/{index-gr4cjv99.js → index-t5rn8q9f.js} +4 -4
  35. package/{index-wh201a76.js → index-tnngmzgf.js} +7 -7
  36. package/{index-eay4t1te.js → index-xdf6rxyt.js} +3 -3
  37. package/{index-jbtn8h1y.js → index-xjkjcbhd.js} +3 -3
  38. package/index.js +19 -19
  39. package/{library.command-jrew04m6.js → library.command-39eq3brk.js} +4 -4
  40. package/{localRegistry.command-m08dkm1b.js → localRegistry.command-34zvgkys.js} +10 -10
  41. package/{module.command-p98t7522.js → module.command-vwahdkzr.js} +8 -8
  42. package/{package.command-57dyrfmn.js → package.command-wkwd5x5p.js} +5 -5
  43. package/package.json +2 -2
  44. package/{page.command-tas6f3na.js → page.command-9w85hrg0.js} +4 -4
  45. package/{primitive.command-bjrbsakw.js → primitive.command-2hnr8h7f.js} +9 -9
  46. package/{quality.command-zavaafbw.js → quality.command-4kerz7mh.js} +3 -3
  47. package/{repair.command-je57wx67.js → repair.command-zmwshmvr.js} +6 -6
  48. package/{routeSourceValidator-wbhmbwpj.js → routeSourceValidator-cncd92fv.js} +39 -0
  49. package/{scalar.command-gqqyy1kr.js → scalar.command-9kanb73t.js} +7 -7
  50. package/templates/workspaceRoot/.cursor/rules/coding-comments.mdc.template +19 -0
  51. package/templates/workspaceRoot/.gitignore.template +1 -0
  52. package/templates/workspaceRoot/AGENTS.md.template +14 -0
  53. package/{workflow.command-d6mrc47s.js → workflow.command-4areq0ex.js} +12 -12
  54. package/{workspace.command-bbg96z8k.js → workspace.command-02x93b10.js} +23 -23
  55. package/index-khzzttv1.js +0 -4274
package/.build-stamp CHANGED
@@ -1 +1 @@
1
- fe5aabbf16f2ea5ada84a8b559093007200be13ac1cae02c0cf70f80a1736b22
1
+ 662b40618a5997cc258bbcdff378d024ba3e5861396f7d73dbfa2a2eaf09d772
@@ -1,16 +1,16 @@
1
1
  // @bun
2
2
  import {
3
3
  AgentScript
4
- } from "./index-pya1h7wx.js";
5
- import"./index-eay4t1te.js";
6
- import"./index-2v10yr8g.js";
7
- import"./index-eqxmxan6.js";
4
+ } from "./index-79v9jwqe.js";
5
+ import"./index-xdf6rxyt.js";
6
+ import"./index-ckywhpvp.js";
7
+ import"./index-ehjhzg5y.js";
8
8
  import {
9
9
  Workspace,
10
10
  command
11
- } from "./index-qpz4csbs.js";
12
- import"./index-0t7pwff2.js";
13
- import"./index-61keag0s.js";
11
+ } from "./index-en4zpzdm.js";
12
+ import"./index-s6nk9815.js";
13
+ import"./index-67546d0j.js";
14
14
  import"./index-6pz1j0zj.js";
15
15
  import"./index-r24hmh0q.js";
16
16
 
@@ -1,22 +1,22 @@
1
1
  // @bun
2
2
  import {
3
3
  ApplicationScript
4
- } from "./index-n5y2gbf2.js";
4
+ } from "./index-31183bxt.js";
5
5
  import {
6
6
  getMobileTargetChoices
7
7
  } from "./index-76rn3g2c.js";
8
- import"./index-fh990y67.js";
8
+ import"./index-n08vr4hh.js";
9
9
  import {
10
10
  App,
11
11
  Exec,
12
12
  Sys,
13
13
  Workspace,
14
14
  command
15
- } from "./index-qpz4csbs.js";
15
+ } from "./index-en4zpzdm.js";
16
16
  import"./index-fgc8r6dj.js";
17
- import"./index-0t7pwff2.js";
18
- import"./index-61keag0s.js";
19
- import"./index-0fn1r7gg.js";
17
+ import"./index-s6nk9815.js";
18
+ import"./index-67546d0j.js";
19
+ import"./index-bjpxzr6s.js";
20
20
  import"./index-6pz1j0zj.js";
21
21
  import"./index-r24hmh0q.js";
22
22
 
@@ -4,8 +4,9 @@ import {
4
4
  CsrArtifactBuilder,
5
5
  SsrBaseArtifactBuilder,
6
6
  precompressArtifacts
7
- } from "./index-khzzttv1.js";
8
- import"./index-0fn1r7gg.js";
7
+ } from "./index-7k9sj7j5.js";
8
+ import"./index-rh16j3c7.js";
9
+ import"./index-bjpxzr6s.js";
9
10
  import {
10
11
  Spinner
11
12
  } from "./index-6pz1j0zj.js";
@@ -201,6 +202,10 @@ void run().catch((error) => {
201
202
  async#writeTypecheckTsconfig({ incremental = true } = {}) {
202
203
  const typecheckDir = path.join(this.#app.cwdPath, ".akan", "typecheck");
203
204
  await mkdir(typecheckDir, { recursive: true });
205
+ const libPageIncludes = (await this.#app.getPageRoots()).filter((root) => root.keyPrefix).flatMap((root) => {
206
+ const rel = path.relative(typecheckDir, root.realDir).split(path.sep).join("/");
207
+ return [`${rel}/**/*.ts`, `${rel}/**/*.tsx`];
208
+ });
204
209
  const tsconfig = {
205
210
  extends: "../../tsconfig.json",
206
211
  compilerOptions: {
@@ -214,6 +219,7 @@ void run().catch((error) => {
214
219
  "../../client.ts",
215
220
  "../../page/**/*.ts",
216
221
  "../../page/**/*.tsx",
222
+ ...libPageIncludes,
217
223
  "../../../../pkgs/akanjs/*/types/**/*.d.ts"
218
224
  ],
219
225
  references: []
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  FileSys
4
- } from "./index-61keag0s.js";
4
+ } from "./index-67546d0j.js";
5
5
  import {
6
6
  Spinner
7
7
  } from "./index-6pz1j0zj.js";
@@ -2,16 +2,17 @@
2
2
  import {
3
3
  AppExecutor,
4
4
  WorkspaceExecutor
5
- } from "./index-0t7pwff2.js";
6
- import"./index-61keag0s.js";
5
+ } from "./index-s6nk9815.js";
6
+ import"./index-67546d0j.js";
7
7
  import {
8
8
  CsrArtifactBuilder,
9
9
  CssCompiler,
10
10
  FontOptimizer,
11
11
  PagesBundleBuilder,
12
12
  SsrBaseArtifactBuilder
13
- } from "./index-khzzttv1.js";
14
- import"./index-0fn1r7gg.js";
13
+ } from "./index-7k9sj7j5.js";
14
+ import"./index-rh16j3c7.js";
15
+ import"./index-bjpxzr6s.js";
15
16
  import"./index-6pz1j0zj.js";
16
17
  import"./index-r24hmh0q.js";
17
18
 
@@ -24,10 +24,10 @@ import {
24
24
  selectLocalDevHost,
25
25
  sortIosRunTargets,
26
26
  writeRootCapacitorConfig
27
- } from "./index-hk58kr1m.js";
27
+ } from "./index-smt4re0s.js";
28
28
  import"./index-76rn3g2c.js";
29
- import"./index-0t7pwff2.js";
30
- import"./index-61keag0s.js";
29
+ import"./index-s6nk9815.js";
30
+ import"./index-67546d0j.js";
31
31
  import"./index-6pz1j0zj.js";
32
32
  import"./index-r24hmh0q.js";
33
33
  export {
@@ -1,24 +1,24 @@
1
1
  // @bun
2
2
  import {
3
3
  CloudScript
4
- } from "./index-s9yajzkj.js";
5
- import"./index-gr4cjv99.js";
4
+ } from "./index-0wgpfp7t.js";
5
+ import"./index-t5rn8q9f.js";
6
6
  import {
7
7
  GlobalConfig
8
- } from "./index-5vvwc0cz.js";
9
- import"./index-n5y2gbf2.js";
8
+ } from "./index-nsj2ftxj.js";
9
+ import"./index-31183bxt.js";
10
10
  import"./index-76rn3g2c.js";
11
- import"./index-fh990y67.js";
12
- import"./index-nv7et4t3.js";
11
+ import"./index-n08vr4hh.js";
12
+ import"./index-31e8cwjq.js";
13
13
  import {
14
14
  Workspace,
15
15
  command
16
- } from "./index-qpz4csbs.js";
16
+ } from "./index-en4zpzdm.js";
17
17
  import"./index-fgc8r6dj.js";
18
- import"./index-0t7pwff2.js";
19
- import"./index-x53a5nya.js";
20
- import"./index-61keag0s.js";
21
- import"./index-0fn1r7gg.js";
18
+ import"./index-s6nk9815.js";
19
+ import"./index-46tjzh6s.js";
20
+ import"./index-67546d0j.js";
21
+ import"./index-bjpxzr6s.js";
22
22
  import"./index-6pz1j0zj.js";
23
23
  import"./index-r24hmh0q.js";
24
24
 
@@ -1,26 +1,26 @@
1
1
  // @bun
2
2
  import {
3
3
  ContextScript
4
- } from "./index-0jwvs8vp.js";
5
- import"./index-jbtn8h1y.js";
6
- import"./index-3sd2vape.js";
7
- import"./index-ahpcr9ss.js";
8
- import"./index-2v6a4wd5.js";
9
- import"./index-wh201a76.js";
10
- import"./index-y4kg682s.js";
4
+ } from "./index-8dsjmcbp.js";
5
+ import"./index-xjkjcbhd.js";
6
+ import"./index-2nb022xv.js";
7
+ import"./index-cp26p7qd.js";
8
+ import"./index-mpj63mbw.js";
9
+ import"./index-tnngmzgf.js";
10
+ import"./index-f1x6fe2e.js";
11
11
  import"./index-ss469dec.js";
12
- import"./index-hk58kr1m.js";
13
- import"./index-eay4t1te.js";
14
- import"./index-2v10yr8g.js";
15
- import"./index-eqxmxan6.js";
16
- import"./index-5vvwc0cz.js";
12
+ import"./index-smt4re0s.js";
13
+ import"./index-xdf6rxyt.js";
14
+ import"./index-ckywhpvp.js";
15
+ import"./index-ehjhzg5y.js";
16
+ import"./index-nsj2ftxj.js";
17
17
  import"./index-76rn3g2c.js";
18
18
  import {
19
19
  Workspace,
20
20
  command
21
- } from "./index-qpz4csbs.js";
22
- import"./index-0t7pwff2.js";
23
- import"./index-61keag0s.js";
21
+ } from "./index-en4zpzdm.js";
22
+ import"./index-s6nk9815.js";
23
+ import"./index-67546d0j.js";
24
24
  import"./index-6pz1j0zj.js";
25
25
  import"./index-r24hmh0q.js";
26
26
 
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  TypeScriptDependencyScanner
4
- } from "./index-x53a5nya.js";
5
- import"./index-61keag0s.js";
4
+ } from "./index-46tjzh6s.js";
5
+ import"./index-67546d0j.js";
6
6
  import"./index-r24hmh0q.js";
7
7
  export {
8
8
  TypeScriptDependencyScanner
@@ -1,22 +1,22 @@
1
1
  // @bun
2
2
  import {
3
3
  Prompter
4
- } from "./index-eqxmxan6.js";
4
+ } from "./index-ehjhzg5y.js";
5
5
  import {
6
6
  AiSession
7
- } from "./index-5vvwc0cz.js";
7
+ } from "./index-nsj2ftxj.js";
8
8
  import {
9
9
  Workspace,
10
10
  command,
11
11
  runner,
12
12
  script
13
- } from "./index-qpz4csbs.js";
13
+ } from "./index-en4zpzdm.js";
14
14
  import {
15
15
  getDirname
16
- } from "./index-0t7pwff2.js";
16
+ } from "./index-s6nk9815.js";
17
17
  import {
18
18
  FileSys
19
- } from "./index-61keag0s.js";
19
+ } from "./index-67546d0j.js";
20
20
  import"./index-6pz1j0zj.js";
21
21
  import"./index-r24hmh0q.js";
22
22
 
@@ -5,19 +5,19 @@ import {
5
5
  import {
6
6
  AppExecutor,
7
7
  WorkspaceExecutor
8
- } from "./index-0t7pwff2.js";
9
- import"./index-61keag0s.js";
8
+ } from "./index-s6nk9815.js";
9
+ import"./index-67546d0j.js";
10
10
  import {
11
11
  AutoImportSync,
12
12
  DevChangePlanner,
13
13
  DevGeneratedIndexSync,
14
14
  GraphClientEntryDiscovery,
15
15
  RouteClientBuilder
16
- } from "./index-khzzttv1.js";
16
+ } from "./index-rh16j3c7.js";
17
17
  import {
18
18
  HmrWatcher,
19
19
  WatchRootResolver
20
- } from "./index-0fn1r7gg.js";
20
+ } from "./index-bjpxzr6s.js";
21
21
  import"./index-6pz1j0zj.js";
22
22
  import"./index-r24hmh0q.js";
23
23
 
@@ -81,7 +81,7 @@ class BuildBatchRunner {
81
81
  this.#logger.verbose(`[build-batch] generation=${request.generation} needs=${request.needs.join(",")} done in ${Date.now() - started}ms`);
82
82
  return result;
83
83
  }
84
- const message = `build worker exited with code ${exitCode} before reporting a result`;
84
+ const message = proc.signalCode ? `build worker was killed by ${proc.signalCode} before reporting a result${proc.signalCode === "SIGKILL" ? " \u2014 most often the kernel OOM killer; check the sandbox's memory limit" : ""}` : `build worker exited with code ${exitCode} before reporting a result`;
85
85
  this.#logger.error(`[build-batch] generation=${request.generation} ${message}`);
86
86
  return {
87
87
  generation: request.generation,
@@ -268,27 +268,34 @@ class IncrementalBuilder {
268
268
  get shuttingDown() {
269
269
  return this.#shuttingDown;
270
270
  }
271
- batchTouchesPagesTree(appDir, batch) {
272
- const absAppDir = path2.resolve(appDir);
271
+ static #matchPageRoot(roots, abs) {
272
+ for (const root of roots) {
273
+ const absRoot = path2.resolve(root.realDir);
274
+ if (abs === absRoot || abs.startsWith(`${absRoot}${path2.sep}`))
275
+ return root;
276
+ }
277
+ return null;
278
+ }
279
+ batchTouchesPagesTree(roots, batch) {
273
280
  for (const f of batch.files) {
274
281
  const abs = path2.resolve(f);
275
- if (!abs.startsWith(`${absAppDir}${path2.sep}`) && abs !== absAppDir)
282
+ if (!IncrementalBuilder.#matchPageRoot(roots, abs))
276
283
  continue;
277
284
  if (/\.(tsx|ts|jsx|js)$/.test(abs))
278
285
  return true;
279
286
  }
280
287
  return false;
281
288
  }
282
- async batchMayChangePageKeys(appDir, batch) {
283
- const absAppDir = path2.resolve(appDir);
289
+ async batchMayChangePageKeys(roots, batch) {
284
290
  const pageKeys = new Set((await this.#app.getPageKeys()).map((key) => path2.normalize(key)));
285
291
  for (const f of batch.files) {
286
292
  const abs = path2.resolve(f);
287
- if (!abs.startsWith(`${absAppDir}${path2.sep}`) && abs !== absAppDir)
293
+ const root = IncrementalBuilder.#matchPageRoot(roots, abs);
294
+ if (!root)
288
295
  continue;
289
296
  if (!/\.(tsx|ts|jsx|js)$/.test(abs))
290
297
  continue;
291
- const rel = path2.normalize(path2.relative(absAppDir, abs));
298
+ const rel = path2.normalize(`${root.keyPrefix}${path2.relative(path2.resolve(root.realDir), abs)}`);
292
299
  if (!await Bun.file(abs).exists() || !pageKeys.has(rel))
293
300
  return true;
294
301
  }
@@ -327,20 +334,20 @@ class IncrementalBuilder {
327
334
  }, 150);
328
335
  }
329
336
  async installWatcher() {
330
- const [appDir, artifactDir] = [`${this.#app.cwdPath}/page`, this.#artifactDir];
337
+ const artifactDir = this.#artifactDir;
331
338
  const roots = await new WatchRootResolver(this.#app).resolve();
332
339
  const watcher = new HmrWatcher({
333
340
  roots,
334
341
  logger: this.#logger,
335
342
  onBatch: async (batch) => {
336
- await this.#enqueueWork("hmr-batch", async () => this.#handleWatchBatch(appDir, artifactDir, batch));
343
+ await this.#enqueueWork("hmr-batch", async () => this.#handleWatchBatch(artifactDir, batch));
337
344
  }
338
345
  });
339
346
  await watcher.start();
340
347
  this.#watcher = watcher;
341
348
  this.#logger.verbose(`watching ${roots.length} roots`);
342
349
  }
343
- async#handleWatchBatch(appDir, artifactDir, batch) {
350
+ async#handleWatchBatch(artifactDir, batch) {
344
351
  const rawKinds = new Set(batch.kinds);
345
352
  if (rawKinds.size === 0)
346
353
  return;
@@ -382,11 +389,12 @@ class IncrementalBuilder {
382
389
  if (kinds.includes("code") && !rebuildClient) {
383
390
  this.#logger.verbose(`client rebuild skipped; devPlan actions=${devPlan.actions.join(",") || "(none)"}`);
384
391
  }
385
- if (kinds.includes("code") && rebuildClient && await this.batchMayChangePageKeys(appDir, expandedBatch)) {
392
+ const pageRoots = await this.#app.getPageRoots();
393
+ if (kinds.includes("code") && rebuildClient && await this.batchMayChangePageKeys(pageRoots, expandedBatch)) {
386
394
  const started = Date.now();
387
395
  await this.#app.getPageKeys({ refresh: true });
388
396
  this.#logger.verbose(`pageKeys updated, app pageKeys are refreshed (${Date.now() - started}ms)`);
389
- } else if (kinds.includes("code") && rebuildClient && this.batchTouchesPagesTree(appDir, expandedBatch)) {
397
+ } else if (kinds.includes("code") && rebuildClient && this.batchTouchesPagesTree(pageRoots, expandedBatch)) {
390
398
  this.#logger.verbose("pageKeys refresh skipped; changed page source cannot add/remove a route key");
391
399
  }
392
400
  const needs = [];
@@ -1,24 +1,24 @@
1
1
  // @bun
2
2
  import {
3
3
  CloudRunner
4
- } from "./index-gr4cjv99.js";
4
+ } from "./index-t5rn8q9f.js";
5
5
  import {
6
6
  AiSession,
7
7
  CloudApi,
8
8
  GlobalConfig
9
- } from "./index-5vvwc0cz.js";
9
+ } from "./index-nsj2ftxj.js";
10
10
  import {
11
11
  ApplicationScript
12
- } from "./index-n5y2gbf2.js";
12
+ } from "./index-31183bxt.js";
13
13
  import {
14
14
  PackageScript
15
- } from "./index-nv7et4t3.js";
15
+ } from "./index-31e8cwjq.js";
16
16
  import {
17
17
  script
18
- } from "./index-qpz4csbs.js";
18
+ } from "./index-en4zpzdm.js";
19
19
  import {
20
20
  PkgExecutor
21
- } from "./index-0t7pwff2.js";
21
+ } from "./index-s6nk9815.js";
22
22
 
23
23
  // pkgs/@akanjs/cli/cloud/cloud.script.ts
24
24
  import { Logger } from "akanjs/common";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  AkanContextAnalyzer
4
- } from "./index-eay4t1te.js";
4
+ } from "./index-xdf6rxyt.js";
5
5
  import {
6
6
  WorkflowExecutor,
7
7
  compactWorkflowInputs,
@@ -23,10 +23,10 @@ import {
23
23
  workflowCommandsForPlan,
24
24
  workflowPlanApproval,
25
25
  writeWorkflowRunArtifact
26
- } from "./index-2v10yr8g.js";
26
+ } from "./index-ckywhpvp.js";
27
27
  import {
28
28
  runner
29
- } from "./index-qpz4csbs.js";
29
+ } from "./index-en4zpzdm.js";
30
30
 
31
31
  // pkgs/@akanjs/cli/workflow/workflow.runner.ts
32
32
  import { mkdir, readFile, writeFile } from "fs/promises";