@akanjs/cli 3.0.0-alpha.11 → 3.0.0-alpha.111

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 (140) hide show
  1. package/.build-stamp +1 -1
  2. package/README.ko.md +1 -1
  3. package/README.md +1 -1
  4. package/{abstractCompactor-e5yq60qz.js → abstractCompactor-mjh5ppsq.js} +3 -5
  5. package/{agent.command-a3n15c6t.js → agent.command-d2gfxfck.js} +11 -13
  6. package/{application.command-rdm3et0g.js → application.command-pj2m7584.js} +65 -38
  7. package/{applicationBuildRunner-6m8n71w4.js → applicationBuildRunner-kxwbssgn.js} +27 -23
  8. package/{applicationReleasePackager-gg8ccbeh.js → applicationReleasePackager-4yasxwv9.js} +8 -9
  9. package/buildBatch.proc.js +12 -14
  10. package/capacitorApp-36rbr858.js +12 -0
  11. package/{cloud.command-56aeekqn.js → cloud.command-gxqp8xdv.js} +15 -18
  12. package/commandManifest.json +1 -1
  13. package/{context.command-ysxawe7h.js → context.command-ez8a0zyz.js} +19 -23
  14. package/dependencyScanner-shs82ynp.js +8 -0
  15. package/devTui-40ggmd99.js +553 -0
  16. package/devTuiView-c08ccbat.js +9 -0
  17. package/getDirname-dr3jz1xg.js +7 -0
  18. package/{guideline.command-yqf9a372.js → guideline.command-xmqwx8zm.js} +24 -22
  19. package/guidelines/agentRule/agentRule.generate.json +31 -0
  20. package/guidelines/agentRule/agentRule.instruction.md +531 -0
  21. package/guidelines/conventions/conventions.instruction.md +493 -369
  22. package/guidelines/framework/framework.generate.json +3 -2
  23. package/guidelines/framework/framework.instruction.md +0 -9
  24. package/guidelines/mcpRule/mcpRule.generate.json +35 -0
  25. package/guidelines/mcpRule/mcpRule.instruction.md +460 -0
  26. package/guidelines/modelStore/modelStore.instruction.md +12 -0
  27. package/guidelines/modelTemplate/modelTemplate.instruction.md +5 -0
  28. package/guidelines/queryRule/queryRule.generate.json +31 -0
  29. package/guidelines/queryRule/queryRule.instruction.md +178 -0
  30. package/guidelines/runtimeRule/runtimeRule.generate.json +25 -0
  31. package/guidelines/runtimeRule/runtimeRule.instruction.md +220 -0
  32. package/guidelines/ssrRule/ssrRule.instruction.md +51 -5
  33. package/guidelines/transportRule/transportRule.generate.json +31 -0
  34. package/guidelines/transportRule/transportRule.instruction.md +60 -0
  35. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +54 -764
  36. package/guidelines/workspaceRecipes/workspaceRecipes.generate.json +33 -0
  37. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +467 -0
  38. package/incrementalBuilder.proc.js +26 -25
  39. package/{index-8pd02prk.js → index-259dsnz3.js} +58 -25
  40. package/{index-yzsxc30b.js → index-2tv3fdx4.js} +975 -234
  41. package/index-3d9y066c.js +76 -0
  42. package/{index-76rn3g2c.js → index-47pj3aee.js} +4 -4
  43. package/{index-m90fn8xe.js → index-4edzf1gr.js} +32 -32
  44. package/{index-3789fdpg.js → index-600zhnve.js} +94 -61
  45. package/{index-1577bej2.js → index-6wwzs1bc.js} +2 -2
  46. package/{index-cv9cxs5k.js → index-7737gxcp.js} +18 -18
  47. package/{index-a5cs7d8r.js → index-8few9nyh.js} +13 -13
  48. package/{index-mewacxye.js → index-8pm30m73.js} +57 -57
  49. package/{index-wnp7hwq7.js → index-92zztqy1.js} +7 -7
  50. package/{index-fgc8r6dj.js → index-a5vmm6x4.js} +3 -1
  51. package/{index-cav1azma.js → index-a64esmtb.js} +1106 -1369
  52. package/{index-nwqqssnb.js → index-aj7tyh5w.js} +26 -23
  53. package/{index-xys926f2.js → index-by5gpp8x.js} +4 -4
  54. package/{index-yzmqvg23.js → index-fz5q3gd7.js} +8 -8
  55. package/{index-kcsa1zff.js → index-gyd220p2.js} +4 -4
  56. package/{index-j37qq1f2.js → index-h7yw2z9n.js} +7 -7
  57. package/{index-bjpxzr6s.js → index-hwkygn9s.js} +51 -3
  58. package/index-j9yhg404.js +159 -0
  59. package/{index-46tjzh6s.js → index-kcxmv48c.js} +29 -29
  60. package/{index-0cj2zxbm.js → index-kn1h7p1x.js} +12 -11
  61. package/{index-e4b2ae6b.js → index-ktb5njgy.js} +41 -34
  62. package/{index-etwh7sd3.js → index-mak3cd28.js} +100 -32
  63. package/{index-xjd3rqzj.js → index-n68jx79w.js} +6 -15
  64. package/{index-z1s5f4e0.js → index-ne2qy0nk.js} +36 -37
  65. package/{index-65aeh789.js → index-pnqbkf5p.js} +1 -1
  66. package/{index-67546d0j.js → index-q0y2jq9j.js} +14 -2
  67. package/{index-4mgkgba3.js → index-rwg2aa4f.js} +14 -14
  68. package/{index-bzznxgcx.js → index-v0qh106m.js} +1002 -128
  69. package/{index-j9cxndc0.js → index-w8kmx1b6.js} +20 -11
  70. package/{index-h5whaj26.js → index-ws5e0j51.js} +16 -12
  71. package/{index-9va8zayb.js → index-wt7qrtd4.js} +27 -27
  72. package/index.js +22 -25
  73. package/{library.command-x6t29a30.js → library.command-nbsky672.js} +11 -10
  74. package/{localRegistry.command-649g1n7b.js → localRegistry.command-ts6t5e5a.js} +20 -23
  75. package/{module.command-8w8ys5t3.js → module.command-29vqzrh8.js} +13 -16
  76. package/{package.command-zgy7f3fz.js → package.command-axv0abmn.js} +8 -10
  77. package/package.json +5 -7
  78. package/{page.command-yjmnkyk2.js → page.command-vs9s3zrh.js} +7 -9
  79. package/{primitive.command-gfqaagsg.js → primitive.command-cbxmqbtc.js} +13 -16
  80. package/{quality.command-ec8r1dn3.js → quality.command-gmbs7nws.js} +184 -334
  81. package/recipeScanner-fpagtgc1.js +11 -0
  82. package/{repair.command-p9ey6mkm.js → repair.command-bqsjptsj.js} +12 -14
  83. package/{routeSourceValidator-e4jmbfcx.js → routeSourceValidator-apyqw7wk.js} +90 -19
  84. package/{scalar.command-9dhmqhtm.js → scalar.command-6k1vhe9s.js} +11 -14
  85. package/subspace.command-35a3t6vv.js +755 -0
  86. package/templates/app/env/env.client.debug.ts.template +1 -5
  87. package/templates/app/env/env.client.develop.ts.template +1 -5
  88. package/templates/app/env/env.client.local.ts.template +1 -5
  89. package/templates/app/env/env.client.main.ts.template +1 -5
  90. package/templates/app/env/env.client.testing.ts.template +1 -5
  91. package/templates/app/env/env.client.type.ts +2 -6
  92. package/templates/app/env/env.server.debug.ts.template +1 -5
  93. package/templates/app/env/env.server.develop.ts.template +1 -5
  94. package/templates/app/env/env.server.local.ts.template +1 -5
  95. package/templates/app/env/env.server.main.ts.template +1 -5
  96. package/templates/app/main.ts +3 -1
  97. package/templates/app/page/_index.tsx +3 -3
  98. package/templates/app/page/_layout.tsx +31 -32
  99. package/templates/appSample/lib/task/task.signal.ts +11 -6
  100. package/templates/appSample/page/task/[taskId]/_index.tsx +22 -27
  101. package/templates/appSample/page/task/[taskId]/edit.tsx +25 -30
  102. package/templates/appSample/page/task/_index.tsx +3 -7
  103. package/templates/appSample/page/task/_layout.tsx +4 -15
  104. package/templates/appSample/page/task/new.tsx +4 -10
  105. package/templates/appSample/srvkit/AuthGuard.ts +2 -2
  106. package/templates/crudPages/[__model__Id]/edit/page.tsx +27 -29
  107. package/templates/crudPages/[__model__Id]/page.tsx +24 -32
  108. package/templates/crudPages/new/page.tsx +26 -25
  109. package/templates/crudPages/page.tsx +27 -26
  110. package/templates/crudSinglePage/page.tsx +26 -21
  111. package/templates/env/_env.server.type.ts +7 -5
  112. package/templates/lib/db.ts +1 -1
  113. package/templates/lib/dict.ts +1 -1
  114. package/templates/lib/sig.ts +5 -1
  115. package/templates/lib/srv.ts +6 -2
  116. package/templates/module/__model__.dictionary.ts +4 -1
  117. package/templates/module/__model__.signal.ts +2 -3
  118. package/templates/module/__model__.store.ts +1 -2
  119. package/templates/workspaceRoot/.gitignore.template +0 -1
  120. package/templates/workspaceRoot/.husky/pre-commit.template +16 -0
  121. package/templates/workspaceRoot/.vscode/settings.json.template +1 -1
  122. package/templates/workspaceRoot/AGENTS.md.template +4 -0
  123. package/templates/workspaceRoot/CLAUDE.md.template +19 -0
  124. package/templates/workspaceRoot/biome.json.template +1 -1
  125. package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +10 -14
  126. package/templates/workspaceRoot/docs/GENERATED.md.template +12 -10
  127. package/templates/workspaceRoot/package.json.template +2 -4
  128. package/typeChecker-3xgrzc2v.js +7 -0
  129. package/typecheck.proc.js +4 -5
  130. package/{workflow.command-ycwc6zr6.js → workflow.command-nwpcdc8p.js} +22 -25
  131. package/{workspace.command-xhyhajxa.js → workspace.command-aczjxzbf.js} +64 -66
  132. package/capacitorApp-mr81qdxq.js +0 -61
  133. package/dependencyScanner-f6grrep3.js +0 -9
  134. package/getDirname-m9s0cmhq.js +0 -8
  135. package/index-mxvakhsm.js +0 -66
  136. package/index-r24hmh0q.js +0 -4
  137. package/recipeScanner-tghkzrrt.js +0 -12
  138. package/typeChecker-kravn7ns.js +0 -8
  139. /package/{index-0wae5ebk.js → index-meh558jy.js} +0 -0
  140. /package/{index-ss469dec.js → index-nz8prx9g.js} +0 -0
@@ -0,0 +1,11 @@
1
+ // @bun
2
+ import {
3
+ collectRecipeSources2,
4
+ scanRecipes2,
5
+ findInlineRecipeDuplicates2
6
+ } from "./index-by5gpp8x.js";
7
+ export {
8
+ collectRecipeSources2 as collectRecipeSources,
9
+ findInlineRecipeDuplicates2 as findInlineRecipeDuplicates,
10
+ scanRecipes2 as scanRecipes
11
+ };
@@ -1,20 +1,18 @@
1
1
  // @bun
2
- import {
3
- RepairRunner
4
- } from "./index-yzmqvg23.js";
5
- import"./index-e4b2ae6b.js";
6
- import"./index-kcsa1zff.js";
7
2
  import {
8
3
  Workspace,
9
- command,
10
- script
11
- } from "./index-etwh7sd3.js";
12
- import"./index-yzsxc30b.js";
13
- import"./index-mxvakhsm.js";
14
- import"./index-xys926f2.js";
15
- import"./index-1577bej2.js";
16
- import"./index-67546d0j.js";
17
- import"./index-r24hmh0q.js";
4
+ script,
5
+ command
6
+ } from "./index-mak3cd28.js";
7
+ import"./index-q0y2jq9j.js";
8
+ import"./index-2tv3fdx4.js";
9
+ import"./index-6wwzs1bc.js";
10
+ import"./index-by5gpp8x.js";
11
+ import"./index-gyd220p2.js";
12
+ import"./index-ktb5njgy.js";
13
+ import {
14
+ RepairRunner
15
+ } from "./index-fz5q3gd7.js";
18
16
 
19
17
  // pkgs/@akanjs/cli/repair/repair.script.ts
20
18
  import { Logger } from "akanjs/common";
@@ -1,9 +1,8 @@
1
1
  // @bun
2
- import"./index-r24hmh0q.js";
3
-
4
2
  // pkgs/@akanjs/devkit/routeSourceValidator.ts
5
3
  import { getRouteExports } from "akanjs/common";
6
4
  import ts from "typescript";
5
+ var chainRoots = new Set(["page", "layout", "rootLayout"]);
7
6
 
8
7
  class RouteSourceValidator {
9
8
  static validateRouteSourceExports(source, filePath, kind, options = {}) {
@@ -64,7 +63,74 @@ class RouteSourceValidator {
64
63
  if (exported.has("metadata") && exported.has("generateMetadata")) {
65
64
  throw new Error(`[route-convention] metadata and generateMetadata cannot both be exported in ${filePath}`);
66
65
  }
67
- return { devOnly: RouteSourceValidator.#readDevOnly(sourceFile, filePath) };
66
+ const chain = RouteSourceValidator.#readChain(sourceFile, filePath);
67
+ if (!chain)
68
+ return { devOnly: RouteSourceValidator.#readDevOnly(sourceFile, filePath) };
69
+ const named = [...exported].filter((name) => name !== "default");
70
+ if (named.length)
71
+ throw new Error(`[route-convention] ${filePath} exports ${named.join(", ")} beside its ${chain.kind}() chain \u2014 every route setting is a stage of the chain`);
72
+ if (kind === "page" && chain.kind !== "page")
73
+ throw new Error(`[route-convention] ${filePath} is a page file but exports ${chain.kind}()`);
74
+ if (kind === "layout" && chain.kind === "page")
75
+ throw new Error(`[route-convention] ${filePath} is a layout file but exports page()`);
76
+ if (options.pattern)
77
+ RouteSourceValidator.#assertChainParams(chain, options.pattern, filePath);
78
+ return {
79
+ devOnly: chain.devOnly,
80
+ chain: { kind: chain.kind, params: chain.params, ...chain.prompt ? { prompt: chain.prompt } : {} }
81
+ };
82
+ }
83
+ static #readChain(sourceFile, filePath) {
84
+ for (const statement of sourceFile.statements) {
85
+ if (!ts.isExportAssignment(statement) || statement.isExportEquals)
86
+ continue;
87
+ let node = RouteSourceValidator.#unwrapExpression(statement.expression);
88
+ const stages = [];
89
+ while (node && ts.isCallExpression(node)) {
90
+ const callee = node.expression;
91
+ if (ts.isPropertyAccessExpression(callee)) {
92
+ stages.unshift({ name: callee.name.text, args: node.arguments });
93
+ node = callee.expression;
94
+ continue;
95
+ }
96
+ if (ts.isIdentifier(callee) && chainRoots.has(callee.text))
97
+ return RouteSourceValidator.#chainOf(callee.text, stages, filePath);
98
+ return null;
99
+ }
100
+ return null;
101
+ }
102
+ return null;
103
+ }
104
+ static #chainOf(kind, stages, filePath) {
105
+ const params = [];
106
+ let prompt;
107
+ let devOnly = false;
108
+ const literal = (stage) => {
109
+ const first = stage.args[0];
110
+ if (!first || !ts.isStringLiteralLike(first))
111
+ throw new Error(`[route-convention] .${stage.name}() takes a string literal first in ${filePath} \u2014 the build reads it without evaluating the module`);
112
+ return first.text;
113
+ };
114
+ for (const stage of stages) {
115
+ if (stage.name === "param")
116
+ params.push(literal(stage));
117
+ else if (stage.name === "prompt")
118
+ prompt = literal(stage);
119
+ else if (stage.name === "config")
120
+ devOnly = RouteSourceValidator.#devOnlyOf(RouteSourceValidator.#unwrapExpression(stage.args[0]), filePath);
121
+ }
122
+ return { kind, params, prompt, devOnly };
123
+ }
124
+ static #assertChainParams(chain, pattern, filePath) {
125
+ const inPath = pattern.split("/").filter((part) => part.startsWith(":")).map((part) => part.slice(1)).filter((name) => name !== "lang");
126
+ if (chain.params.includes("lang"))
127
+ throw new Error(`[route-convention] ${filePath} declares .param("lang"), which every route receives undeclared`);
128
+ const unknown = chain.params.find((name) => !inPath.includes(name));
129
+ if (unknown)
130
+ throw new Error(`[route-convention] ${filePath} declares .param("${unknown}") but no [${unknown}] segment is in its path`);
131
+ const undeclared = inPath.find((name) => !chain.params.includes(name));
132
+ if (chain.kind === "page" && undeclared)
133
+ throw new Error(`[route-convention] ${filePath} sits under [${undeclared}] but declares no .param("${undeclared}") \u2014 a page reads only what it declares`);
68
134
  }
69
135
  static #readDevOnly(sourceFile, filePath) {
70
136
  for (const statement of sourceFile.statements) {
@@ -77,26 +143,31 @@ class RouteSourceValidator {
77
143
  if (!ts.isIdentifier(declaration.name) || declaration.name.text !== "pageConfig")
78
144
  continue;
79
145
  const initializer = RouteSourceValidator.#unwrapExpression(declaration.initializer);
80
- if (!initializer || !ts.isObjectLiteralExpression(initializer))
81
- continue;
82
- for (const property of initializer.properties) {
83
- if (!ts.isPropertyAssignment(property))
84
- continue;
85
- const name = property.name;
86
- const key = ts.isIdentifier(name) ? name.text : ts.isStringLiteral(name) ? name.text : null;
87
- if (key !== "devOnly")
88
- continue;
89
- const value = RouteSourceValidator.#unwrapExpression(property.initializer);
90
- if (value?.kind === ts.SyntaxKind.TrueKeyword)
91
- return true;
92
- if (value?.kind === ts.SyntaxKind.FalseKeyword)
93
- return false;
94
- throw new Error(`[route-convention] pageConfig.devOnly must be a literal true or false in ${filePath} \u2014 the build reads it without evaluating the module`);
95
- }
146
+ if (initializer && ts.isObjectLiteralExpression(initializer))
147
+ return RouteSourceValidator.#devOnlyOf(initializer, filePath);
96
148
  }
97
149
  }
98
150
  return false;
99
151
  }
152
+ static #devOnlyOf(config, filePath) {
153
+ if (!config || !ts.isObjectLiteralExpression(config))
154
+ return false;
155
+ for (const property of config.properties) {
156
+ if (!ts.isPropertyAssignment(property))
157
+ continue;
158
+ const name = property.name;
159
+ const key = ts.isIdentifier(name) ? name.text : ts.isStringLiteral(name) ? name.text : null;
160
+ if (key !== "devOnly")
161
+ continue;
162
+ const value = RouteSourceValidator.#unwrapExpression(property.initializer);
163
+ if (value?.kind === ts.SyntaxKind.TrueKeyword)
164
+ return true;
165
+ if (value?.kind === ts.SyntaxKind.FalseKeyword)
166
+ return false;
167
+ throw new Error(`[route-convention] devOnly must be a literal true or false in ${filePath} \u2014 the build reads it without evaluating the module`);
168
+ }
169
+ return false;
170
+ }
100
171
  static #unwrapExpression(expression) {
101
172
  let current = expression;
102
173
  while (current && (ts.isAsExpression(current) || ts.isSatisfiesExpression(current) || ts.isParenthesizedExpression(current))) {
@@ -1,22 +1,19 @@
1
1
  // @bun
2
2
  import {
3
- ScalarScript
4
- } from "./index-4mgkgba3.js";
5
- import"./index-ss469dec.js";
6
- import"./index-0cj2zxbm.js";
3
+ Sys,
4
+ command
5
+ } from "./index-mak3cd28.js";
6
+ import"./index-q0y2jq9j.js";
7
+ import"./index-2tv3fdx4.js";
8
+ import"./index-6wwzs1bc.js";
7
9
  import {
8
10
  renderPrimitiveReport
9
- } from "./index-kcsa1zff.js";
10
- import"./index-j37qq1f2.js";
11
+ } from "./index-gyd220p2.js";
12
+ import"./index-kn1h7p1x.js";
13
+ import"./index-h7yw2z9n.js";
11
14
  import {
12
- Sys,
13
- command
14
- } from "./index-etwh7sd3.js";
15
- import"./index-yzsxc30b.js";
16
- import"./index-mxvakhsm.js";
17
- import"./index-1577bej2.js";
18
- import"./index-67546d0j.js";
19
- import"./index-r24hmh0q.js";
15
+ ScalarScript
16
+ } from "./index-rwg2aa4f.js";
20
17
 
21
18
  // pkgs/@akanjs/cli/scalar/scalar.command.ts
22
19
  import { Logger, lowerlize } from "akanjs/common";