@akanjs/cli 2.3.1-rc.5 → 2.3.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "2.3.1-rc.5",
3
+ "version": "2.3.1",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -35,7 +35,7 @@
35
35
  "@langchain/openai": "^1.4.6",
36
36
  "@tailwindcss/node": "^4.3.0",
37
37
  "@trapezedev/project": "^7.1.4",
38
- "akanjs": "2.3.1-rc.5",
38
+ "akanjs": "2.3.1",
39
39
  "chalk": "^5.6.2",
40
40
  "commander": "^14.0.3",
41
41
  "daisyui": "^5.5.20",
@@ -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 { endpoint } from "akanjs/signal";
4
+ return `import { internal, endpoint } from "akanjs/signal";
5
5
 
6
6
  import * as srv from "../srv";
7
7
 
@@ -12,10 +12,10 @@ import { store } from "akanjs/store";
12
12
  // Registered by akan scan into st.ts barrel.
13
13
 
14
14
  export class NotiStore extends store("noti" as const, () => ({
15
- notiList: [] as { id: string; type: string; message: string; sentAt: dayjs.Dayjs }[],
15
+ notiList: [] as { id: string; type: string; message: string; sentAt: Dayjs }[],
16
16
  unreadCount: 0,
17
17
  })) {
18
- addNoti(noti: { type: string; message: string; sentAt: dayjs.Dayjs }) {
18
+ addNoti(noti: { type: string; message: string; sentAt: Dayjs }) {
19
19
  const id = Math.random().toString(36).slice(2);
20
20
  this.set({
21
21
  notiList: [...(this.get().notiList ?? []), { ...noti, id }],
@@ -4,7 +4,7 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { a
4
4
  return {
5
5
  filename: "edit.tsx",
6
6
  content: `import { fetch, Task } from "@apps/${dict.appName}/client";
7
- import { Load } from "akanjs/ui";
7
+ import { Load, Link } from "akanjs/ui";
8
8
 
9
9
  // ===== page/task/[taskId]/edit.tsx =====
10
10
  // Convention: Server-side edit form page using Load.Edit from akanjs/ui.
@@ -17,10 +17,24 @@ interface PageProps {
17
17
  }
18
18
  export default async function Page({ params: { taskId } }: PageProps) {
19
19
  const { taskEdit } = await fetch.editTask(taskId);
20
+
20
21
  return (
21
- <Load.Edit slice={fetch.slice.taskInPublic} edit={taskEdit} type="form" onSubmit={\`/task/\${taskId}\`}>
22
- <Task.Template.General />
23
- </Load.Edit>
22
+ <main className="mx-auto max-w-2xl px-6 py-8">
23
+ <div className="mb-6">
24
+ <Link href={\`/task/\${taskId}\`} className="btn btn-ghost btn-sm">
25
+ ← Back to Task
26
+ </Link>
27
+ </div>
28
+ <div className="mb-6">
29
+ <h1 className="font-extrabold text-3xl text-base-content">Edit Task</h1>
30
+ <p className="mt-1 text-base-content/60 text-sm">Update the task details</p>
31
+ </div>
32
+ <div className="rounded-xl border border-base-content/10 bg-base-100 p-6 shadow-sm">
33
+ <Load.Edit slice={fetch.slice.taskInPublic} edit={taskEdit} type="form" onSubmit={\`/task/\${taskId}\`}>
34
+ <Task.Template.General />
35
+ </Load.Edit>
36
+ </div>
37
+ </main>
24
38
  );
25
39
  }
26
40
  `,
@@ -3,8 +3,8 @@ import type { AppInfo, LibInfo } from "akanjs";
3
3
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { appName: string }) {
4
4
  return {
5
5
  filename: "new.tsx",
6
- content: `import { type cnst, fetch, Task } from "@apps/${dict.appName}/client";
7
- import { Load } from "akanjs/ui";
6
+ content: `import { type cnst, fetch, Task, usePage } from "@apps/${dict.appName}/client";
7
+ import { Load, Link } from "akanjs/ui";
8
8
 
9
9
  // ===== page/task/new.tsx =====
10
10
  // Convention: Server-side form page using Load.Edit from akanjs/ui.
@@ -17,9 +17,22 @@ export default async function Page() {
17
17
  const taskForm: Partial<cnst.Task> = { status: "todo" };
18
18
 
19
19
  return (
20
- <Load.Edit slice={fetch.slice.taskInPublic} edit={taskForm} type="form" onCancel="back" onSubmit="/task">
21
- <Task.Template.General />
22
- </Load.Edit>
20
+ <main className="mx-auto max-w-2xl px-6 py-8">
21
+ <div className="mb-6">
22
+ <Link href="/task" className="btn btn-ghost btn-sm">
23
+ ← Tasks
24
+ </Link>
25
+ </div>
26
+ <div className="mb-6">
27
+ <h1 className="font-extrabold text-3xl text-base-content">New Task</h1>
28
+ <p className="mt-1 text-base-content/60 text-sm">Create a new task with title and description</p>
29
+ </div>
30
+ <div className="rounded-xl border border-base-content/10 bg-base-100 p-6 shadow-sm">
31
+ <Load.Edit slice={fetch.slice.taskInPublic} edit={taskForm} type="form" onCancel="back" onSubmit="/task">
32
+ <Task.Template.General />
33
+ </Load.Edit>
34
+ </div>
35
+ </main>
23
36
  );
24
37
  }`,
25
38
  };