@akanjs/cli 3.1.0-rc.0 → 3.1.0-rc.2

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 (76) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-q7a4srt6.js → CodeAgent-q50k4s45.js} +2 -2
  3. package/{CodeTui-ak23dxc9.js → CodeTui-62g35ztk.js} +1 -1
  4. package/TunnelShare-f1egrktx.js +13 -0
  5. package/{agent.command-f3gsc1gd.js → agent.command-adfd5299.js} +5 -5
  6. package/akanCode.js +2 -2
  7. package/{application.command-3v2d53gd.js → application.command-hj3gv1rx.js} +52 -41
  8. package/{applicationBuildRunner-1yaqsrdq.js → applicationBuildRunner-by10r9gf.js} +16 -30
  9. package/buildBatch.proc.js +22 -13
  10. package/{cloud.command-kk2rwkvw.js → cloud.command-k2fhaape.js} +60 -63
  11. package/cloud.script-z8p5dz7e.js +23 -0
  12. package/{code.command-30sca09d.js → code.command-kt5zgcc2.js} +6 -6
  13. package/{context.command-k7eqacq6.js → context.command-8fgn42jw.js} +16 -13
  14. package/context.runner-hnh0rg7m.js +24 -0
  15. package/{guideline.command-dtczrqpf.js → guideline.command-3yxxr2mm.js} +2 -2
  16. package/guidelines/conventions/conventions.instruction.md +30 -15
  17. package/guidelines/cssRule/cssRule.instruction.md +12 -6
  18. package/guidelines/mcpRule/mcpRule.instruction.md +32 -11
  19. package/guidelines/runtimeRule/runtimeRule.instruction.md +24 -15
  20. package/guidelines/transportRule/transportRule.instruction.md +28 -5
  21. package/incrementalBuilder.proc.js +9 -6
  22. package/{index-kjvrq3nc.js → index-0909wckt.js} +361 -282
  23. package/{index-p9ystjrp.js → index-20cebtth.js} +92 -52
  24. package/{index-55mynnqs.js → index-2etqq75t.js} +455 -206
  25. package/{index-6jjtnhkw.js → index-31ce9vhg.js} +51 -9
  26. package/{index-y8q31011.js → index-3reaaa1h.js} +42 -153
  27. package/{index-ww9bhp67.js → index-4pf8g7ff.js} +1 -1
  28. package/{index-qt22xstj.js → index-58vvz603.js} +5 -3
  29. package/index-6726qr1m.js +668 -0
  30. package/index-8935h3n1.js +33 -0
  31. package/{index-nz15k0b6.js → index-8zdwpxef.js} +1 -1
  32. package/{index-c2yrsxdh.js → index-azh29dc8.js} +96 -320
  33. package/{index-c1x0be5j.js → index-bea2gwc6.js} +2 -2
  34. package/{index-v29746vb.js → index-e9prnmyt.js} +3 -3
  35. package/{index-tn4rpqp1.js → index-fjsv10hd.js} +73 -49
  36. package/index-g0vwzy9m.js +241 -0
  37. package/{index-c76k723e.js → index-h85cxfkg.js} +2 -2
  38. package/{index-rwq3ekqc.js → index-hnby7p9n.js} +7 -7
  39. package/{index-2etcv0sc.js → index-jwqtchha.js} +1 -1
  40. package/index-kc8z134d.js +248 -0
  41. package/index-nq045px5.js +1124 -0
  42. package/{index-fm46xrf1.js → index-nq2ja5e0.js} +3 -3
  43. package/{index-0bm04n5g.js → index-pyxn1b53.js} +10 -8
  44. package/{index-05g3jayg.js → index-rhbabmja.js} +1 -1
  45. package/{index-2mx692qq.js → index-rk9sdys3.js} +2 -2
  46. package/{index-7bymavqk.js → index-sby8fe1p.js} +1 -1
  47. package/{index-ctanya41.js → index-sqfdmb5b.js} +4 -4
  48. package/{index-2t4tqd1c.js → index-t7nws9mx.js} +3 -3
  49. package/{index-jyv387qw.js → index-tv8fjaba.js} +4 -4
  50. package/{index-gnyf1fqy.js → index-tz5evhdr.js} +2 -2
  51. package/{index-aprt7pkz.js → index-xpdgxsj5.js} +229 -1327
  52. package/{index-e0cvze1s.js → index-z507nzhg.js} +4 -4
  53. package/index.js +22 -22
  54. package/{library.command-gaga5bmq.js → library.command-8tw59xzj.js} +3 -3
  55. package/{localRegistry.command-9e84e32q.js → localRegistry.command-tf3dmznd.js} +12 -9
  56. package/{module.command-7vpf6db4.js → module.command-9vm8hffy.js} +5 -5
  57. package/{package.command-twmvvf69.js → package.command-erbxe2tz.js} +3 -3
  58. package/package.json +2 -2
  59. package/{page.command-5asq7fdf.js → page.command-jpavcj0p.js} +3 -3
  60. package/{pipeline.command-d0v38572.js → pipeline.command-b8rzvjvv.js} +220 -219
  61. package/{primitive.command-dyrs2fm8.js → primitive.command-sm32chzk.js} +6 -6
  62. package/{projectTypecheck-cvtkrzp2.js → projectTypecheck-jamtx95x.js} +1 -1
  63. package/{quality.command-6emsqpbg.js → quality.command-pkd17n6y.js} +2 -2
  64. package/{repair.command-8t6aegv5.js → repair.command-8y4mq6hs.js} +5 -5
  65. package/{scalar.command-bnggy1x7.js → scalar.command-q8khmyx5.js} +4 -4
  66. package/{subspace.command-f02j5tge.js → subspace.command-51n0ykbx.js} +421 -362
  67. package/templates/app/env/env.client.type.ts +2 -3
  68. package/templates/app/page/styles.css.template +8 -0
  69. package/{tunnel.command-9x8nfn75.js → tunnel.command-7820vtxq.js} +7 -4
  70. package/{workflow.command-jx0wag5r.js → workflow.command-n5sv4wqz.js} +10 -10
  71. package/{workspace.command-cmj6mqyk.js → workspace.command-zdy60jh8.js} +33 -30
  72. package/TunnelShare-21mm6dr5.js +0 -9
  73. package/cloud.script-r7eyfey4.js +0 -20
  74. package/context.runner-hqd1ppqe.js +0 -21
  75. package/index-6w0rbr9d.js +0 -68
  76. package/index-r2tpeb3n.js +0 -392
@@ -38,40 +38,45 @@ import {
38
38
  } from "./index-k9rrten6.js";
39
39
  import {
40
40
  runner,
41
- script
42
- } from "./index-6jjtnhkw.js";
41
+ script,
42
+ assertPromptable
43
+ } from "./index-31ce9vhg.js";
43
44
  import {
44
45
  WorkspaceExecutor,
45
46
  AppExecutor,
46
47
  LibExecutor,
47
48
  PkgExecutor
48
- } from "./index-55mynnqs.js";
49
+ } from "./index-2etqq75t.js";
49
50
  import {
50
51
  DesktopServerStage,
51
- NativeApp,
52
52
  UpdateUploader
53
- } from "./index-kjvrq3nc.js";
53
+ } from "./index-g0vwzy9m.js";
54
+ import {
55
+ NativePublicEnv,
56
+ UpdatePackFolder,
57
+ NativeApp
58
+ } from "./index-0909wckt.js";
54
59
  import {
55
60
  LibraryScript
56
- } from "./index-c1x0be5j.js";
61
+ } from "./index-bea2gwc6.js";
57
62
  import {
58
63
  stripAnsi
59
64
  } from "./index-7md2g9vw.js";
60
65
  import {
61
66
  SlicePlanner,
62
67
  formatSlicePlan
63
- } from "./index-qt22xstj.js";
68
+ } from "./index-58vvz603.js";
69
+ import {
70
+ openBrowser
71
+ } from "./index-9dp031by.js";
64
72
  import {
65
73
  resolveMobileTargets,
66
74
  resolveAppId
67
75
  } from "./index-q958tqqg.js";
68
- import {
69
- openBrowser
70
- } 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";
@@ -1888,8 +1893,8 @@ ${uniqueCandidates.map((candidate) => ` - ${candidate}`).join(`
1888
1893
  }
1889
1894
 
1890
1895
  // 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;
1896
+ import { Logger as Logger3, toError } from "akanjs/common";
1897
+ var loadBuildRunner = async () => (await import("./applicationBuildRunner-by10r9gf.js")).ApplicationBuildRunner;
1893
1898
  var loadPrompts = async () => await import("@inquirer/prompts");
1894
1899
 
1895
1900
  class ApplicationRunner extends runner("application") {
@@ -1914,6 +1919,9 @@ class ApplicationRunner extends runner("application") {
1914
1919
  throw new Error(`No script files found. make a script file in apps/${app.name}/script folder`);
1915
1920
  }
1916
1921
  const scriptFiles = (await app.readdir("script")).filter((file) => file.endsWith(".ts"));
1922
+ assertPromptable("Missing argument 'filename'", {
1923
+ choices: scriptFiles.map((file) => file.replace(".ts", ""))
1924
+ });
1917
1925
  const scriptFile = await (await loadPrompts()).select({
1918
1926
  message: "Select script to run",
1919
1927
  choices: scriptFiles.map((file) => ({ name: file, value: file.replace(".ts", "") }))
@@ -2047,7 +2055,7 @@ try {
2047
2055
  await new (await loadBuildRunner())(app).typecheck(options);
2048
2056
  }
2049
2057
  async typecheckLibrary(lib, options = {}) {
2050
- const { ProjectTypecheck } = await import("./projectTypecheck-cvtkrzp2.js");
2058
+ const { ProjectTypecheck } = await import("./projectTypecheck-jamtx95x.js");
2051
2059
  const root = lib.workspace.workspaceRoot;
2052
2060
  await new ProjectTypecheck(lib.cwdPath, root, { ...process.env, AKAN_WORKSPACE_ROOT: root }).run([
2053
2061
  "../../server.ts",
@@ -2078,9 +2086,9 @@ try {
2078
2086
  fast = false,
2079
2087
  reporter,
2080
2088
  spinner = false,
2081
- profile
2089
+ envProfile
2082
2090
  } = {}) {
2083
- return new (await loadBuildRunner())(app, { fast, reporter, profile }).build({ spinner });
2091
+ return new (await loadBuildRunner())(app, { fast, reporter, profile: envProfile }).build({ spinner });
2084
2092
  }
2085
2093
  async start(app, {
2086
2094
  open = false,
@@ -2189,44 +2197,46 @@ try {
2189
2197
  };
2190
2198
  return canonical(reported) === canonical(own);
2191
2199
  }
2192
- async releaseIos(app, { target, env = "main", teamId, adHoc = false } = {}) {
2200
+ async releaseIos(app, { target, env = "main", teamId, adHoc = false, publicEnv } = {}) {
2193
2201
  const targets = await resolveMobileTargets(app, target);
2194
- await this.#buildMobileCsr(app, env);
2202
+ await this.#buildMobileCsr(app, env, undefined, publicEnv ? await NativePublicEnv.load(publicEnv) : null);
2195
2203
  for (const mobileTarget of targets)
2196
2204
  this.#reportBuild(app, mobileTarget, await new NativeApp(app, mobileTarget, env).releaseIos({ teamId, adHoc }));
2197
2205
  }
2198
- async releaseAndroid(app, format, { target, env = "main" } = {}) {
2206
+ async releaseAndroid(app, format, { target, env = "main", publicEnv } = {}) {
2199
2207
  const targets = await resolveMobileTargets(app, target);
2200
2208
  NativeApp.androidSigning();
2201
- await this.#buildMobileCsr(app, env);
2209
+ await this.#buildMobileCsr(app, env, undefined, publicEnv ? await NativePublicEnv.load(publicEnv) : null);
2202
2210
  for (const mobileTarget of targets)
2203
2211
  this.#reportBuild(app, mobileTarget, await new NativeApp(app, mobileTarget, env).releaseAndroid({ formats: [format] }));
2204
2212
  }
2205
- async packUpdate(app, platform, { target, env = "main", out, against }) {
2213
+ async packUpdate(app, platform, { target, env = "main", out, against, publicEnv }) {
2206
2214
  const targets = await resolveMobileTargets(app, target);
2207
2215
  const [mobileTarget] = targets;
2208
2216
  if (!mobileTarget || targets.length > 1)
2209
2217
  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 });
2218
+ const nativeApp = new NativeApp(app, mobileTarget, env);
2219
+ await UpdatePackFolder.clear(path5.resolve(out ?? path5.join(nativeApp.updatesDir, platform)));
2220
+ const pinned = publicEnv ? await NativePublicEnv.load(publicEnv) : against ? await NativePublicEnv.recordedIn(against) : null;
2221
+ await this.#buildMobileCsr(app, env, undefined, pinned);
2222
+ const { pack } = await nativeApp.packUpdate(platform, { out });
2212
2223
  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
2224
  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
- `);
2225
+ const bundle = path5.join(pack.out, UpdatePackFolder.bundleFile);
2226
+ const compat = await NativeApp.compareBundles(app.cwdPath, against, bundle);
2227
+ const envProblem = await NativePublicEnv.problemAgainst(against, bundle);
2228
+ await UpdatePackFolder.writeCompat(pack, {
2229
+ against,
2230
+ compatible: compat.compatible && !envProblem,
2231
+ problems: [...compat.problems, ...envProblem ? [envProblem] : []]
2232
+ });
2218
2233
  }
2219
- await NativeApp.writePack(pack);
2220
- if (!pack.compat)
2221
- return pack;
2222
- if (pack.compat.compatible) {
2234
+ await UpdatePackFolder.write(pack);
2235
+ const verdict = UpdatePackFolder.storeBuildVerdict(pack);
2236
+ if (verdict)
2237
+ throw verdict;
2238
+ if (pack.compat)
2223
2239
  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; the one ${against} came from provides another native API:
2227
- - ${pack.compat.problems.join(`
2228
- - `)}`);
2229
- process.exitCode = 2;
2230
2240
  return pack;
2231
2241
  }
2232
2242
  async updateKeygen(app, platform, target) {
@@ -2237,16 +2247,27 @@ try {
2237
2247
  if (seen.has(appId))
2238
2248
  continue;
2239
2249
  seen.add(appId);
2240
- const { publicKey, keyPath, created } = await new NativeApp(app, mobileTarget).updateKeygen(nativePlatform);
2250
+ const { publicKey, keyId, keyPath, created } = await new NativeApp(app, mobileTarget).updateKeygen(nativePlatform);
2241
2251
  app.log(`${appId}: ${created ? "made" : "read"} ${keyPath}${created ? " (keep it private and backed up: without it, installed apps take no more updates)" : ""}`);
2242
2252
  app.log(` native: { updates: { url: "https://\u2026/${app.name}", publicKeys: [${JSON.stringify(publicKey)}] } }`);
2253
+ app.log(` keyId ${keyId}: what publish-update --revoke and updates.revokedKeys name this key by`);
2243
2254
  const { publicKey: one, publicKeys } = mobileTarget.config.updates ?? {};
2244
2255
  const declared = publicKeys ?? (one ? [one] : null);
2245
2256
  if (declared && !declared.includes(publicKey))
2246
2257
  app.logger.warn(`native.targets.${mobileTarget.name}.updates.publicKeys does not hold this key; releases it signs would not verify.`);
2247
2258
  }
2248
2259
  }
2249
- async publishUpdate(app, platform, { target, env = "main", channel, upload, arch, sign = false, notarize = false } = {}) {
2260
+ async publishUpdate(app, platform, {
2261
+ target,
2262
+ env = "main",
2263
+ channel,
2264
+ upload,
2265
+ arch,
2266
+ sign = false,
2267
+ notarize = false,
2268
+ revoke,
2269
+ resetSequence
2270
+ } = {}) {
2250
2271
  if (arch && platform !== "desktop")
2251
2272
  throw new Error(`--arch picks a desktop release's CPU; ${platform} publishes its web bundle.`);
2252
2273
  const targets = await resolveMobileTargets(app, target);
@@ -2260,7 +2281,9 @@ try {
2260
2281
  await new NativeApp(app, mobileTarget, env).assertPublishable(nativePlatform, {
2261
2282
  server: ApplicationRunner.carriesServer(mobileTarget, nativePlatform),
2262
2283
  ...channel ? { channel } : {},
2263
- ...arch ? { arch } : {}
2284
+ ...arch ? { arch } : {},
2285
+ revoke,
2286
+ resetSequence
2264
2287
  });
2265
2288
  const carried = await this.#stageMobile(app, nativePlatform, targets, env, arch);
2266
2289
  for (const mobileTarget of targets) {
@@ -2270,15 +2293,17 @@ try {
2270
2293
  ...arch ? { arch } : {},
2271
2294
  sign,
2272
2295
  notarize,
2296
+ revoke,
2297
+ resetSequence,
2273
2298
  ...carried && ApplicationRunner.carriesServer(mobileTarget, nativePlatform) ? { server: carried } : {}
2274
2299
  });
2275
2300
  this.#reportBuild(app, mobileTarget, published.build);
2276
2301
  app.log(`${app.name}/${mobileTarget.name} ${published.bundle}: ${published.dir}/${published.channel}.json, ${published.files} files, ${Math.round(published.size / 1024)} KiB`);
2277
2302
  if (!uploader) {
2278
- app.log(`Upload ${nativeApp.updatesDir} to ${mobileTarget.config.updates?.url}, the manifests last.`);
2303
+ 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
2304
  continue;
2280
2305
  }
2281
- const { uploaded, skipped } = await uploader.upload(nativeApp.updatesDir);
2306
+ const { uploaded, skipped } = await uploader.upload(nativeApp.updatesDir, published);
2282
2307
  app.log(`Uploaded ${uploaded} file(s) to ${upload}, the manifests last; ${skipped} the bucket already held. Installed apps read ${mobileTarget.config.updates?.url}.`);
2283
2308
  }
2284
2309
  }
@@ -2300,13 +2325,14 @@ try {
2300
2325
  if (typeof server !== "object")
2301
2326
  return { omit: [], modules: [] };
2302
2327
  const { omit = [], modules = [], profile, env, restart, watchdog } = server;
2328
+ const { intervalMs, failures } = typeof watchdog === "object" ? watchdog : {};
2303
2329
  return {
2304
2330
  omit,
2305
2331
  modules,
2306
2332
  ...profile ? { profile } : {},
2307
2333
  ...env ? { env } : {},
2308
2334
  ...restart !== undefined ? { restart } : {},
2309
- ...typeof watchdog === "object" ? { watchdog } : {}
2335
+ ...intervalMs && failures ? { watchdog: { intervalMs, failures } } : {}
2310
2336
  };
2311
2337
  });
2312
2338
  const [first = { omit: [], modules: [] }, ...rest] = servers;
@@ -2318,7 +2344,7 @@ try {
2318
2344
  agree("omit different packages", ({ omit }) => omit.join(", "));
2319
2345
  agree("name different env profiles", ({ profile }) => profile ?? "");
2320
2346
  agree("mount different modules", ({ modules }) => modules.join(", "));
2321
- agree("set a different env", ({ env }) => env ? JSON.stringify(env) : "");
2347
+ agree("set a different env", ({ env }) => env ? JSON.stringify(env, Object.keys(env).sort()) : "");
2322
2348
  agree("restart differently", ({ restart }) => String(restart ?? ""));
2323
2349
  agree("watch it differently", ({ watchdog }) => watchdog ? JSON.stringify(watchdog) : "");
2324
2350
  return first;
@@ -2331,7 +2357,11 @@ try {
2331
2357
  const { modules, env: serverEnv, restart, watchdog } = server;
2332
2358
  return await stage?.prepare(env, { modules, env: serverEnv, restart, watchdog });
2333
2359
  }
2334
- async#buildMobileCsr(app, env, profile) {
2360
+ async#buildMobileCsr(app, env, envProfile, publicEnv = null) {
2361
+ if (publicEnv?.AKAN_PUBLIC_ENV !== undefined && publicEnv.AKAN_PUBLIC_ENV !== env)
2362
+ throw new Error(`--env ${env} differs from the public env's AKAN_PUBLIC_ENV ${publicEnv.AKAN_PUBLIC_ENV}.`);
2363
+ if (publicEnv)
2364
+ NativePublicEnv.pin(publicEnv);
2335
2365
  const prevEnv = {
2336
2366
  AKAN_PUBLIC_ENV: process.env.AKAN_PUBLIC_ENV,
2337
2367
  AKAN_PUBLIC_OPERATION_MODE: process.env.AKAN_PUBLIC_OPERATION_MODE,
@@ -2343,7 +2373,7 @@ try {
2343
2373
  APP_OPERATION_MODE: "release"
2344
2374
  });
2345
2375
  try {
2346
- await new (await loadBuildRunner())(app, { environment: env, profile }).build({ spinner: true });
2376
+ await new (await loadBuildRunner())(app, { environment: env, profile: envProfile }).build({ spinner: true });
2347
2377
  } finally {
2348
2378
  for (const [key, value] of Object.entries(prevEnv)) {
2349
2379
  if (value === undefined)
@@ -2352,6 +2382,11 @@ try {
2352
2382
  process.env[key] = value;
2353
2383
  }
2354
2384
  }
2385
+ if (!publicEnv)
2386
+ return;
2387
+ const differs = NativePublicEnv.diff(publicEnv, await NativePublicEnv.built(app) ?? {});
2388
+ if (differs.length)
2389
+ throw new Error(`The web build inlined other values than --public-env gave for ${differs.join(", ")}.`);
2355
2390
  }
2356
2391
  async#runMobileTargets(targets, task) {
2357
2392
  const results = [];
@@ -2367,7 +2402,7 @@ try {
2367
2402
  if (failures.length === 0)
2368
2403
  return;
2369
2404
  for (const failure of failures) {
2370
- const message = failure.error instanceof Error ? failure.error.message : String(failure.error);
2405
+ const message = toError(failure.error).message;
2371
2406
  Logger3.rawLog(`Native target ${failure.target} failed: ${message}`, undefined, "error");
2372
2407
  }
2373
2408
  throw new Error(`${failures.length}/${results.length} native targets failed`);
@@ -3240,6 +3275,9 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
3240
3275
  static devServerReadyTimeoutMs = DevSupervisor.bootTimeoutMs;
3241
3276
  #interrupt = new InterruptTeardown;
3242
3277
  async confirmDatabaseModeDependencyInstall(databaseMode, installSpecs) {
3278
+ assertPromptable(`Database mode '${databaseMode}' requires missing dependencies: ${installSpecs.join(", ")}`, {
3279
+ remedy: `install them first with \`bun add ${installSpecs.join(" ")}\``
3280
+ });
3243
3281
  return await confirm({
3244
3282
  message: `Database mode '${databaseMode}' requires missing dependencies: ${installSpecs.join(", ")}. Install them now?`,
3245
3283
  default: true
@@ -3312,7 +3350,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
3312
3350
  if (!quiet)
3313
3351
  Logger6.rawLog(`Creating an optimized production build for ${app.name}...`);
3314
3352
  try {
3315
- const result = await this.applicationRunner.build(app, { fast, spinner: !quiet, profile });
3353
+ const result = await this.applicationRunner.build(app, { fast, spinner: !quiet, envProfile: profile });
3316
3354
  Logger6.rawLog(`${app.name} built in dist/apps/${app.name}`);
3317
3355
  if (!quiet)
3318
3356
  ApplicationBuildReporter.printSummary(result);
@@ -3325,10 +3363,12 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
3325
3363
  async typecheck(exec, { write = true, clean = false, incremental = true, tests = false } = {}) {
3326
3364
  if (!(exec instanceof AppExecutor) && !(exec instanceof LibExecutor))
3327
3365
  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)
3366
+ if (exec instanceof AppExecutor)
3367
+ await exec.scanSync({ write });
3368
+ else if (write)
3329
3369
  await this.libraryScript.syncLibrary(exec);
3330
3370
  else
3331
- await exec.scanSync({ write });
3371
+ await exec.scan({ write: false });
3332
3372
  const spinner = exec.spinning(`Typechecking ${exec.name}${tests ? " with its tests" : ""}...`);
3333
3373
  try {
3334
3374
  if (exec instanceof LibExecutor)
@@ -3593,13 +3633,13 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
3593
3633
  await Promise.all(shares.map(async (share) => await share.close()));
3594
3634
  }, "Abandoning the tunnel release; the shares expire on their own.");
3595
3635
  await Promise.all(apps.map(async (app) => {
3596
- const { TunnelShare } = await import("./TunnelShare-21mm6dr5.js");
3636
+ const { TunnelShare } = await import("./TunnelShare-f1egrktx.js");
3597
3637
  const share = await TunnelShare.open(app, { workspace: app.workspace });
3598
3638
  shares.push(share);
3599
3639
  urls.set(app.name, share.url);
3600
3640
  Logger6.rawLog(`${app.name} is shared at ${share.url}`);
3601
3641
  })).catch((error) => {
3602
- Logger6.rawLog(`Could not open the tunnel: ${error instanceof Error ? error.message : String(error)}`, undefined, "error");
3642
+ Logger6.rawLog(`Could not open the tunnel: ${toError2(error).message}`, undefined, "error");
3603
3643
  });
3604
3644
  return urls;
3605
3645
  }