ee-core 2.9.2-beta.1 → 2.10.0

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.
Files changed (103) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +65 -65
  3. package/addon/index.js +34 -34
  4. package/addon/window/index.js +98 -98
  5. package/bin/tools.js +8 -8
  6. package/config/cache.js +41 -38
  7. package/config/config.default.js +331 -330
  8. package/config/index.js +75 -73
  9. package/const/channel.js +17 -17
  10. package/const/index.js +8 -8
  11. package/controller/baseContextClass.js +34 -34
  12. package/controller/index.js +34 -34
  13. package/core/index.js +10 -10
  14. package/core/lib/ee.js +216 -216
  15. package/core/lib/loader/context_loader.js +106 -106
  16. package/core/lib/loader/ee_loader.js +435 -435
  17. package/core/lib/loader/file_loader.js +326 -326
  18. package/core/lib/loader/mixin/addon.js +32 -32
  19. package/core/lib/loader/mixin/config.js +130 -130
  20. package/core/lib/loader/mixin/controller.js +125 -125
  21. package/core/lib/loader/mixin/service.js +28 -28
  22. package/core/lib/utils/base_context_class.js +34 -34
  23. package/core/lib/utils/function.js +30 -30
  24. package/core/lib/utils/index.js +133 -133
  25. package/core/lib/utils/sequencify.js +59 -59
  26. package/core/lib/utils/timing.js +77 -77
  27. package/cross/index.js +183 -183
  28. package/cross/spawnProcess.js +183 -183
  29. package/ee/appLoader.js +48 -48
  30. package/ee/application.js +99 -99
  31. package/ee/baseApp.js +103 -102
  32. package/ee/eeApp.js +408 -408
  33. package/ee/index.js +57 -57
  34. package/electron/app/index.js +64 -58
  35. package/electron/index.js +19 -19
  36. package/electron/window/index.js +73 -73
  37. package/electron/window/winState.js +186 -186
  38. package/exception/index.js +112 -112
  39. package/html/boot.html +98 -98
  40. package/html/cross-failure.html +28 -28
  41. package/html/failure.html +28 -28
  42. package/html/index.js +13 -13
  43. package/httpclient/index.js +161 -161
  44. package/index.js +54 -54
  45. package/jobs/baseJobClass.js +16 -16
  46. package/jobs/child/app.js +65 -65
  47. package/jobs/child/forkProcess.js +145 -145
  48. package/jobs/child/index.js +82 -82
  49. package/jobs/child-pool/index.js +213 -213
  50. package/jobs/index.js +8 -8
  51. package/jobs/load-balancer/algorithm/index.js +11 -11
  52. package/jobs/load-balancer/algorithm/minimumConnection.js +18 -18
  53. package/jobs/load-balancer/algorithm/polling.js +11 -11
  54. package/jobs/load-balancer/algorithm/random.js +9 -9
  55. package/jobs/load-balancer/algorithm/specify.js +14 -14
  56. package/jobs/load-balancer/algorithm/weights.js +21 -21
  57. package/jobs/load-balancer/algorithm/weightsMinimumConnection.js +29 -29
  58. package/jobs/load-balancer/algorithm/weightsPolling.js +22 -22
  59. package/jobs/load-balancer/algorithm/weightsRandom.js +16 -16
  60. package/jobs/load-balancer/consts.js +9 -9
  61. package/jobs/load-balancer/index.js +201 -201
  62. package/jobs/load-balancer/scheduler.js +31 -31
  63. package/jobs/renderer/index.js +141 -141
  64. package/jobs/renderer/loadView.js +40 -40
  65. package/jobs/unification.js +63 -63
  66. package/loader/index.js +172 -172
  67. package/log/index.js +68 -68
  68. package/log/logger.js +86 -80
  69. package/main/index.js +56 -56
  70. package/message/childMessage.js +54 -54
  71. package/message/index.js +18 -18
  72. package/old-utils/index.js +91 -91
  73. package/package.json +38 -38
  74. package/ps/index.js +371 -371
  75. package/services/baseContextClass.js +34 -34
  76. package/services/index.js +40 -40
  77. package/socket/httpServer.js +147 -147
  78. package/socket/index.js +81 -81
  79. package/socket/io.js +27 -27
  80. package/socket/ipcServer.js +112 -112
  81. package/socket/socketServer.js +69 -65
  82. package/storage/index.js +38 -38
  83. package/storage/jsondb/adapters/Base.js +23 -23
  84. package/storage/jsondb/adapters/FileSync.js +64 -52
  85. package/storage/jsondb/main.js +55 -42
  86. package/storage/jsondbStorage.js +195 -195
  87. package/storage/sqliteStorage.js +123 -123
  88. package/utils/co.js +237 -237
  89. package/utils/copyto.js +160 -160
  90. package/utils/depd/index.js +538 -538
  91. package/utils/depd/lib/browser/index.js +77 -77
  92. package/utils/extend.js +73 -73
  93. package/utils/get-port/index.d.ts +64 -64
  94. package/utils/get-port/index.js +148 -148
  95. package/utils/helper.js +220 -220
  96. package/utils/index.js +160 -160
  97. package/utils/ip.js +261 -261
  98. package/utils/is.js +145 -145
  99. package/utils/json.js +72 -72
  100. package/utils/pargv.js +263 -263
  101. package/utils/time/index.js +19 -19
  102. package/utils/time/ms.js +162 -162
  103. package/utils/wrap.js +35 -35
@@ -1,77 +1,77 @@
1
- /*!
2
- * depd
3
- * Copyright(c) 2015 Douglas Christopher Wilson
4
- * MIT Licensed
5
- */
6
-
7
- 'use strict'
8
-
9
- /**
10
- * Module exports.
11
- * @public
12
- */
13
-
14
- module.exports = depd
15
-
16
- /**
17
- * Create deprecate for namespace in caller.
18
- */
19
-
20
- function depd (namespace) {
21
- if (!namespace) {
22
- throw new TypeError('argument namespace is required')
23
- }
24
-
25
- function deprecate (message) {
26
- // no-op in browser
27
- }
28
-
29
- deprecate._file = undefined
30
- deprecate._ignored = true
31
- deprecate._namespace = namespace
32
- deprecate._traced = false
33
- deprecate._warned = Object.create(null)
34
-
35
- deprecate.function = wrapfunction
36
- deprecate.property = wrapproperty
37
-
38
- return deprecate
39
- }
40
-
41
- /**
42
- * Return a wrapped function in a deprecation message.
43
- *
44
- * This is a no-op version of the wrapper, which does nothing but call
45
- * validation.
46
- */
47
-
48
- function wrapfunction (fn, message) {
49
- if (typeof fn !== 'function') {
50
- throw new TypeError('argument fn must be a function')
51
- }
52
-
53
- return fn
54
- }
55
-
56
- /**
57
- * Wrap property in a deprecation message.
58
- *
59
- * This is a no-op version of the wrapper, which does nothing but call
60
- * validation.
61
- */
62
-
63
- function wrapproperty (obj, prop, message) {
64
- if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
65
- throw new TypeError('argument obj must be object')
66
- }
67
-
68
- var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
69
-
70
- if (!descriptor) {
71
- throw new TypeError('must call property on owner object')
72
- }
73
-
74
- if (!descriptor.configurable) {
75
- throw new TypeError('property must be configurable')
76
- }
77
- }
1
+ /*!
2
+ * depd
3
+ * Copyright(c) 2015 Douglas Christopher Wilson
4
+ * MIT Licensed
5
+ */
6
+
7
+ 'use strict'
8
+
9
+ /**
10
+ * Module exports.
11
+ * @public
12
+ */
13
+
14
+ module.exports = depd
15
+
16
+ /**
17
+ * Create deprecate for namespace in caller.
18
+ */
19
+
20
+ function depd (namespace) {
21
+ if (!namespace) {
22
+ throw new TypeError('argument namespace is required')
23
+ }
24
+
25
+ function deprecate (message) {
26
+ // no-op in browser
27
+ }
28
+
29
+ deprecate._file = undefined
30
+ deprecate._ignored = true
31
+ deprecate._namespace = namespace
32
+ deprecate._traced = false
33
+ deprecate._warned = Object.create(null)
34
+
35
+ deprecate.function = wrapfunction
36
+ deprecate.property = wrapproperty
37
+
38
+ return deprecate
39
+ }
40
+
41
+ /**
42
+ * Return a wrapped function in a deprecation message.
43
+ *
44
+ * This is a no-op version of the wrapper, which does nothing but call
45
+ * validation.
46
+ */
47
+
48
+ function wrapfunction (fn, message) {
49
+ if (typeof fn !== 'function') {
50
+ throw new TypeError('argument fn must be a function')
51
+ }
52
+
53
+ return fn
54
+ }
55
+
56
+ /**
57
+ * Wrap property in a deprecation message.
58
+ *
59
+ * This is a no-op version of the wrapper, which does nothing but call
60
+ * validation.
61
+ */
62
+
63
+ function wrapproperty (obj, prop, message) {
64
+ if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
65
+ throw new TypeError('argument obj must be object')
66
+ }
67
+
68
+ var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
69
+
70
+ if (!descriptor) {
71
+ throw new TypeError('must call property on owner object')
72
+ }
73
+
74
+ if (!descriptor.configurable) {
75
+ throw new TypeError('property must be configurable')
76
+ }
77
+ }
package/utils/extend.js CHANGED
@@ -1,73 +1,73 @@
1
- 'use strict';
2
-
3
- var hasOwn = Object.prototype.hasOwnProperty;
4
- var toStr = Object.prototype.toString;
5
-
6
- var isPlainObject = function isPlainObject(obj) {
7
- if (!obj || toStr.call(obj) !== '[object Object]') {
8
- return false;
9
- }
10
-
11
- var hasOwnConstructor = hasOwn.call(obj, 'constructor');
12
- var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
13
- // Not own constructor property must be Object
14
- if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
15
- return false;
16
- }
17
-
18
- // Own properties are enumerated firstly, so to speed up,
19
- // if last one is own, then all properties are own.
20
- var key;
21
- for (key in obj) { /**/ }
22
-
23
- return typeof key === 'undefined' || hasOwn.call(obj, key);
24
- };
25
-
26
- module.exports = function extend() {
27
- var options, name, src, copy, copyIsArray, clone;
28
- var target = arguments[0];
29
- var i = 1;
30
- var length = arguments.length;
31
- var deep = false;
32
-
33
- // Handle a deep copy situation
34
- if (typeof target === 'boolean') {
35
- deep = target;
36
- target = arguments[1] || {};
37
- // skip the boolean and the target
38
- i = 2;
39
- } else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) {
40
- target = {};
41
- }
42
-
43
- for (; i < length; ++i) {
44
- options = arguments[i];
45
- // Only deal with non-null/undefined values
46
- if (options == null) continue;
47
-
48
- // Extend the base object
49
- for (name in options) {
50
- if (name === '__proto__') continue;
51
-
52
- src = target[name];
53
- copy = options[name];
54
-
55
- // Prevent never-ending loop
56
- if (target === copy) continue;
57
-
58
- // Recurse if we're merging plain objects
59
- if (deep && copy && isPlainObject(copy)) {
60
- clone = src && isPlainObject(src) ? src : {};
61
- // Never move original objects, clone them
62
- target[name] = extend(deep, clone, copy);
63
-
64
- // Don't bring in undefined values
65
- } else if (typeof copy !== 'undefined') {
66
- target[name] = copy;
67
- }
68
- }
69
- }
70
-
71
- // Return the modified object
72
- return target;
73
- };
1
+ 'use strict';
2
+
3
+ var hasOwn = Object.prototype.hasOwnProperty;
4
+ var toStr = Object.prototype.toString;
5
+
6
+ var isPlainObject = function isPlainObject(obj) {
7
+ if (!obj || toStr.call(obj) !== '[object Object]') {
8
+ return false;
9
+ }
10
+
11
+ var hasOwnConstructor = hasOwn.call(obj, 'constructor');
12
+ var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
13
+ // Not own constructor property must be Object
14
+ if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
15
+ return false;
16
+ }
17
+
18
+ // Own properties are enumerated firstly, so to speed up,
19
+ // if last one is own, then all properties are own.
20
+ var key;
21
+ for (key in obj) { /**/ }
22
+
23
+ return typeof key === 'undefined' || hasOwn.call(obj, key);
24
+ };
25
+
26
+ module.exports = function extend() {
27
+ var options, name, src, copy, copyIsArray, clone;
28
+ var target = arguments[0];
29
+ var i = 1;
30
+ var length = arguments.length;
31
+ var deep = false;
32
+
33
+ // Handle a deep copy situation
34
+ if (typeof target === 'boolean') {
35
+ deep = target;
36
+ target = arguments[1] || {};
37
+ // skip the boolean and the target
38
+ i = 2;
39
+ } else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) {
40
+ target = {};
41
+ }
42
+
43
+ for (; i < length; ++i) {
44
+ options = arguments[i];
45
+ // Only deal with non-null/undefined values
46
+ if (options == null) continue;
47
+
48
+ // Extend the base object
49
+ for (name in options) {
50
+ if (name === '__proto__') continue;
51
+
52
+ src = target[name];
53
+ copy = options[name];
54
+
55
+ // Prevent never-ending loop
56
+ if (target === copy) continue;
57
+
58
+ // Recurse if we're merging plain objects
59
+ if (deep && copy && isPlainObject(copy)) {
60
+ clone = src && isPlainObject(src) ? src : {};
61
+ // Never move original objects, clone them
62
+ target[name] = extend(deep, clone, copy);
63
+
64
+ // Don't bring in undefined values
65
+ } else if (typeof copy !== 'undefined') {
66
+ target[name] = copy;
67
+ }
68
+ }
69
+ }
70
+
71
+ // Return the modified object
72
+ return target;
73
+ };
@@ -1,64 +1,64 @@
1
- /// <reference types="node"/>
2
- import {ListenOptions} from 'net';
3
-
4
- declare namespace getPort {
5
- interface Options extends Omit<ListenOptions, 'port'> {
6
- /**
7
- A preferred port or an iterable of preferred ports to use.
8
- */
9
- readonly port?: number | Iterable<number>;
10
-
11
- /**
12
- The host on which port resolution should be performed. Can be either an IPv4 or IPv6 address.
13
- */
14
- readonly host?: string;
15
- }
16
- }
17
-
18
- declare const getPort: {
19
- /**
20
- Get an available TCP port number.
21
-
22
- @returns Port number.
23
-
24
- @example
25
- ```
26
- import getPort = require('get-port');
27
-
28
- (async () => {
29
- console.log(await getPort());
30
- //=> 51402
31
-
32
- // Pass in a preferred port
33
- console.log(await getPort({port: 3000}));
34
- // Will use 3000 if available, otherwise fall back to a random port
35
-
36
- // Pass in an array of preferred ports
37
- console.log(await getPort({port: [3000, 3001, 3002]}));
38
- // Will use any element in the preferred ports array if available, otherwise fall back to a random port
39
- })();
40
- ```
41
- */
42
- (options?: getPort.Options): Promise<number>;
43
-
44
- /**
45
- Make a range of ports `from`...`to`.
46
-
47
- @param from - First port of the range. Must be in the range `1024`...`65535`.
48
- @param to - Last port of the range. Must be in the range `1024`...`65535` and must be greater than `from`.
49
- @returns The ports in the range.
50
-
51
- @example
52
- ```
53
- import getPort = require('get-port');
54
-
55
- (async () => {
56
- console.log(await getPort({port: getPort.makeRange(3000, 3100)}));
57
- // Will use any port from 3000 to 3100, otherwise fall back to a random port
58
- })();
59
- ```
60
- */
61
- makeRange(from: number, to: number): Iterable<number>;
62
- };
63
-
64
- export = getPort;
1
+ /// <reference types="node"/>
2
+ import {ListenOptions} from 'net';
3
+
4
+ declare namespace getPort {
5
+ interface Options extends Omit<ListenOptions, 'port'> {
6
+ /**
7
+ A preferred port or an iterable of preferred ports to use.
8
+ */
9
+ readonly port?: number | Iterable<number>;
10
+
11
+ /**
12
+ The host on which port resolution should be performed. Can be either an IPv4 or IPv6 address.
13
+ */
14
+ readonly host?: string;
15
+ }
16
+ }
17
+
18
+ declare const getPort: {
19
+ /**
20
+ Get an available TCP port number.
21
+
22
+ @returns Port number.
23
+
24
+ @example
25
+ ```
26
+ import getPort = require('get-port');
27
+
28
+ (async () => {
29
+ console.log(await getPort());
30
+ //=> 51402
31
+
32
+ // Pass in a preferred port
33
+ console.log(await getPort({port: 3000}));
34
+ // Will use 3000 if available, otherwise fall back to a random port
35
+
36
+ // Pass in an array of preferred ports
37
+ console.log(await getPort({port: [3000, 3001, 3002]}));
38
+ // Will use any element in the preferred ports array if available, otherwise fall back to a random port
39
+ })();
40
+ ```
41
+ */
42
+ (options?: getPort.Options): Promise<number>;
43
+
44
+ /**
45
+ Make a range of ports `from`...`to`.
46
+
47
+ @param from - First port of the range. Must be in the range `1024`...`65535`.
48
+ @param to - Last port of the range. Must be in the range `1024`...`65535` and must be greater than `from`.
49
+ @returns The ports in the range.
50
+
51
+ @example
52
+ ```
53
+ import getPort = require('get-port');
54
+
55
+ (async () => {
56
+ console.log(await getPort({port: getPort.makeRange(3000, 3100)}));
57
+ // Will use any port from 3000 to 3100, otherwise fall back to a random port
58
+ })();
59
+ ```
60
+ */
61
+ makeRange(from: number, to: number): Iterable<number>;
62
+ };
63
+
64
+ export = getPort;