@akanjs/cli 3.0.0-alpha.5 → 3.0.0-alpha.7

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 (50) hide show
  1. package/.build-stamp +1 -1
  2. package/{agent.command-b0fcx3r2.js → agent.command-pggr92jj.js} +6 -6
  3. package/{application.command-cgmy00gd.js → application.command-692yap1d.js} +4 -4
  4. package/{applicationBuildRunner-n1svrwgt.js → applicationBuildRunner-ha3y8ew8.js} +1 -1
  5. package/buildBatch.proc.js +2 -2
  6. package/{capacitorApp-yyw35vg4.js → capacitorApp-p0z5yab2.js} +4 -2
  7. package/{cloud.command-1m7hfdpk.js → cloud.command-wqfsyzv2.js} +7 -7
  8. package/{context.command-b5heat2a.js → context.command-9bxtdn0w.js} +13 -13
  9. package/{guideline.command-9ew6aqhm.js → guideline.command-nfqahxex.js} +3 -3
  10. package/incrementalBuilder.proc.js +1 -1
  11. package/{index-m4kpmmtj.js → index-2c3e2xh8.js} +1 -1
  12. package/{index-hrwzz2wf.js → index-4hek879p.js} +1 -1
  13. package/{index-nx1vbtsc.js → index-5dw57f0d.js} +5 -5
  14. package/{index-c94nq3c1.js → index-5pmx7bkg.js} +3 -3
  15. package/{index-jkynkyfk.js → index-6rhabeev.js} +1 -1
  16. package/{index-qp089jp0.js → index-7myvn0f0.js} +1 -1
  17. package/{index-exhpp31y.js → index-a1e0j63x.js} +2 -2
  18. package/{index-meh7mmz9.js → index-azv0xjb5.js} +2 -2
  19. package/{index-pfrt7qwh.js → index-bz2sfzzt.js} +4 -4
  20. package/{index-nfxq39kj.js → index-gex7c8kd.js} +4 -4
  21. package/{index-wrrb8rxk.js → index-gmy45vz2.js} +3 -3
  22. package/{index-mn96y1nk.js → index-js368gk9.js} +5 -5
  23. package/{index-jn9vfpwz.js → index-mssqn2sq.js} +2 -2
  24. package/{index-p6txr1ss.js → index-p3f4q532.js} +3 -3
  25. package/{index-0fj4yg7k.js → index-qb61h0k7.js} +2 -2
  26. package/{index-47qxw1tz.js → index-vg0sj9nc.js} +1 -1
  27. package/{index-60a3jfcz.js → index-vtj3zps1.js} +5 -5
  28. package/{index-p69fcwe1.js → index-w6wbb612.js} +11 -11
  29. package/{index-mterpj70.js → index-xhgtkekh.js} +86 -17
  30. package/{index-6npsfpxr.js → index-ztpw544k.js} +3 -3
  31. package/index.js +18 -18
  32. package/{library.command-aa1g8nsa.js → library.command-md9715jz.js} +3 -3
  33. package/{localRegistry.command-kshva1ck.js → localRegistry.command-exkbamyj.js} +6 -6
  34. package/{module.command-b1zzgqde.js → module.command-w5aaddxk.js} +6 -6
  35. package/{package.command-9qv6vr9s.js → package.command-yfkrcy0z.js} +3 -3
  36. package/package.json +2 -2
  37. package/{page.command-k16pw244.js → page.command-echbavp4.js} +3 -3
  38. package/{primitive.command-s60dn1ae.js → primitive.command-9fbhspw2.js} +7 -7
  39. package/{quality.command-p3vaze52.js → quality.command-3pnt9yep.js} +4 -17
  40. package/{repair.command-mfv749ha.js → repair.command-carj4vax.js} +5 -5
  41. package/{routeSourceValidator-cncd92fv.js → routeSourceValidator-e4jmbfcx.js} +2 -38
  42. package/{scalar.command-hs3nwzv1.js → scalar.command-51ryzypc.js} +5 -5
  43. package/templates/workspaceRoot/.cursor/rules/lint-enforced-rules.mdc.template +3 -2
  44. package/templates/workspaceRoot/.cursor/rules/module-file-playbook.mdc.template +1 -0
  45. package/templates/workspaceRoot/.cursor/rules/scalar-modeling.mdc.template +41 -0
  46. package/templates/workspaceRoot/AGENTS.md.template +12 -7
  47. package/templates/workspaceRoot/biome.json.template +25 -1
  48. package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +4 -1
  49. package/{workflow.command-z0e0fk0z.js → workflow.command-91wmvm8k.js} +10 -10
  50. package/{workspace.command-3q1d6kk4.js → workspace.command-wa10mfd9.js} +19 -19
@@ -5,7 +5,7 @@ import {
5
5
  } from "./index-76rn3g2c.js";
6
6
  import {
7
7
  CommandExecutionError
8
- } from "./index-47qxw1tz.js";
8
+ } from "./index-vg0sj9nc.js";
9
9
 
10
10
  // pkgs/@akanjs/devkit/capacitorApp.ts
11
11
  import { cp, mkdir, readFile, rm, writeFile } from "fs/promises";
@@ -514,6 +514,10 @@ function getAdbDeviceStateIssues(output) {
514
514
  return [];
515
515
  });
516
516
  }
517
+ function getAndroidLocalServerHost(adbDevicesOutput, fallbackHost) {
518
+ const onlineDeviceIds = adbDevicesOutput?.split(/\r?\n/).map((line) => line.trim().split(/\s+/)).filter(([id, state]) => id && state === "device").map(([id]) => id) ?? [];
519
+ return onlineDeviceIds.length === 1 && onlineDeviceIds[0]?.startsWith("emulator-") ? "10.0.2.2" : fallbackHost;
520
+ }
517
521
  var ANDROID_MIN_SDK_VERSION = 26;
518
522
  function raiseGradleMinSdkVersion(content, floor = ANDROID_MIN_SDK_VERSION) {
519
523
  const match = content.match(/minSdkVersion\s*=\s*(\d+)/);
@@ -691,7 +695,7 @@ class CapacitorApp {
691
695
  async save() {
692
696
  await this.project.commit();
693
697
  }
694
- async#prepareIos({ operation, env, regenerate = false }) {
698
+ async#prepareIos({ operation, env, regenerate = false, iosRunTargetKind }) {
695
699
  await this.init({ platform: "ios", operation, env, regenerate });
696
700
  await this.#prepareTargetAssets();
697
701
  await this.#prepareExternalFiles("ios");
@@ -700,9 +704,10 @@ class CapacitorApp {
700
704
  await this.#applyDeepLinks("ios", { operation, env });
701
705
  await this.#flushIosEntitlements();
702
706
  await this.project.commit();
707
+ await this.#setCodeSignEntitlementsInIosIfExists("App/App.entitlements");
703
708
  await this.#generateAssets({ operation, env });
704
709
  this.app.verbose(`syncing iOS`);
705
- await this.#spawnMobile("npx", ["cap", "sync", "ios"], { operation, env });
710
+ await this.#spawnMobile("npx", ["cap", "sync", "ios"], { operation, env }, { iosRunTargetKind });
706
711
  this.app.verbose(`sync completed.`);
707
712
  }
708
713
  async buildIos({ env = "debug", regenerate = false } = {}) {
@@ -721,10 +726,10 @@ class CapacitorApp {
721
726
  async runIos({ operation, env, regenerate = false, noAllowProvisioningUpdates = false, iosDeviceId }) {
722
727
  if (operation === "release")
723
728
  await this.prepareWww();
724
- await this.#prepareIos({ operation, env, regenerate });
725
729
  const runTarget = await this.#selectIosRunTarget(iosDeviceId);
730
+ await this.#prepareIos({ operation, env, regenerate, iosRunTargetKind: runTarget.kind });
726
731
  if (runTarget.kind === "simulator") {
727
- await this.#spawnMobile("npx", ["cap", "run", "ios", "--target", runTarget.id], { operation, env }, { stdio: "inherit" });
732
+ await this.#spawnMobile("npx", ["cap", "run", "ios", "--target", runTarget.id, "--no-sync"], { operation, env }, { stdio: "inherit", platform: "ios", iosRunTargetKind: runTarget.kind });
728
733
  return;
729
734
  }
730
735
  await this.#runIosPhysicalDevice({ operation, env, runTarget, noAllowProvisioningUpdates });
@@ -800,7 +805,7 @@ ${textError instanceof Error ? textError.message : ""}`);
800
805
  noAllowProvisioningUpdates
801
806
  }) {
802
807
  const mobileEnv = sanitizeIosNativeRunEnv(await this.#commandEnv(operation, env));
803
- const configContent = await this.#writeCapacitorConfig({ operation }, mobileEnv);
808
+ const configContent = await this.#writeCapacitorConfig({ operation, platform: "ios", iosRunTargetKind: runTarget.kind }, mobileEnv);
804
809
  await this.#writeRootCapacitorConfig(configContent);
805
810
  const scheme = this.#iosScheme();
806
811
  const command = buildIosNativeRunCommand({
@@ -857,6 +862,7 @@ ${error.message}`;
857
862
  await this.#applyAndroidMinSdkVersion();
858
863
  await this.#applyPermissions({ operation, env });
859
864
  await this.#applyDeepLinks("android", { operation, env });
865
+ await this.#disableNativeKeyboardResizeInAndroid();
860
866
  await this.project.commit();
861
867
  await this.#generateAssets({ operation, env });
862
868
  await this.#ensureAndroidAssetsDir();
@@ -916,6 +922,23 @@ ${error.message}`;
916
922
  async openAndroid() {
917
923
  await this.#spawnMobile("npx", ["cap", "open", "android"], { operation: "local", env: "local" });
918
924
  }
925
+ async#disableNativeKeyboardResizeInAndroid() {
926
+ const manifestPath = path.join(this.app.cwdPath, this.androidRootPath, "app/src/main/AndroidManifest.xml");
927
+ let manifest = await readFile(manifestPath, "utf8");
928
+ let changed = false;
929
+ manifest = manifest.replace(/<activity\b[^>]*android:name="\.MainActivity"[^>]*>/, (activityTag) => {
930
+ if (activityTag.includes("android:windowSoftInputMode=")) {
931
+ const nextTag = activityTag.replace(/android:windowSoftInputMode="[^"]*"/, 'android:windowSoftInputMode="adjustNothing"');
932
+ changed ||= nextTag !== activityTag;
933
+ return nextTag;
934
+ }
935
+ changed = true;
936
+ return activityTag.replace(/>$/, `
937
+ android:windowSoftInputMode="adjustNothing">`);
938
+ });
939
+ if (changed)
940
+ await writeFile(manifestPath, manifest);
941
+ }
919
942
  async#ensureAndroidAssetsDir() {
920
943
  await mkdir(path.join(this.app.cwdPath, this.androidAssetsPath), { recursive: true });
921
944
  }
@@ -1005,12 +1028,16 @@ ${error.message}`;
1005
1028
  return html.replace(/<\/head\s*>/i, `${script}
1006
1029
  </head>`);
1007
1030
  }
1008
- async#writeCapacitorConfig({ operation }, commandEnv) {
1031
+ async#writeCapacitorConfig({
1032
+ operation,
1033
+ platform,
1034
+ iosRunTargetKind
1035
+ }, commandEnv) {
1009
1036
  await mkdir(this.targetRoot, { recursive: true });
1010
1037
  let localIp;
1011
1038
  if (operation === "local") {
1012
1039
  const override = commandEnv.AKAN_PUBLIC_CLIENT_HOST ?? process.env.AKAN_PUBLIC_CLIENT_HOST;
1013
- const resolution = selectLocalDevHost(os.networkInterfaces(), { override });
1040
+ const resolution = await this.#resolveLocalDevHost({ override, platform, iosRunTargetKind });
1014
1041
  localIp = resolution.host;
1015
1042
  this.#logDevHostResolution(resolution, commandEnv);
1016
1043
  }
@@ -1024,9 +1051,29 @@ ${error.message}`;
1024
1051
  await Bun.write(path.join(this.targetRoot, "capacitor.config.json"), content);
1025
1052
  return content;
1026
1053
  }
1054
+ async#resolveLocalDevHost({
1055
+ override,
1056
+ platform,
1057
+ iosRunTargetKind
1058
+ }) {
1059
+ const resolution = selectLocalDevHost(os.networkInterfaces(), { override });
1060
+ if (resolution.source === "override")
1061
+ return resolution;
1062
+ if (platform === "ios" && iosRunTargetKind === "simulator")
1063
+ return { ...resolution, host: "localhost", source: "platform" };
1064
+ if (platform === "android") {
1065
+ try {
1066
+ const host = getAndroidLocalServerHost(await this.#spawn("adb", ["devices"]), resolution.host);
1067
+ return host === resolution.host ? resolution : { ...resolution, host, source: "platform" };
1068
+ } catch {
1069
+ return resolution;
1070
+ }
1071
+ }
1072
+ return resolution;
1073
+ }
1027
1074
  #logDevHostResolution(resolution, commandEnv) {
1028
1075
  this.app.log(`Mobile live-reload server: ${this.#localCsrUrl(resolution.host, commandEnv)}`);
1029
- if (resolution.source === "override")
1076
+ if (resolution.source === "override" || resolution.source === "platform")
1030
1077
  return;
1031
1078
  const suspicious = resolution.host === "127.0.0.1" || resolution.host.startsWith("169.254.");
1032
1079
  const alternatives = resolution.candidates.filter((candidate) => candidate.address !== resolution.host);
@@ -1226,18 +1273,26 @@ ${error.message}`;
1226
1273
  return await this.app.spawn(command, args, { cwd: this.app.cwdPath, ...options });
1227
1274
  }
1228
1275
  async#spawnMobile(command, args = [], { operation, env }, options = {}) {
1276
+ const { iosRunTargetKind, platform, ...spawnOptions } = options;
1229
1277
  const mobileEnv = { ...await this.#commandEnv(operation, env), ...options.env };
1230
- const configContent = await this.#writeCapacitorConfig({ operation }, mobileEnv);
1278
+ const configContent = await this.#writeCapacitorConfig({ operation, platform: platform ?? this.#inferMobilePlatform(args), iosRunTargetKind }, mobileEnv);
1231
1279
  await this.#writeRootCapacitorConfig(configContent);
1232
1280
  try {
1233
1281
  return await this.#spawn(command, args, {
1234
- ...options,
1282
+ ...spawnOptions,
1235
1283
  env: mobileEnv
1236
1284
  });
1237
1285
  } finally {
1238
1286
  await this.#clearRootCapacitorConfigs();
1239
1287
  }
1240
1288
  }
1289
+ #inferMobilePlatform(args) {
1290
+ if (args.includes("android"))
1291
+ return "android";
1292
+ if (args.includes("ios"))
1293
+ return "ios";
1294
+ return;
1295
+ }
1241
1296
  async addCamera() {
1242
1297
  await this.#setPermissionInIos({
1243
1298
  cameraUsageDescription: "$(PRODUCT_NAME) requires access to the camera to take photos.",
@@ -1339,17 +1394,31 @@ ${error.message}`;
1339
1394
  while (end < lines.length && !/^\s*\};\s*$/.test(lines[end] ?? ""))
1340
1395
  end++;
1341
1396
  const settings = lines.slice(start, end + 1);
1342
- if (settings.some((setting) => setting.includes("CODE_SIGN_ENTITLEMENTS")))
1343
- continue;
1397
+ const configName = lines.slice(end + 1, end + 8).find((setting) => setting.includes("name = ")) ?? "";
1344
1398
  const indent = line.match(/^\s*/)?.[0] ?? "";
1345
- lines.splice(index, 0, `${indent}CODE_SIGN_ENTITLEMENTS = ${entitlementsRelPath};`);
1346
- index++;
1347
- changed = true;
1399
+ const insertSettings = [];
1400
+ if (!settings.some((setting) => setting.includes("CODE_SIGN_ENTITLEMENTS"))) {
1401
+ insertSettings.push(`${indent}CODE_SIGN_ENTITLEMENTS = ${entitlementsRelPath};`);
1402
+ }
1403
+ if (configName.includes("name = Debug;") && !settings.some((setting) => setting.includes("CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION"))) {
1404
+ insertSettings.push(`${indent}CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION = YES;`);
1405
+ }
1406
+ if (insertSettings.length > 0) {
1407
+ lines.splice(index, 0, ...insertSettings);
1408
+ index += insertSettings.length;
1409
+ changed = true;
1410
+ }
1348
1411
  }
1349
1412
  if (changed)
1350
1413
  await writeFile(pbxprojPath, lines.join(`
1351
1414
  `));
1352
1415
  }
1416
+ async#setCodeSignEntitlementsInIosIfExists(entitlementsRelPath) {
1417
+ const entitlementsPath = path.join(this.app.cwdPath, this.iosProjectPath, entitlementsRelPath);
1418
+ if (!await Bun.file(entitlementsPath).exists())
1419
+ return;
1420
+ await this.#setCodeSignEntitlementsInIos(entitlementsRelPath);
1421
+ }
1353
1422
  async#setUrlSchemesInAndroid(schemes) {
1354
1423
  const manifestPath = path.join(this.app.cwdPath, this.androidRootPath, "app/src/main/AndroidManifest.xml");
1355
1424
  let manifest = await readFile(manifestPath, "utf8");
@@ -1444,4 +1513,4 @@ ${filter}$1`);
1444
1513
  }
1445
1514
  }
1446
1515
 
1447
- export { SWIFTUICORE_MIN_IOS_MAJOR, rootCapacitorConfigFilenames, rootCapacitorConfigPaths, clearRootCapacitorConfigs, writeRootCapacitorConfig, selectLocalDevHost, parseIosRuntimeMajor, sortIosRunTargets, parseDevicectlDevices, parseSimctlDevices, buildIosNativeRunCommand, classifyIosRunFailure, formatIosRunFailureMessage, sanitizeIosNativeRunEnv, PLACEHOLDER_APP_IDS, isPlaceholderAppId, getMissingAndroidReleaseSigningKeys, formatAndroidReleaseSigningError, getAdbDeviceStateIssues, ANDROID_MIN_SDK_VERSION, raiseGradleMinSdkVersion, assertJsonSerializable, materializeCapacitorConfig, CapacitorApp };
1516
+ export { SWIFTUICORE_MIN_IOS_MAJOR, rootCapacitorConfigFilenames, rootCapacitorConfigPaths, clearRootCapacitorConfigs, writeRootCapacitorConfig, selectLocalDevHost, parseIosRuntimeMajor, sortIosRunTargets, parseDevicectlDevices, parseSimctlDevices, buildIosNativeRunCommand, classifyIosRunFailure, formatIosRunFailureMessage, sanitizeIosNativeRunEnv, PLACEHOLDER_APP_IDS, isPlaceholderAppId, getMissingAndroidReleaseSigningKeys, formatAndroidReleaseSigningError, getAdbDeviceStateIssues, getAndroidLocalServerHost, ANDROID_MIN_SDK_VERSION, raiseGradleMinSdkVersion, assertJsonSerializable, materializeCapacitorConfig, CapacitorApp };
@@ -1,17 +1,17 @@
1
1
  // @bun
2
2
  import {
3
3
  AkanContextAnalyzer
4
- } from "./index-jn9vfpwz.js";
4
+ } from "./index-mssqn2sq.js";
5
5
  import {
6
6
  createRepairReport,
7
7
  generatedFilePathsForTarget,
8
8
  renderRepairReport,
9
9
  writeGeneratedSyncState,
10
10
  writeWorkflowRunArtifact
11
- } from "./index-m4kpmmtj.js";
11
+ } from "./index-2c3e2xh8.js";
12
12
  import {
13
13
  runner
14
- } from "./index-jkynkyfk.js";
14
+ } from "./index-6rhabeev.js";
15
15
 
16
16
  // pkgs/@akanjs/cli/repair/repair.runner.ts
17
17
  var commandForShell = (command) => command.startsWith("akan ") ? `bun run ${command}` : command;
package/index.js CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  getTargetCommandNames,
5
5
  getTargetMetas,
6
6
  runCommands
7
- } from "./index-jkynkyfk.js";
8
- import"./index-47qxw1tz.js";
7
+ } from "./index-6rhabeev.js";
8
+ import"./index-vg0sj9nc.js";
9
9
  import"./index-mxvakhsm.js";
10
10
  import"./index-67546d0j.js";
11
11
  import {
@@ -17,22 +17,22 @@ import path from "path";
17
17
 
18
18
  // pkgs/@akanjs/cli/commandModules.ts
19
19
  var commandModules = {
20
- workspace: async () => (await import("./workspace.command-3q1d6kk4.js")).WorkspaceCommand,
21
- agent: async () => (await import("./agent.command-b0fcx3r2.js")).AgentCommand,
22
- application: async () => (await import("./application.command-cgmy00gd.js")).ApplicationCommand,
23
- library: async () => (await import("./library.command-aa1g8nsa.js")).LibraryCommand,
24
- localRegistry: async () => (await import("./localRegistry.command-kshva1ck.js")).LocalRegistryCommand,
25
- package: async () => (await import("./package.command-9qv6vr9s.js")).PackageCommand,
26
- module: async () => (await import("./module.command-b1zzgqde.js")).ModuleCommand,
27
- page: async () => (await import("./page.command-k16pw244.js")).PageCommand,
28
- context: async () => (await import("./context.command-b5heat2a.js")).ContextCommand,
29
- cloud: async () => (await import("./cloud.command-1m7hfdpk.js")).CloudCommand,
30
- guideline: async () => (await import("./guideline.command-9ew6aqhm.js")).GuidelineCommand,
31
- scalar: async () => (await import("./scalar.command-hs3nwzv1.js")).ScalarCommand,
32
- primitive: async () => (await import("./primitive.command-s60dn1ae.js")).PrimitiveCommand,
33
- quality: async () => (await import("./quality.command-p3vaze52.js")).QualityCommand,
34
- repair: async () => (await import("./repair.command-mfv749ha.js")).RepairCommand,
35
- workflow: async () => (await import("./workflow.command-z0e0fk0z.js")).WorkflowCommand
20
+ workspace: async () => (await import("./workspace.command-wa10mfd9.js")).WorkspaceCommand,
21
+ agent: async () => (await import("./agent.command-pggr92jj.js")).AgentCommand,
22
+ application: async () => (await import("./application.command-692yap1d.js")).ApplicationCommand,
23
+ library: async () => (await import("./library.command-md9715jz.js")).LibraryCommand,
24
+ localRegistry: async () => (await import("./localRegistry.command-exkbamyj.js")).LocalRegistryCommand,
25
+ package: async () => (await import("./package.command-yfkrcy0z.js")).PackageCommand,
26
+ module: async () => (await import("./module.command-w5aaddxk.js")).ModuleCommand,
27
+ page: async () => (await import("./page.command-echbavp4.js")).PageCommand,
28
+ context: async () => (await import("./context.command-9bxtdn0w.js")).ContextCommand,
29
+ cloud: async () => (await import("./cloud.command-wqfsyzv2.js")).CloudCommand,
30
+ guideline: async () => (await import("./guideline.command-nfqahxex.js")).GuidelineCommand,
31
+ scalar: async () => (await import("./scalar.command-51ryzypc.js")).ScalarCommand,
32
+ primitive: async () => (await import("./primitive.command-9fbhspw2.js")).PrimitiveCommand,
33
+ quality: async () => (await import("./quality.command-3pnt9yep.js")).QualityCommand,
34
+ repair: async () => (await import("./repair.command-carj4vax.js")).RepairCommand,
35
+ workflow: async () => (await import("./workflow.command-91wmvm8k.js")).WorkflowCommand
36
36
  };
37
37
  var commandModuleIds = Object.keys(commandModules);
38
38
 
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  LibraryScript
4
- } from "./index-exhpp31y.js";
4
+ } from "./index-a1e0j63x.js";
5
5
  import {
6
6
  Lib,
7
7
  Workspace,
8
8
  command
9
- } from "./index-jkynkyfk.js";
10
- import"./index-47qxw1tz.js";
9
+ } from "./index-6rhabeev.js";
10
+ import"./index-vg0sj9nc.js";
11
11
  import"./index-mxvakhsm.js";
12
12
  import"./index-67546d0j.js";
13
13
  import"./index-r24hmh0q.js";
@@ -2,27 +2,27 @@
2
2
  import {
3
3
  CloudRunner,
4
4
  getNpmRegistryUrl
5
- } from "./index-p6txr1ss.js";
5
+ } from "./index-p3f4q532.js";
6
6
  import {
7
7
  PackageScript
8
- } from "./index-meh7mmz9.js";
8
+ } from "./index-azv0xjb5.js";
9
9
  import"./index-0cj2zxbm.js";
10
10
  import {
11
11
  ApplicationScript
12
- } from "./index-nx1vbtsc.js";
12
+ } from "./index-5dw57f0d.js";
13
13
  import"./index-76rn3g2c.js";
14
- import"./index-exhpp31y.js";
14
+ import"./index-a1e0j63x.js";
15
15
  import {
16
16
  Workspace,
17
17
  command,
18
18
  runner,
19
19
  script
20
- } from "./index-jkynkyfk.js";
20
+ } from "./index-6rhabeev.js";
21
21
  import"./index-fgc8r6dj.js";
22
22
  import"./index-bjpxzr6s.js";
23
23
  import {
24
24
  PkgExecutor
25
- } from "./index-47qxw1tz.js";
25
+ } from "./index-vg0sj9nc.js";
26
26
  import"./index-mxvakhsm.js";
27
27
  import"./index-46tjzh6s.js";
28
28
  import"./index-67546d0j.js";
@@ -1,20 +1,20 @@
1
1
  // @bun
2
2
  import {
3
3
  ModuleScript
4
- } from "./index-60a3jfcz.js";
5
- import"./index-hrwzz2wf.js";
4
+ } from "./index-vtj3zps1.js";
5
+ import"./index-4hek879p.js";
6
6
  import"./index-ss469dec.js";
7
7
  import"./index-0cj2zxbm.js";
8
8
  import {
9
9
  renderPrimitiveReport
10
- } from "./index-m4kpmmtj.js";
11
- import"./index-qp089jp0.js";
10
+ } from "./index-2c3e2xh8.js";
11
+ import"./index-7myvn0f0.js";
12
12
  import {
13
13
  Module,
14
14
  Sys,
15
15
  command
16
- } from "./index-jkynkyfk.js";
17
- import"./index-47qxw1tz.js";
16
+ } from "./index-6rhabeev.js";
17
+ import"./index-vg0sj9nc.js";
18
18
  import"./index-mxvakhsm.js";
19
19
  import"./index-67546d0j.js";
20
20
  import"./index-r24hmh0q.js";
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  PackageScript
4
- } from "./index-meh7mmz9.js";
4
+ } from "./index-azv0xjb5.js";
5
5
  import {
6
6
  Pkg,
7
7
  Workspace,
8
8
  command
9
- } from "./index-jkynkyfk.js";
10
- import"./index-47qxw1tz.js";
9
+ } from "./index-6rhabeev.js";
10
+ import"./index-vg0sj9nc.js";
11
11
  import"./index-mxvakhsm.js";
12
12
  import"./index-46tjzh6s.js";
13
13
  import"./index-67546d0j.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "3.0.0-alpha.5",
3
+ "version": "3.0.0-alpha.7",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -34,7 +34,7 @@
34
34
  "@langchain/openai": "^1.4.6",
35
35
  "@tailwindcss/node": "^4.3.0",
36
36
  "@trapezedev/project": "^7.1.4",
37
- "akanjs": "3.0.0-alpha.5",
37
+ "akanjs": "3.0.0-alpha.7",
38
38
  "chalk": "^5.6.2",
39
39
  "commander": "^14.0.3",
40
40
  "dayjs": "^1.11.20",
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  PageScript
4
- } from "./index-hrwzz2wf.js";
4
+ } from "./index-4hek879p.js";
5
5
  import {
6
6
  App,
7
7
  Module,
8
8
  command
9
- } from "./index-jkynkyfk.js";
10
- import"./index-47qxw1tz.js";
9
+ } from "./index-6rhabeev.js";
10
+ import"./index-vg0sj9nc.js";
11
11
  import"./index-mxvakhsm.js";
12
12
  import"./index-67546d0j.js";
13
13
  import"./index-r24hmh0q.js";
@@ -1,20 +1,20 @@
1
1
  // @bun
2
2
  import {
3
3
  PrimitiveScript
4
- } from "./index-pfrt7qwh.js";
5
- import"./index-60a3jfcz.js";
6
- import"./index-hrwzz2wf.js";
4
+ } from "./index-bz2sfzzt.js";
5
+ import"./index-vtj3zps1.js";
6
+ import"./index-4hek879p.js";
7
7
  import"./index-ss469dec.js";
8
8
  import"./index-0cj2zxbm.js";
9
9
  import {
10
10
  renderPrimitiveReport
11
- } from "./index-m4kpmmtj.js";
12
- import"./index-qp089jp0.js";
11
+ } from "./index-2c3e2xh8.js";
12
+ import"./index-7myvn0f0.js";
13
13
  import {
14
14
  Workspace,
15
15
  command
16
- } from "./index-jkynkyfk.js";
17
- import"./index-47qxw1tz.js";
16
+ } from "./index-6rhabeev.js";
17
+ import"./index-vg0sj9nc.js";
18
18
  import"./index-mxvakhsm.js";
19
19
  import"./index-67546d0j.js";
20
20
  import"./index-r24hmh0q.js";
@@ -7,11 +7,11 @@ import {
7
7
  command,
8
8
  runner,
9
9
  script
10
- } from "./index-jkynkyfk.js";
10
+ } from "./index-6rhabeev.js";
11
11
  import {
12
12
  appRootAllowedFiles,
13
13
  libFacetRootAllowedFiles
14
- } from "./index-47qxw1tz.js";
14
+ } from "./index-vg0sj9nc.js";
15
15
  import"./index-mxvakhsm.js";
16
16
  import"./index-67546d0j.js";
17
17
  import"./index-r24hmh0q.js";
@@ -20,6 +20,7 @@ import"./index-r24hmh0q.js";
20
20
  import { createHash } from "crypto";
21
21
  import { readdir, readFile, stat } from "fs/promises";
22
22
  import path from "path";
23
+ import { RESERVED_ROUTE_CONFIG_EXPORTS } from "akanjs/common";
23
24
  import ignore from "ignore";
24
25
  import ts2 from "typescript";
25
26
 
@@ -415,20 +416,6 @@ var CONVENTION_SUFFIXES = [
415
416
  ".signal.ts",
416
417
  ".store.ts"
417
418
  ];
418
- var PAGE_RESERVED_EXPORTS = new Set([
419
- "pageConfig",
420
- "head",
421
- "metadata",
422
- "generateHead",
423
- "generateMetadata",
424
- "fonts",
425
- "manifest",
426
- "theme",
427
- "reconnect",
428
- "wsConnect",
429
- "layoutStyle",
430
- "gaTrackingId"
431
- ]);
432
419
  var RULE_FIXES = {
433
420
  "akan.global.duplicate-exported-function-name": "Rename one of the exports, or if they are the same thing, extract it into one shared module and import it in both places.",
434
421
  "akan.global.duplicate-exported-function-body": "Extract the shared implementation into a single exported helper and import it, instead of copying the body.",
@@ -911,7 +898,7 @@ function isRestrictedInternalKind(kind) {
911
898
  function isAllowedComponentExport(declaration, isPage) {
912
899
  if (isComponentValueKind(declaration.kind) && isPascalCaseName(declaration.name))
913
900
  return true;
914
- return isPage && PAGE_RESERVED_EXPORTS.has(declaration.name);
901
+ return isPage && RESERVED_ROUTE_CONFIG_EXPORTS.has(declaration.name);
915
902
  }
916
903
  function isPascalCaseName(name) {
917
904
  return /^[A-Z]/.test(name) && !/^[A-Z0-9_]+$/.test(name);
@@ -1,15 +1,15 @@
1
1
  // @bun
2
2
  import {
3
3
  RepairRunner
4
- } from "./index-6npsfpxr.js";
5
- import"./index-jn9vfpwz.js";
6
- import"./index-m4kpmmtj.js";
4
+ } from "./index-ztpw544k.js";
5
+ import"./index-mssqn2sq.js";
6
+ import"./index-2c3e2xh8.js";
7
7
  import {
8
8
  Workspace,
9
9
  command,
10
10
  script
11
- } from "./index-jkynkyfk.js";
12
- import"./index-47qxw1tz.js";
11
+ } from "./index-6rhabeev.js";
12
+ import"./index-vg0sj9nc.js";
13
13
  import"./index-mxvakhsm.js";
14
14
  import"./index-xys926f2.js";
15
15
  import"./index-67546d0j.js";
@@ -2,49 +2,13 @@
2
2
  import"./index-r24hmh0q.js";
3
3
 
4
4
  // pkgs/@akanjs/devkit/routeSourceValidator.ts
5
+ import { getRouteExports } from "akanjs/common";
5
6
  import ts from "typescript";
6
7
 
7
8
  class RouteSourceValidator {
8
- static #pageExports = new Set([
9
- "default",
10
- "pageConfig",
11
- "head",
12
- "metadata",
13
- "generateHead",
14
- "generateMetadata",
15
- "Loading"
16
- ]);
17
- static #rootLayoutExports = new Set([
18
- "default",
19
- "pageConfig",
20
- "head",
21
- "metadata",
22
- "generateHead",
23
- "generateMetadata",
24
- "fonts",
25
- "manifest",
26
- "theme",
27
- "reconnect",
28
- "layoutStyle",
29
- "gaTrackingId",
30
- "Loading",
31
- "NotFound",
32
- "Error"
33
- ]);
34
- static #layoutExports = new Set([
35
- "default",
36
- "pageConfig",
37
- "head",
38
- "metadata",
39
- "generateHead",
40
- "generateMetadata",
41
- "Loading",
42
- "NotFound",
43
- "Error"
44
- ]);
45
9
  static validateRouteSourceExports(source, filePath, kind, options = {}) {
46
10
  const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);
47
- const allowed = kind === "page" ? RouteSourceValidator.#pageExports : options.rootLayout ? RouteSourceValidator.#rootLayoutExports : RouteSourceValidator.#layoutExports;
11
+ const allowed = getRouteExports(kind, { rootLayout: options.rootLayout });
48
12
  const exported = new Set;
49
13
  const assertExport = (name) => {
50
14
  if (!allowed.has(name)) {
@@ -1,18 +1,18 @@
1
1
  // @bun
2
2
  import {
3
3
  ScalarScript
4
- } from "./index-wrrb8rxk.js";
4
+ } from "./index-gmy45vz2.js";
5
5
  import"./index-ss469dec.js";
6
6
  import"./index-0cj2zxbm.js";
7
7
  import {
8
8
  renderPrimitiveReport
9
- } from "./index-m4kpmmtj.js";
10
- import"./index-qp089jp0.js";
9
+ } from "./index-2c3e2xh8.js";
10
+ import"./index-7myvn0f0.js";
11
11
  import {
12
12
  Sys,
13
13
  command
14
- } from "./index-jkynkyfk.js";
15
- import"./index-47qxw1tz.js";
14
+ } from "./index-6rhabeev.js";
15
+ import"./index-vg0sj9nc.js";
16
16
  import"./index-mxvakhsm.js";
17
17
  import"./index-67546d0j.js";
18
18
  import"./index-r24hmh0q.js";
@@ -7,11 +7,12 @@ alwaysApply: true
7
7
 
8
8
  Enforced by `biome.json` and the Akan grit plugins registered in `biome.json`. Several of them produce output that looks wrong; do not "fix" it back.
9
9
 
10
- - **Never hand-order Tailwind classes.** `nursery/useSortedClasses` is an error and also sorts the string arguments to `clsx()` and `cva()`. Sorter output such as `font-bold text-2xl text-base-content` or `border-base-content/5 border-t` is correct. Write the classes in any order, run the formatter, leave the result.
11
- - **Never `throw new Error`.** Throw `new Err("<module>.error.<key>")` and register the key as `[en, ko]` in that module's dictionary `.error({})`. Import `Err` from `"../dict"` on the server and from `"@libs/<lib>/client"` or `"@apps/<app>/client"` in UI. `no-throw-raw-error.grit` exempts `*.test.ts`, `*.spec.ts`, `*.constant.ts`, and `common/**` — `common/` has no legal `Err` import path, so keep throwing code out of it.
10
+ - **Never hand-order Tailwind classes.** `nursery/useSortedClasses` is an error and also sorts the string arguments to `cn()`. Sorter output such as `font-bold text-2xl text-base-content` or `border-base-content/5 border-t` is correct. Write the classes in any order, run the formatter, leave the result.
11
+ - **Never `throw new Error`.** Throw `new Err("<module>.error.<key>")` and register the key as `[en, ko]` in that module's dictionary `.error({})`. Import `Err` from `"../dict"` on the server and from `"@libs/<lib>/client"` or `"@apps/<app>/client"` in UI. `no-throw-raw-error.grit` exempts `*.test.ts`, `*.spec.ts`, `*.constant.ts`, `common/**`, and `apps/akan/env/**` — `common/` and `env/` have no legal `Err` import path, so keep throwing code out of them.
12
12
  - **Never import a third-party package** from `page/**`, from any barrel, or from any `*.{constant,dictionary,document,service,signal,store}.ts` / `*.{Template,Unit,Util,View,Zone}.tsx` (`no-import-external-library.grit`). Re-export the symbol through a lib first. One-line re-export shims such as `libs/<lib>/base/<pkg>.ts` and `libs/<lib>/webkit/<hook>.ts` exist for exactly this reason — they are load-bearing, not cruft. Do not delete them.
13
13
  - **`#private` is banned in exactly four file suffixes:** `*.constant.ts`, `*.document.ts`, `*.service.ts`, and `*.store.ts` (`no-js-private-class-method.grit`). The rule is scoped by file path, not by class shape, so `#private` remains the house style everywhere under `srvkit/`, including `adapt()` adapter classes.
14
14
  - **No `console.log` / `console.debug`.** Only `assert`, `error`, `info`, and `warn` are allowed. Server code uses the injected `this.logger.*` or `new Logger("ClassName")`.
15
+ - **Never return a value from a store action** (`no-return-in-store-action.grit`). Every method of a `store(...)` class dispatches through `st.do.<action>()`, which is typed `void` / `Promise<void>`, so the value is unreachable — write it into state with `this.set({ ... })`. A bare `return;` guard, a `return` inside a nested callback, a getter, and a `static` helper are all still fine.
15
16
  - **Never redeclare a generated CRUD endpoint name** in `*.signal.ts` (`no-redeclare-predefined-endpoint.grit`).
16
17
  - **No deep imports past a barrel** (`no-deep-internal-import.grit`). Cross-module constant references such as `../map/map.constant` are the sanctioned exception.
17
18
  - **Server-component discipline** is enforced on `page/**`, `*.Unit.tsx`, and `*.View.tsx` (`no-import-client-functions.grit`, `no-use-client-in-server.grit`, `non-scalar-props-restricted.grit`).
@@ -45,6 +45,7 @@ Fixed order: `XFilter extends from(...)` → `X extends by(...)` → `XModel ext
45
45
  - The body is three lines: `await fetch.X` → `this.setX(...)` → toast. The optimistic shape is mutate the client model, `void fetch.*`, then commit.
46
46
  - Use `this.pick(...)` when the value must exist, `this.get()` when it may not, and `this.set({...})` to write.
47
47
  - Mutate lists through the collection API (`this.set({ xList: xList.set(x).save() })`), not array spread.
48
+ - An action returns nothing — `st.do.<action>()` is typed `void` / `Promise<void>`, so hand the result to `this.set({...})` rather than returning it (`no-return-in-store-action.grit`); a bare `return;` guard stays fine.
48
49
  - **Never `import type { RootStore } from "../st"`** — it crashes `akan build` with a Bun SSR segfault.
49
50
  - Store actions do not `try/catch`; let the framework toast the `Err`.
50
51