@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.
- package/.build-stamp +1 -1
- package/{abstractCompactor-rk6twzvj.js → abstractCompactor-e5yq60qz.js} +2 -2
- package/{agent.command-jfz8yfwy.js → agent.command-f0gqkfgz.js} +8 -7
- package/{application.command-3smsv7mq.js → application.command-x903m2qq.js} +6 -5
- package/{applicationBuildRunner-aq7mb3z6.js → applicationBuildRunner-ha3y8ew8.js} +4 -4
- package/{applicationReleasePackager-yrrhbkv3.js → applicationReleasePackager-gg8ccbeh.js} +1 -1
- package/buildBatch.proc.js +5 -4
- package/{capacitorApp-q3mpmkkz.js → capacitorApp-9xswcgx7.js} +6 -3
- package/{cloud.command-rk4e9vrt.js → cloud.command-zs6kyf83.js} +10 -9
- package/{context.command-ygzyb0xb.js → context.command-fmepgjzg.js} +16 -15
- package/getDirname-m9s0cmhq.js +8 -0
- package/{guideline.command-1m1ctar3.js → guideline.command-n6sw0a0c.js} +6 -5
- package/guidelines/conventions/conventions.generate.json +25 -0
- package/guidelines/conventions/conventions.instruction.md +668 -0
- package/guidelines/ssrRule/ssrRule.generate.json +31 -0
- package/guidelines/ssrRule/ssrRule.instruction.md +108 -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-3pgtw35d.js → index-0cj2zxbm.js} +1 -1
- package/index-1577bej2.js +7 -0
- package/{index-r4w8cry5.js → index-3vta1tqa.js} +4 -4
- package/{index-ktprgc5g.js → index-4m0bphac.js} +4 -4
- package/{index-h0bngh79.js → index-5sn5w2mt.js} +13 -13
- package/{index-ev6rjw9n.js → index-62955kn5.js} +37 -14
- package/{index-4yp06pn1.js → index-774gcx29.js} +49 -32
- package/{index-sggm9qkv.js → index-779ske1y.js} +86 -17
- package/{index-f4gqk0dd.js → index-82jrh4hj.js} +6 -6
- package/{index-cn24dcqn.js → index-d43t8af2.js} +2 -2
- package/{index-n0z3f2xg.js → index-eyyf2149.js} +34 -6
- package/{index-e3qskyt2.js → index-gcv8ncfh.js} +2 -2
- package/{index-xwgm94zr.js → index-j37qq1f2.js} +1 -1
- package/{index-rh16j3c7.js → index-j9cxndc0.js} +3 -2
- package/{index-b978vs2e.js → index-jf2ya7r2.js} +3 -3
- package/{index-vhv3xnjz.js → index-jhpa13zj.js} +8 -8
- package/{index-jk9q6pse.js → index-kdh76j26.js} +4 -2
- package/{index-6pz1j0zj.js → index-mxvakhsm.js} +6 -2
- package/{index-pyt2b4nw.js → index-qb61h0k7.js} +52 -17
- package/{index-csqk9z5j.js → index-qzdjd4ct.js} +3 -3
- package/{index-4zgs8g1w.js → index-rxkpk7n4.js} +1 -1
- package/{index-hjzr8ja1.js → index-xmmzf150.js} +1 -1
- package/{index-fmgbwsr5.js → index-y4vkyhvv.js} +4 -4
- package/{index-jtm86byd.js → index-z8ptfkzv.js} +84 -40
- package/index.js +20 -19
- package/{library.command-pwfx8dx2.js → library.command-cv9gdbmg.js} +5 -4
- package/{localRegistry.command-bxhqmd1d.js → localRegistry.command-d8fg36zc.js} +9 -8
- package/{module.command-0t3ewata.js → module.command-qyr1s9cn.js} +9 -8
- package/{package.command-7hmkxvpa.js → package.command-wsjx0k47.js} +5 -4
- package/package.json +2 -2
- package/{page.command-st6r4s0q.js → page.command-rdzg65rm.js} +5 -4
- package/{primitive.command-1qkxpzsn.js → primitive.command-89g38b53.js} +10 -9
- package/{quality.command-hy5vt1bh.js → quality.command-0cs2z92d.js} +459 -86
- package/{repair.command-nakkq2zp.js → repair.command-6fphxfwj.js} +7 -6
- package/{routeSourceValidator-cncd92fv.js → routeSourceValidator-e4jmbfcx.js} +2 -38
- package/{scalar.command-fjq272gs.js → scalar.command-xfer69s6.js} +8 -7
- package/templates/app/page/styles.css.template +3 -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 +3 -1
- 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 -827
- package/templates/workspaceRoot/biome.json.template +3 -198
- package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +4 -1
- package/{workflow.command-jswbgk90.js → workflow.command-2ygfqt4f.js} +15 -14
- package/{workspace.command-p9r9nckg.js → workspace.command-vbgpjkf9.js} +37 -35
- package/templates/libRoot/base/baseLogic.ts +0 -14
- package/templates/libRoot/base/index.ts +0 -8
- 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 -17
- 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/typescript-imports.mdc.template +0 -16
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
RepairRunner
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
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-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
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
|
|
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-
|
|
4
|
+
} from "./index-y4vkyhvv.js";
|
|
5
5
|
import"./index-ss469dec.js";
|
|
6
|
-
import"./index-
|
|
6
|
+
import"./index-0cj2zxbm.js";
|
|
7
7
|
import {
|
|
8
8
|
renderPrimitiveReport
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-rxkpk7n4.js";
|
|
10
|
+
import"./index-j37qq1f2.js";
|
|
11
11
|
import {
|
|
12
12
|
Sys,
|
|
13
13
|
command
|
|
14
|
-
} from "./index-
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
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
|
-
/*
|
|
5
|
-
akanjs/ui/styles.css
|
|
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
|
-
|
|
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
|
|
33
|
+
slice={fetch.slice.${dict.model}InPublic}
|
|
34
34
|
edit={${dict.model}Edit}
|
|
35
35
|
type="form"
|
|
36
36
|
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
|
|
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>
|
package/templates/lib/db.ts
CHANGED
|
@@ -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},
|
|
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
|
-
|
|
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
|
};
|