@akanjs/cli 0.0.41 → 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.d.ts +1 -0
- package/index.js +34 -7
- 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,53 @@
|
|
|
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/srv.ts
|
|
20
|
+
var srv_exports = {};
|
|
21
|
+
__export(srv_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(srv_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.services.databases;
|
|
30
|
+
const scalarModules = scanResult.files.services.scalars;
|
|
31
|
+
const serviceModules = scanResult.files.services.services;
|
|
32
|
+
return `
|
|
33
|
+
import { GetServices } from "@akanjs/service";
|
|
34
|
+
|
|
35
|
+
import { libAllSrvs } from "./__lib/lib.service";
|
|
36
|
+
${databaseModules.map((module2) => `import { ${capitalize(module2)}Service } from "./${module2}/${module2}.service";`).join("\n")}
|
|
37
|
+
${serviceModules.map((module2) => `import { ${capitalize(module2)}Service } from "./_${module2}/${module2}.service";`).join("\n")}
|
|
38
|
+
${scalarModules.map((module2) => `import { ${capitalize(module2)}Service } from "./${module2}/${module2}.service";`).join("\n")}
|
|
39
|
+
|
|
40
|
+
export * from "./__lib/lib.service";
|
|
41
|
+
${databaseModules.map((module2) => `export { ${capitalize(module2)}Service } from "./${module2}/${module2}.service";`).join("\n")}
|
|
42
|
+
${serviceModules.map((module2) => `export { ${capitalize(module2)}Service } from "./_${module2}/${module2}.service";`).join("\n")}
|
|
43
|
+
${scalarModules.map((module2) => `export { ${capitalize(module2)}Service } from "./${module2}/${module2}.service";`).join("\n")}
|
|
44
|
+
|
|
45
|
+
export const allSrvs = {
|
|
46
|
+
...libAllSrvs,
|
|
47
|
+
${[...databaseModules, ...scalarModules, ...serviceModules].map((module2) => `${capitalize(module2)}Service`).join(",\n ")}
|
|
48
|
+
} as const;
|
|
49
|
+
|
|
50
|
+
export type AllSrvs = GetServices<typeof allSrvs>;
|
|
51
|
+
`;
|
|
52
|
+
}
|
|
53
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,37 @@
|
|
|
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/st.ts
|
|
20
|
+
var st_exports = {};
|
|
21
|
+
__export(st_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(st_exports);
|
|
25
|
+
function getContent(scanResult, dict = {}) {
|
|
26
|
+
if (!scanResult)
|
|
27
|
+
return null;
|
|
28
|
+
return `
|
|
29
|
+
"use client";
|
|
30
|
+
import { makeStore, st as baseSt } from "@akanjs/store";
|
|
31
|
+
|
|
32
|
+
import { store } from "./store";
|
|
33
|
+
|
|
34
|
+
export const st = makeStore(baseSt, store${scanResult.type === "lib" ? `, { library: true }` : ""});
|
|
35
|
+
`;
|
|
36
|
+
}
|
|
37
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,53 @@
|
|
|
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/store.ts
|
|
20
|
+
var store_exports = {};
|
|
21
|
+
__export(store_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(store_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 names = {
|
|
30
|
+
name: scanResult.name,
|
|
31
|
+
Name: capitalize(scanResult.name)
|
|
32
|
+
};
|
|
33
|
+
const databaseModules = scanResult.files.store.databases;
|
|
34
|
+
const scalarModules = scanResult.files.store.scalars;
|
|
35
|
+
const serviceModules = scanResult.files.store.services;
|
|
36
|
+
return `
|
|
37
|
+
"use client";
|
|
38
|
+
import { MixStore, rootStoreOf } from "@akanjs/store";
|
|
39
|
+
|
|
40
|
+
import { libStores } from "./__lib/lib.store";
|
|
41
|
+
${databaseModules.map((module2) => `import { ${capitalize(module2)}Store } from "./${module2}/${module2}.store";`).join("\n")}
|
|
42
|
+
${serviceModules.map((module2) => `import { ${capitalize(module2)}Store } from "./_${module2}/${module2}.store";`).join("\n")}
|
|
43
|
+
${scalarModules.map((module2) => `import { ${capitalize(module2)}Store } from "./__scalar/${module2}/${module2}.store";`).join("\n")}
|
|
44
|
+
export class RootStore extends MixStore(
|
|
45
|
+
...libStores,
|
|
46
|
+
${names.Name}Store,
|
|
47
|
+
${[...databaseModules, ...scalarModules, ...serviceModules].map((module2) => `${capitalize(module2)}Store`).join(",\n ")}
|
|
48
|
+
) {}
|
|
49
|
+
|
|
50
|
+
export const store = rootStoreOf(RootStore);
|
|
51
|
+
`;
|
|
52
|
+
}
|
|
53
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,34 @@
|
|
|
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/usePage.ts
|
|
20
|
+
var usePage_exports = {};
|
|
21
|
+
__export(usePage_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(usePage_exports);
|
|
25
|
+
function getContent(scanResult, dict = {}) {
|
|
26
|
+
return `
|
|
27
|
+
import { makePageProto } from "@akanjs/next";
|
|
28
|
+
|
|
29
|
+
import { dictionary } from "./dict";
|
|
30
|
+
|
|
31
|
+
export const usePage = makePageProto([dictionary]);
|
|
32
|
+
`;
|
|
33
|
+
}
|
|
34
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
**/script.ts
|
|
2
|
+
**/script*.ts
|
|
3
|
+
**/.env
|
|
4
|
+
**/env.client.debug.ts*
|
|
5
|
+
**/env.client.develop.ts*
|
|
6
|
+
**/env.client.main.ts*
|
|
7
|
+
**/env.client.testing.ts*
|
|
8
|
+
**/env.server.debug.ts*
|
|
9
|
+
**/env.server.develop.ts*
|
|
10
|
+
**/env.server.main.ts*
|
|
11
|
+
**/env.server.testing.ts*
|
|
12
|
+
|
|
13
|
+
# System Files
|
|
14
|
+
.DS_Store
|
|
15
|
+
Thumbs.db
|
|
@@ -0,0 +1,37 @@
|
|
|
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/libRoot/jest.config.ts
|
|
20
|
+
var jest_config_exports = {};
|
|
21
|
+
__export(jest_config_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(jest_config_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
//! will be replaced with akan.config.ts
|
|
28
|
+
import "tsconfig-paths/register";
|
|
29
|
+
|
|
30
|
+
import { withBase } from "@akanjs/test/src/jest.config.base";
|
|
31
|
+
|
|
32
|
+
const config = withBase("${dict.appName}");
|
|
33
|
+
|
|
34
|
+
export default config;
|
|
35
|
+
`;
|
|
36
|
+
}
|
|
37
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,52 @@
|
|
|
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/module/__Model__.Template.tsx
|
|
20
|
+
var Model_Template_exports = {};
|
|
21
|
+
__export(Model_Template_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Model_Template_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
"use client";
|
|
28
|
+
import { cnst, st, usePage } from "@${dict.appName}/client";
|
|
29
|
+
import { Field } from "@shared/ui";
|
|
30
|
+
import { Layout } from "@util/ui";
|
|
31
|
+
|
|
32
|
+
interface ${dict.Model}EditProps {
|
|
33
|
+
${dict.model}Id?: string | null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const General = ({ ${dict.model}Id = undefined }: ${dict.Model}EditProps) => {
|
|
37
|
+
const ${dict.model}Form = st.use.${dict.model}Form();
|
|
38
|
+
const { l } = usePage();
|
|
39
|
+
return (
|
|
40
|
+
<Layout.Template>
|
|
41
|
+
<Field.Text
|
|
42
|
+
label={l.field("${dict.model}", "id")}
|
|
43
|
+
desc={l.desc("${dict.model}", "id")}
|
|
44
|
+
value={${dict.model}Form.id}
|
|
45
|
+
onChange={st.do.setIdOn${dict.Model}}
|
|
46
|
+
/>
|
|
47
|
+
</Layout.Template>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
`;
|
|
51
|
+
}
|
|
52
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,40 @@
|
|
|
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/module/__Model__.Unit.tsx
|
|
20
|
+
var Model_Unit_exports = {};
|
|
21
|
+
__export(Model_Unit_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Model_Unit_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { ModelProps } from "@akanjs/client";
|
|
28
|
+
import { cnst, ${dict.Model} } from "@${dict.appName}/client";
|
|
29
|
+
import { Link } from "@util/ui";
|
|
30
|
+
|
|
31
|
+
export const Card = ({ ${dict.model}, href }: ModelProps<"${dict.model}", cnst.Light${dict.Model}>>) => {
|
|
32
|
+
return (
|
|
33
|
+
<Link href={href} className="animate-fadeIn w-full h-36 flex rounded-lg shadow-sm hover:shadow-lg duration-300">
|
|
34
|
+
<div>{${dict.model}.id}</div>
|
|
35
|
+
</Link>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
`;
|
|
39
|
+
}
|
|
40
|
+
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/module/__Model__.Util.tsx
|
|
20
|
+
var Model_Util_exports = {};
|
|
21
|
+
__export(Model_Util_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Model_Util_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
"use client";
|
|
28
|
+
import { ModelDashboardProps, ModelInsightProps } from "@akanjs/client";
|
|
29
|
+
import { getQueryMap } from "@akanjs/constant";
|
|
30
|
+
import { cnst } from "@${dict.appName}/client";
|
|
31
|
+
import { Data } from "@shared/ui";
|
|
32
|
+
|
|
33
|
+
export const Stat = ({
|
|
34
|
+
className,
|
|
35
|
+
summary,
|
|
36
|
+
sliceName = "${dict.model}",
|
|
37
|
+
queryMap = getQueryMap(cnst.${dict.Model}Summary),
|
|
38
|
+
hidePresents,
|
|
39
|
+
}: ModelDashboardProps<cnst.Summary>) => {
|
|
40
|
+
return (
|
|
41
|
+
<Data.Dashboard
|
|
42
|
+
className={className}
|
|
43
|
+
summary={summary}
|
|
44
|
+
sliceName={sliceName}
|
|
45
|
+
queryMap={queryMap}
|
|
46
|
+
columns={["total${dict.Model}"]}
|
|
47
|
+
hidePresents={hidePresents}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const Insight = ({
|
|
53
|
+
className,
|
|
54
|
+
insight,
|
|
55
|
+
sliceName = "${dict.model}",
|
|
56
|
+
}: ModelInsightProps<cnst.${dict.Model}Insight>) => {
|
|
57
|
+
return (
|
|
58
|
+
<Data.Insight
|
|
59
|
+
className={className}
|
|
60
|
+
insight={insight}
|
|
61
|
+
sliceName={sliceName}
|
|
62
|
+
columns={["count"]}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,46 @@
|
|
|
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/module/__Model__.View.tsx
|
|
20
|
+
var Model_View_exports = {};
|
|
21
|
+
__export(Model_View_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Model_View_exports);
|
|
25
|
+
function getContent(scanResult, dict = {}) {
|
|
26
|
+
return `
|
|
27
|
+
import { clsx } from "@akanjs/client";
|
|
28
|
+
import { cnst } from "@${dict.appName}/client";
|
|
29
|
+
import { Image } from "@util/ui";
|
|
30
|
+
|
|
31
|
+
interface ${dict.Model}ViewProps {
|
|
32
|
+
className?: string;
|
|
33
|
+
${dict.model}: cnst.${dict.Model};
|
|
34
|
+
self?: { id?: string } | null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const General = ({ className, ${dict.model}, self }: ${dict.Model}ViewProps) => {
|
|
38
|
+
return (
|
|
39
|
+
<div className={clsx(className, "animate-fadeIn w-full")}>
|
|
40
|
+
<div>{${dict.model}.id}</div>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
46
|
+
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/module/__Model__.Zone.tsx
|
|
20
|
+
var Model_Zone_exports = {};
|
|
21
|
+
__export(Model_Zone_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Model_Zone_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
"use client";
|
|
28
|
+
import { Data, Load } from "@shared/ui";
|
|
29
|
+
import { ModelsProps } from "@akanjs/client";
|
|
30
|
+
import { cnst, ${dict.Model} } from "@${dict.appName}/client";
|
|
31
|
+
import { ClientInit, ClientView, DefaultOf } from "@akanjs/signal";
|
|
32
|
+
|
|
33
|
+
export const Admin = ({ sliceName = "${dict.model}", init, query }: ModelsProps<cnst.${dict.Model}>>) => {
|
|
34
|
+
return (
|
|
35
|
+
<Data.ListContainer
|
|
36
|
+
init={init}
|
|
37
|
+
query={query}
|
|
38
|
+
sliceName={sliceName}
|
|
39
|
+
renderItem={${dict.Model}.Unit.Card}
|
|
40
|
+
renderDashboard={${dict.Model}.Util.Stat}
|
|
41
|
+
renderInsight={${dict.Model}.Util.Insight}
|
|
42
|
+
renderTemplate={${dict.Model}.Template.General}
|
|
43
|
+
renderTitle={(${dict.model}: DefaultOf<cnst.${dict.Model}>>) => \`${dict.Model} - \${${dict.model}.id ? ${dict.model}.id : "New"}\`}
|
|
44
|
+
renderView={(${dict.model}: cnst.${dict.Model}>) => <${dict.Model}.View.General ${dict.model}={${dict.model}} />}
|
|
45
|
+
columns={[
|
|
46
|
+
"id",
|
|
47
|
+
"status",
|
|
48
|
+
"createdAt",
|
|
49
|
+
"updatedAt",
|
|
50
|
+
]}
|
|
51
|
+
actions={(${dict.model}: cnst.Light${dict.Model}, idx) => ["remove", "edit", "view"]}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
interface CardProps {
|
|
57
|
+
className?: string;
|
|
58
|
+
init: ClientInit<"${dict.model}", cnst.Light${dict.Model}>;
|
|
59
|
+
}
|
|
60
|
+
export const Card = ({ className, init }: CardProps) => {
|
|
61
|
+
return (
|
|
62
|
+
<Load.Units
|
|
63
|
+
className={className}
|
|
64
|
+
init={init}
|
|
65
|
+
renderItem={(${dict.model}: cnst.Light${dict.Model}) => (
|
|
66
|
+
<${dict.Model}.Unit.Card key={${dict.model}.id} href={\`/${dict.model}/\${${dict.model}.id}\`} ${dict.model}={${dict.model}} />
|
|
67
|
+
)}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
interface ViewProps {
|
|
73
|
+
className?: string;
|
|
74
|
+
view: ClientView<"${dict.model}", cnst.${dict.Model}>;
|
|
75
|
+
}
|
|
76
|
+
export const View = ({ view }: ViewProps) => {
|
|
77
|
+
return <Load.View view={view} renderView={(${dict.model}) => <${dict.Model}.View.General ${dict.model}={${dict.model}} />} />;
|
|
78
|
+
};
|
|
79
|
+
`;
|
|
80
|
+
}
|
|
81
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,70 @@
|
|
|
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/module/__model__.constant.ts
|
|
20
|
+
var model_constant_exports = {};
|
|
21
|
+
__export(model_constant_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(model_constant_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { enumOf, Int } from "@akanjs/base";
|
|
28
|
+
import { Field, Filter, Model, sortOf, via } from "@akanjs/constant";
|
|
29
|
+
|
|
30
|
+
export const ${dict.Model}Status = enumOf(["active"] as const);
|
|
31
|
+
export type ${dict.Model}Status = enumOf<typeof ${dict.Model}Status>;
|
|
32
|
+
|
|
33
|
+
@Model.Input("${dict.Model}Input")
|
|
34
|
+
export class ${dict.Model}Input {
|
|
35
|
+
@Field.Prop(() => String, { nullable: true })
|
|
36
|
+
field: string | null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@Model.Object("${dict.Model}Object")
|
|
40
|
+
export class ${dict.Model}Object extends via(${dict.Model}Input) {
|
|
41
|
+
@Field.Prop(() => String, { enum: ${dict.Model}Status, default: "active" })
|
|
42
|
+
status: ${dict.Model}Status;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@Model.Light("Light${dict.Model}")
|
|
46
|
+
export class Light${dict.Model} extends via(${dict.Model}Object, [
|
|
47
|
+
"field",
|
|
48
|
+
"status",
|
|
49
|
+
] as const) {}
|
|
50
|
+
|
|
51
|
+
@Model.Full("${dict.Model}")
|
|
52
|
+
export class ${dict.Model} extends via(${dict.Model}Object, Light${dict.Model}) {}
|
|
53
|
+
|
|
54
|
+
@Model.Insight("${dict.Model}Insight")
|
|
55
|
+
export class ${dict.Model}Insight {
|
|
56
|
+
@Field.Prop(() => Int, { default: 0, accumulate: { $sum: 1 } })
|
|
57
|
+
count: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@Model.Summary("${dict.Model}Summary")
|
|
61
|
+
export class ${dict.Model}Summary {
|
|
62
|
+
@Field.Prop(() => Int, { min: 0, default: 0, query: {} })
|
|
63
|
+
total${dict.Model}: number;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@Model.Filter("${dict.Model}Filter")
|
|
67
|
+
export class ${dict.Model}Filter extends sortOf(${dict.Model}, {}) {}
|
|
68
|
+
`;
|
|
69
|
+
}
|
|
70
|
+
module.exports = module.exports.default;
|