not-node 5.0.1 → 5.0.4

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.
@@ -0,0 +1,16 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <code_scheme name="Project" version="173">
3
+ <JSCodeStyleSettings version="0">
4
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
5
+ </JSCodeStyleSettings>
6
+ <codeStyleSettings language="JavaScript">
7
+ <option name="INDENT_CASE_FROM_SWITCH" value="false" />
8
+ <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
9
+ <option name="ALIGN_MULTILINE_FOR" value="false" />
10
+ <indentOptions>
11
+ <option name="INDENT_SIZE" value="2" />
12
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
13
+ </indentOptions>
14
+ </codeStyleSettings>
15
+ </code_scheme>
16
+ </component>
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
+ </profile>
6
+ </component>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/project.iml" filepath="$PROJECT_DIR$/.idea/project.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+ </content>
9
+ <orderEntry type="inheritedJdk" />
10
+ <orderEntry type="sourceFolder" forTests="false" />
11
+ </component>
12
+ </module>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <list default="true" id="74929b6a-6f9b-4d33-bcd5-317dea0a2db1" name="Changes" comment="" />
5
+ <option name="SHOW_DIALOG" value="false" />
6
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
7
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
8
+ <option name="LAST_RESOLUTION" value="IGNORE" />
9
+ </component>
10
+ <component name="Git.Settings">
11
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
12
+ </component>
13
+ <component name="ProjectId" id="22q8JXHHJZy9UWkJAROmOSSPtVz" />
14
+ <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
15
+ <component name="PropertiesComponent">
16
+ <property name="node.js.detected.package.eslint" value="true" />
17
+ <property name="node.js.selected.package.eslint" value="(autodetect)" />
18
+ <property name="vue.rearranger.settings.migration" value="true" />
19
+ </component>
20
+ <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
21
+ <component name="TypeScriptGeneratedFilesManager">
22
+ <option name="version" value="3" />
23
+ </component>
24
+ </project>
@@ -31,7 +31,8 @@ let opts = {
31
31
  'to': argv.to || false,
32
32
  'config': argv.config || './project.manifest.json',
33
33
  'rollup': argv.rollup || path.join(process.cwd(),'./node_modules/.bin/rollup'),
34
- 'role': argv.role || null
34
+ 'role': argv.role || null,
35
+ 'verbose': argv.verbose || false
35
36
  },
36
37
  configName = path.join(process.cwd(), opts.config),
37
38
  config = {};
@@ -258,7 +259,7 @@ async function loadNPMModule(){
258
259
  list.push(...commons);
259
260
  result[role].templates.push(...list);
260
261
  }
261
- console.log('result', result);
262
+ opts.verbose && console.log('result', result);
262
263
  }else{
263
264
  console.info('...no templates');
264
265
  }
@@ -275,7 +276,7 @@ async function loadNPMModule(){
275
276
  list.push(...commons);
276
277
  result[role].styles.push(...list);
277
278
  }
278
- console.log('result', result);
279
+ opts.verbose && console.log('result', result);
279
280
  }else{
280
281
  console.info('...no styles');
281
282
  }
@@ -491,7 +492,7 @@ async function build_Server(pathToRoot, roles, targetName, targetManifest){
491
492
  }else{
492
493
  console.info('no modules in manifest');
493
494
  }
494
- console.log('List:', list);
495
+ opts.verbose && console.log('List:', list);
495
496
  ////forming index.js and rollup.js
496
497
  for(let i = 0; i < roles.length; i++){
497
498
  const role = roles[i];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-node",
3
- "version": "5.0.1",
3
+ "version": "5.0.4",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -33,37 +33,37 @@
33
33
  "url": "https://github.com/interrupter/not-node/issues"
34
34
  },
35
35
  "dependencies": {
36
- "body-parser": "^1.19.1",
36
+ "body-parser": "^1.20.0",
37
37
  "compression": "^1.7.4",
38
38
  "connect-mongodb-session": "^3.1.1",
39
- "connect-redis": "^6.0.0",
39
+ "connect-redis": "^6.1.3",
40
40
  "cors": "^2.8.5",
41
41
  "deep-diff": "*",
42
42
  "deepmerge": "^4.2.2",
43
43
  "ejs": "^3.1.6",
44
44
  "escape-string-regexp": "*",
45
- "express": "^4.17.2",
46
- "express-fileupload": "^1.2.1",
45
+ "express": "^4.17.3",
46
+ "express-fileupload": "^1.3.1",
47
47
  "express-session": "^1.17.2",
48
48
  "fs-extra": "*",
49
- "helmet": "^4.6.0",
49
+ "helmet": "^5.0.2",
50
50
  "lower-case": "*",
51
51
  "method-override": "^3.0.0",
52
52
  "mock-require": "^3.0.3",
53
53
  "mongoose": "*",
54
54
  "mongoose-validator": "*",
55
55
  "nconf": "*",
56
- "not-config": "^0.1.4",
57
- "not-error": "^0.2.1",
56
+ "not-config": "^0.1.5",
57
+ "not-error": "^0.2.5",
58
58
  "not-filter": "*",
59
- "not-inform": "^0.0.27",
59
+ "not-inform": "^0.0.28",
60
60
  "not-locale": "*",
61
61
  "not-log": "^0.0.20",
62
62
  "not-monitor": "^0.0.13",
63
63
  "not-path": "*",
64
- "not-validation": "^0.0.1",
64
+ "not-validation": "^0.0.7",
65
65
  "rate-limiter-flexible": "^2.3.6",
66
- "redis": "^4.0.1",
66
+ "redis": "^4.0.6",
67
67
  "rfdc": "^1.3.0",
68
68
  "rmdir": "^1.2.0",
69
69
  "serve-static": "*",
@@ -75,18 +75,18 @@
75
75
  "babel-eslint": "^10.1.0",
76
76
  "chai": "*",
77
77
  "chai-as-promised": "*",
78
- "eslint": "^8.4.1",
78
+ "eslint": "^8.12.0",
79
79
  "eslint-plugin-node": "^11.1.0",
80
- "eslint-plugin-sonarjs": "^0.11.0",
80
+ "eslint-plugin-sonarjs": "^0.13.0",
81
81
  "ink-docstrap": "^1.3.2",
82
- "ioredis": "^4.28.2",
83
- "jsdoc": "^3.6.7",
82
+ "ioredis": "^5.0.3",
83
+ "jsdoc": "^3.6.10",
84
84
  "mocha": "*",
85
85
  "mocha-suppress-logs": "^0.3.1",
86
- "mongodb-memory-server": "^8.0.4",
86
+ "mongodb-memory-server": "^8.4.2",
87
87
  "npm-run-all": "^4.1.5",
88
88
  "nyc": "^15.1.0",
89
- "retire": "^3.0.3"
89
+ "retire": "^3.0.6"
90
90
  },
91
91
  "homepage": "https://github.com/interrupter/not-node#readme",
92
92
  "nyc": {
package/src/common.js CHANGED
@@ -80,7 +80,11 @@ module.exports.getTodayDate = () => {
80
80
  * @param {string} name field name
81
81
  * @return {boolean} if object contains field with name
82
82
  **/
83
- const objHas = (obj, name) => Object.prototype.hasOwnProperty.call(obj, name);
83
+ const objHas = (obj, name) => {
84
+ if(typeof obj === 'undefined') return false;
85
+ if(obj === null) return false;
86
+ return Object.prototype.hasOwnProperty.call(obj, name);
87
+ };
84
88
  module.exports.objHas = objHas;
85
89
 
86
90
 
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ ui: {
3
+ component: 'UIEmail',
4
+ placeholder: 'not-node:field_email_placeholder',
5
+ label: 'not-node:field_email_label'
6
+ },
7
+ model: {
8
+ type: String,
9
+ required: true
10
+ }
11
+ };
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ ui: {
3
+ component: 'UITelephone',
4
+ placeholder: 'not-node:field_telephone_placeholder',
5
+ label: 'not-node:field_telephone_label'
6
+ },
7
+ model: {
8
+ type: String,
9
+ required: true
10
+ }
11
+ };
@@ -0,0 +1,4 @@
1
+ module.exports = [{
2
+ validator: 'isEmail',
3
+ message: 'not-node:email_is_not_valid'
4
+ }];
@@ -22,6 +22,12 @@
22
22
  "field_size_label": "Size",
23
23
  "field_size_placeholder": "Size",
24
24
 
25
+ "field_email_label": "Email",
26
+ "field_email_placeholder": "email@server.com",
27
+
28
+ "field_telephone_label": "Tel.",
29
+ "field_telephone_placeholder": "+1 (111) 111-11-11",
30
+
25
31
  "field_ID_label": "ID",
26
32
  "field_ID_placeholder": "ID",
27
33
 
@@ -22,6 +22,12 @@
22
22
  "field_size_label": "Size",
23
23
  "field_size_placeholder": "Size",
24
24
 
25
+ "field_email_label": "Email",
26
+ "field_email_placeholder": "email@server.ru",
27
+
28
+ "field_telephone_label": "Тел.",
29
+ "field_telephone_placeholder": "+7 (111) 111-11-11",
30
+
25
31
  "field_ID_label": "ID",
26
32
  "field_ID_placeholder": "ID",
27
33
 
@@ -124,14 +124,14 @@ module.exports.initManifestFields = (
124
124
  rawKeys
125
125
  .filter((key) => !privateFields.includes(key))
126
126
  .forEach((key) => {
127
- let mutation = getMutationForField(key, mutationsList);
128
- if (mutation) {
129
- list.push(mutation);
130
- mutationsList.splice(mutationsList.indexOf(mutation), 1);
131
- } else {
132
- list.push(key);
133
- }
134
- });
127
+ let mutation = getMutationForField(key, mutationsList);
128
+ if (mutation) {
129
+ list.push(mutation);
130
+ mutationsList.splice(mutationsList.indexOf(mutation), 1);
131
+ } else {
132
+ list.push(key);
133
+ }
134
+ });
135
135
  list.push(...mutationsList);
136
136
  return module.exports.createSchemaFromFields(app, list, 'ui', moduleName);
137
137
  }else{
package/src/form/form.js CHANGED
@@ -170,7 +170,7 @@ class Form {
170
170
  }
171
171
 
172
172
  #augmentValidationSchema(app){
173
- ValidationBuilder(this.#SCHEMA, this.getValidatorEnvGetter());
173
+ this.#SCHEMA = ValidationBuilder(this.#SCHEMA, this.getValidatorEnvGetter());
174
174
  }
175
175
 
176
176
 
package/src/init/index.js CHANGED
@@ -127,7 +127,7 @@ class Init {
127
127
  additional
128
128
  }) {
129
129
  try {
130
- log.info('Kick start app...'+ os.platform()+os.arch());
130
+ log.info('Kick start app...'+ os.platform()+' '+os.arch());
131
131
  ADDS.init(additional);
132
132
  const initSequence = new InitSequence(STANDART_INIT_SEQUENCE);
133
133
  await ADDS.run('pre', {
@@ -153,7 +153,8 @@ class Init {
153
153
  await ADDS.run('post', {
154
154
  config,
155
155
  options,
156
- manifest
156
+ manifest,
157
+ master: Init
157
158
  });
158
159
  log.info('Application initalization finished');
159
160
  } catch (e) {
@@ -59,7 +59,7 @@ class notModule {
59
59
  };
60
60
  this.fieldsImportRules = (objHas(options, 'fields') && options.fields) ? options.fields : {};
61
61
 
62
- // log.info(`Creating module: ${this.getName()}`);
62
+ // log.info(`Creating module: ${this.getName()}`);
63
63
  this.init();
64
64
  return this;
65
65
  }