@itrocks/framework 0.0.1 → 0.0.3
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/config.js +14 -11
- package/cjs/framework.js +4 -0
- package/cjs/menu.d.ts +1 -0
- package/cjs/menu.js +11 -0
- package/package.json +1 -2
package/cjs/config.js
CHANGED
|
@@ -3,22 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.mergeConfig = mergeConfig;
|
|
4
4
|
const app_dir_1 = require("@itrocks/app-dir");
|
|
5
5
|
const node_fs_1 = require("node:fs");
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Object.entries(appConfig).forEach(([key, value]) => {
|
|
11
|
-
if (config[key]) {
|
|
12
|
-
if (!Array.isArray(config[key]))
|
|
6
|
+
function mergeConfigObject(config, mergeConfig) {
|
|
7
|
+
Object.entries(mergeConfig).forEach(([key, value]) => {
|
|
8
|
+
if (Array.isArray(value)) {
|
|
9
|
+
if (!Array.isArray(config[key])) {
|
|
13
10
|
config[key] = [config[key]];
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
}
|
|
12
|
+
config[key].push(...value);
|
|
13
|
+
}
|
|
14
|
+
if (config[key]) {
|
|
15
|
+
mergeConfigObject(config[key], value);
|
|
18
16
|
}
|
|
19
17
|
else {
|
|
20
18
|
config[key] = value;
|
|
21
19
|
}
|
|
22
20
|
});
|
|
23
21
|
}
|
|
22
|
+
function mergeConfig(config, appConfigFile) {
|
|
23
|
+
if (!(0, node_fs_1.existsSync)(app_dir_1.appDir + appConfigFile))
|
|
24
|
+
return;
|
|
25
|
+
mergeConfigObject(config, Object.values(require(app_dir_1.appDir + appConfigFile))[0]);
|
|
26
|
+
}
|
|
24
27
|
//# sourceMappingURL=config.js.map
|
package/cjs/framework.js
CHANGED
|
@@ -25,6 +25,7 @@ const core_transformers_2 = require("@itrocks/core-transformers");
|
|
|
25
25
|
const fastify_1 = require("@itrocks/fastify");
|
|
26
26
|
const fastify_file_session_store_1 = require("@itrocks/fastify-file-session-store");
|
|
27
27
|
const lazy_loading_2 = require("@itrocks/lazy-loading");
|
|
28
|
+
const menu_1 = require("@itrocks/menu");
|
|
28
29
|
const mysql_1 = require("@itrocks/mysql");
|
|
29
30
|
const password_1 = require("@itrocks/password");
|
|
30
31
|
const transformers_1 = require("@itrocks/password/transformers");
|
|
@@ -49,7 +50,9 @@ const data_source_1 = require("../../../../local/data-source");
|
|
|
49
50
|
const secret_1 = require("../../../../local/secret");
|
|
50
51
|
const session_1 = require("../../../../local/session");
|
|
51
52
|
const access_1 = require("./access");
|
|
53
|
+
const menu_2 = require("./menu");
|
|
52
54
|
const template_2 = require("./template");
|
|
55
|
+
const menu = new menu_1.Menu(menu_2.menuConfig);
|
|
53
56
|
let routes;
|
|
54
57
|
template_1.frontScripts.push('/node_modules/@itrocks/air-datepicker/air-datepicker.js', '/node_modules/@itrocks/asset-loader/asset-loader.js', '/node_modules/@itrocks/asset-loader/load-css.js', '/node_modules/@itrocks/asset-loader/load-script.js', '/node_modules/@itrocks/auto-focus/auto-focus.js', '/node_modules/@itrocks/auto-redirect/auto-redirect.js', '/node_modules/@itrocks/auto-redirect/build.js', '/node_modules/@itrocks/autocompleter/autocompleter.js', '/node_modules/@itrocks/breadcrumb/breadcrumb.js', '/node_modules/@itrocks/build/build.js', '/node_modules/@itrocks/collapse/collapse.js', '/node_modules/@itrocks/contained-auto-width/contained-auto-width.js', '/node_modules/@itrocks/form-fetch/form-fetch.js', '/node_modules/@itrocks/modal/modal.js', '/node_modules/@itrocks/notifications/notifications.js', '/node_modules/@itrocks/plugin/plugin.js', '/node_modules/@itrocks/real-viewport-height/real-viewport-height.js', '/node_modules/@itrocks/sorted-array/sorted-array.js', '/node_modules/@itrocks/table/freeze.js', '/node_modules/@itrocks/table/freeze/inherit-background.js', '/node_modules/@itrocks/table/freeze/inherit-border.js', '/node_modules/@itrocks/table/table.js', '/node_modules/@itrocks/xtarget/begin-end.js', '/node_modules/@itrocks/xtarget/build.js', '/node_modules/@itrocks/xtarget/composite.js', '/node_modules/@itrocks/xtarget/default-target.js', '/node_modules/@itrocks/xtarget/head.js', '/node_modules/@itrocks/xtarget/headers-size.js', '/node_modules/@itrocks/xtarget/history.js', '/node_modules/@itrocks/xtarget/main-target.js', '/node_modules/@itrocks/xtarget/modifier.js', '/node_modules/@itrocks/xtarget/xtarget.js', '/node_modules/air-datepicker/air-datepicker.js', '/node_modules/air-datepicker/locale/en.js', '/node_modules/air-datepicker/locale/fr.js', '/node_modules/autocompleter/autocomplete.es.js');
|
|
55
58
|
function bindDependencies() {
|
|
@@ -99,6 +102,7 @@ function bindDependencies() {
|
|
|
99
102
|
const containerData = {
|
|
100
103
|
action: request.action,
|
|
101
104
|
actions: this.actions,
|
|
105
|
+
menu,
|
|
102
106
|
request,
|
|
103
107
|
session: request.request.session
|
|
104
108
|
};
|
package/cjs/menu.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const menuConfig: Record<string, Record<string, string>>;
|
package/cjs/menu.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.menuConfig = void 0;
|
|
4
|
+
const config_1 = require("./config");
|
|
5
|
+
exports.menuConfig = {
|
|
6
|
+
'Administration': {
|
|
7
|
+
'/user/list': 'Users'
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
(0, config_1.mergeConfig)(exports.menuConfig, '/app/config/menu.js');
|
|
11
|
+
//# sourceMappingURL=menu.js.map
|
package/package.json
CHANGED
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
"@itrocks/translate": "latest",
|
|
58
58
|
"@itrocks/user": "latest",
|
|
59
59
|
"@itrocks/uses": "latest",
|
|
60
|
-
"@itrocks/webstorm": "latest",
|
|
61
60
|
"@itrocks/xtarget": "latest",
|
|
62
61
|
"air-datepicker": "^3.5",
|
|
63
62
|
"autocompleter": "^9.3",
|
|
@@ -99,5 +98,5 @@
|
|
|
99
98
|
"build:front": "tsc -p src/front/tsconfig.json && sed -i 's#../../##g' app.js app.d.ts"
|
|
100
99
|
},
|
|
101
100
|
"types": "./cjs/framework.d.ts",
|
|
102
|
-
"version": "0.0.
|
|
101
|
+
"version": "0.0.3"
|
|
103
102
|
}
|