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

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 (89) hide show
  1. package/.build-stamp +1 -1
  2. package/{abstractCompactor-rk6twzvj.js → abstractCompactor-e5yq60qz.js} +2 -2
  3. package/{agent.command-jfz8yfwy.js → agent.command-f0gqkfgz.js} +8 -7
  4. package/{application.command-3smsv7mq.js → application.command-x903m2qq.js} +6 -5
  5. package/{applicationBuildRunner-aq7mb3z6.js → applicationBuildRunner-ha3y8ew8.js} +4 -4
  6. package/{applicationReleasePackager-yrrhbkv3.js → applicationReleasePackager-gg8ccbeh.js} +1 -1
  7. package/buildBatch.proc.js +5 -4
  8. package/{capacitorApp-q3mpmkkz.js → capacitorApp-9xswcgx7.js} +6 -3
  9. package/{cloud.command-rk4e9vrt.js → cloud.command-zs6kyf83.js} +10 -9
  10. package/{context.command-ygzyb0xb.js → context.command-fmepgjzg.js} +16 -15
  11. package/getDirname-m9s0cmhq.js +8 -0
  12. package/{guideline.command-1m1ctar3.js → guideline.command-n6sw0a0c.js} +6 -5
  13. package/guidelines/conventions/conventions.generate.json +25 -0
  14. package/guidelines/conventions/conventions.instruction.md +668 -0
  15. package/guidelines/ssrRule/ssrRule.generate.json +31 -0
  16. package/guidelines/ssrRule/ssrRule.instruction.md +108 -0
  17. package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +24 -0
  18. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +972 -0
  19. package/incrementalBuilder.proc.js +4 -3
  20. package/{index-3pgtw35d.js → index-0cj2zxbm.js} +1 -1
  21. package/index-1577bej2.js +7 -0
  22. package/{index-r4w8cry5.js → index-3vta1tqa.js} +4 -4
  23. package/{index-ktprgc5g.js → index-4m0bphac.js} +4 -4
  24. package/{index-h0bngh79.js → index-5sn5w2mt.js} +13 -13
  25. package/{index-ev6rjw9n.js → index-62955kn5.js} +37 -14
  26. package/{index-4yp06pn1.js → index-774gcx29.js} +49 -32
  27. package/{index-sggm9qkv.js → index-779ske1y.js} +86 -17
  28. package/{index-f4gqk0dd.js → index-82jrh4hj.js} +6 -6
  29. package/{index-cn24dcqn.js → index-d43t8af2.js} +2 -2
  30. package/{index-n0z3f2xg.js → index-eyyf2149.js} +34 -6
  31. package/{index-e3qskyt2.js → index-gcv8ncfh.js} +2 -2
  32. package/{index-xwgm94zr.js → index-j37qq1f2.js} +1 -1
  33. package/{index-rh16j3c7.js → index-j9cxndc0.js} +3 -2
  34. package/{index-b978vs2e.js → index-jf2ya7r2.js} +3 -3
  35. package/{index-vhv3xnjz.js → index-jhpa13zj.js} +8 -8
  36. package/{index-jk9q6pse.js → index-kdh76j26.js} +4 -2
  37. package/{index-6pz1j0zj.js → index-mxvakhsm.js} +6 -2
  38. package/{index-pyt2b4nw.js → index-qb61h0k7.js} +52 -17
  39. package/{index-csqk9z5j.js → index-qzdjd4ct.js} +3 -3
  40. package/{index-4zgs8g1w.js → index-rxkpk7n4.js} +1 -1
  41. package/{index-hjzr8ja1.js → index-xmmzf150.js} +1 -1
  42. package/{index-fmgbwsr5.js → index-y4vkyhvv.js} +4 -4
  43. package/{index-jtm86byd.js → index-z8ptfkzv.js} +84 -40
  44. package/index.js +20 -19
  45. package/{library.command-pwfx8dx2.js → library.command-cv9gdbmg.js} +5 -4
  46. package/{localRegistry.command-bxhqmd1d.js → localRegistry.command-d8fg36zc.js} +9 -8
  47. package/{module.command-0t3ewata.js → module.command-qyr1s9cn.js} +9 -8
  48. package/{package.command-7hmkxvpa.js → package.command-wsjx0k47.js} +5 -4
  49. package/package.json +2 -2
  50. package/{page.command-st6r4s0q.js → page.command-rdzg65rm.js} +5 -4
  51. package/{primitive.command-1qkxpzsn.js → primitive.command-89g38b53.js} +10 -9
  52. package/{quality.command-hy5vt1bh.js → quality.command-0cs2z92d.js} +459 -86
  53. package/{repair.command-nakkq2zp.js → repair.command-6fphxfwj.js} +7 -6
  54. package/{routeSourceValidator-cncd92fv.js → routeSourceValidator-e4jmbfcx.js} +2 -38
  55. package/{scalar.command-fjq272gs.js → scalar.command-xfer69s6.js} +8 -7
  56. package/templates/app/page/styles.css.template +3 -3
  57. package/templates/crudPages/[__model__Id]/edit/page.tsx +1 -1
  58. package/templates/crudPages/new/page.tsx +1 -1
  59. package/templates/crudSinglePage/page.tsx +1 -1
  60. package/templates/lib/db.ts +3 -1
  61. package/templates/lib/useClient.ts +9 -3
  62. package/templates/module/__Model__.Util.tsx +1 -1
  63. package/templates/module/__Model__.Zone.tsx +3 -5
  64. package/templates/workspaceRoot/AGENTS.md.template +0 -827
  65. package/templates/workspaceRoot/biome.json.template +3 -198
  66. package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +4 -1
  67. package/{workflow.command-jswbgk90.js → workflow.command-2ygfqt4f.js} +15 -14
  68. package/{workspace.command-p9r9nckg.js → workspace.command-vbgpjkf9.js} +37 -35
  69. package/templates/libRoot/base/baseLogic.ts +0 -14
  70. package/templates/libRoot/base/index.ts +0 -8
  71. package/templates/workspaceRoot/.cursor/rules/akan-page-routing.mdc.template +0 -43
  72. package/templates/workspaceRoot/.cursor/rules/akan-sync-conventions.mdc.template +0 -33
  73. package/templates/workspaceRoot/.cursor/rules/application-test-commands.mdc.template +0 -16
  74. package/templates/workspaceRoot/.cursor/rules/change-scope.mdc.template +0 -12
  75. package/templates/workspaceRoot/.cursor/rules/client-server-boundaries.mdc.template +0 -17
  76. package/templates/workspaceRoot/.cursor/rules/coding-comments.mdc.template +0 -25
  77. package/templates/workspaceRoot/.cursor/rules/coding-style.mdc.template +0 -44
  78. package/templates/workspaceRoot/.cursor/rules/domain-module-conventions.mdc.template +0 -17
  79. package/templates/workspaceRoot/.cursor/rules/format-lint.mdc.template +0 -12
  80. package/templates/workspaceRoot/.cursor/rules/lint-enforced-rules.mdc.template +0 -18
  81. package/templates/workspaceRoot/.cursor/rules/module-file-playbook.mdc.template +0 -61
  82. package/templates/workspaceRoot/.cursor/rules/naming-conventions.mdc.template +0 -15
  83. package/templates/workspaceRoot/.cursor/rules/react-component-style.mdc.template +0 -21
  84. package/templates/workspaceRoot/.cursor/rules/repo-overview.mdc.template +0 -17
  85. package/templates/workspaceRoot/.cursor/rules/scalar-modeling.mdc.template +0 -58
  86. package/templates/workspaceRoot/.cursor/rules/secrets-and-env.mdc.template +0 -13
  87. package/templates/workspaceRoot/.cursor/rules/service-signal-conventions.mdc.template +0 -83
  88. package/templates/workspaceRoot/.cursor/rules/srvkit-adapters-and-guards.mdc.template +0 -50
  89. package/templates/workspaceRoot/.cursor/rules/typescript-imports.mdc.template +0 -16
@@ -1,17 +1,18 @@
1
1
  // @bun
2
2
  import {
3
3
  RepairRunner
4
- } from "./index-b978vs2e.js";
5
- import"./index-4yp06pn1.js";
6
- import"./index-4zgs8g1w.js";
4
+ } from "./index-jf2ya7r2.js";
5
+ import"./index-774gcx29.js";
6
+ import"./index-rxkpk7n4.js";
7
7
  import {
8
8
  Workspace,
9
9
  command,
10
10
  script
11
- } from "./index-jk9q6pse.js";
12
- import"./index-jtm86byd.js";
13
- import"./index-6pz1j0zj.js";
11
+ } from "./index-kdh76j26.js";
12
+ import"./index-z8ptfkzv.js";
13
+ import"./index-mxvakhsm.js";
14
14
  import"./index-xys926f2.js";
15
+ import"./index-1577bej2.js";
15
16
  import"./index-67546d0j.js";
16
17
  import"./index-r24hmh0q.js";
17
18
 
@@ -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,19 +1,20 @@
1
1
  // @bun
2
2
  import {
3
3
  ScalarScript
4
- } from "./index-fmgbwsr5.js";
4
+ } from "./index-y4vkyhvv.js";
5
5
  import"./index-ss469dec.js";
6
- import"./index-3pgtw35d.js";
6
+ import"./index-0cj2zxbm.js";
7
7
  import {
8
8
  renderPrimitiveReport
9
- } from "./index-4zgs8g1w.js";
10
- import"./index-xwgm94zr.js";
9
+ } from "./index-rxkpk7n4.js";
10
+ import"./index-j37qq1f2.js";
11
11
  import {
12
12
  Sys,
13
13
  command
14
- } from "./index-jk9q6pse.js";
15
- import"./index-jtm86byd.js";
16
- import"./index-6pz1j0zj.js";
14
+ } from "./index-kdh76j26.js";
15
+ import"./index-z8ptfkzv.js";
16
+ import"./index-mxvakhsm.js";
17
+ import"./index-1577bej2.js";
17
18
  import"./index-67546d0j.js";
18
19
  import"./index-r24hmh0q.js";
19
20
 
@@ -1,10 +1,10 @@
1
1
  @import "tailwindcss";
2
2
  @import "akanjs/ui/styles.css";
3
3
 
4
- /* 테마 시스템(브랜드-중립 기본 팔레트 · @theme inline 매핑 · dark 변형 · 런타임 data-theme 전환)은
5
- akanjs/ui/styles.css(프레임워크)가 전부 제공한다. 앱은 import 만으로 즉시 동작한다.
4
+ /* The theme system (brand-neutral default palette, @theme inline mapping, dark variant, and runtime
5
+ data-theme switching) is fully provided by akanjs/ui/styles.css. This app works from the import alone.
6
6
 
7
- 앱만의 브랜드 색을 쓰려면 아래처럼 토큰만 override 하면 된다:
7
+ To use this app's own brand colors, override the tokens like this:
8
8
 
9
9
  :root,
10
10
  [data-theme="dark"] {
@@ -30,7 +30,7 @@ export default async function Page({ params }: PageProps) {
30
30
  </div>
31
31
  <Load.Edit
32
32
  className="flex flex-col items-center"
33
- slice={fetch.slice["${dict.model}InPublic"]}
33
+ slice={fetch.slice.${dict.model}InPublic}
34
34
  edit={${dict.model}Edit}
35
35
  type="form"
36
36
  onCancel="back"
@@ -25,7 +25,7 @@ export default function Page() {
25
25
  </div>
26
26
  <Load.Edit
27
27
  className="flex flex-col items-center"
28
- slice={fetch.slice["${dict.model}InPublic"]}
28
+ slice={fetch.slice.${dict.model}InPublic}
29
29
  edit={${dict.model}Form}
30
30
  type="form"
31
31
  onCancel="back"
@@ -20,7 +20,7 @@ export default async function Page() {
20
20
  <>
21
21
  <div className="animate-fadeIn flex items-center gap-4 px-4 pt-4">
22
22
  <div className="text-lg font-bold md:text-4xl">{l("${dict.model}.modelName")}</div>
23
- <Model.New className="inline-flex items-center gap-2 rounded-field px-3 py-1.5 text-sm transition-colors hover:bg-muted" slice={fetch.slice["${dict.model}InPublic"]} renderTitle="id">
23
+ <Model.New className="inline-flex items-center gap-2 rounded-field px-3 py-1.5 text-sm transition-colors hover:bg-muted" slice={fetch.slice.${dict.model}InPublic} renderTitle="id">
24
24
  <${dict.Model}.Template.General />
25
25
  </Model.New>
26
26
  </div>
@@ -16,7 +16,9 @@ ${databaseModules.map((module) => `import * as ${module}Db from "./${module}/${m
16
16
  ${libs.map((lib) => `export { db as ${lib} } from "@libs/${lib}/server";`).join("\n")}
17
17
 
18
18
  ${databaseModules.map((module) => `class ${capitalize(module)}Input extends by(cnst.${capitalize(module)}Input) {}`).join("\n")}
19
+ ${databaseModules.map((module) => `class ${capitalize(module)}Insight extends by(cnst.${capitalize(module)}Insight) {}`).join("\n")}
19
20
  ${databaseModules.length ? `export type { ${databaseModules.map((module) => `${capitalize(module)}Input`).join(", ")} };` : ""}
21
+ ${databaseModules.length ? `export type { ${databaseModules.map((module) => `${capitalize(module)}Insight`).join(", ")} };` : ""}
20
22
 
21
23
  ${scalarModules.map((module) => `export type * from "./__scalar/${module}/${module}.document";`).join("\n")}
22
24
  ${databaseModules.map((module) => `export type * from "./${module}/${module}.document";`).join("\n")}
@@ -24,7 +26,7 @@ ${databaseModules.map((module) => `export type * from "./${module}/${module}.doc
24
26
  ${databaseModules
25
27
  .map((module) => {
26
28
  const names = { Module: module.charAt(0).toUpperCase() + module.slice(1) };
27
- return `export const ${module} = DatabaseRegistry.buildModel("${module}" as const, ${names.Module}Input, ${module}Db.${names.Module}, ${module}Db.${names.Module}Model, cnst.${names.Module}, cnst.${names.Module}Insight, ${module}Db.${names.Module}Filter);`;
29
+ return `export const ${module} = DatabaseRegistry.buildModel("${module}" as const, ${names.Module}Input, ${module}Db.${names.Module}, ${module}Db.${names.Module}Model, cnst.${names.Module}, ${names.Module}Insight, ${module}Db.${names.Module}Filter);`;
28
30
  })
29
31
  .join("\n")}
30
32
  ${scalarModules.map((module) => `export const ${module} = DatabaseRegistry.buildScalar("${module}" as const, ${capitalize(module)});`).join("\n")}
@@ -1,16 +1,22 @@
1
1
  import type { AppInfo, LibInfo } from "akanjs";
2
2
 
3
3
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { [key: string]: string } = {}) {
4
+ const isApp = (scanInfo?.type ?? "lib") === "app";
4
5
  return `
5
6
  import { makePageProto, registerClientRuntime } from "akanjs/client";
6
7
  import { FetchClient } from "akanjs/fetch";
7
8
  import * as cnst from "./cnst";
8
- import { getAllDictionary } from "./dict" with { type: "macro" };
9
- import type * as dict from "./dict";
9
+ ${isApp ? `import { getAllDictionary } from "./dict" with { type: "macro" };\n` : ""}import type * as dict from "./dict";
10
10
  import { getSerializedSignal } from "./sig" with { type: "macro" };
11
11
  import type * as signal from "./sig";
12
12
 
13
- const dictionary = process.env.AKAN_PUBLIC_RENDER_ENV === "csr" ? getAllDictionary() : {};
13
+ ${
14
+ isApp
15
+ ? `const dictionary = process.env.AKAN_PUBLIC_RENDER_ENV === "csr" ? getAllDictionary() : {};`
16
+ : `// dict.ts is cumulative, so a lib dictionary is a subset of the mounting app's. Translator state is global,
17
+ // so the app's seed already resolves l() here — seeding again would ship the same payload a second time.
18
+ const dictionary = {};`
19
+ }
14
20
  const pageProto = makePageProto<typeof dict>(dictionary);
15
21
  const fetchProto = FetchClient.build<typeof signal>(cnst, getSerializedSignal(), { Err: pageProto.Err });
16
22
  export const runtime = registerClientRuntime({ ...pageProto, ...fetchProto }, { scope: ${JSON.stringify(scanInfo?.type ?? "lib")} });
@@ -21,7 +21,7 @@ interface RemoveProps {
21
21
  export const Remove = ({ ${dict.model}Id }: RemoveProps) => {
22
22
  const { l } = usePage();
23
23
  return (
24
- <Model.Remove modelId={${dict.model}Id} slice={fetch.slice["${dict.model}"]}>
24
+ <Model.Remove modelId={${dict.model}Id} slice={fetch.slice.${dict.model}}>
25
25
  <BiTrash /> {l("base.remove")}
26
26
  </Model.Remove>
27
27
  );
@@ -12,9 +12,7 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dic
12
12
  content: `
13
13
  "use client";
14
14
  import { Load } from "akanjs/ui";
15
- // Alias the domain namespace so the Card/View exports below never collide with the model name
16
- // (a model literally named "card" or "view" would otherwise shadow this import).
17
- import { type cnst, ${dict.Model} as ${dict.Model}Domain } from "@${dict.sysType}s/${dict.sysName}/client";
15
+ import { type cnst, ${dict.Model} as ${dict.Model} } from "@${dict.sysType}s/${dict.sysName}/client";
18
16
  import type { ClientInit, ClientView, SliceMeta } from "akanjs/fetch";
19
17
 
20
18
  interface CardProps {
@@ -28,7 +26,7 @@ export const Card = ({ className, init, slice }: CardProps) => {
28
26
  className={className}
29
27
  init={init}
30
28
  renderItem={(${dict.model}) => (
31
- <${dict.Model}Domain.Unit.Card key={${dict.model}.id} href={\`/${dict.model}/\${${dict.model}.id}\`} ${dict.model}={${dict.model}} />
29
+ <${dict.Model}.Unit.Card key={${dict.model}.id} href={\`/${dict.model}/\${${dict.model}.id}\`} ${dict.model}={${dict.model}} />
32
30
  )}
33
31
  />
34
32
  );
@@ -39,7 +37,7 @@ interface ViewProps {
39
37
  view: ClientView<"${dict.model}", cnst.${dict.Model}>;
40
38
  }
41
39
  export const View = ({ view }: ViewProps) => {
42
- return <Load.View view={view} renderView={(${dict.model}) => <${dict.Model}Domain.View.General ${dict.model}={${dict.model}} />} />;
40
+ return <Load.View view={view} renderView={(${dict.model}) => <${dict.Model}.View.General ${dict.model}={${dict.model}} />} />;
43
41
  };
44
42
  `,
45
43
  };