@akanjs/cli 0.0.42 → 0.0.43
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/index.js +30 -4
- package/package.json +1 -1
- package/src/templates/__scalar/__model__/__model__.constant.js +36 -0
- package/src/templates/__scalar/__model__/__model__.dictionary.js +47 -0
- package/src/templates/__scalar/__model__/__model__.document.js +34 -0
- package/src/templates/app/akan.config.ts.template +5 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.js +45 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/page.js +46 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/privacy/page.js +40 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/signin/page.js +48 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/termsofservice/page.js +39 -0
- package/src/templates/app/app/[lang]/(__appName__)/(user)/layout.js +41 -0
- package/src/templates/app/app/[lang]/(__appName__)/(user)/self/page.js +58 -0
- package/src/templates/app/app/[lang]/(__appName__)/layout.js +50 -0
- package/src/templates/app/app/[lang]/admin/layout.js +51 -0
- package/src/templates/app/app/[lang]/admin/page.js +61 -0
- package/src/templates/app/app/csr.js +32 -0
- package/src/templates/app/app/index.html.template +13 -0
- package/src/templates/app/app/layout.js +36 -0
- package/src/templates/app/app/robots.js +41 -0
- package/src/templates/app/app/sitemap.js +37 -0
- package/src/templates/app/base/baseLogic.js +36 -0
- package/src/templates/app/base/index.js +30 -0
- package/src/templates/app/capacitor.config.ts.template +8 -0
- package/src/templates/app/common/commonLogic.js +36 -0
- package/src/templates/app/common/index.js +30 -0
- package/src/templates/app/env/env.client.js +39 -0
- package/src/templates/app/env/env.client.type.js +36 -0
- package/src/templates/app/env/env.server.js +39 -0
- package/src/templates/app/jest.config.js +37 -0
- package/src/templates/app/lib/___appName__/__appName__.dictionary.js +32 -0
- package/src/templates/app/lib/___appName__/__appName__.service.js +43 -0
- package/src/templates/app/lib/___appName__/__appName__.store.js +37 -0
- package/src/templates/app/lib/___appName__/_server.js +35 -0
- package/src/templates/app/lib/option.js +43 -0
- package/src/templates/app/lib/setting/Setting.Template.js +55 -0
- package/src/templates/app/lib/setting/Setting.Unit.js +36 -0
- package/src/templates/app/lib/setting/Setting.Util.js +32 -0
- package/src/templates/app/lib/setting/Setting.View.js +49 -0
- package/src/templates/app/lib/setting/Setting.Zone.js +78 -0
- package/src/templates/app/lib/setting/_server.js +49 -0
- package/src/templates/app/lib/setting/index.js +59 -0
- package/src/templates/app/lib/setting/setting.constant.js +47 -0
- package/src/templates/app/lib/setting/setting.dictionary.js +47 -0
- package/src/templates/app/lib/setting/setting.document.js +49 -0
- package/src/templates/app/lib/setting/setting.service.js +38 -0
- package/src/templates/app/lib/setting/setting.signal.js +35 -0
- package/src/templates/app/lib/setting/setting.store.js +42 -0
- package/src/templates/app/lib/summary/Summary.Template.js +41 -0
- package/src/templates/app/lib/summary/Summary.Unit.js +36 -0
- package/src/templates/app/lib/summary/Summary.Util.js +31 -0
- package/src/templates/app/lib/summary/Summary.View.js +49 -0
- package/src/templates/app/lib/summary/Summary.Zone.js +60 -0
- package/src/templates/app/lib/summary/_server.js +49 -0
- package/src/templates/app/lib/summary/index.js +65 -0
- package/src/templates/app/lib/summary/summary.constant.js +45 -0
- package/src/templates/app/lib/summary/summary.dictionary.js +50 -0
- package/src/templates/app/lib/summary/summary.document.js +49 -0
- package/src/templates/app/lib/summary/summary.service.js +35 -0
- package/src/templates/app/lib/summary/summary.signal.js +35 -0
- package/src/templates/app/lib/summary/summary.store.js +42 -0
- package/src/templates/app/lib/user/User.Template.js +63 -0
- package/src/templates/app/lib/user/User.Unit.js +36 -0
- package/src/templates/app/lib/user/User.Util.js +92 -0
- package/src/templates/app/lib/user/User.View.js +64 -0
- package/src/templates/app/lib/user/User.Zone.js +72 -0
- package/src/templates/app/lib/user/_server.js +49 -0
- package/src/templates/app/lib/user/index.js +59 -0
- package/src/templates/app/lib/user/user.constant.js +68 -0
- package/src/templates/app/lib/user/user.dictionary.js +53 -0
- package/src/templates/app/lib/user/user.document.js +55 -0
- package/src/templates/app/lib/user/user.service.js +43 -0
- package/src/templates/app/lib/user/user.signal.js +35 -0
- package/src/templates/app/lib/user/user.signal.spec.js +38 -0
- package/src/templates/app/lib/user/user.signal.test.js +40 -0
- package/src/templates/app/lib/user/user.store.js +40 -0
- package/src/templates/app/main.js +41 -0
- package/src/templates/app/middleware.js +36 -0
- package/src/templates/app/nest/backendLogic.js +35 -0
- package/src/templates/app/nest/index.js +30 -0
- package/src/templates/app/next/frontendLogic.js +35 -0
- package/src/templates/app/next/index.js +30 -0
- package/src/templates/app/page.test.ts.template +10 -0
- package/src/templates/app/playwright.config.ts.template +6 -0
- package/src/templates/app/postcss.config.js.template +10 -0
- package/src/templates/app/public/favicon.ico +0 -0
- package/src/templates/app/public/icons/icon-128x128.png +0 -0
- package/src/templates/app/public/icons/icon-144x144.png +0 -0
- package/src/templates/app/public/icons/icon-152x152.png +0 -0
- package/src/templates/app/public/icons/icon-192x192.png +0 -0
- package/src/templates/app/public/icons/icon-256x256.png +0 -0
- package/src/templates/app/public/icons/icon-384x384.png +0 -0
- package/src/templates/app/public/icons/icon-48x48.png +0 -0
- package/src/templates/app/public/icons/icon-512x512.png +0 -0
- package/src/templates/app/public/icons/icon-72x72.png +0 -0
- package/src/templates/app/public/icons/icon-96x96.png +0 -0
- package/src/templates/app/public/logo.svg +70 -0
- package/src/templates/app/public/manifest.json.template +67 -0
- package/src/templates/app/tsconfig.json.template +22 -0
- package/src/templates/app/tsconfig.spec.json.template +7 -0
- package/src/templates/app/ui/Footer.js +65 -0
- package/src/templates/app/ui/MainHeader.js +129 -0
- package/src/templates/app/ui/index.js +31 -0
- package/src/templates/client.js +43 -0
- package/src/templates/crudPages/[__model__Id]/edit/page.js +71 -0
- package/src/templates/crudPages/[__model__Id]/page.js +81 -0
- package/src/templates/crudPages/new/page.js +68 -0
- package/src/templates/crudPages/page.js +69 -0
- package/src/templates/index.js +32 -0
- package/src/templates/lib/__lib/extends/summary.constant.js +44 -0
- package/src/templates/lib/__lib/lib.constant.js +54 -0
- package/src/templates/lib/__lib/lib.dictionary.js +43 -0
- package/src/templates/lib/__lib/lib.document.js +42 -0
- package/src/templates/lib/__lib/lib.service.js +84 -0
- package/src/templates/lib/__lib/lib.signal.js +37 -0
- package/src/templates/lib/__lib/lib.store.js +35 -0
- package/src/templates/lib/__scalar/_server.js +40 -0
- package/src/templates/lib/cnst.js +33 -0
- package/src/templates/lib/cnst_.js +52 -0
- package/src/templates/lib/db.js +54 -0
- package/src/templates/lib/dict.js +46 -0
- package/src/templates/lib/fetch.js +49 -0
- package/src/templates/lib/sig.js +38 -0
- package/src/templates/lib/srv.js +53 -0
- package/src/templates/lib/st.js +37 -0
- package/src/templates/lib/store.js +53 -0
- package/src/templates/lib/usePage.js +34 -0
- package/src/templates/libRoot/.gitignore.template +15 -0
- package/src/templates/libRoot/jest.config.js +37 -0
- package/src/templates/libRoot/package.json.template +5 -0
- package/src/templates/libRoot/tsconfig.json.template +11 -0
- package/src/templates/libRoot/tsconfig.spec.json.template +7 -0
- package/src/templates/module/__Model__.Template.js +52 -0
- package/src/templates/module/__Model__.Unit.js +40 -0
- package/src/templates/module/__Model__.Util.js +68 -0
- package/src/templates/module/__Model__.View.js +46 -0
- package/src/templates/module/__Model__.Zone.js +81 -0
- package/src/templates/module/__model__.constant.js +70 -0
- package/src/templates/module/__model__.dictionary.js +99 -0
- package/src/templates/module/__model__.document.js +54 -0
- package/src/templates/module/__model__.service.js +42 -0
- package/src/templates/module/__model__.signal.js +61 -0
- package/src/templates/module/__model__.signal.spec.js +40 -0
- package/src/templates/module/__model__.signal.test.js +49 -0
- package/src/templates/module/__model__.store.js +40 -0
- package/src/templates/module/_server.js +48 -0
- package/src/templates/module/index.js +59 -0
- package/src/templates/pkgRoot/tsconfig.json.template +12 -0
- package/src/templates/server.js +60 -0
- package/src/templates/workplaceRoot/.env.template +20 -0
- package/src/templates/workplaceRoot/.gitignore.template +195 -0
- package/src/templates/workplaceRoot/.prettierignore.template +10 -0
- package/src/templates/workplaceRoot/.prettierrc.json.template +5 -0
- package/src/templates/workplaceRoot/.swcrc.template +9 -0
- package/src/templates/workplaceRoot/README.md.template +37 -0
- package/src/templates/workplaceRoot/eslint.config.js.template +141 -0
- package/src/templates/workplaceRoot/tsconfig.json.template +29 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/app/ui/Footer.tsx
|
|
20
|
+
var Footer_exports = {};
|
|
21
|
+
__export(Footer_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Footer_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { Image, Link } from "@util/ui";
|
|
28
|
+
|
|
29
|
+
export const Footer = () => {
|
|
30
|
+
return (
|
|
31
|
+
<div className="relative justify-center px-2 pb-12 mt-12 bg-[#f3f3f3] via-secondary-focus to-accent-focus">
|
|
32
|
+
<div className="container py-10">
|
|
33
|
+
<div className="justify-between mt-6 md:flex md:mt-10 sm:mt-0">
|
|
34
|
+
<Link href="/" disabled>
|
|
35
|
+
<Image src="/logo.svg" className="object-contain fill-black" width={200} height={36} />
|
|
36
|
+
</Link>
|
|
37
|
+
<div className="flex gap-4 mt-6 text-xs md:mt-0 md:text-base ">
|
|
38
|
+
<Link href="/termsofservice">
|
|
39
|
+
<span className="text-[#777777]">\uC774\uC6A9\uC57D\uAD00</span>
|
|
40
|
+
</Link>
|
|
41
|
+
<Link href="/privacy">
|
|
42
|
+
<span className="text-[#777777]">\uAC1C\uC778\uC815\uBCF4\uCC98\uB9AC\uBC29\uCE68</span>
|
|
43
|
+
</Link>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div className="items-center justify-between mt-6 text-sm md:text-base md:mt-3 md:flex ">
|
|
47
|
+
<div className="flex flex-col text-xs md:text-base gap-1 text-[#777777]">
|
|
48
|
+
${dict.CompanyName} | <CEO_NAME> | <COMPANY_ADDRESS>
|
|
49
|
+
</div>
|
|
50
|
+
<div>
|
|
51
|
+
<div className="flex gap-4 mt-6 text-xs md:text-base md:mt-0">
|
|
52
|
+
<span className="text-[#777]">\uBB38\uC758</span>
|
|
53
|
+
<a href="mailto:support@example.com">
|
|
54
|
+
<span className="text-[#777]">support@example.com</span>
|
|
55
|
+
</a>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
`;
|
|
64
|
+
}
|
|
65
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/app/ui/MainHeader.tsx
|
|
20
|
+
var MainHeader_exports = {};
|
|
21
|
+
__export(MainHeader_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(MainHeader_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { usePage } from "@${dict.appName}/client";
|
|
28
|
+
import {
|
|
29
|
+
AiOutlineBuild,
|
|
30
|
+
AiOutlineEdit,
|
|
31
|
+
AiOutlineHome,
|
|
32
|
+
AiOutlinePoweroff,
|
|
33
|
+
AiOutlinePrinter,
|
|
34
|
+
AiOutlineRobot,
|
|
35
|
+
AiOutlineSecurityScan,
|
|
36
|
+
AiOutlineSend,
|
|
37
|
+
AiOutlineUser,
|
|
38
|
+
AiOutlineWindows,
|
|
39
|
+
} from "react-icons/ai";
|
|
40
|
+
import { User } from "@shared/client";
|
|
41
|
+
import { Layout, Link } from "@util/ui";
|
|
42
|
+
import { ReactNode } from "react";
|
|
43
|
+
import { clsx } from "@akanjs/client";
|
|
44
|
+
|
|
45
|
+
type DirType = "home" | "send" | "print" | "self";
|
|
46
|
+
|
|
47
|
+
const iconMap: { [key in DirType]: ReactNode } = {
|
|
48
|
+
home: <AiOutlineHome />,
|
|
49
|
+
send: <AiOutlineSend />,
|
|
50
|
+
print: <AiOutlinePrinter />,
|
|
51
|
+
self: <AiOutlineUser />,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
interface MainHeaderProps {
|
|
55
|
+
className?: string;
|
|
56
|
+
children?: any;
|
|
57
|
+
items: {
|
|
58
|
+
type: DirType;
|
|
59
|
+
name: string;
|
|
60
|
+
href?: string;
|
|
61
|
+
}[];
|
|
62
|
+
type?: "view" | "edit" | "new";
|
|
63
|
+
}
|
|
64
|
+
export const MainHeader = ({ className, children, items, type = "view" }: MainHeaderProps) => {
|
|
65
|
+
const { l } = usePage();
|
|
66
|
+
return (
|
|
67
|
+
<Layout.Header
|
|
68
|
+
className={clsx("fixed left-0 px-2 py-2 bg-base-100/50 backdrop-blur-sm flex items-center gap-2", className)}
|
|
69
|
+
>
|
|
70
|
+
<Layout.Sider>
|
|
71
|
+
<div className="text-4xl font-lemonmilk w-full text-center my-8">${dict.AppName}</div>
|
|
72
|
+
<ul className="menu p-4 w-full bg-base-200 text-base-content">
|
|
73
|
+
{/* <li>
|
|
74
|
+
<User.Zone.Profile/>
|
|
75
|
+
</li> */}
|
|
76
|
+
<li>
|
|
77
|
+
<Link href="/location" className="flex gap-2 items-center text-lg">
|
|
78
|
+
{iconMap.home} Home
|
|
79
|
+
</Link>
|
|
80
|
+
</li>
|
|
81
|
+
<li>
|
|
82
|
+
<Link href="/self" className="flex gap-2 items-center text-lg">
|
|
83
|
+
{iconMap.self} My Profile
|
|
84
|
+
</Link>
|
|
85
|
+
</li>
|
|
86
|
+
<li>
|
|
87
|
+
<User.Util.Signout href="/" className="flex gap-2 items-center text-lg text-warning">
|
|
88
|
+
<AiOutlinePoweroff /> Sign out
|
|
89
|
+
</User.Util.Signout>
|
|
90
|
+
</li>
|
|
91
|
+
</ul>
|
|
92
|
+
</Layout.Sider>
|
|
93
|
+
<div className="text-sm breadcrumbs hidden md:block">
|
|
94
|
+
<ul>
|
|
95
|
+
{items.slice(0, -2).map(({ type, name, href }, idx) => (
|
|
96
|
+
<li key={idx}>
|
|
97
|
+
<Link className="flex gap-1 items-center" href={href}>
|
|
98
|
+
{iconMap[type]} {name}
|
|
99
|
+
</Link>
|
|
100
|
+
</li>
|
|
101
|
+
))}
|
|
102
|
+
<li></li>
|
|
103
|
+
</ul>
|
|
104
|
+
</div>
|
|
105
|
+
<div className="text-sm breadcrumbs -ml-2">
|
|
106
|
+
<ul>
|
|
107
|
+
{items.slice(-2).map(({ type, name, href }, idx) => (
|
|
108
|
+
<li key={idx}>
|
|
109
|
+
<Link className="flex gap-1 items-center" href={href}>
|
|
110
|
+
{iconMap[type]} {name}
|
|
111
|
+
</Link>
|
|
112
|
+
</li>
|
|
113
|
+
))}
|
|
114
|
+
{type === "new" ? (
|
|
115
|
+
<li>+ {l("shared.new")}</li>
|
|
116
|
+
) : type === "edit" ? (
|
|
117
|
+
<li className="flex gap-1 items-center">
|
|
118
|
+
<AiOutlineEdit /> {l("shared.edit")}
|
|
119
|
+
</li>
|
|
120
|
+
) : null}
|
|
121
|
+
</ul>
|
|
122
|
+
</div>
|
|
123
|
+
{children}
|
|
124
|
+
</Layout.Header>
|
|
125
|
+
);
|
|
126
|
+
};
|
|
127
|
+
`;
|
|
128
|
+
}
|
|
129
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/app/ui/index.ts
|
|
20
|
+
var ui_exports = {};
|
|
21
|
+
__export(ui_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(ui_exports);
|
|
25
|
+
function getContent(scanResult, dict = {}) {
|
|
26
|
+
return `
|
|
27
|
+
export { MainHeader } from "./MainHeader";
|
|
28
|
+
export { Footer } from "./Footer";
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/client.ts
|
|
20
|
+
var client_exports = {};
|
|
21
|
+
__export(client_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(client_exports);
|
|
25
|
+
var capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
26
|
+
function getContent(scanResult, dict = {}) {
|
|
27
|
+
if (!scanResult)
|
|
28
|
+
return null;
|
|
29
|
+
const databaseModules = scanResult.files.components.databases;
|
|
30
|
+
const scalarModules = scanResult.files.components.scalars;
|
|
31
|
+
const serviceModules = scanResult.files.components.services;
|
|
32
|
+
return `
|
|
33
|
+
export { st } from "./lib/st";
|
|
34
|
+
export { store } from "./lib/store";
|
|
35
|
+
export { usePage } from "./lib/usePage";
|
|
36
|
+
export { fetch } from "./lib/fetch";
|
|
37
|
+
export { cnst } from "./lib/cnst";
|
|
38
|
+
${scalarModules.map((module2) => `export { ${capitalize(module2)} } from "./lib/__scalar/${module2}";`).join("\n")}
|
|
39
|
+
${serviceModules.map((module2) => `export { ${capitalize(module2)} } from "./lib/_${module2}";`).join("\n")}
|
|
40
|
+
${databaseModules.map((module2) => `export { ${capitalize(module2)} } from "./lib/${module2}";`).join("\n")}
|
|
41
|
+
`;
|
|
42
|
+
}
|
|
43
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/crudPages/[__model__Id]/edit/page.tsx
|
|
20
|
+
var page_exports = {};
|
|
21
|
+
__export(page_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(page_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { AiOutlineTeam } from "react-icons/ai";
|
|
28
|
+
import { Load } from "@shared/ui";
|
|
29
|
+
import { fetch, usePage, ${dict.Model} } from "${dict.appName}/client";
|
|
30
|
+
import type { CsrConfig } from "@akanjs/client";
|
|
31
|
+
|
|
32
|
+
interface PageProps {
|
|
33
|
+
params: { ${dict.model}Id: string };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default function Page({ params }: PageProps) {
|
|
37
|
+
const { l } = usePage();
|
|
38
|
+
return (
|
|
39
|
+
<Load.Page
|
|
40
|
+
of={Page}
|
|
41
|
+
loader={async () => {
|
|
42
|
+
const { ${dict.model}Id } = await params;
|
|
43
|
+
const { ${dict.model}, ${dict.model}Edit } = await fetch.edit${dict.Model}(${dict.model}Id);
|
|
44
|
+
return { ${dict.model}, ${dict.model}Edit } as const;
|
|
45
|
+
}}
|
|
46
|
+
render={({ ${dict.model}, ${dict.model}Edit }) => (
|
|
47
|
+
<div className="container">
|
|
48
|
+
<div className="flex justify-between m-4 mt-8">
|
|
49
|
+
<div className="text-xl text-primary flex gap-2 items-center">
|
|
50
|
+
<AiOutlineTeam /> {l("shared.updateModel", { model: l("${dict.model}.modelName") })}
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<Load.Edit
|
|
54
|
+
className="flex flex-col items-center"
|
|
55
|
+
sliceName="${dict.model}InPublic"
|
|
56
|
+
edit={${dict.model}Edit}
|
|
57
|
+
type="form"
|
|
58
|
+
onCancel="back"
|
|
59
|
+
onSubmit="/${dict.model}"
|
|
60
|
+
>
|
|
61
|
+
${dict.Model}.Template.General
|
|
62
|
+
</Load.Edit>
|
|
63
|
+
</div>
|
|
64
|
+
)}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
Page.csrConfig = { transition: "none" } satisfies CsrConfig;
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/crudPages/[__model__Id]/page.tsx
|
|
20
|
+
var page_exports = {};
|
|
21
|
+
__export(page_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(page_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { ${dict.Model}, fetch, usePage } from "${dict.appName}/client";
|
|
28
|
+
import { Link } from "@util/ui";
|
|
29
|
+
import { Load } from "@shared/ui";
|
|
30
|
+
import { getSelf } from "@akanjs/client";
|
|
31
|
+
import { AiOutlineEdit } from "react-icons/ai";
|
|
32
|
+
import type { CsrConfig } from "@akanjs/client";
|
|
33
|
+
|
|
34
|
+
interface PageProps {
|
|
35
|
+
params: { ${dict.model}Id: string };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export async function generateMetadata({ params }: PageProps) {
|
|
39
|
+
const { ${dict.model}Id } = await params;
|
|
40
|
+
const { ${dict.model} } = await fetch.view${dict.Model}(${dict.model}Id);
|
|
41
|
+
return {
|
|
42
|
+
title: ${dict.model}.id,
|
|
43
|
+
description: ${dict.model}.id,
|
|
44
|
+
openGraph: {
|
|
45
|
+
title: ${dict.model}.id,
|
|
46
|
+
description: ${dict.model}.id,
|
|
47
|
+
// images: ${dict.model}.thumbnails.map((i) => i.url),
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export default function Page({ params }: PageProps) {
|
|
52
|
+
const { l } = usePage();
|
|
53
|
+
const self = getSelf({ unauthorize: "/signin" });
|
|
54
|
+
return (
|
|
55
|
+
<Load.Page
|
|
56
|
+
of={Page}
|
|
57
|
+
loader={async () => {
|
|
58
|
+
const { ${dict.model}Id } = await params;
|
|
59
|
+
const { ${dict.model}, ${dict.model}View } = await fetch.view${dict.Model}(${dict.model}Id);
|
|
60
|
+
return { ${dict.model}, ${dict.model}View } as const;
|
|
61
|
+
}}
|
|
62
|
+
render={({ ${dict.model}, ${dict.model}View }) => (
|
|
63
|
+
<div className="container flex flex-col gap-4">
|
|
64
|
+
<div className="flex gap-4 font-bold text-lg items-center">
|
|
65
|
+
${dict.Model}.Zone.View view={${dict.model}View} />
|
|
66
|
+
<Link href={\`/${dict.model}/\${${dict.model}.id}/edit\`}>
|
|
67
|
+
<button className="btn">
|
|
68
|
+
<AiOutlineEdit />
|
|
69
|
+
{l("shared.updateModel", { model: l("${dict.model}.modelName") })}
|
|
70
|
+
</button>
|
|
71
|
+
</Link>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
)}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
Page.csrConfig = { transition: "none" } satisfies CsrConfig;
|
|
79
|
+
`;
|
|
80
|
+
}
|
|
81
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/crudPages/new/page.tsx
|
|
20
|
+
var page_exports = {};
|
|
21
|
+
__export(page_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(page_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { AiOutlineTeam } from "react-icons/ai";
|
|
28
|
+
import { Load } from "@shared/ui";
|
|
29
|
+
import { cnst, fetch, usePage, ${dict.Model} } from "${dict.appName}/client";
|
|
30
|
+
import { getSelf } from "@akanjs/client";
|
|
31
|
+
import type { CsrConfig } from "@akanjs/client";
|
|
32
|
+
|
|
33
|
+
export default function Page() {
|
|
34
|
+
const { l } = usePage();
|
|
35
|
+
const self = getSelf({ unauthorize: "/signin" });
|
|
36
|
+
return (
|
|
37
|
+
<Load.Page
|
|
38
|
+
of={Page}
|
|
39
|
+
loader={async () => {
|
|
40
|
+
const ${dict.model}Form: Partial<cnst.${dict.Model}> = {};
|
|
41
|
+
return { ${dict.model}Form } as const;
|
|
42
|
+
}}
|
|
43
|
+
render={({ ${dict.model}Form }) => (
|
|
44
|
+
<div className="container">
|
|
45
|
+
<div className="flex justify-between m-4 mt-8">
|
|
46
|
+
<div className="text-xl text-primary flex gap-2 items-center">
|
|
47
|
+
<AiOutlineTeam /> {l("shared.createModel", { model: l("${dict.model}.modelName") })}
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
<Load.Edit
|
|
51
|
+
className="flex flex-col items-center"
|
|
52
|
+
sliceName="${dict.model}InPublic"
|
|
53
|
+
edit={${dict.model}Form}
|
|
54
|
+
type="form"
|
|
55
|
+
onCancel="back"
|
|
56
|
+
onSubmit="/${dict.model}"
|
|
57
|
+
>
|
|
58
|
+
${dict.Model}.Template.General
|
|
59
|
+
</Load.Edit>
|
|
60
|
+
</div>
|
|
61
|
+
)}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
Page.csrConfig = { transition: "none" } satisfies CsrConfig;
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/crudPages/page.tsx
|
|
20
|
+
var page_exports = {};
|
|
21
|
+
__export(page_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(page_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { ${dict.Model}, fetch, usePage } from "${dict.appName}/client";
|
|
28
|
+
import { Link } from "@util/ui";
|
|
29
|
+
import { Load } from "@shared/ui";
|
|
30
|
+
import { getSelf } from "@akanjs/client";
|
|
31
|
+
import type { CsrConfig } from "@akanjs/client";
|
|
32
|
+
|
|
33
|
+
export default function Page() {
|
|
34
|
+
const { l } = usePage();
|
|
35
|
+
const self = getSelf({ unauthorize: "/signin" });
|
|
36
|
+
return (
|
|
37
|
+
<Load.Page
|
|
38
|
+
of={Page}
|
|
39
|
+
loader={async () => {
|
|
40
|
+
const { ${dict.model}InitInPublic } = await fetch.init${dict.Model}InPublic();
|
|
41
|
+
return { ${dict.model}InitInPublic } as const;
|
|
42
|
+
}}
|
|
43
|
+
render={({ ${dict.model}InitInPublic }) => (
|
|
44
|
+
<div className="container flex flex-col gap-4">
|
|
45
|
+
<div className="w-full mt-5 px-5 h-full ">
|
|
46
|
+
<div>{l("${dict.model}.modelName")}</div>
|
|
47
|
+
<div className="animate-fadeIn px-4 pt-4 flex gap-4 items-center">
|
|
48
|
+
<div className="font-bold text-lg md:text-4xl">${dict.Model}s</div>
|
|
49
|
+
<Link href={\`/${dict.model}/new\`}>
|
|
50
|
+
<button className="btn">+ {l("shared.createModel", { model: l("${dict.model}.modelName") })}</button>
|
|
51
|
+
</Link>
|
|
52
|
+
</div>
|
|
53
|
+
<div>{l("${dict.model}.modelDesc")}</div>
|
|
54
|
+
<div className="flex px-6 mt-3 gap-4">
|
|
55
|
+
${dict.Model}.Zone.Card
|
|
56
|
+
className="animate-fadeIn grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 justify-center gap-4 w-full"
|
|
57
|
+
init={${dict.model}InitInPublic}
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
)}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
Page.csrConfig = { transition: "none" } satisfies CsrConfig;
|
|
67
|
+
`;
|
|
68
|
+
}
|
|
69
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/index.ts
|
|
20
|
+
var templates_exports = {};
|
|
21
|
+
__export(templates_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(templates_exports);
|
|
25
|
+
function getContent(scanResult, dict = {}) {
|
|
26
|
+
return `
|
|
27
|
+
export { cnst } from "./lib/cnst";
|
|
28
|
+
export { fetch } from "./lib/fetch";
|
|
29
|
+
export * from "./lib/dict";
|
|
30
|
+
`;
|
|
31
|
+
}
|
|
32
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/lib/__lib/extends/summary.constant.ts
|
|
20
|
+
var summary_constant_exports = {};
|
|
21
|
+
__export(summary_constant_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(summary_constant_exports);
|
|
25
|
+
var capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
26
|
+
function getContent(scanResult, dict = {}) {
|
|
27
|
+
if (!scanResult)
|
|
28
|
+
return null;
|
|
29
|
+
const databaseModulesExceptExtends = scanResult.files.constants.databases.filter(
|
|
30
|
+
(module2) => !["summary", "user", "setting"].includes(module2)
|
|
31
|
+
);
|
|
32
|
+
const hasUser = scanResult.files.constants.databases.includes("user");
|
|
33
|
+
const hasSummary = scanResult.files.constants.databases.includes("summary");
|
|
34
|
+
const isRootUserLib = !scanResult.akanConfig.rootLib;
|
|
35
|
+
if (!hasSummary)
|
|
36
|
+
return null;
|
|
37
|
+
return `
|
|
38
|
+
${databaseModulesExceptExtends.map((module2) => `import { ${capitalize(module2)}Summary } from "../../${module2}/${module2}.constant";`).join("\n")}
|
|
39
|
+
${hasUser ? `import { ${isRootUserLib ? "" : capitalize(scanResult.name)}UserSummary } from "../../user/user.constant";` : ""}
|
|
40
|
+
|
|
41
|
+
export const modelSummaries = [${[...databaseModulesExceptExtends, ...hasUser ? [`${isRootUserLib ? "" : scanResult.name}User`] : []].map((module2) => `${capitalize(module2)}Summary`).join(", ")}] as const;
|
|
42
|
+
`;
|
|
43
|
+
}
|
|
44
|
+
module.exports = module.exports.default;
|