not-node 5.0.4 → 5.0.7
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/bin/not-builder.js +11 -11
- package/package.json +1 -1
- package/src/model/buildValidator.js +10 -4
package/bin/not-builder.js
CHANGED
|
@@ -172,7 +172,7 @@ async function loadTemplatesForFront(dir, role, commonDir = COMMON_TEMPLATES, te
|
|
|
172
172
|
try{
|
|
173
173
|
listDirs = await listDir(dir);
|
|
174
174
|
}catch(e){
|
|
175
|
-
console.
|
|
175
|
+
console.error(e);
|
|
176
176
|
}
|
|
177
177
|
//console.log('listDirs:', listDirs);
|
|
178
178
|
try{
|
|
@@ -204,7 +204,7 @@ async function loadTemplatesForFront(dir, role, commonDir = COMMON_TEMPLATES, te
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
}else{
|
|
207
|
-
console.
|
|
207
|
+
console.error('Directory is not exists: ',roleDir);
|
|
208
208
|
}
|
|
209
209
|
return result;
|
|
210
210
|
}
|
|
@@ -261,7 +261,7 @@ async function loadNPMModule(){
|
|
|
261
261
|
}
|
|
262
262
|
opts.verbose && console.log('result', result);
|
|
263
263
|
}else{
|
|
264
|
-
console.info('...no templates');
|
|
264
|
+
opts.verbose && console.info('...no templates');
|
|
265
265
|
}
|
|
266
266
|
if(mod.paths.styles){
|
|
267
267
|
let commons;
|
|
@@ -278,13 +278,13 @@ async function loadNPMModule(){
|
|
|
278
278
|
}
|
|
279
279
|
opts.verbose && console.log('result', result);
|
|
280
280
|
}else{
|
|
281
|
-
console.info('...no styles');
|
|
281
|
+
opts.verbose && console.info('...no styles');
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
}catch(e){
|
|
285
285
|
console.error(e);
|
|
286
286
|
}
|
|
287
|
-
console.log('npm module content ',result);
|
|
287
|
+
opts.verbose && console.log('npm module content ',result);
|
|
288
288
|
return result;
|
|
289
289
|
}
|
|
290
290
|
|
|
@@ -314,7 +314,7 @@ async function loadServerModule(){
|
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
}else{
|
|
317
|
-
console.info('...no controllers');
|
|
317
|
+
opts.verbose && console.info('...no controllers');
|
|
318
318
|
}
|
|
319
319
|
if(mod.paths.templates){
|
|
320
320
|
let commons;
|
|
@@ -339,7 +339,7 @@ async function loadServerModule(){
|
|
|
339
339
|
|
|
340
340
|
}
|
|
341
341
|
}else{
|
|
342
|
-
console.info('...no templates');
|
|
342
|
+
opts.verbose && console.info('...no templates');
|
|
343
343
|
}
|
|
344
344
|
if(mod.paths.styles){
|
|
345
345
|
let commons;
|
|
@@ -364,7 +364,7 @@ async function loadServerModule(){
|
|
|
364
364
|
|
|
365
365
|
}
|
|
366
366
|
}else{
|
|
367
|
-
console.info('...no styles');
|
|
367
|
+
opts.verbose && console.info('...no styles');
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
}catch(e){
|
|
@@ -503,8 +503,8 @@ async function build_Server(pathToRoot, roles, targetName, targetManifest){
|
|
|
503
503
|
let indexFile = path.join(pathToRoot, targetManifest.src, 'index.' + role + '.js');
|
|
504
504
|
let rollupFile = path.join(pathToRoot, targetManifest.root, 'rollup.' + role + '.js');
|
|
505
505
|
let bundleFile = path.join(pathToRoot, targetManifest.build, role + '.js');
|
|
506
|
-
let templateFile = path.join(pathToRoot, targetManifest.build, role + '.html');
|
|
507
|
-
await lib.renderScript(path.join(pathToRoot,targetManifest.index), {
|
|
506
|
+
//let templateFile = path.join(pathToRoot, targetManifest.build, role + '.html');
|
|
507
|
+
await lib.renderScript(path.join(pathToRoot, targetManifest.index), {
|
|
508
508
|
mods:list[role].controllers,
|
|
509
509
|
scss: list[role].styles,
|
|
510
510
|
env: opts.environment,
|
|
@@ -522,7 +522,7 @@ async function build_Server(pathToRoot, roles, targetName, targetManifest){
|
|
|
522
522
|
NODE_ENV: opts.environment
|
|
523
523
|
}
|
|
524
524
|
});
|
|
525
|
-
await lib.joinToFile(templateFile, list[role].templates);
|
|
525
|
+
//await lib.joinToFile(templateFile, list[role].templates);
|
|
526
526
|
}catch(e){
|
|
527
527
|
console.error(e);
|
|
528
528
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @module Model/Validator */
|
|
2
2
|
const validate = require('mongoose-validator');
|
|
3
|
-
const {objHas, executeObjectFunction, isFunc} = require('../common');
|
|
3
|
+
const {objHas, executeObjectFunction, isFunc, isAsync} = require('../common');
|
|
4
4
|
|
|
5
5
|
function extractValidationEnvGetter(options){
|
|
6
6
|
if(options && objHas(options, 'getValidationEnv') && isFunc(options.getValidationEnv)){
|
|
@@ -23,9 +23,15 @@ function extendModern(rule, options){
|
|
|
23
23
|
const result = {...rule};
|
|
24
24
|
delete result.validator;
|
|
25
25
|
const validationEnv = extractValidationEnvGetter(options)();
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
if(isAsync(rule.validator)){
|
|
27
|
+
result.validator = async (val) => {
|
|
28
|
+
return await executeObjectFunction(rule, 'validator', [val, validationEnv]);
|
|
29
|
+
};
|
|
30
|
+
}else{
|
|
31
|
+
result.validator = (val) => {
|
|
32
|
+
return executeObjectFunction(rule, 'validator', [val, validationEnv]);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
29
35
|
return result;
|
|
30
36
|
}
|
|
31
37
|
|