@akanjs/cli 3.0.0-alpha.2 → 3.0.0-alpha.20
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.
- package/.build-stamp +1 -1
- package/README.ko.md +1 -1
- package/README.md +1 -1
- package/{abstractCompactor-e5yq60qz.js → abstractCompactor-20e0cwbs.js} +2 -2
- package/{agent.command-yv00p0s0.js → agent.command-rwkzxp5h.js} +8 -7
- package/{application.command-0qsczf4k.js → application.command-256kb89w.js} +6 -5
- package/{applicationBuildRunner-ct2pxyvw.js → applicationBuildRunner-7gnfz7ww.js} +6 -7
- package/{applicationReleasePackager-gg8ccbeh.js → applicationReleasePackager-93nzdfsy.js} +1 -1
- package/buildBatch.proc.js +5 -4
- package/{capacitorApp-4r9sm3qg.js → capacitorApp-q8j5fsyj.js} +29 -26
- package/{cloud.command-dxfv18sa.js → cloud.command-nf3hwrqv.js} +10 -9
- package/{context.command-8d9e3k6b.js → context.command-cxhznb92.js} +16 -15
- package/{dependencyScanner-f6grrep3.js → dependencyScanner-rbs2407b.js} +1 -1
- package/getDirname-ka11hm7e.js +8 -0
- package/{guideline.command-3jbkxzh6.js → guideline.command-8hvqd21e.js} +7 -6
- package/guidelines/conventions/conventions.generate.json +25 -0
- package/guidelines/conventions/conventions.instruction.md +909 -0
- package/guidelines/cssRule/cssRule.instruction.md +7 -0
- package/guidelines/framework/framework.instruction.md +1 -0
- package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +24 -0
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +972 -0
- package/incrementalBuilder.proc.js +4 -3
- package/index-1577bej2.js +7 -0
- package/{index-1pvex4az.js → index-2gja8hqt.js} +13 -13
- package/{index-2q1f5j9k.js → index-4d30h52j.js} +3 -3
- package/{index-8hsbnyes.js → index-9bwhn99r.js} +5 -3
- package/{index-t3723f99.js → index-9e5tk85e.js} +86 -17
- package/{index-e16gnn26.js → index-a31wqqae.js} +13 -10
- package/{index-nm6wghb6.js → index-bv4f7dda.js} +6 -6
- package/{index-rzwcpcc3.js → index-daxfkf9r.js} +1 -1
- package/{index-ej426mcr.js → index-ewnssrss.js} +37 -6
- package/{index-yzmhasdb.js → index-gcfaehrb.js} +8 -8
- package/{index-a00jg8x8.js → index-gnbq9gjc.js} +49 -32
- package/{index-pyt2b4nw.js → index-hg0qvhmx.js} +152 -241
- package/{index-tdbas9r0.js → index-j37qq1f2.js} +1 -1
- package/{index-7c6k4yvg.js → index-kqxgymh9.js} +15 -7
- package/{index-ec09pws3.js → index-m82smx4n.js} +4 -4
- package/{index-rh16j3c7.js → index-qnv0aqmm.js} +12 -8
- package/{index-bbkek1bp.js → index-rnqk559q.js} +1 -1
- package/{index-hgna5rjy.js → index-scn3prb2.js} +142 -65
- package/{index-0cj2zxbm.js → index-sh01r3pm.js} +1 -1
- package/{index-zasydjxd.js → index-w1a16c42.js} +9 -11
- package/{index-bekddz9q.js → index-wvkgs5sw.js} +4 -4
- package/{index-mr5s7mqd.js → index-x34wfyzw.js} +3 -3
- package/{index-k95xkh4p.js → index-xnan3a0m.js} +8 -4
- package/index.js +20 -19
- package/{library.command-ebdj1vnm.js → library.command-1399w0n2.js} +5 -4
- package/{localRegistry.command-gb178ne8.js → localRegistry.command-y5c91pbh.js} +9 -8
- package/{module.command-9c1bnsx4.js → module.command-qtyhk1m1.js} +9 -8
- package/{package.command-t93p4jkj.js → package.command-f8090yy2.js} +5 -4
- package/package.json +3 -4
- package/{page.command-k3k0meh2.js → page.command-cjf93cyj.js} +5 -4
- package/{primitive.command-de6nktdt.js → primitive.command-am2xjbgn.js} +10 -9
- package/{quality.command-z5kth2wa.js → quality.command-kxh7w9yy.js} +11 -41
- package/{recipeScanner-tghkzrrt.js → recipeScanner-zrzev25x.js} +3 -3
- package/{repair.command-ehf2g112.js → repair.command-varzs4ry.js} +7 -6
- package/{routeSourceValidator-cncd92fv.js → routeSourceValidator-7fycdqyv.js} +3 -39
- package/{scalar.command-7a2jtv33.js → scalar.command-0ag0zp8h.js} +8 -7
- package/templates/app/page/styles.css.template +3 -3
- package/templates/appSample/srvkit/AuthGuard.ts +9 -5
- package/templates/appSample/srvkit/SessionInternalArg.ts +4 -3
- package/templates/crudPages/[__model__Id]/edit/page.tsx +1 -1
- package/templates/crudPages/new/page.tsx +1 -1
- package/templates/crudSinglePage/page.tsx +1 -1
- package/templates/lib/db.ts +1 -1
- package/templates/lib/dict.ts +1 -1
- package/templates/lib/sig.ts +1 -1
- package/templates/lib/srv.ts +6 -2
- package/templates/lib/useClient.ts +9 -3
- package/templates/module/__Model__.Util.tsx +1 -1
- package/templates/module/__Model__.Zone.tsx +3 -5
- package/templates/workspaceRoot/AGENTS.md.template +0 -955
- package/templates/workspaceRoot/CLAUDE.md.template +19 -0
- package/templates/workspaceRoot/biome.json.template +4 -198
- package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +4 -1
- package/{typeChecker-kravn7ns.js → typeChecker-g6bh0xfv.js} +1 -1
- package/typecheck.proc.js +1 -1
- package/{workflow.command-e0tt0vk2.js → workflow.command-ex77wvdb.js} +15 -14
- package/{workspace.command-fpda0evj.js → workspace.command-atxnxxea.js} +69 -51
- package/templates/workspaceRoot/.cursor/rules/akan-page-routing.mdc.template +0 -43
- package/templates/workspaceRoot/.cursor/rules/akan-sync-conventions.mdc.template +0 -33
- package/templates/workspaceRoot/.cursor/rules/application-test-commands.mdc.template +0 -16
- package/templates/workspaceRoot/.cursor/rules/change-scope.mdc.template +0 -12
- package/templates/workspaceRoot/.cursor/rules/client-server-boundaries.mdc.template +0 -18
- package/templates/workspaceRoot/.cursor/rules/coding-comments.mdc.template +0 -25
- package/templates/workspaceRoot/.cursor/rules/coding-style.mdc.template +0 -44
- package/templates/workspaceRoot/.cursor/rules/domain-module-conventions.mdc.template +0 -17
- package/templates/workspaceRoot/.cursor/rules/format-lint.mdc.template +0 -12
- package/templates/workspaceRoot/.cursor/rules/lint-enforced-rules.mdc.template +0 -18
- package/templates/workspaceRoot/.cursor/rules/module-file-playbook.mdc.template +0 -61
- package/templates/workspaceRoot/.cursor/rules/naming-conventions.mdc.template +0 -15
- package/templates/workspaceRoot/.cursor/rules/react-component-style.mdc.template +0 -21
- package/templates/workspaceRoot/.cursor/rules/repo-overview.mdc.template +0 -17
- package/templates/workspaceRoot/.cursor/rules/scalar-modeling.mdc.template +0 -58
- package/templates/workspaceRoot/.cursor/rules/secrets-and-env.mdc.template +0 -13
- package/templates/workspaceRoot/.cursor/rules/service-signal-conventions.mdc.template +0 -83
- package/templates/workspaceRoot/.cursor/rules/srvkit-adapters-and-guards.mdc.template +0 -50
- package/templates/workspaceRoot/.cursor/rules/ssr-first.mdc.template +0 -59
- package/templates/workspaceRoot/.cursor/rules/typescript-imports.mdc.template +0 -16
- /package/{index-r24hmh0q.js → index-yb2wsc7f.js} +0 -0
package/templates/lib/srv.ts
CHANGED
|
@@ -13,7 +13,11 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { [
|
|
|
13
13
|
const libs = scanInfo.getLibs();
|
|
14
14
|
return `
|
|
15
15
|
import { ServiceModel } from "akanjs/service";
|
|
16
|
-
${
|
|
16
|
+
${
|
|
17
|
+
libs.length
|
|
18
|
+
? libs.map((lib) => `import * as ${lib} from "@libs/${lib}/lib/option";`).join("\n")
|
|
19
|
+
: 'import type { BackendEnv } from "akanjs/base";'
|
|
20
|
+
}
|
|
17
21
|
|
|
18
22
|
import * as cnst from "./cnst";
|
|
19
23
|
import * as db from "./db";
|
|
@@ -21,7 +25,7 @@ import * as db from "./db";
|
|
|
21
25
|
${databaseModules.map((module) => `import { ${capitalize(module)}Service } from "./${module}/${module}.service";`).join("\n")}
|
|
22
26
|
${serviceModules.map((module) => `import { ${capitalize(module)}Service } from "./_${module}/${module}.service";`).join("\n")}
|
|
23
27
|
|
|
24
|
-
${libs.map((lib) => `export
|
|
28
|
+
${libs.map((lib) => `export * as ${lib} from "@libs/${lib}/lib/srv";`).join("\n")}
|
|
25
29
|
|
|
26
30
|
${databaseModules.map((module) => `export { ${capitalize(module)}Service } from "./${module}/${module}.service";`).join("\n")}
|
|
27
31
|
${serviceModules.map((module) => `export { ${capitalize(module)}Service } from "./_${module}/${module}.service";`).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
|
-
|
|
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
|
|
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
|
-
|
|
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}
|
|
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}
|
|
40
|
+
return <Load.View view={view} renderView={(${dict.model}) => <${dict.Model}.View.General ${dict.model}={${dict.model}} />} />;
|
|
43
41
|
};
|
|
44
42
|
`,
|
|
45
43
|
};
|