@akanjs/cli 3.2.0-rc.9 → 3.2.1-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/.build-stamp +2 -2
  2. package/CodeAgent-xdw73nbz.js +11 -0
  3. package/{CodeTui-qstk5vpj.js → CodeTui-0gewm71c.js} +822 -666
  4. package/README.ko.md +7 -0
  5. package/README.md +7 -0
  6. package/TunnelShare-cccfdgbm.js +16 -0
  7. package/agent.command-g1mj34wz.js +59 -0
  8. package/akanCode.js +12 -12
  9. package/appExecutor-rrx10jya.js +11 -0
  10. package/{application.command-m4rq4wc2.js → application.command-3w4v7t40.js} +84 -40
  11. package/{applicationBuildRunner-df7rx3ra.js → applicationBuildRunner-y5xbetyz.js} +51 -20
  12. package/buildBatch.proc.js +31 -16
  13. package/{cloud.command-a0gy0qq2.js → cloud.command-ph0rz6sw.js} +28 -29
  14. package/cloud.script-8bs9tp4j.js +30 -0
  15. package/{code.command-5rsdqw8s.js → code.command-9b967qpg.js} +13 -9
  16. package/context.command-ndzs5rbf.js +62 -0
  17. package/context.runner-bmstpng2.js +32 -0
  18. package/csrArtifactBuilder-gtvff6k7.js +10 -0
  19. package/{index-qd7xn2bk.js → dependencyScanner-93g8tk0r.js} +7 -6
  20. package/{devTui-h77zrjv5.js → devTui-rf374y2w.js} +1 -1
  21. package/{fileSys-zpvt5gtf.js → fileSys-e5mwt73x.js} +1 -1
  22. package/frameworkGraph-aneq2nwy.js +8 -0
  23. package/{guideline.command-mffxknbr.js → guideline.command-y8qz9kxy.js} +9 -5
  24. package/guidelines/agentRule/agentRule.instruction.md +25 -9
  25. package/guidelines/akanApi/akanApi.instruction.md +6 -4
  26. package/guidelines/conventions/core.md +23 -5
  27. package/guidelines/conventions/rules/app.md +4 -1
  28. package/guidelines/conventions/rules/page.md +5 -4
  29. package/guidelines/conventions/rules/ts.md +3 -3
  30. package/guidelines/errorCodes/errorCodes.instruction.md +165 -0
  31. package/guidelines/fieldRule/fieldRule.instruction.md +2 -1
  32. package/guidelines/mcpRule/mcpRule.instruction.md +225 -5
  33. package/guidelines/pageRule/pageRule.instruction.md +10 -1
  34. package/guidelines/queryRule/queryRule.instruction.md +3 -1
  35. package/guidelines/runtimeRule/runtimeRule.instruction.md +14 -8
  36. package/guidelines/transportRule/transportRule.instruction.md +31 -1
  37. package/incrementalBuilder.proc.js +609 -437
  38. package/{index-skmtj8rm.js → index-02v45hh9.js} +27 -10
  39. package/{index-j6gc8n14.js → index-0csk6jqm.js} +11 -9
  40. package/{index-2r9ff9qm.js → index-0wa5z6rm.js} +2 -2
  41. package/{index-nmvhjn8c.js → index-0z8sbdme.js} +93 -82
  42. package/{index-2vgv7fs7.js → index-1c2807kg.js} +727 -693
  43. package/{index-hj6w4ka1.js → index-1p81ecbz.js} +1 -1
  44. package/{index-2mf1aen9.js → index-1p9bxjmt.js} +2 -2
  45. package/{index-an76bdrv.js → index-2kh4xj3m.js} +1 -1
  46. package/{index-99qvtff2.js → index-2vn0m9z5.js} +5 -5
  47. package/{index-rp4yf32g.js → index-3569fr49.js} +36 -29
  48. package/{index-xvk2a75m.js → index-38x8ynrx.js} +25 -25
  49. package/{index-cmg5ngqa.js → index-3fmzz9sf.js} +20 -20
  50. package/{index-rfzp4pqs.js → index-45aprybg.js} +3 -3
  51. package/{index-k92x3vne.js → index-4a1n0nym.js} +1 -1
  52. package/{index-ra9fvn7s.js → index-4zgm54wf.js} +76 -40
  53. package/{index-exn38bzx.js → index-652f3bs8.js} +116 -54
  54. package/{index-grxs6fts.js → index-6gepp8yn.js} +57 -31
  55. package/{index-vm0dn0mt.js → index-6j351de4.js} +294 -157
  56. package/{index-w15mg3km.js → index-7ssr7wq4.js} +1 -1
  57. package/{index-gxav1bjz.js → index-82cmbpxc.js} +9 -9
  58. package/{index-2mrn1mrg.js → index-9f3reh2y.js} +1 -1
  59. package/{index-gcx48get.js → index-9rymt8d6.js} +2 -2
  60. package/{index-swwjakt0.js → index-ankyx6dj.js} +14 -18
  61. package/{index-28x1aszt.js → index-b0t92k71.js} +154 -58
  62. package/index-b372rck5.js +799 -0
  63. package/{index-yf9wc28h.js → index-bejy9zyc.js} +1 -1
  64. package/{index-r0a604h4.js → index-c669pbyb.js} +5 -4
  65. package/{index-xyn02k0w.js → index-cm9rb480.js} +662 -433
  66. package/{index-j9790rhk.js → index-d0n78fzc.js} +1635 -1139
  67. package/{index-hqv34wzq.js → index-dr1carpr.js} +10 -10
  68. package/index-f2arv0mv.js +30 -0
  69. package/{index-5radqwn2.js → index-gtydr9qc.js} +12 -12
  70. package/{index-j6eeh5d7.js → index-j3fqs8rc.js} +5 -5
  71. package/{index-yckz5t8b.js → index-jdw9m5c4.js} +516 -434
  72. package/{index-ny2k80mv.js → index-jf4vk1s0.js} +9 -2
  73. package/{index-x40bdsca.js → index-jg5rwrf7.js} +77 -115
  74. package/{index-5zwr4n6k.js → index-ktxdfqg5.js} +65 -8
  75. package/index-mnhrqjjq.js +127 -0
  76. package/{index-3ghdb7p5.js → index-pc42gxa5.js} +2777 -3676
  77. package/{index-0hbtve0a.js → index-q8h4eg5y.js} +32 -28
  78. package/{index-j3v29pq7.js → index-qh81drde.js} +219 -175
  79. package/{index-b4qq3rq0.js → index-rwgqba9p.js} +1 -1
  80. package/{index-w8yasvpc.js → index-scfsqen7.js} +2136 -2175
  81. package/{index-9p260r4e.js → index-trffs83s.js} +538 -250
  82. package/{index-0gg15zwa.js → index-twjgmryg.js} +6 -6
  83. package/index-whvhsb5f.js +80 -0
  84. package/{index-h7hehkw6.js → index-xczjdng6.js} +3 -1
  85. package/{index-39jz41jb.js → index-xs9a3ddt.js} +3 -3
  86. package/{index-35j83zkd.js → index-xv3pvdw4.js} +2 -2
  87. package/{index-34792nh7.js → index-y2g0s9tn.js} +1 -1
  88. package/{index-43f4h4cm.js → index-ymgsvhc5.js} +7 -8
  89. package/{index-ygdbn9jn.js → index-zyb0ebm4.js} +1 -1
  90. package/{index-bns3wcpc.js → index-zyjztrvc.js} +2 -2
  91. package/index.js +30 -24
  92. package/libExecutor-nstr00s7.js +10 -0
  93. package/{library.command-bmd7zc5m.js → library.command-b02aw1hm.js} +12 -5
  94. package/{localRegistry.command-y6en1599.js → localRegistry.command-3hg1p4aj.js} +24 -24
  95. package/{module.command-7exfffqw.js → module.command-bd9gz6cv.js} +11 -7
  96. package/{package.command-adskw2rj.js → package.command-xmr0mxze.js} +11 -10
  97. package/package.json +8 -8
  98. package/{page.command-dw01272p.js → page.command-x94qf58g.js} +8 -4
  99. package/{pipeline.command-0b1r3y5r.js → pipeline.command-n2843k6t.js} +15 -9
  100. package/pkgExecutor-cka27e3c.js +10 -0
  101. package/{primitive.command-byw6vc04.js → primitive.command-cs7v376h.js} +12 -8
  102. package/{projectTypecheck-kkrpq60a.js → projectTypecheck-za2n3nbr.js} +1 -1
  103. package/{prompter-qrwx1p17.js → prompter-d33wmdpa.js} +2 -2
  104. package/{quality.command-6rqnhzct.js → quality.command-nqngh1jd.js} +25 -16
  105. package/{recipeScanner-4b69ybe0.js → recipeScanner-rrx69awy.js} +1 -1
  106. package/{repair.command-rw5zymak.js → repair.command-v2medwsm.js} +12 -8
  107. package/{routeSourceValidator-4h947v7c.js → routeSourceValidator-8n6j1vn7.js} +4 -2
  108. package/{scalar.command-2dyp9nh9.js → scalar.command-61cjmxn1.js} +10 -6
  109. package/skills/akan-debug/SKILL.md +8 -5
  110. package/skills/akan-err/SKILL.md +7 -0
  111. package/skills/akan-mcp/SKILL.md +19 -1
  112. package/skills/akan-scaffold/SKILL.md +1 -1
  113. package/skills/akan-validate/SKILL.md +3 -3
  114. package/{subspace.command-111ynwv1.js → subspace.command-dtv8nfh7.js} +30 -24
  115. package/templates/app/page/_layout.tsx +13 -0
  116. package/templates/app/page/styles.css.template +40 -0
  117. package/templates/appSample/page/_index.tsx +9 -9
  118. package/templates/appSample/page/_layout.tsx +1 -0
  119. package/templates/appSample/page/styles.css.template +40 -5
  120. package/templates/appSample/ui/Recipe/jellyButton.ts +1 -1
  121. package/templates/biomeForm.ts +1 -1
  122. package/templates/env/_env.server.type.ts +1 -1
  123. package/templates/facetIndex/index.ts +2 -37
  124. package/templates/lib/sig.ts +0 -4
  125. package/templates/lib/useClient.ts +1 -1
  126. package/templates/workspaceRoot/.devcontainer/devcontainer.json.template +1 -1
  127. package/templates/workspaceRoot/AGENTS.md.template +2 -1
  128. package/templates/workspaceRoot/README.ts +4 -2
  129. package/{tunnel.command-2gcpfbdj.js → tunnel.command-fmwm5fgb.js} +15 -13
  130. package/{typeChecker-s640r6c0.js → typeChecker-7jt6abrs.js} +1 -1
  131. package/typecheck.proc.js +3 -2
  132. package/{verify.command-djgs86ma.js → verify.command-4f260t53.js} +19 -17
  133. package/{workflow.command-n0k2mxr5.js → workflow.command-tm5q9xsm.js} +21 -14
  134. package/{workspace.command-fh1qwxfx.js → workspace.command-75gc280j.js} +56 -54
  135. package/CodeAgent-x2p3a3e0.js +0 -11
  136. package/TunnelShare-c4xsfzg5.js +0 -15
  137. package/agent.command-9et2e27p.js +0 -52
  138. package/cloud.script-xze4zh7n.js +0 -31
  139. package/context.command-rk1dwrg4.js +0 -57
  140. package/context.runner-83ky5m1b.js +0 -30
  141. package/dependencyScanner-78sq8m4q.js +0 -8
  142. /package/templates/{appSample → app}/public/fonts/Pretendard-Bold.woff2 +0 -0
  143. /package/templates/{appSample → app}/public/fonts/Pretendard-Medium.woff2 +0 -0
  144. /package/templates/{appSample → app}/public/fonts/Pretendard-Regular.woff2 +0 -0
  145. /package/templates/{appSample → app}/public/fonts/Pretendard-SemiBold.woff2 +0 -0
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- // pkgs/@akanjs/devkit/recipeScanner.ts
2
+ // pkgs/@akanjs/devkit/context/recipeScanner.ts
3
3
  import { readdir } from "fs/promises";
4
4
  import ts from "typescript";
5
5
  var collectRecipeSources2 = async (uiDirPath, importFrom, basename = "Recipe") => {
@@ -2,12 +2,12 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-exn38bzx.js";
5
+ } from "./index-652f3bs8.js";
6
6
  import {
7
7
  generatedFilesForSync,
8
8
  createPassedPrimitiveReport,
9
9
  scalarChangedFiles
10
- } from "./index-2vgv7fs7.js";
10
+ } from "./index-1c2807kg.js";
11
11
  import {
12
12
  pluralizeName
13
13
  } from "./index-nz8prx9g.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  DesktopBin
4
- } from "./index-43f4h4cm.js";
4
+ } from "./index-ymgsvhc5.js";
5
5
  // pkgs/@akanjs/devkit/mobile/desktopServerStage.ts
6
6
  import { cp, mkdir, readdir, rm, writeFile } from "fs/promises";
7
7
  import path from "path";
@@ -1,17 +1,17 @@
1
1
  // @bun
2
2
  import {
3
- AkanContextAnalyzer
4
- } from "./index-yckz5t8b.js";
3
+ runner
4
+ } from "./index-652f3bs8.js";
5
5
  import {
6
6
  writeWorkflowRunArtifact,
7
7
  generatedFilePathsForTarget,
8
8
  writeGeneratedSyncState,
9
9
  createRepairReport,
10
10
  renderRepairReport
11
- } from "./index-2vgv7fs7.js";
11
+ } from "./index-1c2807kg.js";
12
12
  import {
13
- runner
14
- } from "./index-exn38bzx.js";
13
+ AkanContextAnalyzer
14
+ } from "./index-jdw9m5c4.js";
15
15
  import {
16
16
  isWorkflowSysName,
17
17
  isWorkflowModuleName
@@ -6,29 +6,32 @@ import {
6
6
  CloudApi,
7
7
  CloudUpdates,
8
8
  PipelineSecrets
9
- } from "./index-rfzp4pqs.js";
9
+ } from "./index-45aprybg.js";
10
10
  import {
11
11
  resolveMobileTargets
12
12
  } from "./index-m9jj544v.js";
13
13
  import {
14
- WorkspaceExecutor,
15
- AppExecutor
16
- } from "./index-3ghdb7p5.js";
14
+ WorkspaceExecutor
15
+ } from "./index-pc42gxa5.js";
16
+ import {
17
+ AppExecutor2
18
+ } from "./index-b372rck5.js";
17
19
  import {
18
20
  NativeApp
19
- } from "./index-43f4h4cm.js";
21
+ } from "./index-ymgsvhc5.js";
20
22
  import {
21
23
  runner,
22
24
  assertPromptable
23
- } from "./index-exn38bzx.js";
25
+ } from "./index-652f3bs8.js";
24
26
  import {
25
27
  getNpmRegistryUrl,
26
28
  getPublishedVersions,
27
- getLatestPackageVersion
28
- } from "./index-ny2k80mv.js";
29
+ getLatestPackageVersion,
30
+ getPublishedPeerDependencies
31
+ } from "./index-jf4vk1s0.js";
29
32
  import {
30
33
  SubspaceConfig
31
- } from "./index-h7hehkw6.js";
34
+ } from "./index-xczjdng6.js";
32
35
  import {
33
36
  openBrowser
34
37
  } from "./index-9dp031by.js";
@@ -304,7 +307,7 @@ class LinuxDockerTarget extends PlatformTestTarget {
304
307
  if (started.exitCode !== 0)
305
308
  throw new Error(`docker run failed: ${started.stderr.trim()}`);
306
309
  this.#container = container;
307
- const extract = await this.exec(`tar -xf /io/${path3.basename(context.snapshot.tarPath)} -C /w && cp /io-env /w/.env && git -C /w init -q`, path3.join(context.logDir, this.platform, "extract.log"), PlatformTestTarget.installIdleMs);
310
+ const extract = await this.exec(`tar -xf /io/${path3.basename(context.snapshot.tarPath)} -C /w && cp /io-env /w/.env && git -C /w init -q && git -C /w add -A`, path3.join(context.logDir, this.platform, "extract.log"), PlatformTestTarget.installIdleMs);
308
311
  if (extract.exitCode !== 0)
309
312
  throw new Error("extracting the snapshot into the container failed");
310
313
  }
@@ -473,7 +476,7 @@ class WindowsSshTarget extends PlatformTestTarget {
473
476
  if (copied.exitCode !== 0)
474
477
  throw new Error(`scp ${remoteName} failed: ${copied.stderr.trim()}`);
475
478
  }
476
- const extract = await this.exec("tar -xf ..\\src.tar && copy /Y ..\\env .env >nul && git init -q", path5.join(context.logDir, this.platform, "extract.log"), PlatformTestTarget.installIdleMs);
479
+ const extract = await this.exec("tar -xf ..\\src.tar && copy /Y ..\\env .env >nul && git init -q && git add -A", path5.join(context.logDir, this.platform, "extract.log"), PlatformTestTarget.installIdleMs);
477
480
  if (extract.exitCode !== 0)
478
481
  throw new Error("extracting the snapshot on the Windows host failed");
479
482
  }
@@ -715,7 +718,7 @@ class EnvArchive {
715
718
  static async#secretGlobs(workspace) {
716
719
  const [appNames] = await workspace.getExecs();
717
720
  const entries = await Promise.all(appNames.map(async (appName) => {
718
- const { secrets = [] } = await AppExecutor.from(workspace, appName).getConfig();
721
+ const { secrets = [] } = await AppExecutor2.from(workspace, appName).getConfig();
719
722
  return [appName, secrets.map((pattern) => new Bun.Glob(pattern))];
720
723
  }));
721
724
  return new Map(entries);
@@ -1240,27 +1243,31 @@ ${run.format(results)}
1240
1243
  }
1241
1244
  async update(workspace, tag = "latest", { registryUrl } = {}) {
1242
1245
  const registry = registryUrl ? getNpmRegistryUrl(registryUrl) : undefined;
1243
- const registryArgs = this.#getRegistryArgs(registry);
1244
- const env = this.#getRegistryEnv(registry);
1245
- const globalCliArgs = ["add", "-g", `@akanjs/cli@${tag}`, ...registryArgs];
1246
- if (!await workspace.exists("package.json"))
1247
- await workspace.spawn("bun", globalCliArgs, { env });
1248
- else
1249
- await Promise.all([
1250
- workspace.spawn("bun", globalCliArgs, { env }),
1251
- this.#updateAkanPkgs(workspace, tag, registry)
1252
- ]);
1246
+ const hasPackageJson = await workspace.exists("package.json");
1247
+ const version = hasPackageJson ? await getLatestPackageVersion("akanjs", tag, registry) : tag;
1248
+ const peers = hasPackageJson ? await getPublishedPeerDependencies("akanjs", version, registry) : null;
1249
+ await Promise.all([
1250
+ workspace.spawn("bun", ["add", "-g", `@akanjs/cli@${version}`, ...this.#getRegistryArgs(registry)], {
1251
+ env: this.#getRegistryEnv(registry)
1252
+ }),
1253
+ peers && this.#updateAkanPkgs(workspace, version, peers, registry)
1254
+ ]);
1253
1255
  }
1254
- async#updateAkanPkgs(workspace, tag = "latest", registryUrl) {
1255
- const latestPublishedVersion = await getLatestPackageVersion("akanjs", tag, registryUrl);
1256
+ async#updateAkanPkgs(workspace, akanVersion, peers, registryUrl) {
1256
1257
  const rootPackageJson = await workspace.getPackageJson();
1257
1258
  if (!rootPackageJson.dependencies)
1258
1259
  throw new Error("No dependencies found in package.json");
1259
- for (const name of ["akanjs", "@akanjs/devkit", "@akanjs/cli", "@akanjs/language"]) {
1260
+ const pins = Object.fromEntries(["akanjs", "@akanjs/devkit", "@akanjs/cli", "@akanjs/language"].map((name) => [name, akanVersion]));
1261
+ for (const peer of ["react", "react-dom", "react-server-dom-webpack"]) {
1262
+ const version = peers[peer];
1263
+ if (version)
1264
+ pins[peer] = version;
1265
+ }
1266
+ for (const [name, version] of Object.entries(pins)) {
1260
1267
  if (rootPackageJson.dependencies[name])
1261
- rootPackageJson.dependencies[name] = latestPublishedVersion;
1268
+ rootPackageJson.dependencies[name] = version;
1262
1269
  if (rootPackageJson.devDependencies?.[name])
1263
- rootPackageJson.devDependencies[name] = latestPublishedVersion;
1270
+ rootPackageJson.devDependencies[name] = version;
1264
1271
  }
1265
1272
  await workspace.setPackageJson(rootPackageJson);
1266
1273
  await workspace.spawn("bun", ["install", ...this.#getRegistryArgs(registryUrl)], {
@@ -1355,7 +1362,7 @@ ${run.format(results)}
1355
1362
  }
1356
1363
  async#gatherCustomSecretFiles(workspace, appNames) {
1357
1364
  const secretPaths = await Promise.all(appNames.map(async (appName) => {
1358
- const config = await AppExecutor.from(workspace, appName).getConfig();
1365
+ const config = await AppExecutor2.from(workspace, appName).getConfig();
1359
1366
  const secretGlobs = config.secrets ?? [];
1360
1367
  if (secretGlobs.length === 0)
1361
1368
  return [];
@@ -1439,7 +1446,7 @@ ${run.format(results)}
1439
1446
  }
1440
1447
  async#syncSecretGitignore(workspace, appNames) {
1441
1448
  const patterns = (await Promise.all(appNames.map(async (appName) => {
1442
- const config = await AppExecutor.from(workspace, appName).getConfig();
1449
+ const config = await AppExecutor2.from(workspace, appName).getConfig();
1443
1450
  return (config.secrets ?? []).map((pattern) => `apps/${appName}/${pattern.replace(/^\/+/, "")}`);
1444
1451
  }))).flat();
1445
1452
  const uniquePatterns = [...new Set(patterns)].sort();
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  resolveSsrPageEntriesForApp
4
- } from "./index-3ghdb7p5.js";
4
+ } from "./index-b372rck5.js";
5
5
  import {
6
6
  createBarrelImportsPlugin,
7
7
  workspaceBarrels,
@@ -10,7 +10,7 @@ import {
10
10
  CsrEntryFiles,
11
11
  PagesEntrySourceGenerator,
12
12
  PagesBundleBuilder
13
- } from "./index-nmvhjn8c.js";
13
+ } from "./index-0z8sbdme.js";
14
14
 
15
15
  // pkgs/@akanjs/devkit/frontendBuild/csrArtifactBuilder.ts
16
16
  import { mkdir as mkdir2, rm as rm2, unlink as unlink2 } from "fs/promises";
@@ -236,7 +236,7 @@ class McpAppViewBuilder {
236
236
  ...options,
237
237
  plugins: [
238
238
  ...options.plugins,
239
- await CsrArtifactBuilder.barrelImportsPlugin(this.#app, McpAppPageTrimmer.pipe(pagePaths)),
239
+ await CsrArtifactBuilder2.barrelImportsPlugin(this.#app, McpAppPageTrimmer.pipe(pagePaths)),
240
240
  PureLazyMarker.plugin()
241
241
  ],
242
242
  entrypoints: views.map((view) => path3.join(generatedDir, `${view.name}.html`)),
@@ -269,7 +269,7 @@ ${logs}` : ""}`);
269
269
  await rm(stagingDir, { recursive: true, force: true });
270
270
  }
271
271
  static async discover(pageEntries, basePaths) {
272
- const { RouteSourceValidator } = await import("./routeSourceValidator-4h947v7c.js");
272
+ const { RouteSourceValidator } = await import("./routeSourceValidator-8n6j1vn7.js");
273
273
  const roots = pageEntries.filter((entry) => parseRouteModuleKey(entry.key).isInternalRootLayout);
274
274
  const overrides = pageEntries.filter((entry) => parseRouteModuleKey(entry.key).kind === "overrides");
275
275
  const layoutNodes = new Set(pageEntries.flatMap((entry) => {
@@ -365,12 +365,12 @@ ${importsOf(view.rootOverrides, "rootOverride")}${importsOf(view.overrides, "ove
365
365
  if (cssAsset) {
366
366
  const artifactDir = path3.join(this.#command === "build" ? this.#app.dist.cwdPath : this.#app.cwdPath, ".akan", "artifact");
367
367
  const css = await Bun.file(path3.join(artifactDir, cssAsset.cssRelPath)).text();
368
- html = CsrArtifactBuilder.injectBeforeHeadEnd(html, CsrArtifactBuilder.createInlineStyle(css));
368
+ html = CsrArtifactBuilder2.injectBeforeHeadEnd(html, CsrArtifactBuilder2.createInlineStyle(css));
369
369
  } else
370
370
  this.#app.logger.warn(`[mcp-app-build] no compiled stylesheet for ${view.name}; its view ships without CSS`);
371
371
  const scripts = [];
372
- html = await CsrArtifactBuilder.replaceModuleScriptSrc(html, async (src) => {
373
- const jsPath = CsrArtifactBuilder.resolveHtmlAssetPath(htmlPath, src);
372
+ html = await CsrArtifactBuilder2.replaceModuleScriptSrc(html, async (src) => {
373
+ const jsPath = CsrArtifactBuilder2.resolveHtmlAssetPath(htmlPath, src);
374
374
  scripts.push(jsPath);
375
375
  return await Bun.file(jsPath).text();
376
376
  });
@@ -383,7 +383,7 @@ ${importsOf(view.rootOverrides, "rootOverride")}${importsOf(view.overrides, "ove
383
383
  }
384
384
 
385
385
  // pkgs/@akanjs/devkit/frontendBuild/csrArtifactBuilder.ts
386
- class CsrArtifactBuilder {
386
+ class CsrArtifactBuilder2 {
387
387
  #app;
388
388
  #command;
389
389
  #lang;
@@ -409,13 +409,13 @@ class CsrArtifactBuilder {
409
409
  await mkdir2(this.#generatedDir, { recursive: true });
410
410
  const generatedFiles = Object.fromEntries((await Promise.all(htmlBasePaths.map(async (basePath) => [
411
411
  this.#createHtmlFile(basePath),
412
- await this.#createEntryFile(basePath, CsrArtifactBuilder.pageEntriesForBasePath(pageEntries, basePath, basePaths))
412
+ await this.#createEntryFile(basePath, CsrArtifactBuilder2.pageEntriesForBasePath(pageEntries, basePath, basePaths))
413
413
  ]))).flat());
414
- const options = CsrArtifactBuilder.bundleOptions(this.#app, this.#command, akanConfig.optimizeImports);
414
+ const options = CsrArtifactBuilder2.bundleOptions(this.#app, this.#command, akanConfig.optimizeImports);
415
415
  const result = await Bun.build({
416
416
  ...options,
417
- plugins: [...options.plugins, await CsrArtifactBuilder.barrelImportsPlugin(this.#app)],
418
- entrypoints: htmlBasePaths.map((basePath) => this.#generatedPath(CsrArtifactBuilder.htmlFilename(basePath))),
417
+ plugins: [...options.plugins, await CsrArtifactBuilder2.barrelImportsPlugin(this.#app)],
418
+ entrypoints: htmlBasePaths.map((basePath) => this.#generatedPath(CsrArtifactBuilder2.htmlFilename(basePath))),
419
419
  files: generatedFiles,
420
420
  root: this.#generatedDir,
421
421
  outdir: this.#outputDir
@@ -429,7 +429,7 @@ ${logs}` : ""}`);
429
429
  await this.#inlineCsrArtifacts(cssAssets);
430
430
  await this.#buildMcpAppViews(pageEntries, { basePaths, cssAssets, options });
431
431
  if (this.#command === "build")
432
- await CsrArtifactBuilder.writePublicEnv(this.#app, options.define);
432
+ await CsrArtifactBuilder2.writePublicEnv(this.#app, options.define);
433
433
  this.#app.verbose(`[csr-build] output -> ${this.#outputDir}`);
434
434
  return { outputDir: this.#outputDir };
435
435
  }
@@ -442,7 +442,7 @@ ${logs}` : ""}`);
442
442
  return await this.#buildMcpAppViews(pageEntries, {
443
443
  basePaths: [...akanConfig.basePaths],
444
444
  cssAssets: await this.#loadCssAssets(),
445
- options: CsrArtifactBuilder.bundleOptions(this.#app, this.#command, akanConfig.optimizeImports)
445
+ options: CsrArtifactBuilder2.bundleOptions(this.#app, this.#command, akanConfig.optimizeImports)
446
446
  });
447
447
  }
448
448
  async#buildMcpAppViews(pageEntries, option) {
@@ -472,7 +472,7 @@ ${logs}` : ""}`);
472
472
  static async writePublicEnv(app, define) {
473
473
  const prefix = "process.env.";
474
474
  const publicEnv = Object.fromEntries(Object.entries(define).filter(([key]) => key.startsWith(`${prefix}AKAN_PUBLIC_`)).map(([key, value]) => [key.slice(prefix.length), JSON.parse(value)]));
475
- await Bun.write(CsrArtifactBuilder.publicEnvPath(app), `${JSON.stringify(publicEnv, null, 2)}
475
+ await Bun.write(CsrArtifactBuilder2.publicEnvPath(app), `${JSON.stringify(publicEnv, null, 2)}
476
476
  `);
477
477
  }
478
478
  static pageEntriesForBasePath(pageEntries, basePath, basePaths) {
@@ -502,7 +502,7 @@ ${logs}` : ""}`);
502
502
  }
503
503
  async#createEntryFile(basePath, pageEntries) {
504
504
  return [
505
- this.#generatedPath(CsrArtifactBuilder.entryFilename(basePath)),
505
+ this.#generatedPath(CsrArtifactBuilder2.entryFilename(basePath)),
506
506
  `import { bootCsr } from "akanjs/webkit";
507
507
  ${await PagesEntrySourceGenerator.generateStatic(pageEntries)}
508
508
  void bootCsr(pages);
@@ -511,7 +511,7 @@ void bootCsr(pages);
511
511
  }
512
512
  #createHtmlFile(basePath) {
513
513
  return [
514
- this.#generatedPath(CsrArtifactBuilder.htmlFilename(basePath)),
514
+ this.#generatedPath(CsrArtifactBuilder2.htmlFilename(basePath)),
515
515
  `<!doctype html>
516
516
  <html lang="${this.#lang}">
517
517
  <head>
@@ -522,7 +522,7 @@ void bootCsr(pages);
522
522
  </head>
523
523
  <body>
524
524
  <div id="root"></div>
525
- <script type="module" src="./${CsrArtifactBuilder.entryFilename(basePath)}"></script>
525
+ <script type="module" src="./${CsrArtifactBuilder2.entryFilename(basePath)}"></script>
526
526
  </body>
527
527
  </html>
528
528
  `
@@ -543,7 +543,7 @@ void bootCsr(pages);
543
543
  const htmlFile = Bun.file(htmlPath);
544
544
  if (!await htmlFile.exists())
545
545
  continue;
546
- const basePath = CsrArtifactBuilder.basePathOfHtml(htmlPath);
546
+ const basePath = CsrArtifactBuilder2.basePathOfHtml(htmlPath);
547
547
  const cssAsset = cssAssets[basePath];
548
548
  if (!cssAsset) {
549
549
  this.#app.logger.warn(`[csr-build] base-artifact.json has no compiled stylesheet for ${basePath || "root"}; ${path4.basename(htmlPath)} ships without CSS`);
@@ -568,11 +568,11 @@ ${remainingAssets.join(`
568
568
  let next = html;
569
569
  if (cssAsset) {
570
570
  const css = await Bun.file(path4.join(this.#artifactDir, cssAsset.cssRelPath)).text();
571
- next = CsrArtifactBuilder.injectBeforeHeadEnd(next, CsrArtifactBuilder.createInlineStyle(css));
571
+ next = CsrArtifactBuilder2.injectBeforeHeadEnd(next, CsrArtifactBuilder2.createInlineStyle(css));
572
572
  }
573
573
  const jsFiles = [];
574
- next = await CsrArtifactBuilder.replaceModuleScriptSrc(next, async (src) => {
575
- const jsPath = CsrArtifactBuilder.resolveHtmlAssetPath(htmlPath, src);
574
+ next = await CsrArtifactBuilder2.replaceModuleScriptSrc(next, async (src) => {
575
+ const jsPath = CsrArtifactBuilder2.resolveHtmlAssetPath(htmlPath, src);
576
576
  jsFiles.push(jsPath);
577
577
  return await Bun.file(jsPath).text();
578
578
  });
@@ -588,7 +588,7 @@ ${remainingAssets.join(`
588
588
  return files.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
589
589
  }
590
590
  static injectBeforeHeadEnd(html, snippet) {
591
- const scannable = CsrArtifactBuilder.blankEmbeddedContent(html);
591
+ const scannable = CsrArtifactBuilder2.blankEmbeddedContent(html);
592
592
  const headEnd = scannable.search(/<\/head\s*>/i);
593
593
  if (headEnd !== -1)
594
594
  return `${html.slice(0, headEnd)}${snippet}
@@ -621,7 +621,7 @@ ${css.replace(/<\/style/gi, "<\\/style")}
621
621
  matched = true;
622
622
  result += html.slice(lastIndex, match.index);
623
623
  result += `<script type="module">
624
- ${CsrArtifactBuilder.escapeInlineScript(await loadScript(src))}
624
+ ${CsrArtifactBuilder2.escapeInlineScript(await loadScript(src))}
625
625
  </script>`;
626
626
  lastIndex = match.index + full.length;
627
627
  }
@@ -641,4 +641,4 @@ ${CsrArtifactBuilder.escapeInlineScript(await loadScript(src))}
641
641
  }
642
642
  }
643
643
 
644
- export { CsrArtifactBuilder };
644
+ export { CsrArtifactBuilder2 };
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  FrameworkMapBuilder,
4
4
  FrameworkMapDoc
5
- } from "./index-9p260r4e.js";
5
+ } from "./index-trffs83s.js";
6
6
 
7
- // pkgs/@akanjs/devkit/frameworkGraph.ts
7
+ // pkgs/@akanjs/devkit/docs/frameworkGraph.ts
8
8
  import { readdir, readFile, realpath, stat } from "fs/promises";
9
9
  import path from "path";
10
10
  import ts from "typescript";
@@ -21,23 +21,23 @@ var channelSpecs = [
21
21
  ];
22
22
  var skippedDirs = new Set(["node_modules", "vendor", "types", "integration", "csrE2e", "platformTest"]);
23
23
 
24
- class FrameworkGraph {
24
+ class FrameworkGraph2 {
25
25
  static architectureFile = "pkgs/akanjs/ARCHITECTURE.md";
26
26
  static #cache = new Map;
27
27
  static #edits = new Map;
28
28
  static async packagesOf(workspaceRoot) {
29
29
  const found = await Promise.all(packageSpecs.map(async ({ name, split }) => {
30
- const root = await FrameworkGraph.#isDir(path.join(workspaceRoot, "pkgs", name)) ? `pkgs/${name}` : await FrameworkGraph.#installedRoot(workspaceRoot, name);
30
+ const root = await FrameworkGraph2.#isDir(path.join(workspaceRoot, "pkgs", name)) ? `pkgs/${name}` : await FrameworkGraph2.#installedRoot(workspaceRoot, name);
31
31
  return root ? [{ name, root, split }] : [];
32
32
  }));
33
33
  return found.flat();
34
34
  }
35
35
  static async build(workspaceRoot) {
36
- const packages = await FrameworkGraph.packagesOf(workspaceRoot);
36
+ const packages = await FrameworkGraph2.packagesOf(workspaceRoot);
37
37
  const akanjs = packages.find(({ name }) => name === "akanjs");
38
38
  if (!akanjs)
39
39
  return null;
40
- const files = (await Promise.all(packages.map(({ root }) => FrameworkGraph.#filesUnder(workspaceRoot, root)))).flat();
40
+ const files = (await Promise.all(packages.map(({ root }) => FrameworkGraph2.#filesUnder(workspaceRoot, root)))).flat();
41
41
  const texts = await Promise.all(files.map(async (file) => [file, await readFile(path.join(workspaceRoot, file), "utf8")]));
42
42
  return new FrameworkMapBuilder({
43
43
  ts,
@@ -47,13 +47,13 @@ class FrameworkGraph {
47
47
  }).build();
48
48
  }
49
49
  static async architecture(workspaceRoot) {
50
- const file = path.join(workspaceRoot, FrameworkGraph.architectureFile);
50
+ const file = path.join(workspaceRoot, FrameworkGraph2.architectureFile);
51
51
  const current = await readFile(file, "utf8").then((text) => text.replace(/\r\n/g, `
52
52
  `)).catch(() => null);
53
- const map = current === null ? null : await FrameworkGraph.build(workspaceRoot);
53
+ const map = current === null ? null : await FrameworkGraph2.build(workspaceRoot);
54
54
  if (current === null || !map || map.packages.find(({ name }) => name === "akanjs")?.root !== "pkgs/akanjs")
55
55
  return null;
56
- const next = FrameworkMapDoc.splice(current, FrameworkMapDoc.render(map, path.posix.dirname(FrameworkGraph.architectureFile)));
56
+ const next = FrameworkMapDoc.splice(current, FrameworkMapDoc.render(map, path.posix.dirname(FrameworkGraph2.architectureFile)));
57
57
  return {
58
58
  file,
59
59
  current,
@@ -65,31 +65,31 @@ class FrameworkGraph {
65
65
  static touched(workspaceRoot, files) {
66
66
  const roots = packageSpecs.map(({ name }) => path.join(workspaceRoot, "pkgs", name) + path.sep);
67
67
  if (files.some((file) => roots.some((root) => path.resolve(workspaceRoot, file).startsWith(root))))
68
- FrameworkGraph.#edits.set(workspaceRoot, (FrameworkGraph.#edits.get(workspaceRoot) ?? 0) + 1);
68
+ FrameworkGraph2.#edits.set(workspaceRoot, (FrameworkGraph2.#edits.get(workspaceRoot) ?? 0) + 1);
69
69
  }
70
70
  static async cached(workspaceRoot) {
71
- const packages = await FrameworkGraph.packagesOf(workspaceRoot);
72
- const stamps = await Promise.all(packages.map(async ({ name, root }) => root.startsWith("pkgs/") ? `${name}#${FrameworkGraph.#edits.get(workspaceRoot) ?? 0}` : `${name}@${await FrameworkGraph.#versionOf(path.join(workspaceRoot, root))}`));
71
+ const packages = await FrameworkGraph2.packagesOf(workspaceRoot);
72
+ const stamps = await Promise.all(packages.map(async ({ name, root }) => root.startsWith("pkgs/") ? `${name}#${FrameworkGraph2.#edits.get(workspaceRoot) ?? 0}` : `${name}@${await FrameworkGraph2.#versionOf(path.join(workspaceRoot, root))}`));
73
73
  const cacheKey = [workspaceRoot, ...stamps].join(`
74
74
  `);
75
- const existing = FrameworkGraph.#cache.get(cacheKey);
75
+ const existing = FrameworkGraph2.#cache.get(cacheKey);
76
76
  if (existing)
77
77
  return await existing;
78
- const built = FrameworkGraph.build(workspaceRoot);
79
- built.catch(() => FrameworkGraph.#cache.delete(cacheKey));
80
- FrameworkGraph.#cache.clear();
81
- FrameworkGraph.#cache.set(cacheKey, built);
78
+ const built = FrameworkGraph2.build(workspaceRoot);
79
+ built.catch(() => FrameworkGraph2.#cache.delete(cacheKey));
80
+ FrameworkGraph2.#cache.clear();
81
+ FrameworkGraph2.#cache.set(cacheKey, built);
82
82
  return await built;
83
83
  }
84
84
  static async#installedRoot(workspaceRoot, name) {
85
- if (!await FrameworkGraph.#isDir(path.join(workspaceRoot, "node_modules")))
85
+ if (!await FrameworkGraph2.#isDir(path.join(workspaceRoot, "node_modules")))
86
86
  return null;
87
87
  const resolved = await (async () => {
88
88
  try {
89
89
  return path.dirname(await realpath(Bun.resolveSync(`${name}/package.json`, workspaceRoot)));
90
90
  } catch {
91
91
  const dir = path.join(workspaceRoot, "node_modules", name);
92
- return await FrameworkGraph.#isDir(dir) ? await realpath(dir) : null;
92
+ return await FrameworkGraph2.#isDir(dir) ? await realpath(dir) : null;
93
93
  }
94
94
  })();
95
95
  if (!resolved)
@@ -123,4 +123,4 @@ class FrameworkGraph {
123
123
  }
124
124
  }
125
125
 
126
- export { FrameworkGraph };
126
+ export { FrameworkGraph2 };
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  FileSys2
4
- } from "./index-bns3wcpc.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-43f4h4cm.js";
12
+ } from "./index-ymgsvhc5.js";
13
13
  import {
14
14
  ExitCodeError
15
- } from "./index-exn38bzx.js";
15
+ } from "./index-652f3bs8.js";
16
16
  import {
17
17
  ConfigLock
18
18
  } from "./index-bqbf654f.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  GlobalConfig,
4
4
  CloudApi
5
- } from "./index-rfzp4pqs.js";
5
+ } from "./index-45aprybg.js";
6
6
 
7
7
  // pkgs/@akanjs/cli/tunnel/TunnelShare.ts
8
8
  import { TunnelAgent } from "akanjs/server/tunnel";