@akanjs/cli 3.0.0-alpha.10 → 3.0.0-alpha.101

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 (135) 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-byytxs22.js} +3 -5
  5. package/{agent.command-f0gqkfgz.js → agent.command-v1a4746v.js} +11 -13
  6. package/{application.command-x903m2qq.js → application.command-fzdcnzhg.js} +65 -38
  7. package/{applicationBuildRunner-ha3y8ew8.js → applicationBuildRunner-s4gsk728.js} +27 -23
  8. package/{applicationReleasePackager-gg8ccbeh.js → applicationReleasePackager-28v9vbzk.js} +8 -9
  9. package/buildBatch.proc.js +12 -14
  10. package/capacitorApp-8d6d4zkm.js +12 -0
  11. package/{cloud.command-zs6kyf83.js → cloud.command-wygy2z05.js} +15 -18
  12. package/commandManifest.json +1 -1
  13. package/{context.command-fmepgjzg.js → context.command-4vdt1aqq.js} +19 -23
  14. package/dependencyScanner-shs82ynp.js +8 -0
  15. package/devTui-qnf1txdz.js +553 -0
  16. package/devTuiView-yzct2cq6.js +9 -0
  17. package/getDirname-dr3jz1xg.js +7 -0
  18. package/{guideline.command-n6sw0a0c.js → guideline.command-p92dq6ts.js} +16 -18
  19. package/guidelines/agentRule/agentRule.generate.json +31 -0
  20. package/guidelines/agentRule/agentRule.instruction.md +533 -0
  21. package/guidelines/conventions/conventions.instruction.md +447 -197
  22. package/guidelines/cssRule/cssRule.instruction.md +7 -0
  23. package/guidelines/framework/framework.generate.json +3 -2
  24. package/guidelines/framework/framework.instruction.md +1 -9
  25. package/guidelines/mcpRule/mcpRule.generate.json +35 -0
  26. package/guidelines/mcpRule/mcpRule.instruction.md +366 -0
  27. package/guidelines/modelStore/modelStore.instruction.md +12 -0
  28. package/guidelines/modelTemplate/modelTemplate.instruction.md +5 -0
  29. package/guidelines/queryRule/queryRule.generate.json +31 -0
  30. package/guidelines/queryRule/queryRule.instruction.md +178 -0
  31. package/guidelines/runtimeRule/runtimeRule.generate.json +25 -0
  32. package/guidelines/runtimeRule/runtimeRule.instruction.md +220 -0
  33. package/guidelines/ssrRule/ssrRule.instruction.md +49 -5
  34. package/guidelines/transportRule/transportRule.generate.json +31 -0
  35. package/guidelines/transportRule/transportRule.instruction.md +60 -0
  36. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +51 -760
  37. package/guidelines/workspaceRecipes/workspaceRecipes.generate.json +33 -0
  38. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +402 -0
  39. package/incrementalBuilder.proc.js +26 -25
  40. package/{index-jf2ya7r2.js → index-0amdxycf.js} +8 -8
  41. package/{index-779ske1y.js → index-1yxtbmbj.js} +27 -27
  42. package/{index-eyyf2149.js → index-29sxqfaw.js} +36 -37
  43. package/index-3d9y066c.js +76 -0
  44. package/{index-76rn3g2c.js → index-47pj3aee.js} +4 -4
  45. package/index-5svjba73.js +159 -0
  46. package/{index-1577bej2.js → index-6wwzs1bc.js} +2 -2
  47. package/{index-gcv8ncfh.js → index-7d6vny25.js} +16 -12
  48. package/{index-y4vkyhvv.js → index-8p8p0cf8.js} +14 -14
  49. package/{index-wnp7hwq7.js → index-92zztqy1.js} +7 -7
  50. package/{index-fgc8r6dj.js → index-a5vmm6x4.js} +3 -1
  51. package/{index-xys926f2.js → index-by5gpp8x.js} +4 -4
  52. package/{index-0cj2zxbm.js → index-c69j78kk.js} +12 -11
  53. package/{index-rxkpk7n4.js → index-fc1bh0a7.js} +4 -4
  54. package/{index-d43t8af2.js → index-gq44bqjt.js} +58 -25
  55. package/{index-774gcx29.js → index-gtmz74tj.js} +41 -34
  56. package/{index-j37qq1f2.js → index-h7yw2z9n.js} +7 -7
  57. package/{index-bjpxzr6s.js → index-hwkygn9s.js} +51 -3
  58. package/{index-xmmzf150.js → index-hyywke0f.js} +1 -1
  59. package/{index-46tjzh6s.js → index-kcxmv48c.js} +29 -29
  60. package/{index-xjd3rqzj.js → index-n68jx79w.js} +6 -15
  61. package/{index-qb61h0k7.js → index-p5neav9b.js} +1098 -1360
  62. package/{index-67546d0j.js → index-q0y2jq9j.js} +14 -2
  63. package/{index-3vta1tqa.js → index-qkk27bk6.js} +32 -32
  64. package/{index-z8ptfkzv.js → index-qsq3q8fy.js} +975 -242
  65. package/{index-qzdjd4ct.js → index-srdssqj7.js} +18 -18
  66. package/{index-j9cxndc0.js → index-w8kmx1b6.js} +20 -11
  67. package/{index-82jrh4hj.js → index-yks023mb.js} +13 -13
  68. package/{index-5sn5w2mt.js → index-yza7zkpt.js} +94 -61
  69. package/{index-jhpa13zj.js → index-zmjppp25.js} +57 -57
  70. package/{index-kdh76j26.js → index-znynzt5w.js} +100 -32
  71. package/{index-4m0bphac.js → index-zxgr3s8s.js} +31 -30
  72. package/{index-62955kn5.js → index-zz5jyd94.js} +1002 -128
  73. package/index.js +22 -25
  74. package/{library.command-cv9gdbmg.js → library.command-s4fszngs.js} +11 -10
  75. package/{localRegistry.command-d8fg36zc.js → localRegistry.command-gyw4da9z.js} +20 -23
  76. package/{module.command-qyr1s9cn.js → module.command-6n7dwvav.js} +13 -16
  77. package/{package.command-wsjx0k47.js → package.command-gr82ypnr.js} +8 -10
  78. package/package.json +5 -7
  79. package/{page.command-rdzg65rm.js → page.command-7gvgb3jb.js} +7 -9
  80. package/{primitive.command-89g38b53.js → primitive.command-tk5ckw38.js} +13 -16
  81. package/{quality.command-0cs2z92d.js → quality.command-38v81baf.js} +226 -105
  82. package/recipeScanner-fpagtgc1.js +11 -0
  83. package/{repair.command-6fphxfwj.js → repair.command-5xbwvsxp.js} +12 -14
  84. package/{routeSourceValidator-e4jmbfcx.js → routeSourceValidator-ze6x894c.js} +0 -2
  85. package/{scalar.command-xfer69s6.js → scalar.command-0epwcr5k.js} +11 -14
  86. package/subspace.command-e2t36xb2.js +755 -0
  87. package/templates/app/env/env.client.debug.ts.template +1 -5
  88. package/templates/app/env/env.client.develop.ts.template +1 -5
  89. package/templates/app/env/env.client.local.ts.template +1 -5
  90. package/templates/app/env/env.client.main.ts.template +1 -5
  91. package/templates/app/env/env.client.testing.ts.template +1 -5
  92. package/templates/app/env/env.client.type.ts +2 -6
  93. package/templates/app/env/env.server.debug.ts.template +1 -5
  94. package/templates/app/env/env.server.develop.ts.template +1 -5
  95. package/templates/app/env/env.server.local.ts.template +1 -5
  96. package/templates/app/env/env.server.main.ts.template +1 -5
  97. package/templates/app/main.ts +3 -1
  98. package/templates/appSample/lib/task/task.signal.ts +11 -6
  99. package/templates/appSample/srvkit/AuthGuard.ts +9 -5
  100. package/templates/appSample/srvkit/SessionInternalArg.ts +4 -3
  101. package/templates/crudPages/[__model__Id]/edit/page.tsx +5 -5
  102. package/templates/crudPages/[__model__Id]/page.tsx +10 -13
  103. package/templates/crudPages/new/page.tsx +5 -5
  104. package/templates/crudPages/page.tsx +9 -9
  105. package/templates/crudSinglePage/page.tsx +11 -7
  106. package/templates/env/_env.server.type.ts +7 -5
  107. package/templates/lib/db.ts +1 -1
  108. package/templates/lib/dict.ts +1 -1
  109. package/templates/lib/sig.ts +5 -1
  110. package/templates/lib/srv.ts +6 -2
  111. package/templates/module/__model__.dictionary.ts +4 -1
  112. package/templates/module/__model__.signal.ts +2 -3
  113. package/templates/module/__model__.store.ts +1 -2
  114. package/templates/workspaceRoot/.gitignore.template +0 -1
  115. package/templates/workspaceRoot/.husky/pre-commit.template +16 -0
  116. package/templates/workspaceRoot/.vscode/settings.json.template +1 -1
  117. package/templates/workspaceRoot/AGENTS.md.template +4 -0
  118. package/templates/workspaceRoot/CLAUDE.md.template +19 -0
  119. package/templates/workspaceRoot/biome.json.template +2 -1
  120. package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +10 -14
  121. package/templates/workspaceRoot/docs/GENERATED.md.template +12 -10
  122. package/templates/workspaceRoot/package.json.template +2 -4
  123. package/typeChecker-3xgrzc2v.js +7 -0
  124. package/typecheck.proc.js +4 -5
  125. package/{workflow.command-2ygfqt4f.js → workflow.command-kphbr7eh.js} +22 -25
  126. package/{workspace.command-vbgpjkf9.js → workspace.command-j1gatz3d.js} +96 -81
  127. package/capacitorApp-9xswcgx7.js +0 -61
  128. package/dependencyScanner-f6grrep3.js +0 -9
  129. package/getDirname-m9s0cmhq.js +0 -8
  130. package/index-mxvakhsm.js +0 -66
  131. package/index-r24hmh0q.js +0 -4
  132. package/recipeScanner-tghkzrrt.js +0 -12
  133. package/typeChecker-kravn7ns.js +0 -8
  134. /package/{index-0wae5ebk.js → index-meh558jy.js} +0 -0
  135. /package/{index-ss469dec.js → index-nz8prx9g.js} +0 -0
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  FileSys
4
- } from "./index-67546d0j.js";
4
+ } from "./index-q0y2jq9j.js";
5
5
 
6
6
  // pkgs/@akanjs/devkit/dependencyScanner.ts
7
7
  import { builtinModules } from "module";
@@ -9,39 +9,41 @@ import * as path from "path";
9
9
  import ignore from "ignore";
10
10
  import ts from "typescript";
11
11
  var testFileRegex = /\.(?:test|spec)\.[cm]?[tj]sx?$/;
12
+ var skipDirs = ["node_modules", "dist", "build", ".git", ".next", "public", "ios", "android", "__fixtures__"];
13
+ var isSkippedPath = (filePath) => skipDirs.some((dir) => filePath.includes(`/${dir}/`) || filePath.startsWith(`${dir}/`));
12
14
  var builtinModuleSet = new Set([...builtinModules, ...builtinModules.map((mod) => `node:${mod}`)]);
13
15
  var stripShebang = (source) => source.replace(/^#!.*(?:\r?\n|$)/, "");
14
16
 
15
- class TypeScriptDependencyScanner {
17
+ class TypeScriptDependencyScanner2 {
16
18
  #fileDependencies = new Map;
17
19
  #fileRuntimeDependencies = new Map;
18
20
  #fileTypeDependencies = new Map;
19
21
  #visitedFiles = new Set;
20
22
  #tsTranspiler = new Bun.Transpiler({ loader: "ts" });
21
23
  #tsxTranspiler = new Bun.Transpiler({ loader: "tsx" });
22
- directory;
23
- rootPackageJson;
24
- ig;
25
- workspaceRoot;
24
+ #directory;
25
+ #rootPackageJson;
26
+ #ig;
27
+ #workspaceRoot;
26
28
  constructor(directory, {
27
29
  workspaceRoot,
28
30
  rootPackageJson,
29
31
  gitignorePatterns = []
30
32
  }) {
31
- this.directory = directory;
32
- this.rootPackageJson = rootPackageJson;
33
- this.ig = ignore().add(gitignorePatterns);
34
- this.workspaceRoot = workspaceRoot;
33
+ this.#directory = directory;
34
+ this.#rootPackageJson = rootPackageJson;
35
+ this.#ig = ignore().add(gitignorePatterns);
36
+ this.#workspaceRoot = workspaceRoot;
35
37
  }
36
38
  async getMonorepoDependencies(projectName, { pkgs = [], libs = [] } = {}) {
37
- const npmSet = new Set(Object.keys({ ...this.rootPackageJson.dependencies, ...this.rootPackageJson.devDependencies }));
39
+ const npmSet = new Set(Object.keys({ ...this.#rootPackageJson.dependencies, ...this.#rootPackageJson.devDependencies }));
38
40
  const pkgPathSet = new Set(pkgs);
39
41
  const libPathSet = new Set(libs.map((lib) => `@libs/${lib}`));
40
42
  await this.getDependencies();
41
43
  const [npmDepSet, pkgPathDepSet, libPathDepSet] = this.#getImportSetsFromDependencies([npmSet, pkgPathSet, libPathSet], this.#fileRuntimeDependencies);
42
44
  const [npmDevDepSet] = this.#getImportSetsFromDependencies([npmSet], this.#fileTypeDependencies);
43
45
  const pkgDeps = [...pkgPathDepSet];
44
- const libDeps = [...libPathDepSet].map((path2) => path2.replace("@libs/", "")).filter((libName) => libName !== projectName);
46
+ const libDeps = [...libPathDepSet].map((path) => path.replace("@libs/", "")).filter((libName) => libName !== projectName);
45
47
  return {
46
48
  pkgDeps,
47
49
  libDeps,
@@ -52,11 +54,11 @@ class TypeScriptDependencyScanner {
52
54
  async getPackageBuildDependencies(projectName) {
53
55
  const runtimeDeps = new Set;
54
56
  const devDeps = new Set;
55
- const sourceFiles = await this.#findTypeScriptFiles(this.directory, {
57
+ const sourceFiles = await this.#findTypeScriptFiles(this.#directory, {
56
58
  excludeBuildFiles: true,
57
59
  excludeTestFiles: true
58
60
  });
59
- const cssFiles = await this.#findCssFiles(this.directory);
61
+ const cssFiles = await this.#findCssFiles(this.#directory);
60
62
  for (const filePath of sourceFiles) {
61
63
  const fileContent = await FileSys.readText(filePath);
62
64
  const { imports, typeImports } = this.#extractImports(fileContent, filePath);
@@ -67,7 +69,7 @@ class TypeScriptDependencyScanner {
67
69
  const fileContent = await FileSys.readText(filePath);
68
70
  this.#addNormalizedImports(runtimeDeps, this.#extractCssPluginImports(fileContent), projectName);
69
71
  }
70
- const buildFilePath = path.join(this.directory, "build.ts");
72
+ const buildFilePath = path.join(this.#directory, "build.ts");
71
73
  if (await FileSys.fileExists(buildFilePath)) {
72
74
  const fileContent = await FileSys.readText(buildFilePath);
73
75
  const { imports, typeImports } = this.#extractImports(fileContent, buildFilePath);
@@ -75,7 +77,7 @@ class TypeScriptDependencyScanner {
75
77
  }
76
78
  for (const dep of runtimeDeps)
77
79
  devDeps.delete(dep);
78
- const rootDeps = { ...this.rootPackageJson.dependencies, ...this.rootPackageJson.devDependencies };
80
+ const rootDeps = { ...this.#rootPackageJson.dependencies, ...this.#rootPackageJson.devDependencies };
79
81
  const missingDeps = [];
80
82
  for (const dep of [...runtimeDeps, ...devDeps]) {
81
83
  if (rootDeps[dep] || await this.#hasWorkspacePackage(dep))
@@ -89,7 +91,7 @@ class TypeScriptDependencyScanner {
89
91
  };
90
92
  }
91
93
  async#hasWorkspacePackage(dep) {
92
- const packageJsonPath = path.join(this.workspaceRoot, "pkgs", dep, "package.json");
94
+ const packageJsonPath = path.join(this.#workspaceRoot, "pkgs", dep, "package.json");
93
95
  if (!await Bun.file(packageJsonPath).exists())
94
96
  return false;
95
97
  try {
@@ -132,9 +134,9 @@ class TypeScriptDependencyScanner {
132
134
  this.#fileRuntimeDependencies.clear();
133
135
  this.#fileTypeDependencies.clear();
134
136
  this.#visitedFiles.clear();
135
- const files = await this.#findTypeScriptFiles(this.directory);
137
+ const files = await this.#findTypeScriptFiles(this.#directory);
136
138
  for (const file of files)
137
- await this.#analyzeFile(file, this.directory);
139
+ await this.#analyzeFile(file, this.#directory);
138
140
  return this.#fileDependencies;
139
141
  }
140
142
  async#findTypeScriptFiles(directory, {
@@ -142,18 +144,17 @@ class TypeScriptDependencyScanner {
142
144
  excludeTestFiles = false
143
145
  } = {}) {
144
146
  const files = [];
145
- const skipDirs = ["node_modules", "dist", "build", ".git", ".next", "public", "ios", "android"];
146
147
  const glob = new Bun.Glob("**/*.{ts,tsx}");
147
148
  for await (const filePath of glob.scan({ cwd: directory, onlyFiles: true })) {
148
- if (skipDirs.some((dir) => filePath.includes(`/${dir}/`) || filePath.startsWith(`${dir}/`)))
149
+ if (isSkippedPath(filePath))
149
150
  continue;
150
151
  if (excludeBuildFiles && filePath === "build.ts")
151
152
  continue;
152
153
  if (excludeTestFiles && testFileRegex.test(filePath))
153
154
  continue;
154
155
  const fullPath = path.join(directory, filePath);
155
- const relativePath = path.relative(this.workspaceRoot, fullPath);
156
- if (this.ig.ignores(relativePath))
156
+ const relativePath = path.relative(this.#workspaceRoot, fullPath);
157
+ if (this.#ig.ignores(relativePath))
157
158
  continue;
158
159
  files.push(fullPath);
159
160
  }
@@ -161,14 +162,13 @@ class TypeScriptDependencyScanner {
161
162
  }
162
163
  async#findCssFiles(directory) {
163
164
  const files = [];
164
- const skipDirs = ["node_modules", "dist", "build", ".git", ".next", "public", "ios", "android"];
165
165
  const glob = new Bun.Glob("**/*.css");
166
166
  for await (const filePath of glob.scan({ cwd: directory, onlyFiles: true })) {
167
- if (skipDirs.some((dir) => filePath.includes(`/${dir}/`) || filePath.startsWith(`${dir}/`)))
167
+ if (isSkippedPath(filePath))
168
168
  continue;
169
169
  const fullPath = path.join(directory, filePath);
170
- const relativePath = path.relative(this.workspaceRoot, fullPath);
171
- if (this.ig.ignores(relativePath))
170
+ const relativePath = path.relative(this.#workspaceRoot, fullPath);
171
+ if (this.#ig.ignores(relativePath))
172
172
  continue;
173
173
  files.push(fullPath);
174
174
  }
@@ -289,7 +289,7 @@ class TypeScriptDependencyScanner {
289
289
  exec.workspace.getPackageJson(),
290
290
  exec.workspace.getGitignorePatterns()
291
291
  ]);
292
- return new TypeScriptDependencyScanner(exec.cwdPath, {
292
+ return new TypeScriptDependencyScanner2(exec.cwdPath, {
293
293
  workspaceRoot: exec.workspace.cwdPath,
294
294
  tsconfig,
295
295
  rootPackageJson,
@@ -298,4 +298,4 @@ class TypeScriptDependencyScanner {
298
298
  }
299
299
  }
300
300
 
301
- export { TypeScriptDependencyScanner };
301
+ export { TypeScriptDependencyScanner2 };
@@ -1,20 +1,11 @@
1
1
  // @bun
2
2
  // pkgs/@akanjs/devkit/frontendBuild/styleContract.ts
3
- var countBlocking = (v) => v.style.filter((s) => s.severity === "error").length + v.theme.length;
4
- var formatStyleContract = (v) => {
5
- const lines = [];
6
- for (const s of v.style) {
7
- lines.push(` [${s.severity}] ${s.rule} ${s.path}:${s.line}`);
8
- lines.push(` ${s.snippet}`);
9
- lines.push(` \u2192 ${s.suggestion}`);
10
- }
11
- for (const t of v.theme) {
12
- lines.push(` [error] contrast ${t.scope} ${t.pair} = ${t.ratio}:1 (min ${t.threshold}:1)`);
13
- lines.push(` \u2192 ${t.suggestion}`);
14
- }
15
- return lines.join(`
3
+ var countBlocking = (violations) => violations.theme.length;
4
+ var formatStyleContract = (violations) => violations.theme.flatMap((theme) => [
5
+ ` [error] contrast ${theme.scope} ${theme.pair} = ${theme.ratio}:1 (min ${theme.threshold}:1)`,
6
+ ` \u2192 ${theme.suggestion}`
7
+ ]).join(`
16
8
  `);
17
- };
18
9
 
19
10
  // pkgs/@akanjs/devkit/frontendBuild/themeValidator.ts
20
11
  var PAIRS = [
@@ -66,7 +57,7 @@ class ThemeValidator {
66
57
  foreground: front,
67
58
  ratio: Math.round(ratio * 100) / 100,
68
59
  threshold,
69
- suggestion: `${scope}\uC758 --${base}(${bg})\uC640 --${fg}(${front}) \uB300\uBE44\uAC00 ${ratio.toFixed(2)}:1 \uB85C \uCD5C\uC18C ${threshold}:1 \uBBF8\uB9CC\uC785\uB2C8\uB2E4. \uD55C\uCABD\uC744 \uB354 \uBC1D\uAC8C/\uC5B4\uB461\uAC8C \uC870\uC815\uD574 \uB300\uBE44\uB97C \uD655\uBCF4\uD558\uC138\uC694.`
60
+ suggestion: `In ${scope}, --${base} (${bg}) against --${fg} (${front}) is ${ratio.toFixed(2)}:1, under the ${threshold}:1 minimum. Lighten or darken one of them until it clears.`
70
61
  });
71
62
  }
72
63
  return violations;