@akanjs/cli 3.1.1-rc.12 → 3.1.1-rc.14
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/{CodeAgent-eaazb526.js → CodeAgent-gtwn7tmb.js} +2 -2
- package/{CodeTui-e7nh3rv9.js → CodeTui-v941fqdh.js} +1 -1
- package/akanCode.js +2 -2
- package/{code.command-at39gpkg.js → code.command-dyet4xn6.js} +4 -4
- package/{context.command-d35ppstw.js → context.command-79gxczm4.js} +2 -2
- package/{context.runner-azvkkzdr.js → context.runner-ejag7mhr.js} +1 -1
- package/guidelines/queryRule/queryRule.instruction.md +4 -0
- package/{index-qsz6w3d6.js → index-41d3zx66.js} +3 -3
- package/{index-8wd5r2xv.js → index-jjd97ya6.js} +1 -1
- package/{index-trvk51ht.js → index-jtydvvq7.js} +1 -1
- package/{index-7yzcaymm.js → index-pc9ps0hx.js} +1 -2
- package/index.js +3 -3
- package/package.json +2 -2
- package/templates/__scalar/__model__/__model__.constant.ts +3 -5
- package/templates/__scalar/__model__/__model__.dictionary.ts +6 -5
- package/templates/__scalar/__model__/__model__.document.ts +3 -3
- package/templates/app/akan.config.ts +2 -3
- package/templates/app/env/env.client.ts +2 -4
- package/templates/app/env/env.client.type.ts +2 -3
- package/templates/app/env/env.server.ts +2 -3
- package/templates/app/lib/___appName__/__appName__.dictionary.ts +1 -2
- package/templates/app/lib/___appName__/__appName__.service.ts +3 -3
- package/templates/app/lib/___appName__/__appName__.signal.ts +5 -5
- package/templates/app/lib/___appName__/__appName__.store.ts +4 -6
- package/templates/app/lib/option.ts +2 -3
- package/templates/app/main.ts +2 -4
- package/templates/app/page/_index.tsx +3 -3
- package/templates/app/page/_layout.tsx +13 -10
- package/templates/appSample/lib/__scalar/workHistory/workHistory.constant.ts +1 -5
- package/templates/appSample/lib/__scalar/workHistory/workHistory.dictionary.ts +1 -1
- package/templates/appSample/lib/_noti/noti.signal.ts +1 -1
- package/templates/appSample/lib/task/Task.Template.tsx +2 -1
- package/templates/appSample/lib/task/Task.Unit.tsx +3 -2
- package/templates/appSample/lib/task/Task.Util.tsx +16 -4
- package/templates/appSample/lib/task/task.constant.ts +1 -5
- package/templates/appSample/lib/task/task.dictionary.ts +2 -8
- package/templates/appSample/lib/task/task.document.ts +1 -1
- package/templates/appSample/page/task/_index.tsx +2 -1
- package/templates/appSample/page/task/new.tsx +2 -1
- package/templates/appSample/ui/QuantityControl.tsx +5 -9
- package/templates/biomeForm.ts +144 -0
- package/templates/crudPages/[__model__Id]/edit/page.tsx +3 -3
- package/templates/crudPages/[__model__Id]/page.tsx +5 -5
- package/templates/crudPages/new/page.tsx +4 -3
- package/templates/crudPages/page.tsx +3 -3
- package/templates/crudSinglePage/page.tsx +9 -5
- package/templates/libRoot/akan.config.ts +2 -3
- package/templates/libRoot/lib/___libName__/__libName__.dictionary.ts +1 -2
- package/templates/libRoot/lib/___libName__/__libName__.service.ts +5 -4
- package/templates/libRoot/lib/___libName__/__libName__.signal.ts +6 -5
- package/templates/libRoot/lib/___libName__/__libName__.store.ts +5 -6
- package/templates/libRoot/lib/option.ts +1 -2
- package/templates/module/__Model__.Template.tsx +11 -10
- package/templates/module/__Model__.Unit.tsx +18 -5
- package/templates/module/__Model__.Util.tsx +9 -7
- package/templates/module/__Model__.View.tsx +9 -6
- package/templates/module/__Model__.Zone.tsx +25 -17
- package/templates/module/__model__.constant.ts +8 -9
- package/templates/module/__model__.dictionary.ts +16 -17
- package/templates/module/__model__.document.ts +6 -8
- package/templates/module/__model__.service.ts +3 -3
- package/templates/module/__model__.signal.ts +11 -10
- package/templates/module/__model__.store.ts +3 -5
- package/templates/service/__model__.dictionary.ts +6 -5
- package/templates/service/__model__.service.ts +3 -3
- package/templates/service/__model__.signal.ts +5 -4
- package/templates/service/__model__.store.ts +3 -5
- package/templates/workspaceRoot/.vscode/settings.json.template +21 -21
- package/{workspace.command-j1680trm.js → workspace.command-097hv6n1.js} +2 -2
package/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
8f15797e897c836192d80c058541aaa725322f171101d088db59e554522ca821
|
package/akanCode.js
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
CodeMailbox2,
|
|
29
29
|
CodeSessionFork2,
|
|
30
30
|
CodeAgent2
|
|
31
|
-
} from "./index-
|
|
31
|
+
} from "./index-41d3zx66.js";
|
|
32
32
|
import {
|
|
33
33
|
akanCodeDefaultModel2,
|
|
34
34
|
akanCodeModel2,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
SubagentPool2,
|
|
41
41
|
akanCodePaths2,
|
|
42
42
|
AkanCodeCompaction2
|
|
43
|
-
} from "./index-
|
|
43
|
+
} from "./index-jjd97ya6.js";
|
|
44
44
|
import"./index-7md2g9vw.js";
|
|
45
45
|
import {
|
|
46
46
|
CodeAgentRpcHost2
|
|
@@ -19,7 +19,7 @@ class CodeRunner extends runner("code") {
|
|
|
19
19
|
async serve(options, listen) {
|
|
20
20
|
await import("./consoleToStderr-h5bryj94.js");
|
|
21
21
|
const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
|
|
22
|
-
import("./CodeAgent-
|
|
22
|
+
import("./CodeAgent-gtwn7tmb.js"),
|
|
23
23
|
import("./CodeAgentRpcHost-9g27hmer.js"),
|
|
24
24
|
import("./CodeAgentRpcListener-7p7z5dd7.js")
|
|
25
25
|
]);
|
|
@@ -34,8 +34,8 @@ class CodeRunner extends runner("code") {
|
|
|
34
34
|
}
|
|
35
35
|
async tui(options, seed) {
|
|
36
36
|
const [{ CodeAgent }, { CodeTui }] = await Promise.all([
|
|
37
|
-
import("./CodeAgent-
|
|
38
|
-
import("./CodeTui-
|
|
37
|
+
import("./CodeAgent-gtwn7tmb.js"),
|
|
38
|
+
import("./CodeTui-v941fqdh.js")
|
|
39
39
|
]);
|
|
40
40
|
const agentOptions = await CodeRunner.#agentOptions(options, false);
|
|
41
41
|
let resume = options.resume;
|
|
@@ -67,7 +67,7 @@ class CodeRunner extends runner("code") {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
async run(prompt, options) {
|
|
70
|
-
const { CodeAgent } = await import("./CodeAgent-
|
|
70
|
+
const { CodeAgent } = await import("./CodeAgent-gtwn7tmb.js");
|
|
71
71
|
const agent = await CodeAgent.create(await CodeRunner.#agentOptions(options, false));
|
|
72
72
|
const printer = new CodeAgentStreamPrinter2({ json: options.json, thinking: options.thinking });
|
|
73
73
|
agent.on((event) => printer.print(event));
|
|
@@ -8,7 +8,7 @@ import"./index-1e2955yd.js";
|
|
|
8
8
|
import"./index-hj6w4ka1.js";
|
|
9
9
|
import"./index-pqdz7rat.js";
|
|
10
10
|
import"./index-kr62ph5a.js";
|
|
11
|
-
import"./index-
|
|
11
|
+
import"./index-pc9ps0hx.js";
|
|
12
12
|
import"./index-2qzzp0c9.js";
|
|
13
13
|
import"./index-8rvwgd1r.js";
|
|
14
14
|
import"./index-m9jj544v.js";
|
|
@@ -23,7 +23,7 @@ import"./index-kbbyzs6j.js";
|
|
|
23
23
|
import"./index-y5m4j2w6.js";
|
|
24
24
|
import {
|
|
25
25
|
ContextScript
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-jtydvvq7.js";
|
|
27
27
|
|
|
28
28
|
// pkgs/@akanjs/cli/context/context.command.ts
|
|
29
29
|
class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
|
|
@@ -120,6 +120,10 @@ this is the full contract behind them.
|
|
|
120
120
|
still run — a nudge that re-sends a row its rooms must re-read, with no edit to stamp.
|
|
121
121
|
- `upsertById(data, { preserveTimestamps })` writes a record whole under its own id, new or in place, with no
|
|
122
122
|
hook: the write a sync or a backfill repeats safely, keeping the record's `createdAt`/`updatedAt` when asked.
|
|
123
|
+
With `{ where }` it writes over a stored row only when that row matches, in the same statement, and never over a
|
|
124
|
+
removed row unless `withRemoved` is also passed; an id no row holds is inserted. It then answers `updateOne`'s
|
|
125
|
+
result: `modifiedCount` 0 when the stored row did not match, and `upsertedId` set on an insert. A writer whose
|
|
126
|
+
lease may have lapsed passes the lease as `where`, so a takeover's row is never overwritten or revived.
|
|
123
127
|
- **Writes that must land together go in `this.transaction(async () => …)`**, which every service has: it commits
|
|
124
128
|
when the body resolves, returns its value, and rolls back when it throws, rethrowing that error unchanged. A
|
|
125
129
|
server has one database, so it covers every model, hooks and query-level writes included; a nested call joins the
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
McpServerConfig,
|
|
6
6
|
McpSignIn,
|
|
7
7
|
AkanCodeCompaction2
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-jjd97ya6.js";
|
|
9
9
|
import {
|
|
10
10
|
stripAnsi
|
|
11
11
|
} from "./index-7md2g9vw.js";
|
|
@@ -809,7 +809,7 @@ class AkanToolPack2 {
|
|
|
809
809
|
return { name: "akan-tools", factory: async (pi) => await this.#register(pi) };
|
|
810
810
|
}
|
|
811
811
|
async names() {
|
|
812
|
-
const { ContextRunner } = await import("./context.runner-
|
|
812
|
+
const { ContextRunner } = await import("./context.runner-ejag7mhr.js");
|
|
813
813
|
return [
|
|
814
814
|
...new ContextRunner().listMcpTools(this.#options.mode).map((tool) => tool.name),
|
|
815
815
|
AkanToolPack2.verifyToolName
|
|
@@ -817,7 +817,7 @@ class AkanToolPack2 {
|
|
|
817
817
|
}
|
|
818
818
|
static verifyToolName = "akan_verify";
|
|
819
819
|
async#register(pi) {
|
|
820
|
-
const { ContextRunner } = await import("./context.runner-
|
|
820
|
+
const { ContextRunner } = await import("./context.runner-ejag7mhr.js");
|
|
821
821
|
const runner = new ContextRunner;
|
|
822
822
|
const guidelineNames = await AkanToolPack2.#guidelineNames();
|
|
823
823
|
for (const tool of runner.listMcpTools(this.#options.mode, { guidelineNames })) {
|
|
@@ -179,7 +179,7 @@ class SubagentPool2 {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
async#run(id, kind, prompt, signal) {
|
|
182
|
-
const { CodeAgent } = await import("./CodeAgent-
|
|
182
|
+
const { CodeAgent } = await import("./CodeAgent-gtwn7tmb.js");
|
|
183
183
|
const budget = this.#options.parent.tools.subagent;
|
|
184
184
|
const child = SubagentPool2.childOf(this.#options.parent, kind);
|
|
185
185
|
const model = this.#options.model?.();
|
|
@@ -654,8 +654,7 @@ class ContextRunner2 extends runner("context") {
|
|
|
654
654
|
throw new Error(`${configPath} already has an "akan" MCP server. Re-run with --force to overwrite it.`);
|
|
655
655
|
}
|
|
656
656
|
const nextConfig = { ...existing, mcpServers: { ...mcpServers, akan: nextAkanServer } };
|
|
657
|
-
await workspace.writeFile(configPath,
|
|
658
|
-
`);
|
|
657
|
+
await workspace.writeFile(configPath, nextConfig);
|
|
659
658
|
return configPath;
|
|
660
659
|
}
|
|
661
660
|
async#installCodexMcp(workspace, { force, mode }) {
|
package/index.js
CHANGED
|
@@ -22,16 +22,16 @@ import path from "path";
|
|
|
22
22
|
|
|
23
23
|
// pkgs/@akanjs/cli/commandModules.ts
|
|
24
24
|
var commandModules = {
|
|
25
|
-
workspace: async () => (await import("./workspace.command-
|
|
25
|
+
workspace: async () => (await import("./workspace.command-097hv6n1.js")).WorkspaceCommand,
|
|
26
26
|
agent: async () => (await import("./agent.command-h82gepwn.js")).AgentCommand,
|
|
27
|
-
code: async () => (await import("./code.command-
|
|
27
|
+
code: async () => (await import("./code.command-dyet4xn6.js")).CodeCommand,
|
|
28
28
|
application: async () => (await import("./application.command-j1reb9p1.js")).ApplicationCommand,
|
|
29
29
|
library: async () => (await import("./library.command-td8t85kb.js")).LibraryCommand,
|
|
30
30
|
localRegistry: async () => (await import("./localRegistry.command-jx9zkmxf.js")).LocalRegistryCommand,
|
|
31
31
|
package: async () => (await import("./package.command-1b1v6k5v.js")).PackageCommand,
|
|
32
32
|
module: async () => (await import("./module.command-j70mqgpp.js")).ModuleCommand,
|
|
33
33
|
page: async () => (await import("./page.command-m31w2tsz.js")).PageCommand,
|
|
34
|
-
context: async () => (await import("./context.command-
|
|
34
|
+
context: async () => (await import("./context.command-79gxczm4.js")).ContextCommand,
|
|
35
35
|
cloud: async () => (await import("./cloud.command-zd2mfkm0.js")).CloudCommand,
|
|
36
36
|
subspace: async () => (await import("./subspace.command-ej0rk116.js")).SubspaceCommand,
|
|
37
37
|
guideline: async () => (await import("./guideline.command-xwkskvky.js")).GuidelineCommand,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "3.1.1-rc.
|
|
3
|
+
"version": "3.1.1-rc.14",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@earendil-works/pi-tui": "1.3.0",
|
|
40
40
|
"@inquirer/prompts": "^8.7.3",
|
|
41
41
|
"@tailwindcss/node": "^4.3.3",
|
|
42
|
-
"akanjs": "3.1.1-rc.
|
|
42
|
+
"akanjs": "3.1.1-rc.14",
|
|
43
43
|
"chalk": "^6.0.1",
|
|
44
44
|
"commander": "^15.0.0",
|
|
45
45
|
"dayjs": "^1.11.23",
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import type { AppInfo, LibInfo } from "akanjs";
|
|
2
|
+
import { BiomeForm } from "../../biomeForm";
|
|
2
3
|
|
|
3
4
|
interface Dict {
|
|
4
5
|
model: string;
|
|
5
6
|
Model: string;
|
|
6
7
|
}
|
|
7
8
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
|
|
8
|
-
return `
|
|
9
|
-
import { via } from "akanjs/constant";
|
|
9
|
+
return `import { via } from "akanjs/constant";
|
|
10
10
|
|
|
11
|
-
export class ${dict.Model} extends via(
|
|
12
|
-
field: field(String),
|
|
13
|
-
})) {}
|
|
11
|
+
${BiomeForm.callArgs("", `export class ${dict.Model} extends via`, ["(field) => ({\n field: field(String),\n})"], " {}")}
|
|
14
12
|
`;
|
|
15
13
|
}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import type { AppInfo, LibInfo } from "akanjs";
|
|
2
|
+
import { BiomeForm } from "../../biomeForm";
|
|
2
3
|
|
|
3
4
|
interface Dict {
|
|
4
5
|
model: string;
|
|
5
6
|
Model: string;
|
|
6
7
|
}
|
|
7
8
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
|
|
8
|
-
|
|
9
|
-
import { scalarDictionary } from "akanjs/dictionary";
|
|
9
|
+
const { Model, model } = dict;
|
|
10
|
+
return `import { scalarDictionary } from "akanjs/dictionary";
|
|
10
11
|
|
|
11
|
-
import type { ${
|
|
12
|
+
import type { ${Model} } from "./${model}.constant";
|
|
12
13
|
|
|
13
14
|
export const dictionary = scalarDictionary(["en", "ko"])
|
|
14
|
-
|
|
15
|
-
.model<${
|
|
15
|
+
${BiomeForm.dictionaryOf([Model, Model], [`${Model} description`, `${Model} 설명`])}
|
|
16
|
+
.model<${Model}>((t) => ({
|
|
16
17
|
field: t(["Field", "필드"]).desc(["Field Description", "필드 설명"]),
|
|
17
18
|
}));
|
|
18
19
|
`;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { AppInfo, LibInfo } from "akanjs";
|
|
2
|
+
import { BiomeForm } from "../../biomeForm";
|
|
2
3
|
|
|
3
4
|
interface Dict {
|
|
4
5
|
model: string;
|
|
5
6
|
Model: string;
|
|
6
7
|
}
|
|
7
8
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
|
|
8
|
-
return `
|
|
9
|
-
import { by } from "akanjs/document";
|
|
9
|
+
return `import { by } from "akanjs/document";
|
|
10
10
|
|
|
11
11
|
import * as cnst from "./${dict.model}.constant";
|
|
12
12
|
|
|
13
|
-
export class ${dict.Model} extends by
|
|
13
|
+
${BiomeForm.callArgs("", `export class ${dict.Model} extends by`, [`cnst.${dict.Model}`], " {}")}
|
|
14
14
|
`;
|
|
15
15
|
}
|
|
@@ -4,11 +4,10 @@ interface Dict {
|
|
|
4
4
|
appName: string;
|
|
5
5
|
}
|
|
6
6
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
|
|
7
|
-
return `
|
|
8
|
-
import type { AppConfig } from "akanjs";
|
|
7
|
+
return `import type { AppConfig } from "akanjs";
|
|
9
8
|
|
|
10
9
|
const config: AppConfig = {};
|
|
11
10
|
|
|
12
11
|
export default config;
|
|
13
|
-
|
|
12
|
+
`;
|
|
14
13
|
}
|
|
@@ -4,8 +4,7 @@ interface Dict {
|
|
|
4
4
|
[key: string]: string;
|
|
5
5
|
}
|
|
6
6
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict = {}) {
|
|
7
|
-
return `
|
|
8
|
-
import { env as debug } from "./env.client.debug";
|
|
7
|
+
return `import { env as debug } from "./env.client.debug";
|
|
9
8
|
import { env as develop } from "./env.client.develop";
|
|
10
9
|
import { env as local } from "./env.client.local";
|
|
11
10
|
import { env as main } from "./env.client.main";
|
|
@@ -16,6 +15,5 @@ const currentEnv = process.env.AKAN_PUBLIC_ENV ?? "local";
|
|
|
16
15
|
if (!(currentEnv in envConfigs)) throw new Error(\`Unknown environment: \${currentEnv}\`);
|
|
17
16
|
|
|
18
17
|
export const env = envConfigs[currentEnv as keyof typeof envConfigs];
|
|
19
|
-
|
|
20
|
-
`;
|
|
18
|
+
`;
|
|
21
19
|
}
|
|
@@ -4,8 +4,7 @@ interface Dict {
|
|
|
4
4
|
[key: string]: string;
|
|
5
5
|
}
|
|
6
6
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict = {}) {
|
|
7
|
-
return
|
|
8
|
-
// Replace with the public env keys this app reads, e.g. { google?: { mapKey: string } }.
|
|
7
|
+
return `// Replace with the public env keys this app reads, e.g. { google?: { mapKey: string } }.
|
|
9
8
|
export type AppClientEnv = Record<never, never>;
|
|
10
|
-
|
|
9
|
+
`;
|
|
11
10
|
}
|
|
@@ -4,8 +4,7 @@ interface Dict {
|
|
|
4
4
|
[key: string]: string;
|
|
5
5
|
}
|
|
6
6
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict = {}) {
|
|
7
|
-
return `
|
|
8
|
-
import { env as debug } from "./env.server.debug";
|
|
7
|
+
return `import { env as debug } from "./env.server.debug";
|
|
9
8
|
import { env as develop } from "./env.server.develop";
|
|
10
9
|
import { env as local } from "./env.server.local";
|
|
11
10
|
import { env as main } from "./env.server.main";
|
|
@@ -16,5 +15,5 @@ const currentEnv = process.env.AKAN_PUBLIC_ENV ?? "local";
|
|
|
16
15
|
if (!(currentEnv in envConfigs)) throw new Error(\`Unknown environment: \${currentEnv}\`);
|
|
17
16
|
|
|
18
17
|
export const env = envConfigs[currentEnv as keyof typeof envConfigs];
|
|
19
|
-
|
|
18
|
+
`;
|
|
20
19
|
}
|
|
@@ -5,8 +5,7 @@ interface Dict {
|
|
|
5
5
|
AppName: string;
|
|
6
6
|
}
|
|
7
7
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
|
|
8
|
-
return `
|
|
9
|
-
import { serviceDictionary } from "akanjs/dictionary";
|
|
8
|
+
return `import { serviceDictionary } from "akanjs/dictionary";
|
|
10
9
|
|
|
11
10
|
import type { ${dict.AppName}Endpoint } from "./${dict.appName}.signal";
|
|
12
11
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { AppInfo, LibInfo } from "akanjs";
|
|
2
|
+
import { BiomeForm } from "../../../biomeForm";
|
|
2
3
|
|
|
3
4
|
interface Dict {
|
|
4
5
|
appName: string;
|
|
5
6
|
AppName: string;
|
|
6
7
|
}
|
|
7
8
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
|
|
8
|
-
return `
|
|
9
|
-
import { serve } from "akanjs/service";
|
|
9
|
+
return `import { serve } from "akanjs/service";
|
|
10
10
|
|
|
11
|
-
export class ${dict.AppName}Service extends serve
|
|
11
|
+
${BiomeForm.callArgs("", `export class ${dict.AppName}Service extends serve`, [`"${dict.appName}" as const`, '{ serverMode: "batch" }', "() => ({})"], " {}")}
|
|
12
12
|
`;
|
|
13
13
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { AppInfo, LibInfo } from "akanjs";
|
|
2
|
+
import { BiomeForm } from "../../../biomeForm";
|
|
2
3
|
|
|
3
4
|
interface Dict {
|
|
4
5
|
appName: string;
|
|
5
6
|
AppName: string;
|
|
6
7
|
}
|
|
7
8
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
|
|
8
|
-
return `
|
|
9
|
-
import { endpoint, internal } from "akanjs/signal";
|
|
9
|
+
return `import { endpoint, internal } from "akanjs/signal";
|
|
10
10
|
|
|
11
11
|
import * as srv from "../srv";
|
|
12
12
|
|
|
13
|
-
export class ${dict.AppName}Internal extends internal
|
|
13
|
+
${BiomeForm.callArgs("", `export class ${dict.AppName}Internal extends internal`, [`srv.${dict.appName}`, "() => ({})"], " {}")}
|
|
14
14
|
|
|
15
|
-
export class ${dict.AppName}Endpoint extends endpoint
|
|
16
|
-
|
|
15
|
+
${BiomeForm.callArgs("", `export class ${dict.AppName}Endpoint extends endpoint`, [`srv.${dict.appName}`, "() => ({})"], " {}")}
|
|
16
|
+
`;
|
|
17
17
|
}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import type { AppInfo, LibInfo } from "akanjs";
|
|
2
|
+
import { BiomeForm } from "../../../biomeForm";
|
|
2
3
|
|
|
3
4
|
interface Dict {
|
|
4
5
|
appName: string;
|
|
5
6
|
AppName: string;
|
|
6
7
|
}
|
|
7
8
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
|
|
8
|
-
return `
|
|
9
|
-
import { store } from "akanjs/store";
|
|
9
|
+
return `import { store } from "akanjs/store";
|
|
10
10
|
|
|
11
|
-
export class ${dict.AppName}Store extends store
|
|
12
|
-
// state
|
|
13
|
-
})) {
|
|
11
|
+
${BiomeForm.callArgs("", `export class ${dict.AppName}Store extends store`, [`"${dict.appName}" as const`, "() => ({\n // state\n})"], " {")}
|
|
14
12
|
// action
|
|
15
13
|
}
|
|
16
|
-
|
|
14
|
+
`;
|
|
17
15
|
}
|
|
@@ -4,8 +4,7 @@ interface Dict {
|
|
|
4
4
|
[key: string]: string;
|
|
5
5
|
}
|
|
6
6
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict = {}) {
|
|
7
|
-
return `
|
|
8
|
-
import { AkanOption } from "akanjs/server";
|
|
7
|
+
return `import { AkanOption } from "akanjs/server";
|
|
9
8
|
|
|
10
9
|
import type { LibOptions } from "./srv";
|
|
11
10
|
|
|
@@ -14,5 +13,5 @@ export type ModulesOptions = LibOptions & {
|
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
export const option = new AkanOption<ModulesOptions>();
|
|
17
|
-
|
|
16
|
+
`;
|
|
18
17
|
}
|
package/templates/app/main.ts
CHANGED
|
@@ -4,8 +4,7 @@ interface Dict {
|
|
|
4
4
|
appName: string;
|
|
5
5
|
}
|
|
6
6
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict) {
|
|
7
|
-
return
|
|
8
|
-
// Not the \`akanjs/server\` barrel: it re-exports AkanServer, whose graph the gateway never runs. Through the
|
|
7
|
+
return `// Not the \`akanjs/server\` barrel: it re-exports AkanServer, whose graph the gateway never runs. Through the
|
|
9
8
|
// barrel this process evaluates 35MB of SSR renderer and DB driver to spawn children and relay bytes.
|
|
10
9
|
import { AkanApp } from "akanjs/server/akanApp";
|
|
11
10
|
|
|
@@ -13,6 +12,5 @@ const run = async () => {
|
|
|
13
12
|
await new AkanApp().start();
|
|
14
13
|
};
|
|
15
14
|
void run();
|
|
16
|
-
|
|
17
|
-
`;
|
|
15
|
+
`;
|
|
18
16
|
}
|
|
@@ -35,8 +35,7 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dic
|
|
|
35
35
|
: "";
|
|
36
36
|
return {
|
|
37
37
|
filename: "_index.tsx",
|
|
38
|
-
content: `
|
|
39
|
-
import { jellyButtonRecipe } from "@apps/${dict.appName}/ui";
|
|
38
|
+
content: `import { jellyButtonRecipe } from "@apps/${dict.appName}/ui";
|
|
40
39
|
import { getEnv } from "akanjs/base";
|
|
41
40
|
import { cn, page, usePage } from "akanjs/client";
|
|
42
41
|
import { Image, Link, System } from "akanjs/ui";
|
|
@@ -293,6 +292,7 @@ export default page().render(() => {
|
|
|
293
292
|
</div>
|
|
294
293
|
</main>
|
|
295
294
|
);
|
|
296
|
-
})
|
|
295
|
+
});
|
|
296
|
+
`,
|
|
297
297
|
};
|
|
298
298
|
}
|
|
@@ -5,12 +5,19 @@ interface Dict {
|
|
|
5
5
|
}
|
|
6
6
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict, options: { libs: string[] }) {
|
|
7
7
|
const isUsingShared = options.libs.includes("shared");
|
|
8
|
+
const rendered = isUsingShared
|
|
9
|
+
? `(
|
|
10
|
+
<>
|
|
11
|
+
{children}
|
|
12
|
+
<Auth.User />
|
|
13
|
+
<Auth.Admin />
|
|
14
|
+
</>
|
|
15
|
+
)`
|
|
16
|
+
: "<>{children}</>";
|
|
8
17
|
return {
|
|
9
18
|
filename: "_layout.tsx",
|
|
10
|
-
content: `
|
|
11
|
-
import "
|
|
12
|
-
import { rootLayout } from "akanjs/client";
|
|
13
|
-
${isUsingShared ? "import { Auth } from '@shared/ui';" : ""}
|
|
19
|
+
content: `import "./styles.css";
|
|
20
|
+
${isUsingShared ? 'import { Auth } from "@libs/shared/ui";\n' : ""}import { rootLayout } from "akanjs/client";
|
|
14
21
|
|
|
15
22
|
export default rootLayout()
|
|
16
23
|
.fonts([
|
|
@@ -41,12 +48,8 @@ export default rootLayout()
|
|
|
41
48
|
</>,
|
|
42
49
|
)
|
|
43
50
|
.render(({ children }) => {
|
|
44
|
-
return
|
|
45
|
-
<>
|
|
46
|
-
{children}${isUsingShared ? "\n <Auth.User />\n <Auth.Admin />" : ""}
|
|
47
|
-
</>
|
|
48
|
-
);
|
|
51
|
+
return ${rendered};
|
|
49
52
|
});
|
|
50
|
-
|
|
53
|
+
`,
|
|
51
54
|
};
|
|
52
55
|
}
|
|
@@ -12,11 +12,7 @@ import { via } from "akanjs/constant";
|
|
|
12
12
|
// ---- Enum ----
|
|
13
13
|
// WorkHistoryAction: the type of change recorded in a work history entry
|
|
14
14
|
// Scalar enums follow the same enumOf() convention as model enums
|
|
15
|
-
export class WorkHistoryAction extends enumOf("workHistoryAction", [
|
|
16
|
-
"created",
|
|
17
|
-
"started",
|
|
18
|
-
"completed",
|
|
19
|
-
] as const) {}
|
|
15
|
+
export class WorkHistoryAction extends enumOf("workHistoryAction", ["created", "started", "completed"] as const) {}
|
|
20
16
|
|
|
21
17
|
// ---- Scalar Entry ----
|
|
22
18
|
// WorkHistory: a single entry in a model's workHistory list
|
|
@@ -3,7 +3,7 @@ import type { AppInfo, LibInfo } from "akanjs";
|
|
|
3
3
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { appName: string }) {
|
|
4
4
|
return `import { scalarDictionary } from "akanjs/dictionary";
|
|
5
5
|
|
|
6
|
-
import type {
|
|
6
|
+
import type { WorkHistory, WorkHistoryAction } from "./workHistory.constant";
|
|
7
7
|
|
|
8
8
|
// ===== workHistory.dictionary.ts =====
|
|
9
9
|
// Convention: scalarDictionary() for scalar module i18n — fewer layers than modelDictionary().
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AppInfo, LibInfo } from "akanjs";
|
|
2
2
|
|
|
3
3
|
export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { appName: string }) {
|
|
4
|
-
return `import {
|
|
4
|
+
return `import { endpoint, internal } from "akanjs/signal";
|
|
5
5
|
|
|
6
6
|
import * as srv from "../srv";
|
|
7
7
|
|
|
@@ -4,7 +4,7 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { a
|
|
|
4
4
|
return {
|
|
5
5
|
filename: "Task.Unit.tsx",
|
|
6
6
|
content: `import { type cnst, usePage } from "@apps/${dict.appName}/client";
|
|
7
|
-
import { type ModelProps
|
|
7
|
+
import { cn, type ModelProps } from "akanjs/client";
|
|
8
8
|
import { badgeRecipe, Layout } from "akanjs/ui";
|
|
9
9
|
|
|
10
10
|
// ===== Task.Unit.tsx =====
|
|
@@ -60,6 +60,7 @@ export const Card = ({ task, className, href }: CardProps) => {
|
|
|
60
60
|
// Abstract: abstracted summary display (search results, previews)
|
|
61
61
|
// export const Abstract = ({ task }: AbstractProps) => (
|
|
62
62
|
// <div className="text-sm">{task.title} — {l("taskStatus", task.status)}</div>
|
|
63
|
-
// )
|
|
63
|
+
// );
|
|
64
|
+
`,
|
|
64
65
|
};
|
|
65
66
|
}
|
|
@@ -20,7 +20,11 @@ interface StartProps {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export const Start = ({ taskId }: StartProps) => (
|
|
23
|
-
<button
|
|
23
|
+
<button
|
|
24
|
+
type="button"
|
|
25
|
+
className={jellyButtonRecipe({ variant: "primary", size: "xs" })}
|
|
26
|
+
onClick={() => st.do.startTask(taskId)}
|
|
27
|
+
>
|
|
24
28
|
{usePage().l("task.taskStart")}
|
|
25
29
|
</button>
|
|
26
30
|
);
|
|
@@ -30,7 +34,11 @@ interface CompleteProps {
|
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
export const Complete = ({ taskId }: CompleteProps) => (
|
|
33
|
-
<button
|
|
37
|
+
<button
|
|
38
|
+
type="button"
|
|
39
|
+
className={jellyButtonRecipe({ variant: "success", size: "xs" })}
|
|
40
|
+
onClick={() => st.do.completeTask(taskId)}
|
|
41
|
+
>
|
|
34
42
|
{usePage().l("task.taskComplete")}
|
|
35
43
|
</button>
|
|
36
44
|
);
|
|
@@ -63,12 +71,16 @@ export const Toolbox = ({ taskId, status }: ToolboxProps) => {
|
|
|
63
71
|
<>
|
|
64
72
|
{status === "todo" && (
|
|
65
73
|
<li>
|
|
66
|
-
<button type="button" onClick={() => st.do.startTask(taskId)}>
|
|
74
|
+
<button type="button" onClick={() => st.do.startTask(taskId)}>
|
|
75
|
+
{l("task.taskStart")}
|
|
76
|
+
</button>
|
|
67
77
|
</li>
|
|
68
78
|
)}
|
|
69
79
|
{status === "inProgress" && (
|
|
70
80
|
<li>
|
|
71
|
-
<button type="button" onClick={() => st.do.completeTask(taskId)}>
|
|
81
|
+
<button type="button" onClick={() => st.do.completeTask(taskId)}>
|
|
82
|
+
{l("task.taskComplete")}
|
|
83
|
+
</button>
|
|
72
84
|
</li>
|
|
73
85
|
)}
|
|
74
86
|
<li>
|
|
@@ -14,11 +14,7 @@ import { WorkHistory } from "../__scalar/workHistory/workHistory.constant";
|
|
|
14
14
|
// Input = user-provided fields; Object = Input + system fields + embedded scalars; Light = subset for list views; Full = Object + Light.
|
|
15
15
|
// Registered by akan sync into cnst.ts barrel.
|
|
16
16
|
|
|
17
|
-
export class TaskStatus extends enumOf("taskStatus", [
|
|
18
|
-
"todo",
|
|
19
|
-
"inProgress",
|
|
20
|
-
"completed",
|
|
21
|
-
] as const) {}
|
|
17
|
+
export class TaskStatus extends enumOf("taskStatus", ["todo", "inProgress", "completed"] as const) {}
|
|
22
18
|
|
|
23
19
|
export class TaskInput extends via((field) => ({
|
|
24
20
|
title: field(String),
|