@akanjs/cli 0.0.118 → 0.0.120
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/cjs/index.js +45 -1
- package/cjs/src/templates/libRoot/akan.config.js +36 -0
- package/cjs/src/templates/libRoot/base/baseLogic.js +35 -0
- package/cjs/src/templates/libRoot/base/index.js +29 -0
- package/cjs/src/templates/libRoot/common/commonLogic.js +35 -0
- package/cjs/src/templates/libRoot/common/index.js +29 -0
- package/cjs/src/templates/libRoot/jest.config.js +1 -1
- package/cjs/src/templates/libRoot/lib/___libName__/__libName__.dictionary.js +31 -0
- package/cjs/src/templates/libRoot/lib/___libName__/__libName__.service.js +42 -0
- package/cjs/src/templates/libRoot/lib/___libName__/__libName__.store.js +36 -0
- package/cjs/src/templates/libRoot/lib/___libName__/_server.js +34 -0
- package/cjs/src/templates/libRoot/lib/option.js +42 -0
- package/cjs/src/templates/libRoot/lib/setting/Setting.Template.js +57 -0
- package/cjs/src/templates/libRoot/lib/setting/Setting.Unit.js +38 -0
- package/cjs/src/templates/libRoot/lib/setting/Setting.Util.js +34 -0
- package/cjs/src/templates/libRoot/lib/setting/Setting.View.js +51 -0
- package/cjs/src/templates/libRoot/lib/setting/Setting.Zone.js +80 -0
- package/cjs/src/templates/libRoot/lib/setting/_server.js +48 -0
- package/cjs/src/templates/libRoot/lib/setting/index.js +61 -0
- package/cjs/src/templates/libRoot/lib/setting/setting.constant.js +46 -0
- package/cjs/src/templates/libRoot/lib/setting/setting.dictionary.js +46 -0
- package/cjs/src/templates/libRoot/lib/setting/setting.document.js +48 -0
- package/cjs/src/templates/libRoot/lib/setting/setting.service.js +37 -0
- package/cjs/src/templates/libRoot/lib/setting/setting.signal.js +34 -0
- package/cjs/src/templates/libRoot/lib/setting/setting.store.js +41 -0
- package/cjs/src/templates/libRoot/lib/summary/Summary.Template.js +43 -0
- package/cjs/src/templates/libRoot/lib/summary/Summary.Unit.js +38 -0
- package/cjs/src/templates/libRoot/lib/summary/Summary.Util.js +33 -0
- package/cjs/src/templates/libRoot/lib/summary/Summary.View.js +51 -0
- package/cjs/src/templates/libRoot/lib/summary/Summary.Zone.js +62 -0
- package/cjs/src/templates/libRoot/lib/summary/_server.js +48 -0
- package/cjs/src/templates/libRoot/lib/summary/index.js +67 -0
- package/cjs/src/templates/libRoot/lib/summary/summary.constant.js +44 -0
- package/cjs/src/templates/libRoot/lib/summary/summary.dictionary.js +49 -0
- package/cjs/src/templates/libRoot/lib/summary/summary.document.js +48 -0
- package/cjs/src/templates/libRoot/lib/summary/summary.service.js +34 -0
- package/cjs/src/templates/libRoot/lib/summary/summary.signal.js +34 -0
- package/cjs/src/templates/libRoot/lib/summary/summary.store.js +41 -0
- package/cjs/src/templates/libRoot/lib/user/User.Template.js +65 -0
- package/cjs/src/templates/libRoot/lib/user/User.Unit.js +38 -0
- package/cjs/src/templates/libRoot/lib/user/User.Util.js +94 -0
- package/cjs/src/templates/libRoot/lib/user/User.View.js +66 -0
- package/cjs/src/templates/libRoot/lib/user/User.Zone.js +74 -0
- package/cjs/src/templates/libRoot/lib/user/_server.js +48 -0
- package/cjs/src/templates/libRoot/lib/user/index.js +61 -0
- package/cjs/src/templates/libRoot/lib/user/user.constant.js +67 -0
- package/cjs/src/templates/libRoot/lib/user/user.dictionary.js +52 -0
- package/cjs/src/templates/libRoot/lib/user/user.document.js +54 -0
- package/cjs/src/templates/libRoot/lib/user/user.service.js +42 -0
- package/cjs/src/templates/libRoot/lib/user/user.signal.js +34 -0
- package/cjs/src/templates/libRoot/lib/user/user.signal.spec.js +37 -0
- package/cjs/src/templates/libRoot/lib/user/user.signal.test.js +39 -0
- package/cjs/src/templates/libRoot/lib/user/user.store.js +39 -0
- package/cjs/src/templates/libRoot/nest/backendLogic.js +34 -0
- package/cjs/src/templates/libRoot/nest/index.js +29 -0
- package/cjs/src/templates/libRoot/next/frontendLogic.js +34 -0
- package/cjs/src/templates/libRoot/next/index.js +29 -0
- package/cjs/src/templates/libRoot/ui/index.js +29 -0
- package/esm/index.js +45 -1
- package/esm/src/templates/libRoot/akan.config.js +16 -0
- package/esm/src/templates/libRoot/base/baseLogic.js +15 -0
- package/esm/src/templates/libRoot/base/index.js +9 -0
- package/esm/src/templates/libRoot/common/commonLogic.js +15 -0
- package/esm/src/templates/libRoot/common/index.js +9 -0
- package/esm/src/templates/libRoot/jest.config.js +1 -1
- package/esm/src/templates/libRoot/lib/___libName__/__libName__.dictionary.js +11 -0
- package/esm/src/templates/libRoot/lib/___libName__/__libName__.service.js +22 -0
- package/esm/src/templates/libRoot/lib/___libName__/__libName__.store.js +16 -0
- package/esm/src/templates/libRoot/lib/___libName__/_server.js +14 -0
- package/esm/src/templates/libRoot/lib/option.js +22 -0
- package/esm/src/templates/libRoot/lib/setting/Setting.Template.js +37 -0
- package/esm/src/templates/libRoot/lib/setting/Setting.Unit.js +18 -0
- package/esm/src/templates/libRoot/lib/setting/Setting.Util.js +14 -0
- package/esm/src/templates/libRoot/lib/setting/Setting.View.js +31 -0
- package/esm/src/templates/libRoot/lib/setting/Setting.Zone.js +60 -0
- package/esm/src/templates/libRoot/lib/setting/_server.js +28 -0
- package/esm/src/templates/libRoot/lib/setting/index.js +41 -0
- package/esm/src/templates/libRoot/lib/setting/setting.constant.js +26 -0
- package/esm/src/templates/libRoot/lib/setting/setting.dictionary.js +26 -0
- package/esm/src/templates/libRoot/lib/setting/setting.document.js +28 -0
- package/esm/src/templates/libRoot/lib/setting/setting.service.js +17 -0
- package/esm/src/templates/libRoot/lib/setting/setting.signal.js +14 -0
- package/esm/src/templates/libRoot/lib/setting/setting.store.js +21 -0
- package/esm/src/templates/libRoot/lib/summary/Summary.Template.js +23 -0
- package/esm/src/templates/libRoot/lib/summary/Summary.Unit.js +18 -0
- package/esm/src/templates/libRoot/lib/summary/Summary.Util.js +13 -0
- package/esm/src/templates/libRoot/lib/summary/Summary.View.js +31 -0
- package/esm/src/templates/libRoot/lib/summary/Summary.Zone.js +42 -0
- package/esm/src/templates/libRoot/lib/summary/_server.js +28 -0
- package/esm/src/templates/libRoot/lib/summary/index.js +47 -0
- package/esm/src/templates/libRoot/lib/summary/summary.constant.js +24 -0
- package/esm/src/templates/libRoot/lib/summary/summary.dictionary.js +29 -0
- package/esm/src/templates/libRoot/lib/summary/summary.document.js +28 -0
- package/esm/src/templates/libRoot/lib/summary/summary.service.js +14 -0
- package/esm/src/templates/libRoot/lib/summary/summary.signal.js +14 -0
- package/esm/src/templates/libRoot/lib/summary/summary.store.js +21 -0
- package/esm/src/templates/libRoot/lib/user/User.Template.js +45 -0
- package/esm/src/templates/libRoot/lib/user/User.Unit.js +18 -0
- package/esm/src/templates/libRoot/lib/user/User.Util.js +74 -0
- package/esm/src/templates/libRoot/lib/user/User.View.js +46 -0
- package/esm/src/templates/libRoot/lib/user/User.Zone.js +54 -0
- package/esm/src/templates/libRoot/lib/user/_server.js +28 -0
- package/esm/src/templates/libRoot/lib/user/index.js +41 -0
- package/esm/src/templates/libRoot/lib/user/user.constant.js +47 -0
- package/esm/src/templates/libRoot/lib/user/user.dictionary.js +32 -0
- package/esm/src/templates/libRoot/lib/user/user.document.js +34 -0
- package/esm/src/templates/libRoot/lib/user/user.service.js +22 -0
- package/esm/src/templates/libRoot/lib/user/user.signal.js +14 -0
- package/esm/src/templates/libRoot/lib/user/user.signal.spec.js +17 -0
- package/esm/src/templates/libRoot/lib/user/user.signal.test.js +19 -0
- package/esm/src/templates/libRoot/lib/user/user.store.js +19 -0
- package/esm/src/templates/libRoot/nest/backendLogic.js +14 -0
- package/esm/src/templates/libRoot/nest/index.js +9 -0
- package/esm/src/templates/libRoot/next/frontendLogic.js +14 -0
- package/esm/src/templates/libRoot/next/index.js +9 -0
- package/esm/src/templates/libRoot/ui/index.js +9 -0
- package/package.json +1 -1
- package/src/cloud/cloud.command.d.ts +1 -0
- package/src/cloud/cloud.runner.d.ts +1 -0
- package/src/cloud/cloud.script.d.ts +1 -0
- package/src/library/library.runner.d.ts +1 -1
- package/src/templates/libRoot/akan.config.d.ts +5 -0
- package/src/templates/libRoot/base/baseLogic.d.ts +5 -0
- package/src/templates/libRoot/base/index.d.ts +5 -0
- package/src/templates/libRoot/common/commonLogic.d.ts +5 -0
- package/src/templates/libRoot/common/index.d.ts +5 -0
- package/src/templates/libRoot/env/env.server.example.ts.template +7 -0
- package/src/templates/libRoot/env/env.server.testing.ts.template +7 -0
- package/src/templates/libRoot/jest.config.d.ts +1 -1
- package/src/templates/libRoot/lib/___libName__/__libName__.dictionary.d.ts +6 -0
- package/src/templates/libRoot/lib/___libName__/__libName__.service.d.ts +6 -0
- package/src/templates/libRoot/lib/___libName__/__libName__.store.d.ts +6 -0
- package/src/templates/libRoot/lib/___libName__/_server.d.ts +7 -0
- package/src/templates/libRoot/lib/option.d.ts +6 -0
- package/src/templates/libRoot/lib/setting/Setting.Template.d.ts +9 -0
- package/src/templates/libRoot/lib/setting/Setting.Unit.d.ts +9 -0
- package/src/templates/libRoot/lib/setting/Setting.Util.d.ts +9 -0
- package/src/templates/libRoot/lib/setting/Setting.View.d.ts +9 -0
- package/src/templates/libRoot/lib/setting/Setting.Zone.d.ts +9 -0
- package/src/templates/libRoot/lib/setting/_server.d.ts +6 -0
- package/src/templates/libRoot/lib/setting/index.d.ts +9 -0
- package/src/templates/libRoot/lib/setting/setting.constant.d.ts +7 -0
- package/src/templates/libRoot/lib/setting/setting.dictionary.d.ts +7 -0
- package/src/templates/libRoot/lib/setting/setting.document.d.ts +6 -0
- package/src/templates/libRoot/lib/setting/setting.service.d.ts +7 -0
- package/src/templates/libRoot/lib/setting/setting.signal.d.ts +6 -0
- package/src/templates/libRoot/lib/setting/setting.store.d.ts +6 -0
- package/src/templates/libRoot/lib/summary/Summary.Template.d.ts +9 -0
- package/src/templates/libRoot/lib/summary/Summary.Unit.d.ts +9 -0
- package/src/templates/libRoot/lib/summary/Summary.Util.d.ts +9 -0
- package/src/templates/libRoot/lib/summary/Summary.View.d.ts +9 -0
- package/src/templates/libRoot/lib/summary/Summary.Zone.d.ts +9 -0
- package/src/templates/libRoot/lib/summary/_server.d.ts +6 -0
- package/src/templates/libRoot/lib/summary/index.d.ts +9 -0
- package/src/templates/libRoot/lib/summary/summary.constant.d.ts +7 -0
- package/src/templates/libRoot/lib/summary/summary.dictionary.d.ts +7 -0
- package/src/templates/libRoot/lib/summary/summary.document.d.ts +6 -0
- package/src/templates/libRoot/lib/summary/summary.service.d.ts +7 -0
- package/src/templates/libRoot/lib/summary/summary.signal.d.ts +6 -0
- package/src/templates/libRoot/lib/summary/summary.store.d.ts +6 -0
- package/src/templates/libRoot/lib/user/User.Template.d.ts +9 -0
- package/src/templates/libRoot/lib/user/User.Unit.d.ts +9 -0
- package/src/templates/libRoot/lib/user/User.Util.d.ts +9 -0
- package/src/templates/libRoot/lib/user/User.View.d.ts +9 -0
- package/src/templates/libRoot/lib/user/User.Zone.d.ts +9 -0
- package/src/templates/libRoot/lib/user/_server.d.ts +6 -0
- package/src/templates/libRoot/lib/user/index.d.ts +9 -0
- package/src/templates/libRoot/lib/user/user.constant.d.ts +7 -0
- package/src/templates/libRoot/lib/user/user.dictionary.d.ts +7 -0
- package/src/templates/libRoot/lib/user/user.document.d.ts +7 -0
- package/src/templates/libRoot/lib/user/user.service.d.ts +7 -0
- package/src/templates/libRoot/lib/user/user.signal.d.ts +6 -0
- package/src/templates/libRoot/lib/user/user.signal.spec.d.ts +6 -0
- package/src/templates/libRoot/lib/user/user.signal.test.d.ts +6 -0
- package/src/templates/libRoot/lib/user/user.store.d.ts +6 -0
- package/src/templates/libRoot/nest/backendLogic.d.ts +5 -0
- package/src/templates/libRoot/nest/index.d.ts +5 -0
- package/src/templates/libRoot/next/frontendLogic.d.ts +5 -0
- package/src/templates/libRoot/next/index.d.ts +5 -0
- package/src/templates/libRoot/package.json.template +2 -3
- package/src/templates/libRoot/ui/index.d.ts +5 -0
|
@@ -0,0 +1,29 @@
|
|
|
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/next/index.ts
|
|
20
|
+
var next_exports = {};
|
|
21
|
+
__export(next_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(next_exports);
|
|
25
|
+
function getContent(scanResult, dict = {}) {
|
|
26
|
+
return `
|
|
27
|
+
export * from "./frontendLogic";
|
|
28
|
+
`;
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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/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 { YourComponent } from "./YourComponent";
|
|
28
|
+
`;
|
|
29
|
+
}
|
package/esm/index.js
CHANGED
|
@@ -2027,6 +2027,7 @@ var runCommands = async (...commands) => {
|
|
|
2027
2027
|
} catch (e) {
|
|
2028
2028
|
const errMsg = e instanceof Error ? e.message : typeof e === "string" ? e : JSON.stringify(e);
|
|
2029
2029
|
Logger.error(`Command Error: ${chalk2.red(errMsg)}`);
|
|
2030
|
+
console.error(e);
|
|
2030
2031
|
}
|
|
2031
2032
|
});
|
|
2032
2033
|
}
|
|
@@ -2241,6 +2242,18 @@ var LibraryRunner = class {
|
|
|
2241
2242
|
return scanResult;
|
|
2242
2243
|
}
|
|
2243
2244
|
async createLibrary(libName, workspace) {
|
|
2245
|
+
await workspace.exec(`mkdir -p libs/${libName}`);
|
|
2246
|
+
const lib = LibExecutor.from(workspace, libName);
|
|
2247
|
+
await lib.applyTemplate({ basePath: ".", template: "libRoot", dict: { libName, Libname: capitalize(libName) } });
|
|
2248
|
+
const rootTsConfig = workspace.readJson("tsconfig.json");
|
|
2249
|
+
rootTsConfig.compilerOptions.paths[`@${libName}`] = [`libs/${libName}/index.ts`];
|
|
2250
|
+
rootTsConfig.compilerOptions.paths[`@${libName}/*`] = [`libs/${libName}/*`];
|
|
2251
|
+
if (rootTsConfig.references) {
|
|
2252
|
+
if (!rootTsConfig.references.some((ref) => ref.path === `./libs/${libName}/tsconfig.json`))
|
|
2253
|
+
rootTsConfig.references.push({ path: `./libs/${libName}/tsconfig.json` });
|
|
2254
|
+
}
|
|
2255
|
+
workspace.writeJson("tsconfig.json", rootTsConfig);
|
|
2256
|
+
return lib;
|
|
2244
2257
|
}
|
|
2245
2258
|
async removeLibrary(lib) {
|
|
2246
2259
|
await lib.workspace.exec(`rm -rf libs/${lib.name}`);
|
|
@@ -2336,7 +2349,8 @@ var LibraryScript = class {
|
|
|
2336
2349
|
await this.syncLibrary(LibExecutor.from(lib.workspace, libName), { recursive: false });
|
|
2337
2350
|
}
|
|
2338
2351
|
async createLibrary(libName, workspace) {
|
|
2339
|
-
await this.#runner.createLibrary(libName, workspace);
|
|
2352
|
+
const lib = await this.#runner.createLibrary(libName, workspace);
|
|
2353
|
+
await this.syncLibrary(lib);
|
|
2340
2354
|
}
|
|
2341
2355
|
async removeLibrary(lib) {
|
|
2342
2356
|
await this.#runner.removeLibrary(lib);
|
|
@@ -4948,6 +4962,26 @@ ${chalk4.green("\u27A4")} Authentication Required`));
|
|
|
4948
4962
|
);
|
|
4949
4963
|
Logger.info("All libraries are published to npm");
|
|
4950
4964
|
}
|
|
4965
|
+
async update(workspace) {
|
|
4966
|
+
const latestPublishedVersionOfBase = await latestVersion("@akanjs/base");
|
|
4967
|
+
const rootPackageJson = workspace.readJson("package.json");
|
|
4968
|
+
if (!rootPackageJson.dependencies)
|
|
4969
|
+
throw new Error("No dependencies found in package.json");
|
|
4970
|
+
Object.keys(rootPackageJson.dependencies).forEach((dependency) => {
|
|
4971
|
+
if (dependency.startsWith("@akanjs/"))
|
|
4972
|
+
Object.assign(rootPackageJson.dependencies ?? {}, { [dependency]: latestPublishedVersionOfBase });
|
|
4973
|
+
});
|
|
4974
|
+
Object.keys(rootPackageJson.devDependencies ?? {}).forEach((dependency) => {
|
|
4975
|
+
if (dependency.startsWith("@akanjs/"))
|
|
4976
|
+
Object.assign(rootPackageJson.devDependencies ?? {}, { [dependency]: latestPublishedVersionOfBase });
|
|
4977
|
+
});
|
|
4978
|
+
workspace.writeJson("package.json", rootPackageJson);
|
|
4979
|
+
await Promise.all([
|
|
4980
|
+
workspace.spawn("npm", ["update", "-g", "@akanjs/cli", "--latest"]),
|
|
4981
|
+
workspace.spawn("pnpm", ["install"])
|
|
4982
|
+
]);
|
|
4983
|
+
Logger.info(`Akan.js is updated to the latest version ${latestPublishedVersionOfBase}`);
|
|
4984
|
+
}
|
|
4951
4985
|
};
|
|
4952
4986
|
|
|
4953
4987
|
// pkgs/@akanjs/cli/src/cloud/cloud.script.ts
|
|
@@ -4978,6 +5012,9 @@ var CloudScript = class {
|
|
|
4978
5012
|
);
|
|
4979
5013
|
await this.#runner.deployAkan(workspace, akanPkgs);
|
|
4980
5014
|
}
|
|
5015
|
+
async update(workspace) {
|
|
5016
|
+
await this.#runner.update(workspace);
|
|
5017
|
+
}
|
|
4981
5018
|
};
|
|
4982
5019
|
|
|
4983
5020
|
// pkgs/@akanjs/cli/src/cloud/cloud.command.ts
|
|
@@ -5001,6 +5038,9 @@ var CloudCommand = class {
|
|
|
5001
5038
|
async deployAkan(workspace) {
|
|
5002
5039
|
await this.cloudScript.deployAkan(workspace);
|
|
5003
5040
|
}
|
|
5041
|
+
async update(workspace) {
|
|
5042
|
+
await this.cloudScript.update(workspace);
|
|
5043
|
+
}
|
|
5004
5044
|
};
|
|
5005
5045
|
__decorateClass([
|
|
5006
5046
|
Target.Public()
|
|
@@ -5022,6 +5062,10 @@ __decorateClass([
|
|
|
5022
5062
|
Target.Public({ devOnly: true }),
|
|
5023
5063
|
__decorateParam(0, Workspace())
|
|
5024
5064
|
], CloudCommand.prototype, "deployAkan", 1);
|
|
5065
|
+
__decorateClass([
|
|
5066
|
+
Target.Public(),
|
|
5067
|
+
__decorateParam(0, Workspace())
|
|
5068
|
+
], CloudCommand.prototype, "update", 1);
|
|
5025
5069
|
CloudCommand = __decorateClass([
|
|
5026
5070
|
Commands()
|
|
5027
5071
|
], CloudCommand);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/akan.config.ts
|
|
2
|
+
function getContent(scanResult, dict) {
|
|
3
|
+
return `
|
|
4
|
+
import type { LibConfig } from "@akanjs/config";
|
|
5
|
+
|
|
6
|
+
const config: LibConfig = {
|
|
7
|
+
rootLib: "shared",
|
|
8
|
+
libs: ["util", "shared"],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default config;
|
|
12
|
+
`;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
getContent as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/base/baseLogic.ts
|
|
2
|
+
function getContent(scanResult, dict) {
|
|
3
|
+
return `
|
|
4
|
+
// \uD604 \uB514\uB809\uD1A0\uB9AC\uC5D0\uC11C\uB294 \uD504\uB85C\uC81D\uD2B8 \uB0B4 \uC804\uCCB4\uC801\uC73C\uB85C \uC0AC\uC6A9\uB418\uB294 \uB85C\uC9C1\uC744 \uAD6C\uD604\uD558\uBA70, \uB530\uB77C\uC11C \uBC31/\uD504\uB860\uD2B8 \uBE44\uC758\uC874\uC801\uC778 pure js \uCF54\uB4DC\uB9CC \uAD6C\uD604 \uAC00\uB2A5\uD569\uB2C8\uB2E4.
|
|
5
|
+
// common\uD3F4\uB354\uC640 \uB2E4\uB978\uC810\uC740, base \uCF54\uB4DC\uB294 \uC2DC\uC2A4\uD15C \uC804\uCCB4\uC5D0\uC11C import\uB418\uC5B4 \uC0AC\uC6A9\uB418\uBBC0\uB85C, \uAC00\uC7A5 \uD575\uC2EC\uC801\uC778 \uB85C\uC9C1\uACFC \uCD94\uC0C1\uD654\uB41C \uAE30\uB2A5\uB9CC \uAD6C\uD604\uD574\uC57C\uD569\uB2C8\uB2E4.
|
|
6
|
+
// @${dict.libName}/base\uC5D0\uC11C\uB294 \uC11C\uBC84/\uD074\uB77C\uC774\uC5B8\uD2B8 \uAD00\uB828 \uB77C\uC774\uBE0C\uB7EC\uB9AC(@*/server, @*/nest, @*/client, @*/next)\uB97C \uBAA8\uB450 import\uD560 \uC218 \uC5C6\uC73C\uBA70, @*/base \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB9CC import \uAC00\uB2A5\uD569\uB2C8\uB2E4.
|
|
7
|
+
|
|
8
|
+
export const someBaseLogic = () => {
|
|
9
|
+
//
|
|
10
|
+
};
|
|
11
|
+
`;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
getContent as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/common/commonLogic.ts
|
|
2
|
+
function getContent(scanResult, dict) {
|
|
3
|
+
return `
|
|
4
|
+
// \uD604 \uB514\uB809\uD1A0\uB9AC\uC5D0\uC11C\uB294 \uD504\uB85C\uC81D\uD2B8 \uB0B4 \uC804\uCCB4\uC801\uC73C\uB85C \uC0AC\uC6A9\uB418\uB294 \uC138\uBD80\uC801\uC778 \uB85C\uC9C1\uC744 \uAD6C\uD604\uD558\uBA70, \uB530\uB77C\uC11C \uBC31/\uD504\uB860\uD2B8 \uBE44\uC758\uC874\uC801\uC778 pure js \uCF54\uB4DC\uB9CC \uAD6C\uD604 \uAC00\uB2A5\uD569\uB2C8\uB2E4.
|
|
5
|
+
// base\uD3F4\uB354\uC640 \uB2E4\uB978\uC810\uC740, common \uCF54\uB4DC\uB294 \uC0AC\uC6A9\uD558\uB294 \uD30C\uC77C\uC5D0\uC11C\uB9CC import\uB418\uAE30 \uB54C\uBB38\uC5D0, \uC678\uBD80\uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C import\uD574\uC11C \uC0AC\uC6A9\uD558\uAC70\uB098 \uC0C1\uC138\uD55C \uB85C\uC9C1\uC744 \uAD6C\uD604\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
|
|
6
|
+
// @${dict.libName}/common\uC5D0\uC11C\uB294 \uC11C\uBC84/\uD074\uB77C\uC774\uC5B8\uD2B8 \uAD00\uB828 \uB77C\uC774\uBE0C\uB7EC\uB9AC(@*/server, @*/nest, @*/client, @*/next)\uB97C \uBAA8\uB450 import\uD560 \uC218 \uC5C6\uC73C\uBA70, @*/base\uC640 @*/common \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB9CC import \uAC00\uB2A5\uD569\uB2C8\uB2E4.
|
|
7
|
+
|
|
8
|
+
export const someCommonLogic = () => {
|
|
9
|
+
//
|
|
10
|
+
};
|
|
11
|
+
`;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
getContent as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/lib/___libName__/__libName__.dictionary.ts
|
|
2
|
+
function getContent(scanResult, dict) {
|
|
3
|
+
return `
|
|
4
|
+
const dictionary = {} as const;
|
|
5
|
+
|
|
6
|
+
export const ${dict.libName}Dictionary = dictionary;
|
|
7
|
+
`;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
getContent as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/lib/___libName__/__libName__.service.ts
|
|
2
|
+
function getContent(scanResult, dict) {
|
|
3
|
+
return `
|
|
4
|
+
import { Cron } from "@akanjs/nest";
|
|
5
|
+
import { LogService, Service, Srv } from "@akanjs/service";
|
|
6
|
+
|
|
7
|
+
import type * as srv from "../srv";
|
|
8
|
+
|
|
9
|
+
@Service("${dict.libName}Service", { serverMode: "batch" })
|
|
10
|
+
export class ${dict.LibName}Service extends LogService("${dict.libName}Service") {
|
|
11
|
+
@Srv() protected readonly summaryService: srv.SummaryService;
|
|
12
|
+
|
|
13
|
+
@Cron("0 * * * *")
|
|
14
|
+
async takePeriodicSnapshot() {
|
|
15
|
+
await this.summaryService.makeSummary();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
getContent as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/lib/___libName__/__libName__.store.ts
|
|
2
|
+
function getContent(scanResult, dict) {
|
|
3
|
+
return `
|
|
4
|
+
import { scalarStateOf, Store } from "@akanjs/store";
|
|
5
|
+
|
|
6
|
+
@Store({ name: "${dict.libName}" })
|
|
7
|
+
export class ${dict.LibName}Store extends scalarStateOf("${dict.libName}" as const, {
|
|
8
|
+
// state
|
|
9
|
+
}) {
|
|
10
|
+
// action
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
getContent as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/lib/___libName__/_server.ts
|
|
2
|
+
function getContent(scanResult, dict) {
|
|
3
|
+
return `
|
|
4
|
+
import { batchModuleOf } from "@akanjs/server";
|
|
5
|
+
|
|
6
|
+
import type { ModulesOptions } from "../option";
|
|
7
|
+
import { ${dict.AppName}Service } from "./${dict.appName}.service";
|
|
8
|
+
|
|
9
|
+
export const register${dict.AppName}Module = (option: ModulesOptions) => batchModuleOf({ service: ${dict.AppName}Service, uses: {} });
|
|
10
|
+
`;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
getContent as default
|
|
14
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/lib/option.ts
|
|
2
|
+
function getContent(scanResult, dict = {}) {
|
|
3
|
+
return `
|
|
4
|
+
import { useGlobals } from "@akanjs/server";
|
|
5
|
+
|
|
6
|
+
import type { LibOptions } from "./__lib/lib.service";
|
|
7
|
+
|
|
8
|
+
export type ModulesOptions = LibOptions & {
|
|
9
|
+
//
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const registerGlobalModule = (options: ModulesOptions) => {
|
|
13
|
+
return useGlobals({
|
|
14
|
+
uses: {},
|
|
15
|
+
useAsyncs: {},
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
`;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
getContent as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/lib/setting/Setting.Template.tsx
|
|
2
|
+
function getContent(scanResult, dict) {
|
|
3
|
+
return {
|
|
4
|
+
filename: "Setting.Template.tsx",
|
|
5
|
+
content: `
|
|
6
|
+
"use client";
|
|
7
|
+
import { st, usePage } from "@${dict.libName}/client";
|
|
8
|
+
|
|
9
|
+
interface GeneralProps {
|
|
10
|
+
settingId?: string | null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const General = ({ settingId = undefined }: GeneralProps) => {
|
|
14
|
+
const settingForm = st.use.settingForm();
|
|
15
|
+
const { l } = usePage();
|
|
16
|
+
return (
|
|
17
|
+
<div className="mb-4 flex items-center">
|
|
18
|
+
<div className="flex items-center gap-2">
|
|
19
|
+
<div className="w-32">{l("setting.resignupDays")}</div>
|
|
20
|
+
<input
|
|
21
|
+
type="number"
|
|
22
|
+
className="input"
|
|
23
|
+
value={settingForm.resignupDays}
|
|
24
|
+
onChange={(e) => {
|
|
25
|
+
st.do.setResignupDaysOnSetting(e.target.valueAsNumber);
|
|
26
|
+
}}
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
`
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
getContent as default
|
|
37
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/lib/setting/Setting.Unit.tsx
|
|
2
|
+
function getContent(scanResult, dict = {}) {
|
|
3
|
+
return {
|
|
4
|
+
filename: "Setting.Unit.tsx",
|
|
5
|
+
content: `
|
|
6
|
+
import { ModelProps } from "@akanjs/client";
|
|
7
|
+
|
|
8
|
+
import { cnst } from "../cnst";
|
|
9
|
+
|
|
10
|
+
export const Card = ({ className, setting }: ModelProps<"setting", cnst.LightSetting>) => {
|
|
11
|
+
return <div>{setting.id}</div>;
|
|
12
|
+
};
|
|
13
|
+
`
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
getContent as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/lib/setting/Setting.Util.tsx
|
|
2
|
+
function getContent(scanResult, dict = {}) {
|
|
3
|
+
return {
|
|
4
|
+
filename: "Setting.Util.tsx",
|
|
5
|
+
content: `
|
|
6
|
+
"use client";
|
|
7
|
+
|
|
8
|
+
export const aaa = 1;
|
|
9
|
+
`
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
getContent as default
|
|
14
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/lib/setting/Setting.View.tsx
|
|
2
|
+
function getContent(scanResult, dict) {
|
|
3
|
+
return {
|
|
4
|
+
filename: "Setting.View.tsx",
|
|
5
|
+
content: `
|
|
6
|
+
import { clsx } from "@akanjs/client";
|
|
7
|
+
import { usePage } from "@${dict.libName}/client";
|
|
8
|
+
|
|
9
|
+
import { cnst } from "../cnst";
|
|
10
|
+
|
|
11
|
+
interface SettingViewProps {
|
|
12
|
+
className?: string;
|
|
13
|
+
setting: cnst.Setting;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const General = ({ className, setting }: SettingViewProps) => {
|
|
17
|
+
const { l } = usePage();
|
|
18
|
+
return (
|
|
19
|
+
<div className={clsx(className, "mr-12")}>
|
|
20
|
+
<div>
|
|
21
|
+
{l("setting.resignupDays")}: {setting.resignupDays}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
`
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
getContent as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/lib/setting/Setting.Zone.tsx
|
|
2
|
+
function getContent(scanResult, dict) {
|
|
3
|
+
return {
|
|
4
|
+
filename: "Setting.Zone.tsx",
|
|
5
|
+
content: `
|
|
6
|
+
"use client";
|
|
7
|
+
import { ModelsProps } from "@akanjs/client";
|
|
8
|
+
import { Setting, st, usePage } from "@${dict.libName}/client";
|
|
9
|
+
import { Model } from "@shared/ui";
|
|
10
|
+
import { Loading } from "@util/ui";
|
|
11
|
+
import { useEffect } from "react";
|
|
12
|
+
import { AiOutlineEdit } from "react-icons/ai";
|
|
13
|
+
|
|
14
|
+
import { cnst } from "../cnst";
|
|
15
|
+
import { msg } from "../dict";
|
|
16
|
+
|
|
17
|
+
export const Admin = ({ sliceName = "setting" }: ModelsProps<cnst.Setting>) => {
|
|
18
|
+
const { l } = usePage();
|
|
19
|
+
const setting = st.use.setting();
|
|
20
|
+
const settingModal = st.use.settingModal();
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
void st.do.getActiveSetting();
|
|
23
|
+
}, []);
|
|
24
|
+
if (!setting) return <Loading.Skeleton active />;
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div>
|
|
28
|
+
<div className="my-2 flex items-center gap-4 text-3xl">
|
|
29
|
+
{l("setting.modelName")}
|
|
30
|
+
{settingModal ? null : (
|
|
31
|
+
<button className="btn btn-sm" onClick={() => st.do.editSetting(setting.id)}>
|
|
32
|
+
<AiOutlineEdit /> {l("shared.edit")}
|
|
33
|
+
</button>
|
|
34
|
+
)}
|
|
35
|
+
</div>
|
|
36
|
+
{settingModal === "edit" ? (
|
|
37
|
+
<Model.EditModal
|
|
38
|
+
sliceName="setting"
|
|
39
|
+
type="form"
|
|
40
|
+
onSubmit={() => {
|
|
41
|
+
msg.success("setting.updateSuccessMsg");
|
|
42
|
+
}}
|
|
43
|
+
onCancel={() => {
|
|
44
|
+
st.do.resetSetting(setting);
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
<Setting.Template.General />
|
|
48
|
+
</Model.EditModal>
|
|
49
|
+
) : (
|
|
50
|
+
<Setting.View.General setting={setting} />
|
|
51
|
+
)}
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
`
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
getContent as default
|
|
60
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/lib/setting/_server.ts
|
|
2
|
+
function getContent(scanResult, dict = {}) {
|
|
3
|
+
return `
|
|
4
|
+
import { databaseModuleOf } from "@akanjs/server";
|
|
5
|
+
|
|
6
|
+
import { cnst } from "../cnst";
|
|
7
|
+
import * as db from "../db";
|
|
8
|
+
import type { ModulesOptions } from "../option";
|
|
9
|
+
import { allSrvs } from "../srv";
|
|
10
|
+
import { SettingService } from "./setting.service";
|
|
11
|
+
import { SettingSignal } from "./setting.signal";
|
|
12
|
+
|
|
13
|
+
export const registerSettingModule = (option: ModulesOptions) =>
|
|
14
|
+
databaseModuleOf(
|
|
15
|
+
{
|
|
16
|
+
constant: cnst.settingCnst,
|
|
17
|
+
database: db.settingDb,
|
|
18
|
+
signal: SettingSignal,
|
|
19
|
+
service: SettingService,
|
|
20
|
+
extended: true,
|
|
21
|
+
},
|
|
22
|
+
allSrvs
|
|
23
|
+
);
|
|
24
|
+
`;
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
getContent as default
|
|
28
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/lib/setting/index.tsx
|
|
2
|
+
function getContent(scanResult, dict = {}) {
|
|
3
|
+
return {
|
|
4
|
+
filename: "index.tsx",
|
|
5
|
+
content: `
|
|
6
|
+
import { Signal } from "@util/ui";
|
|
7
|
+
import { AiOutlineSetting } from "react-icons/ai";
|
|
8
|
+
|
|
9
|
+
import * as Template from "./Setting.Template";
|
|
10
|
+
import * as Unit from "./Setting.Unit";
|
|
11
|
+
import * as Util from "./Setting.Util";
|
|
12
|
+
import * as View from "./Setting.View";
|
|
13
|
+
import * as Zone from "./Setting.Zone";
|
|
14
|
+
|
|
15
|
+
export const Setting = {
|
|
16
|
+
Menu: {
|
|
17
|
+
Admin: {
|
|
18
|
+
key: "setting",
|
|
19
|
+
label: "Setting",
|
|
20
|
+
icon: <AiOutlineSetting />,
|
|
21
|
+
render: () => <Zone.Admin />,
|
|
22
|
+
},
|
|
23
|
+
Doc: {
|
|
24
|
+
key: "setting",
|
|
25
|
+
label: "Setting",
|
|
26
|
+
icon: <AiOutlineSetting />,
|
|
27
|
+
render: () => <Signal.Doc.Zone refName="setting" />,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
Template,
|
|
31
|
+
Unit,
|
|
32
|
+
Util,
|
|
33
|
+
View,
|
|
34
|
+
Zone,
|
|
35
|
+
};
|
|
36
|
+
`
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
getContent as default
|
|
41
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/lib/setting/setting.constant.ts
|
|
2
|
+
function getContent(scanResult, dict) {
|
|
3
|
+
return `
|
|
4
|
+
import { from, Model, via } from "@akanjs/constant";
|
|
5
|
+
|
|
6
|
+
import { libSettingInputs, libSettings, root } from "../__lib/lib.constant";
|
|
7
|
+
|
|
8
|
+
@Model.Input("${dict.LibName}SettingInput")
|
|
9
|
+
export class ${dict.LibName}SettingInput {}
|
|
10
|
+
|
|
11
|
+
@Model.Input("SettingInput")
|
|
12
|
+
export class SettingInput extends from(...libSettingInputs, ${dict.LibName}SettingInput) {}
|
|
13
|
+
|
|
14
|
+
@Model.Object("SettingObject")
|
|
15
|
+
export class SettingObject extends from(...libSettings, SettingInput) {}
|
|
16
|
+
|
|
17
|
+
@Model.Light("LightSetting")
|
|
18
|
+
export class LightSetting extends via(SettingObject, ["status"] as const) {}
|
|
19
|
+
|
|
20
|
+
@Model.Full("Setting")
|
|
21
|
+
export class Setting extends via(SettingObject, LightSetting, root.Setting, root.LightSetting) {}
|
|
22
|
+
`;
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
getContent as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/lib/setting/setting.dictionary.ts
|
|
2
|
+
function getContent(scanResult, dict) {
|
|
3
|
+
return `
|
|
4
|
+
import { ExtendModelDictionary, SignalDictionary } from "@akanjs/dictionary";
|
|
5
|
+
|
|
6
|
+
import type { ${dict.LibName}SettingInput } from "./setting.constant";
|
|
7
|
+
import type { SettingSignal } from "./setting.signal";
|
|
8
|
+
|
|
9
|
+
const modelDictionary = {
|
|
10
|
+
// * ==================== Model ==================== * //
|
|
11
|
+
// * ==================== Model ==================== * //
|
|
12
|
+
// * ==================== Etc ==================== * //
|
|
13
|
+
// * ==================== Etc ==================== * //
|
|
14
|
+
} satisfies ExtendModelDictionary<${dict.LibName}SettingInput>;
|
|
15
|
+
|
|
16
|
+
const signalDictionary = {
|
|
17
|
+
// * ==================== Endpoint ==================== * //
|
|
18
|
+
// * ==================== Endpoint ==================== * //
|
|
19
|
+
} satisfies SignalDictionary<SettingSignal, ${dict.LibName}SettingInput>;
|
|
20
|
+
|
|
21
|
+
export const settingDictionary = { ...modelDictionary, ...signalDictionary };
|
|
22
|
+
`;
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
getContent as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/lib/setting/setting.document.ts
|
|
2
|
+
function getContent(scanResult, dict = {}) {
|
|
3
|
+
return `
|
|
4
|
+
import { beyond, by, Database, into, type SchemaOf } from "@akanjs/document";
|
|
5
|
+
|
|
6
|
+
import { rootSetting } from "../__lib/lib.document";
|
|
7
|
+
import { cnst } from "../cnst";
|
|
8
|
+
|
|
9
|
+
@Database.Input(() => cnst.SettingInput)
|
|
10
|
+
export class SettingInput extends by(rootSetting.Input, cnst.SettingInput) {}
|
|
11
|
+
|
|
12
|
+
@Database.Document(() => cnst.Setting)
|
|
13
|
+
export class Setting extends by(rootSetting.Doc, cnst.Setting) {}
|
|
14
|
+
|
|
15
|
+
@Database.Model(() => cnst.Setting)
|
|
16
|
+
export class SettingModel extends into(Setting, cnst.settingCnst) {}
|
|
17
|
+
|
|
18
|
+
@Database.Middleware(() => cnst.Setting)
|
|
19
|
+
export class SettingMiddleware extends beyond(SettingModel, Setting) {
|
|
20
|
+
onSchema(schema: SchemaOf<SettingModel, Setting>) {
|
|
21
|
+
//
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
getContent as default
|
|
28
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// pkgs/@akanjs/cli/src/templates/libRoot/lib/setting/setting.service.ts
|
|
2
|
+
function getContent(scanResult, dict) {
|
|
3
|
+
return `
|
|
4
|
+
import { ExtendedSettingService, Service } from "@akanjs/service";
|
|
5
|
+
|
|
6
|
+
import { LibSettingService } from "../__lib/lib.service";
|
|
7
|
+
import * as db from "../db";
|
|
8
|
+
|
|
9
|
+
@Service("SettingService")
|
|
10
|
+
export class SettingService extends ExtendedSettingService(db.settingDb, LibSettingService) {
|
|
11
|
+
//
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
getContent as default
|
|
17
|
+
};
|