not-node 6.5.27 → 6.5.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-node",
3
- "version": "6.5.27",
3
+ "version": "6.5.29",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -5,6 +5,8 @@ const logger = require("not-log");
5
5
  const log = logger(module, "not-node//init//app");
6
6
  const { notErrorReporter } = require("not-error/src/index.cjs");
7
7
 
8
+ const notAppPostponedFieldsRegistrator = require("../../manifest/registrator/fields.postponed.js");
9
+
8
10
  const CONST_CORE_PATH = path.join(__dirname, "../../core");
9
11
 
10
12
  module.exports = class InitApp {
@@ -57,7 +59,7 @@ module.exports = class InitApp {
57
59
  });
58
60
  master.getApp().logger = logger(module, "notApplication");
59
61
  } catch (e) {
60
- log.error(e);
62
+ log?.error(e);
61
63
  }
62
64
  }
63
65
 
@@ -70,9 +72,20 @@ module.exports = class InitApp {
70
72
  await InitApp.initCore({ config, options, master, emit });
71
73
  await InitApp.importModules({ config, options, master, emit });
72
74
  await InitApp.createReporter({ config, master });
75
+ this.printReportByPostponedFieldsRegistrator();
73
76
  await emit("app.post", { config, options, master });
74
77
  } catch (e) {
75
- master.throwError(e.message, 1);
78
+ log?.error(e);
79
+ }
80
+ }
81
+
82
+ printReportByPostponedFieldsRegistrator() {
83
+ const report = notAppPostponedFieldsRegistrator.state();
84
+ if (Object.keys(report.unresolved).length) {
85
+ log?.error(report.unresolved);
86
+ }
87
+ if (report.insecure.length) {
88
+ log?.error(`List of insecure fields (${report.insecure.length}): `, report.insecure.join(', '));
76
89
  }
77
90
  }
78
91
  };
@@ -24,7 +24,7 @@ module.exports = class BatchRunner {
24
24
  * Searching for content of module and registering it.
25
25
  * @static
26
26
  * @param {Object} input
27
- * @param {notModule} input.nModule
27
+ * @param {import('./module')} input.nModule
28
28
  * @return {boolean} true - executed, false - no paths
29
29
  **/
30
30
  exec({ nModule }) {
@@ -32,7 +32,7 @@ module.exports = class BatchRunner {
32
32
  return false;
33
33
  }
34
34
  //starting from simpliest forms and moving upwards
35
- this.#processors.forEach((processor) => new processor({ nModule }));
35
+ this.#processors.forEach((processor) => processor.run({ nModule }));
36
36
  return true;
37
37
  }
38
38
  };
@@ -4,11 +4,8 @@ const { error } = require("not-log")(module, "initializator");
4
4
  module.exports = class notModuleInitializatorForms {
5
5
  static openFile = require;
6
6
 
7
- constructor({ nModule }) {
8
- this.run({ nModule, app: nModule.getApp() });
9
- }
10
-
11
- run({ app, nModule }) {
7
+ static run({ nModule }) {
8
+ const app = nModule.getApp();
12
9
  const moduleName = nModule.getName();
13
10
  for (let formName in nModule.getFormsConstructors()) {
14
11
  try {
@@ -9,11 +9,8 @@ const extractPrivateFields = (mod) =>
9
9
 
10
10
  module.exports = class notModuleInitializatorManifests {
11
11
  static openFile = require;
12
- constructor({ nModule }) {
13
- this.run({ nModule });
14
- }
15
12
 
16
- run({ nModule }) {
13
+ static run({ nModule }) {
17
14
  const moduleName = nModule.getName();
18
15
  for (let routeName in nModule.getRoutesManifests()) {
19
16
  try {
@@ -5,11 +5,9 @@ const { notError } = require("not-error");
5
5
 
6
6
  module.exports = class notModuleInitializatorModels {
7
7
  static openFile = require;
8
- constructor({ nModule }) {
9
- this.run({ nModule, app: nModule.getApp() });
10
- }
11
8
 
12
- run({ app, nModule }) {
9
+ static run({ nModule }) {
10
+ const app = nModule.getApp();
13
11
  const moduleName = nModule.getName();
14
12
  for (let modelName in nModule.getModels()) {
15
13
  try {
@@ -8,8 +8,8 @@ const notManifestFilter = require("./manifest.filter.js");
8
8
  /**
9
9
  * API manifest
10
10
  * @class
11
- * @param {object} app express application instance
12
- * @param {object} notApp notApplication instance
11
+ * @param {import('express').Application} app express application instance
12
+ * @param {import('../app.js')} notApp notApplication instance
13
13
  * @param {string} moduleName name of owner module
14
14
  **/
15
15
  class notManifest {
@@ -80,8 +80,7 @@ class notManifest {
80
80
 
81
81
  /**
82
82
  * Check if manifest file has url and actions, so we could register routes
83
- * @param {object} moduleManifest library of .manifest.js files
84
- * @param {string} routeName name of
83
+ * @param {object} route library of .manifest.js files
85
84
  **/
86
85
  registerRoute(route) {
87
86
  if (!this.routeHasRoutes(route)) {
@@ -3,15 +3,18 @@ const fs = require("fs");
3
3
  const { tryFile, objHas } = require("../../common");
4
4
  const Fields = require("../../fields");
5
5
  const { log } = require("not-log")(module, "register//fields");
6
+ const notAppPostponedFieldsRegistrator = require("./fields.postponed");
7
+
6
8
  module.exports = class notModuleRegistratorFields {
7
9
  static openFile = require;
8
10
  static fieldsManager = Fields;
9
11
 
10
- constructor({ nModule }) {
11
- this.run({ nModule });
12
+ static reopenCached(pathToModule) {
13
+ delete this.openFile.cache[this.openFile.resolve(pathToModule)];
14
+ return this.openFile(pathToModule);
12
15
  }
13
16
 
14
- run({ nModule }) {
17
+ static run({ nModule }) {
15
18
  const srcDir = notModuleRegistratorFields.getPath(nModule);
16
19
  if (!srcDir) {
17
20
  return false;
@@ -27,7 +30,7 @@ module.exports = class notModuleRegistratorFields {
27
30
  return nModule.module.paths.fields;
28
31
  }
29
32
 
30
- registerFields({ nModule, lib, fromPath }) {
33
+ static registerFields({ nModule, lib, fromPath }) {
31
34
  for (let t in lib) {
32
35
  this.registerField({
33
36
  nModule,
@@ -38,18 +41,75 @@ module.exports = class notModuleRegistratorFields {
38
41
  }
39
42
  }
40
43
 
41
- registerField({ nModule, name, field, fromPath }) {
44
+ /**
45
+ *
46
+ *
47
+ * @param {object} param { nModule, name, field, fromPath }
48
+ * @param {import('../module')} param.nModule
49
+ * @param {string} param.name
50
+ * @param {object} param.field
51
+ * @param {string} param.fromPath
52
+ */
53
+ static registerField({ nModule, name, field, fromPath }) {
54
+ const MODULE_NAME = nModule.getName();
55
+ if (
56
+ notAppPostponedFieldsRegistrator.fieldShouldBePostponed(
57
+ field,
58
+ nModule
59
+ )
60
+ ) {
61
+ notAppPostponedFieldsRegistrator.add(
62
+ field.parent,
63
+ MODULE_NAME,
64
+ fromPath
65
+ );
66
+ return;
67
+ } else if (field.parent) {
68
+ const parentFieldValue =
69
+ notAppPostponedFieldsRegistrator.findParentField(
70
+ field.parent,
71
+ nModule
72
+ );
73
+ if (parentFieldValue) {
74
+ field = Fields.mutateField(parentFieldValue, field);
75
+ }
76
+ }
42
77
  const fieldValidatorsCount = this.extendByFrontValidators({
43
78
  name,
44
79
  field,
45
80
  fromPath: path.dirname(fromPath),
46
81
  });
47
82
  nModule.setField(name, field);
48
- const MODULE_NAME = nModule.getName();
49
- log(`${MODULE_NAME}//${name} with ${fieldValidatorsCount} validators`);
83
+ log(
84
+ `${MODULE_NAME}//${name} with ${fieldValidatorsCount ?? 0}/${
85
+ field?.model?.validate?.length ?? 0
86
+ } validators`
87
+ );
88
+ this.registerFieldIfInsecure(field, nModule, name);
89
+ notAppPostponedFieldsRegistrator.registerPostponedChildren(
90
+ nModule,
91
+ this,
92
+ MODULE_NAME,
93
+ `${MODULE_NAME}//${name}`
94
+ );
50
95
  }
51
96
 
52
- findValidatorsFile(name, fromPath, possible_extensions = [".js", ".cjs"]) {
97
+ static registerFieldIfInsecure(field, nModule, name) {
98
+ if (
99
+ field.model &&
100
+ (!field.model.validate || field.model.validate.length === 0)
101
+ ) {
102
+ notAppPostponedFieldsRegistrator.registerInsecureField(
103
+ `${nModule.getName()}//${name}`
104
+ );
105
+ }
106
+ }
107
+
108
+ static findValidatorsFile(
109
+ name,
110
+ fromPath,
111
+ possible_extensions = [".js", ".cjs", ".mjs"]
112
+ ) {
53
113
  for (let ext of possible_extensions) {
54
114
  const validatorName = path.join(fromPath, "validators", name + ext);
55
115
  if (tryFile(validatorName)) {
@@ -62,14 +122,14 @@ module.exports = class notModuleRegistratorFields {
62
122
  /**
63
123
  *
64
124
  **/
65
- extendByFrontValidators({ name, field, fromPath }) {
125
+ static extendByFrontValidators({ name, field, fromPath }) {
66
126
  if (!(field && objHas(field, "model"))) {
67
127
  return;
68
128
  }
69
129
  //load validators
70
130
  const validatorName = this.findValidatorsFile(name, fromPath);
71
131
  if (!validatorName) {
72
- return;
132
+ return field?.model?.validate?.length;
73
133
  }
74
134
  const validators = notModuleRegistratorFields.openFile(validatorName);
75
135
  //inject into field.model
@@ -86,7 +146,7 @@ module.exports = class notModuleRegistratorFields {
86
146
  * @param {import('../module')} input.nModule
87
147
  * @param {string} input.srcDir
88
148
  **/
89
- findAll({ nModule, srcDir }) {
149
+ static findAll({ nModule, srcDir }) {
90
150
  fs.readdirSync(srcDir).forEach((file) => {
91
151
  let fromPath = path.join(srcDir, file);
92
152
  if (!tryFile(fromPath)) {
@@ -103,7 +163,7 @@ module.exports = class notModuleRegistratorFields {
103
163
  * @param {import('../module')} input.nModule
104
164
  * @param {string} input.fromPath
105
165
  */
106
- register({ nModule, fromPath }) {
166
+ static register({ nModule, fromPath }) {
107
167
  let file = notModuleRegistratorFields.openFile(fromPath);
108
168
  if (file && objHas(file, "FIELDS")) {
109
169
  //collection
@@ -0,0 +1,194 @@
1
+ const path = require("path");
2
+ const getApp = require("../../getApp");
3
+ const { mutateField } = require("../../fields");
4
+ const { log } = require("not-log")(module, "register//fields.postponed");
5
+
6
+ /**
7
+ * @typedef {object} WaitingField
8
+ * @property {string} moduleName
9
+ * @property {string} pathToField
10
+ */
11
+
12
+ class notAppPostponedFieldsRegistrator {
13
+ /**
14
+ *
15
+ * @static
16
+ * @property {Object<strin, WaitingField>}
17
+ * @memberof notModuleRegistratorFields
18
+ */
19
+ static #waitingList = {};
20
+ static #insecureList = [];
21
+
22
+ /**
23
+ *
24
+ *
25
+ * @static
26
+ * @param {string} parentFieldName full path to field not-module-name//not-field-name
27
+ * @param {string} moduleName not-module-name
28
+ * @param {string} pathToField path to field file
29
+ * @memberof notModuleRegistratorFields
30
+ */
31
+ static add(parentFieldName, moduleName, pathToField) {
32
+ const parts = path.parse(pathToField);
33
+ log(
34
+ `field ${parentFieldName} not registered yet, field ${moduleName}//${parts.name} postponed`
35
+ );
36
+ if (!Object.hasOwn(this.#waitingList, parentFieldName)) {
37
+ this.#waitingList[parentFieldName] = [];
38
+ }
39
+ this.#waitingList[parentFieldName].push({
40
+ moduleName,
41
+ pathToField,
42
+ });
43
+ }
44
+
45
+ /**
46
+ *
47
+ *
48
+ * @static
49
+ * @param {string} parentFieldName full path to field not-module-name//not-field-name
50
+ * @return {Array<WaitingField>}
51
+ * @memberof notModuleRegistratorFields
52
+ */
53
+ static getChildren(parentFieldName) {
54
+ if (Object.hasOwn(this.#waitingList, parentFieldName)) {
55
+ return this.#waitingList[parentFieldName];
56
+ } else {
57
+ return [];
58
+ }
59
+ }
60
+
61
+ /**
62
+ * Removes all records of waiting registration fields
63
+ * @static
64
+ * @param {string} parentFieldName full path to field not-module-name//not-field-name
65
+ * @memberof notAppPostponedFieldsRegistrator
66
+ */
67
+ static clearList(parentFieldName) {
68
+ if (Object.hasOwn(this.#waitingList, parentFieldName)) {
69
+ delete this.#waitingList[parentFieldName];
70
+ }
71
+ }
72
+
73
+ static findParentField(fielName, nModule) {
74
+ const [parentFieldModule, parentFieldName] = fielName.split("//");
75
+ if (parentFieldModule === nModule.getName()) {
76
+ return nModule.getField(parentFieldName);
77
+ } else {
78
+ return getApp().getField(fielName);
79
+ }
80
+ }
81
+
82
+ /**
83
+ * If parent fields exists in childField description and
84
+ * parent field is not registered yet - returns true
85
+ *
86
+ * @static
87
+ * @param {import('../../types').notField} childField
88
+ * @return {boolean}
89
+ * @memberof notAppPostponedFieldsRegistrator
90
+ */
91
+ static fieldShouldBePostponed(childField, nModule) {
92
+ if (Object.hasOwn(childField, "parent")) {
93
+ if (
94
+ childField.parent &&
95
+ typeof childField.parent === "string" &&
96
+ childField.parent.length > 4 &&
97
+ childField.parent.indexOf("//") > 0
98
+ ) {
99
+ const parentField = this.findParentField(
100
+ childField.parent,
101
+ nModule
102
+ );
103
+ if (!parentField) {
104
+ return true;
105
+ }
106
+ }
107
+ }
108
+ return false;
109
+ }
110
+
111
+ /**
112
+ * Returns lib of parent fields and depending fields paths that wasnt resolved
113
+ *
114
+ * @static
115
+ * @return {Object<[string], Array<string>>}
116
+ * @memberof notAppPostponedFieldsRegistrator
117
+ */
118
+ static state() {
119
+ return {
120
+ unresolved: this.getStateUnresolved(),
121
+ insecure: this.getStateInsecure(),
122
+ };
123
+ }
124
+
125
+ static getStateUnresolved() {
126
+ const result = {};
127
+ Object.keys(this.#waitingList).forEach((parentField) => {
128
+ result[parentField] = this.#waitingList[parentField].map(
129
+ (itm) => itm.pathToField
130
+ );
131
+ });
132
+ return result;
133
+ }
134
+
135
+ static getStateInsecure() {
136
+ return this.#insecureList;
137
+ }
138
+
139
+ static registerInsecureField(fullFieldName) {
140
+ this.#insecureList.push(fullFieldName);
141
+ }
142
+
143
+ /**
144
+ *
145
+ *
146
+ * @static
147
+ * @param {import('./fields')} registrator
148
+ * @param {string} MODULE_NAME
149
+ * @param {string} fullFieldName
150
+ * @memberof notAppPostponedFieldsRegistrator
151
+ */
152
+ static registerPostponedChildren(
153
+ nModuleNotRegistred,
154
+ registrator,
155
+ MODULE_NAME,
156
+ fullFieldName
157
+ ) {
158
+ const list = this.getChildren(fullFieldName);
159
+
160
+ if (list.length) {
161
+ const nModule =
162
+ (getApp && getApp().getModule(MODULE_NAME)) ||
163
+ nModuleNotRegistred;
164
+ log(
165
+ `running registration of fields (${list.length}) derived from ${fullFieldName}`
166
+ );
167
+ list.forEach((childField) => {
168
+ const fieldFile = registrator.reopenCached(
169
+ childField.pathToField
170
+ );
171
+ const resultedField = this.mutateOriginal(
172
+ fullFieldName,
173
+ nModule,
174
+ fieldFile
175
+ );
176
+ const parts = path.parse(childField.pathToField);
177
+ registrator.registerField({
178
+ nModule,
179
+ name: parts.name, //fields name
180
+ field: resultedField, //field description
181
+ fromPath: childField.pathToField,
182
+ });
183
+ });
184
+ }
185
+ this.clearList(fullFieldName);
186
+ }
187
+
188
+ static mutateOriginal(fullFieldName, nModule, mutator) {
189
+ const parentField = this.findParentField(fullFieldName, nModule);
190
+ return mutateField(parentField, mutator);
191
+ }
192
+ }
193
+
194
+ module.exports = notAppPostponedFieldsRegistrator;
@@ -5,11 +5,7 @@ const { tryFile } = require("../../common");
5
5
  module.exports = class notModuleRegistratorForms {
6
6
  static openFile = require;
7
7
 
8
- constructor({ nModule }) {
9
- this.run({ nModule });
10
- }
11
-
12
- run({ nModule }) {
8
+ static run({ nModule }) {
13
9
  const srcDir = notModuleRegistratorForms.getPath(nModule);
14
10
  if (!srcDir) {
15
11
  return false;
@@ -31,7 +27,7 @@ module.exports = class notModuleRegistratorForms {
31
27
  * @param {string} input.srcDir
32
28
  * @param {import('../module')} input.nModule
33
29
  **/
34
- findAll({ nModule, srcDir }) {
30
+ static findAll({ nModule, srcDir }) {
35
31
  fs.readdirSync(srcDir).forEach((file) => {
36
32
  let fromPath = path.join(srcDir, file);
37
33
  if (!tryFile(fromPath)) {
@@ -41,7 +37,7 @@ module.exports = class notModuleRegistratorForms {
41
37
  });
42
38
  }
43
39
 
44
- register({ nModule, fromPath }) {
40
+ static register({ nModule, fromPath }) {
45
41
  const Form = notModuleRegistratorForms.openFile(fromPath);
46
42
  const parts = path.parse(fromPath);
47
43
  nModule.setFormConstructor(parts.name, Form);
@@ -2,17 +2,13 @@ const log = require("not-log")(module, "registrator");
2
2
  const notLocale = require("not-locale");
3
3
 
4
4
  module.exports = class notModuleRegistratorLocales {
5
- constructor({ nModule }) {
6
- this.run({ nModule });
7
- }
8
-
9
5
  /**
10
6
  *
11
7
  * @param {object} input
12
8
  * @param {import('../module')} input.nModule
13
9
  * @return {boolean}
14
10
  */
15
- run({ nModule }) {
11
+ static run({ nModule }) {
16
12
  const srcDir = notModuleRegistratorLocales.getPath(nModule);
17
13
  if (!srcDir) {
18
14
  return false;
@@ -20,11 +20,7 @@ const LOGIC_BINDINGS_LIST = [
20
20
  module.exports = class notModuleRegistratorLogics {
21
21
  static openFile = require;
22
22
 
23
- constructor({ nModule }) {
24
- this.run({ nModule });
25
- }
26
-
27
- run({ nModule }) {
23
+ static run({ nModule }) {
28
24
  const srcDir = notModuleRegistratorLogics.getPath(nModule);
29
25
  if (!srcDir) {
30
26
  return false;
@@ -47,7 +43,7 @@ module.exports = class notModuleRegistratorLogics {
47
43
  * @param {import('../module')} input.nModule
48
44
  * @param {string} input.srcDir
49
45
  **/
50
- findAll({ nModule, srcDir }) {
46
+ static findAll({ nModule, srcDir }) {
51
47
  fs.readdirSync(srcDir).forEach((file) => {
52
48
  let fromPath = path.join(srcDir, file);
53
49
  //log.info(`Checking logic in ${fromPath}`);
@@ -58,7 +54,7 @@ module.exports = class notModuleRegistratorLogics {
58
54
  });
59
55
  }
60
56
 
61
- register({ nModule, fromPath, file }) {
57
+ static register({ nModule, fromPath, file }) {
62
58
  const logic = notModuleRegistratorLogics.openFile(fromPath);
63
59
  const logicName = notModuleRegistratorLogics.getName({ logic, file });
64
60
  this.extend({ nModule, logic, logicName, fromPath });
@@ -66,7 +62,7 @@ module.exports = class notModuleRegistratorLogics {
66
62
  //log.info(`${logicName}`);
67
63
  }
68
64
 
69
- extend({ nModule, logic, logicName, fromPath }) {
65
+ static extend({ nModule, logic, logicName, fromPath }) {
70
66
  logic.filename = fromPath;
71
67
  if (nModule.appIsSet()) {
72
68
  mapBind(nModule.getApp(), logic, LOGIC_BINDINGS_LIST);
@@ -17,11 +17,8 @@ const MODEL_BINDINGS_LIST = [
17
17
 
18
18
  module.exports = class notModuleRegistratorModels {
19
19
  static openFile = require;
20
- constructor({ nModule }) {
21
- this.run({ nModule });
22
- }
23
20
 
24
- run({ nModule }) {
21
+ static run({ nModule }) {
25
22
  const srcDir = notModuleRegistratorModels.getPath(nModule);
26
23
  if (!srcDir) {
27
24
  return false;
@@ -44,7 +41,7 @@ module.exports = class notModuleRegistratorModels {
44
41
  * @param {import('../module')} input.nModule
45
42
  * @param {string} input.srcDir
46
43
  **/
47
- findAll({ nModule, srcDir }) {
44
+ static findAll({ nModule, srcDir }) {
48
45
  fs.readdirSync(srcDir).forEach((file) => {
49
46
  let fromPath = path.join(srcDir, file);
50
47
  //log.info(`Checking model in ${fromPath}`);
@@ -55,7 +52,7 @@ module.exports = class notModuleRegistratorModels {
55
52
  });
56
53
  }
57
54
 
58
- register({ nModule, fromPath, file }) {
55
+ static register({ nModule, fromPath, file }) {
59
56
  const model = notModuleRegistratorModels.openFile(fromPath);
60
57
  const modelName = notModuleRegistratorModels.getName({ model, file });
61
58
  this.extend({ nModule, model, modelName, fromPath });
@@ -63,7 +60,7 @@ module.exports = class notModuleRegistratorModels {
63
60
  //log.info(`${modelName}`);
64
61
  }
65
62
 
66
- extend({ nModule, model, modelName, fromPath }) {
63
+ static extend({ nModule, model, modelName, fromPath }) {
67
64
  model.filename = fromPath;
68
65
  if (nModule.appIsSet()) {
69
66
  mapBind(nModule.getApp(), model, MODEL_BINDINGS_LIST);
@@ -45,11 +45,7 @@ const ROUTE_BINDINGS_LIST = [
45
45
  module.exports = class notModuleRegistratorRoutes {
46
46
  static openFile = require;
47
47
 
48
- constructor({ nModule }) {
49
- this.run({ nModule });
50
- }
51
-
52
- run({ nModule }) {
48
+ static run({ nModule }) {
53
49
  const srcDir = notModuleRegistratorRoutes.getPath(nModule);
54
50
  if (!srcDir) {
55
51
  return false;
@@ -72,13 +68,13 @@ module.exports = class notModuleRegistratorRoutes {
72
68
  * @param {import('../module')} input.nModule
73
69
  * @param {string} input.srcDir
74
70
  **/
75
- findAll({ nModule, srcDir }) {
71
+ static findAll({ nModule, srcDir }) {
76
72
  fs.readdirSync(srcDir).forEach((file) =>
77
73
  this.findOne({ nModule, file, srcDir })
78
74
  );
79
75
  }
80
76
 
81
- getFileBasename(file, possible_extensions = []) {
77
+ static getFileBasename(file, possible_extensions = []) {
82
78
  for (let ext of possible_extensions) {
83
79
  if (file.indexOf(ext) !== -1) {
84
80
  return file.substr(0, file.indexOf(ext));
@@ -87,7 +83,7 @@ module.exports = class notModuleRegistratorRoutes {
87
83
  return false;
88
84
  }
89
85
 
90
- findOne({ nModule, srcDir, file }) {
86
+ static findOne({ nModule, srcDir, file }) {
91
87
  try {
92
88
  //если имя похоже на название манифеста
93
89
  const routeBasename = this.getFileBasename(
@@ -171,7 +167,7 @@ module.exports = class notModuleRegistratorRoutes {
171
167
  return false;
172
168
  }
173
169
 
174
- registerManifestAndRoutes({
170
+ static registerManifestAndRoutes({
175
171
  nModule,
176
172
  routeName,
177
173
  routeManifest,
@@ -195,7 +191,7 @@ module.exports = class notModuleRegistratorRoutes {
195
191
  }
196
192
  }
197
193
 
198
- registerRoute({ nModule, route, routeName }) {
194
+ static registerRoute({ nModule, route, routeName }) {
199
195
  nModule.setRoute(route.thisRouteName, route);
200
196
  if (nModule.appIsSet()) {
201
197
  mapBind(nModule.getApp(), route, ROUTE_BINDINGS_LIST);
@@ -204,8 +200,8 @@ module.exports = class notModuleRegistratorRoutes {
204
200
  route.getThisModule = () => nModule;
205
201
  }
206
202
 
207
- registerWSRoute({ nModule, wsRoute }) {
208
- new notModuleRegistratorRoutesWS({
203
+ static registerWSRoute({ nModule, wsRoute }) {
204
+ notModuleRegistratorRoutesWS.run({
209
205
  nModule,
210
206
  wsRoute: wsRoute,
211
207
  wsRouteName: wsRoute.thisRouteName,