@akanjs/cli 3.3.0-rc.1 → 3.3.0-rc.3

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 (105) hide show
  1. package/.build-stamp +2 -2
  2. package/CodeAgent-0r05qa30.js +11 -0
  3. package/{CodeTui-zee8atsr.js → CodeTui-brryts78.js} +4 -4
  4. package/TunnelShare-dcx5j51j.js +16 -0
  5. package/{agent.command-x65f2ags.js → agent.command-xn4maemk.js} +20 -22
  6. package/akanCode.js +5 -5
  7. package/appExecutor-qt1nm242.js +11 -0
  8. package/{application.command-azbd1pb2.js → application.command-rv2n5bw8.js} +17 -19
  9. package/{applicationBuildRunner-trfxv3pd.js → applicationBuildRunner-ggkd5qgy.js} +16 -13
  10. package/buildBatch.proc.js +19 -18
  11. package/{cloud.command-gapp4634.js → cloud.command-hgnbps4n.js} +19 -24
  12. package/cloud.script-rzsnzjsg.js +30 -0
  13. package/{code.command-5smx61yf.js → code.command-9gfph3t3.js} +13 -13
  14. package/{context.command-ym5jbkny.js → context.command-dwhz1fwq.js} +20 -22
  15. package/context.runner-gh9rr71p.js +32 -0
  16. package/csrArtifactBuilder-zawt8knq.js +9 -0
  17. package/{index-2ny1e95c.js → dependencyScanner-93g8tk0r.js} +6 -5
  18. package/{fileSys-q22646yc.js → fileSys-e5mwt73x.js} +1 -1
  19. package/frameworkGraph-aneq2nwy.js +8 -0
  20. package/{guideline.command-zwypaqsh.js → guideline.command-v2daz21k.js} +8 -8
  21. package/guidelines/akanApi/akanApi.instruction.md +7 -2
  22. package/guidelines/conventions/core.md +6 -11
  23. package/guidelines/conventions/rules/app.md +1 -2
  24. package/guidelines/conventions/rules/auth.md +18 -27
  25. package/guidelines/conventions/rules/config.md +14 -46
  26. package/guidelines/conventions/rules/page.md +19 -34
  27. package/guidelines/conventions/rules/server.md +1 -4
  28. package/guidelines/conventions/rules/ssr.md +3 -4
  29. package/guidelines/conventions/rules/ts.md +2 -1
  30. package/guidelines/cssRule/cssRule.instruction.md +1 -0
  31. package/guidelines/pageRule/pageRule.instruction.md +6 -53
  32. package/incrementalBuilder.proc.js +24 -18
  33. package/{index-j6jjmn2r.js → index-0k64a38w.js} +62 -21
  34. package/{index-78y75t0a.js → index-0vtpxfx6.js} +6 -7
  35. package/{index-4ss4gkv3.js → index-0vv0a5h8.js} +2 -2
  36. package/{index-j0wr4e32.js → index-1v5eghaa.js} +9 -9
  37. package/{index-kfvjzk8r.js → index-2ktpwjgf.js} +3 -3
  38. package/{index-w1zexzpx.js → index-2t7jnfg5.js} +1 -1
  39. package/{index-p7beqww9.js → index-3fmzz9sf.js} +18 -18
  40. package/{index-8jtqfye2.js → index-58ck1gsm.js} +6 -6
  41. package/{index-0s7w2085.js → index-5cpjkfhk.js} +4 -4
  42. package/{index-71y6176j.js → index-609zbjve.js} +8 -8
  43. package/{index-9wh04mqy.js → index-66b1hrxh.js} +2 -2
  44. package/{index-gt8phqpt.js → index-6yefp97x.js} +4 -4
  45. package/{index-0dm25wvf.js → index-7ssr7wq4.js} +1 -1
  46. package/{index-612fdtbk.js → index-8fg1hvj5.js} +1 -1
  47. package/{index-41a03gkj.js → index-91bcfjej.js} +19 -19
  48. package/{index-275a4r3n.js → index-999e5kp4.js} +11 -15
  49. package/{index-s885g0jj.js → index-arcdcexp.js} +3 -3
  50. package/{index-jek2re5k.js → index-b3kjr19v.js} +4 -4
  51. package/{index-3txdtztz.js → index-bjg9thz8.js} +1 -1
  52. package/{index-baccvws5.js → index-bsew0a12.js} +1 -1
  53. package/{index-zfnz878d.js → index-c67vjafa.js} +1 -1
  54. package/{index-z92zm3wd.js → index-cfzqdsam.js} +29 -11
  55. package/{index-dadwp2aw.js → index-dy5reyet.js} +271 -39
  56. package/{index-67sd09ag.js → index-fqhr7j56.js} +8 -8
  57. package/{index-zmd9xxgd.js → index-g7hm77j6.js} +3 -3
  58. package/{index-h901f24n.js → index-ghs8gtvp.js} +5 -5
  59. package/{index-v7ajmsh3.js → index-h1k3zyyb.js} +1 -1
  60. package/{index-knpm8sdm.js → index-j3fqs8rc.js} +1 -1
  61. package/{index-6dzjer7p.js → index-jzwdwse0.js} +6 -6
  62. package/{index-2jmvfa62.js → index-m4s4tzjr.js} +3 -3
  63. package/{index-xwwex8rf.js → index-ndfxse05.js} +5 -5
  64. package/{index-z96ks033.js → index-rd669r6x.js} +153 -45
  65. package/{index-k6vwww45.js → index-rnhbh45p.js} +7 -7
  66. package/{index-ybcb9wc8.js → index-rwhdcnr8.js} +9 -9
  67. package/{index-a860mx0m.js → index-sn5cka91.js} +24 -24
  68. package/{index-ebn9kgea.js → index-v0gt5ryd.js} +18 -15
  69. package/{index-2yn3r67f.js → index-vznyyaf8.js} +6 -6
  70. package/{index-dmcpetwe.js → index-w18qdjyf.js} +98 -23
  71. package/{index-p5zh7pmc.js → index-xv3pvdw4.js} +1 -1
  72. package/{index-nc3br31y.js → index-yejf6fth.js} +2 -2
  73. package/{index-7wf8snar.js → index-zfmc4380.js} +1 -1
  74. package/{index-j592zfqc.js → index-zx3bv21b.js} +1 -1
  75. package/{index-by2tvsq6.js → index-zyjztrvc.js} +1 -1
  76. package/index.js +30 -28
  77. package/{libExecutor-jc6f8hm6.js → libExecutor-p21kkayq.js} +3 -3
  78. package/{library.command-nxvesvhb.js → library.command-m4gw18qq.js} +8 -8
  79. package/{localRegistry.command-xz62e4ng.js → localRegistry.command-3yq90wgp.js} +18 -23
  80. package/{module.command-aaws9byg.js → module.command-9vfdxapr.js} +10 -10
  81. package/{package.command-j7hv26p0.js → package.command-rt4y8xaf.js} +9 -12
  82. package/package.json +3 -2
  83. package/{page.command-7yffs7n9.js → page.command-4zc20rnv.js} +8 -8
  84. package/{pipeline.command-7yk0zcng.js → pipeline.command-4ekd9xgb.js} +7 -7
  85. package/{pkgExecutor-arxmvx4t.js → pkgExecutor-mh903rz9.js} +3 -3
  86. package/{primitive.command-7a1pt715.js → primitive.command-5g3xe4mf.js} +11 -11
  87. package/{projectTypecheck-f4qhbecd.js → projectTypecheck-bz6smek9.js} +1 -1
  88. package/{prompter-qyggfhqd.js → prompter-d33wmdpa.js} +2 -2
  89. package/{quality.command-c6mvrjh1.js → quality.command-zf8dyc9w.js} +9 -9
  90. package/{repair.command-093adzt9.js → repair.command-sx0eyq4w.js} +10 -10
  91. package/{scalar.command-2ex84spb.js → scalar.command-4bvzmbbh.js} +9 -9
  92. package/skills/akan-page/SKILL.md +18 -13
  93. package/skills/akan-runtime/SKILL.md +21 -16
  94. package/skills/akan-service/SKILL.md +2 -2
  95. package/{subspace.command-4n4n4jpv.js → subspace.command-cxyej1an.js} +11 -13
  96. package/{tunnel.command-f7ep1qfa.js → tunnel.command-gvnv36yf.js} +10 -12
  97. package/{verify.command-zrkxnvct.js → verify.command-yj2mngs0.js} +15 -17
  98. package/{workflow.command-ks16jegk.js → workflow.command-42p9g0w8.js} +15 -15
  99. package/{workspace.command-ahhfpaag.js → workspace.command-91wx03de.js} +34 -38
  100. package/CodeAgent-fx6088tv.js +0 -11
  101. package/TunnelShare-9ry4vh0y.js +0 -18
  102. package/appExecutor-79azsb2w.js +0 -11
  103. package/cloud.script-3b401efv.js +0 -35
  104. package/context.runner-kctbfsde.js +0 -34
  105. package/dependencyScanner-ge10gb52.js +0 -8
@@ -1,37 +1,37 @@
1
1
  // @bun
2
+ import {
3
+ SysExecutor
4
+ } from "./index-609zbjve.js";
5
+ import {
6
+ CliError
7
+ } from "./index-j4yvgfhr.js";
2
8
  import {
3
9
  ApplicationBuildReporter
4
- } from "./index-dmcpetwe.js";
10
+ } from "./index-w18qdjyf.js";
5
11
  import {
6
12
  script,
7
13
  markCliErrorPrinted,
8
14
  assertPromptable
9
- } from "./index-2yn3r67f.js";
10
- import {
11
- CliError
12
- } from "./index-j4yvgfhr.js";
13
- import {
14
- SysExecutor
15
- } from "./index-71y6176j.js";
15
+ } from "./index-vznyyaf8.js";
16
16
  import {
17
17
  AppExecutor2
18
- } from "./index-z92zm3wd.js";
18
+ } from "./index-cfzqdsam.js";
19
19
  import {
20
20
  LibExecutor2
21
- } from "./index-zfnz878d.js";
21
+ } from "./index-c67vjafa.js";
22
22
  import {
23
23
  PkgExecutor2
24
- } from "./index-w1zexzpx.js";
24
+ } from "./index-2t7jnfg5.js";
25
25
  import {
26
26
  DesktopServerStage
27
- } from "./index-612fdtbk.js";
27
+ } from "./index-8fg1hvj5.js";
28
28
  import {
29
29
  LibraryScript
30
- } from "./index-2jmvfa62.js";
30
+ } from "./index-m4s4tzjr.js";
31
31
  import {
32
32
  ApplicationRunner,
33
33
  VerifyScope
34
- } from "./index-z96ks033.js";
34
+ } from "./index-rd669r6x.js";
35
35
  import {
36
36
  PreviewChrome2,
37
37
  PreviewView2,
@@ -39,13 +39,13 @@ import {
39
39
  } from "./index-rwgqba9p.js";
40
40
  import {
41
41
  formatSlicePlan
42
- } from "./index-j592zfqc.js";
43
- import {
44
- assertPlainName
45
- } from "./index-va90m8nd.js";
42
+ } from "./index-zx3bv21b.js";
46
43
  import {
47
44
  openBrowser
48
45
  } from "./index-9dp031by.js";
46
+ import {
47
+ assertPlainName
48
+ } from "./index-va90m8nd.js";
49
49
 
50
50
  // pkgs/@akanjs/cli/application/application.script.ts
51
51
  import { mkdir as mkdir3, rm } from "fs/promises";
@@ -1779,7 +1779,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
1779
1779
  await Promise.all(shares.map(async (share) => await share.close()));
1780
1780
  }, "Abandoning the tunnel release; the shares expire on their own.");
1781
1781
  await Promise.all(apps.map(async (app) => {
1782
- const { TunnelShare } = await import("./TunnelShare-9ry4vh0y.js");
1782
+ const { TunnelShare } = await import("./TunnelShare-dcx5j51j.js");
1783
1783
  const share = await TunnelShare.open(app, { workspace: app.workspace });
1784
1784
  shares.push(share);
1785
1785
  urls.set(app.name, share.url);
@@ -2,22 +2,16 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-2yn3r67f.js";
5
+ } from "./index-vznyyaf8.js";
6
6
  import {
7
7
  FileSys2
8
- } from "./index-by2tvsq6.js";
8
+ } from "./index-zyjztrvc.js";
9
9
  import {
10
10
  PkgExecutor2
11
- } from "./index-w1zexzpx.js";
12
- import {
13
- FrameworkGraph
14
- } from "./index-p7beqww9.js";
11
+ } from "./index-2t7jnfg5.js";
15
12
  import {
16
13
  MaintainabilityBaseline
17
- } from "./index-baccvws5.js";
18
- import {
19
- TypeScriptDependencyScanner2
20
- } from "./index-2ny1e95c.js";
14
+ } from "./index-bsew0a12.js";
21
15
  import {
22
16
  assertPackageName
23
17
  } from "./index-va90m8nd.js";
@@ -169,9 +163,10 @@ class PackageRunner extends runner("package") {
169
163
  return await pkg.scan();
170
164
  }
171
165
  async buildPackage(pkg) {
166
+ const { TypeScriptDependencyScanner } = await import("./dependencyScanner-93g8tk0r.js");
172
167
  await $`rm -rf ${pkg.dist.cwdPath}`;
173
168
  await pkg.dist.mkdir(pkg.dist.cwdPath);
174
- const scanner = await TypeScriptDependencyScanner2.from(pkg);
169
+ const scanner = await TypeScriptDependencyScanner.from(pkg);
175
170
  const { npmDeps, npmDevDeps, missingDeps } = await scanner.getPackageBuildDependencies(pkg.name);
176
171
  const packageRuntimeDependencies = {
177
172
  "@akanjs/devkit": [
@@ -286,9 +281,9 @@ class PackageRunner extends runner("package") {
286
281
  if (!failures.length)
287
282
  return;
288
283
  throw new Error(`[package] ${pkg.name} dist imports ${failures.length} subpath(s) no consumer can resolve:
289
- ` + `${failures.sort((a, b) => a < b ? -1 : a > b ? 1 : 0).join(`
284
+ ${failures.sort((a, b) => a < b ? -1 : a > b ? 1 : 0).join(`
290
285
  `)}
291
- ` + `Add the missing "exports" entries: a bare file facet needs "./*": "./*.ts", a directory facet ` + `needs its own "./name": "./name/index.ts", and "./*.ts": "./*.ts" keeps an already-suffixed ` + `specifier from gaining a second extension.`);
286
+ Add the missing "exports" entries: a bare file facet needs "./*": "./*.ts", a directory facet needs its own "./name": "./name/index.ts", and "./*.ts": "./*.ts" keeps an already-suffixed specifier from gaining a second extension.`);
292
287
  }
293
288
  async#verifyDistImportsPublished(pkg) {
294
289
  const imports = await this.#collectDistAkanImports(pkg.dist.cwdPath, PackageRunner.#unpublishedPackages);
@@ -300,9 +295,9 @@ class PackageRunner extends runner("package") {
300
295
  return ` ${specifier} \u2014 imported by ${shown}`;
301
296
  });
302
297
  throw new Error(`[package] ${pkg.name} dist imports ${failures.length} specifier(s) of a package that is never published:
303
- ` + `${failures.sort((a, b) => a < b ? -1 : a > b ? 1 : 0).join(`
298
+ ${failures.sort((a, b) => a < b ? -1 : a > b ? 1 : 0).join(`
304
299
  `)}
305
- ` + "Reach it through a published package that embeds it (akanjs/native/api for @akanjs/native/api), or embed it " + "in this package's build.");
300
+ Reach it through a published package that embeds it (akanjs/native/api for @akanjs/native/api), or embed it in this package's build.`);
306
301
  }
307
302
  async verifyDistPackage(pkg, {
308
303
  peerExportsMaps = new Map
@@ -355,6 +350,7 @@ class PackageRunner extends runner("package") {
355
350
  };
356
351
  }
357
352
  async syncArchitecture(workspace) {
353
+ const { FrameworkGraph } = await import("./frameworkGraph-aneq2nwy.js");
358
354
  const architecture = await FrameworkGraph.architecture(workspace.workspaceRoot);
359
355
  if (!architecture)
360
356
  throw new Error(`${FrameworkGraph.architectureFile} is only kept in the akanjs repository`);
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  FileSys2
4
- } from "./index-by2tvsq6.js";
4
+ } from "./index-zyjztrvc.js";
5
5
  import {
6
6
  resolveMobileTargets
7
7
  } from "./index-m9jj544v.js";
@@ -9,10 +9,10 @@ import {
9
9
  UpdatePackFolder,
10
10
  NativePublicEnv,
11
11
  NativeApp
12
- } from "./index-ebn9kgea.js";
12
+ } from "./index-v0gt5ryd.js";
13
13
  import {
14
14
  ExitCodeError
15
- } from "./index-2yn3r67f.js";
15
+ } from "./index-vznyyaf8.js";
16
16
  import {
17
17
  ConfigLock
18
18
  } from "./index-bqbf654f.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  SOURCE_EXTS,
4
4
  WatchRootResolver
5
- } from "./index-dmcpetwe.js";
5
+ } from "./index-w18qdjyf.js";
6
6
  import {
7
7
  loaderFor,
8
8
  BarrelAnalyzer,
@@ -18,15 +18,15 @@ import {
18
18
  CsrDevPaths,
19
19
  PagesEntrySourceGenerator,
20
20
  PagesBundleBuilder
21
- } from "./index-9wh04mqy.js";
21
+ } from "./index-66b1hrxh.js";
22
22
  import {
23
23
  FileSys2
24
- } from "./index-by2tvsq6.js";
24
+ } from "./index-zyjztrvc.js";
25
25
  import {
26
26
  AsyncDefaultExportDetector,
27
27
  StoreBootstrap,
28
28
  resolveSsrPageEntriesForApp
29
- } from "./index-z92zm3wd.js";
29
+ } from "./index-cfzqdsam.js";
30
30
 
31
31
  // pkgs/@akanjs/devkit/frontendBuild/clientEntryDiscovery.ts
32
32
  import fs from "fs";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-2yn3r67f.js";
5
+ } from "./index-vznyyaf8.js";
6
6
 
7
7
  // pkgs/@akanjs/cli/page/page.runner.ts
8
8
  class PageRunner extends runner("page") {
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  JsonFormatter
4
- } from "./index-71y6176j.js";
4
+ } from "./index-609zbjve.js";
5
5
 
6
6
  // pkgs/@akanjs/devkit/quality/maintainabilityBaseline.ts
7
7
  class MaintainabilityBaseline {
@@ -5,7 +5,7 @@ import {
5
5
  SysExecutor,
6
6
  WorkspaceExecutor,
7
7
  AkanLibConfig
8
- } from "./index-71y6176j.js";
8
+ } from "./index-609zbjve.js";
9
9
 
10
10
  // pkgs/@akanjs/devkit/executors/libExecutor.ts
11
11
  class LibExecutor2 extends SysExecutor {
@@ -7,16 +7,16 @@ import {
7
7
  AkanAppConfig,
8
8
  increaseBuildNum,
9
9
  decreaseBuildNum
10
- } from "./index-71y6176j.js";
10
+ } from "./index-609zbjve.js";
11
11
  import {
12
12
  FileSys2
13
- } from "./index-by2tvsq6.js";
13
+ } from "./index-zyjztrvc.js";
14
14
  import {
15
15
  LibExecutor2
16
- } from "./index-zfnz878d.js";
16
+ } from "./index-c67vjafa.js";
17
17
 
18
18
  // pkgs/@akanjs/devkit/executors/appExecutor.ts
19
- import { cp as cpEntry, lstat, mkdir, readdir as readDirEntries, realpath, symlink } from "fs/promises";
19
+ import { cp as cpEntry, lstat, mkdir, readdir as readDirEntries, realpath, rm as rm2, stat, symlink } from "fs/promises";
20
20
  import path3 from "path";
21
21
  import { pathToFileURL } from "url";
22
22
  import { isRouteSourceFile, parseRouteModuleKey, validatePageSourceFile, validateSubRoutePageKey } from "akanjs/common";
@@ -409,7 +409,12 @@ class AppExecutor2 extends SysExecutor {
409
409
  static from(executor, name) {
410
410
  return new AppExecutor2({ workspace: executor instanceof WorkspaceExecutor ? executor : executor.workspace, name });
411
411
  }
412
- static #keptOnStart = [path3.join(".akan", "cache", "bin")];
412
+ #verifyBuild = false;
413
+ useVerifyDist() {
414
+ this.dist = new Executor(`dist/verify/${this.name}`, `${this.workspace.workspaceRoot}/dist/verify/${this.name}`);
415
+ this.#verifyBuild = true;
416
+ }
417
+ static #keptOnStart = [path3.join(".akan", "cache")];
413
418
  static #legacyNative = path3.join(".akan", "native");
414
419
  async#removeDevOutput(dir = ".akan") {
415
420
  const entries = await readDirEntries(this.getPath(dir)).catch(() => []);
@@ -420,12 +425,23 @@ class AppExecutor2 extends SysExecutor {
420
425
  return;
421
426
  }
422
427
  if (AppExecutor2.#keptOnStart.includes(entry))
423
- return;
428
+ return await this.#removeStaleTemps(entry);
424
429
  if (AppExecutor2.#keptOnStart.some((kept) => kept.startsWith(`${entry}${path3.sep}`)))
425
430
  return await this.#removeDevOutput(entry);
426
431
  await this.removeDir(entry);
427
432
  }));
428
433
  }
434
+ static #staleTempMs = 60000;
435
+ async#removeStaleTemps(dir) {
436
+ const root = this.getPath(dir);
437
+ const names = await readDirEntries(root, { recursive: true }).catch(() => []);
438
+ await Promise.all(names.filter((name) => name.endsWith(".tmp")).map(async (name) => {
439
+ const file = path3.join(root, name);
440
+ const stats = await stat(file).catch(() => null);
441
+ if (stats?.isFile() && Date.now() - stats.mtimeMs > AppExecutor2.#staleTempMs)
442
+ await rm2(file, { force: true });
443
+ }));
444
+ }
429
445
  getEnv() {
430
446
  return WorkspaceExecutor.getBaseDevEnv().env;
431
447
  }
@@ -475,11 +491,13 @@ class AppExecutor2 extends SysExecutor {
475
491
  this.#excludeDevOnlyPages = true;
476
492
  this.#pageKeys = null;
477
493
  await this.dist.removeDir(this.dist.cwdPath);
478
- await Promise.all([this.dist.mkdir("private"), this.dist.mkdir("public")]);
479
- await Promise.all([
480
- this.cp("private", `${this.dist.cwdPath}/private`, { dereference: true }),
481
- ...akanConfig.web.ssr ? [this.cp("public", `${this.dist.cwdPath}/public`, { dereference: true })] : []
482
- ]);
494
+ if (!this.#verifyBuild) {
495
+ await Promise.all([this.dist.mkdir("private"), this.dist.mkdir("public")]);
496
+ await Promise.all([
497
+ this.cp("private", `${this.dist.cwdPath}/private`, { dereference: true }),
498
+ ...akanConfig.web.ssr ? [this.cp("public", `${this.dist.cwdPath}/public`, { dereference: true })] : []
499
+ ]);
500
+ }
483
501
  } else {
484
502
  await this.#removeDevOutput();
485
503
  if (!akanConfig.web.ssr || !akanConfig.web.csr)