@akanjs/cli 3.1.0-rc.20 → 3.1.0-rc.21

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 (69) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-n3tzjm91.js → CodeAgent-gzfc5t52.js} +2 -2
  3. package/{CodeTui-fnm9ft4d.js → CodeTui-bpsjs8wz.js} +1 -1
  4. package/TunnelShare-tfrnftgr.js +14 -0
  5. package/{agent.command-3qxf4xcj.js → agent.command-67ysh3n6.js} +5 -5
  6. package/akanCode.js +2 -2
  7. package/{application.command-zfja7x4r.js → application.command-q0tqw5pc.js} +35 -9
  8. package/{applicationBuildRunner-vh4j6vdv.js → applicationBuildRunner-wsszr305.js} +5 -5
  9. package/buildBatch.proc.js +5 -5
  10. package/{cloud.command-fcc8e8tp.js → cloud.command-e7tkxyx6.js} +13 -13
  11. package/cloud.script-krzh3d7k.js +24 -0
  12. package/{code.command-130bdmhe.js → code.command-ttk8tje2.js} +6 -6
  13. package/commandManifest.json +1 -1
  14. package/{context.command-0qx447mb.js → context.command-bdsk2z2r.js} +16 -16
  15. package/context.runner-bxzv0gm0.js +25 -0
  16. package/{guideline.command-cv5bmrx2.js → guideline.command-man90n70.js} +2 -2
  17. package/guidelines/conventions/conventions.instruction.md +24 -1
  18. package/incrementalBuilder.proc.js +3 -3
  19. package/{index-trpasv9q.js → index-033wne2j.js} +1 -1
  20. package/{index-w44cy4vs.js → index-1r5a8bzx.js} +2 -2
  21. package/{index-86jt2a0e.js → index-27y8t17p.js} +1 -1
  22. package/{index-1djcjcre.js → index-2w8j2fnv.js} +3 -3
  23. package/{index-g1mbppa9.js → index-35m6bzm7.js} +3 -3
  24. package/{index-awbdfcf2.js → index-4393nb4b.js} +4 -4
  25. package/{index-qwa5k1j8.js → index-48edp6q4.js} +1 -1
  26. package/{index-vk0pa0mn.js → index-4v43h00g.js} +1 -1
  27. package/{index-axs61rna.js → index-54wc2phm.js} +3 -3
  28. package/{index-1xj2t7cb.js → index-75n5q4ph.js} +7 -7
  29. package/{index-hsadfb6c.js → index-844q7f8z.js} +7 -7
  30. package/{index-4mhy6qme.js → index-8jehkey8.js} +4 -4
  31. package/{index-pydbnfez.js → index-9mt4smfy.js} +2 -2
  32. package/{index-dye8pnxx.js → index-cae9m5jz.js} +1 -1
  33. package/{index-j237xtew.js → index-ebarbgba.js} +2 -2
  34. package/{index-va06nr10.js → index-g6ax17x4.js} +24 -4
  35. package/{index-1p98exm2.js → index-g9ks2k8c.js} +2 -2
  36. package/{index-192ha4xh.js → index-h3r3nr9y.js} +1 -1
  37. package/{index-qtfmtcrw.js → index-h6czey01.js} +71 -18
  38. package/{index-cpb3nvma.js → index-jrmzcp66.js} +2 -2
  39. package/{index-5edzv8fn.js → index-nv79n88g.js} +2 -2
  40. package/{index-665zp9rs.js → index-nx64dz92.js} +2 -2
  41. package/{index-fmzcs8v6.js → index-p2r64bpa.js} +4 -4
  42. package/{index-j4mkhz93.js → index-pg1t468s.js} +3 -3
  43. package/{index-fyq1z6kt.js → index-rc51f9ht.js} +3 -3
  44. package/{index-tamvyvj3.js → index-ta1dychm.js} +3 -3
  45. package/{index-jw1zm273.js → index-vkb9m4z7.js} +53 -9
  46. package/{index-35hc95h5.js → index-xsd96yzw.js} +1 -1
  47. package/{index-d72hfmdm.js → index-zv5s8x58.js} +8 -8
  48. package/index.js +22 -22
  49. package/{library.command-erp2f56n.js → library.command-6amzsrb8.js} +3 -3
  50. package/{localRegistry.command-hj3p16p5.js → localRegistry.command-yqc0nyhh.js} +12 -12
  51. package/{module.command-gs2r615e.js → module.command-10x6jv6c.js} +5 -5
  52. package/{package.command-j10r76ax.js → package.command-pwfvecjf.js} +3 -3
  53. package/package.json +2 -2
  54. package/{page.command-4h4a8pnh.js → page.command-ahhgx9y1.js} +3 -3
  55. package/{pipeline.command-a2nrk26m.js → pipeline.command-1ptr3e9y.js} +2 -2
  56. package/{primitive.command-w6t0asqz.js → primitive.command-g5xwv6tj.js} +6 -6
  57. package/{projectTypecheck-f534enqj.js → projectTypecheck-fx8x7cat.js} +1 -1
  58. package/{quality.command-77x7vbbx.js → quality.command-fw9ck061.js} +2 -2
  59. package/{repair.command-y6sstev7.js → repair.command-g8kecj96.js} +5 -5
  60. package/{scalar.command-20b8cy0k.js → scalar.command-fprap51w.js} +4 -4
  61. package/{subspace.command-baz73jpk.js → subspace.command-sc0t527y.js} +8 -8
  62. package/templates/migration/__migrationId__.ts +23 -0
  63. package/templates/server.ts +8 -1
  64. package/{tunnel.command-2kw8vt9g.js → tunnel.command-mqnsqbwf.js} +7 -7
  65. package/{workflow.command-2djwmpqf.js → workflow.command-j0jgkr13.js} +10 -10
  66. package/{workspace.command-jqs7vjhe.js → workspace.command-1r9hvvw0.js} +24 -24
  67. package/TunnelShare-661cxz5e.js +0 -14
  68. package/cloud.script-1xt3tnts.js +0 -24
  69. package/context.runner-1vsjztjg.js +0 -25
@@ -10,7 +10,7 @@ import {
10
10
  LibExecutor,
11
11
  PkgExecutor,
12
12
  ModuleExecutor
13
- } from "./index-va06nr10.js";
13
+ } from "./index-g6ax17x4.js";
14
14
 
15
15
  // pkgs/@akanjs/devkit/commandDecorators/camelToKebabCase.ts
16
16
  var camelToKebabCase = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase();
@@ -289,8 +289,9 @@ var formatCommandHelp = (command, key) => {
289
289
  const optName = `${flag}--${kebabName}${negation}`;
290
290
  const optDesc = opt.desc ?? "";
291
291
  const defaultVal = opt.default !== undefined ? chalk.gray(` [default: ${String(opt.default)}]`) : "";
292
+ const repeatable = opt.multiple ? chalk.gray(" (repeatable)") : "";
292
293
  const choices = opt.enum ? chalk.gray(typeof opt.enum === "function" ? " ([dynamic choices])" : ` (${opt.enum.map(formatChoice).join(", ")})`) : "";
293
- lines.push(` ${chalk.green(optName)} ${chalk.gray(optDesc)}${defaultVal}${choices}`);
294
+ lines.push(` ${chalk.green(optName)} ${chalk.gray(optDesc)}${defaultVal}${choices}${repeatable}`);
294
295
  }
295
296
  lines.push("");
296
297
  }
@@ -301,6 +302,10 @@ var formatCommandHelp = (command, key) => {
301
302
  // pkgs/@akanjs/devkit/commandDecorators/command.ts
302
303
  var loggedCliErrorObjects = new WeakSet;
303
304
  var loggedCliErrorMessages = new Set;
305
+ var markCliErrorPrinted = (error) => {
306
+ if (typeof error === "object" && error !== null)
307
+ loggedCliErrorObjects.add(error);
308
+ };
304
309
  var formatCliError = (error) => {
305
310
  if (error instanceof Error)
306
311
  return error.message || error.name;
@@ -341,7 +346,12 @@ var handleOption = (programCommand, argMeta) => {
341
346
  } = argMeta.argsOption;
342
347
  const kebabName = camelToKebabCase(argMeta.name);
343
348
  const choices = enumChoices && typeof enumChoices !== "function" ? normalizeEnumChoices(enumChoices) : null;
344
- programCommand.option(`-${flag}, --${kebabName}${type === "boolean" ? " [boolean]" : ` <${kebabName}>`}`, `${desc}${ask ? ` (${ask})` : ""}${example ? ` (example: ${example})` : ""}${choices ? ` (choices: ${choices.map((choice) => choice.name).join(", ")})` : ""}`);
349
+ const flags = `-${flag}, --${kebabName}${type === "boolean" ? " [boolean]" : ` <${kebabName}>`}`;
350
+ const description = `${desc}${ask ? ` (${ask})` : ""}${example ? ` (example: ${example})` : ""}${choices ? ` (choices: ${choices.map((choice) => choice.name).join(", ")})` : ""}`;
351
+ if (argMeta.argsOption.multiple)
352
+ programCommand.option(flags, description, (value, previous = []) => [...previous, value]);
353
+ else
354
+ programCommand.option(flags, description);
345
355
  if (type === "boolean" && argMeta.argsOption.default === true)
346
356
  programCommand.option(`--no-${kebabName}`, `turn off --${kebabName}`);
347
357
  return programCommand;
@@ -359,6 +369,17 @@ var convertArgValue = (value, type) => {
359
369
  else
360
370
  return value === true || value === "true";
361
371
  };
372
+ var givenOptionsOf = (argMetas, opt) => {
373
+ const given = {};
374
+ for (const argMeta of argMetas) {
375
+ if (argMeta.type !== "Option" || opt[argMeta.name] === undefined)
376
+ continue;
377
+ const type = argMeta.argsOption.type ?? "string";
378
+ const value = opt[argMeta.name];
379
+ given[argMeta.name] = Array.isArray(value) ? value.map((each) => convertArgValue(each, type)) : convertArgValue(value, type);
380
+ }
381
+ return given;
382
+ };
362
383
  var normalizeEnumChoices = (enumChoices) => enumChoices.map((choice) => typeof choice === "object" ? { value: choice.value, name: choice.label } : { value: choice, name: choice.toString() });
363
384
  var prompts = async () => await import("@inquirer/prompts");
364
385
  var select = (config, context) => prompts().then((m) => m.select(config, context));
@@ -384,8 +405,14 @@ var inputMessageOf = ({ name, argsOption: { desc, example, ask } }) => ask ? `${
384
405
  var getOptionValue = async (argMeta, opt, context) => {
385
406
  const {
386
407
  name,
387
- argsOption: { enum: enumChoices, default: defaultValue, type, desc, nullable, ask }
408
+ argsOption: { enum: enumChoices, default: defaultValue, type, desc, nullable, ask, multiple }
388
409
  } = argMeta;
410
+ if (multiple) {
411
+ const values = opt[argMeta.name] ?? [];
412
+ for (const value of values)
413
+ assertEnumChoice(argMeta, value);
414
+ return values.map((value) => convertArgValue(value, type ?? "string"));
415
+ }
389
416
  if (opt[argMeta.name] !== undefined) {
390
417
  assertEnumChoice(argMeta, opt[argMeta.name]);
391
418
  return convertArgValue(opt[argMeta.name], type ?? "string");
@@ -574,6 +601,7 @@ var getInternalArgumentValue = async (argMeta, value, workspace) => {
574
601
  };
575
602
  var runCommands = async (...commands) => {
576
603
  let failureExitCode = 1;
604
+ let reportFailure = async (_error) => {};
577
605
  process.on("unhandledRejection", (error) => {
578
606
  printCliError(error);
579
607
  process.exit(ExitCodeError.codeOf(error) ?? failureExitCode);
@@ -614,9 +642,19 @@ It may cause unexpected behavior. Run \`akan update\` to update latest akanjs.`)
614
642
  hidden: targetMeta.targetOption.devOnly
615
643
  });
616
644
  const targetFailureExitCode = targetMeta.targetOption.failureExitCode;
617
- if (targetFailureExitCode !== undefined)
618
- programCommand.exitOverride((error) => process.exit(error.exitCode === 0 ? 0 : targetFailureExitCode));
645
+ const usageExitCode = targetMeta.targetOption.usageExitCode ?? targetFailureExitCode;
646
+ const { onFailure } = targetMeta.targetOption;
619
647
  const [allArgMetas] = getArgMetas(command, targetMeta.key);
648
+ if (usageExitCode !== undefined || onFailure)
649
+ programCommand.exitOverride((error) => {
650
+ if (error.exitCode === 0)
651
+ process.exit(0);
652
+ const refused = new ExitCodeError(error.message.replace(/^error: /, ""), usageExitCode ?? error.exitCode);
653
+ markCliErrorPrinted(refused);
654
+ const given = givenOptionsOf(allArgMetas, programCommand.opts());
655
+ reportFailure = async (failure) => await onFailure?.(failure, { usage: true, given });
656
+ throw refused;
657
+ });
620
658
  for (const argMeta of allArgMetas) {
621
659
  if (argMeta.type === "Option")
622
660
  programCommand = handleOption(programCommand, argMeta);
@@ -643,6 +681,7 @@ It may cause unexpected behavior. Run \`akan update\` to update latest akanjs.`)
643
681
  Logger.rawLog();
644
682
  const cmdArgs = args.slice(0, args.length - 2);
645
683
  const opt = args[args.length - 2];
684
+ reportFailure = async (failure) => await onFailure?.(failure, { usage: false, given: givenOptionsOf(allArgMetas, opt) });
646
685
  const commandArgs = [];
647
686
  if (targetMeta.targetOption.runsOnWorkspaceRoot)
648
687
  await assertCurrentDirectoryIsWorkspaceRoot();
@@ -681,13 +720,18 @@ It may cause unexpected behavior. Run \`akan update\` to update latest akanjs.`)
681
720
  }
682
721
  }
683
722
  }
684
- await program.parseAsync(process.argv).catch((error) => {
723
+ await program.parseAsync(process.argv).catch(async (error) => {
685
724
  printCliError(error);
725
+ await reportFailure(error).catch(printCliError);
686
726
  process.exit(ExitCodeError.codeOf(error) ?? failureExitCode);
687
727
  });
688
728
  };
689
729
  // pkgs/@akanjs/devkit/commandDecorators/commandBuilder.ts
690
- var argMetaOf = (type, name, primitive, argsOption, idx) => ({ name, argsOption: { ...argsOption, type: normalizePrimitiveArgType(primitive) }, key: "", idx, type });
730
+ var argMetaOf = (type, name, primitive, argsOption, idx) => {
731
+ if (type === "Argument" && argsOption?.multiple)
732
+ throw new Error(`argument '${name}' cannot be multiple`);
733
+ return { name, argsOption: { ...argsOption, type: normalizePrimitiveArgType(primitive) }, key: "", idx, type };
734
+ };
691
735
 
692
736
  class TargetBuilder {
693
737
  targetOption;
@@ -758,4 +802,4 @@ function command(refName, depsOrBuilder, builder) {
758
802
  }
759
803
  return CommandBase;
760
804
  }
761
- export { getTargetMetas, getTargetCommandNames, App, Apps, Lib, Sys, SysOrOnlyApp, Exec, Pkg, Module, Workspace, CommandContainer, runner, script, ExitCodeError, assertPromptable, runCommands, command };
805
+ export { getTargetMetas, getTargetCommandNames, App, Apps, Lib, Sys, SysOrOnlyApp, Exec, Pkg, Module, Workspace, CommandContainer, runner, script, ExitCodeError, markCliErrorPrinted, assertPromptable, runCommands, command };
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  AppInfo
4
- } from "./index-va06nr10.js";
4
+ } from "./index-g6ax17x4.js";
5
5
 
6
6
  // pkgs/@akanjs/devkit/slicePlanner.ts
7
7
  class SlicePlanner {
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  AppExecutor
4
- } from "./index-va06nr10.js";
4
+ } from "./index-g6ax17x4.js";
5
5
  import {
6
6
  jsonText,
7
7
  createWorkflowBaselineSummary,
8
8
  buildAkanModuleContextIndex,
9
9
  toolingRolloutGate
10
- } from "./index-trpasv9q.js";
10
+ } from "./index-033wne2j.js";
11
11
  import {
12
12
  buildResourceList,
13
13
  codexMcpConfigPath,
@@ -17,29 +17,29 @@ import {
17
17
  upsertCodexMcpServerBlock,
18
18
  renderDoctorText,
19
19
  AkanContextAnalyzer
20
- } from "./index-5edzv8fn.js";
20
+ } from "./index-nv79n88g.js";
21
21
  import {
22
22
  runner
23
- } from "./index-jw1zm273.js";
23
+ } from "./index-vkb9m4z7.js";
24
24
  import {
25
25
  isPlaceholderAppId
26
- } from "./index-vk0pa0mn.js";
26
+ } from "./index-4v43h00g.js";
27
27
  import {
28
28
  getMobileTargets,
29
29
  appIdsOf
30
30
  } from "./index-m9jj544v.js";
31
31
  import {
32
32
  NativeApp
33
- } from "./index-g1mbppa9.js";
33
+ } from "./index-35m6bzm7.js";
34
34
  import {
35
35
  Prompter2
36
36
  } from "./index-zzvvc845.js";
37
37
  import {
38
38
  RepairRunner
39
- } from "./index-j4mkhz93.js";
39
+ } from "./index-pg1t468s.js";
40
40
  import {
41
41
  WorkflowRunner
42
- } from "./index-1xj2t7cb.js";
42
+ } from "./index-75n5q4ph.js";
43
43
 
44
44
  // pkgs/@akanjs/devkit/akanMcpContract.ts
45
45
  import path from "path";
package/index.js CHANGED
@@ -4,35 +4,35 @@ import {
4
4
  getTargetMetas,
5
5
  getTargetCommandNames,
6
6
  runCommands
7
- } from "./index-jw1zm273.js";
7
+ } from "./index-vkb9m4z7.js";
8
8
  import"./index-52w0fvh8.js";
9
- import"./index-va06nr10.js";
9
+ import"./index-g6ax17x4.js";
10
10
 
11
11
  // pkgs/@akanjs/cli/commandManifest.ts
12
12
  import path from "path";
13
13
 
14
14
  // pkgs/@akanjs/cli/commandModules.ts
15
15
  var commandModules = {
16
- workspace: async () => (await import("./workspace.command-jqs7vjhe.js")).WorkspaceCommand,
17
- agent: async () => (await import("./agent.command-3qxf4xcj.js")).AgentCommand,
18
- code: async () => (await import("./code.command-130bdmhe.js")).CodeCommand,
19
- application: async () => (await import("./application.command-zfja7x4r.js")).ApplicationCommand,
20
- library: async () => (await import("./library.command-erp2f56n.js")).LibraryCommand,
21
- localRegistry: async () => (await import("./localRegistry.command-hj3p16p5.js")).LocalRegistryCommand,
22
- package: async () => (await import("./package.command-j10r76ax.js")).PackageCommand,
23
- module: async () => (await import("./module.command-gs2r615e.js")).ModuleCommand,
24
- page: async () => (await import("./page.command-4h4a8pnh.js")).PageCommand,
25
- context: async () => (await import("./context.command-0qx447mb.js")).ContextCommand,
26
- cloud: async () => (await import("./cloud.command-fcc8e8tp.js")).CloudCommand,
27
- subspace: async () => (await import("./subspace.command-baz73jpk.js")).SubspaceCommand,
28
- guideline: async () => (await import("./guideline.command-cv5bmrx2.js")).GuidelineCommand,
29
- scalar: async () => (await import("./scalar.command-20b8cy0k.js")).ScalarCommand,
30
- primitive: async () => (await import("./primitive.command-w6t0asqz.js")).PrimitiveCommand,
31
- quality: async () => (await import("./quality.command-77x7vbbx.js")).QualityCommand,
32
- repair: async () => (await import("./repair.command-y6sstev7.js")).RepairCommand,
33
- workflow: async () => (await import("./workflow.command-2djwmpqf.js")).WorkflowCommand,
34
- pipeline: async () => (await import("./pipeline.command-a2nrk26m.js")).PipelineCommand,
35
- tunnel: async () => (await import("./tunnel.command-2kw8vt9g.js")).TunnelCommand
16
+ workspace: async () => (await import("./workspace.command-1r9hvvw0.js")).WorkspaceCommand,
17
+ agent: async () => (await import("./agent.command-67ysh3n6.js")).AgentCommand,
18
+ code: async () => (await import("./code.command-ttk8tje2.js")).CodeCommand,
19
+ application: async () => (await import("./application.command-q0tqw5pc.js")).ApplicationCommand,
20
+ library: async () => (await import("./library.command-6amzsrb8.js")).LibraryCommand,
21
+ localRegistry: async () => (await import("./localRegistry.command-yqc0nyhh.js")).LocalRegistryCommand,
22
+ package: async () => (await import("./package.command-pwfvecjf.js")).PackageCommand,
23
+ module: async () => (await import("./module.command-10x6jv6c.js")).ModuleCommand,
24
+ page: async () => (await import("./page.command-ahhgx9y1.js")).PageCommand,
25
+ context: async () => (await import("./context.command-bdsk2z2r.js")).ContextCommand,
26
+ cloud: async () => (await import("./cloud.command-e7tkxyx6.js")).CloudCommand,
27
+ subspace: async () => (await import("./subspace.command-sc0t527y.js")).SubspaceCommand,
28
+ guideline: async () => (await import("./guideline.command-man90n70.js")).GuidelineCommand,
29
+ scalar: async () => (await import("./scalar.command-fprap51w.js")).ScalarCommand,
30
+ primitive: async () => (await import("./primitive.command-g5xwv6tj.js")).PrimitiveCommand,
31
+ quality: async () => (await import("./quality.command-fw9ck061.js")).QualityCommand,
32
+ repair: async () => (await import("./repair.command-g8kecj96.js")).RepairCommand,
33
+ workflow: async () => (await import("./workflow.command-j0jgkr13.js")).WorkflowCommand,
34
+ pipeline: async () => (await import("./pipeline.command-1ptr3e9y.js")).PipelineCommand,
35
+ tunnel: async () => (await import("./tunnel.command-mqnsqbwf.js")).TunnelCommand
36
36
  };
37
37
  var commandModuleIds = Object.keys(commandModules);
38
38
 
@@ -3,12 +3,12 @@ import {
3
3
  Lib,
4
4
  Workspace,
5
5
  command
6
- } from "./index-jw1zm273.js";
6
+ } from "./index-vkb9m4z7.js";
7
7
  import"./index-52w0fvh8.js";
8
- import"./index-va06nr10.js";
8
+ import"./index-g6ax17x4.js";
9
9
  import {
10
10
  LibraryScript
11
- } from "./index-pydbnfez.js";
11
+ } from "./index-9mt4smfy.js";
12
12
 
13
13
  // pkgs/@akanjs/cli/library/library.command.ts
14
14
  class LibraryCommand extends command("library", [LibraryScript], ({ public: target }) => ({
@@ -4,32 +4,32 @@ import {
4
4
  runner,
5
5
  script,
6
6
  command
7
- } from "./index-jw1zm273.js";
7
+ } from "./index-vkb9m4z7.js";
8
8
  import"./index-52w0fvh8.js";
9
9
  import {
10
10
  PkgExecutor
11
- } from "./index-va06nr10.js";
11
+ } from "./index-g6ax17x4.js";
12
12
  import"./index-5nd1wtkv.js";
13
- import"./index-vk0pa0mn.js";
13
+ import"./index-4v43h00g.js";
14
14
  import"./index-m9jj544v.js";
15
- import"./index-g1mbppa9.js";
16
- import"./index-192ha4xh.js";
17
- import"./index-pydbnfez.js";
15
+ import"./index-35m6bzm7.js";
16
+ import"./index-h3r3nr9y.js";
17
+ import"./index-9mt4smfy.js";
18
18
  import {
19
19
  ApplicationScript
20
- } from "./index-qtfmtcrw.js";
20
+ } from "./index-h6czey01.js";
21
21
  import"./index-7md2g9vw.js";
22
- import"./index-cpb3nvma.js";
22
+ import"./index-jrmzcp66.js";
23
23
  import {
24
24
  getNpmRegistryUrl,
25
25
  CloudRunner
26
- } from "./index-fyq1z6kt.js";
26
+ } from "./index-rc51f9ht.js";
27
27
  import"./index-tvehn2sp.js";
28
28
  import {
29
29
  PackageScript
30
- } from "./index-j237xtew.js";
31
- import"./index-35hc95h5.js";
32
- import"./index-665zp9rs.js";
30
+ } from "./index-ebarbgba.js";
31
+ import"./index-xsd96yzw.js";
32
+ import"./index-nx64dz92.js";
33
33
 
34
34
  // pkgs/@akanjs/cli/localRegistry/localRegistry.runner.ts
35
35
  import { mkdir, rm } from "fs/promises";
@@ -3,16 +3,16 @@ import {
3
3
  Sys,
4
4
  Module,
5
5
  command
6
- } from "./index-jw1zm273.js";
6
+ } from "./index-vkb9m4z7.js";
7
7
  import"./index-52w0fvh8.js";
8
- import"./index-va06nr10.js";
8
+ import"./index-g6ax17x4.js";
9
9
  import {
10
10
  renderPrimitiveReport
11
- } from "./index-trpasv9q.js";
12
- import"./index-86jt2a0e.js";
11
+ } from "./index-033wne2j.js";
12
+ import"./index-27y8t17p.js";
13
13
  import {
14
14
  ModuleScript
15
- } from "./index-fmzcs8v6.js";
15
+ } from "./index-p2r64bpa.js";
16
16
 
17
17
  // pkgs/@akanjs/cli/module/module.command.ts
18
18
  import { Logger, lowerlize } from "akanjs/common";
@@ -3,13 +3,13 @@ import {
3
3
  Pkg,
4
4
  Workspace,
5
5
  command
6
- } from "./index-jw1zm273.js";
6
+ } from "./index-vkb9m4z7.js";
7
7
  import"./index-52w0fvh8.js";
8
- import"./index-va06nr10.js";
8
+ import"./index-g6ax17x4.js";
9
9
  import"./index-tvehn2sp.js";
10
10
  import {
11
11
  PackageScript
12
- } from "./index-j237xtew.js";
12
+ } from "./index-ebarbgba.js";
13
13
 
14
14
  // pkgs/@akanjs/cli/package/package.command.ts
15
15
  class PackageCommand extends command("package", [PackageScript], ({ public: target }) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "3.1.0-rc.20",
3
+ "version": "3.1.0-rc.21",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -39,7 +39,7 @@
39
39
  "@earendil-works/pi-tui": "1.3.0",
40
40
  "@inquirer/prompts": "^8.7.3",
41
41
  "@tailwindcss/node": "^4.3.3",
42
- "akanjs": "3.1.0-rc.20",
42
+ "akanjs": "3.1.0-rc.21",
43
43
  "chalk": "^6.0.1",
44
44
  "commander": "^15.0.0",
45
45
  "dayjs": "^1.11.23",
@@ -3,12 +3,12 @@ import {
3
3
  App,
4
4
  Module,
5
5
  command
6
- } from "./index-jw1zm273.js";
6
+ } from "./index-vkb9m4z7.js";
7
7
  import"./index-52w0fvh8.js";
8
- import"./index-va06nr10.js";
8
+ import"./index-g6ax17x4.js";
9
9
  import {
10
10
  PageScript
11
- } from "./index-86jt2a0e.js";
11
+ } from "./index-27y8t17p.js";
12
12
 
13
13
  // pkgs/@akanjs/cli/page/page.command.ts
14
14
  class PageCommand extends command("page", [PageScript], ({ public: target }) => ({
@@ -4,7 +4,7 @@ import {
4
4
  runner,
5
5
  script,
6
6
  command
7
- } from "./index-jw1zm273.js";
7
+ } from "./index-vkb9m4z7.js";
8
8
  import {
9
9
  FileSys2
10
10
  } from "./index-52w0fvh8.js";
@@ -12,7 +12,7 @@ import {
12
12
  AkanAppConfig,
13
13
  AkanWorkspaceConfig,
14
14
  AppExecutor
15
- } from "./index-va06nr10.js";
15
+ } from "./index-g6ax17x4.js";
16
16
  import {
17
17
  resolveMobileTargets
18
18
  } from "./index-m9jj544v.js";
@@ -2,17 +2,17 @@
2
2
  import {
3
3
  Workspace,
4
4
  command
5
- } from "./index-jw1zm273.js";
5
+ } from "./index-vkb9m4z7.js";
6
6
  import"./index-52w0fvh8.js";
7
- import"./index-va06nr10.js";
7
+ import"./index-g6ax17x4.js";
8
8
  import {
9
9
  renderPrimitiveReport
10
- } from "./index-trpasv9q.js";
11
- import"./index-86jt2a0e.js";
12
- import"./index-fmzcs8v6.js";
10
+ } from "./index-033wne2j.js";
11
+ import"./index-27y8t17p.js";
12
+ import"./index-p2r64bpa.js";
13
13
  import {
14
14
  PrimitiveScript
15
- } from "./index-awbdfcf2.js";
15
+ } from "./index-4393nb4b.js";
16
16
 
17
17
  // pkgs/@akanjs/cli/primitive/primitive.command.ts
18
18
  import { Logger } from "akanjs/common";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  ProjectTypecheck2
4
- } from "./index-va06nr10.js";
4
+ } from "./index-g6ax17x4.js";
5
5
  export {
6
6
  ProjectTypecheck2 as ProjectTypecheck
7
7
  };
@@ -3,7 +3,7 @@ import {
3
3
  Workspace,
4
4
  script,
5
5
  command
6
- } from "./index-jw1zm273.js";
6
+ } from "./index-vkb9m4z7.js";
7
7
  import"./index-52w0fvh8.js";
8
8
  import {
9
9
  rootAllowedFiles,
@@ -12,7 +12,7 @@ import {
12
12
  libFacetRootHintOf,
13
13
  facetIndexShadowOf,
14
14
  rootEntryHintOf
15
- } from "./index-va06nr10.js";
15
+ } from "./index-g6ax17x4.js";
16
16
 
17
17
  // pkgs/@akanjs/devkit/qualityScanner.ts
18
18
  import { createHash } from "crypto";
@@ -3,15 +3,15 @@ import {
3
3
  Workspace,
4
4
  script,
5
5
  command
6
- } from "./index-jw1zm273.js";
6
+ } from "./index-vkb9m4z7.js";
7
7
  import"./index-52w0fvh8.js";
8
- import"./index-va06nr10.js";
8
+ import"./index-g6ax17x4.js";
9
9
  import"./index-hj6w4ka1.js";
10
- import"./index-trpasv9q.js";
11
- import"./index-5edzv8fn.js";
10
+ import"./index-033wne2j.js";
11
+ import"./index-nv79n88g.js";
12
12
  import {
13
13
  RepairRunner
14
- } from "./index-j4mkhz93.js";
14
+ } from "./index-pg1t468s.js";
15
15
 
16
16
  // pkgs/@akanjs/cli/repair/repair.script.ts
17
17
  import { Logger } from "akanjs/common";
@@ -2,15 +2,15 @@
2
2
  import {
3
3
  Sys,
4
4
  command
5
- } from "./index-jw1zm273.js";
5
+ } from "./index-vkb9m4z7.js";
6
6
  import"./index-52w0fvh8.js";
7
- import"./index-va06nr10.js";
7
+ import"./index-g6ax17x4.js";
8
8
  import {
9
9
  renderPrimitiveReport
10
- } from "./index-trpasv9q.js";
10
+ } from "./index-033wne2j.js";
11
11
  import {
12
12
  ScalarScript
13
- } from "./index-1p98exm2.js";
13
+ } from "./index-g9ks2k8c.js";
14
14
 
15
15
  // pkgs/@akanjs/cli/scalar/scalar.command.ts
16
16
  import { Logger, lowerlize } from "akanjs/common";
@@ -5,7 +5,7 @@ import {
5
5
  runner,
6
6
  script,
7
7
  command
8
- } from "./index-jw1zm273.js";
8
+ } from "./index-vkb9m4z7.js";
9
9
  import {
10
10
  FileSys2
11
11
  } from "./index-52w0fvh8.js";
@@ -14,20 +14,20 @@ import {
14
14
  Executor,
15
15
  WorkspaceExecutor,
16
16
  AppExecutor
17
- } from "./index-va06nr10.js";
17
+ } from "./index-g6ax17x4.js";
18
18
  import {
19
19
  GlobalConfig
20
- } from "./index-cpb3nvma.js";
20
+ } from "./index-jrmzcp66.js";
21
21
  import"./index-m9jj544v.js";
22
- import"./index-g1mbppa9.js";
23
- import"./index-192ha4xh.js";
22
+ import"./index-35m6bzm7.js";
23
+ import"./index-h3r3nr9y.js";
24
24
  import {
25
25
  SubspaceConfig
26
26
  } from "./index-4pf8g7ff.js";
27
27
  import {
28
28
  SlicePlanner
29
- } from "./index-35hc95h5.js";
30
- import"./index-665zp9rs.js";
29
+ } from "./index-xsd96yzw.js";
30
+ import"./index-nx64dz92.js";
31
31
 
32
32
  // pkgs/@akanjs/devkit/subspace.ts
33
33
  import { mkdir as mkdir2 } from "fs/promises";
@@ -825,7 +825,7 @@ class SubspaceRunner extends runner("subspace") {
825
825
  if (!asked)
826
826
  return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
827
827
  const { libs } = await subspace.slice();
828
- const { CloudScript } = await import("./cloud.script-1xt3tnts.js");
828
+ const { CloudScript } = await import("./cloud.script-krzh3d7k.js");
829
829
  const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
830
830
  host,
831
831
  workspaceId,
@@ -0,0 +1,23 @@
1
+ import type { AppInfo, LibInfo } from "akanjs";
2
+
3
+ interface Dict {
4
+ migrationId: string;
5
+ title: string;
6
+ }
7
+ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
8
+ return `import { migration } from "akanjs/server";
9
+
10
+ export default migration(${JSON.stringify(dict.title)})
11
+ .plan(async ({ table }) => {
12
+ // TODO: count the rows apply changes, and list each decision a person approves
13
+ return { summary: {}, items: [] };
14
+ })
15
+ .apply(async ({ table }, { items }) => {
16
+ // TODO: write through table(refName), so every change is logged and a rollback can undo it
17
+ })
18
+ .verify(async ({ table }) => {
19
+ // TODO: one line per row apply left wrong; none means the data is as intended
20
+ return [];
21
+ });
22
+ `;
23
+ }
@@ -6,7 +6,7 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { [
6
6
  const databaseModules = [...scanInfo.database.entries()].filter(([_, files]) => files.has("service"));
7
7
  const serviceModules = [...scanInfo.service.entries()].filter(([_, files]) => files.has("service"));
8
8
  const scalarModules = [...scanInfo.scalar.entries()];
9
- return `import { ${scanInfo.type === "app" ? "AkanServer, " : ""}AkanLib } from "akanjs/server";
9
+ return `import { ${scanInfo.type === "app" ? "AkanServer, " : ""}AkanLib${scanInfo.type === "app" ? ", Migrations" : ""} } from "akanjs/server";
10
10
  import * as cnst from "./lib/cnst";
11
11
  import * as db from "./lib/db";
12
12
  import * as sig from "./lib/sig";
@@ -29,6 +29,13 @@ ${scalarModules.map(([model]) => ` { constant: cnst.${model}, database: db.${
29
29
  });
30
30
 
31
31
  ${scanInfo.type === "app" ? `export const server = new AkanServer("${scanInfo.name}", env, undefined${libs.length ? `, ${libs.join(", ")}` : ""}, lib);` : ""}
32
+ ${
33
+ scanInfo.type === "app"
34
+ ? `export const migrations = new Migrations([
35
+ ${scanInfo.migrations.map(({ id, checksum }) => ` { id: "${id}", checksum: "${checksum}", load: () => import("./script/migration/${id}") },`).join("\n")}
36
+ ]);`
37
+ : ""
38
+ }
32
39
 
33
40
  ${scanInfo.type === "lib" ? `export { env } from "./env/env.server.testing";` : ""}
34
41
  export * as db from "./lib/db";
@@ -4,25 +4,25 @@ import {
4
4
  runner,
5
5
  script,
6
6
  command
7
- } from "./index-jw1zm273.js";
7
+ } from "./index-vkb9m4z7.js";
8
8
  import"./index-52w0fvh8.js";
9
9
  import {
10
10
  AppExecutor
11
- } from "./index-va06nr10.js";
11
+ } from "./index-g6ax17x4.js";
12
12
  import {
13
13
  GlobalConfig,
14
14
  CloudApi
15
- } from "./index-cpb3nvma.js";
15
+ } from "./index-jrmzcp66.js";
16
16
  import"./index-m9jj544v.js";
17
- import"./index-g1mbppa9.js";
18
- import"./index-192ha4xh.js";
17
+ import"./index-35m6bzm7.js";
18
+ import"./index-h3r3nr9y.js";
19
19
  import {
20
20
  TunnelShare2
21
- } from "./index-qwa5k1j8.js";
21
+ } from "./index-48edp6q4.js";
22
22
  import {
23
23
  writeClipboard
24
24
  } from "./index-p6pbz9n5.js";
25
- import"./index-665zp9rs.js";
25
+ import"./index-nx64dz92.js";
26
26
 
27
27
  // pkgs/@akanjs/cli/tunnel/tunnel.script.ts
28
28
  import { select } from "@inquirer/prompts";