@akanjs/cli 3.1.0-rc.1 → 3.1.0-rc.10

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 (98) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-kyprmy06.js → CodeAgent-rkjyxgec.js} +2 -2
  3. package/{CodeTui-21mtze3j.js → CodeTui-h7pyj6xa.js} +1 -1
  4. package/TunnelShare-661cxz5e.js +14 -0
  5. package/{agent.command-f3gsc1gd.js → agent.command-3qxf4xcj.js} +5 -5
  6. package/akanCode.js +2 -2
  7. package/{application.command-5s780vnz.js → application.command-m1kcd7jf.js} +54 -42
  8. package/{applicationBuildRunner-1yaqsrdq.js → applicationBuildRunner-dj0xkrep.js} +26 -33
  9. package/buildBatch.proc.js +24 -15
  10. package/{cloud.command-yj6xb2a7.js → cloud.command-9cp1t0f5.js} +60 -67
  11. package/cloud.script-dgstqt1m.js +24 -0
  12. package/{code.command-3wkn4ja5.js → code.command-0ad6gw2a.js} +6 -6
  13. package/{context.command-9jjn3gcw.js → context.command-0qx447mb.js} +17 -13
  14. package/context.runner-1vsjztjg.js +25 -0
  15. package/{dependencyScanner-06z2dmrr.js → dependencyScanner-3afj2vt1.js} +1 -1
  16. package/{guideline.command-dtczrqpf.js → guideline.command-cv5bmrx2.js} +2 -2
  17. package/guidelines/agentRule/agentRule.instruction.md +3 -3
  18. package/guidelines/conventions/conventions.instruction.md +457 -1071
  19. package/guidelines/cssRule/cssRule.instruction.md +28 -7
  20. package/guidelines/fieldRule/fieldRule.instruction.md +62 -0
  21. package/guidelines/framework/framework.instruction.md +4 -7
  22. package/guidelines/mcpRule/mcpRule.instruction.md +43 -20
  23. package/guidelines/modelConstant/modelConstant.instruction.md +2 -1
  24. package/guidelines/modelStore/modelStore.instruction.md +9 -0
  25. package/guidelines/pageRule/pageRule.instruction.md +80 -0
  26. package/guidelines/queryRule/queryRule.instruction.md +44 -11
  27. package/guidelines/runtimeRule/runtimeRule.instruction.md +113 -17
  28. package/guidelines/ssrRule/ssrRule.instruction.md +13 -0
  29. package/guidelines/transportRule/transportRule.instruction.md +135 -13
  30. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +4 -4
  31. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +68 -7
  32. package/incrementalBuilder.proc.js +10 -7
  33. package/index-192ha4xh.js +1173 -0
  34. package/{index-c76k723e.js → index-1p98exm2.js} +2 -2
  35. package/{index-rwq3ekqc.js → index-1xj2t7cb.js} +7 -7
  36. package/{index-rtct7d43.js → index-20bxxyvn.js} +80 -80
  37. package/{index-qt22xstj.js → index-35hc95h5.js} +5 -3
  38. package/{index-8r4d7cmt.js → index-4mhy6qme.js} +4 -4
  39. package/{index-ww9bhp67.js → index-4pf8g7ff.js} +1 -1
  40. package/{index-2mx692qq.js → index-5edzv8fn.js} +5 -5
  41. package/{index-k9rrten6.js → index-5nd1wtkv.js} +92 -94
  42. package/index-62md4dwy.js +260 -0
  43. package/index-665zp9rs.js +271 -0
  44. package/{index-2etcv0sc.js → index-86jt2a0e.js} +1 -1
  45. package/{index-krq7btbt.js → index-8fp3b47h.js} +419 -418
  46. package/{index-c2yrsxdh.js → index-9z426msb.js} +109 -328
  47. package/{index-ctanya41.js → index-awbdfcf2.js} +4 -4
  48. package/{index-3hx1z96c.js → index-bqbf654f.js} +1 -1
  49. package/{index-rc5rwyps.js → index-bspm21y1.js} +71 -60
  50. package/index-cpb3nvma.js +667 -0
  51. package/{index-jx4bzvwg.js → index-d47ypebv.js} +97 -55
  52. package/{index-ae5pwhgs.js → index-d72hfmdm.js} +15 -13
  53. package/{index-e0cvze1s.js → index-fmzcs8v6.js} +4 -4
  54. package/{index-8ggztp8k.js → index-fyq1z6kt.js} +68 -201
  55. package/{index-1w2qaee2.js → index-g1mbppa9.js} +331 -259
  56. package/{index-gnyf1fqy.js → index-j237xtew.js} +6 -6
  57. package/{index-fm46xrf1.js → index-j4mkhz93.js} +3 -3
  58. package/{index-6jjtnhkw.js → index-jw1zm273.js} +74 -34
  59. package/{index-q958tqqg.js → index-m9jj544v.js} +1 -1
  60. package/index-mdjc93e1.js +33 -0
  61. package/{index-c1x0be5j.js → index-pydbnfez.js} +2 -2
  62. package/{index-56d2g8ms.js → index-qwa5k1j8.js} +1 -1
  63. package/{index-v29746vb.js → index-tamvyvj3.js} +3 -3
  64. package/{index-05g3jayg.js → index-trpasv9q.js} +260 -259
  65. package/{index-2ahj896a.js → index-tvehn2sp.js} +1 -1
  66. package/{index-55mynnqs.js → index-va06nr10.js} +1434 -1173
  67. package/index-vk0pa0mn.js +240 -0
  68. package/{index-aprt7pkz.js → index-w44cy4vs.js} +2271 -3369
  69. package/index.js +22 -22
  70. package/{library.command-gaga5bmq.js → library.command-erp2f56n.js} +3 -3
  71. package/{localRegistry.command-vsreyy42.js → localRegistry.command-y176p558.js} +15 -11
  72. package/{module.command-7vpf6db4.js → module.command-gs2r615e.js} +5 -5
  73. package/{package.command-twmvvf69.js → package.command-j10r76ax.js} +4 -4
  74. package/package.json +21 -21
  75. package/{page.command-5asq7fdf.js → page.command-4h4a8pnh.js} +3 -3
  76. package/{pipeline.command-d0v38572.js → pipeline.command-a2nrk26m.js} +221 -220
  77. package/{primitive.command-dyrs2fm8.js → primitive.command-w6t0asqz.js} +6 -6
  78. package/{projectTypecheck-cvtkrzp2.js → projectTypecheck-f534enqj.js} +1 -1
  79. package/{quality.command-6emsqpbg.js → quality.command-77x7vbbx.js} +4 -4
  80. package/{repair.command-8t6aegv5.js → repair.command-y6sstev7.js} +5 -5
  81. package/{scalar.command-bnggy1x7.js → scalar.command-20b8cy0k.js} +4 -4
  82. package/{subspace.command-md2teygq.js → subspace.command-5c7yasd7.js} +424 -364
  83. package/templates/appSample/lib/task/Task.Util.tsx +7 -7
  84. package/templates/appSample/lib/task/Task.Zone.tsx +1 -1
  85. package/templates/appSample/ui/QuantityControl.tsx +2 -2
  86. package/templates/crudSinglePage/page.tsx +1 -1
  87. package/templates/lib/cnst.ts +0 -1
  88. package/templates/workspaceRoot/.gitignore.template +23 -52
  89. package/templates/workspaceRoot/biome.json.template +1 -1
  90. package/{tunnel.command-jx3tdm2d.js → tunnel.command-2kw8vt9g.js} +8 -4
  91. package/{workflow.command-jx0wag5r.js → workflow.command-2djwmpqf.js} +10 -10
  92. package/{workspace.command-yxd7rr7g.js → workspace.command-6qfgq4b4.js} +38 -34
  93. package/TunnelShare-q4jq08qg.js +0 -9
  94. package/cloud.script-h6pvcpa2.js +0 -20
  95. package/context.runner-atcrzz5b.js +0 -21
  96. package/index-6w0rbr9d.js +0 -68
  97. package/index-n68jx79w.js +0 -120
  98. package/index-pgj2rt78.js +0 -404
@@ -35,43 +35,48 @@ import {
35
35
  filesChangedSince,
36
36
  HmrWatcher,
37
37
  WatchRootResolver
38
- } from "./index-k9rrten6.js";
38
+ } from "./index-5nd1wtkv.js";
39
39
  import {
40
40
  runner,
41
- script
42
- } from "./index-6jjtnhkw.js";
41
+ script,
42
+ assertPromptable
43
+ } from "./index-jw1zm273.js";
43
44
  import {
44
45
  WorkspaceExecutor,
45
46
  AppExecutor,
46
47
  LibExecutor,
47
48
  PkgExecutor
48
- } from "./index-55mynnqs.js";
49
+ } from "./index-va06nr10.js";
49
50
  import {
50
51
  DesktopServerStage,
51
- NativeApp,
52
52
  UpdateUploader
53
- } from "./index-1w2qaee2.js";
53
+ } from "./index-vk0pa0mn.js";
54
+ import {
55
+ resolveMobileTargets,
56
+ resolveAppId
57
+ } from "./index-m9jj544v.js";
58
+ import {
59
+ NativePublicEnv,
60
+ UpdatePackFolder,
61
+ NativeApp
62
+ } from "./index-g1mbppa9.js";
54
63
  import {
55
64
  LibraryScript
56
- } from "./index-c1x0be5j.js";
65
+ } from "./index-pydbnfez.js";
57
66
  import {
58
67
  stripAnsi
59
68
  } from "./index-7md2g9vw.js";
60
69
  import {
61
70
  SlicePlanner,
62
71
  formatSlicePlan
63
- } from "./index-qt22xstj.js";
64
- import {
65
- resolveMobileTargets,
66
- resolveAppId
67
- } from "./index-q958tqqg.js";
72
+ } from "./index-35hc95h5.js";
68
73
  import {
69
74
  openBrowser
70
75
  } from "./index-9dp031by.js";
71
76
 
72
77
  // pkgs/@akanjs/cli/application/application.script.ts
73
78
  import { confirm } from "@inquirer/prompts";
74
- import { Logger as Logger6 } from "akanjs/common";
79
+ import { Logger as Logger6, toError as toError2 } from "akanjs/common";
75
80
 
76
81
  // pkgs/@akanjs/cli/application/application.runner.ts
77
82
  import { realpathSync } from "fs";
@@ -191,7 +196,9 @@ var closeBunSocket = (socket, error) => {
191
196
 
192
197
  // pkgs/@akanjs/devkit/createTunnel.ts
193
198
  var createTunnel = async (service, { app, environment, port = service === "postgres" ? 5432 : 6379 }) => {
194
- const { serveDomain, repoName } = WorkspaceExecutor.getBaseDevEnv();
199
+ const baseDevEnv = WorkspaceExecutor.getBaseDevEnv();
200
+ WorkspaceExecutor.assertDeployableEnv(baseDevEnv, environment, `The ${service} tunnel`);
201
+ const { serveDomain, repoName } = baseDevEnv;
195
202
  const host = `${app.name}-${environment}.${serveDomain}`;
196
203
  const sshPort = process.env.SSH_TUNNEL_PORT ? parseInt(process.env.SSH_TUNNEL_PORT) : 32767;
197
204
  const dstHost = `${service}-0.${service}-svc.${app.name}-${environment}.svc.cluster.local`;
@@ -1888,8 +1895,8 @@ ${uniqueCandidates.map((candidate) => ` - ${candidate}`).join(`
1888
1895
  }
1889
1896
 
1890
1897
  // pkgs/@akanjs/cli/application/application.runner.ts
1891
- import { Logger as Logger3 } from "akanjs/common";
1892
- var loadBuildRunner = async () => (await import("./applicationBuildRunner-1yaqsrdq.js")).ApplicationBuildRunner;
1898
+ import { Logger as Logger3, toError } from "akanjs/common";
1899
+ var loadBuildRunner = async () => (await import("./applicationBuildRunner-dj0xkrep.js")).ApplicationBuildRunner;
1893
1900
  var loadPrompts = async () => await import("@inquirer/prompts");
1894
1901
 
1895
1902
  class ApplicationRunner extends runner("application") {
@@ -1914,6 +1921,9 @@ class ApplicationRunner extends runner("application") {
1914
1921
  throw new Error(`No script files found. make a script file in apps/${app.name}/script folder`);
1915
1922
  }
1916
1923
  const scriptFiles = (await app.readdir("script")).filter((file) => file.endsWith(".ts"));
1924
+ assertPromptable("Missing argument 'filename'", {
1925
+ choices: scriptFiles.map((file) => file.replace(".ts", ""))
1926
+ });
1917
1927
  const scriptFile = await (await loadPrompts()).select({
1918
1928
  message: "Select script to run",
1919
1929
  choices: scriptFiles.map((file) => ({ name: file, value: file.replace(".ts", "") }))
@@ -2047,7 +2057,7 @@ try {
2047
2057
  await new (await loadBuildRunner())(app).typecheck(options);
2048
2058
  }
2049
2059
  async typecheckLibrary(lib, options = {}) {
2050
- const { ProjectTypecheck } = await import("./projectTypecheck-cvtkrzp2.js");
2060
+ const { ProjectTypecheck } = await import("./projectTypecheck-f534enqj.js");
2051
2061
  const root = lib.workspace.workspaceRoot;
2052
2062
  await new ProjectTypecheck(lib.cwdPath, root, { ...process.env, AKAN_WORKSPACE_ROOT: root }).run([
2053
2063
  "../../server.ts",
@@ -2078,9 +2088,9 @@ try {
2078
2088
  fast = false,
2079
2089
  reporter,
2080
2090
  spinner = false,
2081
- profile
2091
+ envProfile
2082
2092
  } = {}) {
2083
- return new (await loadBuildRunner())(app, { fast, reporter, profile }).build({ spinner });
2093
+ return new (await loadBuildRunner())(app, { fast, reporter, profile: envProfile }).build({ spinner });
2084
2094
  }
2085
2095
  async start(app, {
2086
2096
  open = false,
@@ -2189,44 +2199,46 @@ try {
2189
2199
  };
2190
2200
  return canonical(reported) === canonical(own);
2191
2201
  }
2192
- async releaseIos(app, { target, env = "main", teamId, adHoc = false } = {}) {
2202
+ async releaseIos(app, { target, env = "main", teamId, adHoc = false, publicEnv } = {}) {
2193
2203
  const targets = await resolveMobileTargets(app, target);
2194
- await this.#buildMobileCsr(app, env);
2204
+ await this.#buildMobileCsr(app, env, undefined, publicEnv ? await NativePublicEnv.load(publicEnv) : null);
2195
2205
  for (const mobileTarget of targets)
2196
2206
  this.#reportBuild(app, mobileTarget, await new NativeApp(app, mobileTarget, env).releaseIos({ teamId, adHoc }));
2197
2207
  }
2198
- async releaseAndroid(app, format, { target, env = "main" } = {}) {
2208
+ async releaseAndroid(app, format, { target, env = "main", publicEnv } = {}) {
2199
2209
  const targets = await resolveMobileTargets(app, target);
2200
2210
  NativeApp.androidSigning();
2201
- await this.#buildMobileCsr(app, env);
2211
+ await this.#buildMobileCsr(app, env, undefined, publicEnv ? await NativePublicEnv.load(publicEnv) : null);
2202
2212
  for (const mobileTarget of targets)
2203
2213
  this.#reportBuild(app, mobileTarget, await new NativeApp(app, mobileTarget, env).releaseAndroid({ formats: [format] }));
2204
2214
  }
2205
- async packUpdate(app, platform, { target, env = "main", out, against }) {
2215
+ async packUpdate(app, platform, { target, env = "main", out, against, publicEnv }) {
2206
2216
  const targets = await resolveMobileTargets(app, target);
2207
2217
  const [mobileTarget] = targets;
2208
2218
  if (!mobileTarget || targets.length > 1)
2209
2219
  throw new Error("pack-update packs one native target at a time; pass --target <name>.");
2210
- await this.#buildMobileCsr(app, env);
2211
- const { pack } = await new NativeApp(app, mobileTarget, env).packUpdate(platform, { out });
2220
+ const nativeApp = new NativeApp(app, mobileTarget, env);
2221
+ await UpdatePackFolder.clear(path5.resolve(out ?? path5.join(nativeApp.updatesDir, platform)));
2222
+ const pinned = publicEnv ? await NativePublicEnv.load(publicEnv) : against ? await NativePublicEnv.recordedIn(against) : null;
2223
+ await this.#buildMobileCsr(app, env, undefined, pinned);
2224
+ const { pack } = await nativeApp.packUpdate(platform, { out });
2212
2225
  app.logger.info(`packed ${mobileTarget.name} ${platform} for channel '${pack.channel}' to ${pack.out}: ${pack.files} files, ${(pack.size / 1024).toFixed(0)} KiB, native API ${pack.nativeApi}`);
2213
2226
  if (against) {
2214
- const compat = await NativeApp.compareBundles(app.cwdPath, against, path5.join(pack.out, "bundle.json"));
2215
- pack.compat = { against, ...compat };
2216
- await Bun.write(path5.join(pack.out, "compat.json"), `${JSON.stringify(pack.compat, null, 2)}
2217
- `);
2227
+ const bundle = path5.join(pack.out, UpdatePackFolder.bundleFile);
2228
+ const compat = await NativeApp.compareBundles(app.cwdPath, against, bundle);
2229
+ const envProblem = await NativePublicEnv.problemAgainst(against, bundle);
2230
+ await UpdatePackFolder.writeCompat(pack, {
2231
+ against,
2232
+ compatible: compat.compatible && !envProblem,
2233
+ problems: [...compat.problems, ...envProblem ? [envProblem] : []]
2234
+ });
2218
2235
  }
2219
- await NativeApp.writePack(pack);
2220
- if (!pack.compat)
2221
- return pack;
2222
- if (pack.compat.compatible) {
2236
+ await UpdatePackFolder.write(pack);
2237
+ const verdict = UpdatePackFolder.storeBuildVerdict(pack);
2238
+ if (verdict)
2239
+ throw verdict;
2240
+ if (pack.compat)
2223
2241
  app.logger.info(`runs in the store build of ${against}`);
2224
- return pack;
2225
- }
2226
- app.logger.error(`This bundle needs a new store build; it differs from the one ${against} came from:
2227
- - ${pack.compat.problems.join(`
2228
- - `)}`);
2229
- process.exitCode = 2;
2230
2242
  return pack;
2231
2243
  }
2232
2244
  async updateKeygen(app, platform, target) {
@@ -2237,16 +2249,27 @@ try {
2237
2249
  if (seen.has(appId))
2238
2250
  continue;
2239
2251
  seen.add(appId);
2240
- const { publicKey, keyPath, created } = await new NativeApp(app, mobileTarget).updateKeygen(nativePlatform);
2252
+ const { publicKey, keyId, keyPath, created } = await new NativeApp(app, mobileTarget).updateKeygen(nativePlatform);
2241
2253
  app.log(`${appId}: ${created ? "made" : "read"} ${keyPath}${created ? " (keep it private and backed up: without it, installed apps take no more updates)" : ""}`);
2242
2254
  app.log(` native: { updates: { url: "https://\u2026/${app.name}", publicKeys: [${JSON.stringify(publicKey)}] } }`);
2255
+ app.log(` keyId ${keyId}: what publish-update --revoke and updates.revokedKeys name this key by`);
2243
2256
  const { publicKey: one, publicKeys } = mobileTarget.config.updates ?? {};
2244
2257
  const declared = publicKeys ?? (one ? [one] : null);
2245
2258
  if (declared && !declared.includes(publicKey))
2246
2259
  app.logger.warn(`native.targets.${mobileTarget.name}.updates.publicKeys does not hold this key; releases it signs would not verify.`);
2247
2260
  }
2248
2261
  }
2249
- async publishUpdate(app, platform, { target, env = "main", channel, upload, arch, sign = false, notarize = false } = {}) {
2262
+ async publishUpdate(app, platform, {
2263
+ target,
2264
+ env = "main",
2265
+ channel,
2266
+ upload,
2267
+ arch,
2268
+ sign = false,
2269
+ notarize = false,
2270
+ revoke,
2271
+ resetSequence
2272
+ } = {}) {
2250
2273
  if (arch && platform !== "desktop")
2251
2274
  throw new Error(`--arch picks a desktop release's CPU; ${platform} publishes its web bundle.`);
2252
2275
  const targets = await resolveMobileTargets(app, target);
@@ -2260,7 +2283,9 @@ try {
2260
2283
  await new NativeApp(app, mobileTarget, env).assertPublishable(nativePlatform, {
2261
2284
  server: ApplicationRunner.carriesServer(mobileTarget, nativePlatform),
2262
2285
  ...channel ? { channel } : {},
2263
- ...arch ? { arch } : {}
2286
+ ...arch ? { arch } : {},
2287
+ revoke,
2288
+ resetSequence
2264
2289
  });
2265
2290
  const carried = await this.#stageMobile(app, nativePlatform, targets, env, arch);
2266
2291
  for (const mobileTarget of targets) {
@@ -2270,15 +2295,17 @@ try {
2270
2295
  ...arch ? { arch } : {},
2271
2296
  sign,
2272
2297
  notarize,
2298
+ revoke,
2299
+ resetSequence,
2273
2300
  ...carried && ApplicationRunner.carriesServer(mobileTarget, nativePlatform) ? { server: carried } : {}
2274
2301
  });
2275
2302
  this.#reportBuild(app, mobileTarget, published.build);
2276
2303
  app.log(`${app.name}/${mobileTarget.name} ${published.bundle}: ${published.dir}/${published.channel}.json, ${published.files} files, ${Math.round(published.size / 1024)} KiB`);
2277
2304
  if (!uploader) {
2278
- app.log(`Upload ${nativeApp.updatesDir} to ${mobileTarget.config.updates?.url}, the manifests last.`);
2305
+ app.log(`Upload ${nativeApp.updatesDir} to ${mobileTarget.config.updates?.url}, the manifests last, without pack-update's records (pack.json, compat.json, manifest.template.json, bundle.json); --upload s3://\u2026 sends just this release.`);
2279
2306
  continue;
2280
2307
  }
2281
- const { uploaded, skipped } = await uploader.upload(nativeApp.updatesDir);
2308
+ const { uploaded, skipped } = await uploader.upload(nativeApp.updatesDir, published);
2282
2309
  app.log(`Uploaded ${uploaded} file(s) to ${upload}, the manifests last; ${skipped} the bucket already held. Installed apps read ${mobileTarget.config.updates?.url}.`);
2283
2310
  }
2284
2311
  }
@@ -2300,13 +2327,14 @@ try {
2300
2327
  if (typeof server !== "object")
2301
2328
  return { omit: [], modules: [] };
2302
2329
  const { omit = [], modules = [], profile, env, restart, watchdog } = server;
2330
+ const { intervalMs, failures } = typeof watchdog === "object" ? watchdog : {};
2303
2331
  return {
2304
2332
  omit,
2305
2333
  modules,
2306
2334
  ...profile ? { profile } : {},
2307
2335
  ...env ? { env } : {},
2308
2336
  ...restart !== undefined ? { restart } : {},
2309
- ...typeof watchdog === "object" ? { watchdog } : {}
2337
+ ...intervalMs && failures ? { watchdog: { intervalMs, failures } } : {}
2310
2338
  };
2311
2339
  });
2312
2340
  const [first = { omit: [], modules: [] }, ...rest] = servers;
@@ -2318,7 +2346,7 @@ try {
2318
2346
  agree("omit different packages", ({ omit }) => omit.join(", "));
2319
2347
  agree("name different env profiles", ({ profile }) => profile ?? "");
2320
2348
  agree("mount different modules", ({ modules }) => modules.join(", "));
2321
- agree("set a different env", ({ env }) => env ? JSON.stringify(env) : "");
2349
+ agree("set a different env", ({ env }) => env ? JSON.stringify(env, Object.keys(env).sort()) : "");
2322
2350
  agree("restart differently", ({ restart }) => String(restart ?? ""));
2323
2351
  agree("watch it differently", ({ watchdog }) => watchdog ? JSON.stringify(watchdog) : "");
2324
2352
  return first;
@@ -2331,7 +2359,11 @@ try {
2331
2359
  const { modules, env: serverEnv, restart, watchdog } = server;
2332
2360
  return await stage?.prepare(env, { modules, env: serverEnv, restart, watchdog });
2333
2361
  }
2334
- async#buildMobileCsr(app, env, profile) {
2362
+ async#buildMobileCsr(app, env, envProfile, publicEnv = null) {
2363
+ if (publicEnv?.AKAN_PUBLIC_ENV !== undefined && publicEnv.AKAN_PUBLIC_ENV !== env)
2364
+ throw new Error(`--env ${env} differs from the public env's AKAN_PUBLIC_ENV ${publicEnv.AKAN_PUBLIC_ENV}.`);
2365
+ if (publicEnv)
2366
+ NativePublicEnv.pin(publicEnv);
2335
2367
  const prevEnv = {
2336
2368
  AKAN_PUBLIC_ENV: process.env.AKAN_PUBLIC_ENV,
2337
2369
  AKAN_PUBLIC_OPERATION_MODE: process.env.AKAN_PUBLIC_OPERATION_MODE,
@@ -2343,7 +2375,7 @@ try {
2343
2375
  APP_OPERATION_MODE: "release"
2344
2376
  });
2345
2377
  try {
2346
- await new (await loadBuildRunner())(app, { environment: env, profile }).build({ spinner: true });
2378
+ await new (await loadBuildRunner())(app, { environment: env, profile: envProfile }).build({ spinner: true });
2347
2379
  } finally {
2348
2380
  for (const [key, value] of Object.entries(prevEnv)) {
2349
2381
  if (value === undefined)
@@ -2352,6 +2384,11 @@ try {
2352
2384
  process.env[key] = value;
2353
2385
  }
2354
2386
  }
2387
+ if (!publicEnv)
2388
+ return;
2389
+ const differs = NativePublicEnv.diff(publicEnv, await NativePublicEnv.built(app) ?? {});
2390
+ if (differs.length)
2391
+ throw new Error(`The web build inlined other values than --public-env gave for ${differs.join(", ")}.`);
2355
2392
  }
2356
2393
  async#runMobileTargets(targets, task) {
2357
2394
  const results = [];
@@ -2367,7 +2404,7 @@ try {
2367
2404
  if (failures.length === 0)
2368
2405
  return;
2369
2406
  for (const failure of failures) {
2370
- const message = failure.error instanceof Error ? failure.error.message : String(failure.error);
2407
+ const message = toError(failure.error).message;
2371
2408
  Logger3.rawLog(`Native target ${failure.target} failed: ${message}`, undefined, "error");
2372
2409
  }
2373
2410
  throw new Error(`${failures.length}/${results.length} native targets failed`);
@@ -3240,6 +3277,9 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
3240
3277
  static devServerReadyTimeoutMs = DevSupervisor.bootTimeoutMs;
3241
3278
  #interrupt = new InterruptTeardown;
3242
3279
  async confirmDatabaseModeDependencyInstall(databaseMode, installSpecs) {
3280
+ assertPromptable(`Database mode '${databaseMode}' requires missing dependencies: ${installSpecs.join(", ")}`, {
3281
+ remedy: `install them first with \`bun add ${installSpecs.join(" ")}\``
3282
+ });
3243
3283
  return await confirm({
3244
3284
  message: `Database mode '${databaseMode}' requires missing dependencies: ${installSpecs.join(", ")}. Install them now?`,
3245
3285
  default: true
@@ -3312,7 +3352,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
3312
3352
  if (!quiet)
3313
3353
  Logger6.rawLog(`Creating an optimized production build for ${app.name}...`);
3314
3354
  try {
3315
- const result = await this.applicationRunner.build(app, { fast, spinner: !quiet, profile });
3355
+ const result = await this.applicationRunner.build(app, { fast, spinner: !quiet, envProfile: profile });
3316
3356
  Logger6.rawLog(`${app.name} built in dist/apps/${app.name}`);
3317
3357
  if (!quiet)
3318
3358
  ApplicationBuildReporter.printSummary(result);
@@ -3325,10 +3365,12 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
3325
3365
  async typecheck(exec, { write = true, clean = false, incremental = true, tests = false } = {}) {
3326
3366
  if (!(exec instanceof AppExecutor) && !(exec instanceof LibExecutor))
3327
3367
  throw new Error(`akan typecheck takes an app or a library; ${exec.name} is a package, checked by its own tsconfig.`);
3328
- if (exec instanceof LibExecutor)
3368
+ if (exec instanceof AppExecutor)
3369
+ await exec.scanSync({ write });
3370
+ else if (write)
3329
3371
  await this.libraryScript.syncLibrary(exec);
3330
3372
  else
3331
- await exec.scanSync({ write });
3373
+ await exec.scan({ write: false });
3332
3374
  const spinner = exec.spinning(`Typechecking ${exec.name}${tests ? " with its tests" : ""}...`);
3333
3375
  try {
3334
3376
  if (exec instanceof LibExecutor)
@@ -3593,13 +3635,13 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
3593
3635
  await Promise.all(shares.map(async (share) => await share.close()));
3594
3636
  }, "Abandoning the tunnel release; the shares expire on their own.");
3595
3637
  await Promise.all(apps.map(async (app) => {
3596
- const { TunnelShare } = await import("./TunnelShare-q4jq08qg.js");
3638
+ const { TunnelShare } = await import("./TunnelShare-661cxz5e.js");
3597
3639
  const share = await TunnelShare.open(app, { workspace: app.workspace });
3598
3640
  shares.push(share);
3599
3641
  urls.set(app.name, share.url);
3600
3642
  Logger6.rawLog(`${app.name} is shared at ${share.url}`);
3601
3643
  })).catch((error) => {
3602
- Logger6.rawLog(`Could not open the tunnel: ${error instanceof Error ? error.message : String(error)}`, undefined, "error");
3644
+ Logger6.rawLog(`Could not open the tunnel: ${toError2(error).message}`, undefined, "error");
3603
3645
  });
3604
3646
  return urls;
3605
3647
  }
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  AppExecutor
4
- } from "./index-55mynnqs.js";
4
+ } from "./index-va06nr10.js";
5
5
  import {
6
6
  jsonText,
7
7
  createWorkflowBaselineSummary,
8
8
  buildAkanModuleContextIndex,
9
9
  toolingRolloutGate
10
- } from "./index-05g3jayg.js";
10
+ } from "./index-trpasv9q.js";
11
11
  import {
12
12
  buildResourceList,
13
13
  codexMcpConfigPath,
@@ -17,27 +17,29 @@ import {
17
17
  upsertCodexMcpServerBlock,
18
18
  renderDoctorText,
19
19
  AkanContextAnalyzer
20
- } from "./index-2mx692qq.js";
20
+ } from "./index-5edzv8fn.js";
21
21
  import {
22
22
  runner
23
- } from "./index-6jjtnhkw.js";
23
+ } from "./index-jw1zm273.js";
24
24
  import {
25
- NativeApp,
26
25
  isPlaceholderAppId
27
- } from "./index-1w2qaee2.js";
26
+ } from "./index-vk0pa0mn.js";
27
+ import {
28
+ getMobileTargets,
29
+ appIdsOf
30
+ } from "./index-m9jj544v.js";
31
+ import {
32
+ NativeApp
33
+ } from "./index-g1mbppa9.js";
28
34
  import {
29
35
  Prompter2
30
36
  } from "./index-zzvvc845.js";
31
37
  import {
32
38
  RepairRunner
33
- } from "./index-fm46xrf1.js";
39
+ } from "./index-j4mkhz93.js";
34
40
  import {
35
41
  WorkflowRunner
36
- } from "./index-rwq3ekqc.js";
37
- import {
38
- getMobileTargets,
39
- appIdsOf
40
- } from "./index-q958tqqg.js";
42
+ } from "./index-1xj2t7cb.js";
41
43
 
42
44
  // pkgs/@akanjs/devkit/akanMcpContract.ts
43
45
  import path from "path";
@@ -125,7 +127,7 @@ var inspectAkanContextInputSchema = {
125
127
  },
126
128
  required: ["question", "draft", "review", "request"]
127
129
  };
128
- var slugPart = (value) => typeof value === "string" ? value.trim().replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "").toLowerCase() : "";
130
+ var slugPart = (value) => typeof value === "string" ? value.trim().replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-|-$/g, "").toLowerCase() : "";
129
131
  var optionalString = (args, key) => {
130
132
  const value = args[key];
131
133
  return typeof value === "string" && value ? value : undefined;
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-6jjtnhkw.js";
5
+ } from "./index-jw1zm273.js";
6
6
  import {
7
7
  ModuleExecutor
8
- } from "./index-55mynnqs.js";
8
+ } from "./index-va06nr10.js";
9
9
  import {
10
10
  sourceFile,
11
11
  moduleSourcePaths,
@@ -13,10 +13,10 @@ import {
13
13
  createPassedPrimitiveReport,
14
14
  bilingualLabelForField,
15
15
  bilingualDescriptionForField
16
- } from "./index-05g3jayg.js";
16
+ } from "./index-trpasv9q.js";
17
17
  import {
18
18
  PageScript
19
- } from "./index-2etcv0sc.js";
19
+ } from "./index-86jt2a0e.js";
20
20
  import {
21
21
  pluralizeName
22
22
  } from "./index-nz8prx9g.js";