not-node 6.0.8 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +12 -0
- package/bin/not-builder.js +6 -8
- package/bin/not-cli.mjs +385 -0
- package/index.js +6 -0
- package/package.json +133 -128
- package/playground/.babelrc +11 -0
- package/playground/.eslintignore +4 -0
- package/playground/.eslintrc.json +23 -0
- package/playground/app/front/build.env.js +15 -0
- package/playground/app/front/index.!.js +64 -0
- package/playground/app/front/rollup.!.js +70 -0
- package/playground/app/front/src/admin/main/index.js +45 -0
- package/playground/app/front/src/client/main/index.js +45 -0
- package/playground/app/front/src/common/index.js +39 -0
- package/playground/app/front/src/common/ncInit.js +18 -0
- package/playground/app/front/src/common/ws.client.main.js +35 -0
- package/playground/app/front/src/guest/main/index.js +34 -0
- package/playground/app/front/src/root/main/index.js +45 -0
- package/playground/app/front/src/user/main/index.js +45 -0
- package/playground/app/server/app.js +22 -0
- package/playground/app/server/config/common.json +99 -0
- package/playground/app/server/config/development.json +34 -0
- package/playground/app/server/config/production.json +34 -0
- package/playground/app/server/config/stage.json +34 -0
- package/playground/app/server/index.js +20 -0
- package/playground/app/server/routes/index.js +36 -0
- package/playground/app/server/routes/site.js +71 -0
- package/playground/app/server/views/admin/foot.pug +1 -0
- package/playground/app/server/views/admin/head.pug +7 -0
- package/playground/app/server/views/admin/menu.pug +2 -0
- package/playground/app/server/views/admin.pug +19 -0
- package/playground/app/server/views/dashboard.pug +20 -0
- package/playground/app/server/views/index.pug +15 -0
- package/playground/app/server/views/parts/header.android.pug +7 -0
- package/playground/app/server/views/parts/header.ios.pug +5 -0
- package/playground/app/server/views/parts/header.pug +18 -0
- package/playground/app/server/views/parts/menu.pug +1 -0
- package/playground/app/server/views/parts/overview.pug +2 -0
- package/playground/app/server/ws/auth.js +41 -0
- package/playground/app/server/ws/index.js +84 -0
- package/playground/bin/build.sh +8 -0
- package/playground/package.json +85 -0
- package/playground/project.manifest.json +37 -0
- package/src/app.js +3 -3
- package/src/cli/const.mjs +71 -0
- package/src/cli/readers/AppDescription.mjs +14 -0
- package/src/cli/readers/AppName.mjs +14 -0
- package/src/cli/readers/ModelName.mjs +14 -0
- package/src/cli/readers/ModuleName.mjs +14 -0
- package/src/cli/readers/actions.mjs +25 -0
- package/src/cli/readers/appName.mjs +14 -0
- package/src/cli/readers/cors.mjs +12 -0
- package/src/cli/readers/db/ioredis.mjs +3 -0
- package/src/cli/readers/db/mongoose.mjs +81 -0
- package/src/cli/readers/db/redis.mjs +3 -0
- package/src/cli/readers/db.mjs +30 -0
- package/src/cli/readers/entityData.mjs +44 -0
- package/src/cli/readers/entityLayers.mjs +21 -0
- package/src/cli/readers/fields.mjs +13 -0
- package/src/cli/readers/filter.mjs +34 -0
- package/src/cli/readers/hostname.mjs +23 -0
- package/src/cli/readers/index.mjs +86 -0
- package/src/cli/readers/init_root_user.mjs +55 -0
- package/src/cli/readers/isUserNeedCreateEntity.mjs +14 -0
- package/src/cli/readers/isUserNeedCreateServerModule.mjs +14 -0
- package/src/cli/readers/isUserNeedFrontModuleBootstrap.mjs +14 -0
- package/src/cli/readers/modelIncrement.mjs +32 -0
- package/src/cli/readers/modelIncrementFilter.mjs +49 -0
- package/src/cli/readers/modelOptions.mjs +61 -0
- package/src/cli/readers/modelValidators.mjs +14 -0
- package/src/cli/readers/modelVersioning.mjs +14 -0
- package/src/cli/readers/moduleLayers.mjs +25 -0
- package/src/cli/readers/modules.mjs +19 -0
- package/src/cli/readers/not_node_monitor.mjs +48 -0
- package/src/cli/readers/not_node_reporter.mjs +42 -0
- package/src/cli/readers/port.mjs +14 -0
- package/src/cli/readers/roles.mjs +25 -0
- package/src/cli/readers/rolesSecondary.mjs +14 -0
- package/src/cli/readers/secret.mjs +21 -0
- package/src/cli/readers/session.mjs +62 -0
- package/src/cli/readers/ssl.mjs +38 -0
- package/src/cli/readers/user.mjs +62 -0
- package/src/cli/readers/ws.mjs +35 -0
- package/src/cli/renderers/controllers.mjs +26 -0
- package/src/cli/renderers/controllersCommons.mjs +42 -0
- package/src/cli/renderers/controllersIndex.mjs +18 -0
- package/src/cli/renderers/fields.mjs +1 -0
- package/src/cli/renderers/forms.mjs +43 -0
- package/src/cli/renderers/frontModuleGuestMain.mjs +10 -0
- package/src/cli/renderers/frontModuleRoleMain.mjs +10 -0
- package/src/cli/renderers/index.mjs +29 -0
- package/src/cli/renderers/logics.mjs +17 -0
- package/src/cli/renderers/models.mjs +16 -0
- package/src/cli/renderers/routes.mjs +31 -0
- package/src/common.js +17 -3
- package/src/domain.js +8 -9
- package/src/headers.js +15 -0
- package/src/init/index.js +1 -0
- package/src/init/lib/app.js +5 -7
- package/src/init/lib/db/mongoose.js +1 -0
- package/src/init/lib/modules.js +2 -1
- package/src/init/lib/routes.js +1 -0
- package/src/init/lib/sessions/index.js +14 -2
- package/src/manifest/module.js +6 -20
- package/src/metas.js +32 -0
- package/src/styler.js +42 -0
- package/tmpl/dirs/app.mjs +32 -0
- package/tmpl/dirs/front.mjs +16 -0
- package/tmpl/dirs/module.front.mjs +19 -0
- package/tmpl/dirs/module.server.controllers.common.mjs +7 -0
- package/tmpl/dirs/module.server.mjs +14 -0
- package/tmpl/dirs/server.mjs +127 -0
- package/tmpl/dirs/static.mjs +9 -0
- package/tmpl/files/app/.babelrc +11 -0
- package/tmpl/files/app/.eslintignore +4 -0
- package/tmpl/files/app/.eslintrc.json +23 -0
- package/tmpl/files/app/app.ejs +22 -0
- package/tmpl/files/app/build.sh +8 -0
- package/tmpl/files/app/config/common.ejs +131 -0
- package/tmpl/files/app/config/other.ejs +34 -0
- package/tmpl/files/app/deploy.pm2.ejs +23 -0
- package/tmpl/files/app/env.ejs +16 -0
- package/tmpl/files/app/front/build.env.ejs +15 -0
- package/tmpl/files/app/front/index.!.ejs +66 -0
- package/tmpl/files/app/front/rollup.!.ejs +70 -0
- package/tmpl/files/app/index.ejs +20 -0
- package/tmpl/files/app/package.ejs +71 -0
- package/tmpl/files/app/project.manifest.ejs +23 -0
- package/tmpl/files/app/routes/index.ejs +36 -0
- package/tmpl/files/app/routes/site.ejs +71 -0
- package/tmpl/files/app/views/admin/foot.ejs +1 -0
- package/tmpl/files/app/views/admin/head.ejs +7 -0
- package/tmpl/files/app/views/admin/menu.ejs +2 -0
- package/tmpl/files/app/views/admin.ejs +19 -0
- package/tmpl/files/app/views/dashboard.ejs +20 -0
- package/tmpl/files/app/views/index.ejs +15 -0
- package/tmpl/files/app/views/parts/header.android.ejs +7 -0
- package/tmpl/files/app/views/parts/header.ejs +18 -0
- package/tmpl/files/app/views/parts/header.ios.ejs +5 -0
- package/tmpl/files/app/views/parts/menu.ejs +1 -0
- package/tmpl/files/app/views/parts/overview.ejs +2 -0
- package/tmpl/files/app/ws/auth.ejs +41 -0
- package/tmpl/files/app/ws/index.ejs +84 -0
- package/tmpl/files/module.front/common/index.ejs +39 -0
- package/tmpl/files/module.front/common/ncInit.ejs +18 -0
- package/tmpl/files/module.front/common/ws.client.main.ejs +35 -0
- package/tmpl/files/module.front/role/guest.index.ejs +45 -0
- package/tmpl/files/module.front/role/index.ejs +34 -0
- package/tmpl/files/module.server/const.ejs +1 -0
- package/{scaffold/base.js → tmpl/files/module.server/extractor.ejs} +0 -0
- package/tmpl/files/module.server/index.ejs +8 -0
- package/tmpl/files/module.server/layers/controllers/common/crud.ejs +95 -0
- package/tmpl/files/module.server/layers/controllers/common/index.ejs +59 -0
- package/tmpl/files/module.server/layers/controllers/common/validators.ejs +44 -0
- package/tmpl/files/module.server/layers/controllers/common/ws.client.ejs +25 -0
- package/tmpl/files/module.server/layers/controllers/role/crud.ejs +11 -0
- package/tmpl/files/module.server/layers/controllers/role/index.ejs +29 -0
- package/tmpl/files/module.server/layers/fields.ejs +30 -0
- package/tmpl/files/module.server/layers/forms/_data.ejs +35 -0
- package/tmpl/files/module.server/layers/forms/create.ejs +47 -0
- package/tmpl/files/module.server/layers/forms/delete.ejs +8 -0
- package/tmpl/files/module.server/layers/forms/get.ejs +8 -0
- package/tmpl/files/module.server/layers/forms/getRaw.ejs +8 -0
- package/tmpl/files/module.server/layers/forms/listAll.ejs +8 -0
- package/tmpl/files/module.server/layers/forms/listAndCount.ejs +8 -0
- package/tmpl/files/module.server/layers/forms/update.ejs +40 -0
- package/tmpl/files/module.server/layers/forms/validator.ejs +32 -0
- package/tmpl/files/module.server/layers/forms.ejs +49 -0
- package/tmpl/files/module.server/layers/locales.ejs +3 -0
- package/tmpl/files/module.server/layers/logics.ejs +73 -0
- package/tmpl/files/module.server/layers/models.ejs +68 -0
- package/tmpl/files/module.server/layers/routes.ejs +50 -0
- package/tmpl/files/module.server/layers/routes.manifest.ejs +211 -0
- package/tmpl/files/module.server/layers/routes.ws.ejs +29 -0
- package/tmpl/files/module.server/validationEnv.ejs +5 -0
- package/tmpl/files/notComponent.ejs +57 -0
- package/tmpl/files/notService.ejs +39 -0
- package/scaffold/field.js +0 -0
- package/scaffold/form.js +0 -0
- package/scaffold/logic.js +0 -0
- package/scaffold/model.js +0 -0
- package/scaffold/module.js +0 -0
- package/scaffold/route.js +0 -0
package/src/styler.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const DEFAULT_STYLER = () => {
|
|
2
|
+
return {};
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
module.exports = class notStyler {
|
|
6
|
+
#stylers = {};
|
|
7
|
+
#defaultStyler = DEFAULT_STYLER;
|
|
8
|
+
|
|
9
|
+
constructor(defaultStyler = DEFAULT_STYLER) {
|
|
10
|
+
this.setDefault(defaultStyler);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
get(stylerName) {
|
|
14
|
+
if (
|
|
15
|
+
typeof stylerName !== "undefined" &&
|
|
16
|
+
Object.hasOwn(this.#stylers, stylerName)
|
|
17
|
+
) {
|
|
18
|
+
return this.#stylers[stylerName];
|
|
19
|
+
} else {
|
|
20
|
+
return this.#defaultStyler;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
set(stylerName, func) {
|
|
25
|
+
if (typeof stylerName === "string") {
|
|
26
|
+
this.#stylers[stylerName] = func;
|
|
27
|
+
} else {
|
|
28
|
+
throw new Error("Styler name should be a string");
|
|
29
|
+
}
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
setDefault(func) {
|
|
34
|
+
this.#defaultStyler = func;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
resetDefault() {
|
|
39
|
+
this.#defaultStyler = DEFAULT_STYLER;
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
app: {
|
|
3
|
+
content: {
|
|
4
|
+
front: {
|
|
5
|
+
content: "front",
|
|
6
|
+
},
|
|
7
|
+
server: {
|
|
8
|
+
content: "server",
|
|
9
|
+
},
|
|
10
|
+
static: {
|
|
11
|
+
content: "static",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
bin: {
|
|
16
|
+
content: {
|
|
17
|
+
"build.sh": "app/build.sh",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
"project.manifest.json": {
|
|
21
|
+
tmpl: "app/project.manifest.ejs",
|
|
22
|
+
args: ["AppName", "roles", "modules"],
|
|
23
|
+
},
|
|
24
|
+
"package.json": {
|
|
25
|
+
tmpl: "app/package.ejs",
|
|
26
|
+
args: ["AppName", "appName", "AppDescription", "modules"],
|
|
27
|
+
},
|
|
28
|
+
".babelrc": "app/.babelrc",
|
|
29
|
+
".eslintignore": "app/.eslintignore",
|
|
30
|
+
".eslintrc.json": "app/.eslintrc.json",
|
|
31
|
+
".gitignore": "app/.gitignore",
|
|
32
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
build: {},
|
|
3
|
+
src: {},
|
|
4
|
+
"index.!.js": {
|
|
5
|
+
tmpl: "app/front/index.!.ejs",
|
|
6
|
+
args: ["not_node_reporter"],
|
|
7
|
+
},
|
|
8
|
+
"rollup.!.js": {
|
|
9
|
+
tmpl: "app/front/rollup.!.ejs",
|
|
10
|
+
args: [],
|
|
11
|
+
},
|
|
12
|
+
"build.env.js": {
|
|
13
|
+
tmpl: "app/front/build.env.ejs",
|
|
14
|
+
args: [],
|
|
15
|
+
},
|
|
16
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
common: {
|
|
3
|
+
content: {
|
|
4
|
+
"index.js": {
|
|
5
|
+
tmpl: "module.front/common/index.ejs",
|
|
6
|
+
args: ["modules", "AppName"],
|
|
7
|
+
},
|
|
8
|
+
"ncInit.js": {
|
|
9
|
+
tmpl: "module.front/common/ncInit.ejs",
|
|
10
|
+
args: ["modules", "AppName"],
|
|
11
|
+
},
|
|
12
|
+
"ws.client.main.js": {
|
|
13
|
+
tmpl: "module.front/common/ws.client.main.ejs",
|
|
14
|
+
ifModules: ["not-ws"],
|
|
15
|
+
args: ["modules", "AppName"],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
const EMPTY_CONFIG = "app/config/other.ejs";
|
|
2
|
+
export default {
|
|
3
|
+
config: {
|
|
4
|
+
content: {
|
|
5
|
+
"common.json": {
|
|
6
|
+
tmpl: "app/config/common.ejs",
|
|
7
|
+
args: [
|
|
8
|
+
"hostname",
|
|
9
|
+
"port",
|
|
10
|
+
"cors",
|
|
11
|
+
"ssl",
|
|
12
|
+
"secret",
|
|
13
|
+
"session",
|
|
14
|
+
"db",
|
|
15
|
+
"modules",
|
|
16
|
+
"filter",
|
|
17
|
+
"roles",
|
|
18
|
+
"rolesSecondary",
|
|
19
|
+
"user",
|
|
20
|
+
"ws",
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
"development.json": {
|
|
24
|
+
tmpl: EMPTY_CONFIG,
|
|
25
|
+
args: ["hostname"],
|
|
26
|
+
options: {
|
|
27
|
+
ENV: "development",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
"stage.json": {
|
|
31
|
+
tmpl: EMPTY_CONFIG,
|
|
32
|
+
args: ["hostname"],
|
|
33
|
+
options: {
|
|
34
|
+
ENV: "stage",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
"production.json": {
|
|
38
|
+
tmpl: EMPTY_CONFIG,
|
|
39
|
+
args: ["hostname"],
|
|
40
|
+
options: {
|
|
41
|
+
ENV: "production",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
modules: {},
|
|
47
|
+
routes: {
|
|
48
|
+
content: {
|
|
49
|
+
"index.js": {
|
|
50
|
+
tmpl: "app/routes/index.ejs",
|
|
51
|
+
args: ["AppName", "AppDescription", "modules", "roles"],
|
|
52
|
+
},
|
|
53
|
+
"site.js": {
|
|
54
|
+
tmpl: "app/routes/site.ejs",
|
|
55
|
+
args: ["AppName", "AppDescription", "modules", "roles"],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
views: {
|
|
60
|
+
content: {
|
|
61
|
+
admin: {
|
|
62
|
+
content: {
|
|
63
|
+
"foot.pug": {
|
|
64
|
+
tmpl: "app/views/admin/foot.ejs",
|
|
65
|
+
},
|
|
66
|
+
"head.pug": {
|
|
67
|
+
tmpl: "app/views/admin/head.ejs",
|
|
68
|
+
},
|
|
69
|
+
"menu.pug": {
|
|
70
|
+
tmpl: "app/views/admin/menu.ejs",
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
parts: {
|
|
75
|
+
content: {
|
|
76
|
+
"overview.pug": {
|
|
77
|
+
tmpl: "app/views/parts/overview.ejs",
|
|
78
|
+
},
|
|
79
|
+
"menu.pug": {
|
|
80
|
+
tmpl: "app/views/parts/menu.ejs",
|
|
81
|
+
},
|
|
82
|
+
"header.pug": {
|
|
83
|
+
tmpl: "app/views/parts/header.ejs",
|
|
84
|
+
},
|
|
85
|
+
"header.ios.pug": {
|
|
86
|
+
tmpl: "app/views/parts/header.ios.ejs",
|
|
87
|
+
},
|
|
88
|
+
"header.android.pug": {
|
|
89
|
+
tmpl: "app/views/parts/header.android.ejs",
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
"admin.pug": {
|
|
94
|
+
tmpl: "app/views/admin.ejs",
|
|
95
|
+
},
|
|
96
|
+
"dashboard.pug": {
|
|
97
|
+
tmpl: "app/views/dashboard.ejs",
|
|
98
|
+
},
|
|
99
|
+
"index.pug": {
|
|
100
|
+
tmpl: "app/views/index.ejs",
|
|
101
|
+
args: ["hostname"],
|
|
102
|
+
options: {
|
|
103
|
+
ENV: "production",
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
ws: {
|
|
109
|
+
content: {
|
|
110
|
+
"auth.js": {
|
|
111
|
+
tmpl: "app/ws/auth.ejs",
|
|
112
|
+
},
|
|
113
|
+
"index.js": {
|
|
114
|
+
tmpl: "app/ws/index.ejs",
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
ifModules: ["not-ws"],
|
|
118
|
+
},
|
|
119
|
+
"app.js": {
|
|
120
|
+
tmpl: "app/app.ejs",
|
|
121
|
+
args: [],
|
|
122
|
+
},
|
|
123
|
+
"index.js": {
|
|
124
|
+
tmpl: "app/index.ejs",
|
|
125
|
+
args: [],
|
|
126
|
+
},
|
|
127
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"parserOptions": {
|
|
3
|
+
"ecmaVersion": 10,
|
|
4
|
+
"sourceType": "module"
|
|
5
|
+
},
|
|
6
|
+
"env": {
|
|
7
|
+
"browser": true,
|
|
8
|
+
"es6": true,
|
|
9
|
+
"node": true,
|
|
10
|
+
"mongo": true,
|
|
11
|
+
"mocha": true
|
|
12
|
+
},
|
|
13
|
+
"globals": {
|
|
14
|
+
"ENV": true
|
|
15
|
+
},
|
|
16
|
+
"extends": "eslint:recommended",
|
|
17
|
+
"rules": {
|
|
18
|
+
"indent": "error",
|
|
19
|
+
"linebreak-style": ["error", "unix"],
|
|
20
|
+
"semi": ["error", "always"],
|
|
21
|
+
"no-useless-escape": [0]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const notNode = require("not-node");
|
|
2
|
+
|
|
3
|
+
const Init = require("not-node").Init,
|
|
4
|
+
path = require("path"),
|
|
5
|
+
manifest = require("./../../project.manifest.json");
|
|
6
|
+
|
|
7
|
+
module.exports = () => {
|
|
8
|
+
const options = {
|
|
9
|
+
pathToApp: path.join(__dirname),
|
|
10
|
+
pathToNPM: path.join(__dirname, "../../node_modules"),
|
|
11
|
+
routesPath: path.join(__dirname, "./routes"),
|
|
12
|
+
indexRoute: require("./routes/site.js").index,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const additional = {
|
|
16
|
+
pre({ initSequence }) {
|
|
17
|
+
initSequence.remove("InitMonitoring");
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
Init.run({ options, manifest, additional });
|
|
22
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
echo 'building for' $ENV 'environment'
|
|
3
|
+
rm -rf ./app/front/build/${TARGET_ROLE}.min.js
|
|
4
|
+
rm -rf ./app/front/build/${TARGET_ROLE}.js
|
|
5
|
+
rm -rf ./app/front/build/${TARGET_ROLE}.css
|
|
6
|
+
NODE_ENV=$ENV ./node_modules/.bin/eslint ./src/controllers
|
|
7
|
+
NODE_ENV=$ENV ./node_modules/.bin/rollup -c ./rollup/${TARGET_ROLE}.js --environment ENV:$ENV
|
|
8
|
+
NODE_ENV=$ENV ./node_modules/.bin/terser --compress --mangle -- build/${TARGET_ROLE}.js > ./build/${TARGET_ROLE}.min.js
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"port": <%- port %>,
|
|
3
|
+
"host": "<%- hostname.development %>",
|
|
4
|
+
"cors": [<%- cors.map(entry => `"${entry}"`).join(',') %>],
|
|
5
|
+
"template": {
|
|
6
|
+
"engine": "pug",
|
|
7
|
+
"views": "views",
|
|
8
|
+
"partialsDir": "partials",
|
|
9
|
+
"partials": {}
|
|
10
|
+
},
|
|
11
|
+
<% if (db) { %>
|
|
12
|
+
"db": {
|
|
13
|
+
<% if (db.mongoose) {%>
|
|
14
|
+
"mongoose": {
|
|
15
|
+
"uri": "mongodb://<%- db.mongoose.hostname %>/<%- db.mongoose.db %>?authSource=<%- db.mongoose.authSource %>",
|
|
16
|
+
"options": {
|
|
17
|
+
"useNewUrlParser": true,
|
|
18
|
+
"useUnifiedTopology": true,
|
|
19
|
+
"db": "<%- db.mongoose.db %>",
|
|
20
|
+
"host": "<%- db.mongoose.hostname %>",
|
|
21
|
+
"user": "<%- db.mongoose.user %>",
|
|
22
|
+
"pass": "<%- db.mongoose.pass %>",
|
|
23
|
+
"autoIndex": false
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
<% } %>
|
|
27
|
+
<% if (db.redis) { %>
|
|
28
|
+
"redis": {},
|
|
29
|
+
<% } %>
|
|
30
|
+
<% if (db.ioredis) { %>
|
|
31
|
+
"ioredis": {
|
|
32
|
+
"enableOfflineQueue": false
|
|
33
|
+
}
|
|
34
|
+
<% } %>
|
|
35
|
+
},
|
|
36
|
+
<% } %>
|
|
37
|
+
<% if (session){ %>
|
|
38
|
+
"session": {
|
|
39
|
+
"driver": "<%- session.driver %>",
|
|
40
|
+
"secret": "<%- session.secret %>",
|
|
41
|
+
"cookie": {
|
|
42
|
+
"maxAge": <%- session.ttl %>
|
|
43
|
+
},
|
|
44
|
+
"key": "<%- session.key %>"
|
|
45
|
+
},
|
|
46
|
+
<% } %>
|
|
47
|
+
<% if (ssl) { %>
|
|
48
|
+
"ssl": {
|
|
49
|
+
"enabled": true,
|
|
50
|
+
"keys": {
|
|
51
|
+
"private": "<%- ssl.private %>",
|
|
52
|
+
"fullchain": "<%- ssl.fullchain %>",
|
|
53
|
+
"chain": "<%- ssl.chain %>"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
<% } %>
|
|
57
|
+
"path": {
|
|
58
|
+
"static": "../static",
|
|
59
|
+
"app": "/client",
|
|
60
|
+
"dbDumps": "../../../db.dumps",
|
|
61
|
+
"front": "../front/build",
|
|
62
|
+
"ws": "./ws"
|
|
63
|
+
},
|
|
64
|
+
"defaultUserRole": "user",
|
|
65
|
+
"modules": {
|
|
66
|
+
<% if (modules.includes('not-ws') && ws) { %>
|
|
67
|
+
"ws": {
|
|
68
|
+
"servers": {
|
|
69
|
+
"main": {
|
|
70
|
+
"connection": {
|
|
71
|
+
"port": <%- ws.port %>,
|
|
72
|
+
"secure": <%= ws.secure %>,
|
|
73
|
+
"secret": "<%- secret %>"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
<% } %>
|
|
79
|
+
<% if (modules.includes('not-user') && user){ %>
|
|
80
|
+
"user": {
|
|
81
|
+
"errors":{
|
|
82
|
+
"noUserData": false,
|
|
83
|
+
"noUserWithId": false
|
|
84
|
+
},
|
|
85
|
+
"debug":{
|
|
86
|
+
"loaded": false
|
|
87
|
+
},
|
|
88
|
+
"tokenTTL": <%= user.tokenTTL %>,
|
|
89
|
+
"secret": "<%- secret %>",
|
|
90
|
+
"roles": {
|
|
91
|
+
"primary": [<%- roles.map(entry => `"${entry}"`).join(",") %>],
|
|
92
|
+
"secondary": [<%- rolesSecondary.map(entry => `"${entry}"`).join(",") %>]
|
|
93
|
+
},
|
|
94
|
+
"restrict": {
|
|
95
|
+
"registration": <%= user?.restrict?.registration ?? false %>
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
<% } %>
|
|
99
|
+
<% if (modules.includes('not-filter') && filter){ %>
|
|
100
|
+
"filter": {
|
|
101
|
+
"size": <%= filter?.size ?? 15 %>,
|
|
102
|
+
"default": {
|
|
103
|
+
"filter": {},
|
|
104
|
+
"sorter": {
|
|
105
|
+
"_id": 1
|
|
106
|
+
},
|
|
107
|
+
"pager": {
|
|
108
|
+
"size": <%= filter?.pager?.size ?? 15 %>,
|
|
109
|
+
"skip": 0,
|
|
110
|
+
"page": 0
|
|
111
|
+
},
|
|
112
|
+
"search": ""
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
<% } %>
|
|
116
|
+
<% if (modules.includes('not-filter')){ %>
|
|
117
|
+
"rateLimiter": {
|
|
118
|
+
"keyPrefix": "rateLimiterMiddleware",
|
|
119
|
+
"points": 500,
|
|
120
|
+
"duration": 1
|
|
121
|
+
}
|
|
122
|
+
<% } %>
|
|
123
|
+
},
|
|
124
|
+
"middleware": {
|
|
125
|
+
<%- modules.map(entry => `"${entry}": {}`).join(',') %>
|
|
126
|
+
},
|
|
127
|
+
"importModulesFromNPM": [
|
|
128
|
+
<%- modules.map(entry => `"${entry}"`).join(',') %>
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hostname":"<%- hostname[__options__.ENV] %>",
|
|
3
|
+
"CSP": {
|
|
4
|
+
"connect": [
|
|
5
|
+
"'self'",
|
|
6
|
+
"*",
|
|
7
|
+
"wss:",
|
|
8
|
+
"https:",
|
|
9
|
+
"'unsafe-inline'"
|
|
10
|
+
],
|
|
11
|
+
"default": [
|
|
12
|
+
"'self'",
|
|
13
|
+
"*",
|
|
14
|
+
"wss:",
|
|
15
|
+
"https:",
|
|
16
|
+
"'unsafe-inline'"
|
|
17
|
+
],
|
|
18
|
+
"img": [
|
|
19
|
+
"'self'",
|
|
20
|
+
"data:"
|
|
21
|
+
],
|
|
22
|
+
"script": [
|
|
23
|
+
"'self'",
|
|
24
|
+
"'unsafe-eval'",
|
|
25
|
+
"'unsafe-inline'"
|
|
26
|
+
],
|
|
27
|
+
"style": [
|
|
28
|
+
"'self'",
|
|
29
|
+
"'unsafe-inline'",
|
|
30
|
+
"'unsafe-eval'"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"apps": [{
|
|
3
|
+
"name": "<%- AppName %>",
|
|
4
|
+
"script": "./<%- AppDirName %>/app/server/index.js",
|
|
5
|
+
"node_args": [
|
|
6
|
+
<% nodeArgs.forEach(function(nodeArg, index){ %>
|
|
7
|
+
"<%- nodeArg %>"<%- (nodeArgs.length - 1 > index)?',':'' %>
|
|
8
|
+
<% }); %>
|
|
9
|
+
],
|
|
10
|
+
"watch": <%- watch?'true':'false' %>,
|
|
11
|
+
"ignore_watch": [
|
|
12
|
+
<% ignoreWatchList.forEach(function(ignorePath, index){ %>
|
|
13
|
+
"<%- ignorePath %>"<%- (ignoreWatchList.length - 1 > index)?',':'' %>
|
|
14
|
+
<% }); %>
|
|
15
|
+
],
|
|
16
|
+
"exec_mode": "fork",
|
|
17
|
+
"env": {
|
|
18
|
+
<% envs.forEach(function(env, index){ %>
|
|
19
|
+
"<%- env.name %>": "<%- env.value %>"<%- (envs.length - 1 > index)?',':'' %>
|
|
20
|
+
<% }); %>
|
|
21
|
+
}
|
|
22
|
+
}]
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<% if (not_node_reporter) %{ %>
|
|
2
|
+
NOT_NODE_ERROR_KEY=<%- not_node_reporter.key %>
|
|
3
|
+
NOT_NODE_ERROR_URL_NODE=<%- not_node_reporter.url_node %>
|
|
4
|
+
NOT_NODE_ERROR_URL_BROWSER=<%- not_node_reporter.url_browser %>
|
|
5
|
+
<% } %>
|
|
6
|
+
<% if (not_node_monitor) %{ %>
|
|
7
|
+
NOT_NODE_MONITOR_INTERVAL=<%- not_node_monitor.interval %>
|
|
8
|
+
NOT_NODE_MONITOR_REPORT_INTERVAL=<%- not_node_monitor.report_interval %>
|
|
9
|
+
NOT_NODE_MONITOR_REPORT_KEY=<%- not_node_monitor.report_key %>
|
|
10
|
+
NOT_NODE_MONITOR_REPORT_URL=<%- not_node_monitor.report_url %>
|
|
11
|
+
<% } %>
|
|
12
|
+
<% if (init_root_user) %{ %>
|
|
13
|
+
INIT_ROOT_USERNAME=<%- init_root_user.name %>
|
|
14
|
+
INIT_ROOT_EMAIL=<%- init_root_user.email %>
|
|
15
|
+
INIT_ROOT_PASSWORD=<%- init_root_user.password %>
|
|
16
|
+
<% } %>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<% if (not_node_reporter) { %>
|
|
2
|
+
window.NOT_NODE_ERROR_URL_BROWSER = '<%- not_node_reporter.url_browser %>';
|
|
3
|
+
<% } %>
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Frame
|
|
7
|
+
} from 'not-bulma';
|
|
8
|
+
|
|
9
|
+
const {notCommon, notApp, COMPONENTS} = Frame;
|
|
10
|
+
|
|
11
|
+
notCommon.register('backlog', true);
|
|
12
|
+
window.dumpBacklog = notCommon.dumpBacklog.bind(notCommon);
|
|
13
|
+
|
|
14
|
+
let appDefaultOptions = {
|
|
15
|
+
manifestURL: '/api/manifest',
|
|
16
|
+
router: {
|
|
17
|
+
root: '/',
|
|
18
|
+
manifest: [],
|
|
19
|
+
index: ''
|
|
20
|
+
},
|
|
21
|
+
language: 'ru',
|
|
22
|
+
crud: {
|
|
23
|
+
navigateBackAfter: ['create', 'update', 'delete']
|
|
24
|
+
},
|
|
25
|
+
modules: {
|
|
26
|
+
user: {
|
|
27
|
+
redirectTimout: 1000,
|
|
28
|
+
afterLoginURL: '/dashboard',
|
|
29
|
+
loginForm: {
|
|
30
|
+
modes: [
|
|
31
|
+
'login',
|
|
32
|
+
'requestLoginCodeOnEmail',
|
|
33
|
+
'loginByCode'
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
loginFormContainerSelector: '.main-container',
|
|
37
|
+
restoreFormContainerSelector: '.main-container',
|
|
38
|
+
registerFormContainerSelector: '.main-container'
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
let services = {}, uis = {}, wsc = {}, fields = {};
|
|
44
|
+
|
|
45
|
+
<%% for(var i = 0; i < mods.length; i++) { %%>
|
|
46
|
+
import * as mod_<%%= i %%>
|
|
47
|
+
from '<%%= mods[i] %%>';
|
|
48
|
+
appDefaultOptions = notCommon.absorbModule({
|
|
49
|
+
defaultConf: appDefaultOptions,
|
|
50
|
+
mod: mod_<%%= i %%>,
|
|
51
|
+
services, uis, wsc, fields
|
|
52
|
+
});
|
|
53
|
+
<%% } %%>
|
|
54
|
+
|
|
55
|
+
COMPONENTS.import(uis);
|
|
56
|
+
|
|
57
|
+
import 'bulma';
|
|
58
|
+
|
|
59
|
+
<%% for(var i = 0; i < scss.length; i++) { %%>
|
|
60
|
+
import '<%%= scss[i] %%>';
|
|
61
|
+
<%% } %%>
|
|
62
|
+
|
|
63
|
+
appDefaultOptions.services = services;
|
|
64
|
+
appDefaultOptions.wsc = wsc;
|
|
65
|
+
|
|
66
|
+
notCommon.startApp(() => new notApp(appDefaultOptions));
|